@opengeni/core 0.19.0 → 0.20.2
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/dist/dependencies.d.ts +4 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/sandbox/fleet.d.ts +2 -0
- package/package.json +9 -9
- package/src/dependencies.ts +4 -0
- package/src/domain/resources.ts +2 -1
- package/src/sandbox/fleet.ts +12 -2
package/dist/dependencies.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Settings } from "@opengeni/config";
|
|
2
|
-
import type { ConnectionCredentialsPort, Document, GitHubAppApiPort, ScheduledTask, SessionAuthorizationPort, TurnInitiator } from "@opengeni/contracts";
|
|
2
|
+
import type { ConnectionCredentialsPort, Document, DocumentAuthorityKind, GitHubAppApiPort, ScheduledTask, SessionAuthorizationPort, TurnInitiator } from "@opengeni/contracts";
|
|
3
3
|
import type { Database } from "@opengeni/db";
|
|
4
4
|
import type { DocumentServices } from "@opengeni/documents";
|
|
5
5
|
import type { EventBus } from "@opengeni/events";
|
|
@@ -65,6 +65,9 @@ export type DocumentIndexClient = {
|
|
|
65
65
|
accountId: string;
|
|
66
66
|
workspaceId: string;
|
|
67
67
|
documentId: string;
|
|
68
|
+
authorityKind: DocumentAuthorityKind;
|
|
69
|
+
authorityWorkspaceId: string | null;
|
|
70
|
+
authoritySubjectId: string | null;
|
|
68
71
|
}) => Promise<Document | void>;
|
|
69
72
|
};
|
|
70
73
|
export type AppDependencies = {
|
package/dist/index.js
CHANGED
|
@@ -705,6 +705,7 @@ async function runOnSandbox(services, ctx, target, op) {
|
|
|
705
705
|
if (sandbox.kind !== "selfhosted" || !sandbox.enrollmentId) {
|
|
706
706
|
return {
|
|
707
707
|
target,
|
|
708
|
+
targetName: sandbox.name,
|
|
708
709
|
kind: op.kind,
|
|
709
710
|
ok: false,
|
|
710
711
|
reason: `run_on routes one-off ops to enrolled selfhosted machines; ${sandbox.kind} targets are reached via the active sandbox (swap to it first)`
|
|
@@ -712,9 +713,15 @@ async function runOnSandbox(services, ctx, target, op) {
|
|
|
712
713
|
}
|
|
713
714
|
const enrollment = await getEnrollment(services.db, ctx.workspaceId, sandbox.enrollmentId);
|
|
714
715
|
if (!enrollment || enrollment.status !== "active") {
|
|
715
|
-
return {
|
|
716
|
+
return {
|
|
717
|
+
target,
|
|
718
|
+
targetName: sandbox.name,
|
|
719
|
+
kind: op.kind,
|
|
720
|
+
ok: false,
|
|
721
|
+
reason: `sandbox ${target} is not enrolled/active`
|
|
722
|
+
};
|
|
716
723
|
}
|
|
717
|
-
|
|
724
|
+
const result = await executeRunOnSelfhostedMachine(
|
|
718
725
|
{
|
|
719
726
|
workspaceId: ctx.workspaceId,
|
|
720
727
|
agentId: sandbox.enrollmentId,
|
|
@@ -726,6 +733,7 @@ async function runOnSandbox(services, ctx, target, op) {
|
|
|
726
733
|
target,
|
|
727
734
|
op
|
|
728
735
|
);
|
|
736
|
+
return { ...result, targetName: sandbox.name };
|
|
729
737
|
}
|
|
730
738
|
async function provisionSandbox(services, ctx, input) {
|
|
731
739
|
if (input.kind === "selfhosted") {
|
|
@@ -3327,6 +3335,7 @@ import {
|
|
|
3327
3335
|
normalizeRepositorySubpath,
|
|
3328
3336
|
normalizeResourceMountPath,
|
|
3329
3337
|
resourceIdentityKey,
|
|
3338
|
+
resourceMountPath,
|
|
3330
3339
|
resourceMountPathCollisionKey,
|
|
3331
3340
|
ResourceRefConflictError,
|
|
3332
3341
|
ResourceMountPathError,
|
|
@@ -3388,7 +3397,7 @@ function normalizeResources(resources) {
|
|
|
3388
3397
|
for (const resource of resources) {
|
|
3389
3398
|
let normalized;
|
|
3390
3399
|
if (resource.kind === "file") {
|
|
3391
|
-
const mountPath = normalizeMountPath(resource
|
|
3400
|
+
const mountPath = normalizeMountPath(resourceMountPath(resource));
|
|
3392
3401
|
normalized = {
|
|
3393
3402
|
kind: "file",
|
|
3394
3403
|
fileId: resource.fileId,
|