@inf-monkeys-tech/monkeys 1.1.6 → 1.1.8
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/lib/contracts/declarative-control-http.d.ts +0 -7281
- package/lib/contracts/declarative-control-http.d.ts.map +1 -1
- package/lib/contracts/declarative-control-http.js +2 -102
- package/lib/contracts/declarative-control-http.js.map +1 -1
- package/lib/esm/contracts/index.mjs +0 -82
- package/lib/esm/contracts/index.mjs.map +1 -1
- package/lib/esm/index.mjs +47 -87
- package/lib/esm/index.mjs.map +1 -1
- package/lib/esm/runtime/index.mjs +47 -77
- package/lib/esm/runtime/index.mjs.map +1 -1
- package/lib/esm/schemas/index.mjs +0 -72
- package/lib/esm/schemas/index.mjs.map +1 -1
- package/lib/runtime/declarative-control-compiler.d.ts +6 -0
- package/lib/runtime/declarative-control-compiler.d.ts.map +1 -1
- package/lib/runtime/declarative-control-compiler.js +38 -1
- package/lib/runtime/declarative-control-compiler.js.map +1 -1
- package/package.json +1 -1
|
@@ -15485,11 +15485,6 @@ var DeclarativeAuthoringActionSchema = z14.enum([
|
|
|
15485
15485
|
"publish",
|
|
15486
15486
|
"rollback"
|
|
15487
15487
|
]);
|
|
15488
|
-
var DeclarativeLegacyMigrationKindSchema = z14.enum([
|
|
15489
|
-
"page",
|
|
15490
|
-
"page-data-assets",
|
|
15491
|
-
"workbench"
|
|
15492
|
-
]);
|
|
15493
15488
|
var DeclarativeErrorEnvelopeSchema = z14.object({
|
|
15494
15489
|
code: z14.string().trim().min(1),
|
|
15495
15490
|
message: z14.string().trim().min(1),
|
|
@@ -16971,73 +16966,6 @@ var DeclarativePublicationResultSchema = z14.union([
|
|
|
16971
16966
|
DeclarativeDirectPublicationResultSchema,
|
|
16972
16967
|
DeclarativeAtomicPublicationPlanResultSchema
|
|
16973
16968
|
]);
|
|
16974
|
-
var DeclarativeMigrationDiffEntrySchema = z14.object({
|
|
16975
|
-
path: z14.string().trim().startsWith("/").max(1024),
|
|
16976
|
-
status: z14.enum(["added", "changed", "removed", "unchanged"]),
|
|
16977
|
-
legacyValueHash: Sha256Schema.optional(),
|
|
16978
|
-
declarativeValueHash: Sha256Schema.optional()
|
|
16979
|
-
}).strict();
|
|
16980
|
-
var DeclarativeMigrationBlockerSchema = z14.object({
|
|
16981
|
-
code: ContractIdentifierSchema,
|
|
16982
|
-
path: z14.string().trim().max(1024).optional(),
|
|
16983
|
-
message: z14.string().trim().min(1).max(4096)
|
|
16984
|
-
}).strict();
|
|
16985
|
-
var DeclarativeLegacyMigrationInspectionSchema = z14.object({
|
|
16986
|
-
contract: z14.literal("DeclarativeLegacyMigrationInspection"),
|
|
16987
|
-
schemaVersion: z14.literal(1),
|
|
16988
|
-
migrationKind: DeclarativeLegacyMigrationKindSchema,
|
|
16989
|
-
legacyResourceId: ContractIdentifierSchema,
|
|
16990
|
-
sourceRevisionRef: RevisionRefSchema,
|
|
16991
|
-
sourceContentHash: Sha256Schema,
|
|
16992
|
-
legacyAdapterRevisionRef: RevisionRefSchema,
|
|
16993
|
-
targetResourceRef: StableRefSchema,
|
|
16994
|
-
environmentRevisionRef: RevisionRefSchema,
|
|
16995
|
-
routeSpaceRevisionRef: RevisionRefSchema,
|
|
16996
|
-
normalizedPath: z14.string().trim().startsWith("/").max(2048),
|
|
16997
|
-
takeoverAuthorization: LegacyRouteTakeoverAuthorizationSchema,
|
|
16998
|
-
diff: z14.array(DeclarativeMigrationDiffEntrySchema).max(256),
|
|
16999
|
-
blockers: z14.array(DeclarativeMigrationBlockerSchema).max(128),
|
|
17000
|
-
canCreateDraft: z14.boolean(),
|
|
17001
|
-
inspectionFingerprint: Sha256Schema
|
|
17002
|
-
}).strict().superRefine((value, context) => {
|
|
17003
|
-
const expectedKind = value.migrationKind === "workbench" ? "workbench" : "page";
|
|
17004
|
-
if (value.targetResourceRef.kind !== expectedKind) {
|
|
17005
|
-
context.addIssue({
|
|
17006
|
-
code: "custom",
|
|
17007
|
-
path: ["targetResourceRef", "kind"],
|
|
17008
|
-
message: `A ${value.migrationKind} migration must target ${expectedKind}.`
|
|
17009
|
-
});
|
|
17010
|
-
}
|
|
17011
|
-
if (value.takeoverAuthorization.inspectedSourceContentHash !== value.sourceContentHash || value.takeoverAuthorization.normalizedPath !== value.normalizedPath || value.takeoverAuthorization.targetResourceRef.kind !== value.targetResourceRef.kind || value.takeoverAuthorization.targetResourceRef.id !== value.targetResourceRef.id || value.takeoverAuthorization.targetResourceRef.ownerRepo !== value.targetResourceRef.ownerRepo) {
|
|
17012
|
-
context.addIssue({
|
|
17013
|
-
code: "custom",
|
|
17014
|
-
path: ["takeoverAuthorization"],
|
|
17015
|
-
message: "The takeover authority must bind the exact inspected source, path and target."
|
|
17016
|
-
});
|
|
17017
|
-
}
|
|
17018
|
-
if (value.canCreateDraft !== (value.blockers.length === 0)) {
|
|
17019
|
-
context.addIssue({
|
|
17020
|
-
code: "custom",
|
|
17021
|
-
path: ["canCreateDraft"],
|
|
17022
|
-
message: "Draft creation is allowed exactly when inspection has no blockers."
|
|
17023
|
-
});
|
|
17024
|
-
}
|
|
17025
|
-
});
|
|
17026
|
-
var DeclarativeLegacyMigrationCreateDraftIntentSchema = z14.object({
|
|
17027
|
-
inspectionFingerprint: Sha256Schema,
|
|
17028
|
-
expectedSourceRevisionRef: RevisionRefSchema,
|
|
17029
|
-
expectedSourceContentHash: Sha256Schema,
|
|
17030
|
-
idempotencyKey: z14.string().trim().min(1).max(256)
|
|
17031
|
-
}).strict();
|
|
17032
|
-
var DeclarativeLegacyMigrationCreateDraftResultSchema = z14.object({
|
|
17033
|
-
migrationKind: DeclarativeLegacyMigrationKindSchema,
|
|
17034
|
-
legacyResourceId: ContractIdentifierSchema,
|
|
17035
|
-
inspectionFingerprint: Sha256Schema,
|
|
17036
|
-
sourceRevisionRef: RevisionRefSchema,
|
|
17037
|
-
sourceContentHash: Sha256Schema,
|
|
17038
|
-
takeoverAuthorization: LegacyRouteTakeoverAuthorizationSchema,
|
|
17039
|
-
draft: DeclarativeDraftResultSchema
|
|
17040
|
-
}).strict();
|
|
17041
16969
|
var DeclarativeRetireResultSchema = z14.object({
|
|
17042
16970
|
action: z14.literal("retire"),
|
|
17043
16971
|
resourceKind: DeclarativeResourceKindSchema,
|
|
@@ -20003,6 +19931,27 @@ var compileNavigationRuntimeBundle = (input) => {
|
|
|
20003
19931
|
input.compilerRevisionRef
|
|
20004
19932
|
);
|
|
20005
19933
|
const scope = TenantScopeSchema.parse(navigation.tenantScope);
|
|
19934
|
+
const verifiedKernelPageReferences = [...input.verifiedKernelPageReferences ?? []].map((reference, index) => {
|
|
19935
|
+
const parsed = RevisionRefSchema.parse(reference);
|
|
19936
|
+
if (release.target.surface !== "kernel" || parsed.visibility !== "tenant" || !parsed.tenantScope?.teamRef?.id.startsWith("kernel-page.") || parsed.ownerRepo !== "monkeys-server" || !["page", "page-release"].includes(parsed.kind)) {
|
|
19937
|
+
throw new DeclarativeControlCompilationError(
|
|
19938
|
+
"CROSS_TENANT_REFERENCE",
|
|
19939
|
+
`verifiedKernelPageReferences[${index}]`,
|
|
19940
|
+
"Verified Kernel Page references must be exact tenant-scoped Page and PageRelease revisions from the Kernel page catalog."
|
|
19941
|
+
);
|
|
19942
|
+
}
|
|
19943
|
+
if (scopeKey(parsed.tenantScope) === scopeKey(scope)) {
|
|
19944
|
+
throw new DeclarativeControlCompilationError(
|
|
19945
|
+
"CROSS_TENANT_REFERENCE",
|
|
19946
|
+
`verifiedKernelPageReferences[${index}]`,
|
|
19947
|
+
"Verified Kernel Page references must belong to a different tenant scope."
|
|
19948
|
+
);
|
|
19949
|
+
}
|
|
19950
|
+
return parsed;
|
|
19951
|
+
});
|
|
19952
|
+
const verifiedKernelPageReferenceKeys = new Set(
|
|
19953
|
+
verifiedKernelPageReferences.map(revisionRefKey)
|
|
19954
|
+
);
|
|
20006
19955
|
assertSameTenantScope(release.tenantScope, scope, "release.tenantScope");
|
|
20007
19956
|
if (navigation.nodes.length > input.limits.maxNavigationNodes)
|
|
20008
19957
|
throw new DeclarativeControlCompilationError(
|
|
@@ -20243,11 +20192,32 @@ var compileNavigationRuntimeBundle = (input) => {
|
|
|
20243
20192
|
"Navigation target is active on another surface."
|
|
20244
20193
|
);
|
|
20245
20194
|
}
|
|
20246
|
-
|
|
20247
|
-
|
|
20248
|
-
|
|
20249
|
-
|
|
20250
|
-
|
|
20195
|
+
const targetIsForeignTenant = registration.targetRevisionRef.visibility === "tenant" && scopeKey(registration.targetRevisionRef.tenantScope) !== scopeKey(scope);
|
|
20196
|
+
if (targetIsForeignTenant) {
|
|
20197
|
+
const releaseReference = registration.kind === "route" ? registration.releaseRevisionRef : void 0;
|
|
20198
|
+
if (release.target.surface !== "kernel" || registration.kind !== "route" || registration.targetRevisionRef.kind !== "page" || !releaseReference || !verifiedKernelPageReferenceKeys.has(
|
|
20199
|
+
revisionRefKey(registration.targetRevisionRef)
|
|
20200
|
+
) || !verifiedKernelPageReferenceKeys.has(revisionRefKey(releaseReference))) {
|
|
20201
|
+
throw new DeclarativeControlCompilationError(
|
|
20202
|
+
"CROSS_TENANT_REFERENCE",
|
|
20203
|
+
`nodes[${index}].targetRef`,
|
|
20204
|
+
"Kernel Navigation may retain only Page references independently verified by the authenticated Kernel page catalog."
|
|
20205
|
+
);
|
|
20206
|
+
}
|
|
20207
|
+
if (scopeKey(releaseReference.tenantScope) !== scopeKey(registration.targetRevisionRef.tenantScope)) {
|
|
20208
|
+
throw new DeclarativeControlCompilationError(
|
|
20209
|
+
"CROSS_TENANT_REFERENCE",
|
|
20210
|
+
`nodes[${index}].targetRef`,
|
|
20211
|
+
"Verified Kernel Page and PageRelease references must belong to the same tenant scope."
|
|
20212
|
+
);
|
|
20213
|
+
}
|
|
20214
|
+
} else {
|
|
20215
|
+
assertTenantCompatible(
|
|
20216
|
+
registration.targetRevisionRef,
|
|
20217
|
+
scope,
|
|
20218
|
+
`nodes[${index}].targetRef`
|
|
20219
|
+
);
|
|
20220
|
+
}
|
|
20251
20221
|
if (!accessPolicyChainImplies(
|
|
20252
20222
|
[...ancestors, node.audience],
|
|
20253
20223
|
registration.accessPolicy
|