UNPKG

21.7 kBJavaScriptView Raw
1(()=>{"use strict";var e={983:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CreateContextAndInputs=void 0;const n=r(251),o=r(345),i=r(240),s=r(300),a=r(979);t.CreateContextAndInputs=function(e,t,r,u){const l=new c(e,t,r,u),d={},p=[];let f;for(const r of t.inputData)if(r.data&&r.name){let t;t=r.data&&r.data.http?f=new s.Request(r.data.http):e.getTimerTriggerName()===r.name?(0,o.convertKeysToCamelCase)(r).data:(0,i.fromTypedData)(r.data),d[r.name]=t,p.push(t)}return l.bindings=d,f&&(l.req=f,l.res=new a.Response(l.done),l.bindingData.sys={methodName:e.name,utcNow:(new Date).toISOString(),randGuid:(0,n.v4)()},l.bindingData.query||(l.bindingData.query=Object.assign({},f.query)),l.bindingData.headers||(l.bindingData.headers=Object.assign({},f.headers))),{context:l,inputs:p}};class c{constructor(e,t,r,n){this.invocationId=t.invocationId,this.traceContext=(0,i.fromRpcTraceContext)(t.traceContext);const s={invocationId:this.invocationId,functionName:e.name,functionDirectory:e.directory,retryContext:t.retryContext};this.executionContext=s,this.bindings={},this.log=Object.assign(((...e)=>r("information",...e)),{error:(...e)=>r("error",...e),warn:(...e)=>r("warning",...e),info:(...e)=>r("information",...e),verbose:(...e)=>r("trace",...e)}),this.bindingData=(0,o.getNormalizedBindingData)(t),this.bindingDefinitions=(0,o.getBindingDefinitions)(e),this.done=(e,t)=>{n.emit("done",e,t)}}}},335:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FunctionInfo=void 0;const n=r(240),o=r(815);t.FunctionInfo=class{constructor(e){if(this.name=e.name,this.directory=e.directory,this.bindings={},this.outputBindings={},this.httpOutputName="",this.hasHttpTrigger=!1,e.bindings){const t=this.bindings=e.bindings;Object.keys(t).filter((e=>"in"!==t[e].direction)).forEach((e=>{const r=t[e].type;r&&"http"===r.toLowerCase()?(this.httpOutputName=e,this.outputBindings[e]=Object.assign(t[e],{converter:o.toRpcHttp})):this.outputBindings[e]=Object.assign(t[e],{converter:n.toTypedData})})),this.hasHttpTrigger=Object.keys(t).filter((e=>{const r=t[e].type;return r&&"httptrigger"===r.toLowerCase()})).length>0}}getReturnBinding(){return this.outputBindings.$return}getTimerTriggerName(){for(const e in this.bindings){const t=this.bindings[e].type;if(t&&"timertrigger"===t.toLowerCase())return e}}}},62:function(e,t,r){var n,o,i,s,a,c,u,l,d,p,f=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},h=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},m=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 y=r(764),g=r(983),v=r(240),b=r(758),w=r(335),T=r(702),x="https://go.microsoft.com/fwlink/?linkid=2097909";t.InvocationModel=class{constructor(e){n.add(this),o.set(this,new T),i.set(this,!1),s.set(this,!1),a.set(this,void 0),c.set(this,void 0),h(this,a,e,"f"),h(this,c,new w.FunctionInfo(e.metadata),"f")}getArguments(){return f(this,void 0,void 0,(function*(){const{context:e,inputs:t}=(0,g.CreateContextAndInputs)(m(this,c,"f"),m(this,a,"f").request,((e,...t)=>m(this,n,"m",d).call(this,e,...t)),m(this,o,"f"));return{context:e,inputs:t}}))}invokeFunction(e,t,r){return f(this,void 0,void 0,(function*(){const a=new Promise(((t,r)=>{m(this,o,"f").on("done",((o,i)=>{m(this,n,"m",p).call(this,e.suppressAsyncDoneError),(0,b.isError)(o)?r(o):t(i)}))}));try{let o,c=r(e,...t);return h(this,s,!!c&&"function"==typeof c.then,"f"),m(this,s,"f")?(c=Promise.resolve(c).then((t=>(m(this,n,"m",p).call(this,e.suppressAsyncDoneError),t))),o=Promise.race([c,a])):o=a,yield o}finally{h(this,i,!0,"f")}}))}getResponse(e,t){var r,n;return f(this,void 0,void 0,(function*(){const o={invocationId:m(this,a,"f").invocationId,outputData:[]},i=m(this,c,"f");i.httpOutputName&&e.res&&void 0===e.bindings[i.httpOutputName]&&(e.bindings[i.httpOutputName]=e.res);const s="activityTrigger"==(null===(n=null===(r=null==i?void 0:i.bindings)||void 0===r?void 0:r.name)||void 0===n?void 0:n.type),u=i.getReturnBinding();return(t||s&&null!=t)&&(u?o.returnValue=u.converter(t):"object"==typeof t&&(o.outputData=Object.keys(i.outputBindings).filter((e=>void 0!==t[e])).map((e=>({name:e,data:i.outputBindings[e].converter(t[e])})))),o.returnValue||0!=o.outputData.length||i.hasHttpTrigger||(o.returnValue=(0,v.toTypedData)(t))),e.bindings&&(o.outputData=o.outputData.concat(Object.keys(i.outputBindings).filter((r=>{const n=void 0!==e.bindings[r],o=!!t&&!u&&"object"==typeof t&&void 0!==t[r];return n&&!o})).map((t=>({name:t,data:i.outputBindings[t].converter(e.bindings[t])}))))),o}))}},o=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,c=new WeakMap,n=new WeakSet,u=function(e,t,...r){m(this,a,"f").log(e,t,y.format.apply(null,r))},l=function(e,...t){m(this,n,"m",u).call(this,e,"system",...t)},d=function(e,...t){if(m(this,i,"f")&&"postInvocationHooks"!==m(this,a,"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 or calls to 'done' made before function execution completes. ";e+=`Function name: ${m(this,c,"f").name}. Invocation Id: ${m(this,a,"f").invocationId}. `,e+=`Learn more: ${x}`,m(this,n,"m",l).call(this,"warning",e)}m(this,n,"m",u).call(this,e,"user",...t)},p=function(e=!1){if(m(this,i,"f")){if(m(this,s,"f")&&e)return;const t=m(this,s,"f")?`Error: Choose either to return a promise or call 'done'. Do not use both in your script. Learn more: ${x}`:"Error: 'done' has already been called. Please check your script for extraneous calls to 'done'.";m(this,n,"m",l).call(this,"error",t)}h(this,i,!0,"f")}},601:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.MediaType=t.HeaderName=t.version=void 0,t.version="3.5.0",(n=t.HeaderName||(t.HeaderName={})).contentType="content-type",n.contentDisposition="content-disposition",(r=t.MediaType||(t.MediaType={})).multipartForm="multipart/form-data",r.multipartPrefix="multipart/",r.urlEncodedForm="application/x-www-form-urlencoded",r.octetStream="application/octet-stream",r.json="application/json"},345:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertKeysToCamelCase=t.getNormalizedBindingData=t.getBindingDefinitions=void 0;const n=r(240);function o(e){const t={};for(const r in e){const i=r.charAt(0).toLocaleLowerCase()+r.slice(1);try{const s=(0,n.fromTypedData)(e[r]),a=void 0===s?e[r]:s;!Array.isArray(a)&&"object"==typeof a&&a&&null==a.http?t[i]=o(a):t[i]=a}catch(n){t[i]=e[r]}}return t}t.getBindingDefinitions=function(e){const t=e.bindings;return t?Object.keys(t).map((e=>({name:e,type:t[e].type||"",direction:t[e].direction||void 0}))):[]},t.getNormalizedBindingData=function(e){const t={invocationId:e.invocationId};return e.triggerMetadata&&Object.assign(t,o(e.triggerMetadata)),t},t.convertKeysToCamelCase=o},240:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toNullableTimestamp=t.toNullableString=t.toRpcString=t.toNullableDouble=t.toNullableBool=t.toTypedData=t.fromRpcTraceContext=t.fromTypedData=void 0;const n=r(470),o=r(758);t.fromTypedData=function(e,t=!0){let r=(e=e||{}).string||e.json;if(void 0!==r){if(t)try{null!=r&&(r=JSON.parse(r))}catch(e){}return r}return e.bytes?Buffer.from(e.bytes):e.collectionBytes&&e.collectionBytes.bytes?e.collectionBytes.bytes.map((e=>Buffer.from(e))):e.collectionString&&e.collectionString.string?e.collectionString.string:e.collectionDouble&&e.collectionDouble.double?e.collectionDouble.double:e.collectionSint64&&e.collectionSint64.sint64?e.collectionSint64.sint64.map((e=>(0,n.isLong)(e)?e.toString():e)):void 0},t.fromRpcTraceContext=function(e){return e?{traceparent:e.traceParent,tracestate:e.traceState,attributes:e.attributes}:{}},t.toTypedData=function(e){return"string"==typeof e?{string:e}:Buffer.isBuffer(e)?{bytes:e}:ArrayBuffer.isView(e)?{bytes:new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}:"number"==typeof e?Number.isInteger(e)?{int:e}:{double:e}:{json:JSON.stringify(e)}},t.toNullableBool=function(e,t){if("boolean"==typeof e)return{value:e};if(null!=e)throw new o.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(e))return{value:parseFloat(e)};if(null!=e)throw new o.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(null!=e)throw new o.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(null!=e)throw new o.AzFuncSystemError(`A 'string' type was expected instead of a '${typeof e}' type. Cannot parse value of '${t}'.`)},t.toNullableTimestamp=function(e,t){if(null!=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 o.AzFuncSystemError(`A 'number' or 'Date' input was expected instead of a '${typeof e}'. Cannot parse value of '${t}'.`)}}},815:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRpcHttpCookieList=t.toRpcHttp=t.fromNullableMapping=t.fromRpcHttpBody=void 0;const n=r(758),o=r(240);function i(e){const t={};if(e)for(const r in e)null!=e[r]&&(t[r]=e[r].toString());return t}function s(e){const t=[];return e.forEach((e=>{t.push(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,o.toRpcString)(e.name,"cookie.name"),value:e&&(0,o.toRpcString)(e.value,"cookie.value"),domain:(0,o.toNullableString)(e&&e.domain,"cookie.domain"),path:(0,o.toNullableString)(e&&e.path,"cookie.path"),expires:(0,o.toNullableTimestamp)(e&&e.expires,"cookie.expires"),secure:(0,o.toNullableBool)(e&&e.secure,"cookie.secure"),httpOnly:(0,o.toNullableBool)(e&&e.httpOnly,"cookie.httpOnly"),sameSite:t,maxAge:(0,o.toNullableDouble)(e&&e.maxAge,"cookie.maxAge")}}(e))})),t}t.fromRpcHttpBody=function(e){return e&&e.bytes?e.bytes.toString():(0,o.fromTypedData)(e,!1)},t.fromNullableMapping=function(e,t){let r={};if(e&&Object.keys(e).length>0)for(const t in e)r[t]=e[t].value||"";else t&&Object.keys(t).length>0&&(r=t);return r},t.toRpcHttp=function(e){if("object"!=typeof e||Array.isArray(e))throw new n.AzFuncSystemError("The HTTP response must be an 'object' type that can include properties such as 'body', 'status', and 'headers'. Learn more: https://go.microsoft.com/fwlink/?linkid=2112563");const t=e||{};let r=t.statusCode;return"function"!=typeof t.status&&(r||(r=t.status)),{http:Object.assign(Object.assign({},t),{statusCode:(null==r?void 0:r.toString())||null,headers:i(t.headers),cookies:s(t.cookies||[]),body:(0,o.toTypedData)(t.body)})}},t.toRpcHttpCookieList=s},758:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isError=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.isError=function(e){return null!=e}},300:function(e,t,r){var n,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)},i=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};Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;const s=r(198),a=r(601),c=r(240),u=r(815),l=r(758),d=r(563),p=r(21);function f(e){let t="utf8";return 254===e[0]&&255===e[1]?(t="utf16be",e=h(e,2)):255===e[0]&&254===e[1]?0!==e[2]||0!==e[3]?(t="utf16le",e=h(e,2)):(t="utf32le",e=h(e,4)):239===e[0]&&187===e[1]&&191===e[2]?(t="utf8",e=h(e,3)):0===e[0]&&0===e[1]&&254===e[2]&&255===e[3]&&(t="utf32be",e=h(e,4)),(0,s.decode)(e,t)}function h(e,t){return e.subarray(t)}t.Request=class{constructor(e){var t,r;if(n.set(this,void 0),this.method=e.method,this.url=e.url,this.originalUrl=e.url,this.headers=(0,u.fromNullableMapping)(e.nullableHeaders,e.headers),this.query=(0,u.fromNullableMapping)(e.nullableQuery,e.query),this.params=(0,u.fromNullableMapping)(e.nullableParams,e.params),null===(t=e.body)||void 0===t?void 0:t.bytes){this.bufferBody=Buffer.from(e.body.bytes);const t=null===(r=this.get(a.HeaderName.contentType))||void 0===r?void 0:r.toLowerCase();let n;n=t===a.MediaType.octetStream||(null==t?void 0:t.startsWith(a.MediaType.multipartPrefix))?e.body:{string:f(this.bufferBody)},this.body=(0,c.fromTypedData)(n),this.rawBody=(0,u.fromRpcHttpBody)(n)}}get user(){return void 0===o(this,n,"f")&&i(this,n,(0,p.extractHttpUserFromHeaders)(this.headers),"f"),o(this,n,"f")}get(e){return this.headers&&this.headers[e.toLowerCase()]}parseFormBody(){const e=this.get(a.HeaderName.contentType);if(e)return(0,d.parseForm)(this.body,e);throw new l.AzFuncSystemError(`"${a.HeaderName.contentType}" header must be defined.`)}},n=new WeakMap},979:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Response=void 0;const n=r(601);t.Response=class{constructor(e){this.headers={},this.cookies=[],this.send=this.end,this.header=this.setHeader,this.set=this.setHeader,this.get=this.getHeader,this._done=e}end(e){return void 0!==e&&(this.body=e),this.setContentType(),this._done(),this}setHeader(e,t){return this.headers[e.toLowerCase()]=t,this}getHeader(e){return this.headers[e.toLowerCase()]}removeHeader(e){return delete this.headers[e.toLowerCase()],this}status(e){return this.statusCode=e,this}sendStatus(e){return this.status(e),this.end()}type(e){return this.set(n.HeaderName.contentType,e)}json(e){this.type(n.MediaType.json),this.send(e)}setContentType(){if(void 0!==this.body){if(this.get(n.HeaderName.contentType))return;Buffer.isBuffer(this.body)&&this.type(n.MediaType.octetStream)}}}},21:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractHttpUserFromHeaders=void 0,t.extractHttpUserFromHeaders=function(e){let t=null;if(e["x-ms-client-principal"]){const r=JSON.parse(Buffer.from(e["x-ms-client-principal"],"base64").toString("utf-8"));t=r.identityProvider?{type:"StaticWebApps",id:r.userId,username:r.userDetails,identityProvider:r.identityProvider,claimsPrincipalData:r}:{type:"AppService",id:e["x-ms-client-principal-id"],username:e["x-ms-client-principal-name"],identityProvider:e["x-ms-client-principal-idp"],claimsPrincipalData:r}}return t}},563: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.Form=t.parseForm=void 0;const s=r(601),a=r(758),c=r(910),u=r(519);t.parseForm=function(e,t){const[r,n]=(0,c.parseContentType)(t);switch(r.toLowerCase()){case s.MediaType.multipartForm:{const t=n.get("boundary"),r=(0,u.parseMultipartForm)("string"==typeof e?Buffer.from(e):e,t);return new l(r)}case s.MediaType.urlEncodedForm:{const t=new URLSearchParams(e.toString()),r=[];for(const[e,n]of t)r.push([e,{value:Buffer.from(n)}]);return new l(r)}default:throw new a.AzFuncSystemError(`Media type "${r}" does not match types supported for form parsing: "${s.MediaType.multipartForm}", "${s.MediaType.urlEncodedForm}".`)}};class l{constructor(e){n.set(this,void 0),o(this,n,e,"f")}get(e){for(const[t,r]of i(this,n,"f"))if(t===e)return r;return null}getAll(e){const t=[];for(const[r,o]of i(this,n,"f"))r===e&&t.push(o);return t}has(e){for(const[t]of i(this,n,"f"))if(t===e)return!0;return!1}[(n=new WeakMap,Symbol.iterator)](){return i(this,n,"f")[Symbol.iterator]()}get length(){return i(this,n,"f").length}}t.Form=l},910:function(e,t,r){var n,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.HeaderParams=t.parseContentDisposition=t.parseContentType=t.getHeaderValue=void 0;const i=r(601),s=r(758),a='[^ \\u0000-\\u001F\\u007F\\(\\)<>@,;:\\\\"\\/\\[\\]\\?\\.=]+',c="\\s*(.*)$",u=`\\s*;?${c}`;function l(e){const t=new d;for(;e;){let r=new RegExp(`^\\s*(${a})=(${a})${u}`,"i").exec(e);if(r||(r=new RegExp(`^\\s*(${a})="((?:[^"\\\\]|\\\\.)*)"${u}`,"i").exec(e)),!r)break;t.add(r[1],r[2].replace(/\\"/g,'"')),e=r[3]}return t}t.getHeaderValue=function(e,t){const r=new RegExp(`^\\s*${t}\\s*:${c}`,"i").exec(e);return r?r[1].trim():null},t.parseContentType=function(e){const t=new RegExp(`^\\s*(${a}\\/${a})${u}`,"i").exec(e);if(t)return[t[1],l(t[2])];throw new s.AzFuncSystemError(`${i.HeaderName.contentType} must begin with format "type/subtype".`)},t.parseContentDisposition=function(e){const t=new RegExp(`^\\s*(${a})${u}`,"i").exec(e);if(t)return[t[1],l(t[2])];throw new s.AzFuncSystemError(`${i.HeaderName.contentDisposition} must begin with disposition type.`)};class d{constructor(){n.set(this,{})}get(e){const t=o(this,n,"f")[e.toLowerCase()];if(void 0===t)throw new s.AzFuncSystemError(`Failed to find parameter with name "${e}".`);return t}has(e){return void 0!==o(this,n,"f")[e.toLowerCase()]}add(e,t){o(this,n,"f")[e.toLowerCase()]=t}}t.HeaderParams=d,n=new WeakMap},519:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseMultipartForm=void 0;const n=r(601),o=r(758),i=r(910),s=Buffer.from("\r")[0],a=Buffer.from("\n")[0];t.parseMultipartForm=function(e,t){const r=[];let c,u,l=!1;const d=Buffer.from(`--${t}`),p=Buffer.from(`--${t}--`);let f=0,h=0,m=0,y=0;for(let g=0;g<e.length;g++){let v;if(e[g]!==a)continue;h=e[g-1]===s?g-1:g,v=e.slice(f,h),f=g+1;const b=v.equals(d),w=v.equals(p);if(b||w){if(u&&(u.value=e.slice(m,y)),w)break;u={value:Buffer.from("")},l=!0}else if(l){if(!u)throw new o.AzFuncSystemError(`Expected form data to start with boundary "${t}".`);const e=v.toString();if(e){const t=(0,i.getHeaderValue)(e,n.HeaderName.contentDisposition);if(t){const[,e]=(0,i.parseContentDisposition)(t);c=e.get("name"),e.has("fileName")&&(u.fileName=e.get("fileName"))}else{const t=(0,i.getHeaderValue)(e,n.HeaderName.contentType);t&&(u.contentType=t)}}else{if(l=!1,!c)throw new o.AzFuncSystemError(`Expected part to have header "${n.HeaderName.contentDisposition}" with parameter "name".`);m=f,y=f,r.push([c,u])}}else y=h}return r}},605:e=>{e.exports=require("@azure/functions-core")},702:e=>{e.exports=require("events")},198:e=>{e.exports=require("iconv-lite")},470:e=>{e.exports=require("long")},764:e=>{e.exports=require("util")},251:e=>{e.exports=require("uuid")}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}var n={};(()=>{var e=n;Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0;const t=r(605),o=r(601),i=r(62);class s{constructor(){this.name="@azure/functions",this.version=o.version}getInvocationModel(e){return new i.InvocationModel(e)}}e.setup=function(){(0,t.setProgrammingModel)(new s)}})(),module.exports=n})();
2//# sourceMappingURL=azure-functions.min.js.map
\No newline at end of file