tslaws 0.10.0 → 1.1.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/README.md +13 -2
- package/bin/tslaws.js +8 -2
- package/dist/badge.d.ts +64 -0
- package/dist/badge.js +121 -0
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +25 -5
- package/dist/bundled.js +2 -2
- package/dist/bundlerPlugins.d.ts +2 -0
- package/dist/bundlerPlugins.js +7 -0
- package/dist/certificates.d.ts +139 -0
- package/dist/certificates.js +433 -0
- package/dist/chc.d.ts +97 -0
- package/dist/chc.js +307 -0
- package/dist/check.d.ts +13 -1
- package/dist/check.js +218 -31
- package/dist/cli.d.ts +18 -0
- package/dist/cli.js +242 -34
- package/dist/compile.d.ts +15 -5
- package/dist/compile.js +203 -70
- package/dist/coverage.d.ts +38 -1
- package/dist/coverage.js +123 -19
- package/dist/e2eApi.js +3 -1
- package/dist/generators.js +12 -2
- package/dist/github.d.ts +49 -5
- package/dist/github.js +107 -24
- package/dist/githubCli.d.ts +28 -0
- package/dist/githubCli.js +1113 -212
- package/dist/hints.js +2 -1
- package/dist/init.js +42 -0
- package/dist/isolate.d.ts +33 -0
- package/dist/isolate.js +262 -0
- package/dist/isolatedCheck.d.ts +1 -0
- package/dist/isolatedCheck.js +16 -0
- package/dist/lawHost.d.ts +50 -0
- package/dist/lawHost.js +197 -0
- package/dist/lawRuntime.d.ts +45 -0
- package/dist/lawRuntime.js +321 -0
- package/dist/lock.d.ts +49 -9
- package/dist/lock.js +132 -21
- package/dist/mcp.js +28 -7
- package/dist/mutate.d.ts +4 -0
- package/dist/mutate.js +7 -1
- package/dist/plan.d.ts +1 -0
- package/dist/plan.js +4 -0
- package/dist/pluginHooks.d.ts +20 -0
- package/dist/pluginHooks.js +57 -0
- package/dist/pluginHost.d.ts +5 -0
- package/dist/pluginHost.js +43 -0
- package/dist/pluginWorker.d.ts +1 -0
- package/dist/pluginWorker.js +40 -0
- package/dist/plural.d.ts +2 -0
- package/dist/plural.js +4 -0
- package/dist/pool.d.ts +80 -7
- package/dist/pool.js +222 -11
- package/dist/projects.d.ts +43 -1
- package/dist/projects.js +283 -11
- package/dist/promote.d.ts +56 -2
- package/dist/promote.js +429 -13
- package/dist/property.js +5 -1
- package/dist/propertyWorker.js +9 -4
- package/dist/proposals.d.ts +52 -4
- package/dist/proposals.js +484 -21
- package/dist/reporters.js +5 -1
- package/dist/runtimeEnv.d.ts +13 -5
- package/dist/runtimeEnv.js +48 -10
- package/dist/sandbox.d.ts +98 -0
- package/dist/sandbox.js +673 -0
- package/dist/sandboxGuard.d.ts +56 -0
- package/dist/sandboxGuard.js +249 -0
- package/dist/seal.d.ts +9 -0
- package/dist/seal.js +426 -0
- package/dist/security/cli.d.ts +6 -0
- package/dist/security/cli.js +39 -0
- package/dist/security/cwe.d.ts +14 -0
- package/dist/security/cwe.js +40 -0
- package/dist/security/deps/cache.d.ts +28 -0
- package/dist/security/deps/cache.js +107 -0
- package/dist/security/deps/config.d.ts +16 -0
- package/dist/security/deps/config.js +43 -0
- package/dist/security/deps/imports.d.ts +4 -0
- package/dist/security/deps/imports.js +33 -0
- package/dist/security/deps/lockfiles.d.ts +23 -0
- package/dist/security/deps/lockfiles.js +153 -0
- package/dist/security/deps/osv.d.ts +66 -0
- package/dist/security/deps/osv.js +137 -0
- package/dist/security/deps/run.d.ts +54 -0
- package/dist/security/deps/run.js +135 -0
- package/dist/security/deps/severity.d.ts +26 -0
- package/dist/security/deps/severity.js +78 -0
- package/dist/security/generators.d.ts +9 -0
- package/dist/security/generators.js +36 -0
- package/dist/security/index.d.ts +27 -0
- package/dist/security/index.js +18 -0
- package/dist/security/integers.d.ts +31 -0
- package/dist/security/integers.js +105 -0
- package/dist/security/law.d.ts +54 -0
- package/dist/security/law.js +54 -0
- package/dist/security/pathTraversal.d.ts +29 -0
- package/dist/security/pathTraversal.js +146 -0
- package/dist/security/prototypePollution.d.ts +30 -0
- package/dist/security/prototypePollution.js +142 -0
- package/dist/security/redirect.d.ts +21 -0
- package/dist/security/redirect.js +154 -0
- package/dist/security/redos.d.ts +21 -0
- package/dist/security/redos.js +93 -0
- package/dist/security/validation.d.ts +25 -0
- package/dist/security/validation.js +89 -0
- package/dist/security/xss.d.ts +21 -0
- package/dist/security/xss.js +90 -0
- package/dist/settings.d.ts +20 -0
- package/dist/settings.js +32 -0
- package/dist/smt.d.ts +37 -1
- package/dist/smt.js +277 -111
- package/dist/smtWorker.d.ts +1 -0
- package/dist/smtWorker.js +26 -0
- package/dist/solvers.d.ts +9 -0
- package/dist/solvers.js +11 -5
- package/dist/symbolic.d.ts +54 -1
- package/dist/symbolic.js +239 -13
- package/dist/tsconfigResolve.d.ts +28 -0
- package/dist/tsconfigResolve.js +141 -0
- package/dist/types.d.ts +33 -0
- package/hooks/claude-hook.mjs +2 -0
- package/package.json +19 -7
package/dist/githubCli.d.ts
CHANGED
|
@@ -16,7 +16,27 @@ export interface GithubContext {
|
|
|
16
16
|
err: (text: string) => void;
|
|
17
17
|
/** For tests: a stand-in for the GitHub REST API. */
|
|
18
18
|
api?: Api;
|
|
19
|
+
/**
|
|
20
|
+
* Set when the run covers a monorepo root: every selected project, each with its own directory and options. `cwd`
|
|
21
|
+
* and `projectPath` then name the root, and `options` is unused.
|
|
22
|
+
*/
|
|
23
|
+
projects?: Unit[];
|
|
24
|
+
/** Every project under the root, standalone ones included (project-relative paths, '' for the root itself). */
|
|
25
|
+
discovered?: string[];
|
|
26
|
+
/** The check options of a discovered project, or undefined when it is not one. */
|
|
27
|
+
optionsFor?: (rel: string) => CheckOptions | undefined;
|
|
28
|
+
}
|
|
29
|
+
/** One project of a run. */
|
|
30
|
+
export interface Unit {
|
|
31
|
+
cwd: string;
|
|
32
|
+
/** Relative to the monorepo root ('' for the root itself). */
|
|
33
|
+
rel: string;
|
|
34
|
+
/** From the repository root, with '/' separators ('' for the repository root). */
|
|
35
|
+
path: string;
|
|
36
|
+
options: CheckOptions;
|
|
19
37
|
}
|
|
38
|
+
/** Two repo-relative paths joined; either may be ''. */
|
|
39
|
+
export declare function joinRepo(prefix: string, file: string): string;
|
|
20
40
|
/** `--project-path`, else where `cwd` sits inside its git repository (`git rev-parse --show-prefix`), else ''. */
|
|
21
41
|
export declare function projectPathOf(cwd: string, flag: string | true | undefined): string;
|
|
22
42
|
export type Api = (method: string, path: string, body?: unknown) => Promise<unknown>;
|
|
@@ -33,10 +53,13 @@ interface PullRequest {
|
|
|
33
53
|
ref: string;
|
|
34
54
|
sha: string;
|
|
35
55
|
};
|
|
56
|
+
/** How many files the pull request changes, as GitHub counts them (the files list is capped at 3000). */
|
|
57
|
+
changed_files?: number;
|
|
36
58
|
requested_reviewers?: {
|
|
37
59
|
login: string;
|
|
38
60
|
}[];
|
|
39
61
|
merged?: boolean;
|
|
62
|
+
merged_at?: string | null;
|
|
40
63
|
}
|
|
41
64
|
/** The `github` section of a tslaws.json text, with defaults. It must exist: it names the bot every check trusts. */
|
|
42
65
|
export declare function githubConfigOf(text: string | undefined): GithubConfig;
|
|
@@ -47,6 +70,11 @@ interface ProjectState {
|
|
|
47
70
|
lock: Lock | undefined;
|
|
48
71
|
}
|
|
49
72
|
export declare function projectState(options: CheckOptions): ProjectState;
|
|
73
|
+
/**
|
|
74
|
+
* Whether `login` has `admin` or `maintain` access: the people who may change tsc-laws.lock by hand or run the merge
|
|
75
|
+
* job on demand. A bot never counts, and neither does a login whose permission cannot be read.
|
|
76
|
+
*/
|
|
77
|
+
export declare function maintains(api: Api, name: string, login: string, type?: string): Promise<boolean>;
|
|
50
78
|
/** Why `login` may not accept on this pull request, or undefined when they may. */
|
|
51
79
|
export declare function refusal(api: Api, name: string, pr: PullRequest, login: string, type: string, config: GithubConfig): Promise<string | undefined>;
|
|
52
80
|
export declare function githubCommand(action: string | undefined, ctx: GithubContext): Promise<number>;
|