@ultrst-armada/kloks 1.6.0 → 1.7.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/.krusbl-release-attestation.json +3 -3
- package/package.json +1 -1
- package/packages/backend/dist/{BaseStorageAdapter-tosOoSUg.d.ts → BaseStorageAdapter-6x_BQiB3.d.ts} +6 -1
- package/packages/backend/dist/{chunk-OZDYAEH4.js → chunk-3IUA66RS.js} +219 -3
- package/packages/backend/dist/{chunk-E72GXBXF.js → chunk-6K75XXFD.js} +9 -200
- package/packages/backend/dist/{chunk-GPXV4GBD.js → chunk-6W7OAGNV.js} +59 -75
- package/packages/backend/dist/{chunk-GQUNN7SA.js → chunk-7ZT2ZPPH.js} +7 -5
- package/packages/backend/dist/{chunk-DBZVGMJ7.js → chunk-F6IDQLC2.js} +2 -2
- package/packages/backend/dist/chunk-JUPWFW7V.js +134 -0
- package/packages/backend/dist/{chunk-J2J24JVC.js → chunk-R45CEV46.js} +210 -153
- package/packages/backend/dist/{chunk-3HZYAZF4.js → chunk-SQGBAWZN.js} +97 -7
- package/packages/backend/dist/chunk-VAFCR2MS.js +203 -0
- package/packages/backend/dist/{chunk-VDROUXFT.js → chunk-XHADDA75.js} +19 -13
- package/packages/backend/dist/development/index.d.ts +54 -1
- package/packages/backend/dist/development/index.js +7 -1
- package/packages/backend/dist/index.d.ts +5 -5
- package/packages/backend/dist/index.js +38 -211
- package/packages/backend/dist/krnl-services.js +6 -5
- package/packages/backend/dist/services/index.js +4 -3
- package/packages/backend/dist/srkl/index.d.ts +55 -2
- package/packages/backend/dist/srkl/index.js +3 -2
- package/packages/backend/dist/storage/index.d.ts +35 -3
- package/packages/backend/dist/storage/index.js +12 -3
- package/packages/backend/dist/workspace/index.d.ts +27 -33
- package/packages/backend/dist/workspace/index.js +3 -2
- package/packages/backend/kloks.manifest.json +25 -0
- package/packages/client/dist/index.d.ts +34 -1
- package/packages/client/dist/index.js +116 -0
- package/packages/backend/dist/chunk-LS3HWJBX.js +0 -0
|
@@ -19,13 +19,20 @@ import {
|
|
|
19
19
|
SrklVaultAccessClient,
|
|
20
20
|
createSrklClient,
|
|
21
21
|
decryptVaultBufferInBrowser,
|
|
22
|
+
getPrimarySrklDeploymentUrl as getPrimarySrklDeploymentUrl2,
|
|
23
|
+
getSrklAccounts as getSrklAccounts2,
|
|
24
|
+
getSrklStatus,
|
|
22
25
|
globalCredentialRegistry,
|
|
23
26
|
hexToBytes,
|
|
27
|
+
listBackblazeBuckets,
|
|
28
|
+
srklListBackblazeBuckets as srklListBackblazeBuckets2,
|
|
24
29
|
srklService,
|
|
25
30
|
syncSrklAccounts,
|
|
26
31
|
useSrklServices
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import
|
|
32
|
+
} from "./chunk-3IUA66RS.js";
|
|
33
|
+
import {
|
|
34
|
+
S3Adapter
|
|
35
|
+
} from "./chunk-JUPWFW7V.js";
|
|
29
36
|
import {
|
|
30
37
|
RemoteWorkspaceService,
|
|
31
38
|
SyncEngine,
|
|
@@ -41,7 +48,7 @@ import {
|
|
|
41
48
|
setWorkingWorkspaceConfig,
|
|
42
49
|
syncWorkspace,
|
|
43
50
|
workingWorkspaceService
|
|
44
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-6W7OAGNV.js";
|
|
45
52
|
import {
|
|
46
53
|
AuthServiceDefinition,
|
|
47
54
|
AuthServiceFacade,
|
|
@@ -75,30 +82,33 @@ import {
|
|
|
75
82
|
krnlWorkspaceGraphServiceFacade,
|
|
76
83
|
krnlWorkspaceServiceDefinition,
|
|
77
84
|
krnlWorkspaceServiceFacade
|
|
78
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-7ZT2ZPPH.js";
|
|
79
86
|
import {
|
|
80
87
|
workspaceGraphService
|
|
81
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-F6IDQLC2.js";
|
|
82
89
|
import {
|
|
83
90
|
getPrimarySrklDeploymentUrl,
|
|
84
91
|
getSrklAccounts,
|
|
85
92
|
srklListBackblazeBuckets
|
|
86
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-XHADDA75.js";
|
|
87
94
|
import {
|
|
88
95
|
BackblazeB2Adapter,
|
|
89
96
|
BaseStorageAdapter,
|
|
97
|
+
GoogleDriveAdapter,
|
|
90
98
|
LocalFSAdapter,
|
|
91
|
-
S3Adapter,
|
|
92
99
|
StorageAdapterFactory,
|
|
93
100
|
SupabaseStorageAdapter,
|
|
101
|
+
createGoogleDriveAuthorizationUrl,
|
|
94
102
|
ensureS3DirectoryMarker,
|
|
103
|
+
exchangeGoogleDriveCode,
|
|
95
104
|
isSecretMasked,
|
|
96
105
|
normalizeBackblazeCredentials,
|
|
97
106
|
permanentDeleteS3Folder,
|
|
98
107
|
permanentDeleteS3Object,
|
|
108
|
+
refreshGoogleDriveAccessToken,
|
|
99
109
|
renameS3Folder,
|
|
100
110
|
resolveBackblazeEndpoint
|
|
101
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-R45CEV46.js";
|
|
102
112
|
import {
|
|
103
113
|
authorizeB2,
|
|
104
114
|
b2DownloadFile,
|
|
@@ -111,24 +121,17 @@ import {
|
|
|
111
121
|
sanitizeWorkspaceName
|
|
112
122
|
} from "./chunk-FZKBTF34.js";
|
|
113
123
|
import {
|
|
114
|
-
b2DeleteFileVersion,
|
|
115
|
-
b2DeleteFolder,
|
|
116
|
-
b2ListBuckets as b2ListBuckets2,
|
|
117
|
-
cleanDbUrl,
|
|
118
124
|
createWorkspace,
|
|
119
125
|
deleteWorkspace,
|
|
120
126
|
deleteWorkspaceFile,
|
|
121
127
|
deleteWorkspaceFolder,
|
|
122
128
|
findUserWorkspace,
|
|
123
|
-
getB2BucketId,
|
|
124
|
-
getUnifiedDbUrl,
|
|
125
129
|
getWorkspaceFolderPrefix,
|
|
126
130
|
getWorkspaceStorageDetails,
|
|
127
131
|
getWorkspaces,
|
|
128
132
|
isB2Workspace,
|
|
129
133
|
listWorkspaceFiles,
|
|
130
134
|
loadWorkspaceData,
|
|
131
|
-
queryUnifiedDb,
|
|
132
135
|
readWorkspaceFile,
|
|
133
136
|
renameAppInWorkspaceData,
|
|
134
137
|
resolveWorkspaceConnection,
|
|
@@ -138,7 +141,15 @@ import {
|
|
|
138
141
|
syncWorkspaceDeleteToBucket,
|
|
139
142
|
updateWorkspace,
|
|
140
143
|
writeWorkspaceFile
|
|
141
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-6K75XXFD.js";
|
|
145
|
+
import {
|
|
146
|
+
b2DeleteFileVersion,
|
|
147
|
+
b2DeleteFolder,
|
|
148
|
+
cleanDbUrl,
|
|
149
|
+
getB2BucketId,
|
|
150
|
+
getUnifiedDbUrl,
|
|
151
|
+
queryUnifiedDb
|
|
152
|
+
} from "./chunk-VAFCR2MS.js";
|
|
142
153
|
import {
|
|
143
154
|
BaseApiRoute,
|
|
144
155
|
createSSEResponse,
|
|
@@ -195,6 +206,9 @@ import {
|
|
|
195
206
|
resolveSystemDatabaseClusterNodes
|
|
196
207
|
} from "./chunk-RCCQ7IRM.js";
|
|
197
208
|
import {
|
|
209
|
+
AgentHarnessRuntime,
|
|
210
|
+
AgentHarnessServiceDefinition,
|
|
211
|
+
AgentHarnessServiceFacade,
|
|
198
212
|
CodeDiagnosticsService,
|
|
199
213
|
CodeValidationRuntime,
|
|
200
214
|
CodeValidationServiceDefinition,
|
|
@@ -214,7 +228,7 @@ import {
|
|
|
214
228
|
WebContainerServiceFacade,
|
|
215
229
|
codeDiagnosticsService,
|
|
216
230
|
resolveDevelopmentCommand
|
|
217
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-SQGBAWZN.js";
|
|
218
232
|
import "./chunk-TY32TUNI.js";
|
|
219
233
|
|
|
220
234
|
// src/data/BaseDataProvider.ts
|
|
@@ -564,200 +578,6 @@ var SrklStorageService = class {
|
|
|
564
578
|
}
|
|
565
579
|
};
|
|
566
580
|
|
|
567
|
-
// src/core/srklCore.ts
|
|
568
|
-
var cachedSrklUrl = null;
|
|
569
|
-
async function getPrimarySrklDeploymentUrl2(env) {
|
|
570
|
-
if (cachedSrklUrl && Date.now() < cachedSrklUrl.expiresAt) return cachedSrklUrl.url;
|
|
571
|
-
try {
|
|
572
|
-
const res = await queryUnifiedDb(
|
|
573
|
-
`SELECT url FROM "ultrst-srkl-deployments" WHERE is_active = true ORDER BY is_primary DESC, priority DESC, created_at ASC LIMIT 1`,
|
|
574
|
-
[],
|
|
575
|
-
env
|
|
576
|
-
);
|
|
577
|
-
if (res.rows.length > 0 && res.rows[0].url) {
|
|
578
|
-
const url = res.rows[0].url.trim().replace(/\/+$/, "");
|
|
579
|
-
cachedSrklUrl = { url, expiresAt: Date.now() + 10 * 60 * 1e3 };
|
|
580
|
-
return url;
|
|
581
|
-
}
|
|
582
|
-
} catch (err) {
|
|
583
|
-
console.warn("[SrklCore] Deployment DB lookup fallback:", err.message);
|
|
584
|
-
}
|
|
585
|
-
const fallback = "https://srkl-engine.vercel.app";
|
|
586
|
-
cachedSrklUrl = { url: fallback, expiresAt: Date.now() + 10 * 60 * 1e3 };
|
|
587
|
-
return fallback;
|
|
588
|
-
}
|
|
589
|
-
function deduplicateAccounts(items) {
|
|
590
|
-
const seen = /* @__PURE__ */ new Set();
|
|
591
|
-
const out = [];
|
|
592
|
-
for (const a of items) {
|
|
593
|
-
if (!a) continue;
|
|
594
|
-
const creds = a.credentials || a.metadata?.credentials || a;
|
|
595
|
-
const keyId = (creds.keyId || creds.b2KeyId || creds.accessKeyId || "").trim();
|
|
596
|
-
const token = (creds.token || creds.apiToken || creds.applicationKey || creds.b2ApplicationKey || "").trim();
|
|
597
|
-
const sId = (a.serviceId || a.provider || "").toLowerCase().trim();
|
|
598
|
-
const sig = keyId ? `key:${keyId}` : token ? `tok:${sId}:${token.slice(-12)}` : a.id ? `id:${a.id}` : `nam:${sId}:${a.name || a.label}`;
|
|
599
|
-
if (!seen.has(sig)) {
|
|
600
|
-
seen.add(sig);
|
|
601
|
-
if (a.id) seen.add(`id:${a.id}`);
|
|
602
|
-
out.push(a);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
return out;
|
|
606
|
-
}
|
|
607
|
-
async function getSrklAccounts2(userId, service, env) {
|
|
608
|
-
const rawAccounts = [];
|
|
609
|
-
const srklUrl = await getPrimarySrklDeploymentUrl2(env);
|
|
610
|
-
if (userId) {
|
|
611
|
-
try {
|
|
612
|
-
const uRes = await queryUnifiedDb(
|
|
613
|
-
`SELECT app_profiles FROM "ultrst-users" WHERE id = $1 OR email = $1 LIMIT 1`,
|
|
614
|
-
[userId],
|
|
615
|
-
env
|
|
616
|
-
);
|
|
617
|
-
if (uRes.rows.length > 0) {
|
|
618
|
-
const p = typeof uRes.rows[0].app_profiles === "string" ? JSON.parse(uRes.rows[0].app_profiles) : uRes.rows[0].app_profiles || {};
|
|
619
|
-
const conns = [
|
|
620
|
-
...p.srkl?.storage_connections || [],
|
|
621
|
-
...p.depm?.storage_connections || [],
|
|
622
|
-
...p.qwnsr?.storage_connections || [],
|
|
623
|
-
...p.loky?.storage_connections || []
|
|
624
|
-
];
|
|
625
|
-
for (const c of conns) {
|
|
626
|
-
if (!service || (c.provider || "").toLowerCase().includes(service.toLowerCase())) {
|
|
627
|
-
rawAccounts.push({
|
|
628
|
-
id: c.id,
|
|
629
|
-
name: c.label || c.name || "Backblaze B2 Account",
|
|
630
|
-
provider: c.provider === "backblaze_b2" ? "backblaze" : c.provider,
|
|
631
|
-
serviceId: "backblaze",
|
|
632
|
-
category: "storage",
|
|
633
|
-
groupIds: c.groupIds || (c.groupId ? [c.groupId] : []),
|
|
634
|
-
credentials: {
|
|
635
|
-
keyId: c.b2KeyId || c.keyId || c.accessKeyId || "",
|
|
636
|
-
applicationKey: c.b2ApplicationKey || c.applicationKey || c.secretAccessKey || "",
|
|
637
|
-
bucketName: c.b2BucketName || c.bucketName || "",
|
|
638
|
-
bucketId: c.b2BucketId || c.bucketId || "",
|
|
639
|
-
endpoint: c.b2Endpoint || c.endpoint || "s3.eu-central-003.backblazeb2.com",
|
|
640
|
-
region: c.b2Region || c.region || "eu-central-003"
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
} catch (err) {
|
|
647
|
-
console.warn("[SrklCore] Storage connection DB lookup fallback:", err.message);
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
try {
|
|
651
|
-
const fs9 = await import("fs/promises");
|
|
652
|
-
const path9 = await import("path");
|
|
653
|
-
const accPath = path9.resolve(".skipo/accounts.json");
|
|
654
|
-
const raw = await fs9.readFile(accPath, "utf-8");
|
|
655
|
-
const localUsers = JSON.parse(raw);
|
|
656
|
-
for (const u of Object.values(localUsers)) {
|
|
657
|
-
const conns = Array.isArray(u.storage_connections) ? u.storage_connections : [];
|
|
658
|
-
for (const c of conns) {
|
|
659
|
-
if (!service || (c.provider || "").toLowerCase().includes(service.toLowerCase())) {
|
|
660
|
-
rawAccounts.push({
|
|
661
|
-
id: c.id,
|
|
662
|
-
name: c.label || c.name || "Local B2 Account",
|
|
663
|
-
provider: "backblaze",
|
|
664
|
-
serviceId: "backblaze",
|
|
665
|
-
credentials: {
|
|
666
|
-
keyId: c.b2KeyId || c.keyId || "",
|
|
667
|
-
applicationKey: c.b2ApplicationKey || c.applicationKey || "",
|
|
668
|
-
bucketName: c.b2BucketName || c.bucketName || "",
|
|
669
|
-
bucketId: c.b2BucketId || "",
|
|
670
|
-
endpoint: c.b2Endpoint || "s3.eu-central-003.backblazeb2.com",
|
|
671
|
-
region: c.b2Region || "eu-central-003"
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
} catch {
|
|
678
|
-
}
|
|
679
|
-
let fetchError;
|
|
680
|
-
try {
|
|
681
|
-
const srklRes = await fetch(`${srklUrl}/api/srkl/accounts?service=${service || "backblaze"}`, {
|
|
682
|
-
signal: AbortSignal.timeout(5e3)
|
|
683
|
-
});
|
|
684
|
-
if (srklRes.ok) {
|
|
685
|
-
const sData = await srklRes.json();
|
|
686
|
-
if (Array.isArray(sData.accounts)) {
|
|
687
|
-
for (const sa of sData.accounts) {
|
|
688
|
-
rawAccounts.push(sa);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
} catch (err) {
|
|
693
|
-
fetchError = err.message;
|
|
694
|
-
}
|
|
695
|
-
const accounts = deduplicateAccounts(rawAccounts);
|
|
696
|
-
return {
|
|
697
|
-
success: true,
|
|
698
|
-
deploymentUrl: srklUrl,
|
|
699
|
-
userId,
|
|
700
|
-
count: accounts.length,
|
|
701
|
-
accounts,
|
|
702
|
-
error: accounts.length > 0 ? void 0 : fetchError
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
async function listBackblazeBuckets(payload, rawUserId, env) {
|
|
706
|
-
try {
|
|
707
|
-
const userId = rawUserId || payload?.userId || payload?.credentials?.userId || "";
|
|
708
|
-
const creds = payload?.credentials || {};
|
|
709
|
-
let keyId = (payload?.keyId || payload?.b2KeyId || payload?.accessKeyId || creds.keyId || creds.b2KeyId || creds.accessKeyId || "").trim();
|
|
710
|
-
let appKey = (payload?.applicationKey || payload?.b2ApplicationKey || payload?.appKey || payload?.secretAccessKey || creds.applicationKey || creds.b2ApplicationKey || creds.appKey || creds.secretAccessKey || "").trim();
|
|
711
|
-
const bucketId = (payload?.bucketId || creds.bucketId || "").trim();
|
|
712
|
-
const bucketName = (payload?.bucketName || payload?.b2BucketName || creds.bucketName || creds.b2BucketName || "").trim();
|
|
713
|
-
if ((!keyId || !appKey) && (payload?.accountId || payload?.id)) {
|
|
714
|
-
const srkl = await getSrklAccounts2(userId, "backblaze", env);
|
|
715
|
-
const matched = srkl.accounts?.find((a) => a.id === (payload.accountId || payload.id));
|
|
716
|
-
if (matched?.credentials) {
|
|
717
|
-
keyId = (matched.credentials.keyId || matched.credentials.b2KeyId || matched.credentials.accessKeyId || keyId).trim();
|
|
718
|
-
appKey = (matched.credentials.applicationKey || matched.credentials.b2ApplicationKey || matched.credentials.appKey || matched.credentials.secretAccessKey || appKey).trim();
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
if (!keyId || !appKey) return { success: false, error: "Backblaze credentials (Key ID and Application Key) required." };
|
|
722
|
-
try {
|
|
723
|
-
const buckets = await b2ListBuckets2(keyId, appKey, bucketId || void 0, bucketName || void 0);
|
|
724
|
-
if (Array.isArray(buckets) && buckets.length > 0) return { success: true, buckets };
|
|
725
|
-
} catch (err) {
|
|
726
|
-
console.warn("[SrklCore] Direct B2 bucket query failed, trying SRKL fallback:", err.message);
|
|
727
|
-
}
|
|
728
|
-
const srklUrl = await getPrimarySrklDeploymentUrl2(env);
|
|
729
|
-
const srklRes = await fetch(`${srklUrl}/api/backblaze/buckets`, {
|
|
730
|
-
method: "POST",
|
|
731
|
-
headers: { "Content-Type": "application/json", "x-user-id": userId || "" },
|
|
732
|
-
body: JSON.stringify({ keyId, applicationKey: appKey, bucketId: bucketId || void 0 }),
|
|
733
|
-
signal: AbortSignal.timeout(6e3)
|
|
734
|
-
});
|
|
735
|
-
if (srklRes.ok) {
|
|
736
|
-
const data = await srklRes.json();
|
|
737
|
-
if (data.success && Array.isArray(data.buckets)) return { success: true, buckets: data.buckets };
|
|
738
|
-
}
|
|
739
|
-
return { success: true, buckets: [] };
|
|
740
|
-
} catch (err) {
|
|
741
|
-
return { success: false, error: err.message || "Failed to list Backblaze buckets" };
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
var srklListBackblazeBuckets2 = (keyId, applicationKey, bucketId, bucketName, userId) => listBackblazeBuckets({ keyId, applicationKey, bucketId, bucketName }, userId);
|
|
745
|
-
async function getSrklStatus(env) {
|
|
746
|
-
const srklUrl = await getPrimarySrklDeploymentUrl2(env);
|
|
747
|
-
const start = Date.now();
|
|
748
|
-
try {
|
|
749
|
-
const resp = await fetch(`${srklUrl}/api/ecosystem/health`, { signal: AbortSignal.timeout(5e3) });
|
|
750
|
-
const latencyMs = Date.now() - start;
|
|
751
|
-
if (resp.ok) {
|
|
752
|
-
const data = await resp.json().catch(() => ({}));
|
|
753
|
-
return { success: true, deploymentUrl: srklUrl, online: true, latencyMs, details: data };
|
|
754
|
-
}
|
|
755
|
-
return { success: false, deploymentUrl: srklUrl, online: false, status: resp.status, latencyMs };
|
|
756
|
-
} catch (err) {
|
|
757
|
-
return { success: false, deploymentUrl: srklUrl, online: false, error: err.message, latencyMs: Date.now() - start };
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
|
|
761
581
|
// src/core/credentialVaultCore.ts
|
|
762
582
|
var MANIFEST_PATH = "credentials/manifest.json";
|
|
763
583
|
var SECRET_PREFIX = "credentials/secrets";
|
|
@@ -4372,6 +4192,9 @@ function tryResolveSystemDatabaseUrl(env = typeof process !== "undefined" ? proc
|
|
|
4372
4192
|
}
|
|
4373
4193
|
export {
|
|
4374
4194
|
AdminGuard,
|
|
4195
|
+
AgentHarnessRuntime,
|
|
4196
|
+
AgentHarnessServiceDefinition,
|
|
4197
|
+
AgentHarnessServiceFacade,
|
|
4375
4198
|
AuditLogger,
|
|
4376
4199
|
AuthServiceDefinition,
|
|
4377
4200
|
AuthServiceFacade,
|
|
@@ -4414,6 +4237,7 @@ export {
|
|
|
4414
4237
|
GitHubActionsClient,
|
|
4415
4238
|
GitHubActionsServiceDefinition,
|
|
4416
4239
|
GitHubActionsServiceFacade,
|
|
4240
|
+
GoogleDriveAdapter,
|
|
4417
4241
|
HTTPTransport,
|
|
4418
4242
|
HealthMonitor,
|
|
4419
4243
|
IdempotencyManager,
|
|
@@ -4487,6 +4311,7 @@ export {
|
|
|
4487
4311
|
createCompositeService,
|
|
4488
4312
|
createCredential,
|
|
4489
4313
|
createEmptyContract,
|
|
4314
|
+
createGoogleDriveAuthorizationUrl,
|
|
4490
4315
|
createGraphAssetFolder,
|
|
4491
4316
|
createGraphAssetFolder as createGraphAssetSubfolder,
|
|
4492
4317
|
createGraphPackage,
|
|
@@ -4520,6 +4345,7 @@ export {
|
|
|
4520
4345
|
ensureProjectsRoot,
|
|
4521
4346
|
ensureS3DirectoryMarker,
|
|
4522
4347
|
ensureWorkspaceStructure,
|
|
4348
|
+
exchangeGoogleDriveCode,
|
|
4523
4349
|
exportEncryptedCredentials,
|
|
4524
4350
|
exportGraphAsJsonFile,
|
|
4525
4351
|
fetchCloudflareData,
|
|
@@ -4603,6 +4429,7 @@ export {
|
|
|
4603
4429
|
queryUnifiedDb,
|
|
4604
4430
|
readWorkspaceFile,
|
|
4605
4431
|
recordExecution,
|
|
4432
|
+
refreshGoogleDriveAccessToken,
|
|
4606
4433
|
remoteWorkspaceService,
|
|
4607
4434
|
removeGraphDependency,
|
|
4608
4435
|
renameAppInWorkspaceData,
|
|
@@ -31,13 +31,14 @@ import {
|
|
|
31
31
|
krnlWorkspaceGraphServiceFacade,
|
|
32
32
|
krnlWorkspaceServiceDefinition,
|
|
33
33
|
krnlWorkspaceServiceFacade
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-7ZT2ZPPH.js";
|
|
35
|
+
import "./chunk-F6IDQLC2.js";
|
|
36
|
+
import "./chunk-XHADDA75.js";
|
|
37
|
+
import "./chunk-R45CEV46.js";
|
|
38
38
|
import "./chunk-4QEMALXF.js";
|
|
39
39
|
import "./chunk-FZKBTF34.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-6K75XXFD.js";
|
|
41
|
+
import "./chunk-VAFCR2MS.js";
|
|
41
42
|
import "./chunk-ZDH4XI7W.js";
|
|
42
43
|
import "./chunk-TY32TUNI.js";
|
|
43
44
|
export {
|
|
@@ -14,9 +14,10 @@ import {
|
|
|
14
14
|
} from "../chunk-RBF2OGMC.js";
|
|
15
15
|
import {
|
|
16
16
|
workspaceGraphService
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-F6IDQLC2.js";
|
|
18
|
+
import "../chunk-R45CEV46.js";
|
|
19
|
+
import "../chunk-6K75XXFD.js";
|
|
20
|
+
import "../chunk-VAFCR2MS.js";
|
|
20
21
|
import "../chunk-TY32TUNI.js";
|
|
21
22
|
export {
|
|
22
23
|
CompositeBackend,
|
|
@@ -80,7 +80,7 @@ interface AppServiceDeclaration {
|
|
|
80
80
|
}
|
|
81
81
|
interface AdaptedStorageConnection {
|
|
82
82
|
id: string;
|
|
83
|
-
provider: 'backblaze_b2' | 'aws_s3' | 'local_fs';
|
|
83
|
+
provider: 'backblaze_b2' | 'aws_s3' | 'google_drive' | 'local_fs';
|
|
84
84
|
label: string;
|
|
85
85
|
role?: 'primary' | 'redundant_clone';
|
|
86
86
|
enabled?: boolean;
|
|
@@ -95,6 +95,12 @@ interface AdaptedStorageConnection {
|
|
|
95
95
|
s3BucketName?: string;
|
|
96
96
|
s3Region?: string;
|
|
97
97
|
s3Endpoint?: string;
|
|
98
|
+
googleEmail?: string;
|
|
99
|
+
googleRootFolderId?: string;
|
|
100
|
+
googleRootFolderName?: string;
|
|
101
|
+
googleAccessToken?: string;
|
|
102
|
+
googleAccessTokenExpiresAt?: number;
|
|
103
|
+
googleRefreshToken?: string;
|
|
98
104
|
}
|
|
99
105
|
interface KeyMaterial {
|
|
100
106
|
secretHex: string;
|
|
@@ -187,7 +193,7 @@ declare function getSrklAccounts(userId: string, service?: string, queryDb?: (sq
|
|
|
187
193
|
}>;
|
|
188
194
|
declare function srklListBackblazeBuckets(keyId?: string, applicationKey?: string, _bucketId?: string, _bucketName?: string, userId?: string, queryDb?: (sql: string, params?: unknown[]) => Promise<{
|
|
189
195
|
rows: any[];
|
|
190
|
-
}
|
|
196
|
+
}>, accountId?: string): Promise<{
|
|
191
197
|
success: boolean;
|
|
192
198
|
buckets: any[];
|
|
193
199
|
error?: string;
|
|
@@ -293,6 +299,53 @@ declare const srklService: {
|
|
|
293
299
|
supportedEngines: string[];
|
|
294
300
|
version: string;
|
|
295
301
|
};
|
|
302
|
+
getSrklAccounts: (userId?: string, serviceName?: string, env?: any) => Promise<{
|
|
303
|
+
success: boolean;
|
|
304
|
+
deploymentUrl: string;
|
|
305
|
+
userId?: string;
|
|
306
|
+
count: number;
|
|
307
|
+
accounts: any[];
|
|
308
|
+
error?: string;
|
|
309
|
+
}>;
|
|
310
|
+
getAccounts: (userId?: string, serviceName?: string, env?: any) => Promise<{
|
|
311
|
+
success: boolean;
|
|
312
|
+
deploymentUrl: string;
|
|
313
|
+
userId?: string;
|
|
314
|
+
count: number;
|
|
315
|
+
accounts: any[];
|
|
316
|
+
error?: string;
|
|
317
|
+
}>;
|
|
318
|
+
listBackblazeBuckets: (payload: any, userId?: string, env?: any) => Promise<{
|
|
319
|
+
success: boolean;
|
|
320
|
+
buckets?: any[];
|
|
321
|
+
error?: string;
|
|
322
|
+
}>;
|
|
323
|
+
getSrklStatus: (env?: any) => Promise<{
|
|
324
|
+
success: boolean;
|
|
325
|
+
deploymentUrl: string;
|
|
326
|
+
online: boolean;
|
|
327
|
+
latencyMs: number;
|
|
328
|
+
details: any;
|
|
329
|
+
status?: undefined;
|
|
330
|
+
error?: undefined;
|
|
331
|
+
} | {
|
|
332
|
+
success: boolean;
|
|
333
|
+
deploymentUrl: string;
|
|
334
|
+
online: boolean;
|
|
335
|
+
status: number;
|
|
336
|
+
latencyMs: number;
|
|
337
|
+
details?: undefined;
|
|
338
|
+
error?: undefined;
|
|
339
|
+
} | {
|
|
340
|
+
success: boolean;
|
|
341
|
+
deploymentUrl: string;
|
|
342
|
+
online: boolean;
|
|
343
|
+
error: any;
|
|
344
|
+
latencyMs: number;
|
|
345
|
+
details?: undefined;
|
|
346
|
+
status?: undefined;
|
|
347
|
+
}>;
|
|
348
|
+
getDeploymentUrl: (env?: any) => Promise<string>;
|
|
296
349
|
};
|
|
297
350
|
|
|
298
351
|
export { type AdaptedStorageConnection, type AppAccountManifest, type AppServiceDeclaration, CANONICAL_SRKL_URL, type CredentialRegistryMap, type EcosystemAccount, type EcosystemAccountsRequest, type EcosystemAccountsResponse, type EcosystemServiceCategory, type KeyMaterial, type ServiceAccountEntry, SrklClient, type SrklClientOptions, SrklCredentialRegistry, type SrklEcosystemQueryOptions, type SrklEcosystemResponse, type SrklServiceAccount, SrklVaultAccessClient, type SrklVaultAccessResponse, type UseSrklServicesOptions, type UseSrklServicesResult, type VaultAccessClientOptions, createSrklClient, decryptVaultBufferInBrowser, getPrimarySrklDeploymentUrl, getSrklAccounts, globalCredentialRegistry, hexToBytes, srklListBackblazeBuckets, srklService, syncSrklAccounts, useSrklServices };
|
|
@@ -10,13 +10,14 @@ import {
|
|
|
10
10
|
srklService,
|
|
11
11
|
syncSrklAccounts,
|
|
12
12
|
useSrklServices
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-3IUA66RS.js";
|
|
14
14
|
import {
|
|
15
15
|
getPrimarySrklDeploymentUrl,
|
|
16
16
|
getSrklAccounts,
|
|
17
17
|
srklListBackblazeBuckets
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-XHADDA75.js";
|
|
19
19
|
import "../chunk-4QEMALXF.js";
|
|
20
|
+
import "../chunk-VAFCR2MS.js";
|
|
20
21
|
export {
|
|
21
22
|
CANONICAL_SRKL_URL,
|
|
22
23
|
SrklClient,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseStorageAdapter, S as StorageConfig, F as FileInfo, D as DeleteFolderResult, R as RenameFolderResult, C as ConnectionTestResult } from '../BaseStorageAdapter-
|
|
2
|
-
export { a as StorageMode, b as StorageProviderType, U as UploadResult } from '../BaseStorageAdapter-
|
|
1
|
+
import { B as BaseStorageAdapter, S as StorageConfig, F as FileInfo, D as DeleteFolderResult, R as RenameFolderResult, C as ConnectionTestResult } from '../BaseStorageAdapter-6x_BQiB3.js';
|
|
2
|
+
export { a as StorageMode, b as StorageProviderType, U as UploadResult } from '../BaseStorageAdapter-6x_BQiB3.js';
|
|
3
3
|
import '@ultrst-armada/kloks/functions';
|
|
4
4
|
|
|
5
5
|
declare class LocalFSAdapter extends BaseStorageAdapter {
|
|
@@ -59,6 +59,22 @@ declare class BackblazeB2Adapter extends BaseStorageAdapter {
|
|
|
59
59
|
testConnection(): Promise<ConnectionTestResult>;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
declare class GoogleDriveAdapter extends BaseStorageAdapter {
|
|
63
|
+
private token;
|
|
64
|
+
private request;
|
|
65
|
+
private findChild;
|
|
66
|
+
private resolveParent;
|
|
67
|
+
private split;
|
|
68
|
+
read(pathStr: string): Promise<Uint8Array>;
|
|
69
|
+
write(pathStr: string, data: Uint8Array | string, contentType?: string): Promise<void>;
|
|
70
|
+
delete(pathStr: string): Promise<void>;
|
|
71
|
+
exists(pathStr: string): Promise<boolean>;
|
|
72
|
+
list(pathStr?: string): Promise<FileInfo[]>;
|
|
73
|
+
stat(pathStr: string): Promise<FileInfo>;
|
|
74
|
+
mkdir(pathStr: string): Promise<void>;
|
|
75
|
+
testConnection(): Promise<ConnectionTestResult>;
|
|
76
|
+
}
|
|
77
|
+
|
|
62
78
|
/**
|
|
63
79
|
* Backblaze B2 Endpoint & Credential Normalizer
|
|
64
80
|
*/
|
|
@@ -121,4 +137,20 @@ declare function b2ListFileNames(keyId: string, applicationKey: string, bucketNa
|
|
|
121
137
|
declare function b2UploadFile(keyId: string, applicationKey: string, bucketName: string, fileName: string, content: Uint8Array | string, contentType?: string): Promise<any>;
|
|
122
138
|
declare function b2DownloadFile(keyId: string, applicationKey: string, bucketName: string, fileName: string): Promise<Uint8Array | null>;
|
|
123
139
|
|
|
124
|
-
|
|
140
|
+
interface GoogleDriveOAuthConfig {
|
|
141
|
+
clientId: string;
|
|
142
|
+
clientSecret?: string;
|
|
143
|
+
redirectUri: string;
|
|
144
|
+
scopes?: string[];
|
|
145
|
+
}
|
|
146
|
+
interface GoogleDriveTokenSet {
|
|
147
|
+
accessToken: string;
|
|
148
|
+
refreshToken?: string;
|
|
149
|
+
expiresAt?: number;
|
|
150
|
+
tokenType?: string;
|
|
151
|
+
}
|
|
152
|
+
declare function createGoogleDriveAuthorizationUrl(config: GoogleDriveOAuthConfig, state: string, codeChallenge?: string): string;
|
|
153
|
+
declare function exchangeGoogleDriveCode(config: GoogleDriveOAuthConfig, code: string, codeVerifier?: string): Promise<GoogleDriveTokenSet>;
|
|
154
|
+
declare function refreshGoogleDriveAccessToken(clientId: string, refreshToken: string): Promise<GoogleDriveTokenSet>;
|
|
155
|
+
|
|
156
|
+
export { type B2AuthToken, BackblazeB2Adapter, BaseStorageAdapter, ConnectionTestResult, DeleteFolderResult, FileInfo, GoogleDriveAdapter, type GoogleDriveOAuthConfig, type GoogleDriveTokenSet, LocalFSAdapter, RenameFolderResult, S3Adapter, StorageAdapterFactory, StorageConfig, SupabaseStorageAdapter, authorizeB2, b2DownloadFile, b2ListBuckets, b2ListFileNames, b2UploadFile, createGoogleDriveAuthorizationUrl, ensureS3DirectoryMarker, exchangeGoogleDriveCode, isSecretMasked, normalizeBackblazeCredentials, permanentDeleteS3Folder, permanentDeleteS3Object, refreshGoogleDriveAccessToken, renameS3Folder, resolveBackblazeEndpoint };
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
S3Adapter
|
|
3
|
+
} from "../chunk-JUPWFW7V.js";
|
|
2
4
|
import {
|
|
3
5
|
BackblazeB2Adapter,
|
|
4
6
|
BaseStorageAdapter,
|
|
7
|
+
GoogleDriveAdapter,
|
|
5
8
|
LocalFSAdapter,
|
|
6
|
-
S3Adapter,
|
|
7
9
|
StorageAdapterFactory,
|
|
8
10
|
SupabaseStorageAdapter,
|
|
11
|
+
createGoogleDriveAuthorizationUrl,
|
|
9
12
|
ensureS3DirectoryMarker,
|
|
13
|
+
exchangeGoogleDriveCode,
|
|
10
14
|
isSecretMasked,
|
|
11
15
|
normalizeBackblazeCredentials,
|
|
12
16
|
permanentDeleteS3Folder,
|
|
13
17
|
permanentDeleteS3Object,
|
|
18
|
+
refreshGoogleDriveAccessToken,
|
|
14
19
|
renameS3Folder,
|
|
15
20
|
resolveBackblazeEndpoint
|
|
16
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-R45CEV46.js";
|
|
17
22
|
import {
|
|
18
23
|
authorizeB2,
|
|
19
24
|
b2DownloadFile,
|
|
@@ -24,6 +29,7 @@ import {
|
|
|
24
29
|
export {
|
|
25
30
|
BackblazeB2Adapter,
|
|
26
31
|
BaseStorageAdapter,
|
|
32
|
+
GoogleDriveAdapter,
|
|
27
33
|
LocalFSAdapter,
|
|
28
34
|
S3Adapter,
|
|
29
35
|
StorageAdapterFactory,
|
|
@@ -33,11 +39,14 @@ export {
|
|
|
33
39
|
b2ListBuckets,
|
|
34
40
|
b2ListFileNames,
|
|
35
41
|
b2UploadFile,
|
|
42
|
+
createGoogleDriveAuthorizationUrl,
|
|
36
43
|
ensureS3DirectoryMarker,
|
|
44
|
+
exchangeGoogleDriveCode,
|
|
37
45
|
isSecretMasked,
|
|
38
46
|
normalizeBackblazeCredentials,
|
|
39
47
|
permanentDeleteS3Folder,
|
|
40
48
|
permanentDeleteS3Object,
|
|
49
|
+
refreshGoogleDriveAccessToken,
|
|
41
50
|
renameS3Folder,
|
|
42
51
|
resolveBackblazeEndpoint
|
|
43
52
|
};
|