@activepieces/piece-twilio 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -12
- package/src/index.js +13 -61
- package/src/index.d.ts +0 -3
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/action/download-recording-media.d.ts +0 -6
- package/src/lib/action/download-recording-media.d.ts.map +0 -1
- package/src/lib/action/download-recording-media.js +0 -75
- package/src/lib/action/download-recording-media.js.map +0 -1
- package/src/lib/action/get-message.d.ts +0 -4
- package/src/lib/action/get-message.d.ts.map +0 -1
- package/src/lib/action/get-message.js +0 -34
- package/src/lib/action/get-message.js.map +0 -1
- package/src/lib/action/make-call.d.ts +0 -10
- package/src/lib/action/make-call.d.ts.map +0 -1
- package/src/lib/action/make-call.js +0 -96
- package/src/lib/action/make-call.js.map +0 -1
- package/src/lib/action/phone-number-lookup.d.ts +0 -4
- package/src/lib/action/phone-number-lookup.d.ts.map +0 -1
- package/src/lib/action/phone-number-lookup.js +0 -42
- package/src/lib/action/phone-number-lookup.js.map +0 -1
- package/src/lib/action/send-sms.d.ts +0 -6
- package/src/lib/action/send-sms.d.ts.map +0 -1
- package/src/lib/action/send-sms.js +0 -42
- package/src/lib/action/send-sms.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -9
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -54
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/trigger/new-call.d.ts +0 -3
- package/src/lib/trigger/new-call.d.ts.map +0 -1
- package/src/lib/trigger/new-call.js +0 -133
- package/src/lib/trigger/new-call.js.map +0 -1
- package/src/lib/trigger/new-incoming-sms.d.ts +0 -11
- package/src/lib/trigger/new-incoming-sms.d.ts.map +0 -1
- package/src/lib/trigger/new-incoming-sms.js +0 -106
- package/src/lib/trigger/new-incoming-sms.js.map +0 -1
- package/src/lib/trigger/new-phone-number.d.ts +0 -3
- package/src/lib/trigger/new-phone-number.d.ts.map +0 -1
- package/src/lib/trigger/new-phone-number.js +0 -111
- package/src/lib/trigger/new-phone-number.js.map +0 -1
- package/src/lib/trigger/new-recording.d.ts +0 -3
- package/src/lib/trigger/new-recording.d.ts.map +0 -1
- package/src/lib/trigger/new-recording.js +0 -121
- package/src/lib/trigger/new-recording.js.map +0 -1
- package/src/lib/trigger/new-transcription.d.ts +0 -3
- package/src/lib/trigger/new-transcription.d.ts.map +0 -1
- package/src/lib/trigger/new-transcription.js +0 -110
- package/src/lib/trigger/new-transcription.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-twilio",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.86.0",
|
|
14
|
-
"tslib": "2.6.2"
|
|
15
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
16
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,61 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.twilio = exports.twilioAuth = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const new_phone_number_1 = require("./lib/trigger/new-phone-number");
|
|
15
|
-
const new_recording_1 = require("./lib/trigger/new-recording");
|
|
16
|
-
const new_transcription_1 = require("./lib/trigger/new-transcription");
|
|
17
|
-
const new_call_1 = require("./lib/trigger/new-call");
|
|
18
|
-
exports.twilioAuth = pieces_framework_1.PieceAuth.BasicAuth({
|
|
19
|
-
description: 'The authentication to use to connect to Twilio',
|
|
20
|
-
required: true,
|
|
21
|
-
username: {
|
|
22
|
-
displayName: 'Account SID',
|
|
23
|
-
description: 'The account SID to use to connect to Twilio',
|
|
24
|
-
},
|
|
25
|
-
password: {
|
|
26
|
-
displayName: 'Auth token',
|
|
27
|
-
description: 'The auth token to use to connect to Twilio',
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
exports.twilio = (0, pieces_framework_1.createPiece)({
|
|
31
|
-
displayName: 'Twilio',
|
|
32
|
-
description: 'Cloud communications platform for building SMS, Voice & Messaging applications',
|
|
33
|
-
minimumSupportedRelease: '0.30.0',
|
|
34
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/twilio.png',
|
|
35
|
-
auth: exports.twilioAuth,
|
|
36
|
-
categories: [shared_1.PieceCategory.COMMUNICATION],
|
|
37
|
-
actions: [
|
|
38
|
-
send_sms_1.twilioSendSms,
|
|
39
|
-
phone_number_lookup_1.twilioPhoneNumberLookup,
|
|
40
|
-
make_call_1.twilioMakeCall,
|
|
41
|
-
get_message_1.twilioGetMessage,
|
|
42
|
-
download_recording_media_1.twilioDownloadRecordingMedia,
|
|
43
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
44
|
-
baseUrl: () => 'https://api.twilio.com/2010-04-01',
|
|
45
|
-
auth: exports.twilioAuth,
|
|
46
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
return ({
|
|
48
|
-
Authorization: `Basic ${Buffer.from(`${auth.username}:${auth.password}`).toString('base64')}`,
|
|
49
|
-
});
|
|
50
|
-
}),
|
|
51
|
-
}),
|
|
52
|
-
],
|
|
53
|
-
authors: ["kishanprmr", "MoShizzle", "khaledmashaly", "abuaboud"],
|
|
54
|
-
triggers: [new_incoming_sms_1.twilioNewIncomingSms,
|
|
55
|
-
new_phone_number_1.twilioNewPhoneNumber,
|
|
56
|
-
new_recording_1.twilioNewRecording,
|
|
57
|
-
new_transcription_1.twilioNewTranscription,
|
|
58
|
-
new_call_1.twilioNewCall
|
|
59
|
-
],
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var Js=Object.create;var tt=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Qs=Object.getOwnPropertyNames;var eu=Object.getPrototypeOf,tu=Object.prototype.hasOwnProperty;var i=(e,t)=>tt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_n=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},Pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qs(t))!tu.call(e,o)&&o!==r&&tt(e,o,{get:()=>t[o],enumerable:!(n=Ys(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?Js(eu(e)):{},Pn(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),ru=e=>Pn(tt({},"__esModule",{value:!0}),e);var jo=E((Mo,Zt)=>{(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"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,_=(u.match(l.zoneIndex)||[])[0],P,j;for(_&&(_=_.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(j=d-y,P=":";j--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=function(){let ne=u.split(":"),ce=[];for(let et=0;et<ne.length;et++)ce.push(parseInt(ne[et],16));return ce}(),{parts:d,zoneId:_}}i(m,"expandIPv6");function g(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[_]>>P!==d[_]>>P)return!1;f-=y,_+=1}return!0}i(g,"matchCIDR");function h(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(h,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}i(b,"padPart");let x={};x.IPv4=function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,P,j;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in f){if(j=f[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<4;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return function(){let _=d.slice(1,6),P=[];for(let j=0;j<_.length;j++)y=_[j],P.push(h(y));return P}();if(d=u.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(f>>P&255);return _}().reverse()}else return(d=u.match(r.twoOctet))?function(){let _=d.slice(1,4),P=[];if(f=h(_[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P}():(d=u.match(r.threeOctet))?function(){let _=d.slice(1,5),P=[];if(f=h(_[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(h(_[1])),P.push(f>>8&255),P.push(f&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=function(){function u(d,y){let f,_;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(_=this.parts[f],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={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},_,P;for(let j=7;j>=0;j-=1)if(_=this.parts[j],_ in f){if(P=f[_],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let _=0;_<f.length;_++)d=f[_],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(b(this.parts[_].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new x.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(this.parts[_].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,_=-1,P;for(;P=d.exec(y);)P[0].length>_&&(f=P.index,_=P[0].length);return _<0?y:`${y.substring(0,f)}::${y.substring(f+_)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<16;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(u){let d=this.parser(u);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(u){let d,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,y,f,_,P,j;if(f=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(l.native.test(u))return m(u,8);if((f=u.match(l.transitional))&&(j=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+j,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(_=P[y],!(0<=_&&_<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let f,_,P,j;y==null&&(y="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(j=P[f],u.kind()===j[0].kind()&&u.match.apply(u,j))return _}return y},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Mo)});var Di=E((nA,Ni)=>{var Ri=require("stream").Stream,kl=require("util");Ni.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(de,"DelayedStream");kl.inherits(de,Ri);de.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(de.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Ri.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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=E((iA,Mi)=>{var Ol=require("util"),Ui=require("stream").Stream,Ci=Di();Mi.exports=q;function q(){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}i(q,"CombinedStream");Ol.inherits(q,Ui);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof Ci)){var r=Ci.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};q.prototype.pipe=function(e,t){return Ui.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Fi=E((sA,Li)=>{"use strict";Li.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 Zi=E(re=>{"use strict";var Kt=Fi(),Rl=require("path").extname,Bi=/^\s*([^;\s]*)(?:;|\s|$)/,Nl=/^text\//i;re.charset=Vi;re.charsets={lookup:Vi};re.contentType=Dl;re.extension=Cl;re.extensions=Object.create(null);re.lookup=Ul;re.types=Object.create(null);Ml(re.extensions,re.types);function Vi(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Nl.test(t[1])?"UTF-8":!1}i(Vi,"charset");function Dl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Dl,"contentType");function Cl(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Cl,"extension");function Ul(e){if(!e||typeof e!="string")return!1;var t=Rl("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}i(Ul,"lookup");function Ml(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(i(function(o){var s=Kt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var m=c[l];if(t[m]){var g=r.indexOf(Kt[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(Ml,"populateMaps")});var Wi=E((lA,Hi)=>{Hi.exports=jl;function jl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(jl,"defer")});var Xr=E((dA,qi)=>{var Gi=Wi();qi.exports=Ll;function Ll(e){var t=!1;return Gi(function(){t=!0}),i(function(n,o){t?e(n,o):Gi(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Ll,"async")});var Kr=E((fA,Xi)=>{Xi.exports=Fl;function Fl(e){Object.keys(e.jobs).forEach(Bl.bind(e)),e.jobs={}}i(Fl,"abort");function Bl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Bl,"clean")});var Jr=E((yA,Ji)=>{var Ki=Xr(),Vl=Kr();Ji.exports=Zl;function Zl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Hl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Vl(r):r.results[o]=c,n(s,r.results))})}i(Zl,"iterate");function Hl(e,t,r,n){var o;return e.length==2?o=e(r,Ki(n)):o=e(r,t,Ki(n)),o}i(Hl,"runJob")});var Yr=E((vA,Yi)=>{Yi.exports=Wl;function Wl(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(o,s){return t(e[o],e[s])}),n}i(Wl,"state")});var Qr=E((_A,Qi)=>{var Gl=Kr(),ql=Xr();Qi.exports=Xl;function Xl(e){Object.keys(this.jobs).length&&(this.index=this.size,Gl(this),ql(e)(null,this.results))}i(Xl,"terminator")});var ta=E((bA,ea)=>{var Kl=Jr(),Jl=Yr(),Yl=Qr();ea.exports=Ql;function Ql(e,t,r){for(var n=Jl(e);n.index<(n.keyedList||e).length;)Kl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Yl.bind(n,r)}i(Ql,"parallel")});var en=E((IA,Jt)=>{var ra=Jr(),ep=Yr(),tp=Qr();Jt.exports=rp;Jt.exports.ascending=na;Jt.exports.descending=np;function rp(e,t,r,n){var o=ep(e,r);return ra(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){ra(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),tp.bind(o,n)}i(rp,"serialOrdered");function na(e,t){return e<t?-1:e>t?1:0}i(na,"ascending");function np(e,t){return-1*na(e,t)}i(np,"descending")});var ia=E(($A,oa)=>{var op=en();oa.exports=ip;function ip(e,t,r){return op(e,t,null,r)}i(ip,"serial")});var sa=E((AA,aa)=>{aa.exports={parallel:ta(),serial:ia(),serialOrdered:en()}});var tn=E((zA,ua)=>{"use strict";ua.exports=Object});var la=E((wA,ca)=>{"use strict";ca.exports=Error});var da=E((kA,pa)=>{"use strict";pa.exports=EvalError});var fa=E((OA,ma)=>{"use strict";ma.exports=RangeError});var ya=E((RA,ga)=>{"use strict";ga.exports=ReferenceError});var va=E((NA,ha)=>{"use strict";ha.exports=SyntaxError});var Yt=E((DA,xa)=>{"use strict";xa.exports=TypeError});var Pa=E((CA,_a)=>{"use strict";_a.exports=URIError});var Ta=E((UA,ba)=>{"use strict";ba.exports=Math.abs});var Ea=E((MA,Ia)=>{"use strict";Ia.exports=Math.floor});var Sa=E((jA,$a)=>{"use strict";$a.exports=Math.max});var za=E((LA,Aa)=>{"use strict";Aa.exports=Math.min});var ka=E((FA,wa)=>{"use strict";wa.exports=Math.pow});var Ra=E((BA,Oa)=>{"use strict";Oa.exports=Math.round});var Da=E((VA,Na)=>{"use strict";Na.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ua=E((HA,Ca)=>{"use strict";var ap=Da();Ca.exports=i(function(t){return ap(t)||t===0?t:t<0?-1:1},"sign")});var ja=E((GA,Ma)=>{"use strict";Ma.exports=Object.getOwnPropertyDescriptor});var rn=E((qA,La)=>{"use strict";var Qt=ja();if(Qt)try{Qt([],"length")}catch{Qt=null}La.exports=Qt});var Ba=E((XA,Fa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Fa.exports=er});var nn=E((KA,Va)=>{"use strict";Va.exports=i(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 o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Wa=E((YA,Ha)=>{"use strict";var Za=typeof Symbol<"u"&&Symbol,sp=nn();Ha.exports=i(function(){return typeof Za!="function"||typeof Symbol!="function"||typeof Za("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sp()},"hasNativeSymbols")});var on=E((ez,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=E((tz,qa)=>{"use strict";var up=tn();qa.exports=up.getPrototypeOf||null});var Ja=E((rz,Ka)=>{"use strict";var cp="Function.prototype.bind called on incompatible ",lp=Object.prototype.toString,pp=Math.max,dp="[object Function]",Xa=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),mp=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),fp=i(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");Ka.exports=i(function(t){var r=this;if(typeof r!="function"||lp.apply(r)!==dp)throw new TypeError(cp+r);for(var n=mp(arguments,1),o,s=i(function(){if(this instanceof o){var h=r.apply(this,Xa(n,arguments));return Object(h)===h?h:this}return r.apply(t,Xa(n,arguments))},"binder"),c=pp(0,r.length-n.length),l=[],m=0;m<c;m++)l[m]="$"+m;if(o=Function("binder","return function ("+fp(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var qe=E((oz,Ya)=>{"use strict";var gp=Ja();Ya.exports=Function.prototype.bind||gp});var tr=E((iz,Qa)=>{"use strict";Qa.exports=Function.prototype.call});var sn=E((az,es)=>{"use strict";es.exports=Function.prototype.apply});var rs=E((sz,ts)=>{"use strict";ts.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var os=E((uz,ns)=>{"use strict";var yp=qe(),hp=sn(),vp=tr(),xp=rs();ns.exports=xp||yp.call(vp,hp)});var as=E((cz,is)=>{"use strict";var _p=qe(),Pp=Yt(),bp=tr(),Tp=os();is.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Pp("a function is required");return Tp(_p,bp,t)},"callBindBasic")});var ds=E((pz,ps)=>{"use strict";var Ip=as(),ss=rn(),cs;try{cs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var un=!!cs&&ss&&ss(Object.prototype,"__proto__"),ls=Object,us=ls.getPrototypeOf;ps.exports=un&&typeof un.get=="function"?Ip([un.get]):typeof us=="function"?i(function(t){return us(t==null?t:ls(t))},"getDunder"):!1});var hs=E((mz,ys)=>{"use strict";var ms=on(),fs=an(),gs=ds();ys.exports=ms?i(function(t){return ms(t)},"getProto"):fs?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return fs(t)},"getProto"):gs?i(function(t){return gs(t)},"getProto"):null});var cn=E((gz,vs)=>{"use strict";var Ep=Function.prototype.call,$p=Object.prototype.hasOwnProperty,Sp=qe();vs.exports=Sp.call(Ep,$p)});var Es=E((yz,Is)=>{"use strict";var M,Ap=tn(),zp=la(),wp=da(),kp=fa(),Op=ya(),Ye=va(),Je=Yt(),Rp=Pa(),Np=Ta(),Dp=Ea(),Cp=Sa(),Up=za(),Mp=ka(),jp=Ra(),Lp=Ua(),bs=Function,ln=i(function(e){try{return bs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=rn(),Fp=Ba(),pn=i(function(){throw new Je},"throwTypeError"),Bp=bt?function(){try{return arguments.callee,pn}catch{try{return bt(arguments,"callee").get}catch{return pn}}}():pn,Xe=Wa()(),Q=hs(),Vp=an(),Zp=on(),Ts=sn(),Tt=tr(),Ke={},Hp=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%":Xe&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%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%":zp,"%eval%":eval,"%EvalError%":wp,"%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%":bs,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xe&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xe||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ap,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":kp,"%ReferenceError%":Op,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xe||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xe&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Xe?Symbol:M,"%SyntaxError%":Ye,"%ThrowTypeError%":Bp,"%TypedArray%":Hp,"%TypeError%":Je,"%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%":Rp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Ts,"%Object.defineProperty%":Fp,"%Object.getPrototypeOf%":Vp,"%Math.abs%":Np,"%Math.floor%":Dp,"%Math.max%":Cp,"%Math.min%":Up,"%Math.pow%":Mp,"%Math.round%":jp,"%Math.sign%":Lp,"%Reflect.getPrototypeOf%":Zp};if(Q)try{null.error}catch(e){xs=Q(Q(e)),De["%Error.prototype%"]=xs}var xs,Wp=i(function e(t){var r;if(t==="%AsyncFunction%")r=ln("async function () {}");else if(t==="%GeneratorFunction%")r=ln("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ln("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Q&&(r=Q(o.prototype))}return De[t]=r,r},"doEval"),_s={__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"]},It=qe(),rr=cn(),Gp=It.call(Tt,Array.prototype.concat),qp=It.call(Ts,Array.prototype.splice),Ps=It.call(Tt,String.prototype.replace),nr=It.call(Tt,String.prototype.slice),Xp=It.call(Tt,RegExp.prototype.exec),Kp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jp=/\\(\\)?/g,Yp=i(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var o=[];return Ps(t,Kp,function(s,c,l,m){o[o.length]=l?Ps(m,Jp,"$1"):c||s}),o},"stringToPath"),Qp=i(function(t,r){var n=t,o;if(rr(_s,n)&&(o=_s[n],n="%"+o[0]+"%"),rr(De,n)){var s=De[n];if(s===Ke&&(s=Wp(n)),typeof s>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Is.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(Xp(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Yp(t),o=n.length>0?n[0]:"",s=Qp("%"+o+"%",r),c=s.name,l=s.value,m=!1,g=s.alias;g&&(o=g[0],qp(n,Gp([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var x=n[h],u=nr(x,0,1),d=nr(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ye("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(m=!0),o+="."+x,c="%"+o+"%",rr(De,c))l=De[c];else if(l!=null){if(!(x in l)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&h+1>=n.length){var y=bt(l,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else b=rr(l,x),l=l[x];b&&!m&&(De[c]=l)}}return l},"GetIntrinsic")});var Ss=E((vz,$s)=>{"use strict";var ed=nn();$s.exports=i(function(){return ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var ws=E((_z,zs)=>{"use strict";var td=Es(),As=td("%Object.defineProperty%",!0),rd=Ss()(),nd=cn(),od=Yt(),or=rd?Symbol.toStringTag:null;zs.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new od("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!nd(t,or))&&(As?As(t,or,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Os=E((bz,ks)=>{"use strict";var id=Function.prototype.call,ad=Object.prototype.hasOwnProperty,sd=qe();ks.exports=sd.call(id,ad)});var Ns=E((Tz,Rs)=>{"use strict";Rs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Us=E((Iz,Cs)=>{"use strict";var gn=ji(),ud=require("util"),dn=require("path"),cd=require("http"),ld=require("https"),pd=require("url").parse,dd=require("fs"),md=require("stream").Stream,fd=require("crypto"),mn=Zi(),gd=sa(),yd=ws(),we=Os(),fn=Ns();function Ds(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ds,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(L,"FormData");ud.inherits(L,gn);L.LINE_BREAK=`\r
|
|
2
|
+
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=gn.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 o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof md))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):dd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Ds(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&fn(c,r.header);var l;for(var m in c)if(we(c,m)){if(l=c[m],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=m+": "+l.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+s+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=dn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=dn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ds(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=mn.lookup(e.name)),!r&&e&&e.path&&(r=mn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=mn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+fd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}gd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=pd(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=fn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ld.request(n):r=cd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,m=i(function(g,h){return r.removeListener("error",m),r.removeListener("response",l),t.call(this,g,h)},"callback");l=m.bind(this,null),r.on("error",m),r.on("response",l)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};yd(L.prototype,"FormData");Cs.exports=L});var $d={};_n($d,{twilio:()=>Ed,twilioAuth:()=>V});module.exports=ru($d);var nu=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,m){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,m);let g=c.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let x=h[b];x in l||(l[x]=g[x].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var m;let g=r?.Parent?new s:this;n(g,l),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(T,"$constructor");var ou=Symbol("zod_brand"),me=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$t=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},lr={};function he(e){return e&&Object.assign(lr,e),lr}i(he,"config");function dr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(dr,"getEnumValues");function Tn(e,t){return typeof t=="bigint"?t.toString():t}i(Tn,"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")}}}i(At,"cached");function In(e){return e==null}i(In,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(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(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(X,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(rt,"isObject");var iu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function En(e){if(rt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(rt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(En,"isPlainObject");var $n=new Set(["string","number","symbol"]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Me,"escapeRegex");function wt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(wt,"clone");function H(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(H,"normalizeParams");function Sn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Sn,"optionalKeys");var au={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function je(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(je,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Ie,"prefixIssues");function St(e){return typeof e=="string"?e:e?.message}i(St,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(r.customError?.(e))??St(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ee,"finalizeIssue");function An(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(An,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(fr,"issue");var zn=i((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,Tn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),wn=T("$ZodError",zn),nt=T("$ZodError",zn,{Parent:Error});var uu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ee(m,s,he())));throw mr(l,o?.callee),l}return c.value},"_parse"),kt=uu(nt),cu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ee(m,s,he())));throw mr(l,o?.callee),l}return c.value},"_parseAsync"),Ot=cu(nt),lu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new me;return s.issues.length?{success:!1,error:new(e??wn)(s.issues.map(c=>Ee(c,o,he())))}:{success:!0,data:s.value}},"_safeParse"),ot=lu(nt),pu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ee(c,o,he())))}:{success:!0,data:s.value}},"_safeParseAsync"),it=pu(nt);var du="(?:(?:\\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])))",mu=new RegExp(`^${du}$`);var kn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),On=/^-?\d+n?$/;var gr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var Le=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Nn=T("$ZodCheckMinLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!In(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=An(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Le.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Dn=T("$ZodCheckRegex",(e,t)=>{yr.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 Un={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,l,m)=>{let g=je(c),h;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new me;if(h||u instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(g||(g=je(c,x)))});else{if(c.issues.length===x)continue;g||(g=je(c,x))}}return h?h.then(()=>c):c},"runChecks"),s=i((c,l,m)=>{if(je(c))return c.aborted=!0,c;let g=o(l,n,m);if(g instanceof Promise){if(m.async===!1)throw new me;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,c,l)):s(g,c,l)}let m=e._zod.parse(c,l);if(m instanceof Promise){if(l.async===!1)throw new me;return m.then(g=>o(g,n,l))}return o(m,n,l)}}X(e,"~standard",()=>({validate:i(o=>{try{let s=ot(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return it(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Dt.init(e,t)});var Bn=T("$ZodURL",(e,t)=>{hr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Vn=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}});var vr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Rn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Zn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=On,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 Hn=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Wn=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Gn=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),qn=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Mn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}i(Mn,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let l=o[c],m=t.element._zod.run({value:l,issues:[]},n);m instanceof Promise?s.push(m.then(g=>Mn(g,r,c))):Mn(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Nt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(Nt,"handlePropertyResult");function fu(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=Sn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(fu,"normalizeDef");function gu(e,t,r,n,o,s){let c=[],l=o.keySet,m=o.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(l.has(b))continue;if(g==="never"){c.push(b);continue}let x=m.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Nt(u,r,b,t,h))):Nt(x,r,b,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(gu,"handleCatchall");var Kn=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let m={...l};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=At(()=>fu(t));X(e._zod,"propValues",()=>{let l=t.shape,m={};for(let g in l){let h=l[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let o=rt,s=t.catchall,c;e._zod.parse=(l,m)=>{c??(c=n.value);let g=l.value;if(!o(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let h=[],b=c.shape;for(let x of c.keys){let u=b[x],d=u._zod.optout==="optional",y=u._zod.run({value:g[x],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Nt(f,l,x,g,d))):Nt(y,l,x,g,d)}return s?gu(h,g,l,m,n.value,e):h.length?Promise.all(h).then(()=>l):l}});function jn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!je(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ee(c,n,he())))}),t)}i(jn,"handleUnionResults");var xr=T("$ZodUnion",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>zt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let m of t.options){let g=m._zod.run({value:o.value,issues:[]},s);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(m=>jn(m,o,e,s)):jn(l,o,e,s)}});var Jn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,m]of Object.entries(c)){o[l]||(o[l]=new Set);for(let g of m)o[l].add(g)}}return o});let n=At(()=>{let o=t.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of l){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!rt(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Yn=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!En(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:o[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Ie(g,h.issues)),r.value[g]=h.value)}let m;for(let g in o)l.has(g)||(m=m??[],m.push(g));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let m=t.keyType._zod.run({value:l,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&gr.test(l)&&m.issues.length){let b=t.keyType._zod.run({value:Number(l),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>Ee(b,n,he())),input:l,path:[l],inst:e});continue}let h=t.valueType._zod.run({value:o[l],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(l,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Ie(l,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Qn=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>$n.has(typeof o)).map(o=>typeof o=="string"?Me(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),eo=T("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Me(n):n?Me(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var to=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $t(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new me;return r.value=o,r}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Ln,"handleOptionalResult");var ro=T("$ZodOptional",(e,t)=>{W.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 o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Ln(s,r.value)):Ln(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=T("$ZodNullable",(e,t)=>{W.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 oo=T("$ZodPipe",(e,t)=>{W.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 s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Rt(c,t.in,n)):Rt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Rt(s,t.out,n)):Rt(o,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Rt,"handlePipeResult");var io=T("$ZodCustom",(e,t)=>{Le.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Fn(s,r,n,e));Fn(o,r,n,e)}});function Fn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(fr(o))}}i(Fn,"handleRefineResult");var so,xu=Symbol("ZodOutput"),_u=Symbol("ZodInput"),_r=class{static{i(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 o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function uo(){return new _r}i(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var Pr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...H(t)})}i(co,"_string");function lo(e,t){return new e({type:"string",coerce:!0,...H(t)})}i(lo,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}i(po,"_url");function mo(e,t){return new e({type:"number",checks:[],...H(t)})}i(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}i(fo,"_coercedNumber");function go(e,t){return new e({type:"boolean",...H(t)})}i(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}i(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}i(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}i(vo,"_any");function xo(e){return new e({type:"unknown"})}i(xo,"_unknown");function _o(e,t){return new e({type:"void",...H(t)})}i(_o,"_void");function Po(e,t){return new e({type:"date",coerce:!0,...H(t)})}i(Po,"_coercedDate");function le(e,t){return new Nn({check:"min_length",...H(t),minimum:e})}i(le,"_minLength");function $e(e,t){return new Dn({check:"string_format",format:"regex",...H(t),pattern:e})}i($e,"_regex");function bo(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(bo,"_custom");var K=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.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)=>ot(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>it(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)=>wt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Dt.init(e,t),K.init(e,t)});function a(e){return co(Ut,e)}i(a,"string");var To=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Ut.init(e,t)});var wu=T("ZodMiniURL",(e,t)=>{Bn.init(e,t),To.init(e,t)});function Io(e){return po(wu,e)}i(Io,"url");var br=T("ZodMiniNumber",(e,t)=>{Vn.init(e,t),K.init(e,t)});function te(e){return mo(br,e)}i(te,"number");var Tr=T("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function B(e){return go(Tr,e)}i(B,"boolean");var Eo=T("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),K.init(e,t)});var ku=T("ZodMiniAny",(e,t)=>{Hn.init(e,t),K.init(e,t)});function st(){return vo(ku)}i(st,"any");var Ou=T("ZodMiniUnknown",(e,t)=>{Wn.init(e,t),K.init(e,t)});function w(){return xo(Ou)}i(w,"unknown");var Ru=T("ZodMiniVoid",(e,t)=>{Gn.init(e,t),K.init(e,t)});function $o(e){return _o(Ru,e)}i($o,"_void");var So=T("ZodMiniDate",(e,t)=>{qn.init(e,t),K.init(e,t)});var Nu=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),K.init(e,t)});function R(e,t){return new Nu({type:"array",element:e,...H(t)})}i(R,"array");var Du=T("ZodMiniObject",(e,t)=>{Kn.init(e,t),K.init(e,t),X(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...H(t)};return new Du(r)}i(p,"object");var Cu=T("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Cu({type:"union",options:e,...H(t)})}i(N,"union");var Uu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),K.init(e,t)});function Fe(e,t,r){return new Uu({type:"union",options:t,discriminator:e,...H(r)})}i(Fe,"discriminatedUnion");var Mu=T("ZodMiniRecord",(e,t)=>{Yn.init(e,t),K.init(e,t)});function k(e,t,r){return new Mu({type:"record",keyType:e,valueType:t,...H(r)})}i(k,"record");var ju=T("ZodMiniEnum",(e,t)=>{Qn.init(e,t),K.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 ju({type:"enum",entries:r,...H(t)})}i(U,"_enum");var Lu=T("ZodMiniLiteral",(e,t)=>{eo.init(e,t),K.init(e,t)});function $(e,t){return new Lu({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}i($,"literal");var Fu=T("ZodMiniTransform",(e,t)=>{to.init(e,t),K.init(e,t)});function Se(e){return new Fu({type:"transform",transform:e})}i(Se,"transform");var Bu=T("ZodMiniOptional",(e,t)=>{ro.init(e,t),K.init(e,t)});function v(e){return new Bu({type:"optional",innerType:e})}i(v,"optional");var Vu=T("ZodMiniNullable",(e,t)=>{no.init(e,t),K.init(e,t)});function ut(e){return new Vu({type:"nullable",innerType:e})}i(ut,"nullable");var Zu=T("ZodMiniPipe",(e,t)=>{oo.init(e,t),K.init(e,t)});function Ae(e,t){return new Zu({type:"pipe",in:e,out:t})}i(Ae,"pipe");var Hu=T("ZodMiniCustom",(e,t)=>{io.init(e,t),K.init(e,t)});function Mt(e,t){return bo(Hu,e??(()=>!0),t)}i(Mt,"custom");var ct={};_n(ct,{bigint:()=>Yu,boolean:()=>Ju,date:()=>Qu,number:()=>Ku,string:()=>Xu});function Xu(e){return lo(Ut,e)}i(Xu,"string");function Ku(e){return fo(br,e)}i(Ku,"number");function Ju(e){return yo(Tr,e)}i(Ju,"boolean");function Yu(e){return ho(Eo,e)}i(Yu,"bigint");function Qu(e){return Po(So,e)}i(Qu,"date");var Er=p({retryOnFailure:p({defaultValue:v(B()),hide:v(B())}),continueOnFailure:p({defaultValue:v(B()),hide:v(B())})}),Ir=class{constructor(t,r,n,o,s,c,l,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{i(this,"IAction")}},ae=i(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=p({displayName:a(),description:v(a())}),D=i((e,t)=>p({type:$(t),required:B(),defaultValue:v(st())}),"TPropertyValue");var oe=p({...F.shape,...D(a(),"SHORT_TEXT").shape}),ve=p({...F.shape,...D(a(),"LONG_TEXT").shape});var zo=p({label:a(),value:w()}),jt=p({disabled:v(B()),placeholder:v(a()),options:R(zo)});var ie=p({...F.shape,options:jt,...D(w(),"STATIC_DROPDOWN").shape}),xe=p({...F.shape,options:jt,...D(R(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var $r=p({...F.shape,...D(w(),"DROPDOWN").shape,refreshers:R(a())}),lt=p({...F.shape,...D(R(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var _e=p({...F.shape,...D(B(),"CHECKBOX").shape});var Pe=p({...F.shape,...D(te(),"NUMBER").shape});var pt=p({...F.shape,...D(w(),"FILE").shape});var dt=p({...F.shape,...D(a(),"DATE_TIME").shape});var wo=k(a(),N([oe,ve,ie,lt,xe,_e,Pe,pt,dt])),mt=p({...F.shape,properties:wo,...D(R(w()),"ARRAY").shape});var ft=p({...F.shape,...D(N([k(a(),w())]),"JSON").shape});var ko=N([oe,ie,ft,mt,xe]),tc=k(a(),ko),Sr=p({refreshers:R(a()),...F.shape,...D(w(),"DYNAMIC").shape});var Lt=p({...F.shape,...D($o(),"MARKDOWN").shape});var gt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(gt||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ve=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(Ve||{});var yt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(yt||{}),Ar="both_client_credentials_and_authorization_code";var se=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(se||{}),ht=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(ht||{}),rc=p({strategy:U(ht),paramName:v(a())}),vt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(vt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Oo=p({status:v(te()),body:v(w()),headers:v(k(a(),a()))}),Ro=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(Ft))}),No=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Oo,handlerId:v(a()),streamStepProgress:v(U(Ft))}),nc=N([Ro,No]);var oc=p({body:w(),rawBody:v(w()),headers:k(a(),a()),queryParams:k(a(),a())});function ee(e){return e==null}i(ee,"isNil");function xt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(xt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Bt,"assertNotNullOrUndefined");var zr=Ue(require("crypto"),1);var ic=128,Oe,Ze,ac=i(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*ic),zr.default.randomFillSync(Oe),Ze=0):Ze+e>Oe.length&&(zr.default.randomFillSync(Oe),Ze=0),Ze+=e},"fillPool"),sc=i(e=>(ac(e|=0),Oe.subarray(Ze-e,Ze)),"random"),uc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let l=r(o),m=o;for(;m--;)if(c+=e[l[m]&n]||"",c.length===s)return c}}},"customRandom"),Co=i((e,t=21)=>uc(e,t,sc),"customAlphabet");var cc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Uo=21,cb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Uo}}$`))),lc=Co(cc,Uo);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:ze,updated:ze},Z=i(e=>v(ut(e)),"Nullable");function wr(e){return v(ut(U(e)))}i(wr,"NullableEnum");var db=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(B())),Vt=i(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(R(e))),"OptionalArrayFromQuery");var gb=k(a(),w());var _t=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(_t||{});var Sb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var zb=p({filename:a(),data:w(),type:$("file"),mimetype:v(a())});var pc=Ue(jo());var Cb=p({...ue,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:v(te())});var Lo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Lo||{}),kr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(kr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var dc=p({mode:U(Lo),value:w()}),mc=p({auth:v(a()),fields:k(a(),dc)}),fc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(mc)}),gc=p({type:$("PIECE"),toolName:a().check(le(1)),pieceMetadata:fc}),yc=p({type:$("none")}),hc=p({type:$("access_token"),accessToken:a()}),vc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),xc=p({type:$("headers"),headers:k(a(),a())}),_c=Fe("type",[yc,hc,vc,xc]),Fo=p({type:$("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:v(a())}),Bo=p({type:$("MCP"),toolName:a().check(le(1)),serverUrl:Io(),protocol:U(Or),auth:_c}),Vo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:U(kr),sourceId:a(),sourceName:a()}),Pc=Fe("type",[gc,Fo,Bo,Vo]),bc=p({displayName:a(),description:v(a()),type:U(Rr)}),Zo=p({type:$("MARKDOWN"),markdown:a()}),He={type:$("TOOL_CALL"),input:Z(k(a(),w())),output:v(w()),toolName:a(),status:U(Nr),toolCallId:a(),startTime:a(),endTime:v(a())},cT=p(He),Ho=Fe("toolCallType",[p({...He,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:$("UNKNOWN"),displayName:a()})]),Tc=N([Zo,Ho]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),be=p({apiKey:a()}),Ic=be,Ec=p({apiKey:a(),apiKeyHash:a()}),$c=be,Sc=be,Ac=be,zc=be,wc=be,kc=be,Oc=be,Wo=p({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Rc=p({}),Nc=p({}),Dc=p({}),Cc=p({}),Uc=p({}),Mc=p({}),Go=p({modelId:a(),modelName:a(),modelType:U(Dr)}),qo=p({apiKeyHeader:a(),baseUrl:a(),models:R(Go),defaultHeaders:v(k(a(),a()))}),Xo=p({accountId:a(),gatewayId:a(),models:R(Go),vertexProject:v(a()),vertexRegion:v(a())}),Ko=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Jo=p({region:a().check(le(1))}),jc=N([Ic,Ac,zc,wc,kc,Sc,$c,Ec,Wo,Oc]),Yo=N([qo,Xo,Ko,Jo,Rc,Dc,Cc,Uc,Nc,Mc]),Lc=p({id:a(),name:a(),type:U(Dr)}),Fc=p({id:a(),name:a(),provider:U(_t),config:Yo,enabledForChat:B()}),Bc=p({provider:U(_t),config:Yo,auth:jc,platformId:a()});var mT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Vc=p({base64Url:a(),fileName:a(),extension:v(a())}),Zc=p({mimeType:a(),url:a(),fileName:v(a())}),Cr=N([Vc,Zc]);var Hc=N([p({type:$("file"),value:Cr}),p({type:$("markdown"),value:a(),files:v(R(Cr))})]),Wc=p({sessionId:a(),message:a(),files:v(R(a()))});var ei=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ei||{}),ti=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ti||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var Gc=N([p({...ue,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),qc=p({...ue,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:wr(ti),trigger:wr(ei)}),Xc=p({...ue,tableId:a(),projectId:a(),cells:k(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),Kc=p({events:R(U(Ur)),webhookUrl:a(),flowId:a()}),Jc=p({fields:R(p({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),Yc=p({projectId:a(),limit:v(ct.number()),cursor:v(a()),name:v(a()),externalIds:Vt(a()),folderId:v(a()),folderIds:Vt(a())}),Qc=p({records:R(R(p({fieldId:a(),value:ni()}))),tableId:a()}),el=p({cells:v(R(p({fieldId:a(),value:ni()}))),tableId:a(),agentUpdate:v(B())}),ri=Fe("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),Qo("exists"),Qo("not_exists")]),tl=p({tableId:a(),limit:v(ct.number()),cursor:v(a()),filters:Vt(ri)});function ni(){return Ae(Se(e=>e==null?e:String(e)),ut(a()))}i(ni,"coerceToString");function Re(e){return p({fieldId:a(),operator:$(e),value:a()})}i(Re,"valueFilter");function Qo(e){return p({fieldId:a(),operator:$(e)})}i(Qo,"existenceFilter");var rl=p({status:v(te()),body:v(w()),headers:v(k(a(),a()))}),nl=p({...ue,deleted:Z(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var oi=p({name:a(),description:v(a()),type:a(),required:B()}),ol=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(oi),returnsResponse:B()})});var ii="^[0-9]+\\.[0-9]+\\.[0-9]+$",OT=new RegExp(ii),al="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",RT=a().check($e(new RegExp(ii))),NT=a().check($e(new RegExp(al))),sl=p({packageType:$("ARCHIVE"),pieceType:U(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ai=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),si=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),DT=N([ai,si]),CT=N([sl,ai,si]),ui=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ui||{}),ul=p({type:U(ui),cronExpression:a(),timezone:a()}),UT=p({...ue,type:U(se),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(ul),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),ci=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(ci||{}),li=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(li||{}),pi=(r=>(r.S3="S3",r.DB="DB",r))(pi||{}),MT=p({...ue,projectId:Z(a()),platformId:Z(a()),type:U(ci),compression:U(li),data:v(w()),location:U(pi),size:Z(te()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(k(a(),a()))}),di=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(di||{}),mi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(mi||{}),jT=p({id:a(),email:a(),firstName:a(),status:U(mi),externalId:Z(a()),platformId:Z(a()),platformRole:U(di),lastName:a(),created:ze,updated:ze,lastActiveDate:Z(ze),imageUrl:Z(a())});var Mr=p({...F.shape,...D(k(a(),w()),"OBJECT").shape});var hi=p({...F.shape,...D(a(),"COLOR").shape});var jr=N([oe,ve,Lt,_e,ie,xe,$r,lt,Sr,Pe,mt,Mr,ft,dt,pt,hi]),C={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 fe=p({displayName:a(),description:v(a())});var vi=p({username:a(),password:a()}),Lr=p({...fe.shape,username:p({displayName:a(),description:v(a())}),password:p({displayName:a(),description:v(a())}),...D(vi,"BASIC_AUTH").shape});var dl=k(a(),N([oe,ve,Pe,_e,ie])),Fr=p({...fe.shape,props:dl,...D(w(),"CUSTOM_AUTH").shape});var Ne=p({...fe.shape,...D(p({auth:a()}),"SECRET_TEXT").shape});var ml=k(a(),N([oe,ve,Ne,Pe,_e,ie,xe,Lt])),xi=p({...fe.shape,props:ml,...D(w(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),_i=N([oe,Ne,ie]),Pi=k(a(),_i),fl=p({props:v(k(a(),_i)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:v(N([$("none"),$("consent"),$("login"),$("omit")])),pkce:v(B()),pkceMethod:v(N([$("plain"),$("S256")])),authorizationMethod:v(U(Br)),grantType:v(N([U(yt),$(Ar)])),extra:v(k(a(),a()))}),bi=p({access_token:a(),props:v(Pi),data:k(a(),st())}),Vr=p({...fe.shape,...fl.shape,...D(bi,"OAUTH2").shape});var We=N([Lr,Fr,xi,Vr,Ne]),Pt="Connection",Zr={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 hE={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 gl=p({...F.shape,...D(w(),"CUSTOM").shape,code:a()});var yl=N([jr,We]),Hr=k(a(),yl),UE=k(a(),jr);var Ti=N([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]),Ge=class{constructor(t,r,n,o,s,c,l,m,g,h,b,x,u,d,y,f,_,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=l;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=x;this.onStart=u;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=j}static{i(this,"ITrigger")}},ge=i(e=>{switch(e.type){case"WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ee(e.sampleData)&&ee(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ii="2",Ht="0.82.0";var Wr=class{constructor(t,r,n,o,s,c,l,m,g=Ht,h,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Ii}),"getContextInfo");(!hl(g)||vl(g,Ht))&&(this.minimumSupportedRelease=Ht),s.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ei=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Wr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function hl(e){return/^\d+\.\d+\.\d+$/.test(e)}i(hl,"isValidSimpleSemver");function vl(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i(vl,"isSemverLessThan");var xl=v(k(a(),k(a(),a()))),$i=p({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:v(a()),directoryPath:v(a()),auth:v(N([We,R(We)])),version:a(),categories:v(R(U(Ve))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:xl}),_l=U(["human","ai","both"]),Si=p({description:v(a()),idempotent:v(B())}),Ai=p({name:a(),displayName:a(),description:a(),props:Hr,requireAuth:B(),errorHandlingOptions:v(Er),outputSchema:v(Mt()),audience:v(_l),aiMetadata:v(Si)}),zi=p({name:a(),displayName:a(),description:a(),props:Hr,errorHandlingOptions:v(Er),type:U(se),sampleData:w(),handshakeConfiguration:v(Mt()),renewConfiguration:v(Ti),testStrategy:U(vt),outputSchema:v(Mt()),aiMetadata:v(Si)}),Pl=p({...$i.shape,actions:k(a(),Ai),triggers:k(a(),zi)}),bl=p({...$i.shape,actions:te(),triggers:te(),suggestedActions:v(R(zi)),suggestedTriggers:v(R(Ai))}),wi=p({projectUsage:te(),tags:v(R(a())),pieceType:U(Be),packageType:U(gt),platformId:v(a()),archiveId:v(a())}),U$=p({...Pl.shape,...wi.shape}),M$=p({...bl.shape,...wi.shape}),j$=p({name:a(),version:a()});var Tl=Ue(require("path")),Il=Ue(require("fs/promises"));var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Gt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Gr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Gr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var qt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Xt=class extends Wt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,ne]of Object.entries(c))o.append(j,ne);let l=o.toString(),m=l?`${n}?${l}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:u,isStream:d}=El(t.body,s),y=Sl({...s,...u}),f=await $l(async()=>{let j=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:y,body:x,redirect:h?"follow":"manual",signal:j.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(m,ce)}finally{ne!==void 0&&clearTimeout(ne)}},b),_=h?300:400;if(f.status<200||f.status>=_){let j=await ki(f,g),ne=new qt(t.body,{status:f.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await ki(f,g);return{status:f.status,headers:Al(f.headers),body:P}}};function El(e,t){return wl(e)?{body:void 0,extraHeaders:{},isStream:!1}:zl(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(El,"serializeBody");async function ki(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(ki,"parseResponseBody");async function $l(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Oi(n);continue}return o}catch(o){if(r=o,n<t){await Oi(n);continue}throw o}throw r}i($l,"sendWithRetries");function Oi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Oi,"backoff");function Sl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(Sl,"normalizeHeaders");function Al(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Al,"toHttpHeaders");function zl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(zl,"isNodeFormData");function wl(e){return e==null}i(wl,"isNil");var Y=new Xt;var pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(pe||{});var hd=Ue(require("fs")),Ms=Ue(Us());var vd={"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 xd(e){let t=e.split(";")[0].trim().toLowerCase();return vd[t]??""}i(xd,"contentTypeToExtension");var _d=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Pd=i((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:o,name:s,props:c,extraProps:l,authLocation:m="headers"}){return ae({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:C.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Pd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(pe).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:C.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:C.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=C.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async g=>{let{method:h,url:b,headers:x,queryParams:u,body:d,body_type:y,failsafe:f,timeout:_,response_is_binary:P,followRedirects:j}=g.propsValue;Bt(h,"Method"),Bt(b,"URL");let ne=ee(r)?{}:await r(g.auth,g.propsValue),ce=b.url,et=ce.startsWith("http://")||ce.startsWith("https://")?ce:_d({baseUrl:t(g.auth),relativePath:ce}),ke={method:h,url:et,headers:{...x??{},...m==="headers"||!ee(m)?ne:{}},queryParams:{...m==="queryParams"?ne:{},...u??{}},timeout:_?_*1e3:0,followRedirects:j};if(P&&(ke.responseType="arraybuffer"),d)if(y&&y!=="none"){let ye=d.data;if(y==="form_data"){let Ks=ye,Et=new Ms.default;for(let{fieldName:hn,fieldType:vn,textFieldValue:xn,fileFieldValue:cr}of Ks)vn==="text"&&!xt(xn)?Et.append(hn,xn):vn==="file"&&!xt(cr)&&Et.append(hn,cr.data,{filename:cr?.filename});ke.body=Et,ke.headers={...ke.headers,...Et.getHeaders()}}else ke.body=ye}else y||(ke.body=d);try{let ye=await Y.sendRequest(ke);return await bd(g.files,ye.body,ye.status,ye.headers,P)}catch(ye){if(f)return ye.errorMessage();throw ye}},"run")})}i(js,"createCustomApiCallAction");var bd=i(async(e,t,r,n,o)=>{let s;if(o&&Td(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=xd(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Td=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var J={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(ee(l))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),l);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>l).map(h=>h.data)}case 1:{let l=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:s,server:c}),g=m.findIndex(x=>x.id===l),h=[];ee(l)||g==-1?h=m??[]:h=m?.slice(0,g)??[],ee(o)||(h=h.slice(-o));let b=h?.[0]?.id;return ee(b)||await t.put("lastItem",b),h.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;ee(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return Id(c.map(l=>l.data))}};function Id(e){return e.length<=5?e:e.slice(0,5)}i(Id,"getFirstFiveOrAll");var Qe={phone_number:C.Dropdown({auth:V,description:"The phone number to send the message from",displayName:"From",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"connect your account first",options:[]};let t=e;return{disabled:!1,options:(await Te("GET","IncomingPhoneNumbers.json",{account_sid:t.username,auth_token:t.password})).body.incoming_phone_numbers.map(n=>({value:n.phone_number,label:n.friendly_name}))}},"options")})},Te=i(async(e,t,r,n)=>await Y.sendRequest({method:e,url:`https://api.twilio.com/2010-04-01/Accounts/${r.account_sid}/${t}`,authentication:{type:"BASIC",username:r.account_sid,password:r.auth_token},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n}),"callTwilioApi");var Ls=ae({auth:V,name:"send_sms",description:"Send a new SMS message",audience:"both",aiMetadata:{description:"Sends an SMS text message from a Twilio phone number to a recipient. Use to notify or message a person by text. Requires the destination number, message body, and a Twilio-owned sender number; sending costs money and delivers a separate message on every call, so it is not idempotent.",idempotent:!1},displayName:"Send SMS",props:{from:Qe.phone_number,body:C.ShortText({description:"The body of the message to send",displayName:"Message Body",required:!0}),to:C.ShortText({description:"The phone number to send the message to",displayName:"To",required:!0})},async run(e){let{body:t,to:r,from:n}=e.propsValue,o=e.auth.username,s=e.auth.password;return await Te("POST","Messages.json",{account_sid:o,auth_token:s},{From:n,Body:t,To:r})}});var Fs=ge({auth:V,name:"new_incoming_sms",displayName:"New Incoming SMS",description:"Triggers when a new SMS message is received",aiMetadata:{description:"Fires when an inbound SMS message is received on the specified Twilio phone number. Each event represents one incoming text message with its sender, body, and metadata."},props:{phone_number:Qe.phone_number},sampleData:{body:"Hello",num_segments:"1",direction:"inbound",from:"+12184191735",date_updated:"Wed, 08 Feb 2023 01:40:51 +0000",price:null,error_message:null,uri:"/2010-04-01/Accounts/ACc0ea1238d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63.json",account_sid:"ACc0ea716d61fe90d78a123a3de71d45619",num_media:"0",to:"+12184191735",date_created:"Wed, 08 Feb 2023 01:40:50 +0000",status:"failed",sid:"SM8c3920d3f2ac481ba83e639a69dadd63",date_sent:"Wed, 08 Feb 2023 01:40:51 +0000",messaging_service_sid:"MG88e323e6a88ce67ba3bf12e1bcb7e0b8",error_code:21211,price_unit:"USD",api_version:"2010-04-01",subresource_uris:{media:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Media.json",feedback:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Feedback.json"}},type:"POLLING",async onEnable(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=await Te("GET",`Messages.json?PageSize=20&To=${t}`,{account_sid:r,auth_token:n},{});await e.store.put("_new_incoming_sms_trigger",{lastMessageId:o.body.messages.length===0?null:o.body.messages[0].sid})},async onDisable(e){await e.store.put("_new_incoming_sms_trigger",null)},async run(e){let t=e.auth.username,r=e.auth.password,n=[],o=await e.store.get("_new_incoming_sms_trigger"),s=`2010-04-01/Accounts/${t}/Messages.json?PageSize=20&To=${e.propsValue.phone_number}`,c;for(;s!=null;){let l=await Y.sendRequest({method:"GET",url:`https://api.twilio.com/${s}`,authentication:{type:"BASIC",username:t,password:r}}),m=l.body.messages;!c&&m.length>0&&(c=m[0].sid),s=l.body.next_page_uri;for(let g=0;g<m.length;g++){let h=m[g];if(h.sid===o?.lastMessageId){s=null;break}h.direction==="inbound"&&n.push(h)}}return await e.store.put("_new_incoming_sms_trigger",{lastMessageId:c??o.lastMessageId}),n}});var Bs=ae({auth:V,name:"phone_number_lookup",description:"Lookup information about a phone number.",audience:"both",aiMetadata:{description:"Looks up carrier and line-type intelligence for a single phone number via the Twilio Lookup API. Use to validate or enrich a number (e.g. detect mobile vs landline, carrier) before messaging or calling it. Read-only and idempotent.",idempotent:!0},displayName:"Phone Number Lookup",props:{phone_number:C.ShortText({displayName:"Phone Number",required:!0})},async run(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password;return(await Y.sendRequest({method:"GET",url:`https://lookups.twilio.com/v2/PhoneNumbers/${encodeURIComponent(t)}`,authentication:{type:"BASIC",username:r,password:n},queryParams:{Fields:"line_type_intelligence"}})).body}});var Vs=ae({auth:V,name:"make_call",description:"Call a number and say a message.",audience:"both",aiMetadata:{description:"Places an outbound voice call from a Twilio number that reads a text-to-speech message to the recipient. Use to deliver a spoken notification or alert by phone. Requires both numbers in E.164 format and the message text; each call places a real, billable phone call, so it is not idempotent.",idempotent:!1},displayName:"Call Phone",props:{from:Qe.phone_number,to:C.ShortText({displayName:"To",description:"The phone number to call. Must be in E.164 format (e.g., +15558675310).",required:!0}),message:C.LongText({displayName:"Message to Say",description:"The text message to be converted to speech and spoken to the recipient.",required:!0}),voice:C.StaticDropdown({displayName:"Voice",description:"The voice to use for the text-to-speech message.",required:!1,options:{options:[{label:"Alice (Default)",value:"alice"},{label:"Man",value:"man"},{label:"Woman",value:"woman"}]}}),language:C.StaticDropdown({displayName:"Language",description:"The language to use for the text-to-speech message.",required:!1,options:{options:[{label:"English (US)",value:"en-US"},{label:"English (UK)",value:"en-GB"},{label:"Spanish",value:"es-ES"},{label:"French",value:"fr-FR"},{label:"German",value:"de-DE"}]}}),sendDigits:C.ShortText({displayName:"Send DTMF Tones",description:"A string of keys to dial after the call is connected. Use 'w' for a half-second pause.",required:!1}),timeout:C.Number({displayName:"Timeout (seconds)",description:"The number of seconds to let the phone ring before assuming no answer. Default is 60.",required:!1})},async run(e){let{from:t,to:r,message:n,voice:o,language:s,sendDigits:c,timeout:l}=e.propsValue,m=e.auth.username,g=e.auth.password,h=o?` voice="${o}"`:"",b=s?` language="${s}"`:"",x=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),u=`<Response><Say${h}${b}>${x}</Say></Response>`,d={From:t,To:r,Twiml:u};return c&&(d.SendDigits=c),l&&(d.Timeout=l),(await Te("POST","Calls.json",{account_sid:m,auth_token:g},d)).body}});var Zs=ae({auth:V,name:"get_message",description:"Retrieves the details of a specific message.",audience:"both",aiMetadata:{description:'Fetches the full details and status of a single Twilio message by its SID. Use to check delivery status or inspect a known message; requires the message SID (starting with "SM" or "MM"). Read-only and idempotent.',idempotent:!0},displayName:"Get Message",props:{message_sid:C.ShortText({displayName:"Message SID",description:'The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM".',required:!0})},async run(e){let{message_sid:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=`Messages/${t}.json`;return(await Te("GET",o,{account_sid:r,auth_token:n})).body}});var Hs=ae({auth:V,name:"download_recording_media",displayName:"Download Recording Media",description:"Download the media file for a specific recording.",audience:"both",aiMetadata:{description:'Downloads the audio file for a specific Twilio call recording by its SID, returning it as a file (MP3 or WAV). Use to retrieve recorded call audio for storage or further processing; requires the recording SID (starting with "RE"). Read-only and idempotent.',idempotent:!0},props:{recording_sid:C.ShortText({displayName:"Recording SID",description:'The unique identifier (SID) of the recording to download. It starts with "RE".',required:!0}),format:C.StaticDropdown({displayName:"Format",description:"The desired audio format for the download file.",required:!1,defaultValue:"mp3",options:{options:[{label:"MP3",value:"mp3"},{label:"WAV",value:"wav"}]}}),channels:C.StaticDropdown({displayName:"Channels",description:"Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings.",required:!1,options:{options:[{label:"Mono",value:1},{label:"Dual",value:2}]}})},async run(e){let{recording_sid:t,format:r,channels:n}=e.propsValue,o=e.auth.username,s=e.auth.password,c=r??"mp3",l=`Recordings/${t}.${c}`,m={};n&&(m.RequestedChannels=n.toString());let g=await Y.sendRequest({method:"GET",url:`https://api.twilio.com/2010-04-01/Accounts/${o}/${l}`,queryParams:m,authentication:{type:"BASIC",username:o,password:s},responseType:"arraybuffer"}),h=Buffer.from(g.body);return await e.files.write({fileName:`${t}.${c}`,data:h})}});var ir={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/IncomingPhoneNumbers.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.incoming_phone_numbers??[];for(let b of h){let x=new Date(b.date_created).getTime();if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Ws=ge({auth:V,name:"new_phone_number",displayName:"New Phone Number",description:"Triggers when you add a new phone number to your account.",aiMetadata:{description:"Fires when a new phone number is provisioned on the Twilio account. Each event represents one newly added incoming phone number with its capabilities and configuration."},props:{},sampleData:{sid:"PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",account_sid:"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",friendly_name:"(555) 123-4567",phone_number:"+15551234567",voice_url:"https://demo.twilio.com/welcome/voice/",voice_method:"POST",sms_url:"https://demo.twilio.com/welcome/sms/",sms_method:"POST",date_created:"2025-08-28T11:44:10+00:00",date_updated:"2025-08-28T11:44:10+00:00",capabilities:{voice:!0,sms:!0,mms:!0},uri:"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"},type:"POLLING",async onEnable(e){await J.onEnable(ir,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ir,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ir,e)},async run(e){return await J.poll(ir,e)}});var ar={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Recordings.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.recordings??[];for(let b of h){let x=new Date(b.date_created).getTime();if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Gs=ge({auth:V,name:"new_recording",displayName:"New Recording",description:"Triggers when a new call recording is completed and available.",aiMetadata:{description:"Fires when a new call recording becomes available on the Twilio account. Each event represents one completed recording, including its call SID, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2010-04-01",call_sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",conference_sid:"CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",channels:1,date_created:"Fri, 14 Oct 2016 21:56:34 +0000",date_updated:"Fri, 14 Oct 2016 21:56:38 +0000",start_time:"Fri, 14 Oct 2016 21:56:34 +0000",price:"0.04",price_unit:"USD",duration:"4",sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",source:"StartConferenceRecordingAPI",status:"completed",error_code:null,uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",subresource_uris:{add_on_results:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"},encryption_details:{encryption_public_key_sid:"CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",encryption_cek:"OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",encryption_iv:"8I2hhNIYNTrwxfHk"},media_url:"http://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},type:"POLLING",async onEnable(e){await J.onEnable(ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ar,e)},async run(e){return await J.poll(ar,e)}});var sr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Transcriptions.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.transcriptions??[];for(let b of h){let x=new Date(b.date_created).getTime();if(b.status==="completed")if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},qs=ge({auth:V,name:"new_transcription",displayName:"New Transcription",description:"Triggers when a new call recording transcription is completed.",aiMetadata:{description:"Fires when a call recording transcription reaches completed status on the Twilio account. Each event represents one finished transcription tied to a recording, including its transcribed text."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2008-08-01",date_created:"Thu, 25 Aug 2011 20:59:45 +0000",date_updated:"Thu, 25 Aug 2011 20:59:45 +0000",duration:"10",price:"0.00000",price_unit:"USD",recording_sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",sid:"TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",status:"completed",transcription_text:null,type:"fast",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"},type:"POLLING",async onEnable(e){await J.onEnable(sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(sr,e)},async run(e){return await J.poll(sr,e)}});var ur={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Calls.json?PageSize=${r?1:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.calls??[];for(let b of h){let x=new Date(b.date_created).getTime();if(b.status==="completed")if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Xs=ge({auth:V,name:"new_call",displayName:"New Call",description:"Triggers when a call completes (incoming or outgoing).",aiMetadata:{description:"Fires when a voice call reaches completed status on the Twilio account, for both inbound and outbound calls. Each event represents one finished call with its direction, participants, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",answered_by:"machine_start",api_version:"2010-04-01",caller_name:"callerid1",date_created:"Fri, 18 Oct 2019 17:00:00 +0000",date_updated:"Fri, 18 Oct 2019 17:01:00 +0000",direction:"outbound-api",duration:"4",end_time:"Fri, 18 Oct 2019 17:03:00 +0000",forwarded_from:"calledvia1",from:"+13051416799",from_formatted:"(305) 141-6799",group_sid:"GPdeadbeefdeadbeefdeadbeefdeadbeef",parent_call_sid:"CAdeadbeefdeadbeefdeadbeefdeadbeef",phone_number_sid:"PNdeadbeefdeadbeefdeadbeefdeadbeef",price:"-0.200",price_unit:"USD",sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",start_time:"Fri, 18 Oct 2019 17:02:00 +0000",status:"completed",subresource_uris:{notifications:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",recordings:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",payments:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",events:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",siprec:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",streams:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",user_defined_message_subscriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",user_defined_messages:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"},to:"+13051913581",to_formatted:"(305) 191-3581",trunk_sid:"TKdeadbeefdeadbeefdeadbeefdeadbeef",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",queue_time:"1000"},type:"POLLING",async onEnable(e){await J.onEnable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ur,e)},async run(e){return await J.poll(ur,e)}});var V=Zr.BasicAuth({description:"The authentication to use to connect to Twilio",required:!0,username:{displayName:"Account SID",description:"The account SID to use to connect to Twilio"},password:{displayName:"Auth token",description:"The auth token to use to connect to Twilio"}}),Ed=Ei({displayName:"Twilio",description:"Cloud communications platform for building SMS, Voice & Messaging applications",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/twilio.png",auth:V,categories:["COMMUNICATION"],actions:[Ls,Bs,Vs,Zs,Hs,js({baseUrl:i(()=>"https://api.twilio.com/2010-04-01","baseUrl"),auth:V,authMapping:i(async e=>({Authorization:`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}),"authMapping")})],authors:["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],triggers:[Fs,Ws,Gs,qs,Xs]});0&&(module.exports={twilio,twilioAuth});
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
mime-types/index.js:
|
|
7
|
+
(*!
|
|
8
|
+
* mime-types
|
|
9
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
10
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*)
|
|
13
|
+
*/
|
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":"AAcA,eAAO,MAAM,UAAU,4DAYrB,CAAC;AAEH,eAAO,MAAM,MAAM,4GAkCjB,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,qEAAwE;AACxE,iDAAqD;AACrD,oDAAsD;AACtD,qEAAsE;AACtE,0EAA2E;AAC3E,sDAAwD;AACxD,0DAA4D;AAC5D,oFAAqF;AACrF,qEAAsE;AACtE,+DAAiE;AACjE,uEAAyE;AACzE,qDAAuD;AAE1C,QAAA,UAAU,GAAG,4BAAS,CAAC,SAAS,CAAC;IAC5C,WAAW,EAAE,gDAAgD;IAE7D,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE;QACR,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,6CAA6C;KAC3D;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC,CAAC;AAEU,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EACT,gFAAgF;IAElF,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,IAAI,EAAE,kBAAU;IAChB,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,OAAO,EAAE;QACP,wBAAa;QACb,6CAAuB;QACvB,0BAAc;QACd,8BAAgB;QAChB,uDAA4B;QAC5B,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,mCAAmC;YAClD,IAAI,EAAE,kBAAU;YAChB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CACjC,GAAG,IAAI,CAAC,QAAQ,IACd,IAAI,CAAC,QACP,EAAE,CACH,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBACvB,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,OAAO,EAAE,CAAC,YAAY,EAAC,WAAW,EAAC,eAAe,EAAC,UAAU,CAAC;IAC9D,QAAQ,EAAE,CAAC,uCAAoB;QAC7B,uCAAoB;QACpB,kCAAkB;QAClB,0CAAsB;QACtB,wBAAa;KACd;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const twilioDownloadRecordingMedia: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").BasicAuthProperty, {
|
|
2
|
-
recording_sid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
format: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
4
|
-
channels: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=download-recording-media.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-recording-media.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/download-recording-media.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,4BAA4B;;;;EAqEvC,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.twilioDownloadRecordingMedia = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const __1 = require("../..");
|
|
8
|
-
exports.twilioDownloadRecordingMedia = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: __1.twilioAuth,
|
|
10
|
-
name: 'download_recording_media',
|
|
11
|
-
displayName: 'Download Recording Media',
|
|
12
|
-
description: 'Download the media file for a specific recording.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: { description: 'Downloads the audio file for a specific Twilio call recording by its SID, returning it as a file (MP3 or WAV). Use to retrieve recorded call audio for storage or further processing; requires the recording SID (starting with "RE"). Read-only and idempotent.', idempotent: true },
|
|
15
|
-
props: {
|
|
16
|
-
recording_sid: pieces_framework_1.Property.ShortText({
|
|
17
|
-
displayName: 'Recording SID',
|
|
18
|
-
description: 'The unique identifier (SID) of the recording to download. It starts with "RE".',
|
|
19
|
-
required: true,
|
|
20
|
-
}),
|
|
21
|
-
format: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
-
displayName: 'Format',
|
|
23
|
-
description: 'The desired audio format for the download file.',
|
|
24
|
-
required: false,
|
|
25
|
-
defaultValue: 'mp3',
|
|
26
|
-
options: {
|
|
27
|
-
options: [
|
|
28
|
-
{ label: 'MP3', value: 'mp3' },
|
|
29
|
-
{ label: 'WAV', value: 'wav' },
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
}),
|
|
33
|
-
channels: pieces_framework_1.Property.StaticDropdown({
|
|
34
|
-
displayName: 'Channels',
|
|
35
|
-
description: 'Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings.',
|
|
36
|
-
required: false,
|
|
37
|
-
options: {
|
|
38
|
-
options: [
|
|
39
|
-
{ label: 'Mono', value: 1 },
|
|
40
|
-
{ label: 'Dual', value: 2 },
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
},
|
|
45
|
-
run(context) {
|
|
46
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const { recording_sid, format, channels } = context.propsValue;
|
|
48
|
-
const account_sid = context.auth.username;
|
|
49
|
-
const auth_token = context.auth.password;
|
|
50
|
-
const fileFormat = format !== null && format !== void 0 ? format : 'mp3';
|
|
51
|
-
const path = `Recordings/${recording_sid}.${fileFormat}`;
|
|
52
|
-
const queryParams = {};
|
|
53
|
-
if (channels) {
|
|
54
|
-
queryParams['RequestedChannels'] = channels.toString();
|
|
55
|
-
}
|
|
56
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
57
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
58
|
-
url: `https://api.twilio.com/2010-04-01/Accounts/${account_sid}/${path}`,
|
|
59
|
-
queryParams: queryParams,
|
|
60
|
-
authentication: {
|
|
61
|
-
type: pieces_common_1.AuthenticationType.BASIC,
|
|
62
|
-
username: account_sid,
|
|
63
|
-
password: auth_token,
|
|
64
|
-
},
|
|
65
|
-
responseType: 'arraybuffer',
|
|
66
|
-
});
|
|
67
|
-
const fileData = Buffer.from(response.body);
|
|
68
|
-
return yield context.files.write({
|
|
69
|
-
fileName: `${recording_sid}.${fileFormat}`,
|
|
70
|
-
data: fileData,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=download-recording-media.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"download-recording-media.js","sourceRoot":"","sources":["../../../../src/lib/action/download-recording-media.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAsG;AACtG,6BAAmC;AAEtB,QAAA,4BAA4B,GAAG,IAAA,+BAAY,EAAC;IACvD,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,mDAAmD;IAChE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kQAAkQ,EAAE,UAAU,EAAE,IAAI,EAAE;IACjT,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,gFAAgF;YAC7F,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;YACnB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;oBAC9B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;iBAC/B;aACF;SACF,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,sHAAsH;YACnI,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACL,OAAO,EAAE;oBACL,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE;oBAC3B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE;iBAC9B;aACJ;SACJ,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC/D,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;YAEzC,MAAM,UAAU,GAAG,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,KAAK,CAAC;YACnC,MAAM,IAAI,GAAG,cAAc,aAAa,IAAI,UAAU,EAAE,CAAC;YAEzD,MAAM,WAAW,GAAgB,EAAE,CAAC;YACpC,IAAI,QAAQ,EAAE,CAAC;gBACX,WAAW,CAAC,mBAAmB,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAC3D,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAc;gBACzD,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,8CAA8C,WAAW,IAAI,IAAI,EAAE;gBACxE,WAAW,EAAE,WAAW;gBACxB,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,KAAK;oBAC9B,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,UAAU;iBACrB;gBACD,YAAY,EAAE,aAAa;aAC5B,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAE5C,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;gBAC/B,QAAQ,EAAE,GAAG,aAAa,IAAI,UAAU,EAAE;gBAC1C,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const twilioGetMessage: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").BasicAuthProperty, {
|
|
2
|
-
message_sid: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=get-message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/action/get-message.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;EA6B3B,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.twilioGetMessage = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const __1 = require("../..");
|
|
9
|
-
exports.twilioGetMessage = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: __1.twilioAuth,
|
|
11
|
-
name: 'get_message',
|
|
12
|
-
description: 'Retrieves the details of a specific message.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: { description: 'Fetches the full details and status of a single Twilio message by its SID. Use to check delivery status or inspect a known message; requires the message SID (starting with "SM" or "MM"). Read-only and idempotent.', idempotent: true },
|
|
15
|
-
displayName: 'Get Message',
|
|
16
|
-
props: {
|
|
17
|
-
message_sid: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Message SID',
|
|
19
|
-
description: 'The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM".',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
},
|
|
23
|
-
run(context) {
|
|
24
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const { message_sid } = context.propsValue;
|
|
26
|
-
const account_sid = context.auth.username;
|
|
27
|
-
const auth_token = context.auth.password;
|
|
28
|
-
const path = `Messages/${message_sid}.json`;
|
|
29
|
-
const response = yield (0, common_1.callTwilioApi)(pieces_common_1.HttpMethod.GET, path, { account_sid, auth_token });
|
|
30
|
-
return response.body;
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=get-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-message.js","sourceRoot":"","sources":["../../../../src/lib/action/get-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,sCAA0C;AAC1C,6BAAmC;AAEtB,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sNAAsN,EAAE,UAAU,EAAE,IAAI,EAAE;IACrQ,WAAW,EAAE,aAAa;IAC1B,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,sFAAsF;YACnG,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;YAEzC,MAAM,IAAI,GAAG,YAAY,WAAW,OAAO,CAAC;YAE5C,MAAM,QAAQ,GAAI,MAAM,IAAA,sBAAa,EACnC,0BAAU,CAAC,GAAG,EACd,IAAI,EACJ,EAAE,WAAW,EAAE,UAAU,EAAE,CAC5B,CAAC;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const twilioMakeCall: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").BasicAuthProperty, {
|
|
2
|
-
from: import("@activepieces/pieces-framework").DropdownProperty<any, true, import("@activepieces/pieces-framework").BasicAuthProperty>;
|
|
3
|
-
to: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
message: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
5
|
-
voice: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
-
language: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
7
|
-
sendDigits: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
timeout: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=make-call.d.ts.map
|