@activepieces/piece-hootsuite 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -12
- package/src/index.js +13 -39
- package/src/index.d.ts +0 -4
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/create-message.d.ts +0 -7
- package/src/lib/actions/create-message.d.ts.map +0 -1
- package/src/lib/actions/create-message.js +0 -97
- package/src/lib/actions/create-message.js.map +0 -1
- package/src/lib/actions/delete-message.d.ts +0 -4
- package/src/lib/actions/delete-message.d.ts.map +0 -1
- package/src/lib/actions/delete-message.js +0 -37
- package/src/lib/actions/delete-message.js.map +0 -1
- package/src/lib/actions/get-message.d.ts +0 -4
- package/src/lib/actions/get-message.d.ts.map +0 -1
- package/src/lib/actions/get-message.js +0 -48
- package/src/lib/actions/get-message.js.map +0 -1
- package/src/lib/auth.d.ts +0 -2
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -12
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -10
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -21
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/new-published-post.d.ts +0 -3
- package/src/lib/triggers/new-published-post.d.ts.map +0 -1
- package/src/lib/triggers/new-published-post.js +0 -79
- package/src/lib/triggers/new-published-post.js.map +0 -1
- package/src/lib/triggers/new-scheduled-post.d.ts +0 -3
- package/src/lib/triggers/new-scheduled-post.d.ts.map +0 -1
- package/src/lib/triggers/new-scheduled-post.js +0 -80
- package/src/lib/triggers/new-scheduled-post.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-hootsuite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.87.1",
|
|
14
|
-
"tslib": "2.6.2"
|
|
15
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
16
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hootsuiteAuth = exports.hootsuite = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(exports, "hootsuiteAuth", { enumerable: true, get: function () { return auth_1.hootsuiteAuth; } });
|
|
15
|
-
exports.hootsuite = (0, pieces_framework_1.createPiece)({
|
|
16
|
-
displayName: 'Hootsuite',
|
|
17
|
-
description: 'Social media management — schedule posts and manage multiple networks from one dashboard.',
|
|
18
|
-
minimumSupportedRelease: '0.36.1',
|
|
19
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/hootsuite.png',
|
|
20
|
-
categories: [shared_1.PieceCategory.MARKETING],
|
|
21
|
-
auth: auth_1.hootsuiteAuth,
|
|
22
|
-
authors: ['onyedikachi-david'],
|
|
23
|
-
actions: [
|
|
24
|
-
create_message_1.createMessageAction,
|
|
25
|
-
get_message_1.getMessageAction,
|
|
26
|
-
delete_message_1.deleteMessageAction,
|
|
27
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
28
|
-
baseUrl: () => 'https://platform.hootsuite.com/v1',
|
|
29
|
-
auth: auth_1.hootsuiteAuth,
|
|
30
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
return ({
|
|
32
|
-
Authorization: `Bearer ${auth.access_token}`,
|
|
33
|
-
});
|
|
34
|
-
}),
|
|
35
|
-
}),
|
|
36
|
-
],
|
|
37
|
-
triggers: [new_scheduled_post_1.newScheduledPostTrigger, new_published_post_1.newPublishedPostTrigger],
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var tu=Object.create;var Xe=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var nu=Object.getOwnPropertyNames;var ou=Object.getPrototypeOf,iu=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},vn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nu(t))!iu.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=ru(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?tu(ou(e)):{},xn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),au=e=>xn(Xe({},"__esModule",{value:!0}),e);var Vo=E((Bo,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"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],_,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(M=d-g,_=":";M--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let te=s.split(":"),ie=[];for(let Je=0;Je<te.length;Je++)ie.push(parseInt(te[Je],16));return ie})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let P={};P.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,M;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(M=m[_],g&&M!==0)return null;M!==8&&(g=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),P.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(s){return this.parser(s)!==null},P.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(s){return!!(P.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(s)||!d?!1:P.IPv4.isValidFourPartDecimal(d[1])},P.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},P.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let M=0;M<v.length;M++)g=v[M],_.push(x(g));return _})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(x(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},P.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new P.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),P.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},P.IPv6.isIPv6=function(s){return this.parser(s)!==null},P.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},P.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},P.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(s){let d,g,m,v,_,M;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+M,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.fromByteArray=function(s){let d=s.length;if(d===4)return new P.IPv4(s);if(d===16)return new P.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(s){return P.IPv6.isValid(s)||P.IPv4.isValid(s)},P.isValidCIDR=function(s){return P.IPv6.isValidCIDR(s)||P.IPv4.isValidCIDR(s)},P.parse=function(s){if(P.IPv6.isValid(s))return P.IPv6.parse(s);if(P.IPv4.isValid(s))return P.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(s){try{return P.IPv6.parseCIDR(s)}catch{try{return P.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},P.subnetMatch=function(s,d,g){let m,v,_,M;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(M=_[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return v}return g},typeof Zt<"u"&&Zt.exports?Zt.exports=P:e.ipaddr=P})(Bo)});var Zi=E((PA,Vi)=>{var Bi=require("stream").Stream,Bl=require("util");Vi.exports=se;function se(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(se,"DelayedStream");Bl.inherits(se,Bi);se.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(se.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});se.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};se.prototype.resume=function(){this._released||this.release(),this.source.resume()};se.prototype.pause=function(){this.source.pause()};se.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};se.prototype.pipe=function(){var e=Bi.prototype.pipe.apply(this,arguments);return this.resume(),e};se.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)};se.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 qi=E((bA,Wi)=>{var Vl=require("util"),Gi=require("stream").Stream,Hi=Zi();Wi.exports=W;function W(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(W,"CombinedStream");Vl.inherits(W,Gi);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof Hi)){var r=Hi.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};W.prototype.pipe=function(e,t){return Gi.prototype.pipe.call(this,e,t),this.resume(),e};W.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}};W.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=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.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()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.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")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.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)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ji=E((TA,Ki)=>{"use strict";Ki.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 Qi=E(ee=>{"use strict";var Xt=Ji(),Zl=require("path").extname,Xi=/^\s*([^;\s]*)(?:;|\s|$)/,Hl=/^text\//i;ee.charset=Yi;ee.charsets={lookup:Yi};ee.contentType=Gl;ee.extension=Wl;ee.extensions=Object.create(null);ee.lookup=ql;ee.types=Object.create(null);Kl(ee.extensions,ee.types);function Yi(e){if(!e||typeof e!="string")return!1;var t=Xi.exec(e),r=t&&Xt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Hl.test(t[1])?"UTF-8":!1}o(Yi,"charset");function Gl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ee.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ee.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Gl,"contentType");function Wl(e){if(!e||typeof e!="string")return!1;var t=Xi.exec(e),r=t&&ee.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Wl,"extension");function ql(e){if(!e||typeof e!="string")return!1;var t=Zl("x."+e).toLowerCase().substr(1);return t&&ee.types[t]||!1}o(ql,"lookup");function Kl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xt).forEach(o(function(i){var u=Xt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var h=r.indexOf(Xt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>x||h===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Kl,"populateMaps")});var ta=E(($A,ea)=>{ea.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)}o(Jl,"defer")});var qr=E((zA,na)=>{var ra=ta();na.exports=Xl;function Xl(e){var t=!1;return ra(function(){t=!0}),o(function(n,i){t?e(n,i):ra(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Xl,"async")});var Kr=E((kA,oa)=>{oa.exports=Yl;function Yl(e){Object.keys(e.jobs).forEach(Ql.bind(e)),e.jobs={}}o(Yl,"abort");function Ql(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Ql,"clean")});var Jr=E((RA,aa)=>{var ia=qr(),ep=Kr();aa.exports=tp;function tp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=rp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?ep(r):r.results[i]=c,n(u,r.results))})}o(tp,"iterate");function rp(e,t,r,n){var i;return e.length==2?i=e(r,ia(n)):i=e(r,t,ia(n)),i}o(rp,"runJob")});var Xr=E((DA,sa)=>{sa.exports=np;function np(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(np,"state")});var Yr=E((UA,ua)=>{var op=Kr(),ip=qr();ua.exports=ap;function ap(e){Object.keys(this.jobs).length&&(this.index=this.size,op(this),ip(e)(null,this.results))}o(ap,"terminator")});var la=E((LA,ca)=>{var sp=Jr(),up=Xr(),cp=Yr();ca.exports=lp;function lp(e,t,r){for(var n=up(e);n.index<(n.keyedList||e).length;)sp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return cp.bind(n,r)}o(lp,"parallel")});var Qr=E((FA,Yt)=>{var pa=Jr(),pp=Xr(),dp=Yr();Yt.exports=mp;Yt.exports.ascending=da;Yt.exports.descending=fp;function mp(e,t,r,n){var i=pp(e,r);return pa(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){pa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),dp.bind(i,n)}o(mp,"serialOrdered");function da(e,t){return e<t?-1:e>t?1:0}o(da,"ascending");function fp(e,t){return-1*da(e,t)}o(fp,"descending")});var fa=E((VA,ma)=>{var gp=Qr();ma.exports=yp;function yp(e,t,r){return gp(e,t,null,r)}o(yp,"serial")});var ya=E((HA,ga)=>{ga.exports={parallel:la(),serial:fa(),serialOrdered:Qr()}});var en=E((GA,ha)=>{"use strict";ha.exports=Object});var xa=E((WA,va)=>{"use strict";va.exports=Error});var _a=E((qA,Pa)=>{"use strict";Pa.exports=EvalError});var Ia=E((KA,ba)=>{"use strict";ba.exports=RangeError});var Ea=E((JA,Ta)=>{"use strict";Ta.exports=ReferenceError});var $a=E((XA,Sa)=>{"use strict";Sa.exports=SyntaxError});var Qt=E((YA,Aa)=>{"use strict";Aa.exports=TypeError});var Oa=E((QA,za)=>{"use strict";za.exports=URIError});var wa=E((ez,ka)=>{"use strict";ka.exports=Math.abs});var Na=E((tz,Ra)=>{"use strict";Ra.exports=Math.floor});var Ca=E((rz,Da)=>{"use strict";Da.exports=Math.max});var Ma=E((nz,Ua)=>{"use strict";Ua.exports=Math.min});var ja=E((oz,La)=>{"use strict";La.exports=Math.pow});var Ba=E((iz,Fa)=>{"use strict";Fa.exports=Math.round});var Za=E((az,Va)=>{"use strict";Va.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ga=E((uz,Ha)=>{"use strict";var hp=Za();Ha.exports=o(function(t){return hp(t)||t===0?t:t<0?-1:1},"sign")});var qa=E((lz,Wa)=>{"use strict";Wa.exports=Object.getOwnPropertyDescriptor});var tn=E((pz,Ka)=>{"use strict";var er=qa();if(er)try{er([],"length")}catch{er=null}Ka.exports=er});var Xa=E((dz,Ja)=>{"use strict";var tr=Object.defineProperty||!1;if(tr)try{tr({},"a",{value:1})}catch{tr=!1}Ja.exports=tr});var rn=E((mz,Ya)=>{"use strict";Ya.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ts=E((gz,es)=>{"use strict";var Qa=typeof Symbol<"u"&&Symbol,vp=rn();es.exports=o(function(){return typeof Qa!="function"||typeof Symbol!="function"||typeof Qa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vp()},"hasNativeSymbols")});var nn=E((hz,rs)=>{"use strict";rs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var on=E((vz,ns)=>{"use strict";var xp=en();ns.exports=xp.getPrototypeOf||null});var as=E((xz,is)=>{"use strict";var Pp="Function.prototype.bind called on incompatible ",_p=Object.prototype.toString,bp=Math.max,Ip="[object Function]",os=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Tp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Ep=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");is.exports=o(function(t){var r=this;if(typeof r!="function"||_p.apply(r)!==Ip)throw new TypeError(Pp+r);for(var n=Tp(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,os(n,arguments));return Object(x)===x?x:this}return r.apply(t,os(n,arguments))},"binder"),c=bp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Ep(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var He=E((_z,ss)=>{"use strict";var Sp=as();ss.exports=Function.prototype.bind||Sp});var rr=E((bz,us)=>{"use strict";us.exports=Function.prototype.call});var an=E((Iz,cs)=>{"use strict";cs.exports=Function.prototype.apply});var ps=E((Tz,ls)=>{"use strict";ls.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ms=E((Ez,ds)=>{"use strict";var $p=He(),Ap=an(),zp=rr(),Op=ps();ds.exports=Op||$p.call(zp,Ap)});var gs=E((Sz,fs)=>{"use strict";var kp=He(),wp=Qt(),Rp=rr(),Np=ms();fs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new wp("a function is required");return Np(kp,Rp,t)},"callBindBasic")});var _s=E((Az,Ps)=>{"use strict";var Dp=gs(),ys=tn(),vs;try{vs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var sn=!!vs&&ys&&ys(Object.prototype,"__proto__"),xs=Object,hs=xs.getPrototypeOf;Ps.exports=sn&&typeof sn.get=="function"?Dp([sn.get]):typeof hs=="function"?o(function(t){return hs(t==null?t:xs(t))},"getDunder"):!1});var Ss=E((Oz,Es)=>{"use strict";var bs=nn(),Is=on(),Ts=_s();Es.exports=bs?o(function(t){return bs(t)},"getProto"):Is?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Is(t)},"getProto"):Ts?o(function(t){return Ts(t)},"getProto"):null});var un=E((wz,$s)=>{"use strict";var Cp=Function.prototype.call,Up=Object.prototype.hasOwnProperty,Mp=He();$s.exports=Mp.call(Cp,Up)});var Ns=E((Rz,Rs)=>{"use strict";var U,Lp=en(),jp=xa(),Fp=_a(),Bp=Ia(),Vp=Ea(),Ke=$a(),qe=Qt(),Zp=Oa(),Hp=wa(),Gp=Na(),Wp=Ca(),qp=Ma(),Kp=ja(),Jp=Ba(),Xp=Ga(),ks=Function,cn=o(function(e){try{return ks('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=tn(),Yp=Xa(),ln=o(function(){throw new qe},"throwTypeError"),Qp=Pt?(function(){try{return arguments.callee,ln}catch{try{return Pt(arguments,"callee").get}catch{return ln}}})():ln,Ge=ts()(),X=Ss(),ed=on(),td=nn(),ws=an(),_t=rr(),We={},rd=typeof Uint8Array>"u"||!X?U:X(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&X?X([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jp,"%eval%":eval,"%EvalError%":Fp,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":ks,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&X?X(X([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!X?U:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Lp,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Bp,"%ReferenceError%":Vp,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!X?U:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&X?X(""[Symbol.iterator]()):U,"%Symbol%":Ge?Symbol:U,"%SyntaxError%":Ke,"%ThrowTypeError%":Qp,"%TypedArray%":rd,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":Zp,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":ws,"%Object.defineProperty%":Yp,"%Object.getPrototypeOf%":ed,"%Math.abs%":Hp,"%Math.floor%":Gp,"%Math.max%":Wp,"%Math.min%":qp,"%Math.pow%":Kp,"%Math.round%":Jp,"%Math.sign%":Xp,"%Reflect.getPrototypeOf%":td};if(X)try{null.error}catch(e){As=X(X(e)),De["%Error.prototype%"]=As}var As,nd=o(function e(t){var r;if(t==="%AsyncFunction%")r=cn("async function () {}");else if(t==="%GeneratorFunction%")r=cn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=cn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return De[t]=r,r},"doEval"),zs={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bt=He(),nr=un(),od=bt.call(_t,Array.prototype.concat),id=bt.call(ws,Array.prototype.splice),Os=bt.call(_t,String.prototype.replace),or=bt.call(_t,String.prototype.slice),ad=bt.call(_t,RegExp.prototype.exec),sd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ud=/\\(\\)?/g,cd=o(function(t){var r=or(t,0,1),n=or(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return Os(t,sd,function(u,c,l,f){i[i.length]=l?Os(f,ud,"$1"):c||u}),i},"stringToPath"),ld=o(function(t,r){var n=t,i;if(nr(zs,n)&&(i=zs[n],n="%"+i[0]+"%"),nr(De,n)){var u=De[n];if(u===We&&(u=nd(n)),typeof u>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Rs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(ad(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cd(t),i=n.length>0?n[0]:"",u=ld("%"+i+"%",r),c=u.name,l=u.value,f=!1,h=u.alias;h&&(i=h[0],id(n,od([0,1],h)));for(var x=1,I=!0;x<n.length;x+=1){var P=n[x],s=or(P,0,1),d=or(P,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((P==="constructor"||!I)&&(f=!0),i+="."+P,c="%"+i+"%",nr(De,c))l=De[c];else if(l!=null){if(!(P in l)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&x+1>=n.length){var g=Pt(l,P);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[P]}else I=nr(l,P),l=l[P];I&&!f&&(De[c]=l)}}return l},"GetIntrinsic")});var Cs=E((Dz,Ds)=>{"use strict";var pd=rn();Ds.exports=o(function(){return pd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ls=E((Uz,Ms)=>{"use strict";var dd=Ns(),Us=dd("%Object.defineProperty%",!0),md=Cs()(),fd=un(),gd=Qt(),ir=md?Symbol.toStringTag:null;Ms.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new gd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ir&&(n||!fd(t,ir))&&(Us?Us(t,ir,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ir]=r)},"setToStringTag")});var Fs=E((Lz,js)=>{"use strict";var yd=Function.prototype.call,hd=Object.prototype.hasOwnProperty,vd=He();js.exports=vd.call(yd,hd)});var Vs=E((jz,Bs)=>{"use strict";Bs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Gs=E((Fz,Hs)=>{"use strict";var fn=qi(),xd=require("util"),pn=require("path"),Pd=require("http"),_d=require("https"),bd=require("url").parse,Id=require("fs"),Td=require("stream").Stream,Ed=require("crypto"),dn=Qi(),Sd=ya(),$d=Ls(),ke=Fs(),mn=Vs();function Zs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Zs,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");xd.inherits(L,fn);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=fn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ke(t,"httpVersion"))&&!(t instanceof Td))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){ke(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Id.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ke(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Zs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&mn(c,r.header);var l;for(var f in c)if(ke(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=pn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=pn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=pn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Zs(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=dn.lookup(e.name)),!r&&e&&e.path&&(r=dn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=dn.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)ke(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="--------------------------"+Ed.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}Sd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=bd(e),n=mn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=mn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=_d.request(n):r=Pd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(h,x){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,x)},"callback");l=f.bind(this,null),r.on("error",f),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]"};$d(L.prototype,"FormData");Hs.exports=L});var Ld={};vn(Ld,{hootsuite:()=>Md,hootsuiteAuth:()=>Q});module.exports=au(Ld);var su=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=c.prototype,x=Object.keys(h);for(let I=0;I<x.length;I++){let P=x[I];P in l||(l[P]=h[P].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let h=r?.Parent?new u:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},cr={};function fe(e){return e&&Object.assign(cr,e),cr}o(fe,"config");function pr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(pr,"getEnumValues");function _n(e,t){return typeof t=="bigint"?t.toString():t}o(_n,"jsonStringifyReplacer");function St(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(St,"cached");function bn(e){return e==null}o(bn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var Pn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Pn)return n===void 0&&(n=Pn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var uu=St(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(In,"isPlainObject");var Tn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function At(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(At,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var Sn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Me(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Me,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function Et(e){return typeof e=="string"?e:e?.message}o(Et,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Et(e.inst?._zod.def?.error?.(e))??Et(t?.error?.(e))??Et(r.customError?.(e))??Et(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function $n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o($n,"getLengthableOrigin");function mr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(mr,"issue");var An=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,_n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=b("$ZodError",An),Qe=b("$ZodError",An,{Parent:Error});var lu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new ce;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,fe())));throw dr(l,i?.callee),l}return c.value},"_parse"),zt=lu(Qe),pu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,fe())));throw dr(l,i?.callee),l}return c.value},"_parseAsync"),Ot=pu(Qe),du=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new ce;return u.issues.length?{success:!1,error:new(e??zn)(u.issues.map(c=>Ie(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),et=du(Qe),mu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),tt=mu(Qe);var fu="(?:(?:\\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])))",gu=new RegExp(`^${fu}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),kn=/^-?\d+n?$/,wn=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var Te=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),yu={number:"number",bigint:"bigint",object:"date"};var Nn=b("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=yu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Dn=b("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Sn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=wn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Cn=b("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=$n(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var gr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Un=b("$ZodCheckRegex",(e,t)=>{gr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Ln={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ln;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let h=Me(c),x;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let P=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ce;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==P&&(h||(h=Me(c,P)))});else{if(c.issues.length===P)continue;h||(h=Me(c,P))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Me(c))return c.aborted=!0,c;let h=i(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new ce;return h.then(x=>e._zod.parse(x,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(x=>u(x,c,l)):u(h,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new ce;return f.then(h=>i(h,n,l))}return i(f,n,l)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=et(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return tt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),yr=b("$ZodStringFormat",(e,t)=>{gr.init(e,t),Rt.init(e,t)});var Zn=b("$ZodURL",(e,t)=>{yr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var hr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??fr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Hn=b("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),hr.init(e,t)}),vr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Rn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Gn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=kn,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 Wn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),qn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Kn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function jn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(jn,"handleArrayResult");var Xn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(h=>jn(h,r,c))):jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function hu(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=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(hu,"normalizeDef");function vu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,h=f.def.type,x=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(h==="never"){c.push(I);continue}let P=f.run({value:t[I],issues:[]},n);P instanceof Promise?e.push(P.then(s=>wt(s,r,I,t,x))):wt(P,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(vu,"handleCatchall");var Yn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=St(()=>hu(t));q(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let x=l[h]._zod;if(x.values){f[h]??(f[h]=new Set);for(let I of x.values)f[h].add(I)}}return f});let i=Ye,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let x=[],I=c.shape;for(let P of c.keys){let s=I[P],d=s._zod.optout==="optional",g=s._zod.run({value:h[P],issues:[]},f);g instanceof Promise?x.push(g.then(m=>wt(m,l,P,h,d))):wt(g,l,P,h,d)}return u?vu(x,h,l,f,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Fn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Me(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,fe())))}),t)}o(Fn,"handleUnionResults");var xr=b("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(f=>Fn(f,i,e,u)):Fn(l,i,e,u)}});var Qn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let h of f)i[l].add(h)}}return i});let n=St(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Ye(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!In(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...be(h,I.issues)),r.value[h]=I.value})):(x.issues.length&&r.issues.push(...be(h,x.issues)),r.value[h]=x.value)}let f;for(let h in i)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&fr.test(l)&&f.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Ie(I,n,fe())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...be(l,I.issues)),r.value[f.value]=I.value})):(x.issues.length&&r.issues.push(...be(l,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=pr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Tn.has(typeof i)).map(i=>typeof i=="string"?Ue(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ue(n):n?Ue(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var no=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Bn(u,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=b("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=b("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var so=b("$ZodCustom",(e,t)=>{Te.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Vn(u,r,n,e));Vn(i,r,n,e)}});function Vn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(mr(i))}}o(Vn,"handleRefineResult");var co;var Pr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function lo(){return new Pr}o(lo,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=lo());var _r=globalThis.__zod_globalRegistry;function po(e,t){return new e({type:"string",...V(t)})}o(po,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...V(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...V(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(xo,"_coercedBoolean");function Po(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(Po,"_coercedBigint");function _o(e){return new e({type:"any"})}o(_o,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function Io(e,t){return new e({type:"void",...V(t)})}o(Io,"_void");function To(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(To,"_coercedDate");function Nt(e,t){return new Nn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Nt,"_gte");function ae(e,t){return new Cn({check:"min_length",...V(t),minimum:e})}o(ae,"_minLength");function Ee(e,t){return new Un({check:"string_format",format:"regex",...V(t),pattern:e})}o(Ee,"_regex");function Eo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>At(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ct=b("ZodMiniString",(e,t)=>{Rt.init(e,t),K.init(e,t)});function a(e){return po(Ct,e)}o(a,"string");var So=b("ZodMiniStringFormat",(e,t)=>{yr.init(e,t),Ct.init(e,t)});var ku=b("ZodMiniURL",(e,t)=>{Zn.init(e,t),So.init(e,t)});function $o(e){return fo(ku,e)}o($o,"url");var Ut=b("ZodMiniNumber",(e,t)=>{hr.init(e,t),K.init(e,t)});function Y(e){return go(Ut,e)}o(Y,"number");var wu=b("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),Ut.init(e,t)});function Ao(e){return ho(wu,e)}o(Ao,"int");var br=b("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function F(e){return vo(br,e)}o(F,"boolean");var zo=b("ZodMiniBigInt",(e,t)=>{Gn.init(e,t),K.init(e,t)});var Ru=b("ZodMiniAny",(e,t)=>{Wn.init(e,t),K.init(e,t)});function nt(){return _o(Ru)}o(nt,"any");var Nu=b("ZodMiniUnknown",(e,t)=>{qn.init(e,t),K.init(e,t)});function O(){return bo(Nu)}o(O,"unknown");var Du=b("ZodMiniVoid",(e,t)=>{Kn.init(e,t),K.init(e,t)});function Oo(e){return Io(Du,e)}o(Oo,"_void");var ko=b("ZodMiniDate",(e,t)=>{Jn.init(e,t),K.init(e,t)});var Cu=b("ZodMiniArray",(e,t)=>{Xn.init(e,t),K.init(e,t)});function R(e,t){return new Cu({type:"array",element:e,...V(t)})}o(R,"array");var Uu=b("ZodMiniObject",(e,t)=>{Yn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Uu(r)}o(p,"object");var Mu=b("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Mu({type:"union",options:e,...V(t)})}o(N,"union");var Lu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),K.init(e,t)});function Se(e,t,r){return new Lu({type:"union",options:t,discriminator:e,...V(r)})}o(Se,"discriminatedUnion");var ju=b("ZodMiniRecord",(e,t)=>{eo.init(e,t),K.init(e,t)});function k(e,t,r){return new ju({type:"record",keyType:e,valueType:t,...V(r)})}o(k,"record");var Fu=b("ZodMiniEnum",(e,t)=>{to.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function C(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Fu({type:"enum",entries:r,...V(t)})}o(C,"_enum");var Bu=b("ZodMiniLiteral",(e,t)=>{ro.init(e,t),K.init(e,t)});function S(e,t){return new Bu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var Vu=b("ZodMiniTransform",(e,t)=>{no.init(e,t),K.init(e,t)});function $e(e){return new Vu({type:"transform",transform:e})}o($e,"transform");var Zu=b("ZodMiniOptional",(e,t)=>{oo.init(e,t),K.init(e,t)});function y(e){return new Zu({type:"optional",innerType:e})}o(y,"optional");var Hu=b("ZodMiniNullable",(e,t)=>{io.init(e,t),K.init(e,t)});function ot(e){return new Hu({type:"nullable",innerType:e})}o(ot,"nullable");var Gu=b("ZodMiniPipe",(e,t)=>{ao.init(e,t),K.init(e,t)});function Ae(e,t){return new Gu({type:"pipe",in:e,out:t})}o(Ae,"pipe");var Wu=b("ZodMiniCustom",(e,t)=>{so.init(e,t),K.init(e,t)});function Mt(e,t){return Eo(Wu,e??(()=>!0),t)}o(Mt,"custom");var it={};vn(it,{bigint:()=>Qu,boolean:()=>Yu,date:()=>ec,number:()=>Xu,string:()=>Ju});function Ju(e){return mo(Ct,e)}o(Ju,"string");function Xu(e){return yo(Ut,e)}o(Xu,"number");function Yu(e){return xo(br,e)}o(Yu,"boolean");function Qu(e){return Po(zo,e)}o(Qu,"bigint");function ec(e){return To(ko,e)}o(ec,"date");var Tr=p({retryOnFailure:p({defaultValue:y(F()),hide:y(F())}),continueOnFailure:p({defaultValue:y(F()),hide:y(F())})}),Ir=class{constructor(t,r,n,i,u,c,l,f,h,x,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=x;this.aiMetadata=I}static{o(this,"IAction")}},ze=o(e=>new Ir(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var j=p({displayName:a(),description:y(a())}),D=o((e,t)=>p({type:S(t),required:F(),defaultValue:y(nt())}),"TPropertyValue");var re=p({...j.shape,...D(a(),"SHORT_TEXT").shape}),ge=p({...j.shape,...D(a(),"LONG_TEXT").shape});var Ro=p({label:a(),value:O()}),Lt=p({disabled:y(F()),placeholder:y(a()),options:R(Ro)});var ne=p({...j.shape,options:Lt,...D(O(),"STATIC_DROPDOWN").shape}),ye=p({...j.shape,options:Lt,...D(R(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=p({...j.shape,...D(O(),"DROPDOWN").shape,refreshers:R(a())}),at=p({...j.shape,...D(R(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var he=p({...j.shape,...D(F(),"CHECKBOX").shape});var ve=p({...j.shape,...D(Y(),"NUMBER").shape});var st=p({...j.shape,streaming:y(F()),...D(O(),"FILE").shape});var ut=p({...j.shape,...D(a(),"DATE_TIME").shape});var No=k(a(),N([re,ge,ne,at,ye,he,ve,st,ut])),ct=p({...j.shape,properties:No,...D(R(O()),"ARRAY").shape});var lt=p({...j.shape,...D(N([k(a(),O())]),"JSON").shape});var Do=N([re,ne,lt,ct,ye]),rc=k(a(),Do),Sr=p({refreshers:R(a()),...j.shape,...D(O(),"DYNAMIC").shape});var jt=p({...j.shape,...D(Oo(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),je=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(je||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),$r="both_client_credentials_and_authorization_code";var xe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(xe||{}),mt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(mt||{}),nc=p({strategy:C(mt),paramName:y(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Co=p({status:y(Y()),body:y(O()),headers:y(k(a(),a()))}),Uo=p({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(C(Ft))}),Mo=p({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Co,handlerId:y(a()),streamStepProgress:y(C(Ft))}),oc=N([Uo,Mo]);var ic=p({body:O(),rawBody:y(O()),headers:k(a(),a()),queryParams:k(a(),a())});function J(e){return e==null}o(J,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var Ar=Ce(require("crypto"),1);var ac=128,we,Fe,sc=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*ac),Ar.default.randomFillSync(we),Fe=0):Fe+e>we.length&&(Ar.default.randomFillSync(we),Fe=0),Fe+=e},"fillPool"),uc=o(e=>(sc(e|=0),we.subarray(Fe-e,Fe)),"random"),cc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),jo=o((e,t=21)=>cc(e,t,uc),"customAlphabet");var lc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fo=21,Pb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Fo}}$`))),pc=jo(lc,Fo);var Oe=Ae($e(e=>e instanceof Date?e.toISOString():e),a()),oe={id:a(),created:Oe,updated:Oe},Z=o(e=>y(ot(e)),"Nullable");function zr(e){return y(ot(C(e)))}o(zr,"NullableEnum");var Ib=Ae($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(F())),Vt=o(e=>Ae($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(R(e))),"OptionalArrayFromQuery");var Sb=k(a(),O());var yt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(yt||{});var Mb=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var jb=p({filename:a(),data:O(),type:S("file"),mimetype:y(a())});var dc=Ce(Vo());var Wb=p({...oe,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:y(Y())});var Zo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Zo||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),kr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(kr||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var Rr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Rr||{});var mc=p({mode:C(Zo),value:O()}),fc=p({auth:y(a()),fields:k(a(),mc)}),gc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(fc)}),yc=p({type:S("PIECE"),toolName:a().check(ae(1)),pieceMetadata:gc}),hc=p({type:S("none")}),vc=p({type:S("access_token"),accessToken:a()}),xc=p({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Pc=p({type:S("headers"),headers:k(a(),a())}),_c=Se("type",[hc,vc,xc,Pc]),Ho=p({type:S("FLOW"),toolName:a().check(ae(1)),externalFlowId:a(),flowDisplayName:y(a())}),Go=p({type:S("MCP"),toolName:a().check(ae(1)),serverUrl:$o(),protocol:C(kr),auth:_c}),Wo=p({type:S("KNOWLEDGE_BASE"),toolName:a().check(ae(1)),sourceType:C(Or),sourceId:a(),sourceName:a()}),bc=Se("type",[yc,Ho,Go,Wo]),Ic=p({displayName:a(),description:y(a()),type:C(wr)}),qo=p({type:S("MARKDOWN"),markdown:a()}),Be={type:S("TOOL_CALL"),input:Z(k(a(),O())),output:y(O()),toolName:a(),status:C(Rr),toolCallId:a(),startTime:a(),endTime:y(a())},TI=p(Be),Ko=Se("toolCallType",[p({...Be,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Be,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),p({...Be,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),p({...Be,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Be,toolCallType:S("UNKNOWN"),displayName:a()})]),Tc=N([qo,Ko]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),Pe=p({apiKey:a()}),Ec=Pe,Sc=p({apiKey:a(),apiKeyHash:a()}),$c=Pe,Ac=Pe,zc=Pe,Oc=Pe,kc=Pe,wc=Pe,Rc=Pe,ei=p({accessKeyId:a().check(ae(1)),secretAccessKey:a().check(ae(1))}),Nc=p({}),Dc=p({}),Cc=p({}),Uc=p({}),Mc=p({}),Lc=p({}),ti=p({modelId:a(),modelName:a(),modelType:C(Nr)}),ri=p({apiKeyHeader:a(),baseUrl:a(),models:R(ti),defaultHeaders:y(k(a(),a()))}),ni=p({accountId:a(),gatewayId:a(),models:R(ti),vertexProject:y(a()),vertexRegion:y(a())}),oi=p({resourceName:a(),apiVersion:Ae($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),ii=p({region:a().check(ae(1))}),jc=N([Ec,zc,Oc,kc,wc,Ac,$c,Sc,ei,Rc]),ai=N([ri,ni,oi,ii,Nc,Cc,Uc,Mc,Dc,Lc]),Fc=p({id:a(),name:a(),type:C(Nr)}),Bc=p({id:a(),name:a(),provider:C(yt),config:ai,enabledForChat:F()}),Vc=p({provider:C(yt),config:ai,auth:jc,platformId:a()});var AI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Zc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Hc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Gc=["grok-4.20","grok-4.1-fast"],Wc={openai:Jo,anthropic:Zc,google:Xo,activepieces:[...Hc.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...Gc.map(e=>`x-ai/${e}`)]};var Yo=128e3,qc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Kc({provider:e}){return e?qc[e]??Yo:Yo}o(Kc,"getMaxContextTokens");var Qo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Jc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Xc=new Set(["anthropic","mistral"]);function le(e){return{chatModels:Wc[e],maxContextTokens:Kc({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!Xc.has(e),webSearch:Jc[e]}}o(le,"buildProviderCapabilities");var Yc={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var Qc=p({base64Url:a(),fileName:a(),extension:y(a())}),el=p({mimeType:a(),url:a(),fileName:y(a())}),Dr=N([Qc,el]);var tl=N([p({type:S("file"),value:Dr}),p({type:S("markdown"),value:a(),files:y(R(Dr))})]),rl=p({sessionId:a(),message:a(),files:y(R(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var nl=N([p({...oe,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...oe,name:a(),externalId:a(),type:N([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),ol=p({...oe,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:zr(ci),trigger:zr(ui)}),il=p({...oe,tableId:a(),projectId:a(),cells:k(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),al=p({events:R(C(Cr)),webhookUrl:a(),flowId:a()}),sl=p({fields:R(p({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),ul=p({projectId:a(),limit:y(it.number()),cursor:y(a()),name:y(a()),externalIds:Vt(a()),folderId:y(a()),folderIds:Vt(a())}),cl=p({records:R(R(p({fieldId:a(),value:pi()}))),tableId:a()}),ll=p({cells:y(R(p({fieldId:a(),value:pi()}))),tableId:a(),agentUpdate:y(F())}),li=Se("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),si("exists"),si("not_exists")]),pl=p({tableId:a(),limit:y(it.number()),cursor:y(a()),filters:Vt(li)});function pi(){return Ae($e(e=>e==null?e:String(e)),ot(a()))}o(pi,"coerceToString");function Re(e){return p({fieldId:a(),operator:S(e),value:a()})}o(Re,"valueFilter");function si(e){return p({fieldId:a(),operator:S(e)})}o(si,"existenceFilter");var dl=p({status:y(Y()),body:y(O()),headers:y(k(a(),a()))}),ml=p({...oe,deleted:Z(Oe),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var di=p({name:a(),description:y(a()),type:a(),required:F()}),fl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(di),returnsResponse:F()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",WI=new RegExp(mi),yl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",qI=a().check(Ee(new RegExp(mi))),KI=a().check(Ee(new RegExp(yl))),hl=p({packageType:S("ARCHIVE"),pieceType:C(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=p({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=p({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),JI=N([fi,gi]),XI=N([hl,fi,gi]);var vl=Se("type",[p({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:S("INTERVAL"),intervalMs:Ao().check(Nt(6e4))})]),YI=p({...oe,type:C(xe),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(vl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:F()}),yi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),QI=p({...oe,projectId:Z(a()),platformId:Z(a()),type:C(yi),compression:C(hi),data:y(O()),location:C(vi),size:Z(Y()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(k(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),Pi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Pi||{}),eT=p({id:a(),email:a(),firstName:a(),status:C(Pi),externalId:Z(a()),platformId:Z(a()),platformRole:C(xi),lastName:a(),created:Oe,updated:Oe,lastActiveDate:Z(Oe),imageUrl:Z(a())});var Ur=p({...j.shape,...D(k(a(),O()),"OBJECT").shape});var Ti=p({...j.shape,...D(a(),"COLOR").shape});var Mr=N([re,ge,jt,he,ne,ye,Er,at,Sr,ve,ct,Ur,lt,ut,st,Ti]),B={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 pe=p({displayName:a(),description:y(a())});var Ei=p({username:a(),password:a()}),Lr=p({...pe.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...D(Ei,"BASIC_AUTH").shape});var bl=k(a(),N([re,ge,ve,he,ne])),jr=p({...pe.shape,props:bl,...D(O(),"CUSTOM_AUTH").shape});var Ne=p({...pe.shape,...D(p({auth:a()}),"SECRET_TEXT").shape});var Il=k(a(),N([re,ge,Ne,ve,he,ne,ye,jt])),Si=p({...pe.shape,props:Il,...D(O(),"OIDC").shape});var Fr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Fr||{}),$i=N([re,Ne,ne]),Ai=k(a(),$i),Tl=p({props:y(k(a(),$i)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:y(N([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(F()),pkceMethod:y(N([S("plain"),S("S256")])),authorizationMethod:y(C(Fr)),grantType:y(N([C(dt),S($r)])),extra:y(k(a(),a()))}),zi=p({access_token:a(),props:y(Ai),data:k(a(),nt())}),Br=p({...pe.shape,...Tl.shape,...D(zi,"OAUTH2").shape});var Ve=N([Lr,jr,Si,Br,Ne]),ht="Connection",Vr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var wE={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 El=p({...j.shape,...D(O(),"CUSTOM").shape,code:a()});var Sl=N([Mr,Ve]),Zr=k(a(),Sl),YE=k(a(),Mr);var Oi=N([p({strategy:S("CRON"),cronExpression:a()}),p({strategy:S("NONE")})]),Ze=class{constructor(t,r,n,i,u,c,l,f,h,x,I,P,s,d,g,m,v,_,M){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=x;this.onEnable=I;this.onDisable=P;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=_;this.aiMetadata=M}static{o(this,"ITrigger")}},Ht=o(e=>{switch(e.type){case"WEBHOOK":return new Ze(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 Ze(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 Ze(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 Ze(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,J(e.sampleData)&&J(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var ki="2",Gt="0.82.0";var Hr=class{constructor(t,r,n,i,u,c,l,f,h=Gt,x,I="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=I;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:ki}),"getContextInfo");(!$l(h)||Al(h,Gt))&&(this.minimumSupportedRelease=Gt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Hr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function $l(e){return/^\d+\.\d+\.\d+$/.test(e)}o($l,"isValidSimpleSemver");function Al(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Al,"isSemverLessThan");var zl=y(k(a(),k(a(),a()))),Ri=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:y(a()),directoryPath:y(a()),auth:y(N([Ve,R(Ve)])),version:a(),categories:y(R(C(je))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(F()),i18n:zl}),Ol=C(["human","ai","both"]),Ni=p({description:y(a()),idempotent:y(F())}),Di=p({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:F(),errorHandlingOptions:y(Tr),outputSchema:y(Mt()),audience:y(Ol),aiMetadata:y(Ni)}),Ci=p({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:y(Tr),type:C(xe),sampleData:O(),handshakeConfiguration:y(Mt()),renewConfiguration:y(Oi),testStrategy:C(ft),outputSchema:y(Mt()),aiMetadata:y(Ni)}),kl=p({...Ri.shape,actions:k(a(),Di),triggers:k(a(),Ci)}),wl=p({...Ri.shape,actions:Y(),triggers:Y(),suggestedActions:y(R(Di)),suggestedTriggers:y(R(Ci))}),Ui=p({projectUsage:Y(),pieceType:C(Le),packageType:C(pt),platformId:y(a()),archiveId:y(a())}),YS=p({...kl.shape,...Ui.shape}),QS=p({...wl.shape,...Ui.shape}),e$=p({name:a(),version:a()});var Rl=Ce(require("path")),Nl=Ce(require("fs/promises"));var Fi=require("node:stream");var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Gr,r=new Wr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Gr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Wr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var vt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Mi({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Mi,"toFailsafeOutput");var xt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(xt||{});var Kt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new qt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,te]of Object.entries(c))i.append(M,te);let l=i.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:P,extraHeaders:s,isStream:d}=Dl(t.method)?Cl(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=Ml({...u,...s}),m=await Ul(async()=>{let M=new AbortController,te=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ie={method:t.method.toString(),headers:g,body:P,redirect:x?"follow":"manual",signal:M.signal};return d&&(ie.duplex="half"),r?.dispatcher!==void 0&&(ie.dispatcher=r.dispatcher),await fetch(f,ie)}finally{te!==void 0&&clearTimeout(te)}},I),v=x?300:400;if(m.status<200||m.status>=v){let M=await Li(m,h),te=new vt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",te),te}let _=await Li(m,h);return{status:m.status,headers:Ll(m.headers),body:_}}};function Dl(e){return e!=="GET"&&e!=="HEAD"}o(Dl,"acceptsRequestBody");function Cl(e,t){if(Fl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(jl(e)){let n=new Fi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Cl,"serializeBody");async function Li(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Li,"parseResponseBody");async function Ul(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await ji(n);continue}return i}catch(i){if(r=i,n<t){await ji(n);continue}throw i}throw r}o(Ul,"sendWithRetries");function ji(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(ji,"backoff");function Ml(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Ml,"normalizeHeaders");function Ll(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Ll,"toHttpHeaders");function jl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(jl,"isNodeFormData");function Fl(e){return e==null}o(Fl,"isNil");var Jt=new Kt;var Ad=Ce(require("fs")),Ws=Ce(Gs());var zd={"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 Od(e){let t=e.split(";")[0].trim().toLowerCase();return zd[t]??""}o(Od,"contentTypeToExtension");var kd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),wd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function qs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return ze({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:B.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:B.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${wd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:B.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(xt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:B.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:B.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:B.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:B.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,I={};switch(x){case"none":break;case"json":I.data=B.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=B.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=B.Array({displayName:"Form Data",required:!0,properties:{fieldName:B.ShortText({displayName:"Field Name",required:!0}),fieldType:B.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:B.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:B.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:B.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:B.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:B.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:B.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:x,url:I,headers:P,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:M}=h.propsValue;Bt(x,"Method"),Bt(I,"URL");let te=J(r)?{}:await r(h.auth,h.propsValue),ie=I.url,Je=ie.startsWith("http://")||ie.startsWith("https://")?ie:kd({baseUrl:t(h.auth),relativePath:ie}),_e={method:x,url:Je,headers:{...P??{},...f==="headers"||!J(f)?te:{}},queryParams:{...f==="queryParams"?te:{},...s??{}},timeout:v?v*1e3:0,followRedirects:M};if(_&&(_e.responseType="arraybuffer"),d)if(g&&g!=="none"){let me=d.data;if(g==="form_data"){let eu=me,It=new Ws.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:ur}of eu)yn==="text"&&!gt(hn)?It.append(gn,hn):yn==="file"&&!gt(ur)&&It.append(gn,ur.data,{filename:ur?.filename});_e.body=It,_e.headers={..._e.headers,...It.getHeaders()}}else _e.body=me}else g||(_e.body=d);try{let me=await Jt.sendRequest(_e);return await Rd(h.files,me.body,me.status,me.headers,_)}catch(me){if(m)return Mi({error:me,requestBody:_e.body});throw me}},"run")})}o(qs,"createCustomApiCallAction");var Rd=o(async(e,t,r,n,i)=>{let u;if(i&&Nd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Od(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Nd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var de={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(J(l))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),h=f.reduce((x,I)=>Math.max(x,I.epochMilliSeconds),l);return await t.put("lastPoll",h),f.filter(x=>x.epochMilliSeconds>l).map(x=>x.data)}case 1:{let l=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:u,server:c}),h=f.findIndex(P=>P.id===l),x=[];J(l)||h==-1?x=f??[]:x=f?.slice(0,h)??[],J(i)||(x=x.slice(-i));let I=x?.[0]?.id;return J(I)||await t.put("lastItem",I),x.map(P=>P.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;J(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:u}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:u});break}}return Dd(c.map(l=>l.data))}};function Dd(e){return e.length<=5?e:e.slice(0,5)}o(Dd,"getFirstFiveOrAll");var Q=Vr.OAuth2({description:"Connect your Hootsuite account. Create an OAuth2 app and get your client credentials at https://developer.hootsuite.com.",required:!0,authUrl:"https://platform.hootsuite.com/oauth2/auth",tokenUrl:"https://platform.hootsuite.com/oauth2/token",scope:["offline","post"]});var Cd="https://platform.hootsuite.com/v1";async function ue({auth:e,method:t,path:r,body:n,queryParams:i}){return Jt.sendRequest({method:t,url:`${Cd}${r}`,authentication:{type:"BEARER_TOKEN",token:e.access_token},body:n,queryParams:i})}o(ue,"hootsuiteApiCall");var Ks=ze({auth:Q,name:"create_message",displayName:"Schedule Post",description:"Schedules or immediately publishes a post to one or more social media profiles.",audience:"both",aiMetadata:{description:"Publishes a post to one or more connected Hootsuite social profiles, either immediately or scheduled for a future time depending on whether a scheduled time is provided (leave it empty to post now; a future time must be at least 5 minutes ahead and in UTC). Use to create and distribute social media content across networks. Not idempotent: each call creates a new post, so repeating it produces duplicate posts. Requires the target social profile IDs and the post text.",idempotent:!1},props:{socialProfileIds:B.MultiSelectDropdown({displayName:"Social Profiles",description:"Select the social media profiles to post to.",refreshers:[],required:!0,auth:Q,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your Hootsuite account first"};try{return{disabled:!1,options:(await ue({auth:e,method:"GET",path:"/socialProfiles"})).body.data.map(r=>({label:`${r.socialNetworkUsername??r.id} (${r.type})`,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load profiles. Check your connection."}}},"options")}),text:B.LongText({displayName:"Post Text",description:"The text content of your post.",required:!0}),scheduledSendTime:B.DateTime({displayName:"Scheduled Time",description:"When to publish the post (UTC, must be at least 5 minutes in the future). Leave empty to post immediately.",required:!1}),emailNotification:B.Checkbox({displayName:"Email Notification",description:"Send an email notification when the post is published.",required:!1,defaultValue:!1})},async run(e){let{socialProfileIds:t,text:r,scheduledSendTime:n,emailNotification:i}=e.propsValue,u={text:r,socialProfileIds:t,emailNotification:i};n&&(u.scheduledSendTime=new Date(n).toISOString());let l=(await ue({auth:e.auth,method:"POST",path:"/messages",body:u})).body.data;return{id:l.id,state:l.state,scheduled_send_time:l.scheduledSendTime??null,text:l.text??r,social_profile_ids:(l.socialProfileIds??t).join(", "),post_url:l.postUrl??null,errors:l.errors??[]}}});var Js=ze({auth:Q,name:"get_message",displayName:"Get Post Details",description:"Retrieves the details of a specific scheduled or published post by its ID.",audience:"both",aiMetadata:{description:"Looks up a single Hootsuite post by its ID and returns its current details and state (e.g. scheduled, sent, errored). Use to inspect or confirm a post created earlier or referenced from the dashboard. Idempotent read-only lookup. Requires the post ID, obtainable from a Schedule Post output or the Hootsuite dashboard URL.",idempotent:!0},props:{messageId:B.ShortText({displayName:"Post ID",description:'The unique ID of the post. You can get this from a previous "Schedule Post" action output or from the Hootsuite dashboard URL.',required:!0})},async run(e){let r=(await ue({auth:e.auth,method:"GET",path:`/messages/${e.propsValue.messageId}`})).body.data;return{id:r.id,state:r.state,text:r.text??null,scheduled_send_time:r.scheduledSendTime??null,send_time:r.sendTime??null,social_profile_ids:(r.socialProfileIds??[]).join(", "),post_url:r.postUrl??null,tags:r.tags??[],email_notification:r.emailNotification??null,location:r.location??null,errors:r.errors??[]}}});var Xs=ze({auth:Q,name:"delete_message",displayName:"Delete Post",description:"Permanently deletes a post. Only posts in a deletable state (e.g. SCHEDULED) can be removed.",audience:"both",aiMetadata:{description:"Permanently deletes a Hootsuite post by its ID. Use to cancel or remove a scheduled post before it sends. Only posts in a deletable state (e.g. SCHEDULED) can be removed; already-sent posts cannot. Not idempotent: the first call removes the post and subsequent calls with the same ID will fail since it no longer exists.",idempotent:!1},props:{messageId:B.ShortText({displayName:"Post ID",description:'The unique ID of the post to delete. You can get this from the "Schedule Post" or "Get Post Details" action.',required:!0})},async run(e){return await ue({auth:e.auth,method:"DELETE",path:`/messages/${e.propsValue.messageId}`}),{success:!0,deleted_message_id:e.propsValue.messageId}}});var ar={strategy:1,items:o(async({auth:e})=>((await ue({auth:e,method:"GET",path:"/messages",queryParams:{state:"SCHEDULED",limit:"50"}})).body.data??[]).sort((r,n)=>new Date(n.scheduledSendTime).getTime()-new Date(r.scheduledSendTime).getTime()).map(r=>({id:r.id,data:{id:r.id,state:r.state,scheduled_send_time:r.scheduledSendTime,text:r.text??null,social_profile_ids:(r.socialProfileIds??[]).join(", ")}})),"items")},Ys=Ht({auth:Q,name:"new_scheduled_post",displayName:"New Scheduled Post",description:"Triggers when a new post is scheduled in Hootsuite.",aiMetadata:{description:"Fires when a new post enters the SCHEDULED state in Hootsuite, representing content queued for future publishing. Fires at scheduling time, not when the post actually sends."},props:{},sampleData:{id:"msg_abc123",state:"SCHEDULED",scheduled_send_time:"2024-06-01T10:00:00Z",text:"Check out our latest blog post!",social_profile_ids:"profile_1, profile_2"},type:"POLLING",async test(e){return de.test(ar,e)},async onEnable(e){await de.onEnable(ar,e)},async onDisable(e){await de.onDisable(ar,e)},async run(e){return de.poll(ar,e)}});var sr={strategy:0,items:o(async({auth:e})=>((await ue({auth:e,method:"GET",path:"/messages",queryParams:{state:"SENT",limit:"50"}})).body.data??[]).filter(r=>!!r.sendTime).map(r=>({epochMilliSeconds:new Date(r.sendTime).getTime(),data:{id:r.id,state:r.state,send_time:r.sendTime,text:r.text??null,post_url:r.postUrl??null,social_profile_ids:(r.socialProfileIds??[]).join(", ")}})),"items")},Qs=Ht({auth:Q,name:"new_published_post",displayName:"New Published Post",description:"Triggers when a post is published (sent) in Hootsuite.",aiMetadata:{description:"Fires when a post transitions to the SENT state in Hootsuite, representing content that has actually been published to its social networks."},props:{},sampleData:{id:"msg_xyz456",state:"SENT",send_time:"2024-06-01T10:00:00Z",text:"Check out our latest blog post!",post_url:"https://twitter.com/example/status/123456",social_profile_ids:"profile_1"},type:"POLLING",async test(e){return de.test(sr,e)},async onEnable(e){await de.onEnable(sr,e)},async onDisable(e){await de.onDisable(sr,e)},async run(e){return de.poll(sr,e)}});var Md=wi({displayName:"Hootsuite",description:"Social media management \u2014 schedule posts and manage multiple networks from one dashboard.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/hootsuite.png",categories:["MARKETING"],auth:Q,authors:["onyedikachi-david"],actions:[Ks,Js,Xs,qs({baseUrl:o(()=>"https://platform.hootsuite.com/v1","baseUrl"),auth:Q,authMapping:o(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],triggers:[Ys,Qs]});0&&(module.exports={hootsuite,hootsuiteAuth});
|
|
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
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { hootsuiteAuth } from './lib/auth';
|
|
2
|
-
export declare const hootsuite: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
3
|
-
export { hootsuiteAuth };
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,SAAS,+JAqBpB,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AAExE,iDAAqD;AACrD,iEAAmE;AACnE,2DAA6D;AAC7D,iEAAmE;AACnE,0EAA4E;AAC5E,0EAA4E;AAC5E,qCAA2C;AAyBlC,8FAzBA,oBAAa,OAyBA;AAvBT,QAAA,SAAS,GAAG,IAAA,8BAAW,EAAC;IACnC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,2FAA2F;IACxG,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mDAAmD;IAC5D,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,IAAI,EAAE,oBAAa;IACnB,OAAO,EAAE,CAAC,mBAAmB,CAAC;IAC9B,OAAO,EAAE;QACP,oCAAmB;QACnB,8BAAgB;QAChB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,mCAAmC;YAClD,IAAI,EAAE,oBAAa;YACnB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACtE,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,4CAAuB,EAAE,4CAAuB,CAAC;CAC7D,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const createMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
socialProfileIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
3
|
-
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
-
scheduledSendTime: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
5
|
-
emailNotification: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=create-message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-message.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;EAmF9B,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createMessageAction = 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 auth_1 = require("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
exports.createMessageAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.hootsuiteAuth,
|
|
11
|
-
name: 'create_message',
|
|
12
|
-
displayName: 'Schedule Post',
|
|
13
|
-
description: 'Schedules or immediately publishes a post to one or more social media profiles.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Publishes a post to one or more connected Hootsuite social profiles, either immediately or scheduled for a future time depending on whether a scheduled time is provided (leave it empty to post now; a future time must be at least 5 minutes ahead and in UTC). Use to create and distribute social media content across networks. Not idempotent: each call creates a new post, so repeating it produces duplicate posts. Requires the target social profile IDs and the post text.', idempotent: false },
|
|
16
|
-
props: {
|
|
17
|
-
socialProfileIds: pieces_framework_1.Property.MultiSelectDropdown({
|
|
18
|
-
displayName: 'Social Profiles',
|
|
19
|
-
description: 'Select the social media profiles to post to.',
|
|
20
|
-
refreshers: [],
|
|
21
|
-
required: true,
|
|
22
|
-
auth: auth_1.hootsuiteAuth,
|
|
23
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
24
|
-
if (!auth) {
|
|
25
|
-
return { disabled: true, options: [], placeholder: 'Please connect your Hootsuite account first' };
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
const response = yield (0, common_1.hootsuiteApiCall)({
|
|
29
|
-
auth,
|
|
30
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
31
|
-
path: '/socialProfiles',
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
disabled: false,
|
|
35
|
-
options: response.body.data.map((p) => {
|
|
36
|
-
var _a;
|
|
37
|
-
return ({
|
|
38
|
-
label: `${(_a = p.socialNetworkUsername) !== null && _a !== void 0 ? _a : p.id} (${p.type})`,
|
|
39
|
-
value: p.id,
|
|
40
|
-
});
|
|
41
|
-
}),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
catch (_b) {
|
|
45
|
-
return { disabled: true, options: [], placeholder: 'Failed to load profiles. Check your connection.' };
|
|
46
|
-
}
|
|
47
|
-
}),
|
|
48
|
-
}),
|
|
49
|
-
text: pieces_framework_1.Property.LongText({
|
|
50
|
-
displayName: 'Post Text',
|
|
51
|
-
description: 'The text content of your post.',
|
|
52
|
-
required: true,
|
|
53
|
-
}),
|
|
54
|
-
scheduledSendTime: pieces_framework_1.Property.DateTime({
|
|
55
|
-
displayName: 'Scheduled Time',
|
|
56
|
-
description: 'When to publish the post (UTC, must be at least 5 minutes in the future). Leave empty to post immediately.',
|
|
57
|
-
required: false,
|
|
58
|
-
}),
|
|
59
|
-
emailNotification: pieces_framework_1.Property.Checkbox({
|
|
60
|
-
displayName: 'Email Notification',
|
|
61
|
-
description: 'Send an email notification when the post is published.',
|
|
62
|
-
required: false,
|
|
63
|
-
defaultValue: false,
|
|
64
|
-
}),
|
|
65
|
-
},
|
|
66
|
-
run(context) {
|
|
67
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
var _a, _b, _c, _d, _e;
|
|
69
|
-
const { socialProfileIds, text, scheduledSendTime, emailNotification } = context.propsValue;
|
|
70
|
-
const body = {
|
|
71
|
-
text,
|
|
72
|
-
socialProfileIds,
|
|
73
|
-
emailNotification,
|
|
74
|
-
};
|
|
75
|
-
if (scheduledSendTime) {
|
|
76
|
-
body['scheduledSendTime'] = new Date(scheduledSendTime).toISOString();
|
|
77
|
-
}
|
|
78
|
-
const response = yield (0, common_1.hootsuiteApiCall)({
|
|
79
|
-
auth: context.auth,
|
|
80
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
81
|
-
path: '/messages',
|
|
82
|
-
body,
|
|
83
|
-
});
|
|
84
|
-
const msg = response.body.data;
|
|
85
|
-
return {
|
|
86
|
-
id: msg.id,
|
|
87
|
-
state: msg.state,
|
|
88
|
-
scheduled_send_time: (_a = msg.scheduledSendTime) !== null && _a !== void 0 ? _a : null,
|
|
89
|
-
text: (_b = msg.text) !== null && _b !== void 0 ? _b : text,
|
|
90
|
-
social_profile_ids: ((_c = msg.socialProfileIds) !== null && _c !== void 0 ? _c : socialProfileIds).join(', '),
|
|
91
|
-
post_url: (_d = msg.postUrl) !== null && _d !== void 0 ? _d : null,
|
|
92
|
-
errors: (_e = msg.errors) !== null && _e !== void 0 ? _e : [],
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
//# sourceMappingURL=create-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,sCAA6C;AAEhC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,iFAAiF;IAC9F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,wdAAwd,EAAE,UAAU,EAAE,KAAK,EAAE;IACxgB,KAAK,EAAE;QACL,gBAAgB,EAAE,2BAAQ,CAAC,mBAAmB,CAAC;YAC7C,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,8CAA8C;YAC3D,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,oBAAa;YACnB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;gBACrG,CAAC;gBACD,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAyB;wBAC9D,IAAI;wBACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;wBACtB,IAAI,EAAE,iBAAiB;qBACxB,CAAC,CAAC;oBACH,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;;4BAAC,OAAA,CAAC;gCACtC,KAAK,EAAE,GAAG,MAAA,CAAC,CAAC,qBAAqB,mCAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,GAAG;gCACvD,KAAK,EAAE,CAAC,CAAC,EAAE;6BACZ,CAAC,CAAA;yBAAA,CAAC;qBACJ,CAAC;gBACJ,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;gBACzG,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,4GAA4G;YACzH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,wDAAwD;YACrE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAE5F,MAAM,IAAI,GAA4B;gBACpC,IAAI;gBACJ,gBAAgB;gBAChB,iBAAiB;aAClB,CAAC;YACF,IAAI,iBAAiB,EAAE,CAAC;gBACtB,IAAI,CAAC,mBAAmB,CAAC,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,WAAW,EAAE,CAAC;YACxE,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAkB;gBACvD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,WAAW;gBACjB,IAAI;aACL,CAAC,CAAC;YAEH,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/B,OAAO;gBACL,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,mBAAmB,EAAE,MAAA,GAAG,CAAC,iBAAiB,mCAAI,IAAI;gBAClD,IAAI,EAAE,MAAA,GAAG,CAAC,IAAI,mCAAI,IAAI;gBACtB,kBAAkB,EAAE,CAAC,MAAA,GAAG,CAAC,gBAAgB,mCAAI,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;gBACzE,QAAQ,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,IAAI;gBAC7B,MAAM,EAAE,MAAA,GAAG,CAAC,MAAM,mCAAI,EAAE;aACzB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const deleteMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
messageId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=delete-message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-message.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;EA0B9B,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteMessageAction = 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 auth_1 = require("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
exports.deleteMessageAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.hootsuiteAuth,
|
|
11
|
-
name: 'delete_message',
|
|
12
|
-
displayName: 'Delete Post',
|
|
13
|
-
description: 'Permanently deletes a post. Only posts in a deletable state (e.g. SCHEDULED) can be removed.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Permanently deletes a Hootsuite post by its ID. Use to cancel or remove a scheduled post before it sends. Only posts in a deletable state (e.g. SCHEDULED) can be removed; already-sent posts cannot. Not idempotent: the first call removes the post and subsequent calls with the same ID will fail since it no longer exists.', idempotent: false },
|
|
16
|
-
props: {
|
|
17
|
-
messageId: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Post ID',
|
|
19
|
-
description: 'The unique ID of the post to delete. You can get this from the "Schedule Post" or "Get Post Details" action.',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
},
|
|
23
|
-
run(context) {
|
|
24
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
yield (0, common_1.hootsuiteApiCall)({
|
|
26
|
-
auth: context.auth,
|
|
27
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
28
|
-
path: `/messages/${context.propsValue.messageId}`,
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
success: true,
|
|
32
|
-
deleted_message_id: context.propsValue.messageId,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=delete-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,sCAA6C;AAEhC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,8FAA8F;IAC3G,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kUAAkU,EAAE,UAAU,EAAE,KAAK,EAAE;IAClX,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,8GAA8G;YAC3H,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAA,yBAAgB,EAAC;gBACrB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,IAAI,EAAE,aAAa,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE;aAClD,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,kBAAkB,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;aACjD,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const getMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
messageId: 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/actions/get-message.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;EAoC3B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMessageAction = 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 auth_1 = require("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
exports.getMessageAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.hootsuiteAuth,
|
|
11
|
-
name: 'get_message',
|
|
12
|
-
displayName: 'Get Post Details',
|
|
13
|
-
description: 'Retrieves the details of a specific scheduled or published post by its ID.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Looks up a single Hootsuite post by its ID and returns its current details and state (e.g. scheduled, sent, errored). Use to inspect or confirm a post created earlier or referenced from the dashboard. Idempotent read-only lookup. Requires the post ID, obtainable from a Schedule Post output or the Hootsuite dashboard URL.', idempotent: true },
|
|
16
|
-
props: {
|
|
17
|
-
messageId: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Post ID',
|
|
19
|
-
description: 'The unique ID of the post. You can get this from a previous "Schedule Post" action output or from the Hootsuite dashboard URL.',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
},
|
|
23
|
-
run(context) {
|
|
24
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
26
|
-
const response = yield (0, common_1.hootsuiteApiCall)({
|
|
27
|
-
auth: context.auth,
|
|
28
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
29
|
-
path: `/messages/${context.propsValue.messageId}`,
|
|
30
|
-
});
|
|
31
|
-
const msg = response.body.data;
|
|
32
|
-
return {
|
|
33
|
-
id: msg.id,
|
|
34
|
-
state: msg.state,
|
|
35
|
-
text: (_a = msg.text) !== null && _a !== void 0 ? _a : null,
|
|
36
|
-
scheduled_send_time: (_b = msg.scheduledSendTime) !== null && _b !== void 0 ? _b : null,
|
|
37
|
-
send_time: (_c = msg.sendTime) !== null && _c !== void 0 ? _c : null,
|
|
38
|
-
social_profile_ids: ((_d = msg.socialProfileIds) !== null && _d !== void 0 ? _d : []).join(', '),
|
|
39
|
-
post_url: (_e = msg.postUrl) !== null && _e !== void 0 ? _e : null,
|
|
40
|
-
tags: (_f = msg.tags) !== null && _f !== void 0 ? _f : [],
|
|
41
|
-
email_notification: (_g = msg.emailNotification) !== null && _g !== void 0 ? _g : null,
|
|
42
|
-
location: (_h = msg.location) !== null && _h !== void 0 ? _h : null,
|
|
43
|
-
errors: (_j = msg.errors) !== null && _j !== void 0 ? _j : [],
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=get-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAwC;AACxC,sCAA6C;AAEhC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,4EAA4E;IACzF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,oUAAoU,EAAE,UAAU,EAAE,IAAI,EAAE;IACnX,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,gIAAgI;YAC7I,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAkB;gBACvD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,aAAa,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE;aAClD,CAAC,CAAC;YAEH,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/B,OAAO;gBACL,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,IAAI,EAAE,MAAA,GAAG,CAAC,IAAI,mCAAI,IAAI;gBACtB,mBAAmB,EAAE,MAAA,GAAG,CAAC,iBAAiB,mCAAI,IAAI;gBAClD,SAAS,EAAE,MAAA,GAAG,CAAC,QAAQ,mCAAI,IAAI;gBAC/B,kBAAkB,EAAE,CAAC,MAAA,GAAG,CAAC,gBAAgB,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC3D,QAAQ,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,IAAI;gBAC7B,IAAI,EAAE,MAAA,GAAG,CAAC,IAAI,mCAAI,EAAE;gBACpB,kBAAkB,EAAE,MAAA,GAAG,CAAC,iBAAiB,mCAAI,IAAI;gBACjD,QAAQ,EAAE,MAAA,GAAG,CAAC,QAAQ,mCAAI,IAAI;gBAC9B,MAAM,EAAE,MAAA,GAAG,CAAC,MAAM,mCAAI,EAAE;aACzB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/auth.d.ts
DELETED
package/src/lib/auth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,+GAOxB,CAAC"}
|
package/src/lib/auth.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hootsuiteAuth = void 0;
|
|
4
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
-
exports.hootsuiteAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
6
|
-
description: 'Connect your Hootsuite account. Create an OAuth2 app and get your client credentials at https://developer.hootsuite.com.',
|
|
7
|
-
required: true,
|
|
8
|
-
authUrl: 'https://platform.hootsuite.com/oauth2/auth',
|
|
9
|
-
tokenUrl: 'https://platform.hootsuite.com/oauth2/token',
|
|
10
|
-
scope: ['offline', 'post'],
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=auth.js.map
|
package/src/lib/auth.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE9C,QAAA,aAAa,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC5C,WAAW,EACT,0HAA0H;IAC5H,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,6CAA6C;IACvD,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HttpMethod, HttpMessageBody, HttpResponse } from '@activepieces/pieces-common';
|
|
2
|
-
import { OAuth2PropertyValue } from '@activepieces/pieces-framework';
|
|
3
|
-
export declare function hootsuiteApiCall<T extends HttpMessageBody>({ auth, method, path, body, queryParams, }: {
|
|
4
|
-
auth: OAuth2PropertyValue;
|
|
5
|
-
method: HttpMethod;
|
|
6
|
-
path: string;
|
|
7
|
-
body?: unknown;
|
|
8
|
-
queryParams?: Record<string, string>;
|
|
9
|
-
}): Promise<HttpResponse<T>>;
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,eAAe,EACf,YAAY,EAEb,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EAAE,EAChE,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,GACZ,EAAE;IACD,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAW3B"}
|
package/src/lib/common/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hootsuiteApiCall = hootsuiteApiCall;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const BASE_URL = 'https://platform.hootsuite.com/v1';
|
|
7
|
-
function hootsuiteApiCall(_a) {
|
|
8
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, method, path, body, queryParams, }) {
|
|
9
|
-
return pieces_common_1.httpClient.sendRequest({
|
|
10
|
-
method,
|
|
11
|
-
url: `${BASE_URL}${path}`,
|
|
12
|
-
authentication: {
|
|
13
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
14
|
-
token: auth.access_token,
|
|
15
|
-
},
|
|
16
|
-
body,
|
|
17
|
-
queryParams,
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;AAWA,4CAuBC;;AAlCD,+DAMqC;AAGrC,MAAM,QAAQ,GAAG,mCAAmC,CAAC;AAErD,SAAsB,gBAAgB;iEAA4B,EAChE,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,GAOZ;QACC,OAAO,0BAAU,CAAC,WAAW,CAAI;YAC/B,MAAM;YACN,GAAG,EAAE,GAAG,QAAQ,GAAG,IAAI,EAAE;YACzB,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,IAAI,CAAC,YAAY;aACzB;YACD,IAAI;YACJ,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newPublishedPostTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
|
|
3
|
-
//# sourceMappingURL=new-published-post.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-published-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-published-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AA0CxC,eAAO,MAAM,uBAAuB,kwBA8BlC,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newPublishedPostTrigger = 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 auth_1 = require("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const polling = {
|
|
10
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
11
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
12
|
-
var _b;
|
|
13
|
-
const response = yield (0, common_1.hootsuiteApiCall)({
|
|
14
|
-
auth,
|
|
15
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
16
|
-
path: '/messages',
|
|
17
|
-
queryParams: {
|
|
18
|
-
state: 'SENT',
|
|
19
|
-
limit: '50',
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
return ((_b = response.body.data) !== null && _b !== void 0 ? _b : [])
|
|
23
|
-
.filter((msg) => !!msg.sendTime)
|
|
24
|
-
.map((msg) => {
|
|
25
|
-
var _a, _b, _c;
|
|
26
|
-
return ({
|
|
27
|
-
epochMilliSeconds: new Date(msg.sendTime).getTime(),
|
|
28
|
-
data: {
|
|
29
|
-
id: msg.id,
|
|
30
|
-
state: msg.state,
|
|
31
|
-
send_time: msg.sendTime,
|
|
32
|
-
text: (_a = msg.text) !== null && _a !== void 0 ? _a : null,
|
|
33
|
-
post_url: (_b = msg.postUrl) !== null && _b !== void 0 ? _b : null,
|
|
34
|
-
social_profile_ids: ((_c = msg.socialProfileIds) !== null && _c !== void 0 ? _c : []).join(', '),
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
exports.newPublishedPostTrigger = (0, pieces_framework_1.createTrigger)({
|
|
41
|
-
auth: auth_1.hootsuiteAuth,
|
|
42
|
-
name: 'new_published_post',
|
|
43
|
-
displayName: 'New Published Post',
|
|
44
|
-
description: 'Triggers when a post is published (sent) in Hootsuite.',
|
|
45
|
-
aiMetadata: {
|
|
46
|
-
description: 'Fires when a post transitions to the SENT state in Hootsuite, representing content that has actually been published to its social networks.',
|
|
47
|
-
},
|
|
48
|
-
props: {},
|
|
49
|
-
sampleData: {
|
|
50
|
-
id: 'msg_xyz456',
|
|
51
|
-
state: 'SENT',
|
|
52
|
-
send_time: '2024-06-01T10:00:00Z',
|
|
53
|
-
text: 'Check out our latest blog post!',
|
|
54
|
-
post_url: 'https://twitter.com/example/status/123456',
|
|
55
|
-
social_profile_ids: 'profile_1',
|
|
56
|
-
},
|
|
57
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
58
|
-
test(context) {
|
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
return pieces_common_1.pollingHelper.test(polling, context);
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
onEnable(context) {
|
|
64
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
onDisable(context) {
|
|
69
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
run(context) {
|
|
74
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
return pieces_common_1.pollingHelper.poll(polling, context);
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
//# sourceMappingURL=new-published-post.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-published-post.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-published-post.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAwC;AACxC,sCAA6C;AAE7C,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAmB;YACxD,IAAI;YACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE;gBACX,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,IAAI;aACZ;SACF,CAAC,CAAC;QAEH,OAAO,CAAC,MAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;aAC9B,MAAM,CAAC,CAAC,GAAG,EAAkD,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC;aAC/E,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;;YAAC,OAAA,CAAC;gBACb,iBAAiB,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;gBACnD,IAAI,EAAE;oBACJ,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,SAAS,EAAE,GAAG,CAAC,QAAQ;oBACvB,IAAI,EAAE,MAAA,GAAG,CAAC,IAAI,mCAAI,IAAI;oBACtB,QAAQ,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,IAAI;oBAC7B,kBAAkB,EAAE,CAAC,MAAA,GAAG,CAAC,gBAAgB,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC5D;aACF,CAAC,CAAA;SAAA,CAAC,CAAC;IACR,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAA,gCAAa,EAAC;IACnD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,wDAAwD;IACrE,UAAU,EAAE;QACV,WAAW,EAAE,6IAA6I;KAC3J;IACD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,sBAAsB;QACjC,IAAI,EAAE,iCAAiC;QACvC,QAAQ,EAAE,2CAA2C;QACrD,kBAAkB,EAAE,WAAW;KAChC;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,IAAI,CAAC,OAAO;;YAChB,OAAO,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newScheduledPostTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {}>;
|
|
3
|
-
//# sourceMappingURL=new-scheduled-post.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-scheduled-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-scheduled-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AA4CxC,eAAO,MAAM,uBAAuB,kwBA6BlC,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newScheduledPostTrigger = 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 auth_1 = require("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const polling = {
|
|
10
|
-
// LAST_ITEM is correct here: we want to fire when a post is newly created/scheduled,
|
|
11
|
-
// not when its scheduled time arrives. TIMEBASED with scheduledSendTime would fire
|
|
12
|
-
// based on due-time, causing posts scheduled for earlier dates to be missed.
|
|
13
|
-
strategy: pieces_common_1.DedupeStrategy.LAST_ITEM,
|
|
14
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
15
|
-
var _b;
|
|
16
|
-
const response = yield (0, common_1.hootsuiteApiCall)({
|
|
17
|
-
auth,
|
|
18
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
19
|
-
path: '/messages',
|
|
20
|
-
queryParams: {
|
|
21
|
-
state: 'SCHEDULED',
|
|
22
|
-
limit: '50',
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
return ((_b = response.body.data) !== null && _b !== void 0 ? _b : [])
|
|
26
|
-
.sort((a, b) => new Date(b.scheduledSendTime).getTime() - new Date(a.scheduledSendTime).getTime())
|
|
27
|
-
.map((msg) => {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
return ({
|
|
30
|
-
id: msg.id,
|
|
31
|
-
data: {
|
|
32
|
-
id: msg.id,
|
|
33
|
-
state: msg.state,
|
|
34
|
-
scheduled_send_time: msg.scheduledSendTime,
|
|
35
|
-
text: (_a = msg.text) !== null && _a !== void 0 ? _a : null,
|
|
36
|
-
social_profile_ids: ((_b = msg.socialProfileIds) !== null && _b !== void 0 ? _b : []).join(', '),
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}),
|
|
41
|
-
};
|
|
42
|
-
exports.newScheduledPostTrigger = (0, pieces_framework_1.createTrigger)({
|
|
43
|
-
auth: auth_1.hootsuiteAuth,
|
|
44
|
-
name: 'new_scheduled_post',
|
|
45
|
-
displayName: 'New Scheduled Post',
|
|
46
|
-
description: 'Triggers when a new post is scheduled in Hootsuite.',
|
|
47
|
-
aiMetadata: {
|
|
48
|
-
description: 'Fires when a new post enters the SCHEDULED state in Hootsuite, representing content queued for future publishing. Fires at scheduling time, not when the post actually sends.',
|
|
49
|
-
},
|
|
50
|
-
props: {},
|
|
51
|
-
sampleData: {
|
|
52
|
-
id: 'msg_abc123',
|
|
53
|
-
state: 'SCHEDULED',
|
|
54
|
-
scheduled_send_time: '2024-06-01T10:00:00Z',
|
|
55
|
-
text: 'Check out our latest blog post!',
|
|
56
|
-
social_profile_ids: 'profile_1, profile_2',
|
|
57
|
-
},
|
|
58
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
59
|
-
test(context) {
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return pieces_common_1.pollingHelper.test(polling, context);
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
onEnable(context) {
|
|
65
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, context);
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
onDisable(context) {
|
|
70
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, context);
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
run(context) {
|
|
75
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
return pieces_common_1.pollingHelper.poll(polling, context);
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=new-scheduled-post.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-scheduled-post.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-scheduled-post.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAKqC;AACrC,kCAAwC;AACxC,sCAA6C;AAE7C,MAAM,OAAO,GAGT;IACF,qFAAqF;IACrF,mFAAmF;IACnF,6EAA6E;IAC7E,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACpB,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAmB;YACxD,IAAI;YACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE;gBACX,KAAK,EAAE,WAAW;gBAClB,KAAK,EAAE,IAAI;aACZ;SACF,CAAC,CAAC;QAEH,OAAO,CAAC,MAAA,QAAQ,CAAC,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC;aAC9B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE,CAAC;aACjG,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;;YAAC,OAAA,CAAC;gBACb,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE;oBACJ,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,mBAAmB,EAAE,GAAG,CAAC,iBAAiB;oBAC1C,IAAI,EAAE,MAAA,GAAG,CAAC,IAAI,mCAAI,IAAI;oBACtB,kBAAkB,EAAE,CAAC,MAAA,GAAG,CAAC,gBAAgB,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC5D;aACF,CAAC,CAAA;SAAA,CAAC,CAAC;IACR,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,uBAAuB,GAAG,IAAA,gCAAa,EAAC;IACnD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,qDAAqD;IAClE,UAAU,EAAE;QACV,WAAW,EAAE,+KAA+K;KAC7L;IACD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,WAAW;QAClB,mBAAmB,EAAE,sBAAsB;QAC3C,IAAI,EAAE,iCAAiC;QACvC,kBAAkB,EAAE,sBAAsB;KAC3C;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,IAAI,CAAC,OAAO;;YAChB,OAAO,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;KAAA;CACF,CAAC,CAAC"}
|