@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.
- package/dist/curated-worker-leads/candidate-edit-session.contract.d.ts +12 -12
- package/dist/curated-worker-leads/consent-queue.contract.d.ts +28 -28
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/outreach/__tests__/outreach-requests.contract.spec.js +37 -0
- package/dist/outreach/lab-outreach.contract.d.ts +1110 -0
- package/dist/outreach/lab-outreach.contract.d.ts.map +1 -0
- package/dist/outreach/lab-outreach.contract.js +174 -0
- package/dist/outreach/lab-outreach.contract.spec.d.ts +2 -0
- package/dist/outreach/lab-outreach.contract.spec.d.ts.map +1 -0
- package/dist/outreach/lab-outreach.contract.spec.js +90 -0
- package/dist/outreach/outreach-requests.contract.d.ts +84 -0
- package/dist/outreach/outreach-requests.contract.d.ts.map +1 -1
- package/dist/outreach/outreach-requests.schemas.d.ts +9 -0
- package/dist/outreach/outreach-requests.schemas.d.ts.map +1 -1
- package/dist/outreach/outreach-requests.schemas.js +3 -0
- package/dist/outreach/outreach.contract.spec.js +3 -0
- package/dist/relay-pods/relay-lab-fleet.contract.d.ts +829 -0
- package/dist/relay-pods/relay-lab-fleet.contract.d.ts.map +1 -0
- package/dist/relay-pods/relay-lab-fleet.contract.js +79 -0
- package/dist/relay-pods/relay-lab-fleet.contract.spec.d.ts +2 -0
- package/dist/relay-pods/relay-lab-fleet.contract.spec.d.ts.map +1 -0
- package/dist/relay-pods/relay-lab-fleet.contract.spec.js +146 -0
- package/dist/relay-pods/relay-lab-fleet.schemas.d.ts +443 -0
- package/dist/relay-pods/relay-lab-fleet.schemas.d.ts.map +1 -0
- package/dist/relay-pods/relay-lab-fleet.schemas.js +138 -0
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabFleetSsePayloadSchema = exports.UpdateRelayLabEnrollmentResponseSchema = exports.UpdateRelayLabEnrollmentBodySchema = exports.ReportRelayLabReadinessBodySchema = exports.PublishRelayLabSnapshotResponseSchema = exports.PublishRelayLabSnapshotBodySchema = exports.RelayLabFleetSnapshotSchema = exports.RelayLabReadinessSchema = exports.RelayLabDeviceSchema = exports.RelayLabReadinessErrorCodeSchema = exports.RELAY_LAB_READINESS_ERROR_CODES = exports.RelayLabIdentityStatusSchema = exports.RelayLabEnrollmentSchema = exports.RelayLabLifecycleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.RelayLabLifecycleSchema = zod_1.z.enum(['ACTIVE', 'RETIRED']);
|
|
6
|
+
exports.RelayLabEnrollmentSchema = zod_1.z.enum([
|
|
7
|
+
'UNENROLLED',
|
|
8
|
+
'ENROLLED',
|
|
9
|
+
'REVOKED',
|
|
10
|
+
]);
|
|
11
|
+
exports.RelayLabIdentityStatusSchema = zod_1.z.enum([
|
|
12
|
+
'INCOMPLETE',
|
|
13
|
+
'VALID',
|
|
14
|
+
'CONFLICT',
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Closed v1 vocabulary emitted by Relay contact reconciliation. Keep this
|
|
18
|
+
* list free of device identifiers, phone numbers, and raw error text.
|
|
19
|
+
*/
|
|
20
|
+
exports.RELAY_LAB_READINESS_ERROR_CODES = [
|
|
21
|
+
'OWNER_OFFLINE',
|
|
22
|
+
'CONTACT_WRITE_FAILED',
|
|
23
|
+
];
|
|
24
|
+
exports.RelayLabReadinessErrorCodeSchema = zod_1.z.enum(exports.RELAY_LAB_READINESS_ERROR_CODES);
|
|
25
|
+
exports.RelayLabDeviceSchema = zod_1.z
|
|
26
|
+
.object({
|
|
27
|
+
id: zod_1.z.string().uuid(),
|
|
28
|
+
podId: zod_1.z.string().uuid(),
|
|
29
|
+
podSlug: zod_1.z.string().min(1),
|
|
30
|
+
podDisplayName: zod_1.z.string().min(1),
|
|
31
|
+
localDeviceKey: zod_1.z.string().min(1),
|
|
32
|
+
label: zod_1.z.string().min(1).nullable(),
|
|
33
|
+
phoneE164: zod_1.z
|
|
34
|
+
.string()
|
|
35
|
+
.regex(/^\+[1-9]\d{7,14}$/)
|
|
36
|
+
.nullable(),
|
|
37
|
+
identityVersion: zod_1.z.number().int().positive(),
|
|
38
|
+
lifecycleStatus: exports.RelayLabLifecycleSchema,
|
|
39
|
+
enrollmentStatus: exports.RelayLabEnrollmentSchema,
|
|
40
|
+
connectionStatus: zod_1.z.enum(['ONLINE', 'OFFLINE']),
|
|
41
|
+
restrictionStatus: zod_1.z.enum(['NONE', 'RECOVERING', 'RESTRICTED']),
|
|
42
|
+
identityStatus: exports.RelayLabIdentityStatusSchema,
|
|
43
|
+
lastSeenAt: zod_1.z.string().datetime(),
|
|
44
|
+
})
|
|
45
|
+
.strict();
|
|
46
|
+
exports.RelayLabReadinessSchema = zod_1.z
|
|
47
|
+
.object({
|
|
48
|
+
podId: zod_1.z.string().uuid(),
|
|
49
|
+
podDisplayName: zod_1.z.string().min(1),
|
|
50
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
51
|
+
requiredPairCount: zod_1.z.number().int().nonnegative(),
|
|
52
|
+
savedPairCount: zod_1.z.number().int().nonnegative(),
|
|
53
|
+
failedPairCount: zod_1.z.number().int().nonnegative(),
|
|
54
|
+
missingPairs: zod_1.z
|
|
55
|
+
.array(zod_1.z
|
|
56
|
+
.object({
|
|
57
|
+
ownerLocalDeviceKey: zod_1.z.string().min(1),
|
|
58
|
+
contactLabDeviceId: zod_1.z.string().uuid(),
|
|
59
|
+
errorCode: exports.RelayLabReadinessErrorCodeSchema,
|
|
60
|
+
})
|
|
61
|
+
.strict())
|
|
62
|
+
.max(100),
|
|
63
|
+
reportedAt: zod_1.z.string().datetime(),
|
|
64
|
+
expiresAt: zod_1.z.string().datetime(),
|
|
65
|
+
ready: zod_1.z.boolean(),
|
|
66
|
+
})
|
|
67
|
+
.strict();
|
|
68
|
+
exports.RelayLabFleetSnapshotSchema = zod_1.z
|
|
69
|
+
.object({
|
|
70
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
71
|
+
devices: zod_1.z.array(exports.RelayLabDeviceSchema),
|
|
72
|
+
readiness: zod_1.z.array(exports.RelayLabReadinessSchema),
|
|
73
|
+
})
|
|
74
|
+
.strict();
|
|
75
|
+
/**
|
|
76
|
+
* A pod can publish only its local observations. Recruitment derives pod
|
|
77
|
+
* ownership and enrollment state from the authenticated machine principal.
|
|
78
|
+
*/
|
|
79
|
+
exports.PublishRelayLabSnapshotBodySchema = zod_1.z
|
|
80
|
+
.object({
|
|
81
|
+
generation: zod_1.z.number().int().positive(),
|
|
82
|
+
observedAt: zod_1.z.string().datetime(),
|
|
83
|
+
devices: zod_1.z.array(zod_1.z
|
|
84
|
+
.object({
|
|
85
|
+
localDeviceKey: zod_1.z.string().min(1),
|
|
86
|
+
label: zod_1.z.string().min(1).nullable(),
|
|
87
|
+
phoneE164: zod_1.z
|
|
88
|
+
.string()
|
|
89
|
+
.regex(/^\+[1-9]\d{7,14}$/)
|
|
90
|
+
.nullable(),
|
|
91
|
+
lifecycleStatus: exports.RelayLabLifecycleSchema,
|
|
92
|
+
connectionStatus: zod_1.z.enum(['ONLINE', 'OFFLINE']),
|
|
93
|
+
restrictionStatus: zod_1.z.enum(['NONE', 'RECOVERING', 'RESTRICTED']),
|
|
94
|
+
lastSeenAt: zod_1.z.string().datetime(),
|
|
95
|
+
})
|
|
96
|
+
.strict()),
|
|
97
|
+
})
|
|
98
|
+
.strict();
|
|
99
|
+
exports.PublishRelayLabSnapshotResponseSchema = zod_1.z
|
|
100
|
+
.object({
|
|
101
|
+
acceptedGeneration: zod_1.z.number().int().positive(),
|
|
102
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
103
|
+
})
|
|
104
|
+
.strict();
|
|
105
|
+
/** The pod supplies readiness facts; timestamps and readiness are server-owned. */
|
|
106
|
+
exports.ReportRelayLabReadinessBodySchema = exports.RelayLabReadinessSchema.omit({
|
|
107
|
+
podId: true,
|
|
108
|
+
podDisplayName: true,
|
|
109
|
+
reportedAt: true,
|
|
110
|
+
expiresAt: true,
|
|
111
|
+
ready: true,
|
|
112
|
+
});
|
|
113
|
+
exports.UpdateRelayLabEnrollmentBodySchema = zod_1.z
|
|
114
|
+
.object({
|
|
115
|
+
enrollmentStatus: zod_1.z.enum(['ENROLLED', 'REVOKED']),
|
|
116
|
+
})
|
|
117
|
+
.strict();
|
|
118
|
+
exports.UpdateRelayLabEnrollmentResponseSchema = zod_1.z
|
|
119
|
+
.object({
|
|
120
|
+
localDeviceKey: zod_1.z.string().min(1),
|
|
121
|
+
enrollmentStatus: exports.RelayLabEnrollmentSchema,
|
|
122
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
123
|
+
})
|
|
124
|
+
.strict();
|
|
125
|
+
exports.LabFleetSsePayloadSchema = zod_1.z
|
|
126
|
+
.object({
|
|
127
|
+
revision: zod_1.z.number().int().nonnegative(),
|
|
128
|
+
changeType: zod_1.z.enum([
|
|
129
|
+
'DEVICE_ADDED',
|
|
130
|
+
'IDENTITY_CHANGED',
|
|
131
|
+
'AVAILABILITY_CHANGED',
|
|
132
|
+
'ENROLLMENT_CHANGED',
|
|
133
|
+
'DEVICE_RETIRED',
|
|
134
|
+
]),
|
|
135
|
+
sourcePodId: zod_1.z.string().uuid(),
|
|
136
|
+
affectedDeviceIds: zod_1.z.array(zod_1.z.string().uuid()),
|
|
137
|
+
})
|
|
138
|
+
.strict();
|