@activepieces/piece-chatling 0.1.4 → 0.1.6
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 -23
- package/src/index.js +14 -55
- package/README.md +0 -7
- package/src/index.d.ts +0 -2
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-chatbot.d.ts +0 -4
- package/src/lib/actions/create-chatbot.js +0 -35
- package/src/lib/actions/create-chatbot.js.map +0 -1
- package/src/lib/actions/send-message.d.ts +0 -10
- package/src/lib/actions/send-message.js +0 -61
- package/src/lib/actions/send-message.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -5
- package/src/lib/common/index.js +0 -24
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -6
- package/src/lib/common/props.js +0 -195
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/triggers/new-contact.d.ts +0 -10
- package/src/lib/triggers/new-contact.js +0 -77
- package/src/lib/triggers/new-contact.js.map +0 -1
- package/src/lib/triggers/new-conversation.d.ts +0 -10
- package/src/lib/triggers/new-conversation.js +0 -82
- package/src/lib/triggers/new-conversation.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-chatling",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"dayjs": "1.11.9",
|
|
13
|
-
"deepmerge-ts": "7.1.0",
|
|
14
|
-
"form-data": "4.0.4",
|
|
15
|
-
"mime-types": "2.1.35",
|
|
16
|
-
"nanoid": "3.3.8",
|
|
17
|
-
"semver": "7.6.0",
|
|
18
|
-
"socket.io-client": "4.8.1",
|
|
19
|
-
"tslib": "^2.3.0",
|
|
20
|
-
"zod": "4.1.13",
|
|
21
|
-
"@activepieces/pieces-common": "0.11.6",
|
|
22
|
-
"@activepieces/pieces-framework": "0.25.4",
|
|
23
|
-
"@activepieces/shared": "0.37.0"
|
|
24
|
-
},
|
|
25
|
-
"resolutions": {
|
|
26
|
-
"rollup": "npm:@rollup/wasm-node"
|
|
27
|
-
}
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/index.js",
|
|
9
|
+
"package.json",
|
|
10
|
+
"src/i18n"
|
|
11
|
+
]
|
|
28
12
|
}
|
package/src/index.js
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const shared_1 = require("@activepieces/shared");
|
|
8
|
-
const common_1 = require("./lib/common");
|
|
9
|
-
const send_message_1 = require("./lib/actions/send-message");
|
|
10
|
-
const create_chatbot_1 = require("./lib/actions/create-chatbot");
|
|
11
|
-
const new_conversation_1 = require("./lib/triggers/new-conversation");
|
|
12
|
-
const new_contact_1 = require("./lib/triggers/new-contact");
|
|
13
|
-
const markdownDescription = `
|
|
1
|
+
"use strict";var mu=Object.create;var vt=Object.defineProperty;var fu=Object.getOwnPropertyDescriptor;var gu=Object.getOwnPropertyNames;var yu=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty;var o=(e,t)=>vt(e,"name",{value:t,configurable:!0});var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mn=(e,t)=>{for(var r in t)vt(e,r,{get:t[r],enumerable:!0})},jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gu(t))!hu.call(e,i)&&i!==r&&vt(e,i,{get:()=>t[i],enumerable:!(n=fu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?mu(yu(e)):{},jn(t||!e||!e.__esModule?vt(r,"default",{value:e,enumerable:!0}):r,e)),vu=e=>jn(vt({},"__esModule",{value:!0}),e);var ni=z((ri,ur)=>{(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")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,x=(s.match(l.zoneIndex)||[])[0],P,L;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let oe=s.split(":"),fe=[];for(let Te=0;Te<oe.length;Te++)fe.push(parseInt(oe[Te],16));return fe}(),{parts:d,zoneId:x}}o(f,"expandIPv6");function g(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[x]>>P!==d[x]>>P)return!1;m-=y,x+=1}return!0}o(g,"matchCIDR");function v(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(v,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let _={};_.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}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(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,L;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in m){if(L=m[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,y,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[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")},_.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return function(){let x=d.slice(1,6),P=[];for(let L=0;L<x.length;L++)y=x[L],P.push(v(y));return P}();if(d=s.match(r.longValue)){if(m=v(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(m>>P&255);return x}().reverse()}else return(d=s.match(r.twoOctet))?function(){let x=d.slice(1,4),P=[];if(m=v(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(v(x[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(d=s.match(r.threeOctet))?function(){let x=d.slice(1,5),P=[];if(m=v(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(v(x[0])),P.push(v(x[1])),P.push(m>>8&255),P.push(m&255),P}():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=function(){function s(d,y){let m,x;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=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(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=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},x,P;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in m){if(P=m[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(I(this.parts[x].toString(16),4));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new _.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(m=P.index,x=P[0].length);return x<0?y:`${y.substring(0,m)}::${y.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,y,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],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")},_.IPv6.parser=function(s){let d,y,m,x,P,L;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[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;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,y){let m,x,P,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(L=P[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return x}return y},typeof ur<"u"&&ur.exports?ur.exports=_:e.ipaddr=_})(ri)});var Qi=z((bA,Yi)=>{var Xi=require("stream").Stream,Gl=require("util");Yi.exports=Ie;function Ie(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(Ie,"DelayedStream");Gl.inherits(Ie,Xi);Ie.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(Ie.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});Ie.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Ie.prototype.resume=function(){this._released||this.release(),this.source.resume()};Ie.prototype.pause=function(){this.source.pause()};Ie.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};Ie.prototype.pipe=function(){var e=Xi.prototype.pipe.apply(this,arguments);return this.resume(),e};Ie.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};Ie.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var na=z((TA,ra)=>{var ql=require("util"),ta=require("stream").Stream,ea=Qi();ra.exports=ne;function ne(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(ne,"CombinedStream");ql.inherits(ne,ta);ne.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};ne.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};ne.prototype.append=function(e){var t=ne.isStreamLike(e);if(t){if(!(e instanceof ea)){var r=ea.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};ne.prototype.pipe=function(e,t){return ta.prototype.pipe.call(this,e,t),this.resume(),e};ne.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};ne.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=ne.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ne.prototype._pipeNext=function(e){this._currentStream=e;var t=ne.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};ne.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ne.prototype.write=function(e){this.emit("data",e)};ne.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ne.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};ne.prototype.end=function(){this._reset(),this.emit("end")};ne.prototype.destroy=function(){this._reset(),this.emit("close")};ne.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ne.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};ne.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ne.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ia=z((EA,oa)=>{"use strict";oa.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 ua=z(he=>{"use strict";var yr=ia(),Kl=require("path").extname,aa=/^\s*([^;\s]*)(?:;|\s|$)/,Jl=/^text\//i;he.charset=sa;he.charsets={lookup:sa};he.contentType=Xl;he.extension=Yl;he.extensions=Object.create(null);he.lookup=Ql;he.types=Object.create(null);ep(he.extensions,he.types);function sa(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&yr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Jl.test(t[1])?"UTF-8":!1}o(sa,"charset");function Xl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?he.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=he.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Xl,"contentType");function Yl(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&he.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Yl,"extension");function Ql(e){if(!e||typeof e!="string")return!1;var t=Kl("x."+e).toLowerCase().substr(1);return t&&he.types[t]||!1}o(Ql,"lookup");function ep(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(yr).forEach(o(function(i){var u=yr[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var g=r.indexOf(yr[t[f]].source),v=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>v||g===v&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(ep,"populateMaps")});var la=z((zA,ca)=>{ca.exports=tp;function tp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(tp,"defer")});var mn=z((kA,da)=>{var pa=la();da.exports=rp;function rp(e){var t=!1;return pa(function(){t=!0}),o(function(n,i){t?e(n,i):pa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(rp,"async")});var fn=z((RA,ma)=>{ma.exports=np;function np(e){Object.keys(e.jobs).forEach(op.bind(e)),e.jobs={}}o(np,"abort");function op(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(op,"clean")});var gn=z((NA,ga)=>{var fa=mn(),ip=fn();ga.exports=ap;function ap(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=sp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?ip(r):r.results[i]=c,n(u,r.results))})}o(ap,"iterate");function sp(e,t,r,n){var i;return e.length==2?i=e(r,fa(n)):i=e(r,t,fa(n)),i}o(sp,"runJob")});var yn=z((UA,ya)=>{ya.exports=up;function up(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(up,"state")});var hn=z((jA,ha)=>{var cp=fn(),lp=mn();ha.exports=pp;function pp(e){Object.keys(this.jobs).length&&(this.index=this.size,cp(this),lp(e)(null,this.results))}o(pp,"terminator")});var xa=z((FA,va)=>{var dp=gn(),mp=yn(),fp=hn();va.exports=gp;function gp(e,t,r){for(var n=mp(e);n.index<(n.keyedList||e).length;)dp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return fp.bind(n,r)}o(gp,"parallel")});var vn=z((VA,hr)=>{var _a=gn(),yp=yn(),hp=hn();hr.exports=vp;hr.exports.ascending=Pa;hr.exports.descending=xp;function vp(e,t,r,n){var i=yp(e,r);return _a(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){_a(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),hp.bind(i,n)}o(vp,"serialOrdered");function Pa(e,t){return e<t?-1:e>t?1:0}o(Pa,"ascending");function xp(e,t){return-1*Pa(e,t)}o(xp,"descending")});var Ia=z((HA,ba)=>{var _p=vn();ba.exports=Pp;function Pp(e,t,r){return _p(e,t,null,r)}o(Pp,"serial")});var $a=z((GA,Ta)=>{Ta.exports={parallel:xa(),serial:Ia(),serialOrdered:vn()}});var xn=z((qA,Ea)=>{"use strict";Ea.exports=Object});var Aa=z((KA,Sa)=>{"use strict";Sa.exports=Error});var wa=z((JA,za)=>{"use strict";za.exports=EvalError});var Oa=z((XA,ka)=>{"use strict";ka.exports=RangeError});var Da=z((YA,Ra)=>{"use strict";Ra.exports=ReferenceError});var Ca=z((QA,Na)=>{"use strict";Na.exports=SyntaxError});var vr=z((ez,Ua)=>{"use strict";Ua.exports=TypeError});var ja=z((tz,Ma)=>{"use strict";Ma.exports=URIError});var Fa=z((rz,La)=>{"use strict";La.exports=Math.abs});var Va=z((nz,Ba)=>{"use strict";Ba.exports=Math.floor});var Ha=z((oz,Za)=>{"use strict";Za.exports=Math.max});var Ga=z((iz,Wa)=>{"use strict";Wa.exports=Math.min});var Ka=z((az,qa)=>{"use strict";qa.exports=Math.pow});var Xa=z((sz,Ja)=>{"use strict";Ja.exports=Math.round});var Qa=z((uz,Ya)=>{"use strict";Ya.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ts=z((lz,es)=>{"use strict";var bp=Qa();es.exports=o(function(t){return bp(t)||t===0?t:t<0?-1:1},"sign")});var ns=z((dz,rs)=>{"use strict";rs.exports=Object.getOwnPropertyDescriptor});var _n=z((mz,os)=>{"use strict";var xr=ns();if(xr)try{xr([],"length")}catch{xr=null}os.exports=xr});var as=z((fz,is)=>{"use strict";var _r=Object.defineProperty||!1;if(_r)try{_r({},"a",{value:1})}catch{_r=!1}is.exports=_r});var Pn=z((gz,ss)=>{"use strict";ss.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ls=z((hz,cs)=>{"use strict";var us=typeof Symbol<"u"&&Symbol,Ip=Pn();cs.exports=o(function(){return typeof us!="function"||typeof Symbol!="function"||typeof us("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ip()},"hasNativeSymbols")});var bn=z((xz,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var In=z((_z,ds)=>{"use strict";var Tp=xn();ds.exports=Tp.getPrototypeOf||null});var gs=z((Pz,fs)=>{"use strict";var $p="Function.prototype.bind called on incompatible ",Ep=Object.prototype.toString,Sp=Math.max,Ap="[object Function]",ms=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),zp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),wp=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");fs.exports=o(function(t){var r=this;if(typeof r!="function"||Ep.apply(r)!==Ap)throw new TypeError($p+r);for(var n=zp(arguments,1),i,u=o(function(){if(this instanceof i){var v=r.apply(this,ms(n,arguments));return Object(v)===v?v:this}return r.apply(t,ms(n,arguments))},"binder"),c=Sp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+wp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var lt=z((Iz,ys)=>{"use strict";var kp=gs();ys.exports=Function.prototype.bind||kp});var Pr=z((Tz,hs)=>{"use strict";hs.exports=Function.prototype.call});var Tn=z(($z,vs)=>{"use strict";vs.exports=Function.prototype.apply});var _s=z((Ez,xs)=>{"use strict";xs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bs=z((Sz,Ps)=>{"use strict";var Op=lt(),Rp=Tn(),Dp=Pr(),Np=_s();Ps.exports=Np||Op.call(Dp,Rp)});var Ts=z((Az,Is)=>{"use strict";var Cp=lt(),Up=vr(),Mp=Pr(),jp=bs();Is.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Up("a function is required");return jp(Cp,Mp,t)},"callBindBasic")});var ws=z((wz,zs)=>{"use strict";var Lp=Ts(),$s=_n(),Ss;try{Ss=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var $n=!!Ss&&$s&&$s(Object.prototype,"__proto__"),As=Object,Es=As.getPrototypeOf;zs.exports=$n&&typeof $n.get=="function"?Lp([$n.get]):typeof Es=="function"?o(function(t){return Es(t==null?t:As(t))},"getDunder"):!1});var Ns=z((Oz,Ds)=>{"use strict";var ks=bn(),Os=In(),Rs=ws();Ds.exports=ks?o(function(t){return ks(t)},"getProto"):Os?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Os(t)},"getProto"):Rs?o(function(t){return Rs(t)},"getProto"):null});var En=z((Dz,Cs)=>{"use strict";var Fp=Function.prototype.call,Bp=Object.prototype.hasOwnProperty,Vp=lt();Cs.exports=Vp.call(Fp,Bp)});var Vs=z((Nz,Bs)=>{"use strict";var W,Zp=xn(),Hp=Aa(),Wp=wa(),Gp=Oa(),qp=Da(),ft=Ca(),mt=vr(),Kp=ja(),Jp=Fa(),Xp=Va(),Yp=Ha(),Qp=Ga(),ed=Ka(),td=Xa(),rd=ts(),Ls=Function,Sn=o(function(e){try{return Ls('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Lt=_n(),nd=as(),An=o(function(){throw new mt},"throwTypeError"),od=Lt?function(){try{return arguments.callee,An}catch{try{return Lt(arguments,"callee").get}catch{return An}}}():An,pt=ls()(),ce=Ns(),id=In(),ad=bn(),Fs=Tn(),Ft=Pr(),dt={},sd=typeof Uint8Array>"u"||!ce?W:ce(Uint8Array),Je={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":pt&&ce?ce([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":dt,"%AsyncGenerator%":dt,"%AsyncGeneratorFunction%":dt,"%AsyncIteratorPrototype%":dt,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Hp,"%eval%":eval,"%EvalError%":Wp,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":Ls,"%GeneratorFunction%":dt,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":pt&&ce?ce(ce([][Symbol.iterator]())):W,"%JSON%":typeof JSON=="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!pt||!ce?W:ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Zp,"%Object.getOwnPropertyDescriptor%":Lt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":Gp,"%ReferenceError%":qp,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!pt||!ce?W:ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":pt&&ce?ce(""[Symbol.iterator]()):W,"%Symbol%":pt?Symbol:W,"%SyntaxError%":ft,"%ThrowTypeError%":od,"%TypedArray%":sd,"%TypeError%":mt,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":Kp,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":Ft,"%Function.prototype.apply%":Fs,"%Object.defineProperty%":nd,"%Object.getPrototypeOf%":id,"%Math.abs%":Jp,"%Math.floor%":Xp,"%Math.max%":Yp,"%Math.min%":Qp,"%Math.pow%":ed,"%Math.round%":td,"%Math.sign%":rd,"%Reflect.getPrototypeOf%":ad};if(ce)try{null.error}catch(e){Us=ce(ce(e)),Je["%Error.prototype%"]=Us}var Us,ud=o(function e(t){var r;if(t==="%AsyncFunction%")r=Sn("async function () {}");else if(t==="%GeneratorFunction%")r=Sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ce&&(r=ce(i.prototype))}return Je[t]=r,r},"doEval"),Ms={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Bt=lt(),br=En(),cd=Bt.call(Ft,Array.prototype.concat),ld=Bt.call(Fs,Array.prototype.splice),js=Bt.call(Ft,String.prototype.replace),Ir=Bt.call(Ft,String.prototype.slice),pd=Bt.call(Ft,RegExp.prototype.exec),dd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,md=/\\(\\)?/g,fd=o(function(t){var r=Ir(t,0,1),n=Ir(t,-1);if(r==="%"&&n!=="%")throw new ft("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new ft("invalid intrinsic syntax, expected opening `%`");var i=[];return js(t,dd,function(u,c,l,f){i[i.length]=l?js(f,md,"$1"):c||u}),i},"stringToPath"),gd=o(function(t,r){var n=t,i;if(br(Ms,n)&&(i=Ms[n],n="%"+i[0]+"%"),br(Je,n)){var u=Je[n];if(u===dt&&(u=ud(n)),typeof u>"u"&&!r)throw new mt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new ft("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Bs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new mt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new mt('"allowMissing" argument must be a boolean');if(pd(/^%?[^%]*%?$/,t)===null)throw new ft("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=fd(t),i=n.length>0?n[0]:"",u=gd("%"+i+"%",r),c=u.name,l=u.value,f=!1,g=u.alias;g&&(i=g[0],ld(n,cd([0,1],g)));for(var v=1,I=!0;v<n.length;v+=1){var _=n[v],s=Ir(_,0,1),d=Ir(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new ft("property names with quotes must have matching quotes");if((_==="constructor"||!I)&&(f=!0),i+="."+_,c="%"+i+"%",br(Je,c))l=Je[c];else if(l!=null){if(!(_ in l)){if(!r)throw new mt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Lt&&v+1>=n.length){var y=Lt(l,_);I=!!y,I&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[_]}else I=br(l,_),l=l[_];I&&!f&&(Je[c]=l)}}return l},"GetIntrinsic")});var Hs=z((Uz,Zs)=>{"use strict";var yd=Pn();Zs.exports=o(function(){return yd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var qs=z((jz,Gs)=>{"use strict";var hd=Vs(),Ws=hd("%Object.defineProperty%",!0),vd=Hs()(),xd=En(),_d=vr(),Tr=vd?Symbol.toStringTag:null;Gs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new _d("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Tr&&(n||!xd(t,Tr))&&(Ws?Ws(t,Tr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[Tr]=r)},"setToStringTag")});var Js=z((Fz,Ks)=>{"use strict";var Pd=Function.prototype.call,bd=Object.prototype.hasOwnProperty,Id=lt();Ks.exports=Id.call(Pd,bd)});var Ys=z((Bz,Xs)=>{"use strict";Xs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var tu=z((Vz,eu)=>{"use strict";var On=na(),Td=require("util"),zn=require("path"),$d=require("http"),Ed=require("https"),Sd=require("url").parse,Ad=require("fs"),zd=require("stream").Stream,wd=require("crypto"),wn=ua(),kd=$a(),Od=qs(),Ve=Js(),kn=Ys();function Qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Qs,"escapeHeaderParam");function G(e){if(!(this instanceof G))return new G(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],On.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(G,"FormData");Td.inherits(G,On);G.LINE_BREAK=`\r
|
|
2
|
+
`;G.DEFAULT_CONTENT_TYPE="application/octet-stream";G.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=On.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};G.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+G.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ve(t,"httpVersion"))&&!(t instanceof zd))&&(r.knownLength||this._valuesToMeasure.push(t))};G.prototype._lengthRetriever=function(e,t){Ve(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ad.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ve(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ve(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};G.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&kn(c,r.header);var l;for(var f in c)if(Ve(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+G.LINE_BREAK)}return"--"+this.getBoundary()+G.LINE_BREAK+u+G.LINE_BREAK};G.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=zn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=zn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ve(e,"httpVersion")&&(r=zn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Qs(r)+'"'};G.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=wn.lookup(e.name)),!r&&e&&e.path&&(r=wn.lookup(e.path)),!r&&e&&e.readable&&Ve(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=wn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=G.DEFAULT_CONTENT_TYPE),r};G.prototype._multiPartFooter=function(){return function(e){var t=G.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};G.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+G.LINE_BREAK};G.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ve(e,t)&&(r[t.toLowerCase()]=e[t]);return r};G.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};G.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};G.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(G.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};G.prototype._generateBoundary=function(){this._boundary="--------------------------"+wd.randomBytes(12).toString("hex")};G.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};G.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};G.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}kd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};G.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Sd(e),n=kn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=kn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Ed.request(n):r=$d.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(g,v){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,g,v)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};G.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};G.prototype.toString=function(){return"[object FormData]"};Od(G.prototype,"FormData");eu.exports=G});var Nn=z((Rn,Dn)=>{(function(e,t){typeof Rn=="object"&&typeof Dn<"u"?Dn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Rn,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",i="second",u="minute",c="hour",l="day",f="week",g="month",v="quarter",I="year",_="date",s="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(U){var T=["th","st","nd","rd"],b=U%100;return"["+U+(T[(b-20)%10]||T[b]||T[0])+"]"},"ordinal")},x=o(function(U,T,b){var E=String(U);return!E||E.length>=T?U:""+Array(T+1-E.length).join(b)+U},"m"),P={s:x,z:o(function(U){var T=-U.utcOffset(),b=Math.abs(T),E=Math.floor(b/60),$=b%60;return(T<=0?"+":"-")+x(E,2,"0")+":"+x($,2,"0")},"z"),m:o(function U(T,b){if(T.date()<b.date())return-U(b,T);var E=12*(b.year()-T.year())+(b.month()-T.month()),$=T.clone().add(E,g),F=b-$<0,B=T.clone().add(E+(F?-1:1),g);return+(-(E+(b-$)/(F?$-B:B-$))||0)},"t"),a:o(function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},"a"),p:o(function(U){return{M:g,y:I,w:f,d:l,D:_,h:c,m:u,s:i,ms:n,Q:v}[U]||String(U||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(U){return U===void 0},"u")},L="en",oe={};oe[L]=m;var fe=o(function(U){return U instanceof Xe},"p"),Te=o(function U(T,b,E){var $;if(!T)return L;if(typeof T=="string"){var F=T.toLowerCase();oe[F]&&($=F),b&&(oe[F]=b,$=F);var B=T.split("-");if(!$&&B.length>1)return U(B[0])}else{var Y=T.name;oe[Y]=T,$=Y}return!E&&$&&(L=$),$||!E&&L},"t"),X=o(function(U,T){if(fe(U))return U.clone();var b=typeof T=="object"?T:{};return b.date=U,b.args=arguments,new Xe(b)},"w"),H=P;H.l=Te,H.i=fe,H.w=function(U,T){return X(U,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var Xe=function(){function U(b){this.$L=Te(b.locale,null,!0),this.parse(b)}o(U,"M");var T=U.prototype;return T.parse=function(b){this.$d=function(E){var $=E.date,F=E.utc;if($===null)return new Date(NaN);if(H.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var B=$.match(d);if(B){var Y=B[2]-1||0,ie=(B[7]||"0").substring(0,3);return F?new Date(Date.UTC(B[1],Y,B[3]||1,B[4]||0,B[5]||0,B[6]||0,ie)):new Date(B[1],Y,B[3]||1,B[4]||0,B[5]||0,B[6]||0,ie)}}return new Date($)}(b),this.$x=b.x||{},this.init()},T.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},T.$utils=function(){return H},T.isValid=function(){return this.$d.toString()!==s},T.isSame=function(b,E){var $=X(b);return this.startOf(E)<=$&&$<=this.endOf(E)},T.isAfter=function(b,E){return X(b)<this.startOf(E)},T.isBefore=function(b,E){return this.endOf(E)<X(b)},T.$g=function(b,E,$){return H.u(b)?this[E]:this.set($,b)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function(b,E){var $=this,F=!!H.u(E)||E,B=H.p(b),Y=o(function(We,ye){var Ne=H.w($.$u?Date.UTC($.$y,ye,We):new Date($.$y,ye,We),$);return F?Ne:Ne.endOf(l)},"l"),ie=o(function(We,ye){return H.w($.toDate()[We].apply($.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(ye)),$)},"$"),ue=this.$W,me=this.$M,_e=this.$D,Ye="set"+(this.$u?"UTC":"");switch(B){case I:return F?Y(1,0):Y(31,11);case g:return F?Y(1,me):Y(0,me+1);case f:var He=this.$locale().weekStart||0,yt=(ue<He?ue+7:ue)-He;return Y(F?_e-yt:_e+(6-yt),me);case l:case _:return ie(Ye+"Hours",0);case c:return ie(Ye+"Minutes",1);case u:return ie(Ye+"Seconds",2);case i:return ie(Ye+"Milliseconds",3);default:return this.clone()}},T.endOf=function(b){return this.startOf(b,!1)},T.$set=function(b,E){var $,F=H.p(b),B="set"+(this.$u?"UTC":""),Y=($={},$[l]=B+"Date",$[_]=B+"Date",$[g]=B+"Month",$[I]=B+"FullYear",$[c]=B+"Hours",$[u]=B+"Minutes",$[i]=B+"Seconds",$[n]=B+"Milliseconds",$)[F],ie=F===l?this.$D+(E-this.$W):E;if(F===g||F===I){var ue=this.clone().set(_,1);ue.$d[Y](ie),ue.init(),this.$d=ue.set(_,Math.min(this.$D,ue.daysInMonth())).$d}else Y&&this.$d[Y](ie);return this.init(),this},T.set=function(b,E){return this.clone().$set(b,E)},T.get=function(b){return this[H.p(b)]()},T.add=function(b,E){var $,F=this;b=Number(b);var B=H.p(E),Y=o(function(me){var _e=X(F);return H.w(_e.date(_e.date()+Math.round(me*b)),F)},"y");if(B===g)return this.set(g,this.$M+b);if(B===I)return this.set(I,this.$y+b);if(B===l)return Y(1);if(B===f)return Y(7);var ie=($={},$[u]=t,$[c]=r,$[i]=e,$)[B]||1,ue=this.$d.getTime()+b*ie;return H.w(ue,this)},T.subtract=function(b,E){return this.add(-1*b,E)},T.format=function(b){var E=this,$=this.$locale();if(!this.isValid())return $.invalidDate||s;var F=b||"YYYY-MM-DDTHH:mm:ssZ",B=H.z(this),Y=this.$H,ie=this.$m,ue=this.$M,me=$.weekdays,_e=$.months,Ye=$.meridiem,He=o(function(ye,Ne,ht,Vt){return ye&&(ye[Ne]||ye(E,F))||ht[Ne].slice(0,Vt)},"h"),yt=o(function(ye){return H.s(Y%12||12,ye,"0")},"d"),We=Ye||function(ye,Ne,ht){var Vt=ye<12?"AM":"PM";return ht?Vt.toLowerCase():Vt};return F.replace(y,function(ye,Ne){return Ne||function(ht){switch(ht){case"YY":return String(E.$y).slice(-2);case"YYYY":return H.s(E.$y,4,"0");case"M":return ue+1;case"MM":return H.s(ue+1,2,"0");case"MMM":return He($.monthsShort,ue,_e,3);case"MMMM":return He(_e,ue);case"D":return E.$D;case"DD":return H.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return He($.weekdaysMin,E.$W,me,2);case"ddd":return He($.weekdaysShort,E.$W,me,3);case"dddd":return me[E.$W];case"H":return String(Y);case"HH":return H.s(Y,2,"0");case"h":return yt(1);case"hh":return yt(2);case"a":return We(Y,ie,!0);case"A":return We(Y,ie,!1);case"m":return String(ie);case"mm":return H.s(ie,2,"0");case"s":return String(E.$s);case"ss":return H.s(E.$s,2,"0");case"SSS":return H.s(E.$ms,3,"0");case"Z":return B}return null}(ye)||B.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function(b,E,$){var F,B=this,Y=H.p(E),ie=X(b),ue=(ie.utcOffset()-this.utcOffset())*t,me=this-ie,_e=o(function(){return H.m(B,ie)},"D");switch(Y){case I:F=_e()/12;break;case g:F=_e();break;case v:F=_e()/3;break;case f:F=(me-ue)/6048e5;break;case l:F=(me-ue)/864e5;break;case c:F=me/r;break;case u:F=me/t;break;case i:F=me/e;break;default:F=me}return $?F:H.a(F)},T.daysInMonth=function(){return this.endOf(g).$D},T.$locale=function(){return oe[this.$L]},T.locale=function(b,E){if(!b)return this.$L;var $=this.clone(),F=Te(b,E,!0);return F&&($.$L=F),$},T.clone=function(){return H.w(this.$d,this)},T.toDate=function(){return new Date(this.valueOf())},T.toJSON=function(){return this.isValid()?this.toISOString():null},T.toISOString=function(){return this.$d.toISOString()},T.toString=function(){return this.$d.toUTCString()},U}(),Ze=Xe.prototype;return X.prototype=Ze,[["$ms",n],["$s",i],["$m",u],["$H",c],["$W",l],["$M",g],["$y",I],["$D",_]].forEach(function(U){Ze[U[1]]=function(T){return this.$g(T,U[0],U[1])}}),X.extend=function(U,T){return U.$i||(U(T,Xe,X),U.$i=!0),X},X.locale=Te,X.isDayjs=fe,X.unix=function(U){return X(1e3*U)},X.en=oe[L],X.Ls=oe,X.p={},X})});var Hd={};Mn(Hd,{chatling:()=>Zd});module.exports=vu(Hd);var xu=Object.freeze({status:"aborted"});function S(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let g=c.prototype,v=Object.keys(g);for(let I=0;I<v.length;I++){let _=v[I];_ in l||(l[_]=g[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let g=r?.Parent?new u:this;n(g,l),(f=g._zod).deferred??(f.deferred=[]);for(let v of g._zod.deferred)v();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(S,"$constructor");var _u=Symbol("zod_brand"),$e=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Zt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Sr={};function Ae(e){return e&&Object.assign(Sr,e),Sr}o(Ae,"config");function zr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(zr,"getEnumValues");function Fn(e,t){return typeof t=="bigint"?t.toString():t}o(Fn,"jsonStringifyReplacer");function Wt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Wt,"cached");function Bn(e){return e==null}o(Bn,"nullish");function Gt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Gt,"cleanRegex");var Ln=Symbol("evaluating");function ae(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ln)return n===void 0&&(n=Ln,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(ae,"defineLazy");var wr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(xt,"isObject");var Pu=Wt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Vn(e){if(xt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(xt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Vn,"isPlainObject");var Zn=new Set(["string","number","symbol"]);function Qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Qe,"escapeRegex");function qt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(qt,"clone");function ee(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(ee,"normalizeParams");function Hn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Hn,"optionalKeys");var bu={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 et(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(et,"aborted");function Ue(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ue,"prefixIssues");function Ht(e){return typeof e=="string"?e:e?.message}o(Ht,"unwrapMessage");function Me(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Ht(e.inst?._zod.def?.error?.(e))??Ht(t?.error?.(e))??Ht(r.customError?.(e))??Ht(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Me,"finalizeIssue");function Wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Wn,"getLengthableOrigin");function kr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(kr,"issue");var Gn=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,Fn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),qn=S("$ZodError",Gn),_t=S("$ZodError",Gn,{Parent:Error});var Tu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new $e;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Me(f,u,Ae())));throw wr(l,i?.callee),l}return c.value},"_parse"),Kt=Tu(_t),$u=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Me(f,u,Ae())));throw wr(l,i?.callee),l}return c.value},"_parseAsync"),Jt=$u(_t),Eu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new $e;return u.issues.length?{success:!1,error:new(e??qn)(u.issues.map(c=>Me(c,i,Ae())))}:{success:!0,data:u.value}},"_safeParse"),Pt=Eu(_t),Su=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Me(c,i,Ae())))}:{success:!0,data:u.value}},"_safeParseAsync"),bt=Su(_t);var Au="(?:(?:\\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])))",zu=new RegExp(`^${Au}$`);var Kn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Jn=/^-?\d+n?$/;var Or=/^-?\d+(?:\.\d+)?$/,Xn=/^(?:true|false)$/i;var tt=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Yn=S("$ZodCheckMinLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Bn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Wn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var Rr=S("$ZodCheckStringFormat",(e,t)=>{var r,n;tt.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Qn=S("$ZodCheckRegex",(e,t)=>{Rr.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 to={major:4,minor:3,patch:6};var te=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let g=et(c),v;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(g)continue;let _=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new $e;if(v||s instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(g||(g=et(c,_)))});else{if(c.issues.length===_)continue;g||(g=et(c,_))}}return v?v.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(et(c))return c.aborted=!0,c;let g=i(l,n,f);if(g instanceof Promise){if(f.async===!1)throw new $e;return g.then(v=>e._zod.parse(v,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(v=>u(v,c,l)):u(g,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new $e;return f.then(g=>i(g,n,l))}return i(f,n,l)}}ae(e,"~standard",()=>({validate:o(i=>{try{let u=Pt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return bt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Qt=S("$ZodString",(e,t)=>{te.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Kn(e._zod.bag),e._zod.parse=(r,n)=>{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}}),Dr=S("$ZodStringFormat",(e,t)=>{Rr.init(e,t),Qt.init(e,t)});var ao=S("$ZodURL",(e,t)=>{Dr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var so=S("$ZodNumber",(e,t)=>{te.init(e,t),e._zod.pattern=e._zod.bag.pattern??Or,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var Nr=S("$ZodBoolean",(e,t)=>{te.init(e,t),e._zod.pattern=Xn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),uo=S("$ZodBigInt",(e,t)=>{te.init(e,t),e._zod.pattern=Jn,e._zod.parse=(r,n)=>{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 co=S("$ZodAny",(e,t)=>{te.init(e,t),e._zod.parse=r=>r}),lo=S("$ZodUnknown",(e,t)=>{te.init(e,t),e._zod.parse=r=>r});var po=S("$ZodVoid",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),mo=S("$ZodDate",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function ro(e,t,r){e.issues.length&&t.issues.push(...Ue(r,e.issues)),t.value[r]=e.value}o(ro,"handleArrayResult");var fo=S("$ZodArray",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(g=>ro(g,r,c))):ro(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Yt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ue(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Yt,"handlePropertyResult");function wu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Hn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(wu,"normalizeDef");function ku(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,g=f.def.type,v=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(g==="never"){c.push(I);continue}let _=f.run({value:t[I],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Yt(s,r,I,t,v))):Yt(_,r,I,t,v)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(ku,"handleCatchall");var go=S("$ZodObject",(e,t)=>{if(te.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Wt(()=>wu(t));ae(e._zod,"propValues",()=>{let l=t.shape,f={};for(let g in l){let v=l[g]._zod;if(v.values){f[g]??(f[g]=new Set);for(let I of v.values)f[g].add(I)}}return f});let i=xt,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let g=l.value;if(!i(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let v=[],I=c.shape;for(let _ of c.keys){let s=I[_],d=s._zod.optout==="optional",y=s._zod.run({value:g[_],issues:[]},f);y instanceof Promise?v.push(y.then(m=>Yt(m,l,_,g,d))):Yt(y,l,_,g,d)}return u?ku(v,g,l,f,n.value,e):v.length?Promise.all(v).then(()=>l):l}});function no(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!et(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Me(c,n,Ae())))}),t)}o(no,"handleUnionResults");var Cr=S("$ZodUnion",(e,t)=>{te.init(e,t),ae(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ae(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ae(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ae(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Gt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(f=>no(f,i,e,u)):no(l,i,e,u)}});var yo=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Cr.init(e,t);let r=e._zod.parse;ae(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let g of f)i[l].add(g)}}return i});let n=Wt(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!xt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var ho=S("$ZodRecord",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Vn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let v=t.valueType._zod.run({value:i[g],issues:[]},n);v instanceof Promise?u.push(v.then(I=>{I.issues.length&&r.issues.push(...Ue(g,I.issues)),r.value[g]=I.value})):(v.issues.length&&r.issues.push(...Ue(g,v.issues)),r.value[g]=v.value)}let f;for(let g in i)l.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Or.test(l)&&f.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Me(I,n,Ae())),input:l,path:[l],inst:e});continue}let v=t.valueType._zod.run({value:i[l],issues:[]},n);v instanceof Promise?u.push(v.then(I=>{I.issues.length&&r.issues.push(...Ue(l,I.issues)),r.value[f.value]=I.value})):(v.issues.length&&r.issues.push(...Ue(l,v.issues)),r.value[f.value]=v.value)}}return u.length?Promise.all(u).then(()=>r):r}});var vo=S("$ZodEnum",(e,t)=>{te.init(e,t);let r=zr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Zn.has(typeof i)).map(i=>typeof i=="string"?Qe(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),xo=S("$ZodLiteral",(e,t)=>{if(te.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(n=>typeof n=="string"?Qe(n):n?Qe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var _o=S("$ZodTransform",(e,t)=>{te.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Zt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new $e;return r.value=i,r}});function oo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(oo,"handleOptionalResult");var Po=S("$ZodOptional",(e,t)=>{te.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ae(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Gt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>oo(u,r.value)):oo(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var bo=S("$ZodNullable",(e,t)=>{te.init(e,t),ae(e._zod,"optin",()=>t.innerType._zod.optin),ae(e._zod,"optout",()=>t.innerType._zod.optout),ae(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Gt(r.source)}|null)$`):void 0}),ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Io=S("$ZodPipe",(e,t)=>{te.init(e,t),ae(e._zod,"values",()=>t.in._zod.values),ae(e._zod,"optin",()=>t.in._zod.optin),ae(e._zod,"optout",()=>t.out._zod.optout),ae(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Xt(c,t.in,n)):Xt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Xt(u,t.out,n)):Xt(i,t.out,n)}});function Xt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Xt,"handlePipeResult");var To=S("$ZodCustom",(e,t)=>{tt.init(e,t),te.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>io(u,r,n,e));io(i,r,n,e)}});function io(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(kr(i))}}o(io,"handleRefineResult");var Eo,Nu=Symbol("ZodOutput"),Cu=Symbol("ZodInput"),Ur=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.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 n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function So(){return new Ur}o(So,"registry");(Eo=globalThis).__zod_globalRegistry??(Eo.__zod_globalRegistry=So());var Mr=globalThis.__zod_globalRegistry;function Ao(e,t){return new e({type:"string",...ee(t)})}o(Ao,"_string");function zo(e,t){return new e({type:"string",coerce:!0,...ee(t)})}o(zo,"_coercedString");function wo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ee(t)})}o(wo,"_url");function ko(e,t){return new e({type:"number",checks:[],...ee(t)})}o(ko,"_number");function Oo(e,t){return new e({type:"number",coerce:!0,checks:[],...ee(t)})}o(Oo,"_coercedNumber");function Ro(e,t){return new e({type:"boolean",...ee(t)})}o(Ro,"_boolean");function Do(e,t){return new e({type:"boolean",coerce:!0,...ee(t)})}o(Do,"_coercedBoolean");function No(e,t){return new e({type:"bigint",coerce:!0,...ee(t)})}o(No,"_coercedBigint");function Co(e){return new e({type:"any"})}o(Co,"_any");function Uo(e){return new e({type:"unknown"})}o(Uo,"_unknown");function Mo(e,t){return new e({type:"void",...ee(t)})}o(Mo,"_void");function jo(e,t){return new e({type:"date",coerce:!0,...ee(t)})}o(jo,"_coercedDate");function be(e,t){return new Yn({check:"min_length",...ee(t),minimum:e})}o(be,"_minLength");function je(e,t){return new Qn({check:"string_format",format:"regex",...ee(t),pattern:e})}o(je,"_regex");function Lo(e,t,r){let n=ee(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Lo,"_custom");var se=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");te.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Pt(e,r,n),e.parseAsync=async(r,n)=>Jt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>bt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>qt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),tr=S("ZodMiniString",(e,t)=>{Qt.init(e,t),se.init(e,t)});function a(e){return Ao(tr,e)}o(a,"string");var Fo=S("ZodMiniStringFormat",(e,t)=>{Dr.init(e,t),tr.init(e,t)});var Wu=S("ZodMiniURL",(e,t)=>{ao.init(e,t),Fo.init(e,t)});function Bo(e){return wo(Wu,e)}o(Bo,"url");var jr=S("ZodMiniNumber",(e,t)=>{so.init(e,t),se.init(e,t)});function ge(e){return ko(jr,e)}o(ge,"number");var Lr=S("ZodMiniBoolean",(e,t)=>{Nr.init(e,t),se.init(e,t)});function J(e){return Ro(Lr,e)}o(J,"boolean");var Vo=S("ZodMiniBigInt",(e,t)=>{uo.init(e,t),se.init(e,t)});var Gu=S("ZodMiniAny",(e,t)=>{co.init(e,t),se.init(e,t)});function Tt(){return Co(Gu)}o(Tt,"any");var qu=S("ZodMiniUnknown",(e,t)=>{lo.init(e,t),se.init(e,t)});function D(){return Uo(qu)}o(D,"unknown");var Ku=S("ZodMiniVoid",(e,t)=>{po.init(e,t),se.init(e,t)});function Zo(e){return Mo(Ku,e)}o(Zo,"_void");var Ho=S("ZodMiniDate",(e,t)=>{mo.init(e,t),se.init(e,t)});var Ju=S("ZodMiniArray",(e,t)=>{fo.init(e,t),se.init(e,t)});function M(e,t){return new Ju({type:"array",element:e,...ee(t)})}o(M,"array");var Xu=S("ZodMiniObject",(e,t)=>{go.init(e,t),se.init(e,t),ae(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...ee(t)};return new Xu(r)}o(p,"object");var Yu=S("ZodMiniUnion",(e,t)=>{Cr.init(e,t),se.init(e,t)});function j(e,t){return new Yu({type:"union",options:e,...ee(t)})}o(j,"union");var Qu=S("ZodMiniDiscriminatedUnion",(e,t)=>{yo.init(e,t),se.init(e,t)});function rt(e,t,r){return new Qu({type:"union",options:t,discriminator:e,...ee(r)})}o(rt,"discriminatedUnion");var ec=S("ZodMiniRecord",(e,t)=>{ho.init(e,t),se.init(e,t)});function N(e,t,r){return new ec({type:"record",keyType:e,valueType:t,...ee(r)})}o(N,"record");var tc=S("ZodMiniEnum",(e,t)=>{vo.init(e,t),se.init(e,t),e.options=Object.values(t.entries)});function Z(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new tc({type:"enum",entries:r,...ee(t)})}o(Z,"_enum");var rc=S("ZodMiniLiteral",(e,t)=>{xo.init(e,t),se.init(e,t)});function w(e,t){return new rc({type:"literal",values:Array.isArray(e)?e:[e],...ee(t)})}o(w,"literal");var nc=S("ZodMiniTransform",(e,t)=>{_o.init(e,t),se.init(e,t)});function Le(e){return new nc({type:"transform",transform:e})}o(Le,"transform");var oc=S("ZodMiniOptional",(e,t)=>{Po.init(e,t),se.init(e,t)});function h(e){return new oc({type:"optional",innerType:e})}o(h,"optional");var ic=S("ZodMiniNullable",(e,t)=>{bo.init(e,t),se.init(e,t)});function $t(e){return new ic({type:"nullable",innerType:e})}o($t,"nullable");var ac=S("ZodMiniPipe",(e,t)=>{Io.init(e,t),se.init(e,t)});function Fe(e,t){return new ac({type:"pipe",in:e,out:t})}o(Fe,"pipe");var sc=S("ZodMiniCustom",(e,t)=>{To.init(e,t),se.init(e,t)});function rr(e,t){return Lo(sc,e??(()=>!0),t)}o(rr,"custom");var Et={};Mn(Et,{bigint:()=>fc,boolean:()=>mc,date:()=>gc,number:()=>dc,string:()=>pc});function pc(e){return zo(tr,e)}o(pc,"string");function dc(e){return Oo(jr,e)}o(dc,"number");function mc(e){return Do(Lr,e)}o(mc,"boolean");function fc(e){return No(Vo,e)}o(fc,"bigint");function gc(e){return jo(Ho,e)}o(gc,"date");var Br=p({retryOnFailure:p({defaultValue:h(J()),hide:h(J())}),continueOnFailure:p({defaultValue:h(J()),hide:h(J())})}),Fr=class{constructor(t,r,n,i,u,c,l,f,g,v,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=v;this.aiMetadata=I}static{o(this,"IAction")}},nt=o(e=>new Fr(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 K=p({displayName:a(),description:h(a())}),V=o((e,t)=>p({type:w(t),required:J(),defaultValue:h(Tt())}),"TPropertyValue");var ve=p({...K.shape,...V(a(),"SHORT_TEXT").shape}),ze=p({...K.shape,...V(a(),"LONG_TEXT").shape});var Go=p({label:a(),value:D()}),nr=p({disabled:h(J()),placeholder:h(a()),options:M(Go)});var xe=p({...K.shape,options:nr,...V(D(),"STATIC_DROPDOWN").shape}),we=p({...K.shape,options:nr,...V(M(D()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Vr=p({...K.shape,...V(D(),"DROPDOWN").shape,refreshers:M(a())}),St=p({...K.shape,...V(M(D()),"MULTI_SELECT_DROPDOWN").shape,refreshers:M(a())});var ke=p({...K.shape,...V(J(),"CHECKBOX").shape});var Oe=p({...K.shape,...V(ge(),"NUMBER").shape});var At=p({...K.shape,...V(D(),"FILE").shape});var zt=p({...K.shape,...V(a(),"DATE_TIME").shape});var qo=N(a(),j([ve,ze,xe,St,we,ke,Oe,At,zt])),wt=p({...K.shape,properties:qo,...V(M(D()),"ARRAY").shape});var kt=p({...K.shape,...V(j([N(a(),D())]),"JSON").shape});var Ko=j([ve,xe,kt,wt,we]),hc=N(a(),Ko),Zr=p({refreshers:M(a()),...K.shape,...V(D(),"DYNAMIC").shape});var or=p({...K.shape,...V(Zo(),"MARKDOWN").shape});var Ot=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ot||{}),ot=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ot||{}),it=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(it||{});var Rt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Rt||{}),Hr="both_client_credentials_and_authorization_code";var Re=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Re||{}),Dt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(Dt||{}),vc=p({strategy:Z(Dt),paramName:h(a())}),Nt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Nt||{});var ir=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ir||{}),Jo=p({status:h(ge()),body:h(D()),headers:h(N(a(),a()))}),Xo=p({type:w("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(Z(ir))}),Yo=p({type:w("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Jo,handlerId:h(a()),streamStepProgress:h(Z(ir))}),xc=j([Xo,Yo]);var _c=p({body:D(),rawBody:h(D()),headers:N(a(),a()),queryParams:N(a(),a())});function pe(e){return e==null}o(pe,"isNil");function Ct(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(Ct,"isEmpty");function ar(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(ar,"assertNotNullOrUndefined");var Wr=Ce(require("crypto"),1);var Pc=128,Ge,at,bc=o(e=>{!Ge||Ge.length<e?(Ge=Buffer.allocUnsafe(e*Pc),Wr.default.randomFillSync(Ge),at=0):at+e>Ge.length&&(Wr.default.randomFillSync(Ge),at=0),at+=e},"fillPool"),Ic=o(e=>(bc(e|=0),Ge.subarray(at-e,at)),"random"),Tc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),ei=o((e,t=21)=>Tc(e,t,Ic),"customAlphabet");var $c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ti=21,Ab=a().check(je(new RegExp(`^[0-9a-zA-Z]{${ti}}$`))),Ec=ei($c,ti);var Be=Fe(Le(e=>e instanceof Date?e.toISOString():e),a()),Pe={id:a(),created:Be,updated:Be},Q=o(e=>h($t(e)),"Nullable");function Gr(e){return h($t(Z(e)))}o(Gr,"NullableEnum");var kb=Fe(Le(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(J())),sr=o(e=>Fe(Le(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(M(e))),"OptionalArrayFromQuery");var Db=N(a(),D());var Ut=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(Ut||{});var Wb=a().check(je(/^#[0-9A-Fa-f]{6}$/));var qb=p({filename:a(),data:D(),type:w("file"),mimetype:h(a())});var Sc=Ce(ni());var tI=p({...Pe,name:a(),permissions:M(a()),platformId:Q(a()),type:a(),userCount:h(ge())});var oi=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(oi||{}),qr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(qr||{}),Kr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Kr||{});var Jr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Jr||{});var Xr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Xr||{});var Ac=p({mode:Z(oi),value:D()}),zc=p({auth:h(a()),fields:N(a(),Ac)}),wc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(zc)}),kc=p({type:w("PIECE"),toolName:a().check(be(1)),pieceMetadata:wc}),Oc=p({type:w("none")}),Rc=p({type:w("access_token"),accessToken:a()}),Dc=p({type:w("api_key"),apiKey:a(),apiKeyHeader:a()}),Nc=p({type:w("headers"),headers:N(a(),a())}),Cc=rt("type",[Oc,Rc,Dc,Nc]),ii=p({type:w("FLOW"),toolName:a().check(be(1)),externalFlowId:a(),flowDisplayName:h(a())}),ai=p({type:w("MCP"),toolName:a().check(be(1)),serverUrl:Bo(),protocol:Z(Kr),auth:Cc}),si=p({type:w("KNOWLEDGE_BASE"),toolName:a().check(be(1)),sourceType:Z(qr),sourceId:a(),sourceName:a()}),Uc=rt("type",[kc,ii,ai,si]),Mc=p({displayName:a(),description:h(a()),type:Z(Jr)}),ui=p({type:w("MARKDOWN"),markdown:a()}),st={type:w("TOOL_CALL"),input:Q(N(a(),D())),output:h(D()),toolName:a(),status:Z(Xr),toolCallId:a(),startTime:a(),endTime:h(a())},AI=p(st),ci=rt("toolCallType",[p({...st,toolCallType:w("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...st,toolCallType:w("FLOW"),displayName:a(),externalFlowId:a()}),p({...st,toolCallType:w("MCP"),displayName:a(),serverUrl:a()}),p({...st,toolCallType:w("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...st,toolCallType:w("UNKNOWN"),displayName:a()})]),jc=j([ui,ci]);var Yr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Yr||{}),De=p({apiKey:a()}),Lc=De,Fc=p({apiKey:a(),apiKeyHash:a()}),Bc=De,Vc=De,Zc=De,Hc=De,Wc=De,Gc=De,qc=De,li=p({accessKeyId:a().check(be(1)),secretAccessKey:a().check(be(1))}),Kc=p({}),Jc=p({}),Xc=p({}),Yc=p({}),Qc=p({}),el=p({}),pi=p({modelId:a(),modelName:a(),modelType:Z(Yr)}),di=p({apiKeyHeader:a(),baseUrl:a(),models:M(pi),defaultHeaders:h(N(a(),a()))}),mi=p({accountId:a(),gatewayId:a(),models:M(pi),vertexProject:h(a()),vertexRegion:h(a())}),fi=p({resourceName:a(),apiVersion:Fe(Le(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),gi=p({region:a().check(be(1))}),tl=j([Lc,Zc,Hc,Wc,Gc,Vc,Bc,Fc,li,qc]),yi=j([di,mi,fi,gi,Kc,Xc,Yc,Qc,Jc,el]),rl=p({id:a(),name:a(),type:Z(Yr)}),nl=p({id:a(),name:a(),provider:Z(Ut),config:yi,enabledForChat:J()}),ol=p({provider:Z(Ut),config:yi,auth:tl,platformId:a()});var OI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var il=p({base64Url:a(),fileName:a(),extension:h(a())}),al=p({mimeType:a(),url:a(),fileName:h(a())}),Qr=j([il,al]);var sl=j([p({type:w("file"),value:Qr}),p({type:w("markdown"),value:a(),files:h(M(Qr))})]),ul=p({sessionId:a(),message:a(),files:h(M(a()))});var vi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(vi||{}),xi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(xi||{}),en=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(en||{});var cl=j([p({...Pe,name:a(),externalId:a(),type:w("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:M(p({value:a()}))})}),p({...Pe,name:a(),externalId:a(),type:j([w("TEXT"),w("NUMBER"),w("DATE")]),tableId:a(),projectId:a()})]),ll=p({...Pe,name:a(),folderId:Q(a()),projectId:a(),externalId:a(),status:Gr(xi),trigger:Gr(vi)}),pl=p({...Pe,tableId:a(),projectId:a(),cells:N(a(),p({updated:a(),created:a(),value:D(),fieldName:a()}))}),dl=p({events:M(Z(en)),webhookUrl:a(),flowId:a()}),ml=p({fields:M(p({id:a(),name:a()})),rows:M(N(a(),a())),name:a()}),fl=p({projectId:a(),limit:h(Et.number()),cursor:h(a()),name:h(a()),externalIds:sr(a()),folderId:h(a()),folderIds:sr(a())}),gl=p({records:M(M(p({fieldId:a(),value:Pi()}))),tableId:a()}),yl=p({cells:h(M(p({fieldId:a(),value:Pi()}))),tableId:a(),agentUpdate:h(J())}),_i=rt("operator",[qe("eq"),qe("neq"),qe("gt"),qe("gte"),qe("lt"),qe("lte"),qe("co"),hi("exists"),hi("not_exists")]),hl=p({tableId:a(),limit:h(Et.number()),cursor:h(a()),filters:sr(_i)});function Pi(){return Fe(Le(e=>e==null?e:String(e)),$t(a()))}o(Pi,"coerceToString");function qe(e){return p({fieldId:a(),operator:w(e),value:a()})}o(qe,"valueFilter");function hi(e){return p({fieldId:a(),operator:w(e)})}o(hi,"existenceFilter");var vl=p({status:h(ge()),body:h(D()),headers:h(N(a(),a()))}),xl=p({...Pe,deleted:Q(Be),ownerId:a(),displayName:a(),platformId:a(),externalId:Q(a())});var bi=p({name:a(),description:h(a()),type:a(),required:J()}),_l=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:M(bi),returnsResponse:J()})});var Ii="^[0-9]+\\.[0-9]+\\.[0-9]+$",XI=new RegExp(Ii),bl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",YI=a().check(je(new RegExp(Ii))),QI=a().check(je(new RegExp(bl))),Il=p({packageType:w("ARCHIVE"),pieceType:Z(ot),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Ti=p({packageType:w("REGISTRY"),pieceType:w("OFFICIAL"),pieceName:a(),pieceVersion:a()}),$i=p({packageType:w("REGISTRY"),pieceType:w("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),eT=j([Ti,$i]),tT=j([Il,Ti,$i]),Ei=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(Ei||{}),Tl=p({type:Z(Ei),cronExpression:a(),timezone:a()}),rT=p({...Pe,type:Z(Re),projectId:a(),flowId:a(),triggerName:a(),schedule:Q(Tl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Q(a()),simulate:J()}),Si=(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))(Si||{}),Ai=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ai||{}),zi=(r=>(r.S3="S3",r.DB="DB",r))(zi||{}),nT=p({...Pe,projectId:Q(a()),platformId:Q(a()),type:Z(Si),compression:Z(Ai),data:h(D()),location:Z(zi),size:Q(ge()),fileName:Q(a()),s3Key:Q(a()),metadata:Q(N(a(),a()))}),wi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(wi||{}),ki=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ki||{}),oT=p({id:a(),email:a(),firstName:a(),status:Z(ki),externalId:Q(a()),platformId:Q(a()),platformRole:Z(wi),lastName:a(),created:Be,updated:Be,lastActiveDate:Q(Be),imageUrl:Q(a())});var tn=p({...K.shape,...V(N(a(),D()),"OBJECT").shape});var Ni=p({...K.shape,...V(a(),"COLOR").shape});var rn=j([ve,ze,or,ke,xe,we,Vr,St,Zr,Oe,wt,tn,kt,zt,At,Ni]),q={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 Ee=p({displayName:a(),description:h(a())});var Ci=p({username:a(),password:a()}),nn=p({...Ee.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...V(Ci,"BASIC_AUTH").shape});var Al=N(a(),j([ve,ze,Oe,ke,xe])),on=p({...Ee.shape,props:Al,...V(D(),"CUSTOM_AUTH").shape});var Ke=p({...Ee.shape,...V(p({auth:a()}),"SECRET_TEXT").shape});var zl=N(a(),j([ve,ze,Ke,Oe,ke,xe,we,or])),Ui=p({...Ee.shape,props:zl,...V(D(),"OIDC").shape});var an=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(an||{}),Mi=j([ve,Ke,xe]),ji=N(a(),Mi),wl=p({props:h(N(a(),Mi)),authUrl:a(),tokenUrl:a(),scope:M(a()),prompt:h(j([w("none"),w("consent"),w("login"),w("omit")])),pkce:h(J()),pkceMethod:h(j([w("plain"),w("S256")])),authorizationMethod:h(Z(an)),grantType:h(j([Z(Rt),w(Hr)])),extra:h(N(a(),a()))}),Li=p({access_token:a(),props:h(ji),data:N(a(),Tt())}),sn=p({...Ee.shape,...wl.shape,...V(Li,"OAUTH2").shape});var ut=j([nn,on,Ui,sn,Ke]),Mt="Connection",un={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Mt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Mt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Mt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Mt}},None(){}};var C$={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 kl=p({...K.shape,...V(D(),"CUSTOM").shape,code:a()});var Ol=j([rn,ut]),cn=N(a(),Ol),rE=N(a(),rn);var Fi=j([p({strategy:w("CRON"),cronExpression:a()}),p({strategy:w("NONE")})]),ct=class{constructor(t,r,n,i,u,c,l,f,g,v,I,_,s,d,y,m,x,P,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=v;this.onEnable=I;this.onDisable=_;this.onStart=s;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=L}static{o(this,"ITrigger")}},cr=o(e=>{switch(e.type){case"WEBHOOK":return new ct(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 ct(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 ct(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 ct(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,pe(e.sampleData)&&pe(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Bi="2",lr="0.82.0";var ln=class{constructor(t,r,n,i,u,c,l,f,g=lr,v,I=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=v;this.description=I;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Bi}),"getContextInfo");(!Rl(g)||Dl(g,lr))&&(this.minimumSupportedRelease=lr),u.forEach(_=>this._actions[_.name]=_),c.forEach(_=>this._triggers[_.name]=_)}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,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Vi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new ln(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function Rl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Rl,"isValidSimpleSemver");function Dl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Dl,"isSemverLessThan");var Nl=h(N(a(),N(a(),a()))),Zi=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:M(a()),platformId:h(a()),directoryPath:h(a()),auth:h(j([ut,M(ut)])),version:a(),categories:h(M(Z(it))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:Nl}),Cl=Z(["human","ai","both"]),Hi=p({description:h(a()),idempotent:h(J())}),Wi=p({name:a(),displayName:a(),description:a(),props:cn,requireAuth:J(),errorHandlingOptions:h(Br),outputSchema:h(rr()),audience:h(Cl),aiMetadata:h(Hi)}),Gi=p({name:a(),displayName:a(),description:a(),props:cn,errorHandlingOptions:h(Br),type:Z(Re),sampleData:D(),handshakeConfiguration:h(rr()),renewConfiguration:h(Fi),testStrategy:Z(Nt),outputSchema:h(rr()),aiMetadata:h(Hi)}),Ul=p({...Zi.shape,actions:N(a(),Wi),triggers:N(a(),Gi)}),Ml=p({...Zi.shape,actions:ge(),triggers:ge(),suggestedActions:h(M(Gi)),suggestedTriggers:h(M(Wi))}),qi=p({projectUsage:ge(),tags:h(M(a())),pieceType:Z(ot),packageType:Z(Ot),platformId:h(a()),archiveId:h(a())}),rS=p({...Ul.shape,...qi.shape}),nS=p({...Ml.shape,...qi.shape}),oS=p({name:a(),version:a()});var jl=Ce(require("path")),Ll=Ce(require("fs/promises"));var pr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var dr=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new pn,r=new dn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},pn=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},dn=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var mr=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var fr=class extends pr{static{o(this,"FetchHttpClient")}constructor(t="",r=new dr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[L,oe]of Object.entries(c))i.append(L,oe);let l=i.toString(),f=l?`${n}?${l}`:n,g=t.responseType??"json",v=t.followRedirects??!0,I=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Fl(t.body,u),y=Vl({...u,...s}),m=await Bl(async()=>{let L=new AbortController,oe=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let fe={method:t.method.toString(),headers:y,body:_,redirect:v?"follow":"manual",signal:L.signal};return d&&(fe.duplex="half"),r?.dispatcher!==void 0&&(fe.dispatcher=r.dispatcher),await fetch(f,fe)}finally{oe!==void 0&&clearTimeout(oe)}},I),x=v?300:400;if(m.status<200||m.status>=x){let L=await Ki(m,g),oe=new mr(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",oe),oe}let P=await Ki(m,g);return{status:m.status,headers:Zl(m.headers),body:P}}};function Fl(e,t){return Wl(e)?{body:void 0,extraHeaders:{},isStream:!1}:Hl(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Fl,"serializeBody");async function Ki(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ki,"parseResponseBody");async function Bl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ji(n);continue}return i}catch(i){if(r=i,n<t){await Ji(n);continue}throw i}throw r}o(Bl,"sendWithRetries");function Ji(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ji,"backoff");function Vl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(Vl,"normalizeHeaders");function Zl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Zl,"toHttpHeaders");function Hl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(Hl,"isNodeFormData");function Wl(e){return e==null}o(Wl,"isNil");var gr=new fr;var jt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(jt||{});var Rd=Ce(require("fs")),ru=Ce(tu());var Dd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function Nd(e){let t=e.split(";")[0].trim().toLowerCase();return Dd[t]??""}o(Nd,"contentTypeToExtension");var Cd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Ud=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function nu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return nt({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:q.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:q.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Ud(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:q.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(jt).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:q.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:q.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:q.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:q.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let v=g,I={};switch(v){case"none":break;case"json":I.data=q.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=q.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=q.Array({displayName:"Form Data",required:!0,properties:{fieldName:q.ShortText({displayName:"Field Name",required:!0}),fieldType:q.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:q.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:q.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:q.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:q.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:q.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:q.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async g=>{let{method:v,url:I,headers:_,queryParams:s,body:d,body_type:y,failsafe:m,timeout:x,response_is_binary:P,followRedirects:L}=g.propsValue;ar(v,"Method"),ar(I,"URL");let oe=pe(r)?{}:await r(g.auth,g.propsValue),fe=I.url,Te=fe.startsWith("http://")||fe.startsWith("https://")?fe:Cd({baseUrl:t(g.auth),relativePath:fe}),X={method:v,url:Te,headers:{..._??{},...f==="headers"||!pe(f)?oe:{}},queryParams:{...f==="queryParams"?oe:{},...s??{}},timeout:x?x*1e3:0,followRedirects:L};if(P&&(X.responseType="arraybuffer"),d)if(y&&y!=="none"){let H=d.data;if(y==="form_data"){let Xe=H,Ze=new ru.default;for(let{fieldName:U,fieldType:T,textFieldValue:b,fileFieldValue:E}of Xe)T==="text"&&!Ct(b)?Ze.append(U,b):T==="file"&&!Ct(E)&&Ze.append(U,E.data,{filename:E?.filename});X.body=Ze,X.headers={...X.headers,...Ze.getHeaders()}}else X.body=H}else y||(X.body=d);try{let H=await gr.sendRequest(X);return await Md(g.files,H.body,H.status,H.headers,P)}catch(H){if(m)return H.errorMessage();throw H}},"run")})}o(nu,"createCustomApiCallAction");var Md=o(async(e,t,r,n,i)=>{let u;if(i&&jd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Nd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),jd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Se={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(pe(l))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),g=f.reduce((v,I)=>Math.max(v,I.epochMilliSeconds),l);return await t.put("lastPoll",g),f.filter(v=>v.epochMilliSeconds>l).map(v=>v.data)}case 1:{let l=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:u,server:c}),g=f.findIndex(_=>_.id===l),v=[];pe(l)||g==-1?v=f??[]:v=f?.slice(0,g)??[],pe(i)||(v=v.slice(-i));let I=v?.[0]?.id;return pe(I)||await t.put("lastItem",I),v.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;pe(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:u}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:u});break}}return Ld(c.map(l=>l.data))}};function Ld(e){return e.length<=5?e:e.slice(0,5)}o(Ld,"getFirstFiveOrAll");var Fd={baseUrl:"https://api.chatling.ai/v2"};async function de(e,t,r,n){return(await gr.sendRequest({method:t,url:`${Fd.baseUrl}${r}`,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:n})).body}o(de,"makeRequest");var Bd=`
|
|
14
4
|
To obtain your API key:
|
|
15
5
|
|
|
16
6
|
1. Go to your [Chatling account](https://app.chatling.ai)
|
|
@@ -18,45 +8,14 @@ To obtain your API key:
|
|
|
18
8
|
3. Click the **API Keys** tab
|
|
19
9
|
4. Press **New API key** and generate a new key
|
|
20
10
|
5. Copy the key (it's only shown once)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
valid: false,
|
|
34
|
-
error: 'Invalid API key',
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}),
|
|
38
|
-
});
|
|
39
|
-
exports.chatling = (0, pieces_framework_1.createPiece)({
|
|
40
|
-
displayName: 'Chatling',
|
|
41
|
-
description: 'Build AI chatbots trained on your data.',
|
|
42
|
-
auth: exports.chatlingAuth,
|
|
43
|
-
minimumSupportedRelease: '0.36.1',
|
|
44
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/chatling.png',
|
|
45
|
-
categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
|
46
|
-
authors: ['onyedikachi-david'],
|
|
47
|
-
actions: [
|
|
48
|
-
send_message_1.sendMessage,
|
|
49
|
-
create_chatbot_1.createChatbot,
|
|
50
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
51
|
-
auth: exports.chatlingAuth,
|
|
52
|
-
baseUrl: () => 'https://api.chatling.ai/v2',
|
|
53
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
-
return ({
|
|
55
|
-
Authorization: `Bearer ${auth.secret_text}`,
|
|
56
|
-
});
|
|
57
|
-
}),
|
|
58
|
-
}),
|
|
59
|
-
],
|
|
60
|
-
triggers: [new_conversation_1.newConversation, new_contact_1.newContact],
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
`,le=un.SecretText({displayName:"API Key",description:Bd,required:!0,validate:o(async({auth:e})=>{try{return await de(e,"GET","/project/settings"),{valid:!0}}catch{return{valid:!1,error:"Invalid API key"}}},"validate")});var gt=q.Dropdown({auth:le,displayName:"Chatbot",description:"Select a chatbot",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:(await de(e.secret_text,"GET","/chatbots")).data.chatbots.map(n=>({label:n.name,value:n.id}))}:{disabled:!0,placeholder:"Please connect your account first.",options:[]},"options")}),ou=q.Dropdown({auth:le,displayName:"AI Model",description:"Select the AI model to use",required:!0,refreshers:["chatbotId"],options:o(async({auth:e,chatbotId:t})=>e?t?{disabled:!1,options:(await de(e.secret_text,"GET",`/chatbots/${t}/ai/kb/models`)).data.models.map(i=>({label:i.name,value:i.id}))}:{disabled:!0,placeholder:"Please select a chatbot first.",options:[]}:{disabled:!0,placeholder:"Please connect your account first.",options:[]},"options")}),iu=q.Dropdown({auth:le,displayName:"Language",description:"Select the language for the AI response",required:!1,refreshers:["chatbotId"],options:o(async({auth:e,chatbotId:t})=>e?t?{disabled:!1,options:(await de(e.secret_text,"GET",`/chatbots/${t}/ai/kb/languages`)).data.languages.map(i=>({label:i.name,value:i.id}))}:{disabled:!0,placeholder:"Please select a chatbot first.",options:[]}:{disabled:!0,placeholder:"Please connect your account first.",options:[]},"options")}),au=q.Dropdown({auth:le,displayName:"Contact",description:"Associate the conversation with a contact",required:!1,refreshers:["chatbotId"],options:o(async({auth:e,chatbotId:t})=>e?t?{disabled:!1,options:(await de(e.secret_text,"GET",`/chatbots/${t}/contacts`)).data.contacts.map(i=>({label:i.name||i.email||i.id,value:i.id}))}:{disabled:!0,placeholder:"Please select a chatbot first.",options:[]}:{disabled:!0,placeholder:"Please connect your account first.",options:[]},"options")}),su=q.Dropdown({auth:le,displayName:"Template",description:"Use a template to create the chatbot",required:!1,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:(await de(e.secret_text,"GET","/chatbot-templates")).data.templates.map(n=>({label:n.name,value:n.id}))}:{disabled:!0,placeholder:"Please connect your account first.",options:[]},"options")}),uu=q.Dropdown({auth:le,displayName:"Conversation",description:"Continue an existing conversation",required:!1,refreshers:["chatbotId"],options:o(async({auth:e,chatbotId:t})=>e?t?{disabled:!1,options:(await de(e.secret_text,"GET",`/chatbots/${t}/conversations`)).data.conversations.map(i=>{let u=i.messages?.find(l=>l.role==="user");return{label:u?.text?u.text.substring(0,50)+(u.text.length>50?"...":""):i.created_at,value:i.id}})}:{disabled:!0,placeholder:"Please select a chatbot first.",options:[]}:{disabled:!0,placeholder:"Please connect your account first.",options:[]},"options")});var cu=nt({auth:le,name:"send_message",displayName:"Send Message",description:"Send a message to the chatbot and receive an AI response.",audience:"both",aiMetadata:{description:"Send a user message to a specific Chatling chatbot and get back the AI-generated reply, querying the bot's knowledge base. Use to converse with or test a deployed chatbot programmatically. Requires the chatbot ID and message; optionally pass a conversation_id to continue an existing thread (omit it to start a new one) and tune the AI model, language, temperature, or extra instructions. Not idempotent \u2014 each call generates a fresh response and appends to the conversation.",idempotent:!1},props:{chatbotId:gt,message:q.LongText({displayName:"Message",description:"The message to send to the AI",required:!0}),ai_model_id:ou,conversation_id:uu,contact_id:au,language_id:iu,temperature:q.Number({displayName:"Temperature",description:"Controls randomness (0 = focused, 1 = creative). Default is 0.",required:!1,defaultValue:0}),instructions:q.Array({displayName:"Instructions",description:"Additional instructions to tailor the AI response",required:!1})},async run(e){let{chatbotId:t,message:r,ai_model_id:n,conversation_id:i,contact_id:u,language_id:c,temperature:l,instructions:f}=e.propsValue,g=e.auth.secret_text,v={message:r,ai_model_id:n};return i&&(v.conversation_id=i),u&&(v.contact_id=u),c&&(v.language_id=c),l!=null&&(v.temperature=l),f&&f.length>0&&(v.instructions=f),await de(g,"POST",`/chatbots/${t}/ai/kb/chat`,v)}});var lu=nt({auth:le,name:"create_chatbot",displayName:"Create Chatbot",description:"Create a new chatbot using a template or from scratch.",audience:"both",aiMetadata:{description:"Create a new Chatling chatbot in the account, either seeded from an existing template or built from scratch when no template is given. Use when an agent needs to provision a new bot. Requires a name; the template ID is optional. Not idempotent \u2014 each call creates a separate chatbot, even with identical input.",idempotent:!1},props:{name:q.ShortText({displayName:"Name",description:"The name of the chatbot",required:!0}),template_id:su},async run(e){let{name:t,template_id:r}=e.propsValue,n=e.auth.secret_text,i={name:t};return r&&(i.template_id=r),await de(n,"POST","/chatbots",i)}});var Cn=Ce(Nn());var $r={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>(await de(e.secret_text,"GET",`/chatbots/${t.chatbotId}/conversations?sort=date_desc`)).data.conversations.filter(c=>r===0?!0:(0,Cn.default)(c.created_at).valueOf()>r).map(c=>({epochMilliSeconds:(0,Cn.default)(c.created_at).valueOf(),data:c})),"items")},pu=cr({auth:le,name:"new_conversation",displayName:"New Conversation",description:"Triggers when a new conversation is started by a customer.",aiMetadata:{description:"Fires when a customer starts a new conversation with the selected Chatling chatbot. Each event represents one newly created conversation, including its contact and initial messages. Polls the chatbot's conversations on an interval, deduplicating by creation time."},props:{chatbotId:gt},type:"POLLING",async onEnable(e){await Se.onEnable($r,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Se.onDisable($r,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Se.test($r,e)},async run(e){return await Se.poll($r,e)},sampleData:{id:"conv_abc123",contact_id:"contact_xyz",archived:!1,important:!1,created_at:"2024-01-15T10:30:00.000Z",messages:[{id:"msg_1",text:"Hello, I need help with your product.",role:"user"}]}});var Un=Ce(Nn());var Er={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>(await de(e.secret_text,"GET",`/chatbots/${t.chatbotId}/contacts?sort=date_desc`)).data.contacts.filter(c=>r===0?!0:(0,Un.default)(c.created_at).valueOf()>r).map(c=>({epochMilliSeconds:(0,Un.default)(c.created_at).valueOf(),data:c})),"items")},du=cr({auth:le,name:"new_contact",displayName:"New Contact/Lead",description:"Triggers when a new contact or lead is collected by the chatbot.",aiMetadata:{description:"Fires when the selected Chatling chatbot collects a new contact or lead. Each event represents one newly captured contact with its details (name, email, phone, company, and similar fields). Polls the chatbot's contacts on an interval, deduplicating by creation time."},props:{chatbotId:gt},type:"POLLING",async onEnable(e){await Se.onEnable(Er,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await Se.onDisable(Er,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await Se.test(Er,e)},async run(e){return await Se.poll(Er,e)},sampleData:{id:"contact_abc123",name:"John Doe",email:"john@example.com",phone:"+1234567890",job_title:"Product Manager",website:"https://example.com",company:"Acme Inc",created_at:"2024-01-15T10:30:00.000Z"}});var Zd=Vi({displayName:"Chatling",description:"Build AI chatbots trained on your data.",auth:le,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/chatling.png",categories:["ARTIFICIAL_INTELLIGENCE"],authors:["onyedikachi-david"],actions:[cu,lu,nu({auth:le,baseUrl:o(()=>"https://api.chatling.ai/v2","baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[pu,du]});0&&(module.exports={chatling});
|
|
12
|
+
/*! Bundled license information:
|
|
13
|
+
|
|
14
|
+
mime-types/index.js:
|
|
15
|
+
(*!
|
|
16
|
+
* mime-types
|
|
17
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
18
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
19
|
+
* MIT Licensed
|
|
20
|
+
*)
|
|
21
|
+
*/
|
package/README.md
DELETED
package/src/index.d.ts
DELETED
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/chatling/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAGqC;AACrC,qEAAwE;AACxE,iDAAqD;AACrD,yCAA2C;AAC3C,6DAAyD;AACzD,iEAA6D;AAC7D,sEAAkE;AAClE,4DAAwD;AAExD,MAAM,mBAAmB,GAAG;;;;;;;;CAQ3B,CAAC;AAEW,QAAA,YAAY,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,mBAAmB;IAChC,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,IAAA,oBAAW,EAAC,IAAI,EAAE,0BAAU,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;YAC7D,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,iBAAiB;aACzB,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,yCAAyC;IACtD,IAAI,EAAE,oBAAY;IAClB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,0BAAW;QACX,8BAAa;QACb,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,oBAAY;YAClB,OAAO,EAAE,GAAG,EAAE,CAAC,4BAA4B;YAC3C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAW,IAAgC,CAAC,WAAW,EAAE;iBACzE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,kCAAe,EAAE,wBAAU,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const createChatbot: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
template_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
}>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createChatbot = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const index_1 = require("../../index");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const props_1 = require("../common/props");
|
|
10
|
-
exports.createChatbot = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: index_1.chatlingAuth,
|
|
12
|
-
name: 'create_chatbot',
|
|
13
|
-
displayName: 'Create Chatbot',
|
|
14
|
-
description: 'Create a new chatbot using a template or from scratch.',
|
|
15
|
-
props: {
|
|
16
|
-
name: pieces_framework_1.Property.ShortText({
|
|
17
|
-
displayName: 'Name',
|
|
18
|
-
description: 'The name of the chatbot',
|
|
19
|
-
required: true,
|
|
20
|
-
}),
|
|
21
|
-
template_id: props_1.templateIdDropdown,
|
|
22
|
-
},
|
|
23
|
-
run(context) {
|
|
24
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const { name, template_id } = context.propsValue;
|
|
26
|
-
const apiKey = context.auth.secret_text;
|
|
27
|
-
const body = { name };
|
|
28
|
-
if (template_id)
|
|
29
|
-
body['template_id'] = template_id;
|
|
30
|
-
const response = yield (0, common_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.POST, '/chatbots', body);
|
|
31
|
-
return response;
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=create-chatbot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-chatbot.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/chatling/src/lib/actions/create-chatbot.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,uCAA2C;AAC3C,sCAAwC;AACxC,2CAAqD;AAExC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,oBAAY;IAClB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,wDAAwD;IACrE,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,0BAAkB;KAChC;IAEK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACjD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YAExC,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,CAAC;YAE/C,IAAI,WAAW;gBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YAEnD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,MAAM,EACN,0BAAU,CAAC,IAAI,EACf,WAAW,EACX,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const sendMessage: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
message: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
-
ai_model_id: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
-
conversation_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
-
contact_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
-
language_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
8
|
-
temperature: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
-
instructions: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
10
|
-
}>;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendMessage = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const index_1 = require("../../index");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const props_1 = require("../common/props");
|
|
10
|
-
exports.sendMessage = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: index_1.chatlingAuth,
|
|
12
|
-
name: 'send_message',
|
|
13
|
-
displayName: 'Send Message',
|
|
14
|
-
description: 'Send a message to the chatbot and receive an AI response.',
|
|
15
|
-
props: {
|
|
16
|
-
chatbotId: props_1.chatbotIdDropdown,
|
|
17
|
-
message: pieces_framework_1.Property.LongText({
|
|
18
|
-
displayName: 'Message',
|
|
19
|
-
description: 'The message to send to the AI',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
ai_model_id: props_1.aiModelIdDropdown,
|
|
23
|
-
conversation_id: props_1.conversationIdDropdown,
|
|
24
|
-
contact_id: props_1.contactIdDropdown,
|
|
25
|
-
language_id: props_1.languageIdDropdown,
|
|
26
|
-
temperature: pieces_framework_1.Property.Number({
|
|
27
|
-
displayName: 'Temperature',
|
|
28
|
-
description: 'Controls randomness (0 = focused, 1 = creative). Default is 0.',
|
|
29
|
-
required: false,
|
|
30
|
-
defaultValue: 0,
|
|
31
|
-
}),
|
|
32
|
-
instructions: pieces_framework_1.Property.Array({
|
|
33
|
-
displayName: 'Instructions',
|
|
34
|
-
description: 'Additional instructions to tailor the AI response',
|
|
35
|
-
required: false,
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
run(context) {
|
|
39
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const { chatbotId, message, ai_model_id, conversation_id, contact_id, language_id, temperature, instructions, } = context.propsValue;
|
|
41
|
-
const apiKey = context.auth.secret_text;
|
|
42
|
-
const body = {
|
|
43
|
-
message,
|
|
44
|
-
ai_model_id,
|
|
45
|
-
};
|
|
46
|
-
if (conversation_id)
|
|
47
|
-
body['conversation_id'] = conversation_id;
|
|
48
|
-
if (contact_id)
|
|
49
|
-
body['contact_id'] = contact_id;
|
|
50
|
-
if (language_id)
|
|
51
|
-
body['language_id'] = language_id;
|
|
52
|
-
if (temperature !== undefined && temperature !== null)
|
|
53
|
-
body['temperature'] = temperature;
|
|
54
|
-
if (instructions && instructions.length > 0)
|
|
55
|
-
body['instructions'] = instructions;
|
|
56
|
-
const response = yield (0, common_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.POST, `/chatbots/${chatbotId}/ai/kb/chat`, body);
|
|
57
|
-
return response;
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=send-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/chatling/src/lib/actions/send-message.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,uCAA2C;AAC3C,sCAAwC;AACxC,2CAMyB;AAEZ,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,oBAAY;IAClB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,2DAA2D;IACxE,KAAK,EAAE;QACL,SAAS,EAAE,yBAAiB;QAC5B,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACzB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,yBAAiB;QAC9B,eAAe,EAAE,8BAAsB;QACvC,UAAU,EAAE,yBAAiB;QAC7B,WAAW,EAAE,0BAAkB;QAC/B,WAAW,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC3B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IAEK,GAAG,CAAC,OAAO;;YACf,MAAM,EACJ,SAAS,EACT,OAAO,EACP,WAAW,EACX,eAAe,EACf,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,GACb,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC;YAExC,MAAM,IAAI,GAA4B;gBACpC,OAAO;gBACP,WAAW;aACZ,CAAC;YAEF,IAAI,eAAe;gBAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,eAAe,CAAC;YAC/D,IAAI,UAAU;gBAAE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAChD,IAAI,WAAW;gBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACnD,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI;gBACnD,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACpC,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC;gBACzC,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAEtC,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,MAAM,EACN,0BAAU,CAAC,IAAI,EACf,aAAa,SAAS,aAAa,EACnC,IAAI,CACL,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chatlingCommon = void 0;
|
|
4
|
-
exports.makeRequest = makeRequest;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
exports.chatlingCommon = {
|
|
8
|
-
baseUrl: 'https://api.chatling.ai/v2',
|
|
9
|
-
};
|
|
10
|
-
function makeRequest(apiKey, method, path, body) {
|
|
11
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
13
|
-
method,
|
|
14
|
-
url: `${exports.chatlingCommon.baseUrl}${path}`,
|
|
15
|
-
headers: {
|
|
16
|
-
Authorization: `Bearer ${apiKey}`,
|
|
17
|
-
'Content-Type': 'application/json',
|
|
18
|
-
},
|
|
19
|
-
body,
|
|
20
|
-
});
|
|
21
|
-
return response.body;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/chatling/src/lib/common/index.ts"],"names":[],"mappings":";;;AAMA,kCAiBC;;AAvBD,+DAAqE;AAExD,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAE,4BAA4B;CACtC,CAAC;AAEF,SAAsB,WAAW,CAC/B,MAAc,EACd,MAAkB,EAClB,IAAY,EACZ,IAAc;;QAEd,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI;YAC/C,MAAM;YACN,GAAG,EAAE,GAAG,sBAAc,CAAC,OAAO,GAAG,IAAI,EAAE;YACvC,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,MAAM,EAAE;gBACjC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const chatbotIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
2
|
-
export declare const aiModelIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
-
export declare const languageIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
export declare const contactIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
-
export declare const templateIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
-
export declare const conversationIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
package/src/lib/common/props.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.conversationIdDropdown = exports.templateIdDropdown = exports.contactIdDropdown = exports.languageIdDropdown = exports.aiModelIdDropdown = exports.chatbotIdDropdown = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const index_1 = require("./index");
|
|
8
|
-
const index_2 = require("../../index");
|
|
9
|
-
exports.chatbotIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
10
|
-
auth: index_2.chatlingAuth,
|
|
11
|
-
displayName: 'Chatbot',
|
|
12
|
-
description: 'Select a chatbot',
|
|
13
|
-
required: true,
|
|
14
|
-
refreshers: [],
|
|
15
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
16
|
-
if (!auth) {
|
|
17
|
-
return {
|
|
18
|
-
disabled: true,
|
|
19
|
-
placeholder: 'Please connect your account first.',
|
|
20
|
-
options: [],
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
const response = yield (0, index_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/chatbots');
|
|
24
|
-
const options = response.data.chatbots.map((chatbot) => ({
|
|
25
|
-
label: chatbot.name,
|
|
26
|
-
value: chatbot.id,
|
|
27
|
-
}));
|
|
28
|
-
return {
|
|
29
|
-
disabled: false,
|
|
30
|
-
options,
|
|
31
|
-
};
|
|
32
|
-
}),
|
|
33
|
-
});
|
|
34
|
-
exports.aiModelIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
35
|
-
auth: index_2.chatlingAuth,
|
|
36
|
-
displayName: 'AI Model',
|
|
37
|
-
description: 'Select the AI model to use',
|
|
38
|
-
required: true,
|
|
39
|
-
refreshers: ['chatbotId'],
|
|
40
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, chatbotId }) {
|
|
41
|
-
if (!auth) {
|
|
42
|
-
return {
|
|
43
|
-
disabled: true,
|
|
44
|
-
placeholder: 'Please connect your account first.',
|
|
45
|
-
options: [],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (!chatbotId) {
|
|
49
|
-
return {
|
|
50
|
-
disabled: true,
|
|
51
|
-
placeholder: 'Please select a chatbot first.',
|
|
52
|
-
options: [],
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
const response = yield (0, index_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/chatbots/${chatbotId}/ai/kb/models`);
|
|
56
|
-
const options = response.data.models.map((model) => ({
|
|
57
|
-
label: model.name,
|
|
58
|
-
value: model.id,
|
|
59
|
-
}));
|
|
60
|
-
return {
|
|
61
|
-
disabled: false,
|
|
62
|
-
options,
|
|
63
|
-
};
|
|
64
|
-
}),
|
|
65
|
-
});
|
|
66
|
-
exports.languageIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
67
|
-
auth: index_2.chatlingAuth,
|
|
68
|
-
displayName: 'Language',
|
|
69
|
-
description: 'Select the language for the AI response',
|
|
70
|
-
required: false,
|
|
71
|
-
refreshers: ['chatbotId'],
|
|
72
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, chatbotId }) {
|
|
73
|
-
if (!auth) {
|
|
74
|
-
return {
|
|
75
|
-
disabled: true,
|
|
76
|
-
placeholder: 'Please connect your account first.',
|
|
77
|
-
options: [],
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
if (!chatbotId) {
|
|
81
|
-
return {
|
|
82
|
-
disabled: true,
|
|
83
|
-
placeholder: 'Please select a chatbot first.',
|
|
84
|
-
options: [],
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
const response = yield (0, index_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/chatbots/${chatbotId}/ai/kb/languages`);
|
|
88
|
-
const options = response.data.languages.map((language) => ({
|
|
89
|
-
label: language.name,
|
|
90
|
-
value: language.id,
|
|
91
|
-
}));
|
|
92
|
-
return {
|
|
93
|
-
disabled: false,
|
|
94
|
-
options,
|
|
95
|
-
};
|
|
96
|
-
}),
|
|
97
|
-
});
|
|
98
|
-
exports.contactIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
99
|
-
auth: index_2.chatlingAuth,
|
|
100
|
-
displayName: 'Contact',
|
|
101
|
-
description: 'Associate the conversation with a contact',
|
|
102
|
-
required: false,
|
|
103
|
-
refreshers: ['chatbotId'],
|
|
104
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, chatbotId }) {
|
|
105
|
-
if (!auth) {
|
|
106
|
-
return {
|
|
107
|
-
disabled: true,
|
|
108
|
-
placeholder: 'Please connect your account first.',
|
|
109
|
-
options: [],
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
if (!chatbotId) {
|
|
113
|
-
return {
|
|
114
|
-
disabled: true,
|
|
115
|
-
placeholder: 'Please select a chatbot first.',
|
|
116
|
-
options: [],
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
const response = yield (0, index_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/chatbots/${chatbotId}/contacts`);
|
|
120
|
-
const options = response.data.contacts.map((contact) => ({
|
|
121
|
-
label: contact.name || contact.email || contact.id,
|
|
122
|
-
value: contact.id,
|
|
123
|
-
}));
|
|
124
|
-
return {
|
|
125
|
-
disabled: false,
|
|
126
|
-
options,
|
|
127
|
-
};
|
|
128
|
-
}),
|
|
129
|
-
});
|
|
130
|
-
exports.templateIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
131
|
-
auth: index_2.chatlingAuth,
|
|
132
|
-
displayName: 'Template',
|
|
133
|
-
description: 'Use a template to create the chatbot',
|
|
134
|
-
required: false,
|
|
135
|
-
refreshers: [],
|
|
136
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
137
|
-
if (!auth) {
|
|
138
|
-
return {
|
|
139
|
-
disabled: true,
|
|
140
|
-
placeholder: 'Please connect your account first.',
|
|
141
|
-
options: [],
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
const response = yield (0, index_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, '/chatbot-templates');
|
|
145
|
-
const options = response.data.templates.map((template) => ({
|
|
146
|
-
label: template.name,
|
|
147
|
-
value: template.id,
|
|
148
|
-
}));
|
|
149
|
-
return {
|
|
150
|
-
disabled: false,
|
|
151
|
-
options,
|
|
152
|
-
};
|
|
153
|
-
}),
|
|
154
|
-
});
|
|
155
|
-
exports.conversationIdDropdown = pieces_framework_1.Property.Dropdown({
|
|
156
|
-
auth: index_2.chatlingAuth,
|
|
157
|
-
displayName: 'Conversation',
|
|
158
|
-
description: 'Continue an existing conversation',
|
|
159
|
-
required: false,
|
|
160
|
-
refreshers: ['chatbotId'],
|
|
161
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, chatbotId }) {
|
|
162
|
-
if (!auth) {
|
|
163
|
-
return {
|
|
164
|
-
disabled: true,
|
|
165
|
-
placeholder: 'Please connect your account first.',
|
|
166
|
-
options: [],
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
if (!chatbotId) {
|
|
170
|
-
return {
|
|
171
|
-
disabled: true,
|
|
172
|
-
placeholder: 'Please select a chatbot first.',
|
|
173
|
-
options: [],
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
const response = yield (0, index_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/chatbots/${chatbotId}/conversations`);
|
|
177
|
-
const options = response.data.conversations.map((conv) => {
|
|
178
|
-
var _a;
|
|
179
|
-
const firstUserMsg = (_a = conv.messages) === null || _a === void 0 ? void 0 : _a.find((m) => m.role === 'user');
|
|
180
|
-
const preview = (firstUserMsg === null || firstUserMsg === void 0 ? void 0 : firstUserMsg.text)
|
|
181
|
-
? firstUserMsg.text.substring(0, 50) +
|
|
182
|
-
(firstUserMsg.text.length > 50 ? '...' : '')
|
|
183
|
-
: conv.created_at;
|
|
184
|
-
return {
|
|
185
|
-
label: preview,
|
|
186
|
-
value: conv.id,
|
|
187
|
-
};
|
|
188
|
-
});
|
|
189
|
-
return {
|
|
190
|
-
disabled: false,
|
|
191
|
-
options,
|
|
192
|
-
};
|
|
193
|
-
}),
|
|
194
|
-
});
|
|
195
|
-
//# sourceMappingURL=props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/chatling/src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA0E;AAC1E,mCAAsC;AACtC,uCAA2C;AAE9B,QAAA,iBAAiB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IACjD,IAAI,EAAE,oBAAY;IAClB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,kBAAkB;IAC/B,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAI/B,IAAI,CAAC,WAAW,EAAE,0BAAU,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAElD,MAAM,OAAO,GAA6B,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAClE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACZ,KAAK,EAAE,OAAO,CAAC,IAAI;YACnB,KAAK,EAAE,OAAO,CAAC,EAAE;SAClB,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO;SACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IACjD,IAAI,EAAE,oBAAY;IAClB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,CAAC,WAAW,CAAC;IACzB,OAAO,EAAE,KAA4B,EAAE,oDAAvB,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gCAAgC;gBAC7C,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAKhC,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,aAAa,SAAS,eAAe,CACtC,CAAC;QAEF,MAAM,OAAO,GAA6B,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAChE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACV,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,KAAK,EAAE,KAAK,CAAC,EAAE;SAChB,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO;SACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAClD,IAAI,EAAE,oBAAY;IAClB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,CAAC,WAAW,CAAC;IACzB,OAAO,EAAE,KAA4B,EAAE,oDAAvB,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gCAAgC;gBAC7C,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAKhC,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,aAAa,SAAS,kBAAkB,CACzC,CAAC;QAEF,MAAM,OAAO,GAA6B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CACnE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACb,KAAK,EAAE,QAAQ,CAAC,IAAI;YACpB,KAAK,EAAE,QAAQ,CAAC,EAAE;SACnB,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO;SACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IACjD,IAAI,EAAE,oBAAY;IAClB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,CAAC,WAAW,CAAC;IACzB,OAAO,EAAE,KAA4B,EAAE,oDAAvB,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gCAAgC;gBAC7C,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAKhC,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,aAAa,SAAS,WAAW,CAClC,CAAC;QAEF,MAAM,OAAO,GAA6B,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAClE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACZ,KAAK,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,EAAE;YAClD,KAAK,EAAE,OAAO,CAAC,EAAE;SAClB,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO;SACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAClD,IAAI,EAAE,oBAAY;IAClB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAI/B,IAAI,CAAC,WAAW,EAAE,0BAAU,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;QAE3D,MAAM,OAAO,GAA6B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CACnE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACb,KAAK,EAAE,QAAQ,CAAC,IAAI;YACpB,KAAK,EAAE,QAAQ,CAAC,EAAE;SACnB,CAAC,CACH,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO;SACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IACtD,IAAI,EAAE,oBAAY;IAClB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,mCAAmC;IAChD,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,CAAC,WAAW,CAAC;IACzB,OAAO,EAAE,KAA4B,EAAE,oDAAvB,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,oCAAoC;gBACjD,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,gCAAgC;gBAC7C,OAAO,EAAE,EAAE;aACZ,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAShC,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,aAAa,SAAS,gBAAgB,CACvC,CAAC;QAEF,MAAM,OAAO,GAA6B,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CACvE,CAAC,IAAI,EAAE,EAAE;;YACP,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC;YACnE,MAAM,OAAO,GAAG,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI;gBAChC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;oBAClC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9C,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACpB,OAAO;gBACL,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,IAAI,CAAC,EAAE;aACf,CAAC;QACJ,CAAC,CACF,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,KAAK;YACf,OAAO;SACR,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newContact: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
5
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
7
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
8
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
9
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
10
|
-
}>;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newContact = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const index_1 = require("../../index");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
const common_1 = require("../common");
|
|
10
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
11
|
-
const polling = {
|
|
12
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
13
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
14
|
-
const response = yield (0, common_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/chatbots/${propsValue.chatbotId}/contacts?sort=date_desc`);
|
|
15
|
-
const contacts = response.data.contacts;
|
|
16
|
-
const items = contacts
|
|
17
|
-
.filter((contact) => {
|
|
18
|
-
if (lastFetchEpochMS === 0)
|
|
19
|
-
return true;
|
|
20
|
-
return (0, dayjs_1.default)(contact.created_at).valueOf() > lastFetchEpochMS;
|
|
21
|
-
})
|
|
22
|
-
.map((contact) => ({
|
|
23
|
-
epochMilliSeconds: (0, dayjs_1.default)(contact.created_at).valueOf(),
|
|
24
|
-
data: contact,
|
|
25
|
-
}));
|
|
26
|
-
return items;
|
|
27
|
-
}),
|
|
28
|
-
};
|
|
29
|
-
exports.newContact = (0, pieces_framework_1.createTrigger)({
|
|
30
|
-
auth: index_1.chatlingAuth,
|
|
31
|
-
name: 'new_contact',
|
|
32
|
-
displayName: 'New Contact/Lead',
|
|
33
|
-
description: 'Triggers when a new contact or lead is collected by the chatbot.',
|
|
34
|
-
props: {
|
|
35
|
-
chatbotId: props_1.chatbotIdDropdown,
|
|
36
|
-
},
|
|
37
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
38
|
-
onEnable(context) {
|
|
39
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
41
|
-
auth: context.auth,
|
|
42
|
-
store: context.store,
|
|
43
|
-
propsValue: context.propsValue,
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
onDisable(context) {
|
|
48
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
50
|
-
auth: context.auth,
|
|
51
|
-
store: context.store,
|
|
52
|
-
propsValue: context.propsValue,
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
},
|
|
56
|
-
test(context) {
|
|
57
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
run(context) {
|
|
62
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
sampleData: {
|
|
67
|
-
id: 'contact_abc123',
|
|
68
|
-
name: 'John Doe',
|
|
69
|
-
email: 'john@example.com',
|
|
70
|
-
phone: '+1234567890',
|
|
71
|
-
job_title: 'Product Manager',
|
|
72
|
-
website: 'https://example.com',
|
|
73
|
-
company: 'Acme Inc',
|
|
74
|
-
created_at: '2024-01-15T10:30:00.000Z',
|
|
75
|
-
},
|
|
76
|
-
});
|
|
77
|
-
//# sourceMappingURL=new-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/chatling/src/lib/triggers/new-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,uCAA2C;AAC3C,2CAAoD;AACpD,sCAAwC;AACxC,0DAA0B;AAa1B,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAKhC,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,aAAa,UAAU,CAAC,SAAS,0BAA0B,CAC5D,CAAC;QAEF,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;QAExC,MAAM,KAAK,GAAG,QAAQ;aACnB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;YAClB,IAAI,gBAAgB,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC;YACxC,OAAO,IAAA,eAAK,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,gBAAgB,CAAC;QAChE,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YACjB,iBAAiB,EAAE,IAAA,eAAK,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;YACtD,IAAI,EAAE,OAAO;SACd,CAAC,CAAC,CAAC;QAEN,OAAO,KAAK,CAAC;IACf,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,UAAU,GAAG,IAAA,gCAAa,EAAC;IACtC,IAAI,EAAE,oBAAY;IAClB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,kEAAkE;IAC/E,KAAK,EAAE;QACL,SAAS,EAAE,yBAAiB;KAC7B;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE;gBACpC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACD,UAAU,EAAE;QACV,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,iBAAiB;QAC5B,OAAO,EAAE,qBAAqB;QAC9B,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,0BAA0B;KACvC;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newConversation: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
5
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
7
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
8
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
9
|
-
chatbotId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
10
|
-
}>;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newConversation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const index_1 = require("../../index");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
const common_1 = require("../common");
|
|
10
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
11
|
-
const polling = {
|
|
12
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
13
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
14
|
-
const response = yield (0, common_1.makeRequest)(auth.secret_text, pieces_common_1.HttpMethod.GET, `/chatbots/${propsValue.chatbotId}/conversations?sort=date_desc`);
|
|
15
|
-
const conversations = response.data.conversations;
|
|
16
|
-
// Filter by lastFetchEpochMS if not first run
|
|
17
|
-
const items = conversations
|
|
18
|
-
.filter((conv) => {
|
|
19
|
-
if (lastFetchEpochMS === 0)
|
|
20
|
-
return true;
|
|
21
|
-
return (0, dayjs_1.default)(conv.created_at).valueOf() > lastFetchEpochMS;
|
|
22
|
-
})
|
|
23
|
-
.map((conv) => ({
|
|
24
|
-
epochMilliSeconds: (0, dayjs_1.default)(conv.created_at).valueOf(),
|
|
25
|
-
data: conv,
|
|
26
|
-
}));
|
|
27
|
-
return items;
|
|
28
|
-
}),
|
|
29
|
-
};
|
|
30
|
-
exports.newConversation = (0, pieces_framework_1.createTrigger)({
|
|
31
|
-
auth: index_1.chatlingAuth,
|
|
32
|
-
name: 'new_conversation',
|
|
33
|
-
displayName: 'New Conversation',
|
|
34
|
-
description: 'Triggers when a new conversation is started by a customer.',
|
|
35
|
-
props: {
|
|
36
|
-
chatbotId: props_1.chatbotIdDropdown,
|
|
37
|
-
},
|
|
38
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
39
|
-
onEnable(context) {
|
|
40
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
42
|
-
auth: context.auth,
|
|
43
|
-
store: context.store,
|
|
44
|
-
propsValue: context.propsValue,
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
onDisable(context) {
|
|
49
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
51
|
-
auth: context.auth,
|
|
52
|
-
store: context.store,
|
|
53
|
-
propsValue: context.propsValue,
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
test(context) {
|
|
58
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
run(context) {
|
|
63
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
sampleData: {
|
|
68
|
-
id: 'conv_abc123',
|
|
69
|
-
contact_id: 'contact_xyz',
|
|
70
|
-
archived: false,
|
|
71
|
-
important: false,
|
|
72
|
-
created_at: '2024-01-15T10:30:00.000Z',
|
|
73
|
-
messages: [
|
|
74
|
-
{
|
|
75
|
-
id: 'msg_1',
|
|
76
|
-
text: 'Hello, I need help with your product.',
|
|
77
|
-
role: 'user',
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
//# sourceMappingURL=new-conversation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-conversation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/chatling/src/lib/triggers/new-conversation.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,uCAA2C;AAC3C,2CAAoD;AACpD,sCAAwC;AACxC,0DAA0B;AAW1B,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE;QAClD,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAKhC,IAAI,CAAC,WAAW,EAChB,0BAAU,CAAC,GAAG,EACd,aAAa,UAAU,CAAC,SAAS,+BAA+B,CACjE,CAAC;QAEF,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;QAElD,8CAA8C;QAC9C,MAAM,KAAK,GAAG,aAAa;aACxB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YACf,IAAI,gBAAgB,KAAK,CAAC;gBAAE,OAAO,IAAI,CAAC;YACxC,OAAO,IAAA,eAAK,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,gBAAgB,CAAC;QAC7D,CAAC,CAAC;aACD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACd,iBAAiB,EAAE,IAAA,eAAK,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;YACnD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,CAAC;QAEN,OAAO,KAAK,CAAC;IACf,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,eAAe,GAAG,IAAA,gCAAa,EAAC;IAC3C,IAAI,EAAE,oBAAY;IAClB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,4DAA4D;IACzE,KAAK,EAAE;QACL,SAAS,EAAE,yBAAiB;KAC7B;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE;gBACpC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;IACD,UAAU,EAAE;QACV,EAAE,EAAE,aAAa;QACjB,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,0BAA0B;QACtC,QAAQ,EAAE;YACR;gBACE,EAAE,EAAE,OAAO;gBACX,IAAI,EAAE,uCAAuC;gBAC7C,IAAI,EAAE,MAAM;aACb;SACF;KACF;CACF,CAAC,CAAC"}
|