@shipfox/api-runners-dto 13.0.0 → 14.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/list-active-provisioners.d.ts +9 -0
- package/dist/schemas/list-active-provisioners.d.ts.map +1 -1
- package/dist/schemas/list-active-provisioners.js +6 -1
- package/dist/schemas/list-active-provisioners.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/schemas/index.ts +2 -0
- package/src/schemas/list-active-provisioners.test.ts +44 -0
- package/src/schemas/list-active-provisioners.ts +4 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -39,7 +39,9 @@ export {
|
|
|
39
39
|
heartbeatBodySchema,
|
|
40
40
|
heartbeatResponseSchema,
|
|
41
41
|
type InstallationProvisionerTokenStatus,
|
|
42
|
+
type InstallationRunnersStatus,
|
|
42
43
|
installationProvisionerTokenStatusSchema,
|
|
44
|
+
installationRunnersStatusSchema,
|
|
43
45
|
type ListActiveProvisionersResponseDto,
|
|
44
46
|
type ListAdministratorProvisionerTokensQueryDto,
|
|
45
47
|
type ListAdministratorProvisionerTokensResponseDto,
|
package/src/schemas/index.ts
CHANGED
|
@@ -50,6 +50,8 @@ export {
|
|
|
50
50
|
export {
|
|
51
51
|
type ActiveProvisionerDto,
|
|
52
52
|
activeProvisionerDtoSchema,
|
|
53
|
+
type InstallationRunnersStatus,
|
|
54
|
+
installationRunnersStatusSchema,
|
|
53
55
|
type ListActiveProvisionersResponseDto,
|
|
54
56
|
listActiveProvisionersResponseSchema,
|
|
55
57
|
} from './list-active-provisioners.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installationRunnersStatusSchema,
|
|
3
|
+
listActiveProvisionersResponseSchema,
|
|
4
|
+
} from './list-active-provisioners.js';
|
|
5
|
+
|
|
6
|
+
describe('list active provisioners schemas', () => {
|
|
7
|
+
it('accepts an installation_runners status of managed', () => {
|
|
8
|
+
expect(installationRunnersStatusSchema.parse('managed')).toBe('managed');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('accepts an installation_runners status of none', () => {
|
|
12
|
+
expect(installationRunnersStatusSchema.parse('none')).toBe('none');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('rejects any other installation_runners status', () => {
|
|
16
|
+
const result = installationRunnersStatusSchema.safeParse('unknown');
|
|
17
|
+
|
|
18
|
+
expect(result.success).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('parses a response with provisioners and installation_runners', () => {
|
|
22
|
+
const response = {
|
|
23
|
+
provisioners: [
|
|
24
|
+
{
|
|
25
|
+
id: crypto.randomUUID(),
|
|
26
|
+
name: 'Docker provisioner',
|
|
27
|
+
prefix: 'sf_pt_abcde',
|
|
28
|
+
last_seen_at: '2026-05-08T01:00:00.000Z',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
installation_runners: 'managed',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
expect(listActiveProvisionersResponseSchema.parse(response)).toEqual(response);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('defaults installation_runners for responses from older servers', () => {
|
|
38
|
+
const result = listActiveProvisionersResponseSchema.parse({
|
|
39
|
+
provisioners: [],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
expect(result).toEqual({provisioners: [], installation_runners: 'none'});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import {z} from 'zod';
|
|
2
2
|
|
|
3
|
+
export const installationRunnersStatusSchema = z.enum(['managed', 'none']);
|
|
4
|
+
|
|
3
5
|
export const activeProvisionerDtoSchema = z.object({
|
|
4
6
|
id: z.string().uuid(),
|
|
5
7
|
name: z.string().nullable(),
|
|
@@ -9,8 +11,10 @@ export const activeProvisionerDtoSchema = z.object({
|
|
|
9
11
|
|
|
10
12
|
export const listActiveProvisionersResponseSchema = z.object({
|
|
11
13
|
provisioners: z.array(activeProvisionerDtoSchema),
|
|
14
|
+
installation_runners: installationRunnersStatusSchema.default('none'),
|
|
12
15
|
});
|
|
13
16
|
|
|
17
|
+
export type InstallationRunnersStatus = z.infer<typeof installationRunnersStatusSchema>;
|
|
14
18
|
export type ActiveProvisionerDto = z.infer<typeof activeProvisionerDtoSchema>;
|
|
15
19
|
export type ListActiveProvisionersResponseDto = z.infer<
|
|
16
20
|
typeof listActiveProvisionersResponseSchema
|