@neat.is/types 0.10.5 → 0.10.6-dev.20261007
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/index.cjs +32 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -114,6 +114,7 @@ __export(index_exports, {
|
|
|
114
114
|
PolicySchema: () => PolicySchema,
|
|
115
115
|
PolicySeveritySchema: () => PolicySeveritySchema,
|
|
116
116
|
PolicyViolationSchema: () => PolicyViolationSchema,
|
|
117
|
+
PrVerdictBodySchema: () => PrVerdictBodySchema,
|
|
117
118
|
ProjectListEntrySchema: () => ProjectListEntrySchema,
|
|
118
119
|
ProjectServedBySchema: () => ProjectServedBySchema,
|
|
119
120
|
Provenance: () => Provenance,
|
|
@@ -1886,6 +1887,36 @@ function extractedPrecisionFloor() {
|
|
|
1886
1887
|
function passesExtractedFloor(confidence) {
|
|
1887
1888
|
return confidence >= extractedPrecisionFloor();
|
|
1888
1889
|
}
|
|
1890
|
+
|
|
1891
|
+
// src/pr-verdict.ts
|
|
1892
|
+
var import_zod11 = require("zod");
|
|
1893
|
+
var SHA = /^[0-9a-f]{40}$/;
|
|
1894
|
+
var SLUG = /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9_])?$/;
|
|
1895
|
+
var PrVerdictBodySchema = import_zod11.z.object({
|
|
1896
|
+
owner: import_zod11.z.string().regex(SLUG, "not a GitHub account name"),
|
|
1897
|
+
name: import_zod11.z.string().regex(SLUG, "not a GitHub repository name"),
|
|
1898
|
+
baseSha: import_zod11.z.string().regex(SHA, "must be a full 40-character lowercase commit SHA"),
|
|
1899
|
+
headSha: import_zod11.z.string().regex(SHA, "must be a full 40-character lowercase commit SHA"),
|
|
1900
|
+
cloneUrl: import_zod11.z.string().url(),
|
|
1901
|
+
// Repo-relative paths the PR changes. Optional; capped by the daemon.
|
|
1902
|
+
changedFiles: import_zod11.z.array(import_zod11.z.string()).optional(),
|
|
1903
|
+
tone: import_zod11.z.enum(["loud", "professional"]).optional()
|
|
1904
|
+
}).superRefine((body, ctx) => {
|
|
1905
|
+
let url;
|
|
1906
|
+
try {
|
|
1907
|
+
url = new URL(body.cloneUrl);
|
|
1908
|
+
} catch {
|
|
1909
|
+
return;
|
|
1910
|
+
}
|
|
1911
|
+
if (url.protocol !== "https:" || url.hostname !== "github.com" || url.port !== "") {
|
|
1912
|
+
ctx.addIssue({ code: import_zod11.z.ZodIssueCode.custom, path: ["cloneUrl"], message: "must be an https://github.com URL" });
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
const repoPath = url.pathname.replace(/\.git$/, "").replace(/\/+$/, "");
|
|
1916
|
+
if (repoPath.toLowerCase() !== `/${body.owner}/${body.name}`.toLowerCase()) {
|
|
1917
|
+
ctx.addIssue({ code: import_zod11.z.ZodIssueCode.custom, path: ["cloneUrl"], message: "does not point at owner/name" });
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1889
1920
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1890
1921
|
0 && (module.exports = {
|
|
1891
1922
|
ApplicablePoliciesResponseSchema,
|
|
@@ -1982,6 +2013,7 @@ function passesExtractedFloor(confidence) {
|
|
|
1982
2013
|
PolicySchema,
|
|
1983
2014
|
PolicySeveritySchema,
|
|
1984
2015
|
PolicyViolationSchema,
|
|
2016
|
+
PrVerdictBodySchema,
|
|
1985
2017
|
ProjectListEntrySchema,
|
|
1986
2018
|
ProjectServedBySchema,
|
|
1987
2019
|
Provenance,
|