@shipfox/api-runners-dto 6.0.0 → 7.0.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +12 -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/assign-runner-instances.d.ts +11 -0
- package/dist/schemas/assign-runner-instances.d.ts.map +1 -0
- package/dist/schemas/assign-runner-instances.js +15 -0
- package/dist/schemas/assign-runner-instances.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -3
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +2 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/report-runner-instances.d.ts +2 -17
- package/dist/schemas/report-runner-instances.d.ts.map +1 -1
- package/dist/schemas/report-runner-instances.js +1 -13
- package/dist/schemas/report-runner-instances.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -21
- package/src/schemas/assign-runner-instances.test.ts +27 -0
- package/src/schemas/assign-runner-instances.ts +19 -0
- package/src/schemas/index.ts +5 -24
- package/src/schemas/report-runner-instances.ts +1 -21
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/schemas/assign-capacity.d.ts +0 -18
- package/dist/schemas/assign-capacity.d.ts.map +0 -1
- package/dist/schemas/assign-capacity.js +0 -19
- package/dist/schemas/assign-capacity.js.map +0 -1
- package/dist/schemas/mint-registration-tokens.d.ts +0 -28
- package/dist/schemas/mint-registration-tokens.d.ts.map +0 -1
- package/dist/schemas/mint-registration-tokens.js +0 -24
- package/dist/schemas/mint-registration-tokens.js.map +0 -1
- package/src/schemas/assign-capacity.ts +0 -22
- package/src/schemas/mint-registration-tokens.test.ts +0 -28
- package/src/schemas/mint-registration-tokens.ts +0 -38
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assign-capacity.d.ts","sourceRoot":"","sources":["../../src/schemas/assign-capacity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,6BAA6B;;;iBAQtC,CAAC;AAEL,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAC;AACH,eAAO,MAAM,iCAAiC;;;;;iBAE5C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACvF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const assignCapacityBatchBodySchema = z.object({
|
|
3
|
-
reservation_id: z.string().uuid(),
|
|
4
|
-
capacity_ids: z.array(z.string().uuid()).min(1).max(1000)
|
|
5
|
-
}).refine((body)=>new Set(body.capacity_ids).size === body.capacity_ids.length, {
|
|
6
|
-
message: 'capacity_ids values must be unique',
|
|
7
|
-
path: [
|
|
8
|
-
'capacity_ids'
|
|
9
|
-
]
|
|
10
|
-
});
|
|
11
|
-
export const assignedCapacitySchema = z.object({
|
|
12
|
-
capacity_id: z.string().uuid(),
|
|
13
|
-
assignment_id: z.string().uuid()
|
|
14
|
-
});
|
|
15
|
-
export const assignCapacityBatchResponseSchema = z.object({
|
|
16
|
-
assignments: z.array(assignedCapacitySchema)
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=assign-capacity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/assign-capacity.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const assignCapacityBatchBodySchema = z\n .object({\n reservation_id: z.string().uuid(),\n capacity_ids: z.array(z.string().uuid()).min(1).max(1000),\n })\n .refine((body) => new Set(body.capacity_ids).size === body.capacity_ids.length, {\n message: 'capacity_ids values must be unique',\n path: ['capacity_ids'],\n });\n\nexport const assignedCapacitySchema = z.object({\n capacity_id: z.string().uuid(),\n assignment_id: z.string().uuid(),\n});\nexport const assignCapacityBatchResponseSchema = z.object({\n assignments: z.array(assignedCapacitySchema),\n});\n\nexport type AssignCapacityBatchBodyDto = z.infer<typeof assignCapacityBatchBodySchema>;\nexport type AssignCapacityBatchResponseDto = z.infer<typeof assignCapacityBatchResponseSchema>;\n"],"names":["z","assignCapacityBatchBodySchema","object","reservation_id","string","uuid","capacity_ids","array","min","max","refine","body","Set","size","length","message","path","assignedCapacitySchema","capacity_id","assignment_id","assignCapacityBatchResponseSchema","assignments"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,gCAAgCD,EAC1CE,MAAM,CAAC;IACNC,gBAAgBH,EAAEI,MAAM,GAAGC,IAAI;IAC/BC,cAAcN,EAAEO,KAAK,CAACP,EAAEI,MAAM,GAAGC,IAAI,IAAIG,GAAG,CAAC,GAAGC,GAAG,CAAC;AACtD,GACCC,MAAM,CAAC,CAACC,OAAS,IAAIC,IAAID,KAAKL,YAAY,EAAEO,IAAI,KAAKF,KAAKL,YAAY,CAACQ,MAAM,EAAE;IAC9EC,SAAS;IACTC,MAAM;QAAC;KAAe;AACxB,GAAG;AAEL,OAAO,MAAMC,yBAAyBjB,EAAEE,MAAM,CAAC;IAC7CgB,aAAalB,EAAEI,MAAM,GAAGC,IAAI;IAC5Bc,eAAenB,EAAEI,MAAM,GAAGC,IAAI;AAChC,GAAG;AACH,OAAO,MAAMe,oCAAoCpB,EAAEE,MAAM,CAAC;IACxDmB,aAAarB,EAAEO,KAAK,CAACU;AACvB,GAAG"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const REGISTRATION_TOKEN_BATCH_HARD_MAX = 1000;
|
|
3
|
-
export declare const mintRegistrationTokensRunnerInstanceSchema: z.ZodObject<{
|
|
4
|
-
provider_runner_id: z.ZodString;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
export declare const mintRegistrationTokensBatchBodySchema: z.ZodObject<{
|
|
7
|
-
reservation_id: z.ZodString;
|
|
8
|
-
runner_instances: z.ZodArray<z.ZodObject<{
|
|
9
|
-
provider_runner_id: z.ZodString;
|
|
10
|
-
}, z.core.$strip>>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const mintedRegistrationTokenSchema: z.ZodObject<{
|
|
13
|
-
provider_runner_id: z.ZodString;
|
|
14
|
-
registration_token: z.ZodString;
|
|
15
|
-
expires_at: z.ZodString;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
export declare const mintRegistrationTokensBatchResponseSchema: z.ZodObject<{
|
|
18
|
-
tokens: z.ZodArray<z.ZodObject<{
|
|
19
|
-
provider_runner_id: z.ZodString;
|
|
20
|
-
registration_token: z.ZodString;
|
|
21
|
-
expires_at: z.ZodString;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
export type MintRegistrationTokensRunnerInstanceDto = z.infer<typeof mintRegistrationTokensRunnerInstanceSchema>;
|
|
25
|
-
export type MintRegistrationTokensBatchBodyDto = z.infer<typeof mintRegistrationTokensBatchBodySchema>;
|
|
26
|
-
export type MintedRegistrationTokenDto = z.infer<typeof mintedRegistrationTokenSchema>;
|
|
27
|
-
export type MintRegistrationTokensBatchResponseDto = z.infer<typeof mintRegistrationTokensBatchResponseSchema>;
|
|
28
|
-
//# sourceMappingURL=mint-registration-tokens.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mint-registration-tokens.d.ts","sourceRoot":"","sources":["../../src/schemas/mint-registration-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,iCAAiC,OAAO,CAAC;AACtD,eAAO,MAAM,0CAA0C;;iBAErD,CAAC;AACH,eAAO,MAAM,qCAAqC;;;;;iBAa/C,CAAC;AACJ,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AACH,eAAO,MAAM,yCAAyC;;;;;;iBAEpD,CAAC;AACH,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,0CAA0C,CAClD,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,qCAAqC,CAC7C,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACvF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,yCAAyC,CACjD,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const REGISTRATION_TOKEN_BATCH_HARD_MAX = 1000;
|
|
3
|
-
export const mintRegistrationTokensRunnerInstanceSchema = z.object({
|
|
4
|
-
provider_runner_id: z.string().min(1).max(255)
|
|
5
|
-
});
|
|
6
|
-
export const mintRegistrationTokensBatchBodySchema = z.object({
|
|
7
|
-
reservation_id: z.string().uuid(),
|
|
8
|
-
runner_instances: z.array(mintRegistrationTokensRunnerInstanceSchema).min(1).max(REGISTRATION_TOKEN_BATCH_HARD_MAX)
|
|
9
|
-
}).refine((body)=>new Set(body.runner_instances.map((providerRunner)=>providerRunner.provider_runner_id)).size === body.runner_instances.length, {
|
|
10
|
-
message: 'provider_runner_id values must be unique',
|
|
11
|
-
path: [
|
|
12
|
-
'runner_instances'
|
|
13
|
-
]
|
|
14
|
-
});
|
|
15
|
-
export const mintedRegistrationTokenSchema = z.object({
|
|
16
|
-
provider_runner_id: z.string(),
|
|
17
|
-
registration_token: z.string(),
|
|
18
|
-
expires_at: z.string().datetime()
|
|
19
|
-
});
|
|
20
|
-
export const mintRegistrationTokensBatchResponseSchema = z.object({
|
|
21
|
-
tokens: z.array(mintedRegistrationTokenSchema)
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=mint-registration-tokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schemas/mint-registration-tokens.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const REGISTRATION_TOKEN_BATCH_HARD_MAX = 1000;\nexport const mintRegistrationTokensRunnerInstanceSchema = z.object({\n provider_runner_id: z.string().min(1).max(255),\n});\nexport const mintRegistrationTokensBatchBodySchema = z\n .object({\n reservation_id: z.string().uuid(),\n runner_instances: z\n .array(mintRegistrationTokensRunnerInstanceSchema)\n .min(1)\n .max(REGISTRATION_TOKEN_BATCH_HARD_MAX),\n })\n .refine(\n (body) =>\n new Set(body.runner_instances.map((providerRunner) => providerRunner.provider_runner_id))\n .size === body.runner_instances.length,\n {message: 'provider_runner_id values must be unique', path: ['runner_instances']},\n );\nexport const mintedRegistrationTokenSchema = z.object({\n provider_runner_id: z.string(),\n registration_token: z.string(),\n expires_at: z.string().datetime(),\n});\nexport const mintRegistrationTokensBatchResponseSchema = z.object({\n tokens: z.array(mintedRegistrationTokenSchema),\n});\nexport type MintRegistrationTokensRunnerInstanceDto = z.infer<\n typeof mintRegistrationTokensRunnerInstanceSchema\n>;\nexport type MintRegistrationTokensBatchBodyDto = z.infer<\n typeof mintRegistrationTokensBatchBodySchema\n>;\nexport type MintedRegistrationTokenDto = z.infer<typeof mintedRegistrationTokenSchema>;\nexport type MintRegistrationTokensBatchResponseDto = z.infer<\n typeof mintRegistrationTokensBatchResponseSchema\n>;\n"],"names":["z","REGISTRATION_TOKEN_BATCH_HARD_MAX","mintRegistrationTokensRunnerInstanceSchema","object","provider_runner_id","string","min","max","mintRegistrationTokensBatchBodySchema","reservation_id","uuid","runner_instances","array","refine","body","Set","map","providerRunner","size","length","message","path","mintedRegistrationTokenSchema","registration_token","expires_at","datetime","mintRegistrationTokensBatchResponseSchema","tokens"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,oCAAoC,KAAK;AACtD,OAAO,MAAMC,6CAA6CF,EAAEG,MAAM,CAAC;IACjEC,oBAAoBJ,EAAEK,MAAM,GAAGC,GAAG,CAAC,GAAGC,GAAG,CAAC;AAC5C,GAAG;AACH,OAAO,MAAMC,wCAAwCR,EAClDG,MAAM,CAAC;IACNM,gBAAgBT,EAAEK,MAAM,GAAGK,IAAI;IAC/BC,kBAAkBX,EACfY,KAAK,CAACV,4CACNI,GAAG,CAAC,GACJC,GAAG,CAACN;AACT,GACCY,MAAM,CACL,CAACC,OACC,IAAIC,IAAID,KAAKH,gBAAgB,CAACK,GAAG,CAAC,CAACC,iBAAmBA,eAAeb,kBAAkB,GACpFc,IAAI,KAAKJ,KAAKH,gBAAgB,CAACQ,MAAM,EAC1C;IAACC,SAAS;IAA4CC,MAAM;QAAC;KAAmB;AAAA,GAChF;AACJ,OAAO,MAAMC,gCAAgCtB,EAAEG,MAAM,CAAC;IACpDC,oBAAoBJ,EAAEK,MAAM;IAC5BkB,oBAAoBvB,EAAEK,MAAM;IAC5BmB,YAAYxB,EAAEK,MAAM,GAAGoB,QAAQ;AACjC,GAAG;AACH,OAAO,MAAMC,4CAA4C1B,EAAEG,MAAM,CAAC;IAChEwB,QAAQ3B,EAAEY,KAAK,CAACU;AAClB,GAAG"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {z} from 'zod';
|
|
2
|
-
|
|
3
|
-
export const assignCapacityBatchBodySchema = z
|
|
4
|
-
.object({
|
|
5
|
-
reservation_id: z.string().uuid(),
|
|
6
|
-
capacity_ids: z.array(z.string().uuid()).min(1).max(1000),
|
|
7
|
-
})
|
|
8
|
-
.refine((body) => new Set(body.capacity_ids).size === body.capacity_ids.length, {
|
|
9
|
-
message: 'capacity_ids values must be unique',
|
|
10
|
-
path: ['capacity_ids'],
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const assignedCapacitySchema = z.object({
|
|
14
|
-
capacity_id: z.string().uuid(),
|
|
15
|
-
assignment_id: z.string().uuid(),
|
|
16
|
-
});
|
|
17
|
-
export const assignCapacityBatchResponseSchema = z.object({
|
|
18
|
-
assignments: z.array(assignedCapacitySchema),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export type AssignCapacityBatchBodyDto = z.infer<typeof assignCapacityBatchBodySchema>;
|
|
22
|
-
export type AssignCapacityBatchResponseDto = z.infer<typeof assignCapacityBatchResponseSchema>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
mintRegistrationTokensBatchBodySchema,
|
|
3
|
-
mintRegistrationTokensRunnerInstanceSchema,
|
|
4
|
-
} from './mint-registration-tokens.js';
|
|
5
|
-
|
|
6
|
-
describe('mintRegistrationTokensRunnerInstanceSchema', () => {
|
|
7
|
-
it('accepts provisioned runner ids up to the lifecycle report limit', () => {
|
|
8
|
-
const result = mintRegistrationTokensRunnerInstanceSchema.safeParse({
|
|
9
|
-
provider_runner_id: 'a'.repeat(255),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
expect(result.success).toBe(true);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
describe('mintRegistrationTokensBatchBodySchema', () => {
|
|
17
|
-
it('rejects duplicate provisioned runner ids', () => {
|
|
18
|
-
const result = mintRegistrationTokensBatchBodySchema.safeParse({
|
|
19
|
-
reservation_id: crypto.randomUUID(),
|
|
20
|
-
runner_instances: [
|
|
21
|
-
{provider_runner_id: 'provisioned-runner-1'},
|
|
22
|
-
{provider_runner_id: 'provisioned-runner-1'},
|
|
23
|
-
],
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
expect(result.success).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {z} from 'zod';
|
|
2
|
-
|
|
3
|
-
export const REGISTRATION_TOKEN_BATCH_HARD_MAX = 1000;
|
|
4
|
-
export const mintRegistrationTokensRunnerInstanceSchema = z.object({
|
|
5
|
-
provider_runner_id: z.string().min(1).max(255),
|
|
6
|
-
});
|
|
7
|
-
export const mintRegistrationTokensBatchBodySchema = z
|
|
8
|
-
.object({
|
|
9
|
-
reservation_id: z.string().uuid(),
|
|
10
|
-
runner_instances: z
|
|
11
|
-
.array(mintRegistrationTokensRunnerInstanceSchema)
|
|
12
|
-
.min(1)
|
|
13
|
-
.max(REGISTRATION_TOKEN_BATCH_HARD_MAX),
|
|
14
|
-
})
|
|
15
|
-
.refine(
|
|
16
|
-
(body) =>
|
|
17
|
-
new Set(body.runner_instances.map((providerRunner) => providerRunner.provider_runner_id))
|
|
18
|
-
.size === body.runner_instances.length,
|
|
19
|
-
{message: 'provider_runner_id values must be unique', path: ['runner_instances']},
|
|
20
|
-
);
|
|
21
|
-
export const mintedRegistrationTokenSchema = z.object({
|
|
22
|
-
provider_runner_id: z.string(),
|
|
23
|
-
registration_token: z.string(),
|
|
24
|
-
expires_at: z.string().datetime(),
|
|
25
|
-
});
|
|
26
|
-
export const mintRegistrationTokensBatchResponseSchema = z.object({
|
|
27
|
-
tokens: z.array(mintedRegistrationTokenSchema),
|
|
28
|
-
});
|
|
29
|
-
export type MintRegistrationTokensRunnerInstanceDto = z.infer<
|
|
30
|
-
typeof mintRegistrationTokensRunnerInstanceSchema
|
|
31
|
-
>;
|
|
32
|
-
export type MintRegistrationTokensBatchBodyDto = z.infer<
|
|
33
|
-
typeof mintRegistrationTokensBatchBodySchema
|
|
34
|
-
>;
|
|
35
|
-
export type MintedRegistrationTokenDto = z.infer<typeof mintedRegistrationTokenSchema>;
|
|
36
|
-
export type MintRegistrationTokensBatchResponseDto = z.infer<
|
|
37
|
-
typeof mintRegistrationTokensBatchResponseSchema
|
|
38
|
-
>;
|