@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.
@@ -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 { target, kind: op.kind, ok: false, reason: `sandbox ${target} is not enrolled/active` };
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
- return executeRunOnSelfhostedMachine(
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.mountPath ?? `files/${resource.fileId}`);
3400
+ const mountPath = normalizeMountPath(resourceMountPath(resource));
3392
3401
  normalized = {
3393
3402
  kind: "file",
3394
3403
  fileId: resource.fileId,