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,MAAM,CAAC,GAAG,CAAC,CAAC;KAClC;AACL,CAAC;AAJD,8CAIC;AAED,SAAgB,SAAS,CAAI,IAA0B;IACnD,OAAO,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC;AAC/C,CAAC;AAFD,8BAEC;;;;;;;;;;;;ACvCD,sDAAsD;AACtD,kCAAkC;;;AAIlC,IAAI,OAA4C,CAAC;AACjD,SAAgB,iBAAiB;IAC7B,IAAI,OAAO,KAAK,SAAS,EAAE;QACvB,IAAI;YACA,8DAA8D;YAC9D,OAAO,GAAqB,mBAAO,CAAC,oDAAuB,CAAC,CAAC;SAChE;QAAC,WAAM;YACJ,OAAO,GAAG,IAAI,CAAC;SAClB;KACJ;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAVD,8CAUC;;;;;;;;;;;AChBD;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;;;;;ACtBA,sDAAsD;AACtD,kCAAkC;;;AAElC,+DAA6B;AAC7B,6GAA0D;AAAjD,kIAAe;AACxB,yHAAkE;AAAzD,8IAAmB;AAC5B,iGAAkD;AAAzC,sHAAW;AACpB,+HAAsE;AAA7D,oJAAqB;AAC9B,+HAAsE;AAA7D,oJAAqB;AAC9B,4HAAoE;AAA3D,iJAAoB;AAC7B,+FAAiD;AAAxC,sHAAW;AACpB,kGAAmD;AAA1C,yHAAY;AACrB,qEAAiC;AACjC,uGAAwD;AAA/C,wIAAiB;AAC1B,wEAAmC;AACnC,2EAAqC;AACrC,8FAAgD;AAAvC,mHAAU","sources":["webpack://@azure/functions/./src/InvocationContext.ts","webpack://@azure/functions/./src/InvocationModel.ts","webpack://@azure/functions/./src/addBindingName.ts","webpack://@azure/functions/./src/app.ts","webpack://@azure/functions/./src/constants.ts","webpack://@azure/functions/./src/converters/fromRpcBindings.ts","webpack://@azure/functions/./src/converters/fromRpcContext.ts","webpack://@azure/functions/./src/converters/fromRpcNullable.ts","webpack://@azure/functions/./src/converters/fromRpcTriggerMetadata.ts","webpack://@azure/functions/./src/converters/fromRpcTypedData.ts","webpack://@azure/functions/./src/converters/toCamelCase.ts","webpack://@azure/functions/./src/converters/toRpcDuration.ts","webpack://@azure/functions/./src/converters/toRpcHttp.ts","webpack://@azure/functions/./src/converters/toRpcHttpCookie.ts","webpack://@azure/functions/./src/converters/toRpcNullable.ts","webpack://@azure/functions/./src/converters/toRpcTypedData.ts","webpack://@azure/functions/./src/errors.ts","webpack://@azure/functions/./src/hooks/AppStartContext.ts","webpack://@azure/functions/./src/hooks/AppTerminateContext.ts","webpack://@azure/functions/./src/hooks/HookContext.ts","webpack://@azure/functions/./src/hooks/InvocationHookContext.ts","webpack://@azure/functions/./src/hooks/PostInvocationContext.ts","webpack://@azure/functions/./src/hooks/PreInvocationContext.ts","webpack://@azure/functions/./src/hooks/registerHook.ts","webpack://@azure/functions/./src/http/HttpRequest.ts","webpack://@azure/functions/./src/http/HttpResponse.ts","webpack://@azure/functions/./src/http/extractHttpUserFromHeaders.ts","webpack://@azure/functions/./src/input.ts","webpack://@azure/functions/./src/output.ts","webpack://@azure/functions/./src/trigger.ts","webpack://@azure/functions/./src/utils/Disposable.ts","webpack://@azure/functions/./src/utils/isTrigger.ts","webpack://@azure/functions/./src/utils/nonNull.ts","webpack://@azure/functions/./src/utils/tryGetCoreApiLazy.ts","webpack://@azure/functions/external commonjs2 \"@azure/functions-core\"","webpack://@azure/functions/external commonjs2 \"undici\"","webpack://@azure/functions/external commonjs2 \"url\"","webpack://@azure/functions/external commonjs2 \"util\"","webpack://@azure/functions/webpack/bootstrap","webpack://@azure/functions/./src/index.ts"],"sourcesContent":["// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport {\r\n EffectiveFunctionOptions,\r\n InvocationContextInit,\r\n LogHandler,\r\n RetryContext,\r\n TraceContext,\r\n TriggerMetadata,\r\n} from '@azure/functions';\r\n\r\nexport class InvocationContext implements types.InvocationContext {\r\n invocationId: string;\r\n functionName: string;\r\n extraInputs: InvocationContextExtraInputs;\r\n extraOutputs: InvocationContextExtraOutputs;\r\n retryContext?: RetryContext;\r\n traceContext?: TraceContext;\r\n triggerMetadata?: TriggerMetadata;\r\n options: EffectiveFunctionOptions;\r\n #userLogHandler: LogHandler;\r\n\r\n constructor(init?: InvocationContextInit) {\r\n init = init || {};\r\n const fallbackString = 'unknown';\r\n this.invocationId = init.invocationId || fallbackString;\r\n this.functionName = init.functionName || fallbackString;\r\n this.extraInputs = new InvocationContextExtraInputs();\r\n this.extraOutputs = new InvocationContextExtraOutputs();\r\n this.retryContext = init.retryContext;\r\n this.traceContext = init.traceContext;\r\n this.triggerMetadata = init.triggerMetadata;\r\n this.options = {\r\n trigger: init.options?.trigger || {\r\n name: fallbackString,\r\n type: fallbackString,\r\n },\r\n return: init.options?.return,\r\n extraInputs: init.options?.extraInputs || [],\r\n extraOutputs: init.options?.extraOutputs || [],\r\n };\r\n this.#userLogHandler = init.logHandler || fallbackLogHandler;\r\n }\r\n\r\n log(...args: unknown[]): void {\r\n this.#userLogHandler('information', ...args);\r\n }\r\n\r\n trace(...args: unknown[]): void {\r\n this.#userLogHandler('trace', ...args);\r\n }\r\n\r\n debug(...args: unknown[]): void {\r\n this.#userLogHandler('debug', ...args);\r\n }\r\n\r\n info(...args: unknown[]): void {\r\n this.#userLogHandler('information', ...args);\r\n }\r\n\r\n warn(...args: unknown[]): void {\r\n this.#userLogHandler('warning', ...args);\r\n }\r\n\r\n error(...args: unknown[]): void {\r\n this.#userLogHandler('error', ...args);\r\n }\r\n}\r\n\r\nclass InvocationContextExtraInputs implements types.InvocationContextExtraInputs {\r\n #inputs: Record<string, unknown> = {};\r\n get(inputOrName: types.FunctionInput | string): any {\r\n const name = typeof inputOrName === 'string' ? inputOrName : inputOrName.name;\r\n return this.#inputs[name];\r\n }\r\n set(inputOrName: types.FunctionInput | string, value: unknown): void {\r\n const name = typeof inputOrName === 'string' ? inputOrName : inputOrName.name;\r\n this.#inputs[name] = value;\r\n }\r\n}\r\n\r\nclass InvocationContextExtraOutputs implements types.InvocationContextExtraOutputs {\r\n #outputs: Record<string, unknown> = {};\r\n get(outputOrName: types.FunctionOutput | string): unknown {\r\n const name = typeof outputOrName === 'string' ? outputOrName : outputOrName.name;\r\n return this.#outputs[name];\r\n }\r\n set(outputOrName: types.FunctionOutput | string, value: unknown): void {\r\n const name = typeof outputOrName === 'string' ? outputOrName : outputOrName.name;\r\n this.#outputs[name] = value;\r\n }\r\n}\r\n\r\nfunction fallbackLogHandler(level: types.LogLevel, ...args: unknown[]): void {\r\n switch (level) {\r\n case 'trace':\r\n console.trace(...args);\r\n break;\r\n case 'debug':\r\n console.debug(...args);\r\n break;\r\n case 'information':\r\n console.info(...args);\r\n break;\r\n case 'warning':\r\n console.warn(...args);\r\n break;\r\n case 'critical':\r\n case 'error':\r\n console.error(...args);\r\n break;\r\n default:\r\n console.log(...args);\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as coreTypes from '@azure/functions-core';\r\nimport {\r\n CoreInvocationContext,\r\n InvocationArguments,\r\n RpcBindingInfo,\r\n RpcInvocationResponse,\r\n RpcLogCategory,\r\n RpcLogLevel,\r\n RpcTypedData,\r\n} from '@azure/functions-core';\r\nimport { format } from 'util';\r\nimport { returnBindingKey } from './constants';\r\nimport { fromRpcBindings } from './converters/fromRpcBindings';\r\nimport { fromRpcRetryContext, fromRpcTraceContext } from './converters/fromRpcContext';\r\nimport { fromRpcTriggerMetadata } from './converters/fromRpcTriggerMetadata';\r\nimport { fromRpcTypedData } from './converters/fromRpcTypedData';\r\nimport { toCamelCaseValue } from './converters/toCamelCase';\r\nimport { toRpcHttp } from './converters/toRpcHttp';\r\nimport { toRpcTypedData } from './converters/toRpcTypedData';\r\nimport { InvocationContext } from './InvocationContext';\r\nimport { isHttpTrigger, isTimerTrigger, isTrigger } from './utils/isTrigger';\r\nimport { isDefined, nonNullProp, nonNullValue } from './utils/nonNull';\r\n\r\nexport class InvocationModel implements coreTypes.InvocationModel {\r\n #isDone = false;\r\n #coreCtx: CoreInvocationContext;\r\n #functionName: string;\r\n #bindings: Record<string, RpcBindingInfo>;\r\n #triggerType: string;\r\n\r\n constructor(coreCtx: CoreInvocationContext) {\r\n this.#coreCtx = coreCtx;\r\n this.#functionName = nonNullProp(coreCtx.metadata, 'name');\r\n this.#bindings = nonNullProp(coreCtx.metadata, 'bindings');\r\n const triggerBinding = nonNullValue(\r\n Object.values(this.#bindings).find((b) => isTrigger(b.type)),\r\n 'triggerBinding'\r\n );\r\n this.#triggerType = nonNullProp(triggerBinding, 'type');\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/require-await\r\n async getArguments(): Promise<InvocationArguments> {\r\n const req = this.#coreCtx.request;\r\n\r\n const context = new InvocationContext({\r\n invocationId: nonNullProp(this.#coreCtx, 'invocationId'),\r\n functionName: this.#functionName,\r\n logHandler: (level: RpcLogLevel, ...args: unknown[]) => this.#userLog(level, ...args),\r\n retryContext: fromRpcRetryContext(req.retryContext),\r\n traceContext: fromRpcTraceContext(req.traceContext),\r\n triggerMetadata: fromRpcTriggerMetadata(req.triggerMetadata, this.#triggerType),\r\n options: fromRpcBindings(this.#bindings),\r\n });\r\n\r\n const inputs: unknown[] = [];\r\n if (req.inputData) {\r\n for (const binding of req.inputData) {\r\n const bindingName = nonNullProp(binding, 'name');\r\n let input: unknown = fromRpcTypedData(binding.data);\r\n\r\n const bindingType = this.#bindings[bindingName].type;\r\n if (isTimerTrigger(bindingType)) {\r\n input = toCamelCaseValue(input);\r\n }\r\n\r\n if (isTrigger(bindingType)) {\r\n inputs.push(input);\r\n } else {\r\n context.extraInputs.set(bindingName, input);\r\n }\r\n }\r\n }\r\n\r\n return { context, inputs };\r\n }\r\n\r\n async invokeFunction(\r\n context: InvocationContext,\r\n inputs: unknown[],\r\n handler: coreTypes.FunctionCallback\r\n ): Promise<unknown> {\r\n try {\r\n return await Promise.resolve(handler(...inputs, context));\r\n } finally {\r\n this.#isDone = true;\r\n }\r\n }\r\n\r\n async getResponse(context: InvocationContext, result: unknown): Promise<RpcInvocationResponse> {\r\n const response: RpcInvocationResponse = { invocationId: this.#coreCtx.invocationId };\r\n\r\n response.outputData = [];\r\n let usedReturnValue = false;\r\n for (const [name, binding] of Object.entries(this.#bindings)) {\r\n if (binding.direction === 'out') {\r\n if (name === returnBindingKey) {\r\n response.returnValue = await this.#convertOutput(binding, result);\r\n usedReturnValue = true;\r\n } else {\r\n const outputValue = await this.#convertOutput(binding, context.extraOutputs.get(name));\r\n if (isDefined(outputValue)) {\r\n response.outputData.push({ name, data: outputValue });\r\n }\r\n }\r\n }\r\n }\r\n\r\n // This allows the return value of non-HTTP triggered functions to be passed back\r\n // to the host, even if no explicit output binding is set. In most cases, this is ignored,\r\n // but e.g., Durable uses this to pass orchestrator state back to the Durable extension, w/o\r\n // an explicit output binding. See here for more details: https://github.com/Azure/azure-functions-nodejs-library/pull/25\r\n if (!usedReturnValue && !isHttpTrigger(this.#triggerType)) {\r\n response.returnValue = toRpcTypedData(result);\r\n }\r\n\r\n return response;\r\n }\r\n\r\n async #convertOutput(binding: RpcBindingInfo, value: unknown): Promise<RpcTypedData | null | undefined> {\r\n if (binding.type?.toLowerCase() === 'http') {\r\n return toRpcHttp(value);\r\n } else {\r\n return toRpcTypedData(value);\r\n }\r\n }\r\n\r\n #log(level: RpcLogLevel, logCategory: RpcLogCategory, ...args: unknown[]): void {\r\n this.#coreCtx.log(level, logCategory, format(...args));\r\n }\r\n\r\n #systemLog(level: RpcLogLevel, ...args: unknown[]) {\r\n this.#log(level, 'system', ...args);\r\n }\r\n\r\n #userLog(level: RpcLogLevel, ...args: unknown[]): void {\r\n if (this.#isDone && this.#coreCtx.state !== 'postInvocationHooks') {\r\n let badAsyncMsg =\r\n \"Warning: Unexpected call to 'log' on the context object after function execution has completed. Please check for asynchronous calls that are not awaited. \";\r\n badAsyncMsg += `Function name: ${this.#functionName}. Invocation Id: ${this.#coreCtx.invocationId}.`;\r\n this.#systemLog('warning', badAsyncMsg);\r\n }\r\n this.#log(level, 'user', ...args);\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport { HttpRequest } from './http/HttpRequest';\r\nexport { HttpResponse } from './http/HttpResponse';\r\nexport { InvocationContext } from './InvocationContext';\r\n\r\nconst bindingCounts: Record<string, number> = {};\r\n/**\r\n * If the host spawns multiple workers, it expects the metadata (including binding name) to be the same across workers.\r\n * That means we need to generate binding names in a deterministic fashion, so we'll do that using a count\r\n * There's a tiny risk users register bindings in a non-deterministic order (i.e. async race conditions), but it's okay considering the following:\r\n * 1. We will track the count individually for each binding type. This makes the names more readable and reduces the chances a race condition will matter\r\n * 2. Users can manually specify the name themselves (aka if they're doing weird async stuff) and we will respect that\r\n * More info here: https://github.com/Azure/azure-functions-nodejs-worker/issues/638\r\n */\r\nexport function addBindingName<T extends { type: string; name?: string }>(\r\n binding: T,\r\n suffix: string\r\n): T & { name: string } {\r\n if (!binding.name) {\r\n let bindingType = binding.type;\r\n if (!bindingType.toLowerCase().endsWith(suffix.toLowerCase())) {\r\n bindingType += suffix;\r\n }\r\n let count = bindingCounts[bindingType] || 0;\r\n count += 1;\r\n bindingCounts[bindingType] = count;\r\n binding.name = bindingType + count.toString();\r\n }\r\n return <T & { name: string }>binding;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport {\r\n CosmosDBFunctionOptions,\r\n EventGridFunctionOptions,\r\n EventHubFunctionOptions,\r\n ExponentialBackoffRetryOptions,\r\n FixedDelayRetryOptions,\r\n FunctionOptions,\r\n FunctionTrigger,\r\n GenericFunctionOptions,\r\n HttpFunctionOptions,\r\n HttpHandler,\r\n HttpMethod,\r\n HttpMethodFunctionOptions,\r\n ServiceBusQueueFunctionOptions,\r\n ServiceBusTopicFunctionOptions,\r\n StorageBlobFunctionOptions,\r\n StorageQueueFunctionOptions,\r\n TimerFunctionOptions,\r\n WarmupFunctionOptions,\r\n} from '@azure/functions';\r\nimport * as coreTypes from '@azure/functions-core';\r\nimport { CoreInvocationContext, FunctionCallback } from '@azure/functions-core';\r\nimport { returnBindingKey, version } from './constants';\r\nimport { toRpcDuration } from './converters/toRpcDuration';\r\nimport { InvocationModel } from './InvocationModel';\r\nimport * as output from './output';\r\nimport * as trigger from './trigger';\r\nimport { isTrigger } from './utils/isTrigger';\r\nimport { tryGetCoreApiLazy } from './utils/tryGetCoreApiLazy';\r\n\r\nexport * as hook from './hooks/registerHook';\r\n\r\nclass ProgrammingModel implements coreTypes.ProgrammingModel {\r\n name = '@azure/functions';\r\n version = version;\r\n getInvocationModel(coreCtx: CoreInvocationContext): InvocationModel {\r\n return new InvocationModel(coreCtx);\r\n }\r\n}\r\n\r\nlet hasSetup = false;\r\nfunction setup() {\r\n const coreApi = tryGetCoreApiLazy();\r\n if (!coreApi) {\r\n console.warn(\r\n 'WARNING: Failed to detect the Azure Functions runtime. Switching \"@azure/functions\" package to test mode - not all features are supported.'\r\n );\r\n } else {\r\n coreApi.setProgrammingModel(new ProgrammingModel());\r\n }\r\n hasSetup = true;\r\n}\r\n\r\nfunction convertToHttpOptions(\r\n optionsOrHandler: HttpFunctionOptions | HttpHandler,\r\n method: HttpMethod\r\n): HttpFunctionOptions {\r\n const options: HttpFunctionOptions =\r\n typeof optionsOrHandler === 'function' ? { handler: optionsOrHandler } : optionsOrHandler;\r\n options.methods = [method];\r\n return options;\r\n}\r\n\r\nfunction convertToGenericOptions<T extends Omit<FunctionOptions, 'trigger'> & Partial<FunctionOptions>>(\r\n options: T,\r\n triggerMethod: (o: Omit<T, 'handler' | 'return' | 'trigger' | 'extraInputs' | 'extraOutputs'>) => FunctionTrigger\r\n): FunctionOptions {\r\n const { handler, return: ret, trigger, extraInputs, extraOutputs, ...triggerOptions } = options;\r\n return {\r\n trigger: trigger ?? triggerMethod(triggerOptions),\r\n return: ret,\r\n extraInputs,\r\n extraOutputs,\r\n handler,\r\n };\r\n}\r\n\r\nexport function get(name: string, optionsOrHandler: HttpMethodFunctionOptions | HttpHandler): void {\r\n http(name, convertToHttpOptions(optionsOrHandler, 'GET'));\r\n}\r\n\r\nexport function put(name: string, optionsOrHandler: HttpMethodFunctionOptions | HttpHandler): void {\r\n http(name, convertToHttpOptions(optionsOrHandler, 'PUT'));\r\n}\r\n\r\nexport function post(name: string, optionsOrHandler: HttpMethodFunctionOptions | HttpHandler): void {\r\n http(name, convertToHttpOptions(optionsOrHandler, 'POST'));\r\n}\r\n\r\nexport function patch(name: string, optionsOrHandler: HttpMethodFunctionOptions | HttpHandler): void {\r\n http(name, convertToHttpOptions(optionsOrHandler, 'PATCH'));\r\n}\r\n\r\nexport function deleteRequest(name: string, optionsOrHandler: HttpMethodFunctionOptions | HttpHandler): void {\r\n http(name, convertToHttpOptions(optionsOrHandler, 'DELETE'));\r\n}\r\n\r\nexport function http(name: string, options: HttpFunctionOptions): void {\r\n options.return ||= output.http({});\r\n generic(name, convertToGenericOptions(options, trigger.http));\r\n}\r\n\r\nexport function timer(name: string, options: TimerFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.timer));\r\n}\r\n\r\nexport function storageBlob(name: string, options: StorageBlobFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.storageBlob));\r\n}\r\n\r\nexport function storageQueue(name: string, options: StorageQueueFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.storageQueue));\r\n}\r\n\r\nexport function serviceBusQueue(name: string, options: ServiceBusQueueFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.serviceBusQueue));\r\n}\r\n\r\nexport function serviceBusTopic(name: string, options: ServiceBusTopicFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.serviceBusTopic));\r\n}\r\n\r\nexport function eventHub(name: string, options: EventHubFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.eventHub));\r\n}\r\n\r\nexport function eventGrid(name: string, options: EventGridFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.eventGrid));\r\n}\r\n\r\nexport function cosmosDB(name: string, options: CosmosDBFunctionOptions): void {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\r\n generic(name, convertToGenericOptions(options, <any>trigger.cosmosDB));\r\n}\r\n\r\nexport function warmup(name: string, options: WarmupFunctionOptions): void {\r\n generic(name, convertToGenericOptions(options, trigger.warmup));\r\n}\r\n\r\nexport function generic(name: string, options: GenericFunctionOptions): void {\r\n if (!hasSetup) {\r\n setup();\r\n }\r\n\r\n const bindings: Record<string, coreTypes.RpcBindingInfo> = {};\r\n\r\n const trigger = options.trigger;\r\n bindings[trigger.name] = {\r\n ...trigger,\r\n direction: 'in',\r\n type: isTrigger(trigger.type) ? trigger.type : trigger.type + 'Trigger',\r\n };\r\n\r\n if (options.extraInputs) {\r\n for (const input of options.extraInputs) {\r\n bindings[input.name] = {\r\n ...input,\r\n direction: 'in',\r\n };\r\n }\r\n }\r\n\r\n if (options.return) {\r\n bindings[returnBindingKey] = {\r\n ...options.return,\r\n direction: 'out',\r\n };\r\n }\r\n\r\n if (options.extraOutputs) {\r\n for (const output of options.extraOutputs) {\r\n bindings[output.name] = {\r\n ...output,\r\n direction: 'out',\r\n };\r\n }\r\n }\r\n\r\n let retryOptions: coreTypes.RpcRetryOptions | undefined;\r\n if (options.retry) {\r\n retryOptions = {\r\n ...options.retry,\r\n retryStrategy: options.retry.strategy,\r\n delayInterval: toRpcDuration((<FixedDelayRetryOptions>options.retry).delayInterval, 'retry.delayInterval'),\r\n maximumInterval: toRpcDuration(\r\n (<ExponentialBackoffRetryOptions>options.retry).maximumInterval,\r\n 'retry.maximumInterval'\r\n ),\r\n minimumInterval: toRpcDuration(\r\n (<ExponentialBackoffRetryOptions>options.retry).minimumInterval,\r\n 'retry.minimumInterval'\r\n ),\r\n };\r\n }\r\n\r\n const coreApi = tryGetCoreApiLazy();\r\n if (!coreApi) {\r\n console.warn(\r\n `WARNING: Skipping call to register function \"${name}\" because the \"@azure/functions\" package is in test mode.`\r\n );\r\n } else {\r\n coreApi.registerFunction({ name, bindings, retryOptions }, <FunctionCallback>options.handler);\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport const version = '4.1.0';\r\n\r\nexport const returnBindingKey = '$return';\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { EffectiveFunctionOptions, FunctionInput, FunctionOutput, FunctionTrigger } from '@azure/functions';\r\nimport { RpcBindingInfo } from '@azure/functions-core';\r\nimport { returnBindingKey } from '../constants';\r\nimport { isTrigger } from '../utils/isTrigger';\r\nimport { nonNullProp, nonNullValue } from '../utils/nonNull';\r\n\r\nexport function fromRpcBindings(bindings: Record<string, RpcBindingInfo> | null | undefined): EffectiveFunctionOptions {\r\n let trigger: FunctionTrigger | undefined;\r\n let returnBinding: FunctionOutput | undefined;\r\n const extraInputs: FunctionInput[] = [];\r\n const extraOutputs: FunctionOutput[] = [];\r\n for (const [name, binding] of Object.entries(nonNullValue(bindings, 'bindings'))) {\r\n if (isTrigger(binding.type)) {\r\n trigger = fromRpcBinding(name, binding);\r\n } else if (name === returnBindingKey) {\r\n returnBinding = fromRpcBinding(name, binding);\r\n } else if (binding.direction === 'in') {\r\n extraInputs.push(fromRpcBinding(name, binding));\r\n } else if (binding.direction === 'out') {\r\n extraOutputs.push(fromRpcBinding(name, binding));\r\n }\r\n }\r\n return {\r\n trigger: nonNullValue(trigger, 'trigger'),\r\n return: returnBinding,\r\n extraInputs,\r\n extraOutputs,\r\n };\r\n}\r\n\r\nfunction fromRpcBinding(name: string, binding: RpcBindingInfo): FunctionTrigger | FunctionInput | FunctionOutput {\r\n return {\r\n ...binding,\r\n type: nonNullProp(binding, 'type'),\r\n name,\r\n };\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { Exception, RetryContext, TraceContext } from '@azure/functions';\r\nimport { RpcException, RpcRetryContext, RpcTraceContext } from '@azure/functions-core';\r\nimport { copyPropIfDefined, nonNullProp } from '../utils/nonNull';\r\n\r\nexport function fromRpcRetryContext(retryContext: RpcRetryContext | null | undefined): RetryContext | undefined {\r\n if (!retryContext) {\r\n return undefined;\r\n } else {\r\n const result: RetryContext = {\r\n retryCount: nonNullProp(retryContext, 'retryCount'),\r\n maxRetryCount: nonNullProp(retryContext, 'maxRetryCount'),\r\n };\r\n if (retryContext.exception) {\r\n result.exception = fromRpcException(retryContext.exception);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nfunction fromRpcException(exception: RpcException): Exception {\r\n const result: Exception = {};\r\n copyPropIfDefined(exception, result, 'message');\r\n copyPropIfDefined(exception, result, 'source');\r\n copyPropIfDefined(exception, result, 'stackTrace');\r\n return result;\r\n}\r\n\r\nexport function fromRpcTraceContext(traceContext: RpcTraceContext | null | undefined): TraceContext | undefined {\r\n if (!traceContext) {\r\n return undefined;\r\n } else {\r\n const result: TraceContext = {};\r\n copyPropIfDefined(traceContext, result, 'traceParent');\r\n copyPropIfDefined(traceContext, result, 'traceState');\r\n if (traceContext.attributes) {\r\n result.attributes = traceContext.attributes;\r\n }\r\n return result;\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { RpcNullableString } from '@azure/functions-core';\r\n\r\nexport function fromNullableMapping(\r\n nullableMapping: Record<string, RpcNullableString> | null | undefined,\r\n originalMapping?: Record<string, string> | null\r\n): Record<string, string> {\r\n let converted = {};\r\n if (nullableMapping && Object.keys(nullableMapping).length > 0) {\r\n for (const key in nullableMapping) {\r\n converted[key] = nullableMapping[key].value || '';\r\n }\r\n } else if (originalMapping && Object.keys(originalMapping).length > 0) {\r\n converted = originalMapping;\r\n }\r\n return converted;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { TriggerMetadata } from '@azure/functions';\r\nimport { RpcTypedData } from '@azure/functions-core';\r\nimport { isHttpTrigger, isTimerTrigger } from '../utils/isTrigger';\r\nimport { fromRpcTypedData } from './fromRpcTypedData';\r\nimport { toCamelCaseKey, toCamelCaseValue } from './toCamelCase';\r\n\r\nexport function fromRpcTriggerMetadata(\r\n triggerMetadata: Record<string, RpcTypedData> | null | undefined,\r\n triggerType: string\r\n): TriggerMetadata | undefined {\r\n // For http and timer triggers, we will avoid using `triggerMetadata` for a few reasons:\r\n // 1. It uses `toCamelCase` methods, which can lead to weird casing bugs\r\n // 2. It's generally a large medley of properties that is difficult for us to document/type\r\n // 3. We can represent that information on the request & timer objects instead\r\n if (!triggerMetadata || isHttpTrigger(triggerType) || isTimerTrigger(triggerType)) {\r\n return undefined;\r\n } else {\r\n const result: TriggerMetadata = {};\r\n for (const [key, value] of Object.entries(triggerMetadata)) {\r\n result[toCamelCaseKey(key)] = toCamelCaseValue(fromRpcTypedData(value));\r\n }\r\n return result;\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { RpcTypedData } from '@azure/functions-core';\r\nimport { HttpRequest } from '../http/HttpRequest';\r\nimport { isDefined } from '../utils/nonNull';\r\n\r\nexport function fromRpcTypedData(data: RpcTypedData | null | undefined): unknown {\r\n if (!data) {\r\n return undefined;\r\n } else if (isDefined(data.string)) {\r\n return tryJsonParse(data.string);\r\n } else if (isDefined(data.json)) {\r\n return JSON.parse(data.json);\r\n } else if (isDefined(data.bytes)) {\r\n return Buffer.from(data.bytes);\r\n } else if (isDefined(data.stream)) {\r\n return Buffer.from(data.stream);\r\n } else if (isDefined(data.http)) {\r\n return new HttpRequest(data.http);\r\n } else if (isDefined(data.int)) {\r\n return data.int;\r\n } else if (isDefined(data.double)) {\r\n return data.double;\r\n } else if (data.collectionBytes && isDefined(data.collectionBytes.bytes)) {\r\n return data.collectionBytes.bytes.map((d) => Buffer.from(d));\r\n } else if (data.collectionString && isDefined(data.collectionString.string)) {\r\n return data.collectionString.string.map(tryJsonParse);\r\n } else if (data.collectionDouble && isDefined(data.collectionDouble.double)) {\r\n return data.collectionDouble.double;\r\n } else if (data.collectionSint64 && isDefined(data.collectionSint64.sint64)) {\r\n return data.collectionSint64.sint64;\r\n } else {\r\n return undefined;\r\n }\r\n}\r\n\r\nfunction tryJsonParse(data: string): unknown {\r\n try {\r\n return JSON.parse(data);\r\n } catch {\r\n return data;\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport function toCamelCaseValue(data: unknown): unknown {\r\n if (typeof data !== 'object' || data === null) {\r\n return data;\r\n } else if (Array.isArray(data)) {\r\n return data.map(toCamelCaseValue);\r\n } else {\r\n const result = {};\r\n for (const [key, value] of Object.entries(data)) {\r\n result[toCamelCaseKey(key)] = toCamelCaseValue(value);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function toCamelCaseKey(key: string): string {\r\n return key.charAt(0).toLowerCase() + key.slice(1);\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { RpcDuration } from '@azure/functions-core';\r\nimport { Duration } from '../../types';\r\nimport { AzFuncSystemError } from '../errors';\r\nimport { isDefined } from '../utils/nonNull';\r\n\r\nexport function toRpcDuration(dateTime: Duration | number | undefined, propertyName: string): RpcDuration | undefined {\r\n if (isDefined(dateTime)) {\r\n try {\r\n let timeInMilliseconds: number | undefined;\r\n if (typeof dateTime === 'object') {\r\n const minutes = (dateTime.minutes || 0) + (dateTime.hours || 0) * 60;\r\n const seconds = (dateTime.seconds || 0) + minutes * 60;\r\n timeInMilliseconds = (dateTime.milliseconds || 0) + seconds * 1000;\r\n } else if (typeof dateTime === 'number') {\r\n timeInMilliseconds = dateTime;\r\n }\r\n\r\n if (isDefined(timeInMilliseconds) && timeInMilliseconds >= 0) {\r\n return {\r\n seconds: Math.round(timeInMilliseconds / 1000),\r\n };\r\n }\r\n } catch {\r\n // fall through\r\n }\r\n\r\n throw new AzFuncSystemError(\r\n `A 'number' or 'Duration' object was expected instead of a '${typeof dateTime}'. Cannot parse value of '${propertyName}'.`\r\n );\r\n }\r\n\r\n return undefined;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { RpcHttpData, RpcTypedData } from '@azure/functions-core';\r\nimport { AzFuncSystemError } from '../errors';\r\nimport { HttpResponse } from '../http/HttpResponse';\r\nimport { toRpcHttpCookie } from './toRpcHttpCookie';\r\nimport { toRpcTypedData } from './toRpcTypedData';\r\n\r\nexport async function toRpcHttp(data: unknown): Promise<RpcTypedData | null | undefined> {\r\n if (data === null || data === undefined) {\r\n return data;\r\n } else if (typeof data !== 'object') {\r\n throw new AzFuncSystemError(\r\n 'The HTTP response must be an object with optional properties \"body\", \"status\", \"headers\", and \"cookies\".'\r\n );\r\n }\r\n\r\n const response = data instanceof HttpResponse ? data : new HttpResponse(data);\r\n const rpcResponse: RpcHttpData = {};\r\n rpcResponse.statusCode = response.status.toString();\r\n\r\n rpcResponse.headers = {};\r\n for (const [key, value] of response.headers.entries()) {\r\n rpcResponse.headers[key] = value;\r\n }\r\n\r\n rpcResponse.cookies = [];\r\n for (const cookie of response.cookies) {\r\n rpcResponse.cookies.push(toRpcHttpCookie(cookie));\r\n }\r\n\r\n rpcResponse.enableContentNegotiation = response.enableContentNegotiation;\r\n\r\n const bodyBytes = await response.arrayBuffer();\r\n rpcResponse.body = toRpcTypedData(bodyBytes);\r\n\r\n return { http: rpcResponse };\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { Cookie } from '@azure/functions';\r\nimport { RpcHttpCookie, RpcHttpCookieSameSite } from '@azure/functions-core';\r\nimport { toNullableBool, toNullableDouble, toNullableString, toNullableTimestamp, toRpcString } from './toRpcNullable';\r\n\r\n/**\r\n * From RFC specifications for 'Set-Cookie' response header: https://www.rfc-editor.org/rfc/rfc6265.txt\r\n * @param inputCookie\r\n */\r\nexport function toRpcHttpCookie(inputCookie: Cookie): RpcHttpCookie {\r\n // Resolve RpcHttpCookie.SameSite enum, a one-off\r\n let rpcSameSite: RpcHttpCookieSameSite = 'none';\r\n if (inputCookie && inputCookie.sameSite) {\r\n const sameSite = inputCookie.sameSite.toLocaleLowerCase();\r\n if (sameSite === 'lax') {\r\n rpcSameSite = 'lax';\r\n } else if (sameSite === 'strict') {\r\n rpcSameSite = 'strict';\r\n } else if (sameSite === 'none') {\r\n rpcSameSite = 'explicitNone';\r\n }\r\n }\r\n\r\n const rpcCookie: RpcHttpCookie = {\r\n name: inputCookie && toRpcString(inputCookie.name, 'cookie.name'),\r\n value: inputCookie && toRpcString(inputCookie.value, 'cookie.value'),\r\n domain: toNullableString(inputCookie && inputCookie.domain, 'cookie.domain'),\r\n path: toNullableString(inputCookie && inputCookie.path, 'cookie.path'),\r\n expires: toNullableTimestamp(inputCookie && inputCookie.expires, 'cookie.expires'),\r\n secure: toNullableBool(inputCookie && inputCookie.secure, 'cookie.secure'),\r\n httpOnly: toNullableBool(inputCookie && inputCookie.httpOnly, 'cookie.httpOnly'),\r\n sameSite: rpcSameSite,\r\n maxAge: toNullableDouble(inputCookie && inputCookie.maxAge, 'cookie.maxAge'),\r\n };\r\n\r\n return rpcCookie;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { RpcNullableBool, RpcNullableDouble, RpcNullableString, RpcNullableTimestamp } from '@azure/functions-core';\r\nimport { AzFuncSystemError } from '../errors';\r\nimport { isDefined } from '../utils/nonNull';\r\n\r\n/**\r\n * Converts boolean input to an 'INullableBool' to be sent through the RPC layer.\r\n * Input that is not a boolean but is also not null or undefined logs a function app level warning.\r\n * @param nullable Input to be converted to an INullableBool if it is a valid boolean\r\n * @param propertyName The name of the property that the caller will assign the output to. Used for debugging.\r\n */\r\nexport function toNullableBool(nullable: boolean | undefined, propertyName: string): undefined | RpcNullableBool {\r\n if (typeof nullable === 'boolean') {\r\n return <RpcNullableBool>{\r\n value: nullable,\r\n };\r\n }\r\n\r\n if (isDefined(nullable)) {\r\n throw new AzFuncSystemError(\r\n `A 'boolean' type was expected instead of a '${typeof nullable}' type. Cannot parse value of '${propertyName}'.`\r\n );\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Converts number or string that parses to a number to an 'INullableDouble' to be sent through the RPC layer.\r\n * Input that is not a valid number but is also not null or undefined logs a function app level warning.\r\n * @param nullable Input to be converted to an INullableDouble if it is a valid number\r\n * @param propertyName The name of the property that the caller will assign the output to. Used for debugging.\r\n */\r\nexport function toNullableDouble(\r\n nullable: number | string | undefined,\r\n propertyName: string\r\n): undefined | RpcNullableDouble {\r\n if (typeof nullable === 'number') {\r\n return <RpcNullableDouble>{\r\n value: nullable,\r\n };\r\n } else if (typeof nullable === 'string') {\r\n if (!isNaN(Number(nullable))) {\r\n const parsedNumber = parseFloat(nullable);\r\n return <RpcNullableDouble>{\r\n value: parsedNumber,\r\n };\r\n }\r\n }\r\n\r\n if (isDefined(nullable)) {\r\n throw new AzFuncSystemError(\r\n `A 'number' type was expected instead of a '${typeof nullable}' type. Cannot parse value of '${propertyName}'.`\r\n );\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Converts string input to an 'INullableString' to be sent through the RPC layer.\r\n * Input that is not a string but is also not null or undefined logs a function app level warning.\r\n * @param nullable Input to be converted to an INullableString if it is a valid string\r\n * @param propertyName The name of the property that the caller will assign the output to. Used for debugging.\r\n */\r\nexport function toRpcString(nullable: string | undefined, propertyName: string): string {\r\n if (typeof nullable === 'string') {\r\n return nullable;\r\n }\r\n\r\n if (isDefined(nullable)) {\r\n throw new AzFuncSystemError(\r\n `A 'string' type was expected instead of a '${typeof nullable}' type. Cannot parse value of '${propertyName}'.`\r\n );\r\n }\r\n\r\n return '';\r\n}\r\n\r\n/**\r\n * Converts string input to an 'INullableString' to be sent through the RPC layer.\r\n * Input that is not a string but is also not null or undefined logs a function app level warning.\r\n * @param nullable Input to be converted to an INullableString if it is a valid string\r\n * @param propertyName The name of the property that the caller will assign the output to. Used for debugging.\r\n */\r\nexport function toNullableString(nullable: string | undefined, propertyName: string): undefined | RpcNullableString {\r\n if (typeof nullable === 'string') {\r\n return <RpcNullableString>{\r\n value: nullable,\r\n };\r\n }\r\n\r\n if (isDefined(nullable)) {\r\n throw new AzFuncSystemError(\r\n `A 'string' type was expected instead of a '${typeof nullable}' type. Cannot parse value of '${propertyName}'.`\r\n );\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Converts Date or number input to an 'INullableTimestamp' to be sent through the RPC layer.\r\n * Input that is not a Date or number but is also not null or undefined logs a function app level warning.\r\n * @param nullable Input to be converted to an INullableTimestamp if it is valid input\r\n * @param propertyName The name of the property that the caller will assign the output to. Used for debugging.\r\n */\r\nexport function toNullableTimestamp(\r\n dateTime: Date | number | undefined,\r\n propertyName: string\r\n): RpcNullableTimestamp | undefined {\r\n if (isDefined(dateTime)) {\r\n try {\r\n const timeInMilliseconds = typeof dateTime === 'number' ? dateTime : dateTime.getTime();\r\n\r\n if (timeInMilliseconds && timeInMilliseconds >= 0) {\r\n return {\r\n value: {\r\n seconds: Math.round(timeInMilliseconds / 1000),\r\n },\r\n };\r\n }\r\n } catch {\r\n throw new AzFuncSystemError(\r\n `A 'number' or 'Date' input was expected instead of a '${typeof dateTime}'. Cannot parse value of '${propertyName}'.`\r\n );\r\n }\r\n }\r\n return undefined;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { RpcTypedData } from '@azure/functions-core';\r\n\r\nexport function toRpcTypedData(data: unknown): RpcTypedData | null | undefined {\r\n if (data === null || data === undefined) {\r\n return data;\r\n } else if (typeof data === 'string') {\r\n return { string: data };\r\n } else if (Buffer.isBuffer(data)) {\r\n return { bytes: data };\r\n } else if (ArrayBuffer.isView(data)) {\r\n const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\r\n return { bytes: bytes };\r\n } else if (data instanceof ArrayBuffer) {\r\n const bytes = new Uint8Array(data);\r\n return { bytes: bytes };\r\n } else if (typeof data === 'number') {\r\n if (Number.isInteger(data)) {\r\n return { int: data };\r\n } else {\r\n return { double: data };\r\n }\r\n } else {\r\n return { json: JSON.stringify(data) };\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport interface AzFuncError {\r\n /**\r\n * System errors can be tracked in our telemetry\r\n * User errors cannot be tracked in our telemetry because they could have user information (users can still track it themselves in their app insights resource)\r\n */\r\n isAzureFunctionsSystemError: boolean;\r\n}\r\n\r\nexport class AzFuncSystemError extends Error {\r\n isAzureFunctionsSystemError = true;\r\n}\r\n\r\nexport class AzFuncTypeError extends TypeError implements AzFuncError {\r\n isAzureFunctionsSystemError = true;\r\n}\r\n\r\nexport class AzFuncRangeError extends RangeError implements AzFuncError {\r\n isAzureFunctionsSystemError = true;\r\n}\r\n\r\nexport class ReadOnlyError extends AzFuncTypeError {\r\n constructor(propertyName: string) {\r\n super(`Cannot assign to read only property '${propertyName}'`);\r\n }\r\n}\r\n\r\nexport function ensureErrorType(err: unknown): Error & Partial<AzFuncError> {\r\n if (err instanceof Error) {\r\n return err;\r\n } else {\r\n let message: string;\r\n if (err === undefined || err === null) {\r\n message = 'Unknown error';\r\n } else if (typeof err === 'string') {\r\n message = err;\r\n } else if (typeof err === 'object') {\r\n message = JSON.stringify(err);\r\n } else {\r\n message = String(err);\r\n }\r\n return new Error(message);\r\n }\r\n}\r\n\r\n/**\r\n * This is mostly for callbacks where `null` or `undefined` indicates there is no error\r\n * By contrast, anything thrown/caught is assumed to be an error regardless of what it is\r\n */\r\nexport function isError(err: unknown): boolean {\r\n return err !== null && err !== undefined;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { HookContext } from './HookContext';\r\n\r\nexport class AppStartContext extends HookContext implements types.AppStartContext {}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { HookContext } from './HookContext';\r\n\r\nexport class AppTerminateContext extends HookContext implements types.AppTerminateContext {}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { ReadOnlyError } from '../errors';\r\nimport { nonNullProp } from '../utils/nonNull';\r\n\r\nexport class HookContext implements types.HookContext {\r\n #init: types.HookContextInit;\r\n\r\n constructor(init?: types.HookContextInit) {\r\n this.#init = init ?? {};\r\n this.#init.hookData ??= {};\r\n }\r\n\r\n get hookData(): Record<string, unknown> {\r\n return nonNullProp(this.#init, 'hookData');\r\n }\r\n\r\n set hookData(_value: unknown) {\r\n throw new ReadOnlyError('hookData');\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { ReadOnlyError } from '../errors';\r\nimport { InvocationContext } from '../InvocationContext';\r\nimport { nonNullProp } from '../utils/nonNull';\r\nimport { HookContext } from './HookContext';\r\n\r\nexport class InvocationHookContext extends HookContext implements types.InvocationHookContext {\r\n #init: types.InvocationHookContextInit;\r\n\r\n constructor(init?: types.InvocationHookContextInit) {\r\n super(init);\r\n this.#init = init ?? {};\r\n this.#init.inputs ??= [];\r\n this.#init.invocationContext ??= new InvocationContext();\r\n }\r\n\r\n get invocationContext(): types.InvocationContext {\r\n return nonNullProp(this.#init, 'invocationContext');\r\n }\r\n\r\n set invocationContext(_value: types.InvocationContext) {\r\n throw new ReadOnlyError('invocationContext');\r\n }\r\n\r\n get inputs(): unknown[] {\r\n return nonNullProp(this.#init, 'inputs');\r\n }\r\n\r\n set inputs(value: unknown[]) {\r\n this.#init.inputs = value;\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { InvocationHookContext } from './InvocationHookContext';\r\n\r\nexport class PostInvocationContext extends InvocationHookContext implements types.PostInvocationContext {\r\n #init: types.PostInvocationContextInit;\r\n\r\n constructor(init?: types.PostInvocationContextInit) {\r\n super(init);\r\n this.#init = init ?? {};\r\n }\r\n\r\n get result(): unknown {\r\n return this.#init.result;\r\n }\r\n\r\n set result(value: unknown) {\r\n this.#init.result = value;\r\n }\r\n\r\n get error(): unknown {\r\n return this.#init.error;\r\n }\r\n\r\n set error(value: unknown) {\r\n this.#init.error = value;\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { nonNullProp } from '../utils/nonNull';\r\nimport { InvocationHookContext } from './InvocationHookContext';\r\n\r\nexport class PreInvocationContext extends InvocationHookContext implements types.PreInvocationContext {\r\n #init: types.PreInvocationContextInit;\r\n\r\n constructor(init?: types.PreInvocationContextInit) {\r\n super(init);\r\n this.#init = init ?? {};\r\n this.#init.functionCallback ??= () => {};\r\n }\r\n\r\n get functionHandler(): types.FunctionHandler {\r\n return nonNullProp(this.#init, 'functionCallback');\r\n }\r\n\r\n set functionHandler(value: types.FunctionHandler) {\r\n this.#init.functionCallback = value;\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { AppStartHandler, AppTerminateHandler, PostInvocationHandler, PreInvocationHandler } from '@azure/functions';\r\nimport * as coreTypes from '@azure/functions-core';\r\nimport { Disposable } from '../utils/Disposable';\r\nimport { tryGetCoreApiLazy } from '../utils/tryGetCoreApiLazy';\r\nimport { AppStartContext } from './AppStartContext';\r\nimport { AppTerminateContext } from './AppTerminateContext';\r\nimport { PostInvocationContext } from './PostInvocationContext';\r\nimport { PreInvocationContext } from './PreInvocationContext';\r\n\r\nfunction registerHook(hookName: string, callback: coreTypes.HookCallback): coreTypes.Disposable {\r\n const coreApi = tryGetCoreApiLazy();\r\n if (!coreApi) {\r\n console.warn(\r\n `WARNING: Skipping call to register ${hookName} hook because the \"@azure/functions\" package is in test mode.`\r\n );\r\n return new Disposable(() => {\r\n console.warn(\r\n `WARNING: Skipping call to dispose ${hookName} hook because the \"@azure/functions\" package is in test mode.`\r\n );\r\n });\r\n } else {\r\n return coreApi.registerHook(hookName, callback);\r\n }\r\n}\r\n\r\nexport function appStart(handler: AppStartHandler): Disposable {\r\n return registerHook('appStart', (coreContext) => {\r\n return handler(new AppStartContext(coreContext));\r\n });\r\n}\r\n\r\nexport function appTerminate(handler: AppTerminateHandler): Disposable {\r\n return registerHook('appTerminate', (coreContext) => {\r\n return handler(new AppTerminateContext(coreContext));\r\n });\r\n}\r\n\r\nexport function preInvocation(handler: PreInvocationHandler): Disposable {\r\n return registerHook('preInvocation', (coreContext) => {\r\n return handler(new PreInvocationContext(coreContext));\r\n });\r\n}\r\n\r\nexport function postInvocation(handler: PostInvocationHandler): Disposable {\r\n return registerHook('postInvocation', (coreContext) => {\r\n return handler(new PostInvocationContext(coreContext));\r\n });\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { HttpRequestParams, HttpRequestUser } from '@azure/functions';\r\nimport { RpcHttpData } from '@azure/functions-core';\r\nimport { Blob } from 'buffer';\r\nimport { ReadableStream } from 'stream/web';\r\nimport { FormData, Headers, Request as uRequest } from 'undici';\r\nimport { URLSearchParams } from 'url';\r\nimport { fromNullableMapping } from '../converters/fromRpcNullable';\r\nimport { nonNullProp } from '../utils/nonNull';\r\nimport { extractHttpUserFromHeaders } from './extractHttpUserFromHeaders';\r\n\r\nexport class HttpRequest implements types.HttpRequest {\r\n readonly query: URLSearchParams;\r\n readonly params: HttpRequestParams;\r\n\r\n #cachedUser?: HttpRequestUser | null;\r\n #uReq: uRequest;\r\n #body?: Buffer | string;\r\n\r\n constructor(rpcHttp: RpcHttpData) {\r\n const url = nonNullProp(rpcHttp, 'url');\r\n\r\n if (rpcHttp.body?.bytes) {\r\n this.#body = Buffer.from(rpcHttp.body?.bytes);\r\n } else if (rpcHttp.body?.string) {\r\n this.#body = rpcHttp.body.string;\r\n }\r\n\r\n this.#uReq = new uRequest(url, {\r\n body: this.#body,\r\n method: nonNullProp(rpcHttp, 'method'),\r\n headers: fromNullableMapping(rpcHttp.nullableHeaders, rpcHttp.headers),\r\n });\r\n\r\n this.query = new URLSearchParams(fromNullableMapping(rpcHttp.nullableQuery, rpcHttp.query));\r\n this.params = fromNullableMapping(rpcHttp.nullableParams, rpcHttp.params);\r\n }\r\n\r\n get url(): string {\r\n return this.#uReq.url;\r\n }\r\n\r\n get method(): string {\r\n return this.#uReq.method;\r\n }\r\n\r\n get headers(): Headers {\r\n return this.#uReq.headers;\r\n }\r\n\r\n get user(): HttpRequestUser | null {\r\n if (this.#cachedUser === undefined) {\r\n this.#cachedUser = extractHttpUserFromHeaders(this.headers);\r\n }\r\n\r\n return this.#cachedUser;\r\n }\r\n\r\n get body(): ReadableStream<any> | null {\r\n return this.#uReq.body;\r\n }\r\n\r\n get bodyUsed(): boolean {\r\n return this.#uReq.bodyUsed;\r\n }\r\n\r\n async arrayBuffer(): Promise<ArrayBuffer> {\r\n return this.#uReq.arrayBuffer();\r\n }\r\n\r\n async blob(): Promise<Blob> {\r\n return this.#uReq.blob();\r\n }\r\n\r\n async formData(): Promise<FormData> {\r\n return this.#uReq.formData();\r\n }\r\n\r\n async json(): Promise<unknown> {\r\n return this.#uReq.json();\r\n }\r\n\r\n async text(): Promise<string> {\r\n return this.#uReq.text();\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as types from '@azure/functions';\r\nimport { HttpResponseInit } from '@azure/functions';\r\nimport { Blob } from 'buffer';\r\nimport { ReadableStream } from 'stream/web';\r\nimport { FormData, Headers, Response as uResponse, ResponseInit as uResponseInit } from 'undici';\r\nimport { isDefined } from '../utils/nonNull';\r\n\r\nexport class HttpResponse implements types.HttpResponse {\r\n readonly cookies: types.Cookie[];\r\n readonly enableContentNegotiation: boolean;\r\n\r\n #uRes: uResponse;\r\n\r\n constructor(resInit?: HttpResponseInit) {\r\n const uResInit: uResponseInit = { status: resInit?.status, headers: resInit?.headers };\r\n if (isDefined(resInit?.jsonBody)) {\r\n this.#uRes = uResponse.json(resInit?.jsonBody, uResInit);\r\n } else {\r\n this.#uRes = new uResponse(resInit?.body, uResInit);\r\n }\r\n\r\n this.cookies = resInit?.cookies || [];\r\n this.enableContentNegotiation = !!resInit?.enableContentNegotiation;\r\n }\r\n\r\n get status(): number {\r\n return this.#uRes.status;\r\n }\r\n\r\n get headers(): Headers {\r\n return this.#uRes.headers;\r\n }\r\n\r\n get body(): ReadableStream<any> | null {\r\n return this.#uRes.body;\r\n }\r\n\r\n get bodyUsed(): boolean {\r\n return this.#uRes.bodyUsed;\r\n }\r\n\r\n async arrayBuffer(): Promise<ArrayBuffer> {\r\n return this.#uRes.arrayBuffer();\r\n }\r\n\r\n async blob(): Promise<Blob> {\r\n return this.#uRes.blob();\r\n }\r\n\r\n async formData(): Promise<FormData> {\r\n return this.#uRes.formData();\r\n }\r\n\r\n async json(): Promise<unknown> {\r\n return this.#uRes.json();\r\n }\r\n\r\n async text(): Promise<string> {\r\n return this.#uRes.text();\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { HttpRequestUser } from '@azure/functions';\r\nimport { Headers } from 'undici';\r\nimport { nonNullValue } from '../utils/nonNull';\r\n\r\n/* grandfathered in. Should fix when possible */\r\n/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */\r\n\r\nexport function extractHttpUserFromHeaders(headers: Headers): HttpRequestUser | null {\r\n let user: HttpRequestUser | null = null;\r\n\r\n const clientPrincipal = headers.get('x-ms-client-principal');\r\n if (clientPrincipal) {\r\n const claimsPrincipalData = JSON.parse(Buffer.from(clientPrincipal, 'base64').toString('utf-8'));\r\n\r\n if (claimsPrincipalData['identityProvider']) {\r\n user = {\r\n type: 'StaticWebApps',\r\n id: claimsPrincipalData['userId'],\r\n username: claimsPrincipalData['userDetails'],\r\n identityProvider: claimsPrincipalData['identityProvider'],\r\n claimsPrincipalData,\r\n };\r\n } else {\r\n user = {\r\n type: 'AppService',\r\n id: nonNullValue(headers.get('x-ms-client-principal-id'), 'user-id'),\r\n username: nonNullValue(headers.get('x-ms-client-principal-name'), 'user-name'),\r\n identityProvider: nonNullValue(headers.get('x-ms-client-principal-idp'), 'user-idp'),\r\n claimsPrincipalData,\r\n };\r\n }\r\n }\r\n\r\n return user;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport {\r\n CosmosDBInput,\r\n CosmosDBInputOptions,\r\n FunctionInput,\r\n GenericInputOptions,\r\n SqlInput,\r\n SqlInputOptions,\r\n StorageBlobInput,\r\n StorageBlobInputOptions,\r\n TableInput,\r\n TableInputOptions,\r\n} from '@azure/functions';\r\nimport { addBindingName } from './addBindingName';\r\n\r\nexport function storageBlob(options: StorageBlobInputOptions): StorageBlobInput {\r\n return addInputBindingName({\r\n ...options,\r\n type: 'blob',\r\n });\r\n}\r\n\r\nexport function table(options: TableInputOptions): TableInput {\r\n return addInputBindingName({\r\n ...options,\r\n type: 'table',\r\n });\r\n}\r\n\r\nexport function cosmosDB(options: CosmosDBInputOptions): CosmosDBInput {\r\n return addInputBindingName({\r\n ...options,\r\n type: 'cosmosDB',\r\n });\r\n}\r\n\r\nexport function sql(options: SqlInputOptions): SqlInput {\r\n return addInputBindingName({\r\n ...options,\r\n type: 'sql',\r\n });\r\n}\r\n\r\nexport function generic(options: GenericInputOptions): FunctionInput {\r\n return addInputBindingName(options);\r\n}\r\n\r\nfunction addInputBindingName<T extends { type: string; name?: string }>(binding: T): T & { name: string } {\r\n return addBindingName(binding, 'Input');\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport {\r\n CosmosDBOutput,\r\n CosmosDBOutputOptions,\r\n EventGridOutput,\r\n EventGridOutputOptions,\r\n EventHubOutput,\r\n EventHubOutputOptions,\r\n FunctionOutput,\r\n GenericOutputOptions,\r\n HttpOutput,\r\n HttpOutputOptions,\r\n ServiceBusQueueOutput,\r\n ServiceBusQueueOutputOptions,\r\n ServiceBusTopicOutput,\r\n ServiceBusTopicOutputOptions,\r\n SqlOutput,\r\n SqlOutputOptions,\r\n StorageBlobOutput,\r\n StorageBlobOutputOptions,\r\n StorageQueueOutput,\r\n StorageQueueOutputOptions,\r\n TableOutput,\r\n TableOutputOptions,\r\n} from '@azure/functions';\r\nimport { addBindingName } from './addBindingName';\r\n\r\nexport function http(options: HttpOutputOptions): HttpOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'http',\r\n });\r\n}\r\n\r\nexport function storageBlob(options: StorageBlobOutputOptions): StorageBlobOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'blob',\r\n });\r\n}\r\n\r\nexport function table(options: TableOutputOptions): TableOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'table',\r\n });\r\n}\r\n\r\nexport function storageQueue(options: StorageQueueOutputOptions): StorageQueueOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'queue',\r\n });\r\n}\r\n\r\nexport function serviceBusQueue(options: ServiceBusQueueOutputOptions): ServiceBusQueueOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'serviceBus',\r\n });\r\n}\r\n\r\nexport function serviceBusTopic(options: ServiceBusTopicOutputOptions): ServiceBusTopicOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'serviceBus',\r\n });\r\n}\r\n\r\nexport function eventHub(options: EventHubOutputOptions): EventHubOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'eventHub',\r\n });\r\n}\r\n\r\nexport function eventGrid(options: EventGridOutputOptions): EventGridOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'eventGrid',\r\n });\r\n}\r\n\r\nexport function cosmosDB(options: CosmosDBOutputOptions): CosmosDBOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'cosmosDB',\r\n });\r\n}\r\n\r\nexport function sql(options: SqlOutputOptions): SqlOutput {\r\n return addOutputBindingName({\r\n ...options,\r\n type: 'sql',\r\n });\r\n}\r\n\r\nexport function generic(options: GenericOutputOptions): FunctionOutput {\r\n return addOutputBindingName(options);\r\n}\r\n\r\nfunction addOutputBindingName<T extends { type: string; name?: string }>(binding: T): T & { name: string } {\r\n return addBindingName(binding, 'Output');\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport {\r\n CosmosDBTrigger,\r\n CosmosDBTriggerOptions,\r\n EventGridTrigger,\r\n EventGridTriggerOptions,\r\n EventHubTrigger,\r\n EventHubTriggerOptions,\r\n FunctionTrigger,\r\n GenericTriggerOptions,\r\n HttpTrigger,\r\n HttpTriggerOptions,\r\n ServiceBusQueueTrigger,\r\n ServiceBusQueueTriggerOptions,\r\n ServiceBusTopicTrigger,\r\n ServiceBusTopicTriggerOptions,\r\n StorageBlobTrigger,\r\n StorageBlobTriggerOptions,\r\n StorageQueueTrigger,\r\n StorageQueueTriggerOptions,\r\n TimerTrigger,\r\n TimerTriggerOptions,\r\n WarmupTrigger,\r\n WarmupTriggerOptions,\r\n} from '@azure/functions';\r\nimport { addBindingName } from './addBindingName';\r\n\r\nexport function http(options: HttpTriggerOptions): HttpTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n authLevel: options.authLevel || 'anonymous',\r\n methods: options.methods || ['GET', 'POST'],\r\n type: 'httpTrigger',\r\n });\r\n}\r\n\r\nexport function timer(options: TimerTriggerOptions): TimerTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'timerTrigger',\r\n });\r\n}\r\n\r\nexport function storageBlob(options: StorageBlobTriggerOptions): StorageBlobTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'blobTrigger',\r\n });\r\n}\r\n\r\nexport function storageQueue(options: StorageQueueTriggerOptions): StorageQueueTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'queueTrigger',\r\n });\r\n}\r\n\r\nexport function serviceBusQueue(options: ServiceBusQueueTriggerOptions): ServiceBusQueueTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'serviceBusTrigger',\r\n });\r\n}\r\n\r\nexport function serviceBusTopic(options: ServiceBusTopicTriggerOptions): ServiceBusTopicTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'serviceBusTrigger',\r\n });\r\n}\r\n\r\nexport function eventHub(options: EventHubTriggerOptions): EventHubTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'eventHubTrigger',\r\n });\r\n}\r\n\r\nexport function eventGrid(options: EventGridTriggerOptions): EventGridTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'eventGridTrigger',\r\n });\r\n}\r\n\r\nexport function cosmosDB(options: CosmosDBTriggerOptions): CosmosDBTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'cosmosDBTrigger',\r\n });\r\n}\r\n\r\nexport function warmup(options: WarmupTriggerOptions): WarmupTrigger {\r\n return addTriggerBindingName({\r\n ...options,\r\n type: 'warmupTrigger',\r\n });\r\n}\r\n\r\nexport function generic(options: GenericTriggerOptions): FunctionTrigger {\r\n return addTriggerBindingName(options);\r\n}\r\n\r\nfunction addTriggerBindingName<T extends { type: string; name?: string }>(binding: T): T & { name: string } {\r\n return addBindingName(binding, 'Trigger');\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\n/**\r\n * Based off of VS Code\r\n * https://github.com/microsoft/vscode/blob/7bed4ce3e9f5059b5fc638c348f064edabcce5d2/src/vs/workbench/api/common/extHostTypes.ts#L65\r\n */\r\nexport class Disposable {\r\n static from(...inDisposables: { dispose(): any }[]): Disposable {\r\n let disposables: ReadonlyArray<{ dispose(): any }> | undefined = inDisposables;\r\n return new Disposable(function () {\r\n if (disposables) {\r\n for (const disposable of disposables) {\r\n if (disposable && typeof disposable.dispose === 'function') {\r\n disposable.dispose();\r\n }\r\n }\r\n disposables = undefined;\r\n }\r\n });\r\n }\r\n\r\n #callOnDispose?: () => any;\r\n\r\n constructor(callOnDispose: () => any) {\r\n this.#callOnDispose = callOnDispose;\r\n }\r\n\r\n dispose(): any {\r\n if (typeof this.#callOnDispose === 'function') {\r\n this.#callOnDispose();\r\n this.#callOnDispose = undefined;\r\n }\r\n }\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport function isTrigger(typeName: string | undefined | null): boolean {\r\n return !!typeName && /trigger$/i.test(typeName);\r\n}\r\n\r\nexport function isHttpTrigger(typeName: string | undefined | null): boolean {\r\n return typeName?.toLowerCase() === 'httptrigger';\r\n}\r\n\r\nexport function isTimerTrigger(typeName: string | undefined | null): boolean {\r\n return typeName?.toLowerCase() === 'timertrigger';\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport { AzFuncSystemError } from '../errors';\r\n\r\n/**\r\n * Retrieves a property by name from an object and checks that it's not null and not undefined. It is strongly typed\r\n * for the property and will give a compile error if the given name is not a property of the source.\r\n */\r\nexport function nonNullProp<TSource, TKey extends keyof TSource>(\r\n source: TSource,\r\n name: TKey\r\n): NonNullable<TSource[TKey]> {\r\n const value: NonNullable<TSource[TKey]> = <NonNullable<TSource[TKey]>>source[name];\r\n return nonNullValue(value, <string>name);\r\n}\r\n\r\n/**\r\n * Validates that a given value is not null and not undefined.\r\n */\r\nexport function nonNullValue<T>(value: T | undefined | null, propertyNameOrMessage?: string): T {\r\n if (value === null || value === undefined) {\r\n throw new AzFuncSystemError(\r\n 'Internal error: Expected value to be neither null nor undefined' +\r\n (propertyNameOrMessage ? `: ${propertyNameOrMessage}` : '')\r\n );\r\n }\r\n\r\n return value;\r\n}\r\n\r\nexport function copyPropIfDefined<TData, TKey extends keyof TData>(source: TData, destination: TData, key: TKey): void {\r\n if (source[key] !== null && source[key] !== undefined) {\r\n destination[key] = source[key];\r\n }\r\n}\r\n\r\nexport function isDefined<T>(data: T | undefined | null): data is T {\r\n return data !== null && data !== undefined;\r\n}\r\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nimport * as coreTypes from '@azure/functions-core';\r\n\r\nlet coreApi: typeof coreTypes | undefined | null;\r\nexport function tryGetCoreApiLazy(): typeof coreTypes | null {\r\n if (coreApi === undefined) {\r\n try {\r\n // eslint-disable-next-line @typescript-eslint/no-var-requires\r\n coreApi = <typeof coreTypes>require('@azure/functions-core');\r\n } catch {\r\n coreApi = null;\r\n }\r\n }\r\n return coreApi;\r\n}\r\n","module.exports = require(\"@azure/functions-core\");","module.exports = require(\"undici\");","module.exports = require(\"url\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// Copyright (c) .NET Foundation. All rights reserved.\r\n// Licensed under the MIT License.\r\n\r\nexport * as app from './app';\r\nexport { AppStartContext } from './hooks/AppStartContext';\r\nexport { AppTerminateContext } from './hooks/AppTerminateContext';\r\nexport { HookContext } from './hooks/HookContext';\r\nexport { InvocationHookContext } from './hooks/InvocationHookContext';\r\nexport { PostInvocationContext } from './hooks/PostInvocationContext';\r\nexport { PreInvocationContext } from './hooks/PreInvocationContext';\r\nexport { HttpRequest } from './http/HttpRequest';\r\nexport { HttpResponse } from './http/HttpResponse';\r\nexport * as input from './input';\r\nexport { InvocationContext } from './InvocationContext';\r\nexport * as output from './output';\r\nexport * as trigger from './trigger';\r\nexport { Disposable } from './utils/Disposable';\r\n"],"names":[],"sourceRoot":""} |