@uns-kit/core 3.0.42 → 3.0.43
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/MIGRATIONS.md
CHANGED
|
@@ -9,6 +9,22 @@ Agents must inspect the application's existing ownership and shutdown flow
|
|
|
9
9
|
before editing it. The examples below describe the intended behavior, not a
|
|
10
10
|
mechanical search-and-replace operation.
|
|
11
11
|
|
|
12
|
+
## 3.0.43 - Shared managed operator route registration
|
|
13
|
+
|
|
14
|
+
This entry describes the prepared 3.0.43 release; npm publication is separate. Existing ordinary
|
|
15
|
+
API endpoints and standalone services require no changes. Applications exposing
|
|
16
|
+
`operatorOperations` must adopt the coordinated API/core release, then be launched
|
|
17
|
+
by a Controller providing the reviewed route-token file and exact launch metadata.
|
|
18
|
+
`UnsApiProxy` registers and renews its own route automatically; no application-name
|
|
19
|
+
branch or custom route publisher is needed. Route credentials grant no data or
|
|
20
|
+
operator-command permissions. See [the contract](../../docs/operator-api.md).
|
|
21
|
+
|
|
22
|
+
Do not replace the owning Controller URL with a generic master URL, copy tokens
|
|
23
|
+
into config, normalize the launch's version tag or broaden service scopes to make
|
|
24
|
+
registration succeed. A Controller-only hot update cannot add launch metadata to
|
|
25
|
+
an already running process. Use the normal reviewed restart/upgrade after the
|
|
26
|
+
coordinated versions are published. Keep old application data and queues intact.
|
|
27
|
+
|
|
12
28
|
## 3.0.42 - Opt-in registered operator APIs and Service API body metadata
|
|
13
29
|
|
|
14
30
|
Existing applications require no operator-API change when crossing this version.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RUNTIME_ROUTE_REGISTRATION_PATH = "/api/runtime-services/routes";
|
|
3
|
+
export declare const RUNTIME_ROUTE_REGISTRATION_LEASE_MS = 30000;
|
|
4
|
+
export declare const runtimeRouteDeploymentSchema: z.ZodObject<{
|
|
5
|
+
controllerName: z.ZodString;
|
|
6
|
+
rttNode: z.ZodString;
|
|
7
|
+
version: z.ZodString;
|
|
8
|
+
instanceId: z.ZodString;
|
|
9
|
+
launchId: z.ZodString;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export type RuntimeRouteDeployment = z.infer<typeof runtimeRouteDeploymentSchema>;
|
|
12
|
+
export declare function runtimeRouteOrigin(value: string): string;
|
|
13
|
+
export declare const runtimeRouteBindingSchema: z.ZodObject<{
|
|
14
|
+
processName: z.ZodString;
|
|
15
|
+
version: z.ZodString;
|
|
16
|
+
apiHost: z.ZodString;
|
|
17
|
+
controllerName: z.ZodString;
|
|
18
|
+
controllerPublicBase: z.ZodString;
|
|
19
|
+
instanceId: z.ZodString;
|
|
20
|
+
deploymentId: z.ZodString;
|
|
21
|
+
}, z.core.$strict>;
|
|
22
|
+
export type RuntimeRouteBinding = z.infer<typeof runtimeRouteBindingSchema>;
|
|
23
|
+
export declare const runtimeRouteReceiptSchema: z.ZodObject<{
|
|
24
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
25
|
+
expiresInMs: z.ZodLiteral<30000>;
|
|
26
|
+
binding: z.ZodObject<{
|
|
27
|
+
processName: z.ZodString;
|
|
28
|
+
version: z.ZodString;
|
|
29
|
+
apiHost: z.ZodString;
|
|
30
|
+
controllerName: z.ZodString;
|
|
31
|
+
controllerPublicBase: z.ZodString;
|
|
32
|
+
instanceId: z.ZodString;
|
|
33
|
+
deploymentId: z.ZodString;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
/** A receipt is ownership evidence only for this exact process launch/origin. */
|
|
37
|
+
export declare function readRuntimeRouteReceipt(value: unknown, expected: RuntimeRouteDeployment & {
|
|
38
|
+
processName: string;
|
|
39
|
+
apiHost: string;
|
|
40
|
+
}): {
|
|
41
|
+
protocolVersion: 1;
|
|
42
|
+
expiresInMs: 30000;
|
|
43
|
+
binding: {
|
|
44
|
+
processName: string;
|
|
45
|
+
version: string;
|
|
46
|
+
apiHost: string;
|
|
47
|
+
controllerName: string;
|
|
48
|
+
controllerPublicBase: string;
|
|
49
|
+
instanceId: string;
|
|
50
|
+
deploymentId: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=route-registration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-registration.d.ts","sourceRoot":"","sources":["../../src/runtime/route-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,+BAA+B,iCAAiC,CAAC;AAC9E,eAAO,MAAM,mCAAmC,QAAS,CAAC;AAE1D,eAAO,MAAM,4BAA4B;;;;;;kBAG9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMxD;AAED,eAAO,MAAM,yBAAyB;;;;;;;;kBAG3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;kBAE3B,CAAC;AAEZ,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;EAQlI"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const RUNTIME_ROUTE_REGISTRATION_PATH = "/api/runtime-services/routes";
|
|
3
|
+
export const RUNTIME_ROUTE_REGISTRATION_LEASE_MS = 30_000;
|
|
4
|
+
const name = z.string().min(1).max(256);
|
|
5
|
+
export const runtimeRouteDeploymentSchema = z.object({
|
|
6
|
+
controllerName: name, rttNode: name, version: name, instanceId: name,
|
|
7
|
+
launchId: z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),
|
|
8
|
+
}).strict();
|
|
9
|
+
export function runtimeRouteOrigin(value) {
|
|
10
|
+
if (typeof value !== "string" || value.length > 2048)
|
|
11
|
+
throw Error("Invalid runtime route origin");
|
|
12
|
+
const url = new URL(value);
|
|
13
|
+
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== "/")
|
|
14
|
+
throw Error("Invalid runtime route origin");
|
|
15
|
+
return url.origin;
|
|
16
|
+
}
|
|
17
|
+
export const runtimeRouteBindingSchema = z.object({
|
|
18
|
+
processName: name, version: name, apiHost: z.string().min(1).max(2048), controllerName: name,
|
|
19
|
+
controllerPublicBase: z.string().min(1).max(2048), instanceId: name, deploymentId: z.string().min(1).max(1024),
|
|
20
|
+
}).strict();
|
|
21
|
+
export const runtimeRouteReceiptSchema = z.object({
|
|
22
|
+
protocolVersion: z.literal(1), expiresInMs: z.literal(RUNTIME_ROUTE_REGISTRATION_LEASE_MS), binding: runtimeRouteBindingSchema,
|
|
23
|
+
}).strict();
|
|
24
|
+
/** A receipt is ownership evidence only for this exact process launch/origin. */
|
|
25
|
+
export function readRuntimeRouteReceipt(value, expected) {
|
|
26
|
+
const receipt = runtimeRouteReceiptSchema.parse(value), binding = receipt.binding;
|
|
27
|
+
if (binding.controllerName !== expected.controllerName || binding.instanceId !== expected.instanceId
|
|
28
|
+
|| binding.version !== expected.version || binding.processName !== expected.processName
|
|
29
|
+
|| runtimeRouteOrigin(binding.apiHost) !== runtimeRouteOrigin(expected.apiHost)
|
|
30
|
+
|| !binding.deploymentId.startsWith(expected.launchId + ":"))
|
|
31
|
+
throw Error("Runtime route receipt does not match launch");
|
|
32
|
+
runtimeRouteOrigin(binding.controllerPublicBase);
|
|
33
|
+
return receipt;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=route-registration.js.map
|
|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Q,GAAG,GAAG,CAAC;QAAE,MAAM,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAC3H,kBAAkB,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { z } from \"zod\";\n\nexport const RUNTIME_ROUTE_REGISTRATION_PATH = \"/api/runtime-services/routes\";\nexport const RUNTIME_ROUTE_REGISTRATION_LEASE_MS = 30_000;\nconst name = z.string().min(1).max(256);\nexport const runtimeRouteDeploymentSchema = z.object({\n controllerName: name, rttNode: name, version: name, instanceId: name,\n launchId: z.string().regex(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/),\n}).strict();\nexport type RuntimeRouteDeployment = z.infer<typeof runtimeRouteDeploymentSchema>;\n\nexport function runtimeRouteOrigin(value: string): string {\n if (typeof value !== \"string\" || value.length > 2048) throw Error(\"Invalid runtime route origin\");\n const url = new URL(value);\n if (![\"http:\", \"https:\"].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== \"/\")\n throw Error(\"Invalid runtime route origin\");\n return url.origin;\n}\n\nexport const runtimeRouteBindingSchema = z.object({\n processName: name, version: name, apiHost: z.string().min(1).max(2048), controllerName: name,\n controllerPublicBase: z.string().min(1).max(2048), instanceId: name, deploymentId: z.string().min(1).max(1024),\n}).strict();\nexport type RuntimeRouteBinding = z.infer<typeof runtimeRouteBindingSchema>;\nexport const runtimeRouteReceiptSchema = z.object({\n protocolVersion: z.literal(1), expiresInMs: z.literal(RUNTIME_ROUTE_REGISTRATION_LEASE_MS), binding: runtimeRouteBindingSchema,\n}).strict();\n\n/** A receipt is ownership evidence only for this exact process launch/origin. */\nexport function readRuntimeRouteReceipt(value: unknown, expected: RuntimeRouteDeployment & { processName: string; apiHost: string }) {\n const receipt = runtimeRouteReceiptSchema.parse(value), binding = receipt.binding;\n if (binding.controllerName !== expected.controllerName || binding.instanceId !== expected.instanceId\n || binding.version !== expected.version || binding.processName !== expected.processName\n || runtimeRouteOrigin(binding.apiHost) !== runtimeRouteOrigin(expected.apiHost)\n || !binding.deploymentId.startsWith(expected.launchId + \":\")) throw Error(\"Runtime route receipt does not match launch\");\n runtimeRouteOrigin(binding.controllerPublicBase);\n return receipt;\n}\n"]}
|