@secure-exec/google-drive 0.0.0-nathan-docs-sdk-expansion.c9c2e4e
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 +41 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +21 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
> **Preview** This package is in preview and may have breaking changes.
|
|
2
|
+
|
|
3
|
+
# @secure-exec/google-drive
|
|
4
|
+
|
|
5
|
+
Declarative Google Drive native mount helper for secure-exec VMs. This package keeps
|
|
6
|
+
the public helper surface on the TypeScript side while routing first-party
|
|
7
|
+
Google Drive-backed filesystems through the native `google_drive` sidecar
|
|
8
|
+
plugin.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { createGoogleDriveBackend } from "@secure-exec/google-drive";
|
|
14
|
+
|
|
15
|
+
export const googleDriveMount = {
|
|
16
|
+
path: "/data",
|
|
17
|
+
plugin: createGoogleDriveBackend({
|
|
18
|
+
credentials: {
|
|
19
|
+
clientEmail: "...",
|
|
20
|
+
privateKey: "...",
|
|
21
|
+
},
|
|
22
|
+
folderId: "your-google-drive-folder-id",
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Configuration
|
|
28
|
+
|
|
29
|
+
| Option | Type | Required | Description |
|
|
30
|
+
|--------|------|----------|-------------|
|
|
31
|
+
| `credentials` | `{ clientEmail: string; privateKey: string }` | Yes | Google service account credentials |
|
|
32
|
+
| `folderId` | `string` | Yes | Google Drive folder ID where blocks are stored |
|
|
33
|
+
| `keyPrefix` | `string` | No | Optional prefix for the persisted manifest and block file names |
|
|
34
|
+
| `chunkSize` | `number` | No | Optional persisted block chunk size used by the native plugin |
|
|
35
|
+
| `inlineThreshold` | `number` | No | Optional maximum inline file size stored in the manifest before chunking |
|
|
36
|
+
|
|
37
|
+
## Rate Limits
|
|
38
|
+
|
|
39
|
+
Google Drive API has a rate limit of approximately 10 queries/sec/user. Heavy
|
|
40
|
+
I/O workloads may experience throttling. Consider larger `chunkSize` values for
|
|
41
|
+
write-heavy workloads so the native plugin emits fewer Drive API calls.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { MountConfigJsonObject, NativeMountPluginDescriptor } from "@secure-exec/core/descriptors";
|
|
2
|
+
export type GoogleDriveCredentials = MountConfigJsonObject & {
|
|
3
|
+
clientEmail: string;
|
|
4
|
+
privateKey: string;
|
|
5
|
+
};
|
|
6
|
+
export interface GoogleDriveFsOptions {
|
|
7
|
+
credentials: GoogleDriveCredentials;
|
|
8
|
+
folderId: string;
|
|
9
|
+
keyPrefix?: string;
|
|
10
|
+
chunkSize?: number;
|
|
11
|
+
inlineThreshold?: number;
|
|
12
|
+
}
|
|
13
|
+
export type GoogleDriveMountPluginConfig = MountConfigJsonObject & {
|
|
14
|
+
credentials: GoogleDriveCredentials;
|
|
15
|
+
folderId: string;
|
|
16
|
+
keyPrefix?: string;
|
|
17
|
+
chunkSize?: number;
|
|
18
|
+
inlineThreshold?: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Create a declarative Google Drive native mount descriptor.
|
|
22
|
+
*
|
|
23
|
+
* This keeps the package on the public mount-helper surface while routing
|
|
24
|
+
* first-party Google Drive-backed filesystems through the native
|
|
25
|
+
* `google_drive` plugin instead of a TypeScript runtime package.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createGoogleDriveBackend(options: GoogleDriveFsOptions): NativeMountPluginDescriptor<GoogleDriveMountPluginConfig>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a declarative Google Drive native mount descriptor.
|
|
3
|
+
*
|
|
4
|
+
* This keeps the package on the public mount-helper surface while routing
|
|
5
|
+
* first-party Google Drive-backed filesystems through the native
|
|
6
|
+
* `google_drive` plugin instead of a TypeScript runtime package.
|
|
7
|
+
*/
|
|
8
|
+
export function createGoogleDriveBackend(options) {
|
|
9
|
+
return {
|
|
10
|
+
id: "google_drive",
|
|
11
|
+
config: {
|
|
12
|
+
credentials: options.credentials,
|
|
13
|
+
folderId: options.folderId,
|
|
14
|
+
...(options.keyPrefix ? { keyPrefix: options.keyPrefix } : {}),
|
|
15
|
+
...(options.chunkSize != null ? { chunkSize: options.chunkSize } : {}),
|
|
16
|
+
...(options.inlineThreshold != null
|
|
17
|
+
? { inlineThreshold: options.inlineThreshold }
|
|
18
|
+
: {}),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@secure-exec/google-drive",
|
|
3
|
+
"version": "0.0.0-nathan-docs-sdk-expansion.c9c2e4e",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"beta": true,
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"check-types": "tsc --noEmit",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"test": "vitest run"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@secure-exec/core": "0.0.0-nathan-docs-sdk-expansion.c9c2e4e"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^22.10.2",
|
|
29
|
+
"typescript": "^5.7.2",
|
|
30
|
+
"vitest": "^2.1.8"
|
|
31
|
+
}
|
|
32
|
+
}
|