@dakkitor/api-contracts 1.7.0 → 1.7.1
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/relay-pods/relay-lab-fleet.contract.d.ts +34 -5
- package/dist/relay-pods/relay-lab-fleet.contract.d.ts.map +1 -1
- package/dist/relay-pods/relay-lab-fleet.contract.spec.js +16 -0
- package/dist/relay-pods/relay-lab-fleet.schemas.d.ts +34 -5
- package/dist/relay-pods/relay-lab-fleet.schemas.d.ts.map +1 -1
- package/dist/relay-pods/relay-lab-fleet.schemas.js +22 -5
- package/package.json +1 -1
|
@@ -676,13 +676,42 @@ export declare const relayLabFleetContract: {
|
|
|
676
676
|
}>;
|
|
677
677
|
summary: "Update a local Relay Lab device enrollment state";
|
|
678
678
|
method: "PATCH";
|
|
679
|
-
body: z.ZodObject<{
|
|
680
|
-
enrollmentStatus: z.
|
|
679
|
+
body: z.ZodDiscriminatedUnion<"enrollmentStatus", [z.ZodObject<{
|
|
680
|
+
enrollmentStatus: z.ZodLiteral<"ENROLLED">;
|
|
681
|
+
expectedIdentity: z.ZodObject<{
|
|
682
|
+
identityVersion: z.ZodNumber;
|
|
683
|
+
label: z.ZodEffects<z.ZodString, string, string>;
|
|
684
|
+
phoneE164: z.ZodString;
|
|
685
|
+
}, "strict", z.ZodTypeAny, {
|
|
686
|
+
label: string;
|
|
687
|
+
phoneE164: string;
|
|
688
|
+
identityVersion: number;
|
|
689
|
+
}, {
|
|
690
|
+
label: string;
|
|
691
|
+
phoneE164: string;
|
|
692
|
+
identityVersion: number;
|
|
693
|
+
}>;
|
|
681
694
|
}, "strict", z.ZodTypeAny, {
|
|
682
|
-
enrollmentStatus: "ENROLLED"
|
|
695
|
+
enrollmentStatus: "ENROLLED";
|
|
696
|
+
expectedIdentity: {
|
|
697
|
+
label: string;
|
|
698
|
+
phoneE164: string;
|
|
699
|
+
identityVersion: number;
|
|
700
|
+
};
|
|
683
701
|
}, {
|
|
684
|
-
enrollmentStatus: "ENROLLED"
|
|
685
|
-
|
|
702
|
+
enrollmentStatus: "ENROLLED";
|
|
703
|
+
expectedIdentity: {
|
|
704
|
+
label: string;
|
|
705
|
+
phoneE164: string;
|
|
706
|
+
identityVersion: number;
|
|
707
|
+
};
|
|
708
|
+
}>, z.ZodObject<{
|
|
709
|
+
enrollmentStatus: z.ZodLiteral<"REVOKED">;
|
|
710
|
+
}, "strict", z.ZodTypeAny, {
|
|
711
|
+
enrollmentStatus: "REVOKED";
|
|
712
|
+
}, {
|
|
713
|
+
enrollmentStatus: "REVOKED";
|
|
714
|
+
}>]>;
|
|
686
715
|
path: "/v2/relay-pods/me/lab-devices/:localDeviceKey/enrollment";
|
|
687
716
|
responses: {
|
|
688
717
|
400: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relay-lab-fleet.contract.d.ts","sourceRoot":"","sources":["../../contracts/relay-pods/relay-lab-fleet.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,cAAc,2BAA2B,CAAC;AAU1C,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"relay-lab-fleet.contract.d.ts","sourceRoot":"","sources":["../../contracts/relay-pods/relay-lab-fleet.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,cAAc,2BAA2B,CAAC;AAU1C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDjC,CAAC"}
|
|
@@ -123,13 +123,29 @@ const device = {
|
|
|
123
123
|
(0, bun_test_1.it)('accepts only enroll and revoke as human enrollment commands', () => {
|
|
124
124
|
(0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
|
|
125
125
|
enrollmentStatus: 'ENROLLED',
|
|
126
|
+
expectedIdentity: {
|
|
127
|
+
identityVersion: 3,
|
|
128
|
+
label: 'Alice Lab',
|
|
129
|
+
phoneE164: '+447700900123',
|
|
130
|
+
},
|
|
126
131
|
}).success).toBe(true);
|
|
132
|
+
(0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
|
|
133
|
+
enrollmentStatus: 'ENROLLED',
|
|
134
|
+
}).success).toBe(false);
|
|
127
135
|
(0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
|
|
128
136
|
enrollmentStatus: 'REVOKED',
|
|
129
137
|
}).success).toBe(true);
|
|
130
138
|
(0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
|
|
131
139
|
enrollmentStatus: 'UNENROLLED',
|
|
132
140
|
}).success).toBe(false);
|
|
141
|
+
(0, bun_test_1.expect)(relay_lab_fleet_schemas_1.UpdateRelayLabEnrollmentBodySchema.safeParse({
|
|
142
|
+
enrollmentStatus: 'REVOKED',
|
|
143
|
+
expectedIdentity: {
|
|
144
|
+
identityVersion: 3,
|
|
145
|
+
label: 'Alice Lab',
|
|
146
|
+
phoneE164: '+447700900123',
|
|
147
|
+
},
|
|
148
|
+
}).success).toBe(false);
|
|
133
149
|
});
|
|
134
150
|
});
|
|
135
151
|
(0, bun_test_1.describe)('relayLabFleetContract routes', () => {
|
|
@@ -391,13 +391,42 @@ export declare const ReportRelayLabReadinessBodySchema: z.ZodObject<Omit<{
|
|
|
391
391
|
errorCode: "OWNER_OFFLINE" | "CONTACT_WRITE_FAILED";
|
|
392
392
|
}[];
|
|
393
393
|
}>;
|
|
394
|
-
export declare const UpdateRelayLabEnrollmentBodySchema: z.ZodObject<{
|
|
395
|
-
enrollmentStatus: z.
|
|
394
|
+
export declare const UpdateRelayLabEnrollmentBodySchema: z.ZodDiscriminatedUnion<"enrollmentStatus", [z.ZodObject<{
|
|
395
|
+
enrollmentStatus: z.ZodLiteral<"ENROLLED">;
|
|
396
|
+
expectedIdentity: z.ZodObject<{
|
|
397
|
+
identityVersion: z.ZodNumber;
|
|
398
|
+
label: z.ZodEffects<z.ZodString, string, string>;
|
|
399
|
+
phoneE164: z.ZodString;
|
|
400
|
+
}, "strict", z.ZodTypeAny, {
|
|
401
|
+
label: string;
|
|
402
|
+
phoneE164: string;
|
|
403
|
+
identityVersion: number;
|
|
404
|
+
}, {
|
|
405
|
+
label: string;
|
|
406
|
+
phoneE164: string;
|
|
407
|
+
identityVersion: number;
|
|
408
|
+
}>;
|
|
396
409
|
}, "strict", z.ZodTypeAny, {
|
|
397
|
-
enrollmentStatus: "ENROLLED"
|
|
410
|
+
enrollmentStatus: "ENROLLED";
|
|
411
|
+
expectedIdentity: {
|
|
412
|
+
label: string;
|
|
413
|
+
phoneE164: string;
|
|
414
|
+
identityVersion: number;
|
|
415
|
+
};
|
|
398
416
|
}, {
|
|
399
|
-
enrollmentStatus: "ENROLLED"
|
|
400
|
-
|
|
417
|
+
enrollmentStatus: "ENROLLED";
|
|
418
|
+
expectedIdentity: {
|
|
419
|
+
label: string;
|
|
420
|
+
phoneE164: string;
|
|
421
|
+
identityVersion: number;
|
|
422
|
+
};
|
|
423
|
+
}>, z.ZodObject<{
|
|
424
|
+
enrollmentStatus: z.ZodLiteral<"REVOKED">;
|
|
425
|
+
}, "strict", z.ZodTypeAny, {
|
|
426
|
+
enrollmentStatus: "REVOKED";
|
|
427
|
+
}, {
|
|
428
|
+
enrollmentStatus: "REVOKED";
|
|
429
|
+
}>]>;
|
|
401
430
|
export declare const UpdateRelayLabEnrollmentResponseSchema: z.ZodObject<{
|
|
402
431
|
localDeviceKey: z.ZodString;
|
|
403
432
|
enrollmentStatus: z.ZodEnum<["UNENROLLED", "ENROLLED", "REVOKED"]>;
|
|
@@ -1 +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,sDAE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M,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,iCAAiC,CACzC,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -110,11 +110,28 @@ exports.ReportRelayLabReadinessBodySchema = exports.RelayLabReadinessSchema.omit
|
|
|
110
110
|
expiresAt: true,
|
|
111
111
|
ready: true,
|
|
112
112
|
});
|
|
113
|
-
exports.UpdateRelayLabEnrollmentBodySchema = zod_1.z
|
|
114
|
-
.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
exports.UpdateRelayLabEnrollmentBodySchema = zod_1.z.discriminatedUnion('enrollmentStatus', [
|
|
114
|
+
zod_1.z
|
|
115
|
+
.object({
|
|
116
|
+
enrollmentStatus: zod_1.z.literal('ENROLLED'),
|
|
117
|
+
expectedIdentity: zod_1.z
|
|
118
|
+
.object({
|
|
119
|
+
identityVersion: zod_1.z.number().int().positive(),
|
|
120
|
+
label: zod_1.z
|
|
121
|
+
.string()
|
|
122
|
+
.min(1)
|
|
123
|
+
.refine((value) => value === value.trim()),
|
|
124
|
+
phoneE164: zod_1.z.string().regex(/^\+[1-9]\d{7,14}$/),
|
|
125
|
+
})
|
|
126
|
+
.strict(),
|
|
127
|
+
})
|
|
128
|
+
.strict(),
|
|
129
|
+
zod_1.z
|
|
130
|
+
.object({
|
|
131
|
+
enrollmentStatus: zod_1.z.literal('REVOKED'),
|
|
132
|
+
})
|
|
133
|
+
.strict(),
|
|
134
|
+
]);
|
|
118
135
|
exports.UpdateRelayLabEnrollmentResponseSchema = zod_1.z
|
|
119
136
|
.object({
|
|
120
137
|
localDeviceKey: zod_1.z.string().min(1),
|