srcpack 0.1.2 → 0.1.4
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 +28 -25
- package/dist/bundle.d.ts +3 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +51027 -17210
- package/dist/config.d.ts +3 -3
- package/dist/gdrive.d.ts +17 -4
- package/dist/index.js +1515 -1514
- package/package.json +16 -5
- package/src/bundle.ts +52 -25
- package/src/cli.ts +105 -29
- package/src/config.ts +1 -1
- package/src/gdrive.ts +166 -24
- package/src/init.ts +2 -2
package/dist/config.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const BundleConfigSchema: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z
|
|
|
7
7
|
}, z.core.$strip>]>;
|
|
8
8
|
declare const UploadConfigSchema: z.ZodObject<{
|
|
9
9
|
provider: z.ZodLiteral<"gdrive">;
|
|
10
|
-
|
|
10
|
+
folderId: z.ZodOptional<z.ZodString>;
|
|
11
11
|
clientId: z.ZodString;
|
|
12
12
|
clientSecret: z.ZodString;
|
|
13
13
|
}, z.core.$strip>;
|
|
@@ -15,12 +15,12 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
15
15
|
outDir: z.ZodDefault<z.ZodString>;
|
|
16
16
|
upload: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
17
17
|
provider: z.ZodLiteral<"gdrive">;
|
|
18
|
-
|
|
18
|
+
folderId: z.ZodOptional<z.ZodString>;
|
|
19
19
|
clientId: z.ZodString;
|
|
20
20
|
clientSecret: z.ZodString;
|
|
21
21
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
22
22
|
provider: z.ZodLiteral<"gdrive">;
|
|
23
|
-
|
|
23
|
+
folderId: z.ZodOptional<z.ZodString>;
|
|
24
24
|
clientId: z.ZodString;
|
|
25
25
|
clientSecret: z.ZodString;
|
|
26
26
|
}, z.core.$strip>>]>>;
|
package/dist/gdrive.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ export interface Tokens {
|
|
|
8
8
|
scope: string;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* Loads stored tokens
|
|
11
|
+
* Loads stored tokens for a specific OAuth client.
|
|
12
12
|
* Returns null if no tokens exist or they cannot be read.
|
|
13
13
|
*/
|
|
14
|
-
export declare function loadTokens(): Promise<Tokens | null>;
|
|
14
|
+
export declare function loadTokens(config: UploadConfig): Promise<Tokens | null>;
|
|
15
15
|
/**
|
|
16
|
-
* Removes stored tokens
|
|
16
|
+
* Removes stored tokens for a specific OAuth client.
|
|
17
17
|
*/
|
|
18
|
-
export declare function clearTokens(): Promise<void>;
|
|
18
|
+
export declare function clearTokens(config: UploadConfig): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Gets valid tokens, refreshing if necessary.
|
|
21
21
|
* Returns null if no tokens exist or refresh fails.
|
|
@@ -30,4 +30,17 @@ export declare function login(config: UploadConfig): Promise<Tokens>;
|
|
|
30
30
|
* Ensures we have valid tokens - loads existing or triggers login.
|
|
31
31
|
*/
|
|
32
32
|
export declare function ensureAuthenticated(config: UploadConfig): Promise<Tokens>;
|
|
33
|
+
export interface UploadResult {
|
|
34
|
+
fileId: string;
|
|
35
|
+
name: string;
|
|
36
|
+
webViewLink?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Uploads a file to Google Drive. Updates existing file if found with same name.
|
|
40
|
+
*/
|
|
41
|
+
export declare function uploadFile(filePath: string, config: UploadConfig): Promise<UploadResult>;
|
|
42
|
+
/**
|
|
43
|
+
* Uploads multiple files to Google Drive.
|
|
44
|
+
*/
|
|
45
|
+
export declare function uploadFiles(filePaths: string[], config: UploadConfig): Promise<UploadResult[]>;
|
|
33
46
|
export { OAuthError };
|