@activepieces/piece-forms 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -17
- package/src/index.js +34 -20
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/return-response.d.ts +0 -5
- package/src/lib/actions/return-response.d.ts.map +0 -1
- package/src/lib/actions/return-response.js +0 -64
- package/src/lib/actions/return-response.js.map +0 -1
- package/src/lib/triggers/chat-trigger.d.ts +0 -19
- package/src/lib/triggers/chat-trigger.d.ts.map +0 -1
- package/src/lib/triggers/chat-trigger.js +0 -76
- package/src/lib/triggers/chat-trigger.js.map +0 -1
- package/src/lib/triggers/form-trigger.d.ts +0 -23
- package/src/lib/triggers/form-trigger.d.ts.map +0 -1
- package/src/lib/triggers/form-trigger.js +0 -119
- package/src/lib/triggers/form-trigger.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-forms",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.4",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.92.0",
|
|
14
|
-
"http-status-codes": "2.2.0",
|
|
15
|
-
"mime-types": "2.1.35",
|
|
16
|
-
"tslib": "2.6.2"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@types/mime-types": "2.1.1"
|
|
20
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
21
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
1
|
+
"use strict";var Xo=Object.create;var De=Object.defineProperty;var qo=Object.getOwnPropertyDescriptor;var Qo=Object.getOwnPropertyNames;var ei=Object.getPrototypeOf,ti=Object.prototype.hasOwnProperty;var o=(e,t)=>De(e,"name",{value:t,configurable:!0});var re=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},_r=(e,t)=>{for(var r in t)De(e,r,{get:t[r],enumerable:!0})},hr=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Qo(t))!ti.call(e,a)&&a!==r&&De(e,a,{get:()=>t[a],enumerable:!(i=qo(t,a))||i.enumerable});return e};var Te=(e,t,r)=>(r=e!=null?Xo(ei(e)):{},hr(t||!e||!e.__esModule?De(r,"default",{value:e,enumerable:!0}):r,e)),ri=e=>hr(De({},"__esModule",{value:!0}),e);var Vn=re((Zn,xt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},i=new RegExp("^0[0-7]+$","i"),a=new RegExp("^0x[a-f0-9]+$","i"),l="%[0-9a-z]{1,}",d="(?:[0-9a-f]+::?)+",f={zoneIndex:new RegExp(l,"i"),native:new RegExp(`^(::)?(${d})?([0-9a-f]+)?(::)?(${l})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${l})?)$`,"i"),transitional:new RegExp(`^((?:${d})|(?:::)(?:${d})?)${t}\\.${t}\\.${t}\\.${t}(${l})?$`,"i")};function h(s,p){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,_=(s.match(f.zoneIndex)||[])[0],v,L;for(_&&(_=_.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>p)return null;for(L=p-y,v=":";L--;)v+="0:";return s=s.replace("::",v),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),p=(function(){let gr=s.split(":"),yr=[];for(let At=0;At<gr.length;At++)yr.push(parseInt(gr[At],16));return yr})(),{parts:p,zoneId:_}}o(h,"expandIPv6");function x(s,p,y,m){if(s.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,v;for(;m>0;){if(v=y-m,v<0&&(v=0),s[_]>>v!==p[_]>>v)return!1;m-=y,_+=1}return!0}o(x,"matchCIDR");function P(s){if(a.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(i.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function C(s,p){for(;s.length<p;)s=`0${s}`;return s}o(C,"padPart");let E={};E.IPv4=(function(){function s(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<p.length;y++)if(m=p[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(p,y){let m;if(y===void 0&&(m=p,p=m[0],y=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return x(this.octets,p.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,v,L;for(_=3;_>=0;_-=1)if(v=this.octets[_],v in m){if(L=m[v],y&&L!==0)return null;L!==8&&(y=!0),p+=L}else return null;return 32-p},s.prototype.range=function(){return E.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return E.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),E.IPv4.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),y=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),_=[],v=0;for(;v<4;)_.push(parseInt(y[v],10)|parseInt(m[v],10)^255),v++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},E.IPv4.isIPv4=function(s){return this.parser(s)!==null},E.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},E.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},E.IPv4.isValidFourPartDecimal=function(s){return!!(E.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},E.IPv4.isValidCIDRFourPartDecimal=function(s){let p=s.match(/^(.+)\/(\d+)$/);return!E.IPv4.isValidCIDR(s)||!p?!1:E.IPv4.isValidFourPartDecimal(p[1])},E.IPv4.networkAddressFromCIDR=function(s){let p,y,m,_,v;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),v=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),_=[],y=0;y<4;)_.push(parseInt(m[y],10)&parseInt(v[y],10)),y++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},E.IPv4.parse=function(s){let p=this.parser(s);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},E.IPv4.parseCIDR=function(s){let p;if(p=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(p[2]);if(y>=0&&y<=32){let m=[this.parse(p[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},E.IPv4.parser=function(s){let p,y,m;if(p=s.match(r.fourOctet))return(function(){let _=p.slice(1,6),v=[];for(let L=0;L<_.length;L++)y=_[L],v.push(P(y));return v})();if(p=s.match(r.longValue)){if(m=P(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let _=[],v;for(v=0;v<=24;v+=8)_.push(m>>v&255);return _})().reverse()}else return(p=s.match(r.twoOctet))?(function(){let _=p.slice(1,4),v=[];if(m=P(_[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return v.push(P(_[0])),v.push(m>>16&255),v.push(m>>8&255),v.push(m&255),v})():(p=s.match(r.threeOctet))?(function(){let _=p.slice(1,5),v=[];if(m=P(_[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return v.push(P(_[0])),v.push(P(_[1])),v.push(m>>8&255),v.push(m&255),v})():null},E.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)p[y]=255,y++;return m<4&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},E.IPv6=(function(){function s(p,y){let m,_;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(_=this.parts[m],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(p,y){let m;if(y===void 0&&(m=p,p=m[0],y=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return x(this.parts,p.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},_,v;for(let L=7;L>=0;L-=1)if(_=this.parts[L],_ in m){if(v=m[_],y&&v!==0)return null;v!==16&&(y=!0),p+=v}else return null;return 128-p},s.prototype.range=function(){return E.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let p,y=[],m=this.parts;for(let _=0;_<m.length;_++)p=m[_],y.push(p>>8),y.push(p&255);return y},s.prototype.toFixedLengthString=function(){let p=(function(){let m=[];for(let _=0;_<this.parts.length;_++)m.push(C(this.parts[_].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),p+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),y=p[0],m=p[1];return new E.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let p=(function(){let m=[];for(let _=0;_<this.parts.length;_++)m.push(this.parts[_].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),p+y},s.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,_=-1,v;for(;v=p.exec(y);)v[0].length>_&&(m=v.index,_=v[0].length);return _<0?y:`${y.substring(0,m)}::${y.substring(m+_)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),E.IPv6.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),y=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),_=[],v=0;for(;v<16;)_.push(parseInt(y[v],10)|parseInt(m[v],10)^255),v++;return new this(_)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},E.IPv6.isIPv6=function(s){return this.parser(s)!==null},E.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let p=this.parser(s);return new this(p.parts,p.zoneId),!0}catch{return!1}},E.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},E.IPv6.networkAddressFromCIDR=function(s){let p,y,m,_,v;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),v=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),_=[],y=0;y<16;)_.push(parseInt(m[y],10)&parseInt(v[y],10)),y++;return new this(_)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},E.IPv6.parse=function(s){let p=this.parser(s);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},E.IPv6.parseCIDR=function(s){let p,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(p=parseInt(y[2]),p>=0&&p<=128))return m=[this.parse(y[1]),p],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},E.IPv6.parser=function(s){let p,y,m,_,v,L;if(m=s.match(f.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(f.native.test(s))return h(s,8);if((m=s.match(f.transitional))&&(L=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=h(p+L,6),p.parts)){for(v=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<v.length;y++)if(_=v[y],!(0<=_&&_<=255))return null;return p.parts.push(v[0]<<8|v[1]),p.parts.push(v[2]<<8|v[3]),{parts:p.parts,zoneId:p.zoneId}}return null},E.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)p[y]=255,y++;return m<16&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},E.fromByteArray=function(s){let p=s.length;if(p===4)return new E.IPv4(s);if(p===16)return new E.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},E.isValid=function(s){return E.IPv6.isValid(s)||E.IPv4.isValid(s)},E.isValidCIDR=function(s){return E.IPv6.isValidCIDR(s)||E.IPv4.isValidCIDR(s)},E.parse=function(s){if(E.IPv6.isValid(s))return E.IPv6.parse(s);if(E.IPv4.isValid(s))return E.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},E.parseCIDR=function(s){try{return E.IPv6.parseCIDR(s)}catch{try{return E.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},E.process=function(s){let p=this.parse(s);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},E.subnetMatch=function(s,p,y){let m,_,v,L;y==null&&(y="unicast");for(_ in p)if(Object.prototype.hasOwnProperty.call(p,_)){for(v=p[_],v[0]&&!(v[0]instanceof Array)&&(v=[v]),m=0;m<v.length;m++)if(L=v[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return _}return y},typeof xt<"u"&&xt.exports?xt.exports=E:e.ipaddr=E})(Zn)});var dr=re(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.USE_PROXY=c.UNSUPPORTED_MEDIA_TYPE=c.UNPROCESSABLE_ENTITY=c.UNAUTHORIZED=c.TOO_MANY_REQUESTS=c.TEMPORARY_REDIRECT=c.SWITCHING_PROTOCOLS=c.SERVICE_UNAVAILABLE=c.SEE_OTHER=c.RESET_CONTENT=c.REQUESTED_RANGE_NOT_SATISFIABLE=c.REQUEST_URI_TOO_LONG=c.REQUEST_TOO_LONG=c.REQUEST_TIMEOUT=c.REQUEST_HEADER_FIELDS_TOO_LARGE=c.PROXY_AUTHENTICATION_REQUIRED=c.PROCESSING=c.PRECONDITION_REQUIRED=c.PRECONDITION_FAILED=c.PERMANENT_REDIRECT=c.PAYMENT_REQUIRED=c.PARTIAL_CONTENT=c.OK=c.NOT_MODIFIED=c.NOT_IMPLEMENTED=c.NOT_FOUND=c.NOT_ACCEPTABLE=c.NON_AUTHORITATIVE_INFORMATION=c.NO_CONTENT=c.NETWORK_AUTHENTICATION_REQUIRED=c.MULTIPLE_CHOICES=c.MULTI_STATUS=c.MOVED_TEMPORARILY=c.MOVED_PERMANENTLY=c.METHOD_NOT_ALLOWED=c.METHOD_FAILURE=c.LOCKED=c.LENGTH_REQUIRED=c.INTERNAL_SERVER_ERROR=c.INSUFFICIENT_STORAGE=c.INSUFFICIENT_SPACE_ON_RESOURCE=c.IM_A_TEAPOT=c.HTTP_VERSION_NOT_SUPPORTED=c.GONE=c.GATEWAY_TIMEOUT=c.FORBIDDEN=c.FAILED_DEPENDENCY=c.EXPECTATION_FAILED=c.CREATED=c.CONTINUE=c.CONFLICT=c.BAD_REQUEST=c.BAD_GATEWAY=c.ACCEPTED=void 0;c.ACCEPTED=202;c.BAD_GATEWAY=502;c.BAD_REQUEST=400;c.CONFLICT=409;c.CONTINUE=100;c.CREATED=201;c.EXPECTATION_FAILED=417;c.FAILED_DEPENDENCY=424;c.FORBIDDEN=403;c.GATEWAY_TIMEOUT=504;c.GONE=410;c.HTTP_VERSION_NOT_SUPPORTED=505;c.IM_A_TEAPOT=418;c.INSUFFICIENT_SPACE_ON_RESOURCE=419;c.INSUFFICIENT_STORAGE=507;c.INTERNAL_SERVER_ERROR=500;c.LENGTH_REQUIRED=411;c.LOCKED=423;c.METHOD_FAILURE=420;c.METHOD_NOT_ALLOWED=405;c.MOVED_PERMANENTLY=301;c.MOVED_TEMPORARILY=302;c.MULTI_STATUS=207;c.MULTIPLE_CHOICES=300;c.NETWORK_AUTHENTICATION_REQUIRED=511;c.NO_CONTENT=204;c.NON_AUTHORITATIVE_INFORMATION=203;c.NOT_ACCEPTABLE=406;c.NOT_FOUND=404;c.NOT_IMPLEMENTED=501;c.NOT_MODIFIED=304;c.OK=200;c.PARTIAL_CONTENT=206;c.PAYMENT_REQUIRED=402;c.PERMANENT_REDIRECT=308;c.PRECONDITION_FAILED=412;c.PRECONDITION_REQUIRED=428;c.PROCESSING=102;c.PROXY_AUTHENTICATION_REQUIRED=407;c.REQUEST_HEADER_FIELDS_TOO_LARGE=431;c.REQUEST_TIMEOUT=408;c.REQUEST_TOO_LONG=413;c.REQUEST_URI_TOO_LONG=414;c.REQUESTED_RANGE_NOT_SATISFIABLE=416;c.RESET_CONTENT=205;c.SEE_OTHER=303;c.SERVICE_UNAVAILABLE=503;c.SWITCHING_PROTOCOLS=101;c.TEMPORARY_REDIRECT=307;c.TOO_MANY_REQUESTS=429;c.UNAUTHORIZED=401;c.UNPROCESSABLE_ENTITY=422;c.UNSUPPORTED_MEDIA_TYPE=415;c.USE_PROXY=305;c.default={ACCEPTED:c.ACCEPTED,BAD_GATEWAY:c.BAD_GATEWAY,BAD_REQUEST:c.BAD_REQUEST,CONFLICT:c.CONFLICT,CONTINUE:c.CONTINUE,CREATED:c.CREATED,EXPECTATION_FAILED:c.EXPECTATION_FAILED,FORBIDDEN:c.FORBIDDEN,GATEWAY_TIMEOUT:c.GATEWAY_TIMEOUT,GONE:c.GONE,HTTP_VERSION_NOT_SUPPORTED:c.HTTP_VERSION_NOT_SUPPORTED,IM_A_TEAPOT:c.IM_A_TEAPOT,INSUFFICIENT_SPACE_ON_RESOURCE:c.INSUFFICIENT_SPACE_ON_RESOURCE,INSUFFICIENT_STORAGE:c.INSUFFICIENT_STORAGE,INTERNAL_SERVER_ERROR:c.INTERNAL_SERVER_ERROR,LENGTH_REQUIRED:c.LENGTH_REQUIRED,LOCKED:c.LOCKED,METHOD_FAILURE:c.METHOD_FAILURE,METHOD_NOT_ALLOWED:c.METHOD_NOT_ALLOWED,MOVED_PERMANENTLY:c.MOVED_PERMANENTLY,MOVED_TEMPORARILY:c.MOVED_TEMPORARILY,MULTI_STATUS:c.MULTI_STATUS,MULTIPLE_CHOICES:c.MULTIPLE_CHOICES,NETWORK_AUTHENTICATION_REQUIRED:c.NETWORK_AUTHENTICATION_REQUIRED,NO_CONTENT:c.NO_CONTENT,NON_AUTHORITATIVE_INFORMATION:c.NON_AUTHORITATIVE_INFORMATION,NOT_ACCEPTABLE:c.NOT_ACCEPTABLE,NOT_FOUND:c.NOT_FOUND,NOT_IMPLEMENTED:c.NOT_IMPLEMENTED,NOT_MODIFIED:c.NOT_MODIFIED,OK:c.OK,PARTIAL_CONTENT:c.PARTIAL_CONTENT,PAYMENT_REQUIRED:c.PAYMENT_REQUIRED,PERMANENT_REDIRECT:c.PERMANENT_REDIRECT,PRECONDITION_FAILED:c.PRECONDITION_FAILED,PRECONDITION_REQUIRED:c.PRECONDITION_REQUIRED,PROCESSING:c.PROCESSING,PROXY_AUTHENTICATION_REQUIRED:c.PROXY_AUTHENTICATION_REQUIRED,REQUEST_HEADER_FIELDS_TOO_LARGE:c.REQUEST_HEADER_FIELDS_TOO_LARGE,REQUEST_TIMEOUT:c.REQUEST_TIMEOUT,REQUEST_TOO_LONG:c.REQUEST_TOO_LONG,REQUEST_URI_TOO_LONG:c.REQUEST_URI_TOO_LONG,REQUESTED_RANGE_NOT_SATISFIABLE:c.REQUESTED_RANGE_NOT_SATISFIABLE,RESET_CONTENT:c.RESET_CONTENT,SEE_OTHER:c.SEE_OTHER,SERVICE_UNAVAILABLE:c.SERVICE_UNAVAILABLE,SWITCHING_PROTOCOLS:c.SWITCHING_PROTOCOLS,TEMPORARY_REDIRECT:c.TEMPORARY_REDIRECT,TOO_MANY_REQUESTS:c.TOO_MANY_REQUESTS,UNAUTHORIZED:c.UNAUTHORIZED,UNPROCESSABLE_ENTITY:c.UNPROCESSABLE_ENTITY,UNSUPPORTED_MEDIA_TYPE:c.UNSUPPORTED_MEDIA_TYPE,USE_PROXY:c.USE_PROXY}});var Co=re(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.reasonPhraseToStatusCode=Ne.statusCodeToReasonPhrase=void 0;Ne.statusCodeToReasonPhrase={202:"Accepted",502:"Bad Gateway",400:"Bad Request",409:"Conflict",100:"Continue",201:"Created",417:"Expectation Failed",424:"Failed Dependency",403:"Forbidden",504:"Gateway Timeout",410:"Gone",505:"HTTP Version Not Supported",418:"I'm a teapot",419:"Insufficient Space on Resource",507:"Insufficient Storage",500:"Internal Server Error",411:"Length Required",423:"Locked",420:"Method Failure",405:"Method Not Allowed",301:"Moved Permanently",302:"Moved Temporarily",207:"Multi-Status",300:"Multiple Choices",511:"Network Authentication Required",204:"No Content",203:"Non Authoritative Information",406:"Not Acceptable",404:"Not Found",501:"Not Implemented",304:"Not Modified",200:"OK",206:"Partial Content",402:"Payment Required",308:"Permanent Redirect",412:"Precondition Failed",428:"Precondition Required",102:"Processing",407:"Proxy Authentication Required",431:"Request Header Fields Too Large",408:"Request Timeout",413:"Request Entity Too Large",414:"Request-URI Too Long",416:"Requested Range Not Satisfiable",205:"Reset Content",303:"See Other",503:"Service Unavailable",101:"Switching Protocols",307:"Temporary Redirect",429:"Too Many Requests",401:"Unauthorized",451:"Unavailable For Legal Reasons",422:"Unprocessable Entity",415:"Unsupported Media Type",305:"Use Proxy",421:"Misdirected Request"};Ne.reasonPhraseToStatusCode={Accepted:202,"Bad Gateway":502,"Bad Request":400,Conflict:409,Continue:100,Created:201,"Expectation Failed":417,"Failed Dependency":424,Forbidden:403,"Gateway Timeout":504,Gone:410,"HTTP Version Not Supported":505,"I'm a teapot":418,"Insufficient Space on Resource":419,"Insufficient Storage":507,"Internal Server Error":500,"Length Required":411,Locked:423,"Method Failure":420,"Method Not Allowed":405,"Moved Permanently":301,"Moved Temporarily":302,"Multi-Status":207,"Multiple Choices":300,"Network Authentication Required":511,"No Content":204,"Non Authoritative Information":203,"Not Acceptable":406,"Not Found":404,"Not Implemented":501,"Not Modified":304,OK:200,"Partial Content":206,"Payment Required":402,"Permanent Redirect":308,"Precondition Failed":412,"Precondition Required":428,Processing:102,"Proxy Authentication Required":407,"Request Header Fields Too Large":431,"Request Timeout":408,"Request Entity Too Large":413,"Request-URI Too Long":414,"Requested Range Not Satisfiable":416,"Reset Content":205,"See Other":303,"Service Unavailable":503,"Switching Protocols":101,"Temporary Redirect":307,"Too Many Requests":429,Unauthorized:401,"Unavailable For Legal Reasons":451,"Unprocessable Entity":422,"Unsupported Media Type":415,"Use Proxy":305,"Misdirected Request":421}});var mr=re(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.getStatusText=ve.getStatusCode=ve.getReasonPhrase=void 0;var Uo=Co();function Mo(e){var t=Uo.statusCodeToReasonPhrase[e.toString()];if(!t)throw new Error("Status code does not exist: "+e);return t}o(Mo,"getReasonPhrase");ve.getReasonPhrase=Mo;function Os(e){var t=Uo.reasonPhraseToStatusCode[e];if(!t)throw new Error("Reason phrase does not exist: "+e);return t}o(Os,"getStatusCode");ve.getStatusCode=Os;ve.getStatusText=Mo});var Lo=re(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.StatusCodes=void 0;var zs;(function(e){e[e.ACCEPTED=202]="ACCEPTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.CONFLICT=409]="CONFLICT",e[e.CONTINUE=100]="CONTINUE",e[e.CREATED=201]="CREATED",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.GONE=410]="GONE",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.LOCKED=423]="LOCKED",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.OK=200]="OK",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.PROCESSING=102]="PROCESSING",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.USE_PROXY=305]="USE_PROXY",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST"})(zs=Qe.StatusCodes||(Qe.StatusCodes={}))});var jo=re(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ReasonPhrases=void 0;var Rs;(function(e){e.ACCEPTED="Accepted",e.BAD_GATEWAY="Bad Gateway",e.BAD_REQUEST="Bad Request",e.CONFLICT="Conflict",e.CONTINUE="Continue",e.CREATED="Created",e.EXPECTATION_FAILED="Expectation Failed",e.FAILED_DEPENDENCY="Failed Dependency",e.FORBIDDEN="Forbidden",e.GATEWAY_TIMEOUT="Gateway Timeout",e.GONE="Gone",e.HTTP_VERSION_NOT_SUPPORTED="HTTP Version Not Supported",e.IM_A_TEAPOT="I'm a teapot",e.INSUFFICIENT_SPACE_ON_RESOURCE="Insufficient Space on Resource",e.INSUFFICIENT_STORAGE="Insufficient Storage",e.INTERNAL_SERVER_ERROR="Internal Server Error",e.LENGTH_REQUIRED="Length Required",e.LOCKED="Locked",e.METHOD_FAILURE="Method Failure",e.METHOD_NOT_ALLOWED="Method Not Allowed",e.MOVED_PERMANENTLY="Moved Permanently",e.MOVED_TEMPORARILY="Moved Temporarily",e.MULTI_STATUS="Multi-Status",e.MULTIPLE_CHOICES="Multiple Choices",e.NETWORK_AUTHENTICATION_REQUIRED="Network Authentication Required",e.NO_CONTENT="No Content",e.NON_AUTHORITATIVE_INFORMATION="Non Authoritative Information",e.NOT_ACCEPTABLE="Not Acceptable",e.NOT_FOUND="Not Found",e.NOT_IMPLEMENTED="Not Implemented",e.NOT_MODIFIED="Not Modified",e.OK="OK",e.PARTIAL_CONTENT="Partial Content",e.PAYMENT_REQUIRED="Payment Required",e.PERMANENT_REDIRECT="Permanent Redirect",e.PRECONDITION_FAILED="Precondition Failed",e.PRECONDITION_REQUIRED="Precondition Required",e.PROCESSING="Processing",e.PROXY_AUTHENTICATION_REQUIRED="Proxy Authentication Required",e.REQUEST_HEADER_FIELDS_TOO_LARGE="Request Header Fields Too Large",e.REQUEST_TIMEOUT="Request Timeout",e.REQUEST_TOO_LONG="Request Entity Too Large",e.REQUEST_URI_TOO_LONG="Request-URI Too Long",e.REQUESTED_RANGE_NOT_SATISFIABLE="Requested Range Not Satisfiable",e.RESET_CONTENT="Reset Content",e.SEE_OTHER="See Other",e.SERVICE_UNAVAILABLE="Service Unavailable",e.SWITCHING_PROTOCOLS="Switching Protocols",e.TEMPORARY_REDIRECT="Temporary Redirect",e.TOO_MANY_REQUESTS="Too Many Requests",e.UNAUTHORIZED="Unauthorized",e.UNAVAILABLE_FOR_LEGAL_REASONS="Unavailable For Legal Reasons",e.UNPROCESSABLE_ENTITY="Unprocessable Entity",e.UNSUPPORTED_MEDIA_TYPE="Unsupported Media Type",e.USE_PROXY="Use Proxy",e.MISDIRECTED_REQUEST="Misdirected Request"})(Rs=et.ReasonPhrases||(et.ReasonPhrases={}))});var Zo=re(W=>{"use strict";var It=W&&W.__assign||function(){return It=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},It.apply(this,arguments)},Ns=W&&W.__createBinding||(Object.create?(function(e,t,r,i){i===void 0&&(i=r),Object.defineProperty(e,i,{enumerable:!0,get:o(function(){return t[r]},"get")})}):(function(e,t,r,i){i===void 0&&(i=r),e[i]=t[r]})),Ds=W&&W.__exportStar||function(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&Ns(t,e,r)},ks=W&&W.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(W,"__esModule",{value:!0});var ws=ks(dr()),Fo=mr(),fr=mr();Object.defineProperty(W,"getStatusCode",{enumerable:!0,get:o(function(){return fr.getStatusCode},"get")});Object.defineProperty(W,"getReasonPhrase",{enumerable:!0,get:o(function(){return fr.getReasonPhrase},"get")});Object.defineProperty(W,"getStatusText",{enumerable:!0,get:o(function(){return fr.getStatusText},"get")});var Cs=Lo();Object.defineProperty(W,"StatusCodes",{enumerable:!0,get:o(function(){return Cs.StatusCodes},"get")});var Us=jo();Object.defineProperty(W,"ReasonPhrases",{enumerable:!0,get:o(function(){return Us.ReasonPhrases},"get")});Ds(dr(),W);W.default=It(It({},ws.default),{getStatusCode:Fo.getStatusCode,getStatusText:Fo.getStatusText})});var Bo=re((PT,Vo)=>{"use strict";Vo.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Wo=re(Y=>{"use strict";var bt=Bo(),Ms=require("path").extname,Go=/^\s*([^;\s]*)(?:;|\s|$)/,Ls=/^text\//i;Y.charset=Ho;Y.charsets={lookup:Ho};Y.contentType=js;Y.extension=Fs;Y.extensions=Object.create(null);Y.lookup=Zs;Y.types=Object.create(null);Vs(Y.extensions,Y.types);function Ho(e){if(!e||typeof e!="string")return!1;var t=Go.exec(e),r=t&&bt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Ls.test(t[1])?"UTF-8":!1}o(Ho,"charset");function js(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(js,"contentType");function Fs(e){if(!e||typeof e!="string")return!1;var t=Go.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Fs,"extension");function Zs(e){if(!e||typeof e!="string")return!1;var t=Ms("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(Zs,"lookup");function Vs(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(bt).forEach(o(function(a){var l=bt[a],d=l.extensions;if(!(!d||!d.length)){e[a]=d;for(var f=0;f<d.length;f++){var h=d[f];if(t[h]){var x=r.indexOf(bt[t[h]].source),P=r.indexOf(l.source);if(t[h]!=="application/octet-stream"&&(x>P||x===P&&t[h].substr(0,12)==="application/"))continue}t[h]=a}}},"forEachMimeType"))}o(Vs,"populateMaps")});var Gs={};_r(Gs,{forms:()=>Bs});module.exports=ri(Gs);var ni=Object.freeze({status:"aborted"});function T(e,t,r){function i(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,h);let x=d.prototype,P=Object.keys(x);for(let C=0;C<P.length;C++){let E=P[C];E in f||(f[E]=x[E].bind(f))}}o(i,"init");let a=r?.Parent??Object;class l extends a{static{o(this,"Definition")}}Object.defineProperty(l,"name",{value:e});function d(f){var h;let x=r?.Parent?new l:this;i(x,f),(h=x._zod).deferred??(h.deferred=[]);for(let P of x._zod.deferred)P();return x}return o(d,"_"),Object.defineProperty(d,"init",{value:i}),Object.defineProperty(d,Symbol.hasInstance,{value:o(f=>r?.Parent&&f instanceof r.Parent?!0:f?._zod?.traits?.has(e),"value")}),Object.defineProperty(d,"name",{value:e}),d}o(T,"$constructor");var ee=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},tt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},$t={};function ne(e){return e&&Object.assign($t,e),$t}o(ne,"config");function Ot(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,a])=>t.indexOf(+i)===-1).map(([i,a])=>a)}o(Ot,"getEnumValues");function xr(e,t){return typeof t=="bigint"?t.toString():t}o(xr,"jsonStringifyReplacer");function nt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(nt,"cached");function Er(e){return e==null}o(Er,"nullish");function ot(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(ot,"cleanRegex");var vr=Symbol("evaluating");function B(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==vr)return i===void 0&&(i=vr,i=r()),i},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}o(B,"defineLazy");var zt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ke,"isObject");var oi=nt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pr(e){if(ke(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ke(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Pr,"isPlainObject");var Tr=new Set(["string","number","symbol"]);function Ie(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ie,"escapeRegex");function it(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}o(it,"clone");function j(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(j,"normalizeParams");function Ir(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Ir,"optionalKeys");var br={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function be(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(be,"aborted");function le(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}o(le,"prefixIssues");function rt(e){return typeof e=="string"?e:e?.message}o(rt,"unwrapMessage");function pe(e,t,r){let i={...e,path:e.path??[]};if(!e.message){let a=rt(e.inst?._zod.def?.error?.(e))??rt(t?.error?.(e))??rt(r.customError?.(e))??rt(r.localeError?.(e))??"Invalid input";i.message=a}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}o(pe,"finalizeIssue");function Ar(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Ar,"getLengthableOrigin");function Rt(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}o(Rt,"issue");var $r=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,xr,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Sr=T("$ZodError",$r),we=T("$ZodError",$r,{Parent:Error});var ai=o(e=>(t,r,i,a)=>{let l=i?Object.assign(i,{async:!1}):{async:!1},d=t._zod.run({value:r,issues:[]},l);if(d instanceof Promise)throw new ee;if(d.issues.length){let f=new(a?.Err??e)(d.issues.map(h=>pe(h,l,ne())));throw zt(f,a?.callee),f}return d.value},"_parse"),at=ai(we),si=o(e=>async(t,r,i,a)=>{let l=i?Object.assign(i,{async:!0}):{async:!0},d=t._zod.run({value:r,issues:[]},l);if(d instanceof Promise&&(d=await d),d.issues.length){let f=new(a?.Err??e)(d.issues.map(h=>pe(h,l,ne())));throw zt(f,a?.callee),f}return d.value},"_parseAsync"),st=si(we),ui=o(e=>(t,r,i)=>{let a=i?{...i,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},a);if(l instanceof Promise)throw new ee;return l.issues.length?{success:!1,error:new(e??Sr)(l.issues.map(d=>pe(d,a,ne())))}:{success:!0,data:l.value}},"_safeParse"),Ce=ui(we),ci=o(e=>async(t,r,i)=>{let a=i?Object.assign(i,{async:!0}):{async:!0},l=t._zod.run({value:r,issues:[]},a);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(d=>pe(d,a,ne())))}:{success:!0,data:l.value}},"_safeParseAsync"),Ue=ci(we);var li="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",pi=new RegExp(`^${li}$`);var Or=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),zr=/^-?\d+n?$/,Rr=/^-?\d+$/,Nt=/^-?\d+(?:\.\d+)?$/,Nr=/^(?:true|false)$/i;var de=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),di={number:"number",bigint:"bigint",object:"date"};var Dr=T("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let r=di[typeof t.value];e._zod.onattach.push(i=>{let a=i._zod.bag,l=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>l&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var kr=T("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[a,l]=br[t.format];e._zod.onattach.push(d=>{let f=d._zod.bag;f.format=t.format,f.minimum=a,f.maximum=l,r&&(f.pattern=Rr)}),e._zod.check=d=>{let f=d.value;if(r){if(!Number.isInteger(f)){d.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}f<a&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),f>l&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:l,inclusive:!0,inst:e,continue:!t.abort})}});var wr=T("$ZodCheckMinLength",(e,t)=>{var r;de.init(e,t),(r=e._zod.def).when??(r.when=i=>{let a=i.value;return!Er(a)&&a.length!==void 0}),e._zod.onattach.push(i=>{let a=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let a=i.value;if(a.length>=t.minimum)return;let d=Ar(a);i.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}});var Dt=T("$ZodCheckStringFormat",(e,t)=>{var r,i;de.init(e,t),e._zod.onattach.push(a=>{let l=a._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Cr=T("$ZodCheckRegex",(e,t)=>{Dt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Mr={major:4,minor:3,patch:6};var Z=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mr;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let a of i)for(let l of a._zod.onattach)l(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let a=o((d,f,h)=>{let x=be(d),P;for(let C of f){if(C._zod.def.when){if(!C._zod.def.when(d))continue}else if(x)continue;let E=d.issues.length,s=C._zod.check(d);if(s instanceof Promise&&h?.async===!1)throw new ee;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,d.issues.length!==E&&(x||(x=be(d,E)))});else{if(d.issues.length===E)continue;x||(x=be(d,E))}}return P?P.then(()=>d):d},"runChecks"),l=o((d,f,h)=>{if(be(d))return d.aborted=!0,d;let x=a(f,i,h);if(x instanceof Promise){if(h.async===!1)throw new ee;return x.then(P=>e._zod.parse(P,h))}return e._zod.parse(x,h)},"handleCanaryResult");e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){let x=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return x instanceof Promise?x.then(P=>l(P,d,f)):l(x,d,f)}let h=e._zod.parse(d,f);if(h instanceof Promise){if(f.async===!1)throw new ee;return h.then(x=>a(x,i,f))}return a(h,i,f)}}B(e,"~standard",()=>({validate:o(a=>{try{let l=Ce(e,a);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return Ue(e,a).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},"validate"),vendor:"zod",version:1}))}),lt=T("$ZodString",(e,t)=>{Z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Or(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),kt=T("$ZodStringFormat",(e,t)=>{Dt.init(e,t),lt.init(e,t)});var Vr=T("$ZodURL",(e,t)=>{kt.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),a=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=a.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var wt=T("$ZodNumber",(e,t)=>{Z.init(e,t),e._zod.pattern=e._zod.bag.pattern??Nt,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let a=r.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return r;let l=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...l?{received:l}:{}}),r}}),Br=T("$ZodNumberFormat",(e,t)=>{kr.init(e,t),wt.init(e,t)}),Ct=T("$ZodBoolean",(e,t)=>{Z.init(e,t),e._zod.pattern=Nr,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let a=r.value;return typeof a=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),Gr=T("$ZodBigInt",(e,t)=>{Z.init(e,t),e._zod.pattern=zr,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Hr=T("$ZodAny",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r}),Wr=T("$ZodUnknown",(e,t)=>{Z.init(e,t),e._zod.parse=r=>r});var Kr=T("$ZodVoid",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{let a=r.value;return typeof a>"u"||r.issues.push({expected:"void",code:"invalid_type",input:a,inst:e}),r}}),Yr=T("$ZodDate",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let a=r.value,l=a instanceof Date;return l&&!Number.isNaN(a.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:a,...l?{received:"Invalid Date"}:{},inst:e}),r}});function Lr(e,t,r){e.issues.length&&t.issues.push(...le(r,e.issues)),t.value[r]=e.value}o(Lr,"handleArrayResult");var Jr=T("$ZodArray",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);let l=[];for(let d=0;d<a.length;d++){let f=a[d],h=t.element._zod.run({value:f,issues:[]},i);h instanceof Promise?l.push(h.then(x=>Lr(x,r,d))):Lr(h,r,d)}return l.length?Promise.all(l).then(()=>r):r}});function ct(e,t,r,i,a){if(e.issues.length){if(a&&!(r in i))return;t.issues.push(...le(r,e.issues))}e.value===void 0?r in i&&(t.value[r]=void 0):t.value[r]=e.value}o(ct,"handlePropertyResult");function mi(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Ir(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(mi,"normalizeDef");function fi(e,t,r,i,a,l){let d=[],f=a.keySet,h=a.catchall._zod,x=h.def.type,P=h.optout==="optional";for(let C in t){if(f.has(C))continue;if(x==="never"){d.push(C);continue}let E=h.run({value:t[C],issues:[]},i);E instanceof Promise?e.push(E.then(s=>ct(s,r,C,t,P))):ct(E,r,C,t,P)}return d.length&&r.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:l}),e.length?Promise.all(e).then(()=>r):r}o(fi,"handleCatchall");var Xr=T("$ZodObject",(e,t)=>{if(Z.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let f=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let h={...f};return Object.defineProperty(t,"shape",{value:h}),h},"get")})}let i=nt(()=>mi(t));B(e._zod,"propValues",()=>{let f=t.shape,h={};for(let x in f){let P=f[x]._zod;if(P.values){h[x]??(h[x]=new Set);for(let C of P.values)h[x].add(C)}}return h});let a=ke,l=t.catchall,d;e._zod.parse=(f,h)=>{d??(d=i.value);let x=f.value;if(!a(x))return f.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),f;f.value={};let P=[],C=d.shape;for(let E of d.keys){let s=C[E],p=s._zod.optout==="optional",y=s._zod.run({value:x[E],issues:[]},h);y instanceof Promise?P.push(y.then(m=>ct(m,f,E,x,p))):ct(y,f,E,x,p)}return l?fi(P,x,f,h,i.value,e):P.length?Promise.all(P).then(()=>f):f}});function jr(e,t,r,i){for(let l of e)if(l.issues.length===0)return t.value=l.value,t;let a=e.filter(l=>!be(l));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(l=>l.issues.map(d=>pe(d,i,ne())))}),t)}o(jr,"handleUnionResults");var Ut=T("$ZodUnion",(e,t)=>{Z.init(e,t),B(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),B(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),B(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),B(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){let a=t.options.map(l=>l._zod.pattern);return new RegExp(`^(${a.map(l=>ot(l.source)).join("|")})$`)}});let r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(a,l)=>{if(r)return i(a,l);let d=!1,f=[];for(let h of t.options){let x=h._zod.run({value:a.value,issues:[]},l);if(x instanceof Promise)f.push(x),d=!0;else{if(x.issues.length===0)return x;f.push(x)}}return d?Promise.all(f).then(h=>jr(h,a,e,l)):jr(f,a,e,l)}});var qr=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ut.init(e,t);let r=e._zod.parse;B(e._zod,"propValues",()=>{let a={};for(let l of t.options){let d=l._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(let[f,h]of Object.entries(d)){a[f]||(a[f]=new Set);for(let x of h)a[f].add(x)}}return a});let i=nt(()=>{let a=t.options,l=new Map;for(let d of a){let f=d._zod.propValues?.[t.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(d)}"`);for(let h of f){if(l.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);l.set(h,d)}}return l});e._zod.parse=(a,l)=>{let d=a.value;if(!ke(d))return a.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),a;let f=i.value.get(d?.[t.discriminator]);return f?f._zod.run(a,l):t.unionFallback?r(a,l):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:d,path:[t.discriminator],inst:e}),a)}});var Qr=T("$ZodRecord",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{let a=r.value;if(!Pr(a))return r.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),r;let l=[],d=t.keyType._zod.values;if(d){r.value={};let f=new Set;for(let x of d)if(typeof x=="string"||typeof x=="number"||typeof x=="symbol"){f.add(typeof x=="number"?x.toString():x);let P=t.valueType._zod.run({value:a[x],issues:[]},i);P instanceof Promise?l.push(P.then(C=>{C.issues.length&&r.issues.push(...le(x,C.issues)),r.value[x]=C.value})):(P.issues.length&&r.issues.push(...le(x,P.issues)),r.value[x]=P.value)}let h;for(let x in a)f.has(x)||(h=h??[],h.push(x));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:h})}else{r.value={};for(let f of Reflect.ownKeys(a)){if(f==="__proto__")continue;let h=t.keyType._zod.run({value:f,issues:[]},i);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Nt.test(f)&&h.issues.length){let C=t.keyType._zod.run({value:Number(f),issues:[]},i);if(C instanceof Promise)throw new Error("Async schemas not supported in object keys currently");C.issues.length===0&&(h=C)}if(h.issues.length){t.mode==="loose"?r.value[f]=a[f]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(C=>pe(C,i,ne())),input:f,path:[f],inst:e});continue}let P=t.valueType._zod.run({value:a[f],issues:[]},i);P instanceof Promise?l.push(P.then(C=>{C.issues.length&&r.issues.push(...le(f,C.issues)),r.value[h.value]=C.value})):(P.issues.length&&r.issues.push(...le(f,P.issues)),r.value[h.value]=P.value)}}return l.length?Promise.all(l).then(()=>r):r}});var en=T("$ZodEnum",(e,t)=>{Z.init(e,t);let r=Ot(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(a=>Tr.has(typeof a)).map(a=>typeof a=="string"?Ie(a):a.toString()).join("|")})$`),e._zod.parse=(a,l)=>{let d=a.value;return i.has(d)||a.issues.push({code:"invalid_value",values:r,input:d,inst:e}),a}}),tn=T("$ZodLiteral",(e,t)=>{if(Z.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Ie(i):i?Ie(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,a)=>{let l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:t.values,input:l,inst:e}),i}});var rn=T("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new tt(e.constructor.name);let a=t.transform(r.value,r);if(i.async)return(a instanceof Promise?a:Promise.resolve(a)).then(d=>(r.value=d,r));if(a instanceof Promise)throw new ee;return r.value=a,r}});function Fr(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Fr,"handleOptionalResult");var nn=T("$ZodOptional",(e,t)=>{Z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",B(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),B(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ot(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){let a=t.innerType._zod.run(r,i);return a instanceof Promise?a.then(l=>Fr(l,r.value)):Fr(a,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}});var on=T("$ZodNullable",(e,t)=>{Z.init(e,t),B(e._zod,"optin",()=>t.innerType._zod.optin),B(e._zod,"optout",()=>t.innerType._zod.optout),B(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ot(r.source)}|null)$`):void 0}),B(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)});var an=T("$ZodPipe",(e,t)=>{Z.init(e,t),B(e._zod,"values",()=>t.in._zod.values),B(e._zod,"optin",()=>t.in._zod.optin),B(e._zod,"optout",()=>t.out._zod.optout),B(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let l=t.out._zod.run(r,i);return l instanceof Promise?l.then(d=>ut(d,t.in,i)):ut(l,t.in,i)}let a=t.in._zod.run(r,i);return a instanceof Promise?a.then(l=>ut(l,t.out,i)):ut(a,t.out,i)}});function ut(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(ut,"handlePipeResult");var sn=T("$ZodCustom",(e,t)=>{de.init(e,t),Z.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,a=t.fn(i);if(a instanceof Promise)return a.then(l=>Zr(l,r,i,e));Zr(a,r,i,e)}});function Zr(e,t,r,i){if(!e){let a={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(a.params=i._zod.def.params),t.issues.push(Rt(a))}}o(Zr,"handleRefineResult");var cn;var Mt=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let a={...i,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ln(){return new Mt}o(ln,"registry");(cn=globalThis).__zod_globalRegistry??(cn.__zod_globalRegistry=ln());var Lt=globalThis.__zod_globalRegistry;function pn(e,t){return new e({type:"string",...j(t)})}o(pn,"_string");function dn(e,t){return new e({type:"string",coerce:!0,...j(t)})}o(dn,"_coercedString");function mn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...j(t)})}o(mn,"_url");function fn(e,t){return new e({type:"number",checks:[],...j(t)})}o(fn,"_number");function gn(e,t){return new e({type:"number",coerce:!0,checks:[],...j(t)})}o(gn,"_coercedNumber");function yn(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...j(t)})}o(yn,"_int");function _n(e,t){return new e({type:"boolean",...j(t)})}o(_n,"_boolean");function hn(e,t){return new e({type:"boolean",coerce:!0,...j(t)})}o(hn,"_coercedBoolean");function vn(e,t){return new e({type:"bigint",coerce:!0,...j(t)})}o(vn,"_coercedBigint");function xn(e){return new e({type:"any"})}o(xn,"_any");function En(e){return new e({type:"unknown"})}o(En,"_unknown");function Pn(e,t){return new e({type:"void",...j(t)})}o(Pn,"_void");function Tn(e,t){return new e({type:"date",coerce:!0,...j(t)})}o(Tn,"_coercedDate");function pt(e,t){return new Dr({check:"greater_than",...j(t),value:e,inclusive:!0})}o(pt,"_gte");function Q(e,t){return new wr({check:"min_length",...j(t),minimum:e})}o(Q,"_minLength");function me(e,t){return new Cr({check:"string_format",format:"regex",...j(t),pattern:e})}o(me,"_regex");function In(e,t,r){let i=j(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}o(In,"_custom");var G=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");Z.init(e,t),e.def=t,e.type=t.type,e.parse=(r,i)=>at(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>Ce(e,r,i),e.parseAsync=async(r,i)=>st(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>Ue(e,r,i),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]},{parent:!0}),e.with=e.check,e.clone=(r,i)=>it(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.apply=r=>r(e)}),mt=T("ZodMiniString",(e,t)=>{lt.init(e,t),G.init(e,t)});function n(e){return pn(mt,e)}o(n,"string");var bn=T("ZodMiniStringFormat",(e,t)=>{kt.init(e,t),mt.init(e,t)});var $i=T("ZodMiniURL",(e,t)=>{Vr.init(e,t),bn.init(e,t)});function An(e){return mn($i,e)}o(An,"url");var ft=T("ZodMiniNumber",(e,t)=>{wt.init(e,t),G.init(e,t)});function K(e){return fn(ft,e)}o(K,"number");var Si=T("ZodMiniNumberFormat",(e,t)=>{Br.init(e,t),ft.init(e,t)});function $n(e){return yn(Si,e)}o($n,"int");var jt=T("ZodMiniBoolean",(e,t)=>{Ct.init(e,t),G.init(e,t)});function M(e){return _n(jt,e)}o(M,"boolean");var Sn=T("ZodMiniBigInt",(e,t)=>{Gr.init(e,t),G.init(e,t)});var Oi=T("ZodMiniAny",(e,t)=>{Hr.init(e,t),G.init(e,t)});function Le(){return xn(Oi)}o(Le,"any");var zi=T("ZodMiniUnknown",(e,t)=>{Wr.init(e,t),G.init(e,t)});function O(){return En(zi)}o(O,"unknown");var Ri=T("ZodMiniVoid",(e,t)=>{Kr.init(e,t),G.init(e,t)});function On(e){return Pn(Ri,e)}o(On,"_void");var zn=T("ZodMiniDate",(e,t)=>{Yr.init(e,t),G.init(e,t)});var Ni=T("ZodMiniArray",(e,t)=>{Jr.init(e,t),G.init(e,t)});function N(e,t){return new Ni({type:"array",element:e,...j(t)})}o(N,"array");var Di=T("ZodMiniObject",(e,t)=>{Xr.init(e,t),G.init(e,t),B(e,"shape",()=>t.shape)});function u(e,t){let r={type:"object",shape:e??{},...j(t)};return new Di(r)}o(u,"object");var ki=T("ZodMiniUnion",(e,t)=>{Ut.init(e,t),G.init(e,t)});function D(e,t){return new ki({type:"union",options:e,...j(t)})}o(D,"union");var wi=T("ZodMiniDiscriminatedUnion",(e,t)=>{qr.init(e,t),G.init(e,t)});function fe(e,t,r){return new wi({type:"union",options:t,discriminator:e,...j(r)})}o(fe,"discriminatedUnion");var Ci=T("ZodMiniRecord",(e,t)=>{Qr.init(e,t),G.init(e,t)});function z(e,t,r){return new Ci({type:"record",keyType:e,valueType:t,...j(r)})}o(z,"record");var Ui=T("ZodMiniEnum",(e,t)=>{en.init(e,t),G.init(e,t),e.options=Object.values(t.entries)});function w(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Ui({type:"enum",entries:r,...j(t)})}o(w,"_enum");var Mi=T("ZodMiniLiteral",(e,t)=>{tn.init(e,t),G.init(e,t)});function b(e,t){return new Mi({type:"literal",values:Array.isArray(e)?e:[e],...j(t)})}o(b,"literal");var Li=T("ZodMiniTransform",(e,t)=>{rn.init(e,t),G.init(e,t)});function ge(e){return new Li({type:"transform",transform:e})}o(ge,"transform");var ji=T("ZodMiniOptional",(e,t)=>{nn.init(e,t),G.init(e,t)});function g(e){return new ji({type:"optional",innerType:e})}o(g,"optional");var Fi=T("ZodMiniNullable",(e,t)=>{on.init(e,t),G.init(e,t)});function je(e){return new Fi({type:"nullable",innerType:e})}o(je,"nullable");var Zi=T("ZodMiniPipe",(e,t)=>{an.init(e,t),G.init(e,t)});function ye(e,t){return new Zi({type:"pipe",in:e,out:t})}o(ye,"pipe");var Vi=T("ZodMiniCustom",(e,t)=>{sn.init(e,t),G.init(e,t)});function gt(e,t){return In(Vi,e??(()=>!0),t)}o(gt,"custom");var Fe={};_r(Fe,{bigint:()=>Yi,boolean:()=>Ki,date:()=>Ji,number:()=>Wi,string:()=>Hi});function Hi(e){return dn(mt,e)}o(Hi,"string");function Wi(e){return gn(ft,e)}o(Wi,"number");function Ki(e){return hn(jt,e)}o(Ki,"boolean");function Yi(e){return vn(Sn,e)}o(Yi,"bigint");function Ji(e){return Tn(zn,e)}o(Ji,"date");var Zt=u({retryOnFailure:u({defaultValue:g(M()),hide:g(M())}),continueOnFailure:u({defaultValue:g(M()),hide:g(M())})}),Ft=class{constructor(t,r,i,a,l,d,f,h,x,P,C){this.name=t;this.displayName=r;this.description=i;this.props=a;this.run=l;this.test=d;this.requireAuth=f;this.errorHandlingOptions=h;this.outputSchema=x;this.audience=P;this.aiMetadata=C}static{o(this,"IAction")}},Nn=o(e=>new Ft(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var U=u({displayName:n(),description:g(n())}),k=o((e,t)=>u({type:b(t),required:M(),defaultValue:g(Le())}),"TPropertyValue");var J=u({...U.shape,...k(n(),"SHORT_TEXT").shape}),oe=u({...U.shape,...k(n(),"LONG_TEXT").shape});var Dn=u({label:n(),value:O()}),yt=u({disabled:g(M()),placeholder:g(n()),options:N(Dn)});var X=u({...U.shape,options:yt,...k(O(),"STATIC_DROPDOWN").shape}),ie=u({...U.shape,options:yt,...k(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Vt=u({...U.shape,...k(O(),"DROPDOWN").shape,refreshers:N(n())}),Ze=u({...U.shape,...k(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(n())});var ae=u({...U.shape,...k(M(),"CHECKBOX").shape});var se=u({...U.shape,...k(K(),"NUMBER").shape});var Ve=u({...U.shape,...k(O(),"FILE").shape});var Be=u({...U.shape,...k(n(),"DATE_TIME").shape});var kn=z(n(),D([J,oe,X,Ze,ie,ae,se,Ve,Be])),Ge=u({...U.shape,properties:kn,...k(N(O()),"ARRAY").shape});var He=u({...U.shape,...k(D([z(n(),O())]),"JSON").shape});var wn=D([J,X,He,Ge,ie]),qi=z(n(),wn),Bt=u({refreshers:N(n()),...U.shape,...k(O(),"DYNAMIC").shape});var _t=u({...U.shape,...k(On(),"MARKDOWN").shape});var We=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(We||{}),Ae=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ae||{}),$e=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))($e||{});var Ke=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ke||{}),Gt="both_client_credentials_and_authorization_code";var ue=(a=>(a.POLLING="POLLING",a.WEBHOOK="WEBHOOK",a.APP_WEBHOOK="APP_WEBHOOK",a.MANUAL="MANUAL",a))(ue||{}),Ye=(l=>(l.NONE="NONE",l.HEADER_PRESENT="HEADER_PRESENT",l.QUERY_PRESENT="QUERY_PRESENT",l.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",l.HEAD_REQUEST="HEAD_REQUEST",l))(Ye||{}),Qi=u({strategy:w(Ye),paramName:g(n())}),Je=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Je||{});var ht=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ht||{}),Cn=u({status:g(K()),body:g(O()),headers:g(z(n(),n()))}),Un=u({type:b("DELAY"),resumeDateTime:n(),requestIdToReply:g(n()),handlerId:g(n()),streamStepProgress:g(w(ht))}),Mn=u({type:b("WEBHOOK"),requestId:n(),requestIdToReply:g(n()),response:Cn,handlerId:g(n()),streamStepProgress:g(w(ht))}),ea=D([Un,Mn]);var ta=u({body:O(),rawBody:g(O()),headers:z(n(),n()),queryParams:z(n(),n())});function _e(e){return e==null}o(_e,"isNil");var Ht=Te(require("crypto"),1);var ra=128,xe,Se,na=o(e=>{!xe||xe.length<e?(xe=Buffer.allocUnsafe(e*ra),Ht.default.randomFillSync(xe),Se=0):Se+e>xe.length&&(Ht.default.randomFillSync(xe),Se=0),Se+=e},"fillPool"),oa=o(e=>(na(e|=0),xe.subarray(Se-e,Se)),"random"),ia=o((e,t,r)=>{let i=(2<<31-Math.clz32(e.length-1|1))-1,a=Math.ceil(1.6*i*t/e.length);return(l=t)=>{let d="";for(;;){let f=r(a),h=a;for(;h--;)if(d+=e[f[h]&i]||"",d.length===l)return d}}},"customRandom"),jn=o((e,t=21)=>ia(e,t,oa),"customAlphabet");var aa="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fn=21,A_=n().check(me(new RegExp(`^[0-9a-zA-Z]{${Fn}}$`))),sa=jn(aa,Fn);var he=ye(ge(e=>e instanceof Date?e.toISOString():e),n()),q={id:n(),created:he,updated:he},F=o(e=>g(je(e)),"Nullable");function Wt(e){return g(je(w(e)))}o(Wt,"NullableEnum");var O_=ye(ge(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(M())),vt=o(e=>ye(ge(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(N(e))),"OptionalArrayFromQuery");var N_=z(n(),O());var Xe=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(Xe||{});var B_=n().check(me(/^#[0-9A-Fa-f]{6}$/));var H_=u({filename:n(),data:O(),type:b("file"),mimetype:g(n())});var ua=Te(Vn());var Q_=u({...q,name:n(),permissions:N(n()),platformId:F(n()),type:n(),userCount:g(K())});var Bn=(i=>(i.AGENT_DECIDE="agent-decide",i.CHOOSE_YOURSELF="choose-yourself",i.LEAVE_EMPTY="leave-empty",i))(Bn||{}),Kt=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Kt||{}),Yt=(i=>(i.SSE="sse",i.STREAMABLE_HTTP="streamable-http",i.SIMPLE_HTTP="http",i))(Yt||{});var Jt=(i=>(i.TEXT="text",i.NUMBER="number",i.BOOLEAN="boolean",i))(Jt||{});var Xt=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Xt||{});var ca=u({mode:w(Bn),value:O()}),la=u({auth:g(n()),fields:z(n(),ca)}),pa=u({pieceName:n(),pieceVersion:n(),actionName:n(),predefinedInput:g(la)}),da=u({type:b("PIECE"),toolName:n().check(Q(1)),pieceMetadata:pa}),ma=u({type:b("none")}),fa=u({type:b("access_token"),accessToken:n()}),ga=u({type:b("api_key"),apiKey:n(),apiKeyHeader:n()}),ya=u({type:b("headers"),headers:z(n(),n())}),_a=fe("type",[ma,fa,ga,ya]),Gn=u({type:b("FLOW"),toolName:n().check(Q(1)),externalFlowId:n(),flowDisplayName:g(n())}),Hn=u({type:b("MCP"),toolName:n().check(Q(1)),serverUrl:An(),protocol:w(Yt),auth:_a}),Wn=u({type:b("KNOWLEDGE_BASE"),toolName:n().check(Q(1)),sourceType:w(Kt),sourceId:n(),sourceName:n()}),ha=fe("type",[da,Gn,Hn,Wn]),va=u({displayName:n(),description:g(n()),type:w(Jt)}),Kn=u({type:b("MARKDOWN"),markdown:n()}),Oe={type:b("TOOL_CALL"),input:F(z(n(),O())),output:g(O()),toolName:n(),status:w(Xt),toolCallId:n(),startTime:n(),endTime:g(n())},Ah=u(Oe),Yn=fe("toolCallType",[u({...Oe,toolCallType:b("PIECE"),pieceName:n(),pieceVersion:n(),actionName:n()}),u({...Oe,toolCallType:b("FLOW"),displayName:n(),externalFlowId:n()}),u({...Oe,toolCallType:b("MCP"),displayName:n(),serverUrl:n()}),u({...Oe,toolCallType:b("KNOWLEDGE_BASE"),displayName:n(),sourceType:n()}),u({...Oe,toolCallType:b("UNKNOWN"),displayName:n()})]),xa=D([Kn,Yn]);var qt=(r=>(r.IMAGE="image",r.TEXT="text",r))(qt||{}),ce=u({apiKey:n()}),Ea=ce,Pa=u({apiKey:n(),apiKeyHash:n()}),Ta=ce,Ia=ce,ba=ce,Aa=ce,$a=ce,Sa=ce,Oa=ce,Jn=u({accessKeyId:n().check(Q(1)),secretAccessKey:n().check(Q(1))}),za=u({}),Ra=u({}),Na=u({}),Da=u({}),ka=u({}),wa=u({}),Xn=u({modelId:n(),modelName:n(),modelType:w(qt)}),qn=u({apiKeyHeader:n(),baseUrl:n(),models:N(Xn),defaultHeaders:g(z(n(),n()))}),Qn=u({accountId:n(),gatewayId:n(),models:N(Xn),vertexProject:g(n()),vertexRegion:g(n())}),eo=u({resourceName:n(),apiVersion:ye(ge(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(n()))}),to=u({region:n().check(Q(1))}),Ca=D([Ea,ba,Aa,$a,Sa,Ia,Ta,Pa,Jn,Oa]),ro=D([qn,Qn,eo,to,za,Na,Da,ka,Ra,wa]),Ua=u({id:n(),name:n(),type:w(qt)}),Ma=u({id:n(),name:n(),provider:w(Xe),config:ro,enabledForChat:M()}),La=u({provider:w(Xe),config:ro,auth:Ca,platformId:n()});var zh={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var ja=u({base64Url:n(),fileName:n(),extension:g(n())}),Fa=u({mimeType:n(),url:n(),fileName:g(n())}),Qt=D([ja,Fa]);function er(e){return e.toLowerCase().replace(/\s+(\w)/g,(r,i)=>i.toUpperCase()).replace(/^(.)/,r=>r.toLowerCase()).replaceAll(/[\\"''\n\r\t]/g,"")}o(er,"createKeyForFormInput");var Za=D([u({type:b("file"),value:Qt}),u({type:b("markdown"),value:n(),files:g(N(Qt))})]),Va=u({sessionId:n(),message:n(),files:g(N(n()))});var oo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(oo||{}),io=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(io||{}),tr=(i=>(i.RECORD_CREATED="RECORD_CREATED",i.RECORD_UPDATED="RECORD_UPDATED",i.RECORD_DELETED="RECORD_DELETED",i))(tr||{});var Ba=D([u({...q,name:n(),externalId:n(),type:b("STATIC_DROPDOWN"),tableId:n(),projectId:n(),data:u({options:N(u({value:n()}))})}),u({...q,name:n(),externalId:n(),type:D([b("TEXT"),b("NUMBER"),b("DATE")]),tableId:n(),projectId:n()})]),Ga=u({...q,name:n(),folderId:F(n()),projectId:n(),externalId:n(),status:Wt(io),trigger:Wt(oo)}),Ha=u({...q,tableId:n(),projectId:n(),cells:z(n(),u({updated:n(),created:n(),value:O(),fieldName:n()}))}),Wa=u({events:N(w(tr)),webhookUrl:n(),flowId:n()}),Ka=u({fields:N(u({id:n(),name:n()})),rows:N(z(n(),n())),name:n()}),Ya=u({projectId:n(),limit:g(Fe.number()),cursor:g(n()),name:g(n()),externalIds:vt(n()),folderId:g(n()),folderIds:vt(n())}),Ja=u({records:N(N(u({fieldId:n(),value:so()}))),tableId:n()}),Xa=u({cells:g(N(u({fieldId:n(),value:so()}))),tableId:n(),agentUpdate:g(M())}),ao=fe("operator",[Ee("eq"),Ee("neq"),Ee("gt"),Ee("gte"),Ee("lt"),Ee("lte"),Ee("co"),no("exists"),no("not_exists")]),qa=u({tableId:n(),limit:g(Fe.number()),cursor:g(n()),filters:vt(ao)});function so(){return ye(ge(e=>e==null?e:String(e)),je(n()))}o(so,"coerceToString");function Ee(e){return u({fieldId:n(),operator:b(e),value:n()})}o(Ee,"valueFilter");function no(e){return u({fieldId:n(),operator:b(e)})}o(no,"existenceFilter");var Qa=u({status:g(K()),body:g(O()),headers:g(z(n(),n()))}),es=u({...q,deleted:F(he),ownerId:n(),displayName:n(),platformId:n(),externalId:F(n())}),rr="useDraft";var uo=u({name:n(),description:g(n()),type:n(),required:M()}),ts=u({pieceName:n(),triggerName:n(),input:u({toolName:n(),toolDescription:n(),inputSchema:N(uo),returnsResponse:M()})});var co="^[0-9]+\\.[0-9]+\\.[0-9]+$",Yh=new RegExp(co),ns="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",Jh=n().check(me(new RegExp(co))),Xh=n().check(me(new RegExp(ns))),os=u({packageType:b("ARCHIVE"),pieceType:w(Ae),pieceName:n(),pieceVersion:n(),archiveId:n(),platformId:n()}),lo=u({packageType:b("REGISTRY"),pieceType:b("OFFICIAL"),pieceName:n(),pieceVersion:n()}),po=u({packageType:b("REGISTRY"),pieceType:b("CUSTOM"),pieceName:n(),pieceVersion:n(),platformId:n()}),qh=D([lo,po]),Qh=D([os,lo,po]);var is=fe("type",[u({type:b("CRON_EXPRESSION"),cronExpression:n(),timezone:n()}),u({type:b("INTERVAL"),intervalMs:$n().check(pt(6e4))})]),ev=u({...q,type:w(ue),projectId:n(),flowId:n(),triggerName:n(),schedule:F(is),flowVersionId:n(),pieceName:n(),pieceVersion:n(),deleted:F(n()),simulate:M()}),mo=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(mo||{}),fo=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(fo||{}),go=(r=>(r.S3="S3",r.DB="DB",r))(go||{}),tv=u({...q,projectId:F(n()),platformId:F(n()),type:w(mo),compression:w(fo),data:g(O()),location:w(go),size:F(K()),fileName:F(n()),s3Key:F(n()),metadata:F(z(n(),n()))}),yo=(i=>(i.ADMIN="ADMIN",i.MEMBER="MEMBER",i.OPERATOR="OPERATOR",i))(yo||{}),_o=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_o||{}),rv=u({id:n(),email:n(),firstName:n(),status:w(_o),externalId:F(n()),platformId:F(n()),platformRole:w(yo),lastName:n(),created:he,updated:he,lastActiveDate:F(he),imageUrl:F(n())});var nr=u({...U.shape,...k(z(n(),O()),"OBJECT").shape});var xo=u({...U.shape,...k(n(),"COLOR").shape});var or=D([J,oe,_t,ae,X,ie,Vt,Ze,Bt,se,Ge,nr,He,Be,Ve,xo]),H={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var te=u({displayName:n(),description:g(n())});var Eo=u({username:n(),password:n()}),ir=u({...te.shape,username:u({displayName:n(),description:g(n())}),password:u({displayName:n(),description:g(n())}),...k(Eo,"BASIC_AUTH").shape});var cs=z(n(),D([J,oe,se,ae,X])),ar=u({...te.shape,props:cs,...k(O(),"CUSTOM_AUTH").shape});var Pe=u({...te.shape,...k(u({auth:n()}),"SECRET_TEXT").shape});var ls=z(n(),D([J,oe,Pe,se,ae,X,ie,_t])),Po=u({...te.shape,props:ls,...k(O(),"OIDC").shape});var sr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(sr||{}),To=D([J,Pe,X]),Io=z(n(),To),ps=u({props:g(z(n(),To)),authUrl:n(),tokenUrl:n(),scope:N(n()),prompt:g(D([b("none"),b("consent"),b("login"),b("omit")])),pkce:g(M()),pkceMethod:g(D([b("plain"),b("S256")])),authorizationMethod:g(w(sr)),grantType:g(D([w(Ke),b(Gt)])),extra:g(z(n(),n()))}),bo=u({access_token:n(),props:g(Io),data:z(n(),Le())}),ur=u({...te.shape,...ps.shape,...k(bo,"OAUTH2").shape});var ze=D([ir,ar,Po,ur,Pe]),qe="Connection",cr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||qe}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||qe,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||qe}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||qe}},None(){}};var kx={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var ds=u({...U.shape,...k(O(),"CUSTOM").shape,code:n()});var fs=D([or,ze]),lr=z(n(),fs),eE=z(n(),or);var Ao=D([u({strategy:b("CRON"),cronExpression:n()}),u({strategy:b("NONE")})]),Re=class{constructor(t,r,i,a,l,d,f,h,x,P,C,E,s,p,y,m,_,v,L){this.name=t;this.displayName=r;this.description=i;this.requireAuth=a;this.props=l;this.type=d;this.handshakeConfiguration=f;this.onHandshake=h;this.renewConfiguration=x;this.onRenew=P;this.onEnable=C;this.onDisable=E;this.onStart=s;this.run=p;this.test=y;this.sampleData=m;this.testStrategy=_;this.outputSchema=v;this.aiMetadata=L}static{o(this,"ITrigger")}},Pt=o(e=>{switch(e.type){case"WEBHOOK":return new Re(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Re(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Re(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Re(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,_e(e.sampleData)&&_e(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var $o="2",Tt="0.82.0";var pr=class{constructor(t,r,i,a,l,d,f,h,x=Tt,P,C="",E){this.displayName=t;this.logoUrl=r;this.authors=i;this.events=a;this.categories=f;this.auth=h;this.minimumSupportedRelease=x;this.maximumSupportedRelease=P;this.description=C;this.deprecated=E;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:$o}),"getContextInfo");(!gs(x)||ys(x,Tt))&&(this.minimumSupportedRelease=Tt),l.forEach(s=>this._actions[s.name]=s),d.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},So=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,i,a)=>i===a.findIndex(l=>l.type===r.type)))throw new Error("Auth properties must be unique by type");return new pr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function gs(e){return/^\d+\.\d+\.\d+$/.test(e)}o(gs,"isValidSimpleSemver");function ys(e,t){let[r,i,a]=e.split(".").map(Number),[l,d,f]=t.split(".").map(Number);return r!==l?r<l:i!==d?i<d:a<f}o(ys,"isSemverLessThan");var _s=g(z(n(),z(n(),n()))),Oo=u({id:g(n()),name:n(),displayName:n(),logoUrl:n(),description:n(),authors:N(n()),platformId:g(n()),directoryPath:g(n()),auth:g(D([ze,N(ze)])),version:n(),categories:g(N(w($e))),minimumSupportedRelease:g(n()),maximumSupportedRelease:g(n()),deprecated:g(M()),i18n:_s}),hs=w(["human","ai","both"]),zo=u({description:g(n()),idempotent:g(M())}),Ro=u({name:n(),displayName:n(),description:n(),props:lr,requireAuth:M(),errorHandlingOptions:g(Zt),outputSchema:g(gt()),audience:g(hs),aiMetadata:g(zo)}),No=u({name:n(),displayName:n(),description:n(),props:lr,errorHandlingOptions:g(Zt),type:w(ue),sampleData:O(),handshakeConfiguration:g(gt()),renewConfiguration:g(Ao),testStrategy:w(Je),outputSchema:g(gt()),aiMetadata:g(zo)}),vs=u({...Oo.shape,actions:z(n(),Ro),triggers:z(n(),No)}),xs=u({...Oo.shape,actions:K(),triggers:K(),suggestedActions:g(N(Ro)),suggestedTriggers:g(N(No))}),Do=u({projectUsage:K(),pieceType:w(Ae),packageType:w(We),platformId:g(n()),archiveId:g(n())}),eP=u({...vs.shape,...Do.shape}),tP=u({...xs.shape,...Do.shape}),rP=u({name:n(),version:n()});var Es=Te(require("path")),Ps=Te(require("fs/promises"));var Is=`
|
|
2
|
+
This trigger sets up a chat interface. Ensure that **Respond on UI** is used in your flow`,bs=`
|
|
3
|
+
**Published Chat URL:**
|
|
4
|
+
\`\`\`text
|
|
5
|
+
{{chatUrl}}
|
|
6
|
+
\`\`\`
|
|
7
|
+
Use this for production, views the published version of the chat flow.
|
|
8
|
+
<br>
|
|
9
|
+
<br>
|
|
10
|
+
`,ko=Pt({name:"chat_submission",displayName:"Chat UI",description:"Trigger the flow by sending a message",props:{about:H.MarkDown({value:bs,variant:"BORDERLESS"}),responseMarkdown:H.MarkDown({value:Is,variant:"WARNING"}),botName:H.ShortText({displayName:"Bot Name",description:"The name of the chatbot",required:!0,defaultValue:"AI Bot"})},sampleData:void 0,type:"WEBHOOK",async onEnable(){},async onDisable(){},async run(e){let t=e.payload.body;if(!t.chatId)throw new Error("Chat ID is required");if(!t.message)throw new Error("Message is required");let r=Object.entries(t).filter(([a])=>a.startsWith("file")).map(([a,l])=>[Number(a.split("[")[1].split("]")[0]),l]).sort(([a],[l])=>a-l).map(([a,l])=>l);return[{sessionId:t.chatId,message:t.message,files:r}]}});var As=`**Published Form URL:**
|
|
11
|
+
\`\`\`text
|
|
12
|
+
{{formUrl}}
|
|
13
|
+
\`\`\`
|
|
14
|
+
Use this for production, views the published version of the form.
|
|
15
|
+
<br>
|
|
16
|
+
<br>
|
|
17
|
+
**Draft Form URL:**
|
|
18
|
+
\`\`\`text
|
|
19
|
+
{{formUrl}}?${rr}=true
|
|
20
|
+
\`\`\`
|
|
21
|
+
Use this to generate sample data, views the draft version of the form (the one you are editing now).
|
|
22
|
+
`,$s=`
|
|
23
|
+
If **Wait for Response** is enabled, use **Respond on UI** in your flow to provide a response back to the form.
|
|
24
|
+
`,Ss=o((e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){let r=e.toLowerCase();if(r==="true"||r==="false")return r==="true"}throw new Error(`Field ${t} must be a boolean or 'true'/'false' string`)},"parseBoolean"),wo=Pt({name:"form_submission",displayName:"Web Form",description:"Trigger the flow by submitting a form.",props:{about:H.MarkDown({value:As,variant:"BORDERLESS"}),response:H.MarkDown({value:$s,variant:"WARNING"}),waitForResponse:H.Checkbox({displayName:"Wait for Response",defaultValue:!1,required:!0}),inputs:H.Array({displayName:"Inputs",required:!0,properties:{displayName:H.ShortText({displayName:"Field Name",required:!0}),type:H.StaticDropdown({displayName:"Field Type",required:!0,options:{options:[{value:"text",label:"Text"},{value:"text_area",label:"Text Area"},{value:"file",label:"File"},{value:"toggle",label:"Toggle"}]}}),description:H.ShortText({displayName:"Field Description",required:!1}),required:H.Checkbox({displayName:"Required",required:!0})}})},sampleData:{},type:"WEBHOOK",async onEnable(){},async onDisable(){},async run(e){let t=e.payload.body,r=e.propsValue.inputs,i={};for(let a of r){let l=er(a.displayName),d=t[l];switch(a.type){case"toggle":i[l]=Ss(d,a.displayName);break;case"text":case"text_area":case"file":i[l]=d;break}}return[i]}});var Ko=Te(Zo()),Yo=Te(Wo()),Jo=Nn({audience:"human",name:"return_response",displayName:"Respond on UI",description:"Return a file or text (markdown) as a response.",props:{markdown:H.LongText({displayName:"Text (Markdown)",required:!1}),file:H.File({displayName:"Attachment",required:!1})},errorHandlingOptions:{retryOnFailure:{hide:!0},continueOnFailure:{hide:!0}},async run({propsValue:e,run:t,files:r}){let i=[];if(e.file){let l=e.file.filename,d=e.file.base64,f=Yo.default.lookup(l);i.push({url:await r.write({fileName:l,data:Buffer.from(d,"base64")}),mimeType:f||""})}let a={type:"markdown",value:e.markdown??"",files:i};return t.respond({response:{status:Ko.StatusCodes.OK,body:a,headers:{}}}),a}});var Bs=So({displayName:"Human Input",description:"Trigger a flow through human input.",auth:cr.None(),minimumSupportedRelease:"0.65.0",categories:["CORE"],logoUrl:"https://cdn.activepieces.com/pieces/new-core/human-input.svg",authors:["anasbarg","MoShizzle","abuaboud"],actions:[Jo],triggers:[wo,ko]});0&&(module.exports={forms});
|
|
25
|
+
/*! Bundled license information:
|
|
26
|
+
|
|
27
|
+
mime-types/index.js:
|
|
28
|
+
(*!
|
|
29
|
+
* mime-types
|
|
30
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
31
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
32
|
+
* MIT Licensed
|
|
33
|
+
*)
|
|
34
|
+
*/
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK,2DAUhB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,iDAAqD;AACrD,8DAA+D;AAC/D,8DAA+D;AAC/D,mEAA+D;AAElD,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,qCAAqC;IAClD,IAAI,EAAE,4BAAS,CAAC,IAAI,EAAE;IACtB,uBAAuB,EAAE,QAAQ;IACjC,UAAU,EAAE,CAAC,sBAAa,CAAC,IAAI,CAAC;IAChC,OAAO,EAAE,8DAA8D;IACvE,OAAO,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC;IAC9C,OAAO,EAAE,CAAC,gCAAc,CAAC;IACzB,QAAQ,EAAE,CAAC,+BAAgB,EAAE,+BAAgB,CAAC;CAC/C,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const returnResponse: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
markdown: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
3
|
-
file: import("@activepieces/pieces-framework").FileProperty<false>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=return-response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"return-response.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/return-response.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;EAoDzB,CAAC"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.returnResponse = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const http_status_codes_1 = require("http-status-codes");
|
|
8
|
-
const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
|
|
9
|
-
exports.returnResponse = (0, pieces_framework_1.createAction)({
|
|
10
|
-
audience: 'human',
|
|
11
|
-
name: 'return_response',
|
|
12
|
-
displayName: 'Respond on UI',
|
|
13
|
-
description: 'Return a file or text (markdown) as a response.',
|
|
14
|
-
props: {
|
|
15
|
-
markdown: pieces_framework_1.Property.LongText({
|
|
16
|
-
displayName: 'Text (Markdown)',
|
|
17
|
-
required: false,
|
|
18
|
-
}),
|
|
19
|
-
file: pieces_framework_1.Property.File({
|
|
20
|
-
displayName: 'Attachment',
|
|
21
|
-
required: false,
|
|
22
|
-
}),
|
|
23
|
-
},
|
|
24
|
-
errorHandlingOptions: {
|
|
25
|
-
retryOnFailure: {
|
|
26
|
-
hide: true,
|
|
27
|
-
},
|
|
28
|
-
continueOnFailure: {
|
|
29
|
-
hide: true,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
run(_a) {
|
|
33
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, run, files }) {
|
|
34
|
-
var _b;
|
|
35
|
-
const responseFiles = [];
|
|
36
|
-
if (propsValue.file) {
|
|
37
|
-
const fileName = propsValue.file.filename;
|
|
38
|
-
const fileBase64 = propsValue.file.base64;
|
|
39
|
-
const mimeType = mime_types_1.default.lookup(fileName);
|
|
40
|
-
responseFiles.push({
|
|
41
|
-
url: yield files.write({
|
|
42
|
-
fileName,
|
|
43
|
-
data: Buffer.from(fileBase64, 'base64'),
|
|
44
|
-
}),
|
|
45
|
-
mimeType: mimeType || '',
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
const markdownResponseBody = {
|
|
49
|
-
type: shared_1.HumanInputFormResultTypes.MARKDOWN,
|
|
50
|
-
value: (_b = propsValue.markdown) !== null && _b !== void 0 ? _b : '',
|
|
51
|
-
files: responseFiles,
|
|
52
|
-
};
|
|
53
|
-
run.respond({
|
|
54
|
-
response: {
|
|
55
|
-
status: http_status_codes_1.StatusCodes.OK,
|
|
56
|
-
body: markdownResponseBody,
|
|
57
|
-
headers: {},
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
return markdownResponseBody;
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
//# sourceMappingURL=return-response.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"return-response.js","sourceRoot":"","sources":["../../../../src/lib/actions/return-response.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,iDAA8G;AAC9G,yDAAgD;AAChD,oEAA8B;AAEjB,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,oBAAoB,EAAE;QACpB,cAAc,EAAE;YACd,IAAI,EAAE,IAAI;SACX;QACD,iBAAiB,EAAE;YACjB,IAAI,EAAE,IAAI;SACX;KACF;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE;;YAClC,MAAM,aAAa,GAA4B,EAAE,CAAA;YACjD,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;gBACpB,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC1C,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC1C,MAAM,QAAQ,GAAG,oBAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACvC,aAAa,CAAC,IAAI,CAAC;oBACjB,GAAG,EAAE,MAAM,KAAK,CAAC,KAAK,CAAC;wBACrB,QAAQ;wBACR,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;qBACxC,CAAC;oBACF,QAAQ,EAAE,QAAQ,IAAI,EAAE;iBACzB,CAAC,CAAC;YACL,CAAC;YACD,MAAM,oBAAoB,GAAyB;gBACjD,IAAI,EAAE,kCAAyB,CAAC,QAAQ;gBACxC,KAAK,EAAE,MAAA,UAAU,CAAC,QAAQ,mCAAI,EAAE;gBAChC,KAAK,EAAE,aAAa;aACrB,CAAA;YACD,GAAG,CAAC,OAAO,CAAC;gBACV,QAAQ,EAAE;oBACR,MAAM,EAAE,+BAAW,CAAC,EAAE;oBACtB,IAAI,EAAE,oBAAoB;oBAC1B,OAAO,EAAE,EAAE;iBACZ;aAEF,CAAC,CAAC;YACH,OAAO,oBAAoB,CAAC;QAC9B,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const onChatSubmission: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
3
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
-
responseMarkdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
5
|
-
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
7
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
8
|
-
responseMarkdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
9
|
-
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
11
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
12
|
-
responseMarkdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
13
|
-
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
15
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
16
|
-
responseMarkdown: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
17
|
-
botName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
-
}>;
|
|
19
|
-
//# sourceMappingURL=chat-trigger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-trigger.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/chat-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAoBxC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;EAoD3B,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.onChatSubmission = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const responseMarkdown = `
|
|
8
|
-
This trigger sets up a chat interface. Ensure that **Respond on UI** is used in your flow`;
|
|
9
|
-
const markdown = `
|
|
10
|
-
**Published Chat URL:**
|
|
11
|
-
\`\`\`text
|
|
12
|
-
{{chatUrl}}
|
|
13
|
-
\`\`\`
|
|
14
|
-
Use this for production, views the published version of the chat flow.
|
|
15
|
-
<br>
|
|
16
|
-
<br>
|
|
17
|
-
`;
|
|
18
|
-
exports.onChatSubmission = (0, pieces_framework_1.createTrigger)({
|
|
19
|
-
name: 'chat_submission',
|
|
20
|
-
displayName: 'Chat UI',
|
|
21
|
-
description: 'Trigger the flow by sending a message',
|
|
22
|
-
props: {
|
|
23
|
-
about: pieces_framework_1.Property.MarkDown({
|
|
24
|
-
value: markdown,
|
|
25
|
-
variant: shared_1.MarkdownVariant.BORDERLESS,
|
|
26
|
-
}),
|
|
27
|
-
responseMarkdown: pieces_framework_1.Property.MarkDown({
|
|
28
|
-
value: responseMarkdown,
|
|
29
|
-
variant: shared_1.MarkdownVariant.WARNING,
|
|
30
|
-
}),
|
|
31
|
-
botName: pieces_framework_1.Property.ShortText({
|
|
32
|
-
displayName: 'Bot Name',
|
|
33
|
-
description: 'The name of the chatbot',
|
|
34
|
-
required: true,
|
|
35
|
-
defaultValue: 'AI Bot',
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
sampleData: undefined,
|
|
39
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
40
|
-
onEnable() {
|
|
41
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
return;
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
onDisable() {
|
|
46
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
return;
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
run(ctx) {
|
|
51
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
const item = ctx.payload.body;
|
|
53
|
-
if (!item.chatId) {
|
|
54
|
-
throw new Error('Chat ID is required');
|
|
55
|
-
}
|
|
56
|
-
if (!item.message) {
|
|
57
|
-
throw new Error('Message is required');
|
|
58
|
-
}
|
|
59
|
-
const files = Object.entries(item)
|
|
60
|
-
.filter(([key]) => key.startsWith('file'))
|
|
61
|
-
.map(([key, value]) => {
|
|
62
|
-
const index = Number(key.split('[')[1].split(']')[0]);
|
|
63
|
-
return [index, value];
|
|
64
|
-
})
|
|
65
|
-
.sort(([indexA], [indexB]) => indexA - indexB)
|
|
66
|
-
.map(([_, value]) => value);
|
|
67
|
-
const response = {
|
|
68
|
-
sessionId: item.chatId,
|
|
69
|
-
message: item.message,
|
|
70
|
-
files,
|
|
71
|
-
};
|
|
72
|
-
return [response];
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
//# sourceMappingURL=chat-trigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-trigger.js","sourceRoot":"","sources":["../../../../src/lib/triggers/chat-trigger.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,iDAI8B;AAE9B,MAAM,gBAAgB,GAAG;0FACiE,CAAC;AAE3F,MAAM,QAAQ,GAAG;;;;;;;;CAQhB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,uCAAuC;IACpD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,wBAAe,CAAC,UAAU;SACpC,CAAC;QACF,gBAAgB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAClC,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,wBAAe,CAAC,OAAO;SACjC,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,QAAQ;SACvB,CAAC;KACH;IACD,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ;;YACZ,OAAO;QACT,CAAC;KAAA;IACK,SAAS;;YACb,OAAO;QACT,CAAC;KAAA;IACK,GAAG,CAAC,GAAG;;YACX,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,IAA6C,CAAC;YACvE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACzC,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACzC,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;iBAC/B,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;iBACzC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACpB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtD,OAAO,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC;YACjC,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;iBAC7C,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;YAE9B,MAAM,QAAQ,GAAqB;gBACjC,SAAS,EAAE,IAAI,CAAC,MAAM;gBACtB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK;aACN,CAAA;YACD,OAAO,CAAC,QAAQ,CAAC,CAAC;QACpB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const onFormSubmission: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
3
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
4
|
-
response: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
5
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
6
|
-
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
7
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
8
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
9
|
-
response: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
11
|
-
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
12
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
13
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
14
|
-
response: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
15
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
16
|
-
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
17
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").PieceAuthProperty | undefined, {
|
|
18
|
-
about: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
19
|
-
response: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
20
|
-
waitForResponse: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
21
|
-
inputs: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
22
|
-
}>;
|
|
23
|
-
//# sourceMappingURL=form-trigger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form-trigger.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/form-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AA6CxC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;EAgF3B,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.onFormSubmission = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const markdown = `**Published Form URL:**
|
|
8
|
-
\`\`\`text
|
|
9
|
-
{{formUrl}}
|
|
10
|
-
\`\`\`
|
|
11
|
-
Use this for production, views the published version of the form.
|
|
12
|
-
<br>
|
|
13
|
-
<br>
|
|
14
|
-
**Draft Form URL:**
|
|
15
|
-
\`\`\`text
|
|
16
|
-
{{formUrl}}?${shared_1.USE_DRAFT_QUERY_PARAM_NAME}=true
|
|
17
|
-
\`\`\`
|
|
18
|
-
Use this to generate sample data, views the draft version of the form (the one you are editing now).
|
|
19
|
-
`;
|
|
20
|
-
const responseMarkdown = `
|
|
21
|
-
If **Wait for Response** is enabled, use **Respond on UI** in your flow to provide a response back to the form.
|
|
22
|
-
`;
|
|
23
|
-
const parseBoolean = (value, fieldName) => {
|
|
24
|
-
if (typeof value === 'boolean') {
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
if (typeof value === 'string') {
|
|
28
|
-
const lowerValue = value.toLowerCase();
|
|
29
|
-
if (lowerValue === 'true' || lowerValue === 'false') {
|
|
30
|
-
return lowerValue === 'true';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
throw new Error(`Field ${fieldName} must be a boolean or 'true'/'false' string`);
|
|
34
|
-
};
|
|
35
|
-
exports.onFormSubmission = (0, pieces_framework_1.createTrigger)({
|
|
36
|
-
name: 'form_submission',
|
|
37
|
-
displayName: 'Web Form',
|
|
38
|
-
description: 'Trigger the flow by submitting a form.',
|
|
39
|
-
props: {
|
|
40
|
-
about: pieces_framework_1.Property.MarkDown({
|
|
41
|
-
value: markdown,
|
|
42
|
-
variant: shared_1.MarkdownVariant.BORDERLESS,
|
|
43
|
-
}),
|
|
44
|
-
response: pieces_framework_1.Property.MarkDown({
|
|
45
|
-
value: responseMarkdown,
|
|
46
|
-
variant: shared_1.MarkdownVariant.WARNING,
|
|
47
|
-
}),
|
|
48
|
-
waitForResponse: pieces_framework_1.Property.Checkbox({
|
|
49
|
-
displayName: 'Wait for Response',
|
|
50
|
-
defaultValue: false,
|
|
51
|
-
required: true,
|
|
52
|
-
}),
|
|
53
|
-
inputs: pieces_framework_1.Property.Array({
|
|
54
|
-
displayName: 'Inputs',
|
|
55
|
-
required: true,
|
|
56
|
-
properties: {
|
|
57
|
-
displayName: pieces_framework_1.Property.ShortText({
|
|
58
|
-
displayName: 'Field Name',
|
|
59
|
-
required: true,
|
|
60
|
-
}),
|
|
61
|
-
type: pieces_framework_1.Property.StaticDropdown({
|
|
62
|
-
displayName: 'Field Type',
|
|
63
|
-
required: true,
|
|
64
|
-
options: {
|
|
65
|
-
options: [
|
|
66
|
-
{ value: 'text', label: 'Text' },
|
|
67
|
-
{ value: 'text_area', label: 'Text Area' },
|
|
68
|
-
{ value: 'file', label: 'File' },
|
|
69
|
-
{ value: 'toggle', label: 'Toggle' },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
}),
|
|
73
|
-
description: pieces_framework_1.Property.ShortText({
|
|
74
|
-
displayName: 'Field Description',
|
|
75
|
-
required: false,
|
|
76
|
-
}),
|
|
77
|
-
required: pieces_framework_1.Property.Checkbox({
|
|
78
|
-
displayName: 'Required',
|
|
79
|
-
required: true,
|
|
80
|
-
}),
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
},
|
|
84
|
-
sampleData: {},
|
|
85
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
86
|
-
onEnable() {
|
|
87
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
return;
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
onDisable() {
|
|
92
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
return;
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
run(context) {
|
|
97
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const payload = context.payload.body;
|
|
99
|
-
const inputs = context.propsValue.inputs;
|
|
100
|
-
const processedPayload = {};
|
|
101
|
-
for (const input of inputs) {
|
|
102
|
-
const key = (0, shared_1.createKeyForFormInput)(input.displayName);
|
|
103
|
-
const value = payload[key];
|
|
104
|
-
switch (input.type) {
|
|
105
|
-
case 'toggle':
|
|
106
|
-
processedPayload[key] = parseBoolean(value, input.displayName);
|
|
107
|
-
break;
|
|
108
|
-
case 'text':
|
|
109
|
-
case 'text_area':
|
|
110
|
-
case 'file':
|
|
111
|
-
processedPayload[key] = value;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return [processedPayload];
|
|
116
|
-
});
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
//# sourceMappingURL=form-trigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form-trigger.js","sourceRoot":"","sources":["../../../../src/lib/triggers/form-trigger.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,iDAI8B;AAG9B,MAAM,QAAQ,GAAG;;;;;;;;;cASH,mCAA0B;;;CAGvC,CAAC;AACF,MAAM,gBAAgB,GAAG;;CAExB,CAAC;AASF,MAAM,YAAY,GAAG,CAAC,KAAc,EAAE,SAAiB,EAAW,EAAE;IAClE,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;YACpD,OAAO,UAAU,KAAK,MAAM,CAAC;QAC/B,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,SAAS,SAAS,6CAA6C,CAAC,CAAC;AACnF,CAAC,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,wBAAe,CAAC,UAAU;SACpC,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,wBAAe,CAAC,OAAO;SACjC,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,mBAAmB;YAChC,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACrB,WAAW,EAAE,QAAQ;YACrB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;oBAC9B,WAAW,EAAE,YAAY;oBACzB,QAAQ,EAAE,IAAI;iBACf,CAAC;gBACF,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;oBAC5B,WAAW,EAAE,YAAY;oBACzB,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;4BAChC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;4BAC1C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;4BAChC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;yBACrC;qBACF;iBACF,CAAC;gBACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;oBAC9B,WAAW,EAAE,mBAAmB;oBAChC,QAAQ,EAAE,KAAK;iBAChB,CAAC;gBACF,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;oBAC1B,WAAW,EAAE,UAAU;oBACvB,QAAQ,EAAE,IAAI;iBACf,CAAC;aACH;SACF,CAAC;KACH;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ;;YACZ,OAAO;QACT,CAAC;KAAA;IACK,SAAS;;YACb,OAAO;QACT,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAA+B,CAAC;YAChE,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAqB,CAAC;YAExD,MAAM,gBAAgB,GAA4B,EAAE,CAAC;YACrD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC3B,MAAM,GAAG,GAAG,IAAA,8BAAqB,EAAC,KAAK,CAAC,WAAW,CAAC,CAAC;gBACrD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;gBAE3B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;oBACnB,KAAK,QAAQ;wBACX,gBAAgB,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;wBAC/D,MAAM;oBACR,KAAK,MAAM,CAAC;oBACZ,KAAK,WAAW,CAAC;oBACjB,KAAK,MAAM;wBACT,gBAAgB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;wBAC9B,MAAM;gBACV,CAAC;YACH,CAAC;YAED,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC5B,CAAC;KAAA;CACF,CAAC,CAAC"}
|