@powerlines/plugin-cloudflare 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/cloudflare-builtin.mjs +1 -2
- package/dist/components/env-builtin.mjs +1 -2
- package/dist/components/worker-entry.mjs +1 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +3 -4
- package/dist/node_modules/.pnpm/{@stryke_string-format@0.17.1 → @stryke_string-format@0.17.3}/node_modules/@stryke/string-format/dist/get-words.cjs +1 -1
- package/dist/node_modules/.pnpm/{@stryke_string-format@0.17.1 → @stryke_string-format@0.17.3}/node_modules/@stryke/string-format/dist/get-words.mjs +2 -3
- package/dist/node_modules/.pnpm/{@stryke_string-format@0.17.1 → @stryke_string-format@0.17.3}/node_modules/@stryke/string-format/dist/kebab-case.cjs +1 -1
- package/dist/node_modules/.pnpm/{@stryke_string-format@0.17.1 → @stryke_string-format@0.17.3}/node_modules/@stryke/string-format/dist/kebab-case.mjs +2 -3
- package/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.36 → @stryke_type-checks@0.5.38}/node_modules/@stryke/type-checks/dist/get-object-tag.cjs +1 -1
- package/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.36 → @stryke_type-checks@0.5.38}/node_modules/@stryke/type-checks/dist/get-object-tag.mjs +2 -3
- package/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.36 → @stryke_type-checks@0.5.38}/node_modules/@stryke/type-checks/dist/is-function.cjs +1 -1
- package/dist/node_modules/.pnpm/{@stryke_type-checks@0.5.36 → @stryke_type-checks@0.5.38}/node_modules/@stryke/type-checks/dist/is-function.mjs +2 -3
- package/package.json +12 -12
- package/dist/components/cloudflare-builtin.d.cts +0 -13
- package/dist/components/cloudflare-builtin.d.cts.map +0 -1
- package/dist/components/cloudflare-builtin.d.mts +0 -13
- package/dist/components/cloudflare-builtin.d.mts.map +0 -1
- package/dist/components/cloudflare-builtin.mjs.map +0 -1
- package/dist/components/env-builtin.d.cts +0 -13
- package/dist/components/env-builtin.d.cts.map +0 -1
- package/dist/components/env-builtin.d.mts +0 -13
- package/dist/components/env-builtin.d.mts.map +0 -1
- package/dist/components/env-builtin.mjs.map +0 -1
- package/dist/components/index.d.cts +0 -4
- package/dist/components/index.d.mts +0 -4
- package/dist/components/worker-entry.d.cts +0 -17
- package/dist/components/worker-entry.d.cts.map +0 -1
- package/dist/components/worker-entry.d.mts +0 -17
- package/dist/components/worker-entry.d.mts.map +0 -1
- package/dist/components/worker-entry.mjs.map +0 -1
- package/dist/index.d.cts +0 -21
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts +0 -21
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.1/node_modules/@stryke/string-format/dist/get-words.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_string-format@0.17.1/node_modules/@stryke/string-format/dist/kebab-case.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.36/node_modules/@stryke/type-checks/dist/get-object-tag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_type-checks@0.5.36/node_modules/@stryke/type-checks/dist/is-function.mjs.map +0 -1
- package/dist/types/index.d.cts +0 -2
- package/dist/types/index.d.mts +0 -2
- package/dist/types/plugin.d.cts +0 -63
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts +0 -63
- package/dist/types/plugin.d.mts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const require_kebab_case = require('./node_modules/.pnpm/@stryke_string-format@0.17.
|
|
4
|
-
const require_is_function = require('./node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
3
|
+
const require_kebab_case = require('./node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.cjs');
|
|
4
|
+
const require_is_function = require('./node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.cjs');
|
|
5
5
|
const require_components_cloudflare_builtin = require('./components/cloudflare-builtin.cjs');
|
|
6
6
|
const require_components_env_builtin = require('./components/env-builtin.cjs');
|
|
7
7
|
const require_components_worker_entry = require('./components/worker-entry.cjs');
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { kebabCase } from "./node_modules/.pnpm/@stryke_string-format@0.17.
|
|
2
|
-
import { isFunction } from "./node_modules/.pnpm/@stryke_type-checks@0.5.
|
|
1
|
+
import { kebabCase } from "./node_modules/.pnpm/@stryke_string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs";
|
|
2
|
+
import { isFunction } from "./node_modules/.pnpm/@stryke_type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs";
|
|
3
3
|
import { CloudflareBuiltin } from "./components/cloudflare-builtin.mjs";
|
|
4
4
|
import { CloudflareEnvBuiltin } from "./components/env-builtin.mjs";
|
|
5
5
|
import { WorkerEntry } from "./components/worker-entry.mjs";
|
|
@@ -77,5 +77,4 @@ function plugin(options = {}) {
|
|
|
77
77
|
var src_default = plugin;
|
|
78
78
|
|
|
79
79
|
//#endregion
|
|
80
|
-
export { CloudflareBuiltin, CloudflareEnvBuiltin, WorkerEntry, src_default as default, plugin };
|
|
81
|
-
//# sourceMappingURL=index.mjs.map
|
|
80
|
+
export { CloudflareBuiltin, CloudflareEnvBuiltin, WorkerEntry, src_default as default, plugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Regular expression pattern to split strings into words for various case conversions
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/get-words.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Regular expression pattern to split strings into words for various case conversions
|
|
4
4
|
*
|
|
@@ -34,5 +34,4 @@ function getWords(str, options = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
|
-
export { getWords };
|
|
38
|
-
//# sourceMappingURL=get-words.mjs.map
|
|
37
|
+
export { getWords };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_get_words = require('./get-words.cjs');
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Check if the input string is in kebab case.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getWords } from "./get-words.mjs";
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@stryke+string-format@0.17.3/node_modules/@stryke/string-format/dist/kebab-case.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Check if the input string is in kebab case.
|
|
6
6
|
*
|
|
@@ -30,5 +30,4 @@ function kebabCase(input) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
|
-
export { kebabCase };
|
|
34
|
-
//# sourceMappingURL=kebab-case.mjs.map
|
|
33
|
+
export { kebabCase };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Gets the `toStringTag` of `obj`.
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/get-object-tag.mjs
|
|
2
2
|
/**
|
|
3
3
|
* Gets the `toStringTag` of `obj`.
|
|
4
4
|
*
|
|
@@ -11,5 +11,4 @@ const getObjectTag = (value) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
|
-
export { getObjectTag };
|
|
15
|
-
//# sourceMappingURL=get-object-tag.mjs.map
|
|
14
|
+
export { getObjectTag };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_get_object_tag = require('./get-object-tag.cjs');
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs
|
|
4
4
|
function isSyncFunction(value) {
|
|
5
5
|
return require_get_object_tag.getObjectTag(value) === "[object Function]";
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getObjectTag } from "./get-object-tag.mjs";
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@stryke+type-checks@0.5.38/node_modules/@stryke/type-checks/dist/is-function.mjs
|
|
4
4
|
function isSyncFunction(value) {
|
|
5
5
|
return getObjectTag(value) === "[object Function]";
|
|
6
6
|
}
|
|
@@ -22,5 +22,4 @@ const isFunction = (value) => {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
25
|
-
export { isFunction };
|
|
26
|
-
//# sourceMappingURL=is-function.mjs.map
|
|
25
|
+
export { isFunction };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-cloudflare",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Powerlines plugin that provides integration with Cloudflare services.",
|
|
6
6
|
"repository": {
|
|
@@ -144,25 +144,25 @@
|
|
|
144
144
|
"dependencies": {
|
|
145
145
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
146
146
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
147
|
-
"@powerlines/plugin-pulumi": "^0.5.
|
|
148
|
-
"@powerlines/plugin-env": "^0.16.
|
|
147
|
+
"@powerlines/plugin-pulumi": "^0.5.14",
|
|
148
|
+
"@powerlines/plugin-env": "^0.16.52",
|
|
149
149
|
"@pulumi/cloudflare": "^6.13.0",
|
|
150
150
|
"@pulumi/pulumi": "^3.225.1",
|
|
151
|
-
"@storm-software/config-tools": "^1.189.
|
|
152
|
-
"@stryke/hash": "^0.13.
|
|
153
|
-
"@stryke/path": "^0.26.
|
|
151
|
+
"@storm-software/config-tools": "^1.189.27",
|
|
152
|
+
"@stryke/hash": "^0.13.10",
|
|
153
|
+
"@stryke/path": "^0.26.19",
|
|
154
154
|
"defu": "^6.1.4",
|
|
155
|
-
"powerlines": "^0.40.
|
|
155
|
+
"powerlines": "^0.40.20"
|
|
156
156
|
},
|
|
157
157
|
"devDependencies": {
|
|
158
|
-
"@cloudflare/workers-types": "^4.
|
|
159
|
-
"@powerlines/plugin-alloy": "^0.25.
|
|
160
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
161
|
-
"@types/node": "^25.
|
|
158
|
+
"@cloudflare/workers-types": "^4.20260310.1",
|
|
159
|
+
"@powerlines/plugin-alloy": "^0.25.17",
|
|
160
|
+
"@powerlines/plugin-plugin": "^0.12.284",
|
|
161
|
+
"@types/node": "^25.4.0"
|
|
162
162
|
},
|
|
163
163
|
"publishConfig": { "access": "public" },
|
|
164
164
|
"main": "./dist/index.cjs",
|
|
165
165
|
"module": "./dist/index.mjs",
|
|
166
166
|
"types": "./dist/index.d.cts",
|
|
167
|
-
"gitHead": "
|
|
167
|
+
"gitHead": "8d772181f794749e0f19f97c732dd921148c31c8"
|
|
168
168
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
|
-
import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
-
|
|
4
|
-
//#region src/components/cloudflare-builtin.d.ts
|
|
5
|
-
type CloudflareBuiltinProps = Partial<BuiltinFileProps> & Omit<BuiltinFileProps, "id" | "description">;
|
|
6
|
-
/**
|
|
7
|
-
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
8
|
-
*/
|
|
9
|
-
declare function CloudflareBuiltin(props: CloudflareBuiltinProps): _alloy_js_core1.Children;
|
|
10
|
-
declare type __ΩCloudflareBuiltinProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps };
|
|
13
|
-
//# sourceMappingURL=cloudflare-builtin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-builtin.d.cts","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"sourcesContent":[],"mappings":";;;;KAoCY,sBAAA,GAAyB,QAAQ,oBAC3C,KAAK;;;AADP;AAA6C,iBAM7B,iBAAA,CAN6B,KAAA,EAMJ,sBANI,CAAA,EAMkB,eAAA,CAAA,QANlB;AAAR,yCAAA,GAAA,EAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core1 from "@alloy-js/core";
|
|
2
|
-
import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
|
|
3
|
-
|
|
4
|
-
//#region src/components/cloudflare-builtin.d.ts
|
|
5
|
-
type CloudflareBuiltinProps = Partial<BuiltinFileProps> & Omit<BuiltinFileProps, "id" | "description">;
|
|
6
|
-
/**
|
|
7
|
-
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
8
|
-
*/
|
|
9
|
-
declare function CloudflareBuiltin(props: CloudflareBuiltinProps): _alloy_js_core1.Children;
|
|
10
|
-
declare type __ΩCloudflareBuiltinProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps };
|
|
13
|
-
//# sourceMappingURL=cloudflare-builtin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-builtin.d.mts","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"sourcesContent":[],"mappings":";;;;KAoCY,sBAAA,GAAyB,QAAQ,oBAC3C,KAAK;;;AADP;AAA6C,iBAM7B,iBAAA,CAN6B,KAAA,EAMJ,sBANI,CAAA,EAMkB,eAAA,CAAA,QANlB;AAAR,yCAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-builtin.mjs","names":["code","Show","splitProps","FunctionDeclaration","VarDeclaration","Spacing","BuiltinFile","InterfaceDeclaration","InterfaceMember","TSDoc","TSDocParam","TSDocReturns","defu","CloudflareBuiltin","props","imports","children","rest","_$createComponent","_$mergeProps","id","description","name","type","initializer","typeParameters","default","doc","_$createIntrinsic","heading","parameters","returnType","when","Boolean"],"sources":["../../src/components/cloudflare-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n InterfaceDeclaration,\n InterfaceMember\n} from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport type CloudflareBuiltinProps = Partial<BuiltinFileProps> &\n Omit<BuiltinFileProps, \"id\" | \"description\">;\n\n/**\n * Generates the Cloudflare environment configuration module for the Powerlines project.\n */\nexport function CloudflareBuiltin(props: CloudflareBuiltinProps) {\n const [{ imports, children }, rest] = splitProps(props, [\n \"imports\",\n \"children\"\n ]);\n\n return (\n <BuiltinFile\n id=\"cloudflare\"\n description=\"A set of helpful runtime utilities for integrating Cloudflare services.\"\n {...rest}\n imports={defu(\n {\n \"node:async_hooks\": [\"AsyncLocalStorage\"],\n \"@cloudflare/workers-types\": [\n { name: \"Request\", type: true },\n { name: \"Response\", type: true },\n { name: \"ExecutionContext\", type: true },\n { name: \"IncomingRequestCfProperties\", type: true },\n { name: \"ScheduledController\", type: true },\n { name: \"ForwardableEmailMessage\", type: true },\n { name: \"MessageBatch\", type: true },\n { name: \"TailStream\", type: true },\n { name: \"TraceItem\", type: true },\n { name: \"TailStream.TailEvent\", type: true },\n { name: \"TailStream.Onset\", type: true },\n { name: \"TailStream.TailEventHandlerType\", type: true }\n ]\n },\n imports ?? {}\n )}>\n <VarDeclaration\n const\n name=\"globalContextStorage\"\n initializer={code`globalThis as unknown as Record<PropertyKey, unknown>; `}\n />\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n doc=\"An interface representing the runtime context for Cloudflare operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"request\"\n type=\"Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>\"\n doc=\"The incoming Cloudflare request.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the incoming request.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_FETCH_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-fetch\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"fetchContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare fetch context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_FETCH_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareFetchContext>()) as AsyncLocalStorage<CloudflareFetchContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare fetch context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare fetch context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n parameters={[]}\n returnType=\"CloudflareFetchContext<Env, CfHostMetadata>\">\n {code`const context = fetchContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare fetch context is not available. Ensure that you are calling this function within the scope of a Cloudflare fetch request.\");\n}\nreturn context as CloudflareFetchContext<Env, CfHostMetadata>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare fetch context. This is typically used to set up the context for handling a Cloudflare fetch request, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getFetchContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare fetch context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareFetchContext<Env, CfHostMetadata>\"\n },\n {\n name: \"callback\",\n type: \"(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Promise<Response>\"\n }\n ]}\n returnType=\"Promise<Response>\">\n {code`return fetchContextStorage.run(context, () => callback(context.request, context.env, context.ctx)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the runtime context for Cloudflare scheduled operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"controller\"\n type=\"ScheduledController\"\n doc=\"The Cloudflare scheduled controller for the scheduled operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the scheduled operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_SCHEDULED_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-scheduled\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"scheduledContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare scheduled runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_SCHEDULED_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareScheduledContext>()) as AsyncLocalStorage<CloudflareScheduledContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare scheduled runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare scheduled runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareScheduledContext<Env>\">\n {code`const context = scheduledContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare scheduled context is not available. Ensure that you are calling this function within the scope of a Cloudflare scheduled operation.\");\n}\nreturn context as CloudflareScheduledContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare scheduled context. This is typically used to set up the context for handling a Cloudflare scheduled operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getScheduledContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare scheduled context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareScheduledContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareScheduledContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return scheduledContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the runtime context for Cloudflare email operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"message\"\n type=\"ForwardableEmailMessage\"\n doc=\"The Cloudflare email instance for the email operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the email operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_EMAIL_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-email\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"emailContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare email runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_EMAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareEmailContext>()) as AsyncLocalStorage<CloudflareEmailContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare email runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare email runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareEmailContext<Env>\">\n {code`const context = emailContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare email context is not available. Ensure that you are calling this function within the scope of a Cloudflare email operation.\");\n}\nreturn context as CloudflareEmailContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare email context. This is typically used to set up the context for handling a Cloudflare email operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getEmailContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare email context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`A promise that resolves with the result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareEmailContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareEmailContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return emailContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n doc=\"An interface representing the runtime context for Cloudflare queue operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"batch\"\n type=\"MessageBatch<Message>\"\n doc=\"The Cloudflare queue event instance for the queue operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the queue operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_QUEUE_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-queue\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"queueContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare queue runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_QUEUE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareQueueContext>()) as AsyncLocalStorage<CloudflareQueueContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare queue runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare queue runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n parameters={[]}\n returnType=\"CloudflareQueueContext<Message, Env>\">\n {code`const context = queueContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare queue context is not available. Ensure that you are calling this function within the scope of a Cloudflare queue operation.\");\n}\nreturn context as CloudflareQueueContext<Message, Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare queue context. This is typically used to set up the context for handling a Cloudflare queue operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getQueueContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare queue context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareQueueContext<Message, Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareQueueContext<Message, Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return queueContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the tail context for Cloudflare tail operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"events\"\n type=\"TraceItem[]\"\n doc=\"An array of trace items representing the events in the Cloudflare tail context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the tail operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TAIL_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-tail\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"tailContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare tail runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailContext>()) as AsyncLocalStorage<CloudflareTailContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare tail runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare tail runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTailContext<Env>\">\n {code`const context = tailContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare tail context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail operation.\");\n}\nreturn context as CloudflareTailContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare tail context. This is typically used to set up the context for handling a Cloudflare tail operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTailContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare tail context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTailContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTailContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"T\">\n {code`return tailContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the tail context for Cloudflare tail stream operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"event\"\n type=\"TailStream.TailEvent<TailStream.Onset>\"\n doc=\"The tail event associated with the Cloudflare tail stream context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the tail stream operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-tail-stream\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"tailStreamContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare tail stream runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailStreamContext>()) as AsyncLocalStorage<CloudflareTailStreamContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare tail stream runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare tail stream runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTailStreamContext<Env>\">\n {code`const context = tailStreamContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare tail stream context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail stream operation.\");\n}\nreturn context as CloudflareTailStreamContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare tail stream context. This is typically used to set up the context for handling a Cloudflare tail stream operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTailStreamContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare tail stream context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTailStreamContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTailStreamContext<Env>) => Promise<TailStream.TailEventHandlerType>\"\n }\n ]}\n returnType=\"Promise<TailStream.TailEventHandlerType>\">\n {code`return tailStreamContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the trace context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"traces\"\n type=\"TraceItem[]\"\n doc=\"An array of trace items associated with the Cloudflare trace context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the trace operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TRACE_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-trace\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"traceContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare trace runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TRACE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTraceContext>()) as AsyncLocalStorage<CloudflareTraceContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare trace runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare trace runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTraceContext<Env>\">\n {code`const context = traceContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare trace context is not available. Ensure that you are calling this function within the scope of a Cloudflare trace operation.\");\n}\nreturn context as CloudflareTraceContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare trace context. This is typically used to set up the context for handling a Cloudflare trace operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTraceContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare trace context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTraceContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTraceContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return traceContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the test context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"controller\"\n type=\"TestController\"\n doc=\"The test controller associated with the Cloudflare test context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the test operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TEST_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-test\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"testContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare test runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TEST_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTestContext>()) as AsyncLocalStorage<CloudflareTestContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare test runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare test runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTestContext<Env>\">\n {code`const context = testContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare test context is not available. Ensure that you are calling this function within the scope of a Cloudflare test operation.\");\n}\nreturn context as CloudflareTestContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare test context. This is typically used to set up the context for handling a Cloudflare test operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTestContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare test context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTestContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTestContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return testContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0CA,SAAgBa,kBAAkBC,OAA+B;CAC/D,MAAM,CAAC,EAAEC,SAASC,YAAYC,QAAQf,WAAWY,OAAO,CACtD,WACA,WACD,CAAC;AAEF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BACtFR,YAAU;QAACY,MAAI;QAAAN,UAAahB,IAAI;QAAmE,CAAA;OAAAkB,gBACnGP,cAAY,EAAAK,UAAEhB,IAAI,wCAAsC,CAAA;OAAA;;KAAA,CAAA;IAAAkB,gBAE1Df,qBAAmB;KAAA,UAAA;KAElBmB,MAAI;KACJG,gBAAgB,CAAC;MAAEH,MAAM;MAAOI,SAAS;MAAsB,CAAC;KAChEI,YAAY,CACV;MACER,MAAM;MACNC,MAAM;MACP,EACD;MACED,MAAM;MACNC,MAAM;MACP,CACF;KACDQ,YAAU;KAAAf,UACThB,IAAI;KAAmE,CAAA;IAAAkB,gBAEzEb,SAAO,EAAA,CAAA;IAAAa,gBACPb,SAAO,EAAA,CAAA;IAAAa,gBACPjB,MAAI;KAAA,IAAC+B,OAAI;AAAA,aAAEC,QAAQjB,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env-builtin";
|
|
3
|
-
|
|
4
|
-
//#region src/components/env-builtin.d.ts
|
|
5
|
-
type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, "defaultConfig">;
|
|
6
|
-
/**
|
|
7
|
-
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
8
|
-
*/
|
|
9
|
-
declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): _alloy_js_core0.Children;
|
|
10
|
-
declare type __ΩCloudflareEnvBuiltinProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps };
|
|
13
|
-
//# sourceMappingURL=env-builtin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":[],"mappings":";;;;KA0BY,yBAAA,GAA4B,KAAK;;;AAA7C;AAKgB,iBAAA,oBAAA,CAA4B,KAAA,EAAA,yBAAyB,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env-builtin";
|
|
3
|
-
|
|
4
|
-
//#region src/components/env-builtin.d.ts
|
|
5
|
-
type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, "defaultConfig">;
|
|
6
|
-
/**
|
|
7
|
-
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
8
|
-
*/
|
|
9
|
-
declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): _alloy_js_core0.Children;
|
|
10
|
-
declare type __ΩCloudflareEnvBuiltinProps = any[];
|
|
11
|
-
//#endregion
|
|
12
|
-
export { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps };
|
|
13
|
-
//# sourceMappingURL=env-builtin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":[],"mappings":";;;;KA0BY,yBAAA,GAA4B,KAAK;;;AAA7C;AAKgB,iBAAA,oBAAA,CAA4B,KAAA,EAAA,yBAAyB,CAAA,EAAA,eAAA,CAAA,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.mjs","names":["code","Show","splitProps","Spacing","EnvBuiltin","defu","CloudflareEnvBuiltin","props","children","imports","rest","_$createComponent","_$mergeProps","defaultConfig","when","Boolean"],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n EnvBuiltin,\n EnvBuiltinProps\n} from \"@powerlines/plugin-env/components/env-builtin\";\nimport defu from \"defu\";\n\nexport type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, \"defaultConfig\">;\n\n/**\n * Generates the Cloudflare environment configuration module for the Powerlines project.\n */\nexport function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps) {\n const [{ children, imports }, rest] = splitProps(props, [\n \"children\",\n \"imports\"\n ]);\n\n return (\n <EnvBuiltin\n defaultConfig={code`env`}\n {...rest}\n imports={defu(\n {\n \"cloudflare:workers\": [\"env\"]\n },\n imports ?? {}\n )}>\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EnvBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;AA+BA,SAAgBM,qBAAqBC,OAAkC;CACrE,MAAM,CAAC,EAAEC,UAAUC,WAAWC,QAAQR,WAAWK,OAAO,CACtD,YACA,UACD,CAAC;AAEF,QAAAI,gBACGP,YAAUQ,WAAA,EACTC,eAAeb,IAAI,OAAK,EACpBU,MAAI;EAAA,IACRD,UAAO;AAAA,UAAEJ,KACP,EACE,sBAAsB,CAAC,MAAK,EAC7B,EACDI,WAAW,EACb,CAAC;;EAAA,IAAAD,WAAA;AAAA,UAAA,CAAAG,gBACAR,SAAO,EAAA,CAAA,EAAAQ,gBACPV,MAAI;IAAA,IAACa,OAAI;AAAA,YAAEC,QAAQP,SAAS;;IAAGA;IAAQ,CAAA,CAAA;;EAAA,CAAA,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps } from "./cloudflare-builtin.cjs";
|
|
2
|
-
import { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps } from "./env-builtin.cjs";
|
|
3
|
-
import { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps } from "./worker-entry.cjs";
|
|
4
|
-
export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, WorkerEntry, WorkerEntryProps, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩWorkerEntryProps };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps } from "./cloudflare-builtin.mjs";
|
|
2
|
-
import { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps } from "./env-builtin.mjs";
|
|
3
|
-
import { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps } from "./worker-entry.mjs";
|
|
4
|
-
export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, WorkerEntry, WorkerEntryProps, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩWorkerEntryProps };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CloudflareWorkerEntryModule } from "../types/plugin.cjs";
|
|
2
|
-
import "../types/index.cjs";
|
|
3
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
4
|
-
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
5
|
-
|
|
6
|
-
//#region src/components/worker-entry.d.ts
|
|
7
|
-
type WorkerEntryProps = Partial<EntryFileProps> & Omit<EntryFileProps, "path"> & {
|
|
8
|
-
worker: CloudflareWorkerEntryModule;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.
|
|
12
|
-
*/
|
|
13
|
-
declare function WorkerEntry(props: WorkerEntryProps): _alloy_js_core0.Children;
|
|
14
|
-
declare type __ΩWorkerEntryProps = any[];
|
|
15
|
-
//#endregion
|
|
16
|
-
export { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps };
|
|
17
|
-
//# sourceMappingURL=worker-entry.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.d.cts","names":[],"sources":["../../src/components/worker-entry.tsx"],"sourcesContent":[],"mappings":";;;;;;KA+BY,gBAAA,GAAmB,QAAQ,kBACrC,KAAK;UACK;;;AAFZ;;AAA+B,iBAQf,WAAA,CARe,KAAA,EAQI,gBARJ,CAAA,EAQoB,eAAA,CAAA,QARpB;AACxB,mCAAA,GAAA,EAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CloudflareWorkerEntryModule } from "../types/plugin.mjs";
|
|
2
|
-
import "../types/index.mjs";
|
|
3
|
-
import * as _alloy_js_core0 from "@alloy-js/core";
|
|
4
|
-
import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
5
|
-
|
|
6
|
-
//#region src/components/worker-entry.d.ts
|
|
7
|
-
type WorkerEntryProps = Partial<EntryFileProps> & Omit<EntryFileProps, "path"> & {
|
|
8
|
-
worker: CloudflareWorkerEntryModule;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.
|
|
12
|
-
*/
|
|
13
|
-
declare function WorkerEntry(props: WorkerEntryProps): _alloy_js_core0.Children;
|
|
14
|
-
declare type __ΩWorkerEntryProps = any[];
|
|
15
|
-
//#endregion
|
|
16
|
-
export { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps };
|
|
17
|
-
//# sourceMappingURL=worker-entry.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.d.mts","names":[],"sources":["../../src/components/worker-entry.tsx"],"sourcesContent":[],"mappings":";;;;;;KA+BY,gBAAA,GAAmB,QAAQ,kBACrC,KAAK;UACK;;;AAFZ;;AAA+B,iBAQf,WAAA,CARe,KAAA,EAQI,gBARJ,CAAA,EAQoB,eAAA,CAAA,QARpB;AACxB,mCAAA,GAAA,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.mjs","names":["code","computed","Show","splitProps","Spacing","usePowerlines","EntryFile","murmurhash","relativePath","replaceExtension","defu","WorkerEntry","props","worker","children","imports","builtinImports","rest","context","entryPath","entry","input","file","_$createComponent","_$mergeProps","path","maxLength","name","type","value","cloudflare","_$createIntrinsic","when","fetch","tail","trace","tailStream","scheduled","test","email","queue","Boolean"],"sources":["../../src/components/worker-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts\";\nimport {\n EntryFile,\n EntryFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { relativePath } from \"@stryke/path/find\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { CloudflarePluginContext, CloudflareWorkerEntryModule } from \"../types\";\n\nexport type WorkerEntryProps = Partial<EntryFileProps> &\n Omit<EntryFileProps, \"path\"> & {\n worker: CloudflareWorkerEntryModule;\n };\n\n/**\n * Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.\n */\nexport function WorkerEntry(props: WorkerEntryProps) {\n const [{ worker, children, imports, builtinImports }, rest] = splitProps(\n props,\n [\"worker\", \"children\", \"imports\", \"builtinImports\"]\n );\n\n const context = usePowerlines<CloudflarePluginContext>();\n const entryPath = computed(\n () =>\n `./${replaceExtension(\n relativePath(\n context.entryPath,\n worker.entry.input?.file || worker.entry.file\n )\n )}`\n );\n\n return (\n <EntryFile\n path={`worker-${murmurhash(worker.entry, {\n maxLength: 8\n })}-entry.ts`}\n {...rest}\n imports={defu(\n {\n \"@cloudflare/workers-types\": [\n { name: \"Request\", type: true },\n { name: \"Response\", type: true },\n { name: \"ExecutionContext\", type: true },\n { name: \"IncomingRequestCfProperties\", type: true },\n { name: \"ScheduledController\", type: true },\n { name: \"ForwardableEmailMessage\", type: true },\n { name: \"MessageBatch\", type: true },\n { name: \"TailStream\", type: true },\n { name: \"TraceItem\", type: true },\n { name: \"TailStream.TailEvent\", type: true },\n { name: \"TailStream.Onset\", type: true },\n { name: \"TailStream.TailEventHandlerType\", type: true }\n ],\n [entryPath.value]: \"worker\"\n },\n imports ?? {}\n )}\n builtinImports={defu(\n {\n cloudflare: [\n \"withFetchContext\",\n \"withTailContext\",\n \"withTraceContext\",\n \"withTailStreamContext\",\n \"withScheduledContext\",\n \"withTestContext\",\n \"withEmailContext\",\n \"withQueueContext\"\n ]\n },\n builtinImports ?? {}\n )}>\n {code`export default { `}\n <hbr />\n <Show when={worker.fetch}>\n {code` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {\n return await withFetchContext({ request, env, ctx }, async (context) => {\n return worker.fetch(context.request, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.tail}>\n {code` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTailContext({ events, env, ctx }, async (context) => {\n return worker.tail(context.events, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.trace}>\n {code` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTraceContext({ traces, env, ctx }, async (context) => {\n return worker.trace(context.traces, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.tailStream}>\n {code` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {\n return await withTailStreamContext({ event, env, ctx }, async (context) => {\n return await worker.tailStream(context.event, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.scheduled}>\n {code` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withScheduledContext({ controller, env, ctx }, async (context) => {\n return worker.scheduled(context.controller, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.test}>\n {code` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTestContext({ controller, env, ctx }, async (context) => {\n return worker.test(context.controller, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.email}>\n {code` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withEmailContext({ message, env, ctx }, async (context) => {\n return worker.email(context.message, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.queue}>\n {code` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withQueueContext({ batch, env, ctx }, async (context) => {\n return worker.queue(context.batch, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n {code` } satisfies ExportedHandler<CloudflareBindings>; `}\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EntryFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAuCA,SAAgBW,YAAYC,OAAyB;CACnD,MAAM,CAAC,EAAEC,QAAQC,UAAUC,SAASC,kBAAkBC,QAAQd,WAC5DS,OACA;EAAC;EAAU;EAAY;EAAW;EACpC,CAAC;CAED,MAAMM,UAAUb,eAAwC;CACxD,MAAMc,YAAYlB,eAEd,KAAKQ,iBACHD,aACEU,QAAQC,WACRN,OAAOO,MAAMC,OAAOC,QAAQT,OAAOO,MAAME,KAE7C,CAAC,GACJ;AAED,QAAAC,gBACGjB,WAASkB,WAAA,EAAA,IACRC,OAAI;AAAA,SAAE,UAAUlB,WAAWM,OAAOO,OAAO,EACvCM,WAAW,GACZ,CAAC,CAAA;IAAW,EACTT,MAAI;EAAA,IACRF,UAAO;AAAA,UAAEL,KACP;IACE,6BAA6B;KAC3B;MAAEiB,MAAM;MAAWC,MAAM;MAAM;KAC/B;MAAED,MAAM;MAAYC,MAAM;MAAM;KAChC;MAAED,MAAM;MAAoBC,MAAM;MAAM;KACxC;MAAED,MAAM;MAA+BC,MAAM;MAAM;KACnD;MAAED,MA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B,gBAAA,OAAA,EAAA,CAAA;IAAAR,gBAGHrB,MAAI;KAAA,IAAC8B,OAAI;AAAA,aAAEnB,OAAOyB;;KAAIxB,UACpBd,IAAI;;;;;KAIH,CAAA;IAAA+B,gBAAA,OAAA,EAAA,CAAA;IAAAR,gBAGHrB,MAAI;KAAA,IAAC8B,OAAI;AAAA,aAAEnB,OAAO0B;;KAAKzB,UACrBd,IAAI;;;;;KAIH,CAAA;IAAA+B,gBAAA,OAAA,EAAA,CAAA;IAAAR,gBAGHrB,MAAI;KAAA,IAAC8B,OAAI;AAAA,aAAEnB,OAAO2B;;KAAK1B,UACrBd,IAAI;;;;;KAIH,CAAA;IAAA+B,gBAAA,OAAA,EAAA,CAAA;IAGH/B,IAAI;IAAoDuB,gBACxDnB,SAAO,EAAA,CAAA;IAAAmB,gBACPrB,MAAI;KAAA,IAAC8B,OAAI;AAAA,aAAES,QAAQ3B,SAAS;;KAAGA;KAAQ,CAAA;IAAA;;EAAA,CAAA,CAAA"}
|
package/dist/index.d.cts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps } from "./components/cloudflare-builtin.cjs";
|
|
2
|
-
import { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps } from "./components/env-builtin.cjs";
|
|
3
|
-
import { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule } from "./types/plugin.cjs";
|
|
4
|
-
import "./types/index.cjs";
|
|
5
|
-
import { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps } from "./components/worker-entry.cjs";
|
|
6
|
-
import "./components/index.cjs";
|
|
7
|
-
import { Plugin } from "powerlines";
|
|
8
|
-
|
|
9
|
-
//#region src/index.d.ts
|
|
10
|
-
declare module "powerlines" {
|
|
11
|
-
interface Config {
|
|
12
|
-
cloudflare?: CloudflarePluginOptions;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
17
|
-
*/
|
|
18
|
-
declare function plugin<TContext extends CloudflarePluginContext = CloudflarePluginContext>(options?: CloudflarePluginOptions): Plugin<TContext>[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, WorkerEntry, WorkerEntryProps, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule, __ΩWorkerEntryProps, plugin as default, plugin };
|
|
21
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;iBA0CiB;;;AAJY;;;AAIW,iBAOxB,MAPwB,CAAA,iBAQrB,uBARqB,GAQK,uBARL,CAAA,CAAA,OAAA,CAAA,EAS7B,uBAT6B,CAAA,EA8GjC,MA9GiC,CA8G1B,QA9G0B,CAAA,EAAA"}
|
package/dist/index.d.mts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps } from "./components/cloudflare-builtin.mjs";
|
|
2
|
-
import { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps } from "./components/env-builtin.mjs";
|
|
3
|
-
import { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule } from "./types/plugin.mjs";
|
|
4
|
-
import "./types/index.mjs";
|
|
5
|
-
import { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps } from "./components/worker-entry.mjs";
|
|
6
|
-
import "./components/index.mjs";
|
|
7
|
-
import { Plugin } from "powerlines";
|
|
8
|
-
|
|
9
|
-
//#region src/index.d.ts
|
|
10
|
-
declare module "powerlines" {
|
|
11
|
-
interface Config {
|
|
12
|
-
cloudflare?: CloudflarePluginOptions;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
17
|
-
*/
|
|
18
|
-
declare function plugin<TContext extends CloudflarePluginContext = CloudflarePluginContext>(options?: CloudflarePluginOptions): Plugin<TContext>[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, WorkerEntry, WorkerEntryProps, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule, __ΩWorkerEntryProps, plugin as default, plugin };
|
|
21
|
-
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;iBA0CiB;;;AAJY;;;AAIW,iBAOxB,MAPwB,CAAA,iBAQrB,uBARqB,GAQK,uBARL,CAAA,CAAA,OAAA,CAAA,EAS7B,uBAT6B,CAAA,EA8GjC,MA9GiC,CA8G1B,QA9G0B,CAAA,EAAA"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["For","render","readEnvTypeReflection","resolveModule","pulumiCloudflare","joinPaths","kebabCase","isFunction","defu","CloudflareEnvBuiltin","CloudflareBuiltin","WorkerEntry","plugin","options","name","config","cloudflare","configResolved","devDependencies","prepare","result","_$createComponent","reflection","build","order","handler","_self$","workers","Promise","all","entry","map","input","Error","workerModule","default","fetch","tail","trace","tailStream","scheduled","test","email","queue","each","children","worker","deployPulumi","apiToken","process","env","CLOUDFLARE_API_TOKEN","warn","pulumi","setConfig","value","WorkersScript","accountId","scriptName","contentFile","output","outputPath"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core\";\nimport { ExportedHandler } from \"@cloudflare/workers-types\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { readEnvTypeReflection } from \"@powerlines/plugin-env/helpers\";\nimport { resolveModule } from \"@powerlines/plugin-esbuild/helpers/resolve\";\nimport * as pulumiCloudflare from \"@pulumi/cloudflare\";\nimport { joinPaths } from \"@stryke/path\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { CloudflareEnvBuiltin } from \"./components\";\nimport { CloudflareBuiltin } from \"./components/cloudflare-builtin\";\nimport { WorkerEntry } from \"./components/worker-entry\";\nimport {\n CloudflarePluginContext,\n CloudflarePluginOptions\n} from \"./types/plugin\";\n\nexport * from \"./components\";\nexport type * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n cloudflare?: CloudflarePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport function plugin<\n TContext extends CloudflarePluginContext = CloudflarePluginContext\n>(options: CloudflarePluginOptions = {}) {\n return [\n {\n name: \"cloudflare\",\n config() {\n return {\n cloudflare: defu(options, {})\n };\n },\n configResolved() {\n this.devDependencies[\"@cloudflare/workers-types\"] = \"^4.20240616.0\";\n },\n async prepare() {\n const result = await readEnvTypeReflection(this, \"env\");\n\n return render(\n this,\n <>\n <CloudflareBuiltin />\n <CloudflareEnvBuiltin reflection={result} />\n </>\n );\n },\n build: {\n order: \"pre\",\n async handler() {\n this.workers = await Promise.all(\n this.entry.map(async entry => {\n if (!entry.input) {\n throw new Error(\n `Cloudflare Worker entry \"${entry.name}\" is missing an input file.`\n );\n }\n\n const workerModule = await resolveModule<{\n default: ExportedHandler;\n }>(this, entry.input);\n if (!workerModule?.default) {\n throw new Error(\n `Cloudflare Worker entry \"${\n entry.name\n }\" does not export a default handler. The Powerlines Cloudflare plugin expects each Worker entry module to export a default object matching the \\`ExportedHandler\\` interface from \"@cloudflare/workers-types\".`\n );\n }\n\n return {\n entry,\n fetch: isFunction(workerModule.default.fetch),\n tail: isFunction(workerModule.default.tail),\n trace: isFunction(workerModule.default.trace),\n tailStream: isFunction(workerModule.default.tailStream),\n scheduled: isFunction(workerModule.default.scheduled),\n test: isFunction(workerModule.default.test),\n email: isFunction(workerModule.default.email),\n queue: isFunction(workerModule.default.queue)\n };\n })\n );\n\n return render(\n this,\n <For each={this.workers}>\n {worker => <WorkerEntry worker={worker} />}\n </For>\n );\n }\n },\n async deployPulumi() {\n let apiToken = process.env.CLOUDFLARE_API_TOKEN;\n if (!apiToken) {\n apiToken = this.config.cloudflare.apiToken;\n if (apiToken) {\n this.warn(\n \"If possible, please use the `CLOUDFLARE_API_TOKEN` environment variable instead of using the `apiToken` option directly. The `apiToken` option will work; however, this is a less secure method of configuration.\"\n );\n } else {\n throw new Error(\n \"Unable to determine the Cloudflare API token. Please set the `CLOUDFLARE_API_TOKEN` environment variable.\"\n );\n }\n }\n\n await this.pulumi.setConfig(\"cloudflare:apiToken\", {\n value: apiToken\n });\n\n const worker = new pulumiCloudflare.WorkersScript(\n `${kebabCase(this.config.name)}-worker`,\n {\n accountId: this.config.cloudflare.accountId,\n scriptName:\n this.config.cloudflare.scriptName || kebabCase(this.config.name),\n contentFile: joinPaths(this.config.output.outputPath, \"index.js\")\n }\n );\n\n return {\n worker\n };\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiDA,SAAgBY,OAEdC,UAAmC,EAAE,EAAE;AACvC,QAAO,CACL;EACEC,MAAM;EACNC,SAAS;AACP,UAAO,EACLC,YAAYR,KAAKK,SAAS,EAAE,CAAA,EAC7B;;EAEHI,iBAAiB;AACf,QAAKC,gBAAgB,+BAA+B;;EAEtD,MAAMC,UAAU;GACd,MAAMC,SAAS,MAAMlB,sBAAsB,MAAM,MAAM;AAEvD,UAAOD,OACL,MAAI,CAAAoB,gBAEDX,mBAAiB,EAAA,CAAA,EAAAW,gBACjBZ,sBAAoB,EAACa,YAAYF,QAAM,CAAA,CAE5C,CAAC;;EAEHG,OAAO;GACLC,OAAO;GACP,MAAMC,UAAU;IAAA,MAAAC,SAAA;AACd,SAAKC,UAAU,MAAMC,QAAQC,IAC3B,KAAKC,MAAMC,IAAI,OAAMD,UAAS;AAC5B,SAAI,CAACA,MAAME,MACT,OAAM,IAA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,OAAOC,YAAY,WAAU;IAEpE,CAAC,EAIA;;EAEJ,CACF;;AAGH,kBAAejD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-words.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.17.1/node_modules/@stryke/string-format/dist/get-words.mjs"],"sourcesContent":["//#region src/get-words.ts\n/**\n* Regular expression pattern to split strings into words for various case conversions\n*\n* This pattern matches sequences of characters in a string, considering the following case:\n* - Sequences of two or more uppercase letters followed by an uppercase letter and lowercase letters or digits (for acronyms)\n* - Sequences of one uppercase letter optionally followed by lowercase letters and digits\n* - Single uppercase letters\n* - Sequences of digits\n*\n* The resulting match can be used to convert camelCase, snake_case, kebab-case, and other mixed formats into\n* a consistent format like snake case.\n*\n* @example\n* const matches = 'camelCaseHTTPRequest'.match(CASE_SPLIT_PATTERN);\n* // matches: ['camel', 'Case', 'HTTP', 'Request']\n*/\nconst CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\\d+|[A-Z]+(?![a-z])/g;\nconst RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\\d+|[A-Z/.-]+(?![a-z/.-])/g;\n/**\n* Splits a string into words using a regular expression pattern\n*\n* @example\n* const words = getWords('camelCaseHTTPRequest');\n* // words: ['camel', 'Case', 'HTTP', 'Request']\n*\n* @param str - The string to split into words\n* @param options - Options for splitting the string\n* @returns An array of words\n*/\nfunction getWords(str, options = {}) {\n\tif (str.length > 5e3) throw new Error(\"The regular expression parameter of `get-words` can't handle strings longer than 2000 characters\");\n\treturn [...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []];\n}\n\n//#endregion\nexport { CASE_SPLIT_PATTERN, RELAXED_SPLIT_PATTERN, getWords };\n//# sourceMappingURL=get-words.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;;;;;;;;;;;;AAY9B,SAAS,SAAS,KAAK,UAAU,EAAE,EAAE;AACpC,KAAI,IAAI,SAAS,IAAK,OAAM,IAAI,MAAM,mGAAmG;AACzI,QAAO,CAAC,GAAG,IAAI,MAAM,QAAQ,UAAU,QAAQ,UAAU,wBAAwB,oBAAoB,IAAI,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kebab-case.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+string-format@0.17.1/node_modules/@stryke/string-format/dist/kebab-case.mjs"],"sourcesContent":["import { getWords } from \"./get-words.mjs\";\n\n//#region src/kebab-case.ts\n/**\n* Check if the input string is in kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string to check.\n* @returns True if the input is in kebab case, false otherwise.\n*/\nfunction isKebabCase(input) {\n\treturn input ? /^[a-z]+(?:-[a-z0-9]+)*$/.test(input) : false;\n}\n/**\n* Convert the input string to kebab case.\n*\n* @remarks\n* Kebab case is defined as all lowercase letters with hyphens separating words - \"this-is-an-example\".\n*\n* @param input - The input string.\n* @returns The kebab-cased string.\n*/\nfunction kebabCase(input) {\n\tif (isKebabCase(input) || input === void 0) return input;\n\tconst parts = input ? getWords(input) : [];\n\tif (parts.length === 0) return \"\";\n\treturn parts.join(\"-\").toLowerCase();\n}\n\n//#endregion\nexport { isKebabCase, kebabCase };\n//# sourceMappingURL=kebab-case.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;AAYA,SAAS,YAAY,OAAO;AAC3B,QAAO,QAAQ,0BAA0B,KAAK,MAAM,GAAG;;;;;;;;;;;AAWxD,SAAS,UAAU,OAAO;AACzB,KAAI,YAAY,MAAM,IAAI,UAAU,KAAK,EAAG,QAAO;CACnD,MAAM,QAAQ,QAAQ,SAAS,MAAM,GAAG,EAAE;AAC1C,KAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAO,MAAM,KAAK,IAAI,CAAC,aAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-object-tag.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.36/node_modules/@stryke/type-checks/dist/get-object-tag.mjs"],"sourcesContent":["//#region src/get-object-tag.ts\n/**\n* Gets the `toStringTag` of `obj`.\n*\n* @param value - The obj to query.\n* @returns Returns the `toStringTag`.\n*/\nconst getObjectTag = (value) => {\n\tif (value == null) return value === void 0 ? \"[object Undefined]\" : \"[object Null]\";\n\treturn Object.prototype.toString.call(value);\n};\n\n//#endregion\nexport { getObjectTag };\n//# sourceMappingURL=get-object-tag.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,UAAU;AAC/B,KAAI,SAAS,KAAM,QAAO,UAAU,KAAK,IAAI,uBAAuB;AACpE,QAAO,OAAO,UAAU,SAAS,KAAK,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-function.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@stryke+type-checks@0.5.36/node_modules/@stryke/type-checks/dist/is-function.mjs"],"sourcesContent":["import { getObjectTag } from \"./get-object-tag.mjs\";\n\n//#region src/is-function.ts\nfunction isSyncFunction(value) {\n\treturn getObjectTag(value) === \"[object Function]\";\n}\nfunction isAsyncFunction(value) {\n\treturn getObjectTag(value) === \"[object AsyncFunction]\";\n}\n/**\n* Check if the provided value's type is `Function`\n*\n* @param value - The value to type check\n* @returns An indicator specifying if the value provided is of type `Function`\n*/\nconst isFunction = (value) => {\n\ttry {\n\t\treturn value instanceof Function || typeof value === \"function\" || Boolean(value?.constructor && value?.call && value?.apply) || isSyncFunction(value) || isAsyncFunction(value);\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n//#endregion\nexport { isAsyncFunction, isFunction, isSyncFunction };\n//# sourceMappingURL=is-function.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,SAAS,eAAe,OAAO;AAC9B,QAAO,aAAa,MAAM,KAAK;;AAEhC,SAAS,gBAAgB,OAAO;AAC/B,QAAO,aAAa,MAAM,KAAK;;;;;;;;AAQhC,MAAM,cAAc,UAAU;AAC7B,KAAI;AACH,SAAO,iBAAiB,YAAY,OAAO,UAAU,cAAc,QAAQ,OAAO,eAAe,OAAO,QAAQ,OAAO,MAAM,IAAI,eAAe,MAAM,IAAI,gBAAgB,MAAM;SACzK;AACP,SAAO"}
|
package/dist/types/index.d.cts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule } from "./plugin.cjs";
|
|
2
|
-
export { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule };
|
package/dist/types/index.d.mts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule } from "./plugin.mjs";
|
|
2
|
-
export { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule };
|
package/dist/types/plugin.d.cts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ExportedHandler } from "@cloudflare/workers-types";
|
|
2
|
-
import { EnvPluginContext, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env";
|
|
3
|
-
import { PulumiPluginContext, PulumiPluginResolvedConfig, PulumiPluginUserConfig } from "@powerlines/plugin-pulumi";
|
|
4
|
-
import { PluginContext, ResolvedEntryTypeDefinition } from "powerlines";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
interface CloudflarePluginOptions {
|
|
8
|
-
/**
|
|
9
|
-
* The Cloudflare account ID to use for the plugin.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* This is required for certain features of the plugin, such as deploying a Cloudflare Worker entry module. This option can also be set via the `CLOUDFLARE_ACCOUNT_ID` environment variable. If both are provided, the value from the plugin options will take precedence.
|
|
13
|
-
*
|
|
14
|
-
* @see https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/
|
|
15
|
-
*/
|
|
16
|
-
accountId?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The Cloudflare API token to use for the plugin.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This option can also be set via the `CLOUDFLARE_API_TOKEN` environment variable. If both are provided, the value from the plugin options will take precedence.
|
|
22
|
-
*
|
|
23
|
-
* @see https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
|
|
24
|
-
*/
|
|
25
|
-
apiToken?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The domain to use for the Cloudflare deployed resources.
|
|
28
|
-
*/
|
|
29
|
-
domain?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The name of the Cloudflare Worker script to deploy - used in URLs and route configuration.
|
|
32
|
-
*
|
|
33
|
-
* @remarks
|
|
34
|
-
* If no value is provided, the {@link Config.name} configuration value will be used.
|
|
35
|
-
*/
|
|
36
|
-
scriptName?: string;
|
|
37
|
-
}
|
|
38
|
-
type CloudflarePluginUserConfig = EnvPluginUserConfig & PulumiPluginUserConfig & {
|
|
39
|
-
/**
|
|
40
|
-
* Options for the Cloudflare plugin.
|
|
41
|
-
*/
|
|
42
|
-
cloudflare?: CloudflarePluginOptions;
|
|
43
|
-
};
|
|
44
|
-
type CloudflarePluginResolvedConfig = EnvPluginResolvedConfig & PulumiPluginResolvedConfig & {
|
|
45
|
-
/**
|
|
46
|
-
* Options for the Cloudflare plugin.
|
|
47
|
-
*/
|
|
48
|
-
cloudflare: Required<CloudflarePluginOptions>;
|
|
49
|
-
};
|
|
50
|
-
type CloudflareWorkerEntryModule = Record<keyof ExportedHandler, boolean> & {
|
|
51
|
-
entry: ResolvedEntryTypeDefinition;
|
|
52
|
-
};
|
|
53
|
-
type CloudflarePluginContext<TResolvedConfig extends CloudflarePluginResolvedConfig = CloudflarePluginResolvedConfig> = PluginContext<TResolvedConfig> & EnvPluginContext<TResolvedConfig> & PulumiPluginContext<TResolvedConfig> & {
|
|
54
|
-
workers: CloudflareWorkerEntryModule[];
|
|
55
|
-
};
|
|
56
|
-
declare type __ΩCloudflarePluginOptions = any[];
|
|
57
|
-
declare type __ΩCloudflarePluginUserConfig = any[];
|
|
58
|
-
declare type __ΩCloudflarePluginResolvedConfig = any[];
|
|
59
|
-
declare type __ΩCloudflareWorkerEntryModule = any[];
|
|
60
|
-
declare type __ΩCloudflarePluginContext = any[];
|
|
61
|
-
//#endregion
|
|
62
|
-
export { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule };
|
|
63
|
-
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;UA+BiB,uBAAA;;AAAjB;AAmCA;;;;;AAQA;EAA6C,SAAA,CAAA,EAAA,MAAA;EAC3C;;;;AAOF;;;;EAIoC,QAAA,CAAA,EAAA,MAAA;EAGxB;;;EAGM,MAAA,CAAA,EAAA,MAAA;EAAd;;;;;;EAGoC,UAAA,CAAA,EAAA,MAAA;;KA7B5B,0BAAA,GAA6B,sBACvC;;;;eAIe;;KAGL,8BAAA,GAAiC,0BAC3C;;;;cAIc,SAAS;;KAGb,2BAAA,GAA8B,aAClC;SAGC;;KAGG,gDACc,iCACtB,kCACA,cAAc,mBAChB,iBAAiB,mBACjB,oBAAoB;WACT"}
|
package/dist/types/plugin.d.mts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { ExportedHandler } from "@cloudflare/workers-types";
|
|
2
|
-
import { EnvPluginContext, EnvPluginResolvedConfig, EnvPluginUserConfig } from "@powerlines/plugin-env";
|
|
3
|
-
import { PulumiPluginContext, PulumiPluginResolvedConfig, PulumiPluginUserConfig } from "@powerlines/plugin-pulumi";
|
|
4
|
-
import { PluginContext, ResolvedEntryTypeDefinition } from "powerlines";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
interface CloudflarePluginOptions {
|
|
8
|
-
/**
|
|
9
|
-
* The Cloudflare account ID to use for the plugin.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* This is required for certain features of the plugin, such as deploying a Cloudflare Worker entry module. This option can also be set via the `CLOUDFLARE_ACCOUNT_ID` environment variable. If both are provided, the value from the plugin options will take precedence.
|
|
13
|
-
*
|
|
14
|
-
* @see https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/
|
|
15
|
-
*/
|
|
16
|
-
accountId?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The Cloudflare API token to use for the plugin.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* This option can also be set via the `CLOUDFLARE_API_TOKEN` environment variable. If both are provided, the value from the plugin options will take precedence.
|
|
22
|
-
*
|
|
23
|
-
* @see https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
|
|
24
|
-
*/
|
|
25
|
-
apiToken?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The domain to use for the Cloudflare deployed resources.
|
|
28
|
-
*/
|
|
29
|
-
domain?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The name of the Cloudflare Worker script to deploy - used in URLs and route configuration.
|
|
32
|
-
*
|
|
33
|
-
* @remarks
|
|
34
|
-
* If no value is provided, the {@link Config.name} configuration value will be used.
|
|
35
|
-
*/
|
|
36
|
-
scriptName?: string;
|
|
37
|
-
}
|
|
38
|
-
type CloudflarePluginUserConfig = EnvPluginUserConfig & PulumiPluginUserConfig & {
|
|
39
|
-
/**
|
|
40
|
-
* Options for the Cloudflare plugin.
|
|
41
|
-
*/
|
|
42
|
-
cloudflare?: CloudflarePluginOptions;
|
|
43
|
-
};
|
|
44
|
-
type CloudflarePluginResolvedConfig = EnvPluginResolvedConfig & PulumiPluginResolvedConfig & {
|
|
45
|
-
/**
|
|
46
|
-
* Options for the Cloudflare plugin.
|
|
47
|
-
*/
|
|
48
|
-
cloudflare: Required<CloudflarePluginOptions>;
|
|
49
|
-
};
|
|
50
|
-
type CloudflareWorkerEntryModule = Record<keyof ExportedHandler, boolean> & {
|
|
51
|
-
entry: ResolvedEntryTypeDefinition;
|
|
52
|
-
};
|
|
53
|
-
type CloudflarePluginContext<TResolvedConfig extends CloudflarePluginResolvedConfig = CloudflarePluginResolvedConfig> = PluginContext<TResolvedConfig> & EnvPluginContext<TResolvedConfig> & PulumiPluginContext<TResolvedConfig> & {
|
|
54
|
-
workers: CloudflareWorkerEntryModule[];
|
|
55
|
-
};
|
|
56
|
-
declare type __ΩCloudflarePluginOptions = any[];
|
|
57
|
-
declare type __ΩCloudflarePluginUserConfig = any[];
|
|
58
|
-
declare type __ΩCloudflarePluginResolvedConfig = any[];
|
|
59
|
-
declare type __ΩCloudflareWorkerEntryModule = any[];
|
|
60
|
-
declare type __ΩCloudflarePluginContext = any[];
|
|
61
|
-
//#endregion
|
|
62
|
-
export { CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule };
|
|
63
|
-
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;UA+BiB,uBAAA;;AAAjB;AAmCA;;;;;AAQA;EAA6C,SAAA,CAAA,EAAA,MAAA;EAC3C;;;;AAOF;;;;EAIoC,QAAA,CAAA,EAAA,MAAA;EAGxB;;;EAGM,MAAA,CAAA,EAAA,MAAA;EAAd;;;;;;EAGoC,UAAA,CAAA,EAAA,MAAA;;KA7B5B,0BAAA,GAA6B,sBACvC;;;;eAIe;;KAGL,8BAAA,GAAiC,0BAC3C;;;;cAIc,SAAS;;KAGb,2BAAA,GAA8B,aAClC;SAGC;;KAGG,gDACc,iCACtB,kCACA,cAAc,mBAChB,iBAAiB,mBACjB,oBAAoB;WACT"}
|