@azure/functions
Version:
Microsoft Azure Functions NodeJS Framework
1 lines • 54.4 kB
JavaScript
(()=>{"use strict";var e={337:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setup=t.capabilities=t.enableHttpStream=t.lockSetup=void 0;const n=r(725),o=r(9168),i=r(3476),s=r(4893);let a=!1;t.lockSetup=function(){a=!0},t.enableHttpStream=!1,t.capabilities={},t.setup=function(e){if(a)throw new n.AzFuncSystemError("Setup options can't be changed after app startup has finished.");if(e.enableHttpStream){const e=(0,i.tryGetCoreApiLazy)();if(e&&!e.log)throw new n.AzFuncSystemError("HTTP streaming requires Azure Functions Host v4.28 or higher.")}if((0,o.isDefined)(e.enableHttpStream)&&(t.enableHttpStream=e.enableHttpStream),e.capabilities)for(let[r,n]of Object.entries(e.capabilities))(0,o.isDefined)(n)&&(n=String(n),(0,s.workerSystemLog)("debug",`Capability ${r} set to ${n}.`),t.capabilities[r]=n);t.enableHttpStream&&(0,s.workerSystemLog)("debug","HTTP streaming enabled.")}},520:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ProgrammingModel=void 0;const o=r(6921),i=r(2337),s=r(6691),a=r(337);t.ProgrammingModel=class{constructor(){this.name="@azure/functions",this.version=o.version}getInvocationModel(e){return new s.InvocationModel(e)}getCapabilities(e){return n(this,void 0,void 0,function*(){if((0,a.lockSetup)(),a.enableHttpStream){const t=yield(0,i.setupHttpProxy)();e.HttpUri=t}return Object.assign(e,a.capabilities),e})}}},679:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromRpcTypedData=void 0;const n=r(6490),o=r(7992),i=r(9168);function s(e){try{return JSON.parse(e)}catch(t){return e}}t.fromRpcTypedData=function(e){var t;if(e){if((0,i.isDefined)(e.string))return s(e.string);if((0,i.isDefined)(e.json))return JSON.parse(e.json);if((0,i.isDefined)(e.bytes))return Buffer.from(e.bytes);if((0,i.isDefined)(e.stream))return Buffer.from(e.stream);if((0,i.isDefined)(e.http))return new o.HttpRequest(e.http);if((0,i.isDefined)(e.int))return e.int;if((0,i.isDefined)(e.double))return e.double;if(e.collectionBytes&&(0,i.isDefined)(e.collectionBytes.bytes))return e.collectionBytes.bytes.map(e=>Buffer.from(e));if(e.collectionString&&(0,i.isDefined)(e.collectionString.string))return e.collectionString.string.map(s);if(e.collectionDouble&&(0,i.isDefined)(e.collectionDouble.double))return e.collectionDouble.double;if(e.collectionSint64&&(0,i.isDefined)(e.collectionSint64.sint64))return e.collectionSint64.sint64;if(e.modelBindingData&&(0,i.isDefined)(e.modelBindingData.content))try{return n.ResourceFactoryResolver.getInstance().createClient(e.modelBindingData.source,e.modelBindingData)}catch(e){throw new Error(`Unable to create client. Please register the extensions library with your function app. Error: ${e instanceof Error?e.message:String(e)}`)}else if(e.collectionModelBindingData&&(0,i.isDefined)(e.collectionModelBindingData.modelBindingData)&&e.collectionModelBindingData.modelBindingData.length>0)try{return n.ResourceFactoryResolver.getInstance().createClient(null===(t=e.collectionModelBindingData.modelBindingData[0])||void 0===t?void 0:t.source,e.collectionModelBindingData.modelBindingData)}catch(e){throw new Error(`Unable to create client. Please register the extensions library with your function app. Error: ${e instanceof Error?e.message:String(e)}`)}}}},725:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isError=t.trySetErrorMessage=t.ensureErrorType=t.ReadOnlyError=t.AzFuncRangeError=t.AzFuncTypeError=t.AzFuncSystemError=void 0;class r extends Error{constructor(){super(...arguments),this.isAzureFunctionsSystemError=!0}}t.AzFuncSystemError=r;class n extends TypeError{constructor(){super(...arguments),this.isAzureFunctionsSystemError=!0}}t.AzFuncTypeError=n;class o extends RangeError{constructor(){super(...arguments),this.isAzureFunctionsSystemError=!0}}t.AzFuncRangeError=o,t.ReadOnlyError=class extends n{constructor(e){super(`Cannot assign to read only property '${e}'`)}},t.ensureErrorType=function(e){if(e instanceof Error)return e;{let t;return t=null==e?"Unknown error":"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):String(e),new Error(t)}},t.trySetErrorMessage=function(e,t){try{e.message=t}catch(e){}},t.isError=function(e){return null!=e}},811:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.webPubSub=t.mySql=t.sql=t.cosmosDB=t.eventGrid=t.eventHub=t.serviceBusTopic=t.serviceBusQueue=t.storageQueue=t.table=t.storageBlob=t.http=void 0;const n=r(6693);function o(e){return(0,n.addBindingName)(e,"Output")}t.http=function(e){return o(Object.assign(Object.assign({},e),{type:"http"}))},t.storageBlob=function(e){return o(Object.assign(Object.assign({},e),{type:"blob"}))},t.table=function(e){return o(Object.assign(Object.assign({},e),{type:"table"}))},t.storageQueue=function(e){return o(Object.assign(Object.assign({},e),{type:"queue"}))},t.serviceBusQueue=function(e){return o(Object.assign(Object.assign({},e),{type:"serviceBus"}))},t.serviceBusTopic=function(e){return o(Object.assign(Object.assign({},e),{type:"serviceBus"}))},t.eventHub=function(e){return o(Object.assign(Object.assign({},e),{type:"eventHub"}))},t.eventGrid=function(e){return o(Object.assign(Object.assign({},e),{type:"eventGrid"}))},t.cosmosDB=function(e){return o(Object.assign(Object.assign({},e),{type:"cosmosDB"}))},t.sql=function(e){return o(Object.assign(Object.assign({},e),{type:"sql"}))},t.mySql=function(e){return o(Object.assign(Object.assign({},e),{type:"mysql"}))},t.webPubSub=function(e){return o(Object.assign(Object.assign({},e),{type:"webPubSub"}))},t.generic=function(e){return o(e)}},917:(e,t)=>{function r(e){return e.charAt(0).toLowerCase()+e.slice(1)}Object.defineProperty(t,"__esModule",{value:!0}),t.toCamelCaseKey=t.toCamelCaseValue=void 0,t.toCamelCaseValue=function e(t){if("object"!=typeof t||null===t)return t;if(Array.isArray(t))return t.map(e);{const n={};for(const[o,i]of Object.entries(t))n[r(o)]=e(i);return n}},t.toCamelCaseKey=r},1630:e=>{e.exports=require("http")},1645:e=>{e.exports=require("net")},1705:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toNullableTimestamp=t.toNullableString=t.toRpcString=t.toNullableDouble=t.toNullableBool=void 0;const n=r(725),o=r(9168);t.toNullableBool=function(e,t){if("boolean"==typeof e)return{value:e};if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'boolean' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toNullableDouble=function(e,t){if("number"==typeof e)return{value:e};if("string"==typeof e&&!isNaN(Number(e)))return{value:parseFloat(e)};if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'number' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toRpcString=function(e,t){if("string"==typeof e)return e;if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'string' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`);return""},t.toNullableString=function(e,t){if("string"==typeof e)return{value:e};if((0,o.isDefined)(e))throw new n.AzFuncSystemError(`A 'string' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toNullableTimestamp=function(e,t){if((0,o.isDefined)(e))try{const t="number"==typeof e?e:e.getTime();if(t&&t>=0)return{value:{seconds:Math.round(t/1e3)}}}catch(r){throw new n.AzFuncSystemError(`A 'number' or 'Date' input was expected instead of a '${typeof e}'. Cannot parse value of '${t}'.`)}}},1776:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromRpcTraceContext=t.fromRpcRetryContext=void 0;const n=r(9168);t.fromRpcRetryContext=function(e){if(e){const t={retryCount:(0,n.nonNullProp)(e,"retryCount"),maxRetryCount:(0,n.nonNullProp)(e,"maxRetryCount")};return e.exception&&(t.exception=function(e){const t={};return(0,n.copyPropIfDefined)(e,t,"message"),(0,n.copyPropIfDefined)(e,t,"source"),(0,n.copyPropIfDefined)(e,t,"stackTrace"),t}(e.exception)),t}},t.fromRpcTraceContext=function(e){if(e){const t={};return(0,n.copyPropIfDefined)(e,t,"traceParent"),(0,n.copyPropIfDefined)(e,t,"traceState"),e.attributes&&(t.attributes=e.attributes),t}}},1859:function(e,t,r){var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.mcpTool=t.webPubSub=t.mySql=t.sql=t.warmup=t.cosmosDB=t.eventGrid=t.eventHub=t.serviceBusTopic=t.serviceBusQueue=t.storageQueue=t.storageBlob=t.timer=t.http=t.deleteRequest=t.patch=t.post=t.put=t.get=t.setup=t.hook=void 0;const o=r(2757),i=r(811),s=r(520),a=r(2888),u=r(3476);t.hook=r(6765);var c=r(337);Object.defineProperty(t,"setup",{enumerable:!0,get:function(){return c.setup}});let l=!1;function p(e,t){const r="function"==typeof e?{handler:e}:e;return r.methods=[t],r}function f(e,t){const{handler:r,return:o,trigger:i,extraInputs:s,extraOutputs:a,retry:u}=e,c=n(e,["handler","return","trigger","extraInputs","extraOutputs","retry"]);return{trigger:null!=i?i:t(c),return:o,retry:u,extraInputs:s,extraOutputs:a,handler:r}}function d(e,t){t.return||(t.return=i.http({})),y(e,f(t,a.http))}function y(e,t){l||function(){const e=(0,u.tryGetCoreApiLazy)();e?e.setProgrammingModel(new s.ProgrammingModel):console.warn('WARNING: Failed to detect the Azure Functions runtime. Switching "@azure/functions" package to test mode - not all features are supported.'),l=!0}();const r=(0,u.tryGetCoreApiLazy)();r?r.registerFunction((0,o.toCoreFunctionMetadata)(e,t),t.handler):console.warn(`WARNING: Skipping call to register function "${e}" because the "@azure/functions" package is in test mode.`)}t.get=function(e,t){d(e,p(t,"GET"))},t.put=function(e,t){d(e,p(t,"PUT"))},t.post=function(e,t){d(e,p(t,"POST"))},t.patch=function(e,t){d(e,p(t,"PATCH"))},t.deleteRequest=function(e,t){d(e,p(t,"DELETE"))},t.http=d,t.timer=function(e,t){y(e,f(t,a.timer))},t.storageBlob=function(e,t){y(e,f(t,a.storageBlob))},t.storageQueue=function(e,t){y(e,f(t,a.storageQueue))},t.serviceBusQueue=function(e,t){y(e,f(t,a.serviceBusQueue))},t.serviceBusTopic=function(e,t){y(e,f(t,a.serviceBusTopic))},t.eventHub=function(e,t){y(e,f(t,a.eventHub))},t.eventGrid=function(e,t){y(e,f(t,a.eventGrid))},t.cosmosDB=function(e,t){y(e,f(t,a.cosmosDB))},t.warmup=function(e,t){y(e,f(t,a.warmup))},t.sql=function(e,t){y(e,f(t,a.sql))},t.mySql=function(e,t){y(e,f(t,a.mySql))},t.webPubSub=function(e,t){y(e,f(t,a.webPubSub))},t.mcpTool=function(e,t){y(e,f(t,a.mcpTool))},t.generic=y},1898:function(e,t){var r,n=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0;class i{static from(...e){let t=e;return new i(function(){if(t){for(const e of t)e&&"function"==typeof e.dispose&&e.dispose();t=void 0}})}constructor(e){r.set(this,void 0),n(this,r,e,"f")}dispose(){"function"==typeof o(this,r,"f")&&(o(this,r,"f").call(this),n(this,r,void 0,"f"))}}t.Disposable=i,r=new WeakMap},2337:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,o,(t=e[r](t)).done,t.value)})}}};Object.defineProperty(t,"__esModule",{value:!0}),t.setupHttpProxy=t.sendProxyResponse=t.waitForProxyRequest=void 0;const i=r(5096),s=r(4735),a=r(1630),u=r(1645),c=r(725),l=r(9168),p=r(4893),f={},d={},y=new s.EventEmitter;t.waitForProxyRequest=function(e){return n(this,void 0,void 0,function*(){return new Promise((t,r)=>{const n=f[e];n?(t(n),delete f[e]):y.once(e,()=>{const r=f[e];r&&(t(r),delete f[e])})})})};const h="x-ms-invocation-id";t.sendProxyResponse=function(e,t){var r,s,a,u;return n(this,void 0,void 0,function*(){const n=(0,l.nonNullProp)(d,e);delete d[e];for(const[e,r]of t.headers.entries())n.setHeader(e,r);if(n.setHeader(h,e),n.statusCode=t.status,t.cookies.length>0&&function(e,t){const r=e.cookies.map(e=>{let t;switch(e.sameSite){case"Lax":t="lax";break;case"None":t="none";break;case"Strict":t="strict";break;default:t=e.sameSite}return(0,i.serialize)(e.name,e.value,{domain:e.domain,path:e.path,expires:"number"==typeof e.expires?new Date(e.expires):e.expires,secure:e.secure,httpOnly:e.httpOnly,sameSite:t,maxAge:e.maxAge})});t.setHeader("Set-Cookie",r)}(t,n),t.body)try{for(var c,p=!0,f=o(t.body.values());c=yield f.next(),!(r=c.done);){u=c.value,p=!1;try{const e=u;n.write(e)}finally{p=!0}}}catch(e){s={error:e}}finally{try{p||r||!(a=f.return)||(yield a.call(f))}finally{if(s)throw s.error}}n.end()})},t.setupHttpProxy=function(){return n(this,void 0,void 0,function*(){return new Promise((e,t)=>{const r=a.createServer();r.on("request",(e,t)=>{const r=e.headers[h];"string"==typeof r?(f[r]=e,d[r]=t,y.emit(r)):(0,p.workerSystemLog)("error",`Http proxy request missing header ${h}`)}),r.on("error",e=>{e=(0,c.ensureErrorType)(e),(0,p.workerSystemLog)("error",`Http proxy error: ${e.stack||e.message}`)}),r.listen(()=>{const n=r.address();null!==n&&"object"==typeof n?0===n.port?((0,p.workerSystemLog)("debug","Port 0 assigned. Finding open port."),function(e){const t=u.createServer();!function r(n){if(n>55025)throw new c.AzFuncSystemError("No available ports found between 55000 and 55025. To enable HTTP streaming, please open a port in this range.");t.once("error",()=>{r(n+1)}),t.once("listening",()=>{const r=t.address();null!==r&&"object"==typeof r&&(n=r.port,t.close(),e(n))}),t.listen(n)}(55e3)}(t=>{r.close(),r.listen(t,()=>{(0,p.workerSystemLog)("debug",`Server is now listening on found open port: ${t}`)}),e(`http://localhost:${t}/`)})):((0,p.workerSystemLog)("debug",`Auto-assigned port is valid. Port: ${n.port}`),e(`http://localhost:${n.port}/`)):t(new c.AzFuncSystemError("Unexpected server address during http proxy setup"))}),r.on("close",()=>{(0,p.workerSystemLog)("information","Http proxy closing")})})})}},2757:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addSdkBindingsFlag=t.toCoreFunctionMetadata=void 0;const n=r(6921),o=r(725),i=r(9898),s=r(4893),a=r(8360);function u(e,t,r,n,o){if(void 0!==e&&!0===e){const e={operation:"EnableDeferredBinding",properties:{functionName:t||"unknown",entityType:o?"binding":"trigger",triggerType:r||"unknown",bindingOrTriggerName:n||"unknown",supportsDeferredBinding:!0},message:`Enabled Deferred Binding of type '${r||"unknown"}' for function '${t||"unknown"}'`};return(0,s.workerSystemLog)("information",JSON.stringify(e)),{supportsDeferredBinding:"true"}}return{supportsDeferredBinding:"false"}}t.toCoreFunctionMetadata=function(e,t){var r;const s={},c=[],l=t.trigger;if(s[l.name]=Object.assign(Object.assign({},l),{direction:"in",type:(0,i.isTrigger)(l.type)?l.type:l.type+"Trigger",properties:u(null===(r=t.trigger)||void 0===r?void 0:r.sdkBinding,e,l.type,l.name,!1)}),c.push(l.name),t.extraInputs)for(const r of t.extraInputs)s[r.name]=Object.assign(Object.assign({},r),{direction:"in",properties:u(null==r?void 0:r.sdkBinding,e,r.type,r.name,!0)}),c.push(r.name);if(t.return&&(s[n.returnBindingKey]=Object.assign(Object.assign({},t.return),{direction:"out"}),c.push(n.returnBindingKey)),t.extraOutputs)for(const e of t.extraOutputs)s[e.name]=Object.assign(Object.assign({},e),{direction:"out"}),c.push(e.name);if(c.filter((e,t)=>c.indexOf(e)!==t).length>0)throw new o.AzFuncSystemError(`Duplicate bindings found for function "${e}". Remove a duplicate binding or manually specify the "name" property to make it unique.`);let p;return t.retry&&(p=Object.assign(Object.assign({},t.retry),{retryStrategy:t.retry.strategy,delayInterval:(0,a.toRpcDuration)(t.retry.delayInterval,"retry.delayInterval"),maximumInterval:(0,a.toRpcDuration)(t.retry.maximumInterval,"retry.maximumInterval"),minimumInterval:(0,a.toRpcDuration)(t.retry.minimumInterval,"retry.minimumInterval")})),{name:e,bindings:s,retryOptions:p}},t.addSdkBindingsFlag=u},2888:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.mcpTool=t.webPubSub=t.mySql=t.sql=t.warmup=t.cosmosDB=t.eventGrid=t.eventHub=t.serviceBusTopic=t.serviceBusQueue=t.storageQueue=t.storageBlob=t.timer=t.http=void 0;const n=r(6693),o=r(5571);function i(e){return(0,n.addBindingName)(e,"Trigger")}t.http=function(e){return i(Object.assign(Object.assign({},e),{authLevel:e.authLevel||"anonymous",methods:e.methods||["GET","POST"],type:"httpTrigger"}))},t.timer=function(e){return i(Object.assign(Object.assign({},e),{type:"timerTrigger"}))},t.storageBlob=function(e){return i(Object.assign(Object.assign({},e),{type:"blobTrigger"}))},t.storageQueue=function(e){return i(Object.assign(Object.assign({},e),{type:"queueTrigger"}))},t.serviceBusQueue=function(e){return i(Object.assign(Object.assign({},e),{type:"serviceBusTrigger"}))},t.serviceBusTopic=function(e){return i(Object.assign(Object.assign({},e),{type:"serviceBusTrigger"}))},t.eventHub=function(e){return i(Object.assign(Object.assign({},e),{type:"eventHubTrigger"}))},t.eventGrid=function(e){return i(Object.assign(Object.assign({},e),{type:"eventGridTrigger"}))},t.cosmosDB=function(e){return i(Object.assign(Object.assign({},e),{type:"cosmosDBTrigger"}))},t.warmup=function(e){return i(Object.assign(Object.assign({},e),{type:"warmupTrigger"}))},t.sql=function(e){return i(Object.assign(Object.assign({},e),{type:"sqlTrigger"}))},t.mySql=function(e){return i(Object.assign(Object.assign({},e),{type:"mysqlTrigger"}))},t.webPubSub=function(e){return i(Object.assign(Object.assign({},e),{type:"webPubSubTrigger"}))},t.mcpTool=function(e){return i(Object.assign(Object.assign({},(0,o.converToMcpToolTriggerOptionsToRpc)(e)),{type:"mcpToolTrigger"}))},t.generic=function(e){return i(e)}},3476:(e,t,r)=>{let n;Object.defineProperty(t,"__esModule",{value:!0}),t.tryGetCoreApiLazy=void 0,t.tryGetCoreApiLazy=function(){if(void 0===n)try{n=r(8789)}catch(e){n=null}return n}},3978:e=>{e.exports=require("undici")},4169:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getStringHash=t.getRandomHexString=void 0;const n=r(5511);t.getRandomHexString=function(e=10){return n.randomBytes(Math.ceil(e/2)).toString("hex").slice(0,e)},t.getStringHash=function(e,t=10){return n.createHash("sha256").update(e).digest("hex").slice(0,t)}},4454:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRpcTypedData=void 0,t.toRpcTypedData=function(e){return null==e?e:"string"==typeof e?{string:e}:Buffer.isBuffer(e)?{bytes:e}:ArrayBuffer.isView(e)?{bytes:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}:e instanceof ArrayBuffer?{bytes:new Uint8Array(e)}:"number"==typeof e?Number.isInteger(e)?{int:e}:{double:e}:{json:JSON.stringify(e)}}},4586:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AppTerminateContext=void 0;const n=r(5789);class o extends n.HookContext{}t.AppTerminateContext=o},4714:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromRpcTriggerMetadata=void 0;const n=r(9898),o=r(679),i=r(917);t.fromRpcTriggerMetadata=function(e,t){if(e&&!(0,n.isHttpTrigger)(t)&&!(0,n.isTimerTrigger)(t)){const t={};for(const[r,n]of Object.entries(e))t[(0,i.toCamelCaseKey)(r)]=(0,i.toCamelCaseValue)((0,o.fromRpcTypedData)(n));return t}}},4735:e=>{e.exports=require("events")},4788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.generic=t.webPubSubContext=t.webPubSubConnection=t.mySql=t.sql=t.cosmosDB=t.table=t.storageBlob=void 0;const n=r(6693);function o(e){return(0,n.addBindingName)(e,"Input")}t.storageBlob=function(e){return o(Object.assign(Object.assign({},e),{type:"blob"}))},t.table=function(e){return o(Object.assign(Object.assign({},e),{type:"table"}))},t.cosmosDB=function(e){return o(Object.assign(Object.assign({},e),{type:"cosmosDB"}))},t.sql=function(e){return o(Object.assign(Object.assign({},e),{type:"sql"}))},t.mySql=function(e){return o(Object.assign(Object.assign({},e),{type:"mysql"}))},t.webPubSubConnection=function(e){return o(Object.assign(Object.assign({},e),{type:"webPubSubConnection"}))},t.webPubSubContext=function(e){return o(Object.assign(Object.assign({},e),{type:"webPubSubContext"}))},t.generic=function(e){return o(e)}},4893:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.workerSystemLog=void 0;const n=r(8354),o=r(5396),i=r(3476);t.workerSystemLog=function(e,...t){const r=(0,i.tryGetCoreApiLazy)();r&&r.log?r.log(e,"system",(0,n.format)(...t)):(0,o.fallbackLogHandler)(e,...t)}},5064:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.toRpcHttp=void 0;const o=r(725),i=r(2337),s=r(8950),a=r(337),u=r(7866),c=r(4454);t.toRpcHttp=function(e,t){return n(this,void 0,void 0,function*(){if(null==t)return t;if("object"!=typeof t)throw new o.AzFuncSystemError('The HTTP response must be an object with optional properties "body", "status", "headers", and "cookies".');const r=t instanceof s.HttpResponse?t:new s.HttpResponse(t);if(a.enableHttpStream)return void(yield(0,i.sendProxyResponse)(e,r));const n={};n.statusCode=r.status.toString(),n.headers={};for(const[e,t]of r.headers.entries())n.headers[e]=t;n.cookies=[];for(const e of r.cookies)n.cookies.push((0,u.toRpcHttpCookie)(e));n.enableContentNegotiation=r.enableContentNegotiation;const l=yield r.arrayBuffer();return n.body=(0,c.toRpcTypedData)(l),{http:n}})}},5096:e=>{e.exports=require("cookie")},5138:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromNullableMapping=void 0,t.fromNullableMapping=function(e,t){var r;let n={};if(e&&Object.keys(e).length>0)for(const t in e)n[t]=(null===(r=e[t])||void 0===r?void 0:r.value)||"";else t&&Object.keys(t).length>0&&(n=t);return n}},5396:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fallbackLogHandler=void 0,t.fallbackLogHandler=function(e,...t){switch(e){case"trace":console.trace(...t);break;case"debug":console.debug(...t);break;case"information":console.info(...t);break;case"warning":console.warn(...t);break;case"critical":case"error":console.error(...t);break;default:console.log(...t)}}},5407:function(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.LogHookContext=void 0;const s=r(725),a=r(9168),u=r(5789);class c extends u.HookContext{constructor(e){var t,r,s,a,u,c;super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(a=i(this,n,"f")).level)&&void 0!==t||(a.level="information"),null!==(r=(u=i(this,n,"f")).message)&&void 0!==r||(u.message="unknown"),null!==(s=(c=i(this,n,"f")).category)&&void 0!==s||(c.category="user")}get level(){return(0,a.nonNullProp)(i(this,n,"f"),"level")}set level(e){i(this,n,"f").level=e}get message(){return(0,a.nonNullProp)(i(this,n,"f"),"message")}set message(e){i(this,n,"f").message=e}get category(){return(0,a.nonNullProp)(i(this,n,"f"),"category")}set category(e){throw new s.ReadOnlyError("category")}get invocationContext(){return i(this,n,"f").invocationContext}set invocationContext(e){throw new s.ReadOnlyError("invocationContext")}}t.LogHookContext=c,n=new WeakMap},5511:e=>{e.exports=require("crypto")},5521:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fromRpcBindings=void 0;const n=r(6921),o=r(9898),i=r(9168);function s(e,t){return Object.assign(Object.assign({},t),{type:(0,i.nonNullProp)(t,"type"),name:e})}t.fromRpcBindings=function(e){let t,r;const a=[],u=[];for(const[c,l]of Object.entries((0,i.nonNullValue)(e,"bindings")))(0,o.isTrigger)(l.type)?t=s(c,l):c===n.returnBindingKey?r=s(c,l):"in"===l.direction?a.push(s(c,l)):"out"===l.direction&&u.push(s(c,l));return{trigger:(0,i.nonNullValue)(t,"trigger"),return:r,extraInputs:a,extraOutputs:u}}},5571:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.converToMcpToolTriggerOptionsToRpc=void 0;const n=r(7175);t.converToMcpToolTriggerOptionsToRpc=function(e){const t={toolName:e.toolName,description:e.description};let r;try{r=(0,n.normalizeToolProperties)(e.toolProperties)}catch(e){if(e instanceof Error&&(e.message.includes("Property type is required")||e.message.includes("Property type must be specified")))throw e;r=void 0}if(void 0!==r)return Object.assign(Object.assign({},t),{toolProperties:JSON.stringify(r)});throw new Error(`Invalid toolProperties for tool '${e.toolName}': Expected an array of McpToolProperty or ToolProps objects or ToolProps need a type defined.`)}},5789:function(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.HookContext=void 0;const s=r(725),a=r(9168);t.HookContext=class{constructor(e){var t,r;n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(r=i(this,n,"f")).hookData)&&void 0!==t||(r.hookData={})}get hookData(){return(0,a.nonNullProp)(i(this,n,"f"),"hookData")}set hookData(e){throw new s.ReadOnlyError("hookData")}},n=new WeakMap},6490:e=>{e.exports=require("@azure/functions-extensions-base")},6691:function(e,t,r){var n,o,i,s,a,u,c,l,p,f,d=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})},y=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},h=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationModel=void 0;const g=r(8354),v=r(6921),b=r(5521),m=r(1776),w=r(4714),P=r(679),x=r(917),O=r(5064),j=r(4454),T=r(725),C=r(2337),S=r(7992),_=r(8157),k=r(337),E=r(9898),D=r(9168);t.InvocationModel=class{constructor(e){n.add(this),o.set(this,!1),i.set(this,void 0),s.set(this,void 0),a.set(this,void 0),u.set(this,void 0),y(this,i,e,"f"),y(this,s,(0,D.nonNullProp)(e.metadata,"name"),"f"),y(this,a,(0,D.nonNullProp)(e.metadata,"bindings"),"f");const t=(0,D.nonNullValue)(Object.values(h(this,a,"f")).find(e=>(0,E.isTrigger)(e.type)),"triggerBinding");y(this,u,(0,D.nonNullProp)(t,"type"),"f")}getArguments(){return d(this,void 0,void 0,function*(){const e=h(this,i,"f").request,t=new _.InvocationContext({invocationId:(0,D.nonNullProp)(h(this,i,"f"),"invocationId"),functionName:h(this,s,"f"),logHandler:(e,...t)=>h(this,n,"m",f).call(this,e,...t),retryContext:(0,m.fromRpcRetryContext)(e.retryContext),traceContext:(0,m.fromRpcTraceContext)(e.traceContext),triggerMetadata:(0,w.fromRpcTriggerMetadata)(e.triggerMetadata,h(this,u,"f")),options:(0,b.fromRpcBindings)(h(this,a,"f"))}),r=[];if(e.inputData)for(const n of e.inputData){const o=(0,D.nonNullProp)(n,"name"),s=h(this,a,"f")[o];if(!s)throw new T.AzFuncSystemError(`Failed to find binding "${o}" in bindings "${Object.keys(h(this,a,"f")).join(", ")}".`);const u=s.type;let c;if((0,E.isHttpTrigger)(u)&&k.enableHttpStream){const t=yield(0,C.waitForProxyRequest)(h(this,i,"f").invocationId);c=(0,S.createStreamRequest)(t,(0,D.nonNullProp)(e,"triggerMetadata"))}else c=(0,P.fromRpcTypedData)(n.data);(0,E.isTimerTrigger)(u)&&(c=(0,x.toCamelCaseValue)(c)),(0,E.isTrigger)(u)?r.push(c):t.extraInputs.set(o,c)}return{context:t,inputs:r}})}invokeFunction(e,t,r){return d(this,void 0,void 0,function*(){try{return yield Promise.resolve(r(...t,e))}finally{y(this,o,!0,"f")}})}getResponse(e,t){return d(this,void 0,void 0,function*(){const r={invocationId:h(this,i,"f").invocationId,outputData:[]};let o=!1;for(const[i,s]of Object.entries(h(this,a,"f")))if("out"===s.direction)if(i===v.returnBindingKey)r.returnValue=yield h(this,n,"m",c).call(this,e.invocationId,s,t),o=!0;else{const t=yield h(this,n,"m",c).call(this,e.invocationId,s,e.extraOutputs.get(i));(0,D.isDefined)(t)&&r.outputData.push({name:i,data:t})}return o||(0,E.isHttpTrigger)(h(this,u,"f"))||(r.returnValue=(0,j.toRpcTypedData)(t)),r})}},o=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,u=new WeakMap,n=new WeakSet,c=function(e,t,r){var n;return d(this,void 0,void 0,function*(){return"http"===(null===(n=t.type)||void 0===n?void 0:n.toLowerCase())?(0,O.toRpcHttp)(e,r):(0,j.toRpcTypedData)(r)})},l=function(e,t,...r){h(this,i,"f").log(e,t,(0,g.format)(...r))},p=function(e,...t){h(this,n,"m",l).call(this,e,"system",...t)},f=function(e,...t){if(h(this,o,"f")&&"postInvocationHooks"!==h(this,i,"f").state){let e="Warning: Unexpected call to 'log' on the context object after function execution has completed. Please check for asynchronous calls that are not awaited. ";e+=`Function name: ${h(this,s,"f")}. Invocation Id: ${h(this,i,"f").invocationId}.`,h(this,n,"m",p).call(this,"warning",e)}h(this,n,"m",l).call(this,e,"user",...t)}},6693:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addBindingName=void 0;const n=r(4169);t.addBindingName=function(e,t){if(!e.name){let r=e.type;r.toLowerCase().endsWith(t.toLowerCase())||(r+=t),e.name=r+(0,n.getStringHash)(JSON.stringify(e))}return e}},6765:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.log=t.postInvocation=t.preInvocation=t.appTerminate=t.appStart=void 0;const n=r(725),o=r(1898),i=r(3476),s=r(7531),a=r(4586),u=r(5407),c=r(7508),l=r(8561);function p(e,t){const r=(0,i.tryGetCoreApiLazy)();return r?r.registerHook(e,t):(console.warn(`WARNING: Skipping call to register ${e} hook because the "@azure/functions" package is in test mode.`),new o.Disposable(()=>{console.warn(`WARNING: Skipping call to dispose ${e} hook because the "@azure/functions" package is in test mode.`)}))}t.appStart=function(e){return p("appStart",t=>e(new s.AppStartContext(t)))},t.appTerminate=function(e){return p("appTerminate",t=>e(new a.AppTerminateContext(t)))},t.preInvocation=function(e){return p("preInvocation",t=>e(new l.PreInvocationContext(t)))},t.postInvocation=function(e){return p("postInvocation",t=>e(new c.PostInvocationContext(t)))},t.log=function(e){try{return p("log",t=>e(new u.LogHookContext(t)))}catch(e){const t=(0,n.ensureErrorType)(e);throw"RangeError"===t.name&&t.isAzureFunctionsSystemError?new n.AzFuncSystemError("Log hooks require Azure Functions Host v4.34 or higher."):e}}},6921:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.returnBindingKey=t.version=void 0,t.version="4.10.0",t.returnBindingKey="$return"},7175:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeToolProperties=t.isToolProperties=t.convertToolProperties=t.arg=t.ToolPropertyBuilder=void 0;class r{constructor(){this.property={}}get propertyName(){return this.property.propertyName||""}get propertyType(){if(!this.property.propertyType)throw new Error("Property type must be specified (use .string(), .number(), etc.)");return this.property.propertyType}get description(){return this.property.description||""}get isRequired(){var e;return null===(e=this.property.isRequired)||void 0===e||e}get isArray(){var e;return null!==(e=this.property.isArray)&&void 0!==e&&e}string(){return this.property.propertyType="string",this}double(){return this.property.propertyType="number",this}long(){return this.property.propertyType="number",this}number(){return this.property.propertyType="number",this}boolean(){return this.property.propertyType="boolean",this}object(){return this.property.propertyType="object",this}integer(){return this.property.propertyType="integer",this}datetime(){return this.property.propertyType="string",this}describe(e){return this.property.description=e,this}optional(){return this.property.isRequired=!1,this.buildInternal()}asArray(){return this.property.isArray=!0,this}buildInternal(){var e,t;if(!this.property.propertyType)throw new Error("Property type must be specified (use .string(), .number(), etc.)");return{propertyName:"",propertyType:this.property.propertyType,description:this.property.description||"",isRequired:null===(e=this.property.isRequired)||void 0===e||e,isArray:null!==(t=this.property.isArray)&&void 0!==t&&t}}}function n(e){return Object.entries(e).map(([e,t])=>{var r,n;return{propertyName:e,propertyType:t.propertyType,description:t.description||"",isRequired:null===(r=t.isRequired)||void 0===r||r,isArray:null!==(n=t.isArray)&&void 0!==n&&n}})}function o(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&Object.values(e).every(e=>"object"==typeof e&&null!==e&&"propertyType"in e&&"description"in e&&"isRequired"in e&&"isArray"in e)}t.ToolPropertyBuilder=r,t.arg={string:()=>(new r).string(),integer:()=>(new r).integer(),number:()=>(new r).number(),long:()=>(new r).long(),double:()=>(new r).double(),boolean:()=>(new r).boolean(),datetime:()=>(new r).datetime(),object:()=>(new r).object()},t.convertToolProperties=n,t.isToolProperties=o,t.normalizeToolProperties=function(e){if(e){if(Array.isArray(e))return e.forEach((e,t)=>{!function(e,t){const r=t?` for property '${t}'`:"";if(!e.propertyType||""===e.propertyType.trim())throw new Error(`Property type is required${r}`);void 0!==e.description&&null!==e.description||(e.description="")}(e,e.propertyName||`index ${t}`)}),e;if(o(e))return n(e);throw new Error("Invalid tool properties format")}}},7508:function(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.PostInvocationContext=void 0;const s=r(9463);class a extends s.InvocationHookContext{constructor(e){super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f")}get result(){return i(this,n,"f").result}set result(e){i(this,n,"f").result=e}get error(){return i(this,n,"f").error}set error(e){i(this,n,"f").error=e}}t.PostInvocationContext=a,n=new WeakMap},7531:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AppStartContext=void 0;const n=r(5789);class o extends n.HookContext{}t.AppStartContext=o},7866:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRpcHttpCookie=void 0;const n=r(1705);t.toRpcHttpCookie=function(e){let t="none";if(e&&e.sameSite){const r=e.sameSite.toLocaleLowerCase();"lax"===r?t="lax":"strict"===r?t="strict":"none"===r&&(t="explicitNone")}return{name:e&&(0,n.toRpcString)(e.name,"cookie.name"),value:e&&(0,n.toRpcString)(e.value,"cookie.value"),domain:(0,n.toNullableString)(e&&e.domain,"cookie.domain"),path:(0,n.toNullableString)(e&&e.path,"cookie.path"),expires:(0,n.toNullableTimestamp)(e&&e.expires,"cookie.expires"),secure:(0,n.toNullableBool)(e&&e.secure,"cookie.secure"),httpOnly:(0,n.toNullableBool)(e&&e.httpOnly,"cookie.httpOnly"),sameSite:t,maxAge:(0,n.toNullableDouble)(e&&e.maxAge,"cookie.maxAge")}}},7992:function(e,t,r){var n,o,i,s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})},a=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},u=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},c=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamRequest=t.HttpRequest=void 0;const l=r(3978),p=r(9551),f=r(5138),d=r(679),y=r(725),h=r(9168),g=r(8529);class v{constructor(e){var t,r,s;n.set(this,void 0),o.set(this,void 0),i.set(this,void 0),a(this,i,e,"f");let c=e.undiciRequest;if(!c){const n=(0,h.nonNullProp)(e,"url");let o;(null===(t=e.body)||void 0===t?void 0:t.bytes)?o=Buffer.from(null===(r=e.body)||void 0===r?void 0:r.bytes):(null===(s=e.body)||void 0===s?void 0:s.string)&&(o=e.body.string),c=new l.Request(n,{body:o,method:(0,h.nonNullProp)(e,"method"),headers:(0,f.fromNullableMapping)(e.nullableHeaders,e.headers)})}a(this,o,c,"f"),e.nullableQuery||e.query?this.query=new p.URLSearchParams((0,f.fromNullableMapping)(e.nullableQuery,e.query)):this.query=new URL(u(this,o,"f").url).searchParams,this.params=(0,f.fromNullableMapping)(e.nullableParams,e.params)}get url(){return u(this,o,"f").url}get method(){return u(this,o,"f").method}get headers(){return u(this,o,"f").headers}get user(){return void 0===u(this,n,"f")&&a(this,n,(0,g.extractHttpUserFromHeaders)(this.headers),"f"),u(this,n,"f")}get body(){return u(this,o,"f").body}get bodyUsed(){return u(this,o,"f").bodyUsed}arrayBuffer(){return s(this,void 0,void 0,function*(){return u(this,o,"f").arrayBuffer()})}blob(){return s(this,void 0,void 0,function*(){return u(this,o,"f").blob()})}formData(){return s(this,void 0,void 0,function*(){return u(this,o,"f").formData()})}json(){return s(this,void 0,void 0,function*(){return u(this,o,"f").json()})}text(){return s(this,void 0,void 0,function*(){return u(this,o,"f").text()})}clone(){const e=structuredClone(u(this,i,"f"));return e.undiciRequest=u(this,o,"f").clone(),new v(e)}}t.HttpRequest=v,n=new WeakMap,o=new WeakMap,i=new WeakMap,t.createStreamRequest=function(e,t){var r;const n="x-forwarded-host",o="x-forwarded-proto",i=e.headers[n],s=e.headers[o];if("string"!=typeof i||"string"!=typeof s)throw new y.AzFuncSystemError(`Expected headers "${n}" and "${o}" to be set.`);const a=`${s}://${i}${(0,h.nonNullProp)(e,"url")}`;let u;const p=null===(r=e.method)||void 0===r?void 0:r.toLowerCase();"get"!==p&&"head"!==p&&(u=e);const{Query:f,Headers:g}=t,b=c(t,["Query","Headers"]);let m;const w=(0,d.fromRpcTypedData)(g);"object"==typeof w&&(0,h.isDefined)(w)&&(m=w);const P=new l.Request(a,{body:u,duplex:"half",method:(0,h.nonNullProp)(e,"method"),headers:m}),x={};for(const[e,t]of Object.entries(b))(0,h.isDefined)(t.string)&&(x[e]=t.string);return new v({undiciRequest:P,params:x})}},8156:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MySqlChangeOperation=t.SqlChangeOperation=t.arg=t.Disposable=t.trigger=t.output=t.InvocationContext=t.input=t.HttpResponse=t.HttpRequest=t.PreInvocationContext=t.PostInvocationContext=t.LogHookContext=t.InvocationHookContext=t.HookContext=t.AppTerminateContext=t.AppStartContext=t.app=void 0,t.app=r(1859);var n=r(7531);Object.defineProperty(t,"AppStartContext",{enumerable:!0,get:function(){return n.AppStartContext}});var o=r(4586);Object.defineProperty(t,"AppTerminateContext",{enumerable:!0,get:function(){return o.AppTerminateContext}});var i=r(5789);Object.defineProperty(t,"HookContext",{enumerable:!0,get:function(){return i.HookContext}});var s=r(9463);Object.defineProperty(t,"InvocationHookContext",{enumerable:!0,get:function(){return s.InvocationHookContext}});var a=r(5407);Object.defineProperty(t,"LogHookContext",{enumerable:!0,get:function(){return a.LogHookContext}});var u=r(7508);Object.defineProperty(t,"PostInvocationContext",{enumerable:!0,get:function(){return u.PostInvocationContext}});var c=r(8561);Object.defineProperty(t,"PreInvocationContext",{enumerable:!0,get:function(){return c.PreInvocationContext}});var l=r(7992);Object.defineProperty(t,"HttpRequest",{enumerable:!0,get:function(){return l.HttpRequest}});var p=r(8950);Object.defineProperty(t,"HttpResponse",{enumerable:!0,get:function(){return p.HttpResponse}}),t.input=r(4788);var f=r(8157);Object.defineProperty(t,"InvocationContext",{enumerable:!0,get:function(){return f.InvocationContext}}),t.output=r(811),t.trigger=r(2888);var d=r(1898);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return d.Disposable}});var y,h,g=r(7175);Object.defineProperty(t,"arg",{enumerable:!0,get:function(){return g.arg}}),(h=t.SqlChangeOperation||(t.SqlChangeOperation={}))[h.Insert=0]="Insert",h[h.Update=1]="Update",h[h.Delete=2]="Delete",(y=t.MySqlChangeOperation||(t.MySqlChangeOperation={}))[y.Update=0]="Update"},8157:function(e,t,r){var n,o,i,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.InvocationContext=void 0;const u=r(5396);t.InvocationContext=class{constructor(e){var t,r,o,i;n.set(this,void 0),e=e||{};const a="unknown";this.invocationId=e.invocationId||a,this.functionName=e.functionName||a,this.extraInputs=new c,this.extraOutputs=new l,this.retryContext=e.retryContext,this.traceContext=e.traceContext,this.triggerMetadata=e.triggerMetadata,this.options={trigger:(null===(t=e.options)||void 0===t?void 0:t.trigger)||{name:a,type:a},return:null===(r=e.options)||void 0===r?void 0:r.return,extraInputs:(null===(o=e.options)||void 0===o?void 0:o.extraInputs)||[],extraOutputs:(null===(i=e.options)||void 0===i?void 0:i.extraOutputs)||[]},s(this,n,e.logHandler||u.fallbackLogHandler,"f")}log(...e){a(this,n,"f").call(this,"information",...e)}trace(...e){a(this,n,"f").call(this,"trace",...e)}debug(...e){a(this,n,"f").call(this,"debug",...e)}info(...e){a(this,n,"f").call(this,"information",...e)}warn(...e){a(this,n,"f").call(this,"warning",...e)}error(...e){a(this,n,"f").call(this,"error",...e)}},n=new WeakMap;class c{constructor(){o.set(this,{})}get(e){const t="string"==typeof e?e:e.name;return a(this,o,"f")[t]}set(e,t){const r="string"==typeof e?e:e.name;a(this,o,"f")[r]=t}}o=new WeakMap;class l{constructor(){i.set(this,{})}get(e){const t="string"==typeof e?e:e.name;return a(this,i,"f")[t]}set(e,t){const r="string"==typeof e?e:e.name;a(this,i,"f")[r]=t}}i=new WeakMap},8354:e=>{e.exports=require("util")},8360:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRpcDuration=void 0;const n=r(725),o=r(9168);t.toRpcDuration=function(e,t){if((0,o.isDefined)(e)){try{let t;if("object"==typeof e){const r=(e.minutes||0)+60*(e.hours||0),n=(e.seconds||0)+60*r;t=(e.milliseconds||0)+1e3*n}else"number"==typeof e&&(t=e);if((0,o.isDefined)(t)&&t>=0)return{seconds:Math.round(t/1e3)}}catch(e){}throw new n.AzFuncSystemError(`A 'number' or 'Duration' object was expected instead of a '${typeof e}'. Cannot parse value of '${t}'.`)}}},8529:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractHttpUserFromHeaders=void 0;const n=r(9168);t.extractHttpUserFromHeaders=function(e){let t=null;const r=e.get("x-ms-client-principal");if(r){const o=JSON.parse(Buffer.from(r,"base64").toString("utf-8"));t=o.identityProvider?{type:"StaticWebApps",id:o.userId,username:o.userDetails,identityProvider:o.identityProvider,claimsPrincipalData:o}:{type:"AppService",id:(0,n.nonNullValue)(e.get("x-ms-client-principal-id"),"user-id"),username:(0,n.nonNullValue)(e.get("x-ms-client-principal-name"),"user-name"),identityProvider:(0,n.nonNullValue)(e.get("x-ms-client-principal-idp"),"user-idp"),claimsPrincipalData:o}}return t}},8561:function(e,t,r){var n,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.PreInvocationContext=void 0;const s=r(9168),a=r(9463);class u extends a.InvocationHookContext{constructor(e){var t,r;super(e),n.set(this,void 0),o(this,n,null!=e?e:{},"f"),null!==(t=(r=i(this,n,"f")).functionCallback)&&void 0!==t||(r.functionCallback=()=>{})}get functionHandler(){return(0,s.nonNullProp)(i(this,n,"f"),"functionCallback")}set functionHandler(e){i(this,n,"f").functionCallback=e}}t.PreInvocationContext=u,n=new WeakMap},8789:e=>{e.exports=require("@azure/functions-core")},8950:function(e,t,r){var n,o,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}u((n=n.apply(e,t||[])).next())})},s=this&&this.__classPrivateFieldSet||function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable"