@ultrst-armada/kloks 1.26.6 → 2.0.1
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/package.json +3 -7
- package/packages/backend/dist/{chunk-BVXGUHLZ.js → chunk-AOZSDRNY.js} +1 -1
- package/packages/backend/dist/chunk-G4EDIAHW.js +0 -0
- package/packages/backend/dist/{chunk-T6BJHFWZ.js → chunk-LMOM7CST.js} +2 -2
- package/packages/backend/dist/chunk-OQRQCDS6.js +109 -0
- package/packages/backend/dist/chunk-OWMQLML7.js +451 -0
- package/packages/backend/dist/{chunk-Y5ENDXU2.js → chunk-SQKG3S6P.js} +2 -10
- package/packages/backend/dist/{chunk-NGEB3CF5.js → chunk-Z6G32NQQ.js} +8 -3
- package/packages/backend/dist/core/SrklStorageService.test.d.ts +1 -0
- package/packages/backend/dist/krnl-services.js +5 -4
- package/packages/backend/dist/node.js +9 -21
- package/packages/backend/dist/services/node.js +4 -3
- package/packages/backend/dist/storage/GoogleDriveStorageService.d.ts +31 -9
- package/packages/backend/dist/storage/GoogleDriveWorkspaceService.d.ts +23 -6
- package/packages/backend/dist/storage/StorageAdapterFactory.d.ts +2 -2
- package/packages/backend/dist/storage/node.d.ts +0 -2
- package/packages/backend/dist/storage/node.js +5 -17
- package/packages/backend/dist/storage-workspace.js +4 -335
- package/packages/backend/dist/workspace/node.js +3 -2
- package/packages/backend/package.json +3 -7
- package/packages/client/dist/auth.d.ts +20 -1
- package/packages/client/dist/auth.js +13 -3
- package/packages/client/dist/chunk-5JMYSB7L.js +133 -0
- package/packages/client/dist/index.d.ts +1 -1
- package/packages/client/dist/index.js +13 -3
- package/packages/client/package.json +1 -1
- package/packages/state-graph/dist/browser.js +24 -24
- package/packages/state-graph/dist/index.js +24 -24
- package/packages/backend/dist/chunk-3FZSYSJC.js +0 -86
- package/packages/backend/dist/chunk-G7PPVOFP.js +0 -369
- package/packages/backend/dist/storage/GoogleDriveAdapter.d.ts +0 -41
- package/packages/backend/dist/storage/GoogleDriveOAuth.d.ts +0 -34
- package/packages/backend/dist/storage/googleDriveSdk.d.ts +0 -1
- package/packages/client/dist/chunk-B4WOPCRZ.js +0 -26
- package/packages/state-graph/dist/{chunk-YUJC367F.js → chunk-UKTICGGV.js} +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,18 +31,19 @@ import {
|
|
|
31
31
|
krnlWorkspaceGraphServiceFacade,
|
|
32
32
|
krnlWorkspaceServiceDefinition,
|
|
33
33
|
krnlWorkspaceServiceFacade
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LMOM7CST.js";
|
|
35
35
|
import "./chunk-FZKBTF34.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-AOZSDRNY.js";
|
|
37
|
+
import "./chunk-SQKG3S6P.js";
|
|
38
38
|
import "./chunk-JGUWYVOL.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-OQRQCDS6.js";
|
|
40
40
|
import "./chunk-KPLDYX5Z.js";
|
|
41
41
|
import "./chunk-JCMB7BIM.js";
|
|
42
42
|
import "./chunk-2COYZMUJ.js";
|
|
43
43
|
import "./chunk-HUY4272L.js";
|
|
44
44
|
import "./chunk-5F5V7NAG.js";
|
|
45
45
|
import "./chunk-4QEMALXF.js";
|
|
46
|
+
import "./chunk-OWMQLML7.js";
|
|
46
47
|
export {
|
|
47
48
|
AuthServiceDefinition,
|
|
48
49
|
AuthServiceFacade,
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
GOOGLE_DRIVE_FILE_SCOPE,
|
|
3
|
-
GOOGLE_DRIVE_STORAGE_SCOPE,
|
|
4
|
-
createGoogleDriveAuthorizationUrl,
|
|
5
|
-
exchangeGoogleDriveCode,
|
|
6
|
-
refreshGoogleDriveAccessToken
|
|
7
|
-
} from "./chunk-3FZSYSJC.js";
|
|
1
|
+
import "./chunk-G4EDIAHW.js";
|
|
8
2
|
import {
|
|
9
3
|
RemoteWorkspaceService,
|
|
10
4
|
SyncEngine,
|
|
@@ -19,7 +13,7 @@ import {
|
|
|
19
13
|
setWorkingWorkspaceConfig,
|
|
20
14
|
syncWorkspace,
|
|
21
15
|
workingWorkspaceService
|
|
22
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Z6G32NQQ.js";
|
|
23
17
|
import {
|
|
24
18
|
CompositeBackend,
|
|
25
19
|
EndpointGenerator,
|
|
@@ -179,18 +173,17 @@ import {
|
|
|
179
173
|
krnlWorkspaceGraphServiceFacade,
|
|
180
174
|
krnlWorkspaceServiceDefinition,
|
|
181
175
|
krnlWorkspaceServiceFacade
|
|
182
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-LMOM7CST.js";
|
|
183
177
|
import {
|
|
184
178
|
formatCanonicalWorkspaceFolderName,
|
|
185
179
|
sanitizeWorkspaceName
|
|
186
180
|
} from "./chunk-FZKBTF34.js";
|
|
187
181
|
import {
|
|
188
182
|
workspaceGraphService
|
|
189
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-AOZSDRNY.js";
|
|
190
184
|
import {
|
|
191
185
|
BackblazeB2Adapter,
|
|
192
186
|
BucketStorageService,
|
|
193
|
-
GoogleDriveStorageService,
|
|
194
187
|
LocalFSAdapter,
|
|
195
188
|
S3Adapter,
|
|
196
189
|
StorageAdapterFactory,
|
|
@@ -199,7 +192,7 @@ import {
|
|
|
199
192
|
permanentDeleteS3Folder,
|
|
200
193
|
permanentDeleteS3Object,
|
|
201
194
|
renameS3Folder
|
|
202
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-SQKG3S6P.js";
|
|
203
196
|
import {
|
|
204
197
|
createWorkspace,
|
|
205
198
|
deleteWorkspace,
|
|
@@ -223,8 +216,8 @@ import {
|
|
|
223
216
|
writeWorkspaceFile
|
|
224
217
|
} from "./chunk-JGUWYVOL.js";
|
|
225
218
|
import {
|
|
226
|
-
|
|
227
|
-
} from "./chunk-
|
|
219
|
+
GoogleDriveStorageService
|
|
220
|
+
} from "./chunk-OQRQCDS6.js";
|
|
228
221
|
import {
|
|
229
222
|
getPrimarySrklDeploymentUrl,
|
|
230
223
|
getSrklAccounts,
|
|
@@ -257,6 +250,7 @@ import {
|
|
|
257
250
|
b2ListFileNames,
|
|
258
251
|
b2UploadFile
|
|
259
252
|
} from "./chunk-4QEMALXF.js";
|
|
253
|
+
import "./chunk-OWMQLML7.js";
|
|
260
254
|
import {
|
|
261
255
|
DeterministicEndpointExecutor,
|
|
262
256
|
deterministicEndpointExecutor
|
|
@@ -421,7 +415,7 @@ function validateServiceDefinition(def) {
|
|
|
421
415
|
}
|
|
422
416
|
|
|
423
417
|
// src/core/SrklStorageService.ts
|
|
424
|
-
import { S3Client, ListObjectsV2Command } from "@dinilmusick/gutts/storage";
|
|
418
|
+
import { S3Client, ListObjectsV2Command } from "@dinilmusick/gutts/storage/s3";
|
|
425
419
|
import { promises as fs } from "fs";
|
|
426
420
|
import path from "path";
|
|
427
421
|
var ACCOUNTS_FILE = path.resolve(".skipo/accounts.json");
|
|
@@ -4475,12 +4469,9 @@ export {
|
|
|
4475
4469
|
FailoverExecutionEngine,
|
|
4476
4470
|
FrontendSession,
|
|
4477
4471
|
FunctionalityTable,
|
|
4478
|
-
GOOGLE_DRIVE_FILE_SCOPE,
|
|
4479
|
-
GOOGLE_DRIVE_STORAGE_SCOPE,
|
|
4480
4472
|
GRAPHS_ROOT,
|
|
4481
4473
|
GeminiServiceDefinition,
|
|
4482
4474
|
GeminiServiceFacade,
|
|
4483
|
-
GoogleDriveAdapter,
|
|
4484
4475
|
GoogleDriveStorageService,
|
|
4485
4476
|
HTTPTransport,
|
|
4486
4477
|
HealthCheckService,
|
|
@@ -4563,7 +4554,6 @@ export {
|
|
|
4563
4554
|
createCompositeService,
|
|
4564
4555
|
createCredential,
|
|
4565
4556
|
createEmptyContract,
|
|
4566
|
-
createGoogleDriveAuthorizationUrl,
|
|
4567
4557
|
createGraphAssetFolder,
|
|
4568
4558
|
createGraphAssetFolder as createGraphAssetSubfolder,
|
|
4569
4559
|
createGraphPackage,
|
|
@@ -4600,7 +4590,6 @@ export {
|
|
|
4600
4590
|
ensureProjectsRoot,
|
|
4601
4591
|
ensureS3DirectoryMarker,
|
|
4602
4592
|
ensureWorkspaceStructure,
|
|
4603
|
-
exchangeGoogleDriveCode,
|
|
4604
4593
|
exportEncryptedCredentials,
|
|
4605
4594
|
exportGraphAsJsonFile,
|
|
4606
4595
|
failoverExecutionEngine,
|
|
@@ -4700,7 +4689,6 @@ export {
|
|
|
4700
4689
|
queryUnifiedDb,
|
|
4701
4690
|
readWorkspaceFile,
|
|
4702
4691
|
recordExecution,
|
|
4703
|
-
refreshGoogleDriveAccessToken,
|
|
4704
4692
|
remoteWorkspaceService,
|
|
4705
4693
|
removeGraphDependency,
|
|
4706
4694
|
renameAppInWorkspaceData,
|
|
@@ -14,13 +14,14 @@ import {
|
|
|
14
14
|
} from "../chunk-OXEP3AP6.js";
|
|
15
15
|
import {
|
|
16
16
|
workspaceGraphService
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-AOZSDRNY.js";
|
|
18
|
+
import "../chunk-SQKG3S6P.js";
|
|
19
19
|
import "../chunk-JGUWYVOL.js";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-OQRQCDS6.js";
|
|
21
21
|
import "../chunk-JCMB7BIM.js";
|
|
22
22
|
import "../chunk-HUY4272L.js";
|
|
23
23
|
import "../chunk-5F5V7NAG.js";
|
|
24
|
+
import "../chunk-OWMQLML7.js";
|
|
24
25
|
export {
|
|
25
26
|
CompositeBackend,
|
|
26
27
|
EndpointGenerator,
|
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { BaseStorageAdapter } from './BaseStorageAdapter.js';
|
|
2
|
+
import type { ConnectionTestResult, FileInfo, StorageConfig } from './types.js';
|
|
3
|
+
import type { GoogleDriveWorkspaceTokens, GoogleDriveWorkspaceFolder } from './GoogleDriveWorkspaceService.js';
|
|
4
|
+
export type GoogleDriveTokenSet = GoogleDriveWorkspaceTokens;
|
|
5
|
+
/** Server-only dependencies. Never serialize this object into a connection record. */
|
|
6
|
+
export interface GoogleDriveRuntimeAuthOptions {
|
|
7
|
+
clientSecret?: string;
|
|
8
|
+
fetcher?: typeof fetch;
|
|
9
|
+
getCredentials?: () => Promise<GoogleDriveWorkspaceTokens | undefined>;
|
|
10
|
+
persistCredentials?: (tokens: GoogleDriveWorkspaceTokens) => Promise<void> | void;
|
|
11
|
+
}
|
|
12
|
+
export declare class GoogleDriveStorageService extends BaseStorageAdapter {
|
|
13
|
+
private readonly runtimeAuth;
|
|
14
|
+
private workspacePromise?;
|
|
10
15
|
constructor(config: StorageConfig, runtimeAuth?: GoogleDriveRuntimeAuthOptions);
|
|
16
|
+
private workspace;
|
|
17
|
+
read(path: string): Promise<Uint8Array>;
|
|
18
|
+
write(path: string, data: Uint8Array | string, contentType?: string): Promise<void>;
|
|
19
|
+
delete(path: string): Promise<void>;
|
|
20
|
+
exists(path: string): Promise<boolean>;
|
|
21
|
+
list(path?: string): Promise<FileInfo[]>;
|
|
22
|
+
stat(path: string): Promise<FileInfo>;
|
|
23
|
+
mkdir(path: string): Promise<void>;
|
|
24
|
+
listFolders(parentFolderId?: string): Promise<GoogleDriveWorkspaceFolder[]>;
|
|
25
|
+
selectRootFolder(folderId: string): Promise<GoogleDriveWorkspaceFolder>;
|
|
26
|
+
getAccountIdentity(): Promise<{
|
|
27
|
+
accountId: string;
|
|
28
|
+
email?: string;
|
|
29
|
+
}>;
|
|
30
|
+
refreshTokens(): Promise<GoogleDriveWorkspaceTokens>;
|
|
31
|
+
getConnectionMetadata(): Pick<StorageConfig, 'provider' | 'googleClientId' | 'googleRedirectUri' | 'googleAccountId' | 'googleRootFolderId'>;
|
|
32
|
+
testConnection(): Promise<ConnectionTestResult>;
|
|
11
33
|
}
|
|
@@ -3,16 +3,22 @@ export declare const GOOGLE_DRIVE_WORKSPACE_SCOPE = "https://www.googleapis.com/
|
|
|
3
3
|
export interface GoogleDriveWorkspaceTokens {
|
|
4
4
|
accessToken: string;
|
|
5
5
|
refreshToken?: string;
|
|
6
|
+
/** Unix epoch milliseconds. */
|
|
6
7
|
expiresAt?: number;
|
|
7
8
|
tokenType?: string;
|
|
8
9
|
}
|
|
9
10
|
export interface GoogleDriveWorkspaceOptions {
|
|
10
11
|
clientId: string;
|
|
12
|
+
/** Server-side OAuth client secret. Never include it in persisted connection metadata. */
|
|
11
13
|
clientSecret?: string;
|
|
12
14
|
redirectUri: string;
|
|
15
|
+
/** Credentials loaded by the server-side connection owner. */
|
|
13
16
|
tokens?: GoogleDriveWorkspaceTokens;
|
|
14
17
|
rootFolderId?: string;
|
|
18
|
+
/** Previously associated Google account ID; a different identity is rejected. */
|
|
19
|
+
googleAccountId?: string;
|
|
15
20
|
fetcher?: typeof fetch;
|
|
21
|
+
/** Persists an exchanged or rotated credential set before it becomes current in this instance. */
|
|
16
22
|
persistTokens?: (tokens: GoogleDriveWorkspaceTokens) => Promise<void> | void;
|
|
17
23
|
}
|
|
18
24
|
export interface GoogleDriveWorkspaceFolder {
|
|
@@ -25,10 +31,10 @@ export interface GoogleDriveWorkspaceFolder {
|
|
|
25
31
|
/**
|
|
26
32
|
* Fetch-native Google Drive implementation for Worker/edge runtimes.
|
|
27
33
|
*
|
|
28
|
-
* This class deliberately uses only
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
34
|
+
* This class deliberately uses only Web Fetch, URL, TextEncoder, Uint8Array,
|
|
35
|
+
* Web Crypto and standard response/header APIs. It does not import googleapis,
|
|
36
|
+
* Node streams, Buffer, filesystem or Node-only modules. OAuth credentials are
|
|
37
|
+
* supplied and persisted only by server-side callers.
|
|
32
38
|
*/
|
|
33
39
|
export declare class GoogleDriveWorkspaceService {
|
|
34
40
|
private readonly options;
|
|
@@ -36,9 +42,20 @@ export declare class GoogleDriveWorkspaceService {
|
|
|
36
42
|
private tokens;
|
|
37
43
|
private refreshPromise?;
|
|
38
44
|
constructor(options: GoogleDriveWorkspaceOptions);
|
|
39
|
-
|
|
40
|
-
static
|
|
45
|
+
/** Generate a cryptographically random RFC 7636 verifier using Web Crypto. */
|
|
46
|
+
static createPkceCodeVerifier(): string;
|
|
47
|
+
/** Create the S256 challenge corresponding to a previously stored verifier. */
|
|
48
|
+
static createPkceCodeChallenge(codeVerifier: string): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Validate callback state against the value stored by the initiating server-side session.
|
|
51
|
+
* Call this at the callback boundary before exchanging the returned authorization code.
|
|
52
|
+
*/
|
|
53
|
+
static validateOAuthState(expectedState: string, returnedState: string): void;
|
|
54
|
+
static createAuthorizationUrl(options: Pick<GoogleDriveWorkspaceOptions, 'clientId' | 'redirectUri'>, state: string, scopes?: string[], codeChallenge?: string): string;
|
|
55
|
+
static exchangeAuthorizationCode(options: Pick<GoogleDriveWorkspaceOptions, 'clientId' | 'clientSecret' | 'redirectUri' | 'fetcher' | 'persistTokens'>, code: string, existingRefreshToken?: string, codeVerifier?: string): Promise<GoogleDriveWorkspaceTokens>;
|
|
41
56
|
private static requestTokens;
|
|
57
|
+
/** Force a refresh through this instance's shared refresh/persistence lifecycle. */
|
|
58
|
+
refreshTokens(): Promise<GoogleDriveWorkspaceTokens>;
|
|
42
59
|
private getAccessToken;
|
|
43
60
|
private api;
|
|
44
61
|
private listFiles;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseStorageAdapter } from './BaseStorageAdapter.js';
|
|
2
|
-
import { StorageConfig } from './types.js';
|
|
3
|
-
import type { GoogleDriveRuntimeAuthOptions } from './
|
|
2
|
+
import type { StorageConfig } from './types.js';
|
|
3
|
+
import type { GoogleDriveRuntimeAuthOptions } from './GoogleDriveStorageService.js';
|
|
4
4
|
export interface StorageAdapterRuntimeOptions {
|
|
5
5
|
/** Server-only OAuth dependencies; never include these in persisted connection JSON. */
|
|
6
6
|
googleDrive?: GoogleDriveRuntimeAuthOptions;
|
|
@@ -4,11 +4,9 @@ export * from './LocalFSAdapter.js';
|
|
|
4
4
|
export * from './S3Adapter.js';
|
|
5
5
|
export * from './BucketStorageService.js';
|
|
6
6
|
export * from './BackblazeB2Adapter.js';
|
|
7
|
-
export * from './GoogleDriveAdapter.js';
|
|
8
7
|
export * from './GoogleDriveStorageService.js';
|
|
9
8
|
export * from './b2Endpoint.js';
|
|
10
9
|
export * from './s3Purge.js';
|
|
11
10
|
export * from './SupabaseStorageAdapter.js';
|
|
12
11
|
export * from './StorageAdapterFactory.js';
|
|
13
12
|
export * from './B2DirectClient.js';
|
|
14
|
-
export * from './GoogleDriveOAuth.js';
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
GOOGLE_DRIVE_FILE_SCOPE,
|
|
3
|
-
GOOGLE_DRIVE_STORAGE_SCOPE,
|
|
4
|
-
createGoogleDriveAuthorizationUrl,
|
|
5
|
-
exchangeGoogleDriveCode,
|
|
6
|
-
refreshGoogleDriveAccessToken
|
|
7
|
-
} from "../chunk-3FZSYSJC.js";
|
|
1
|
+
import "../chunk-G4EDIAHW.js";
|
|
8
2
|
import {
|
|
9
3
|
BackblazeB2Adapter,
|
|
10
4
|
BucketStorageService,
|
|
11
|
-
GoogleDriveStorageService,
|
|
12
5
|
LocalFSAdapter,
|
|
13
6
|
S3Adapter,
|
|
14
7
|
StorageAdapterFactory,
|
|
@@ -17,10 +10,10 @@ import {
|
|
|
17
10
|
permanentDeleteS3Folder,
|
|
18
11
|
permanentDeleteS3Object,
|
|
19
12
|
renameS3Folder
|
|
20
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-SQKG3S6P.js";
|
|
21
14
|
import {
|
|
22
|
-
|
|
23
|
-
} from "../chunk-
|
|
15
|
+
GoogleDriveStorageService
|
|
16
|
+
} from "../chunk-OQRQCDS6.js";
|
|
24
17
|
import {
|
|
25
18
|
isSecretMasked,
|
|
26
19
|
normalizeBackblazeCredentials,
|
|
@@ -36,13 +29,11 @@ import {
|
|
|
36
29
|
b2ListFileNames,
|
|
37
30
|
b2UploadFile
|
|
38
31
|
} from "../chunk-4QEMALXF.js";
|
|
32
|
+
import "../chunk-OWMQLML7.js";
|
|
39
33
|
export {
|
|
40
34
|
BackblazeB2Adapter,
|
|
41
35
|
BaseStorageAdapter,
|
|
42
36
|
BucketStorageService,
|
|
43
|
-
GOOGLE_DRIVE_FILE_SCOPE,
|
|
44
|
-
GOOGLE_DRIVE_STORAGE_SCOPE,
|
|
45
|
-
GoogleDriveAdapter,
|
|
46
37
|
GoogleDriveStorageService,
|
|
47
38
|
LocalFSAdapter,
|
|
48
39
|
S3Adapter,
|
|
@@ -53,14 +44,11 @@ export {
|
|
|
53
44
|
b2ListBuckets,
|
|
54
45
|
b2ListFileNames,
|
|
55
46
|
b2UploadFile,
|
|
56
|
-
createGoogleDriveAuthorizationUrl,
|
|
57
47
|
ensureS3DirectoryMarker,
|
|
58
|
-
exchangeGoogleDriveCode,
|
|
59
48
|
isSecretMasked,
|
|
60
49
|
normalizeBackblazeCredentials,
|
|
61
50
|
permanentDeleteS3Folder,
|
|
62
51
|
permanentDeleteS3Object,
|
|
63
|
-
refreshGoogleDriveAccessToken,
|
|
64
52
|
renameS3Folder,
|
|
65
53
|
resolveBackblazeEndpoint
|
|
66
54
|
};
|