@powerlines/plugin-cloudflare 0.6.56 → 0.6.57

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.
Files changed (71) hide show
  1. package/package.json +8 -8
  2. package/dist/_virtual/_rolldown/runtime.cjs +0 -1
  3. package/dist/components/cloudflare-builtin.cjs +0 -33
  4. package/dist/components/cloudflare-builtin.d.cts +0 -12
  5. package/dist/components/cloudflare-builtin.d.cts.map +0 -1
  6. package/dist/components/cloudflare-builtin.d.mts +0 -12
  7. package/dist/components/cloudflare-builtin.d.mts.map +0 -1
  8. package/dist/components/cloudflare-builtin.mjs +0 -34
  9. package/dist/components/cloudflare-builtin.mjs.map +0 -1
  10. package/dist/components/env-builtin.cjs +0 -1
  11. package/dist/components/env-builtin.d.cts +0 -12
  12. package/dist/components/env-builtin.d.cts.map +0 -1
  13. package/dist/components/env-builtin.d.mts +0 -12
  14. package/dist/components/env-builtin.d.mts.map +0 -1
  15. package/dist/components/env-builtin.mjs +0 -2
  16. package/dist/components/env-builtin.mjs.map +0 -1
  17. package/dist/components/index.cjs +0 -1
  18. package/dist/components/index.d.cts +0 -4
  19. package/dist/components/index.d.mts +0 -4
  20. package/dist/components/index.mjs +0 -1
  21. package/dist/components/worker-entry.cjs +0 -33
  22. package/dist/components/worker-entry.d.cts +0 -15
  23. package/dist/components/worker-entry.d.cts.map +0 -1
  24. package/dist/components/worker-entry.d.mts +0 -15
  25. package/dist/components/worker-entry.d.mts.map +0 -1
  26. package/dist/components/worker-entry.mjs +0 -34
  27. package/dist/components/worker-entry.mjs.map +0 -1
  28. package/dist/helpers/constants.cjs +0 -1
  29. package/dist/helpers/constants.d.cts +0 -5
  30. package/dist/helpers/constants.d.cts.map +0 -1
  31. package/dist/helpers/constants.d.mts +0 -5
  32. package/dist/helpers/constants.d.mts.map +0 -1
  33. package/dist/helpers/constants.mjs +0 -2
  34. package/dist/helpers/constants.mjs.map +0 -1
  35. package/dist/helpers/wrangler.cjs +0 -1
  36. package/dist/helpers/wrangler.d.cts +0 -36
  37. package/dist/helpers/wrangler.d.cts.map +0 -1
  38. package/dist/helpers/wrangler.d.mts +0 -36
  39. package/dist/helpers/wrangler.d.mts.map +0 -1
  40. package/dist/helpers/wrangler.mjs +0 -2
  41. package/dist/helpers/wrangler.mjs.map +0 -1
  42. package/dist/index.cjs +0 -1
  43. package/dist/index.d.cts +0 -21
  44. package/dist/index.d.cts.map +0 -1
  45. package/dist/index.d.mts +0 -21
  46. package/dist/index.d.mts.map +0 -1
  47. package/dist/index.mjs +0 -2
  48. package/dist/index.mjs.map +0 -1
  49. package/dist/types/index.cjs +0 -1
  50. package/dist/types/index.d.cts +0 -4
  51. package/dist/types/index.d.mts +0 -4
  52. package/dist/types/index.mjs +0 -1
  53. package/dist/types/plugin.cjs +0 -0
  54. package/dist/types/plugin.d.cts +0 -91
  55. package/dist/types/plugin.d.cts.map +0 -1
  56. package/dist/types/plugin.d.mts +0 -91
  57. package/dist/types/plugin.d.mts.map +0 -1
  58. package/dist/types/plugin.mjs +0 -1
  59. package/dist/types/worker-module.cjs +0 -0
  60. package/dist/types/worker-module.d.cts +0 -42
  61. package/dist/types/worker-module.d.cts.map +0 -1
  62. package/dist/types/worker-module.d.mts +0 -42
  63. package/dist/types/worker-module.d.mts.map +0 -1
  64. package/dist/types/worker-module.mjs +0 -1
  65. package/dist/types/wrangler.cjs +0 -1
  66. package/dist/types/wrangler.d.cts +0 -40
  67. package/dist/types/wrangler.d.cts.map +0 -1
  68. package/dist/types/wrangler.d.mts +0 -40
  69. package/dist/types/wrangler.d.mts.map +0 -1
  70. package/dist/types/wrangler.mjs +0 -2
  71. package/dist/types/wrangler.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-cloudflare",
3
- "version": "0.6.56",
3
+ "version": "0.6.57",
4
4
  "private": false,
5
5
  "description": "A Powerlines plugin that provides integration with Cloudflare services.",
6
6
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
@@ -209,9 +209,9 @@
209
209
  "dependencies": {
210
210
  "@alloy-js/core": "0.23.0-dev.8",
211
211
  "@alloy-js/typescript": "0.23.0-dev.4",
212
- "@powerlines/plugin-env": "^0.16.157",
213
- "@powerlines/plugin-pulumi": "^0.6.72",
214
- "@powerlines/plugin-unenv": "^0.1.420",
212
+ "@powerlines/plugin-env": "^0.16.158",
213
+ "@powerlines/plugin-pulumi": "^0.6.73",
214
+ "@powerlines/plugin-unenv": "^0.1.421",
215
215
  "@pulumi/cloudflare": "^6.14.0",
216
216
  "@pulumi/pulumi": "^3.232.0",
217
217
  "@storm-software/config-tools": "^1.189.78",
@@ -222,17 +222,17 @@
222
222
  "@stryke/type-checks": "^0.6.2",
223
223
  "@stryke/types": "^0.11.4",
224
224
  "defu": "^6.1.7",
225
- "powerlines": "^0.43.27"
225
+ "powerlines": "^0.43.28"
226
226
  },
227
227
  "devDependencies": {
228
228
  "@cloudflare/unenv-preset": "^2.16.1",
229
229
  "@cloudflare/workers-types": "^4.20260426.1",
230
- "@powerlines/plugin-alloy": "^0.26.49",
231
- "@powerlines/plugin-plugin": "^0.12.382",
230
+ "@powerlines/plugin-alloy": "^0.26.51",
231
+ "@powerlines/plugin-plugin": "^0.12.383",
232
232
  "@types/node": "^25.6.0",
233
233
  "wrangler": "^4.85.0",
234
234
  "zod": "^4.3.6"
235
235
  },
236
236
  "publishConfig": { "access": "public" },
237
- "gitHead": "ad851a239011b884c15b0444db518d74927fd13f"
237
+ "gitHead": "efeaec793549f37c700f2e876bf6097c37375c46"
238
238
  }
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
@@ -1,33 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`),r=require(`defu`);r=e.__toESM(r);let i=require(`@alloy-js/typescript`),a=require(`@powerlines/plugin-alloy/core/components`),o=require(`@powerlines/plugin-alloy/typescript/components/builtin-file`),s=require(`@powerlines/plugin-alloy/typescript/components/interface-declaration`),c=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`);function l(e){let[{imports:l,children:u},d]=(0,n.splitProps)(e,[`imports`,`children`]);return(0,t.createComponent)(o.BuiltinFile,(0,t.mergeProps)({id:`cloudflare`,description:`A set of helpful runtime utilities for integrating Cloudflare services.`},d,{get imports(){return(0,r.default)({"node:async_hooks":[`AsyncLocalStorage`],"@cloudflare/workers-types":[{name:`Request`,type:!0},{name:`Response`,type:!0},{name:`ExecutionContext`,type:!0},{name:`IncomingRequestCfProperties`,type:!0},{name:`ScheduledController`,type:!0},{name:`ForwardableEmailMessage`,type:!0},{name:`MessageBatch`,type:!0},{name:`TailStream`,type:!0},{name:`TraceItem`,type:!0},{name:`TailStream.TailEvent`,type:!0},{name:`TailStream.Onset`,type:!0},{name:`TailStream.TailEventHandlerType`,type:!0}]},l??{})},get children(){return[(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`globalContextStorage`,initializer:n.code`globalThis as unknown as Record<PropertyKey, unknown>; `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareFetchContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`},{name:`CfHostMetadata`,default:`unknown`}],doc:`An interface representing the runtime context for Cloudflare operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`request`,type:`Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>`,doc:`The incoming Cloudflare request.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the incoming request.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_FETCH_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-fetch"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`fetchContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare fetch context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_FETCH_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareFetchContext>()) as AsyncLocalStorage<CloudflareFetchContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare fetch context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getFetchContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`},{name:`CfHostMetadata`,default:`unknown`}],parameters:[],returnType:`CloudflareFetchContext<Env, CfHostMetadata>`,children:n.code`const context = fetchContextStorage.getStore();
2
- if (!context) {
3
- throw new Error("Cloudflare fetch context is not available. Ensure that you are calling this function within the scope of a Cloudflare fetch request.");
4
- }
5
- return context as CloudflareFetchContext<Env, CfHostMetadata>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare fetch context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withFetchContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`},{name:`CfHostMetadata`,default:`unknown`}],parameters:[{name:`context`,type:`CloudflareFetchContext<Env, CfHostMetadata>`},{name:`callback`,type:`(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Promise<Response>`}],returnType:`Promise<Response>`,children:n.code`return fetchContextStorage.run(context, () => callback(context.request, context.env, context.ctx)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareScheduledContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the runtime context for Cloudflare scheduled operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`controller`,type:`ScheduledController`,doc:`The Cloudflare scheduled controller for the scheduled operation.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the scheduled operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_SCHEDULED_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-scheduled"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`scheduledContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare scheduled runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_SCHEDULED_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareScheduledContext>()) as AsyncLocalStorage<CloudflareScheduledContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare scheduled runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getScheduledContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareScheduledContext<Env>`,children:n.code`const context = scheduledContextStorage.getStore();
6
- if (!context) {
7
- throw new Error("Cloudflare scheduled context is not available. Ensure that you are calling this function within the scope of a Cloudflare scheduled operation.");
8
- }
9
- return context as CloudflareScheduledContext<Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare scheduled context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withScheduledContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareScheduledContext<Env>`},{name:`callback`,type:`(ctx: CloudflareScheduledContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:n.code`return scheduledContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareEmailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the runtime context for Cloudflare email operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`message`,type:`ForwardableEmailMessage`,doc:`The Cloudflare email instance for the email operation.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the email operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_EMAIL_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-email"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`emailContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare email runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_EMAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareEmailContext>()) as AsyncLocalStorage<CloudflareEmailContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare email runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getEmailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareEmailContext<Env>`,children:n.code`const context = emailContextStorage.getStore();
10
- if (!context) {
11
- throw new Error("Cloudflare email context is not available. Ensure that you are calling this function within the scope of a Cloudflare email operation.");
12
- }
13
- return context as CloudflareEmailContext<Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare email context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`A promise that resolves with the result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withEmailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareEmailContext<Env>`},{name:`callback`,type:`(ctx: CloudflareEmailContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:n.code`return emailContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareQueueContext`,typeParameters:[{name:`Message`,default:`unknown`},{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the runtime context for Cloudflare queue operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`batch`,type:`MessageBatch<Message>`,doc:`The Cloudflare queue event instance for the queue operation.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the queue operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_QUEUE_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-queue"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`queueContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare queue runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_QUEUE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareQueueContext>()) as AsyncLocalStorage<CloudflareQueueContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare queue runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getQueueContext`,typeParameters:[{name:`Message`,default:`unknown`},{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareQueueContext<Message, Env>`,children:n.code`const context = queueContextStorage.getStore();
14
- if (!context) {
15
- throw new Error("Cloudflare queue context is not available. Ensure that you are calling this function within the scope of a Cloudflare queue operation.");
16
- }
17
- return context as CloudflareQueueContext<Message, Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare queue context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withQueueContext`,typeParameters:[{name:`Message`,default:`unknown`},{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareQueueContext<Message, Env>`},{name:`callback`,type:`(ctx: CloudflareQueueContext<Message, Env>) => Promise<void>`}],returnType:`Promise<void>`,children:n.code`return queueContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareTailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the tail context for Cloudflare tail operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`events`,type:`TraceItem[]`,doc:`An array of trace items representing the events in the Cloudflare tail context.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the tail operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_TAIL_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-tail"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`tailContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare tail runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_TAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailContext>()) as AsyncLocalStorage<CloudflareTailContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare tail runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getTailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTailContext<Env>`,children:n.code`const context = tailContextStorage.getStore();
18
- if (!context) {
19
- throw new Error("Cloudflare tail context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail operation.");
20
- }
21
- return context as CloudflareTailContext<Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare tail context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withTailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTailContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTailContext<Env>) => Promise<void>`}],returnType:`T`,children:n.code`return tailContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareTailStreamContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the tail context for Cloudflare tail stream operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`event`,type:`TailStream.TailEvent<TailStream.Onset>`,doc:`The tail event associated with the Cloudflare tail stream context.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the tail stream operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-tail-stream"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`tailStreamContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare tail stream runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailStreamContext>()) as AsyncLocalStorage<CloudflareTailStreamContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare tail stream runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getTailStreamContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTailStreamContext<Env>`,children:n.code`const context = tailStreamContextStorage.getStore();
22
- if (!context) {
23
- 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.");
24
- }
25
- return context as CloudflareTailStreamContext<Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare tail stream context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withTailStreamContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTailStreamContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTailStreamContext<Env>) => Promise<TailStream.TailEventHandlerType>`}],returnType:`Promise<TailStream.TailEventHandlerType>`,children:n.code`return tailStreamContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareTraceContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the trace context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`traces`,type:`TraceItem[]`,doc:`An array of trace items associated with the Cloudflare trace context.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the trace operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_TRACE_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-trace"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`traceContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare trace runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_TRACE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTraceContext>()) as AsyncLocalStorage<CloudflareTraceContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare trace runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getTraceContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTraceContext<Env>`,children:n.code`const context = traceContextStorage.getStore();
26
- if (!context) {
27
- throw new Error("Cloudflare trace context is not available. Ensure that you are calling this function within the scope of a Cloudflare trace operation.");
28
- }
29
- return context as CloudflareTraceContext<Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare trace context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withTraceContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTraceContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTraceContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:n.code`return traceContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(s.InterfaceDeclaration,{export:!0,name:`CloudflareTestContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the test context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[(0,t.createComponent)(s.InterfaceMember,{name:`controller`,type:`TestController`,doc:`The test controller associated with the Cloudflare test context.`}),(0,t.createComponent)(s.InterfaceMember,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),(0,t.createComponent)(s.InterfaceMember,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the test operation.`})]}}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{const:!0,name:`CLOUDFLARE_TEST_CONTEXT_KEY`,initializer:n.code`Symbol.for("powerlines-cloudflare-test"); `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(i.VarDeclaration,{export:!0,const:!0,name:`testContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare test runtime context.`,initializer:n.code`(globalContextStorage[CLOUDFLARE_TEST_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTestContext>()) as AsyncLocalStorage<CloudflareTestContext>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.`,get children(){return(0,t.createComponent)(c.TSDocReturns,{children:n.code`The current Cloudflare test runtime context.`})}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`getTestContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTestContext<Env>`,children:n.code`const context = testContextStorage.getStore();
30
- if (!context) {
31
- throw new Error("Cloudflare test context is not available. Ensure that you are calling this function within the scope of a Cloudflare test operation.");
32
- }
33
- return context as CloudflareTestContext<Env>; `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(c.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.",get children(){return[(0,t.createComponent)(c.TSDocParam,{name:`context`,children:n.code`The Cloudflare test context to run the function with.`}),(0,t.createComponent)(c.TSDocParam,{name:`callback`,children:n.code`The function to execute within the scope of the provided context.`}),(0,t.createComponent)(c.TSDocReturns,{children:n.code`The result of the executed function.`})]}}),(0,t.createComponent)(i.FunctionDeclaration,{export:!0,name:`withTestContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTestContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTestContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:n.code`return testContextStorage.run(context, () => callback(context)); `}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(a.Spacing,{}),(0,t.createComponent)(n.Show,{get when(){return!!u},children:u})]}}))}exports.CloudflareBuiltin=l;
@@ -1,12 +0,0 @@
1
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
-
3
- //#region src/components/cloudflare-builtin.d.ts
4
- type CloudflareBuiltinProps = Partial<BuiltinFileProps> & Omit<BuiltinFileProps, "id" | "description">;
5
- /**
6
- * Generates the Cloudflare environment configuration module for the Powerlines project.
7
- */
8
- declare function CloudflareBuiltin(props: CloudflareBuiltinProps): any;
9
- declare type __ΩCloudflareBuiltinProps = any[];
10
- //#endregion
11
- export { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps };
12
- //# sourceMappingURL=cloudflare-builtin.d.cts.map
@@ -1 +0,0 @@
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;AAAA"}
@@ -1,12 +0,0 @@
1
- import { BuiltinFileProps } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
2
-
3
- //#region src/components/cloudflare-builtin.d.ts
4
- type CloudflareBuiltinProps = Partial<BuiltinFileProps> & Omit<BuiltinFileProps, "id" | "description">;
5
- /**
6
- * Generates the Cloudflare environment configuration module for the Powerlines project.
7
- */
8
- declare function CloudflareBuiltin(props: CloudflareBuiltinProps): any;
9
- declare type __ΩCloudflareBuiltinProps = any[];
10
- //#endregion
11
- export { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps };
12
- //# sourceMappingURL=cloudflare-builtin.d.mts.map
@@ -1 +0,0 @@
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;AAAA"}
@@ -1,34 +0,0 @@
1
- import{createComponent as e,createIntrinsic as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Show as r,code as i,splitProps as a}from"@alloy-js/core";import o from"defu";import{FunctionDeclaration as s,VarDeclaration as c}from"@alloy-js/typescript";import{Spacing as l}from"@powerlines/plugin-alloy/core/components";import{BuiltinFile as u}from"@powerlines/plugin-alloy/typescript/components/builtin-file";import{InterfaceDeclaration as d,InterfaceMember as f}from"@powerlines/plugin-alloy/typescript/components/interface-declaration";import{TSDoc as p,TSDocParam as m,TSDocReturns as h}from"@powerlines/plugin-alloy/typescript/components/tsdoc";function g(g){let[{imports:_,children:v},y]=a(g,[`imports`,`children`]);return e(u,n({id:`cloudflare`,description:`A set of helpful runtime utilities for integrating Cloudflare services.`},y,{get imports(){return o({"node:async_hooks":[`AsyncLocalStorage`],"@cloudflare/workers-types":[{name:`Request`,type:!0},{name:`Response`,type:!0},{name:`ExecutionContext`,type:!0},{name:`IncomingRequestCfProperties`,type:!0},{name:`ScheduledController`,type:!0},{name:`ForwardableEmailMessage`,type:!0},{name:`MessageBatch`,type:!0},{name:`TailStream`,type:!0},{name:`TraceItem`,type:!0},{name:`TailStream.TailEvent`,type:!0},{name:`TailStream.Onset`,type:!0},{name:`TailStream.TailEventHandlerType`,type:!0}]},_??{})},get children(){return[e(c,{const:!0,name:`globalContextStorage`,initializer:i`globalThis as unknown as Record<PropertyKey, unknown>; `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareFetchContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`},{name:`CfHostMetadata`,default:`unknown`}],doc:`An interface representing the runtime context for Cloudflare operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`request`,type:`Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>`,doc:`The incoming Cloudflare request.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the incoming request.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_FETCH_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-fetch"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`fetchContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare fetch context.`,initializer:i`(globalContextStorage[CLOUDFLARE_FETCH_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareFetchContext>()) as AsyncLocalStorage<CloudflareFetchContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare fetch context.`})}}),e(s,{export:!0,name:`getFetchContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`},{name:`CfHostMetadata`,default:`unknown`}],parameters:[],returnType:`CloudflareFetchContext<Env, CfHostMetadata>`,children:i`const context = fetchContextStorage.getStore();
2
- if (!context) {
3
- throw new Error("Cloudflare fetch context is not available. Ensure that you are calling this function within the scope of a Cloudflare fetch request.");
4
- }
5
- return context as CloudflareFetchContext<Env, CfHostMetadata>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare fetch context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withFetchContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`},{name:`CfHostMetadata`,default:`unknown`}],parameters:[{name:`context`,type:`CloudflareFetchContext<Env, CfHostMetadata>`},{name:`callback`,type:`(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Promise<Response>`}],returnType:`Promise<Response>`,children:i`return fetchContextStorage.run(context, () => callback(context.request, context.env, context.ctx)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareScheduledContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the runtime context for Cloudflare scheduled operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`controller`,type:`ScheduledController`,doc:`The Cloudflare scheduled controller for the scheduled operation.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the scheduled operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_SCHEDULED_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-scheduled"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`scheduledContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare scheduled runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_SCHEDULED_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareScheduledContext>()) as AsyncLocalStorage<CloudflareScheduledContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare scheduled runtime context.`})}}),e(s,{export:!0,name:`getScheduledContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareScheduledContext<Env>`,children:i`const context = scheduledContextStorage.getStore();
6
- if (!context) {
7
- throw new Error("Cloudflare scheduled context is not available. Ensure that you are calling this function within the scope of a Cloudflare scheduled operation.");
8
- }
9
- return context as CloudflareScheduledContext<Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare scheduled context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withScheduledContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareScheduledContext<Env>`},{name:`callback`,type:`(ctx: CloudflareScheduledContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:i`return scheduledContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareEmailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the runtime context for Cloudflare email operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`message`,type:`ForwardableEmailMessage`,doc:`The Cloudflare email instance for the email operation.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the email operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_EMAIL_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-email"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`emailContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare email runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_EMAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareEmailContext>()) as AsyncLocalStorage<CloudflareEmailContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare email runtime context.`})}}),e(s,{export:!0,name:`getEmailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareEmailContext<Env>`,children:i`const context = emailContextStorage.getStore();
10
- if (!context) {
11
- throw new Error("Cloudflare email context is not available. Ensure that you are calling this function within the scope of a Cloudflare email operation.");
12
- }
13
- return context as CloudflareEmailContext<Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare email context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`A promise that resolves with the result of the executed function.`})]}}),e(s,{export:!0,name:`withEmailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareEmailContext<Env>`},{name:`callback`,type:`(ctx: CloudflareEmailContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:i`return emailContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareQueueContext`,typeParameters:[{name:`Message`,default:`unknown`},{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the runtime context for Cloudflare queue operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`batch`,type:`MessageBatch<Message>`,doc:`The Cloudflare queue event instance for the queue operation.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the queue operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_QUEUE_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-queue"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`queueContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare queue runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_QUEUE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareQueueContext>()) as AsyncLocalStorage<CloudflareQueueContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare queue runtime context.`})}}),e(s,{export:!0,name:`getQueueContext`,typeParameters:[{name:`Message`,default:`unknown`},{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareQueueContext<Message, Env>`,children:i`const context = queueContextStorage.getStore();
14
- if (!context) {
15
- throw new Error("Cloudflare queue context is not available. Ensure that you are calling this function within the scope of a Cloudflare queue operation.");
16
- }
17
- return context as CloudflareQueueContext<Message, Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare queue context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withQueueContext`,typeParameters:[{name:`Message`,default:`unknown`},{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareQueueContext<Message, Env>`},{name:`callback`,type:`(ctx: CloudflareQueueContext<Message, Env>) => Promise<void>`}],returnType:`Promise<void>`,children:i`return queueContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareTailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the tail context for Cloudflare tail operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`events`,type:`TraceItem[]`,doc:`An array of trace items representing the events in the Cloudflare tail context.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the tail operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_TAIL_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-tail"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`tailContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare tail runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_TAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailContext>()) as AsyncLocalStorage<CloudflareTailContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare tail runtime context.`})}}),e(s,{export:!0,name:`getTailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTailContext<Env>`,children:i`const context = tailContextStorage.getStore();
18
- if (!context) {
19
- throw new Error("Cloudflare tail context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail operation.");
20
- }
21
- return context as CloudflareTailContext<Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare tail context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withTailContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTailContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTailContext<Env>) => Promise<void>`}],returnType:`T`,children:i`return tailContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareTailStreamContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the tail context for Cloudflare tail stream operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`event`,type:`TailStream.TailEvent<TailStream.Onset>`,doc:`The tail event associated with the Cloudflare tail stream context.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the tail stream operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-tail-stream"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`tailStreamContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare tail stream runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailStreamContext>()) as AsyncLocalStorage<CloudflareTailStreamContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare tail stream runtime context.`})}}),e(s,{export:!0,name:`getTailStreamContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTailStreamContext<Env>`,children:i`const context = tailStreamContextStorage.getStore();
22
- if (!context) {
23
- 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.");
24
- }
25
- return context as CloudflareTailStreamContext<Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare tail stream context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withTailStreamContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTailStreamContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTailStreamContext<Env>) => Promise<TailStream.TailEventHandlerType>`}],returnType:`Promise<TailStream.TailEventHandlerType>`,children:i`return tailStreamContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareTraceContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the trace context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`traces`,type:`TraceItem[]`,doc:`An array of trace items associated with the Cloudflare trace context.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the trace operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_TRACE_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-trace"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`traceContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare trace runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_TRACE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTraceContext>()) as AsyncLocalStorage<CloudflareTraceContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare trace runtime context.`})}}),e(s,{export:!0,name:`getTraceContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTraceContext<Env>`,children:i`const context = traceContextStorage.getStore();
26
- if (!context) {
27
- throw new Error("Cloudflare trace context is not available. Ensure that you are calling this function within the scope of a Cloudflare trace operation.");
28
- }
29
- return context as CloudflareTraceContext<Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare trace context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withTraceContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTraceContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTraceContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:i`return traceContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(d,{export:!0,name:`CloudflareTestContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],doc:`An interface representing the test context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.`,get children(){return[e(f,{name:`controller`,type:`TestController`,doc:`The test controller associated with the Cloudflare test context.`}),e(f,{name:`env`,type:`Env`,doc:`The Cloudflare environment bindings available during runtime.`}),e(f,{name:`ctx`,type:`ExecutionContext`,doc:`The Cloudflare execution context for the test operation.`})]}}),t(`hbr`,{}),e(c,{const:!0,name:`CLOUDFLARE_TEST_CONTEXT_KEY`,initializer:i`Symbol.for("powerlines-cloudflare-test"); `}),t(`hbr`,{}),e(c,{export:!0,const:!0,name:`testContextStorage`,doc:`An AsyncLocalStorage instance for managing the Cloudflare test runtime context.`,initializer:i`(globalContextStorage[CLOUDFLARE_TEST_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTestContext>()) as AsyncLocalStorage<CloudflareTestContext>; `}),t(`hbr`,{}),e(p,{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.`,get children(){return e(h,{children:i`The current Cloudflare test runtime context.`})}}),e(s,{export:!0,name:`getTestContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[],returnType:`CloudflareTestContext<Env>`,children:i`const context = testContextStorage.getStore();
30
- if (!context) {
31
- throw new Error("Cloudflare test context is not available. Ensure that you are calling this function within the scope of a Cloudflare test operation.");
32
- }
33
- return context as CloudflareTestContext<Env>; `}),t(`hbr`,{}),e(p,{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.",get children(){return[e(m,{name:`context`,children:i`The Cloudflare test context to run the function with.`}),e(m,{name:`callback`,children:i`The function to execute within the scope of the provided context.`}),e(h,{children:i`The result of the executed function.`})]}}),e(s,{export:!0,name:`withTestContext`,typeParameters:[{name:`Env`,default:`CloudflareBindings`}],parameters:[{name:`context`,type:`CloudflareTestContext<Env>`},{name:`callback`,type:`(ctx: CloudflareTestContext<Env>) => Promise<void>`}],returnType:`Promise<void>`,children:i`return testContextStorage.run(context, () => callback(context)); `}),e(l,{}),e(l,{}),e(r,{get when(){return!!v},children:v})]}}))}export{g as CloudflareBuiltin};
34
- //# sourceMappingURL=cloudflare-builtin.mjs.map
@@ -1 +0,0 @@
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":"kpBA6BA,SAAO,EAAA,EAAA,CACL,GAAK,CAAA,CACL,UACA,YACA,GAAO,EAAW,EAAO,CAAK,UAAW,WAAW,CAAC,CACvD,OAAO,EAAgB,EAAA,EAAA,iBAEvB,YAAY,0EACV,CAAA,EAAK,eAEL,OAAA,EAAA,CACC,mBAAyB,CAAA,oBAAY,CACtC,4BAAA,CAAA,CACK,KAAS,UACN,KAAC,GACN,CAAA,CACA,KAAQ,WACT,KAAA,KAEK,KAAA,mBACJ,KAAA,GACI,CAAC,CACJ,KAAA,8BACI,KAAI,GACR,CAAA,CACE,KAAA,sBACE,KAAM,GACP,CAAE,CACD,KAAI,0BACJ,KAAI,GACL,CAAE,CACD,KAAI,eACJ,KAAI,GACL,CAAE,CACD,KAAI,aACJ,KAAI,GACL,CAAE,CACD,KAAI,YACJ,KAAI,GACL,CAAE,CACD,KAAA,uBACD,KAAA,GACD,CAAA,CACA,KAAA,mBACD,KAAA,GACC,CAAA,CACA,KAAM,kCACN,KAAA,GACD,CAAA,CACA,CAAA,GAAS,EAAA,CAAA,EAEZ,IAAG,UAAA,CACD,MAAE,CAAA,EAAA,EAAA,CACA,MAAM,GACN,KAAA,uBACA,YAAW,CAAM,0DAClB,CAAC,CAAE,EAAS,EAAiB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kB,EAAA,CACpB,KAAI,WACR,SAAa,CAAK,oEACnB,CAAA,CAAA,EAAA,EAAA,CACK,SAAA,CAAA,uCACL,CAAK,CAAC,EAEN,CAAC,CAAA,EAAK,EAAA,CACN,OAAA,GACC,KAAA,mBACA,eAAM,CAAA,CACN,KAAA,MACA,QAAW,qBACX,CAAA,CACA,WAAY,CAAA,CACf,KAAS,UACN,KAAI,8BACZ,CAAA,CACO,KAAQ,WACP,KAAA,sDACD,CAAG,CACH,WAAa,gBACZ,SAAC,CAAW,qEACb,CAAC,CAAC,EAAiB,EAAW,EAAA,CAAA,CAAK,EAAgB,EAAQ,EAAA,CAAM,CAAC,EAAiB,EAAqB,CACvG,OAAC,GACD,KAAK,wBACN,eAAA,CAAA,CACC,KAAA,MACA,QAAM,qBACN,CAAA,CACA,IAAA,sLACA,IAAE,UAAA,CACA,MAAO,CAAC,EAAS,EAAA,CACf,KAAM,aACP,KAAA,iBACD,IAAA,mEACC,CAAC,CAAA,EAAgB,EAAA,CAChB,KAAM,MACR,KAAA,MACD,IAAA,gEACD,CAAA,CAAA,EAAwB,EAAE,CACzB,KAAK,MACN,KAAA,mBACD,IAAS,2DACT,CAAA,CAAA,EAED,CAAA,CAAA,EAAW,MAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACd,MAAA,GACH,KAAA"}
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`),r=require(`defu`);r=e.__toESM(r);let i=require(`@powerlines/plugin-alloy/core/components/spacing`),a=require(`@powerlines/plugin-env/components/env-builtin`);function o(e){let[{children:o,imports:s},c]=(0,n.splitProps)(e,[`children`,`imports`]);return(0,t.createComponent)(a.EnvBuiltin,(0,t.mergeProps)({defaultConfig:n.code`env`},c,{get imports(){return(0,r.default)({"cloudflare:workers":[`env`]},s??{})},get children(){return[(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(n.Show,{get when(){return!!o},children:o})]}}))}exports.CloudflareEnvBuiltin=o;
@@ -1,12 +0,0 @@
1
- import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env-builtin";
2
-
3
- //#region src/components/env-builtin.d.ts
4
- type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, "defaultConfig">;
5
- /**
6
- * Generates the Cloudflare environment configuration module for the Powerlines project.
7
- */
8
- declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): any;
9
- declare type __ΩCloudflareEnvBuiltinProps = any[];
10
- //#endregion
11
- export { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps };
12
- //# sourceMappingURL=env-builtin.d.cts.map
@@ -1 +0,0 @@
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;AAAA"}
@@ -1,12 +0,0 @@
1
- import { EnvBuiltinProps } from "@powerlines/plugin-env/components/env-builtin";
2
-
3
- //#region src/components/env-builtin.d.ts
4
- type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, "defaultConfig">;
5
- /**
6
- * Generates the Cloudflare environment configuration module for the Powerlines project.
7
- */
8
- declare function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps): any;
9
- declare type __ΩCloudflareEnvBuiltinProps = any[];
10
- //#endregion
11
- export { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps };
12
- //# sourceMappingURL=env-builtin.d.mts.map
@@ -1 +0,0 @@
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;AAAA"}
@@ -1,2 +0,0 @@
1
- import{createComponent as e,mergeProps as t}from"@alloy-js/core/jsx-runtime";import{Show as n,code as r,splitProps as i}from"@alloy-js/core";import a from"defu";import{Spacing as o}from"@powerlines/plugin-alloy/core/components/spacing";import{EnvBuiltin as s}from"@powerlines/plugin-env/components/env-builtin";function c(c){let[{children:l,imports:u},d]=i(c,[`children`,`imports`]);return e(s,t({defaultConfig:r`env`},d,{get imports(){return a({"cloudflare:workers":[`env`]},u??{})},get children(){return[e(o,{}),e(n,{get when(){return!!l},children:l})]}}))}export{c as CloudflareEnvBuiltin};
2
- //# sourceMappingURL=env-builtin.mjs.map
@@ -1 +0,0 @@
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":"uTA0BA,SAAY,EAAyB,EAAO,MAE1C,WACC,WACD,GAAA,EAAA,EAAA,CAAA,WAAA,UAAA,CAAA,CACF,OAAO,EAAS,EAAqB,EAAO,CAC1C,cAAiB,CAAE,MAClB,CAAE,EAAA,CACD,IAAC,SAAO,CACR,OAAA,EAAA,CAAA,qBAAA,CAAA,MAAA,CAEF,CAAO,GAAA,EAAA,CAAA,EAEL,IAAE,UAAa,CACb,MAAI,CAAI,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACR,IAAA,MAAa,CACX,MAAA,EAAA,GAEC,WACF,CAAC,CAAA,EAEL,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./cloudflare-builtin.cjs`),t=require(`./env-builtin.cjs`),n=require(`./worker-entry.cjs`);exports.CloudflareBuiltin=e.CloudflareBuiltin,exports.CloudflareEnvBuiltin=t.CloudflareEnvBuiltin,exports.WorkerEntry=n.WorkerEntry;
@@ -1,4 +0,0 @@
1
- import { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps } from "./cloudflare-builtin.cjs";
2
- import { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps } from "./env-builtin.cjs";
3
- import { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps } from "./worker-entry.cjs";
4
- export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, WorkerEntry, WorkerEntryProps, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩWorkerEntryProps };
@@ -1,4 +0,0 @@
1
- import { CloudflareBuiltin, CloudflareBuiltinProps, __ΩCloudflareBuiltinProps } from "./cloudflare-builtin.mjs";
2
- import { CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, __ΩCloudflareEnvBuiltinProps } from "./env-builtin.mjs";
3
- import { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps } from "./worker-entry.mjs";
4
- export { CloudflareBuiltin, CloudflareBuiltinProps, CloudflareEnvBuiltin, CloudflareEnvBuiltinProps, WorkerEntry, WorkerEntryProps, __ΩCloudflareBuiltinProps, __ΩCloudflareEnvBuiltinProps, __ΩWorkerEntryProps };
@@ -1 +0,0 @@
1
- import{CloudflareBuiltin as e}from"./cloudflare-builtin.mjs";import{CloudflareEnvBuiltin as t}from"./env-builtin.mjs";import{WorkerEntry as n}from"./worker-entry.mjs";export{e as CloudflareBuiltin,t as CloudflareEnvBuiltin,n as WorkerEntry};
@@ -1,33 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/core`),r=require(`defu`);r=e.__toESM(r);let i=require(`@powerlines/plugin-alloy/core/components`),a=require(`@powerlines/plugin-alloy/core/contexts`),o=require(`@powerlines/plugin-alloy/typescript/components/entry-file`),s=require(`@stryke/hash`),c=require(`@stryke/path/find`),l=require(`@stryke/path/replace`);function u(e){let[{worker:u,children:d,imports:f,builtinImports:p},m]=(0,n.splitProps)(e,[`worker`,`children`,`imports`,`builtinImports`]),h=(0,a.usePowerlines)(),g=(0,n.computed)(()=>`./${(0,l.replaceExtension)((0,c.relativePath)(h.entryPath,u.metadata.entry.input?.file||u.metadata.entry.file))}`);return(0,t.createComponent)(o.EntryFile,(0,t.mergeProps)({get path(){return`worker-${(0,s.murmurhash)(u.metadata.entry,{maxLength:8})}-entry.ts`}},m,{get imports(){return(0,r.default)({"@cloudflare/workers-types":[{name:`Request`,type:!0},{name:`Response`,type:!0},{name:`ExecutionContext`,type:!0},{name:`IncomingRequestCfProperties`,type:!0},{name:`ScheduledController`,type:!0},{name:`ForwardableEmailMessage`,type:!0},{name:`MessageBatch`,type:!0},{name:`TailStream`,type:!0},{name:`TraceItem`,type:!0},{name:`TailStream.TailEvent`,type:!0},{name:`TailStream.Onset`,type:!0},{name:`TailStream.TailEventHandlerType`,type:!0}],[g.value]:`worker`},f??{})},get builtinImports(){return(0,r.default)({cloudflare:[`withFetchContext`,`withTailContext`,`withTraceContext`,`withTailStreamContext`,`withScheduledContext`,`withTestContext`,`withEmailContext`,`withQueueContext`]},p??{})},get children(){return[n.code`export default { `,(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.fetch},children:n.code` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {
2
- return await withFetchContext({ request, env, ctx }, async (context) => {
3
- return worker.fetch(context.request, context.env, context.ctx);
4
- });
5
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.tail},children:n.code` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
6
- return withTailContext({ events, env, ctx }, async (context) => {
7
- return worker.tail(context.events, context.env, context.ctx);
8
- });
9
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.trace},children:n.code` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
10
- return withTraceContext({ traces, env, ctx }, async (context) => {
11
- return worker.trace(context.traces, context.env, context.ctx);
12
- });
13
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.tailStream},children:n.code` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {
14
- return await withTailStreamContext({ event, env, ctx }, async (context) => {
15
- return await worker.tailStream(context.event, context.env, context.ctx);
16
- });
17
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.scheduled},children:n.code` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
18
- return withScheduledContext({ controller, env, ctx }, async (context) => {
19
- return worker.scheduled(context.controller, context.env, context.ctx);
20
- });
21
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.test},children:n.code` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
22
- return withTestContext({ controller, env, ctx }, async (context) => {
23
- return worker.test(context.controller, context.env, context.ctx);
24
- });
25
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.email},children:n.code` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
26
- return withEmailContext({ message, env, ctx }, async (context) => {
27
- return worker.email(context.message, context.env, context.ctx);
28
- });
29
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),(0,t.createComponent)(n.Show,{get when(){return u.queue},children:n.code` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
30
- return withQueueContext({ batch, env, ctx }, async (context) => {
31
- return worker.queue(context.batch, context.env, context.ctx);
32
- });
33
- }, `}),(0,t.createIntrinsic)(`hbr`,{}),n.code` } satisfies ExportedHandler<CloudflareBindings>; `,(0,t.createComponent)(i.Spacing,{}),(0,t.createComponent)(n.Show,{get when(){return!!d},children:d})]}}))}exports.WorkerEntry=u;
@@ -1,15 +0,0 @@
1
- import { CloudflareWorkerEntryModule } from "../types/plugin.cjs";
2
- import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
3
-
4
- //#region src/components/worker-entry.d.ts
5
- type WorkerEntryProps = Partial<EntryFileProps> & Omit<EntryFileProps, "path"> & {
6
- worker: CloudflareWorkerEntryModule;
7
- };
8
- /**
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.
10
- */
11
- declare function WorkerEntry(props: WorkerEntryProps): any;
12
- declare type __ΩWorkerEntryProps = any[];
13
- //#endregion
14
- export { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps };
15
- //# sourceMappingURL=worker-entry.d.cts.map
@@ -1 +0,0 @@
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,gBAAA;AAAA"}
@@ -1,15 +0,0 @@
1
- import { CloudflareWorkerEntryModule } from "../types/plugin.mjs";
2
- import { EntryFileProps } from "@powerlines/plugin-alloy/typescript/components/entry-file";
3
-
4
- //#region src/components/worker-entry.d.ts
5
- type WorkerEntryProps = Partial<EntryFileProps> & Omit<EntryFileProps, "path"> & {
6
- worker: CloudflareWorkerEntryModule;
7
- };
8
- /**
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.
10
- */
11
- declare function WorkerEntry(props: WorkerEntryProps): any;
12
- declare type __ΩWorkerEntryProps = any[];
13
- //#endregion
14
- export { WorkerEntry, WorkerEntryProps, __ΩWorkerEntryProps };
15
- //# sourceMappingURL=worker-entry.d.mts.map
@@ -1 +0,0 @@
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,gBAAA;AAAA"}
@@ -1,34 +0,0 @@
1
- import{createComponent as e,createIntrinsic as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Show as r,code as i,computed as a,splitProps as o}from"@alloy-js/core";import s from"defu";import{Spacing as c}from"@powerlines/plugin-alloy/core/components";import{usePowerlines as l}from"@powerlines/plugin-alloy/core/contexts";import{EntryFile as u}from"@powerlines/plugin-alloy/typescript/components/entry-file";import{murmurhash as d}from"@stryke/hash";import{relativePath as f}from"@stryke/path/find";import{replaceExtension as p}from"@stryke/path/replace";function m(m){let[{worker:h,children:g,imports:_,builtinImports:v},y]=o(m,[`worker`,`children`,`imports`,`builtinImports`]),b=l(),x=a(()=>`./${p(f(b.entryPath,h.metadata.entry.input?.file||h.metadata.entry.file))}`);return e(u,n({get path(){return`worker-${d(h.metadata.entry,{maxLength:8})}-entry.ts`}},y,{get imports(){return s({"@cloudflare/workers-types":[{name:`Request`,type:!0},{name:`Response`,type:!0},{name:`ExecutionContext`,type:!0},{name:`IncomingRequestCfProperties`,type:!0},{name:`ScheduledController`,type:!0},{name:`ForwardableEmailMessage`,type:!0},{name:`MessageBatch`,type:!0},{name:`TailStream`,type:!0},{name:`TraceItem`,type:!0},{name:`TailStream.TailEvent`,type:!0},{name:`TailStream.Onset`,type:!0},{name:`TailStream.TailEventHandlerType`,type:!0}],[x.value]:`worker`},_??{})},get builtinImports(){return s({cloudflare:[`withFetchContext`,`withTailContext`,`withTraceContext`,`withTailStreamContext`,`withScheduledContext`,`withTestContext`,`withEmailContext`,`withQueueContext`]},v??{})},get children(){return[i`export default { `,t(`hbr`,{}),e(r,{get when(){return h.fetch},children:i` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {
2
- return await withFetchContext({ request, env, ctx }, async (context) => {
3
- return worker.fetch(context.request, context.env, context.ctx);
4
- });
5
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.tail},children:i` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
6
- return withTailContext({ events, env, ctx }, async (context) => {
7
- return worker.tail(context.events, context.env, context.ctx);
8
- });
9
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.trace},children:i` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
10
- return withTraceContext({ traces, env, ctx }, async (context) => {
11
- return worker.trace(context.traces, context.env, context.ctx);
12
- });
13
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.tailStream},children:i` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {
14
- return await withTailStreamContext({ event, env, ctx }, async (context) => {
15
- return await worker.tailStream(context.event, context.env, context.ctx);
16
- });
17
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.scheduled},children:i` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
18
- return withScheduledContext({ controller, env, ctx }, async (context) => {
19
- return worker.scheduled(context.controller, context.env, context.ctx);
20
- });
21
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.test},children:i` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
22
- return withTestContext({ controller, env, ctx }, async (context) => {
23
- return worker.test(context.controller, context.env, context.ctx);
24
- });
25
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.email},children:i` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
26
- return withEmailContext({ message, env, ctx }, async (context) => {
27
- return worker.email(context.message, context.env, context.ctx);
28
- });
29
- }, `}),t(`hbr`,{}),e(r,{get when(){return h.queue},children:i` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {
30
- return withQueueContext({ batch, env, ctx }, async (context) => {
31
- return worker.queue(context.batch, context.env, context.ctx);
32
- });
33
- }, `}),t(`hbr`,{}),i` } satisfies ExportedHandler<CloudflareBindings>; `,e(c,{}),e(r,{get when(){return!!g},children:g})]}}))}export{m as WorkerEntry};
34
- //# sourceMappingURL=worker-entry.mjs.map