@rentnerproxy/app-contracts 0.0.0-stage → 1.1.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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -2
  3. package/contracts.schema.json +4007 -0
  4. package/dist/Types/contract.types.d.ts +15 -0
  5. package/dist/Types/contract.types.js +1 -0
  6. package/dist/catalog.d.ts +352 -0
  7. package/dist/catalog.js +54 -0
  8. package/dist/client.d.ts +31 -0
  9. package/dist/client.js +66 -0
  10. package/dist/http-operations.d.ts +333 -0
  11. package/dist/http-operations.generated.d.ts +299 -0
  12. package/dist/http-operations.generated.js +300 -0
  13. package/dist/http-operations.js +17 -0
  14. package/dist/http.d.ts +127 -0
  15. package/dist/http.js +142 -0
  16. package/dist/index.d.ts +5 -0
  17. package/dist/index.js +4 -0
  18. package/dist/manifest.d.ts +90 -0
  19. package/dist/manifest.js +106 -0
  20. package/dist/platform-api.d.ts +282 -0
  21. package/dist/platform-api.js +287 -0
  22. package/dist/primitives.d.ts +33 -0
  23. package/dist/primitives.js +87 -0
  24. package/dist/provider-api.d.ts +221 -0
  25. package/dist/provider-api.js +227 -0
  26. package/dist/public-schemas.d.ts +4 -0
  27. package/dist/public-schemas.js +6 -0
  28. package/dist/publication.d.ts +410 -0
  29. package/dist/publication.js +50 -0
  30. package/dist/runtime.d.ts +75 -0
  31. package/dist/runtime.js +88 -0
  32. package/dist/schemas.d.ts +926 -0
  33. package/dist/schemas.js +114 -0
  34. package/dist/ui-bridge.d.ts +81 -0
  35. package/dist/ui-bridge.js +92 -0
  36. package/dist/validation.d.ts +784 -0
  37. package/dist/validation.js +245 -0
  38. package/dist/wire.d.ts +31 -0
  39. package/dist/wire.js +54 -0
  40. package/fixtures.json +1094 -0
  41. package/http-fixtures.json +829 -0
  42. package/openapi.json +2557 -0
  43. package/package.json +60 -5
  44. package/protocol-fixtures.json +1804 -0
  45. package/upstream-probe-fixtures.json +852 -0
@@ -0,0 +1,287 @@
1
+ import { z } from 'zod';
2
+ import { providerProfile } from './manifest.js';
3
+ import { displayName, recordId, sha256, summary } from './primitives.js';
4
+ const hostname = z
5
+ .string()
6
+ .max(253)
7
+ .regex(/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/)
8
+ .describe('Lowercase ASCII hostname. Encode international names as A-labels.');
9
+ const listCursor = z.string().regex(/^[A-Za-z0-9_-]{1,256}$/);
10
+ const listedDomain = z
11
+ .string()
12
+ .max(255)
13
+ .regex(/^(?:\*\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/)
14
+ .describe('Lowercase ASCII domain, optionally with a leading wildcard label.');
15
+ const proxyHost = z.looseObject({
16
+ id: recordId,
17
+ revision: recordId,
18
+ hostname,
19
+ enabled: z
20
+ .boolean()
21
+ .optional()
22
+ .describe('Whether the host serves traffic. Platforms that serve diagnostics.upstream.probe.v2 always include it.'),
23
+ domains: z
24
+ .array(listedDomain)
25
+ .min(1)
26
+ .optional()
27
+ .describe('Every domain of the host in ascending order. Platforms that serve diagnostics.upstream.probe.v2 always include it; a probe names one of these domains that is not a wildcard.'),
28
+ probeRevision: sha256
29
+ .optional()
30
+ .describe('Changes only when something an upstream probe observes changes. Platforms that serve diagnostics.upstream.probe.v2 always include it, and each probe result carries the value from when the probe ran.'),
31
+ });
32
+ const upstreamAddress = z.union([z.ipv4(), z.ipv6(), hostname]);
33
+ const maxUpstreamProbes = 32;
34
+ const probedHost = {
35
+ hostId: recordId.describe('Host ID from the proxy host listing.'),
36
+ domain: hostname.describe('One of the listed domains of the host, sent to the upstream like a request for that domain. Wildcard domains cannot be probed.'),
37
+ };
38
+ const upstreamProbeTarget = z.strictObject({
39
+ ...probedHost,
40
+ timeoutMs: z
41
+ .number()
42
+ .int()
43
+ .min(1_000)
44
+ .max(8_000)
45
+ .describe('Upstream deadline in milliseconds. It leaves room for the platform checks within the App API request deadline.'),
46
+ });
47
+ const upstreamProbeFailure = z
48
+ .discriminatedUnion('stage', [
49
+ z.looseObject({
50
+ stage: z.literal('configuration'),
51
+ code: z.enum([
52
+ 'configuration_stale',
53
+ 'configuration_changed',
54
+ 'host_not_active',
55
+ 'runtime_unavailable',
56
+ ]),
57
+ }),
58
+ z.looseObject({
59
+ stage: z.literal('tls'),
60
+ code: z.literal('tls_failed'),
61
+ }),
62
+ z.looseObject({
63
+ stage: z.literal('upstream'),
64
+ code: z.enum([
65
+ 'upstream_unreachable',
66
+ 'upstream_timeout',
67
+ 'upstream_dns_failed',
68
+ 'upstream_responded',
69
+ 'access_denied',
70
+ 'upstream_error',
71
+ 'redirect_not_followed',
72
+ 'unexpected_status',
73
+ 'redirect_host',
74
+ 'wildcard_domain',
75
+ 'skipped',
76
+ ]),
77
+ }),
78
+ ])
79
+ .describe('The first stage that prevented a usable upstream response, checked in this order: the active proxy configuration did not serve the host and domain, upstream TLS verification failed, or the upstream sent no HTTP response. Built-in monitoring reports configuration failures as unknown, tls_failed and the upstream codes upstream_unreachable, upstream_timeout and upstream_dns_failed as unhealthy, and any other upstream code as an invalid response.');
80
+ const upstreamProbeOutcome = z
81
+ .discriminatedUnion('outcome', [
82
+ z.looseObject({
83
+ outcome: z.literal('probed'),
84
+ ...probedHost,
85
+ probeRevision: sha256.describe('Equals the probeRevision of the host in the listing when the probe ran. A different value means that something the probe observes changed since the host was listed.'),
86
+ durationMs: z
87
+ .number()
88
+ .int()
89
+ .min(0)
90
+ .max(12_000)
91
+ .describe('Duration of the upstream stage.'),
92
+ httpStatus: z
93
+ .number()
94
+ .int()
95
+ .min(100)
96
+ .max(599)
97
+ .nullable()
98
+ .describe('Status of the upstream response, or null without one. Compare it with the expected status only when failure is null. Built-in monitoring accepts exactly the expected status, and any 2xx or 3xx status while the expected status is the default 200.'),
99
+ failure: upstreamProbeFailure.nullable(),
100
+ }),
101
+ z.looseObject({
102
+ outcome: z
103
+ .enum([
104
+ 'scopeDenied',
105
+ 'hostRemoved',
106
+ 'hostDisabled',
107
+ 'domainNotFound',
108
+ 'configurationChanged',
109
+ 'busy',
110
+ 'rateLimited',
111
+ 'unavailable',
112
+ ])
113
+ .describe('The probe did not run or its result was discarded. scopeDenied: the grant no longer covers the host. hostRemoved, hostDisabled and domainNotFound: list the hosts again. configurationChanged: the host or proxy configuration changed during the probe; discard it. busy: monitoring-class capacity is in use or a probe of the same host is running. rateLimited: this installation exhausted its probe budget. unavailable: the proxy runtime cannot run probes. Retry busy, rateLimited and unavailable later with backoff.'),
114
+ ...probedHost,
115
+ }),
116
+ ])
117
+ .describe('The result of one probe.');
118
+ const notification = z.strictObject({
119
+ category: recordId,
120
+ severity: z.enum(['info', 'warning', 'error']),
121
+ title: displayName,
122
+ message: summary,
123
+ });
124
+ /** A link-like run that a mail client could turn into a link, after ASCII-only lowercasing. */
125
+ const linkLike = /(?:[a-z][a-z0-9+.-]*:\/\/|www\.|mailto:)/u;
126
+ /** Lowercase ASCII letters only, as the Rust SDK does, so both SDKs fold case alike. */
127
+ function asciiLowercase(value) {
128
+ return value.replace(/[A-Z]/gu, (letter) => letter.toLowerCase());
129
+ }
130
+ /**
131
+ * Plain incident text on one line: no control, surrogate, format, line or paragraph separator
132
+ * characters, and no links.
133
+ */
134
+ function incidentText(maximum) {
135
+ return z
136
+ .string()
137
+ .regex(new RegExp(`^[^\\p{Cc}\\p{Cs}\\p{Cf}\\p{Zl}\\p{Zp}]{1,${maximum}}$`, 'u'))
138
+ .refine((value) => !linkLike.test(asciiLowercase(value)), 'Incident text cannot contain links.');
139
+ }
140
+ const appIncidentChange = z
141
+ .discriminatedUnion('status', [
142
+ z.strictObject({
143
+ status: z.literal('open'),
144
+ category: recordId.describe('An incident category the manifest declares.'),
145
+ severity: z.enum(['warning', 'error', 'critical']),
146
+ title: incidentText(80),
147
+ message: incidentText(400),
148
+ resourceId: recordId
149
+ .optional()
150
+ .describe('Required for a proxyHost category and absent otherwise: the listed host ID the incident refers to. The app must hold a read or probe grant that covers the host.'),
151
+ }),
152
+ z.strictObject({ status: z.literal('resolved') }),
153
+ ])
154
+ .describe("Assert the current state of the incident the path key names. Open creates or updates it and resolve closes it. The SDK rejects link-like text. The platform renders title and message as plain text in its own templates, delivers through mail and webhook channels to users who subscribe to the category and may see the resource, and never sends a notification twice for a repeated state. Send the current state again with every observation: while notifications are paused after a restore, the platform keeps no incidents. Derive the idempotency key from the incident key and the asserted state, so a repeated observation reuses it and stays within the platform's idempotency record limit.");
155
+ export const jsonValue = z.json();
156
+ const maxLegacyHandoffParts = 1_024;
157
+ const maxLegacyHandoffPartBytes = 262_144;
158
+ const utf8 = new TextEncoder();
159
+ const legacyHandoffDomain = providerProfile.describe('Built-in feature domain that an official app takes over. It equals a provider profile. The app manifest must declare that profile, and the installation must hold the platform grant to register a provider for it.');
160
+ const legacyHandoffDigest = sha256.describe('Opaque lowercase hexadecimal SHA-256 of the fixed export. It binds the domain and the ordered part hashes. Pass it unchanged to every part read and to commit.');
161
+ const legacyHandoffSequence = z
162
+ .number()
163
+ .int()
164
+ .min(0)
165
+ .max(maxLegacyHandoffParts - 1)
166
+ .describe('Zero-based position of a part in the fixed export. Valid sequences satisfy 0 <= sequence < partCount.');
167
+ const platformOwned = z.strictObject({
168
+ domain: legacyHandoffDomain,
169
+ state: z.literal('platform'),
170
+ });
171
+ const exported = z.strictObject({
172
+ domain: legacyHandoffDomain,
173
+ state: z.literal('exported'),
174
+ digest: legacyHandoffDigest,
175
+ partCount: z
176
+ .number()
177
+ .int()
178
+ .min(0)
179
+ .max(maxLegacyHandoffParts)
180
+ .describe('Number of parts in the fixed export.'),
181
+ });
182
+ const committed = z.strictObject({
183
+ domain: legacyHandoffDomain,
184
+ state: z.literal('committed'),
185
+ digest: legacyHandoffDigest,
186
+ });
187
+ const legacyHandoffSchemas = {
188
+ LegacyHandoffDomain: legacyHandoffDomain,
189
+ LegacyHandoffStatus: z
190
+ .discriminatedUnion('state', [platformOwned, exported, committed])
191
+ .describe('Ownership of the domain as seen by the active generation of the calling installation. platform means the platform still owns it. exported means this installation is importing the fixed export. committed means this installation owns it. Another holder is a conflict, never a state.'),
192
+ LegacyHandoffBeginResult: z
193
+ .discriminatedUnion('state', [exported, committed])
194
+ .describe('exported carries the fixed export that this installation imports. committed means this installation already owns the domain and carries the committed digest without a part count.'),
195
+ LegacyHandoffPartRequest: z
196
+ .strictObject({
197
+ digest: legacyHandoffDigest,
198
+ sequence: legacyHandoffSequence,
199
+ })
200
+ .describe('Read one part of the export that begin fixed for this installation. The digest binds the read to that export. A read of a replaced export with a different digest fails and returns no part.'),
201
+ LegacyHandoffPart: z
202
+ .strictObject({ sequence: legacyHandoffSequence, part: jsonValue })
203
+ .refine(({ part }) => utf8.encode(JSON.stringify(part)).byteLength <=
204
+ maxLegacyHandoffPartBytes, 'The serialized part exceeds the size limit.')
205
+ .describe('One exported part as App API wire JSON. The SDK checks that the compact JSON.stringify form of part is at most 262144 UTF-8 bytes. Import it durably before commit.'),
206
+ LegacyHandoffCommit: z
207
+ .strictObject({ digest: legacyHandoffDigest })
208
+ .describe('Commit exactly the digest that begin returned after every part is imported durably. The platform retires its state once.'),
209
+ LegacyHandoffCommitResult: committed.describe('This installation owns the domain. A repeated commit with the same digest returns the same result.'),
210
+ };
211
+ export const appApiPayload = z
212
+ .record(z.string(), jsonValue)
213
+ .describe('A bounded JSON object. The gateway and app validate its content against the installed operation schema.');
214
+ export const platformApiSchemas = {
215
+ AppApiPayload: appApiPayload,
216
+ ProxyHostQuery: z.strictObject({
217
+ limit: z.number().int().min(1).max(100),
218
+ cursor: listCursor.optional(),
219
+ }),
220
+ ProxyHostPage: z.looseObject({
221
+ hosts: z.array(proxyHost).max(100),
222
+ nextCursor: listCursor.optional(),
223
+ }),
224
+ OwnedProxyHostChange: z.discriminatedUnion('action', [
225
+ z.strictObject({
226
+ action: z.literal('upsert'),
227
+ hostId: recordId,
228
+ expectedRevision: recordId
229
+ .nullable()
230
+ .describe('Null requires that the host does not yet exist.'),
231
+ hostname,
232
+ upstream: z.strictObject({
233
+ scheme: z.enum(['http', 'https']),
234
+ address: upstreamAddress,
235
+ port: z.number().int().min(1).max(65_535),
236
+ }),
237
+ }),
238
+ z.strictObject({
239
+ action: z.literal('remove'),
240
+ hostId: recordId,
241
+ expectedRevision: recordId,
242
+ }),
243
+ ]),
244
+ UpstreamProbe: z.strictObject({
245
+ hostId: recordId,
246
+ timeoutMs: z.number().int().min(1).max(10_000),
247
+ }),
248
+ UpstreamProbeResult: z.discriminatedUnion('outcome', [
249
+ z.looseObject({
250
+ outcome: z.literal('reachable'),
251
+ durationMs: z.number().int().min(0).max(10_000),
252
+ }),
253
+ z.looseObject({ outcome: z.enum(['unreachable', 'timedOut']) }),
254
+ ]),
255
+ UpstreamProbeBatch: z
256
+ .strictObject({
257
+ probes: z
258
+ .array(upstreamProbeTarget)
259
+ .min(1)
260
+ .max(maxUpstreamProbes)
261
+ .refine((probes) => new Set(probes.map(({ hostId }) => hostId)).size ===
262
+ probes.length, 'Probe each host at most once per batch.'),
263
+ })
264
+ .describe('Probe hosts that a diagnostics.upstream.probe.v2 grant covers, each through the domain the app chooses from the listing. The SDK checks that each host appears once. The platform admits every probe with monitoring-class capacity separate from interactive Domain Checks, against a budget of this installation sized for 1,000 hosts probed every 60 seconds.'),
265
+ UpstreamProbeOutcome: upstreamProbeOutcome,
266
+ UpstreamProbeBatchResult: z
267
+ .looseObject({
268
+ results: z
269
+ .array(upstreamProbeOutcome)
270
+ .min(1)
271
+ .max(maxUpstreamProbes),
272
+ })
273
+ .describe('One result for every requested probe, in request order.'),
274
+ AppNotification: notification,
275
+ AppIncidentChange: appIncidentChange,
276
+ AppAuditEvent: z.strictObject({
277
+ action: recordId,
278
+ outcome: z.enum(['succeeded', 'rejected', 'failed']),
279
+ resourceId: recordId.optional(),
280
+ }),
281
+ AppSecret: z
282
+ .strictObject({
283
+ value: z.string().min(1).max(16_384),
284
+ })
285
+ .describe('Return only to the authorized backend. Keep secret values out of logs and browser messages.'),
286
+ ...legacyHandoffSchemas,
287
+ };
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ export declare const contractVersion = "1.1.0";
3
+ export declare const protocolVersion: z.ZodLiteral<"1.0.0">;
4
+ export declare const runtimeProfile: z.ZodLiteral<"rentnerproxy-linux-v1">;
5
+ export declare const formatVersion: z.ZodLiteral<1>;
6
+ export declare const positiveInteger: z.ZodNumber;
7
+ export declare const stateVersion: z.ZodNumber;
8
+ export declare const recordId: z.ZodString;
9
+ export declare const githubId: z.ZodString;
10
+ export declare const sha256: z.ZodString;
11
+ export declare const commit: z.ZodString;
12
+ export declare const target: z.ZodEnum<{
13
+ "linux-amd64": "linux-amd64";
14
+ "linux-arm64": "linux-arm64";
15
+ }>;
16
+ export declare const timestamp: z.ZodISODateTime;
17
+ export declare const namespace: z.ZodString;
18
+ export declare const appId: z.ZodString;
19
+ export declare const appVersion: z.ZodString;
20
+ export declare const v1ProtocolVersion: z.ZodString;
21
+ export declare const protocolRange: z.ZodString;
22
+ export declare const displayName: z.ZodString;
23
+ export declare const summary: z.ZodString;
24
+ export declare const releaseNotes: z.ZodString;
25
+ export declare function packagePath(directory: string, extension: string): z.ZodString;
26
+ export declare const archive: z.ZodObject<{
27
+ sha256: z.ZodString;
28
+ sizeBytes: z.ZodNumber;
29
+ }, z.core.$strict>;
30
+ export declare const sourceIdentity: z.ZodObject<{
31
+ repositoryId: z.ZodString;
32
+ commit: z.ZodString;
33
+ }, z.core.$strict>;
@@ -0,0 +1,87 @@
1
+ import { z } from 'zod';
2
+ export const contractVersion = '1.1.0';
3
+ export const protocolVersion = z.literal('1.0.0');
4
+ export const runtimeProfile = z
5
+ .literal('rentnerproxy-linux-v1')
6
+ .describe('Native Linux appliance profile exercised on AMD64 and ARM64. Runtime compatibility is checked against the supported appliance profile at installation.');
7
+ export const formatVersion = z
8
+ .literal(1)
9
+ .describe('Wire version. Readers reject unknown versions and unknown fields. Changes to a closed shape, allowed value, or meaning require a new wire version after v1 stabilizes.');
10
+ export const positiveInteger = z
11
+ .number()
12
+ .int()
13
+ .min(1)
14
+ .max(Number.MAX_SAFE_INTEGER);
15
+ export const stateVersion = z.number().int().min(1).max(2_147_483_647);
16
+ export const recordId = z.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/);
17
+ export const githubId = z.string().regex(/^[1-9][0-9]{0,19}$/);
18
+ export const sha256 = z.string().regex(/^[a-f0-9]{64}$/);
19
+ export const commit = z.string().regex(/^[a-f0-9]{40}$/);
20
+ export const target = z.enum(['linux-amd64', 'linux-arm64']);
21
+ export const timestamp = z.iso
22
+ .datetime({ precision: 3 })
23
+ .describe('UTC timestamp with exactly three fractional digits. Time and actor authority are verified by the caller.');
24
+ function slug(maxLength) {
25
+ return '[a-z](?:[a-z0-9-]{0,' + (maxLength - 2) + '}[a-z0-9])?';
26
+ }
27
+ export const namespace = z.string().regex(new RegExp('^' + slug(32) + '$'));
28
+ export const appId = z
29
+ .string()
30
+ .regex(new RegExp('^' + slug(32) + '\\.' + slug(64) + '$'));
31
+ // Package names are part of the immutable release identity. Build metadata
32
+ // would introduce distinct names with equal SemVer precedence.
33
+ const part = '(?:0|[1-9][0-9]{0,5})';
34
+ const prerelease = '(?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)';
35
+ export const appVersion = z
36
+ .string()
37
+ .max(64)
38
+ .regex(new RegExp('^' +
39
+ part +
40
+ '\\.' +
41
+ part +
42
+ '\\.' +
43
+ part +
44
+ '(?:-' +
45
+ prerelease +
46
+ '(?:\\.' +
47
+ prerelease +
48
+ ')*)?$'));
49
+ const v1Protocol = '1\\.' + part + '\\.' + part;
50
+ export const v1ProtocolVersion = z
51
+ .string()
52
+ .regex(new RegExp('^' + v1Protocol + '$'));
53
+ export const protocolRange = z
54
+ .string()
55
+ .regex(new RegExp('^>=' + v1Protocol + ' <(?:' + v1Protocol + '|2\\.0\\.0)$'))
56
+ .describe('Inclusive minimum and exclusive maximum within protocol major 1. The minimum must be less than the maximum.');
57
+ // Use Unicode scalar counts and exclude control characters in both validators.
58
+ export const displayName = z.string().regex(/^[^\p{Cc}\p{Cs}]{1,80}$/u);
59
+ export const summary = z.string().regex(/^[^\p{Cc}\p{Cs}]{1,400}$/u);
60
+ export const releaseNotes = z
61
+ .string()
62
+ .regex(/^(?:[^\p{Cc}\p{Cs}]|\n){1,2000}$/u);
63
+ const applicationPath = '[a-zA-Z0-9_-]+(?:\\.[a-zA-Z0-9_-]+)*';
64
+ export function packagePath(directory, extension) {
65
+ return z
66
+ .string()
67
+ .max(240)
68
+ .regex(new RegExp('^' +
69
+ directory +
70
+ '/(?:' +
71
+ applicationPath +
72
+ '/)*' +
73
+ applicationPath +
74
+ '\\.(?:' +
75
+ extension +
76
+ ')$'));
77
+ }
78
+ export const archive = z.strictObject({
79
+ sha256,
80
+ sizeBytes: z.number().int().min(1).max(2_147_483_647),
81
+ });
82
+ export const sourceIdentity = z
83
+ .strictObject({
84
+ repositoryId: githubId,
85
+ commit,
86
+ })
87
+ .describe('Immutable GitHub repository ID and exact source commit.');
@@ -0,0 +1,221 @@
1
+ import { z } from 'zod';
2
+ export declare const providerSchemas: {
3
+ ProviderRegistration: z.ZodObject<{
4
+ id: z.ZodString;
5
+ profile: z.ZodEnum<{
6
+ crowdsec: "crowdsec";
7
+ dns: "dns";
8
+ "docker-discovery": "docker-discovery";
9
+ "load-balancer": "load-balancer";
10
+ monitoring: "monitoring";
11
+ oidc: "oidc";
12
+ }>;
13
+ version: z.ZodLiteral<"1.0.0">;
14
+ }, z.core.$strict>;
15
+ ProviderRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
16
+ profile: z.ZodEnum<{
17
+ monitoring: "monitoring";
18
+ }>;
19
+ payload: z.ZodObject<{
20
+ limit: z.ZodNumber;
21
+ }, z.core.$strict>;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ profile: z.ZodEnum<{
24
+ "docker-discovery": "docker-discovery";
25
+ }>;
26
+ payload: z.ZodObject<{
27
+ connectionId: z.ZodString;
28
+ limit: z.ZodNumber;
29
+ }, z.core.$strict>;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ profile: z.ZodEnum<{
32
+ "load-balancer": "load-balancer";
33
+ }>;
34
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
+ action: z.ZodLiteral<"apply">;
36
+ contributionId: z.ZodString;
37
+ revision: z.ZodString;
38
+ policy: z.ZodEnum<{
39
+ leastConnections: "leastConnections";
40
+ roundRobin: "roundRobin";
41
+ }>;
42
+ upstreams: z.ZodArray<z.ZodObject<{
43
+ address: z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>;
44
+ port: z.ZodNumber;
45
+ }, z.core.$strict>>;
46
+ }, z.core.$strict>, z.ZodObject<{
47
+ action: z.ZodLiteral<"readStatus">;
48
+ contributionId: z.ZodString;
49
+ }, z.core.$strict>], "action">;
50
+ }, z.core.$strict>, z.ZodObject<{
51
+ profile: z.ZodEnum<{
52
+ dns: "dns";
53
+ }>;
54
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
55
+ action: z.ZodLiteral<"present">;
56
+ challengeId: z.ZodString;
57
+ zoneId: z.ZodString;
58
+ name: z.ZodString;
59
+ value: z.ZodString;
60
+ }, z.core.$strict>, z.ZodObject<{
61
+ action: z.ZodLiteral<"check">;
62
+ challengeId: z.ZodString;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ action: z.ZodLiteral<"cleanup">;
65
+ challengeId: z.ZodString;
66
+ }, z.core.$strict>], "action">;
67
+ }, z.core.$strict>, z.ZodObject<{
68
+ profile: z.ZodEnum<{
69
+ oidc: "oidc";
70
+ }>;
71
+ payload: z.ZodObject<{
72
+ transactionId: z.ZodString;
73
+ }, z.core.$strict>;
74
+ }, z.core.$strict>, z.ZodObject<{
75
+ profile: z.ZodEnum<{
76
+ crowdsec: "crowdsec";
77
+ }>;
78
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
79
+ action: z.ZodLiteral<"consumeLogs">;
80
+ batchId: z.ZodString;
81
+ entries: z.ZodArray<z.ZodObject<{
82
+ proxyHostId: z.ZodString;
83
+ observedAt: z.ZodISODateTime;
84
+ clientAddress: z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>;
85
+ status: z.ZodNumber;
86
+ }, z.core.$strict>>;
87
+ }, z.core.$strict>, z.ZodObject<{
88
+ action: z.ZodLiteral<"evaluate">;
89
+ proxyHostId: z.ZodString;
90
+ clientAddress: z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>;
91
+ }, z.core.$strict>], "action">;
92
+ }, z.core.$strict>], "profile">;
93
+ ProviderResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
94
+ profile: z.ZodEnum<{
95
+ monitoring: "monitoring";
96
+ }>;
97
+ payload: z.ZodObject<{
98
+ samples: z.ZodArray<z.ZodObject<{
99
+ serviceId: z.ZodString;
100
+ observedAt: z.ZodISODateTime;
101
+ healthy: z.ZodBoolean;
102
+ }, z.core.$loose>>;
103
+ }, z.core.$loose>;
104
+ }, z.core.$loose>, z.ZodObject<{
105
+ profile: z.ZodEnum<{
106
+ "docker-discovery": "docker-discovery";
107
+ }>;
108
+ payload: z.ZodObject<{
109
+ connectionId: z.ZodString;
110
+ observations: z.ZodArray<z.ZodObject<{
111
+ workloadId: z.ZodString;
112
+ observedAt: z.ZodISODateTime;
113
+ address: z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6]>;
114
+ port: z.ZodNumber;
115
+ }, z.core.$loose>>;
116
+ }, z.core.$loose>;
117
+ }, z.core.$loose>, z.ZodObject<{
118
+ profile: z.ZodEnum<{
119
+ "load-balancer": "load-balancer";
120
+ }>;
121
+ payload: z.ZodObject<{
122
+ contributionId: z.ZodString;
123
+ revisionStatus: z.ZodDiscriminatedUnion<[z.ZodObject<{
124
+ status: z.ZodLiteral<"applied">;
125
+ appliedRevision: z.ZodString;
126
+ }, z.core.$loose>, z.ZodObject<{
127
+ status: z.ZodEnum<{
128
+ rejected: "rejected";
129
+ unavailable: "unavailable";
130
+ unchanged: "unchanged";
131
+ }>;
132
+ appliedRevision: z.ZodNullable<z.ZodString>;
133
+ }, z.core.$loose>], "status">;
134
+ }, z.core.$loose>;
135
+ }, z.core.$loose>, z.ZodObject<{
136
+ profile: z.ZodEnum<{
137
+ dns: "dns";
138
+ }>;
139
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
140
+ action: z.ZodEnum<{
141
+ cleanup: "cleanup";
142
+ present: "present";
143
+ }>;
144
+ challengeId: z.ZodString;
145
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
146
+ id: z.ZodString;
147
+ status: z.ZodEnum<{
148
+ accepted: "accepted";
149
+ cancelled: "cancelled";
150
+ cancelling: "cancelling";
151
+ running: "running";
152
+ succeeded: "succeeded";
153
+ }>;
154
+ problem: z.ZodOptional<z.ZodNever>;
155
+ }, z.core.$loose>, z.ZodObject<{
156
+ id: z.ZodString;
157
+ status: z.ZodLiteral<"failed">;
158
+ problem: z.ZodObject<{
159
+ type: z.ZodString;
160
+ title: z.ZodString;
161
+ status: z.ZodNumber;
162
+ code: z.ZodString;
163
+ requestId: z.ZodString;
164
+ }, z.core.$strict>;
165
+ }, z.core.$loose>], "status">;
166
+ }, z.core.$loose>, z.ZodObject<{
167
+ action: z.ZodLiteral<"check">;
168
+ challengeId: z.ZodString;
169
+ outcome: z.ZodEnum<{
170
+ missing: "missing";
171
+ unavailable: "unavailable";
172
+ verified: "verified";
173
+ }>;
174
+ }, z.core.$loose>], "action">;
175
+ }, z.core.$loose>, z.ZodObject<{
176
+ profile: z.ZodEnum<{
177
+ oidc: "oidc";
178
+ }>;
179
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
180
+ outcome: z.ZodLiteral<"verified">;
181
+ transactionId: z.ZodString;
182
+ identity: z.ZodObject<{
183
+ subject: z.ZodString;
184
+ groups: z.ZodArray<z.ZodString>;
185
+ }, z.core.$loose>;
186
+ }, z.core.$loose>, z.ZodObject<{
187
+ outcome: z.ZodEnum<{
188
+ invalid: "invalid";
189
+ unavailable: "unavailable";
190
+ }>;
191
+ transactionId: z.ZodString;
192
+ }, z.core.$loose>], "outcome">;
193
+ }, z.core.$loose>, z.ZodObject<{
194
+ profile: z.ZodEnum<{
195
+ crowdsec: "crowdsec";
196
+ }>;
197
+ payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
198
+ action: z.ZodLiteral<"consumeLogs">;
199
+ batchId: z.ZodString;
200
+ outcome: z.ZodEnum<{
201
+ processed: "processed";
202
+ unavailable: "unavailable";
203
+ }>;
204
+ }, z.core.$loose>, z.ZodObject<{
205
+ action: z.ZodLiteral<"evaluate">;
206
+ decision: z.ZodDiscriminatedUnion<[z.ZodObject<{
207
+ outcome: z.ZodLiteral<"allow">;
208
+ allowed: z.ZodLiteral<true>;
209
+ cachedBlock: z.ZodLiteral<false>;
210
+ }, z.core.$loose>, z.ZodObject<{
211
+ outcome: z.ZodLiteral<"deny">;
212
+ allowed: z.ZodLiteral<false>;
213
+ cachedBlock: z.ZodLiteral<true>;
214
+ }, z.core.$loose>, z.ZodObject<{
215
+ outcome: z.ZodLiteral<"unavailable">;
216
+ allowed: z.ZodLiteral<false>;
217
+ cachedBlock: z.ZodBoolean;
218
+ }, z.core.$loose>], "outcome">;
219
+ }, z.core.$loose>], "action">;
220
+ }, z.core.$loose>], "profile">;
221
+ };