@powerlines/plugin-cloudflare 0.6.130 → 0.6.132

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.
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
3
2
 
4
3
  //#region src/components/cloudflare-builtin.d.ts
@@ -6,7 +5,7 @@ type CloudflareBuiltinProps = Partial<BuiltinFileProps> & Omit<BuiltinFileProps,
6
5
  /**
7
6
  * Generates the Cloudflare environment configuration module for the Powerlines project.
8
7
  */
9
- declare function CloudflareBuiltin(props: CloudflareBuiltinProps): _$_alloy_js_core0.Children;
8
+ declare function CloudflareBuiltin(props: CloudflareBuiltinProps): import("@alloy-js/core").Children;
10
9
  declare type __ΩCloudflareBuiltinProps = any[];
11
10
  //#endregion
12
11
  export { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps };
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare-builtin.d.cts","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"mappings":";;;;KAoCY,sBAAA,GAAyB,OAAA,CAAQ,gBAAA,IAC3C,IAAA,CAAK,gBAAA;;;AADP;iBAMgB,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,iBAAA,CAAA,QAAA;AAAA"}
1
+ {"version":3,"file":"cloudflare-builtin.d.cts","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"mappings":";;;KAoCY,sBAAA,GAAyB,OAAA,CAAQ,gBAAA,IAC3C,IAAA,CAAK,gBAAA;;AADP;;iBAMgB,iBAAA,CAAkB,KAAA,EAAO,sBAAsB,4BAAA,QAAA;AAAA"}
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
3
2
 
4
3
  //#region src/components/cloudflare-builtin.d.ts
@@ -6,7 +5,7 @@ type CloudflareBuiltinProps = Partial<BuiltinFileProps> & Omit<BuiltinFileProps,
6
5
  /**
7
6
  * Generates the Cloudflare environment configuration module for the Powerlines project.
8
7
  */
9
- declare function CloudflareBuiltin(props: CloudflareBuiltinProps): _$_alloy_js_core0.Children;
8
+ declare function CloudflareBuiltin(props: CloudflareBuiltinProps): import("@alloy-js/core").Children;
10
9
  declare type __ΩCloudflareBuiltinProps = any[];
11
10
  //#endregion
12
11
  export { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps };
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare-builtin.d.mts","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"mappings":";;;;KAoCY,sBAAA,GAAyB,OAAA,CAAQ,gBAAA,IAC3C,IAAA,CAAK,gBAAA;;;AADP;iBAMgB,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,iBAAA,CAAA,QAAA;AAAA"}
1
+ {"version":3,"file":"cloudflare-builtin.d.mts","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"mappings":";;;KAoCY,sBAAA,GAAyB,OAAA,CAAQ,gBAAA,IAC3C,IAAA,CAAK,gBAAA;;AADP;;iBAMgB,iBAAA,CAAkB,KAAA,EAAO,sBAAsB,4BAAA,QAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cloudflare-builtin.mjs","names":[],"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":";;;;;;;;;;;;;AA6BA,SAAO,kBAAA,OAAA;CACL,MAAK,CAAA,EACL,SACA,YACA,QAAO,WAAW,OAAO,CAAK,WAAW,WAAW,CAAC;AACvD,QAAO,gBAAgB,aAAA,WAAA;;EAEvB,aAAY;EACV,EAAA,MAAK;;AAEL,UAAA,KAAA;IACC,oBAAyB,CAAA,oBAAY;IACtC,6BAAA;KAAA;MACK,MAAS;MACN,MA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;QACD,KAAA;QACD,CAAA;OAAA,gBAAwB,iBAAE;QACzB,MAAK;QACN,MAAA;QACD,KAAS;QACT,CAAA;OAAA;;KAED,CAAA;IAAA,gBAAW,OAAA,EAAA,CAAA;IAAA,gBAAA,gBAAA;KACd,SAAA;KACH,MAAA"}
1
+ {"version":3,"file":"cloudflare-builtin.mjs","names":[],"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":";;;;;;;;;;;;;AA6BA,SAAO,kBAAA,OAAA;CACL,MAAK,CAAA,EACL,SACA,YACA,QAAO,WAAW,OAAO,CAAK,WAAW,UAAC,CAAU;CACtD,OAAO,gBAAgB,aAAA,WAAA;;EAEvB,aAAY;CACV,GAAA,MAAK;;GAEL,OAAA,KAAA;IACC,oBAAyB,CAAA,mBAAY;IACtC,6BAAA;KAAA;MACK,MAAS;MACN,MAAC;KACN;KAAA;MACA,MAAQ;MACT,MAAA;;;MAEK,MAAA;MACJ,MAAA;KACG;KAAE;MACJ,MAAA;MACI,MAAI;KACR;KAAA;MACE,MAAA;MACE,MAAM;KACR;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAA;MACD,MAAA;KACD;KAAA;MACA,MAAA;MACD,MAAA;KACC;KAAA;MACA,MAAM;MACN,MAAA;KACD;IAAA;GACD,GAAC,WAAS,CAAA,CAAA;EACZ;EACA,IAAG,WAAA;GACD,OAAE;IAAA,gBAAA,gBAAA;KACA,SAAM;KACN,MAAA;KACA,aAAW,IAAM;IACnB,CAAC;IAAG,gBAAS,SAAiB,CAAA,CAAA;IAAA,gBAAmB,SAAA,CAAA,CAAA;IAAA,gBAAA,sBAAA;KAC/C,UAAC;KACD,MAAK;KACL,gBAAC,CAAA;MACC,MAAM;MACN,SAAM;KACR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B,MAAI;QACR,UAAa,IAAK;OACnB,CAAA;OAAA,gBAAA,cAAA,EACK,UAAA,IAAA,uCACL,CAAA;MAAK;KACJ;IACF,CAAC;IAAC,gBAAK,qBAAA;KACN,UAAA;KACC,MAAA;KACA,gBAAM,CAAA;MACN,MAAA;MACA,SAAW;KACX,CAAA;KACA,YAAY,CAAA;MACf,MAAS;MACN,MAAI;KACZ,GAAA;MACO,MAAQ;MACP,MAAA;KACD,CAAA;KACA,YAAa;KACZ,UAAC,IAAW;IACd,CAAC;IAAE,gBAAiB,SAAW,CAAA,CAAA;IAAK,gBAAgB,SAAQ,CAAA,CAAA;IAAO,gBAAiB,sBAAqB;KACvG,UAAC;KACD,MAAK;KACN,gBAAA,CAAA;MACC,MAAA;MACA,SAAM;KACN,CAAA;KACA,KAAA;KACA,IAAE,WAAA;MACA,OAAO;OAAC,gBAAS,iBAAA;QACf,MAAM;QACP,MAAA;QACD,KAAA;OACA,CAAC;OAAC,gBAAgB,iBAAA;QAChB,MAAM;QACR,MAAA;QACD,KAAA;OACD,CAAA;OAAA,gBAAwB,iBAAE;QACzB,MAAK;QACN,MAAA;QACD,KAAS;OACT,CAAA;MAAA;KACA;IACD,CAAA;IAAA,gBAAW,OAAA,CAAA,CAAA;IAAA,gBAAA,gBAAA;KACd,SAAA;KACH,MAAA"}
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env-builtin";
3
2
 
4
3
  //#region src/components/env-builtin.d.ts
@@ -6,7 +5,7 @@ type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, "defaultConfig">;
6
5
  /**
7
6
  * Generates the Cloudflare environment configuration module for the Powerlines project.
8
7
  */
9
- declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): _$_alloy_js_core0.Children;
8
+ declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): import("@alloy-js/core").Children;
10
9
  declare type __ΩCloudflareEnvBuiltinProps = any[];
11
10
  //#endregion
12
11
  export { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps };
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;KA0BY,yBAAA,GAA4B,IAAA,CAAK,eAAA;;;AAA7C;iBAKgB,oBAAA,CAAqB,KAAA,EAAO,yBAAA,GAAyB,iBAAA,CAAA,QAAA;AAAA"}
1
+ {"version":3,"file":"env-builtin.d.cts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;KA0BY,yBAAA,GAA4B,IAAI,CAAC,eAAA;;AAA7C;;iBAKgB,oBAAA,CAAqB,KAAA,EAAO,yBAAyB,4BAAA,QAAA;AAAA"}
@@ -1,4 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
1
  import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env-builtin";
3
2
 
4
3
  //#region src/components/env-builtin.d.ts
@@ -6,7 +5,7 @@ type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, "defaultConfig">;
6
5
  /**
7
6
  * Generates the Cloudflare environment configuration module for the Powerlines project.
8
7
  */
9
- declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): _$_alloy_js_core0.Children;
8
+ declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): import("@alloy-js/core").Children;
10
9
  declare type __ΩCloudflareEnvBuiltinProps = any[];
11
10
  //#endregion
12
11
  export { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps };
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;;KA0BY,yBAAA,GAA4B,IAAA,CAAK,eAAA;;;AAA7C;iBAKgB,oBAAA,CAAqB,KAAA,EAAO,yBAAA,GAAyB,iBAAA,CAAA,QAAA;AAAA"}
1
+ {"version":3,"file":"env-builtin.d.mts","names":[],"sources":["../../src/components/env-builtin.tsx"],"mappings":";;;KA0BY,yBAAA,GAA4B,IAAI,CAAC,eAAA;;AAA7C;;iBAKgB,oBAAA,CAAqB,KAAA,EAAO,yBAAyB,4BAAA,QAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"env-builtin.mjs","names":[],"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":";;;;;;;;;;AA0BA,SAAY,qBAAyB,OAAO;UAE1C,UACC,WACD,QAAA,WAAA,OAAA,CAAA,YAAA,UAAA,CAAA;AACF,QAAO,gBAAS,YAAqB,WAAO,EAC1C,eAAiB,IAAE,OAClB,EAAE,MAAA;EACD,IAAC,UAAO;AACR,UAAA,KAAA,iCAEF,EAAO,WAAA,EAAA,CAAA;;EAEL,IAAE,WAAa;AACb,UAAI,CAAI,gBAAA,SAAA,EAAA,CAAA,EAAA,gBAAA,MAAA;IACR,IAAA,OAAa;AACX,YAAA,QAAA,SAAA;;IAEC;IACF,CAAC,CAAA;;EAEL,CAAC,CAAC"}
1
+ {"version":3,"file":"env-builtin.mjs","names":[],"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":";;;;;;;;;;AA0BA,SAAY,qBAAyB,OAAO;UAE1C,UACC,WACD,QAAA,WAAA,OAAA,CAAA,YAAA,SAAA,CAAA;CACF,OAAO,gBAAS,YAAqB,WAAO,EAC1C,eAAiB,IAAE,MACnB,GAAG,MAAA;EACD,IAAC,UAAO;GACR,OAAA,KAAA,gCAEF,GAAO,WAAA,CAAA,CAAA;EACL;EACA,IAAE,WAAa;GACb,OAAI,CAAI,gBAAA,SAAA,CAAA,CAAA,GAAA,gBAAA,MAAA;IACR,IAAA,OAAa;KACX,OAAA,QAAA,QAAA;IACA;IACC;GACH,CAAC,CAAC;EACJ;CACF,CAAC,CAAC;AACJ"}
@@ -1,5 +1,4 @@
1
1
  import { CloudflareWorkerEntryModule } from "../types/plugin.cjs";
2
- import * as _$_alloy_js_core0 from "@alloy-js/core";
3
2
  import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
4
3
 
5
4
  //#region src/components/worker-entry.d.ts
@@ -9,7 +8,7 @@ type WorkerEntryProps = Partial<EntryFileProps> & Omit<EntryFileProps, "path"> &
9
8
  /**
10
9
  * 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.
11
10
  */
12
- declare function WorkerEntry(props: WorkerEntryProps): _$_alloy_js_core0.Children;
11
+ declare function WorkerEntry(props: WorkerEntryProps): import("@alloy-js/core").Children;
13
12
  declare type __ΩWorkerEntryProps = any[];
14
13
  //#endregion
15
14
  export { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps };
@@ -1 +1 @@
1
- {"version":3,"file":"worker-entry.d.cts","names":[],"sources":["../../src/components/worker-entry.tsx"],"mappings":";;;;;KA+BY,gBAAA,GAAmB,OAAA,CAAQ,cAAA,IACrC,IAAA,CAAK,cAAA;EACH,MAAA,EAAQ,2BAAA;AAAA;;AAFZ;;iBAQgB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,iBAAA,CAAA,QAAA;AAAA"}
1
+ {"version":3,"file":"worker-entry.d.cts","names":[],"sources":["../../src/components/worker-entry.tsx"],"mappings":";;;;KA+BY,gBAAA,GAAmB,OAAA,CAAQ,cAAA,IACrC,IAAA,CAAK,cAAA;EACH,MAAA,EAAQ,2BAAA;AAAA;AAFZ;;;AAAA,iBAQgB,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA;AAAA"}
@@ -1,5 +1,4 @@
1
1
  import { CloudflareWorkerEntryModule } from "../types/plugin.mjs";
2
- import * as _$_alloy_js_core0 from "@alloy-js/core";
3
2
  import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
4
3
 
5
4
  //#region src/components/worker-entry.d.ts
@@ -9,7 +8,7 @@ type WorkerEntryProps = Partial<EntryFileProps> & Omit<EntryFileProps, "path"> &
9
8
  /**
10
9
  * 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.
11
10
  */
12
- declare function WorkerEntry(props: WorkerEntryProps): _$_alloy_js_core0.Children;
11
+ declare function WorkerEntry(props: WorkerEntryProps): import("@alloy-js/core").Children;
13
12
  declare type __ΩWorkerEntryProps = any[];
14
13
  //#endregion
15
14
  export { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps };
@@ -1 +1 @@
1
- {"version":3,"file":"worker-entry.d.mts","names":[],"sources":["../../src/components/worker-entry.tsx"],"mappings":";;;;;KA+BY,gBAAA,GAAmB,OAAA,CAAQ,cAAA,IACrC,IAAA,CAAK,cAAA;EACH,MAAA,EAAQ,2BAAA;AAAA;;AAFZ;;iBAQgB,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,iBAAA,CAAA,QAAA;AAAA"}
1
+ {"version":3,"file":"worker-entry.d.mts","names":[],"sources":["../../src/components/worker-entry.tsx"],"mappings":";;;;KA+BY,gBAAA,GAAmB,OAAA,CAAQ,cAAA,IACrC,IAAA,CAAK,cAAA;EACH,MAAA,EAAQ,2BAAA;AAAA;AAFZ;;;AAAA,iBAQgB,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"worker-entry.mjs","names":[],"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.metadata.entry.input?.file || worker.metadata.entry.file\n )\n )}`\n );\n\n return (\n <EntryFile\n path={`worker-${murmurhash(worker.metadata.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":";;;;;;;;;;;;;;AA+BA,SAAY,YAAgB,OAAG;CAC7B,MAAK,CAAA,EACH,QACD,mBAED,kBACC,QAAU,WAAG,OAAW;EAAA;EAAe;EAAY;EAAW;EAAY,CAAA;CAC3E,MAAA,UAAA,eAAA;CACF,MAAO,YAAS,eAAmB,KAAA,iBAAkB,aAAA,QAAA,WAAA,OAAA,SAAA,MAAA,OAAA,QAAA,OAAA,SAAA,MAAA,KAAA,CAAA,GAAA;AACnD,QAAO,gBAAkB,WAAW,WAAA,EAClC,IAAA,OAAK;AACH,SAAO,UAAG,WAAY,OAAW,SAAA,OAAe,EACnD,WAAA;IAGD,EAAA,MAAM;EACJ,IAAI,UAAA;AACF,UAAK,KAAA;IACH,6BAAY;KAAA;MACV,MAAA;MACA,MAAM;MACR;KAAA;MACA,MAAA;MACL,MAAA;;;MAEM,MAAA;MACJ,MAAA;MACC;KAAK;MACH,MAAA;MACE,MAAM;MACP;KAAC;MACJ,MAAS;MACP,MAAA;MACC;KAAE;MACD,MAAI;MACJ,MAAI;MACL;KAAE;MACD,MAAI;MACJ,MAAI;MACL;KAAE;MACD,MAAI;MACJ,MAAI;MACL;KAAE;MACD,MAAI;MACJ,MAAI;MACL;KAAE;MACD,MAAC;MACD,MAAC;MACF;KAAA;MACD,MAAQ;MACT,MAAA;MACD;KAAA;MACE,MAAA;MACE,MAAA;MACD;KAAC;KACD,UAAI,QAAA;IACN,EAAE,WAAI,EAAA,CAAA;;EAET,IAAI,iBAAK;AACP,UAAO,KAAA,EACL,YAAK;IAAA;IAAiB;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,EACvB,EAAE,kBAAI,EAAgB,CAAA;;EAEzB,IAAI,WAAC;AACH,UAAE;IAAA,IAAA;IAAmB,gBAAA,OAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACnB,IAAA,OAAA;AACD,aAAK,OAAO;;KAEZ,UAAW,IAAA;;;;;KAKX,CAAC;IAAE,gBAAA,OAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACF,IAAI,OAAA;AACF,aAAE,OAAA;;KAEJ,UAAO,IAAM;;;;;KAKd,CAAC;IAAA,gBAAI,OAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACL,IAAK,OAAA;AACL,aAAU,OAAO;;KAEhB,UAAO,IAAA;;;;;KAKR,CAAA;IAAG,gBAAE,OAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACL,IAAK,OAAM;AACT,aAAM,OAAM;;KAEb,UAAS,IAAK;;;;;KAKf,CAAA;IAAA,gBAAkB,OAAU,EAAA,CAAA;IAAA,gBAAA,MAAA;KAC3B,IAAC,OAAM;AACP,aAAO,OAAA;;KAEP,UAAE,IAAA;;;;;KAKH,CAAC;IAAC,gBAAiB,OAAA,EAAW,CAAC;IAAA,gBAAoB,MAAC;KACnD,IAAA,OAAO;AACL,aAAO,OAAO;;KAEhB,UAAE,IAAA;;;;;KAKH,CAAC;IAAA,gBAAO,OAAmB,EAAA,CAAA;IAAA,gBAAqB,MAAO;KACtD,IAAE,OAAO;AACP,aAAA,OAAA;;KAEF,UAAI,IAAA;;;;;KAKL,CAAC;IAAE,gBAAc,OAAM,EAAO,CAAC;IAAA,gBAAoB,MAAA;KAClD,IAAE,OAAA;AACA,aAAA,OAAA;;KAEH,UAAK,IAAA;;;;;KAKT,CAAA;IAAA,gBAAA,OAAA,EAAA,CAAA;IAAA,IAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,MAAA;KACH,IAAA,OAAA"}
1
+ {"version":3,"file":"worker-entry.mjs","names":[],"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.metadata.entry.input?.file || worker.metadata.entry.file\n )\n )}`\n );\n\n return (\n <EntryFile\n path={`worker-${murmurhash(worker.metadata.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":";;;;;;;;;;;;;;AA+BA,SAAY,YAAgB,OAAG;CAC7B,MAAK,CAAA,EACH,QACD,mBAED,kBACC,QAAU,WAAG,OAAW;EAAA;EAAe;EAAY;EAAW;CAAY,CAAA;CAC3E,MAAA,UAAA,cAAA;CACF,MAAO,YAAS,eAAmB,KAAA,iBAAkB,aAAA,QAAA,WAAA,OAAA,SAAA,MAAA,OAAA,QAAA,OAAA,SAAA,MAAA,IAAA,CAAA,GAAA;CACnD,OAAO,gBAAkB,WAAW,WAAA,EAClC,IAAA,OAAK;EACH,OAAO,UAAG,WAAY,OAAW,SAAA,OAAe,EACnD,WAAA;CAED,EACA,GAAA,MAAM;EACJ,IAAI,UAAA;GACF,OAAK,KAAA;IACH,6BAAY;KAAA;MACV,MAAA;MACA,MAAM;KACR;KAAA;MACA,M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U,CAAC;IAAC,gBAAoB,MAAC;KACnD,IAAA,OAAO;MACL,OAAO,OAAO;KAChB;KACA,UAAE,IAAA;;;;;IAKJ,CAAC;IAAC,gBAAO,OAAmB,CAAA,CAAA;IAAA,gBAAqB,MAAO;KACtD,IAAE,OAAO;MACP,OAAA,OAAA;KACF;KACA,UAAI,IAAA;;;;;IAKN,CAAC;IAAG,gBAAc,OAAM,CAAA,CAAO;IAAC,gBAAoB,MAAA;KAClD,IAAE,OAAA;MACA,OAAA,OAAA;KACF;KACD,UAAK,IAAA;;;;;IAKT,CAAA;IAAA,gBAAA,OAAA,CAAA,CAAA;IAAA,IAAA;IAAA,gBAAA,SAAA,CAAA,CAAA;IAAA,gBAAA,MAAA;KACH,IAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrangler.d.cts","names":[],"sources":["../../src/helpers/wrangler.ts"],"mappings":";;;UAqBiB,wBAAA;EACf,sBAAA;AAAA;AAAA,UAGe,WAAA;;;;EAIf,UAAA;EAJ0B;;;EAQ1B,cAAA;EAAA;;;EAIA,gBAAA;EAIU;AASZ;;EATE,UAAA;AAAA;;;;;;;iBASc,yBAAA,CACd,OAAA,EAAS,iBAAA;AAAA"}
1
+ {"version":3,"file":"wrangler.d.cts","names":[],"sources":["../../src/helpers/wrangler.ts"],"mappings":";;;UAqBiB,wBAAA;EACf,sBAAsB;AAAA;AAAA,UAGP,WAAA;;;AAHO;EAOtB,UAAA;EAJ0B;;;EAQ1B,cAAA;EAAA;;;EAIA,gBAAA;EAIU;AASZ;;EATE,UAAA;AAAA;AAU0B;;;;;;AAAA,iBADZ,yBAAA,CACd,OAA0B,EAAjB,iBAAiB;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrangler.d.mts","names":[],"sources":["../../src/helpers/wrangler.ts"],"mappings":";;;UAqBiB,wBAAA;EACf,sBAAA;AAAA;AAAA,UAGe,WAAA;;;;EAIf,UAAA;EAJ0B;;;EAQ1B,cAAA;EAAA;;;EAIA,gBAAA;EAIU;AASZ;;EATE,UAAA;AAAA;;;;;;;iBASc,yBAAA,CACd,OAAA,EAAS,iBAAA;AAAA"}
1
+ {"version":3,"file":"wrangler.d.mts","names":[],"sources":["../../src/helpers/wrangler.ts"],"mappings":";;;UAqBiB,wBAAA;EACf,sBAAsB;AAAA;AAAA,UAGP,WAAA;;;AAHO;EAOtB,UAAA;EAJ0B;;;EAQ1B,cAAA;EAAA;;;EAIA,gBAAA;EAIU;AASZ;;EATE,UAAA;AAAA;AAU0B;;;;;;AAAA,iBADZ,yBAAA,CACd,OAA0B,EAAjB,iBAAiB;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrangler.mjs","names":[],"sources":["../../src/helpers/wrangler.ts"],"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 { joinPaths } from \"@stryke/path\";\nimport { UnresolvedContext } from \"powerlines\";\n\nexport interface ResolveConfigPathOptions {\n useRedirectIfAvailable?: boolean;\n}\n\nexport interface ConfigPaths {\n /**\n * Absolute path to the actual configuration being used (possibly redirected from the user's config).\n */\n configPath: string | undefined;\n /**\n * Absolute path to the user's configuration, which may not be the same as `configPath` if it was redirected.\n */\n userConfigPath: string | undefined;\n /**\n * Absolute path to the deploy config path used\n */\n deployConfigPath: string | undefined;\n /**\n * Was a redirected config file read?\n */\n redirected: boolean;\n}\n\n/**\n * Resolves the Wrangler configuration file path by checking for allowed extensions in the specified root directory.\n *\n * @param context - The Cloudflare plugin context containing the configuration and file system access.\n * @returns The absolute path to the found configuration file, or undefined if no file is found.\n */\nexport function resolveWranglerConfigPath(\n context: UnresolvedContext\n): string | undefined {\n for (const extension of [\"jsonc\", \"json\", \"toml\"]) {\n if (\n context.fs.existsSync(\n joinPaths(context.config.root, `wrangler.${extension}`)\n )\n ) {\n return joinPaths(context.config.root, `wrangler.${extension}`);\n }\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAI,0BAAA,SAAA;AACF,MAAG,MAAQ,aAAa;EAAA;EAAO;EAAA;EAAc,CAC3C,KAAA,QAAA,GAAA,WAAA,UAAA,QAAA,OAAA,MAAA,YAAA,YAAA,CAAA,CACF,QAAW,UAAU,QAAA,OAAS,MAAA,YAAA,YAAA"}
1
+ {"version":3,"file":"wrangler.mjs","names":[],"sources":["../../src/helpers/wrangler.ts"],"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 { joinPaths } from \"@stryke/path\";\nimport { UnresolvedContext } from \"powerlines\";\n\nexport interface ResolveConfigPathOptions {\n useRedirectIfAvailable?: boolean;\n}\n\nexport interface ConfigPaths {\n /**\n * Absolute path to the actual configuration being used (possibly redirected from the user's config).\n */\n configPath: string | undefined;\n /**\n * Absolute path to the user's configuration, which may not be the same as `configPath` if it was redirected.\n */\n userConfigPath: string | undefined;\n /**\n * Absolute path to the deploy config path used\n */\n deployConfigPath: string | undefined;\n /**\n * Was a redirected config file read?\n */\n redirected: boolean;\n}\n\n/**\n * Resolves the Wrangler configuration file path by checking for allowed extensions in the specified root directory.\n *\n * @param context - The Cloudflare plugin context containing the configuration and file system access.\n * @returns The absolute path to the found configuration file, or undefined if no file is found.\n */\nexport function resolveWranglerConfigPath(\n context: UnresolvedContext\n): string | undefined {\n for (const extension of [\"jsonc\", \"json\", \"toml\"]) {\n if (\n context.fs.existsSync(\n joinPaths(context.config.root, `wrangler.${extension}`)\n )\n ) {\n return joinPaths(context.config.root, `wrangler.${extension}`);\n }\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAI,0BAAA,SAAA;CACF,KAAG,MAAQ,aAAa;EAAA;EAAO;EAAA;CAAc,GAC3C,IAAA,QAAA,GAAA,WAAA,UAAA,QAAA,OAAA,MAAA,YAAA,WAAA,CAAA,GACF,OAAW,UAAU,QAAA,OAAS,MAAA,YAAA,WAAA;AAIhC"}
package/dist/index.d.cts CHANGED
@@ -17,5 +17,5 @@ declare module "powerlines" {
17
17
  */
18
18
  declare function plugin<TContext extends CloudflarePluginContext = CloudflarePluginContext>(options?: CloudflarePluginOptions): Plugin<TContext>[];
19
19
  //#endregion
20
- export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, CloudflareWorkerMetadata, Json, JsonSchema, Literal, LiteralSchema, OptionalZodTypeOf, PathSchema, WorkerEntry, WorkerEntryProps, WorkerModule, WorkerModuleMetadata, WranglerResolvedConfig, WranglerUserConfig, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule, __ΩCloudflareWorkerMetadata, __ΩJson, __ΩLiteral, __ΩOptionalZodTypeOf, __ΩWorkerEntryProps, __ΩWorkerModule, __ΩWorkerModuleMetadata, __ΩWranglerResolvedConfig, __ΩWranglerUserConfig, plugin as default, plugin, defaultWranglerConfig, isCyclic, parseWithRootPath };
20
+ export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, type CloudflarePluginContext, type CloudflarePluginOptions, type CloudflarePluginResolvedConfig, type CloudflarePluginUserConfig, type CloudflareWorkerEntryModule, type CloudflareWorkerMetadata, type Json, type JsonSchema, type Literal, type LiteralSchema, type OptionalZodTypeOf, type PathSchema, WorkerEntry, WorkerEntryProps, type WorkerModule, type WorkerModuleMetadata, type WranglerResolvedConfig, type WranglerUserConfig, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, type __ΩCloudflarePluginContext, type __ΩCloudflarePluginOptions, type __ΩCloudflarePluginResolvedConfig, type __ΩCloudflarePluginUserConfig, type __ΩCloudflareWorkerEntryModule, type __ΩCloudflareWorkerMetadata, type __ΩJson, type __ΩLiteral, type __ΩOptionalZodTypeOf, __ΩWorkerEntryProps, type __ΩWorkerModule, type __ΩWorkerModuleMetadata, type __ΩWranglerResolvedConfig, type __ΩWranglerUserConfig, plugin as default, plugin, type defaultWranglerConfig, type isCyclic, type parseWithRootPath };
21
21
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;;YAkDY,MAAA;IACR,UAAA,GAAa,uBAAA;EAAA;AAAA;;;AAJY;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAA+B,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;;YAkDY,MAAA;IACR,UAAA,GAAa,uBAAuB;EAAA;AAAA;;;AAJX;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAA+B,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -17,5 +17,5 @@ declare module "powerlines" {
17
17
  */
18
18
  declare function plugin<TContext extends CloudflarePluginContext = CloudflarePluginContext>(options?: CloudflarePluginOptions): Plugin<TContext>[];
19
19
  //#endregion
20
- export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, CloudflarePluginContext, CloudflarePluginOptions, CloudflarePluginResolvedConfig, CloudflarePluginUserConfig, CloudflareWorkerEntryModule, CloudflareWorkerMetadata, Json, JsonSchema, Literal, LiteralSchema, OptionalZodTypeOf, PathSchema, WorkerEntry, WorkerEntryProps, WorkerModule, WorkerModuleMetadata, WranglerResolvedConfig, WranglerUserConfig, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩCloudflarePluginContext, __ΩCloudflarePluginOptions, __ΩCloudflarePluginResolvedConfig, __ΩCloudflarePluginUserConfig, __ΩCloudflareWorkerEntryModule, __ΩCloudflareWorkerMetadata, __ΩJson, __ΩLiteral, __ΩOptionalZodTypeOf, __ΩWorkerEntryProps, __ΩWorkerModule, __ΩWorkerModuleMetadata, __ΩWranglerResolvedConfig, __ΩWranglerUserConfig, plugin as default, plugin, defaultWranglerConfig, isCyclic, parseWithRootPath };
20
+ export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, type CloudflarePluginContext, type CloudflarePluginOptions, type CloudflarePluginResolvedConfig, type CloudflarePluginUserConfig, type CloudflareWorkerEntryModule, type CloudflareWorkerMetadata, type Json, type JsonSchema, type Literal, type LiteralSchema, type OptionalZodTypeOf, type PathSchema, WorkerEntry, WorkerEntryProps, type WorkerModule, type WorkerModuleMetadata, type WranglerResolvedConfig, type WranglerUserConfig, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, type __ΩCloudflarePluginContext, type __ΩCloudflarePluginOptions, type __ΩCloudflarePluginResolvedConfig, type __ΩCloudflarePluginUserConfig, type __ΩCloudflareWorkerEntryModule, type __ΩCloudflareWorkerMetadata, type __ΩJson, type __ΩLiteral, type __ΩOptionalZodTypeOf, __ΩWorkerEntryProps, type __ΩWorkerModule, type __ΩWorkerModuleMetadata, type __ΩWranglerResolvedConfig, type __ΩWranglerUserConfig, plugin as default, plugin, type defaultWranglerConfig, type isCyclic, type parseWithRootPath };
21
21
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;;YAkDY,MAAA;IACR,UAAA,GAAa,uBAAA;EAAA;AAAA;;;AAJY;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAA+B,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;;;;;YAkDY,MAAA;IACR,UAAA,GAAa,uBAAuB;EAAA;AAAA;;;AAJX;iBAWb,MAAA,kBACG,uBAAA,GAA0B,uBAAA,CAAA,CAC3C,OAAA,GAAS,uBAAA,GAA+B,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"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 { getCloudflarePreset } from \"@cloudflare/unenv-preset\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { readEnvTypeReflection } from \"@powerlines/plugin-env/helpers\";\nimport pulumi from \"@powerlines/plugin-pulumi\";\nimport unenv from \"@powerlines/plugin-unenv\";\nimport { resolveModule } from \"@powerlines/schema/resolve\";\nimport * as pulumiCloudflare from \"@pulumi/cloudflare\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths, replaceExtension } from \"@stryke/path\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { PartialKeys } from \"@stryke/types\";\nimport defu from \"defu\";\nimport { Plugin, UnresolvedContext } from \"powerlines\";\nimport { unstable_readConfig } from \"wrangler\";\nimport { CloudflareEnvBuiltin } from \"./components\";\nimport { CloudflareBuiltin } from \"./components/cloudflare-builtin\";\nimport { WorkerEntry } from \"./components/worker-entry\";\nimport { resolveWranglerConfigPath } from \"./helpers/wrangler\";\nimport {\n CloudflarePluginContext,\n CloudflarePluginOptions,\n CloudflareWorkerEntryModule\n} from \"./types/plugin\";\nimport { WorkerModule } from \"./types/worker-module\";\nimport { WranglerResolvedConfig, WranglerUserConfig } from \"./types/wrangler\";\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 = {}): Plugin<TContext>[] {\n return [\n unenv<TContext>(options.unenv),\n ...pulumi<TContext>(options.pulumi),\n {\n name: \"cloudflare\",\n config() {\n return {\n cloudflare: defu(omit(options, [\"unenv\", \"pulumi\"]), {\n configPath: resolveWranglerConfigPath(this as UnresolvedContext)\n }),\n resolve: {\n skipNodeModulesBundle: false\n },\n unenv: {\n presets: [\n getCloudflarePreset({\n compatibilityDate: this.config.compatibilityDate?.toString(),\n compatibilityFlags: [\"nodejs_als\"]\n })\n ]\n }\n };\n },\n configResolved() {\n this.devDependencies[\"@cloudflare/workers-types\"] = \"^4.20240616.0\";\n\n const config: PartialKeys<WranglerUserConfig, \"build\" | \"define\"> =\n unstable_readConfig(\n { config: this.config.cloudflare?.configPath },\n { preserveOriginalMain: true, hideWarnings: true }\n );\n this.cloudflare.wrangler = structuredClone(\n config\n ) as WranglerResolvedConfig;\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.cloudflare ??= { workers: [] };\n this.cloudflare.workers = (await Promise.all(\n this.entry.map(async (entry, i, arr) => {\n if (!entry.input) {\n throw new Error(\n `Cloudflare Worker entry \"${entry.file}\" is missing an input file.`\n );\n }\n\n const workerModule = await resolveModule<WorkerModule>(\n this,\n entry.input\n );\n if (!workerModule?.default) {\n throw new Error(\n `Cloudflare Worker entry \"${\n entry.file\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 const name =\n workerModule.metadata?.name ||\n replaceExtension(entry.input.file || entry.file) ||\n arr.length > 1\n ? `${this.config.name}-${i}`\n : this.config.name;\n\n return {\n metadata: {\n name,\n pattern: `${name}.{domain}`,\n entry\n },\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 )) as CloudflareWorkerEntryModule[];\n\n return render(\n this,\n <For each={this.cloudflare.workers}>\n {worker => <WorkerEntry worker={worker} />}\n </For>\n );\n }\n },\n async deploy() {\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 // for (const worker of this.cloudflare.workers) {\n // }\n },\n pulumi: {\n async deploy() {\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 provider = new pulumiCloudflare.Provider(\n \"cloudflare-provider\",\n {\n apiToken\n }\n );\n\n const zone = await pulumiCloudflare.getZone(\n {\n filter: {\n account: { id: this.config.cloudflare.accountId },\n name: this.config.cloudflare.domain\n }\n },\n { provider }\n );\n\n const workers = [] as pulumiCloudflare.Worker[];\n const workerVersions = [] as pulumiCloudflare.WorkerVersion[];\n const workersDeployments = [] as pulumiCloudflare.WorkersDeployment[];\n const workersRoutes = [] as pulumiCloudflare.WorkersRoute[];\n const dnsRecords = [] as pulumiCloudflare.DnsRecord[];\n for (const worker of this.cloudflare.workers) {\n const resource = new pulumiCloudflare.Worker(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n name: worker.metadata.name,\n tags: [\n `project:${kebabCase(this.config.name)}`,\n this.config.organization\n ? `organization:${kebabCase(this.config.organization)}`\n : undefined,\n this.config.mode\n ? `mode:${kebabCase(this.config.mode)}`\n : undefined\n ].filter(Boolean) as string[]\n },\n worker.metadata\n ),\n { provider }\n );\n workers.push(resource);\n\n const workerVersion = new pulumiCloudflare.WorkerVersion(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker-version`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n workerId: resource.id,\n mainModule: joinPaths(this.config.output.path, \"index.mjs\"),\n modules: [\n {\n name: joinPaths(this.config.output.path, \"index.mjs\"),\n contentType: \"application/javascript+module\",\n contentFile: joinPaths(\n this.config.output.path,\n \"index.mjs\"\n )\n }\n ]\n },\n worker.metadata,\n {\n compatibilityDate:\n this.config.compatibilityDate?.cloudflare?.toString() as string,\n compatibilityFlags: [\"nodejs_als\"]\n }\n ) as pulumiCloudflare.WorkerVersionArgs,\n { provider }\n );\n workerVersions.push(workerVersion);\n\n const workersDeployment = new pulumiCloudflare.WorkersDeployment(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.workers-deployment`,\n defu({\n accountId: this.config.cloudflare.accountId,\n zoneId: zone.id,\n strategy: \"percentage\",\n scriptName: resource.name,\n versions: [\n {\n percentage: 100,\n versionId: workerVersion.id\n }\n ]\n }),\n { provider }\n );\n workersDeployments.push(workersDeployment);\n\n const workersRoute = new pulumiCloudflare.WorkersRoute(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.workers-route`,\n defu({\n accountId: this.config.cloudflare.accountId,\n zoneId: zone.id,\n pattern: worker.metadata.pattern\n .replace(\"{domain}\", this.config.cloudflare.domain)\n .replace(\"{scriptName}\", worker.metadata.name)\n .replace(\"{mode}\", this.config.mode),\n script: resource.name\n }),\n { provider }\n );\n workersRoutes.push(workersRoute);\n\n const dnsRecord = new pulumiCloudflare.DnsRecord(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.dns-record`,\n {\n name: workersRoute.pattern,\n type: \"A\",\n content: \"192.0.2.1\",\n zoneId: zone.id,\n proxied: true,\n ttl: 1\n },\n { provider }\n );\n dnsRecords.push(dnsRecord);\n }\n\n return {\n workers,\n workerVersions,\n workersDeployments,\n workersRoutes,\n dnsRecords\n };\n }\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,OAAC,UAAW,EAAA,EAAA;AAC5B,QAAO;EAAA,MAAO,QAAQ,MAAM;EAAA,GAAA,OAAA,QAAA,OAAA;EAAA;;GAE5B,SAAQ;AACN,WAAU;KACR,YAAa,KAAA,KAAA,SAAA,CAAuB,SAAA,SAAA,CAAA,EAAA,EACtC,YAAA,0BAAA,KAAA,EACF,CAAA;gBAEE,uBAAA,OACG;KACH,OAAA,EACK,SAAS,CAAA,oBAAM;MACX,mBAAQ,KAAA,OAAwB,mBAAE,UAAA;MAClC,oBAAA,CAAA,aAA+B;MACjC,CAAA,CAAA,EACA;KACF;;GAEH,iBAAS;AACP,SAAA,gBAAS,+BAAA;IACT,MAAE,SAAO,oBAAA,EACP,QAAE,KAAW,OAAM,YAAa,YACjC,EAAE;KACD,sBAAI;KACJ,cAAW;KACZ,CAAC;AACF,SAAK,WAAA,WAAA,gBA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GAAA,UAAA,KAAA,OAAA,KAAA,CAAA,iBAAA,KAAA;;MAED,QAAU,KAAG;MACX,SAAA,OAAA,SAAA,QAAA,QAAA,YAAA,KAAA,OAAA,WAAA,OAAA,CAAA,QAAA,gBAAA,OAAA,SAAA,KAAA,CAAA,QAAA,UAAA,KAAA,OAAA,KAAA;MACA,QAAQ,SAAE;MACX,CAAC,EAAE,EACF,UACD,CAAC;AACF,mBAAG,KAAA,aAAA;KACH,MAAI,YAAS,IAAA,iBAAA,UAAA,GAAA,KAAA,OAAA,eAAA,GAAA,KAAA,OAAA,aAAA,KAAA,KAAA,UAAA,KAAA,OAAA,KAAA,KAAA,UAAA,OAAA,SAAA,KAAA,GAAA,UAAA,KAAA,OAAA,KAAA,GAAA,GAAA,UAAA,KAAA,OAAA,KAAA,CAAA,GAAA,UAAA,OAAA,SAAA,KAAA,GAAA,GAAA,UAAA,KAAA,OAAA,KAAA,CAAA,cAAA;MACZ,MAAA,aAAA;;MAED,SAAM;MACN,QAAM,KAAA;MACN,SAAM;MACN,KAAM;MACN,EAAA,EACA,UACC,CAAC;AACF,gBAAW,KAAC,UAAO;;AAErB,WAAO;KACL;KACA;KACA;KACA;KACA;KACD;MAEJ;GACF;EAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"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 { getCloudflarePreset } from \"@cloudflare/unenv-preset\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport { readEnvTypeReflection } from \"@powerlines/plugin-env/helpers\";\nimport pulumi from \"@powerlines/plugin-pulumi\";\nimport unenv from \"@powerlines/plugin-unenv\";\nimport { resolveModule } from \"@powerlines/schema/resolve\";\nimport * as pulumiCloudflare from \"@pulumi/cloudflare\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { joinPaths, replaceExtension } from \"@stryke/path\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { PartialKeys } from \"@stryke/types\";\nimport defu from \"defu\";\nimport { Plugin, UnresolvedContext } from \"powerlines\";\nimport { unstable_readConfig } from \"wrangler\";\nimport { CloudflareEnvBuiltin } from \"./components\";\nimport { CloudflareBuiltin } from \"./components/cloudflare-builtin\";\nimport { WorkerEntry } from \"./components/worker-entry\";\nimport { resolveWranglerConfigPath } from \"./helpers/wrangler\";\nimport {\n CloudflarePluginContext,\n CloudflarePluginOptions,\n CloudflareWorkerEntryModule\n} from \"./types/plugin\";\nimport { WorkerModule } from \"./types/worker-module\";\nimport { WranglerResolvedConfig, WranglerUserConfig } from \"./types/wrangler\";\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 = {}): Plugin<TContext>[] {\n return [\n unenv<TContext>(options.unenv),\n ...pulumi<TContext>(options.pulumi),\n {\n name: \"cloudflare\",\n config() {\n return {\n cloudflare: defu(omit(options, [\"unenv\", \"pulumi\"]), {\n configPath: resolveWranglerConfigPath(this as UnresolvedContext)\n }),\n resolve: {\n skipNodeModulesBundle: false\n },\n unenv: {\n presets: [\n getCloudflarePreset({\n compatibilityDate: this.config.compatibilityDate?.toString(),\n compatibilityFlags: [\"nodejs_als\"]\n })\n ]\n }\n };\n },\n configResolved() {\n this.devDependencies[\"@cloudflare/workers-types\"] = \"^4.20240616.0\";\n\n const config: PartialKeys<WranglerUserConfig, \"build\" | \"define\"> =\n unstable_readConfig(\n { config: this.config.cloudflare?.configPath },\n { preserveOriginalMain: true, hideWarnings: true }\n );\n this.cloudflare.wrangler = structuredClone(\n config\n ) as WranglerResolvedConfig;\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.cloudflare ??= { workers: [] };\n this.cloudflare.workers = (await Promise.all(\n this.entry.map(async (entry, i, arr) => {\n if (!entry.input) {\n throw new Error(\n `Cloudflare Worker entry \"${entry.file}\" is missing an input file.`\n );\n }\n\n const workerModule = await resolveModule<WorkerModule>(\n this,\n entry.input\n );\n if (!workerModule?.default) {\n throw new Error(\n `Cloudflare Worker entry \"${\n entry.file\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 const name =\n workerModule.metadata?.name ||\n replaceExtension(entry.input.file || entry.file) ||\n arr.length > 1\n ? `${this.config.name}-${i}`\n : this.config.name;\n\n return {\n metadata: {\n name,\n pattern: `${name}.{domain}`,\n entry\n },\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 )) as CloudflareWorkerEntryModule[];\n\n return render(\n this,\n <For each={this.cloudflare.workers}>\n {worker => <WorkerEntry worker={worker} />}\n </For>\n );\n }\n },\n async deploy() {\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 // for (const worker of this.cloudflare.workers) {\n // }\n },\n pulumi: {\n async deploy() {\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 provider = new pulumiCloudflare.Provider(\n \"cloudflare-provider\",\n {\n apiToken\n }\n );\n\n const zone = await pulumiCloudflare.getZone(\n {\n filter: {\n account: { id: this.config.cloudflare.accountId },\n name: this.config.cloudflare.domain\n }\n },\n { provider }\n );\n\n const workers = [] as pulumiCloudflare.Worker[];\n const workerVersions = [] as pulumiCloudflare.WorkerVersion[];\n const workersDeployments = [] as pulumiCloudflare.WorkersDeployment[];\n const workersRoutes = [] as pulumiCloudflare.WorkersRoute[];\n const dnsRecords = [] as pulumiCloudflare.DnsRecord[];\n for (const worker of this.cloudflare.workers) {\n const resource = new pulumiCloudflare.Worker(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n name: worker.metadata.name,\n tags: [\n `project:${kebabCase(this.config.name)}`,\n this.config.organization\n ? `organization:${kebabCase(this.config.organization)}`\n : undefined,\n this.config.mode\n ? `mode:${kebabCase(this.config.mode)}`\n : undefined\n ].filter(Boolean) as string[]\n },\n worker.metadata\n ),\n { provider }\n );\n workers.push(resource);\n\n const workerVersion = new pulumiCloudflare.WorkerVersion(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}.${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.worker-version`,\n defu(\n {\n accountId: this.config.cloudflare.accountId,\n workerId: resource.id,\n mainModule: joinPaths(this.config.output.path, \"index.mjs\"),\n modules: [\n {\n name: joinPaths(this.config.output.path, \"index.mjs\"),\n contentType: \"application/javascript+module\",\n contentFile: joinPaths(\n this.config.output.path,\n \"index.mjs\"\n )\n }\n ]\n },\n worker.metadata,\n {\n compatibilityDate:\n this.config.compatibilityDate?.cloudflare?.toString() as string,\n compatibilityFlags: [\"nodejs_als\"]\n }\n ) as pulumiCloudflare.WorkerVersionArgs,\n { provider }\n );\n workerVersions.push(workerVersion);\n\n const workersDeployment = new pulumiCloudflare.WorkersDeployment(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.workers-deployment`,\n defu({\n accountId: this.config.cloudflare.accountId,\n zoneId: zone.id,\n strategy: \"percentage\",\n scriptName: resource.name,\n versions: [\n {\n percentage: 100,\n versionId: workerVersion.id\n }\n ]\n }),\n { provider }\n );\n workersDeployments.push(workersDeployment);\n\n const workersRoute = new pulumiCloudflare.WorkersRoute(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.workers-route`,\n defu({\n accountId: this.config.cloudflare.accountId,\n zoneId: zone.id,\n pattern: worker.metadata.pattern\n .replace(\"{domain}\", this.config.cloudflare.domain)\n .replace(\"{scriptName}\", worker.metadata.name)\n .replace(\"{mode}\", this.config.mode),\n script: resource.name\n }),\n { provider }\n );\n workersRoutes.push(workersRoute);\n\n const dnsRecord = new pulumiCloudflare.DnsRecord(\n `${this.config.organization ? `${this.config.organization}.` : \"\"}${\n kebabCase(this.config.name) === kebabCase(worker.metadata.name)\n ? kebabCase(this.config.name)\n : `${kebabCase(this.config.name)}-${kebabCase(\n worker.metadata.name\n )}`\n }.${kebabCase(this.config.mode)}.dns-record`,\n {\n name: workersRoute.pattern,\n type: \"A\",\n content: \"192.0.2.1\",\n zoneId: zone.id,\n proxied: true,\n ttl: 1\n },\n { provider }\n );\n dnsRecords.push(dnsRecord);\n }\n\n return {\n workers,\n workerVersions,\n workersDeployments,\n workersRoutes,\n dnsRecords\n };\n }\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,OAAC,UAAW,CAAA,GAAA;CAC5B,OAAO;EAAA,MAAO,QAAQ,KAAM;EAAA,GAAA,OAAA,QAAA,MAAA;EAAA;;GAE5B,SAAQ;IACN,OAAU;KACR,YAAa,KAAA,KAAA,SAAA,CAAuB,SAAA,QAAA,CAAA,GAAA,EACtC,YAAA,0BAAA,IAAA,EACF,CAAA;gBAEE,uBAAA,MACG;KACH,OAAA,EACK,SAAS,CAAA,oBAAM;MACX,mBAAQ,KAAA,OAAwB,mBAAE,SAAA;MAClC,oBAAA,CAAA,YAA+B;KACjC,CAAA,CAAA,EACL;IACE;GACF;GACA,iBAAS;IACP,KAAA,gBAAS,+BAAA;IACT,MAAE,SAAO,oBAAA,EACP,QAAE,KAAW,OAAM,Y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BAAA;EAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;UAyCiB,uBAAA;;AAAjB;;;;;;;EASE,SAAA;EA+BA;;;;;AAK4B;AAG9B;;EA7BE,QAAA;EA6BuC;;;;;;EArBvC,UAAA;EAqBuC;;;EAhBvC,MAAA;EAsBe;;;AAA4B;AAG7C;;EAjBE,KAAA,GAAQ,kBAAA;EAiBmC;;;EAZ3C,MAAA,GAAS,mBAAmB;AAAA;AAAA,KAGlB,0BAAA,GAA6B,mBAAA,GACvC,sBAAA,GACA,qBAAA;EAasB;;;EATpB,UAAA,GAAa,IAAA,CAAK,uBAAA;AAAA;AAAA,KAGV,8BAAA,GAAiC,uBAAA,GAC3C,0BAAA,GACA,yBAAA;EAIc;;;EAAZ,UAAA,EAAY,QAAA,CAAS,IAAA,CAAK,uBAAA;AAAA;AAAA,KAGlB,wBAAA,GAA2B,YAAA,CACrC,oBAAA;EADkC;;;EAOlC,KAAA,EAAO,2BAAA;AAAA;AAAA,KAGG,2BAAA,GAA8B,MAAA,OAClC,eAAA;EAJ4B;;;EAUlC,QAAA,EAAU,wBAAA;AAAA;AAAA,KAGA,uBAAA,yBACc,8BAAA,GACtB,8BAAA,IACA,aAAA,CAAc,eAAA,IAChB,gBAAA,CAAiB,eAAA,IACjB,mBAAA,CAAoB,eAAA,IACpB,kBAAA,CAAmB,eAAA;EACjB,UAAA;IACE,QAAA,GAAW,sBAAA;IACX,OAAA,EAAS,2BAAA;EAAA;AAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"worker-module.d.cts","names":[],"sources":["../../src/types/worker-module.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CACjC,IAAA,CAAK,kBAAA;;AADP;;;;;EASE,IAAA;EATwC;;;;;;EAiBxC,UAAA;EAcA;;;AAGF;;;;;;;;;EAHE,OAAA;AAAA;AAAA,UAGe,YAAA;EACf,QAAA,GAAW,oBAAA;EACX,OAAA,EAAS,eAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"worker-module.d.cts","names":[],"sources":["../../src/types/worker-module.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CACjC,IAAA,CAAK,kBAAA;;AADP;;;;;EASE,IAAA;EATwC;;;;;;EAiBxC,UAAA;EAcA;;AAAO;AAGT;;;;;;;;;EAHE,OAAA;AAAA;AAAA,UAGe,YAAA;EACf,QAAA,GAAW,oBAAA;EACX,OAAA,EAAS,eAAe;AAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"worker-module.d.mts","names":[],"sources":["../../src/types/worker-module.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CACjC,IAAA,CAAK,kBAAA;;AADP;;;;;EASE,IAAA;EATwC;;;;;;EAiBxC,UAAA;EAcA;;;AAGF;;;;;;;;;EAHE,OAAA;AAAA;AAAA,UAGe,YAAA;EACf,QAAA,GAAW,oBAAA;EACX,OAAA,EAAS,eAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"worker-module.d.mts","names":[],"sources":["../../src/types/worker-module.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CACjC,IAAA,CAAK,kBAAA;;AADP;;;;;EASE,IAAA;EATwC;;;;;;EAiBxC,UAAA;EAcA;;AAAO;AAGT;;;;;;;;;EAHE,OAAA;AAAA;AAAA,UAGe,YAAA;EACf,QAAA,GAAW,oBAAA;EACX,OAAA,EAAS,eAAe;AAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrangler.d.cts","names":[],"sources":["../../src/types/wrangler.ts"],"mappings":";;;;;KAyBY,iBAAA,WAA4B,EAAA,CAAG,QAAA,gBACzC,CAAA,SAAU,EAAA,CAAG,QAAA,GAAW,EAAA,CAAG,KAAA,CAAM,CAAA;AAAA,cAGtB,aAAA,EAAa,CAAA,CAAA,QAAA,WAAA,CAAA,CAAA,SAAA,EAAA,CAAA,CAAA,SAAA,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ApDf;AAGpC;;KAkEY,sBAAA,GAAyB,eAAe;AAAA,cAEvC,qBAAA,EAAuB,sBAuHE;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrangler.mjs","names":[],"sources":["../../src/types/wrangler.ts"],"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 assert from \"node:assert\";\nimport path from \"node:path\";\n\nimport type { Unstable_Config, Unstable_RawConfig } from \"wrangler\";\nimport * as z from \"zod\";\nimport * as z4 from \"zod/v4/core\";\n\nexport type OptionalZodTypeOf<T extends z4.$ZodType | undefined> =\n T extends z4.$ZodType ? z4.infer<T> : undefined;\n\n// https://github.com/colinhacks/zod/blob/59768246aa57133184b2cf3f7c2a1ba5c3ab08c3/README.md?plain=1#L1302-L1317\nexport const LiteralSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null()\n]);\nexport type Literal = z.infer<typeof LiteralSchema>;\nexport type Json = Literal | { [key: string]: Json } | Json[];\nexport const JsonSchema: z.ZodType<Json> = z.lazy(() =>\n z.union([\n LiteralSchema,\n z.array(JsonSchema),\n z.record(z.string(), JsonSchema)\n ])\n);\n\nlet rootPath: string | undefined;\nexport async function parseWithRootPath<Z extends z4.$ZodType>(\n newRootPath: string,\n schema: Z,\n payload: z4.ParsePayload<any>,\n ctx: z.core.ParseContextInternal\n) {\n rootPath = newRootPath;\n try {\n return await schema._zod.parse(payload, ctx);\n } finally {\n rootPath = undefined;\n }\n}\nexport const PathSchema = z.string().transform(p => {\n assert(\n rootPath !== undefined,\n \"Expected `PathSchema` to be parsed within `parseWithRootPath()`\"\n );\n return path.resolve(rootPath, p);\n});\n\nexport function isCyclic(value: unknown, seen = new Set<unknown>()) {\n if (typeof value !== \"object\" || value === null) return false;\n for (const child of Object.values(value)) {\n if (seen.has(child)) return true;\n seen.add(child);\n if (isCyclic(child, seen)) return true;\n seen.delete(child);\n }\n return false;\n}\n\nexport type WranglerUserConfig = Unstable_RawConfig;\n\n/**\n * This is the static type definition for the configuration object.\n *\n * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,\n * and optionally augment with arguments passed directly to wrangler.\n *\n * For more information about the configuration object, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration\n *\n * @remarks\n * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear\n * in the top level config and should not appear in any environments.\n * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects\n * - All top level fields in config and environments are optional in the Wrangler configuration file.\n */\n\nexport type WranglerResolvedConfig = Unstable_Config;\n\nexport const defaultWranglerConfig: WranglerResolvedConfig = {\n /* COMPUTED_FIELDS */\n configPath: undefined,\n userConfigPath: undefined,\n topLevelName: undefined,\n definedEnvironments: undefined,\n targetEnvironment: undefined,\n\n /*= =================================================== */\n /* Fields supported by both Workers & Pages */\n /*= =================================================== */\n /* TOP-LEVEL ONLY FIELDS */\n pages_build_output_dir: undefined,\n send_metrics: undefined,\n dev: {\n ip: process.platform === \"win32\" ? \"127.0.0.1\" : \"localhost\",\n port: undefined, // the default of 8787 is set at runtime\n inspector_port: undefined, // the default of 9229 is set at runtime\n inspector_ip: undefined, // the default of 127.0.0.1 is set at runtime\n local_protocol: \"http\",\n upstream_protocol: \"http\",\n host: undefined,\n // Note this one is also workers only\n enable_containers: true,\n container_engine: undefined,\n generate_types: false\n },\n\n /** INHERITABLE ENVIRONMENT FIELDS */\n name: undefined,\n compatibility_date: undefined,\n compatibility_flags: [],\n limits: undefined,\n placement: undefined,\n\n /** NON-INHERITABLE ENVIRONMENT FIELDS */\n vars: {},\n durable_objects: { bindings: [] },\n kv_namespaces: [],\n queues: {\n producers: [],\n consumers: [] // WORKERS SUPPORT ONLY!!\n },\n r2_buckets: [],\n d1_databases: [],\n vectorize: [],\n hyperdrive: [],\n workflows: [],\n secrets_store_secrets: [],\n services: [],\n analytics_engine_datasets: [],\n ai: undefined,\n images: undefined,\n stream: undefined,\n media: undefined,\n version_metadata: undefined,\n unsafe_hello_world: [],\n ratelimits: [],\n worker_loaders: [],\n\n /*= =================================================== */\n /* Fields supported by Workers only */\n /*= =================================================== */\n /* TOP-LEVEL ONLY FIELDS */\n legacy_env: true,\n site: undefined,\n wasm_modules: undefined,\n text_blobs: undefined,\n data_blobs: undefined,\n keep_vars: undefined,\n alias: undefined,\n\n /** INHERITABLE ENVIRONMENT FIELDS */\n account_id: undefined,\n main: undefined,\n find_additional_modules: undefined,\n preserve_file_names: undefined,\n base_dir: undefined,\n workers_dev: undefined,\n preview_urls: undefined,\n route: undefined,\n routes: undefined,\n tsconfig: undefined,\n jsx_factory: \"React.createElement\",\n jsx_fragment: \"React.Fragment\",\n migrations: [],\n triggers: {\n crons: undefined\n },\n rules: [],\n build: { command: undefined, watch_dir: \"./src\", cwd: undefined },\n no_bundle: undefined,\n minify: undefined,\n keep_names: undefined,\n dispatch_namespaces: [],\n first_party_worker: undefined,\n logfwdr: { bindings: [] },\n logpush: undefined,\n upload_source_maps: undefined,\n assets: undefined,\n observability: { enabled: true },\n cache: undefined,\n /** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */\n compliance_region: undefined,\n python_modules: { exclude: [\"**/*.pyc\"] },\n\n /** NON-INHERITABLE ENVIRONMENT FIELDS */\n define: {},\n cloudchamber: {},\n containers: undefined,\n send_email: [],\n browser: undefined,\n unsafe: {},\n mtls_certificates: [],\n tail_consumers: undefined,\n streaming_tail_consumers: undefined,\n pipelines: [],\n vpc_services: [],\n ai_search_namespaces: []\n} as unknown as WranglerResolvedConfig;\n"],"mappings":";;;;;A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Q;CACR,QAAK;CACL,OAAE;CACF,kBAAkB;CAClB,oBAAkB,EAAA;CAClB,YAAC,EAAA;;CAMD,YAAQ;CACR,MAAA;;CAEA,YAAQ;CACR,YAAQ;CACR,WAAA;CACA,OAAA;;CAEA,YAAY;CACZ,MAAE;CACF,yBAAC;CACD,qBAAc;CACd,UAAA;CACA,aAAa;CACb,cAAc;CACd,OAAA;CACA,QAAA;CACA,UAAU;CACV,aAAA;CACA,cAAa;CACb,YAAQ,EAAA;CACR,UAAQ,EACR,OAAO,QACP;CACA,OAAA,EAAA;CACA,OAAA;EACA,SAAA;;EAEE,KAAK;EACN;CACD,WAAW;CACX,QAAO;CACP,YAAY;CACZ,qBAAe,EAAA;CACf,oBAAc;CACd,SAAA,EACA,UAAY,EAAA,EACZ;CACA,SAAO;;CAEP,QAAI;CACJ,eAAY,EACZ,SAAM,MACN;CACA,OAAA;;CAEA,mBAAa;CACb,gBAAc,EACd,SAAO,CAAA,WAAS,EAChB;;CAEA,QAAA,EAAA;CACA,cAAc,EAAC;CACf,YAAY;CACZ,YAAU,EAAA;CACV,SAAS;CACT,QAAC,EAAA;CACD,mBAAS,EAAA;CACT,gBAAgB;CAChB,0BAAoB;CACpB,WAAQ,EAAA;CACR,cAAY,EAAA;CACZ,sBAAsB,EAAC;CACxB"}
1
+ {"version":3,"file":"wrangler.mjs","names":[],"sources":["../../src/types/wrangler.ts"],"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 assert from \"node:assert\";\nimport path from \"node:path\";\n\nimport type { Unstable_Config, Unstable_RawConfig } from \"wrangler\";\nimport * as z from \"zod\";\nimport * as z4 from \"zod/v4/core\";\n\nexport type OptionalZodTypeOf<T extends z4.$ZodType | undefined> =\n T extends z4.$ZodType ? z4.infer<T> : undefined;\n\n// https://github.com/colinhacks/zod/blob/59768246aa57133184b2cf3f7c2a1ba5c3ab08c3/README.md?plain=1#L1302-L1317\nexport const LiteralSchema = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null()\n]);\nexport type Literal = z.infer<typeof LiteralSchema>;\nexport type Json = Literal | { [key: string]: Json } | Json[];\nexport const JsonSchema: z.ZodType<Json> = z.lazy(() =>\n z.union([\n LiteralSchema,\n z.array(JsonSchema),\n z.record(z.string(), JsonSchema)\n ])\n);\n\nlet rootPath: string | undefined;\nexport async function parseWithRootPath<Z extends z4.$ZodType>(\n newRootPath: string,\n schema: Z,\n payload: z4.ParsePayload<any>,\n ctx: z.core.ParseContextInternal\n) {\n rootPath = newRootPath;\n try {\n return await schema._zod.parse(payload, ctx);\n } finally {\n rootPath = undefined;\n }\n}\nexport const PathSchema = z.string().transform(p => {\n assert(\n rootPath !== undefined,\n \"Expected `PathSchema` to be parsed within `parseWithRootPath()`\"\n );\n return path.resolve(rootPath, p);\n});\n\nexport function isCyclic(value: unknown, seen = new Set<unknown>()) {\n if (typeof value !== \"object\" || value === null) return false;\n for (const child of Object.values(value)) {\n if (seen.has(child)) return true;\n seen.add(child);\n if (isCyclic(child, seen)) return true;\n seen.delete(child);\n }\n return false;\n}\n\nexport type WranglerUserConfig = Unstable_RawConfig;\n\n/**\n * This is the static type definition for the configuration object.\n *\n * It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,\n * and optionally augment with arguments passed directly to wrangler.\n *\n * For more information about the configuration object, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration\n *\n * @remarks\n * - Fields that are only specified in `ConfigFields` and not `Environment` can only appear\n * in the top level config and should not appear in any environments.\n * - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects\n * - All top level fields in config and environments are optional in the Wrangler configuration file.\n */\n\nexport type WranglerResolvedConfig = Unstable_Config;\n\nexport const defaultWranglerConfig: WranglerResolvedConfig = {\n /* COMPUTED_FIELDS */\n configPath: undefined,\n userConfigPath: undefined,\n topLevelName: undefined,\n definedEnvironments: undefined,\n targetEnvironment: undefined,\n\n /*= =================================================== */\n /* Fields supported by both Workers & Pages */\n /*= =================================================== */\n /* TOP-LEVEL ONLY FIELDS */\n pages_build_output_dir: undefined,\n send_metrics: undefined,\n dev: {\n ip: process.platform === \"win32\" ? \"127.0.0.1\" : \"localhost\",\n port: undefined, // the default of 8787 is set at runtime\n inspector_port: undefined, // the default of 9229 is set at runtime\n inspector_ip: undefined, // the default of 127.0.0.1 is set at runtime\n local_protocol: \"http\",\n upstream_protocol: \"http\",\n host: undefined,\n // Note this one is also workers only\n enable_containers: true,\n container_engine: undefined,\n generate_types: false\n },\n\n /** INHERITABLE ENVIRONMENT FIELDS */\n name: undefined,\n compatibility_date: undefined,\n compatibility_flags: [],\n limits: undefined,\n placement: undefined,\n\n /** NON-INHERITABLE ENVIRONMENT FIELDS */\n vars: {},\n durable_objects: { bindings: [] },\n kv_namespaces: [],\n queues: {\n producers: [],\n consumers: [] // WORKERS SUPPORT ONLY!!\n },\n r2_buckets: [],\n d1_databases: [],\n vectorize: [],\n hyperdrive: [],\n workflows: [],\n secrets_store_secrets: [],\n services: [],\n analytics_engine_datasets: [],\n ai: undefined,\n images: undefined,\n stream: undefined,\n media: undefined,\n version_metadata: undefined,\n unsafe_hello_world: [],\n ratelimits: [],\n worker_loaders: [],\n\n /*= =================================================== */\n /* Fields supported by Workers only */\n /*= =================================================== */\n /* TOP-LEVEL ONLY FIELDS */\n legacy_env: true,\n site: undefined,\n wasm_modules: undefined,\n text_blobs: undefined,\n data_blobs: undefined,\n keep_vars: undefined,\n alias: undefined,\n\n /** INHERITABLE ENVIRONMENT FIELDS */\n account_id: undefined,\n main: undefined,\n find_additional_modules: undefined,\n preserve_file_names: undefined,\n base_dir: undefined,\n workers_dev: undefined,\n preview_urls: undefined,\n route: undefined,\n routes: undefined,\n tsconfig: undefined,\n jsx_factory: \"React.createElement\",\n jsx_fragment: \"React.Fragment\",\n migrations: [],\n triggers: {\n crons: undefined\n },\n rules: [],\n build: { command: undefined, watch_dir: \"./src\", cwd: undefined },\n no_bundle: undefined,\n minify: undefined,\n keep_names: undefined,\n dispatch_namespaces: [],\n first_party_worker: undefined,\n logfwdr: { bindings: [] },\n logpush: undefined,\n upload_source_maps: undefined,\n assets: undefined,\n observability: { enabled: true },\n cache: undefined,\n /** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */\n compliance_region: undefined,\n python_modules: { exclude: [\"**/*.pyc\"] },\n\n /** NON-INHERITABLE ENVIRONMENT FIELDS */\n define: {},\n cloudchamber: {},\n containers: undefined,\n send_email: [],\n browser: undefined,\n unsafe: {},\n mtls_certificates: [],\n tail_consumers: undefined,\n streaming_tail_consumers: undefined,\n pipelines: [],\n vpc_services: [],\n ai_search_namespaces: []\n} as unknown as WranglerResolvedConfig;\n"],"mappings":";;;;;AAuBA,MAAY,gBAAgB,EAAA,MAAK;CAAA,EAAA,OAAA;CAAA,EAAA,OAAA;CAAA,EAAA,QAAA;CAAA,EAAA,KAAA;AAAA,CAAA;;;;;;AAEjC,IAAA;AACA,eAAgB,kBAAwB,aAAS,QAAA,SAAA,KAAA;;CAE/C,IAAC;SACI,MAAM,OAAA,KAAgB,MAAE,SAAM,GAAA;CACnC,UAAU;EACR,WAAQ;CACV;AACF;AACA,MAAE,aAAA,EAAA,OAAA,EAAA,WAAA,MAAA;CACF,OAAO,aAAe,QAAQ,iEAAqB;CACnD,OAAO,KAAK,QAAO,UAAa,CAAA;AAChC,CAAA;AACA,SAAU,SAAA,OAAA,uBAAA,IAAA,IAAA,GAAA;CACR,IAAE,OAAA,UAAa,YAAA,UAAA,MAAA,OAAA;CACf,KAAI,MAAM,SAAU,OAAC,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EP,QAAI;CACJ,eAAY,EACZ,SAAM,KACN;CACA,OAAA;;CAEA,mBAAa;CACb,gBAAc,EACd,SAAO,CAAA,UAAS,EAChB;;CAEA,QAAA,CAAA;CACA,cAAc,CAAC;CACf,YAAY;CACZ,YAAU,CAAA;CACV,SAAS;CACT,QAAC,CAAA;CACD,mBAAS,CAAA;CACT,gBAAgB;CAChB,0BAAoB;CACpB,WAAQ,CAAA;CACR,cAAY,CAAA;CACZ,sBAAsB,CAAC;AACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-cloudflare",
3
- "version": "0.6.130",
3
+ "version": "0.6.132",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin that provides integration with Cloudflare services.",
6
6
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
@@ -96,10 +96,10 @@
96
96
  "dependencies": {
97
97
  "@alloy-js/core": "^0.23.1",
98
98
  "@alloy-js/typescript": "^0.23.0",
99
- "@powerlines/schema": "^0.11.19",
100
- "@powerlines/plugin-env": "^0.16.231",
101
- "@powerlines/plugin-pulumi": "^0.6.142",
102
- "@powerlines/plugin-unenv": "^0.1.490",
99
+ "@powerlines/schema": "^0.11.21",
100
+ "@powerlines/plugin-env": "^0.16.233",
101
+ "@powerlines/plugin-pulumi": "^0.6.144",
102
+ "@powerlines/plugin-unenv": "^0.1.492",
103
103
  "@pulumi/cloudflare": "^6.15.0",
104
104
  "@pulumi/pulumi": "^3.239.0",
105
105
  "@storm-software/config-tools": "^1.190.20",
@@ -110,17 +110,17 @@
110
110
  "@stryke/type-checks": "^0.6.9",
111
111
  "@stryke/types": "^0.12.4",
112
112
  "defu": "^6.1.7",
113
- "powerlines": "^0.47.40"
113
+ "powerlines": "^0.47.42"
114
114
  },
115
115
  "devDependencies": {
116
116
  "@cloudflare/unenv-preset": "^2.16.1",
117
117
  "@cloudflare/workers-types": "^4.20260518.1",
118
- "@powerlines/plugin-alloy": "^0.26.123",
119
- "@powerlines/plugin-plugin": "^0.12.452",
120
- "@types/node": "^25.8.0",
118
+ "@powerlines/plugin-alloy": "^0.26.125",
119
+ "@powerlines/plugin-plugin": "^0.12.454",
120
+ "@types/node": "^25.9.0",
121
121
  "wrangler": "^4.92.0",
122
122
  "zod": "^4.4.3"
123
123
  },
124
124
  "publishConfig": { "access": "public" },
125
- "gitHead": "c5c293e753d59ab690265988c77bd535680ac71b"
125
+ "gitHead": "2dbbdb2f6fde8f0f49208757c7c1b18deb96ff97"
126
126
  }