@xyo-network/service-kit-schemas 0.2.1 → 0.2.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/README.md +14 -0
- package/dist/neutral/fleet.d.ts +112 -0
- package/dist/neutral/fleet.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +1 -0
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +90 -8
- package/dist/neutral/index.mjs.map +4 -4
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -69,3 +69,17 @@ configured; a future HTTP adapter must apply its own network policy.
|
|
|
69
69
|
No enrollment, pricing, domains, encryption negotiation or receiver delivery
|
|
70
70
|
protocols are introduced by this package. Existing Event Kit behavior is
|
|
71
71
|
unchanged.
|
|
72
|
+
|
|
73
|
+
## Local B4 families
|
|
74
|
+
|
|
75
|
+
The unpublished local 0.2.1 candidate also exports closed `FleetZod`,
|
|
76
|
+
`FleetMemberZod`, `FleetPublicationScopeZod` and `FleetControlZod` families,
|
|
77
|
+
their canonical schema constants, numeric `FLEET_PAYLOAD_VERSION = 1000000`,
|
|
78
|
+
inferred types and `parseFleetPayload`. B4 uses original SDK roots, separately
|
|
79
|
+
from B1 references. Coverage remains a bounded generic native payload; products
|
|
80
|
+
own interpretation. Parsing these declarations proves no owner, signer, carrying
|
|
81
|
+
correspondence or complete history. See the
|
|
82
|
+
[local B4 profiles and gate results](../../docs/B4_LOCAL_PRIMITIVES_2026-10-11.md);
|
|
83
|
+
authenticated composition is separately qualified through the existing XL1 adapter
|
|
84
|
+
and its [selected local cohort](../../docs/B4_AUTHENTICATED_LOCAL_PROFILE_2026-10-11.md).
|
|
85
|
+
Namespace registration, package publication and hosting remain open.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FleetSchema: "network.xyo.service.fleet" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
5
|
+
export declare const FleetMemberSchema: "network.xyo.service.fleet.member" & {
|
|
6
|
+
readonly __schema: true;
|
|
7
|
+
};
|
|
8
|
+
export declare const FleetPublicationScopeSchema: "network.xyo.service.fleet.publicationscope" & {
|
|
9
|
+
readonly __schema: true;
|
|
10
|
+
};
|
|
11
|
+
export declare const FleetControlSchema: "network.xyo.service.fleet.control" & {
|
|
12
|
+
readonly __schema: true;
|
|
13
|
+
};
|
|
14
|
+
export declare const FLEET_PAYLOAD_VERSION = 1000000;
|
|
15
|
+
/** Finite local profile bound; B4 roles are generic strings, not schema identifiers. */
|
|
16
|
+
export declare const FleetRoleIdZod: z.ZodString;
|
|
17
|
+
export declare const FleetZod: z.ZodObject<{
|
|
18
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet" & {
|
|
19
|
+
readonly __schema: true;
|
|
20
|
+
}>;
|
|
21
|
+
$version: z.ZodLiteral<1000000>;
|
|
22
|
+
owner: z.ZodString;
|
|
23
|
+
fleetId: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
export declare const FleetMemberZod: z.ZodObject<{
|
|
26
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.member" & {
|
|
27
|
+
readonly __schema: true;
|
|
28
|
+
}>;
|
|
29
|
+
$version: z.ZodLiteral<1000000>;
|
|
30
|
+
fleetRoot: z.ZodString;
|
|
31
|
+
memberId: z.ZodString;
|
|
32
|
+
roleId: z.ZodString;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
/** Native coverage bounds and its own version/predicate interpretation belong to the selected verifier/product. */
|
|
35
|
+
export declare const FleetPublicationScopeZod: z.ZodObject<{
|
|
36
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.publicationscope" & {
|
|
37
|
+
readonly __schema: true;
|
|
38
|
+
}>;
|
|
39
|
+
$version: z.ZodLiteral<1000000>;
|
|
40
|
+
fleetRoot: z.ZodString;
|
|
41
|
+
roleId: z.ZodString;
|
|
42
|
+
coverage: z.ZodObject<{
|
|
43
|
+
schema: z.ZodString;
|
|
44
|
+
$version: z.ZodNumber;
|
|
45
|
+
}, z.core.$catchall<z.ZodUnknown>>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export declare const FleetControlZod: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
|
+
operation: z.ZodLiteral<"activate-fleet">;
|
|
49
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.control" & {
|
|
50
|
+
readonly __schema: true;
|
|
51
|
+
}>;
|
|
52
|
+
$version: z.ZodLiteral<1000000>;
|
|
53
|
+
fleetRoot: z.ZodString;
|
|
54
|
+
previousControlRoot: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
operation: z.ZodLiteral<"remove-fleet">;
|
|
57
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.control" & {
|
|
58
|
+
readonly __schema: true;
|
|
59
|
+
}>;
|
|
60
|
+
$version: z.ZodLiteral<1000000>;
|
|
61
|
+
fleetRoot: z.ZodString;
|
|
62
|
+
previousControlRoot: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
operation: z.ZodLiteral<"activate-member">;
|
|
65
|
+
memberRoot: z.ZodString;
|
|
66
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.control" & {
|
|
67
|
+
readonly __schema: true;
|
|
68
|
+
}>;
|
|
69
|
+
$version: z.ZodLiteral<1000000>;
|
|
70
|
+
fleetRoot: z.ZodString;
|
|
71
|
+
previousControlRoot: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
73
|
+
operation: z.ZodLiteral<"remove-member">;
|
|
74
|
+
memberRoot: z.ZodString;
|
|
75
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.control" & {
|
|
76
|
+
readonly __schema: true;
|
|
77
|
+
}>;
|
|
78
|
+
$version: z.ZodLiteral<1000000>;
|
|
79
|
+
fleetRoot: z.ZodString;
|
|
80
|
+
previousControlRoot: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
+
operation: z.ZodLiteral<"grant-publisher">;
|
|
83
|
+
memberRoot: z.ZodString;
|
|
84
|
+
scopeRoot: z.ZodString;
|
|
85
|
+
publisherAddress: z.ZodString;
|
|
86
|
+
expiresAtBlock: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.control" & {
|
|
88
|
+
readonly __schema: true;
|
|
89
|
+
}>;
|
|
90
|
+
$version: z.ZodLiteral<1000000>;
|
|
91
|
+
fleetRoot: z.ZodString;
|
|
92
|
+
previousControlRoot: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
operation: z.ZodLiteral<"remove-publisher">;
|
|
95
|
+
memberRoot: z.ZodString;
|
|
96
|
+
scopeRoot: z.ZodString;
|
|
97
|
+
publisherAddress: z.ZodString;
|
|
98
|
+
schema: z.ZodLiteral<"network.xyo.service.fleet.control" & {
|
|
99
|
+
readonly __schema: true;
|
|
100
|
+
}>;
|
|
101
|
+
$version: z.ZodLiteral<1000000>;
|
|
102
|
+
fleetRoot: z.ZodString;
|
|
103
|
+
previousControlRoot: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strict>], "operation">;
|
|
105
|
+
export type Fleet = z.infer<typeof FleetZod>;
|
|
106
|
+
export type FleetMember = z.infer<typeof FleetMemberZod>;
|
|
107
|
+
export type FleetPublicationScope = z.infer<typeof FleetPublicationScopeZod>;
|
|
108
|
+
export type FleetControl = z.infer<typeof FleetControlZod>;
|
|
109
|
+
export type FleetPayload = Fleet | FleetMember | FleetPublicationScope | FleetControl;
|
|
110
|
+
export type FleetPayloadFamily = FleetPayload['schema'];
|
|
111
|
+
export declare function parseFleetPayload(value: unknown): FleetPayload | undefined;
|
|
112
|
+
//# sourceMappingURL=fleet.d.ts.map
|
|
@@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.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -97,24 +97,95 @@ function toDataLakeLocator(value) {
|
|
|
97
97
|
return parsed.success ? parsed.data : void 0;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
// src/
|
|
100
|
+
// src/fleet.ts
|
|
101
|
+
import { asSchema as asSchema2 } from "@xyo-network/sdk-protocol";
|
|
101
102
|
import { z as z4 } from "zod";
|
|
102
|
-
var
|
|
103
|
+
var FleetSchema = asSchema2("network.xyo.service.fleet", true);
|
|
104
|
+
var FleetMemberSchema = asSchema2("network.xyo.service.fleet.member", true);
|
|
105
|
+
var FleetPublicationScopeSchema = asSchema2("network.xyo.service.fleet.publicationscope", true);
|
|
106
|
+
var FleetControlSchema = asSchema2("network.xyo.service.fleet.control", true);
|
|
107
|
+
var FLEET_PAYLOAD_VERSION = 1e6;
|
|
108
|
+
var FleetRoleIdZod = z4.string().min(1).max(255);
|
|
109
|
+
var VersionZod = z4.literal(FLEET_PAYLOAD_VERSION);
|
|
110
|
+
var BlockZod = z4.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
111
|
+
var FleetZod = z4.strictObject({
|
|
112
|
+
schema: z4.literal(FleetSchema),
|
|
113
|
+
$version: VersionZod,
|
|
114
|
+
owner: AddressZod,
|
|
115
|
+
fleetId: ServiceIdZod
|
|
116
|
+
});
|
|
117
|
+
var FleetMemberZod = z4.strictObject({
|
|
118
|
+
schema: z4.literal(FleetMemberSchema),
|
|
119
|
+
$version: VersionZod,
|
|
120
|
+
fleetRoot: HashZod,
|
|
121
|
+
memberId: ServiceIdZod,
|
|
122
|
+
roleId: FleetRoleIdZod
|
|
123
|
+
});
|
|
124
|
+
var FleetPublicationScopeZod = z4.strictObject({
|
|
125
|
+
schema: z4.literal(FleetPublicationScopeSchema),
|
|
126
|
+
$version: VersionZod,
|
|
127
|
+
fleetRoot: HashZod,
|
|
128
|
+
roleId: FleetRoleIdZod,
|
|
129
|
+
coverage: z4.object({ schema: SchemaIdentifierZod, $version: BlockZod }).catchall(z4.unknown())
|
|
130
|
+
});
|
|
131
|
+
var controlShape = {
|
|
132
|
+
schema: z4.literal(FleetControlSchema),
|
|
133
|
+
$version: VersionZod,
|
|
134
|
+
fleetRoot: HashZod,
|
|
135
|
+
previousControlRoot: HashZod.optional()
|
|
136
|
+
};
|
|
137
|
+
var FleetControlZod = z4.discriminatedUnion("operation", [
|
|
138
|
+
z4.strictObject({ ...controlShape, operation: z4.literal("activate-fleet") }),
|
|
139
|
+
z4.strictObject({ ...controlShape, operation: z4.literal("remove-fleet") }),
|
|
140
|
+
z4.strictObject({
|
|
141
|
+
...controlShape,
|
|
142
|
+
operation: z4.literal("activate-member"),
|
|
143
|
+
memberRoot: HashZod
|
|
144
|
+
}),
|
|
145
|
+
z4.strictObject({
|
|
146
|
+
...controlShape,
|
|
147
|
+
operation: z4.literal("remove-member"),
|
|
148
|
+
memberRoot: HashZod
|
|
149
|
+
}),
|
|
150
|
+
z4.strictObject({
|
|
151
|
+
...controlShape,
|
|
152
|
+
operation: z4.literal("grant-publisher"),
|
|
153
|
+
memberRoot: HashZod,
|
|
154
|
+
scopeRoot: HashZod,
|
|
155
|
+
publisherAddress: AddressZod,
|
|
156
|
+
expiresAtBlock: BlockZod.optional()
|
|
157
|
+
}),
|
|
158
|
+
z4.strictObject({
|
|
159
|
+
...controlShape,
|
|
160
|
+
operation: z4.literal("remove-publisher"),
|
|
161
|
+
memberRoot: HashZod,
|
|
162
|
+
scopeRoot: HashZod,
|
|
163
|
+
publisherAddress: AddressZod
|
|
164
|
+
})
|
|
165
|
+
]);
|
|
166
|
+
function parseFleetPayload(value) {
|
|
167
|
+
const parsed = z4.union([FleetZod, FleetMemberZod, FleetPublicationScopeZod, FleetControlZod]).safeParse(value);
|
|
168
|
+
return parsed.success ? parsed.data : void 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/objectReference.ts
|
|
172
|
+
import { z as z5 } from "zod";
|
|
173
|
+
var ObjectReferenceZod = z5.strictObject({
|
|
103
174
|
schema: SchemaIdentifierZod,
|
|
104
175
|
dataHash: HashZod
|
|
105
176
|
});
|
|
106
177
|
|
|
107
178
|
// src/serviceAdvertisement.ts
|
|
108
|
-
import { asSchema as
|
|
109
|
-
import { z as
|
|
110
|
-
var ServiceAdvertisementSchema =
|
|
179
|
+
import { asSchema as asSchema3 } from "@xyo-network/sdk-protocol";
|
|
180
|
+
import { z as z6 } from "zod";
|
|
181
|
+
var ServiceAdvertisementSchema = asSchema3("network.xyo.service.advertisement", true);
|
|
111
182
|
var MAX_ADVERTISEMENT_DATA_LAKES = 16;
|
|
112
|
-
var ServiceAdvertisementZod =
|
|
113
|
-
schema:
|
|
183
|
+
var ServiceAdvertisementZod = z6.strictObject({
|
|
184
|
+
schema: z6.literal(ServiceAdvertisementSchema),
|
|
114
185
|
...ServiceIdentityZod.shape,
|
|
115
186
|
profile: SchemaIdentifierZod,
|
|
116
187
|
descriptor: ObjectReferenceZod,
|
|
117
|
-
dataLakes:
|
|
188
|
+
dataLakes: z6.array(ObjectReferenceZod).min(1).max(MAX_ADVERTISEMENT_DATA_LAKES),
|
|
118
189
|
...LifecycleShape
|
|
119
190
|
}).superRefine((advertisement, context) => {
|
|
120
191
|
validateLifecycle(advertisement, context);
|
|
@@ -140,6 +211,16 @@ export {
|
|
|
140
211
|
DataLakeIdZod,
|
|
141
212
|
DataLakeLocatorSchema,
|
|
142
213
|
DataLakeLocatorZod,
|
|
214
|
+
FLEET_PAYLOAD_VERSION,
|
|
215
|
+
FleetControlSchema,
|
|
216
|
+
FleetControlZod,
|
|
217
|
+
FleetMemberSchema,
|
|
218
|
+
FleetMemberZod,
|
|
219
|
+
FleetPublicationScopeSchema,
|
|
220
|
+
FleetPublicationScopeZod,
|
|
221
|
+
FleetRoleIdZod,
|
|
222
|
+
FleetSchema,
|
|
223
|
+
FleetZod,
|
|
143
224
|
HashZod,
|
|
144
225
|
MAX_ADVERTISEMENT_DATA_LAKES,
|
|
145
226
|
MAX_LOCATOR_ENDPOINTS,
|
|
@@ -153,6 +234,7 @@ export {
|
|
|
153
234
|
ServiceIdentityZod,
|
|
154
235
|
isDataLakeLocator,
|
|
155
236
|
isServiceAdvertisement,
|
|
237
|
+
parseFleetPayload,
|
|
156
238
|
toDataLakeLocator,
|
|
157
239
|
toServiceAdvertisement
|
|
158
240
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/dataLakeLocator.ts", "../../src/identifiers.ts", "../../src/lifecycle.ts", "../../src/objectReference.ts", "../../src/serviceAdvertisement.ts"],
|
|
4
|
-
"sourcesContent": ["import { asSchema } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\nimport {\n AddressZod, ChainIdZod, DataLakeIdZod, SchemaIdentifierZod,\n} from './identifiers.js'\nimport { LifecycleShape, validateLifecycle } from './lifecycle.js'\n\nexport const DataLakeLocatorSchema = asSchema('network.xyo.service.datalake.locator' as const, true)\nexport type DataLakeLocatorSchema = typeof DataLakeLocatorSchema\n\nexport const MAX_LOCATOR_ENDPOINTS = 8\nexport const MAX_LOCATOR_ENDPOINT_LENGTH = 2048\n\nfunction parseEndpoint(value: string): URL | undefined {\n // WHATWG URL parsing tolerates some control characters; the stored wire value does not.\n if (value.length > MAX_LOCATOR_ENDPOINT_LENGTH || value.includes('#') || /[\\p{Cc}\\s\\\\]/u.test(value)) return undefined\n\n const authority = /^https?:\\/\\/([^/?#]+)/iu.exec(value)?.[1]\n // Reject even empty userinfo, which URL.username/password would otherwise hide.\n if (authority === undefined || authority.length === 0 || authority.includes('@')) return undefined\n\n try {\n const endpoint = new URL(value)\n return !['http:', 'https:'].includes(endpoint.protocol) || !endpoint.hostname\n || endpoint.username || endpoint.password || endpoint.hash\n ? undefined\n : endpoint\n } catch {\n return undefined\n }\n}\n\nconst endpointSyntaxMessage = 'Endpoint must be an absolute HTTP(S) URL without userinfo, fragments, whitespace, backslashes or control characters'\nconst EndpointZod = z.string().min(1).max(MAX_LOCATOR_ENDPOINT_LENGTH)\n .refine(value => parseEndpoint(value) !== undefined, { message: endpointSyntaxMessage })\n\n/**\n * Public locator syntax only. Parsing does not prove operator identity, availability,\n * access permission or network safety, and does not authorize fetching an endpoint.\n */\nexport const DataLakeLocatorZod = z.strictObject({\n schema: z.literal(DataLakeLocatorSchema),\n authorizationChainId: ChainIdZod,\n operator: AddressZod,\n dataLakeId: DataLakeIdZod,\n transportProfile: SchemaIdentifierZod,\n endpoints: z.array(EndpointZod).min(1).max(MAX_LOCATOR_ENDPOINTS),\n ...LifecycleShape,\n}).superRefine((locator, context) => {\n validateLifecycle(locator, context)\n const endpoints = new Set<string>()\n for (const [index, value] of locator.endpoints.entries()) {\n // Compare normalized URL identity without rewriting the committed wire value.\n const endpoint = parseEndpoint(value)\n if (!endpoint) continue\n if (endpoints.has(endpoint.href)) {\n context.addIssue({\n code: 'custom',\n message: 'endpoints must contain unique URLs',\n path: ['endpoints', index],\n })\n }\n endpoints.add(endpoint.href)\n }\n})\n\nexport type DataLakeLocator = z.infer<typeof DataLakeLocatorZod>\n\nexport function isDataLakeLocator(value: unknown): value is DataLakeLocator {\n return DataLakeLocatorZod.safeParse(value).success\n}\n\nexport function toDataLakeLocator(value: unknown): DataLakeLocator | undefined {\n const parsed = DataLakeLocatorZod.safeParse(value)\n return parsed.success ? parsed.data : undefined\n}\n", "import { SchemaRegEx } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\n/** Service Kit's bounded identifier length; not a limit on the SDK's schema namespace. */\nexport const MAX_SCHEMA_IDENTIFIER_LENGTH = 255\n\n/** Canonical XYO schema syntax, validated without changing the supplied string. */\nexport const SchemaIdentifierZod = z.string().max(MAX_SCHEMA_IDENTIFIER_LENGTH).refine(value => SchemaRegEx.exec(value)?.[0] === value, {\n // Comparing the full match rejects a trailing newline tolerated by RegExp's $ anchor.\n message: 'Expected a canonical XYO schema identifier',\n})\n\n/** Canonical data hash: 32 bytes represented by lowercase hexadecimal. */\nexport const HashZod = z.string().length(64).regex(/^[0-9a-f]{64}$/u)\n\n/** Canonical XL1 address: 20 bytes, lowercase hexadecimal, without a 0x prefix. */\nexport const AddressZod = z.string().length(40).regex(/^[0-9a-f]{40}$/u)\n\nexport const ChainIdZod = AddressZod\nexport const ServiceIdZod = z.string().length(32).regex(/^[0-9a-f]{32}$/u)\nexport const DataLakeIdZod = z.string().length(32).regex(/^[0-9a-f]{32}$/u)\n\n/** Declared identity only; parsing does not establish provider authority. */\nexport const ServiceIdentityZod = z.strictObject({\n authorizationChainId: ChainIdZod,\n provider: AddressZod,\n serviceId: ServiceIdZod,\n})\n\nexport type ServiceIdentity = z.infer<typeof ServiceIdentityZod>\n", "import { z } from 'zod'\n\nimport { HashZod } from './identifiers.js'\n\nconst NonnegativeJsonSafeIntegerZod = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\nexport const LifecycleShape = {\n revision: z.number().int().min(1).max(Number.MAX_SAFE_INTEGER),\n supersedes: HashZod.optional(),\n validFromBlock: NonnegativeJsonSafeIntegerZod,\n expiresAtBlock: NonnegativeJsonSafeIntegerZod.optional(),\n}\n\ninterface LifecycleFields {\n expiresAtBlock?: number\n revision: number\n supersedes?: string\n validFromBlock: number\n}\n\n/** Checks local shape only, without selecting a revision or asserting a chain position. */\nexport function validateLifecycle(value: LifecycleFields, context: z.RefinementCtx) {\n const isRoot = value.revision === 1\n if (isRoot === (value.supersedes !== undefined)) {\n context.addIssue({\n code: 'custom',\n message: 'Revision 1 must omit supersedes; later revisions must include it',\n path: ['supersedes'],\n })\n }\n if (value.expiresAtBlock !== undefined && value.expiresAtBlock <= value.validFromBlock) {\n context.addIssue({\n code: 'custom',\n message: 'expiresAtBlock is exclusive and must be after validFromBlock',\n path: ['expiresAtBlock'],\n })\n }\n}\n", "import { z } from 'zod'\n\nimport { HashZod, SchemaIdentifierZod } from './identifiers.js'\n\n/** Immutable lookup target; the reference is not evidence of authorship or finality. */\nexport const ObjectReferenceZod = z.strictObject({\n schema: SchemaIdentifierZod,\n dataHash: HashZod,\n})\n\nexport type ObjectReference = z.infer<typeof ObjectReferenceZod>\n", "import { asSchema } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\nimport { SchemaIdentifierZod, ServiceIdentityZod } from './identifiers.js'\nimport { LifecycleShape, validateLifecycle } from './lifecycle.js'\nimport { ObjectReferenceZod } from './objectReference.js'\n\nexport const ServiceAdvertisementSchema = asSchema('network.xyo.service.advertisement' as const, true)\nexport type ServiceAdvertisementSchema = typeof ServiceAdvertisementSchema\n\nexport const MAX_ADVERTISEMENT_DATA_LAKES = 16\n\n/** An immutable declaration. Its provider and lifecycle require independent chain evidence. */\nexport const ServiceAdvertisementZod = z.strictObject({\n schema: z.literal(ServiceAdvertisementSchema),\n ...ServiceIdentityZod.shape,\n profile: SchemaIdentifierZod,\n descriptor: ObjectReferenceZod,\n dataLakes: z.array(ObjectReferenceZod).min(1).max(MAX_ADVERTISEMENT_DATA_LAKES),\n ...LifecycleShape,\n}).superRefine((advertisement, context) => {\n validateLifecycle(advertisement, context)\n const references = new Set(advertisement.dataLakes.map(reference => `${reference.schema}:${reference.dataHash}`))\n if (references.size !== advertisement.dataLakes.length) {\n context.addIssue({\n code: 'custom',\n message: 'dataLakes must contain unique schema and dataHash references',\n path: ['dataLakes'],\n })\n }\n})\n\nexport type ServiceAdvertisement = z.infer<typeof ServiceAdvertisementZod>\n\nexport function isServiceAdvertisement(value: unknown): value is ServiceAdvertisement {\n return ServiceAdvertisementZod.safeParse(value).success\n}\n\nexport function toServiceAdvertisement(value: unknown): ServiceAdvertisement | undefined {\n const parsed = ServiceAdvertisementZod.safeParse(value)\n return parsed.success ? parsed.data : undefined\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,KAAAA,UAAS;;;ACDlB,SAAS,mBAAmB;AAC5B,SAAS,SAAS;AAGX,IAAM,+BAA+B;AAGrC,IAAM,sBAAsB,EAAE,OAAO,EAAE,IAAI,4BAA4B,EAAE,OAAO,WAAS,YAAY,KAAK,KAAK,IAAI,CAAC,MAAM,OAAO;AAAA;AAAA,EAEtI,SAAS;AACX,CAAC;AAGM,IAAM,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAG7D,IAAM,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAEhE,IAAM,aAAa;AACnB,IAAM,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAClE,IAAM,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAGnE,IAAM,qBAAqB,EAAE,aAAa;AAAA,EAC/C,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,WAAW;AACb,CAAC;;;AC3BD,SAAS,KAAAC,UAAS;AAIlB,IAAM,gCAAgCC,GAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,OAAO,gBAAgB;AAElF,IAAM,iBAAiB;AAAA,EAC5B,UAAUA,GAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,OAAO,gBAAgB;AAAA,EAC7D,YAAY,QAAQ,SAAS;AAAA,EAC7B,gBAAgB;AAAA,EAChB,gBAAgB,8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AY,CAAC,eAAe,YAAY;AACzC,oBAAkB,eAAe,OAAO;AACxC,QAAM,aAAa,IAAI,IAAI,cAAc,UAAU,IAAI,eAAa,GAAG,UAAU,MAAM,IAAI,UAAU,QAAQ,EAAE,CAAC;AAChH,MAAI,WAAW,SAAS,cAAc,UAAU,QAAQ;AACtD,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM,CAAC,WAAW;AAAA,IACpB,CAAC;AAAA,EACH;AACF,CAAC;AAIM,SAAS,uBAAuB,OAA+C;AACpF,SAAO,wBAAwB,UAAU,KAAK,EAAE;AAClD;AAEO,SAAS,uBAAuB,OAAkD;AACvF,QAAM,SAAS,wBAAwB,UAAU,KAAK;AACtD,SAAO,OAAO,UAAU,OAAO,OAAO;AACxC;",
|
|
6
|
-
"names": ["z", "z", "z", "z", "z", "z", "asSchema", "z", "asSchema", "z"]
|
|
3
|
+
"sources": ["../../src/dataLakeLocator.ts", "../../src/identifiers.ts", "../../src/lifecycle.ts", "../../src/fleet.ts", "../../src/objectReference.ts", "../../src/serviceAdvertisement.ts"],
|
|
4
|
+
"sourcesContent": ["import { asSchema } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\nimport {\n AddressZod, ChainIdZod, DataLakeIdZod, SchemaIdentifierZod,\n} from './identifiers.js'\nimport { LifecycleShape, validateLifecycle } from './lifecycle.js'\n\nexport const DataLakeLocatorSchema = asSchema('network.xyo.service.datalake.locator' as const, true)\nexport type DataLakeLocatorSchema = typeof DataLakeLocatorSchema\n\nexport const MAX_LOCATOR_ENDPOINTS = 8\nexport const MAX_LOCATOR_ENDPOINT_LENGTH = 2048\n\nfunction parseEndpoint(value: string): URL | undefined {\n // WHATWG URL parsing tolerates some control characters; the stored wire value does not.\n if (value.length > MAX_LOCATOR_ENDPOINT_LENGTH || value.includes('#') || /[\\p{Cc}\\s\\\\]/u.test(value)) return undefined\n\n const authority = /^https?:\\/\\/([^/?#]+)/iu.exec(value)?.[1]\n // Reject even empty userinfo, which URL.username/password would otherwise hide.\n if (authority === undefined || authority.length === 0 || authority.includes('@')) return undefined\n\n try {\n const endpoint = new URL(value)\n return !['http:', 'https:'].includes(endpoint.protocol) || !endpoint.hostname\n || endpoint.username || endpoint.password || endpoint.hash\n ? undefined\n : endpoint\n } catch {\n return undefined\n }\n}\n\nconst endpointSyntaxMessage = 'Endpoint must be an absolute HTTP(S) URL without userinfo, fragments, whitespace, backslashes or control characters'\nconst EndpointZod = z.string().min(1).max(MAX_LOCATOR_ENDPOINT_LENGTH)\n .refine(value => parseEndpoint(value) !== undefined, { message: endpointSyntaxMessage })\n\n/**\n * Public locator syntax only. Parsing does not prove operator identity, availability,\n * access permission or network safety, and does not authorize fetching an endpoint.\n */\nexport const DataLakeLocatorZod = z.strictObject({\n schema: z.literal(DataLakeLocatorSchema),\n authorizationChainId: ChainIdZod,\n operator: AddressZod,\n dataLakeId: DataLakeIdZod,\n transportProfile: SchemaIdentifierZod,\n endpoints: z.array(EndpointZod).min(1).max(MAX_LOCATOR_ENDPOINTS),\n ...LifecycleShape,\n}).superRefine((locator, context) => {\n validateLifecycle(locator, context)\n const endpoints = new Set<string>()\n for (const [index, value] of locator.endpoints.entries()) {\n // Compare normalized URL identity without rewriting the committed wire value.\n const endpoint = parseEndpoint(value)\n if (!endpoint) continue\n if (endpoints.has(endpoint.href)) {\n context.addIssue({\n code: 'custom',\n message: 'endpoints must contain unique URLs',\n path: ['endpoints', index],\n })\n }\n endpoints.add(endpoint.href)\n }\n})\n\nexport type DataLakeLocator = z.infer<typeof DataLakeLocatorZod>\n\nexport function isDataLakeLocator(value: unknown): value is DataLakeLocator {\n return DataLakeLocatorZod.safeParse(value).success\n}\n\nexport function toDataLakeLocator(value: unknown): DataLakeLocator | undefined {\n const parsed = DataLakeLocatorZod.safeParse(value)\n return parsed.success ? parsed.data : undefined\n}\n", "import { SchemaRegEx } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\n/** Service Kit's bounded identifier length; not a limit on the SDK's schema namespace. */\nexport const MAX_SCHEMA_IDENTIFIER_LENGTH = 255\n\n/** Canonical XYO schema syntax, validated without changing the supplied string. */\nexport const SchemaIdentifierZod = z.string().max(MAX_SCHEMA_IDENTIFIER_LENGTH).refine(value => SchemaRegEx.exec(value)?.[0] === value, {\n // Comparing the full match rejects a trailing newline tolerated by RegExp's $ anchor.\n message: 'Expected a canonical XYO schema identifier',\n})\n\n/** Canonical data hash: 32 bytes represented by lowercase hexadecimal. */\nexport const HashZod = z.string().length(64).regex(/^[0-9a-f]{64}$/u)\n\n/** Canonical XL1 address: 20 bytes, lowercase hexadecimal, without a 0x prefix. */\nexport const AddressZod = z.string().length(40).regex(/^[0-9a-f]{40}$/u)\n\nexport const ChainIdZod = AddressZod\nexport const ServiceIdZod = z.string().length(32).regex(/^[0-9a-f]{32}$/u)\nexport const DataLakeIdZod = z.string().length(32).regex(/^[0-9a-f]{32}$/u)\n\n/** Declared identity only; parsing does not establish provider authority. */\nexport const ServiceIdentityZod = z.strictObject({\n authorizationChainId: ChainIdZod,\n provider: AddressZod,\n serviceId: ServiceIdZod,\n})\n\nexport type ServiceIdentity = z.infer<typeof ServiceIdentityZod>\n", "import { z } from 'zod'\n\nimport { HashZod } from './identifiers.js'\n\nconst NonnegativeJsonSafeIntegerZod = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\nexport const LifecycleShape = {\n revision: z.number().int().min(1).max(Number.MAX_SAFE_INTEGER),\n supersedes: HashZod.optional(),\n validFromBlock: NonnegativeJsonSafeIntegerZod,\n expiresAtBlock: NonnegativeJsonSafeIntegerZod.optional(),\n}\n\ninterface LifecycleFields {\n expiresAtBlock?: number\n revision: number\n supersedes?: string\n validFromBlock: number\n}\n\n/** Checks local shape only, without selecting a revision or asserting a chain position. */\nexport function validateLifecycle(value: LifecycleFields, context: z.RefinementCtx) {\n const isRoot = value.revision === 1\n if (isRoot === (value.supersedes !== undefined)) {\n context.addIssue({\n code: 'custom',\n message: 'Revision 1 must omit supersedes; later revisions must include it',\n path: ['supersedes'],\n })\n }\n if (value.expiresAtBlock !== undefined && value.expiresAtBlock <= value.validFromBlock) {\n context.addIssue({\n code: 'custom',\n message: 'expiresAtBlock is exclusive and must be after validFromBlock',\n path: ['expiresAtBlock'],\n })\n }\n}\n", "import { asSchema } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\nimport {\n AddressZod, HashZod, SchemaIdentifierZod, ServiceIdZod,\n} from './identifiers.js'\n\nexport const FleetSchema = asSchema('network.xyo.service.fleet' as const, true)\nexport const FleetMemberSchema = asSchema('network.xyo.service.fleet.member' as const, true)\nexport const FleetPublicationScopeSchema = asSchema('network.xyo.service.fleet.publicationscope' as const, true)\nexport const FleetControlSchema = asSchema('network.xyo.service.fleet.control' as const, true)\nexport const FLEET_PAYLOAD_VERSION = 1_000_000\n\n/** Finite local profile bound; B4 roles are generic strings, not schema identifiers. */\nexport const FleetRoleIdZod = z.string().min(1).max(255)\nconst VersionZod = z.literal(FLEET_PAYLOAD_VERSION)\nconst BlockZod = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\nexport const FleetZod = z.strictObject({\n schema: z.literal(FleetSchema), $version: VersionZod, owner: AddressZod, fleetId: ServiceIdZod,\n})\nexport const FleetMemberZod = z.strictObject({\n schema: z.literal(FleetMemberSchema),\n $version: VersionZod,\n fleetRoot: HashZod,\n memberId: ServiceIdZod,\n roleId: FleetRoleIdZod,\n})\n/** Native coverage bounds and its own version/predicate interpretation belong to the selected verifier/product. */\nexport const FleetPublicationScopeZod = z.strictObject({\n schema: z.literal(FleetPublicationScopeSchema),\n $version: VersionZod,\n fleetRoot: HashZod,\n roleId: FleetRoleIdZod,\n coverage: z.object({ schema: SchemaIdentifierZod, $version: BlockZod }).catchall(z.unknown()),\n})\nconst controlShape = {\n schema: z.literal(FleetControlSchema),\n $version: VersionZod,\n fleetRoot: HashZod,\n previousControlRoot: HashZod.optional(),\n}\nexport const FleetControlZod = z.discriminatedUnion('operation', [\n z.strictObject({ ...controlShape, operation: z.literal('activate-fleet') }),\n z.strictObject({ ...controlShape, operation: z.literal('remove-fleet') }),\n z.strictObject({\n ...controlShape, operation: z.literal('activate-member'), memberRoot: HashZod,\n }),\n z.strictObject({\n ...controlShape, operation: z.literal('remove-member'), memberRoot: HashZod,\n }),\n z.strictObject({\n ...controlShape,\n operation: z.literal('grant-publisher'),\n memberRoot: HashZod,\n scopeRoot: HashZod,\n publisherAddress: AddressZod,\n expiresAtBlock: BlockZod.optional(),\n }),\n z.strictObject({\n ...controlShape,\n operation: z.literal('remove-publisher'),\n memberRoot: HashZod,\n scopeRoot: HashZod,\n publisherAddress: AddressZod,\n }),\n])\n\nexport type Fleet = z.infer<typeof FleetZod>\nexport type FleetMember = z.infer<typeof FleetMemberZod>\nexport type FleetPublicationScope = z.infer<typeof FleetPublicationScopeZod>\nexport type FleetControl = z.infer<typeof FleetControlZod>\nexport type FleetPayload = Fleet | FleetMember | FleetPublicationScope | FleetControl\nexport type FleetPayloadFamily = FleetPayload['schema']\n\nexport function parseFleetPayload(value: unknown): FleetPayload | undefined {\n const parsed = z.union([FleetZod, FleetMemberZod, FleetPublicationScopeZod, FleetControlZod]).safeParse(value)\n return parsed.success ? parsed.data : undefined\n}\n", "import { z } from 'zod'\n\nimport { HashZod, SchemaIdentifierZod } from './identifiers.js'\n\n/** Immutable lookup target; the reference is not evidence of authorship or finality. */\nexport const ObjectReferenceZod = z.strictObject({\n schema: SchemaIdentifierZod,\n dataHash: HashZod,\n})\n\nexport type ObjectReference = z.infer<typeof ObjectReferenceZod>\n", "import { asSchema } from '@xyo-network/sdk-protocol'\nimport { z } from 'zod'\n\nimport { SchemaIdentifierZod, ServiceIdentityZod } from './identifiers.js'\nimport { LifecycleShape, validateLifecycle } from './lifecycle.js'\nimport { ObjectReferenceZod } from './objectReference.js'\n\nexport const ServiceAdvertisementSchema = asSchema('network.xyo.service.advertisement' as const, true)\nexport type ServiceAdvertisementSchema = typeof ServiceAdvertisementSchema\n\nexport const MAX_ADVERTISEMENT_DATA_LAKES = 16\n\n/** An immutable declaration. Its provider and lifecycle require independent chain evidence. */\nexport const ServiceAdvertisementZod = z.strictObject({\n schema: z.literal(ServiceAdvertisementSchema),\n ...ServiceIdentityZod.shape,\n profile: SchemaIdentifierZod,\n descriptor: ObjectReferenceZod,\n dataLakes: z.array(ObjectReferenceZod).min(1).max(MAX_ADVERTISEMENT_DATA_LAKES),\n ...LifecycleShape,\n}).superRefine((advertisement, context) => {\n validateLifecycle(advertisement, context)\n const references = new Set(advertisement.dataLakes.map(reference => `${reference.schema}:${reference.dataHash}`))\n if (references.size !== advertisement.dataLakes.length) {\n context.addIssue({\n code: 'custom',\n message: 'dataLakes must contain unique schema and dataHash references',\n path: ['dataLakes'],\n })\n }\n})\n\nexport type ServiceAdvertisement = z.infer<typeof ServiceAdvertisementZod>\n\nexport function isServiceAdvertisement(value: unknown): value is ServiceAdvertisement {\n return ServiceAdvertisementZod.safeParse(value).success\n}\n\nexport function toServiceAdvertisement(value: unknown): ServiceAdvertisement | undefined {\n const parsed = ServiceAdvertisementZod.safeParse(value)\n return parsed.success ? parsed.data : undefined\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,KAAAA,UAAS;;;ACDlB,SAAS,mBAAmB;AAC5B,SAAS,SAAS;AAGX,IAAM,+BAA+B;AAGrC,IAAM,sBAAsB,EAAE,OAAO,EAAE,IAAI,4BAA4B,EAAE,OAAO,WAAS,YAAY,KAAK,KAAK,IAAI,CAAC,MAAM,OAAO;AAAA;AAAA,EAEtI,SAAS;AACX,CAAC;AAGM,IAAM,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAG7D,IAAM,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAEhE,IAAM,aAAa;AACnB,IAAM,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,iBAAiB;AAClE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E,IAAI,CAAC,EAAE,IAAI,4BAA4B;AAAA,EAC9E,GAAG;AACL,CAAC,EAAE,YAAY,CAAC,eAAe,YAAY;AACzC,oBAAkB,eAAe,OAAO;AACxC,QAAM,aAAa,IAAI,IAAI,cAAc,UAAU,IAAI,eAAa,GAAG,UAAU,MAAM,IAAI,UAAU,QAAQ,EAAE,CAAC;AAChH,MAAI,WAAW,SAAS,cAAc,UAAU,QAAQ;AACtD,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,SAAS;AAAA,MACT,MAAM,CAAC,WAAW;AAAA,IACpB,CAAC;AAAA,EACH;AACF,CAAC;AAIM,SAAS,uBAAuB,OAA+C;AACpF,SAAO,wBAAwB,UAAU,KAAK,EAAE;AAClD;AAEO,SAAS,uBAAuB,OAAkD;AACvF,QAAM,SAAS,wBAAwB,UAAU,KAAK;AACtD,SAAO,OAAO,UAAU,OAAO,OAAO;AACxC;",
|
|
6
|
+
"names": ["z", "z", "z", "z", "asSchema", "z", "asSchema", "z", "z", "z", "asSchema", "z", "asSchema", "z"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/service-kit-schemas",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Strict shared service and datalake descriptors",
|
|
5
5
|
"license": "LGPL-3.0-only",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@ariestools/lib-neutral": "~10.1
|
|
22
|
-
"@ariestools/toolchain": "~10.1
|
|
23
|
-
"@ariestools/tsconfig": "~10.1
|
|
21
|
+
"@ariestools/lib-neutral": "~10.2.1",
|
|
22
|
+
"@ariestools/toolchain": "~10.2.1",
|
|
23
|
+
"@ariestools/tsconfig": "~10.2.1",
|
|
24
24
|
"@xyo-network/sdk-protocol": "~8.0.3",
|
|
25
|
-
"eslint": "~10.
|
|
25
|
+
"eslint": "~10.13.0",
|
|
26
26
|
"eslint-import-resolver-typescript": "~4.4.5",
|
|
27
27
|
"typescript": "~6.0.3",
|
|
28
|
-
"vite": "~8.3.
|
|
29
|
-
"vitest": "~5.0.
|
|
30
|
-
"zod": "~4.6.
|
|
28
|
+
"vite": "~8.3.5",
|
|
29
|
+
"vitest": "~5.0.5",
|
|
30
|
+
"zod": "~4.6.7"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@xyo-network/sdk-protocol": "^8.0",
|