cdom 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codacy/codacy.yaml +15 -0
- package/.github/instructions/codacy.instructions.md +72 -0
- package/.wrangler/tmp/bundle-AF2XYW/checked-fetch.js +30 -0
- package/.wrangler/tmp/bundle-AF2XYW/middleware-insertion-facade.js +11 -0
- package/.wrangler/tmp/bundle-AF2XYW/middleware-loader.entry.ts +134 -0
- package/.wrangler/tmp/dev-CcfZyg/pages-shim.js +252 -0
- package/.wrangler/tmp/dev-CcfZyg/pages-shim.js.map +8 -0
- package/.wrangler/tmp/dev-CdN289/pages-shim.js +252 -0
- package/.wrangler/tmp/dev-CdN289/pages-shim.js.map +8 -0
- package/LICENSE +21 -0
- package/README.md +607 -0
- package/build.js +66 -0
- package/examples/dashboard.css +199 -0
- package/examples/dashboard.html +219 -0
- package/examples/persistence_test.html +91 -0
- package/examples/scratch.html +72 -0
- package/examples/spreadsheet.cdom +466 -0
- package/examples/spreadsheet.css +221 -0
- package/examples/spreadsheet.html +36 -0
- package/helpers/abs.js +3 -0
- package/helpers/add.js +2 -0
- package/helpers/and.js +3 -0
- package/helpers/assign.js +6 -0
- package/helpers/average.js +5 -0
- package/helpers/avg.js +2 -0
- package/helpers/ceil.js +3 -0
- package/helpers/ceiling.js +2 -0
- package/helpers/charat.js +3 -0
- package/helpers/choose.js +4 -0
- package/helpers/clear.js +7 -0
- package/helpers/coalesce.js +6 -0
- package/helpers/concat.js +3 -0
- package/helpers/count.js +3 -0
- package/helpers/currency.js +4 -0
- package/helpers/datedif.js +13 -0
- package/helpers/datediff.js +13 -0
- package/helpers/day.js +3 -0
- package/helpers/decrement.js +7 -0
- package/helpers/divide.js +6 -0
- package/helpers/endswith.js +3 -0
- package/helpers/eq.js +3 -0
- package/helpers/every.js +3 -0
- package/helpers/fetch.js +20 -0
- package/helpers/filter.js +3 -0
- package/helpers/find.js +3 -0
- package/helpers/findindex.js +3 -0
- package/helpers/first.js +3 -0
- package/helpers/fixed.js +2 -0
- package/helpers/flat.js +3 -0
- package/helpers/floor.js +3 -0
- package/helpers/gt.js +3 -0
- package/helpers/if.js +3 -0
- package/helpers/iferror.js +2 -0
- package/helpers/ifs.js +6 -0
- package/helpers/includes.js +6 -0
- package/helpers/increment.js +7 -0
- package/helpers/index.js +5 -0
- package/helpers/int.js +2 -0
- package/helpers/isarray.js +3 -0
- package/helpers/isblank.js +3 -0
- package/helpers/isempty.js +5 -0
- package/helpers/isnumber.js +3 -0
- package/helpers/isstring.js +2 -0
- package/helpers/istext.js +3 -0
- package/helpers/join.js +3 -0
- package/helpers/keys.js +3 -0
- package/helpers/last.js +3 -0
- package/helpers/left.js +4 -0
- package/helpers/len.js +2 -0
- package/helpers/length.js +5 -0
- package/helpers/lower.js +2 -0
- package/helpers/lt.js +3 -0
- package/helpers/map.js +3 -0
- package/helpers/match.js +2 -0
- package/helpers/max.js +4 -0
- package/helpers/median.js +6 -0
- package/helpers/mid.js +10 -0
- package/helpers/min.js +4 -0
- package/helpers/month.js +3 -0
- package/helpers/multiply.js +3 -0
- package/helpers/not.js +3 -0
- package/helpers/now.js +3 -0
- package/helpers/or.js +3 -0
- package/helpers/padend.js +3 -0
- package/helpers/padstart.js +3 -0
- package/helpers/percent.js +4 -0
- package/helpers/pop.js +9 -0
- package/helpers/pow.js +3 -0
- package/helpers/power.js +2 -0
- package/helpers/proper.js +2 -0
- package/helpers/push.js +9 -0
- package/helpers/rand.js +2 -0
- package/helpers/random.js +3 -0
- package/helpers/replace.js +3 -0
- package/helpers/reverse.js +4 -0
- package/helpers/right.js +4 -0
- package/helpers/round.js +5 -0
- package/helpers/set.js +10 -0
- package/helpers/sign.js +3 -0
- package/helpers/slice.js +6 -0
- package/helpers/some.js +3 -0
- package/helpers/sort.js +4 -0
- package/helpers/split.js +3 -0
- package/helpers/sqrt.js +3 -0
- package/helpers/startswith.js +3 -0
- package/helpers/stddev.js +4 -0
- package/helpers/stdev.js +2 -0
- package/helpers/substitute.js +2 -0
- package/helpers/substring.js +3 -0
- package/helpers/subtract.js +6 -0
- package/helpers/sum.js +3 -0
- package/helpers/switch.js +6 -0
- package/helpers/text.js +2 -0
- package/helpers/textjoin.js +4 -0
- package/helpers/titlecase.js +3 -0
- package/helpers/tocamelcase.js +7 -0
- package/helpers/today.js +5 -0
- package/helpers/tofixed.js +3 -0
- package/helpers/toggle.js +6 -0
- package/helpers/tolocalestring.js +3 -0
- package/helpers/tolowercase.js +3 -0
- package/helpers/toslugcase.js +7 -0
- package/helpers/touppercase.js +3 -0
- package/helpers/trim.js +3 -0
- package/helpers/trunc.js +3 -0
- package/helpers/unique.js +3 -0
- package/helpers/upper.js +2 -0
- package/helpers/var.js +2 -0
- package/helpers/variance.js +6 -0
- package/helpers/webservice.js +2 -0
- package/helpers/weekday.js +3 -0
- package/helpers/xlookup.js +5 -0
- package/helpers/year.js +3 -0
- package/index.js +1291 -0
- package/package.json +37 -0
- package/wrangler.toml +16 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Configuration for AI behavior when interacting with Codacy's MCP Server
|
|
3
|
+
applyTo: '**'
|
|
4
|
+
---
|
|
5
|
+
---
|
|
6
|
+
# Codacy Rules
|
|
7
|
+
Configuration for AI behavior when interacting with Codacy's MCP Server
|
|
8
|
+
|
|
9
|
+
## CRITICAL: After ANY successful `edit_file` or `reapply` operation
|
|
10
|
+
- YOU MUST IMMEDIATELY run the `codacy_cli_analyze` tool from Codacy's MCP Server for each file that was edited, with:
|
|
11
|
+
- `rootPath`: set to the workspace path
|
|
12
|
+
- `file`: set to the path of the edited file
|
|
13
|
+
- `tool`: leave empty or unset
|
|
14
|
+
- If any issues are found in the new edits, propose and apply fixes for them.
|
|
15
|
+
- > NOTE: Failure to follow this rule is considered a critical error.
|
|
16
|
+
|
|
17
|
+
## When you tried to run the `codacy_cli_analyze` tool and the Codacy CLI is not installed
|
|
18
|
+
- Ask the user 'Codacy CLI is not installed. Would you like me to install it now?'
|
|
19
|
+
- If the user responds with "yes", run the `codacy_cli_install` tool and then continue with the original task
|
|
20
|
+
- If the user responds with "no", instruct the user that they can disable automatic analysis in the extension settings
|
|
21
|
+
- Wait for the user to respond before proceeding with any other actions
|
|
22
|
+
|
|
23
|
+
## After every response
|
|
24
|
+
- If you made any file edits in this conversation, verify you ran `codacy_cli_analyze` tool from Codacy's MCP Server
|
|
25
|
+
|
|
26
|
+
## When there are no Codacy MCP Server tools available, or the MCP Server is not reachable
|
|
27
|
+
- Suggest the user the following troubleshooting steps:
|
|
28
|
+
- Try to reset the MCP on the extension
|
|
29
|
+
- If the user is using VSCode, suggest them to review their Copilot > MCP settings in Github, under their organization or personal account. Refer them to Settings > Copilot > Enable MCP servers in Copilot. Suggested URL (https://github.com/settings/copilot/features) or https://github.com/organizations/{organization-name}/settings/copilot/features (This can only be done by their organization admins / owners)
|
|
30
|
+
- If none of the above steps work, suggest the user to contact Codacy support
|
|
31
|
+
|
|
32
|
+
## Trying to call a tool that needs a rootPath as a parameter
|
|
33
|
+
- Always use the standard, non-URL-encoded file system path
|
|
34
|
+
|
|
35
|
+
## CRITICAL: Dependencies and Security Checks
|
|
36
|
+
- IMMEDIATELY after ANY of these actions:
|
|
37
|
+
- Running npm/yarn/pnpm install
|
|
38
|
+
- Adding dependencies to package.json
|
|
39
|
+
- Adding requirements to requirements.txt
|
|
40
|
+
- Adding dependencies to pom.xml
|
|
41
|
+
- Adding dependencies to build.gradle
|
|
42
|
+
- Any other package manager operations
|
|
43
|
+
- You MUST run the `codacy_cli_analyze` tool with:
|
|
44
|
+
- `rootPath`: set to the workspace path
|
|
45
|
+
- `tool`: set to "trivy"
|
|
46
|
+
- `file`: leave empty or unset
|
|
47
|
+
- If any vulnerabilities are found because of the newly added packages:
|
|
48
|
+
- Stop all other operations
|
|
49
|
+
- Propose and apply fixes for the security issues
|
|
50
|
+
- Only continue with the original task after security issues are resolved
|
|
51
|
+
- EXAMPLE:
|
|
52
|
+
- After: npm install react-markdown
|
|
53
|
+
- Do: Run codacy_cli_analyze with trivy
|
|
54
|
+
- Before: Continuing with any other tasks
|
|
55
|
+
|
|
56
|
+
## General
|
|
57
|
+
- Repeat the relevant steps for each modified file.
|
|
58
|
+
- "Propose fixes" means to both suggest and, if possible, automatically apply the fixes.
|
|
59
|
+
- You MUST NOT wait for the user to ask for analysis or remind you to run the tool.
|
|
60
|
+
- Do not run `codacy_cli_analyze` looking for changes in duplicated code or code complexity metrics.
|
|
61
|
+
- Complexity metrics are different from complexity issues. When trying to fix complexity in a repository or file, focus on solving the complexity issues and ignore the complexity metric.
|
|
62
|
+
- Do not run `codacy_cli_analyze` looking for changes in code coverage.
|
|
63
|
+
- Do not try to manually install Codacy CLI using either brew, npm, npx, or any other package manager.
|
|
64
|
+
- If the Codacy CLI is not installed, just run the `codacy_cli_analyze` tool from Codacy's MCP Server.
|
|
65
|
+
- When calling `codacy_cli_analyze`, only send provider, organization and repository if the project is a git repository.
|
|
66
|
+
|
|
67
|
+
## Whenever a call to a Codacy tool that uses `repository` or `organization` as a parameter returns a 404 error
|
|
68
|
+
- Offer to run the `codacy_setup_repository` tool to add the repository to Codacy
|
|
69
|
+
- If the user accepts, run the `codacy_setup_repository` tool
|
|
70
|
+
- Do not ever try to run the `codacy_setup_repository` tool on your own
|
|
71
|
+
- After setup, immediately retry the action that failed (only retry once)
|
|
72
|
+
---
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const urls = new Set();
|
|
2
|
+
|
|
3
|
+
function checkURL(request, init) {
|
|
4
|
+
const url =
|
|
5
|
+
request instanceof URL
|
|
6
|
+
? request
|
|
7
|
+
: new URL(
|
|
8
|
+
(typeof request === "string"
|
|
9
|
+
? new Request(request, init)
|
|
10
|
+
: request
|
|
11
|
+
).url
|
|
12
|
+
);
|
|
13
|
+
if (url.port && url.port !== "443" && url.protocol === "https:") {
|
|
14
|
+
if (!urls.has(url.toString())) {
|
|
15
|
+
urls.add(url.toString());
|
|
16
|
+
console.warn(
|
|
17
|
+
`WARNING: known issue with \`fetch()\` requests to custom HTTPS ports in published Workers:\n` +
|
|
18
|
+
` - ${url.toString()} - the custom port will be ignored when the Worker is published using the \`wrangler deploy\` command.\n`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
globalThis.fetch = new Proxy(globalThis.fetch, {
|
|
25
|
+
apply(target, thisArg, argArray) {
|
|
26
|
+
const [request, init] = argArray;
|
|
27
|
+
checkURL(request, init);
|
|
28
|
+
return Reflect.apply(target, thisArg, argArray);
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import worker, * as OTHER_EXPORTS from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\node_modules\\wrangler\\templates\\pages-shim.ts";
|
|
2
|
+
import * as __MIDDLEWARE_0__ from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\node_modules\\wrangler\\templates\\middleware\\middleware-ensure-req-body-drained.ts";
|
|
3
|
+
import * as __MIDDLEWARE_1__ from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\node_modules\\wrangler\\templates\\middleware\\middleware-miniflare3-json-error.ts";
|
|
4
|
+
|
|
5
|
+
export * from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\node_modules\\wrangler\\templates\\pages-shim.ts";
|
|
6
|
+
const MIDDLEWARE_TEST_INJECT = "__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__";
|
|
7
|
+
export const __INTERNAL_WRANGLER_MIDDLEWARE__ = [
|
|
8
|
+
|
|
9
|
+
__MIDDLEWARE_0__.default,__MIDDLEWARE_1__.default
|
|
10
|
+
]
|
|
11
|
+
export default worker;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// This loads all middlewares exposed on the middleware object and then starts
|
|
2
|
+
// the invocation chain. The big idea is that we can add these to the middleware
|
|
3
|
+
// export dynamically through wrangler, or we can potentially let users directly
|
|
4
|
+
// add them as a sort of "plugin" system.
|
|
5
|
+
|
|
6
|
+
import ENTRY, { __INTERNAL_WRANGLER_MIDDLEWARE__ } from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\.wrangler\\tmp\\bundle-AF2XYW\\middleware-insertion-facade.js";
|
|
7
|
+
import { __facade_invoke__, __facade_register__, Dispatcher } from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\node_modules\\wrangler\\templates\\middleware\\common.ts";
|
|
8
|
+
import type { WorkerEntrypointConstructor } from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\.wrangler\\tmp\\bundle-AF2XYW\\middleware-insertion-facade.js";
|
|
9
|
+
|
|
10
|
+
// Preserve all the exports from the worker
|
|
11
|
+
export * from "C:\\Users\\Owner\\AntigravityProjects\\cdom\\.wrangler\\tmp\\bundle-AF2XYW\\middleware-insertion-facade.js";
|
|
12
|
+
|
|
13
|
+
class __Facade_ScheduledController__ implements ScheduledController {
|
|
14
|
+
readonly #noRetry: ScheduledController["noRetry"];
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
readonly scheduledTime: number,
|
|
18
|
+
readonly cron: string,
|
|
19
|
+
noRetry: ScheduledController["noRetry"]
|
|
20
|
+
) {
|
|
21
|
+
this.#noRetry = noRetry;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
noRetry() {
|
|
25
|
+
if (!(this instanceof __Facade_ScheduledController__)) {
|
|
26
|
+
throw new TypeError("Illegal invocation");
|
|
27
|
+
}
|
|
28
|
+
// Need to call native method immediately in case uncaught error thrown
|
|
29
|
+
this.#noRetry();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function wrapExportedHandler(worker: ExportedHandler): ExportedHandler {
|
|
34
|
+
// If we don't have any middleware defined, just return the handler as is
|
|
35
|
+
if (
|
|
36
|
+
__INTERNAL_WRANGLER_MIDDLEWARE__ === undefined ||
|
|
37
|
+
__INTERNAL_WRANGLER_MIDDLEWARE__.length === 0
|
|
38
|
+
) {
|
|
39
|
+
return worker;
|
|
40
|
+
}
|
|
41
|
+
// Otherwise, register all middleware once
|
|
42
|
+
for (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {
|
|
43
|
+
__facade_register__(middleware);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const fetchDispatcher: ExportedHandlerFetchHandler = function (
|
|
47
|
+
request,
|
|
48
|
+
env,
|
|
49
|
+
ctx
|
|
50
|
+
) {
|
|
51
|
+
if (worker.fetch === undefined) {
|
|
52
|
+
throw new Error("Handler does not export a fetch() function.");
|
|
53
|
+
}
|
|
54
|
+
return worker.fetch(request, env, ctx);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
...worker,
|
|
59
|
+
fetch(request, env, ctx) {
|
|
60
|
+
const dispatcher: Dispatcher = function (type, init) {
|
|
61
|
+
if (type === "scheduled" && worker.scheduled !== undefined) {
|
|
62
|
+
const controller = new __Facade_ScheduledController__(
|
|
63
|
+
Date.now(),
|
|
64
|
+
init.cron ?? "",
|
|
65
|
+
() => {}
|
|
66
|
+
);
|
|
67
|
+
return worker.scheduled(controller, env, ctx);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return __facade_invoke__(request, env, ctx, dispatcher, fetchDispatcher);
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function wrapWorkerEntrypoint(
|
|
76
|
+
klass: WorkerEntrypointConstructor
|
|
77
|
+
): WorkerEntrypointConstructor {
|
|
78
|
+
// If we don't have any middleware defined, just return the handler as is
|
|
79
|
+
if (
|
|
80
|
+
__INTERNAL_WRANGLER_MIDDLEWARE__ === undefined ||
|
|
81
|
+
__INTERNAL_WRANGLER_MIDDLEWARE__.length === 0
|
|
82
|
+
) {
|
|
83
|
+
return klass;
|
|
84
|
+
}
|
|
85
|
+
// Otherwise, register all middleware once
|
|
86
|
+
for (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {
|
|
87
|
+
__facade_register__(middleware);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// `extend`ing `klass` here so other RPC methods remain callable
|
|
91
|
+
return class extends klass {
|
|
92
|
+
#fetchDispatcher: ExportedHandlerFetchHandler<Record<string, unknown>> = (
|
|
93
|
+
request,
|
|
94
|
+
env,
|
|
95
|
+
ctx
|
|
96
|
+
) => {
|
|
97
|
+
this.env = env;
|
|
98
|
+
this.ctx = ctx;
|
|
99
|
+
if (super.fetch === undefined) {
|
|
100
|
+
throw new Error("Entrypoint class does not define a fetch() function.");
|
|
101
|
+
}
|
|
102
|
+
return super.fetch(request);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
#dispatcher: Dispatcher = (type, init) => {
|
|
106
|
+
if (type === "scheduled" && super.scheduled !== undefined) {
|
|
107
|
+
const controller = new __Facade_ScheduledController__(
|
|
108
|
+
Date.now(),
|
|
109
|
+
init.cron ?? "",
|
|
110
|
+
() => {}
|
|
111
|
+
);
|
|
112
|
+
return super.scheduled(controller);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
fetch(request: Request<unknown, IncomingRequestCfProperties>) {
|
|
117
|
+
return __facade_invoke__(
|
|
118
|
+
request,
|
|
119
|
+
this.env,
|
|
120
|
+
this.ctx,
|
|
121
|
+
this.#dispatcher,
|
|
122
|
+
this.#fetchDispatcher
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let WRAPPED_ENTRY: ExportedHandler | WorkerEntrypointConstructor | undefined;
|
|
129
|
+
if (typeof ENTRY === "object") {
|
|
130
|
+
WRAPPED_ENTRY = wrapExportedHandler(ENTRY);
|
|
131
|
+
} else if (typeof ENTRY === "function") {
|
|
132
|
+
WRAPPED_ENTRY = wrapWorkerEntrypoint(ENTRY);
|
|
133
|
+
}
|
|
134
|
+
export default WRAPPED_ENTRY;
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
// .wrangler/tmp/bundle-AF2XYW/checked-fetch.js
|
|
29
|
+
var require_checked_fetch = __commonJS({
|
|
30
|
+
".wrangler/tmp/bundle-AF2XYW/checked-fetch.js"() {
|
|
31
|
+
var urls = /* @__PURE__ */ new Set();
|
|
32
|
+
function checkURL(request, init) {
|
|
33
|
+
const url = request instanceof URL ? request : new URL(
|
|
34
|
+
(typeof request === "string" ? new Request(request, init) : request).url
|
|
35
|
+
);
|
|
36
|
+
if (url.port && url.port !== "443" && url.protocol === "https:") {
|
|
37
|
+
if (!urls.has(url.toString())) {
|
|
38
|
+
urls.add(url.toString());
|
|
39
|
+
console.warn(
|
|
40
|
+
`WARNING: known issue with \`fetch()\` requests to custom HTTPS ports in published Workers:
|
|
41
|
+
- ${url.toString()} - the custom port will be ignored when the Worker is published using the \`wrangler deploy\` command.
|
|
42
|
+
`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
__name(checkURL, "checkURL");
|
|
48
|
+
globalThis.fetch = new Proxy(globalThis.fetch, {
|
|
49
|
+
apply(target, thisArg, argArray) {
|
|
50
|
+
const [request, init] = argArray;
|
|
51
|
+
checkURL(request, init);
|
|
52
|
+
return Reflect.apply(target, thisArg, argArray);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// .wrangler/tmp/bundle-AF2XYW/middleware-loader.entry.ts
|
|
59
|
+
var import_checked_fetch7 = __toESM(require_checked_fetch());
|
|
60
|
+
|
|
61
|
+
// wrangler-modules-watch:wrangler:modules-watch
|
|
62
|
+
var import_checked_fetch = __toESM(require_checked_fetch());
|
|
63
|
+
|
|
64
|
+
// .wrangler/tmp/bundle-AF2XYW/middleware-insertion-facade.js
|
|
65
|
+
var import_checked_fetch5 = __toESM(require_checked_fetch());
|
|
66
|
+
|
|
67
|
+
// node_modules/wrangler/templates/pages-shim.ts
|
|
68
|
+
var import_checked_fetch2 = __toESM(require_checked_fetch());
|
|
69
|
+
var pages_shim_default = {
|
|
70
|
+
async fetch(request, env, context) {
|
|
71
|
+
const response = await env.ASSETS.fetch(request.url, request);
|
|
72
|
+
return new Response(response.body, response);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts
|
|
77
|
+
var import_checked_fetch3 = __toESM(require_checked_fetch());
|
|
78
|
+
var drainBody = /* @__PURE__ */ __name(async (request, env, _ctx, middlewareCtx) => {
|
|
79
|
+
try {
|
|
80
|
+
return await middlewareCtx.next(request, env);
|
|
81
|
+
} finally {
|
|
82
|
+
try {
|
|
83
|
+
if (request.body !== null && !request.bodyUsed) {
|
|
84
|
+
const reader = request.body.getReader();
|
|
85
|
+
while (!(await reader.read()).done) {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
console.error("Failed to drain the unused request body.", e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, "drainBody");
|
|
93
|
+
var middleware_ensure_req_body_drained_default = drainBody;
|
|
94
|
+
|
|
95
|
+
// node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts
|
|
96
|
+
var import_checked_fetch4 = __toESM(require_checked_fetch());
|
|
97
|
+
function reduceError(e) {
|
|
98
|
+
return {
|
|
99
|
+
name: e?.name,
|
|
100
|
+
message: e?.message ?? String(e),
|
|
101
|
+
stack: e?.stack,
|
|
102
|
+
cause: e?.cause === void 0 ? void 0 : reduceError(e.cause)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
__name(reduceError, "reduceError");
|
|
106
|
+
var jsonError = /* @__PURE__ */ __name(async (request, env, _ctx, middlewareCtx) => {
|
|
107
|
+
try {
|
|
108
|
+
return await middlewareCtx.next(request, env);
|
|
109
|
+
} catch (e) {
|
|
110
|
+
const error = reduceError(e);
|
|
111
|
+
return Response.json(error, {
|
|
112
|
+
status: 500,
|
|
113
|
+
headers: { "MF-Experimental-Error-Stack": "true" }
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}, "jsonError");
|
|
117
|
+
var middleware_miniflare3_json_error_default = jsonError;
|
|
118
|
+
|
|
119
|
+
// .wrangler/tmp/bundle-AF2XYW/middleware-insertion-facade.js
|
|
120
|
+
var __INTERNAL_WRANGLER_MIDDLEWARE__ = [
|
|
121
|
+
middleware_ensure_req_body_drained_default,
|
|
122
|
+
middleware_miniflare3_json_error_default
|
|
123
|
+
];
|
|
124
|
+
var middleware_insertion_facade_default = pages_shim_default;
|
|
125
|
+
|
|
126
|
+
// node_modules/wrangler/templates/middleware/common.ts
|
|
127
|
+
var import_checked_fetch6 = __toESM(require_checked_fetch());
|
|
128
|
+
var __facade_middleware__ = [];
|
|
129
|
+
function __facade_register__(...args) {
|
|
130
|
+
__facade_middleware__.push(...args.flat());
|
|
131
|
+
}
|
|
132
|
+
__name(__facade_register__, "__facade_register__");
|
|
133
|
+
function __facade_invokeChain__(request, env, ctx, dispatch, middlewareChain) {
|
|
134
|
+
const [head, ...tail] = middlewareChain;
|
|
135
|
+
const middlewareCtx = {
|
|
136
|
+
dispatch,
|
|
137
|
+
next(newRequest, newEnv) {
|
|
138
|
+
return __facade_invokeChain__(newRequest, newEnv, ctx, dispatch, tail);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
return head(request, env, ctx, middlewareCtx);
|
|
142
|
+
}
|
|
143
|
+
__name(__facade_invokeChain__, "__facade_invokeChain__");
|
|
144
|
+
function __facade_invoke__(request, env, ctx, dispatch, finalMiddleware) {
|
|
145
|
+
return __facade_invokeChain__(request, env, ctx, dispatch, [
|
|
146
|
+
...__facade_middleware__,
|
|
147
|
+
finalMiddleware
|
|
148
|
+
]);
|
|
149
|
+
}
|
|
150
|
+
__name(__facade_invoke__, "__facade_invoke__");
|
|
151
|
+
|
|
152
|
+
// .wrangler/tmp/bundle-AF2XYW/middleware-loader.entry.ts
|
|
153
|
+
var __Facade_ScheduledController__ = class ___Facade_ScheduledController__ {
|
|
154
|
+
constructor(scheduledTime, cron, noRetry) {
|
|
155
|
+
this.scheduledTime = scheduledTime;
|
|
156
|
+
this.cron = cron;
|
|
157
|
+
this.#noRetry = noRetry;
|
|
158
|
+
}
|
|
159
|
+
static {
|
|
160
|
+
__name(this, "__Facade_ScheduledController__");
|
|
161
|
+
}
|
|
162
|
+
#noRetry;
|
|
163
|
+
noRetry() {
|
|
164
|
+
if (!(this instanceof ___Facade_ScheduledController__)) {
|
|
165
|
+
throw new TypeError("Illegal invocation");
|
|
166
|
+
}
|
|
167
|
+
this.#noRetry();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
function wrapExportedHandler(worker) {
|
|
171
|
+
if (__INTERNAL_WRANGLER_MIDDLEWARE__ === void 0 || __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0) {
|
|
172
|
+
return worker;
|
|
173
|
+
}
|
|
174
|
+
for (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {
|
|
175
|
+
__facade_register__(middleware);
|
|
176
|
+
}
|
|
177
|
+
const fetchDispatcher = /* @__PURE__ */ __name(function(request, env, ctx) {
|
|
178
|
+
if (worker.fetch === void 0) {
|
|
179
|
+
throw new Error("Handler does not export a fetch() function.");
|
|
180
|
+
}
|
|
181
|
+
return worker.fetch(request, env, ctx);
|
|
182
|
+
}, "fetchDispatcher");
|
|
183
|
+
return {
|
|
184
|
+
...worker,
|
|
185
|
+
fetch(request, env, ctx) {
|
|
186
|
+
const dispatcher = /* @__PURE__ */ __name(function(type, init) {
|
|
187
|
+
if (type === "scheduled" && worker.scheduled !== void 0) {
|
|
188
|
+
const controller = new __Facade_ScheduledController__(
|
|
189
|
+
Date.now(),
|
|
190
|
+
init.cron ?? "",
|
|
191
|
+
() => {
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
return worker.scheduled(controller, env, ctx);
|
|
195
|
+
}
|
|
196
|
+
}, "dispatcher");
|
|
197
|
+
return __facade_invoke__(request, env, ctx, dispatcher, fetchDispatcher);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
__name(wrapExportedHandler, "wrapExportedHandler");
|
|
202
|
+
function wrapWorkerEntrypoint(klass) {
|
|
203
|
+
if (__INTERNAL_WRANGLER_MIDDLEWARE__ === void 0 || __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0) {
|
|
204
|
+
return klass;
|
|
205
|
+
}
|
|
206
|
+
for (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {
|
|
207
|
+
__facade_register__(middleware);
|
|
208
|
+
}
|
|
209
|
+
return class extends klass {
|
|
210
|
+
#fetchDispatcher = /* @__PURE__ */ __name((request, env, ctx) => {
|
|
211
|
+
this.env = env;
|
|
212
|
+
this.ctx = ctx;
|
|
213
|
+
if (super.fetch === void 0) {
|
|
214
|
+
throw new Error("Entrypoint class does not define a fetch() function.");
|
|
215
|
+
}
|
|
216
|
+
return super.fetch(request);
|
|
217
|
+
}, "#fetchDispatcher");
|
|
218
|
+
#dispatcher = /* @__PURE__ */ __name((type, init) => {
|
|
219
|
+
if (type === "scheduled" && super.scheduled !== void 0) {
|
|
220
|
+
const controller = new __Facade_ScheduledController__(
|
|
221
|
+
Date.now(),
|
|
222
|
+
init.cron ?? "",
|
|
223
|
+
() => {
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
return super.scheduled(controller);
|
|
227
|
+
}
|
|
228
|
+
}, "#dispatcher");
|
|
229
|
+
fetch(request) {
|
|
230
|
+
return __facade_invoke__(
|
|
231
|
+
request,
|
|
232
|
+
this.env,
|
|
233
|
+
this.ctx,
|
|
234
|
+
this.#dispatcher,
|
|
235
|
+
this.#fetchDispatcher
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
__name(wrapWorkerEntrypoint, "wrapWorkerEntrypoint");
|
|
241
|
+
var WRAPPED_ENTRY;
|
|
242
|
+
if (typeof middleware_insertion_facade_default === "object") {
|
|
243
|
+
WRAPPED_ENTRY = wrapExportedHandler(middleware_insertion_facade_default);
|
|
244
|
+
} else if (typeof middleware_insertion_facade_default === "function") {
|
|
245
|
+
WRAPPED_ENTRY = wrapWorkerEntrypoint(middleware_insertion_facade_default);
|
|
246
|
+
}
|
|
247
|
+
var middleware_loader_entry_default = WRAPPED_ENTRY;
|
|
248
|
+
export {
|
|
249
|
+
__INTERNAL_WRANGLER_MIDDLEWARE__,
|
|
250
|
+
middleware_loader_entry_default as default
|
|
251
|
+
};
|
|
252
|
+
//# sourceMappingURL=pages-shim.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../bundle-AF2XYW/checked-fetch.js", "../bundle-AF2XYW/middleware-loader.entry.ts", "wrangler-modules-watch:wrangler:modules-watch", "../bundle-AF2XYW/middleware-insertion-facade.js", "../../../node_modules/wrangler/templates/pages-shim.ts", "../../../node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts", "../../../node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts", "../../../node_modules/wrangler/templates/middleware/common.ts"],
|
|
4
|
+
"sourceRoot": "C:\\Users\\Owner\\AntigravityProjects\\cdom\\.wrangler\\tmp\\dev-CcfZyg",
|
|
5
|
+
"sourcesContent": ["const urls = new Set();\n\nfunction checkURL(request, init) {\n\tconst url =\n\t\trequest instanceof URL\n\t\t\t? request\n\t\t\t: new URL(\n\t\t\t\t\t(typeof request === \"string\"\n\t\t\t\t\t\t? new Request(request, init)\n\t\t\t\t\t\t: request\n\t\t\t\t\t).url\n\t\t\t\t);\n\tif (url.port && url.port !== \"443\" && url.protocol === \"https:\") {\n\t\tif (!urls.has(url.toString())) {\n\t\t\turls.add(url.toString());\n\t\t\tconsole.warn(\n\t\t\t\t`WARNING: known issue with \\`fetch()\\` requests to custom HTTPS ports in published Workers:\\n` +\n\t\t\t\t\t` - ${url.toString()} - the custom port will be ignored when the Worker is published using the \\`wrangler deploy\\` command.\\n`\n\t\t\t);\n\t\t}\n\t}\n}\n\nglobalThis.fetch = new Proxy(globalThis.fetch, {\n\tapply(target, thisArg, argArray) {\n\t\tconst [request, init] = argArray;\n\t\tcheckURL(request, init);\n\t\treturn Reflect.apply(target, thisArg, argArray);\n\t},\n});\n", "// This loads all middlewares exposed on the middleware object and then starts\n// the invocation chain. The big idea is that we can add these to the middleware\n// export dynamically through wrangler, or we can potentially let users directly\n// add them as a sort of \"plugin\" system.\n\nimport ENTRY, { __INTERNAL_WRANGLER_MIDDLEWARE__ } from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\.wrangler\\\\tmp\\\\bundle-AF2XYW\\\\middleware-insertion-facade.js\";\nimport { __facade_invoke__, __facade_register__, Dispatcher } from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\node_modules\\\\wrangler\\\\templates\\\\middleware\\\\common.ts\";\nimport type { WorkerEntrypointConstructor } from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\.wrangler\\\\tmp\\\\bundle-AF2XYW\\\\middleware-insertion-facade.js\";\n\n// Preserve all the exports from the worker\nexport * from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\.wrangler\\\\tmp\\\\bundle-AF2XYW\\\\middleware-insertion-facade.js\";\n\nclass __Facade_ScheduledController__ implements ScheduledController {\n\treadonly #noRetry: ScheduledController[\"noRetry\"];\n\n\tconstructor(\n\t\treadonly scheduledTime: number,\n\t\treadonly cron: string,\n\t\tnoRetry: ScheduledController[\"noRetry\"]\n\t) {\n\t\tthis.#noRetry = noRetry;\n\t}\n\n\tnoRetry() {\n\t\tif (!(this instanceof __Facade_ScheduledController__)) {\n\t\t\tthrow new TypeError(\"Illegal invocation\");\n\t\t}\n\t\t// Need to call native method immediately in case uncaught error thrown\n\t\tthis.#noRetry();\n\t}\n}\n\nfunction wrapExportedHandler(worker: ExportedHandler): ExportedHandler {\n\t// If we don't have any middleware defined, just return the handler as is\n\tif (\n\t\t__INTERNAL_WRANGLER_MIDDLEWARE__ === undefined ||\n\t\t__INTERNAL_WRANGLER_MIDDLEWARE__.length === 0\n\t) {\n\t\treturn worker;\n\t}\n\t// Otherwise, register all middleware once\n\tfor (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {\n\t\t__facade_register__(middleware);\n\t}\n\n\tconst fetchDispatcher: ExportedHandlerFetchHandler = function (\n\t\trequest,\n\t\tenv,\n\t\tctx\n\t) {\n\t\tif (worker.fetch === undefined) {\n\t\t\tthrow new Error(\"Handler does not export a fetch() function.\");\n\t\t}\n\t\treturn worker.fetch(request, env, ctx);\n\t};\n\n\treturn {\n\t\t...worker,\n\t\tfetch(request, env, ctx) {\n\t\t\tconst dispatcher: Dispatcher = function (type, init) {\n\t\t\t\tif (type === \"scheduled\" && worker.scheduled !== undefined) {\n\t\t\t\t\tconst controller = new __Facade_ScheduledController__(\n\t\t\t\t\t\tDate.now(),\n\t\t\t\t\t\tinit.cron ?? \"\",\n\t\t\t\t\t\t() => {}\n\t\t\t\t\t);\n\t\t\t\t\treturn worker.scheduled(controller, env, ctx);\n\t\t\t\t}\n\t\t\t};\n\t\t\treturn __facade_invoke__(request, env, ctx, dispatcher, fetchDispatcher);\n\t\t},\n\t};\n}\n\nfunction wrapWorkerEntrypoint(\n\tklass: WorkerEntrypointConstructor\n): WorkerEntrypointConstructor {\n\t// If we don't have any middleware defined, just return the handler as is\n\tif (\n\t\t__INTERNAL_WRANGLER_MIDDLEWARE__ === undefined ||\n\t\t__INTERNAL_WRANGLER_MIDDLEWARE__.length === 0\n\t) {\n\t\treturn klass;\n\t}\n\t// Otherwise, register all middleware once\n\tfor (const middleware of __INTERNAL_WRANGLER_MIDDLEWARE__) {\n\t\t__facade_register__(middleware);\n\t}\n\n\t// `extend`ing `klass` here so other RPC methods remain callable\n\treturn class extends klass {\n\t\t#fetchDispatcher: ExportedHandlerFetchHandler<Record<string, unknown>> = (\n\t\t\trequest,\n\t\t\tenv,\n\t\t\tctx\n\t\t) => {\n\t\t\tthis.env = env;\n\t\t\tthis.ctx = ctx;\n\t\t\tif (super.fetch === undefined) {\n\t\t\t\tthrow new Error(\"Entrypoint class does not define a fetch() function.\");\n\t\t\t}\n\t\t\treturn super.fetch(request);\n\t\t};\n\n\t\t#dispatcher: Dispatcher = (type, init) => {\n\t\t\tif (type === \"scheduled\" && super.scheduled !== undefined) {\n\t\t\t\tconst controller = new __Facade_ScheduledController__(\n\t\t\t\t\tDate.now(),\n\t\t\t\t\tinit.cron ?? \"\",\n\t\t\t\t\t() => {}\n\t\t\t\t);\n\t\t\t\treturn super.scheduled(controller);\n\t\t\t}\n\t\t};\n\n\t\tfetch(request: Request<unknown, IncomingRequestCfProperties>) {\n\t\t\treturn __facade_invoke__(\n\t\t\t\trequest,\n\t\t\t\tthis.env,\n\t\t\t\tthis.ctx,\n\t\t\t\tthis.#dispatcher,\n\t\t\t\tthis.#fetchDispatcher\n\t\t\t);\n\t\t}\n\t};\n}\n\nlet WRAPPED_ENTRY: ExportedHandler | WorkerEntrypointConstructor | undefined;\nif (typeof ENTRY === \"object\") {\n\tWRAPPED_ENTRY = wrapExportedHandler(ENTRY);\n} else if (typeof ENTRY === \"function\") {\n\tWRAPPED_ENTRY = wrapWorkerEntrypoint(ENTRY);\n}\nexport default WRAPPED_ENTRY;\n", "", "\t\t\t\timport worker, * as OTHER_EXPORTS from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\node_modules\\\\wrangler\\\\templates\\\\pages-shim.ts\";\n\t\t\t\timport * as __MIDDLEWARE_0__ from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\node_modules\\\\wrangler\\\\templates\\\\middleware\\\\middleware-ensure-req-body-drained.ts\";\nimport * as __MIDDLEWARE_1__ from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\node_modules\\\\wrangler\\\\templates\\\\middleware\\\\middleware-miniflare3-json-error.ts\";\n\n\t\t\t\texport * from \"C:\\\\Users\\\\Owner\\\\AntigravityProjects\\\\cdom\\\\node_modules\\\\wrangler\\\\templates\\\\pages-shim.ts\";\n\t\t\t\tconst MIDDLEWARE_TEST_INJECT = \"__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__\";\n\t\t\t\texport const __INTERNAL_WRANGLER_MIDDLEWARE__ = [\n\t\t\t\t\t\n\t\t\t\t\t__MIDDLEWARE_0__.default,__MIDDLEWARE_1__.default\n\t\t\t\t]\n\t\t\t\texport default worker;", "// This Worker is used as a default when no Pages Functions are present.\n// It proxies the request directly on to the asset server binding.\n\nexport default <ExportedHandler<{ ASSETS: Fetcher }>>{\n\tasync fetch(request, env, context) {\n\t\tconst response = await env.ASSETS.fetch(request.url, request);\n\t\treturn new Response(response.body, response);\n\t},\n};\n", "import type { Middleware } from \"./common\";\n\nconst drainBody: Middleware = async (request, env, _ctx, middlewareCtx) => {\n\ttry {\n\t\treturn await middlewareCtx.next(request, env);\n\t} finally {\n\t\ttry {\n\t\t\tif (request.body !== null && !request.bodyUsed) {\n\t\t\t\tconst reader = request.body.getReader();\n\t\t\t\twhile (!(await reader.read()).done) {}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(\"Failed to drain the unused request body.\", e);\n\t\t}\n\t}\n};\n\nexport default drainBody;\n", "import type { Middleware } from \"./common\";\n\ninterface JsonError {\n\tmessage?: string;\n\tname?: string;\n\tstack?: string;\n\tcause?: JsonError;\n}\n\nfunction reduceError(e: any): JsonError {\n\treturn {\n\t\tname: e?.name,\n\t\tmessage: e?.message ?? String(e),\n\t\tstack: e?.stack,\n\t\tcause: e?.cause === undefined ? undefined : reduceError(e.cause),\n\t};\n}\n\n// See comment in `bundle.ts` for details on why this is needed\nconst jsonError: Middleware = async (request, env, _ctx, middlewareCtx) => {\n\ttry {\n\t\treturn await middlewareCtx.next(request, env);\n\t} catch (e: any) {\n\t\tconst error = reduceError(e);\n\t\treturn Response.json(error, {\n\t\t\tstatus: 500,\n\t\t\theaders: { \"MF-Experimental-Error-Stack\": \"true\" },\n\t\t});\n\t}\n};\n\nexport default jsonError;\n", "export type Awaitable<T> = T | Promise<T>;\n// TODO: allow dispatching more events?\nexport type Dispatcher = (\n\ttype: \"scheduled\",\n\tinit: { cron?: string }\n) => Awaitable<void>;\n\nexport type IncomingRequest = Request<\n\tunknown,\n\tIncomingRequestCfProperties<unknown>\n>;\n\nexport interface MiddlewareContext {\n\tdispatch: Dispatcher;\n\tnext(request: IncomingRequest, env: any): Awaitable<Response>;\n}\n\nexport type Middleware = (\n\trequest: IncomingRequest,\n\tenv: any,\n\tctx: ExecutionContext,\n\tmiddlewareCtx: MiddlewareContext\n) => Awaitable<Response>;\n\nconst __facade_middleware__: Middleware[] = [];\n\n// The register functions allow for the insertion of one or many middleware,\n// We register internal middleware first in the stack, but have no way of controlling\n// the order that addMiddleware is run in service workers so need an internal function.\nexport function __facade_register__(...args: (Middleware | Middleware[])[]) {\n\t__facade_middleware__.push(...args.flat());\n}\nexport function __facade_registerInternal__(\n\t...args: (Middleware | Middleware[])[]\n) {\n\t__facade_middleware__.unshift(...args.flat());\n}\n\nfunction __facade_invokeChain__(\n\trequest: IncomingRequest,\n\tenv: any,\n\tctx: ExecutionContext,\n\tdispatch: Dispatcher,\n\tmiddlewareChain: Middleware[]\n): Awaitable<Response> {\n\tconst [head, ...tail] = middlewareChain;\n\tconst middlewareCtx: MiddlewareContext = {\n\t\tdispatch,\n\t\tnext(newRequest, newEnv) {\n\t\t\treturn __facade_invokeChain__(newRequest, newEnv, ctx, dispatch, tail);\n\t\t},\n\t};\n\treturn head(request, env, ctx, middlewareCtx);\n}\n\nexport function __facade_invoke__(\n\trequest: IncomingRequest,\n\tenv: any,\n\tctx: ExecutionContext,\n\tdispatch: Dispatcher,\n\tfinalMiddleware: Middleware\n): Awaitable<Response> {\n\treturn __facade_invokeChain__(request, env, ctx, dispatch, [\n\t\t...__facade_middleware__,\n\t\tfinalMiddleware,\n\t]);\n}\n"],
|
|
6
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,QAAM,OAAO,oBAAI,IAAI;AAErB,aAAS,SAAS,SAAS,MAAM;AAChC,YAAM,MACL,mBAAmB,MAChB,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AM;AAAA,IAC1B,mBAAyE,wBACxE,SACA,KACA,QACI;AACJ,WAAK,MAAM;AACX,WAAK,MAAM;AACX,UAAI,MAAM,UAAU,QAAW;AAC9B,cAAM,IAAI,MAAM,sDAAsD;AAAA,MACvE;AACA,aAAO,MAAM,MAAM,OAAO;AAAA,IAC3B,GAXyE;AAAA,IAazE,cAA0B,wBAAC,MAAM,SAAS;AACzC,UAAI,SAAS,eAAe,MAAM,cAAc,QAAW;AAC1D,cAAM,aAAa,IAAI;AAAA,UACtB,KAAK,IAAI;AAAA,UACT,KAAK,QAAQ;AAAA,UACb,MAAM;AAAA,UAAC;AAAA,QACR;AACA,eAAO,MAAM,UAAU,UAAU;AAAA,MAClC;AAAA,IACD,GAT0B;AAAA,IAW1B,MAAM,SAAwD;AAC7D,aAAO;AAAA,QACN;AAAA,QACA,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;AAnDS;AAqDT,IAAI;AACJ,IAAI,OAAO,wCAAU,UAAU;AAC9B,kBAAgB,oBAAoB,mCAAK;AAC1C,WAAW,OAAO,wCAAU,YAAY;AACvC,kBAAgB,qBAAqB,mCAAK;AAC3C;AACA,IAAO,kCAAQ;",
|
|
7
|
+
"names": ["import_checked_fetch", "import_checked_fetch", "import_checked_fetch", "import_checked_fetch", "import_checked_fetch", "import_checked_fetch"]
|
|
8
|
+
}
|