@ultrst-armada/kloks 2.0.4 → 2.1.0
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 +76 -1
- package/packages/backend/dist/api/index.js +2 -1
- package/packages/backend/dist/chunk-23LS4LWC.js +746 -0
- package/packages/backend/dist/chunk-3UZFKB4M.js +28 -0
- package/packages/backend/dist/chunk-5GW5PJWQ.js +96 -0
- package/packages/backend/dist/chunk-5SXOQAAX.js +41 -0
- package/packages/backend/dist/chunk-5UVJDX7Q.js +44 -0
- package/packages/backend/dist/{chunk-5F5V7NAG.js → chunk-5Y7K7HAT.js} +4 -1
- package/packages/backend/dist/chunk-6BL5DXFZ.js +43 -0
- package/packages/backend/dist/{chunk-OXEP3AP6.js → chunk-6I7I4C6H.js} +158 -1
- package/packages/backend/dist/{chunk-SQKG3S6P.js → chunk-AUNIGE6Q.js} +2 -2
- package/packages/backend/dist/{chunk-NY2SQOXI.js → chunk-CDRHYO44.js} +4 -1
- package/packages/backend/dist/{chunk-ZBNSK26X.js → chunk-CV55JMT7.js} +6 -5
- package/packages/backend/dist/{chunk-KPLDYX5Z.js → chunk-DJ457D5D.js} +33 -26
- package/packages/backend/dist/{chunk-FK3OAUXM.js → chunk-DTPCWHQJ.js} +4 -2
- package/packages/backend/dist/{chunk-OWMQLML7.js → chunk-EMSSTOOK.js} +33 -2
- package/packages/backend/dist/{chunk-Z6G32NQQ.js → chunk-ENMIBY2V.js} +12 -9
- package/packages/backend/dist/chunk-EQFZX3JT.js +63 -0
- package/packages/backend/dist/chunk-FKK23J2A.js +363 -0
- package/packages/backend/dist/chunk-GTKW4IGC.js +197 -0
- package/packages/backend/dist/chunk-GVMVYC6C.js +0 -0
- package/packages/backend/dist/chunk-HRJCGJTR.js +261 -0
- package/packages/backend/dist/chunk-I6T64MLT.js +171 -0
- package/packages/backend/dist/chunk-IKDYKRVH.js +51 -0
- package/packages/backend/dist/chunk-IP6XWQU2.js +48 -0
- package/packages/backend/dist/chunk-JGR6BJVX.js +74 -0
- package/packages/backend/dist/{chunk-POLVHTHJ.js → chunk-KCPQWJBO.js} +4 -1
- package/packages/backend/dist/chunk-LC6ULEM2.js +125 -0
- package/packages/backend/dist/{chunk-NTKUQVCQ.js → chunk-LMUMMVTU.js} +14 -2
- package/packages/backend/dist/chunk-LMY6MGFD.js +78 -0
- package/packages/backend/dist/chunk-NFK6YFTA.js +157 -0
- package/packages/backend/dist/chunk-NZWCPJDJ.js +82 -0
- package/packages/backend/dist/chunk-OT2PSPBK.js +74 -0
- package/packages/backend/dist/chunk-QYWVZBI6.js +54 -0
- package/packages/backend/dist/chunk-TOLAWKAY.js +1132 -0
- package/packages/backend/dist/{chunk-OQRQCDS6.js → chunk-TRJVVNO7.js} +2 -2
- package/packages/backend/dist/chunk-U7T65YUP.js +889 -0
- package/packages/backend/dist/chunk-YFMHT77Z.js +58 -0
- package/packages/backend/dist/client-JXGCPWEA.js +7 -0
- package/packages/backend/dist/control-plane/index.js +3 -1
- package/packages/backend/dist/core/b2DirectCore.test.d.ts +1 -0
- package/packages/backend/dist/core/cloudflareIntegrationCore.test.d.ts +1 -0
- package/packages/backend/dist/core/googleDriveOAuthCore.d.ts +51 -0
- package/packages/backend/dist/core/googleDriveOAuthCore.test.d.ts +1 -0
- package/packages/backend/dist/core/index.d.ts +3 -0
- package/packages/backend/dist/core/storageConnectionCore.d.ts +136 -0
- package/packages/backend/dist/core/storageConnectionCore.test.d.ts +1 -0
- package/packages/backend/dist/core/storageConnectionRuntimeCore.d.ts +57 -0
- package/packages/backend/dist/core/storageConnectionRuntimeCore.test.d.ts +1 -0
- package/packages/backend/dist/core/storageContracts.d.ts +77 -0
- package/packages/backend/dist/core/storageProviderRegistry.d.ts +7 -0
- package/packages/backend/dist/core/systemCredentialsCore.d.ts +46 -0
- package/packages/backend/dist/core/unifiedDb.d.ts +12 -2
- package/packages/backend/dist/core/unifiedDb.errors.test.d.ts +1 -0
- package/packages/backend/dist/core/unifiedDbNodeAdapter.d.ts +6 -0
- package/packages/backend/dist/core/workspaceBucketSyncCore.d.ts +3 -4
- package/packages/backend/dist/core/workspaceBucketSyncCore.test.d.ts +1 -0
- package/packages/backend/dist/core/workspaceCore.d.ts +25 -6
- package/packages/backend/dist/core/workspaceDataCore.test.d.ts +1 -0
- package/packages/backend/dist/core/workspaceFileCore.d.ts +25 -7
- package/packages/backend/dist/core/workspaceFileCore.test.d.ts +1 -0
- package/packages/backend/dist/core/workspaceFileNodeAdapter.d.ts +6 -0
- package/packages/backend/dist/core/workspaceStorageDetailsCore.d.ts +4 -8
- package/packages/backend/dist/core/workspaceStorageDetailsCore.test.d.ts +1 -0
- package/packages/backend/dist/development/index.js +1 -1
- package/packages/backend/dist/development/playwrightInspectionService.js +1 -1
- package/packages/backend/dist/development/playwrightInspectionSupport.d.ts +1 -0
- package/packages/backend/dist/index.d.ts +1 -0
- package/packages/backend/dist/index.js +130 -15
- package/packages/backend/dist/krnl-services.d.ts +0 -22
- package/packages/backend/dist/krnl-services.js +8 -19
- package/packages/backend/dist/krnl-services.node.d.ts +28 -0
- package/packages/backend/dist/node.d.ts +4 -0
- package/packages/backend/dist/node.js +670 -454
- package/packages/backend/dist/provider-services/capacity.d.ts +2 -0
- package/packages/backend/dist/provider-services/client.d.ts +18 -0
- package/packages/backend/dist/provider-services/cloudflare.d.ts +6 -0
- package/packages/backend/dist/provider-services/facades.d.ts +44 -0
- package/packages/backend/dist/provider-services/gemini.d.ts +8 -0
- package/packages/backend/dist/provider-services/google/cloud-run.d.ts +1 -0
- package/packages/backend/dist/provider-services/google/cloud-run.js +9 -0
- package/packages/backend/dist/provider-services/google/cloud-shell.d.ts +1 -0
- package/packages/backend/dist/provider-services/google/cloud-shell.js +9 -0
- package/packages/backend/dist/provider-services/google/cloud-storage.d.ts +1 -0
- package/packages/backend/dist/provider-services/google/cloud-storage.js +9 -0
- package/packages/backend/dist/provider-services/google/drive.d.ts +4 -0
- package/packages/backend/dist/provider-services/google/drive.js +20 -0
- package/packages/backend/dist/provider-services/google/gemini.d.ts +2 -0
- package/packages/backend/dist/provider-services/google/gemini.js +10 -0
- package/packages/backend/dist/provider-services/google/index.d.ts +3 -0
- package/packages/backend/dist/provider-services/google/index.js +17 -0
- package/packages/backend/dist/provider-services/google/vertex-ai.d.ts +1 -0
- package/packages/backend/dist/provider-services/google/vertex-ai.js +9 -0
- package/packages/backend/dist/provider-services/index.d.ts +11 -0
- package/packages/backend/dist/provider-services/index.js +118 -0
- package/packages/backend/dist/provider-services/node.d.ts +4 -0
- package/packages/backend/dist/provider-services/node.js +40 -0
- package/packages/backend/dist/provider-services/operations.d.ts +28 -0
- package/packages/backend/dist/provider-services/operations.test.d.ts +1 -0
- package/packages/backend/dist/provider-services/provider-services.test.d.ts +1 -0
- package/packages/backend/dist/provider-services/registry.d.ts +16 -0
- package/packages/backend/dist/provider-services/storage/backblaze-b2.d.ts +7 -0
- package/packages/backend/dist/provider-services/storage/backblaze-b2.js +8 -0
- package/packages/backend/dist/provider-services/storage/contract.d.ts +45 -0
- package/packages/backend/dist/provider-services/storage/dropbox.d.ts +3 -0
- package/packages/backend/dist/provider-services/storage/dropbox.js +12 -0
- package/packages/backend/dist/provider-services/storage/github.d.ts +4 -0
- package/packages/backend/dist/provider-services/storage/github.js +12 -0
- package/packages/backend/dist/provider-services/storage/google-drive.d.ts +4 -0
- package/packages/backend/dist/provider-services/storage/index.d.ts +7 -0
- package/packages/backend/dist/provider-services/storage/node.d.ts +2 -0
- package/packages/backend/dist/provider-services/storage/node.js +17 -0
- package/packages/backend/dist/provider-services/storage/service.d.ts +27 -0
- package/packages/backend/dist/provider-services/storage/storage-contract.test.d.ts +1 -0
- package/packages/backend/dist/provider-services/storage-facades.d.ts +55 -0
- package/packages/backend/dist/provider-services/storage-node.d.ts +11 -0
- package/packages/backend/dist/provider-services/storage-providers.d.ts +30 -0
- package/packages/backend/dist/provider-services/storage-providers.test.d.ts +1 -0
- package/packages/backend/dist/provider-services/storage.d.ts +3 -0
- package/packages/backend/dist/provider-services/storage.js +29 -0
- package/packages/backend/dist/provider-services/types.d.ts +61 -0
- package/packages/backend/dist/provider-services/vercel.d.ts +13 -0
- package/packages/backend/dist/resolver/index.js +13 -0
- package/packages/backend/dist/resolver/systemDatabaseUrl.d.ts +16 -12
- package/packages/backend/dist/services/node.js +12 -10
- package/packages/backend/dist/srkl/index.js +6 -4
- package/packages/backend/dist/storage/B2DirectClient.d.ts +7 -13
- package/packages/backend/dist/storage/B2DirectClient.test.d.ts +1 -0
- package/packages/backend/dist/storage/GoogleDriveWorkspaceService.d.ts +5 -0
- package/packages/backend/dist/storage/index.js +4 -3
- package/packages/backend/dist/storage/node.js +7 -6
- package/packages/backend/dist/storage-workspace.js +1 -1
- package/packages/backend/dist/workspace/index.js +2 -1
- package/packages/backend/dist/workspace/node.js +12 -7
- package/packages/backend/dist/workspaceFileCore-RQO7YMRD.js +28 -0
- package/packages/backend/package.json +78 -3
- package/packages/services/dist/index.js +8 -2
- package/packages/backend/dist/chunk-4QEMALXF.js +0 -90
- package/packages/backend/dist/chunk-AOZSDRNY.js +0 -159
- package/packages/backend/dist/chunk-GYSZ6CAX.js +0 -19
- package/packages/backend/dist/chunk-JCMB7BIM.js +0 -211
- package/packages/backend/dist/chunk-JGUWYVOL.js +0 -570
- package/packages/backend/dist/chunk-LMOM7CST.js +0 -427
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderClient
|
|
3
|
+
} from "./chunk-YFMHT77Z.js";
|
|
4
|
+
|
|
5
|
+
// src/provider-services/gemini.ts
|
|
6
|
+
async function listGeminiModels(connection, transport = fetch) {
|
|
7
|
+
const client = createProviderClient({ ...connection, providerId: "google-gemini" }, transport);
|
|
8
|
+
const { data } = await client.request({
|
|
9
|
+
path: "/v1beta/models"
|
|
10
|
+
});
|
|
11
|
+
return Array.isArray(data?.models) ? data.models : [];
|
|
12
|
+
}
|
|
13
|
+
function getGeminiQuotaStatus(accountId) {
|
|
14
|
+
return {
|
|
15
|
+
providerId: "google",
|
|
16
|
+
serviceId: "google-gemini",
|
|
17
|
+
accountId,
|
|
18
|
+
capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
19
|
+
metrics: [],
|
|
20
|
+
coverage: "unavailable",
|
|
21
|
+
error: "Model and project quota data must be measured or obtained from rate-limit headers"
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
listGeminiModels,
|
|
27
|
+
getGeminiQuotaStatus
|
|
28
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderClient
|
|
3
|
+
} from "./chunk-YFMHT77Z.js";
|
|
4
|
+
import {
|
|
5
|
+
resolveProviderServiceId
|
|
6
|
+
} from "./chunk-FKK23J2A.js";
|
|
7
|
+
|
|
8
|
+
// src/provider-services/storage-providers.ts
|
|
9
|
+
function serviceConnection(connection, provider) {
|
|
10
|
+
if (resolveProviderServiceId(connection.providerId) !== provider)
|
|
11
|
+
throw new Error("Credential provider does not match the requested service");
|
|
12
|
+
return connection;
|
|
13
|
+
}
|
|
14
|
+
function githubName(value) {
|
|
15
|
+
if (!/^[A-Za-z0-9_.-]+$/.test(value) || value === "." || value === "..")
|
|
16
|
+
throw new Error("Invalid GitHub repository owner or name");
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
function safeRepositoryPath(path) {
|
|
20
|
+
const parts = path.split("/");
|
|
21
|
+
if (parts.some((part) => part === "" || part === "." || part === ".."))
|
|
22
|
+
throw new Error("Invalid repository path");
|
|
23
|
+
return parts.map(encodeURIComponent).join("/");
|
|
24
|
+
}
|
|
25
|
+
async function listGitHubRepositories(connection, transport = fetch, page = 1) {
|
|
26
|
+
if (!Number.isSafeInteger(page) || page < 1 || page > 1e4)
|
|
27
|
+
throw new Error("Invalid GitHub repositories page");
|
|
28
|
+
const { data } = await createProviderClient(serviceConnection(connection, "github"), transport).request({
|
|
29
|
+
path: "/user/repos",
|
|
30
|
+
query: {
|
|
31
|
+
per_page: 100,
|
|
32
|
+
page,
|
|
33
|
+
affiliation: "owner,collaborator,organization_member"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
if (!Array.isArray(data)) throw new Error("Invalid GitHub repositories response");
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
async function listGitHubRepositoryContents(connection, owner, repo, path = "", transport = fetch) {
|
|
40
|
+
const suffix = path ? "/" + safeRepositoryPath(path) : "";
|
|
41
|
+
const { data } = await createProviderClient(serviceConnection(connection, "github"), transport).request({
|
|
42
|
+
path: `/repos/${githubName(owner)}/${githubName(repo)}/contents${suffix}`
|
|
43
|
+
});
|
|
44
|
+
return data;
|
|
45
|
+
}
|
|
46
|
+
async function listGitLabProjects(connection, transport = fetch) {
|
|
47
|
+
const { data } = await createProviderClient(serviceConnection(connection, "gitlab"), transport).request({
|
|
48
|
+
path: "/api/v4/projects",
|
|
49
|
+
query: { membership: true, per_page: 100 }
|
|
50
|
+
});
|
|
51
|
+
if (!Array.isArray(data)) throw new Error("Invalid GitLab projects response");
|
|
52
|
+
return data;
|
|
53
|
+
}
|
|
54
|
+
async function listGitLabRepositoryTree(connection, project, path = "", transport = fetch) {
|
|
55
|
+
const key = String(project).trim();
|
|
56
|
+
if (!key || key.includes("?") || key.includes("#")) throw new Error("GitLab project required");
|
|
57
|
+
if (path) safeRepositoryPath(path);
|
|
58
|
+
const { data } = await createProviderClient(serviceConnection(connection, "gitlab"), transport).request({
|
|
59
|
+
path: `/api/v4/projects/${encodeURIComponent(key)}/repository/tree`,
|
|
60
|
+
query: { per_page: 100, ...path ? { path } : {} }
|
|
61
|
+
});
|
|
62
|
+
if (!Array.isArray(data)) throw new Error("Invalid GitLab repository tree response");
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
async function listDropboxFolder(connection, path = "", transport = fetch) {
|
|
66
|
+
if (path && (!path.startsWith("/") || path.split("/").includes("..")))
|
|
67
|
+
throw new Error("Dropbox path must be an absolute path within the account");
|
|
68
|
+
const { data } = await createProviderClient(serviceConnection(connection, "dropbox"), transport).request({
|
|
69
|
+
path: "/2/files/list_folder",
|
|
70
|
+
method: "POST",
|
|
71
|
+
body: { path, recursive: false, limit: 100 }
|
|
72
|
+
});
|
|
73
|
+
if (!Array.isArray(data?.entries) || typeof data.cursor !== "string" || typeof data.has_more !== "boolean")
|
|
74
|
+
throw new Error("Invalid Dropbox folder response");
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
async function continueDropboxFolder(connection, cursor, transport = fetch) {
|
|
78
|
+
if (!cursor || typeof cursor !== "string") throw new Error("Dropbox cursor required");
|
|
79
|
+
const { data } = await createProviderClient(serviceConnection(connection, "dropbox"), transport).request({
|
|
80
|
+
path: "/2/files/list_folder/continue",
|
|
81
|
+
method: "POST",
|
|
82
|
+
body: { cursor }
|
|
83
|
+
});
|
|
84
|
+
if (!Array.isArray(data?.entries) || typeof data.cursor !== "string" || typeof data.has_more !== "boolean")
|
|
85
|
+
throw new Error("Invalid Dropbox cursor response");
|
|
86
|
+
return data;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
listGitHubRepositories,
|
|
91
|
+
listGitHubRepositoryContents,
|
|
92
|
+
listGitLabProjects,
|
|
93
|
+
listGitLabRepositoryTree,
|
|
94
|
+
listDropboxFolder,
|
|
95
|
+
continueDropboxFolder
|
|
96
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/provider-services/capacity.ts
|
|
2
|
+
function calculateProviderCapacity(snapshot, now = /* @__PURE__ */ new Date(), maxAgeMs = 10 * 6e4) {
|
|
3
|
+
const checkedAt = now.toISOString();
|
|
4
|
+
const unknown = (reason) => ({ status: "unknown", weight: 0, percentRemaining: null, bottleneck: null, reason, checkedAt });
|
|
5
|
+
const timestamp = Date.parse(snapshot.capturedAt);
|
|
6
|
+
if (!Number.isFinite(timestamp) || now.getTime() < timestamp - 3e4 || now.getTime() - timestamp > maxAgeMs) return unknown("Telemetry is stale or undated");
|
|
7
|
+
if (snapshot.error || snapshot.coverage === "unavailable") {
|
|
8
|
+
return unknown(snapshot.error || "Provider quota telemetry unavailable");
|
|
9
|
+
}
|
|
10
|
+
const enforced = snapshot.metrics.filter((m) => m.enforceable);
|
|
11
|
+
if (!enforced.length) return unknown("No provider-confirmed renewable quota windows");
|
|
12
|
+
if (snapshot.coverage !== "complete") return unknown("Required quota coverage is incomplete");
|
|
13
|
+
let bottleneck = null;
|
|
14
|
+
let minimum = 1;
|
|
15
|
+
for (const metric of enforced) {
|
|
16
|
+
if (metric.source !== "provider" || !validQuota(metric) || !metric.resetAt || Date.parse(metric.resetAt) <= now.getTime()) {
|
|
17
|
+
return unknown("Quota metric missing, estimated, or outside its reset window: " + metric.id);
|
|
18
|
+
}
|
|
19
|
+
const remaining = Math.max(0, Math.min(1, (metric.limit - metric.used) / metric.limit));
|
|
20
|
+
if (!bottleneck || remaining < minimum) {
|
|
21
|
+
minimum = remaining;
|
|
22
|
+
bottleneck = metric;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const status = minimum === 0 ? "exhausted" : "eligible";
|
|
26
|
+
return {
|
|
27
|
+
status,
|
|
28
|
+
weight: status === "eligible" ? Number(minimum.toFixed(4)) : 0,
|
|
29
|
+
percentRemaining: Math.round(minimum * 100),
|
|
30
|
+
bottleneck: bottleneck?.id ?? null,
|
|
31
|
+
reason: status === "eligible" ? "Provider-measured quota remaining" : "A required quota is exhausted",
|
|
32
|
+
checkedAt
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function validQuota(metric) {
|
|
36
|
+
return metric.used !== null && metric.limit !== null && Number.isFinite(metric.used) && Number.isFinite(metric.limit) && metric.used >= 0 && metric.limit > 0 && typeof metric.resetAt === "string" && Number.isFinite(Date.parse(metric.resetAt));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
calculateProviderCapacity
|
|
41
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/provider-services/storage/contract.ts
|
|
2
|
+
var UnsupportedStorageOperation = class extends Error {
|
|
3
|
+
constructor(providerId, operation) {
|
|
4
|
+
super(`Storage provider ${providerId} does not support ${operation} through this adapter`);
|
|
5
|
+
this.providerId = providerId;
|
|
6
|
+
this.operation = operation;
|
|
7
|
+
this.name = "UnsupportedStorageOperation";
|
|
8
|
+
}
|
|
9
|
+
providerId;
|
|
10
|
+
operation;
|
|
11
|
+
code = "STORAGE_OPERATION_UNSUPPORTED";
|
|
12
|
+
};
|
|
13
|
+
function assertStorageOperation(service, operation) {
|
|
14
|
+
if (!service.capabilities[operation])
|
|
15
|
+
throw new UnsupportedStorageOperation(service.providerId, operation);
|
|
16
|
+
}
|
|
17
|
+
function normalizeStoragePath(path = "") {
|
|
18
|
+
if (path.includes("\\") || path.includes("?") || path.includes("#") || /[\x00-\x1f]/.test(path))
|
|
19
|
+
throw new Error("Invalid storage path");
|
|
20
|
+
const parts = path.replace(/^\/+|\/+$/g, "").split("/").filter(Boolean);
|
|
21
|
+
if (parts.some((p) => p === "." || p === ".." || p === "%2e" || p === "%2e%2e"))
|
|
22
|
+
throw new Error("Storage path traversal is not permitted");
|
|
23
|
+
return parts.join("/");
|
|
24
|
+
}
|
|
25
|
+
function readOnlyService(id) {
|
|
26
|
+
return {
|
|
27
|
+
read: async () => {
|
|
28
|
+
throw new UnsupportedStorageOperation(id, "read");
|
|
29
|
+
},
|
|
30
|
+
write: async () => {
|
|
31
|
+
throw new UnsupportedStorageOperation(id, "write");
|
|
32
|
+
},
|
|
33
|
+
delete: async () => {
|
|
34
|
+
throw new UnsupportedStorageOperation(id, "delete");
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
UnsupportedStorageOperation,
|
|
41
|
+
assertStorageOperation,
|
|
42
|
+
normalizeStoragePath,
|
|
43
|
+
readOnlyService
|
|
44
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeStoragePath
|
|
3
|
+
} from "./chunk-5UVJDX7Q.js";
|
|
4
|
+
import {
|
|
5
|
+
GoogleDriveWorkspaceService
|
|
6
|
+
} from "./chunk-EMSSTOOK.js";
|
|
7
|
+
|
|
8
|
+
// src/provider-services/storage/google-drive.ts
|
|
9
|
+
function createGoogleDriveStorageService(options) {
|
|
10
|
+
const drive = new GoogleDriveWorkspaceService(options);
|
|
11
|
+
return {
|
|
12
|
+
providerId: "google-drive",
|
|
13
|
+
capabilities: Object.freeze({ list: true, read: true, write: true, delete: true }),
|
|
14
|
+
async list(path = "", cursor) {
|
|
15
|
+
if (cursor) throw new Error("Google Drive adapter handles pagination internally");
|
|
16
|
+
const files = await drive.list(normalizeStoragePath(path));
|
|
17
|
+
return {
|
|
18
|
+
entries: files.map((file) => ({
|
|
19
|
+
id: String(file.id || file.path),
|
|
20
|
+
path: "/" + file.path,
|
|
21
|
+
name: file.path.split("/").pop() || file.path,
|
|
22
|
+
kind: file.isFolder ? "folder" : "file",
|
|
23
|
+
...Number.isFinite(file.size) ? { size: file.size } : {}
|
|
24
|
+
})),
|
|
25
|
+
nextCursor: null,
|
|
26
|
+
complete: true
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
read(path) {
|
|
30
|
+
return drive.read(normalizeStoragePath(path));
|
|
31
|
+
},
|
|
32
|
+
write(path, content, contentType) {
|
|
33
|
+
return drive.write(normalizeStoragePath(path), content, contentType);
|
|
34
|
+
},
|
|
35
|
+
delete(path) {
|
|
36
|
+
return drive.delete(normalizeStoragePath(path));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
createGoogleDriveStorageService
|
|
43
|
+
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StorageAdapterFactory
|
|
3
|
+
} from "./chunk-AUNIGE6Q.js";
|
|
4
|
+
import {
|
|
5
|
+
findUserWorkspace
|
|
6
|
+
} from "./chunk-23LS4LWC.js";
|
|
7
|
+
|
|
1
8
|
// src/services/ServiceBoundary.ts
|
|
2
9
|
import {
|
|
3
10
|
createService,
|
|
@@ -327,6 +334,155 @@ var NodeGraphPersistenceService = class {
|
|
|
327
334
|
};
|
|
328
335
|
var nodeGraphPersistence = new NodeGraphPersistenceService();
|
|
329
336
|
|
|
337
|
+
// src/services/workspaceGraphService.ts
|
|
338
|
+
function slugify(name) {
|
|
339
|
+
const value = String(name || "").trim().replace(/[/\\]+/g, "_").replace(/[<>:"|?*]/g, "").slice(0, 80);
|
|
340
|
+
return value || "New Graph";
|
|
341
|
+
}
|
|
342
|
+
function storage() {
|
|
343
|
+
return StorageAdapterFactory.create({
|
|
344
|
+
provider: "local_fs",
|
|
345
|
+
basePath: process.env.KLOKS_GRAPH_STORAGE_ROOT || "./workspaces-data"
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
function graphPath(workspaceId, slug) {
|
|
349
|
+
return `workspaces/${workspaceId}/graphs/${slug}.graph.json`;
|
|
350
|
+
}
|
|
351
|
+
async function assertWorkspace(userId, workspaceId) {
|
|
352
|
+
const result = await findUserWorkspace(workspaceId);
|
|
353
|
+
if (!result.workspace || !result.user || result.user.id !== userId) {
|
|
354
|
+
throw new Error(`Workspace ${workspaceId} does not exist`);
|
|
355
|
+
}
|
|
356
|
+
return result.workspace;
|
|
357
|
+
}
|
|
358
|
+
async function readGraph(workspaceId, slug) {
|
|
359
|
+
const adapter = storage();
|
|
360
|
+
const path = graphPath(workspaceId, slug);
|
|
361
|
+
if (!await adapter.exists(path)) return null;
|
|
362
|
+
const raw = new TextDecoder().decode(await adapter.read(path));
|
|
363
|
+
return JSON.parse(raw);
|
|
364
|
+
}
|
|
365
|
+
async function writeGraph(document) {
|
|
366
|
+
const adapter = storage();
|
|
367
|
+
await adapter.write(graphPath(document.workspaceId, document.graphSlug), JSON.stringify(document, null, 2), "application/json");
|
|
368
|
+
}
|
|
369
|
+
function toDocument(workspaceId, id, name, slug, nodes = [], edges = [], createdAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
370
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
371
|
+
return {
|
|
372
|
+
$schema: "https://skipo.dev/schemas/node-graph.v1.json",
|
|
373
|
+
version: "1.0.0",
|
|
374
|
+
appId: workspaceId,
|
|
375
|
+
appName: name,
|
|
376
|
+
createdAt,
|
|
377
|
+
updatedAt: now,
|
|
378
|
+
exportedAt: now,
|
|
379
|
+
workspaceId,
|
|
380
|
+
graphId: id,
|
|
381
|
+
graphSlug: slug,
|
|
382
|
+
graph: { nodes, edges }
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
var workspaceGraphService = {
|
|
386
|
+
async listGraphs(userId, workspaceId) {
|
|
387
|
+
await assertWorkspace(userId, workspaceId);
|
|
388
|
+
const adapter = storage();
|
|
389
|
+
const files = await adapter.list(`workspaces/${workspaceId}/graphs`);
|
|
390
|
+
const graphs = [];
|
|
391
|
+
for (const file of files.filter((item) => item.path.endsWith(".graph.json"))) {
|
|
392
|
+
try {
|
|
393
|
+
const raw = new TextDecoder().decode(await adapter.read(file.path));
|
|
394
|
+
const graph = JSON.parse(raw);
|
|
395
|
+
graphs.push({
|
|
396
|
+
id: graph.graphId,
|
|
397
|
+
name: graph.appName,
|
|
398
|
+
slug: graph.graphSlug,
|
|
399
|
+
createdAt: graph.createdAt,
|
|
400
|
+
updatedAt: graph.updatedAt,
|
|
401
|
+
nodeCount: graph.graph.nodes.length
|
|
402
|
+
});
|
|
403
|
+
} catch {
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
graphs.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
407
|
+
return { success: true, graphs };
|
|
408
|
+
},
|
|
409
|
+
async createGraph(userId, workspaceId, input) {
|
|
410
|
+
await assertWorkspace(userId, workspaceId);
|
|
411
|
+
const targetName = String(input?.name || "").trim().slice(0, 80) || "New Graph";
|
|
412
|
+
const baseSlug = slugify(targetName);
|
|
413
|
+
let slug = baseSlug;
|
|
414
|
+
let n = 2;
|
|
415
|
+
while (await readGraph(workspaceId, slug)) slug = `${baseSlug} (${n++})`;
|
|
416
|
+
const graph = toDocument(workspaceId, `graph-${Date.now()}`, targetName, slug);
|
|
417
|
+
await writeGraph(graph);
|
|
418
|
+
return { success: true, graph, graphs: (await this.listGraphs(userId, workspaceId)).graphs };
|
|
419
|
+
},
|
|
420
|
+
async getGraph(userId, workspaceId, slug) {
|
|
421
|
+
await assertWorkspace(userId, workspaceId);
|
|
422
|
+
const graph = await readGraph(workspaceId, slug);
|
|
423
|
+
if (!graph) throw new Error(`Graph "${slug}" not found`);
|
|
424
|
+
return { success: true, graph };
|
|
425
|
+
},
|
|
426
|
+
async saveGraph(userId, workspaceId, slug, patch) {
|
|
427
|
+
await assertWorkspace(userId, workspaceId);
|
|
428
|
+
const existing = await readGraph(workspaceId, slug);
|
|
429
|
+
if (!existing) throw new Error(`Graph "${slug}" not found`);
|
|
430
|
+
const next = {
|
|
431
|
+
...existing,
|
|
432
|
+
appName: typeof patch.name === "string" && patch.name.trim() ? patch.name.trim().slice(0, 80) : existing.appName,
|
|
433
|
+
graph: {
|
|
434
|
+
nodes: Array.isArray(patch.nodes) ? patch.nodes : existing.graph.nodes,
|
|
435
|
+
edges: Array.isArray(patch.edges) ? patch.edges : existing.graph.edges
|
|
436
|
+
},
|
|
437
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
438
|
+
exportedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
439
|
+
};
|
|
440
|
+
await writeGraph(next);
|
|
441
|
+
return { success: true, graph: next };
|
|
442
|
+
},
|
|
443
|
+
async deleteGraph(userId, workspaceId, slug) {
|
|
444
|
+
await assertWorkspace(userId, workspaceId);
|
|
445
|
+
const adapter = storage();
|
|
446
|
+
const path = graphPath(workspaceId, slug);
|
|
447
|
+
if (!await adapter.exists(path)) throw new Error(`Graph "${slug}" not found`);
|
|
448
|
+
await adapter.delete(path);
|
|
449
|
+
return { success: true, deletedSlug: slug, graphs: (await this.listGraphs(userId, workspaceId)).graphs };
|
|
450
|
+
},
|
|
451
|
+
async duplicateGraph(userId, workspaceId, slug, newName) {
|
|
452
|
+
const existing = (await this.getGraph(userId, workspaceId, slug)).graph;
|
|
453
|
+
const targetName = (newName || `${existing.appName} (Copy)`).trim().slice(0, 80);
|
|
454
|
+
const baseSlug = slugify(targetName);
|
|
455
|
+
let newSlug = baseSlug;
|
|
456
|
+
let n = 2;
|
|
457
|
+
while (await readGraph(workspaceId, newSlug)) newSlug = `${baseSlug} (${n++})`;
|
|
458
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
459
|
+
const graph = {
|
|
460
|
+
...JSON.parse(JSON.stringify(existing)),
|
|
461
|
+
graphId: `graph-${Date.now()}`,
|
|
462
|
+
graphSlug: newSlug,
|
|
463
|
+
appName: targetName,
|
|
464
|
+
createdAt: now,
|
|
465
|
+
updatedAt: now,
|
|
466
|
+
exportedAt: now
|
|
467
|
+
};
|
|
468
|
+
await writeGraph(graph);
|
|
469
|
+
return { success: true, graph, graphs: (await this.listGraphs(userId, workspaceId)).graphs };
|
|
470
|
+
},
|
|
471
|
+
async clearGraph(userId, workspaceId, slug) {
|
|
472
|
+
const existing = (await this.getGraph(userId, workspaceId, slug)).graph;
|
|
473
|
+
return this.saveGraph(userId, workspaceId, slug, { nodes: [], edges: [] });
|
|
474
|
+
},
|
|
475
|
+
async getGraphDocument(userId, workspaceId, slug) {
|
|
476
|
+
return (await this.getGraph(userId, workspaceId, slug)).graph;
|
|
477
|
+
},
|
|
478
|
+
async saveGraphDocument(userId, workspaceId, document) {
|
|
479
|
+
await assertWorkspace(userId, workspaceId);
|
|
480
|
+
if (document.workspaceId !== workspaceId) throw new Error("Graph workspace mismatch");
|
|
481
|
+
await writeGraph({ ...document, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), exportedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
482
|
+
return { success: true, graph: document };
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
|
|
330
486
|
export {
|
|
331
487
|
createLocalService,
|
|
332
488
|
createRemoteService,
|
|
@@ -339,5 +495,6 @@ export {
|
|
|
339
495
|
exportGraphAsJsonFile,
|
|
340
496
|
parseGraphJsonFile,
|
|
341
497
|
NodeGraphPersistenceService,
|
|
342
|
-
nodeGraphPersistence
|
|
498
|
+
nodeGraphPersistence,
|
|
499
|
+
workspaceGraphService
|
|
343
500
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GoogleDriveStorageService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TRJVVNO7.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeBackblazeCredentials,
|
|
6
6
|
resolveBackblazeEndpoint
|
|
7
7
|
} from "./chunk-HUY4272L.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseStorageAdapter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5Y7K7HAT.js";
|
|
11
11
|
|
|
12
12
|
// src/storage/LocalFSAdapter.ts
|
|
13
13
|
import { promises as fs } from "fs";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SkipoBase
|
|
3
|
+
} from "./chunk-LMY6MGFD.js";
|
|
4
|
+
|
|
1
5
|
// src/workspace/WorkspaceCloneSyncEngine.ts
|
|
2
|
-
import { SkipoBase } from "@ultrst-armada/kloks/functions/base";
|
|
3
6
|
var WorkspaceCloneSyncEngine = class extends SkipoBase {
|
|
4
7
|
constructor() {
|
|
5
8
|
super({ name: "WorkspaceCloneSyncEngine" });
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SkipoBase
|
|
3
|
+
} from "./chunk-LMY6MGFD.js";
|
|
4
|
+
|
|
1
5
|
// src/control-plane/AuditLogger.ts
|
|
2
6
|
import { promises as fs } from "fs";
|
|
3
7
|
import path from "path";
|
|
4
|
-
import { SkipoBase } from "@ultrst-armada/kloks/functions/base";
|
|
5
8
|
var AuditLogger = class extends SkipoBase {
|
|
6
9
|
logFile;
|
|
7
10
|
constructor(logFile = ".skipo/audit.jsonl") {
|
|
@@ -41,8 +44,7 @@ var AuditLogger = class extends SkipoBase {
|
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
// src/control-plane/DatabaseClusterManager.ts
|
|
44
|
-
|
|
45
|
-
var DatabaseClusterManager = class _DatabaseClusterManager extends SkipoBase2 {
|
|
47
|
+
var DatabaseClusterManager = class _DatabaseClusterManager extends SkipoBase {
|
|
46
48
|
config;
|
|
47
49
|
health = /* @__PURE__ */ new Map();
|
|
48
50
|
constructor(config) {
|
|
@@ -116,8 +118,7 @@ function resolveSystemDatabaseClusterNodes(env = process.env) {
|
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
// src/control-plane/ControlPlaneManager.ts
|
|
119
|
-
|
|
120
|
-
var ControlPlaneManager = class extends SkipoBase3 {
|
|
121
|
+
var ControlPlaneManager = class extends SkipoBase {
|
|
121
122
|
auth;
|
|
122
123
|
audit;
|
|
123
124
|
cluster;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveUserStorageConnectionSecret
|
|
3
|
+
} from "./chunk-TOLAWKAY.js";
|
|
1
4
|
import {
|
|
2
5
|
b2ListBuckets
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-I6T64MLT.js";
|
|
4
7
|
|
|
5
8
|
// src/srkl/SrklDiscoveryService.ts
|
|
6
9
|
var cachedSrklUrls = null;
|
|
@@ -52,23 +55,13 @@ async function getSrklAccounts(userId, service, queryDb) {
|
|
|
52
55
|
if (!seenKeys.has(key)) {
|
|
53
56
|
seenKeys.add(key);
|
|
54
57
|
accounts.push({
|
|
55
|
-
id: conn.id,
|
|
56
|
-
name: conn.label || conn.id,
|
|
57
|
-
provider: conn.provider,
|
|
58
|
-
serviceId: conn.provider,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
bucketName: conn.b2BucketName || conn.bucketName,
|
|
63
|
-
region: conn.b2Region || conn.region,
|
|
64
|
-
endpoint: conn.b2Endpoint || conn.endpoint,
|
|
65
|
-
email: conn.googleEmail,
|
|
66
|
-
rootFolderId: conn.googleRootFolderId,
|
|
67
|
-
rootFolderName: conn.googleRootFolderName,
|
|
68
|
-
accessToken: conn.googleAccessToken,
|
|
69
|
-
accessTokenExpiresAt: conn.googleAccessTokenExpiresAt,
|
|
70
|
-
refreshToken: conn.googleRefreshToken
|
|
71
|
-
}
|
|
58
|
+
id: String(conn.id),
|
|
59
|
+
name: String(conn.label || conn.id),
|
|
60
|
+
provider: String(conn.provider || ""),
|
|
61
|
+
serviceId: String(conn.provider || ""),
|
|
62
|
+
category: "storage",
|
|
63
|
+
status: conn.testStatus === "ok" ? "CONNECTED" : conn.enabled === false ? "DISABLED" : "ACTIVE",
|
|
64
|
+
emailOrSlug: conn.googleEmail || conn.label || conn.id
|
|
72
65
|
});
|
|
73
66
|
}
|
|
74
67
|
}
|
|
@@ -87,11 +80,19 @@ async function getSrklAccounts(userId, service, queryDb) {
|
|
|
87
80
|
for (const item of list) {
|
|
88
81
|
const sId = String(item.serviceId || item.id || "").toLowerCase();
|
|
89
82
|
if (service && !sId.includes(service.toLowerCase())) continue;
|
|
90
|
-
const
|
|
91
|
-
const key =
|
|
83
|
+
const id = String(item.id || `srkl-${sId}`);
|
|
84
|
+
const key = `id:${id}`;
|
|
92
85
|
if (!seenKeys.has(key)) {
|
|
93
86
|
seenKeys.add(key);
|
|
94
|
-
accounts.push(
|
|
87
|
+
accounts.push({
|
|
88
|
+
id,
|
|
89
|
+
name: String(item.name || item.label || sId),
|
|
90
|
+
serviceId: sId,
|
|
91
|
+
provider: String(item.provider || item.serviceId || ""),
|
|
92
|
+
category: String(item.category || "storage"),
|
|
93
|
+
status: String(item.status || "ACTIVE"),
|
|
94
|
+
...typeof item.emailOrSlug === "string" ? { emailOrSlug: item.emailOrSlug } : {}
|
|
95
|
+
});
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
}
|
|
@@ -102,12 +103,18 @@ async function getSrklAccounts(userId, service, queryDb) {
|
|
|
102
103
|
async function srklListBackblazeBuckets(keyId, applicationKey, _bucketId, _bucketName, userId, queryDb, accountId) {
|
|
103
104
|
let resolvedKeyId = (keyId || "").trim();
|
|
104
105
|
let resolvedAppKey = (applicationKey || "").trim();
|
|
105
|
-
if ((!resolvedKeyId || !resolvedAppKey) &&
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
if ((!resolvedKeyId || !resolvedAppKey) && userId) {
|
|
107
|
+
const matched = await resolveUserStorageConnectionSecret(
|
|
108
|
+
userId,
|
|
109
|
+
accountId,
|
|
110
|
+
queryDb,
|
|
111
|
+
"backblaze_b2"
|
|
112
|
+
);
|
|
108
113
|
if (matched) {
|
|
109
|
-
resolvedKeyId = matched.
|
|
110
|
-
resolvedAppKey =
|
|
114
|
+
resolvedKeyId = String(matched.b2KeyId || matched.keyId || matched.accessKeyId || "").trim();
|
|
115
|
+
resolvedAppKey = String(
|
|
116
|
+
matched.b2ApplicationKey || matched.applicationKey || matched.appKey || matched.secretAccessKey || ""
|
|
117
|
+
).trim();
|
|
111
118
|
}
|
|
112
119
|
}
|
|
113
120
|
if (!resolvedKeyId || !resolvedAppKey) {
|
|
@@ -42,7 +42,11 @@ function quoteDriveQuery(value) {
|
|
|
42
42
|
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
|
43
43
|
}
|
|
44
44
|
async function parseJson(response) {
|
|
45
|
-
|
|
45
|
+
try {
|
|
46
|
+
return await response.json();
|
|
47
|
+
} catch {
|
|
48
|
+
throw new Error("Google Drive returned an invalid JSON response.");
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
async function persistTokensSafely(persistTokens, tokens) {
|
|
48
52
|
if (!persistTokens) return;
|
|
@@ -234,7 +238,10 @@ var GoogleDriveWorkspaceService = class _GoogleDriveWorkspaceService {
|
|
|
234
238
|
url.searchParams.set("includeItemsFromAllDrives", "true");
|
|
235
239
|
if (pageToken) url.searchParams.set("pageToken", pageToken);
|
|
236
240
|
const data = await parseJson(await this.api(url.toString()));
|
|
237
|
-
if (Array.isArray(data.files))
|
|
241
|
+
if (!Array.isArray(data.files)) {
|
|
242
|
+
throw new Error("Google Drive file listing returned an invalid response.");
|
|
243
|
+
}
|
|
244
|
+
files.push(...data.files);
|
|
238
245
|
pageToken = typeof data.nextPageToken === "string" ? data.nextPageToken : "";
|
|
239
246
|
} while (pageToken);
|
|
240
247
|
return files;
|
|
@@ -291,7 +298,31 @@ var GoogleDriveWorkspaceService = class _GoogleDriveWorkspaceService {
|
|
|
291
298
|
...typeof data.user?.emailAddress === "string" ? { email: data.user.emailAddress } : {}
|
|
292
299
|
};
|
|
293
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Folder browsing is always rooted at the persisted workspace root. A caller
|
|
303
|
+
* may browse a descendant, but cannot supply an unrelated Drive folder ID.
|
|
304
|
+
*/
|
|
305
|
+
async assertFolderWithinRoot(folderId) {
|
|
306
|
+
const rootId = this.options.rootFolderId || "root";
|
|
307
|
+
if (!folderId || folderId === rootId) return;
|
|
308
|
+
const pending = [folderId];
|
|
309
|
+
const visited = /* @__PURE__ */ new Set();
|
|
310
|
+
while (pending.length && visited.size < 128) {
|
|
311
|
+
const current = pending.shift();
|
|
312
|
+
if (current === rootId) return;
|
|
313
|
+
if (current === "root" && rootId !== "root") break;
|
|
314
|
+
if (visited.has(current)) continue;
|
|
315
|
+
visited.add(current);
|
|
316
|
+
const folder = await this.resolveFolder(current);
|
|
317
|
+
for (const parentId of folder.parentIds) {
|
|
318
|
+
if (parentId === rootId) return;
|
|
319
|
+
if (!visited.has(parentId)) pending.push(parentId);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
throw new Error("The selected Google Drive folder is outside the configured workspace root.");
|
|
323
|
+
}
|
|
294
324
|
async listFolders(parentFolderId = this.options.rootFolderId || "root") {
|
|
325
|
+
await this.assertFolderWithinRoot(parentFolderId);
|
|
295
326
|
const files = await this.listFiles(
|
|
296
327
|
parentFolderId,
|
|
297
328
|
`mimeType = '${FOLDER_MIME_TYPE}' and trashed = false`
|