@warlock.js/core 5.32.0 → 5.34.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/CHANGELOG.md +64 -46
- package/esm/application/application-config-types.d.mts +8 -0
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/boot-signal.d.mts +8 -8
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/boot-signal.mjs +15 -9
- package/esm/application/boot-signal.mjs.map +1 -1
- package/esm/cli/commands/ai/ai-command.action.mjs +140 -0
- package/esm/cli/commands/ai/ai-command.action.mjs.map +1 -0
- package/esm/cli/commands/ai.command.mjs +50 -0
- package/esm/cli/commands/ai.command.mjs.map +1 -0
- package/esm/cli/commands/check/check-command.action.mjs +4 -0
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
- package/esm/cli/commands/check.command.mjs +6 -1
- package/esm/cli/commands/check.command.mjs.map +1 -1
- package/esm/cli/commands/e2e.command.mjs +63 -0
- package/esm/cli/commands/e2e.command.mjs.map +1 -0
- package/esm/cli/commands/load-e2e-spec.mjs +47 -0
- package/esm/cli/commands/load-e2e-spec.mjs.map +1 -0
- package/esm/cli/commands/pm2/pm2-command.action.mjs +91 -0
- package/esm/cli/commands/pm2/pm2-command.action.mjs.map +1 -0
- package/esm/cli/commands/pm2/pm2-config.mjs +115 -0
- package/esm/cli/commands/pm2/pm2-config.mjs.map +1 -0
- package/esm/cli/commands/pm2.command.mjs +53 -0
- package/esm/cli/commands/pm2.command.mjs.map +1 -0
- package/esm/cli/framework-cli-commands.mjs +6 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +1 -4
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/shutdown-timeout.mjs +7 -0
- package/esm/connectors/shutdown-timeout.mjs.map +1 -0
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +8 -1
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs +1 -1
- package/esm/dev-server/health-checker/default-health-checkers.mjs +2 -16
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -1
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +1 -2
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +1 -1
- package/esm/dev-server/health-checker/file-health-result.mjs.map +1 -1
- package/esm/e2e/browser.d.mts +4 -0
- package/esm/e2e/browser.d.mts.map +1 -0
- package/esm/e2e/browser.mjs +88 -0
- package/esm/e2e/browser.mjs.map +1 -0
- package/esm/e2e/cdp.d.mts +152 -0
- package/esm/e2e/cdp.d.mts.map +1 -0
- package/esm/e2e/cdp.mjs +106 -0
- package/esm/e2e/cdp.mjs.map +1 -0
- package/esm/e2e/fixture.mjs +195 -0
- package/esm/e2e/fixture.mjs.map +1 -0
- package/esm/e2e/index.d.mts +5 -0
- package/esm/e2e/index.mjs +6 -0
- package/esm/e2e/owned-process.mjs +193 -0
- package/esm/e2e/owned-process.mjs.map +1 -0
- package/esm/e2e/page.d.mts +64 -0
- package/esm/e2e/page.d.mts.map +1 -0
- package/esm/e2e/page.mjs +376 -0
- package/esm/e2e/page.mjs.map +1 -0
- package/esm/e2e/run-e2e.d.mts +17 -0
- package/esm/e2e/run-e2e.d.mts.map +1 -0
- package/esm/e2e/run-e2e.mjs +143 -0
- package/esm/e2e/run-e2e.mjs.map +1 -0
- package/esm/e2e/types.d.mts +123 -0
- package/esm/e2e/types.d.mts.map +1 -0
- package/esm/e2e/types.mjs +24 -0
- package/esm/e2e/types.mjs.map +1 -0
- package/esm/generations/features/index.mjs +2 -0
- package/esm/generations/features/index.mjs.map +1 -1
- package/esm/generations/features/process.feature.mjs +65 -0
- package/esm/generations/features/process.feature.mjs.map +1 -0
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/port-preflight.mjs +2 -0
- package/esm/http/port-preflight.mjs.map +1 -1
- package/esm/index.d.mts +7 -2
- package/esm/index.mjs +7 -2
- package/esm/secrets/errors.d.mts +9 -0
- package/esm/secrets/errors.d.mts.map +1 -0
- package/esm/secrets/errors.mjs +24 -0
- package/esm/secrets/errors.mjs.map +1 -0
- package/esm/secrets/file-backend.mjs +167 -0
- package/esm/secrets/file-backend.mjs.map +1 -0
- package/esm/secrets/index.d.mts +6 -0
- package/esm/secrets/index.mjs +6 -0
- package/esm/secrets/keyring-backend.mjs +50 -0
- package/esm/secrets/keyring-backend.mjs.map +1 -0
- package/esm/secrets/memory-backend.d.mts +12 -0
- package/esm/secrets/memory-backend.d.mts.map +1 -0
- package/esm/secrets/memory-backend.mjs +28 -0
- package/esm/secrets/memory-backend.mjs.map +1 -0
- package/esm/secrets/resolve-driver.mjs +14 -0
- package/esm/secrets/resolve-driver.mjs.map +1 -0
- package/esm/secrets/secret-store.d.mts +25 -0
- package/esm/secrets/secret-store.d.mts.map +1 -0
- package/esm/secrets/secret-store.mjs +120 -0
- package/esm/secrets/secret-store.mjs.map +1 -0
- package/esm/secrets/secrets.d.mts +11 -0
- package/esm/secrets/secrets.d.mts.map +1 -0
- package/esm/secrets/secrets.mjs +72 -0
- package/esm/secrets/secrets.mjs.map +1 -0
- package/esm/secrets/types.d.mts +26 -0
- package/esm/secrets/types.d.mts.map +1 -0
- package/esm/socket/index.d.mts +2 -2
- package/esm/socket/index.mjs +2 -2
- package/esm/socket/utils.d.mts +7 -0
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/socket/utils.mjs +12 -1
- package/esm/socket/utils.mjs.map +1 -1
- package/esm/tests/fakes/index.d.mts +2 -1
- package/esm/tests/fakes/index.mjs +2 -1
- package/esm/tests/fakes/secrets-fake.d.mts +13 -0
- package/esm/tests/fakes/secrets-fake.d.mts.map +1 -0
- package/esm/tests/fakes/secrets-fake.mjs +50 -0
- package/esm/tests/fakes/secrets-fake.mjs.map +1 -0
- package/esm/tests/fakes/test-fakes.d.mts +2 -2
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +5 -2
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +2 -1
- package/esm/tests/index.mjs +2 -1
- package/esm/tests/vitest-setup.d.mts +1 -1
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/check/lint-step.d.mts +2 -8
- package/esm/tooling/check/lint-step.d.mts.map +1 -1
- package/esm/tooling/check/lint-step.mjs +1 -42
- package/esm/tooling/check/lint-step.mjs.map +1 -1
- package/esm/tooling/check/run-check.d.mts +2 -0
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-check.mjs +3 -1
- package/esm/tooling/check/run-check.mjs.map +1 -1
- package/esm/tooling/problem.d.mts +1 -1
- package/esm/tooling/problem.d.mts.map +1 -1
- package/esm/tooling/problem.mjs.map +1 -1
- package/esm/updater/package-manager.mjs +5 -1
- package/esm/updater/package-manager.mjs.map +1 -1
- package/esm/upgrade/codemods/index.mjs +3 -0
- package/esm/upgrade/codemods/index.mjs.map +1 -1
- package/esm/upgrade/codemods/oxc-toolchain.mjs +191 -0
- package/esm/upgrade/codemods/oxc-toolchain.mjs.map +1 -0
- package/esm/upgrade/codemods/oxlint-rule-schemas.mjs +6 -0
- package/esm/upgrade/codemods/oxlint-rule-schemas.mjs.map +1 -0
- package/esm/upgrade/codemods/port-eslint-rules.mjs +343 -0
- package/esm/upgrade/codemods/port-eslint-rules.mjs.map +1 -0
- package/esm/upgrade/codemods/toolchain-templates.mjs +244 -0
- package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -0
- package/esm/upgrade/codemods/validate-oxlint-rule.mjs +60 -0
- package/esm/upgrade/codemods/validate-oxlint-rule.mjs.map +1 -0
- package/esm/upgrade/notes.mjs +14 -7
- package/esm/upgrade/notes.mjs.map +1 -1
- package/esm/upgrade/run-upgrade.mjs +25 -6
- package/esm/upgrade/run-upgrade.mjs.map +1 -1
- package/esm/warlock-config/types.d.mts +1 -1
- package/llms-full.txt +538 -29
- package/llms.txt +5 -3
- package/package.json +29 -20
- package/skills/README.md +2 -1
- package/skills/create-module/SKILL.md +2 -2
- package/skills/index.md +1 -1
- package/skills/run-app/SKILL.md +115 -6
- package/skills/store-secrets/SKILL.md +141 -0
- package/skills/test-browser/SKILL.md +119 -0
- package/skills/test-fakes/SKILL.md +13 -11
- package/skills/upgrade-from-5-29/SKILL.md +85 -7
- package/skills/warlock-check/SKILL.md +7 -3
- package/skills/warlock-doctor/SKILL.md +8 -0
- package/skills/wire-socket/SKILL.md +19 -0
- package/skills/write-cli-command/SKILL.md +21 -0
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +0 -154
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +0 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +0 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +0 -192
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { BrowserPage } from "./page.mjs";
|
|
2
|
+
//#region ../../packages/core/src/e2e/types.d.ts
|
|
3
|
+
export type Command = readonly [executable: string, ...args: string[]];
|
|
4
|
+
export type Pattern = string | RegExp;
|
|
5
|
+
export type Viewport = {
|
|
6
|
+
name: string;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
mobile?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const defaultViewports: readonly Viewport[];
|
|
12
|
+
export type FixtureContext = {
|
|
13
|
+
/** Disposable copy of the app. All commands run here. */
|
|
14
|
+
directory: string;
|
|
15
|
+
dataRoot: string;
|
|
16
|
+
/** OS-selected ephemeral port, reserved until immediately before app startup. */
|
|
17
|
+
port: number;
|
|
18
|
+
url: string;
|
|
19
|
+
/** Write an actual port here when the app binds port 0 itself. */
|
|
20
|
+
portFile: string;
|
|
21
|
+
};
|
|
22
|
+
export type AppFixtureOptions = {
|
|
23
|
+
directory?: string;
|
|
24
|
+
/** Optional build, executed inside the disposable copy before start. */
|
|
25
|
+
build?: Command | ((fixture: FixtureContext) => Command);
|
|
26
|
+
/** Defaults to [process.execPath, "dist/app.js"]. Must stay in the foreground. */
|
|
27
|
+
start?: Command | ((fixture: FixtureContext) => Command);
|
|
28
|
+
/** Only these app variables are added to the isolated environment. */
|
|
29
|
+
env?: Record<string, string> | ((fixture: FixtureContext) => Record<string, string>);
|
|
30
|
+
/** Directories prepended to PATH, for fixture-owned fake engines/binaries. */
|
|
31
|
+
path?: string[];
|
|
32
|
+
/** Prepare data/fake binaries in the disposable fixture before build/start. */
|
|
33
|
+
prepare?: (fixture: FixtureContext) => void | Promise<void>;
|
|
34
|
+
/** Additional relative directories to omit when copying app files. */
|
|
35
|
+
exclude?: string[];
|
|
36
|
+
readyPath?: string;
|
|
37
|
+
/** If true, await portFile instead of using the preallocated port. */
|
|
38
|
+
portFromFile?: boolean;
|
|
39
|
+
startupTimeoutMs?: number;
|
|
40
|
+
};
|
|
41
|
+
export type BrowserOptions = {
|
|
42
|
+
binary?: string;
|
|
43
|
+
/** Additional Chrome flags, e.g. --no-sandbox in a controlled root container. */
|
|
44
|
+
args?: string[];
|
|
45
|
+
};
|
|
46
|
+
export type NetworkFailure = {
|
|
47
|
+
at: string;
|
|
48
|
+
url: string;
|
|
49
|
+
status?: number;
|
|
50
|
+
errorText?: string;
|
|
51
|
+
canceled?: boolean;
|
|
52
|
+
allowed?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type ConsoleEntry = {
|
|
55
|
+
at: string;
|
|
56
|
+
level: string;
|
|
57
|
+
text: string;
|
|
58
|
+
allowed?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export type StepEvidence = {
|
|
61
|
+
name: string;
|
|
62
|
+
startedAt: string;
|
|
63
|
+
durationMs: number;
|
|
64
|
+
status: "passed" | "failed";
|
|
65
|
+
error?: string;
|
|
66
|
+
};
|
|
67
|
+
export type ProcessEvidence = {
|
|
68
|
+
role: string;
|
|
69
|
+
pid: number;
|
|
70
|
+
childPid?: number;
|
|
71
|
+
command: string[];
|
|
72
|
+
ownerFile: string;
|
|
73
|
+
stopped?: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type E2EEvidence = {
|
|
76
|
+
schemaVersion: 1;
|
|
77
|
+
startedAt: string;
|
|
78
|
+
durationMs: number;
|
|
79
|
+
status: "running" | "passed" | "failed";
|
|
80
|
+
url?: string;
|
|
81
|
+
steps: StepEvidence[];
|
|
82
|
+
console: ConsoleEntry[];
|
|
83
|
+
networkFailures: NetworkFailure[];
|
|
84
|
+
screenshots: {
|
|
85
|
+
name: string;
|
|
86
|
+
file: string;
|
|
87
|
+
viewport: Viewport;
|
|
88
|
+
}[];
|
|
89
|
+
processes: ProcessEvidence[];
|
|
90
|
+
errors: string[];
|
|
91
|
+
};
|
|
92
|
+
export type NetworkAllowance = {
|
|
93
|
+
url: Pattern;
|
|
94
|
+
status?: number;
|
|
95
|
+
errorText?: Pattern;
|
|
96
|
+
};
|
|
97
|
+
export type E2EContext = FixtureContext & {
|
|
98
|
+
page: BrowserPage;
|
|
99
|
+
evidence: E2EEvidence;
|
|
100
|
+
outputDirectory: string;
|
|
101
|
+
signal: AbortSignal;
|
|
102
|
+
step: <T>(name: string, action: () => Promise<T>) => Promise<T>;
|
|
103
|
+
};
|
|
104
|
+
export type E2ESpec = {
|
|
105
|
+
app: AppFixtureOptions;
|
|
106
|
+
browser?: BrowserOptions;
|
|
107
|
+
viewports?: readonly Viewport[];
|
|
108
|
+
allowConsoleErrors?: Pattern[];
|
|
109
|
+
allowNetworkFailures?: NetworkAllowance[];
|
|
110
|
+
/** Long-lived HTTP requests excluded from the final network-idle barrier. */
|
|
111
|
+
allowPendingRequests?: Pattern[];
|
|
112
|
+
timeoutMs?: number;
|
|
113
|
+
run: (context: E2EContext) => Promise<void>;
|
|
114
|
+
};
|
|
115
|
+
export type RunE2EOptions = {
|
|
116
|
+
browser?: string;
|
|
117
|
+
path?: string[];
|
|
118
|
+
outputDirectory?: string;
|
|
119
|
+
signal?: AbortSignal;
|
|
120
|
+
};
|
|
121
|
+
export declare function defineE2E(spec: E2ESpec): E2ESpec;
|
|
122
|
+
//#endregion
|
|
123
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/e2e/types.ts"],"mappings":";;YAEY,oBAAoB,uBAAuB;YAC3C,mBAAmB;YACnB;EAAa;EAAc;EAAe;EAAgB;;qBACzD,2BAA2B;YAK5B;;EAEV;EACA;;EAEA;EACA;;EAEA;;YAEU;EACV;;EAEA,QAAQ,YAAY,SAAS,mBAAmB;;EAEhD,QAAQ,YAAY,SAAS,mBAAmB;;EAEhD,MAAM,2BAA2B,SAAS,mBAAmB;;EAE7D;;EAEA,WAAW,SAAS,0BAA0B;;EAE9C;EACA;;EAEA;EACA;;YAEU;EACV;;EAEA;;YAEU;EACV;EACA;EACA;EACA;EACA;EACA;;YAEU;EAAiB;EAAY;EAAe;EAAc;;YAC1D;EACV;EACA;EACA;EACA;EACA;;YAEU;EACV;EACA;EACA;EACA;EACA;EACA;;YAEU;EACV;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,SAAS;EACT,iBAAiB;EACjB;IAAe;IAAc;IAAc,UAAU;;EACrD,WAAW;EACX;;YAEU;EAAqB,KAAK;EAAS;EAAiB,YAAY;;YAChE,aAAa;EACvB,MAAM;EACN,UAAU;EACV;EACA,QAAQ;EACR,OAAO,GAAG,cAAc,cAAc,QAAQ,OAAO,QAAQ;;YAEnD;EACV,KAAK;EACL,UAAU;EACV,qBAAqB;EACrB,qBAAqB;EACrB,uBAAuB;;EAEvB,uBAAuB;EACvB;EACA,MAAM,SAAS,eAAe;;YAEpB;EACV;EACA;EACA;EACA,SAAS;;wBAGK,UAAU,MAAM,UAAU"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../../packages/core/src/e2e/types.ts
|
|
2
|
+
const defaultViewports = [{
|
|
3
|
+
name: "desktop",
|
|
4
|
+
width: 1280,
|
|
5
|
+
height: 800
|
|
6
|
+
}, {
|
|
7
|
+
name: "phone",
|
|
8
|
+
width: 390,
|
|
9
|
+
height: 844,
|
|
10
|
+
mobile: true
|
|
11
|
+
}];
|
|
12
|
+
function defineE2E(spec) {
|
|
13
|
+
return spec;
|
|
14
|
+
}
|
|
15
|
+
function errorMessage(error) {
|
|
16
|
+
return error instanceof Error ? error.message : String(error);
|
|
17
|
+
}
|
|
18
|
+
function matches(pattern, value) {
|
|
19
|
+
return typeof pattern === "string" ? value.includes(pattern) : new RegExp(pattern.source, pattern.flags).test(value);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { defaultViewports, defineE2E, errorMessage, matches };
|
|
24
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../../../../../../packages/core/src/e2e/types.ts"],"sourcesContent":["import type { BrowserPage } from \"./page\";\n\nexport type Command = readonly [executable: string, ...args: string[]];\nexport type Pattern = string | RegExp;\nexport type Viewport = { name: string; width: number; height: number; mobile?: boolean };\nexport const defaultViewports: readonly Viewport[] = [\n { name: \"desktop\", width: 1280, height: 800 },\n { name: \"phone\", width: 390, height: 844, mobile: true },\n];\n\nexport type FixtureContext = {\n /** Disposable copy of the app. All commands run here. */\n directory: string;\n dataRoot: string;\n /** OS-selected ephemeral port, reserved until immediately before app startup. */\n port: number;\n url: string;\n /** Write an actual port here when the app binds port 0 itself. */\n portFile: string;\n};\nexport type AppFixtureOptions = {\n directory?: string;\n /** Optional build, executed inside the disposable copy before start. */\n build?: Command | ((fixture: FixtureContext) => Command);\n /** Defaults to [process.execPath, \"dist/app.js\"]. Must stay in the foreground. */\n start?: Command | ((fixture: FixtureContext) => Command);\n /** Only these app variables are added to the isolated environment. */\n env?: Record<string, string> | ((fixture: FixtureContext) => Record<string, string>);\n /** Directories prepended to PATH, for fixture-owned fake engines/binaries. */\n path?: string[];\n /** Prepare data/fake binaries in the disposable fixture before build/start. */\n prepare?: (fixture: FixtureContext) => void | Promise<void>;\n /** Additional relative directories to omit when copying app files. */\n exclude?: string[];\n readyPath?: string;\n /** If true, await portFile instead of using the preallocated port. */\n portFromFile?: boolean;\n startupTimeoutMs?: number;\n};\nexport type BrowserOptions = {\n binary?: string;\n /** Additional Chrome flags, e.g. --no-sandbox in a controlled root container. */\n args?: string[];\n};\nexport type NetworkFailure = {\n at: string;\n url: string;\n status?: number;\n errorText?: string;\n canceled?: boolean;\n allowed?: boolean;\n};\nexport type ConsoleEntry = { at: string; level: string; text: string; allowed?: boolean };\nexport type StepEvidence = {\n name: string;\n startedAt: string;\n durationMs: number;\n status: \"passed\" | \"failed\";\n error?: string;\n};\nexport type ProcessEvidence = {\n role: string;\n pid: number;\n childPid?: number;\n command: string[];\n ownerFile: string;\n stopped?: boolean;\n};\nexport type E2EEvidence = {\n schemaVersion: 1;\n startedAt: string;\n durationMs: number;\n status: \"running\" | \"passed\" | \"failed\";\n url?: string;\n steps: StepEvidence[];\n console: ConsoleEntry[];\n networkFailures: NetworkFailure[];\n screenshots: { name: string; file: string; viewport: Viewport }[];\n processes: ProcessEvidence[];\n errors: string[];\n};\nexport type NetworkAllowance = { url: Pattern; status?: number; errorText?: Pattern };\nexport type E2EContext = FixtureContext & {\n page: BrowserPage;\n evidence: E2EEvidence;\n outputDirectory: string;\n signal: AbortSignal;\n step: <T>(name: string, action: () => Promise<T>) => Promise<T>;\n};\nexport type E2ESpec = {\n app: AppFixtureOptions;\n browser?: BrowserOptions;\n viewports?: readonly Viewport[];\n allowConsoleErrors?: Pattern[];\n allowNetworkFailures?: NetworkAllowance[];\n /** Long-lived HTTP requests excluded from the final network-idle barrier. */\n allowPendingRequests?: Pattern[];\n timeoutMs?: number;\n run: (context: E2EContext) => Promise<void>;\n};\nexport type RunE2EOptions = {\n browser?: string;\n path?: string[];\n outputDirectory?: string;\n signal?: AbortSignal;\n};\n\nexport function defineE2E(spec: E2ESpec): E2ESpec {\n return spec;\n}\nexport function errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\nexport function matches(pattern: Pattern, value: string): boolean {\n // A fresh regexp avoids stateful /g and /y allowlists changing their verdict.\n return typeof pattern === \"string\"\n ? value.includes(pattern)\n : new RegExp(pattern.source, pattern.flags).test(value);\n}\n"],"mappings":";AAKA,MAAa,mBAAwC,CACnD;CAAE,MAAM;CAAW,OAAO;CAAM,QAAQ;AAAI,GAC5C;CAAE,MAAM;CAAS,OAAO;CAAK,QAAQ;CAAK,QAAQ;AAAK,CACzD;AAmGA,SAAgB,UAAU,MAAwB;CAChD,OAAO;AACT;AACA,SAAgB,aAAa,OAAwB;CACnD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;AACA,SAAgB,QAAQ,SAAkB,OAAwB;CAEhE,OAAO,OAAO,YAAY,WACtB,MAAM,SAAS,OAAO,IACtB,IAAI,OAAO,QAAQ,QAAQ,QAAQ,KAAK,CAAC,CAAC,KAAK,KAAK;AAC1D"}
|
|
@@ -19,6 +19,7 @@ import { mongodbFeature } from "./mongodb.feature.mjs";
|
|
|
19
19
|
import { mysqlFeature } from "./mysql.feature.mjs";
|
|
20
20
|
import { notificationsFeature } from "./notifications.feature.mjs";
|
|
21
21
|
import { postgresFeature } from "./postgres.feature.mjs";
|
|
22
|
+
import { processFeature } from "./process.feature.mjs";
|
|
22
23
|
import { queueFeature } from "./queue.feature.mjs";
|
|
23
24
|
import { reactEmailFeature } from "./react-email.feature.mjs";
|
|
24
25
|
import { reactFeature } from "./react.feature.mjs";
|
|
@@ -60,6 +61,7 @@ const featuresMap = {
|
|
|
60
61
|
shadcn: shadcnFeature,
|
|
61
62
|
sitemap: sitemapFeature,
|
|
62
63
|
devtools: devtoolsFeature,
|
|
64
|
+
process: processFeature,
|
|
63
65
|
herald: heraldFeature,
|
|
64
66
|
queue: queueFeature,
|
|
65
67
|
"bull-board": bullBoardFeature,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/index.ts"],"sourcesContent":["import { accessFeature } from \"./access.feature\";\nimport { aiAnthropicFeature } from \"./ai-anthropic.feature\";\nimport { aiBedrockFeature } from \"./ai-bedrock.feature\";\nimport { aiGoogleFeature } from \"./ai-google.feature\";\nimport { aiOllamaFeature } from \"./ai-ollama.feature\";\nimport { aiOpenaiFeature } from \"./ai-openai.feature\";\nimport { aiPanopticFeature } from \"./ai-panoptic.feature\";\nimport { aiToolsFeature } from \"./ai-tools.feature\";\nimport { aiWorkspaceFeature } from \"./ai-workspace.feature\";\nimport { aiFeature } from \"./ai.feature\";\nimport { authGoogleFeature } from \"./auth-google.feature\";\nimport { authPasskeysFeature } from \"./auth-passkeys.feature\";\nimport { bullBoardFeature } from \"./bull-board.feature\";\nimport { devtoolsFeature } from \"./devtools.feature\";\nimport { heraldFeature } from \"./herald.feature\";\nimport { imageFeature } from \"./image.feature\";\nimport { mailFeature } from \"./mail.feature\";\nimport { mongodbFeature } from \"./mongodb.feature\";\nimport { mysqlFeature } from \"./mysql.feature\";\nimport { notificationsFeature } from \"./notifications.feature\";\nimport { postgresFeature } from \"./postgres.feature\";\nimport { queueFeature } from \"./queue.feature\";\nimport { reactEmailFeature } from \"./react-email.feature\";\nimport { reactFeature } from \"./react.feature\";\nimport { redisFeature } from \"./redis.feature\";\nimport { s3Feature } from \"./s3.feature\";\nimport { schedulerFeature } from \"./scheduler.feature\";\nimport { sesFeature } from \"./ses.feature\";\nimport { shadcnFeature } from \"./shadcn.feature\";\nimport { sitemapFeature } from \"./sitemap.feature\";\nimport { socketFeature } from \"./socket.feature\";\nimport { tailwindFeature } from \"./tailwind.feature\";\nimport { testFeature } from \"./test.feature\";\nimport type { FeatureDefinition } from \"./types\";\nimport { webFeature } from \"./web.feature\";\n\nexport type { FeatureDefinition } from \"./types\";\n\n/**\n * The feature registry `warlock add` dispatches against.\n *\n * This file is an INDEX, nothing more: every entry lives in its own module\n * alongside the `onExecuting` body it runs. Key order is load-bearing — it is\n * the order `--list` prints and the order the \"not allowed\" error lists — so\n * add new features in the place they should appear, not alphabetically.\n */\nexport const featuresMap: Record<string, FeatureDefinition> = {\n \"react-email\": reactEmailFeature,\n react: reactFeature,\n image: imageFeature,\n mail: mailFeature,\n ses: sesFeature,\n mongodb: mongodbFeature,\n scheduler: schedulerFeature,\n // swagger / postman intentionally omitted — those packages do not exist yet;\n // they will ship together in the unified @warlock.js/api-docs package.\n postgres: postgresFeature,\n mysql: mysqlFeature,\n redis: redisFeature,\n s3: s3Feature,\n test: testFeature,\n web: webFeature,\n // Directly after `web`, and only there: it `requires` it, it is useless\n // without it, and a reader scanning `--list` for the page stack should meet\n // the two together rather than find styling filed between queues and sockets.\n tailwind: tailwindFeature,\n // Immediately after `tailwind`, for the same reason `tailwind` follows `web`:\n // it `requires` it, it appends to the stylesheet that feature creates, and the\n // three of them are one stack a reader should meet in build order.\n shadcn: shadcnFeature,\n // Directly after the web/tailwind/shadcn stack, for the same reason: it\n // `requires` web (it reads the page registry `listRoutablePages()`\n // exposes) and a reader scanning `--list` for the page stack should meet it\n // there rather than filed between queues and sockets.\n sitemap: sitemapFeature,\n devtools: devtoolsFeature,\n herald: heraldFeature,\n queue: queueFeature,\n // Directly after `queue`, for the same reason `tailwind` follows `web`: it\n // needs queue already installed and configured, and a reader scanning\n // `--list` for job-queue features should meet the two together.\n \"bull-board\": bullBoardFeature,\n socket: socketFeature,\n notifications: notificationsFeature,\n access: accessFeature,\n // Login methods for @warlock.js/auth — \"<package>-<vendor>\" like the ai-* entries.\n \"auth-google\": authGoogleFeature,\n \"auth-passkeys\": authPasskeysFeature,\n ai: aiFeature,\n \"ai-openai\": aiOpenaiFeature,\n \"ai-google\": aiGoogleFeature,\n \"ai-anthropic\": aiAnthropicFeature,\n \"ai-bedrock\": aiBedrockFeature,\n \"ai-ollama\": aiOllamaFeature,\n \"ai-tools\": aiToolsFeature,\n \"ai-panoptic\": aiPanopticFeature,\n \"ai-workspace\": aiWorkspaceFeature,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/index.ts"],"sourcesContent":["import { accessFeature } from \"./access.feature\";\nimport { aiAnthropicFeature } from \"./ai-anthropic.feature\";\nimport { aiBedrockFeature } from \"./ai-bedrock.feature\";\nimport { aiGoogleFeature } from \"./ai-google.feature\";\nimport { aiOllamaFeature } from \"./ai-ollama.feature\";\nimport { aiOpenaiFeature } from \"./ai-openai.feature\";\nimport { aiPanopticFeature } from \"./ai-panoptic.feature\";\nimport { aiToolsFeature } from \"./ai-tools.feature\";\nimport { aiWorkspaceFeature } from \"./ai-workspace.feature\";\nimport { aiFeature } from \"./ai.feature\";\nimport { authGoogleFeature } from \"./auth-google.feature\";\nimport { authPasskeysFeature } from \"./auth-passkeys.feature\";\nimport { bullBoardFeature } from \"./bull-board.feature\";\nimport { devtoolsFeature } from \"./devtools.feature\";\nimport { heraldFeature } from \"./herald.feature\";\nimport { imageFeature } from \"./image.feature\";\nimport { mailFeature } from \"./mail.feature\";\nimport { mongodbFeature } from \"./mongodb.feature\";\nimport { mysqlFeature } from \"./mysql.feature\";\nimport { notificationsFeature } from \"./notifications.feature\";\nimport { postgresFeature } from \"./postgres.feature\";\nimport { processFeature } from \"./process.feature\";\nimport { queueFeature } from \"./queue.feature\";\nimport { reactEmailFeature } from \"./react-email.feature\";\nimport { reactFeature } from \"./react.feature\";\nimport { redisFeature } from \"./redis.feature\";\nimport { s3Feature } from \"./s3.feature\";\nimport { schedulerFeature } from \"./scheduler.feature\";\nimport { sesFeature } from \"./ses.feature\";\nimport { shadcnFeature } from \"./shadcn.feature\";\nimport { sitemapFeature } from \"./sitemap.feature\";\nimport { socketFeature } from \"./socket.feature\";\nimport { tailwindFeature } from \"./tailwind.feature\";\nimport { testFeature } from \"./test.feature\";\nimport type { FeatureDefinition } from \"./types\";\nimport { webFeature } from \"./web.feature\";\n\nexport type { FeatureDefinition } from \"./types\";\n\n/**\n * The feature registry `warlock add` dispatches against.\n *\n * This file is an INDEX, nothing more: every entry lives in its own module\n * alongside the `onExecuting` body it runs. Key order is load-bearing — it is\n * the order `--list` prints and the order the \"not allowed\" error lists — so\n * add new features in the place they should appear, not alphabetically.\n */\nexport const featuresMap: Record<string, FeatureDefinition> = {\n \"react-email\": reactEmailFeature,\n react: reactFeature,\n image: imageFeature,\n mail: mailFeature,\n ses: sesFeature,\n mongodb: mongodbFeature,\n scheduler: schedulerFeature,\n // swagger / postman intentionally omitted — those packages do not exist yet;\n // they will ship together in the unified @warlock.js/api-docs package.\n postgres: postgresFeature,\n mysql: mysqlFeature,\n redis: redisFeature,\n s3: s3Feature,\n test: testFeature,\n web: webFeature,\n // Directly after `web`, and only there: it `requires` it, it is useless\n // without it, and a reader scanning `--list` for the page stack should meet\n // the two together rather than find styling filed between queues and sockets.\n tailwind: tailwindFeature,\n // Immediately after `tailwind`, for the same reason `tailwind` follows `web`:\n // it `requires` it, it appends to the stylesheet that feature creates, and the\n // three of them are one stack a reader should meet in build order.\n shadcn: shadcnFeature,\n // Directly after the web/tailwind/shadcn stack, for the same reason: it\n // `requires` web (it reads the page registry `listRoutablePages()`\n // exposes) and a reader scanning `--list` for the page stack should meet it\n // there rather than filed between queues and sockets.\n sitemap: sitemapFeature,\n devtools: devtoolsFeature,\n process: processFeature,\n herald: heraldFeature,\n queue: queueFeature,\n // Directly after `queue`, for the same reason `tailwind` follows `web`: it\n // needs queue already installed and configured, and a reader scanning\n // `--list` for job-queue features should meet the two together.\n \"bull-board\": bullBoardFeature,\n socket: socketFeature,\n notifications: notificationsFeature,\n access: accessFeature,\n // Login methods for @warlock.js/auth — \"<package>-<vendor>\" like the ai-* entries.\n \"auth-google\": authGoogleFeature,\n \"auth-passkeys\": authPasskeysFeature,\n ai: aiFeature,\n \"ai-openai\": aiOpenaiFeature,\n \"ai-google\": aiGoogleFeature,\n \"ai-anthropic\": aiAnthropicFeature,\n \"ai-bedrock\": aiBedrockFeature,\n \"ai-ollama\": aiOllamaFeature,\n \"ai-tools\": aiToolsFeature,\n \"ai-panoptic\": aiPanopticFeature,\n \"ai-workspace\": aiWorkspaceFeature,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAa,cAAiD;CAC5D,eAAe;CACf,OAAO;CACP,OAAO;CACP,MAAM;CACN,KAAK;CACL,SAAS;CACT,WAAW;CAGX,UAAU;CACV,OAAO;CACP,OAAO;CACP,IAAI;CACJ,MAAM;CACN,KAAK;CAIL,UAAU;CAIV,QAAQ;CAKR,SAAS;CACT,UAAU;CACV,SAAS;CACT,QAAQ;CACR,OAAO;CAIP,cAAc;CACd,QAAQ;CACR,eAAe;CACf,QAAQ;CAER,eAAe;CACf,iBAAiB;CACjB,IAAI;CACJ,aAAa;CACb,aAAa;CACb,gBAAgB;CAChB,cAAc;CACd,aAAa;CACb,YAAY;CACZ,eAAe;CACf,gBAAgB;AAClB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { srcPath } from "../../utils/paths.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import { recordSkippedFile } from "../generation-run.mjs";
|
|
4
|
+
import { fileExistsAsync, getFileAsync, putFileAsync } from "../generation-fs.mjs";
|
|
5
|
+
import { INSTALLED_WARLOCK_VERSION } from "./types.mjs";
|
|
6
|
+
|
|
7
|
+
//#region ../../packages/core/src/generations/features/process.feature.ts
|
|
8
|
+
const processConfig = `import { rootPath } from "@warlock.js/core";
|
|
9
|
+
import type { SupervisorOptions } from "@warlock.js/process";
|
|
10
|
+
|
|
11
|
+
const processConfig = {
|
|
12
|
+
owner: "app",
|
|
13
|
+
registry: rootPath("storage/processes/registry.json"),
|
|
14
|
+
defaults: { timeoutMs: 300_000, memoryBytes: 512 * 1024 * 1024 },
|
|
15
|
+
} satisfies SupervisorOptions;
|
|
16
|
+
|
|
17
|
+
export default processConfig;
|
|
18
|
+
`;
|
|
19
|
+
const processes = `import { supervisor } from "@warlock.js/process";
|
|
20
|
+
import processConfig from "../../config/process";
|
|
21
|
+
|
|
22
|
+
export const processes = supervisor(processConfig);
|
|
23
|
+
`;
|
|
24
|
+
const lifecycle = `import { Application } from "@warlock.js/core";
|
|
25
|
+
import { processes } from "./index";
|
|
26
|
+
|
|
27
|
+
Application.onValidateBoot(async () => {
|
|
28
|
+
await processes.recover();
|
|
29
|
+
});
|
|
30
|
+
Application.onShutdown(async () => {
|
|
31
|
+
await processes.stopAll();
|
|
32
|
+
});
|
|
33
|
+
`;
|
|
34
|
+
async function createOnce(file, content) {
|
|
35
|
+
if (await fileExistsAsync(file)) {
|
|
36
|
+
recordSkippedFile(file, "exists");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
await putFileAsync(file, content);
|
|
40
|
+
}
|
|
41
|
+
const processFeature = {
|
|
42
|
+
description: "App-owned processes and terminals; creates typed config, recovery and graceful shutdown hooks, and a development process panel.",
|
|
43
|
+
dependencies: { "@warlock.js/process": INSTALLED_WARLOCK_VERSION },
|
|
44
|
+
ejectConfig: {
|
|
45
|
+
name: "process",
|
|
46
|
+
content: processConfig
|
|
47
|
+
},
|
|
48
|
+
async onExecuting() {
|
|
49
|
+
await createOnce(srcPath("app/processes/index.ts"), processes);
|
|
50
|
+
await createOnce(srcPath("app/processes/lifecycle.ts"), lifecycle);
|
|
51
|
+
const main = srcPath("app/main.ts");
|
|
52
|
+
const content = await fileExistsAsync(main) ? await getFileAsync(main) : "";
|
|
53
|
+
if (!/import\s*["']\.\/processes\/lifecycle["']/.test(content)) await putFileAsync(main, `import "./processes/lifecycle";\n${content}`);
|
|
54
|
+
else recordSkippedFile(main, "exists");
|
|
55
|
+
await createOnce(srcPath("app/processes/devtools.ts"), `import { processes } from "./index";
|
|
56
|
+
|
|
57
|
+
export const processPanel = { list: () => processes.list() };
|
|
58
|
+
`);
|
|
59
|
+
console.log("Process supervision configured. Next: set a unique owner and registry per app instance in src/config/process.ts, then import { processes } from your app/processes module and await processes.spawn(...). Install devtools with warlock add devtools to view the Processes panel. Install node-pty separately for spawnPty(). macOS also needs the shipped identity helper compiled and WARLOCK_PROCESS_IDENTITY_HELPER configured; see the process package README.");
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { processFeature };
|
|
65
|
+
//# sourceMappingURL=process.feature.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.feature.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/generations/features/process.feature.ts"],"sourcesContent":["import { srcPath } from \"../../utils\";\nimport { fileExistsAsync, getFileAsync, putFileAsync, recordSkippedFile } from \"../generation-fs\";\nimport { type FeatureDefinition, INSTALLED_WARLOCK_VERSION } from \"./types\";\n\nconst processConfig = `import { rootPath } from \"@warlock.js/core\";\nimport type { SupervisorOptions } from \"@warlock.js/process\";\n\nconst processConfig = {\n owner: \"app\",\n registry: rootPath(\"storage/processes/registry.json\"),\n defaults: { timeoutMs: 300_000, memoryBytes: 512 * 1024 * 1024 },\n} satisfies SupervisorOptions;\n\nexport default processConfig;\n`;\n\nconst processes = `import { supervisor } from \"@warlock.js/process\";\nimport processConfig from \"../../config/process\";\n\nexport const processes = supervisor(processConfig);\n`;\n\nconst lifecycle = `import { Application } from \"@warlock.js/core\";\nimport { processes } from \"./index\";\n\nApplication.onValidateBoot(async () => {\n await processes.recover();\n});\nApplication.onShutdown(async () => {\n await processes.stopAll();\n});\n`;\n\nasync function createOnce(file: string, content: string): Promise<void> {\n if (await fileExistsAsync(file)) {\n recordSkippedFile(file, \"exists\");\n return;\n }\n await putFileAsync(file, content);\n}\n\nexport const processFeature: FeatureDefinition = {\n description:\n \"App-owned processes and terminals; creates typed config, recovery and graceful shutdown hooks, and a development process panel.\",\n dependencies: { \"@warlock.js/process\": INSTALLED_WARLOCK_VERSION },\n ejectConfig: { name: \"process\", content: processConfig },\n async onExecuting() {\n await createOnce(srcPath(\"app/processes/index.ts\"), processes);\n await createOnce(srcPath(\"app/processes/lifecycle.ts\"), lifecycle);\n const main = srcPath(\"app/main.ts\");\n const content = (await fileExistsAsync(main)) ? await getFileAsync(main) : \"\";\n if (!/import\\s*[\"']\\.\\/processes\\/lifecycle[\"']/.test(content)) {\n await putFileAsync(main, `import \"./processes/lifecycle\";\\n${content}`);\n } else recordSkippedFile(main, \"exists\");\n // Devtools discovers this source only in development and only when installed.\n await createOnce(\n srcPath(\"app/processes/devtools.ts\"),\n `import { processes } from \"./index\";\n\nexport const processPanel = { list: () => processes.list() };\n`,\n );\n console.log(\n \"Process supervision configured. Next: set a unique owner and registry per app instance in src/config/process.ts, then import { processes } from your app/processes module and await processes.spawn(...). Install devtools with warlock add devtools to view the Processes panel. Install node-pty separately for spawnPty(). macOS also needs the shipped identity helper compiled and WARLOCK_PROCESS_IDENTITY_HELPER configured; see the process package README.\",\n );\n },\n};\n"],"mappings":";;;;;;;AAIA,MAAM,gBAAgB;;;;;;;;;;;AAYtB,MAAM,YAAY;;;;;AAMlB,MAAM,YAAY;;;;;;;;;;AAWlB,eAAe,WAAW,MAAc,SAAgC;CACtE,IAAI,MAAM,gBAAgB,IAAI,GAAG;EAC/B,kBAAkB,MAAM,QAAQ;EAChC;CACF;CACA,MAAM,aAAa,MAAM,OAAO;AAClC;AAEA,MAAa,iBAAoC;CAC/C,aACE;CACF,cAAc,EAAE,uBAAuB,0BAA0B;CACjE,aAAa;EAAE,MAAM;EAAW,SAAS;CAAc;CACvD,MAAM,cAAc;EAClB,MAAM,WAAW,QAAQ,wBAAwB,GAAG,SAAS;EAC7D,MAAM,WAAW,QAAQ,4BAA4B,GAAG,SAAS;EACjE,MAAM,OAAO,QAAQ,aAAa;EAClC,MAAM,UAAW,MAAM,gBAAgB,IAAI,IAAK,MAAM,aAAa,IAAI,IAAI;EAC3E,IAAI,CAAC,4CAA4C,KAAK,OAAO,GAC3D,MAAM,aAAa,MAAM,oCAAoC,SAAS;OACjE,kBAAkB,MAAM,QAAQ;EAEvC,MAAM,WACJ,QAAQ,2BAA2B,GACnC;;;CAIF;EACA,QAAQ,IACN,qcACF;CACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port-preflight.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/port-preflight.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"port-preflight.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/http/port-preflight.ts"],"mappings":";;;;;;;;;;;;;;qBAqBa,uBAAuB;WAKhB;WACA;;WAJF;EAEhB,YACkB,cACA;;;;;;;;;wBAiBJ,gBAAgB,cAAc,gBAAoC;;;;;;;;;;wBAmC5D,sBACpB,cACA,gBACC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createServer } from "node:net";
|
|
2
|
+
import cluster from "node:cluster";
|
|
2
3
|
|
|
3
4
|
//#region ../../packages/core/src/http/port-preflight.ts
|
|
4
5
|
/**
|
|
@@ -65,6 +66,7 @@ function isPortAvailable(port, host = DEFAULT_PROBE_HOST) {
|
|
|
65
66
|
* @throws {PortInUseError} when the port is taken.
|
|
66
67
|
*/
|
|
67
68
|
async function assertPortIsAvailable(port, host = DEFAULT_PROBE_HOST) {
|
|
69
|
+
if (cluster.isWorker) return;
|
|
68
70
|
if (!await isPortAvailable(port, host)) throw new PortInUseError(port, host);
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port-preflight.mjs","names":[],"sources":["../../../../../../../../packages/core/src/http/port-preflight.ts"],"sourcesContent":["import { createServer } from \"node:net\";\n\n/**\n * Host used when the caller has no configured bind host.\n */\nconst DEFAULT_PROBE_HOST = \"localhost\";\n\n/**\n * Raised when a port the framework is about to bind is already taken.\n *\n * Carries the port and host so a caller can report them without parsing the\n * message, and its message is the developer-facing instruction — the whole\n * point of preflighting is that nobody has to decode a raw `EADDRINUSE`.\n *\n * The message leads with `EADDRINUSE` on purpose: it is the string a\n * developer greps their terminal for, and the one every other Node tool\n * already trained them to recognize as \"something else is on this port\".\n * `code` mirrors it as a property so a caller can branch on it without\n * parsing text, the same way `NodeJS.ErrnoException.code` works.\n */\nexport class PortInUseError extends Error {\n /** Mirrors Node's own `ErrnoException.code` for this failure. */\n public readonly code = \"EADDRINUSE\";\n\n public constructor(\n public readonly port: number,\n public readonly host: string,\n ) {\n super(\n `EADDRINUSE: Port ${port} is already in use on ${host}. Stop the dev server (or whatever else is listening on port ${port}) and run again, or start on a free port — e.g. startHttpTestServer({ port: ${port + 1} }).`,\n );\n\n this.name = \"PortInUseError\";\n }\n}\n\n/**\n * Probe a TCP port by attempting a bind and immediately releasing it.\n *\n * @returns `true` when the port is free, `false` when it is taken or the\n * process is not allowed to bind it. Any other bind failure is re-thrown —\n * an unreadable network error must not be reported as \"port in use\".\n */\nexport function isPortAvailable(port: number, host: string = DEFAULT_PROBE_HOST): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const probe = createServer();\n\n probe.unref();\n\n probe.once(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"EADDRINUSE\" || error.code === \"EACCES\") {\n resolve(false);\n\n return;\n }\n\n reject(error);\n });\n\n probe.once(\"listening\", () => {\n probe.close(() => resolve(true));\n });\n\n // `exclusive` refuses a shared bind, which is what makes the probe honest:\n // with load balancing enabled a second bind on a served port can succeed.\n probe.listen({ port, host, exclusive: true });\n });\n}\n\n/**\n * Assert a port is free before something binds it.\n *\n * Run this ahead of the actual `listen()` so a collision surfaces as an\n * instruction the developer can act on, instead of a raw `EADDRINUSE` thrown\n * from deep inside the HTTP stack.\n *\n * @throws {PortInUseError} when the port is taken.\n */\nexport async function assertPortIsAvailable(\n port: number,\n host: string = DEFAULT_PROBE_HOST,\n): Promise<void> {\n const available = await isPortAvailable(port, host);\n\n if (!available) {\n throw new PortInUseError(port, host);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"port-preflight.mjs","names":[],"sources":["../../../../../../../../packages/core/src/http/port-preflight.ts"],"sourcesContent":["import { createServer } from \"node:net\";\nimport cluster from \"node:cluster\";\n\n/**\n * Host used when the caller has no configured bind host.\n */\nconst DEFAULT_PROBE_HOST = \"localhost\";\n\n/**\n * Raised when a port the framework is about to bind is already taken.\n *\n * Carries the port and host so a caller can report them without parsing the\n * message, and its message is the developer-facing instruction — the whole\n * point of preflighting is that nobody has to decode a raw `EADDRINUSE`.\n *\n * The message leads with `EADDRINUSE` on purpose: it is the string a\n * developer greps their terminal for, and the one every other Node tool\n * already trained them to recognize as \"something else is on this port\".\n * `code` mirrors it as a property so a caller can branch on it without\n * parsing text, the same way `NodeJS.ErrnoException.code` works.\n */\nexport class PortInUseError extends Error {\n /** Mirrors Node's own `ErrnoException.code` for this failure. */\n public readonly code = \"EADDRINUSE\";\n\n public constructor(\n public readonly port: number,\n public readonly host: string,\n ) {\n super(\n `EADDRINUSE: Port ${port} is already in use on ${host}. Stop the dev server (or whatever else is listening on port ${port}) and run again, or start on a free port — e.g. startHttpTestServer({ port: ${port + 1} }).`,\n );\n\n this.name = \"PortInUseError\";\n }\n}\n\n/**\n * Probe a TCP port by attempting a bind and immediately releasing it.\n *\n * @returns `true` when the port is free, `false` when it is taken or the\n * process is not allowed to bind it. Any other bind failure is re-thrown —\n * an unreadable network error must not be reported as \"port in use\".\n */\nexport function isPortAvailable(port: number, host: string = DEFAULT_PROBE_HOST): Promise<boolean> {\n return new Promise((resolve, reject) => {\n const probe = createServer();\n\n probe.unref();\n\n probe.once(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"EADDRINUSE\" || error.code === \"EACCES\") {\n resolve(false);\n\n return;\n }\n\n reject(error);\n });\n\n probe.once(\"listening\", () => {\n probe.close(() => resolve(true));\n });\n\n // `exclusive` refuses a shared bind, which is what makes the probe honest:\n // with load balancing enabled a second bind on a served port can succeed.\n probe.listen({ port, host, exclusive: true });\n });\n}\n\n/**\n * Assert a port is free before something binds it.\n *\n * Run this ahead of the actual `listen()` so a collision surfaces as an\n * instruction the developer can act on, instead of a raw `EADDRINUSE` thrown\n * from deep inside the HTTP stack.\n *\n * @throws {PortInUseError} when the port is taken.\n */\nexport async function assertPortIsAvailable(\n port: number,\n host: string = DEFAULT_PROBE_HOST,\n): Promise<void> {\n // Node cluster workers intentionally share the primary's listener. An\n // exclusive probe rejects that occupied port, blocking rolling reloads.\n // Let the real server.listen() report bind failures in workers instead.\n // https://nodejs.org/api/cluster.html#how-it-works\n if (cluster.isWorker) return;\n\n const available = await isPortAvailable(port, host);\n\n if (!available) {\n throw new PortInUseError(port, host);\n }\n}\n"],"mappings":";;;;;;;AAMA,MAAM,qBAAqB;;;;;;;;;;;;;;AAe3B,IAAa,iBAAb,cAAoC,MAAM;CAIxC,AAAO,YACL,AAAgB,MAChB,AAAgB,MAChB;EACA,MACE,oBAAoB,KAAK,wBAAwB,KAAK,+DAA+D,KAAK,8EAA8E,OAAO,EAAE,KACnN;EALgB;EACA;cAJK;EAUrB,KAAK,OAAO;CACd;AACF;;;;;;;;AASA,SAAgB,gBAAgB,MAAc,OAAe,oBAAsC;CACjG,OAAO,IAAI,SAAS,SAAS,WAAW;EACtC,MAAM,QAAQ,aAAa;EAE3B,MAAM,MAAM;EAEZ,MAAM,KAAK,UAAU,UAAiC;GACpD,IAAI,MAAM,SAAS,gBAAgB,MAAM,SAAS,UAAU;IAC1D,QAAQ,KAAK;IAEb;GACF;GAEA,OAAO,KAAK;EACd,CAAC;EAED,MAAM,KAAK,mBAAmB;GAC5B,MAAM,YAAY,QAAQ,IAAI,CAAC;EACjC,CAAC;EAID,MAAM,OAAO;GAAE;GAAM;GAAM,WAAW;EAAK,CAAC;CAC9C,CAAC;AACH;;;;;;;;;;AAWA,eAAsB,sBACpB,MACA,OAAe,oBACA;CAKf,IAAI,QAAQ,UAAU;CAItB,IAAI,CAAC,MAFmB,gBAAgB,MAAM,IAAI,GAGhD,MAAM,IAAI,eAAe,MAAM,IAAI;AAEvC"}
|
package/esm/index.d.mts
CHANGED
|
@@ -150,6 +150,11 @@ import { decrypt, encrypt } from "./encryption/encrypt.mjs";
|
|
|
150
150
|
import { hmacHash } from "./encryption/hash.mjs";
|
|
151
151
|
import { hashPassword, verifyPassword } from "./encryption/password.mjs";
|
|
152
152
|
import { EncryptionConfigurations, EncryptionPasswordConfigurations } from "./encryption/types.mjs";
|
|
153
|
+
import { SecretStoreError, SecretStoreErrorCode } from "./secrets/errors.mjs";
|
|
154
|
+
import { SecretBackend, SecretStoreOptions, SecretsConfigurations } from "./secrets/types.mjs";
|
|
155
|
+
import { MemorySecretBackend } from "./secrets/memory-backend.mjs";
|
|
156
|
+
import { SecretStore } from "./secrets/secret-store.mjs";
|
|
157
|
+
import { secrets } from "./secrets/secrets.mjs";
|
|
153
158
|
import { ensureFatalIsVisible } from "./logger/fatal-visibility.mjs";
|
|
154
159
|
import { LogConfigurations } from "./logger/types.mjs";
|
|
155
160
|
import { setLogConfigurations } from "./logger/logger.mjs";
|
|
@@ -186,7 +191,7 @@ import "./resource/index.mjs";
|
|
|
186
191
|
import { Restful } from "./restful/restful.mjs";
|
|
187
192
|
import "./restful/index.mjs";
|
|
188
193
|
import { SocketAdapterFactory, SocketOptions } from "./socket/types.mjs";
|
|
189
|
-
import { getSocketServer } from "./socket/utils.mjs";
|
|
194
|
+
import { broadcastSocketEvent, getSocketServer } from "./socket/utils.mjs";
|
|
190
195
|
import "./socket/index.mjs";
|
|
191
196
|
import { RegisteredUseCase, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema } from "./use-cases/types.mjs";
|
|
192
197
|
import { useCase } from "./use-cases/use-case.mjs";
|
|
@@ -227,7 +232,7 @@ import "./warlock-config/index.mjs";
|
|
|
227
232
|
import { env } from "@mongez/dotenv";
|
|
228
233
|
import { colors } from "@mongez/copper";
|
|
229
234
|
export * from "@mongez/localization";
|
|
230
|
-
export { $registerUseCase, $unregisterUseCase, APP_ROLES, AUTH_GUARD_MARKER, AccessConnector, AggregateExpressionInput, AggregateExpressions, AiConnector, AllRepositoryOptions, AppConfigurations, AppRole, Application, AuthDescriptor, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BadRequestError, BadSchemaUseCaseError, BaseCastOutput, BaseConnector, type BenchmarkChannel, type BenchmarkConfigurations, type BenchmarkErrorResult, type BenchmarkOptions, BenchmarkProfiler, type BenchmarkProfilerOptions, type BenchmarkResult, BenchmarkSnapshots, type BenchmarkSnapshotsOptions, type BenchmarkStats, type BenchmarkSuccessResult, BootContext, BootListener, BootSignal, BootSignalType, BootValidator, CLICommand, type CLICommandAction, type CLICommandOption, type CLICommandOptions, type CLICommandPreload, type CLICommandSource, CacheConnector, type CacheMiddlewareOptions, CachedRepositoryOptions, type CapturedMail, CascadeAdapter, CascadeQueryBuilder, CastOutput, ChunkCallback, ClockSource, ClosableServer, CloudDriver, CloudStorageDriverContract, CloudStorageDriverOptions, CloudStorageFileData, type CommandActionData, type ConcurrencyLimitOptions, ConditionalRequestInput, ConditionalRequestOutcome, ConfigIssue, ConfigKey, ConfigKeyRegistry, ConfigModuleEntry, ConfigName, ConfigOf, ConfigRegistry, ConfigSchema, ConfigSchemaOptions, ConfigSpecialHandlers, ConflictError, Connector, ConnectorBuildContext, ConnectorBuildContribution, ConnectorBuildGenerateResult, ConnectorEsbuildPatch, ConnectorLifecyclePhase, ConnectorName, ConnectorPriority, ConnectorsManager, ConsoleChannel, ContainerTypes, CookieJarUnavailableError, CookieOptions, CspConfig, CsrfOriginCheckReason, CsrfOriginVerdict, CursorPaginationOptions, CursorPaginationResult, DEFAULT_CSP_DIRECTIVES, DEFAULT_POSTMAN_BASE_URL, DOSpacesDriver, DatabaseCacheDriver, type DatabaseCacheOptions, DatabaseConnector, DatabaseLog, DatabaseLogModel, DatabaseLogOptions, DecodedAccessToken, DefineResourceOptions, DeleteManyResult, DetectedImageFormat, type DevelopmentAppModuleEntry, type DevelopmentAppModules, type DevelopmentModelModuleEntry, type DevelopmentModelModuleState, type DevelopmentModelModules, DevelopmentPostmanResult, ERROR_CODES, ERROR_CODES_DOCS_URL, EncryptionConfigurations, EncryptionPasswordConfigurations, EntityTag, Environment, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, EventSubscription, ExistsExceptCurrentIdRuleOptions, ExistsExceptCurrentUserRuleOptions, FastifyInstance, FieldOutput, FileNamingStrategy, FileValidationOptions, FileValidator, FileVisibility, FilterFunction, FilterOperator, FilterOptions, FilterRule, FilterRules, ForbiddenError, GenerateImageVariantsOptions, GeneratedImageDescriptor, GeneratedImageVariant, GroupByFields, GroupedRoutesOptions, HealthCheck, HealthStatus, HeraldConnector, HttpConfigurations, HttpConnector, HttpContext, HttpError, HttpErrorCodes, type HttpErrorMapper, type HttpErrorMapping, HttpLoggingConfig, HttpReadyReport, HttpServerOptions, HttpServerRebuiltListener, HttpTracingConfig, type IdempotencyOptions, IdsSource, Image, ImageFormat, ImageInput, ImageTransformCallback, ImageTransformConfig, ImageTransformOptions, ImageVariantDefinition, ImageVariantFit, ImageVariantOutputFormat, ImageVariantsConfigError, InvalidConfigError, InvalidCspDirectiveError, type IpFilterOptions, JavaScriptRuntime, JavaScriptRuntimeName, ListOptions, LocalDriver, LocalStorageDriverOptions, LocaleDictionaryEntries, LocaleDictionaryError, LocalizedObject, LogConfigurations, LoggerConnector, MAIL_EVENTS, Mail, type MailAddress, type MailAttachment, type MailConfigurations, MailError, type MailErrorCode, type MailEvents, type MailMode, type MailOptions, type MailPriority, type MailResult, MailerConnector, type MailersConfig, type MaintenanceOptions, Middleware, MiddlewareResponse, MimeTypes, ModelResourceRegistry, NULLABLE_RESOURCE, NamedApiRoute, NamedApiRoutesOptions, NoopChannel, type NormalizedMail, NotAcceptableError, NotAllowedError, NotificationsConnector, NullableResource, NullableResourceTarget, OPENAPI_JSON_SCHEMA_DIALECT, OpenApiBuildResult, OpenApiComponents, OpenApiContext, OpenApiDocument, OpenApiOperation, OpenApiParameter, OpenApiRequestBody, OpenApiResponse, OpenApiRouteInput, OpenApiSchema, OpenApiSecurityRequirement, OpenApiSecurityScheme, OpenApiValidationResponseConfig, POSTMAN_COLLECTION_SCHEMA, PaginationMode, PaginationResult, ParsedLocaleDictionary, PartialMiddleware, PartialPick, Path, PipeableReactStream, PipelineOptions, PortInUseError, PositionalHandlerSuspect, PostmanAuth, PostmanAuthEntry, PostmanBody, PostmanCollection, PostmanCollectionOptions, PostmanFolder, PostmanFormParam, PostmanHeader, PostmanItem, PostmanOriginalRequest, PostmanQueryParam, PostmanRequest, PostmanRequestItem, PostmanResponse, PostmanUrl, PostmanVariable, PrefixConfig, PrefixOptions, PresignedOptions, PresignedUploadOptions, PrivateRequestLoggingRule, PurgeImageVariantsOptions, PutDirectoryOptions, PutDirectoryResult, PutFromUrlOptions, PutOptions, QueryBuilderContract, Queue, R2Driver, R2StorageDriverOptions, type RateLimitOptions, RegisterConfiguredConnectorsOptions, RegisterResource, RegisteredUseCase, RepositoryAdapterContract, RepositoryConfigurations, RepositoryEvent, RepositoryManager, RepositoryOptions, RepositoryOptionsWithCursor, RepositoryOptionsWithPages, Request, RequestContextStore, RequestController, RequestControllerContract, RequestEvent, RequestHandler, RequestHandlerType, RequestHandlerValidation, RequestLocals, RequestLog, RequestLogSnapshot, RequestLogSource, RequestLoggingOptions, RequestMethod, RequestTranslator, ResolveImageVariantInput, type ResolvedCLICommandOption, ResolvedImageVariant, ResolvedImageVariantsConfig, Resource, ResourceArraySchema, ResourceCastType, ResourceConstructor, ResourceContract, ResourceFieldBuilder, ResourceFieldBuilderDateOutputOptions, ResourceFieldConfig, ResourceMethod, ResourceNotFoundError, ResourceOutput, ResourceOutputOf, ResourceOutputValueCastType, ResourceSchema, ResourceSelfReference, Response, ResponseBodyOutput, ResponseBodyValue, ResponseEvent, ResponseSSEController, ResponseSSEMessageOptions, ResponseSSEOptions, ResponseSchema, ResponseSchemaOutput, ResponseStatus, ResponseStreamController, ResponseStreamOptions, Restful, RestfulMiddleware, ReturnedResponse, Route, RouteNameTakenError, RouteOptions, RouteRateLimitOptions, RouteRegistry, RouteResource, Router, RouterGroupCallback, RouterStacks, RuntimeStrategy, S3Driver, type SESConfigurations, type SMTPConfigurations, SUPPORTED_RUNTIMES_DOCS_URL, SafeFetchOptions, SafeFetchResult, SafeRedirectOptions, SaveAsOptions, SaveMode, SaveOptions, ScopedStorage, ScopedStorageContract, SeedClock, SeedContext, SeedRecordRef, SeedResult, Seeder, SeederDependencyCycleError, SeederMetadata, SendBufferOptions, SendFileOptions, Serialized, SerializedWire, ServerError, ShutdownListener, SocketAdapterFactory, SocketConnector, SocketOptions, StaticMountOptions, Storage, StorageCapabilityError, StorageConfigurations, StorageConnector, StorageCopyEventPayload, StorageDriverConfig, StorageDriverContextStore, StorageDriverContract, StorageDriverName, StorageDriverRegistry, StorageDriverType, StorageError, StorageErrorOptions, StorageEventHandler, StorageEventPayload, StorageEventType, StorageFile, StorageFileData, StorageFileInfo, StorageManagerContract, StorageNotInitializedError, StoragePutEventPayload, StreamReactResponseOptions, TemporaryTokenError, TemporaryTokenPayload, TemporaryTokenValidation, TracingContext, TracingContextSource, TracingHooks, TracingPhaseInfo, TracingRequestEndInfo, Track, TrackableModel, TypedAllRepositoryOptions, TypedRepositoryOptions, TypedRepositoryOptionsWithCursor, TypedRepositoryOptionsWithPages, UPDATE_MANY_BATCH_SIZE, UPLOADS_DEFAULTS, URL_CREDENTIAL_PARAMS, UnAuthorizedError, UniqueExceptCurrentIdRuleOptions, UniqueExceptCurrentUserRuleOptions, UnknownSeederDependencyError, UploadedFile, UploadedFileControllerOptions, UploadedFileImageOptions, UploadedFileJson, UploadedFileQuery, UploadsConfigurations, UploadsImagesConfigurations, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema, ValidationConfiguration, ValidationFailureContext, ValidationFailureHandler, ValidationFailureResponse, ValidationResponseConfiguration, VariantOutputFormat, VariantSourceFormat, WarlockConfig, WarlockConfigManager, WarlockError, WarlockErrorCode, WarningSink, WatermarkConfig, WhereOperator, XMLable, addUseCaseHistory, anyMatch, app, appLog, appPath, applyCspHeader, assertConfiguredHttpPortIsFree, assertMailCount, assertMailSent, assertNoReservedConnectorNames, assertNodeOnlyCommand, assertPortIsAvailable, assertSitesRequireWebRole, assertUniqueConnectorNames, assertValidConfigModules, assetsUrl, beginHttpDrain, bootstrap, broadcastUseCaseResult, buildCspHeaderValue, buildIdempotencyCacheKey, buildOpenApiDocument, buildRequestLogSnapshot, buildTracingContext, cachePath, captureMail, clearPositionalHandlerSuspects, clearTestMailbox, clock, closeAllMailers, closeMailer, closeServerWithTimeout, colors, command, config, configPath, configSpecialHandlers, connectorsManager, container, createHttpApplication, createRequestStore, createUploadedFileController, decrypt, defaultHttpConfigurations, defineConfig, defineConfigSchema, defineResource, deriveTraceId, describeJavaScriptRuntime, describePositionalHandlerSuspect, detectJavaScriptRuntime, dispatchPhase, dispatchRequestEnd, dispatchRequestStart, displayEnvironmentMode, encrypt, ensureFatalIsVisible, env, environment, errorCodeDocsUrl, errorCodeOf, escapeHeaderValue, evaluateConditionalRequest, exampleFromSchema, existsExceptCurrentIdRule, existsExceptCurrentUserRule, explainErrorCode, fetchLatestVersion, fileExtensionRule, fileRule, fileTypeRule, findMailsBySubject, findMailsTo, fireLifecycleEvent, forgetPositionalHandlerSuspects, formatConfigIssues, generateImageVariants, generateMailId, getDefaultMailConfig, getDevelopmentOpenApiDocument, getDevelopmentPostmanCollection, getExplicitMailMode, getHttpReadyReport, getHttpServer, getLastMail, getLocalized, getMailEventName, getMailMode, getMailboxSize, getMailer, getMailerConfig, getMimeType, getPoolStats, getPublicUrl, getRoles, getSites, getSocketServer, getTestMailbox, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, hasRole, hashBody, hashPassword, health, hmacHash, httpConfig, ids, imageRule, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, inspectHandlerSignature, ipMatches, isAllowedCsrfOrigin, isAuthGuardMiddleware, isBootSignal, isConfigSchema, isDevelopmentMode, isNewerVersion, isNullableResource, isPortAvailable, isPrivateOrReservedIp, isProductionMode, isSafeRedirect, isTestMode, isTracingEnabled, isUnguardedMutatingRoute, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, isValidIdempotencyKey, isWarlockErrorCode, listPositionalHandlerSuspects, loadS3, logResponse, logsPath, looksLikePositionalHandler, mailEvents, markAuthGuard, matchesDerivedRouteName, matchesIfMatch, matchesIfNoneMatch, measure, mergeCspDirectives, middleware, nodeOnlyCommandError, normalizeOrigin, normalizeRequestPath, normalizeRoutePath, notifyHttpServerRebuilt, nullable, onHttpServerRebuilt, openApiToPostmanCollection, originOf, ownOrigin, parseEntityTag, parseEntityTagList, parseLocaleDictionary, parseRoles, parseSites, parseSize, parseTraceparentTraceId, paths, preflightConfiguredHttpPort, promiseAllObject, publicPath, publicUrl, purgeImageVariants, redactQueryCredentials, redactUrlCredentials, registerAppConfig, registerConfiguredConnectors, registerDevelopmentOpenApiProvider, registerGroupedTranslationKeys, registerHttpPlugins, registerLocaleDictionary, registerTracingHooks, remedyLines, renderReact, renderReactMail, reportPositionalHandlerSuspects, reportUnguardedMutatingRoutes, requestContext, requestMemo, requiresDefaultCsrfGuard, resetHttpReadyReport, resetMailConfig, resetMailMode, resetRolesCacheForTests, resetTracingConfigForTests, resetUnguardedRouteReports, resolveCspConfig, resolveCsrfOriginVerdict, resolveImageVariant, resolveMailConfig, resolvePublicRoot, resolveRequestLoggingOptions, resolveTracingConfig, resolveWithinRoot, rootPath, routeNameMethodSuffix, router, runDefaultCsrfGuard, runPipeline, safeFetchToBuffer, safeRedirect, sanitizePath, seeder, sendBootSignal, sendMail, serializeCspDirectives, servesHttp, setBaseUrl, setClockSource, setConfig, setEnvironment, setHttpReadyReport, setIdsSource, setLogConfigurations, setMailConfigurations, setMailMode, shouldPreflightHttpPort, sleep, sluggable, srcPath, startHttpServer, stopHttpApplication, storage, storageConfig, storageConfigurations, storageDriverContext, storagePath, streamReactResponse, strongEntityTagMatch, t, tempPath, toJson, toSingleLineSseField, trackConnectionsForDrain, uniqueExceptCurrentIdRule, uniqueExceptCurrentUserRule, unregisterLocaleDictionary, unverifiedBuildRuntimeNotice, uploadedFileController, uploadedFileMetadataSchema, uploadsConfig, uploadsPath, uploadsUrl, url, useCase, useComputedModel, useComputedSlug, useCurrentUser, useHashedPassword, useRequest, useRequestStore, validateConfigValue, validateCspConfigAtBoot, validateCspDirectives, verifyMailer, verifyPassword, warlockConfigManager, warlockPath, wasMailSentTo, wasMailSentWithSubject, weakEntityTagMatch, wrapResponseInDataKey };
|
|
235
|
+
export { $registerUseCase, $unregisterUseCase, APP_ROLES, AUTH_GUARD_MARKER, AccessConnector, AggregateExpressionInput, AggregateExpressions, AiConnector, AllRepositoryOptions, AppConfigurations, AppRole, Application, AuthDescriptor, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BadRequestError, BadSchemaUseCaseError, BaseCastOutput, BaseConnector, type BenchmarkChannel, type BenchmarkConfigurations, type BenchmarkErrorResult, type BenchmarkOptions, BenchmarkProfiler, type BenchmarkProfilerOptions, type BenchmarkResult, BenchmarkSnapshots, type BenchmarkSnapshotsOptions, type BenchmarkStats, type BenchmarkSuccessResult, BootContext, BootListener, BootSignal, BootSignalType, BootValidator, CLICommand, type CLICommandAction, type CLICommandOption, type CLICommandOptions, type CLICommandPreload, type CLICommandSource, CacheConnector, type CacheMiddlewareOptions, CachedRepositoryOptions, type CapturedMail, CascadeAdapter, CascadeQueryBuilder, CastOutput, ChunkCallback, ClockSource, ClosableServer, CloudDriver, CloudStorageDriverContract, CloudStorageDriverOptions, CloudStorageFileData, type CommandActionData, type ConcurrencyLimitOptions, ConditionalRequestInput, ConditionalRequestOutcome, ConfigIssue, ConfigKey, ConfigKeyRegistry, ConfigModuleEntry, ConfigName, ConfigOf, ConfigRegistry, ConfigSchema, ConfigSchemaOptions, ConfigSpecialHandlers, ConflictError, Connector, ConnectorBuildContext, ConnectorBuildContribution, ConnectorBuildGenerateResult, ConnectorEsbuildPatch, ConnectorLifecyclePhase, ConnectorName, ConnectorPriority, ConnectorsManager, ConsoleChannel, ContainerTypes, CookieJarUnavailableError, CookieOptions, CspConfig, CsrfOriginCheckReason, CsrfOriginVerdict, CursorPaginationOptions, CursorPaginationResult, DEFAULT_CSP_DIRECTIVES, DEFAULT_POSTMAN_BASE_URL, DOSpacesDriver, DatabaseCacheDriver, type DatabaseCacheOptions, DatabaseConnector, DatabaseLog, DatabaseLogModel, DatabaseLogOptions, DecodedAccessToken, DefineResourceOptions, DeleteManyResult, DetectedImageFormat, type DevelopmentAppModuleEntry, type DevelopmentAppModules, type DevelopmentModelModuleEntry, type DevelopmentModelModuleState, type DevelopmentModelModules, DevelopmentPostmanResult, ERROR_CODES, ERROR_CODES_DOCS_URL, EncryptionConfigurations, EncryptionPasswordConfigurations, EntityTag, Environment, ErrorCodeArea, ErrorCodeCategory, ErrorCodeDefinition, EventSubscription, ExistsExceptCurrentIdRuleOptions, ExistsExceptCurrentUserRuleOptions, FastifyInstance, FieldOutput, FileNamingStrategy, FileValidationOptions, FileValidator, FileVisibility, FilterFunction, FilterOperator, FilterOptions, FilterRule, FilterRules, ForbiddenError, GenerateImageVariantsOptions, GeneratedImageDescriptor, GeneratedImageVariant, GroupByFields, GroupedRoutesOptions, HealthCheck, HealthStatus, HeraldConnector, HttpConfigurations, HttpConnector, HttpContext, HttpError, HttpErrorCodes, type HttpErrorMapper, type HttpErrorMapping, HttpLoggingConfig, HttpReadyReport, HttpServerOptions, HttpServerRebuiltListener, HttpTracingConfig, type IdempotencyOptions, IdsSource, Image, ImageFormat, ImageInput, ImageTransformCallback, ImageTransformConfig, ImageTransformOptions, ImageVariantDefinition, ImageVariantFit, ImageVariantOutputFormat, ImageVariantsConfigError, InvalidConfigError, InvalidCspDirectiveError, type IpFilterOptions, JavaScriptRuntime, JavaScriptRuntimeName, ListOptions, LocalDriver, LocalStorageDriverOptions, LocaleDictionaryEntries, LocaleDictionaryError, LocalizedObject, LogConfigurations, LoggerConnector, MAIL_EVENTS, Mail, type MailAddress, type MailAttachment, type MailConfigurations, MailError, type MailErrorCode, type MailEvents, type MailMode, type MailOptions, type MailPriority, type MailResult, MailerConnector, type MailersConfig, type MaintenanceOptions, MemorySecretBackend, Middleware, MiddlewareResponse, MimeTypes, ModelResourceRegistry, NULLABLE_RESOURCE, NamedApiRoute, NamedApiRoutesOptions, NoopChannel, type NormalizedMail, NotAcceptableError, NotAllowedError, NotificationsConnector, NullableResource, NullableResourceTarget, OPENAPI_JSON_SCHEMA_DIALECT, OpenApiBuildResult, OpenApiComponents, OpenApiContext, OpenApiDocument, OpenApiOperation, OpenApiParameter, OpenApiRequestBody, OpenApiResponse, OpenApiRouteInput, OpenApiSchema, OpenApiSecurityRequirement, OpenApiSecurityScheme, OpenApiValidationResponseConfig, POSTMAN_COLLECTION_SCHEMA, PaginationMode, PaginationResult, ParsedLocaleDictionary, PartialMiddleware, PartialPick, Path, PipeableReactStream, PipelineOptions, PortInUseError, PositionalHandlerSuspect, PostmanAuth, PostmanAuthEntry, PostmanBody, PostmanCollection, PostmanCollectionOptions, PostmanFolder, PostmanFormParam, PostmanHeader, PostmanItem, PostmanOriginalRequest, PostmanQueryParam, PostmanRequest, PostmanRequestItem, PostmanResponse, PostmanUrl, PostmanVariable, PrefixConfig, PrefixOptions, PresignedOptions, PresignedUploadOptions, PrivateRequestLoggingRule, PurgeImageVariantsOptions, PutDirectoryOptions, PutDirectoryResult, PutFromUrlOptions, PutOptions, QueryBuilderContract, Queue, R2Driver, R2StorageDriverOptions, type RateLimitOptions, RegisterConfiguredConnectorsOptions, RegisterResource, RegisteredUseCase, RepositoryAdapterContract, RepositoryConfigurations, RepositoryEvent, RepositoryManager, RepositoryOptions, RepositoryOptionsWithCursor, RepositoryOptionsWithPages, Request, RequestContextStore, RequestController, RequestControllerContract, RequestEvent, RequestHandler, RequestHandlerType, RequestHandlerValidation, RequestLocals, RequestLog, RequestLogSnapshot, RequestLogSource, RequestLoggingOptions, RequestMethod, RequestTranslator, ResolveImageVariantInput, type ResolvedCLICommandOption, ResolvedImageVariant, ResolvedImageVariantsConfig, Resource, ResourceArraySchema, ResourceCastType, ResourceConstructor, ResourceContract, ResourceFieldBuilder, ResourceFieldBuilderDateOutputOptions, ResourceFieldConfig, ResourceMethod, ResourceNotFoundError, ResourceOutput, ResourceOutputOf, ResourceOutputValueCastType, ResourceSchema, ResourceSelfReference, Response, ResponseBodyOutput, ResponseBodyValue, ResponseEvent, ResponseSSEController, ResponseSSEMessageOptions, ResponseSSEOptions, ResponseSchema, ResponseSchemaOutput, ResponseStatus, ResponseStreamController, ResponseStreamOptions, Restful, RestfulMiddleware, ReturnedResponse, Route, RouteNameTakenError, RouteOptions, RouteRateLimitOptions, RouteRegistry, RouteResource, Router, RouterGroupCallback, RouterStacks, RuntimeStrategy, S3Driver, type SESConfigurations, type SMTPConfigurations, SUPPORTED_RUNTIMES_DOCS_URL, SafeFetchOptions, SafeFetchResult, SafeRedirectOptions, SaveAsOptions, SaveMode, SaveOptions, ScopedStorage, ScopedStorageContract, type SecretBackend, SecretStore, SecretStoreError, SecretStoreErrorCode, type SecretStoreOptions, type SecretsConfigurations, SeedClock, SeedContext, SeedRecordRef, SeedResult, Seeder, SeederDependencyCycleError, SeederMetadata, SendBufferOptions, SendFileOptions, Serialized, SerializedWire, ServerError, ShutdownListener, SocketAdapterFactory, SocketConnector, SocketOptions, StaticMountOptions, Storage, StorageCapabilityError, StorageConfigurations, StorageConnector, StorageCopyEventPayload, StorageDriverConfig, StorageDriverContextStore, StorageDriverContract, StorageDriverName, StorageDriverRegistry, StorageDriverType, StorageError, StorageErrorOptions, StorageEventHandler, StorageEventPayload, StorageEventType, StorageFile, StorageFileData, StorageFileInfo, StorageManagerContract, StorageNotInitializedError, StoragePutEventPayload, StreamReactResponseOptions, TemporaryTokenError, TemporaryTokenPayload, TemporaryTokenValidation, TracingContext, TracingContextSource, TracingHooks, TracingPhaseInfo, TracingRequestEndInfo, Track, TrackableModel, TypedAllRepositoryOptions, TypedRepositoryOptions, TypedRepositoryOptionsWithCursor, TypedRepositoryOptionsWithPages, UPDATE_MANY_BATCH_SIZE, UPLOADS_DEFAULTS, URL_CREDENTIAL_PARAMS, UnAuthorizedError, UniqueExceptCurrentIdRuleOptions, UniqueExceptCurrentUserRuleOptions, UnknownSeederDependencyError, UploadedFile, UploadedFileControllerOptions, UploadedFileImageOptions, UploadedFileJson, UploadedFileQuery, UploadsConfigurations, UploadsImagesConfigurations, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema, ValidationConfiguration, ValidationFailureContext, ValidationFailureHandler, ValidationFailureResponse, ValidationResponseConfiguration, VariantOutputFormat, VariantSourceFormat, WarlockConfig, WarlockConfigManager, WarlockError, WarlockErrorCode, WarningSink, WatermarkConfig, WhereOperator, XMLable, addUseCaseHistory, anyMatch, app, appLog, appPath, applyCspHeader, assertConfiguredHttpPortIsFree, assertMailCount, assertMailSent, assertNoReservedConnectorNames, assertNodeOnlyCommand, assertPortIsAvailable, assertSitesRequireWebRole, assertUniqueConnectorNames, assertValidConfigModules, assetsUrl, beginHttpDrain, bootstrap, broadcastSocketEvent, broadcastUseCaseResult, buildCspHeaderValue, buildIdempotencyCacheKey, buildOpenApiDocument, buildRequestLogSnapshot, buildTracingContext, cachePath, captureMail, clearPositionalHandlerSuspects, clearTestMailbox, clock, closeAllMailers, closeMailer, closeServerWithTimeout, colors, command, config, configPath, configSpecialHandlers, connectorsManager, container, createHttpApplication, createRequestStore, createUploadedFileController, decrypt, defaultHttpConfigurations, defineConfig, defineConfigSchema, defineResource, deriveTraceId, describeJavaScriptRuntime, describePositionalHandlerSuspect, detectJavaScriptRuntime, dispatchPhase, dispatchRequestEnd, dispatchRequestStart, displayEnvironmentMode, encrypt, ensureFatalIsVisible, env, environment, errorCodeDocsUrl, errorCodeOf, escapeHeaderValue, evaluateConditionalRequest, exampleFromSchema, existsExceptCurrentIdRule, existsExceptCurrentUserRule, explainErrorCode, fetchLatestVersion, fileExtensionRule, fileRule, fileTypeRule, findMailsBySubject, findMailsTo, fireLifecycleEvent, forgetPositionalHandlerSuspects, formatConfigIssues, generateImageVariants, generateMailId, getDefaultMailConfig, getDevelopmentOpenApiDocument, getDevelopmentPostmanCollection, getExplicitMailMode, getHttpReadyReport, getHttpServer, getLastMail, getLocalized, getMailEventName, getMailMode, getMailboxSize, getMailer, getMailerConfig, getMimeType, getPoolStats, getPublicUrl, getRoles, getSites, getSocketServer, getTestMailbox, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, hasRole, hashBody, hashPassword, health, hmacHash, httpConfig, ids, imageRule, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, inspectHandlerSignature, ipMatches, isAllowedCsrfOrigin, isAuthGuardMiddleware, isBootSignal, isConfigSchema, isDevelopmentMode, isNewerVersion, isNullableResource, isPortAvailable, isPrivateOrReservedIp, isProductionMode, isSafeRedirect, isTestMode, isTracingEnabled, isUnguardedMutatingRoute, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, isValidIdempotencyKey, isWarlockErrorCode, listPositionalHandlerSuspects, loadS3, logResponse, logsPath, looksLikePositionalHandler, mailEvents, markAuthGuard, matchesDerivedRouteName, matchesIfMatch, matchesIfNoneMatch, measure, mergeCspDirectives, middleware, nodeOnlyCommandError, normalizeOrigin, normalizeRequestPath, normalizeRoutePath, notifyHttpServerRebuilt, nullable, onHttpServerRebuilt, openApiToPostmanCollection, originOf, ownOrigin, parseEntityTag, parseEntityTagList, parseLocaleDictionary, parseRoles, parseSites, parseSize, parseTraceparentTraceId, paths, preflightConfiguredHttpPort, promiseAllObject, publicPath, publicUrl, purgeImageVariants, redactQueryCredentials, redactUrlCredentials, registerAppConfig, registerConfiguredConnectors, registerDevelopmentOpenApiProvider, registerGroupedTranslationKeys, registerHttpPlugins, registerLocaleDictionary, registerTracingHooks, remedyLines, renderReact, renderReactMail, reportPositionalHandlerSuspects, reportUnguardedMutatingRoutes, requestContext, requestMemo, requiresDefaultCsrfGuard, resetHttpReadyReport, resetMailConfig, resetMailMode, resetRolesCacheForTests, resetTracingConfigForTests, resetUnguardedRouteReports, resolveCspConfig, resolveCsrfOriginVerdict, resolveImageVariant, resolveMailConfig, resolvePublicRoot, resolveRequestLoggingOptions, resolveTracingConfig, resolveWithinRoot, rootPath, routeNameMethodSuffix, router, runDefaultCsrfGuard, runPipeline, safeFetchToBuffer, safeRedirect, sanitizePath, secrets, seeder, sendBootSignal, sendMail, serializeCspDirectives, servesHttp, setBaseUrl, setClockSource, setConfig, setEnvironment, setHttpReadyReport, setIdsSource, setLogConfigurations, setMailConfigurations, setMailMode, shouldPreflightHttpPort, sleep, sluggable, srcPath, startHttpServer, stopHttpApplication, storage, storageConfig, storageConfigurations, storageDriverContext, storagePath, streamReactResponse, strongEntityTagMatch, t, tempPath, toJson, toSingleLineSseField, trackConnectionsForDrain, uniqueExceptCurrentIdRule, uniqueExceptCurrentUserRule, unregisterLocaleDictionary, unverifiedBuildRuntimeNotice, uploadedFileController, uploadedFileMetadataSchema, uploadsConfig, uploadsPath, uploadsUrl, url, useCase, useComputedModel, useComputedSlug, useCurrentUser, useHashedPassword, useRequest, useRequestStore, validateConfigValue, validateCspConfigAtBoot, validateCspDirectives, verifyMailer, verifyPassword, warlockConfigManager, warlockPath, wasMailSentTo, wasMailSentWithSubject, weakEntityTagMatch, wrapResponseInDataKey };
|
|
231
236
|
import "./config/types.mjs";
|
|
232
237
|
import "./http/request.mjs";
|
|
233
238
|
import "./http/serialized.mjs";
|
package/esm/index.mjs
CHANGED
|
@@ -160,6 +160,11 @@ import "./database/index.mjs";
|
|
|
160
160
|
import { decrypt, encrypt } from "./encryption/encrypt.mjs";
|
|
161
161
|
import { hmacHash } from "./encryption/hash.mjs";
|
|
162
162
|
import "./encryption/index.mjs";
|
|
163
|
+
import { SecretStoreError } from "./secrets/errors.mjs";
|
|
164
|
+
import { MemorySecretBackend } from "./secrets/memory-backend.mjs";
|
|
165
|
+
import { SecretStore } from "./secrets/secret-store.mjs";
|
|
166
|
+
import { secrets } from "./secrets/secrets.mjs";
|
|
167
|
+
import "./secrets/index.mjs";
|
|
163
168
|
import { ERROR_CODES, ERROR_CODES_DOCS_URL, errorCodeDocsUrl, errorCodeOf, explainErrorCode, isWarlockErrorCode } from "./errors/error-codes.mjs";
|
|
164
169
|
import { LocaleDictionaryError, parseLocaleDictionary } from "./localization/parse-locale-dictionary.mjs";
|
|
165
170
|
import { registerGroupedTranslationKeys, registerLocaleDictionary, unregisterLocaleDictionary } from "./localization/register-locale-dictionary.mjs";
|
|
@@ -181,7 +186,7 @@ import { RegisterResource } from "./resource/register-resource.mjs";
|
|
|
181
186
|
import "./resource/index.mjs";
|
|
182
187
|
import { Restful } from "./restful/restful.mjs";
|
|
183
188
|
import "./restful/index.mjs";
|
|
184
|
-
import { getSocketServer } from "./socket/utils.mjs";
|
|
189
|
+
import { broadcastSocketEvent, getSocketServer } from "./socket/utils.mjs";
|
|
185
190
|
import "./socket/index.mjs";
|
|
186
191
|
import { broadcastUseCaseResult } from "./use-cases/use-case-broadcast.mjs";
|
|
187
192
|
import { fireLifecycleEvent, globalEventsCallbacksMap, globalUseCasesEvents } from "./use-cases/use-case-events.mjs";
|
|
@@ -198,4 +203,4 @@ import { colors } from "@mongez/copper";
|
|
|
198
203
|
|
|
199
204
|
export * from "@mongez/localization"
|
|
200
205
|
|
|
201
|
-
export { $registerUseCase, $unregisterUseCase, APP_ROLES, AUTH_GUARD_MARKER, AccessConnector, AiConnector, Application, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BadRequestError, BadSchemaUseCaseError, BaseConnector, BenchmarkProfiler, BenchmarkSnapshots, CLICommand, CacheConnector, CascadeAdapter, CascadeQueryBuilder, CloudDriver, ConfigSpecialHandlers, ConflictError, ConnectorLifecyclePhase, ConnectorPriority, ConnectorsManager, ConsoleChannel, CookieJarUnavailableError, DEFAULT_CSP_DIRECTIVES, DEFAULT_POSTMAN_BASE_URL, DOSpacesDriver, DatabaseCacheDriver, DatabaseConnector, DatabaseLog, DatabaseLogModel, ERROR_CODES, ERROR_CODES_DOCS_URL, FileValidator, ForbiddenError, HeraldConnector, HttpConnector, HttpError, HttpErrorCodes, Image, ImageVariantsConfigError, InvalidConfigError, InvalidCspDirectiveError, LocalDriver, LocaleDictionaryError, LoggerConnector, MAIL_EVENTS, Mail, MailError, MailerConnector, MimeTypes, NULLABLE_RESOURCE, NoopChannel, NotAcceptableError, NotAllowedError, NotificationsConnector, OPENAPI_JSON_SCHEMA_DIALECT, POSTMAN_COLLECTION_SCHEMA, Path, PortInUseError, Queue, R2Driver, RegisterResource, RepositoryManager, Request, RequestController, RequestLog, Resource, ResourceFieldBuilder, ResourceNotFoundError, Response, ResponseStatus, Restful, RouteNameTakenError, RouteRegistry, Router, S3Driver, SUPPORTED_RUNTIMES_DOCS_URL, ScopedStorage, SeederDependencyCycleError, ServerError, SocketConnector, Storage, StorageCapabilityError, StorageConnector, StorageError, StorageFile, StorageNotInitializedError, UPDATE_MANY_BATCH_SIZE, UPLOADS_DEFAULTS, URL_CREDENTIAL_PARAMS, UnAuthorizedError, UnknownSeederDependencyError, UploadedFile, WarlockConfigManager, WarlockError, addUseCaseHistory, anyMatch, app, appLog, appPath, applyCspHeader, assertConfiguredHttpPortIsFree, assertMailCount, assertMailSent, assertNoReservedConnectorNames, assertNodeOnlyCommand, assertPortIsAvailable, assertSitesRequireWebRole, assertUniqueConnectorNames, assertValidConfigModules, assetsUrl, beginHttpDrain, bootstrap, broadcastUseCaseResult, buildCspHeaderValue, buildIdempotencyCacheKey, buildOpenApiDocument, buildRequestLogSnapshot, buildTracingContext, cachePath, captureMail, clearPositionalHandlerSuspects, clearTestMailbox, clock, closeAllMailers, closeMailer, closeServerWithTimeout, colors, command, config, configPath, configSpecialHandlers, connectorsManager, container, createHttpApplication, createRequestStore, createUploadedFileController, decrypt, defaultHttpConfigurations, defineConfig, defineConfigSchema, defineResource, deriveTraceId, describeJavaScriptRuntime, describePositionalHandlerSuspect, detectJavaScriptRuntime, dispatchPhase, dispatchRequestEnd, dispatchRequestStart, displayEnvironmentMode, encrypt, ensureFatalIsVisible, env, environment, errorCodeDocsUrl, errorCodeOf, escapeHeaderValue, evaluateConditionalRequest, exampleFromSchema, existsExceptCurrentIdRule, existsExceptCurrentUserRule, explainErrorCode, fetchLatestVersion, fileExtensionRule, fileRule, fileTypeRule, findMailsBySubject, findMailsTo, fireLifecycleEvent, forgetPositionalHandlerSuspects, formatConfigIssues, generateImageVariants, generateMailId, getDefaultMailConfig, getDevelopmentOpenApiDocument, getDevelopmentPostmanCollection, getExplicitMailMode, getHttpReadyReport, getHttpServer, getLastMail, getLocalized, getMailEventName, getMailMode, getMailboxSize, getMailer, getMailerConfig, getMimeType, getPoolStats, getPublicUrl, getRoles, getSites, getSocketServer, getTestMailbox, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, hasRole, hashBody, hashPassword, health, hmacHash, httpConfig, ids, imageRule, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, inspectHandlerSignature, ipMatches, isAllowedCsrfOrigin, isAuthGuardMiddleware, isBootSignal, isConfigSchema, isDevelopmentMode, isNewerVersion, isNullableResource, isPortAvailable, isPrivateOrReservedIp, isProductionMode, isSafeRedirect, isTestMode, isTracingEnabled, isUnguardedMutatingRoute, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, isValidIdempotencyKey, isWarlockErrorCode, listPositionalHandlerSuspects, loadS3, logResponse, logsPath, looksLikePositionalHandler, mailEvents, markAuthGuard, matchesDerivedRouteName, matchesIfMatch, matchesIfNoneMatch, measure, mergeCspDirectives, middleware, nodeOnlyCommandError, normalizeOrigin, normalizeRequestPath, normalizeRoutePath, notifyHttpServerRebuilt, nullable, onHttpServerRebuilt, openApiToPostmanCollection, originOf, ownOrigin, parseEntityTag, parseEntityTagList, parseLocaleDictionary, parseRoles, parseSites, parseSize, parseTraceparentTraceId, paths, preflightConfiguredHttpPort, promiseAllObject, publicPath, publicUrl, purgeImageVariants, redactQueryCredentials, redactUrlCredentials, registerAppConfig, registerConfiguredConnectors, registerDevelopmentOpenApiProvider, registerGroupedTranslationKeys, registerHttpPlugins, registerLocaleDictionary, registerTracingHooks, remedyLines, renderReact, renderReactMail, reportPositionalHandlerSuspects, reportUnguardedMutatingRoutes, requestContext, requestMemo, requiresDefaultCsrfGuard, resetHttpReadyReport, resetMailConfig, resetMailMode, resetRolesCacheForTests, resetTracingConfigForTests, resetUnguardedRouteReports, resolveCspConfig, resolveCsrfOriginVerdict, resolveImageVariant, resolveMailConfig, resolvePublicRoot, resolveRequestLoggingOptions, resolveTracingConfig, resolveWithinRoot, rootPath, routeNameMethodSuffix, router, runDefaultCsrfGuard, runPipeline, safeFetchToBuffer, safeRedirect, sanitizePath, seeder, sendBootSignal, sendMail, serializeCspDirectives, servesHttp, setBaseUrl, setClockSource, setConfig, setEnvironment, setHttpReadyReport, setIdsSource, setLogConfigurations, setMailConfigurations, setMailMode, shouldPreflightHttpPort, sleep, sluggable, srcPath, startHttpServer, stopHttpApplication, storage, storageConfig, storageConfigurations, storageDriverContext, storagePath, streamReactResponse, strongEntityTagMatch, t, tempPath, toJson, toSingleLineSseField, trackConnectionsForDrain, uniqueExceptCurrentIdRule, uniqueExceptCurrentUserRule, unregisterLocaleDictionary, unverifiedBuildRuntimeNotice, uploadedFileController, uploadedFileMetadataSchema, uploadsConfig, uploadsPath, uploadsUrl, url, useCase, useComputedModel, useComputedSlug, useCurrentUser, useHashedPassword, useRequest, useRequestStore, validateConfigValue, validateCspConfigAtBoot, validateCspDirectives, verifyMailer, verifyPassword, warlockConfigManager, warlockPath, wasMailSentTo, wasMailSentWithSubject, weakEntityTagMatch, wrapResponseInDataKey };
|
|
206
|
+
export { $registerUseCase, $unregisterUseCase, APP_ROLES, AUTH_GUARD_MARKER, AccessConnector, AiConnector, Application, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BadRequestError, BadSchemaUseCaseError, BaseConnector, BenchmarkProfiler, BenchmarkSnapshots, CLICommand, CacheConnector, CascadeAdapter, CascadeQueryBuilder, CloudDriver, ConfigSpecialHandlers, ConflictError, ConnectorLifecyclePhase, ConnectorPriority, ConnectorsManager, ConsoleChannel, CookieJarUnavailableError, DEFAULT_CSP_DIRECTIVES, DEFAULT_POSTMAN_BASE_URL, DOSpacesDriver, DatabaseCacheDriver, DatabaseConnector, DatabaseLog, DatabaseLogModel, ERROR_CODES, ERROR_CODES_DOCS_URL, FileValidator, ForbiddenError, HeraldConnector, HttpConnector, HttpError, HttpErrorCodes, Image, ImageVariantsConfigError, InvalidConfigError, InvalidCspDirectiveError, LocalDriver, LocaleDictionaryError, LoggerConnector, MAIL_EVENTS, Mail, MailError, MailerConnector, MemorySecretBackend, MimeTypes, NULLABLE_RESOURCE, NoopChannel, NotAcceptableError, NotAllowedError, NotificationsConnector, OPENAPI_JSON_SCHEMA_DIALECT, POSTMAN_COLLECTION_SCHEMA, Path, PortInUseError, Queue, R2Driver, RegisterResource, RepositoryManager, Request, RequestController, RequestLog, Resource, ResourceFieldBuilder, ResourceNotFoundError, Response, ResponseStatus, Restful, RouteNameTakenError, RouteRegistry, Router, S3Driver, SUPPORTED_RUNTIMES_DOCS_URL, ScopedStorage, SecretStore, SecretStoreError, SeederDependencyCycleError, ServerError, SocketConnector, Storage, StorageCapabilityError, StorageConnector, StorageError, StorageFile, StorageNotInitializedError, UPDATE_MANY_BATCH_SIZE, UPLOADS_DEFAULTS, URL_CREDENTIAL_PARAMS, UnAuthorizedError, UnknownSeederDependencyError, UploadedFile, WarlockConfigManager, WarlockError, addUseCaseHistory, anyMatch, app, appLog, appPath, applyCspHeader, assertConfiguredHttpPortIsFree, assertMailCount, assertMailSent, assertNoReservedConnectorNames, assertNodeOnlyCommand, assertPortIsAvailable, assertSitesRequireWebRole, assertUniqueConnectorNames, assertValidConfigModules, assetsUrl, beginHttpDrain, bootstrap, broadcastSocketEvent, broadcastUseCaseResult, buildCspHeaderValue, buildIdempotencyCacheKey, buildOpenApiDocument, buildRequestLogSnapshot, buildTracingContext, cachePath, captureMail, clearPositionalHandlerSuspects, clearTestMailbox, clock, closeAllMailers, closeMailer, closeServerWithTimeout, colors, command, config, configPath, configSpecialHandlers, connectorsManager, container, createHttpApplication, createRequestStore, createUploadedFileController, decrypt, defaultHttpConfigurations, defineConfig, defineConfigSchema, defineResource, deriveTraceId, describeJavaScriptRuntime, describePositionalHandlerSuspect, detectJavaScriptRuntime, dispatchPhase, dispatchRequestEnd, dispatchRequestStart, displayEnvironmentMode, encrypt, ensureFatalIsVisible, env, environment, errorCodeDocsUrl, errorCodeOf, escapeHeaderValue, evaluateConditionalRequest, exampleFromSchema, existsExceptCurrentIdRule, existsExceptCurrentUserRule, explainErrorCode, fetchLatestVersion, fileExtensionRule, fileRule, fileTypeRule, findMailsBySubject, findMailsTo, fireLifecycleEvent, forgetPositionalHandlerSuspects, formatConfigIssues, generateImageVariants, generateMailId, getDefaultMailConfig, getDevelopmentOpenApiDocument, getDevelopmentPostmanCollection, getExplicitMailMode, getHttpReadyReport, getHttpServer, getLastMail, getLocalized, getMailEventName, getMailMode, getMailboxSize, getMailer, getMailerConfig, getMimeType, getPoolStats, getPublicUrl, getRoles, getSites, getSocketServer, getTestMailbox, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, hasRole, hashBody, hashPassword, health, hmacHash, httpConfig, ids, imageRule, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, inspectHandlerSignature, ipMatches, isAllowedCsrfOrigin, isAuthGuardMiddleware, isBootSignal, isConfigSchema, isDevelopmentMode, isNewerVersion, isNullableResource, isPortAvailable, isPrivateOrReservedIp, isProductionMode, isSafeRedirect, isTestMode, isTracingEnabled, isUnguardedMutatingRoute, isUnknownTsExtensionError, isUnresolvedConfigImportError, isUnsupportedTypeStrippingError, isValidIdempotencyKey, isWarlockErrorCode, listPositionalHandlerSuspects, loadS3, logResponse, logsPath, looksLikePositionalHandler, mailEvents, markAuthGuard, matchesDerivedRouteName, matchesIfMatch, matchesIfNoneMatch, measure, mergeCspDirectives, middleware, nodeOnlyCommandError, normalizeOrigin, normalizeRequestPath, normalizeRoutePath, notifyHttpServerRebuilt, nullable, onHttpServerRebuilt, openApiToPostmanCollection, originOf, ownOrigin, parseEntityTag, parseEntityTagList, parseLocaleDictionary, parseRoles, parseSites, parseSize, parseTraceparentTraceId, paths, preflightConfiguredHttpPort, promiseAllObject, publicPath, publicUrl, purgeImageVariants, redactQueryCredentials, redactUrlCredentials, registerAppConfig, registerConfiguredConnectors, registerDevelopmentOpenApiProvider, registerGroupedTranslationKeys, registerHttpPlugins, registerLocaleDictionary, registerTracingHooks, remedyLines, renderReact, renderReactMail, reportPositionalHandlerSuspects, reportUnguardedMutatingRoutes, requestContext, requestMemo, requiresDefaultCsrfGuard, resetHttpReadyReport, resetMailConfig, resetMailMode, resetRolesCacheForTests, resetTracingConfigForTests, resetUnguardedRouteReports, resolveCspConfig, resolveCsrfOriginVerdict, resolveImageVariant, resolveMailConfig, resolvePublicRoot, resolveRequestLoggingOptions, resolveTracingConfig, resolveWithinRoot, rootPath, routeNameMethodSuffix, router, runDefaultCsrfGuard, runPipeline, safeFetchToBuffer, safeRedirect, sanitizePath, secrets, seeder, sendBootSignal, sendMail, serializeCspDirectives, servesHttp, setBaseUrl, setClockSource, setConfig, setEnvironment, setHttpReadyReport, setIdsSource, setLogConfigurations, setMailConfigurations, setMailMode, shouldPreflightHttpPort, sleep, sluggable, srcPath, startHttpServer, stopHttpApplication, storage, storageConfig, storageConfigurations, storageDriverContext, storagePath, streamReactResponse, strongEntityTagMatch, t, tempPath, toJson, toSingleLineSseField, trackConnectionsForDrain, uniqueExceptCurrentIdRule, uniqueExceptCurrentUserRule, unregisterLocaleDictionary, unverifiedBuildRuntimeNotice, uploadedFileController, uploadedFileMetadataSchema, uploadsConfig, uploadsPath, uploadsUrl, url, useCase, useComputedModel, useComputedSlug, useCurrentUser, useHashedPassword, useRequest, useRequestStore, validateConfigValue, validateCspConfigAtBoot, validateCspDirectives, verifyMailer, verifyPassword, warlockConfigManager, warlockPath, wasMailSentTo, wasMailSentWithSubject, weakEntityTagMatch, wrapResponseInDataKey };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region ../../packages/core/src/secrets/errors.d.ts
|
|
2
|
+
export type SecretStoreErrorCode = "INVALID_DRIVER" | "MEMORY_IN_PRODUCTION" | "INVALID_NAME" | "INVALID_VALUE" | "INVALID_NAMESPACE" | "READ_ONLY" | "KEY_REQUIRED" | "UNAVAILABLE" | "UNSAFE_FILE" | "CORRUPT_FILE";
|
|
3
|
+
/** Safe to log: never carries names, values, paths, or vendor error causes. */
|
|
4
|
+
export declare class SecretStoreError extends Error {
|
|
5
|
+
readonly code: SecretStoreErrorCode;
|
|
6
|
+
constructor(code: SecretStoreErrorCode);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//# sourceMappingURL=errors.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/secrets/errors.ts"],"mappings":";YAAY;;qBAaC,yBAAyB;WACD,MAAM;EAAzC,YAAmC,MAAM"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../../packages/core/src/secrets/errors.ts
|
|
2
|
+
/** Safe to log: never carries names, values, paths, or vendor error causes. */
|
|
3
|
+
var SecretStoreError = class extends Error {
|
|
4
|
+
constructor(code) {
|
|
5
|
+
super({
|
|
6
|
+
INVALID_DRIVER: "secrets.driver / SECRETS_DRIVER must be auto or memory.",
|
|
7
|
+
MEMORY_IN_PRODUCTION: "The memory secrets driver requires secrets.allowMemoryInProduction: true when NODE_ENV=production.",
|
|
8
|
+
INVALID_NAME: "Secret names must be valid Unicode strings of 1 to 256 UTF-16 code units.",
|
|
9
|
+
INVALID_VALUE: "Secret values must be strings.",
|
|
10
|
+
INVALID_NAMESPACE: "A nonempty secret store namespace is required.",
|
|
11
|
+
READ_ONLY: "This secret is supplied by a read-only environment variable.",
|
|
12
|
+
KEY_REQUIRED: "File secrets require encryption.key: exactly 64 hexadecimal characters.",
|
|
13
|
+
UNAVAILABLE: "The selected secret backend is unavailable. No unsafe write was attempted.",
|
|
14
|
+
UNSAFE_FILE: "Secret storage must use an owned, private directory and regular files.",
|
|
15
|
+
CORRUPT_FILE: "A secret file could not be authenticated. Check the app key and restore a backup."
|
|
16
|
+
}[code]);
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.name = "SecretStoreError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SecretStoreError };
|
|
24
|
+
//# sourceMappingURL=errors.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../../../../../../packages/core/src/secrets/errors.ts"],"sourcesContent":["export type SecretStoreErrorCode =\n | \"INVALID_DRIVER\"\n | \"MEMORY_IN_PRODUCTION\"\n | \"INVALID_NAME\"\n | \"INVALID_VALUE\"\n | \"INVALID_NAMESPACE\"\n | \"READ_ONLY\"\n | \"KEY_REQUIRED\"\n | \"UNAVAILABLE\"\n | \"UNSAFE_FILE\"\n | \"CORRUPT_FILE\";\n\n/** Safe to log: never carries names, values, paths, or vendor error causes. */\nexport class SecretStoreError extends Error {\n public constructor(public readonly code: SecretStoreErrorCode) {\n super(\n {\n INVALID_DRIVER: \"secrets.driver / SECRETS_DRIVER must be auto or memory.\",\n MEMORY_IN_PRODUCTION:\n \"The memory secrets driver requires secrets.allowMemoryInProduction: true when NODE_ENV=production.\",\n INVALID_NAME: \"Secret names must be valid Unicode strings of 1 to 256 UTF-16 code units.\",\n INVALID_VALUE: \"Secret values must be strings.\",\n INVALID_NAMESPACE: \"A nonempty secret store namespace is required.\",\n READ_ONLY: \"This secret is supplied by a read-only environment variable.\",\n KEY_REQUIRED: \"File secrets require encryption.key: exactly 64 hexadecimal characters.\",\n UNAVAILABLE: \"The selected secret backend is unavailable. No unsafe write was attempted.\",\n UNSAFE_FILE: \"Secret storage must use an owned, private directory and regular files.\",\n CORRUPT_FILE:\n \"A secret file could not be authenticated. Check the app key and restore a backup.\",\n }[code],\n );\n this.name = \"SecretStoreError\";\n }\n}\n"],"mappings":";;AAaA,IAAa,mBAAb,cAAsC,MAAM;CAC1C,AAAO,YAAY,AAAgB,MAA4B;EAC7D,MACE;GACE,gBAAgB;GAChB,sBACE;GACF,cAAc;GACd,eAAe;GACf,mBAAmB;GACnB,WAAW;GACX,cAAc;GACd,aAAa;GACb,aAAa;GACb,cACE;EACJ,EAAE,KACJ;EAhBiC;EAiBjC,KAAK,OAAO;CACd;AACF"}
|