@dakkitor/api-contracts 1.6.0 → 1.7.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 (28) hide show
  1. package/dist/curated-worker-leads/candidate-edit-session.contract.d.ts +12 -12
  2. package/dist/curated-worker-leads/consent-queue.contract.d.ts +28 -28
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +6 -0
  6. package/dist/outreach/__tests__/outreach-requests.contract.spec.js +37 -0
  7. package/dist/outreach/lab-outreach.contract.d.ts +1110 -0
  8. package/dist/outreach/lab-outreach.contract.d.ts.map +1 -0
  9. package/dist/outreach/lab-outreach.contract.js +174 -0
  10. package/dist/outreach/lab-outreach.contract.spec.d.ts +2 -0
  11. package/dist/outreach/lab-outreach.contract.spec.d.ts.map +1 -0
  12. package/dist/outreach/lab-outreach.contract.spec.js +90 -0
  13. package/dist/outreach/outreach-requests.contract.d.ts +84 -0
  14. package/dist/outreach/outreach-requests.contract.d.ts.map +1 -1
  15. package/dist/outreach/outreach-requests.schemas.d.ts +9 -0
  16. package/dist/outreach/outreach-requests.schemas.d.ts.map +1 -1
  17. package/dist/outreach/outreach-requests.schemas.js +3 -0
  18. package/dist/outreach/outreach.contract.spec.js +3 -0
  19. package/dist/relay-pods/relay-lab-fleet.contract.d.ts +829 -0
  20. package/dist/relay-pods/relay-lab-fleet.contract.d.ts.map +1 -0
  21. package/dist/relay-pods/relay-lab-fleet.contract.js +79 -0
  22. package/dist/relay-pods/relay-lab-fleet.contract.spec.d.ts +2 -0
  23. package/dist/relay-pods/relay-lab-fleet.contract.spec.d.ts.map +1 -0
  24. package/dist/relay-pods/relay-lab-fleet.contract.spec.js +146 -0
  25. package/dist/relay-pods/relay-lab-fleet.schemas.d.ts +443 -0
  26. package/dist/relay-pods/relay-lab-fleet.schemas.d.ts.map +1 -0
  27. package/dist/relay-pods/relay-lab-fleet.schemas.js +138 -0
  28. package/package.json +1 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
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.relayLabFleetContract = void 0;
18
+ const core_1 = require("@ts-rest/core");
19
+ const zod_1 = require("zod");
20
+ const error_schemas_1 = require("../common/error-schemas");
21
+ const relay_lab_fleet_schemas_1 = require("./relay-lab-fleet.schemas");
22
+ __exportStar(require("./relay-lab-fleet.schemas"), exports);
23
+ const c = (0, core_1.initContract)();
24
+ const enrollmentPathParams = zod_1.z
25
+ .object({
26
+ localDeviceKey: zod_1.z.string().min(1),
27
+ })
28
+ .strict();
29
+ exports.relayLabFleetContract = c.router({
30
+ publishSnapshot: {
31
+ method: 'PUT',
32
+ path: '/relay-pods/me/lab-devices/snapshot',
33
+ body: relay_lab_fleet_schemas_1.PublishRelayLabSnapshotBodySchema,
34
+ responses: {
35
+ 200: relay_lab_fleet_schemas_1.PublishRelayLabSnapshotResponseSchema,
36
+ },
37
+ summary: 'Publish a Relay pod Lab-device snapshot',
38
+ metadata: { tags: ['Relay Lab Fleet'] },
39
+ },
40
+ readFleet: {
41
+ method: 'GET',
42
+ path: '/relay-pods/lab-fleet',
43
+ responses: {
44
+ 200: relay_lab_fleet_schemas_1.RelayLabFleetSnapshotSchema,
45
+ },
46
+ summary: 'Read the current multi-pod Relay Lab fleet',
47
+ metadata: { tags: ['Relay Lab Fleet'] },
48
+ },
49
+ reportReadiness: {
50
+ method: 'PUT',
51
+ path: '/relay-pods/me/lab-readiness',
52
+ body: relay_lab_fleet_schemas_1.ReportRelayLabReadinessBodySchema,
53
+ responses: {
54
+ 200: relay_lab_fleet_schemas_1.RelayLabReadinessSchema,
55
+ },
56
+ summary: 'Report pod-local Relay Lab readiness',
57
+ metadata: { tags: ['Relay Lab Fleet'] },
58
+ },
59
+ updateEnrollment: {
60
+ method: 'PATCH',
61
+ path: '/relay-pods/me/lab-devices/:localDeviceKey/enrollment',
62
+ pathParams: enrollmentPathParams,
63
+ body: relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema,
64
+ responses: {
65
+ 200: relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentResponseSchema,
66
+ 404: error_schemas_1.ErrorResponseSchema,
67
+ },
68
+ summary: 'Update a local Relay Lab device enrollment state',
69
+ metadata: { tags: ['Relay Lab Fleet'] },
70
+ },
71
+ }, {
72
+ pathPrefix: '/v2',
73
+ commonResponses: {
74
+ 400: error_schemas_1.ErrorResponseSchema,
75
+ 401: error_schemas_1.ErrorResponseSchema,
76
+ 403: error_schemas_1.ErrorResponseSchema,
77
+ 500: error_schemas_1.ErrorResponseSchema,
78
+ },
79
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=relay-lab-fleet.contract.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-lab-fleet.contract.spec.d.ts","sourceRoot":"","sources":["../../contracts/relay-pods/relay-lab-fleet.contract.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const bun_test_1 = require("bun:test");
4
+ const relay_lab_fleet_schemas_1 = require("./relay-lab-fleet.schemas");
5
+ const relay_lab_fleet_contract_1 = require("./relay-lab-fleet.contract");
6
+ const index_1 = require("../index");
7
+ const podId = '11111111-1111-4111-8111-111111111111';
8
+ const labDeviceId = '22222222-2222-4222-8222-222222222222';
9
+ const now = '2026-08-02T09:00:00.000Z';
10
+ const device = {
11
+ id: labDeviceId,
12
+ podId,
13
+ podSlug: 'pod-01',
14
+ podDisplayName: 'Pod 01',
15
+ localDeviceKey: 'phone-01',
16
+ label: 'Primary phone',
17
+ phoneE164: '+447700900123',
18
+ identityVersion: 1,
19
+ lifecycleStatus: 'ACTIVE',
20
+ enrollmentStatus: 'ENROLLED',
21
+ connectionStatus: 'ONLINE',
22
+ restrictionStatus: 'NONE',
23
+ identityStatus: 'VALID',
24
+ lastSeenAt: now,
25
+ };
26
+ (0, bun_test_1.describe)('relay Lab fleet schemas', () => {
27
+ (0, bun_test_1.it)('keeps the canonical fleet device strict', () => {
28
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.RelayLabDeviceSchema.parse(device)).toMatchObject({
29
+ id: labDeviceId,
30
+ podId,
31
+ phoneE164: '+447700900123',
32
+ });
33
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.RelayLabDeviceSchema.safeParse({ ...device, workerId: podId }).success).toBe(false);
34
+ });
35
+ (0, bun_test_1.it)('accepts pod-local snapshot rows without caller-supplied pod scope', () => {
36
+ const body = {
37
+ generation: 7,
38
+ observedAt: now,
39
+ devices: [
40
+ {
41
+ localDeviceKey: 'phone-01',
42
+ label: 'Primary phone',
43
+ phoneE164: '+447700900123',
44
+ lifecycleStatus: 'ACTIVE',
45
+ connectionStatus: 'ONLINE',
46
+ restrictionStatus: 'NONE',
47
+ lastSeenAt: now,
48
+ },
49
+ ],
50
+ };
51
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.PublishRelayLabSnapshotBodySchema.parse(body)).toEqual(body);
52
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.PublishRelayLabSnapshotBodySchema.safeParse({ ...body, podId }).success).toBe(false);
53
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.PublishRelayLabSnapshotBodySchema.safeParse({
54
+ ...body,
55
+ devices: [{ ...body.devices[0], enrollmentStatus: 'ENROLLED' }],
56
+ }).success).toBe(false);
57
+ });
58
+ (0, bun_test_1.it)('accepts only server-scoped readiness facts', () => {
59
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.ReportRelayLabReadinessBodySchema.safeParse({
60
+ revision: 43,
61
+ requiredPairCount: 2,
62
+ savedPairCount: 2,
63
+ failedPairCount: 0,
64
+ missingPairs: [],
65
+ }).success).toBe(true);
66
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.ReportRelayLabReadinessBodySchema.safeParse({
67
+ podId,
68
+ revision: 43,
69
+ requiredPairCount: 2,
70
+ savedPairCount: 2,
71
+ failedPairCount: 0,
72
+ missingPairs: [],
73
+ }).success).toBe(false);
74
+ });
75
+ (0, bun_test_1.it)('accepts only the exported contact-reconciliation readiness error codes', () => {
76
+ const readiness = {
77
+ revision: 43,
78
+ requiredPairCount: 1,
79
+ savedPairCount: 0,
80
+ failedPairCount: 1,
81
+ missingPairs: [
82
+ {
83
+ ownerLocalDeviceKey: 'phone-01',
84
+ contactLabDeviceId: labDeviceId,
85
+ errorCode: 'CONTACT_WRITE_FAILED',
86
+ },
87
+ ],
88
+ };
89
+ for (const errorCode of relay_lab_fleet_schemas_1.RELAY_LAB_READINESS_ERROR_CODES) {
90
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.ReportRelayLabReadinessBodySchema.safeParse({
91
+ ...readiness,
92
+ missingPairs: [{ ...readiness.missingPairs[0], errorCode }],
93
+ }).success).toBe(true);
94
+ }
95
+ for (const errorCode of [
96
+ 'failed for +447700900123',
97
+ 'contact_write_failed',
98
+ `X_${'A'.repeat(64)}`,
99
+ 'PHONE_447700900123',
100
+ 'CONTACT_447700900123',
101
+ ]) {
102
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.ReportRelayLabReadinessBodySchema.safeParse({
103
+ ...readiness,
104
+ missingPairs: [{ ...readiness.missingPairs[0], errorCode }],
105
+ }).success).toBe(false);
106
+ }
107
+ });
108
+ (0, bun_test_1.it)('emits compact SSE payloads without phone numbers', () => {
109
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.LabFleetSsePayloadSchema.parse({
110
+ revision: 43,
111
+ changeType: 'IDENTITY_CHANGED',
112
+ sourcePodId: podId,
113
+ affectedDeviceIds: [labDeviceId],
114
+ })).not.toHaveProperty('phoneNumber');
115
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.LabFleetSsePayloadSchema.safeParse({
116
+ revision: 43,
117
+ changeType: 'IDENTITY_CHANGED',
118
+ sourcePodId: podId,
119
+ affectedDeviceIds: [labDeviceId],
120
+ phoneNumber: '+447700900123',
121
+ }).success).toBe(false);
122
+ });
123
+ (0, bun_test_1.it)('accepts only enroll and revoke as human enrollment commands', () => {
124
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
125
+ enrollmentStatus: 'ENROLLED',
126
+ }).success).toBe(true);
127
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
128
+ enrollmentStatus: 'REVOKED',
129
+ }).success).toBe(true);
130
+ (0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
131
+ enrollmentStatus: 'UNENROLLED',
132
+ }).success).toBe(false);
133
+ });
134
+ });
135
+ (0, bun_test_1.describe)('relayLabFleetContract routes', () => {
136
+ (0, bun_test_1.it)('publishes the pod and fleet lifecycle endpoints under /v2', () => {
137
+ (0, bun_test_1.expect)(relay_lab_fleet_contract_1.relayLabFleetContract.publishSnapshot.path).toBe('/v2/relay-pods/me/lab-devices/snapshot');
138
+ (0, bun_test_1.expect)(relay_lab_fleet_contract_1.relayLabFleetContract.readFleet.path).toBe('/v2/relay-pods/lab-fleet');
139
+ (0, bun_test_1.expect)(relay_lab_fleet_contract_1.relayLabFleetContract.reportReadiness.path).toBe('/v2/relay-pods/me/lab-readiness');
140
+ (0, bun_test_1.expect)(relay_lab_fleet_contract_1.relayLabFleetContract.updateEnrollment).toMatchObject({
141
+ method: 'PATCH',
142
+ path: '/v2/relay-pods/me/lab-devices/:localDeviceKey/enrollment',
143
+ });
144
+ (0, bun_test_1.expect)(index_1.apiContractRouter.RelayLabFleet.readFleet.path).toBe('/v2/relay-pods/lab-fleet');
145
+ });
146
+ });
@@ -0,0 +1,443 @@
1
+ import { z } from 'zod';
2
+ export declare const RelayLabLifecycleSchema: z.ZodEnum<["ACTIVE", "RETIRED"]>;
3
+ export declare const RelayLabEnrollmentSchema: z.ZodEnum<["UNENROLLED", "ENROLLED", "REVOKED"]>;
4
+ export declare const RelayLabIdentityStatusSchema: z.ZodEnum<["INCOMPLETE", "VALID", "CONFLICT"]>;
5
+ /**
6
+ * Closed v1 vocabulary emitted by Relay contact reconciliation. Keep this
7
+ * list free of device identifiers, phone numbers, and raw error text.
8
+ */
9
+ export declare const RELAY_LAB_READINESS_ERROR_CODES: readonly ["OWNER_OFFLINE", "CONTACT_WRITE_FAILED"];
10
+ export declare const RelayLabReadinessErrorCodeSchema: z.ZodEnum<["OWNER_OFFLINE", "CONTACT_WRITE_FAILED"]>;
11
+ export declare const RelayLabDeviceSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ podId: z.ZodString;
14
+ podSlug: z.ZodString;
15
+ podDisplayName: z.ZodString;
16
+ localDeviceKey: z.ZodString;
17
+ label: z.ZodNullable<z.ZodString>;
18
+ phoneE164: z.ZodNullable<z.ZodString>;
19
+ identityVersion: z.ZodNumber;
20
+ lifecycleStatus: z.ZodEnum<["ACTIVE", "RETIRED"]>;
21
+ enrollmentStatus: z.ZodEnum<["UNENROLLED", "ENROLLED", "REVOKED"]>;
22
+ connectionStatus: z.ZodEnum<["ONLINE", "OFFLINE"]>;
23
+ restrictionStatus: z.ZodEnum<["NONE", "RECOVERING", "RESTRICTED"]>;
24
+ identityStatus: z.ZodEnum<["INCOMPLETE", "VALID", "CONFLICT"]>;
25
+ lastSeenAt: z.ZodString;
26
+ }, "strict", z.ZodTypeAny, {
27
+ id: string;
28
+ podId: string;
29
+ podSlug: string;
30
+ podDisplayName: string;
31
+ localDeviceKey: string;
32
+ label: string | null;
33
+ phoneE164: string | null;
34
+ identityVersion: number;
35
+ lifecycleStatus: "ACTIVE" | "RETIRED";
36
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
37
+ connectionStatus: "ONLINE" | "OFFLINE";
38
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
39
+ identityStatus: "INCOMPLETE" | "VALID" | "CONFLICT";
40
+ lastSeenAt: string;
41
+ }, {
42
+ id: string;
43
+ podId: string;
44
+ podSlug: string;
45
+ podDisplayName: string;
46
+ localDeviceKey: string;
47
+ label: string | null;
48
+ phoneE164: string | null;
49
+ identityVersion: number;
50
+ lifecycleStatus: "ACTIVE" | "RETIRED";
51
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
52
+ connectionStatus: "ONLINE" | "OFFLINE";
53
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
54
+ identityStatus: "INCOMPLETE" | "VALID" | "CONFLICT";
55
+ lastSeenAt: string;
56
+ }>;
57
+ export declare const RelayLabReadinessSchema: z.ZodObject<{
58
+ podId: z.ZodString;
59
+ podDisplayName: z.ZodString;
60
+ revision: z.ZodNumber;
61
+ requiredPairCount: z.ZodNumber;
62
+ savedPairCount: z.ZodNumber;
63
+ failedPairCount: z.ZodNumber;
64
+ missingPairs: z.ZodArray<z.ZodObject<{
65
+ ownerLocalDeviceKey: z.ZodString;
66
+ contactLabDeviceId: z.ZodString;
67
+ errorCode: z.ZodEnum<["OWNER_OFFLINE", "CONTACT_WRITE_FAILED"]>;
68
+ }, "strict", z.ZodTypeAny, {
69
+ ownerLocalDeviceKey: string;
70
+ contactLabDeviceId: string;
71
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
72
+ }, {
73
+ ownerLocalDeviceKey: string;
74
+ contactLabDeviceId: string;
75
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
76
+ }>, "many">;
77
+ reportedAt: z.ZodString;
78
+ expiresAt: z.ZodString;
79
+ ready: z.ZodBoolean;
80
+ }, "strict", z.ZodTypeAny, {
81
+ podId: string;
82
+ podDisplayName: string;
83
+ revision: number;
84
+ requiredPairCount: number;
85
+ savedPairCount: number;
86
+ failedPairCount: number;
87
+ missingPairs: {
88
+ ownerLocalDeviceKey: string;
89
+ contactLabDeviceId: string;
90
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
91
+ }[];
92
+ reportedAt: string;
93
+ expiresAt: string;
94
+ ready: boolean;
95
+ }, {
96
+ podId: string;
97
+ podDisplayName: string;
98
+ revision: number;
99
+ requiredPairCount: number;
100
+ savedPairCount: number;
101
+ failedPairCount: number;
102
+ missingPairs: {
103
+ ownerLocalDeviceKey: string;
104
+ contactLabDeviceId: string;
105
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
106
+ }[];
107
+ reportedAt: string;
108
+ expiresAt: string;
109
+ ready: boolean;
110
+ }>;
111
+ export declare const RelayLabFleetSnapshotSchema: z.ZodObject<{
112
+ revision: z.ZodNumber;
113
+ devices: z.ZodArray<z.ZodObject<{
114
+ id: z.ZodString;
115
+ podId: z.ZodString;
116
+ podSlug: z.ZodString;
117
+ podDisplayName: z.ZodString;
118
+ localDeviceKey: z.ZodString;
119
+ label: z.ZodNullable<z.ZodString>;
120
+ phoneE164: z.ZodNullable<z.ZodString>;
121
+ identityVersion: z.ZodNumber;
122
+ lifecycleStatus: z.ZodEnum<["ACTIVE", "RETIRED"]>;
123
+ enrollmentStatus: z.ZodEnum<["UNENROLLED", "ENROLLED", "REVOKED"]>;
124
+ connectionStatus: z.ZodEnum<["ONLINE", "OFFLINE"]>;
125
+ restrictionStatus: z.ZodEnum<["NONE", "RECOVERING", "RESTRICTED"]>;
126
+ identityStatus: z.ZodEnum<["INCOMPLETE", "VALID", "CONFLICT"]>;
127
+ lastSeenAt: z.ZodString;
128
+ }, "strict", z.ZodTypeAny, {
129
+ id: string;
130
+ podId: string;
131
+ podSlug: string;
132
+ podDisplayName: string;
133
+ localDeviceKey: string;
134
+ label: string | null;
135
+ phoneE164: string | null;
136
+ identityVersion: number;
137
+ lifecycleStatus: "ACTIVE" | "RETIRED";
138
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
139
+ connectionStatus: "ONLINE" | "OFFLINE";
140
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
141
+ identityStatus: "INCOMPLETE" | "VALID" | "CONFLICT";
142
+ lastSeenAt: string;
143
+ }, {
144
+ id: string;
145
+ podId: string;
146
+ podSlug: string;
147
+ podDisplayName: string;
148
+ localDeviceKey: string;
149
+ label: string | null;
150
+ phoneE164: string | null;
151
+ identityVersion: number;
152
+ lifecycleStatus: "ACTIVE" | "RETIRED";
153
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
154
+ connectionStatus: "ONLINE" | "OFFLINE";
155
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
156
+ identityStatus: "INCOMPLETE" | "VALID" | "CONFLICT";
157
+ lastSeenAt: string;
158
+ }>, "many">;
159
+ readiness: z.ZodArray<z.ZodObject<{
160
+ podId: z.ZodString;
161
+ podDisplayName: z.ZodString;
162
+ revision: z.ZodNumber;
163
+ requiredPairCount: z.ZodNumber;
164
+ savedPairCount: z.ZodNumber;
165
+ failedPairCount: z.ZodNumber;
166
+ missingPairs: z.ZodArray<z.ZodObject<{
167
+ ownerLocalDeviceKey: z.ZodString;
168
+ contactLabDeviceId: z.ZodString;
169
+ errorCode: z.ZodEnum<["OWNER_OFFLINE", "CONTACT_WRITE_FAILED"]>;
170
+ }, "strict", z.ZodTypeAny, {
171
+ ownerLocalDeviceKey: string;
172
+ contactLabDeviceId: string;
173
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
174
+ }, {
175
+ ownerLocalDeviceKey: string;
176
+ contactLabDeviceId: string;
177
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
178
+ }>, "many">;
179
+ reportedAt: z.ZodString;
180
+ expiresAt: z.ZodString;
181
+ ready: z.ZodBoolean;
182
+ }, "strict", z.ZodTypeAny, {
183
+ podId: string;
184
+ podDisplayName: string;
185
+ revision: number;
186
+ requiredPairCount: number;
187
+ savedPairCount: number;
188
+ failedPairCount: number;
189
+ missingPairs: {
190
+ ownerLocalDeviceKey: string;
191
+ contactLabDeviceId: string;
192
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
193
+ }[];
194
+ reportedAt: string;
195
+ expiresAt: string;
196
+ ready: boolean;
197
+ }, {
198
+ podId: string;
199
+ podDisplayName: string;
200
+ revision: number;
201
+ requiredPairCount: number;
202
+ savedPairCount: number;
203
+ failedPairCount: number;
204
+ missingPairs: {
205
+ ownerLocalDeviceKey: string;
206
+ contactLabDeviceId: string;
207
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
208
+ }[];
209
+ reportedAt: string;
210
+ expiresAt: string;
211
+ ready: boolean;
212
+ }>, "many">;
213
+ }, "strict", z.ZodTypeAny, {
214
+ revision: number;
215
+ devices: {
216
+ id: string;
217
+ podId: string;
218
+ podSlug: string;
219
+ podDisplayName: string;
220
+ localDeviceKey: string;
221
+ label: string | null;
222
+ phoneE164: string | null;
223
+ identityVersion: number;
224
+ lifecycleStatus: "ACTIVE" | "RETIRED";
225
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
226
+ connectionStatus: "ONLINE" | "OFFLINE";
227
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
228
+ identityStatus: "INCOMPLETE" | "VALID" | "CONFLICT";
229
+ lastSeenAt: string;
230
+ }[];
231
+ readiness: {
232
+ podId: string;
233
+ podDisplayName: string;
234
+ revision: number;
235
+ requiredPairCount: number;
236
+ savedPairCount: number;
237
+ failedPairCount: number;
238
+ missingPairs: {
239
+ ownerLocalDeviceKey: string;
240
+ contactLabDeviceId: string;
241
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
242
+ }[];
243
+ reportedAt: string;
244
+ expiresAt: string;
245
+ ready: boolean;
246
+ }[];
247
+ }, {
248
+ revision: number;
249
+ devices: {
250
+ id: string;
251
+ podId: string;
252
+ podSlug: string;
253
+ podDisplayName: string;
254
+ localDeviceKey: string;
255
+ label: string | null;
256
+ phoneE164: string | null;
257
+ identityVersion: number;
258
+ lifecycleStatus: "ACTIVE" | "RETIRED";
259
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
260
+ connectionStatus: "ONLINE" | "OFFLINE";
261
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
262
+ identityStatus: "INCOMPLETE" | "VALID" | "CONFLICT";
263
+ lastSeenAt: string;
264
+ }[];
265
+ readiness: {
266
+ podId: string;
267
+ podDisplayName: string;
268
+ revision: number;
269
+ requiredPairCount: number;
270
+ savedPairCount: number;
271
+ failedPairCount: number;
272
+ missingPairs: {
273
+ ownerLocalDeviceKey: string;
274
+ contactLabDeviceId: string;
275
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
276
+ }[];
277
+ reportedAt: string;
278
+ expiresAt: string;
279
+ ready: boolean;
280
+ }[];
281
+ }>;
282
+ /**
283
+ * A pod can publish only its local observations. Recruitment derives pod
284
+ * ownership and enrollment state from the authenticated machine principal.
285
+ */
286
+ export declare const PublishRelayLabSnapshotBodySchema: z.ZodObject<{
287
+ generation: z.ZodNumber;
288
+ observedAt: z.ZodString;
289
+ devices: z.ZodArray<z.ZodObject<{
290
+ localDeviceKey: z.ZodString;
291
+ label: z.ZodNullable<z.ZodString>;
292
+ phoneE164: z.ZodNullable<z.ZodString>;
293
+ lifecycleStatus: z.ZodEnum<["ACTIVE", "RETIRED"]>;
294
+ connectionStatus: z.ZodEnum<["ONLINE", "OFFLINE"]>;
295
+ restrictionStatus: z.ZodEnum<["NONE", "RECOVERING", "RESTRICTED"]>;
296
+ lastSeenAt: z.ZodString;
297
+ }, "strict", z.ZodTypeAny, {
298
+ localDeviceKey: string;
299
+ label: string | null;
300
+ phoneE164: string | null;
301
+ lifecycleStatus: "ACTIVE" | "RETIRED";
302
+ connectionStatus: "ONLINE" | "OFFLINE";
303
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
304
+ lastSeenAt: string;
305
+ }, {
306
+ localDeviceKey: string;
307
+ label: string | null;
308
+ phoneE164: string | null;
309
+ lifecycleStatus: "ACTIVE" | "RETIRED";
310
+ connectionStatus: "ONLINE" | "OFFLINE";
311
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
312
+ lastSeenAt: string;
313
+ }>, "many">;
314
+ }, "strict", z.ZodTypeAny, {
315
+ devices: {
316
+ localDeviceKey: string;
317
+ label: string | null;
318
+ phoneE164: string | null;
319
+ lifecycleStatus: "ACTIVE" | "RETIRED";
320
+ connectionStatus: "ONLINE" | "OFFLINE";
321
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
322
+ lastSeenAt: string;
323
+ }[];
324
+ generation: number;
325
+ observedAt: string;
326
+ }, {
327
+ devices: {
328
+ localDeviceKey: string;
329
+ label: string | null;
330
+ phoneE164: string | null;
331
+ lifecycleStatus: "ACTIVE" | "RETIRED";
332
+ connectionStatus: "ONLINE" | "OFFLINE";
333
+ restrictionStatus: "NONE" | "RECOVERING" | "RESTRICTED";
334
+ lastSeenAt: string;
335
+ }[];
336
+ generation: number;
337
+ observedAt: string;
338
+ }>;
339
+ export declare const PublishRelayLabSnapshotResponseSchema: z.ZodObject<{
340
+ acceptedGeneration: z.ZodNumber;
341
+ revision: z.ZodNumber;
342
+ }, "strict", z.ZodTypeAny, {
343
+ revision: number;
344
+ acceptedGeneration: number;
345
+ }, {
346
+ revision: number;
347
+ acceptedGeneration: number;
348
+ }>;
349
+ /** The pod supplies readiness facts; timestamps and readiness are server-owned. */
350
+ export declare const ReportRelayLabReadinessBodySchema: z.ZodObject<Omit<{
351
+ podId: z.ZodString;
352
+ podDisplayName: z.ZodString;
353
+ revision: z.ZodNumber;
354
+ requiredPairCount: z.ZodNumber;
355
+ savedPairCount: z.ZodNumber;
356
+ failedPairCount: z.ZodNumber;
357
+ missingPairs: z.ZodArray<z.ZodObject<{
358
+ ownerLocalDeviceKey: z.ZodString;
359
+ contactLabDeviceId: z.ZodString;
360
+ errorCode: z.ZodEnum<["OWNER_OFFLINE", "CONTACT_WRITE_FAILED"]>;
361
+ }, "strict", z.ZodTypeAny, {
362
+ ownerLocalDeviceKey: string;
363
+ contactLabDeviceId: string;
364
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
365
+ }, {
366
+ ownerLocalDeviceKey: string;
367
+ contactLabDeviceId: string;
368
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
369
+ }>, "many">;
370
+ reportedAt: z.ZodString;
371
+ expiresAt: z.ZodString;
372
+ ready: z.ZodBoolean;
373
+ }, "podId" | "podDisplayName" | "reportedAt" | "expiresAt" | "ready">, "strict", z.ZodTypeAny, {
374
+ revision: number;
375
+ requiredPairCount: number;
376
+ savedPairCount: number;
377
+ failedPairCount: number;
378
+ missingPairs: {
379
+ ownerLocalDeviceKey: string;
380
+ contactLabDeviceId: string;
381
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
382
+ }[];
383
+ }, {
384
+ revision: number;
385
+ requiredPairCount: number;
386
+ savedPairCount: number;
387
+ failedPairCount: number;
388
+ missingPairs: {
389
+ ownerLocalDeviceKey: string;
390
+ contactLabDeviceId: string;
391
+ errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
392
+ }[];
393
+ }>;
394
+ export declare const UpdateRelayLabEnrollmentBodySchema: z.ZodObject<{
395
+ enrollmentStatus: z.ZodEnum<["ENROLLED", "REVOKED"]>;
396
+ }, "strict", z.ZodTypeAny, {
397
+ enrollmentStatus: "ENROLLED" | "REVOKED";
398
+ }, {
399
+ enrollmentStatus: "ENROLLED" | "REVOKED";
400
+ }>;
401
+ export declare const UpdateRelayLabEnrollmentResponseSchema: z.ZodObject<{
402
+ localDeviceKey: z.ZodString;
403
+ enrollmentStatus: z.ZodEnum<["UNENROLLED", "ENROLLED", "REVOKED"]>;
404
+ revision: z.ZodNumber;
405
+ }, "strict", z.ZodTypeAny, {
406
+ localDeviceKey: string;
407
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
408
+ revision: number;
409
+ }, {
410
+ localDeviceKey: string;
411
+ enrollmentStatus: "UNENROLLED" | "ENROLLED" | "REVOKED";
412
+ revision: number;
413
+ }>;
414
+ export declare const LabFleetSsePayloadSchema: z.ZodObject<{
415
+ revision: z.ZodNumber;
416
+ changeType: z.ZodEnum<["DEVICE_ADDED", "IDENTITY_CHANGED", "AVAILABILITY_CHANGED", "ENROLLMENT_CHANGED", "DEVICE_RETIRED"]>;
417
+ sourcePodId: z.ZodString;
418
+ affectedDeviceIds: z.ZodArray<z.ZodString, "many">;
419
+ }, "strict", z.ZodTypeAny, {
420
+ revision: number;
421
+ changeType: "DEVICE_ADDED" | "IDENTITY_CHANGED" | "AVAILABILITY_CHANGED" | "ENROLLMENT_CHANGED" | "DEVICE_RETIRED";
422
+ sourcePodId: string;
423
+ affectedDeviceIds: string[];
424
+ }, {
425
+ revision: number;
426
+ changeType: "DEVICE_ADDED" | "IDENTITY_CHANGED" | "AVAILABILITY_CHANGED" | "ENROLLMENT_CHANGED" | "DEVICE_RETIRED";
427
+ sourcePodId: string;
428
+ affectedDeviceIds: string[];
429
+ }>;
430
+ export type RelayLabLifecycle = z.infer<typeof RelayLabLifecycleSchema>;
431
+ export type RelayLabEnrollment = z.infer<typeof RelayLabEnrollmentSchema>;
432
+ export type RelayLabIdentityStatus = z.infer<typeof RelayLabIdentityStatusSchema>;
433
+ export type RelayLabReadinessErrorCode = z.infer<typeof RelayLabReadinessErrorCodeSchema>;
434
+ export type RelayLabDevice = z.infer<typeof RelayLabDeviceSchema>;
435
+ export type RelayLabReadiness = z.infer<typeof RelayLabReadinessSchema>;
436
+ export type RelayLabFleetSnapshot = z.infer<typeof RelayLabFleetSnapshotSchema>;
437
+ export type PublishRelayLabSnapshotBody = z.infer<typeof PublishRelayLabSnapshotBodySchema>;
438
+ export type PublishRelayLabSnapshotResponse = z.infer<typeof PublishRelayLabSnapshotResponseSchema>;
439
+ export type ReportRelayLabReadinessBody = z.infer<typeof ReportRelayLabReadinessBodySchema>;
440
+ export type UpdateRelayLabEnrollmentBody = z.infer<typeof UpdateRelayLabEnrollmentBodySchema>;
441
+ export type UpdateRelayLabEnrollmentResponse = z.infer<typeof UpdateRelayLabEnrollmentResponseSchema>;
442
+ export type LabFleetSsePayload = z.infer<typeof LabFleetSsePayloadSchema>;
443
+ //# sourceMappingURL=relay-lab-fleet.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relay-lab-fleet.schemas.d.ts","sourceRoot":"","sources":["../../contracts/relay-pods/relay-lab-fleet.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,kCAAgC,CAAC;AACrE,eAAO,MAAM,wBAAwB,kDAInC,CAAC;AACH,eAAO,MAAM,4BAA4B,gDAIvC,CAAC;AACH;;;GAGG;AACH,eAAO,MAAM,+BAA+B,oDAGlC,CAAC;AACX,eAAO,MAAM,gCAAgC,sDAE5C,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBtB,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBzB,CAAC;AAEZ,eAAO,MAAM,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