@opengeni/contracts 3.0.0-canary.0 → 3.0.1-canary.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/dist/atlassian.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  AtlassianSyncCadence,
18
18
  SaveAtlassianSourcesRequest,
19
19
  atlassianScopesAllowRead
20
- } from "./chunk-OO4AEMQB.js";
20
+ } from "./chunk-FBXZZSXA.js";
21
21
  import "./chunk-YBW5JSA3.js";
22
22
  import "./chunk-O5LEQHDM.js";
23
23
  import "./chunk-GRG7PHWQ.js";
@@ -5517,11 +5517,26 @@ var McpMutationReceipt = z21.object({
5517
5517
  // src/sandbox-snapshots.ts
5518
5518
  var WORKSPACE_ARCHIVE_DESCRIPTOR_VERSION = 2;
5519
5519
  var WORKSPACE_ARCHIVE_OBJECT_REF_SCHEMA = "sandbox_archive_object_v1";
5520
- var OBJECT_KEY = /^sandbox-archives\/v1\/[0-9a-f-]{36}\/[0-9a-f-]{36}\/[0-9a-f-]{36}\/wa1:[0-9]{13}:[0-9a-f]{64}\.tar$/i;
5520
+ var UPLOAD_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
5521
+ var OBJECT_KEY = /^sandbox-archives\/v1\/([0-9a-f-]{36})\/([0-9a-f-]{36})\/([0-9a-f-]{36})\/(wa1:[0-9]{13}:[0-9a-f]{64})(?:\.([0-9a-f-]+))?\.tar$/i;
5522
+ function parseWorkspaceArchiveObjectKey(value) {
5523
+ if (typeof value !== "string") return null;
5524
+ const match = OBJECT_KEY.exec(value);
5525
+ if (!match || match[0] !== value || match[5] !== void 0 && !UPLOAD_ID.test(match[5])) {
5526
+ return null;
5527
+ }
5528
+ return {
5529
+ accountId: match[1],
5530
+ workspaceId: match[2],
5531
+ sandboxGroupId: match[3],
5532
+ revision: match[4],
5533
+ uploadId: match[5] ?? null
5534
+ };
5535
+ }
5521
5536
  function parseWorkspaceArchiveObjectRef(value) {
5522
5537
  if (!value || typeof value !== "object" || Array.isArray(value)) return null;
5523
5538
  const candidate = value;
5524
- if (candidate.schema !== WORKSPACE_ARCHIVE_OBJECT_REF_SCHEMA || typeof candidate.key !== "string" || !OBJECT_KEY.test(candidate.key) || typeof candidate.sha256 !== "string" || !SHA256.test(candidate.sha256) || !nonnegativeInteger(candidate.bytes) || candidate.bytes <= 0 || typeof candidate.backend !== "string" || candidate.backend.length === 0 || candidate.backend.length > 64) {
5539
+ if (candidate.schema !== WORKSPACE_ARCHIVE_OBJECT_REF_SCHEMA || typeof candidate.key !== "string" || !parseWorkspaceArchiveObjectKey(candidate.key) || typeof candidate.sha256 !== "string" || !SHA256.test(candidate.sha256) || !nonnegativeInteger(candidate.bytes) || candidate.bytes <= 0 || typeof candidate.backend !== "string" || candidate.backend.length === 0 || candidate.backend.length > 64) {
5525
5540
  return null;
5526
5541
  }
5527
5542
  return {
@@ -5533,7 +5548,18 @@ function parseWorkspaceArchiveObjectRef(value) {
5533
5548
  };
5534
5549
  }
5535
5550
  function workspaceArchiveObjectKey(input) {
5536
- return `sandbox-archives/v1/${input.accountId}/${input.workspaceId}/${input.sandboxGroupId}/${input.revision}.tar`;
5551
+ if (input.uploadId !== void 0 && (!UPLOAD_ID.test(input.uploadId) || input.uploadId.length !== 36)) {
5552
+ throw new Error("Invalid workspace archive upload UUID");
5553
+ }
5554
+ return `sandbox-archives/v1/${input.accountId}/${input.workspaceId}/${input.sandboxGroupId}/${input.revision}${input.uploadId === void 0 ? "" : `.${input.uploadId}`}.tar`;
5555
+ }
5556
+ function validateWorkspaceArchiveObjectRef(value, input) {
5557
+ const ref = parseWorkspaceArchiveObjectRef(value);
5558
+ const key = ref && parseWorkspaceArchiveObjectKey(ref.key);
5559
+ const descriptor = parseWorkspaceArchiveDescriptor(input.descriptor);
5560
+ if (!ref || !key || descriptor?.version !== 1 || key.accountId.toLowerCase() !== input.accountId.toLowerCase() || key.workspaceId.toLowerCase() !== input.workspaceId.toLowerCase() || key.sandboxGroupId.toLowerCase() !== input.sandboxGroupId.toLowerCase() || key.revision !== descriptor.revision || ref.sha256 !== descriptor.archiveSha256 || ref.bytes !== descriptor.archiveBytes)
5561
+ return null;
5562
+ return ref;
5537
5563
  }
5538
5564
  function workspaceArchivePayloadPresent(sessionState) {
5539
5565
  if (!sessionState) return false;
@@ -13145,7 +13171,10 @@ var SessionAuthorizationActor = z36.discriminatedUnion("kind", [
13145
13171
  /** Frozen authority that admitted the calling turn. */
13146
13172
  initiator: TurnInitiator,
13147
13173
  initiatorContext: TurnInitiatorContext,
13148
- /** Durable causal human for delegated/service work; null for pure service work. */
13174
+ /**
13175
+ * Durable causal-human selector for named human-bound capabilities. It never
13176
+ * authorizes by itself and is null for pure service work.
13177
+ */
13149
13178
  initiatingHumanSubjectId: z36.string().min(1).max(1024).nullable()
13150
13179
  })
13151
13180
  ]);
@@ -21169,8 +21198,10 @@ export {
21169
21198
  McpMutationReceipt,
21170
21199
  WORKSPACE_ARCHIVE_DESCRIPTOR_VERSION,
21171
21200
  WORKSPACE_ARCHIVE_OBJECT_REF_SCHEMA,
21201
+ parseWorkspaceArchiveObjectKey,
21172
21202
  parseWorkspaceArchiveObjectRef,
21173
21203
  workspaceArchiveObjectKey,
21204
+ validateWorkspaceArchiveObjectRef,
21174
21205
  workspaceArchivePayloadPresent,
21175
21206
  omitInlineWorkspaceArchiveWhenObjectRefPresent,
21176
21207
  NATIVE_SNAPSHOT_PREFIXES,
@@ -22522,4 +22553,4 @@ export {
22522
22553
  ClientConfig,
22523
22554
  evaluateWorkspaceModelPolicy
22524
22555
  };
22525
- //# sourceMappingURL=chunk-OO4AEMQB.js.map
22556
+ //# sourceMappingURL=chunk-FBXZZSXA.js.map