@activepieces/piece-mautic 0.5.5 → 0.5.7
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 -12
- package/src/index.js +14 -49
- package/src/index.d.ts +0 -6
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-company.d.ts +0 -12
- package/src/lib/actions/create-company.d.ts.map +0 -1
- package/src/lib/actions/create-company.js +0 -39
- package/src/lib/actions/create-company.js.map +0 -1
- package/src/lib/actions/create-contact.d.ts +0 -28
- package/src/lib/actions/create-contact.d.ts.map +0 -1
- package/src/lib/actions/create-contact.js +0 -39
- package/src/lib/actions/create-contact.js.map +0 -1
- package/src/lib/actions/index.d.ts +0 -7
- package/src/lib/actions/index.d.ts.map +0 -1
- package/src/lib/actions/index.js +0 -16
- package/src/lib/actions/index.js.map +0 -1
- package/src/lib/actions/search-company.d.ts +0 -12
- package/src/lib/actions/search-company.d.ts.map +0 -1
- package/src/lib/actions/search-company.js +0 -38
- package/src/lib/actions/search-company.js.map +0 -1
- package/src/lib/actions/search-contact.d.ts +0 -28
- package/src/lib/actions/search-contact.d.ts.map +0 -1
- package/src/lib/actions/search-contact.js +0 -40
- package/src/lib/actions/search-contact.js.map +0 -1
- package/src/lib/actions/update-company.d.ts +0 -13
- package/src/lib/actions/update-company.d.ts.map +0 -1
- package/src/lib/actions/update-company.js +0 -48
- package/src/lib/actions/update-company.js.map +0 -1
- package/src/lib/actions/update-contact.d.ts +0 -29
- package/src/lib/actions/update-contact.d.ts.map +0 -1
- package/src/lib/actions/update-contact.js +0 -39
- package/src/lib/actions/update-contact.js.map +0 -1
- package/src/lib/auth.d.ts +0 -6
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -31
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/helper.d.ts +0 -12
- package/src/lib/common/helper.d.ts.map +0 -1
- package/src/lib/common/helper.js +0 -90
- package/src/lib/common/helper.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -31
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -32
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/index.d.ts +0 -31
- package/src/lib/triggers/index.d.ts.map +0 -1
- package/src/lib/triggers/index.js +0 -427
- package/src/lib/triggers/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-mautic",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.87.1",
|
|
14
|
-
"tslib": "2.6.2"
|
|
15
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
16
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,55 +1,20 @@
|
|
|
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 actions_1 = require("./lib/actions");
|
|
9
|
-
const triggers_1 = require("./lib/triggers");
|
|
10
|
-
const auth_1 = require("./lib/auth");
|
|
11
|
-
const markdownDescription = `
|
|
1
|
+
"use strict";var nu=Object.create;var Ye=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var au=Object.getPrototypeOf,su=Object.prototype.hasOwnProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Tn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},In=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of iu(t))!su.call(e,i)&&i!==r&&Ye(e,i,{get:()=>t[i],enumerable:!(n=ou(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?nu(au(e)):{},In(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e)),uu=e=>In(Ye({},"__esModule",{value:!0}),e);var qo=E((Go,Vt)=>{(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]+::?)+",p={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,v=(s.match(p.zoneIndex)||[])[0],P,j;for(v&&(v=v.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(j=d-y,P=":";j--;)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 ne=s.split(":"),ue=[];for(let Xe=0;Xe<ne.length;Xe++)ue.push(parseInt(ne[Xe],16));return ue})(),{parts:d,zoneId:v}}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 v=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=y,v+=1}return!0}o(g,"matchCIDR");function x(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(x,"parseIntAuto");function T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"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},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}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(),v=[],P=0;for(;P<4;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}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,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}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 v=d.slice(1,6),P=[];for(let j=0;j<v.length;j++)y=v[j],P.push(x(y));return P})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[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,v;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(v=this.parts[m],!(0<=v&&v<=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},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],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 v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].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 v=0;v<this.parts.length;v++)m.push(this.parts[v].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,v=-1,P;for(;P=d.exec(y);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},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(),v=[],P=0;for(;P<16;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}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,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},_.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,v,P,j;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(v=P[y],!(0<=v&&v<=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,v,P,j;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return y},typeof Vt<"u"&&Vt.exports?Vt.exports=_:e.ipaddr=_})(Go)});var Ji=E((TA,Ki)=>{var qi=require("stream").Stream,Vp=require("util");Ki.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");Vp.inherits(pe,qi);pe.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(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=qi.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.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)};pe.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 ea=E((EA,Qi)=>{var Hp=require("util"),Yi=require("stream").Stream,Xi=Ji();Qi.exports=G;function G(){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(G,"CombinedStream");Hp.inherits(G,Yi);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof Xi)){var r=Xi.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};G.prototype.pipe=function(e,t){return Yi.prototype.pipe.call(this,e,t),this.resume(),e};G.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}};G.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=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.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()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.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")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.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)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ra=E((SA,ta)=>{"use strict";ta.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 ia=E(te=>{"use strict";var Jt=ra(),Wp=require("path").extname,na=/^\s*([^;\s]*)(?:;|\s|$)/,Gp=/^text\//i;te.charset=oa;te.charsets={lookup:oa};te.contentType=qp;te.extension=Kp;te.extensions=Object.create(null);te.lookup=Jp;te.types=Object.create(null);Xp(te.extensions,te.types);function oa(e){if(!e||typeof e!="string")return!1;var t=na.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Gp.test(t[1])?"UTF-8":!1}o(oa,"charset");function qp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(qp,"contentType");function Kp(e){if(!e||typeof e!="string")return!1;var t=na.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Kp,"extension");function Jp(e){if(!e||typeof e!="string")return!1;var t=Wp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Jp,"lookup");function Xp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var g=r.indexOf(Jt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>x||g===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Xp,"populateMaps")});var sa=E((OA,aa)=>{aa.exports=Yp;function Yp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Yp,"defer")});var Gr=E((wA,ca)=>{var ua=sa();ca.exports=Qp;function Qp(e){var t=!1;return ua(function(){t=!0}),o(function(n,i){t?e(n,i):ua(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Qp,"async")});var qr=E((NA,pa)=>{pa.exports=el;function el(e){Object.keys(e.jobs).forEach(tl.bind(e)),e.jobs={}}o(el,"abort");function tl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(tl,"clean")});var Kr=E((CA,da)=>{var la=Gr(),rl=qr();da.exports=nl;function nl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ol(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?rl(r):r.results[i]=c,n(u,r.results))})}o(nl,"iterate");function ol(e,t,r,n){var i;return e.length==2?i=e(r,la(n)):i=e(r,t,la(n)),i}o(ol,"runJob")});var Jr=E((MA,ma)=>{ma.exports=il;function il(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(il,"state")});var Xr=E((LA,fa)=>{var al=qr(),sl=Gr();fa.exports=ul;function ul(e){Object.keys(this.jobs).length&&(this.index=this.size,al(this),sl(e)(null,this.results))}o(ul,"terminator")});var ya=E((BA,ga)=>{var cl=Kr(),pl=Jr(),ll=Xr();ga.exports=dl;function dl(e,t,r){for(var n=pl(e);n.index<(n.keyedList||e).length;)cl(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 ll.bind(n,r)}o(dl,"parallel")});var Yr=E((VA,Xt)=>{var ha=Kr(),ml=Jr(),fl=Xr();Xt.exports=gl;Xt.exports.ascending=va;Xt.exports.descending=yl;function gl(e,t,r,n){var i=ml(e,r);return ha(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ha(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),fl.bind(i,n)}o(gl,"serialOrdered");function va(e,t){return e<t?-1:e>t?1:0}o(va,"ascending");function yl(e,t){return-1*va(e,t)}o(yl,"descending")});var _a=E((WA,xa)=>{var hl=Yr();xa.exports=vl;function vl(e,t,r){return hl(e,t,null,r)}o(vl,"serial")});var ba=E((qA,Pa)=>{Pa.exports={parallel:ya(),serial:_a(),serialOrdered:Yr()}});var Qr=E((KA,Ta)=>{"use strict";Ta.exports=Object});var Ea=E((JA,Ia)=>{"use strict";Ia.exports=Error});var Sa=E((XA,$a)=>{"use strict";$a.exports=EvalError});var za=E((YA,Aa)=>{"use strict";Aa.exports=RangeError});var ka=E((QA,Oa)=>{"use strict";Oa.exports=ReferenceError});var Ra=E((ez,wa)=>{"use strict";wa.exports=SyntaxError});var Yt=E((tz,Na)=>{"use strict";Na.exports=TypeError});var Ca=E((rz,Da)=>{"use strict";Da.exports=URIError});var Ma=E((nz,Ua)=>{"use strict";Ua.exports=Math.abs});var La=E((oz,ja)=>{"use strict";ja.exports=Math.floor});var Ba=E((iz,Fa)=>{"use strict";Fa.exports=Math.max});var Va=E((az,Za)=>{"use strict";Za.exports=Math.min});var Wa=E((sz,Ha)=>{"use strict";Ha.exports=Math.pow});var qa=E((uz,Ga)=>{"use strict";Ga.exports=Math.round});var Ja=E((cz,Ka)=>{"use strict";Ka.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ya=E((lz,Xa)=>{"use strict";var xl=Ja();Xa.exports=o(function(t){return xl(t)||t===0?t:t<0?-1:1},"sign")});var es=E((mz,Qa)=>{"use strict";Qa.exports=Object.getOwnPropertyDescriptor});var en=E((fz,ts)=>{"use strict";var Qt=es();if(Qt)try{Qt([],"length")}catch{Qt=null}ts.exports=Qt});var ns=E((gz,rs)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}rs.exports=er});var tn=E((yz,os)=>{"use strict";os.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 p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var ss=E((vz,as)=>{"use strict";var is=typeof Symbol<"u"&&Symbol,_l=tn();as.exports=o(function(){return typeof is!="function"||typeof Symbol!="function"||typeof is("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_l()},"hasNativeSymbols")});var rn=E((_z,us)=>{"use strict";us.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nn=E((Pz,cs)=>{"use strict";var Pl=Qr();cs.exports=Pl.getPrototypeOf||null});var ds=E((bz,ls)=>{"use strict";var bl="Function.prototype.bind called on incompatible ",Tl=Object.prototype.toString,Il=Math.max,El="[object Function]",ps=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"),$l=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"),Sl=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");ls.exports=o(function(t){var r=this;if(typeof r!="function"||Tl.apply(r)!==El)throw new TypeError(bl+r);for(var n=$l(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,ps(n,arguments));return Object(x)===x?x:this}return r.apply(t,ps(n,arguments))},"binder"),c=Il(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Sl(p,",")+"){ 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 We=E((Iz,ms)=>{"use strict";var Al=ds();ms.exports=Function.prototype.bind||Al});var tr=E((Ez,fs)=>{"use strict";fs.exports=Function.prototype.call});var on=E(($z,gs)=>{"use strict";gs.exports=Function.prototype.apply});var hs=E((Sz,ys)=>{"use strict";ys.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var xs=E((Az,vs)=>{"use strict";var zl=We(),Ol=on(),kl=tr(),wl=hs();vs.exports=wl||zl.call(kl,Ol)});var Ps=E((zz,_s)=>{"use strict";var Rl=We(),Nl=Yt(),Dl=tr(),Cl=xs();_s.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Nl("a function is required");return Cl(Rl,Dl,t)},"callBindBasic")});var Ss=E((kz,$s)=>{"use strict";var Ul=Ps(),bs=en(),Is;try{Is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var an=!!Is&&bs&&bs(Object.prototype,"__proto__"),Es=Object,Ts=Es.getPrototypeOf;$s.exports=an&&typeof an.get=="function"?Ul([an.get]):typeof Ts=="function"?o(function(t){return Ts(t==null?t:Es(t))},"getDunder"):!1});var ws=E((Rz,ks)=>{"use strict";var As=rn(),zs=nn(),Os=Ss();ks.exports=As?o(function(t){return As(t)},"getProto"):zs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return zs(t)},"getProto"):Os?o(function(t){return Os(t)},"getProto"):null});var sn=E((Dz,Rs)=>{"use strict";var Ml=Function.prototype.call,jl=Object.prototype.hasOwnProperty,Ll=We();Rs.exports=Ll.call(Ml,jl)});var Ls=E((Cz,js)=>{"use strict";var U,Fl=Qr(),Bl=Ea(),Zl=Sa(),Vl=za(),Hl=ka(),Je=Ra(),Ke=Yt(),Wl=Ca(),Gl=Ma(),ql=La(),Kl=Ba(),Jl=Va(),Xl=Wa(),Yl=qa(),Ql=Ya(),Us=Function,un=o(function(e){try{return Us('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=en(),ed=ns(),cn=o(function(){throw new Ke},"throwTypeError"),td=_t?(function(){try{return arguments.callee,cn}catch{try{return _t(arguments,"callee").get}catch{return cn}}})():cn,Ge=ss()(),X=ws(),rd=nn(),nd=rn(),Ms=on(),Pt=tr(),qe={},od=typeof Uint8Array>"u"||!X?U:X(Uint8Array),Ce={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&X?X([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Bl,"%eval%":eval,"%EvalError%":Zl,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":Us,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&X?X(X([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!X?U:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Fl,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Vl,"%ReferenceError%":Hl,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!X?U:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&X?X(""[Symbol.iterator]()):U,"%Symbol%":Ge?Symbol:U,"%SyntaxError%":Je,"%ThrowTypeError%":td,"%TypedArray%":od,"%TypeError%":Ke,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":Wl,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":Ms,"%Object.defineProperty%":ed,"%Object.getPrototypeOf%":rd,"%Math.abs%":Gl,"%Math.floor%":ql,"%Math.max%":Kl,"%Math.min%":Jl,"%Math.pow%":Xl,"%Math.round%":Yl,"%Math.sign%":Ql,"%Reflect.getPrototypeOf%":nd};if(X)try{null.error}catch(e){Ns=X(X(e)),Ce["%Error.prototype%"]=Ns}var Ns,id=o(function e(t){var r;if(t==="%AsyncFunction%")r=un("async function () {}");else if(t==="%GeneratorFunction%")r=un("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=un("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Ce[t]=r,r},"doEval"),Ds={__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=We(),rr=sn(),ad=bt.call(Pt,Array.prototype.concat),sd=bt.call(Ms,Array.prototype.splice),Cs=bt.call(Pt,String.prototype.replace),nr=bt.call(Pt,String.prototype.slice),ud=bt.call(Pt,RegExp.prototype.exec),cd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pd=/\\(\\)?/g,ld=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Je("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Je("invalid intrinsic syntax, expected opening `%`");var i=[];return Cs(t,cd,function(u,c,p,f){i[i.length]=p?Cs(f,pd,"$1"):c||u}),i},"stringToPath"),dd=o(function(t,r){var n=t,i;if(rr(Ds,n)&&(i=Ds[n],n="%"+i[0]+"%"),rr(Ce,n)){var u=Ce[n];if(u===qe&&(u=id(n)),typeof u>"u"&&!r)throw new Ke("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Je("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");js.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(ud(/^%?[^%]*%?$/,t)===null)throw new Je("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ld(t),i=n.length>0?n[0]:"",u=dd("%"+i+"%",r),c=u.name,p=u.value,f=!1,g=u.alias;g&&(i=g[0],sd(n,ad([0,1],g)));for(var x=1,T=!0;x<n.length;x+=1){var _=n[x],s=nr(_,0,1),d=nr(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Je("property names with quotes must have matching quotes");if((_==="constructor"||!T)&&(f=!0),i+="."+_,c="%"+i+"%",rr(Ce,c))p=Ce[c];else if(p!=null){if(!(_ in p)){if(!r)throw new Ke("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&x+1>=n.length){var y=_t(p,_);T=!!y,T&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[_]}else T=rr(p,_),p=p[_];T&&!f&&(Ce[c]=p)}}return p},"GetIntrinsic")});var Bs=E((Mz,Fs)=>{"use strict";var md=tn();Fs.exports=o(function(){return md()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Hs=E((Lz,Vs)=>{"use strict";var fd=Ls(),Zs=fd("%Object.defineProperty%",!0),gd=Bs()(),yd=sn(),hd=Yt(),or=gd?Symbol.toStringTag:null;Vs.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 hd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!yd(t,or))&&(Zs?Zs(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Gs=E((Bz,Ws)=>{"use strict";var vd=Function.prototype.call,xd=Object.prototype.hasOwnProperty,_d=We();Ws.exports=_d.call(vd,xd)});var Ks=E((Zz,qs)=>{"use strict";qs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ys=E((Vz,Xs)=>{"use strict";var mn=ea(),Pd=require("util"),pn=require("path"),bd=require("http"),Td=require("https"),Id=require("url").parse,Ed=require("fs"),$d=require("stream").Stream,Sd=require("crypto"),ln=ia(),Ad=ba(),zd=Hs(),we=Gs(),dn=Ks();function Js(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Js,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],mn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Pd.inherits(L,mn);L.LINE_BREAK=`\r
|
|
2
|
+
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=mn.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)};L.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)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof $d))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ed.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.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="'+Js(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&dn(c,r.header);var p;for(var f in c)if(we(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=pn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=pn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=pn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Js(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ln.lookup(e.name)),!r&&e&&e.path&&(r=ln.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.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(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+Sd.randomBytes(12).toString("hex")};L.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};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.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}Ad.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Id(e),n=dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=dn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Td.request(n):r=bd.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 p,f=o(function(g,x){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,x)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};zd(L.prototype,"FormData");Xs.exports=L});var Bd={};Tn(Bd,{mautic:()=>Fd});module.exports=uu(Bd);var cu=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=c.prototype,x=Object.keys(g);for(let T=0;T<x.length;T++){let _=x[T];_ in p||(p[_]=g[_].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let g=r?.Parent?new u:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let x of g._zod.deferred)x();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var le=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},cr={};function ye(e){return e&&Object.assign(cr,e),cr}o(ye,"config");function lr(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(lr,"getEnumValues");function $n(e,t){return typeof t=="bigint"?t.toString():t}o($n,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function Sn(e){return e==null}o(Sn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var En=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==En)return n===void 0&&(n=En,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Qe,"isObject");var pu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function An(e){if(Qe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Qe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(An,"isPlainObject");var zn=new Set(["string","number","symbol"]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Me,"escapeRegex");function At(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(At,"clone");function Z(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(Z,"normalizeParams");function On(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(On,"optionalKeys");var kn={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 je(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(je,"aborted");function Te(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Te,"prefixIssues");function Et(e){return typeof e=="string"?e:e?.message}o(Et,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Et(e.inst?._zod.def?.error?.(e))??Et(t?.error?.(e))??Et(r.customError?.(e))??Et(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(wn,"getLengthableOrigin");function mr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(mr,"issue");var Rn=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,$n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Nn=b("$ZodError",Rn),et=b("$ZodError",Rn,{Parent:Error});var du=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 le;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,ye())));throw dr(p,i?.callee),p}return c.value},"_parse"),zt=du(et),mu=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 p=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,ye())));throw dr(p,i?.callee),p}return c.value},"_parseAsync"),Ot=mu(et),fu=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 le;return u.issues.length?{success:!1,error:new(e??Nn)(u.issues.map(c=>Ie(c,i,ye())))}:{success:!0,data:u.value}},"_safeParse"),tt=fu(et),gu=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=>Ie(c,i,ye())))}:{success:!0,data:u.value}},"_safeParseAsync"),rt=gu(et);var yu="(?:(?:\\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])))",hu=new RegExp(`^${yu}$`);var Dn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Cn=/^-?\d+n?$/,Un=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,Mn=/^(?:true|false)$/i;var Ee=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),vu={number:"number",bigint:"bigint",object:"date"};var jn=b("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=vu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Ln=b("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=kn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Un)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Fn=b("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Sn(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 gr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.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=()=>{})}),Bn=b("$ZodCheckRegex",(e,t)=>{gr.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 Vn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vn;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,p,f)=>{let g=je(c),x;for(let T of p){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(g)continue;let _=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new le;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(g||(g=je(c,_)))});else{if(c.issues.length===_)continue;g||(g=je(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(je(c))return c.aborted=!0,c;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new le;return g.then(x=>e._zod.parse(x,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(x=>u(x,c,p)):u(g,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new le;return f.then(g=>i(g,n,p))}return i(f,n,p)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=tt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return rt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Dn(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}}),yr=b("$ZodStringFormat",(e,t)=>{gr.init(e,t),Rt.init(e,t)});var Kn=b("$ZodURL",(e,t)=>{yr.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 hr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??fr,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}}),Jn=b("$ZodNumberFormat",(e,t)=>{Ln.init(e,t),hr.init(e,t)}),vr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Mn,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}}),Xn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Cn,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 Yn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Qn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var eo=b("$ZodVoid",(e,t)=>{H.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}}),to=b("$ZodDate",(e,t)=>{H.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 Hn(e,t,r){e.issues.length&&t.issues.push(...Te(r,e.issues)),t.value[r]=e.value}o(Hn,"handleArrayResult");var ro=b("$ZodArray",(e,t)=>{H.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 p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(g=>Hn(g,r,c))):Hn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Te(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function xu(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=On(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(xu,"normalizeDef");function _u(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,x=f.optout==="optional";for(let T in t){if(p.has(T))continue;if(g==="never"){c.push(T);continue}let _=f.run({value:t[T],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>wt(s,r,T,t,x))):wt(_,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(_u,"handleCatchall");var no=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>xu(t));q(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let x=p[g]._zod;if(x.values){f[g]??(f[g]=new Set);for(let T of x.values)f[g].add(T)}}return f});let i=Qe,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let x=[],T=c.shape;for(let _ of c.keys){let s=T[_],d=s._zod.optout==="optional",y=s._zod.run({value:g[_],issues:[]},f);y instanceof Promise?x.push(y.then(m=>wt(m,p,_,g,d))):wt(y,p,_,g,d)}return u?_u(x,g,p,f,n.value,e):x.length?Promise.all(x).then(()=>p):p}});function Wn(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=>!je(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=>Ie(c,n,ye())))}),t)}o(Wn,"handleUnionResults");var xr=b("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(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=>St(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,p=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(f=>Wn(f,i,e,u)):Wn(p,i,e,u)}});var oo=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;q(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[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){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(!Qe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._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 io=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!An(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 p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let x=t.valueType._zod.run({value:i[g],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Te(g,T.issues)),r.value[g]=T.value})):(x.issues.length&&r.issues.push(...Te(g,x.issues)),r.value[g]=x.value)}let f;for(let g in i)p.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 p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&fr.test(p)&&f.issues.length){let T=t.keyType._zod.run({value:Number(p),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>Ie(T,n,ye())),input:p,path:[p],inst:e});continue}let x=t.valueType._zod.run({value:i[p],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Te(p,T.issues)),r.value[f.value]=T.value})):(x.issues.length&&r.issues.push(...Te(p,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var ao=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=lr(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"?Me(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}}),so=b("$ZodLiteral",(e,t)=>{if(H.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"?Me(n):n?Me(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 uo=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(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 le;return r.value=i,r}});function Gn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Gn,"handleOptionalResult");var co=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(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=>Gn(u,r.value)):Gn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var po=b("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),q(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 lo=b("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(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=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var mo=b("$ZodCustom",(e,t)=>{Ee.init(e,t),H.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=>qn(u,r,n,e));qn(i,r,n,e)}});function qn(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(mr(i))}}o(qn,"handleRefineResult");var go;var _r=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 yo(){return new _r}o(yo,"registry");(go=globalThis).__zod_globalRegistry??(go.__zod_globalRegistry=yo());var Pr=globalThis.__zod_globalRegistry;function ho(e,t){return new e({type:"string",...Z(t)})}o(ho,"_string");function vo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(vo,"_coercedString");function xo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(xo,"_url");function _o(e,t){return new e({type:"number",checks:[],...Z(t)})}o(_o,"_number");function Po(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(Po,"_coercedNumber");function bo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(bo,"_int");function To(e,t){return new e({type:"boolean",...Z(t)})}o(To,"_boolean");function Io(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(Io,"_coercedBoolean");function Eo(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(Eo,"_coercedBigint");function $o(e){return new e({type:"any"})}o($o,"_any");function So(e){return new e({type:"unknown"})}o(So,"_unknown");function Ao(e,t){return new e({type:"void",...Z(t)})}o(Ao,"_void");function zo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(zo,"_coercedDate");function Nt(e,t){return new jn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Nt,"_gte");function ce(e,t){return new Fn({check:"min_length",...Z(t),minimum:e})}o(ce,"_minLength");function $e(e,t){return new Bn({check:"string_format",format:"regex",...Z(t),pattern:e})}o($e,"_regex");function Oo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Oo,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>tt(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>rt(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)=>At(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ct=b("ZodMiniString",(e,t)=>{Rt.init(e,t),K.init(e,t)});function a(e){return ho(Ct,e)}o(a,"string");var ko=b("ZodMiniStringFormat",(e,t)=>{yr.init(e,t),Ct.init(e,t)});var Ru=b("ZodMiniURL",(e,t)=>{Kn.init(e,t),ko.init(e,t)});function wo(e){return xo(Ru,e)}o(wo,"url");var Ut=b("ZodMiniNumber",(e,t)=>{hr.init(e,t),K.init(e,t)});function Q(e){return _o(Ut,e)}o(Q,"number");var Nu=b("ZodMiniNumberFormat",(e,t)=>{Jn.init(e,t),Ut.init(e,t)});function Ro(e){return bo(Nu,e)}o(Ro,"int");var br=b("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function B(e){return To(br,e)}o(B,"boolean");var No=b("ZodMiniBigInt",(e,t)=>{Xn.init(e,t),K.init(e,t)});var Du=b("ZodMiniAny",(e,t)=>{Yn.init(e,t),K.init(e,t)});function ot(){return $o(Du)}o(ot,"any");var Cu=b("ZodMiniUnknown",(e,t)=>{Qn.init(e,t),K.init(e,t)});function O(){return So(Cu)}o(O,"unknown");var Uu=b("ZodMiniVoid",(e,t)=>{eo.init(e,t),K.init(e,t)});function Do(e){return Ao(Uu,e)}o(Do,"_void");var Co=b("ZodMiniDate",(e,t)=>{to.init(e,t),K.init(e,t)});var Mu=b("ZodMiniArray",(e,t)=>{ro.init(e,t),K.init(e,t)});function R(e,t){return new Mu({type:"array",element:e,...Z(t)})}o(R,"array");var ju=b("ZodMiniObject",(e,t)=>{no.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new ju(r)}o(l,"object");var Lu=b("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Lu({type:"union",options:e,...Z(t)})}o(N,"union");var Fu=b("ZodMiniDiscriminatedUnion",(e,t)=>{oo.init(e,t),K.init(e,t)});function Se(e,t,r){return new Fu({type:"union",options:t,discriminator:e,...Z(r)})}o(Se,"discriminatedUnion");var Bu=b("ZodMiniRecord",(e,t)=>{io.init(e,t),K.init(e,t)});function k(e,t,r){return new Bu({type:"record",keyType:e,valueType:t,...Z(r)})}o(k,"record");var Zu=b("ZodMiniEnum",(e,t)=>{ao.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function C(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Zu({type:"enum",entries:r,...Z(t)})}o(C,"_enum");var Vu=b("ZodMiniLiteral",(e,t)=>{so.init(e,t),K.init(e,t)});function $(e,t){return new Vu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o($,"literal");var Hu=b("ZodMiniTransform",(e,t)=>{uo.init(e,t),K.init(e,t)});function Ae(e){return new Hu({type:"transform",transform:e})}o(Ae,"transform");var Wu=b("ZodMiniOptional",(e,t)=>{co.init(e,t),K.init(e,t)});function h(e){return new Wu({type:"optional",innerType:e})}o(h,"optional");var Gu=b("ZodMiniNullable",(e,t)=>{po.init(e,t),K.init(e,t)});function it(e){return new Gu({type:"nullable",innerType:e})}o(it,"nullable");var qu=b("ZodMiniPipe",(e,t)=>{lo.init(e,t),K.init(e,t)});function ze(e,t){return new qu({type:"pipe",in:e,out:t})}o(ze,"pipe");var Ku=b("ZodMiniCustom",(e,t)=>{mo.init(e,t),K.init(e,t)});function Mt(e,t){return Oo(Ku,e??(()=>!0),t)}o(Mt,"custom");var at={};Tn(at,{bigint:()=>tc,boolean:()=>ec,date:()=>rc,number:()=>Qu,string:()=>Yu});function Yu(e){return vo(Ct,e)}o(Yu,"string");function Qu(e){return Po(Ut,e)}o(Qu,"number");function ec(e){return Io(br,e)}o(ec,"boolean");function tc(e){return Eo(No,e)}o(tc,"bigint");function rc(e){return zo(Co,e)}o(rc,"date");var Ir=l({retryOnFailure:l({defaultValue:h(B()),hide:h(B())}),continueOnFailure:l({defaultValue:h(B()),hide:h(B())})}),Tr=class{constructor(t,r,n,i,u,c,p,f,g,x,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=x;this.aiMetadata=T}static{o(this,"IAction")}},ee=o(e=>new Tr(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 F=l({displayName:a(),description:h(a())}),D=o((e,t)=>l({type:$(t),required:B(),defaultValue:h(ot())}),"TPropertyValue");var oe=l({...F.shape,...D(a(),"SHORT_TEXT").shape}),he=l({...F.shape,...D(a(),"LONG_TEXT").shape});var Mo=l({label:a(),value:O()}),jt=l({disabled:h(B()),placeholder:h(a()),options:R(Mo)});var ie=l({...F.shape,options:jt,...D(O(),"STATIC_DROPDOWN").shape}),ve=l({...F.shape,options:jt,...D(R(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=l({...F.shape,...D(O(),"DROPDOWN").shape,refreshers:R(a())}),st=l({...F.shape,...D(R(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var xe=l({...F.shape,...D(B(),"CHECKBOX").shape});var _e=l({...F.shape,...D(Q(),"NUMBER").shape});var ut=l({...F.shape,streaming:h(B()),...D(O(),"FILE").shape});var ct=l({...F.shape,...D(a(),"DATE_TIME").shape});var jo=k(a(),N([oe,he,ie,st,ve,xe,_e,ut,ct])),pt=l({...F.shape,properties:jo,...D(R(O()),"ARRAY").shape});var lt=l({...F.shape,...D(N([k(a(),O())]),"JSON").shape});var Lo=N([oe,ie,lt,pt,ve]),oc=k(a(),Lo),$r=l({refreshers:R(a()),...F.shape,...D(O(),"DYNAMIC").shape});var Lt=l({...F.shape,...D(Do(),"MARKDOWN").shape});var dt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(dt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),Fe=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Fe||{});var mt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(mt||{}),Sr="both_client_credentials_and_authorization_code";var Oe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Oe||{}),ft=(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))(ft||{}),ic=l({strategy:C(ft),paramName:h(a())}),gt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(gt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Fo=l({status:h(Q()),body:h(O()),headers:h(k(a(),a()))}),Bo=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(C(Ft))}),Zo=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Fo,handlerId:h(a()),streamStepProgress:h(C(Ft))}),ac=N([Bo,Zo]);var sc=l({body:O(),rawBody:h(O()),headers:k(a(),a()),queryParams:k(a(),a())});function ae(e){return e==null}o(ae,"isNil");function yt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(yt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var Ar=Ue(require("crypto"),1);var uc=128,Re,Be,cc=o(e=>{!Re||Re.length<e?(Re=Buffer.allocUnsafe(e*uc),Ar.default.randomFillSync(Re),Be=0):Be+e>Re.length&&(Ar.default.randomFillSync(Re),Be=0),Be+=e},"fillPool"),pc=o(e=>(cc(e|=0),Re.subarray(Be-e,Be)),"random"),lc=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 p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),Ho=o((e,t=21)=>lc(e,t,pc),"customAlphabet");var dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Wo=21,Tb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Wo}}$`))),mc=Ho(dc,Wo);var ke=ze(Ae(e=>e instanceof Date?e.toISOString():e),a()),se={id:a(),created:ke,updated:ke},V=o(e=>h(it(e)),"Nullable");function zr(e){return h(it(C(e)))}o(zr,"NullableEnum");var $b=ze(Ae(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Zt=o(e=>ze(Ae(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(R(e))),"OptionalArrayFromQuery");var zb=k(a(),O());var ht=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(ht||{});var Fb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var Zb=l({filename:a(),data:O(),type:$("file"),mimetype:h(a())});var fc=Ue(qo());var Jb=l({...se,name:a(),permissions:R(a()),platformId:V(a()),type:a(),userCount:h(Q())});var Ko=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ko||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),kr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(kr||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var Rr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Rr||{});var gc=l({mode:C(Ko),value:O()}),yc=l({auth:h(a()),fields:k(a(),gc)}),hc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(yc)}),vc=l({type:$("PIECE"),toolName:a().check(ce(1)),pieceMetadata:hc}),xc=l({type:$("none")}),_c=l({type:$("access_token"),accessToken:a()}),Pc=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),bc=l({type:$("headers"),headers:k(a(),a())}),Tc=Se("type",[xc,_c,Pc,bc]),Jo=l({type:$("FLOW"),toolName:a().check(ce(1)),externalFlowId:a(),flowDisplayName:h(a())}),Xo=l({type:$("MCP"),toolName:a().check(ce(1)),serverUrl:wo(),protocol:C(kr),auth:Tc}),Yo=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(ce(1)),sourceType:C(Or),sourceId:a(),sourceName:a()}),Ic=Se("type",[vc,Jo,Xo,Yo]),Ec=l({displayName:a(),description:h(a()),type:C(wr)}),Qo=l({type:$("MARKDOWN"),markdown:a()}),Ze={type:$("TOOL_CALL"),input:V(k(a(),O())),output:h(O()),toolName:a(),status:C(Rr),toolCallId:a(),startTime:a(),endTime:h(a())},ST=l(Ze),ei=Se("toolCallType",[l({...Ze,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Ze,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Ze,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Ze,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Ze,toolCallType:$("UNKNOWN"),displayName:a()})]),$c=N([Qo,ei]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),Pe=l({apiKey:a()}),Sc=Pe,Ac=l({apiKey:a(),apiKeyHash:a()}),zc=Pe,Oc=Pe,kc=Pe,wc=Pe,Rc=Pe,Nc=Pe,Dc=Pe,ii=l({accessKeyId:a().check(ce(1)),secretAccessKey:a().check(ce(1))}),Cc=l({}),Uc=l({}),Mc=l({}),jc=l({}),Lc=l({}),Fc=l({}),ai=l({modelId:a(),modelName:a(),modelType:C(Nr)}),si=l({apiKeyHeader:a(),baseUrl:a(),models:R(ai),defaultHeaders:h(k(a(),a()))}),ui=l({accountId:a(),gatewayId:a(),models:R(ai),vertexProject:h(a()),vertexRegion:h(a())}),ci=l({resourceName:a(),apiVersion:ze(Ae(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),pi=l({region:a().check(ce(1))}),Bc=N([Sc,kc,wc,Rc,Nc,Oc,zc,Ac,ii,Dc]),li=N([si,ui,ci,pi,Cc,Mc,jc,Lc,Uc,Fc]),Zc=l({id:a(),name:a(),type:C(Nr)}),Vc=l({id:a(),name:a(),provider:C(ht),config:li,enabledForChat:B()}),Hc=l({provider:C(ht),config:li,auth:Bc,platformId:a()});var kT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Wc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Gc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],qc=["grok-4.20","grok-4.1-fast"],Kc={openai:ti,anthropic:Wc,google:ri,activepieces:[...Gc.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...qc.map(e=>`x-ai/${e}`)]};var ni=128e3,Jc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Xc({provider:e}){return e?Jc[e]??ni:ni}o(Xc,"getMaxContextTokens");var oi={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Yc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Qc=new Set(["anthropic","mistral"]);function de(e){return{chatModels:Kc[e],maxContextTokens:Xc({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!Qc.has(e),webSearch:Yc[e]}}o(de,"buildProviderCapabilities");var ep={openai:de("openai"),anthropic:de("anthropic"),openrouter:de("openrouter"),azure:de("azure"),google:de("google"),"cloudflare-gateway":de("cloudflare-gateway"),custom:de("custom"),bedrock:de("bedrock"),mistral:de("mistral"),activepieces:de("activepieces")};var tp=l({base64Url:a(),fileName:a(),extension:h(a())}),rp=l({mimeType:a(),url:a(),fileName:h(a())}),Dr=N([tp,rp]);var np=N([l({type:$("file"),value:Dr}),l({type:$("markdown"),value:a(),files:h(R(Dr))})]),op=l({sessionId:a(),message:a(),files:h(R(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var ip=N([l({...se,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:R(l({value:a()}))})}),l({...se,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),ap=l({...se,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:zr(fi),trigger:zr(mi)}),sp=l({...se,tableId:a(),projectId:a(),cells:k(a(),l({updated:a(),created:a(),value:O(),fieldName:a()}))}),up=l({events:R(C(Cr)),webhookUrl:a(),flowId:a()}),cp=l({fields:R(l({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),pp=l({projectId:a(),limit:h(at.number()),cursor:h(a()),name:h(a()),externalIds:Zt(a()),folderId:h(a()),folderIds:Zt(a())}),lp=l({records:R(R(l({fieldId:a(),value:yi()}))),tableId:a()}),dp=l({cells:h(R(l({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:h(B())}),gi=Se("operator",[Ne("eq"),Ne("neq"),Ne("gt"),Ne("gte"),Ne("lt"),Ne("lte"),Ne("co"),di("exists"),di("not_exists")]),mp=l({tableId:a(),limit:h(at.number()),cursor:h(a()),filters:Zt(gi)});function yi(){return ze(Ae(e=>e==null?e:String(e)),it(a()))}o(yi,"coerceToString");function Ne(e){return l({fieldId:a(),operator:$(e),value:a()})}o(Ne,"valueFilter");function di(e){return l({fieldId:a(),operator:$(e)})}o(di,"existenceFilter");var fp=l({status:h(Q()),body:h(O()),headers:h(k(a(),a()))}),gp=l({...se,deleted:V(ke),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var hi=l({name:a(),description:h(a()),type:a(),required:B()}),yp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:R(hi),returnsResponse:B()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",JT=new RegExp(vi),vp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",XT=a().check($e(new RegExp(vi))),YT=a().check($e(new RegExp(vp))),xp=l({packageType:$("ARCHIVE"),pieceType:C(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),xi=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),_i=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),QT=N([xi,_i]),eI=N([xp,xi,_i]);var _p=Se("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:Ro().check(Nt(6e4))})]),tI=l({...se,type:C(Oe),projectId:a(),flowId:a(),triggerName:a(),schedule:V(_p),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),Pi=(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))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ti=(r=>(r.S3="S3",r.DB="DB",r))(Ti||{}),rI=l({...se,projectId:V(a()),platformId:V(a()),type:C(Pi),compression:C(bi),data:h(O()),location:C(Ti),size:V(Q()),fileName:V(a()),s3Key:V(a()),metadata:V(k(a(),a()))}),Ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ii||{}),Ei=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ei||{}),nI=l({id:a(),email:a(),firstName:a(),status:C(Ei),externalId:V(a()),platformId:V(a()),platformRole:C(Ii),lastName:a(),created:ke,updated:ke,lastActiveDate:V(ke),imageUrl:V(a())});var Ur=l({...F.shape,...D(k(a(),O()),"OBJECT").shape});var zi=l({...F.shape,...D(a(),"COLOR").shape});var Mr=N([oe,he,Lt,xe,ie,ve,Er,st,$r,_e,pt,Ur,lt,ct,ut,zi]),M={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 me=l({displayName:a(),description:h(a())});var Oi=l({username:a(),password:a()}),jr=l({...me.shape,username:l({displayName:a(),description:h(a())}),password:l({displayName:a(),description:h(a())}),...D(Oi,"BASIC_AUTH").shape});var Ip=k(a(),N([oe,he,_e,xe,ie])),Lr=l({...me.shape,props:Ip,...D(O(),"CUSTOM_AUTH").shape});var De=l({...me.shape,...D(l({auth:a()}),"SECRET_TEXT").shape});var Ep=k(a(),N([oe,he,De,_e,xe,ie,ve,Lt])),ki=l({...me.shape,props:Ep,...D(O(),"OIDC").shape});var Fr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Fr||{}),wi=N([oe,De,ie]),Ri=k(a(),wi),$p=l({props:h(k(a(),wi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:h(N([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(B()),pkceMethod:h(N([$("plain"),$("S256")])),authorizationMethod:h(C(Fr)),grantType:h(N([C(mt),$(Sr)])),extra:h(k(a(),a()))}),Ni=l({access_token:a(),props:h(Ri),data:k(a(),ot())}),Br=l({...me.shape,...$p.shape,...D(Ni,"OAUTH2").shape});var Ve=N([jr,Lr,ki,Br,De]),vt="Connection",Ht={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||vt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||vt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||vt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||vt}},None(){}};var DE={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 Sp=l({...F.shape,...D(O(),"CUSTOM").shape,code:a()});var Ap=N([Mr,Ve]),Zr=k(a(),Ap),t$=k(a(),Mr);var Di=N([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]),He=class{constructor(t,r,n,i,u,c,p,f,g,x,T,_,s,d,y,m,v,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=x;this.onEnable=T;this.onDisable=_;this.onStart=s;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=j}static{o(this,"ITrigger")}},Ci=o(e=>{switch(e.type){case"WEBHOOK":return new He(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 He(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 He(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 He(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,ae(e.sampleData)&&ae(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ui="2",Wt="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,p,f,g=Wt,x,T="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=x;this.description=T;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ui}),"getContextInfo");(!zp(g)||Op(g,Wt))&&(this.minimumSupportedRelease=Wt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Mi=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 Vr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function zp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(zp,"isValidSimpleSemver");function Op(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Op,"isSemverLessThan");var kp=h(k(a(),k(a(),a()))),ji=l({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:h(a()),directoryPath:h(a()),auth:h(N([Ve,R(Ve)])),version:a(),categories:h(R(C(Fe))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(B()),i18n:kp}),wp=C(["human","ai","both"]),Li=l({description:h(a()),idempotent:h(B())}),Fi=l({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:B(),errorHandlingOptions:h(Ir),outputSchema:h(Mt()),audience:h(wp),aiMetadata:h(Li)}),Bi=l({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:h(Ir),type:C(Oe),sampleData:O(),handshakeConfiguration:h(Mt()),renewConfiguration:h(Di),testStrategy:C(gt),outputSchema:h(Mt()),aiMetadata:h(Li)}),Rp=l({...ji.shape,actions:k(a(),Fi),triggers:k(a(),Bi)}),Np=l({...ji.shape,actions:Q(),triggers:Q(),suggestedActions:h(R(Fi)),suggestedTriggers:h(R(Bi))}),Zi=l({projectUsage:Q(),pieceType:C(Le),packageType:C(dt),platformId:h(a()),archiveId:h(a())}),tS=l({...Rp.shape,...Zi.shape}),rS=l({...Np.shape,...Zi.shape}),nS=l({name:a(),version:a()});var Dp=Ue(require("path")),Cp=Ue(require("fs/promises"));var Gi=require("node:stream");var Gt=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"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new Wr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Wr=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 xt=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}}};function Vi({error:e,requestBody:t}){return e instanceof xt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Vi,"toFailsafeOutput");var fe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(fe||{});var Kt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new qt){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[j,ne]of Object.entries(c))i.append(j,ne);let p=i.toString(),f=p?`${n}?${p}`:n,g=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Up(t.method)?Mp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Lp({...u,...s}),m=await jp(async()=>{let j=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ue={method:t.method.toString(),headers:y,body:_,redirect:x?"follow":"manual",signal:j.signal};return d&&(ue.duplex="half"),r?.dispatcher!==void 0&&(ue.dispatcher=r.dispatcher),await fetch(f,ue)}finally{ne!==void 0&&clearTimeout(ne)}},T),v=x?300:400;if(m.status<200||m.status>=v){let j=await Hi(m,g),ne=new xt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await Hi(m,g);return{status:m.status,headers:Fp(m.headers),body:P}}};function Up(e){return e!=="GET"&&e!=="HEAD"}o(Up,"acceptsRequestBody");function Mp(e,t){if(Zp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Bp(e)){let n=new Gi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return 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(Mp,"serializeBody");async function Hi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Hi,"parseResponseBody");async function jp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Wi(n);continue}return i}catch(i){if(r=i,n<t){await Wi(n);continue}throw i}throw r}o(jp,"sendWithRetries");function Wi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Wi,"backoff");function Lp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Lp,"normalizeHeaders");function Fp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Fp,"toHttpHeaders");function Bp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Bp,"isNodeFormData");function Zp(e){return e==null}o(Zp,"isNil");var Y=new Kt;var Od=Ue(require("fs")),Qs=Ue(Ys());var kd={"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 wd(e){let t=e.split(";")[0].trim().toLowerCase();return kd[t]??""}o(wd,"contentTypeToExtension");var Rd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Nd=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 eu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return ee({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:M.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:M.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Nd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:M.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(fe).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:M.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:M.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:M.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:M.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let x=g,T={};switch(x){case"none":break;case"json":T.data=M.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=M.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=M.Array({displayName:"Form Data",required:!0,properties:{fieldName:M.ShortText({displayName:"Field Name",required:!0}),fieldType:M.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:M.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:M.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:M.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:M.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:M.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:M.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:x,url:T,headers:_,queryParams:s,body:d,body_type:y,failsafe:m,timeout:v,response_is_binary:P,followRedirects:j}=g.propsValue;Bt(x,"Method"),Bt(T,"URL");let ne=ae(r)?{}:await r(g.auth,g.propsValue),ue=T.url,Xe=ue.startsWith("http://")||ue.startsWith("https://")?ue:Rd({baseUrl:t(g.auth),relativePath:ue}),be={method:x,url:Xe,headers:{..._??{},...f==="headers"||!ae(f)?ne:{}},queryParams:{...f==="queryParams"?ne:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(P&&(be.responseType="arraybuffer"),d)if(y&&y!=="none"){let ge=d.data;if(y==="form_data"){let ru=ge,Tt=new Qs.default;for(let{fieldName:_n,fieldType:Pn,textFieldValue:bn,fileFieldValue:ur}of ru)Pn==="text"&&!yt(bn)?Tt.append(_n,bn):Pn==="file"&&!yt(ur)&&Tt.append(_n,ur.data,{filename:ur?.filename});be.body=Tt,be.headers={...be.headers,...Tt.getHeaders()}}else be.body=ge}else y||(be.body=d);try{let ge=await Y.sendRequest(be);return await Dd(g.files,ge.body,ge.status,ge.headers,P)}catch(ge){if(m)return Vi({error:ge,requestBody:be.body});throw ge}},"run")})}o(eu,"createCustomApiCallAction");var Dd=o(async(e,t,r,n,i)=>{let u;if(i&&Cd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=wd(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.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Cd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Ud=`
|
|
12
4
|
Follow these steps:
|
|
13
5
|
|
|
14
6
|
1. **Enter the Base URL:** Open your Mautic instance and copy the URL from the address bar. If your dashboard link is "https://mautic.ddev.site/s/dashboard", set your base URL as "https://mautic.ddev.site/".
|
|
15
7
|
|
|
16
8
|
2. **Enable Basic Authentication:** Log in to Mautic, go to **Settings** > **Configuration** > **API Settings**, and ensure that Basic Authentication is enabled.
|
|
17
9
|
|
|
18
|
-
`;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
actions_1.searchContact,
|
|
30
|
-
actions_1.updateContact,
|
|
31
|
-
actions_1.createCompany,
|
|
32
|
-
actions_1.searchCompany,
|
|
33
|
-
actions_1.updateCompany,
|
|
34
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
35
|
-
auth: auth_1.mauticAuth,
|
|
36
|
-
baseUrl: (auth) => {
|
|
37
|
-
if (!auth) {
|
|
38
|
-
return '';
|
|
39
|
-
}
|
|
40
|
-
const { base_url } = auth.props;
|
|
41
|
-
return `${base_url.endsWith('/') ? base_url : base_url + '/'}api/`;
|
|
42
|
-
},
|
|
43
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
const { username, password } = auth.props;
|
|
45
|
-
return {
|
|
46
|
-
Authorization: 'Basic ' +
|
|
47
|
-
Buffer.from(`${username}:${password}`).toString('base64'),
|
|
48
|
-
'Content-Type': 'application/json',
|
|
49
|
-
};
|
|
50
|
-
}),
|
|
51
|
-
}),
|
|
52
|
-
],
|
|
53
|
-
triggers: triggers_1.triggers,
|
|
54
|
-
});
|
|
55
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
+
`,J=Ht.CustomAuth({description:Ud,props:{base_url:M.ShortText({displayName:"Base URL",required:!0}),username:M.ShortText({displayName:"Username",required:!0}),password:Ht.SecretText({displayName:"Password",required:!0})},required:!0});var Md=o((e,t,r)=>{switch(e){case"lookup":case"text":case"email":case"tel":case"region":case"country":case"locale":case"timezone":case"url":return M.ShortText(t);case"date":case"datetime":return M.DateTime(t);case"number":return M.Number(t);case"boolean":return M.StaticDropdown({...t,options:{options:[{value:"no",label:"No"},{value:"yes",label:"Yes"}]}});case"multiselect":return M.StaticMultiSelectDropdown({...t,options:{options:Object.values(r)[0]}});case"select":return M.StaticDropdown({...t,options:{options:Object.values(r)[0]}});default:return console.error(`No support of type ${e}`),null}},"mapMauticToActivepiecesProperty"),jd=o(async(e,t,r,n)=>{let i={method:"GET",url:`${e.endsWith("/")?e:e+"/"}api/fields/${n}?limit=1000`,headers:{Authorization:`Basic ${Buffer.from(`${t}:${r}`).toString("base64")}`,"Content-Type":"application/json"}},u=await Y.sendRequest(i);if(u.status==200)return Object.values(u.body.fields).reduce((c,p)=>{let{label:f,alias:g,type:x,properties:T}=p,_={displayName:f,required:!1};if(!x)return{};let s=Md(x,_,T);return s&&(c[g]=s),c},{});throw Error(`Unable to fetch ${n} metadata`)},"fetchDynamicFieldsFromMetadata"),ir=o(e=>M.DynamicProperties({auth:J,displayName:"All Fields",description:"List of all possible fields present",required:!0,refreshers:[],props:o(async({auth:t})=>{if(!t)return{};let{base_url:r,username:n,password:i}=t.props;return jd(r,n,i,e)},"props")}),"getFields");var re={contactFields:{...ir("contact"),...ir("lead")},companyFields:ir("company"),id:M.ShortText({displayName:"Id of the entity",required:!0})},ar=o(async(e,t,r,n)=>{let i={method:"GET",url:`${e}${t}`,headers:{Authorization:`Basic ${Buffer.from(`${r}:${n}`).toString("base64")}`,"Content-Type":"application/json"}},u=await Y.sendRequest(i),c=u.body.total;if(!c||c!=1)throw Error("The query is not perfect enough to get single result. Please refine");return u},"searchEntity");var fn=ee({auth:J,description:"Creates a new contact in Mautic CRM",audience:"both",aiMetadata:{description:"Create a new contact (lead) in Mautic from the provided field values (name, email, phone, custom fields, etc.). Use when adding a person to Mautic; to modify an existing contact use Update Contact instead, and to avoid duplicates check first with Search Contact. Not idempotent: each call inserts a new contact, so repeating it produces duplicates.",idempotent:!1},displayName:"Create Contact",name:"create_mautic_contact",props:{fields:re.contactFields},run:o(async function(e){let{base_url:t,username:r,password:n}=e.auth.props,i={method:"POST",url:(t.endsWith("/")?t:t+"/")+"api/contacts/new",body:JSON.stringify(e.propsValue.fields),headers:{Authorization:"Basic "+Buffer.from(`${r}:${n}`).toString("base64"),"Content-Type":"application/json"}};return await Y.sendRequest(i)},"run")});var gn=ee({auth:J,description:"Search for a contact in Mautic CRM",audience:"both",aiMetadata:{description:"Look up a contact in Mautic by matching the supplied field values (each provided field becomes an exact-equality filter), returning the first matching contact. Use to find a contact or resolve its id before updating, or to verify whether someone already exists before creating one. Read-only and idempotent.",idempotent:!0},displayName:"Search Contact",name:"search_mautic_contact",props:{fields:re.contactFields},run:o(async function(e){let{base_url:t,username:r,password:n}=e.auth.props,i=(t.endsWith("/")?t:t+"/")+"api/contacts",u=e.propsValue.fields,c=Object.keys(u),p=0,f="?";for(let x of c)u[x]&&(f+=`where[${p}][col]=${x}&where[${p}][expr]=eq&where[${p}][val]=${u[x]}&`,++p);let g=await ar(i,f,r,n);return Object.values(g.body.contacts)[0]},"run")});var yn=ee({auth:J,description:"Update a contact in Mautic CRM",audience:"both",aiMetadata:{description:"Update an existing Mautic contact, identified by its numeric contact id, with the provided field values. Use when you already know the contact id (resolve it first with Search Contact if you only have an email or name). Idempotent: applying the same field values to the same id repeatedly leaves the contact in the same state.",idempotent:!0},displayName:"Update Contact With Contact Id",name:"update_mautic_contact",props:{id:re.id,fields:re.contactFields},run:o(async function(e){let{base_url:t,username:r,password:n}=e.auth.props,i={method:"PATCH",url:`${t.endsWith("/")?t:t+"/"}api/contacts/${e.propsValue.id}/edit`,body:JSON.stringify(e.propsValue.fields),headers:{Authorization:"Basic "+Buffer.from(`${r}:${n}`).toString("base64"),"Content-Type":"application/json"}};return await Y.sendRequest(i)},"run")});var hn=ee({auth:J,description:"Creates a new company in Mautic CRM",audience:"both",aiMetadata:{description:"Create a new company in Mautic from the provided field values (company name, address, custom fields, etc.). Use when adding an organization to Mautic; to modify an existing company use Update Company, and check Search Company first to avoid duplicates. Not idempotent: each call inserts a new company record.",idempotent:!1},displayName:"Create Company",name:"create_mautic_company",props:{fields:re.companyFields},run:o(async function(e){let{base_url:t,username:r,password:n}=e.auth.props,i={method:"POST",url:(t.endsWith("/")?t:t+"/")+"api/companies/new",body:JSON.stringify(e.propsValue.fields),headers:{Authorization:"Basic "+Buffer.from(`${r}:${n}`).toString("base64"),"Content-Type":"application/json"}};return await Y.sendRequest(i)},"run")});var vn=ee({auth:J,description:"Search for a company in Mautic CRM",audience:"both",aiMetadata:{description:"Look up a company in Mautic by matching the supplied field values (combined into a search query), returning the first matching company. Use to find a company or resolve its id before updating, or to verify whether an organization already exists before creating one. Read-only and idempotent.",idempotent:!0},displayName:"Search Company",name:"search_mautic_company",props:{fields:re.companyFields},run:o(async function(e){let{base_url:t,username:r,password:n}=e.auth.props,i=(t.endsWith("/")?t:t+"/")+"api/companies",u=e.propsValue.fields,c=Object.keys(u),p="?";for(let g of c)u[g]&&(p+=`search=${g}:${u[g]}&`);let f=await ar(i,p,r,n);return Object.values(f.body.companies)[0]},"run")});var xn=ee({auth:J,description:"Update a company in Mautic CRM",audience:"both",aiMetadata:{description:"Update an existing Mautic company, identified by its numeric company id, with the provided field values (empty fields are dropped so they are left unchanged). Use when you already know the company id (resolve it first with Search Company if you only have a name). Idempotent: applying the same field values to the same id repeatedly leaves the company in the same state.",idempotent:!0},displayName:"Update Company With Contact Id",name:"update_mautic_company",props:{id:re.id,fields:re.companyFields},run:o(async function(e){let{base_url:t,username:r,password:n}=e.auth.props,i=e.propsValue.fields,u=Object.keys(i);for(let p of u)i[p]||delete i[p];let c={method:"PATCH",url:`${t.endsWith("/")?t:t+"/"}api/companies/${e.propsValue.id}/edit`,body:JSON.stringify(i),headers:{Authorization:"Basic "+Buffer.from(`${r}:${n}`).toString("base64"),"Content-Type":"application/json"}};return await Y.sendRequest(c)},"run")});var sr={contact:{id:38186,points:0,color:null,fields:{core:{points:{id:"9",label:"Points",alias:"points",type:"number",group:"core",object:"lead",is_fixed:"1",value:"0"},title:{id:"1",label:"Title",alias:"title",type:"lookup",group:"core",object:"lead",is_fixed:"1",value:""},firstname:{id:"2",label:"First Name",alias:"firstname",type:"text",group:"core",object:"lead",is_fixed:"1",value:"Test"},lastname:{id:"3",label:"Last Name",alias:"lastname",type:"text",group:"core",object:"lead",is_fixed:"1",value:"Contact"},company:{id:"4",label:"Company",alias:"company",type:"text",group:"core",object:"lead",is_fixed:"1",value:""},position:{id:"5",label:"Position",alias:"position",type:"text",group:"core",object:"lead",is_fixed:"1",value:""},email:{id:"6",label:"Email",alias:"email",type:"email",group:"core",object:"lead",is_fixed:"1",value:"Test@email.com"},phone:{id:"8",label:"Phone",alias:"phone",type:"tel",group:"core",object:"lead",is_fixed:"1",value:""},mobile:{id:"7",label:"Mobile",alias:"mobile",type:"tel",group:"core",object:"lead",is_fixed:"1",value:""},address1:{id:"11",label:"Address Line 1",alias:"address1",type:"text",group:"core",object:"lead",is_fixed:"1",value:""},address2:{id:"12",label:"Address Line 2",alias:"address2",type:"text",group:"core",object:"lead",is_fixed:"1",value:""},city:{id:"13",label:"City",alias:"city",type:"text",group:"core",object:"lead",is_fixed:"1",value:""},state:{id:"14",label:"State",alias:"state",type:"region",group:"core",object:"lead",is_fixed:"1",value:""},zipcode:{id:"15",label:"Zip Code",alias:"zipcode",type:"text",group:"core",object:"lead",is_fixed:"1",value:""},country:{id:"16",label:"Country",alias:"country",type:"country",group:"core",object:"lead",is_fixed:"1",value:""},fax:{id:"10",label:"Fax",alias:"fax",type:"tel",group:"core",object:"lead",is_fixed:"0",value:null},preferred_locale:{id:"17",label:"Preferred Locale",alias:"preferred_locale",type:"locale",group:"core",object:"lead",is_fixed:"1",value:null},attribution_date:{id:"18",label:"Attribution Date",alias:"attribution_date",type:"datetime",group:"core",object:"lead",is_fixed:"1",value:null},attribution:{id:"19",label:"Attribution",alias:"attribution",type:"number",group:"core",object:"lead",is_fixed:"1",value:null},website:{id:"20",label:"Website",alias:"website",type:"url",group:"core",object:"lead",is_fixed:"0",value:null},boolean:{id:"43",label:"Boolean",alias:"boolean",type:"boolean",group:"core",object:"lead",is_fixed:"0",value:null},multiple_contact:{id:"44",label:"Multiple Contact",alias:"multiple_contact",type:"multiselect",group:"core",object:"lead",is_fixed:"0",value:null}},social:{facebook:{id:"21",label:"Facebook",alias:"facebook",type:"text",group:"social",object:"lead",is_fixed:"0",value:null},foursquare:{id:"22",label:"Foursquare",alias:"foursquare",type:"text",group:"social",object:"lead",is_fixed:"0",value:null},instagram:{id:"24",label:"Instagram",alias:"instagram",type:"text",group:"social",object:"lead",is_fixed:"0",value:null},linkedin:{id:"25",label:"LinkedIn",alias:"linkedin",type:"text",group:"social",object:"lead",is_fixed:"0",value:null},skype:{id:"26",label:"Skype",alias:"skype",type:"text",group:"social",object:"lead",is_fixed:"0",value:null},twitter:{id:"27",label:"Twitter",alias:"twitter",type:"text",group:"social",object:"lead",is_fixed:"0",value:null}},personal:[],professional:[]}},channel:"email",old_status:"contactable",new_status:"manual",timestamp:"2017-12-01T00:05:18-06:00"},tu=[{name:"lead_post_save_update",displayName:"Contact Updated",description:"Triggers when a contact is updated.",aiMetadata:{description:"Fires when an existing contact (lead) in Mautic is saved after being modified, representing a change to that contact's field values. Use to react to edits on already-existing contacts; for newly created contacts use the New Contact trigger."},sampleData:{"mautic.lead_post_save_update":[sr]},eventType:"mautic.lead_post_save_update"},{name:"lead_company_change",displayName:"Contact Company Subscription Change",description:"Triggers when a commpany is added or removed to/from contact.",aiMetadata:{description:"Fires when a contact's company association changes in Mautic \u2014 that is, when the contact is added to or removed from a company. Use to react to a contact's organization membership changing."},sampleData:{"mautic.lead_company_change":[sr]},eventType:"mautic.lead_company_change"},{name:"lead_channel_subscription_changed",displayName:"Contact Channel Subscription Change",description:"Triggers when a contact's channel subscription status changes.",aiMetadata:{description:"Fires when a contact's subscription status for a communication channel (such as email) changes in Mautic \u2014 for example when they opt in or out of receiving messages. Use to react to contactability/consent changes for a channel."},sampleData:{"mautic.lead_channel_subscription_changed":[sr]},eventType:"mautic.lead_channel_subscription_changed"},{name:"lead_post_save_new",displayName:"New Contact",description:"Triggers when a new contact is created.",aiMetadata:{description:"Fires when a new contact (lead) is created in Mautic, representing a freshly added person. Use to react to contact creation; for changes to existing contacts use the Contact Updated trigger."},sampleData:{"mautic.lead_post_save_new":[sr]},eventType:"mautic.lead_post_save_new"}].map(e=>Ld(e));function Ld({name:e,displayName:t,eventType:r,description:n,aiMetadata:i,sampleData:u}){return Ci({auth:J,name:`mautic_${e}_trigger`,displayName:t,description:n,aiMetadata:i,props:{name:M.ShortText({displayName:"Webhook Name",description:"The name the webhook will be searchable by in mautic the webhooks page.",required:!0}),description:M.LongText({displayName:"Description",description:"A short description of the webhook",required:!0})},sampleData:u,type:"WEBHOOK",async onEnable(c){let{base_url:p,username:f,password:g}=c.auth.props,x={method:"POST",url:`${p.endsWith("/")?p:p+"/"}api/hooks/new`,body:{name:c.propsValue.name,description:c.propsValue.description,webhookUrl:c.webhookUrl,eventsOrderbyDir:"ASC",triggers:[r]},headers:{"Content-Type":"application/json",Authorization:"Basic "+Buffer.from(`${f}:${g}`).toString("base64")},queryParams:{}},T=await Y.sendRequest(x);await c.store.put(`mautic_${e}_trigger`,T.body)},async onDisable(c){let{base_url:p,username:f,password:g}=c.auth.props,x=await c.store.get(`mautic_${e}_trigger`);if(x!=null){let T={method:"DELETE",url:`${p.endsWith("/")?p:p+"/"}api/hooks/${x.hook.id}/delete`,headers:{"Content-Type":"application/json",Authorization:"Basic "+Buffer.from(`${f}:${g}`).toString("base64")}},_=await Y.sendRequest(T);console.debug("mautic.trigger.onDisable",_)}},async run(c){return[c.payload.body]}})}o(Ld,"registerTrigger");var Fd=Mi({displayName:"Mautic",description:"Open-source marketing automation software",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/mautic.png",authors:["bibhuty-did-this","kanarelo","kishanprmr","MoShizzle","khaledmashaly","abuaboud"],categories:["MARKETING"],auth:J,actions:[fn,gn,yn,hn,vn,xn,eu({auth:J,baseUrl:o(e=>{if(!e)return"";let{base_url:t}=e.props;return`${t.endsWith("/")?t:t+"/"}api/`},"baseUrl"),authMapping:o(async e=>{let{username:t,password:r}=e.props;return{Authorization:"Basic "+Buffer.from(`${t}:${r}`).toString("base64"),"Content-Type":"application/json"}},"authMapping")})],triggers:tu});0&&(module.exports={mautic});
|
|
11
|
+
/*! Bundled license information:
|
|
12
|
+
|
|
13
|
+
mime-types/index.js:
|
|
14
|
+
(*!
|
|
15
|
+
* mime-types
|
|
16
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
17
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
18
|
+
* MIT Licensed
|
|
19
|
+
*)
|
|
20
|
+
*/
|
package/src/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const mautic: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>>;
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,MAAM;;;;GAqCjB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAKwC;AACxC,iDAAqD;AACrD,2CAOuB;AACvB,6CAA0C;AAC1C,qCAAwC;AAExC,MAAM,mBAAmB,GAAG;;;;;;;CAO3B,CAAC;AAEW,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,2CAA2C;IAExD,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,OAAO,EAAE,CAAC,kBAAkB,EAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,eAAe,EAAC,UAAU,CAAC;IAC5F,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,IAAI,EAAE,iBAAU;IAChB,OAAO,EAAE;QACP,uBAAa;QACb,uBAAa;QACb,uBAAa;QACb,uBAAa;QACb,uBAAa;QACb,uBAAa;QACb,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,iBAAU;YAChB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,EAAE,CAAC;gBACZ,CAAC;gBACD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;gBAChC,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,MAAM,CAAC;YACrE,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;gBAC1C,OAAO;oBACL,aAAa,EACX,QAAQ;wBACR,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBAC3D,cAAc,EAAE,kBAAkB;iBACnC,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const createCompany: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
fields: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
-
base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
9
|
-
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
10
|
-
}>>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=create-company.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-company.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-company.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;;;;;;;;EA8BxB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createCompany = 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 common_1 = require("../common");
|
|
8
|
-
const auth_1 = require("../auth");
|
|
9
|
-
exports.createCompany = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.mauticAuth,
|
|
11
|
-
description: 'Creates a new company in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
|
|
12
|
-
audience: 'both',
|
|
13
|
-
aiMetadata: {
|
|
14
|
-
description: 'Create a new company in Mautic from the provided field values (company name, address, custom fields, etc.). Use when adding an organization to Mautic; to modify an existing company use Update Company, and check Search Company first to avoid duplicates. Not idempotent: each call inserts a new company record.',
|
|
15
|
-
idempotent: false,
|
|
16
|
-
},
|
|
17
|
-
displayName: 'Create Company',
|
|
18
|
-
name: 'create_mautic_company',
|
|
19
|
-
props: {
|
|
20
|
-
fields: common_1.mauticCommon.companyFields,
|
|
21
|
-
},
|
|
22
|
-
run: function (context) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const { base_url, username, password } = context.auth.props;
|
|
25
|
-
const request = {
|
|
26
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
-
url: (base_url.endsWith('/') ? base_url : base_url + '/') +
|
|
28
|
-
'api/companies/new',
|
|
29
|
-
body: JSON.stringify(context.propsValue.fields),
|
|
30
|
-
headers: {
|
|
31
|
-
Authorization: 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=create-company.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-company.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-company.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,sCAAyC;AACzC,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,qCAAqC,EAAE,gEAAgE;IACpH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sTAAsT;QACxT,UAAU,EAAE,KAAK;KAClB;IACD,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL,MAAM,EAAE,qBAAY,CAAC,aAAa;KACnC;IACD,GAAG,EAAE,UAAgB,OAAO;;YAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5D,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EACD,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC;oBACpD,mBAAmB;gBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC/C,OAAO,EAAE;oBACP,aAAa,EACX,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBACtE,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare const createContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>, {
|
|
6
|
-
fields: {
|
|
7
|
-
displayName: string;
|
|
8
|
-
description?: string | undefined;
|
|
9
|
-
auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
-
base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
-
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
|
-
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
13
|
-
}>;
|
|
14
|
-
props: (propsValue: Record<string, unknown> & {
|
|
15
|
-
auth?: import("@activepieces/shared").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
|
|
16
|
-
base_url: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
17
|
-
username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
-
password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
19
|
-
}>> | undefined;
|
|
20
|
-
}, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").InputPropertyMap>;
|
|
21
|
-
refreshers: string[];
|
|
22
|
-
valueSchema: import("@activepieces/pieces-framework").DynamicPropsValue;
|
|
23
|
-
type: import("@activepieces/pieces-framework").PropertyType.DYNAMIC;
|
|
24
|
-
required: true;
|
|
25
|
-
defaultValue?: unknown;
|
|
26
|
-
};
|
|
27
|
-
}>;
|
|
28
|
-
//# sourceMappingURL=create-contact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BxB,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createContact = 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 common_1 = require("../common");
|
|
8
|
-
const auth_1 = require("../auth");
|
|
9
|
-
exports.createContact = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.mauticAuth,
|
|
11
|
-
description: 'Creates a new contact in Mautic CRM', // Must be a unique across the piece, this shouldn't be changed.
|
|
12
|
-
audience: 'both',
|
|
13
|
-
aiMetadata: {
|
|
14
|
-
description: 'Create a new contact (lead) in Mautic from the provided field values (name, email, phone, custom fields, etc.). Use when adding a person to Mautic; to modify an existing contact use Update Contact instead, and to avoid duplicates check first with Search Contact. Not idempotent: each call inserts a new contact, so repeating it produces duplicates.',
|
|
15
|
-
idempotent: false,
|
|
16
|
-
},
|
|
17
|
-
displayName: 'Create Contact',
|
|
18
|
-
name: 'create_mautic_contact',
|
|
19
|
-
props: {
|
|
20
|
-
fields: common_1.mauticCommon.contactFields,
|
|
21
|
-
},
|
|
22
|
-
run: function (context) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const { base_url, username, password } = context.auth.props;
|
|
25
|
-
const request = {
|
|
26
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
27
|
-
url: (base_url.endsWith('/') ? base_url : base_url + '/') +
|
|
28
|
-
'api/contacts/new',
|
|
29
|
-
body: JSON.stringify(context.propsValue.fields),
|
|
30
|
-
headers: {
|
|
31
|
-
Authorization: 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'),
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=create-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAIqC;AACrC,sCAAyC;AACzC,kCAAqC;AAExB,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,qCAAqC,EAAE,gEAAgE;IACpH,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,8VAA8V;QAChW,UAAU,EAAE,KAAK;KAClB;IACD,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE;QACL,MAAM,EAAE,qBAAY,CAAC,aAAa;KACnC;IACD,GAAG,EAAE,UAAgB,OAAO;;YAC1B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC5D,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EACD,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,GAAG,GAAG,CAAC;oBACpD,kBAAkB;gBACpB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC/C,OAAO,EAAE;oBACP,aAAa,EACX,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBACtE,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { createContact } from './create-contact';
|
|
2
|
-
export { searchContact } from './search-contact';
|
|
3
|
-
export { updateContact } from './update-contact';
|
|
4
|
-
export { createCompany } from './create-company';
|
|
5
|
-
export { searchCompany } from './search-company';
|
|
6
|
-
export { updateCompany } from './update-company';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|