@activepieces/piece-elastic-email 0.2.2 → 0.2.4
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 -13
- package/src/index.js +20 -51
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-contact.d.ts +0 -12
- package/src/lib/actions/add-contact.d.ts.map +0 -1
- package/src/lib/actions/add-contact.js +0 -100
- package/src/lib/actions/add-contact.js.map +0 -1
- package/src/lib/actions/create-campaign.d.ts +0 -11
- package/src/lib/actions/create-campaign.d.ts.map +0 -1
- package/src/lib/actions/create-campaign.js +0 -84
- package/src/lib/actions/create-campaign.js.map +0 -1
- package/src/lib/actions/create-contact.d.ts +0 -8
- package/src/lib/actions/create-contact.d.ts.map +0 -1
- package/src/lib/actions/create-contact.js +0 -68
- package/src/lib/actions/create-contact.js.map +0 -1
- package/src/lib/actions/create-segment.d.ts +0 -5
- package/src/lib/actions/create-segment.d.ts.map +0 -1
- package/src/lib/actions/create-segment.js +0 -44
- package/src/lib/actions/create-segment.js.map +0 -1
- package/src/lib/actions/list-campaigns.d.ts +0 -6
- package/src/lib/actions/list-campaigns.d.ts.map +0 -1
- package/src/lib/actions/list-campaigns.js +0 -60
- package/src/lib/actions/list-campaigns.js.map +0 -1
- package/src/lib/actions/list-contacts.d.ts +0 -5
- package/src/lib/actions/list-contacts.d.ts.map +0 -1
- package/src/lib/actions/list-contacts.js +0 -52
- package/src/lib/actions/list-contacts.js.map +0 -1
- package/src/lib/actions/send-email.d.ts +0 -17
- package/src/lib/actions/send-email.d.ts.map +0 -1
- package/src/lib/actions/send-email.js +0 -133
- package/src/lib/actions/send-email.js.map +0 -1
- package/src/lib/actions/unsubscribe-contact.d.ts +0 -4
- package/src/lib/actions/unsubscribe-contact.d.ts.map +0 -1
- package/src/lib/actions/unsubscribe-contact.js +0 -39
- package/src/lib/actions/unsubscribe-contact.js.map +0 -1
- package/src/lib/actions/update-campaign.d.ts +0 -12
- package/src/lib/actions/update-campaign.d.ts.map +0 -1
- package/src/lib/actions/update-campaign.js +0 -94
- package/src/lib/actions/update-campaign.js.map +0 -1
- package/src/lib/actions/update-contact.d.ts +0 -7
- package/src/lib/actions/update-contact.d.ts.map +0 -1
- package/src/lib/actions/update-contact.js +0 -52
- package/src/lib/actions/update-contact.js.map +0 -1
- package/src/lib/auth.d.ts +0 -2
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -59
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -9
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -19
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/constants.d.ts +0 -8
- package/src/lib/common/constants.d.ts.map +0 -1
- package/src/lib/common/constants.js +0 -47
- package/src/lib/common/constants.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -6
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -165
- package/src/lib/common/props.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-elastic-email",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
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
|
-
"zod": "4.3.6",
|
|
15
|
-
"tslib": "2.6.2"
|
|
16
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
17
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,51 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const add_contact_1 = require("./lib/actions/add-contact");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
displayName: 'Elastic Email',
|
|
22
|
-
description: 'Email delivery and marketing platform for sending emails, managing contacts, campaigns, and segments.',
|
|
23
|
-
auth: auth_1.elasticEmailAuth,
|
|
24
|
-
minimumSupportedRelease: '0.36.1',
|
|
25
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/elastic-email.png',
|
|
26
|
-
authors: ['Harmatta'],
|
|
27
|
-
categories: [shared_1.PieceCategory.MARKETING],
|
|
28
|
-
actions: [
|
|
29
|
-
add_contact_1.addContactAction,
|
|
30
|
-
create_campaign_1.createCampaignAction,
|
|
31
|
-
create_contact_1.createContactAction,
|
|
32
|
-
create_segment_1.createSegmentAction,
|
|
33
|
-
list_campaigns_1.listCampaignsAction,
|
|
34
|
-
list_contacts_1.listContactsAction,
|
|
35
|
-
send_email_1.sendEmailAction,
|
|
36
|
-
unsubscribe_contact_1.unsubscribeContactAction,
|
|
37
|
-
update_campaign_1.updateCampaignAction,
|
|
38
|
-
update_contact_1.updateContactAction,
|
|
39
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
40
|
-
baseUrl: () => constants_1.ELASTIC_EMAIL_API_BASE,
|
|
41
|
-
auth: auth_1.elasticEmailAuth,
|
|
42
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
-
return ({
|
|
44
|
-
'X-ElasticEmail-ApiKey': auth.secret_text,
|
|
45
|
-
});
|
|
46
|
-
}),
|
|
47
|
-
}),
|
|
48
|
-
],
|
|
49
|
-
triggers: [],
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var mu=Object.create;var et=Object.defineProperty;var fu=Object.getOwnPropertyDescriptor;var gu=Object.getOwnPropertyNames;var yu=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var I=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gu(t))!hu.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=fu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?mu(yu(e)):{},_n(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),vu=e=>_n(et({},"__esModule",{value:!0}),e);var Ho=I((Vo,qt)=>{(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 y(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],b,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>d)return null;for(L=d-f,b=":";L--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let re=s.split(":"),ae=[];for(let Qe=0;Qe<re.length;Qe++)ae.push(parseInt(re[Qe],16));return ae})(),{parts:d,zoneId:v}}o(y,"expandIPv6");function h(s,d,f,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=f-m,b<0&&(b=0),s[v]>>b!==d[v]>>b)return!1;m-=f,v+=1}return!0}o(h,"matchCIDR");function _(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(_,"parseIntAuto");function $(s,d){for(;s.length<d;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<d.length;f++)if(m=d[f],!(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,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,L;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(L=m[b],f&&L!==0)return null;L!==8&&(f=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,f,m,v,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.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)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(d[2]);if(f>=0&&f<=32){let m=[this.parse(d[1]),f];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")},x.IPv4.parser=function(s){let d,f,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),b=[];for(let L=0;L<v.length;L++)f=v[L],b.push(_(f));return b})();if(d=s.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),b=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(_(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),b=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(_(v[0])),b.push(_(v[1])),b.push(m>>8&255),b.push(m&255),b})():null},x.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],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,f){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");f&&(this.zoneId=f)}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,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!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,b;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(b=m[v],f&&b!==0)return null;b!==16&&(f=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,f=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],f.push(d>>8),f.push(d&255);return f},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}).call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},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),f=d[0],m=d[1];return new x.IPv4([f>>8,f&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(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,b;for(;b=d.exec(f);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(f[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.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}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,f,m,v,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(b[f],10)),f++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.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)},x.IPv6.parseCIDR=function(s){let d,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(f[2]),d>=0&&d<=128))return m=[this.parse(f[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")},x.IPv6.parser=function(s){let d,f,m,v,b,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return y(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=y(d+L,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<b.length;f++)if(v=b[f],!(0<=v&&v<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.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],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,f){let m,v,b,L;f==null&&(f="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(b=d[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(L=b[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return f},typeof qt<"u"&&qt.exports?qt.exports=x:e.ipaddr=x})(Vo)});var qi=I((zA,Hi)=>{var Vi=require("stream").Stream,ep=require("util");Hi.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");ep.inherits(ce,Vi);ce.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(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Vi.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.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)};ce.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 Ji=I((kA,Ki)=>{var tp=require("util"),Wi=require("stream").Stream,Gi=qi();Ki.exports=J;function J(){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(J,"CombinedStream");tp.inherits(J,Wi);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof Gi)){var r=Gi.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};J.prototype.pipe=function(e,t){return Wi.prototype.pipe.call(this,e,t),this.resume(),e};J.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}};J.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=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.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()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.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")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.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)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Yi=I((wA,Xi)=>{"use strict";Xi.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 ta=I(te=>{"use strict";var Yt=Yi(),rp=require("path").extname,Qi=/^\s*([^;\s]*)(?:;|\s|$)/,np=/^text\//i;te.charset=ea;te.charsets={lookup:ea};te.contentType=op;te.extension=ip;te.extensions=Object.create(null);te.lookup=ap;te.types=Object.create(null);sp(te.extensions,te.types);function ea(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&np.test(t[1])?"UTF-8":!1}o(ea,"charset");function op(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(op,"contentType");function ip(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ip,"extension");function ap(e){if(!e||typeof e!="string")return!1;var t=rp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(ap,"lookup");function sp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var u=Yt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var y=c[p];if(t[y]){var h=r.indexOf(Yt[t[y]].source),_=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(h>_||h===_&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(sp,"populateMaps")});var na=I((CA,ra)=>{ra.exports=up;function up(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(up,"defer")});var Jr=I((MA,ia)=>{var oa=na();ia.exports=cp;function cp(e){var t=!1;return oa(function(){t=!0}),o(function(n,i){t?e(n,i):oa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(cp,"async")});var Xr=I((jA,aa)=>{aa.exports=lp;function lp(e){Object.keys(e.jobs).forEach(pp.bind(e)),e.jobs={}}o(lp,"abort");function pp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(pp,"clean")});var Yr=I((BA,ua)=>{var sa=Jr(),dp=Xr();ua.exports=mp;function mp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=fp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?dp(r):r.results[i]=c,n(u,r.results))})}o(mp,"iterate");function fp(e,t,r,n){var i;return e.length==2?i=e(r,sa(n)):i=e(r,t,sa(n)),i}o(fp,"runJob")});var Qr=I((VA,ca)=>{ca.exports=gp;function gp(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(gp,"state")});var en=I((qA,la)=>{var yp=Xr(),hp=Jr();la.exports=vp;function vp(e){Object.keys(this.jobs).length&&(this.index=this.size,yp(this),hp(e)(null,this.results))}o(vp,"terminator")});var da=I((WA,pa)=>{var xp=Yr(),Pp=Qr(),_p=en();pa.exports=bp;function bp(e,t,r){for(var n=Pp(e);n.index<(n.keyedList||e).length;)xp(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 _p.bind(n,r)}o(bp,"parallel")});var tn=I((JA,Qt)=>{var ma=Yr(),Ep=Qr(),Tp=en();Qt.exports=Ip;Qt.exports.ascending=fa;Qt.exports.descending=Sp;function Ip(e,t,r,n){var i=Ep(e,r);return ma(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ma(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Tp.bind(i,n)}o(Ip,"serialOrdered");function fa(e,t){return e<t?-1:e>t?1:0}o(fa,"ascending");function Sp(e,t){return-1*fa(e,t)}o(Sp,"descending")});var ya=I((YA,ga)=>{var $p=tn();ga.exports=Ap;function Ap(e,t,r){return $p(e,t,null,r)}o(Ap,"serial")});var va=I((ez,ha)=>{ha.exports={parallel:da(),serial:ya(),serialOrdered:tn()}});var rn=I((tz,xa)=>{"use strict";xa.exports=Object});var _a=I((rz,Pa)=>{"use strict";Pa.exports=Error});var Ea=I((nz,ba)=>{"use strict";ba.exports=EvalError});var Ia=I((oz,Ta)=>{"use strict";Ta.exports=RangeError});var $a=I((iz,Sa)=>{"use strict";Sa.exports=ReferenceError});var za=I((az,Aa)=>{"use strict";Aa.exports=SyntaxError});var er=I((sz,Oa)=>{"use strict";Oa.exports=TypeError});var Na=I((uz,ka)=>{"use strict";ka.exports=URIError});var Ra=I((cz,wa)=>{"use strict";wa.exports=Math.abs});var Ca=I((lz,Da)=>{"use strict";Da.exports=Math.floor});var Ma=I((pz,Ua)=>{"use strict";Ua.exports=Math.max});var ja=I((dz,La)=>{"use strict";La.exports=Math.min});var Ba=I((mz,Fa)=>{"use strict";Fa.exports=Math.pow});var Va=I((fz,Za)=>{"use strict";Za.exports=Math.round});var qa=I((gz,Ha)=>{"use strict";Ha.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Wa=I((hz,Ga)=>{"use strict";var zp=qa();Ga.exports=o(function(t){return zp(t)||t===0?t:t<0?-1:1},"sign")});var Ja=I((xz,Ka)=>{"use strict";Ka.exports=Object.getOwnPropertyDescriptor});var nn=I((Pz,Xa)=>{"use strict";var tr=Ja();if(tr)try{tr([],"length")}catch{tr=null}Xa.exports=tr});var Qa=I((_z,Ya)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Ya.exports=rr});var on=I((bz,es)=>{"use strict";es.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 ns=I((Tz,rs)=>{"use strict";var ts=typeof Symbol<"u"&&Symbol,Op=on();rs.exports=o(function(){return typeof ts!="function"||typeof Symbol!="function"||typeof ts("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Op()},"hasNativeSymbols")});var an=I((Sz,os)=>{"use strict";os.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var sn=I(($z,is)=>{"use strict";var kp=rn();is.exports=kp.getPrototypeOf||null});var us=I((Az,ss)=>{"use strict";var Np="Function.prototype.bind called on incompatible ",wp=Object.prototype.toString,Rp=Math.max,Dp="[object Function]",as=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"),Cp=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"),Up=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");ss.exports=o(function(t){var r=this;if(typeof r!="function"||wp.apply(r)!==Dp)throw new TypeError(Np+r);for(var n=Cp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,as(n,arguments));return Object(_)===_?_:this}return r.apply(t,as(n,arguments))},"binder"),c=Rp(0,r.length-n.length),p=[],y=0;y<c;y++)p[y]="$"+y;if(i=Function("binder","return function ("+Up(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var He=I((Oz,cs)=>{"use strict";var Mp=us();cs.exports=Function.prototype.bind||Mp});var nr=I((kz,ls)=>{"use strict";ls.exports=Function.prototype.call});var un=I((Nz,ps)=>{"use strict";ps.exports=Function.prototype.apply});var ms=I((wz,ds)=>{"use strict";ds.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var gs=I((Rz,fs)=>{"use strict";var Lp=He(),jp=un(),Fp=nr(),Bp=ms();fs.exports=Bp||Lp.call(Fp,jp)});var hs=I((Dz,ys)=>{"use strict";var Zp=He(),Vp=er(),Hp=nr(),qp=gs();ys.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Vp("a function is required");return qp(Zp,Hp,t)},"callBindBasic")});var Es=I((Uz,bs)=>{"use strict";var Gp=hs(),vs=nn(),Ps;try{Ps=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var cn=!!Ps&&vs&&vs(Object.prototype,"__proto__"),_s=Object,xs=_s.getPrototypeOf;bs.exports=cn&&typeof cn.get=="function"?Gp([cn.get]):typeof xs=="function"?o(function(t){return xs(t==null?t:_s(t))},"getDunder"):!1});var As=I((Lz,$s)=>{"use strict";var Ts=an(),Is=sn(),Ss=Es();$s.exports=Ts?o(function(t){return Ts(t)},"getProto"):Is?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Is(t)},"getProto"):Ss?o(function(t){return Ss(t)},"getProto"):null});var ln=I((Fz,zs)=>{"use strict";var Wp=Function.prototype.call,Kp=Object.prototype.hasOwnProperty,Jp=He();zs.exports=Jp.call(Wp,Kp)});var Cs=I((Bz,Ds)=>{"use strict";var M,Xp=rn(),Yp=_a(),Qp=Ea(),ed=Ia(),td=$a(),Ke=za(),We=er(),rd=Na(),nd=Ra(),od=Ca(),id=Ma(),ad=ja(),sd=Ba(),ud=Va(),cd=Wa(),ws=Function,pn=o(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=nn(),ld=Qa(),dn=o(function(){throw new We},"throwTypeError"),pd=bt?(function(){try{return arguments.callee,dn}catch{try{return bt(arguments,"callee").get}catch{return dn}}})():dn,qe=ns()(),Q=As(),dd=sn(),md=an(),Rs=un(),Et=nr(),Ge={},fd=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Yp,"%eval%":eval,"%EvalError%":Qp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":ws,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xp,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":ed,"%ReferenceError%":td,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":qe?Symbol:M,"%SyntaxError%":Ke,"%ThrowTypeError%":pd,"%TypedArray%":fd,"%TypeError%":We,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":rd,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Et,"%Function.prototype.apply%":Rs,"%Object.defineProperty%":ld,"%Object.getPrototypeOf%":dd,"%Math.abs%":nd,"%Math.floor%":od,"%Math.max%":id,"%Math.min%":ad,"%Math.pow%":sd,"%Math.round%":ud,"%Math.sign%":cd,"%Reflect.getPrototypeOf%":md};if(Q)try{null.error}catch(e){Os=Q(Q(e)),De["%Error.prototype%"]=Os}var Os,gd=o(function e(t){var r;if(t==="%AsyncFunction%")r=pn("async function () {}");else if(t==="%GeneratorFunction%")r=pn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=pn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return De[t]=r,r},"doEval"),ks={__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"]},Tt=He(),or=ln(),yd=Tt.call(Et,Array.prototype.concat),hd=Tt.call(Rs,Array.prototype.splice),Ns=Tt.call(Et,String.prototype.replace),ir=Tt.call(Et,String.prototype.slice),vd=Tt.call(Et,RegExp.prototype.exec),xd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pd=/\\(\\)?/g,_d=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return Ns(t,xd,function(u,c,p,y){i[i.length]=p?Ns(y,Pd,"$1"):c||u}),i},"stringToPath"),bd=o(function(t,r){var n=t,i;if(or(ks,n)&&(i=ks[n],n="%"+i[0]+"%"),or(De,n)){var u=De[n];if(u===Ge&&(u=gd(n)),typeof u>"u"&&!r)throw new We("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ds.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new We("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new We('"allowMissing" argument must be a boolean');if(vd(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_d(t),i=n.length>0?n[0]:"",u=bd("%"+i+"%",r),c=u.name,p=u.value,y=!1,h=u.alias;h&&(i=h[0],hd(n,yd([0,1],h)));for(var _=1,$=!0;_<n.length;_+=1){var x=n[_],s=ir(x,0,1),d=ir(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(y=!0),i+="."+x,c="%"+i+"%",or(De,c))p=De[c];else if(p!=null){if(!(x in p)){if(!r)throw new We("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&_+1>=n.length){var f=bt(p,x);$=!!f,$&&"get"in f&&!("originalValue"in f.get)?p=f.get:p=p[x]}else $=or(p,x),p=p[x];$&&!y&&(De[c]=p)}}return p},"GetIntrinsic")});var Ms=I((Vz,Us)=>{"use strict";var Ed=on();Us.exports=o(function(){return Ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Fs=I((qz,js)=>{"use strict";var Td=Cs(),Ls=Td("%Object.defineProperty%",!0),Id=Ms()(),Sd=ln(),$d=er(),ar=Id?Symbol.toStringTag:null;js.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new $d("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!Sd(t,ar))&&(Ls?Ls(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Zs=I((Wz,Bs)=>{"use strict";var Ad=Function.prototype.call,zd=Object.prototype.hasOwnProperty,Od=He();Bs.exports=Od.call(Ad,zd)});var Hs=I((Kz,Vs)=>{"use strict";Vs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ws=I((Jz,Gs)=>{"use strict";var yn=Ji(),kd=require("util"),mn=require("path"),Nd=require("http"),wd=require("https"),Rd=require("url").parse,Dd=require("fs"),Cd=require("stream").Stream,Ud=require("crypto"),fn=ta(),Md=va(),Ld=Fs(),Oe=Zs(),gn=Hs();function qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(qs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],yn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");kd.inherits(j,yn);j.LINE_BREAK=`\r
|
|
2
|
+
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=yn.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)};j.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)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Oe(t,"httpVersion"))&&!(t instanceof Cd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Oe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Dd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Oe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Oe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&gn(c,r.header);var p;for(var y in c)if(Oe(c,y)){if(p=c[y],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=y+": "+p.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=mn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=mn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Oe(e,"httpVersion")&&(r=mn.basename(e.client._httpMessage.path||"")),r)return'filename="'+qs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=fn.lookup(e.name)),!r&&e&&e.path&&(r=fn.lookup(e.path)),!r&&e&&e.readable&&Oe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=fn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Oe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.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(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ud.randomBytes(12).toString("hex")};j.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};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.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}Md.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Rd(e),n=gn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=gn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=wd.request(n):r=Nd.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,y=o(function(h,_){return r.removeListener("error",y),r.removeListener("response",p),t.call(this,h,_)},"callback");p=y.bind(this,null),r.on("error",y),r.on("response",p)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Ld(j.prototype,"FormData");Gs.exports=j});var Wd={};Pn(Wd,{elasticEmail:()=>Gd});module.exports=vu(Wd);var xu=Object.freeze({status:"aborted"});function E(e,t,r){function n(p,y){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:y,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,y);let h=c.prototype,_=Object.keys(h);for(let $=0;$<_.length;$++){let x=_[$];x in p||(p[x]=h[x].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 y;let h=r?.Parent?new u:this;n(h,p),(y=h._zod).deferred??(y.deferred=[]);for(let _ of h._zod.deferred)_();return h}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(E,"$constructor");var le=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},pr={};function fe(e){return e&&Object.assign(pr,e),pr}o(fe,"config");function mr(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(mr,"getEnumValues");function En(e,t){return typeof t=="bigint"?t.toString():t}o(En,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(At,"cached");function Tn(e){return e==null}o(Tn,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var bn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bn)return n===void 0&&(n=bn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var fr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Pu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(In,"isPlainObject");var Sn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function H(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(H,"normalizeParams");function $n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o($n,"optionalKeys");var An={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 Me(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(Me,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ee,"finalizeIssue");function zn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(zn,"getLengthableOrigin");function gr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(gr,"issue");var On=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,En,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),kn=E("$ZodError",On),rt=E("$ZodError",On,{Parent:Error});var bu=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(y=>Ee(y,u,fe())));throw fr(p,i?.callee),p}return c.value},"_parse"),kt=bu(rt),Eu=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(y=>Ee(y,u,fe())));throw fr(p,i?.callee),p}return c.value},"_parseAsync"),Nt=Eu(rt),Tu=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??kn)(u.issues.map(c=>Ee(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),nt=Tu(rt),Iu=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=>Ee(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ot=Iu(rt);var Su="(?:(?:\\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])))",$u=new RegExp(`^${Su}$`);var Nn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),wn=/^-?\d+n?$/,Rn=/^-?\d+$/,yr=/^-?\d+(?:\.\d+)?$/,Dn=/^(?:true|false)$/i;var Te=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Au={number:"number",bigint:"bigint",object:"date"};var Cn=E("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=Au[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 Un=E("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=An[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=Rn)}),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 Mn=E("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Tn(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=zn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var hr=E("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.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=()=>{})}),Ln=E("$ZodCheckRegex",(e,t)=>{hr.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 Fn={major:4,minor:3,patch:6};var G=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fn;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,y)=>{let h=Me(c),_;for(let $ of p){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=$._zod.check(c);if(s instanceof Promise&&y?.async===!1)throw new le;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Me(c,x)))});else{if(c.issues.length===x)continue;h||(h=Me(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,p,y)=>{if(Me(c))return c.aborted=!0,c;let h=i(p,n,y);if(h instanceof Promise){if(y.async===!1)throw new le;return h.then(_=>e._zod.parse(_,y))}return e._zod.parse(h,y)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(_=>u(_,c,p)):u(h,c,p)}let y=e._zod.parse(c,p);if(y instanceof Promise){if(p.async===!1)throw new le;return y.then(h=>i(h,n,p))}return i(y,n,p)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=nt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ot(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dt=E("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Nn(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}}),vr=E("$ZodStringFormat",(e,t)=>{hr.init(e,t),Dt.init(e,t)});var qn=E("$ZodURL",(e,t)=>{vr.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 xr=E("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??yr,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}}),Gn=E("$ZodNumberFormat",(e,t)=>{Un.init(e,t),xr.init(e,t)}),Pr=E("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=Dn,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}}),Wn=E("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=wn,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 Kn=E("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Jn=E("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var Xn=E("$ZodVoid",(e,t)=>{G.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}}),Yn=E("$ZodDate",(e,t)=>{G.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 Bn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Bn,"handleArrayResult");var Qn=E("$ZodArray",(e,t)=>{G.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],y=t.element._zod.run({value:p,issues:[]},n);y instanceof Promise?u.push(y.then(h=>Bn(h,r,c))):Bn(y,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Rt,"handlePropertyResult");function zu(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=$n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(zu,"normalizeDef");function Ou(e,t,r,n,i,u){let c=[],p=i.keySet,y=i.catchall._zod,h=y.def.type,_=y.optout==="optional";for(let $ in t){if(p.has($))continue;if(h==="never"){c.push($);continue}let x=y.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Rt(s,r,$,t,_))):Rt(x,r,$,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Ou,"handleCatchall");var eo=E("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...p};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=At(()=>zu(t));X(e._zod,"propValues",()=>{let p=t.shape,y={};for(let h in p){let _=p[h]._zod;if(_.values){y[h]??(y[h]=new Set);for(let $ of _.values)y[h].add($)}}return y});let i=tt,u=t.catchall,c;e._zod.parse=(p,y)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let _=[],$=c.shape;for(let x of c.keys){let s=$[x],d=s._zod.optout==="optional",f=s._zod.run({value:h[x],issues:[]},y);f instanceof Promise?_.push(f.then(m=>Rt(m,p,x,h,d))):Rt(f,p,x,h,d)}return u?Ou(_,h,p,y,n.value,e):_.length?Promise.all(_).then(()=>p):p}});function Zn(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=>!Me(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=>Ee(c,n,fe())))}),t)}o(Zn,"handleUnionResults");var _r=E("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(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=>zt(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 y of t.options){let h=y._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(y=>Zn(y,i,e,u)):Zn(p,i,e,u)}});var to=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_r.init(e,t);let r=e._zod.parse;X(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,y]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of y)i[p].add(h)}}return i});let n=At(()=>{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 y of p){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!tt(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 ro=E("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!In(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 h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?u.push(_.then($=>{$.issues.length&&r.issues.push(...be(h,$.issues)),r.value[h]=$.value})):(_.issues.length&&r.issues.push(...be(h,_.issues)),r.value[h]=_.value)}let y;for(let h in i)p.has(h)||(y=y??[],y.push(h));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let y=t.keyType._zod.run({value:p,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&yr.test(p)&&y.issues.length){let $=t.keyType._zod.run({value:Number(p),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(y=$)}if(y.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map($=>Ee($,n,fe())),input:p,path:[p],inst:e});continue}let _=t.valueType._zod.run({value:i[p],issues:[]},n);_ instanceof Promise?u.push(_.then($=>{$.issues.length&&r.issues.push(...be(p,$.issues)),r.value[y.value]=$.value})):(_.issues.length&&r.issues.push(...be(p,_.issues)),r.value[y.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var no=E("$ZodEnum",(e,t)=>{G.init(e,t);let r=mr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Sn.has(typeof i)).map(i=>typeof i=="string"?Ue(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}}),oo=E("$ZodLiteral",(e,t)=>{if(G.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"?Ue(n):n?Ue(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 io=E("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(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 Vn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Vn,"handleOptionalResult");var ao=E("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(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=>Vn(u,r.value)):Vn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var so=E("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),X(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 uo=E("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(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=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var co=E("$ZodCustom",(e,t)=>{Te.init(e,t),G.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=>Hn(u,r,n,e));Hn(i,r,n,e)}});function Hn(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(gr(i))}}o(Hn,"handleRefineResult");var po;var br=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 mo(){return new br}o(mo,"registry");(po=globalThis).__zod_globalRegistry??(po.__zod_globalRegistry=mo());var Er=globalThis.__zod_globalRegistry;function fo(e,t){return new e({type:"string",...H(t)})}o(fo,"_string");function go(e,t){return new e({type:"string",coerce:!0,...H(t)})}o(go,"_coercedString");function yo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}o(yo,"_url");function ho(e,t){return new e({type:"number",checks:[],...H(t)})}o(ho,"_number");function vo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}o(vo,"_coercedNumber");function xo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}o(xo,"_int");function Po(e,t){return new e({type:"boolean",...H(t)})}o(Po,"_boolean");function _o(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}o(_o,"_coercedBoolean");function bo(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}o(bo,"_coercedBigint");function Eo(e){return new e({type:"any"})}o(Eo,"_any");function To(e){return new e({type:"unknown"})}o(To,"_unknown");function Io(e,t){return new e({type:"void",...H(t)})}o(Io,"_void");function So(e,t){return new e({type:"date",coerce:!0,...H(t)})}o(So,"_coercedDate");function Ct(e,t){return new Cn({check:"greater_than",...H(t),value:e,inclusive:!0})}o(Ct,"_gte");function se(e,t){return new Mn({check:"min_length",...H(t),minimum:e})}o(se,"_minLength");function Ie(e,t){return new Ln({check:"string_format",format:"regex",...H(t),pattern:e})}o(Ie,"_regex");function $o(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o($o,"_custom");var Y=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>Nt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=E("ZodMiniString",(e,t)=>{Dt.init(e,t),Y.init(e,t)});function a(e){return fo(Mt,e)}o(a,"string");var Ao=E("ZodMiniStringFormat",(e,t)=>{vr.init(e,t),Mt.init(e,t)});var Zu=E("ZodMiniURL",(e,t)=>{qn.init(e,t),Ao.init(e,t)});function zo(e){return yo(Zu,e)}o(zo,"url");var Lt=E("ZodMiniNumber",(e,t)=>{xr.init(e,t),Y.init(e,t)});function ee(e){return ho(Lt,e)}o(ee,"number");var Vu=E("ZodMiniNumberFormat",(e,t)=>{Gn.init(e,t),Lt.init(e,t)});function Oo(e){return xo(Vu,e)}o(Oo,"int");var Tr=E("ZodMiniBoolean",(e,t)=>{Pr.init(e,t),Y.init(e,t)});function B(e){return Po(Tr,e)}o(B,"boolean");var ko=E("ZodMiniBigInt",(e,t)=>{Wn.init(e,t),Y.init(e,t)});var Hu=E("ZodMiniAny",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function at(){return Eo(Hu)}o(at,"any");var qu=E("ZodMiniUnknown",(e,t)=>{Jn.init(e,t),Y.init(e,t)});function k(){return To(qu)}o(k,"unknown");var Gu=E("ZodMiniVoid",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function No(e){return Io(Gu,e)}o(No,"_void");var wo=E("ZodMiniDate",(e,t)=>{Yn.init(e,t),Y.init(e,t)});var Wu=E("ZodMiniArray",(e,t)=>{Qn.init(e,t),Y.init(e,t)});function R(e,t){return new Wu({type:"array",element:e,...H(t)})}o(R,"array");var Ku=E("ZodMiniObject",(e,t)=>{eo.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...H(t)};return new Ku(r)}o(l,"object");var Ju=E("ZodMiniUnion",(e,t)=>{_r.init(e,t),Y.init(e,t)});function D(e,t){return new Ju({type:"union",options:e,...H(t)})}o(D,"union");var Xu=E("ZodMiniDiscriminatedUnion",(e,t)=>{to.init(e,t),Y.init(e,t)});function Se(e,t,r){return new Xu({type:"union",options:t,discriminator:e,...H(r)})}o(Se,"discriminatedUnion");var Yu=E("ZodMiniRecord",(e,t)=>{ro.init(e,t),Y.init(e,t)});function N(e,t,r){return new Yu({type:"record",keyType:e,valueType:t,...H(r)})}o(N,"record");var Qu=E("ZodMiniEnum",(e,t)=>{no.init(e,t),Y.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Qu({type:"enum",entries:r,...H(t)})}o(U,"_enum");var ec=E("ZodMiniLiteral",(e,t)=>{oo.init(e,t),Y.init(e,t)});function S(e,t){return new ec({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}o(S,"literal");var tc=E("ZodMiniTransform",(e,t)=>{io.init(e,t),Y.init(e,t)});function $e(e){return new tc({type:"transform",transform:e})}o($e,"transform");var rc=E("ZodMiniOptional",(e,t)=>{ao.init(e,t),Y.init(e,t)});function g(e){return new rc({type:"optional",innerType:e})}o(g,"optional");var nc=E("ZodMiniNullable",(e,t)=>{so.init(e,t),Y.init(e,t)});function st(e){return new nc({type:"nullable",innerType:e})}o(st,"nullable");var oc=E("ZodMiniPipe",(e,t)=>{uo.init(e,t),Y.init(e,t)});function Ae(e,t){return new oc({type:"pipe",in:e,out:t})}o(Ae,"pipe");var ic=E("ZodMiniCustom",(e,t)=>{co.init(e,t),Y.init(e,t)});function jt(e,t){return $o(ic,e??(()=>!0),t)}o(jt,"custom");var ut={};Pn(ut,{bigint:()=>pc,boolean:()=>lc,date:()=>dc,number:()=>cc,string:()=>uc});function uc(e){return go(Mt,e)}o(uc,"string");function cc(e){return vo(Lt,e)}o(cc,"number");function lc(e){return _o(Tr,e)}o(lc,"boolean");function pc(e){return bo(ko,e)}o(pc,"bigint");function dc(e){return So(wo,e)}o(dc,"date");var Sr=l({retryOnFailure:l({defaultValue:g(B()),hide:g(B())}),continueOnFailure:l({defaultValue:g(B()),hide:g(B())})}),Ir=class{constructor(t,r,n,i,u,c,p,y,h,_,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=y;this.outputSchema=h;this.audience=_;this.aiMetadata=$}static{o(this,"IAction")}},W=o(e=>new Ir(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:g(a())}),C=o((e,t)=>l({type:S(t),required:B(),defaultValue:g(at())}),"TPropertyValue");var ne=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Do=l({label:a(),value:k()}),Ft=l({disabled:g(B()),placeholder:g(a()),options:R(Do)});var oe=l({...F.shape,options:Ft,...C(k(),"STATIC_DROPDOWN").shape}),ye=l({...F.shape,options:Ft,...C(R(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var $r=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:R(a())}),ct=l({...F.shape,...C(R(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var he=l({...F.shape,...C(B(),"CHECKBOX").shape});var ve=l({...F.shape,...C(ee(),"NUMBER").shape});var lt=l({...F.shape,streaming:g(B()),...C(k(),"FILE").shape});var pt=l({...F.shape,...C(a(),"DATE_TIME").shape});var Co=N(a(),D([ne,ge,oe,ct,ye,he,ve,lt,pt])),dt=l({...F.shape,properties:Co,...C(R(k()),"ARRAY").shape});var mt=l({...F.shape,...C(D([N(a(),k())]),"JSON").shape});var Uo=D([ne,oe,mt,dt,ye]),fc=N(a(),Uo),Ar=l({refreshers:R(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Bt=l({...F.shape,...C(No(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),je=(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))(je||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),zr="both_client_credentials_and_authorization_code";var ke=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ke||{}),yt=(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))(yt||{}),gc=l({strategy:U(yt),paramName:g(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Zt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Zt||{}),Mo=l({status:g(ee()),body:g(k()),headers:g(N(a(),a()))}),Lo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(U(Zt))}),jo=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:Mo,handlerId:g(a()),streamStepProgress:g(U(Zt))}),yc=D([Lo,jo]);var hc=l({body:k(),rawBody:g(k()),headers:N(a(),a()),queryParams:N(a(),a())});function ue(e){return e==null}o(ue,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Vt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Vt,"assertNotNullOrUndefined");var Or=Ce(require("crypto"),1);var vc=128,Ne,Fe,xc=o(e=>{!Ne||Ne.length<e?(Ne=Buffer.allocUnsafe(e*vc),Or.default.randomFillSync(Ne),Fe=0):Fe+e>Ne.length&&(Or.default.randomFillSync(Ne),Fe=0),Fe+=e},"fillPool"),Pc=o(e=>(xc(e|=0),Ne.subarray(Fe-e,Fe)),"random"),_c=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),y=i;for(;y--;)if(c+=e[p[y]&n]||"",c.length===u)return c}}},"customRandom"),Bo=o((e,t=21)=>_c(e,t,Pc),"customAlphabet");var bc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Zo=21,zb=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${Zo}}$`))),Ec=Bo(bc,Zo);var ze=Ae($e(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:ze,updated:ze},q=o(e=>g(st(e)),"Nullable");function kr(e){return g(st(U(e)))}o(kr,"NullableEnum");var Nb=Ae($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(B())),Ht=o(e=>Ae($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(R(e))),"OptionalArrayFromQuery");var Db=N(a(),k());var xt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(xt||{});var Gb=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var Kb=l({filename:a(),data:k(),type:S("file"),mimetype:g(a())});var Tc=Ce(Ho());var rE=l({...ie,name:a(),permissions:R(a()),platformId:q(a()),type:a(),userCount:g(ee())});var qo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(qo||{}),Nr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Nr||{}),wr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wr||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Dr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Dr||{});var Ic=l({mode:U(qo),value:k()}),Sc=l({auth:g(a()),fields:N(a(),Ic)}),$c=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(Sc)}),Ac=l({type:S("PIECE"),toolName:a().check(se(1)),pieceMetadata:$c}),zc=l({type:S("none")}),Oc=l({type:S("access_token"),accessToken:a()}),kc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Nc=l({type:S("headers"),headers:N(a(),a())}),wc=Se("type",[zc,Oc,kc,Nc]),Go=l({type:S("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:g(a())}),Wo=l({type:S("MCP"),toolName:a().check(se(1)),serverUrl:zo(),protocol:U(wr),auth:wc}),Ko=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(Nr),sourceId:a(),sourceName:a()}),Rc=Se("type",[Ac,Go,Wo,Ko]),Dc=l({displayName:a(),description:g(a()),type:U(Rr)}),Jo=l({type:S("MARKDOWN"),markdown:a()}),Be={type:S("TOOL_CALL"),input:q(N(a(),k())),output:g(k()),toolName:a(),status:U(Dr),toolCallId:a(),startTime:a(),endTime:g(a())},wE=l(Be),Xo=Se("toolCallType",[l({...Be,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:S("UNKNOWN"),displayName:a()})]),Cc=D([Jo,Xo]);var Cr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Cr||{}),xe=l({apiKey:a()}),Uc=xe,Mc=l({apiKey:a(),apiKeyHash:a()}),Lc=xe,jc=xe,Fc=xe,Bc=xe,Zc=xe,Vc=xe,Hc=xe,ri=l({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),qc=l({}),Gc=l({}),Wc=l({}),Kc=l({}),Jc=l({}),Xc=l({}),ni=l({modelId:a(),modelName:a(),modelType:U(Cr)}),oi=l({apiKeyHeader:a(),baseUrl:a(),models:R(ni),defaultHeaders:g(N(a(),a()))}),ii=l({accountId:a(),gatewayId:a(),models:R(ni),vertexProject:g(a()),vertexRegion:g(a())}),ai=l({resourceName:a(),apiVersion:Ae($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),si=l({region:a().check(se(1))}),Yc=D([Uc,Fc,Bc,Zc,Vc,jc,Lc,Mc,ri,Hc]),ui=D([oi,ii,ai,si,qc,Wc,Kc,Jc,Gc,Xc]),Qc=l({id:a(),name:a(),type:U(Cr)}),el=l({id:a(),name:a(),provider:U(xt),config:ui,enabledForChat:B()}),tl=l({provider:U(xt),config:ui,auth:Yc,platformId:a()});var UE={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Yo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],rl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],nl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Qo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],ol=["grok-4.20","grok-4.1-fast"],il={openai:Yo,anthropic:rl,google:Qo,activepieces:[...nl.map(e=>`anthropic/${e}`),...Yo.map(e=>`openai/${e}`),...Qo.map(e=>`google/${e}`),...ol.map(e=>`x-ai/${e}`)]};var ei=128e3,al={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function sl({provider:e}){return e?al[e]??ei:ei}o(sl,"getMaxContextTokens");var ti={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"},ul={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},cl=new Set(["anthropic","mistral"]);function pe(e){return{chatModels:il[e],maxContextTokens:sl({provider:e}),defaultEmbeddingModel:ti[e],supportsEmbedding:ti[e]!==void 0,supportsImageGeneration:!cl.has(e),webSearch:ul[e]}}o(pe,"buildProviderCapabilities");var ll={openai:pe("openai"),anthropic:pe("anthropic"),openrouter:pe("openrouter"),azure:pe("azure"),google:pe("google"),"cloudflare-gateway":pe("cloudflare-gateway"),custom:pe("custom"),bedrock:pe("bedrock"),mistral:pe("mistral"),activepieces:pe("activepieces")};var pl=l({base64Url:a(),fileName:a(),extension:g(a())}),dl=l({mimeType:a(),url:a(),fileName:g(a())}),Ur=D([pl,dl]);var ml=D([l({type:S("file"),value:Ur}),l({type:S("markdown"),value:a(),files:g(R(Ur))})]),fl=l({sessionId:a(),message:a(),files:g(R(a()))});var li=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(li||{}),pi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(pi||{}),Mr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Mr||{});var gl=D([l({...ie,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:R(l({value:a()}))})}),l({...ie,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),yl=l({...ie,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:kr(pi),trigger:kr(li)}),hl=l({...ie,tableId:a(),projectId:a(),cells:N(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),vl=l({events:R(U(Mr)),webhookUrl:a(),flowId:a()}),xl=l({fields:R(l({id:a(),name:a()})),rows:R(N(a(),a())),name:a()}),Pl=l({projectId:a(),limit:g(ut.number()),cursor:g(a()),name:g(a()),externalIds:Ht(a()),folderId:g(a()),folderIds:Ht(a())}),_l=l({records:R(R(l({fieldId:a(),value:mi()}))),tableId:a()}),bl=l({cells:g(R(l({fieldId:a(),value:mi()}))),tableId:a(),agentUpdate:g(B())}),di=Se("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),ci("exists"),ci("not_exists")]),El=l({tableId:a(),limit:g(ut.number()),cursor:g(a()),filters:Ht(di)});function mi(){return Ae($e(e=>e==null?e:String(e)),st(a()))}o(mi,"coerceToString");function we(e){return l({fieldId:a(),operator:S(e),value:a()})}o(we,"valueFilter");function ci(e){return l({fieldId:a(),operator:S(e)})}o(ci,"existenceFilter");var Tl=l({status:g(ee()),body:g(k()),headers:g(N(a(),a()))}),Il=l({...ie,deleted:q(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var fi=l({name:a(),description:g(a()),type:a(),required:B()}),Sl=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:R(fi),returnsResponse:B()})});var gi="^[0-9]+\\.[0-9]+\\.[0-9]+$",rT=new RegExp(gi),Al="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",nT=a().check(Ie(new RegExp(gi))),oT=a().check(Ie(new RegExp(Al))),zl=l({packageType:S("ARCHIVE"),pieceType:U(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),yi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),hi=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),iT=D([yi,hi]),aT=D([zl,yi,hi]);var Ol=Se("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:Oo().check(Ct(6e4))})]),sT=l({...ie,type:U(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Ol),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:B()}),vi=(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))(vi||{}),xi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(xi||{}),Pi=(r=>(r.S3="S3",r.DB="DB",r))(Pi||{}),uT=l({...ie,projectId:q(a()),platformId:q(a()),type:U(vi),compression:U(xi),data:g(k()),location:U(Pi),size:q(ee()),fileName:q(a()),s3Key:q(a()),metadata:q(N(a(),a()))}),_i=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_i||{}),bi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(bi||{}),cT=l({id:a(),email:a(),firstName:a(),status:U(bi),externalId:q(a()),platformId:q(a()),platformRole:U(_i),lastName:a(),created:ze,updated:ze,lastActiveDate:q(ze),imageUrl:q(a())});var Lr=l({...F.shape,...C(N(a(),k()),"OBJECT").shape});var Si=l({...F.shape,...C(a(),"COLOR").shape});var jr=D([ne,ge,Bt,he,oe,ye,$r,ct,Ar,ve,dt,Lr,mt,pt,lt,Si]),P={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 de=l({displayName:a(),description:g(a())});var $i=l({username:a(),password:a()}),Fr=l({...de.shape,username:l({displayName:a(),description:g(a())}),password:l({displayName:a(),description:g(a())}),...C($i,"BASIC_AUTH").shape});var Rl=N(a(),D([ne,ge,ve,he,oe])),Br=l({...de.shape,props:Rl,...C(k(),"CUSTOM_AUTH").shape});var Re=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Dl=N(a(),D([ne,ge,Re,ve,he,oe,ye,Bt])),Ai=l({...de.shape,props:Dl,...C(k(),"OIDC").shape});var Zr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Zr||{}),zi=D([ne,Re,oe]),Oi=N(a(),zi),Cl=l({props:g(N(a(),zi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:g(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:g(B()),pkceMethod:g(D([S("plain"),S("S256")])),authorizationMethod:g(U(Zr)),grantType:g(D([U(gt),S(zr)])),extra:g(N(a(),a()))}),ki=l({access_token:a(),props:g(Oi),data:N(a(),at())}),Vr=l({...de.shape,...Cl.shape,...C(ki,"OAUTH2").shape});var Ze=D([Fr,Br,Ai,Vr,Re]),Pt="Connection",Hr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Pt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Pt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Pt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Pt}},None(){}};var FI={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 Ul=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Ml=D([jr,Ze]),qr=N(a(),Ml),sS=N(a(),jr);var Ni=D([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var wi="2",Gt="0.82.0";var Gr=class{constructor(t,r,n,i,u,c,p,y,h=Gt,_,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=y;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wi}),"getContextInfo");(!Ll(h)||jl(h,Gt))&&(this.minimumSupportedRelease=Gt),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}},Ri=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 Gr(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 Ll(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Ll,"isValidSimpleSemver");function jl(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(jl,"isSemverLessThan");var Fl=g(N(a(),N(a(),a()))),Di=l({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:g(a()),directoryPath:g(a()),auth:g(D([Ze,R(Ze)])),version:a(),categories:g(R(U(je))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),deprecated:g(B()),i18n:Fl}),Bl=U(["human","ai","both"]),Ci=l({description:g(a()),idempotent:g(B())}),Ui=l({name:a(),displayName:a(),description:a(),props:qr,requireAuth:B(),errorHandlingOptions:g(Sr),outputSchema:g(jt()),audience:g(Bl),aiMetadata:g(Ci)}),Mi=l({name:a(),displayName:a(),description:a(),props:qr,errorHandlingOptions:g(Sr),type:U(ke),sampleData:k(),handshakeConfiguration:g(jt()),renewConfiguration:g(Ni),testStrategy:U(ht),outputSchema:g(jt()),aiMetadata:g(Ci)}),Zl=l({...Di.shape,actions:N(a(),Ui),triggers:N(a(),Mi)}),Vl=l({...Di.shape,actions:ee(),triggers:ee(),suggestedActions:g(R(Ui)),suggestedTriggers:g(R(Mi))}),Li=l({projectUsage:ee(),pieceType:U(Le),packageType:U(ft),platformId:g(a()),archiveId:g(a())}),s$=l({...Zl.shape,...Li.shape}),u$=l({...Vl.shape,...Li.shape}),c$=l({name:a(),version:a()});var Hl=Ce(require("path")),ql=Ce(require("fs/promises"));var Zi=require("node:stream");var Wt=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 Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Wr,r=new Kr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Wr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Kr=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 _t=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 ji({error:e,requestBody:t}){return e instanceof _t?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(ji,"toFailsafeOutput");var Jt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Jt||{});var Xt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[L,re]of Object.entries(c))i.append(L,re);let p=i.toString(),y=p?`${n}?${p}`:n,h=t.responseType??"json",_=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Gl(t.method)?Wl(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},f=Jl({...u,...s}),m=await Kl(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:f,body:x,redirect:_?"follow":"manual",signal:L.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(y,ae)}finally{re!==void 0&&clearTimeout(re)}},$),v=_?300:400;if(m.status<200||m.status>=v){let L=await Fi(m,h),re=new _t(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Fi(m,h);return{status:m.status,headers:Xl(m.headers),body:b}}};function Gl(e){return e!=="GET"&&e!=="HEAD"}o(Gl,"acceptsRequestBody");function Wl(e,t){if(Ql(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Yl(e)){let n=new Zi.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(Wl,"serializeBody");async function Fi(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(Fi,"parseResponseBody");async function Kl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Bi(n);continue}return i}catch(i){if(r=i,n<t){await Bi(n);continue}throw i}throw r}o(Kl,"sendWithRetries");function Bi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Bi,"backoff");function Jl(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(Jl,"normalizeHeaders");function Xl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Xl,"toHttpHeaders");function Yl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Yl,"isNodeFormData");function Ql(e){return e==null}o(Ql,"isNil");var Ve=new Xt;var jd=Ce(require("fs")),Ks=Ce(Ws());var Fd={"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 Bd(e){let t=e.split(";")[0].trim().toLowerCase();return Fd[t]??""}o(Bd,"contentTypeToExtension");var Zd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Vd=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 Js({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:y="headers"}){return W({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:P.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:P.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Vd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:P.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Jt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:P.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:P.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:P.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:P.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,$={};switch(_){case"none":break;case"json":$.data=P.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=P.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=P.Array({displayName:"Form Data",required:!0,properties:{fieldName:P.ShortText({displayName:"Field Name",required:!0}),fieldType:P.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:P.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:P.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:P.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:P.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:P.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:P.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:_,url:$,headers:x,queryParams:s,body:d,body_type:f,failsafe:m,timeout:v,response_is_binary:b,followRedirects:L}=h.propsValue;Vt(_,"Method"),Vt($,"URL");let re=ue(r)?{}:await r(h.auth,h.propsValue),ae=$.url,Qe=ae.startsWith("http://")||ae.startsWith("https://")?ae:Zd({baseUrl:t(h.auth),relativePath:ae}),_e={method:_,url:Qe,headers:{...x??{},...y==="headers"||!ue(y)?re:{}},queryParams:{...y==="queryParams"?re:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(b&&(_e.responseType="arraybuffer"),d)if(f&&f!=="none"){let me=d.data;if(f==="form_data"){let du=me,It=new Ks.default;for(let{fieldName:hn,fieldType:vn,textFieldValue:xn,fileFieldValue:lr}of du)vn==="text"&&!vt(xn)?It.append(hn,xn):vn==="file"&&!vt(lr)&&It.append(hn,lr.data,{filename:lr?.filename});_e.body=It,_e.headers={..._e.headers,...It.getHeaders()}}else _e.body=me}else f||(_e.body=d);try{let me=await Ve.sendRequest(_e);return await Hd(h.files,me.body,me.status,me.headers,b)}catch(me){if(m)return ji({error:me,requestBody:_e.body});throw me}},"run")})}o(Js,"createCustomApiCallAction");var Hd=o(async(e,t,r,n,i)=>{let u;if(i&&qd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Bd(c??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),qd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Je="https://api.elasticemail.com/v4",sr=["Transactional","Engaged","Active","Bounced","Unsubscribed","Abuse","Inactive","Stale","NotConfirmed"],ur=["Deleted","Active","Processing","Sending","Completed","Paused","Cancelled","Draft"],Xs=["HTML","PlainText","AMP","CSS"],Ys=["UserProvided","None","Raw7bit","Raw8bit","QuotedPrintable","Base64","Uue"],Qs=["Unknown","Allow","Deny"];var Z=Hr.SecretText({displayName:"API Key",description:`
|
|
4
|
+
To obtain your Elastic Email API key:
|
|
5
|
+
1. Log in to your Elastic Email account
|
|
6
|
+
2. Navigate to **Settings \u2192 Manage API Keys**
|
|
7
|
+
3. Click **Create API Key**
|
|
8
|
+
4. Ensure the key has the required permissions (Contacts, Campaigns, Emails, Segments)
|
|
9
|
+
5. Copy the key and paste it here
|
|
10
|
+
`,required:!0,validate:o(async({auth:e})=>{try{return(await Ve.sendRequest({method:"GET",url:`${Je}/contacts`,headers:{"X-ElasticEmail-ApiKey":e},queryParams:{limit:"1"}})).status===200?{valid:!0}:{valid:!1,error:"Invalid API key \u2014 could not authenticate with Elastic Email."}}catch(t){let r=t!=null&&typeof t=="object"&&"response"in t&&t.response!=null&&typeof t.response=="object"&&"status"in t.response?t.response.status:void 0;return r===401||r===403?{valid:!1,error:"Invalid API key \u2014 could not authenticate with Elastic Email."}:{valid:!1,error:"Could not reach the Elastic Email API. Check your network connection and try again."}}},"validate")});async function V({apiKey:e,method:t,path:r,queryParams:n,body:i}){return(await Ve.sendRequest({method:t,url:`${Je}${r}`,headers:{"X-ElasticEmail-ApiKey":e,...i?{"Content-Type":"application/json"}:{}},queryParams:n,body:i})).body}o(V,"elasticEmailRequest");var eu=P.Dropdown({displayName:"Contact Email",description:"Select an existing contact by email address.",required:!0,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/contacts",queryParams:{limit:String(100)}})??[]).filter(r=>r.Email).map(r=>({label:r.Email,value:r.Email}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),tu=P.Dropdown({displayName:"Campaign",description:"Select an existing campaign by name.",required:!0,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/campaigns",queryParams:{limit:String(100)}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Xe=P.MultiSelectDropdown({displayName:"Mailing Lists",description:"Select mailing lists.",required:!1,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/lists",queryParams:{limit:String(100)}})??[]).filter(r=>r.ListName).map(r=>({label:r.ListName,value:r.ListName}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),cr=P.MultiSelectDropdown({displayName:"Segments",description:"Select segments.",required:!1,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/segments",queryParams:{limit:String(100)}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")}),Ye=P.Dropdown({displayName:"Template",description:"Select an email template.",required:!1,refreshers:[],auth:Z,options:o(async({auth:e})=>e?{disabled:!1,options:(await V({apiKey:e.secret_text,method:"GET",path:"/templates",queryParams:{limit:String(100),scopeType:"Personal"}})??[]).filter(r=>r.Name).map(r=>({label:r.Name,value:r.Name}))}:{disabled:!0,placeholder:"Connect your Elastic Email account first.",options:[]},"options")});var ru=W({name:"add_contact",displayName:"Add Contact to Mailing List",description:"Add a new contact to one or more mailing lists in Elastic Email.",audience:"both",aiMetadata:{description:"Adds a contact (identified by email) to one or more named mailing lists in Elastic Email, with optional name, status, custom fields, and consent details. Use when subscribing someone to specific lists rather than just creating a bare contact. Each call appends the contact, so it is not idempotent.",idempotent:!1},auth:Z,props:{email:P.ShortText({displayName:"Email",description:"The email address of the contact.",required:!0}),listNames:Xe,status:P.StaticDropdown({displayName:"Status",description:"Initial status of the contact.",required:!1,options:{options:sr.map(e=>({label:e,value:e}))}}),firstName:P.ShortText({displayName:"First Name",required:!1}),lastName:P.ShortText({displayName:"Last Name",required:!1}),customFields:P.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1}),consentIP:P.ShortText({displayName:"Consent IP",description:"IP address of consent. If not provided, your current public IP is used.",required:!1}),consentDate:P.ShortText({displayName:"Consent Date",description:"ISO 8601 date of consent. If not provided, current date is used.",required:!1}),consentTracking:P.StaticDropdown({displayName:"Consent Tracking",description:'Consent tracking level. Defaults to "Unknown".',required:!1,options:{options:Qs.map(e=>({label:e,value:e}))}})},async run({auth:e,propsValue:t}){let r={};return t.listNames&&(r.listnames=Array.isArray(t.listNames)?t.listNames.join(","):String(t.listNames)),V({apiKey:e.secret_text,method:"POST",path:"/contacts",queryParams:Object.keys(r).length>0?r:void 0,body:[{Email:t.email,Status:t.status??void 0,FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0,Consent:{ConsentIP:t.consentIP??void 0,ConsentDate:t.consentDate??void 0,ConsentTracking:t.consentTracking??void 0}}]})}});var nu=W({name:"create_campaign",displayName:"Create Campaign",description:"Create a new email campaign in Elastic Email.",audience:"both",aiMetadata:{description:"Creates a new email campaign in Elastic Email targeting the given mailing lists and/or segments, with sender, subject, template, and an initial status (e.g. draft or active). Use to set up a bulk campaign send; for one-off transactional messages use Send Email instead. Each call creates a separate campaign, so it is not idempotent.",idempotent:!1},auth:Z,props:{name:P.ShortText({displayName:"Campaign Name",required:!0}),from:P.ShortText({displayName:"From",description:"Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).",required:!0}),recipientListNames:Xe,recipientSegmentNames:cr,replyTo:P.ShortText({displayName:"Reply To",description:"Reply-to email address.",required:!0}),status:P.StaticDropdown({displayName:"Status",description:"Initial campaign status.",required:!0,options:{options:ur.map(e=>({label:e,value:e}))}}),subject:P.ShortText({displayName:"Subject",description:"Default email subject line.",required:!1}),templateName:Ye},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/campaigns",body:{Name:t.name,Recipients:{ListNames:t.recipientListNames&&t.recipientListNames.length>0?t.recipientListNames:void 0,SegmentNames:t.recipientSegmentNames&&t.recipientSegmentNames.length>0?t.recipientSegmentNames:void 0},Content:[{From:t.from,ReplyTo:t.replyTo,Subject:t.subject??void 0,TemplateName:t.templateName??void 0}],Status:t.status}})}});var ou=W({name:"create_contact",displayName:"Create Contact",description:"Create a new contact in Elastic Email.",audience:"both",aiMetadata:{description:"Creates a new contact in Elastic Email from an email address, with optional name, status, and custom fields, without attaching it to any mailing list. Use when you only need the contact to exist; use Add Contact to Mailing List when it must also join specific lists. Each call appends the contact, so it is not idempotent.",idempotent:!1},auth:Z,props:{email:P.ShortText({displayName:"Email",description:"The email address of the contact.",required:!0}),status:P.StaticDropdown({displayName:"Status",description:"Initial status of the contact.",required:!1,options:{options:sr.map(e=>({label:e,value:e}))}}),firstName:P.ShortText({displayName:"First Name",required:!1}),lastName:P.ShortText({displayName:"Last Name",required:!1}),customFields:P.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/contacts",body:[{Email:t.email,Status:t.status??void 0,FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0}]})}});var iu=W({name:"create_segment",displayName:"Create Segment",description:"Create a new contact segment in Elastic Email using a SQL-like rule.",audience:"both",aiMetadata:{description:"Creates a named contact segment in Elastic Email defined by a SQL-like rule that selects which contacts belong to it. Use to build a reusable audience for campaigns. The rule must follow Elastic Email segment-rule syntax. Each call creates a separate segment, so it is not idempotent.",idempotent:!1},auth:Z,props:{name:P.ShortText({displayName:"Segment Name",required:!0}),rule:P.ShortText({displayName:"Rule",description:"SQL-like rule to determine which contacts belong to this segment. See https://help.elasticemail.com/en/articles/5162182-segment-rules",required:!0})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"POST",path:"/segments",body:{Name:t.name,Rule:t.rule}})}});var au=W({name:"list_campaigns",displayName:"List Campaigns",description:"Fetch a paginated list of campaigns from Elastic Email.",audience:"both",aiMetadata:{description:"Retrieves a paginated list of campaigns from Elastic Email; leave the search field empty to return all campaigns, or set it to filter by campaign name. Use to look up campaigns or find a campaign name before updating it. Read-only and idempotent.",idempotent:!0},auth:Z,props:{search:P.ShortText({displayName:"Search",description:"Filter campaigns by name.",required:!1}),limit:P.Number({displayName:"Limit",description:"Maximum number of campaigns to return (max 100).",required:!1,defaultValue:100}),offset:P.Number({displayName:"Offset",description:"Number of campaigns to skip.",required:!1,defaultValue:0})},async run({auth:e,propsValue:t}){let r={};return t.search&&(r.search=t.search),t.limit!==void 0&&(r.limit=String(t.limit)),t.offset!==void 0&&(r.offset=String(t.offset)),V({apiKey:e.secret_text,method:"GET",path:"/campaigns",queryParams:r})}});var su=W({name:"list_contacts",displayName:"List Contacts",description:"Fetch a paginated list of contacts from Elastic Email.",audience:"both",aiMetadata:{description:"Retrieves a paginated list of contacts from the Elastic Email account using limit and offset. Use to browse or page through contacts. Read-only and idempotent.",idempotent:!0},auth:Z,props:{limit:P.Number({displayName:"Limit",description:"Maximum number of contacts to return (max 100).",required:!1,defaultValue:100}),offset:P.Number({displayName:"Offset",description:"Number of contacts to skip.",required:!1,defaultValue:0})},async run({auth:e,propsValue:t}){let r={};return t.limit!==void 0&&(r.limit=String(t.limit)),t.offset!==void 0&&(r.offset=String(t.offset)),V({apiKey:e.secret_text,method:"GET",path:"/contacts",queryParams:r})}});var uu=W({name:"send_email",displayName:"Send Email",description:"Send an email to one or more recipients via Elastic Email.",audience:"both",aiMetadata:{description:"Sends a transactional email to one or more recipients via Elastic Email, with either inline body content or a saved template, plus optional merge fields, tracking, and a scheduled time offset. Use for direct one-off sends; use Create Campaign for bulk list/segment marketing. Each call dispatches a new email, so it is not idempotent.",idempotent:!1},auth:Z,props:{recipients:P.Array({displayName:"Recipients",description:"List of recipient email addresses.",required:!0}),from:P.ShortText({displayName:"From",description:"Sender email with optional name (e.g. `email@domain.com` or `John Doe <email@domain.com>`).",required:!0}),subject:P.ShortText({displayName:"Subject",description:"Email subject line.",required:!1}),bodyContentType:P.StaticDropdown({displayName:"Body Content Type",description:"Type of body content.",required:!1,options:{options:Xs.map(e=>({label:e,value:e}))}}),bodyContent:P.LongText({displayName:"Body Content",description:"The actual body content of the email.",required:!1}),replyTo:P.ShortText({displayName:"Reply To",description:"Reply-to email address.",required:!1}),templateName:Ye,merge:P.Object({displayName:"Merge Fields",description:"Key-value merge fields shared between recipients. Use in email body like {firstname}, {lastname}.",required:!1}),timeOffset:P.Number({displayName:"Time Offset (minutes)",description:"Delay sending by this many minutes. Maximum is 35 days (50400 minutes).",required:!1}),poolName:P.ShortText({displayName:"Pool Name",description:"Name of custom IP pool for sending.",required:!1}),channelName:P.ShortText({displayName:"Channel Name",description:"Name of the sending channel.",required:!1}),encoding:P.StaticDropdown({displayName:"Encoding",description:"Encoding type for email headers.",required:!1,options:{options:Ys.map(e=>({label:e,value:e}))}}),trackOpens:P.Checkbox({displayName:"Track Opens",description:"Track email opens. If not set, uses account default.",required:!1}),trackClicks:P.Checkbox({displayName:"Track Clicks",description:"Track link clicks. If not set, uses account default.",required:!1})},async run({auth:e,propsValue:t}){let r=(t.recipients??[]).map(String);return V({apiKey:e.secret_text,method:"POST",path:"/emails",body:{Recipients:r.map(n=>({Email:n})),Content:{From:t.from,Subject:t.subject??void 0,Body:t.bodyContentType||t.bodyContent?[{ContentType:t.bodyContentType||"HTML",Body:t.bodyContent}]:void 0,ReplyTo:t.replyTo??void 0,TemplateName:t.templateName??void 0,Merge:t.merge??void 0},Options:{TimeOffset:t.timeOffset??void 0,PoolName:t.poolName??void 0,ChannelName:t.channelName??void 0,Encoding:t.encoding??void 0,TrackOpens:t.trackOpens??void 0,TrackClicks:t.trackClicks??void 0}}})}});var cu=W({name:"unsubscribe_contact",displayName:"Unsubscribe Contact",description:"Unsubscribe one or more email addresses from future emails in Elastic Email.",audience:"both",aiMetadata:{description:"Marks one or more email addresses as unsubscribed in Elastic Email so they no longer receive future emails. Use to honor opt-out or suppression requests. Idempotent: re-running with the same addresses leaves them unsubscribed with no additional effect.",idempotent:!0},auth:Z,props:{emails:P.Array({displayName:"Email Addresses",description:"List of email addresses to unsubscribe.",required:!0})},async run({auth:e,propsValue:t}){let r=(t.emails??[]).map(String);return V({apiKey:e.secret_text,method:"POST",path:"/suppressions/unsubscribes",body:r})}});var lu=W({name:"update_campaign",displayName:"Update Campaign",description:"Update an existing campaign in Elastic Email.",audience:"both",aiMetadata:{description:"Updates an existing campaign in Elastic Email, identified by its name, merging any provided fields (name, sender, recipients, subject, template, status) with the campaign's current values so omitted fields are preserved. Use to revise a campaign before it sends. Idempotent: applying the same values yields the same campaign state.",idempotent:!0},auth:Z,props:{campaign:tu,name:P.ShortText({displayName:"New Campaign Name",description:"New name for the campaign. Leave empty to keep existing.",required:!1}),from:P.ShortText({displayName:"From",description:"Sender email with optional name. Leave empty to keep existing.",required:!1}),recipientListNames:Xe,recipientSegmentNames:cr,replyTo:P.ShortText({displayName:"Reply To",description:"Reply-to email address. Leave empty to keep existing.",required:!1}),subject:P.ShortText({displayName:"Subject",description:"Email subject. Leave empty to keep existing.",required:!1}),templateName:Ye,status:P.StaticDropdown({displayName:"Status",description:"Campaign status. Leave empty to keep existing.",required:!1,options:{options:ur.map(e=>({label:e,value:e}))}})},async run({auth:e,propsValue:t}){let r=String(t.campaign),n=await V({apiKey:e.secret_text,method:"GET",path:`/campaigns/${encodeURIComponent(r)}`}),i=n.Content?.[0]??{};return V({apiKey:e.secret_text,method:"PUT",path:`/campaigns/${encodeURIComponent(r)}`,body:{Name:t.name||n.Name,Recipients:{ListNames:t.recipientListNames&&t.recipientListNames.length>0?t.recipientListNames:n.Recipients?.ListNames??void 0,SegmentNames:t.recipientSegmentNames&&t.recipientSegmentNames.length>0?t.recipientSegmentNames:n.Recipients?.SegmentNames??void 0},Content:[{From:t.from||i.From,ReplyTo:t.replyTo||i.ReplyTo,Subject:t.subject||i.Subject,TemplateName:t.templateName||i.TemplateName}],Status:t.status||n.Status}})}});var pu=W({name:"update_contact",displayName:"Update Contact",description:"Update an existing contact in Elastic Email.",audience:"both",aiMetadata:{description:"Updates an existing contact in Elastic Email, identified by email address, setting first name, last name, and/or custom fields. Use to edit contact details after creation. Idempotent: applying the same values yields the same contact state.",idempotent:!0},auth:Z,props:{contact:eu,firstName:P.ShortText({displayName:"First Name",required:!1}),lastName:P.ShortText({displayName:"Last Name",required:!1}),customFields:P.Object({displayName:"Custom Fields",description:"Key-value pairs of custom contact fields. Only existing custom fields will be saved.",required:!1})},async run({auth:e,propsValue:t}){return V({apiKey:e.secret_text,method:"PUT",path:`/contacts/${encodeURIComponent(String(t.contact))}`,body:{FirstName:t.firstName??void 0,LastName:t.lastName??void 0,CustomFields:t.customFields??void 0}})}});var Gd=Ri({displayName:"Elastic Email",description:"Email delivery and marketing platform for sending emails, managing contacts, campaigns, and segments.",auth:Z,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/elastic-email.png",authors:["Harmatta"],categories:["MARKETING"],actions:[ru,nu,ou,iu,au,su,uu,cu,lu,pu,Js({baseUrl:o(()=>Je,"baseUrl"),auth:Z,authMapping:o(async e=>({"X-ElasticEmail-ApiKey":e.secret_text}),"authMapping")})],triggers:[]});0&&(module.exports={elasticEmail});
|
|
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
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,YAAY,mHA6BvB,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,qEAA6D;AAC7D,iDAAqD;AAErD,qCAA8C;AAC9C,sDAAgE;AAChE,2DAA6D;AAC7D,mEAAqE;AACrE,iEAAmE;AACnE,iEAAmE;AACnE,iEAAmE;AACnE,+DAAiE;AACjE,yDAA2D;AAC3D,2EAA6E;AAC7E,mEAAqE;AACrE,iEAAmE;AAEtD,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,uGAAuG;IACzG,IAAI,EAAE,uBAAgB;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,uDAAuD;IAChE,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE;QACP,8BAAgB;QAChB,sCAAoB;QACpB,oCAAmB;QACnB,oCAAmB;QACnB,oCAAmB;QACnB,kCAAkB;QAClB,4BAAe;QACf,8CAAwB;QACxB,sCAAoB;QACpB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,kCAAsB;YACrC,IAAI,EAAE,uBAAgB;YACtB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,uBAAuB,EAAE,IAAI,CAAC,WAAW;iBAC1C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const addContactAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
listNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
status: import("@activepieces/pieces-framework").StaticDropdownProperty<"Transactional" | "Engaged" | "Active" | "Bounced" | "Unsubscribed" | "Abuse" | "Inactive" | "Stale" | "NotConfirmed", false>;
|
|
5
|
-
firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
|
-
lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
-
customFields: import("@activepieces/pieces-framework").ObjectProperty<false>;
|
|
8
|
-
consentIP: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
consentDate: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
consentTracking: import("@activepieces/pieces-framework").StaticDropdownProperty<"Unknown" | "Allow" | "Deny", false>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=add-contact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-contact.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,gBAAgB;;;;;;;;;;EA2F3B,CAAC"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addContactAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
const client_1 = require("../common/client");
|
|
9
|
-
const constants_1 = require("../common/constants");
|
|
10
|
-
const props_1 = require("../common/props");
|
|
11
|
-
exports.addContactAction = (0, pieces_framework_1.createAction)({
|
|
12
|
-
name: 'add_contact',
|
|
13
|
-
displayName: 'Add Contact to Mailing List',
|
|
14
|
-
description: 'Add a new contact to one or more mailing lists in Elastic Email.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Adds a contact (identified by email) to one or more named mailing lists in Elastic Email, with optional name, status, custom fields, and consent details. Use when subscribing someone to specific lists rather than just creating a bare contact. Each call appends the contact, so it is not idempotent.',
|
|
18
|
-
idempotent: false,
|
|
19
|
-
},
|
|
20
|
-
auth: auth_1.elasticEmailAuth,
|
|
21
|
-
props: {
|
|
22
|
-
email: pieces_framework_1.Property.ShortText({
|
|
23
|
-
displayName: 'Email',
|
|
24
|
-
description: 'The email address of the contact.',
|
|
25
|
-
required: true,
|
|
26
|
-
}),
|
|
27
|
-
listNames: props_1.listNamesProp,
|
|
28
|
-
status: pieces_framework_1.Property.StaticDropdown({
|
|
29
|
-
displayName: 'Status',
|
|
30
|
-
description: 'Initial status of the contact.',
|
|
31
|
-
required: false,
|
|
32
|
-
options: {
|
|
33
|
-
options: constants_1.CONTACT_STATUS_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
34
|
-
},
|
|
35
|
-
}),
|
|
36
|
-
firstName: pieces_framework_1.Property.ShortText({
|
|
37
|
-
displayName: 'First Name',
|
|
38
|
-
required: false,
|
|
39
|
-
}),
|
|
40
|
-
lastName: pieces_framework_1.Property.ShortText({
|
|
41
|
-
displayName: 'Last Name',
|
|
42
|
-
required: false,
|
|
43
|
-
}),
|
|
44
|
-
customFields: pieces_framework_1.Property.Object({
|
|
45
|
-
displayName: 'Custom Fields',
|
|
46
|
-
description: 'Key-value pairs of custom contact fields. Only existing custom fields will be saved.',
|
|
47
|
-
required: false,
|
|
48
|
-
}),
|
|
49
|
-
consentIP: pieces_framework_1.Property.ShortText({
|
|
50
|
-
displayName: 'Consent IP',
|
|
51
|
-
description: 'IP address of consent. If not provided, your current public IP is used.',
|
|
52
|
-
required: false,
|
|
53
|
-
}),
|
|
54
|
-
consentDate: pieces_framework_1.Property.ShortText({
|
|
55
|
-
displayName: 'Consent Date',
|
|
56
|
-
description: 'ISO 8601 date of consent. If not provided, current date is used.',
|
|
57
|
-
required: false,
|
|
58
|
-
}),
|
|
59
|
-
consentTracking: pieces_framework_1.Property.StaticDropdown({
|
|
60
|
-
displayName: 'Consent Tracking',
|
|
61
|
-
description: 'Consent tracking level. Defaults to "Unknown".',
|
|
62
|
-
required: false,
|
|
63
|
-
options: {
|
|
64
|
-
options: constants_1.CONSENT_TRACKING_OPTIONS.map((s) => ({ label: s, value: s })),
|
|
65
|
-
},
|
|
66
|
-
}),
|
|
67
|
-
},
|
|
68
|
-
run(_a) {
|
|
69
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
70
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
|
71
|
-
const queryParams = {};
|
|
72
|
-
if (propsValue.listNames) {
|
|
73
|
-
queryParams['listnames'] = Array.isArray(propsValue.listNames)
|
|
74
|
-
? propsValue.listNames.join(',')
|
|
75
|
-
: String(propsValue.listNames);
|
|
76
|
-
}
|
|
77
|
-
return (0, client_1.elasticEmailRequest)({
|
|
78
|
-
apiKey: auth.secret_text,
|
|
79
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
80
|
-
path: '/contacts',
|
|
81
|
-
queryParams: Object.keys(queryParams).length > 0 ? queryParams : undefined,
|
|
82
|
-
body: [
|
|
83
|
-
{
|
|
84
|
-
Email: propsValue.email,
|
|
85
|
-
Status: (_b = propsValue.status) !== null && _b !== void 0 ? _b : undefined,
|
|
86
|
-
FirstName: (_c = propsValue.firstName) !== null && _c !== void 0 ? _c : undefined,
|
|
87
|
-
LastName: (_d = propsValue.lastName) !== null && _d !== void 0 ? _d : undefined,
|
|
88
|
-
CustomFields: (_e = propsValue.customFields) !== null && _e !== void 0 ? _e : undefined,
|
|
89
|
-
Consent: {
|
|
90
|
-
ConsentIP: (_f = propsValue.consentIP) !== null && _f !== void 0 ? _f : undefined,
|
|
91
|
-
ConsentDate: (_g = propsValue.consentDate) !== null && _g !== void 0 ? _g : undefined,
|
|
92
|
-
ConsentTracking: (_h = propsValue.consentTracking) !== null && _h !== void 0 ? _h : undefined,
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
//# sourceMappingURL=add-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-contact.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-contact.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AAExE,kCAA2C;AAC3C,6CAAuD;AACvD,mDAG6B;AAC7B,2CAAgD;AAEnC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EACT,kEAAkE;IACpE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,4SAA4S;QAC9S,UAAU,EAAE,KAAK;KAClB;IACD,IAAI,EAAE,uBAAgB;IACtB,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,qBAAa;QACxB,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,kCAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;aACrE;SACF,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,eAAe;YAC5B,WAAW,EACT,sFAAsF;YACxF,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,yEAAyE;YAC3E,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACvC,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,oCAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;aACvE;SACF,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,WAAW,GAA2B,EAAE,CAAC;YAC/C,IAAI,UAAU,CAAC,SAAS,EAAE,CAAC;gBACzB,WAAW,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;oBAC5D,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;oBAChC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACnC,CAAC;YAED,OAAO,IAAA,4BAAmB,EAAC;gBACzB,MAAM,EAAE,IAAI,CAAC,WAAW;gBACxB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;gBAC1E,IAAI,EAAE;oBACJ;wBACE,KAAK,EAAE,UAAU,CAAC,KAAK;wBACvB,MAAM,EAAE,MAAA,UAAU,CAAC,MAAM,mCAAI,SAAS;wBACtC,SAAS,EAAE,MAAA,UAAU,CAAC,SAAS,mCAAI,SAAS;wBAC5C,QAAQ,EAAE,MAAA,UAAU,CAAC,QAAQ,mCAAI,SAAS;wBAC1C,YAAY,EAAE,MAAA,UAAU,CAAC,YAAY,mCAAI,SAAS;wBAClD,OAAO,EAAE;4BACP,SAAS,EAAE,MAAA,UAAU,CAAC,SAAS,mCAAI,SAAS;4BAC5C,WAAW,EAAE,MAAA,UAAU,CAAC,WAAW,mCAAI,SAAS;4BAChD,eAAe,EAAE,MAAA,UAAU,CAAC,eAAe,mCAAI,SAAS;yBACzD;qBACF;iBACF;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const createCampaignAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
from: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
recipientListNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
-
recipientSegmentNames: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
6
|
-
replyTo: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
status: import("@activepieces/pieces-framework").StaticDropdownProperty<"Active" | "Deleted" | "Processing" | "Sending" | "Completed" | "Paused" | "Cancelled" | "Draft", true>;
|
|
8
|
-
subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
templateName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=create-campaign.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-campaign.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-campaign.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,oBAAoB;;;;;;;;;EAuE/B,CAAC"}
|