testing-farm
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -12,4 +12,4 @@ import { PublicLink } from './link'; | ||
async requestDetails(requestId) { | ||
const data = requestIdSchema.parse(requestId); | ||
return this.link.get('requests', requestSchema, data); | ||
const id = requestIdSchema.parse(requestId); | ||
return this.link.get(`requests/${id}`, requestSchema); | ||
} | ||
@@ -16,0 +16,0 @@ async composes() { |
@@ -37,3 +37,3 @@ import { URL } from 'url'; | ||
buildURL(path) { | ||
let url = new URL(path, this.instance); | ||
let url = new URL(`${this.instance.pathname}/${path}`, this.instance); | ||
return url; | ||
@@ -40,0 +40,0 @@ } |
@@ -482,6 +482,9 @@ import { z } from 'zod'; | ||
id: z.ZodString; | ||
user_id: z.ZodString; | ||
created: z.ZodString; | ||
updated: z.ZodString; | ||
environments: z.ZodArray<z.ZodObject<{ | ||
environments_requested: z.ZodArray<z.ZodObject<{ | ||
arch: z.ZodString; | ||
artifacts: z.ZodAny; | ||
hardware: z.ZodAny; | ||
os: z.ZodObject<{ | ||
@@ -494,5 +497,26 @@ compose: z.ZodString; | ||
}>; | ||
pool: z.ZodString; | ||
variables: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; | ||
pool: z.ZodUnion<[z.ZodString, z.ZodNull]>; | ||
settings: z.ZodObject<{ | ||
pipeline: z.ZodAny; | ||
provisioning: z.ZodAny; | ||
}, "strip", z.ZodTypeAny, { | ||
pipeline?: any; | ||
provisioning?: any; | ||
}, { | ||
pipeline?: any; | ||
provisioning?: any; | ||
}>; | ||
tmt: z.ZodObject<{ | ||
context: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; | ||
}, "strip", z.ZodTypeAny, { | ||
context: {}; | ||
}, { | ||
context: {}; | ||
}>; | ||
variables: z.ZodRecord<z.ZodString, z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
settings: { | ||
pipeline?: any; | ||
provisioning?: any; | ||
}; | ||
arch: string; | ||
@@ -502,5 +526,14 @@ os: { | ||
}; | ||
pool: string; | ||
variables: {}; | ||
pool: string | null; | ||
variables: Record<string, string>; | ||
tmt: { | ||
context: {}; | ||
}; | ||
artifacts?: any; | ||
hardware?: any; | ||
}, { | ||
settings: { | ||
pipeline?: any; | ||
provisioning?: any; | ||
}; | ||
arch: string; | ||
@@ -510,4 +543,9 @@ os: { | ||
}; | ||
pool: string; | ||
variables: {}; | ||
pool: string | null; | ||
variables: Record<string, string>; | ||
tmt: { | ||
context: {}; | ||
}; | ||
artifacts?: any; | ||
hardware?: any; | ||
}>, "many">; | ||
@@ -526,11 +564,11 @@ state: z.ZodString; | ||
result: z.ZodObject<{ | ||
summary: z.ZodString; | ||
summary: z.ZodUnion<[z.ZodString, z.ZodNull]>; | ||
overall: z.ZodString; | ||
xunit: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
summary: string; | ||
summary: string | null; | ||
overall: string; | ||
xunit: string; | ||
}, { | ||
summary: string; | ||
summary: string | null; | ||
overall: string; | ||
@@ -540,4 +578,4 @@ xunit: string; | ||
run: z.ZodObject<{ | ||
console: z.ZodString; | ||
stages: z.ZodArray<z.ZodObject<{ | ||
console: z.ZodUnion<[z.ZodString, z.ZodNull]>; | ||
stages: z.ZodUnion<[z.ZodArray<z.ZodObject<{ | ||
name: z.ZodString; | ||
@@ -572,7 +610,7 @@ notes: z.ZodArray<z.ZodObject<{ | ||
log: string; | ||
}>, "many">; | ||
}>, "many">, z.ZodNull]>; | ||
artifacts: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
artifacts: string; | ||
console: string; | ||
console: string | null; | ||
stages: { | ||
@@ -586,6 +624,6 @@ name: string; | ||
log: string; | ||
}[]; | ||
}[] | null; | ||
}, { | ||
artifacts: string; | ||
console: string; | ||
console: string | null; | ||
stages: { | ||
@@ -599,7 +637,15 @@ name: string; | ||
log: string; | ||
}[]; | ||
}[] | null; | ||
}>; | ||
settings: z.ZodAny; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string; | ||
environments: { | ||
created: string; | ||
user_id: string; | ||
updated: string; | ||
environments_requested: { | ||
settings: { | ||
pipeline?: any; | ||
provisioning?: any; | ||
}; | ||
arch: string; | ||
@@ -609,7 +655,10 @@ os: { | ||
}; | ||
pool: string; | ||
variables: {}; | ||
pool: string | null; | ||
variables: Record<string, string>; | ||
tmt: { | ||
context: {}; | ||
}; | ||
artifacts?: any; | ||
hardware?: any; | ||
}[]; | ||
created: string; | ||
updated: string; | ||
state: string; | ||
@@ -621,3 +670,3 @@ notes: { | ||
result: { | ||
summary: string; | ||
summary: string | null; | ||
overall: string; | ||
@@ -628,3 +677,3 @@ xunit: string; | ||
artifacts: string; | ||
console: string; | ||
console: string | null; | ||
stages: { | ||
@@ -638,7 +687,15 @@ name: string; | ||
log: string; | ||
}[]; | ||
}[] | null; | ||
}; | ||
settings?: any; | ||
}, { | ||
id: string; | ||
environments: { | ||
created: string; | ||
user_id: string; | ||
updated: string; | ||
environments_requested: { | ||
settings: { | ||
pipeline?: any; | ||
provisioning?: any; | ||
}; | ||
arch: string; | ||
@@ -648,7 +705,10 @@ os: { | ||
}; | ||
pool: string; | ||
variables: {}; | ||
pool: string | null; | ||
variables: Record<string, string>; | ||
tmt: { | ||
context: {}; | ||
}; | ||
artifacts?: any; | ||
hardware?: any; | ||
}[]; | ||
created: string; | ||
updated: string; | ||
state: string; | ||
@@ -660,3 +720,3 @@ notes: { | ||
result: { | ||
summary: string; | ||
summary: string | null; | ||
overall: string; | ||
@@ -667,3 +727,3 @@ xunit: string; | ||
artifacts: string; | ||
console: string; | ||
console: string | null; | ||
stages: { | ||
@@ -677,4 +737,5 @@ name: string; | ||
log: string; | ||
}[]; | ||
}[] | null; | ||
}; | ||
settings?: any; | ||
}>; | ||
@@ -711,8 +772,11 @@ export type Request = z.infer<typeof requestSchema>; | ||
export declare const aboutSchema: z.ZodObject<{ | ||
api_version: z.ZodString; | ||
version: z.ZodString; | ||
release_notes: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
api_version: string; | ||
version: string; | ||
release_notes: string; | ||
}, { | ||
api_version: string; | ||
version: string; | ||
release_notes: string; | ||
}>; | ||
export type About = z.infer<typeof aboutSchema>; |
@@ -134,13 +134,21 @@ import { z } from 'zod'; | ||
id: requestIdSchema, | ||
user_id: z.string(), | ||
created: z.string(), | ||
updated: z.string(), | ||
environments: z.array(z.object({ | ||
environments_requested: z.array(z.object({ | ||
arch: z.string(), | ||
artifacts: z.any(), | ||
hardware: z.any(), | ||
os: z.object({ | ||
compose: z.string(), | ||
}), | ||
pool: z.string(), | ||
variables: z.object({ | ||
// [key: string]: string | ||
pool: z.union([z.string(), z.null()]), | ||
settings: z.object({ | ||
pipeline: z.any(), | ||
provisioning: z.any(), | ||
}), | ||
tmt: z.object({ | ||
context: z.object({}), | ||
}), | ||
variables: z.record(z.string()), | ||
})), | ||
@@ -150,3 +158,3 @@ state: z.string(), | ||
result: z.object({ | ||
summary: z.string(), | ||
summary: z.union([z.string(), z.null()]), | ||
overall: z.string(), | ||
@@ -156,11 +164,15 @@ xunit: z.string(), | ||
run: z.object({ | ||
console: urlSchema, | ||
stages: z.array(z.object({ | ||
name: z.string(), | ||
notes: z.array(noteSchema), | ||
result: z.string(), | ||
log: urlSchema, | ||
})), | ||
console: z.union([urlSchema, z.null()]), | ||
stages: z.union([ | ||
z.array(z.object({ | ||
name: z.string(), | ||
notes: z.array(noteSchema), | ||
result: z.string(), | ||
log: urlSchema, | ||
})), | ||
z.null(), | ||
]), | ||
artifacts: urlSchema, | ||
}), | ||
settings: z.any(), | ||
}); | ||
@@ -175,4 +187,5 @@ export const ranchSchema = z.union([z.literal('public'), z.literal('redhat')]); | ||
export const aboutSchema = z.object({ | ||
api_version: z.string(), | ||
version: z.string(), | ||
release_notes: z.string(), | ||
}); | ||
//# sourceMappingURL=schema.js.map |
{ | ||
"name": "testing-farm", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A NodeJS module to access Testing Farm instances through the REST API.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# Testing Farm | ||
[![npm version][npm-status]][npm] [![Unit tests][test-status]][test] [![Linting suite][lint-status]][lint] [![CodeQL][codeql-status]][codeql] [![codecov][codecov-status]][codecov] | ||
[npm]: https://www.npmjs.com/package/testing-farm | ||
[npm-status]: https://badgen.net/npm/v/testing-farm | ||
[test]: https://github.com/redhat-plumbers-in-action/testing-farm/actions/workflows/tests.yml | ||
[test-status]: https://github.com/redhat-plumbers-in-action/testing-farm/actions/workflows/tests.yml/badge.svg | ||
[lint]: https://github.com/redhat-plumbers-in-action/testing-farm/actions/workflows/lint.yml | ||
[lint-status]: https://github.com/redhat-plumbers-in-action/testing-farm/actions/workflows/lint.yml/badge.svg | ||
[codeql]: https://github.com/redhat-plumbers-in-action/testing-farm/actions/workflows/codeql-analysis.yml | ||
[codeql-status]: https://github.com/redhat-plumbers-in-action/testing-farm/actions/workflows/codeql-analysis.yml/badge.svg | ||
[codecov]: https://codecov.io/github/redhat-plumbers-in-action/testing-farm | ||
[codecov-status]: https://codecov.io/github/redhat-plumbers-in-action/testing-farm/branch/main/graph/badge.svg?token=EqTfXgwKz2 | ||
Typesafe access to [Testing Farm's REST API](https://testing-farm.gitlab.io/api/). | ||
@@ -4,0 +21,0 @@ |
@@ -36,4 +36,4 @@ import { PublicLink } from './link'; | ||
async requestDetails(requestId: string): Promise<Request> { | ||
const data = requestIdSchema.parse(requestId); | ||
return this.link.get('requests', requestSchema, data); | ||
const id = requestIdSchema.parse(requestId); | ||
return this.link.get(`requests/${id}`, requestSchema); | ||
} | ||
@@ -40,0 +40,0 @@ |
@@ -63,3 +63,3 @@ import { URL } from 'url'; | ||
protected buildURL(path: string): URL { | ||
let url = new URL(path, this.instance); | ||
let url = new URL(`${this.instance.pathname}/${path}`, this.instance); | ||
return url; | ||
@@ -66,0 +66,0 @@ } |
@@ -150,14 +150,22 @@ import { z } from 'zod'; | ||
id: requestIdSchema, | ||
user_id: z.string(), | ||
created: z.string(), | ||
updated: z.string(), | ||
environments: z.array( | ||
environments_requested: z.array( | ||
z.object({ | ||
arch: z.string(), | ||
artifacts: z.any(), | ||
hardware: z.any(), | ||
os: z.object({ | ||
compose: z.string(), | ||
}), | ||
pool: z.string(), | ||
variables: z.object({ | ||
// [key: string]: string | ||
pool: z.union([z.string(), z.null()]), | ||
settings: z.object({ | ||
pipeline: z.any(), | ||
provisioning: z.any(), | ||
}), | ||
tmt: z.object({ | ||
context: z.object({}), | ||
}), | ||
variables: z.record(z.string()), | ||
}) | ||
@@ -168,3 +176,3 @@ ), | ||
result: z.object({ | ||
summary: z.string(), | ||
summary: z.union([z.string(), z.null()]), | ||
overall: z.string(), | ||
@@ -174,13 +182,17 @@ xunit: z.string(), | ||
run: z.object({ | ||
console: urlSchema, | ||
stages: z.array( | ||
z.object({ | ||
name: z.string(), | ||
notes: z.array(noteSchema), | ||
result: z.string(), | ||
log: urlSchema, | ||
}) | ||
), | ||
console: z.union([urlSchema, z.null()]), | ||
stages: z.union([ | ||
z.array( | ||
z.object({ | ||
name: z.string(), | ||
notes: z.array(noteSchema), | ||
result: z.string(), | ||
log: urlSchema, | ||
}) | ||
), | ||
z.null(), | ||
]), | ||
artifacts: urlSchema, | ||
}), | ||
settings: z.any(), | ||
}); | ||
@@ -207,5 +219,6 @@ | ||
export const aboutSchema = z.object({ | ||
api_version: z.string(), | ||
version: z.string(), | ||
release_notes: z.string(), | ||
}); | ||
export type About = z.infer<typeof aboutSchema>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
89434
1445
74
0