@rentnerproxy/app-contracts 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +32 -2
- package/contracts.schema.json +4007 -0
- package/dist/Types/contract.types.d.ts +15 -0
- package/dist/Types/contract.types.js +1 -0
- package/dist/catalog.d.ts +352 -0
- package/dist/catalog.js +54 -0
- package/dist/client.d.ts +31 -0
- package/dist/client.js +66 -0
- package/dist/http-operations.d.ts +333 -0
- package/dist/http-operations.generated.d.ts +299 -0
- package/dist/http-operations.generated.js +300 -0
- package/dist/http-operations.js +17 -0
- package/dist/http.d.ts +127 -0
- package/dist/http.js +142 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/manifest.d.ts +90 -0
- package/dist/manifest.js +106 -0
- package/dist/platform-api.d.ts +282 -0
- package/dist/platform-api.js +287 -0
- package/dist/primitives.d.ts +33 -0
- package/dist/primitives.js +87 -0
- package/dist/provider-api.d.ts +221 -0
- package/dist/provider-api.js +227 -0
- package/dist/publication.d.ts +410 -0
- package/dist/publication.js +50 -0
- package/dist/runtime.d.ts +75 -0
- package/dist/runtime.js +88 -0
- package/dist/schemas.d.ts +926 -0
- package/dist/schemas.js +114 -0
- package/dist/ui-bridge.d.ts +81 -0
- package/dist/ui-bridge.js +92 -0
- package/dist/validation.d.ts +784 -0
- package/dist/validation.js +245 -0
- package/dist/wire.d.ts +31 -0
- package/dist/wire.js +54 -0
- package/fixtures.json +1094 -0
- package/http-fixtures.json +829 -0
- package/openapi.json +2557 -0
- package/package.json +56 -5
- package/protocol-fixtures.json +1804 -0
- package/upstream-probe-fixtures.json +852 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { providerProfile } from './manifest.js';
|
|
3
|
+
import { recordId, timestamp } from './primitives.js';
|
|
4
|
+
import { operation } from './wire.js';
|
|
5
|
+
const providerRegistration = z.strictObject({
|
|
6
|
+
id: recordId,
|
|
7
|
+
profile: providerProfile,
|
|
8
|
+
version: z.literal('1.0.0'),
|
|
9
|
+
});
|
|
10
|
+
const limit = z.number().int().min(1).max(100);
|
|
11
|
+
const address = z.union([z.ipv4(), z.ipv6()]);
|
|
12
|
+
const port = z.number().int().min(1).max(65_535);
|
|
13
|
+
const revision = z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(/^[1-9][0-9]{0,19}$/)
|
|
16
|
+
.describe('Canonical positive decimal revision, ordered numerically within a contribution.');
|
|
17
|
+
const challengeName = z
|
|
18
|
+
.string()
|
|
19
|
+
.max(253)
|
|
20
|
+
.regex(/^(?:[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/);
|
|
21
|
+
const discoveryRequest = z
|
|
22
|
+
.strictObject({ connectionId: recordId, limit })
|
|
23
|
+
.describe('The connection must be assigned to the installation by the platform.');
|
|
24
|
+
const engineRequest = z.discriminatedUnion('action', [
|
|
25
|
+
z.strictObject({
|
|
26
|
+
action: z.literal('apply'),
|
|
27
|
+
contributionId: recordId,
|
|
28
|
+
revision,
|
|
29
|
+
policy: z.enum(['roundRobin', 'leastConnections']),
|
|
30
|
+
upstreams: z.array(z.strictObject({ address, port })).min(1).max(64),
|
|
31
|
+
}),
|
|
32
|
+
z.strictObject({
|
|
33
|
+
action: z.literal('readStatus'),
|
|
34
|
+
contributionId: recordId,
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
37
|
+
const dnsRequest = z.discriminatedUnion('action', [
|
|
38
|
+
z.strictObject({
|
|
39
|
+
action: z.literal('present'),
|
|
40
|
+
challengeId: recordId,
|
|
41
|
+
zoneId: recordId,
|
|
42
|
+
name: challengeName,
|
|
43
|
+
value: z.string().regex(/^[\x20-\x7e]{1,255}$/),
|
|
44
|
+
}),
|
|
45
|
+
z.strictObject({ action: z.literal('check'), challengeId: recordId }),
|
|
46
|
+
z.strictObject({ action: z.literal('cleanup'), challengeId: recordId }),
|
|
47
|
+
]);
|
|
48
|
+
const oidcRequest = z
|
|
49
|
+
.strictObject({ transactionId: recordId })
|
|
50
|
+
.describe('Resolve only the platform-brokered transaction bound to this installation.');
|
|
51
|
+
const crowdsecRequest = z.discriminatedUnion('action', [
|
|
52
|
+
z.strictObject({
|
|
53
|
+
action: z.literal('consumeLogs'),
|
|
54
|
+
batchId: recordId,
|
|
55
|
+
entries: z
|
|
56
|
+
.array(z.strictObject({
|
|
57
|
+
proxyHostId: recordId,
|
|
58
|
+
observedAt: timestamp,
|
|
59
|
+
clientAddress: address,
|
|
60
|
+
status: z.number().int().min(100).max(599),
|
|
61
|
+
}))
|
|
62
|
+
.min(1)
|
|
63
|
+
.max(100)
|
|
64
|
+
.describe('Platform-projected access events for proxy hosts granted to this installation.'),
|
|
65
|
+
}),
|
|
66
|
+
z.strictObject({
|
|
67
|
+
action: z.literal('evaluate'),
|
|
68
|
+
proxyHostId: recordId,
|
|
69
|
+
clientAddress: address,
|
|
70
|
+
}),
|
|
71
|
+
]);
|
|
72
|
+
const providerRequest = z.discriminatedUnion('profile', [
|
|
73
|
+
z.strictObject({
|
|
74
|
+
profile: providerProfile.extract(['monitoring']),
|
|
75
|
+
payload: z.strictObject({ limit }),
|
|
76
|
+
}),
|
|
77
|
+
z.strictObject({
|
|
78
|
+
profile: providerProfile.extract(['docker-discovery']),
|
|
79
|
+
payload: discoveryRequest,
|
|
80
|
+
}),
|
|
81
|
+
z.strictObject({
|
|
82
|
+
profile: providerProfile.extract(['load-balancer']),
|
|
83
|
+
payload: engineRequest,
|
|
84
|
+
}),
|
|
85
|
+
z.strictObject({
|
|
86
|
+
profile: providerProfile.extract(['dns']),
|
|
87
|
+
payload: dnsRequest,
|
|
88
|
+
}),
|
|
89
|
+
z.strictObject({
|
|
90
|
+
profile: providerProfile.extract(['oidc']),
|
|
91
|
+
payload: oidcRequest,
|
|
92
|
+
}),
|
|
93
|
+
z.strictObject({
|
|
94
|
+
profile: providerProfile.extract(['crowdsec']),
|
|
95
|
+
payload: crowdsecRequest,
|
|
96
|
+
}),
|
|
97
|
+
]);
|
|
98
|
+
const monitoringResult = z
|
|
99
|
+
.looseObject({
|
|
100
|
+
samples: z
|
|
101
|
+
.array(z.looseObject({
|
|
102
|
+
serviceId: recordId,
|
|
103
|
+
observedAt: timestamp,
|
|
104
|
+
healthy: z.boolean(),
|
|
105
|
+
}))
|
|
106
|
+
.max(100),
|
|
107
|
+
})
|
|
108
|
+
.describe('Read-only health samples up to the requested limit.');
|
|
109
|
+
const discoveryResult = z
|
|
110
|
+
.looseObject({
|
|
111
|
+
connectionId: recordId,
|
|
112
|
+
observations: z
|
|
113
|
+
.array(z.looseObject({
|
|
114
|
+
workloadId: recordId,
|
|
115
|
+
observedAt: timestamp,
|
|
116
|
+
address,
|
|
117
|
+
port,
|
|
118
|
+
}))
|
|
119
|
+
.max(100),
|
|
120
|
+
})
|
|
121
|
+
.describe('Observations apply only to records owned by this installation and connection.');
|
|
122
|
+
const engineResult = z
|
|
123
|
+
.looseObject({
|
|
124
|
+
contributionId: recordId,
|
|
125
|
+
revisionStatus: z.discriminatedUnion('status', [
|
|
126
|
+
z.looseObject({
|
|
127
|
+
status: z.literal('applied'),
|
|
128
|
+
appliedRevision: revision,
|
|
129
|
+
}),
|
|
130
|
+
z.looseObject({
|
|
131
|
+
status: z.enum(['unchanged', 'rejected', 'unavailable']),
|
|
132
|
+
appliedRevision: revision.nullable(),
|
|
133
|
+
}),
|
|
134
|
+
]),
|
|
135
|
+
})
|
|
136
|
+
.describe('A stale, invalid, or unavailable update leaves the last applied revision intact.');
|
|
137
|
+
const dnsResult = z
|
|
138
|
+
.discriminatedUnion('action', [
|
|
139
|
+
z.looseObject({
|
|
140
|
+
action: z.enum(['present', 'cleanup']),
|
|
141
|
+
challengeId: recordId,
|
|
142
|
+
operation,
|
|
143
|
+
}),
|
|
144
|
+
z.looseObject({
|
|
145
|
+
action: z.literal('check'),
|
|
146
|
+
challengeId: recordId,
|
|
147
|
+
outcome: z.enum(['verified', 'missing', 'unavailable']),
|
|
148
|
+
}),
|
|
149
|
+
])
|
|
150
|
+
.describe('Presentation and cleanup are bound to an owned challenge. A failure preserves the serving certificate.');
|
|
151
|
+
const identityValue = z.string().regex(/^[^\p{Cc}\p{Cs}]{1,255}$/u);
|
|
152
|
+
const oidcResult = z
|
|
153
|
+
.discriminatedUnion('outcome', [
|
|
154
|
+
z.looseObject({
|
|
155
|
+
outcome: z.literal('verified'),
|
|
156
|
+
transactionId: recordId,
|
|
157
|
+
identity: z.looseObject({
|
|
158
|
+
subject: identityValue,
|
|
159
|
+
groups: z.array(identityValue).max(64),
|
|
160
|
+
}),
|
|
161
|
+
}),
|
|
162
|
+
z.looseObject({
|
|
163
|
+
outcome: z.enum(['invalid', 'unavailable']),
|
|
164
|
+
transactionId: recordId,
|
|
165
|
+
}),
|
|
166
|
+
])
|
|
167
|
+
.describe('The verified identity is a proposal. Session issuance and authorization stay with the platform.');
|
|
168
|
+
const crowdsecResult = z.discriminatedUnion('action', [
|
|
169
|
+
z.looseObject({
|
|
170
|
+
action: z.literal('consumeLogs'),
|
|
171
|
+
batchId: recordId,
|
|
172
|
+
outcome: z.enum(['processed', 'unavailable']),
|
|
173
|
+
}),
|
|
174
|
+
z.looseObject({
|
|
175
|
+
action: z.literal('evaluate'),
|
|
176
|
+
decision: z
|
|
177
|
+
.discriminatedUnion('outcome', [
|
|
178
|
+
z.looseObject({
|
|
179
|
+
outcome: z.literal('allow'),
|
|
180
|
+
allowed: z.literal(true),
|
|
181
|
+
cachedBlock: z.literal(false),
|
|
182
|
+
}),
|
|
183
|
+
z.looseObject({
|
|
184
|
+
outcome: z.literal('deny'),
|
|
185
|
+
allowed: z.literal(false),
|
|
186
|
+
cachedBlock: z.literal(true),
|
|
187
|
+
}),
|
|
188
|
+
z.looseObject({
|
|
189
|
+
outcome: z.literal('unavailable'),
|
|
190
|
+
allowed: z.literal(false),
|
|
191
|
+
cachedBlock: z.boolean(),
|
|
192
|
+
}),
|
|
193
|
+
])
|
|
194
|
+
.describe('Unavailability confirms no allow decision and preserves any cached block.'),
|
|
195
|
+
}),
|
|
196
|
+
]);
|
|
197
|
+
const providerResult = z.discriminatedUnion('profile', [
|
|
198
|
+
z.looseObject({
|
|
199
|
+
profile: providerProfile.extract(['monitoring']),
|
|
200
|
+
payload: monitoringResult,
|
|
201
|
+
}),
|
|
202
|
+
z.looseObject({
|
|
203
|
+
profile: providerProfile.extract(['docker-discovery']),
|
|
204
|
+
payload: discoveryResult,
|
|
205
|
+
}),
|
|
206
|
+
z.looseObject({
|
|
207
|
+
profile: providerProfile.extract(['load-balancer']),
|
|
208
|
+
payload: engineResult,
|
|
209
|
+
}),
|
|
210
|
+
z.looseObject({
|
|
211
|
+
profile: providerProfile.extract(['dns']),
|
|
212
|
+
payload: dnsResult,
|
|
213
|
+
}),
|
|
214
|
+
z.looseObject({
|
|
215
|
+
profile: providerProfile.extract(['oidc']),
|
|
216
|
+
payload: oidcResult,
|
|
217
|
+
}),
|
|
218
|
+
z.looseObject({
|
|
219
|
+
profile: providerProfile.extract(['crowdsec']),
|
|
220
|
+
payload: crowdsecResult,
|
|
221
|
+
}),
|
|
222
|
+
]);
|
|
223
|
+
export const providerSchemas = {
|
|
224
|
+
ProviderRegistration: providerRegistration,
|
|
225
|
+
ProviderRequest: providerRequest,
|
|
226
|
+
ProviderResult: providerResult,
|
|
227
|
+
};
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const candidate: z.ZodObject<{
|
|
3
|
+
formatVersion: z.ZodLiteral<1>;
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
revision: z.ZodNumber;
|
|
6
|
+
source: z.ZodObject<{
|
|
7
|
+
repositoryId: z.ZodString;
|
|
8
|
+
commit: z.ZodString;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
build: z.ZodObject<{
|
|
11
|
+
repositoryId: z.ZodString;
|
|
12
|
+
workflowCommit: z.ZodString;
|
|
13
|
+
workflowPath: z.ZodString;
|
|
14
|
+
runId: z.ZodString;
|
|
15
|
+
attempt: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
evidence: z.ZodObject<{
|
|
18
|
+
revision: z.ZodNumber;
|
|
19
|
+
report: z.ZodObject<{
|
|
20
|
+
sha256: z.ZodString;
|
|
21
|
+
sizeBytes: z.ZodNumber;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
result: z.ZodLiteral<"passed">;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
release: z.ZodObject<{
|
|
26
|
+
appId: z.ZodString;
|
|
27
|
+
version: z.ZodString;
|
|
28
|
+
source: z.ZodObject<{
|
|
29
|
+
repositoryId: z.ZodString;
|
|
30
|
+
commit: z.ZodString;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
publisher: z.ZodObject<{
|
|
33
|
+
namespace: z.ZodString;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
37
|
+
manifest: z.ZodObject<{
|
|
38
|
+
formatVersion: z.ZodLiteral<1>;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
version: z.ZodString;
|
|
41
|
+
target: z.ZodEnum<{
|
|
42
|
+
"linux-amd64": "linux-amd64";
|
|
43
|
+
"linux-arm64": "linux-arm64";
|
|
44
|
+
}>;
|
|
45
|
+
source: z.ZodObject<{
|
|
46
|
+
repositoryId: z.ZodString;
|
|
47
|
+
commit: z.ZodString;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
display: z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
summary: z.ZodString;
|
|
52
|
+
license: z.ZodString;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
requires: z.ZodObject<{
|
|
55
|
+
runtimeProfile: z.ZodLiteral<"rentnerproxy-linux-v1">;
|
|
56
|
+
platformApi: z.ZodString;
|
|
57
|
+
appProtocol: z.ZodString;
|
|
58
|
+
uiBridge: z.ZodOptional<z.ZodString>;
|
|
59
|
+
engineCapabilities: z.ZodArray<z.ZodEnum<{
|
|
60
|
+
"caddy.crowdsec.v1": "caddy.crowdsec.v1";
|
|
61
|
+
"caddy.load-balancing.v1": "caddy.load-balancing.v1";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strict>;
|
|
64
|
+
entrypoint: z.ZodLiteral<"bin/app">;
|
|
65
|
+
api: z.ZodLiteral<"api/openapi.json">;
|
|
66
|
+
configSchema: z.ZodOptional<z.ZodString>;
|
|
67
|
+
ui: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
entrypoint: z.ZodString;
|
|
69
|
+
slots: z.ZodArray<z.ZodEnum<{
|
|
70
|
+
dashboardWidget: "dashboardWidget";
|
|
71
|
+
navigation: "navigation";
|
|
72
|
+
proxyHostTab: "proxyHostTab";
|
|
73
|
+
search: "search";
|
|
74
|
+
}>>;
|
|
75
|
+
}, z.core.$strict>>;
|
|
76
|
+
providers: z.ZodArray<z.ZodEnum<{
|
|
77
|
+
crowdsec: "crowdsec";
|
|
78
|
+
dns: "dns";
|
|
79
|
+
"docker-discovery": "docker-discovery";
|
|
80
|
+
"load-balancer": "load-balancer";
|
|
81
|
+
monitoring: "monitoring";
|
|
82
|
+
oidc: "oidc";
|
|
83
|
+
}>>;
|
|
84
|
+
capabilities: z.ZodArray<z.ZodUnion<z.ZodObject<{
|
|
85
|
+
id: z.ZodLiteral<"access.logs.read.v1" | "diagnostics.upstream.probe.v1" | "diagnostics.upstream.probe.v2" | "dns.challenge.manage.v1" | "docker.inventory.observe.v1" | "engine.contributions.submit.v1" | "identity.provider.register.v1" | "notifications.incidents.manage.v1" | "notifications.publish.v1" | "proxy.hosts.manage-owned.v1" | "proxy.hosts.read.v1" | "security.enforcement.contribute.v1">;
|
|
86
|
+
scope: z.ZodLiteral<"dnsZones" | "dockerConnections" | "identityProviders" | "installation" | "ownedEngineResources" | "ownedProxyHosts" | "proxyHosts">;
|
|
87
|
+
}, z.core.$strict>[]>>;
|
|
88
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
89
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
targetVersion: z.ZodNumber;
|
|
91
|
+
readVersions: z.ZodArray<z.ZodNumber>;
|
|
92
|
+
writeVersions: z.ZodArray<z.ZodNumber>;
|
|
93
|
+
migrations: z.ZodArray<z.ZodObject<{
|
|
94
|
+
fromVersion: z.ZodNumber;
|
|
95
|
+
toVersion: z.ZodNumber;
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
}, z.core.$strict>>;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
incidentCategories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
resource: z.ZodEnum<{
|
|
103
|
+
none: "none";
|
|
104
|
+
proxyHost: "proxyHost";
|
|
105
|
+
}>;
|
|
106
|
+
}, z.core.$strict>>>;
|
|
107
|
+
resources: z.ZodObject<{
|
|
108
|
+
startupTimeoutMs: z.ZodNumber;
|
|
109
|
+
drainTimeoutMs: z.ZodNumber;
|
|
110
|
+
memoryMiB: z.ZodNumber;
|
|
111
|
+
processLimit: z.ZodNumber;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
archive: z.ZodObject<{
|
|
115
|
+
sha256: z.ZodString;
|
|
116
|
+
sizeBytes: z.ZodNumber;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
manifestSha256: z.ZodString;
|
|
119
|
+
sbom: z.ZodObject<{
|
|
120
|
+
sha256: z.ZodString;
|
|
121
|
+
sizeBytes: z.ZodNumber;
|
|
122
|
+
}, z.core.$strict>;
|
|
123
|
+
provenance: z.ZodObject<{
|
|
124
|
+
sha256: z.ZodString;
|
|
125
|
+
sizeBytes: z.ZodNumber;
|
|
126
|
+
}, z.core.$strict>;
|
|
127
|
+
}, z.core.$strict>>;
|
|
128
|
+
icon: z.ZodOptional<z.ZodObject<{
|
|
129
|
+
format: z.ZodEnum<{
|
|
130
|
+
png: "png";
|
|
131
|
+
webp: "webp";
|
|
132
|
+
}>;
|
|
133
|
+
sha256: z.ZodString;
|
|
134
|
+
sizeBytes: z.ZodNumber;
|
|
135
|
+
}, z.core.$strict>>;
|
|
136
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export declare const approval: z.ZodObject<{
|
|
140
|
+
formatVersion: z.ZodLiteral<1>;
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
revision: z.ZodNumber;
|
|
143
|
+
actorId: z.ZodString;
|
|
144
|
+
approvedAt: z.ZodISODateTime;
|
|
145
|
+
candidate: z.ZodObject<{
|
|
146
|
+
formatVersion: z.ZodLiteral<1>;
|
|
147
|
+
id: z.ZodString;
|
|
148
|
+
revision: z.ZodNumber;
|
|
149
|
+
source: z.ZodObject<{
|
|
150
|
+
repositoryId: z.ZodString;
|
|
151
|
+
commit: z.ZodString;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
build: z.ZodObject<{
|
|
154
|
+
repositoryId: z.ZodString;
|
|
155
|
+
workflowCommit: z.ZodString;
|
|
156
|
+
workflowPath: z.ZodString;
|
|
157
|
+
runId: z.ZodString;
|
|
158
|
+
attempt: z.ZodNumber;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
evidence: z.ZodObject<{
|
|
161
|
+
revision: z.ZodNumber;
|
|
162
|
+
report: z.ZodObject<{
|
|
163
|
+
sha256: z.ZodString;
|
|
164
|
+
sizeBytes: z.ZodNumber;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
result: z.ZodLiteral<"passed">;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
release: z.ZodObject<{
|
|
169
|
+
appId: z.ZodString;
|
|
170
|
+
version: z.ZodString;
|
|
171
|
+
source: z.ZodObject<{
|
|
172
|
+
repositoryId: z.ZodString;
|
|
173
|
+
commit: z.ZodString;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
publisher: z.ZodObject<{
|
|
176
|
+
namespace: z.ZodString;
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
180
|
+
manifest: z.ZodObject<{
|
|
181
|
+
formatVersion: z.ZodLiteral<1>;
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
version: z.ZodString;
|
|
184
|
+
target: z.ZodEnum<{
|
|
185
|
+
"linux-amd64": "linux-amd64";
|
|
186
|
+
"linux-arm64": "linux-arm64";
|
|
187
|
+
}>;
|
|
188
|
+
source: z.ZodObject<{
|
|
189
|
+
repositoryId: z.ZodString;
|
|
190
|
+
commit: z.ZodString;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
display: z.ZodObject<{
|
|
193
|
+
name: z.ZodString;
|
|
194
|
+
summary: z.ZodString;
|
|
195
|
+
license: z.ZodString;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
requires: z.ZodObject<{
|
|
198
|
+
runtimeProfile: z.ZodLiteral<"rentnerproxy-linux-v1">;
|
|
199
|
+
platformApi: z.ZodString;
|
|
200
|
+
appProtocol: z.ZodString;
|
|
201
|
+
uiBridge: z.ZodOptional<z.ZodString>;
|
|
202
|
+
engineCapabilities: z.ZodArray<z.ZodEnum<{
|
|
203
|
+
"caddy.crowdsec.v1": "caddy.crowdsec.v1";
|
|
204
|
+
"caddy.load-balancing.v1": "caddy.load-balancing.v1";
|
|
205
|
+
}>>;
|
|
206
|
+
}, z.core.$strict>;
|
|
207
|
+
entrypoint: z.ZodLiteral<"bin/app">;
|
|
208
|
+
api: z.ZodLiteral<"api/openapi.json">;
|
|
209
|
+
configSchema: z.ZodOptional<z.ZodString>;
|
|
210
|
+
ui: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
entrypoint: z.ZodString;
|
|
212
|
+
slots: z.ZodArray<z.ZodEnum<{
|
|
213
|
+
dashboardWidget: "dashboardWidget";
|
|
214
|
+
navigation: "navigation";
|
|
215
|
+
proxyHostTab: "proxyHostTab";
|
|
216
|
+
search: "search";
|
|
217
|
+
}>>;
|
|
218
|
+
}, z.core.$strict>>;
|
|
219
|
+
providers: z.ZodArray<z.ZodEnum<{
|
|
220
|
+
crowdsec: "crowdsec";
|
|
221
|
+
dns: "dns";
|
|
222
|
+
"docker-discovery": "docker-discovery";
|
|
223
|
+
"load-balancer": "load-balancer";
|
|
224
|
+
monitoring: "monitoring";
|
|
225
|
+
oidc: "oidc";
|
|
226
|
+
}>>;
|
|
227
|
+
capabilities: z.ZodArray<z.ZodUnion<z.ZodObject<{
|
|
228
|
+
id: z.ZodLiteral<"access.logs.read.v1" | "diagnostics.upstream.probe.v1" | "diagnostics.upstream.probe.v2" | "dns.challenge.manage.v1" | "docker.inventory.observe.v1" | "engine.contributions.submit.v1" | "identity.provider.register.v1" | "notifications.incidents.manage.v1" | "notifications.publish.v1" | "proxy.hosts.manage-owned.v1" | "proxy.hosts.read.v1" | "security.enforcement.contribute.v1">;
|
|
229
|
+
scope: z.ZodLiteral<"dnsZones" | "dockerConnections" | "identityProviders" | "installation" | "ownedEngineResources" | "ownedProxyHosts" | "proxyHosts">;
|
|
230
|
+
}, z.core.$strict>[]>>;
|
|
231
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
232
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
targetVersion: z.ZodNumber;
|
|
234
|
+
readVersions: z.ZodArray<z.ZodNumber>;
|
|
235
|
+
writeVersions: z.ZodArray<z.ZodNumber>;
|
|
236
|
+
migrations: z.ZodArray<z.ZodObject<{
|
|
237
|
+
fromVersion: z.ZodNumber;
|
|
238
|
+
toVersion: z.ZodNumber;
|
|
239
|
+
path: z.ZodString;
|
|
240
|
+
}, z.core.$strict>>;
|
|
241
|
+
}, z.core.$strict>>;
|
|
242
|
+
incidentCategories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
243
|
+
id: z.ZodString;
|
|
244
|
+
name: z.ZodString;
|
|
245
|
+
resource: z.ZodEnum<{
|
|
246
|
+
none: "none";
|
|
247
|
+
proxyHost: "proxyHost";
|
|
248
|
+
}>;
|
|
249
|
+
}, z.core.$strict>>>;
|
|
250
|
+
resources: z.ZodObject<{
|
|
251
|
+
startupTimeoutMs: z.ZodNumber;
|
|
252
|
+
drainTimeoutMs: z.ZodNumber;
|
|
253
|
+
memoryMiB: z.ZodNumber;
|
|
254
|
+
processLimit: z.ZodNumber;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
}, z.core.$strict>;
|
|
257
|
+
archive: z.ZodObject<{
|
|
258
|
+
sha256: z.ZodString;
|
|
259
|
+
sizeBytes: z.ZodNumber;
|
|
260
|
+
}, z.core.$strict>;
|
|
261
|
+
manifestSha256: z.ZodString;
|
|
262
|
+
sbom: z.ZodObject<{
|
|
263
|
+
sha256: z.ZodString;
|
|
264
|
+
sizeBytes: z.ZodNumber;
|
|
265
|
+
}, z.core.$strict>;
|
|
266
|
+
provenance: z.ZodObject<{
|
|
267
|
+
sha256: z.ZodString;
|
|
268
|
+
sizeBytes: z.ZodNumber;
|
|
269
|
+
}, z.core.$strict>;
|
|
270
|
+
}, z.core.$strict>>;
|
|
271
|
+
icon: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
format: z.ZodEnum<{
|
|
273
|
+
png: "png";
|
|
274
|
+
webp: "webp";
|
|
275
|
+
}>;
|
|
276
|
+
sha256: z.ZodString;
|
|
277
|
+
sizeBytes: z.ZodNumber;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
}, z.core.$strict>;
|
|
282
|
+
}, z.core.$strict>;
|
|
283
|
+
export declare const publication: z.ZodObject<{
|
|
284
|
+
formatVersion: z.ZodLiteral<1>;
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
approvalId: z.ZodString;
|
|
287
|
+
approvalRevision: z.ZodNumber;
|
|
288
|
+
catalogRevision: z.ZodNumber;
|
|
289
|
+
publishedAt: z.ZodISODateTime;
|
|
290
|
+
run: z.ZodObject<{
|
|
291
|
+
repositoryId: z.ZodString;
|
|
292
|
+
workflowCommit: z.ZodString;
|
|
293
|
+
workflowPath: z.ZodString;
|
|
294
|
+
runId: z.ZodString;
|
|
295
|
+
attempt: z.ZodNumber;
|
|
296
|
+
}, z.core.$strict>;
|
|
297
|
+
release: z.ZodObject<{
|
|
298
|
+
appId: z.ZodString;
|
|
299
|
+
version: z.ZodString;
|
|
300
|
+
source: z.ZodObject<{
|
|
301
|
+
repositoryId: z.ZodString;
|
|
302
|
+
commit: z.ZodString;
|
|
303
|
+
}, z.core.$strict>;
|
|
304
|
+
publisher: z.ZodObject<{
|
|
305
|
+
namespace: z.ZodString;
|
|
306
|
+
name: z.ZodString;
|
|
307
|
+
}, z.core.$strict>;
|
|
308
|
+
packages: z.ZodArray<z.ZodObject<{
|
|
309
|
+
manifest: z.ZodObject<{
|
|
310
|
+
formatVersion: z.ZodLiteral<1>;
|
|
311
|
+
id: z.ZodString;
|
|
312
|
+
version: z.ZodString;
|
|
313
|
+
target: z.ZodEnum<{
|
|
314
|
+
"linux-amd64": "linux-amd64";
|
|
315
|
+
"linux-arm64": "linux-arm64";
|
|
316
|
+
}>;
|
|
317
|
+
source: z.ZodObject<{
|
|
318
|
+
repositoryId: z.ZodString;
|
|
319
|
+
commit: z.ZodString;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
display: z.ZodObject<{
|
|
322
|
+
name: z.ZodString;
|
|
323
|
+
summary: z.ZodString;
|
|
324
|
+
license: z.ZodString;
|
|
325
|
+
}, z.core.$strict>;
|
|
326
|
+
requires: z.ZodObject<{
|
|
327
|
+
runtimeProfile: z.ZodLiteral<"rentnerproxy-linux-v1">;
|
|
328
|
+
platformApi: z.ZodString;
|
|
329
|
+
appProtocol: z.ZodString;
|
|
330
|
+
uiBridge: z.ZodOptional<z.ZodString>;
|
|
331
|
+
engineCapabilities: z.ZodArray<z.ZodEnum<{
|
|
332
|
+
"caddy.crowdsec.v1": "caddy.crowdsec.v1";
|
|
333
|
+
"caddy.load-balancing.v1": "caddy.load-balancing.v1";
|
|
334
|
+
}>>;
|
|
335
|
+
}, z.core.$strict>;
|
|
336
|
+
entrypoint: z.ZodLiteral<"bin/app">;
|
|
337
|
+
api: z.ZodLiteral<"api/openapi.json">;
|
|
338
|
+
configSchema: z.ZodOptional<z.ZodString>;
|
|
339
|
+
ui: z.ZodOptional<z.ZodObject<{
|
|
340
|
+
entrypoint: z.ZodString;
|
|
341
|
+
slots: z.ZodArray<z.ZodEnum<{
|
|
342
|
+
dashboardWidget: "dashboardWidget";
|
|
343
|
+
navigation: "navigation";
|
|
344
|
+
proxyHostTab: "proxyHostTab";
|
|
345
|
+
search: "search";
|
|
346
|
+
}>>;
|
|
347
|
+
}, z.core.$strict>>;
|
|
348
|
+
providers: z.ZodArray<z.ZodEnum<{
|
|
349
|
+
crowdsec: "crowdsec";
|
|
350
|
+
dns: "dns";
|
|
351
|
+
"docker-discovery": "docker-discovery";
|
|
352
|
+
"load-balancer": "load-balancer";
|
|
353
|
+
monitoring: "monitoring";
|
|
354
|
+
oidc: "oidc";
|
|
355
|
+
}>>;
|
|
356
|
+
capabilities: z.ZodArray<z.ZodUnion<z.ZodObject<{
|
|
357
|
+
id: z.ZodLiteral<"access.logs.read.v1" | "diagnostics.upstream.probe.v1" | "diagnostics.upstream.probe.v2" | "dns.challenge.manage.v1" | "docker.inventory.observe.v1" | "engine.contributions.submit.v1" | "identity.provider.register.v1" | "notifications.incidents.manage.v1" | "notifications.publish.v1" | "proxy.hosts.manage-owned.v1" | "proxy.hosts.read.v1" | "security.enforcement.contribute.v1">;
|
|
358
|
+
scope: z.ZodLiteral<"dnsZones" | "dockerConnections" | "identityProviders" | "installation" | "ownedEngineResources" | "ownedProxyHosts" | "proxyHosts">;
|
|
359
|
+
}, z.core.$strict>[]>>;
|
|
360
|
+
permissions: z.ZodArray<z.ZodString>;
|
|
361
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
362
|
+
targetVersion: z.ZodNumber;
|
|
363
|
+
readVersions: z.ZodArray<z.ZodNumber>;
|
|
364
|
+
writeVersions: z.ZodArray<z.ZodNumber>;
|
|
365
|
+
migrations: z.ZodArray<z.ZodObject<{
|
|
366
|
+
fromVersion: z.ZodNumber;
|
|
367
|
+
toVersion: z.ZodNumber;
|
|
368
|
+
path: z.ZodString;
|
|
369
|
+
}, z.core.$strict>>;
|
|
370
|
+
}, z.core.$strict>>;
|
|
371
|
+
incidentCategories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
372
|
+
id: z.ZodString;
|
|
373
|
+
name: z.ZodString;
|
|
374
|
+
resource: z.ZodEnum<{
|
|
375
|
+
none: "none";
|
|
376
|
+
proxyHost: "proxyHost";
|
|
377
|
+
}>;
|
|
378
|
+
}, z.core.$strict>>>;
|
|
379
|
+
resources: z.ZodObject<{
|
|
380
|
+
startupTimeoutMs: z.ZodNumber;
|
|
381
|
+
drainTimeoutMs: z.ZodNumber;
|
|
382
|
+
memoryMiB: z.ZodNumber;
|
|
383
|
+
processLimit: z.ZodNumber;
|
|
384
|
+
}, z.core.$strict>;
|
|
385
|
+
}, z.core.$strict>;
|
|
386
|
+
archive: z.ZodObject<{
|
|
387
|
+
sha256: z.ZodString;
|
|
388
|
+
sizeBytes: z.ZodNumber;
|
|
389
|
+
}, z.core.$strict>;
|
|
390
|
+
manifestSha256: z.ZodString;
|
|
391
|
+
sbom: z.ZodObject<{
|
|
392
|
+
sha256: z.ZodString;
|
|
393
|
+
sizeBytes: z.ZodNumber;
|
|
394
|
+
}, z.core.$strict>;
|
|
395
|
+
provenance: z.ZodObject<{
|
|
396
|
+
sha256: z.ZodString;
|
|
397
|
+
sizeBytes: z.ZodNumber;
|
|
398
|
+
}, z.core.$strict>;
|
|
399
|
+
}, z.core.$strict>>;
|
|
400
|
+
icon: z.ZodOptional<z.ZodObject<{
|
|
401
|
+
format: z.ZodEnum<{
|
|
402
|
+
png: "png";
|
|
403
|
+
webp: "webp";
|
|
404
|
+
}>;
|
|
405
|
+
sha256: z.ZodString;
|
|
406
|
+
sizeBytes: z.ZodNumber;
|
|
407
|
+
}, z.core.$strict>>;
|
|
408
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, z.core.$strict>;
|
|
410
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { catalogRelease } from './catalog.js';
|
|
3
|
+
import { archive, commit, formatVersion, githubId, positiveInteger, recordId, sourceIdentity, timestamp, } from './primitives.js';
|
|
4
|
+
const workflowRun = z.strictObject({
|
|
5
|
+
repositoryId: githubId,
|
|
6
|
+
workflowCommit: commit,
|
|
7
|
+
workflowPath: z
|
|
8
|
+
.string()
|
|
9
|
+
.max(160)
|
|
10
|
+
.regex(/^\.github\/workflows\/[a-zA-Z0-9_-]+\.ya?ml$/),
|
|
11
|
+
runId: githubId,
|
|
12
|
+
attempt: positiveInteger,
|
|
13
|
+
});
|
|
14
|
+
export const candidate = z
|
|
15
|
+
.strictObject({
|
|
16
|
+
formatVersion,
|
|
17
|
+
id: recordId,
|
|
18
|
+
revision: positiveInteger,
|
|
19
|
+
source: sourceIdentity,
|
|
20
|
+
build: workflowRun,
|
|
21
|
+
evidence: z.strictObject({
|
|
22
|
+
revision: positiveInteger,
|
|
23
|
+
report: archive,
|
|
24
|
+
result: z.literal('passed'),
|
|
25
|
+
}),
|
|
26
|
+
release: catalogRelease,
|
|
27
|
+
})
|
|
28
|
+
.describe('Private candidate snapshot. The validation report and each target archive have their own byte identity. A record claiming success does not establish trusted validation evidence.');
|
|
29
|
+
export const approval = z
|
|
30
|
+
.strictObject({
|
|
31
|
+
formatVersion,
|
|
32
|
+
id: recordId,
|
|
33
|
+
revision: positiveInteger,
|
|
34
|
+
actorId: recordId,
|
|
35
|
+
approvedAt: timestamp,
|
|
36
|
+
candidate,
|
|
37
|
+
})
|
|
38
|
+
.describe('Private approval for the entire candidate snapshot, including ordered arrays. Resolve actor permissions and current approval state at the trusted publication boundary.');
|
|
39
|
+
export const publication = z
|
|
40
|
+
.strictObject({
|
|
41
|
+
formatVersion,
|
|
42
|
+
id: recordId,
|
|
43
|
+
approvalId: recordId,
|
|
44
|
+
approvalRevision: positiveInteger,
|
|
45
|
+
catalogRevision: positiveInteger,
|
|
46
|
+
publishedAt: timestamp,
|
|
47
|
+
run: workflowRun,
|
|
48
|
+
release: catalogRelease,
|
|
49
|
+
})
|
|
50
|
+
.describe('Private publication receipt. Reconcile by immutable approval revision and exact release contents. Record publication only after the unchanged package bytes and matching signed catalog are available.');
|