@activepieces/piece-google-tasks 0.4.5 → 0.5.0
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 -34
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/new-task.d.ts +0 -8
- package/src/lib/actions/new-task.d.ts.map +0 -1
- package/src/lib/actions/new-task.js +0 -43
- package/src/lib/actions/new-task.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 -58
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -110
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/new-task.d.ts +0 -11
- package/src/lib/triggers/new-task.d.ts.map +0 -1
- package/src/lib/triggers/new-task.js +0 -70
- package/src/lib/triggers/new-task.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-tasks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.86.0",
|
|
14
|
-
"tslib": "2.6.2"
|
|
15
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
16
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleTasks = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/google-tasks.png',
|
|
15
|
-
categories: [shared_1.PieceCategory.PRODUCTIVITY],
|
|
16
|
-
actions: [
|
|
17
|
-
new_task_1.googleTasksAddNewTaskAction,
|
|
18
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
19
|
-
baseUrl: () => common_1.googleTasksCommon.baseUrl,
|
|
20
|
-
auth: auth_1.googleTasksAuth,
|
|
21
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
return ({
|
|
23
|
-
Authorization: `Bearer ${auth.access_token}`,
|
|
24
|
-
});
|
|
25
|
-
}),
|
|
26
|
-
}),
|
|
27
|
-
],
|
|
28
|
-
displayName: 'Google Tasks',
|
|
29
|
-
description: 'Task list management application',
|
|
30
|
-
authors: ["Salem-Alaa", "kishanprmr", "MoShizzle", "khaledmashaly", "abuaboud"],
|
|
31
|
-
triggers: [new_task_2.newTaskTrigger],
|
|
32
|
-
auth: auth_1.googleTasksAuth,
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var _u=Object.create;var et=Object.defineProperty;var Pu=Object.getOwnPropertyDescriptor;var Tu=Object.getOwnPropertyNames;var bu=Object.getPrototypeOf,Iu=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},xn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tu(t))!Iu.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=Pu(t,i))||n.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?_u(bu(e)):{},_n(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),Eu=e=>_n(et({},"__esModule",{value:!0}),e);var Zo=S((Vo,Gt)=>{(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"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,m=-1,x=(u.match(l.zoneIndex)||[])[0],P,j;for(x&&(x=x.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(j=d-y,P=":";j--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let oe=u.split(":"),ce=[];for(let Qe=0;Qe<oe.length;Qe++)ce.push(parseInt(oe[Qe],16));return ce})(),{parts:d,zoneId:x}}o(f,"expandIPv6");function g(u,d,y,m){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),u[x]>>P!==d[x]>>P)return!1;m-=y,x+=1}return!0}o(g,"matchCIDR");function v(u){if(i.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}o(v,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}o(b,"padPart");let _={};_.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,j;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in m){if(j=m[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}else return null;return 32-d},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),_.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(u){return this.parser(u)!==null},_.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(u){return!!(_.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(u)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(u){let d,y,m,x,P;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(u){let d,y,m;if(d=u.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let j=0;j<x.length;j++)y=x[j],P.push(v(y));return P})();if(d=u.match(r.longValue)){if(m=v(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(m>>P&255);return x})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(m=v(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(v(x[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=u.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(m=v(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(v(x[0])),P.push(v(x[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(u/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},_.IPv6=(function(){function u(d,y){let m,x;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,P;for(let j=7;j>=0;j-=1)if(x=this.parts[j],x in m){if(P=m[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(b(this.parts[x].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new _.IPv4([y>>8,y&255,m>>8,m&255])},u.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(m=P.index,x=P[0].length);return x<0?y:`${y.substring(0,m)}::${y.substring(m+x)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),_.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(u){return this.parser(u)!==null},_.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(u){let d,y,m,x,P;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},_.IPv6.parse=function(u){let d=this.parser(u);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(u){let d,y,m;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(u){let d,y,m,x,P,j;if(m=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(u))return f(u,8);if((m=u.match(l.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(u/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},_.fromByteArray=function(u){let d=u.length;if(d===4)return new _.IPv4(u);if(d===16)return new _.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(u){return _.IPv6.isValid(u)||_.IPv4.isValid(u)},_.isValidCIDR=function(u){return _.IPv6.isValidCIDR(u)||_.IPv4.isValidCIDR(u)},_.parse=function(u){if(_.IPv6.isValid(u))return _.IPv6.parse(u);if(_.IPv4.isValid(u))return _.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(u){try{return _.IPv6.parseCIDR(u)}catch{try{return _.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(u,d,y){let m,x,P,j;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],u.kind()===j[0].kind()&&u.match.apply(u,j))return x}return y},typeof Gt<"u"&&Gt.exports?Gt.exports=_:e.ipaddr=_})(Vo)});var Hi=S((j$,Zi)=>{var Vi=require("stream").Stream,ap=require("util");Zi.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");ap.inherits(pe,Vi);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Vi.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};pe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Ki=S((B$,Wi)=>{var sp=require("util"),qi=require("stream").Stream,Gi=Hi();Wi.exports=X;function X(){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(X,"CombinedStream");sp.inherits(X,qi);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Gi)){var r=Gi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return qi.prototype.pipe.call(this,e,t),this.resume(),e};X.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}};X.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=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.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()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.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")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.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)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Xi=S((Z$,Ji)=>{"use strict";Ji.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 ea=S(ne=>{"use strict";var Yt=Xi(),up=require("path").extname,Yi=/^\s*([^;\s]*)(?:;|\s|$)/,cp=/^text\//i;ne.charset=Qi;ne.charsets={lookup:Qi};ne.contentType=lp;ne.extension=pp;ne.extensions=Object.create(null);ne.lookup=dp;ne.types=Object.create(null);mp(ne.extensions,ne.types);function Qi(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&cp.test(t[1])?"UTF-8":!1}o(Qi,"charset");function lp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ne.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ne.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(lp,"contentType");function pp(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&ne.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(pp,"extension");function dp(e){if(!e||typeof e!="string")return!1;var t=up("x."+e).toLowerCase().substr(1);return t&&ne.types[t]||!1}o(dp,"lookup");function mp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var s=Yt[i],c=s.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var g=r.indexOf(Yt[t[f]].source),v=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(g>v||g===v&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(mp,"populateMaps")});var ra=S((q$,ta)=>{ta.exports=fp;function fp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(fp,"defer")});var Kr=S((K$,oa)=>{var na=ra();oa.exports=gp;function gp(e){var t=!1;return na(function(){t=!0}),o(function(n,i){t?e(n,i):na(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(gp,"async")});var Jr=S((X$,ia)=>{ia.exports=yp;function yp(e){Object.keys(e.jobs).forEach(hp.bind(e)),e.jobs={}}o(yp,"abort");function hp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(hp,"clean")});var Xr=S((Q$,sa)=>{var aa=Kr(),vp=Jr();sa.exports=xp;function xp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=_p(t,i,e[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?vp(r):r.results[i]=c,n(s,r.results))})}o(xp,"iterate");function _p(e,t,r,n){var i;return e.length==2?i=e(r,aa(n)):i=e(r,t,aa(n)),i}o(_p,"runJob")});var Yr=S((tk,ua)=>{ua.exports=Pp;function Pp(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,s){return t(e[i],e[s])}),n}o(Pp,"state")});var Qr=S((nk,ca)=>{var Tp=Jr(),bp=Kr();ca.exports=Ip;function Ip(e){Object.keys(this.jobs).length&&(this.index=this.size,Tp(this),bp(e)(null,this.results))}o(Ip,"terminator")});var pa=S((ik,la)=>{var Ep=Xr(),Sp=Yr(),Ap=Qr();la.exports=$p;function $p(e,t,r){for(var n=Sp(e);n.index<(n.keyedList||e).length;)Ep(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Ap.bind(n,r)}o($p,"parallel")});var en=S((sk,Qt)=>{var da=Xr(),kp=Yr(),zp=Qr();Qt.exports=Op;Qt.exports.ascending=ma;Qt.exports.descending=wp;function Op(e,t,r,n){var i=kp(e,r);return da(e,t,i,o(function s(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){da(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),zp.bind(i,n)}o(Op,"serialOrdered");function ma(e,t){return e<t?-1:e>t?1:0}o(ma,"ascending");function wp(e,t){return-1*ma(e,t)}o(wp,"descending")});var ga=S((ck,fa)=>{var Rp=en();fa.exports=Np;function Np(e,t,r){return Rp(e,t,null,r)}o(Np,"serial")});var ha=S((pk,ya)=>{ya.exports={parallel:pa(),serial:ga(),serialOrdered:en()}});var tn=S((dk,va)=>{"use strict";va.exports=Object});var _a=S((mk,xa)=>{"use strict";xa.exports=Error});var Ta=S((fk,Pa)=>{"use strict";Pa.exports=EvalError});var Ia=S((gk,ba)=>{"use strict";ba.exports=RangeError});var Sa=S((yk,Ea)=>{"use strict";Ea.exports=ReferenceError});var $a=S((hk,Aa)=>{"use strict";Aa.exports=SyntaxError});var er=S((vk,ka)=>{"use strict";ka.exports=TypeError});var Oa=S((xk,za)=>{"use strict";za.exports=URIError});var Ra=S((_k,wa)=>{"use strict";wa.exports=Math.abs});var Da=S((Pk,Na)=>{"use strict";Na.exports=Math.floor});var Ua=S((Tk,Ca)=>{"use strict";Ca.exports=Math.max});var La=S((bk,Ma)=>{"use strict";Ma.exports=Math.min});var Fa=S((Ik,ja)=>{"use strict";ja.exports=Math.pow});var Va=S((Ek,Ba)=>{"use strict";Ba.exports=Math.round});var Ha=S((Sk,Za)=>{"use strict";Za.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var qa=S(($k,Ga)=>{"use strict";var Dp=Ha();Ga.exports=o(function(t){return Dp(t)||t===0?t:t<0?-1:1},"sign")});var Ka=S((zk,Wa)=>{"use strict";Wa.exports=Object.getOwnPropertyDescriptor});var rn=S((Ok,Ja)=>{"use strict";var tr=Ka();if(tr)try{tr([],"length")}catch{tr=null}Ja.exports=tr});var Ya=S((wk,Xa)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Xa.exports=rr});var nn=S((Rk,Qa)=>{"use strict";Qa.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 s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var rs=S((Dk,ts)=>{"use strict";var es=typeof Symbol<"u"&&Symbol,Cp=nn();ts.exports=o(function(){return typeof es!="function"||typeof Symbol!="function"||typeof es("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Cp()},"hasNativeSymbols")});var on=S((Uk,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=S((Mk,os)=>{"use strict";var Up=tn();os.exports=Up.getPrototypeOf||null});var ss=S((Lk,as)=>{"use strict";var Mp="Function.prototype.bind called on incompatible ",Lp=Object.prototype.toString,jp=Math.max,Fp="[object Function]",is=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Bp=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Vp=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");as.exports=o(function(t){var r=this;if(typeof r!="function"||Lp.apply(r)!==Fp)throw new TypeError(Mp+r);for(var n=Bp(arguments,1),i,s=o(function(){if(this instanceof i){var v=r.apply(this,is(n,arguments));return Object(v)===v?v:this}return r.apply(t,is(n,arguments))},"binder"),c=jp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Vp(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var We=S((Fk,us)=>{"use strict";var Zp=ss();us.exports=Function.prototype.bind||Zp});var nr=S((Bk,cs)=>{"use strict";cs.exports=Function.prototype.call});var sn=S((Vk,ls)=>{"use strict";ls.exports=Function.prototype.apply});var ds=S((Zk,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var fs=S((Hk,ms)=>{"use strict";var Hp=We(),Gp=sn(),qp=nr(),Wp=ds();ms.exports=Wp||Hp.call(qp,Gp)});var ys=S((Gk,gs)=>{"use strict";var Kp=We(),Jp=er(),Xp=nr(),Yp=fs();gs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Jp("a function is required");return Yp(Kp,Xp,t)},"callBindBasic")});var Ts=S((Wk,Ps)=>{"use strict";var Qp=ys(),hs=rn(),xs;try{xs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var un=!!xs&&hs&&hs(Object.prototype,"__proto__"),_s=Object,vs=_s.getPrototypeOf;Ps.exports=un&&typeof un.get=="function"?Qp([un.get]):typeof vs=="function"?o(function(t){return vs(t==null?t:_s(t))},"getDunder"):!1});var As=S((Jk,Ss)=>{"use strict";var bs=on(),Is=an(),Es=Ts();Ss.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"):Es?o(function(t){return Es(t)},"getProto"):null});var cn=S((Yk,$s)=>{"use strict";var ed=Function.prototype.call,td=Object.prototype.hasOwnProperty,rd=We();$s.exports=rd.call(ed,td)});var Ds=S((Qk,Ns)=>{"use strict";var L,nd=tn(),od=_a(),id=Ta(),ad=Ia(),sd=Sa(),Ye=$a(),Xe=er(),ud=Oa(),cd=Ra(),ld=Da(),pd=Ua(),dd=La(),md=Fa(),fd=Va(),gd=qa(),ws=Function,ln=o(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=rn(),yd=Ya(),pn=o(function(){throw new Xe},"throwTypeError"),hd=Pt?(function(){try{return arguments.callee,pn}catch{try{return Pt(arguments,"callee").get}catch{return pn}}})():pn,Ke=rs()(),te=As(),vd=an(),xd=on(),Rs=sn(),Tt=nr(),Je={},_d=typeof Uint8Array>"u"||!te?L:te(Uint8Array),Me={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&te?te([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":od,"%eval%":eval,"%EvalError%":id,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":ws,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&te?te(te([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!te?L:te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":nd,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":ad,"%ReferenceError%":sd,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!te?L:te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&te?te(""[Symbol.iterator]()):L,"%Symbol%":Ke?Symbol:L,"%SyntaxError%":Ye,"%ThrowTypeError%":hd,"%TypedArray%":_d,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":ud,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Rs,"%Object.defineProperty%":yd,"%Object.getPrototypeOf%":vd,"%Math.abs%":cd,"%Math.floor%":ld,"%Math.max%":pd,"%Math.min%":dd,"%Math.pow%":md,"%Math.round%":fd,"%Math.sign%":gd,"%Reflect.getPrototypeOf%":xd};if(te)try{null.error}catch(e){ks=te(te(e)),Me["%Error.prototype%"]=ks}var ks,Pd=o(function e(t){var r;if(t==="%AsyncFunction%")r=ln("async function () {}");else if(t==="%GeneratorFunction%")r=ln("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ln("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&te&&(r=te(i.prototype))}return Me[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=We(),or=cn(),Td=bt.call(Tt,Array.prototype.concat),bd=bt.call(Rs,Array.prototype.splice),Os=bt.call(Tt,String.prototype.replace),ir=bt.call(Tt,String.prototype.slice),Id=bt.call(Tt,RegExp.prototype.exec),Ed=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Sd=/\\(\\)?/g,Ad=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var i=[];return Os(t,Ed,function(s,c,l,f){i[i.length]=l?Os(f,Sd,"$1"):c||s}),i},"stringToPath"),$d=o(function(t,r){var n=t,i;if(or(zs,n)&&(i=zs[n],n="%"+i[0]+"%"),or(Me,n)){var s=Me[n];if(s===Je&&(s=Pd(n)),typeof s>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Id(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ad(t),i=n.length>0?n[0]:"",s=$d("%"+i+"%",r),c=s.name,l=s.value,f=!1,g=s.alias;g&&(i=g[0],bd(n,Td([0,1],g)));for(var v=1,b=!0;v<n.length;v+=1){var _=n[v],u=ir(_,0,1),d=ir(_,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ye("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(f=!0),i+="."+_,c="%"+i+"%",or(Me,c))l=Me[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&v+1>=n.length){var y=Pt(l,_);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[_]}else b=or(l,_),l=l[_];b&&!f&&(Me[c]=l)}}return l},"GetIntrinsic")});var Us=S((tz,Cs)=>{"use strict";var kd=nn();Cs.exports=o(function(){return kd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var js=S((nz,Ls)=>{"use strict";var zd=Ds(),Ms=zd("%Object.defineProperty%",!0),Od=Us()(),wd=cn(),Rd=er(),ar=Od?Symbol.toStringTag:null;Ls.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 Rd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!wd(t,ar))&&(Ms?Ms(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Bs=S((iz,Fs)=>{"use strict";var Nd=Function.prototype.call,Dd=Object.prototype.hasOwnProperty,Cd=We();Fs.exports=Cd.call(Nd,Dd)});var Zs=S((az,Vs)=>{"use strict";Vs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var qs=S((sz,Gs)=>{"use strict";var gn=Ki(),Ud=require("util"),dn=require("path"),Md=require("http"),Ld=require("https"),jd=require("url").parse,Fd=require("fs"),Bd=require("stream").Stream,Vd=require("crypto"),mn=ea(),Zd=ha(),Hd=js(),Oe=Bs(),fn=Zs();function Hs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Hs,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");Ud.inherits(F,gn);F.LINE_BREAK=`\r
|
|
2
|
+
`;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=gn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};F.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)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Oe(t,"httpVersion"))&&!(t instanceof Bd))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){Oe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Fd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Oe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Oe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};F.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),s="",c={"Content-Disposition":["form-data",'name="'+Hs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&fn(c,r.header);var l;for(var f in c)if(Oe(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=f+": "+l.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+s+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=dn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=dn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Oe(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Hs(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=mn.lookup(e.name)),!r&&e&&e.path&&(r=mn.lookup(e.path)),!r&&e&&e.readable&&Oe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=mn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Oe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.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(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+Vd.randomBytes(12).toString("hex")};F.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};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.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}Zd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=jd(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=fn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Ld.request(n):r=Md.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(g,v){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,g,v)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};Hd(F.prototype,"FormData");Gs.exports=F});var im={};xn(im,{googleTasks:()=>om});module.exports=Eu(im);var Su=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let g=c.prototype,v=Object.keys(g);for(let b=0;b<v.length;b++){let _=v[b];_ in l||(l[_]=g[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var f;let g=r?.Parent?new s:this;n(g,l),(f=g._zod).deferred??(f.deferred=[]);for(let v of g._zod.deferred)v();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var de=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},lr={};function ye(e){return e&&Object.assign(lr,e),lr}o(ye,"config");function dr(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(dr,"getEnumValues");function Tn(e,t){return typeof t=="bigint"?t.toString():t}o(Tn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function bn(e){return e==null}o(bn,"nullish");function kt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(kt,"cleanRegex");var Pn=Symbol("evaluating");function Y(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(Y,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var Au=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(In,"isPlainObject");var En=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function H(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(H,"normalizeParams");function Sn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Sn,"optionalKeys");var An={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Fe(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(Fe,"aborted");function Te(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Te,"prefixIssues");function At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function $n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o($n,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(fr,"issue");var kn=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,Tn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=T("$ZodError",kn),rt=T("$ZodError",kn,{Parent:Error});var ku=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new de;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>be(f,s,ye())));throw mr(l,i?.callee),l}return c.value},"_parse"),Ot=ku(rt),zu=o(e=>async(t,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>be(f,s,ye())));throw mr(l,i?.callee),l}return c.value},"_parseAsync"),wt=zu(rt),Ou=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new de;return s.issues.length?{success:!1,error:new(e??zn)(s.issues.map(c=>be(c,i,ye())))}:{success:!0,data:s.value}},"_safeParse"),nt=Ou(rt),wu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>be(c,i,ye())))}:{success:!0,data:s.value}},"_safeParseAsync"),ot=wu(rt);var Ru="(?:(?:\\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])))",Nu=new RegExp(`^${Ru}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),wn=/^-?\d+n?$/,Rn=/^-?\d+$/,gr=/^-?\d+(?:\.\d+)?$/,Nn=/^(?:true|false)$/i;var Ie=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Du={number:"number",bigint:"bigint",object:"date"};var Dn=T("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);let r=Du[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(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 Cn=T("$ZodCheckNumberFormat",(e,t)=>{Ie.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=An[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=s,r&&(l.pattern=Rn)}),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>s&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Un=T("$ZodCheckMinLength",(e,t)=>{var r;Ie.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 yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ie.init(e,t),e._zod.onattach.push(i=>{let s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=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=()=>{})}),Mn=T("$ZodCheckRegex",(e,t)=>{yr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var jn={major:4,minor:3,patch:6};var q=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let g=Fe(c),v;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let _=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new de;if(v||u instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await u,c.issues.length!==_&&(g||(g=Fe(c,_)))});else{if(c.issues.length===_)continue;g||(g=Fe(c,_))}}return v?v.then(()=>c):c},"runChecks"),s=o((c,l,f)=>{if(Fe(c))return c.aborted=!0,c;let g=i(l,n,f);if(g instanceof Promise){if(f.async===!1)throw new de;return g.then(v=>e._zod.parse(v,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(v=>s(v,c,l)):s(g,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new de;return f.then(g=>i(g,n,l))}return i(f,n,l)}}Y(e,"~standard",()=>({validate:o(i=>{try{let s=nt(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ot(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dt=T("$ZodString",(e,t)=>{q.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}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Dt.init(e,t)});var Hn=T("$ZodURL",(e,t)=>{hr.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 vr=T("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=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,...s?{received:s}:{}}),r}}),Gn=T("$ZodNumberFormat",(e,t)=>{Cn.init(e,t),vr.init(e,t)}),xr=T("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Nn,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}}),qn=T("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=wn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Wn=T("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),Kn=T("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r});var Jn=T("$ZodVoid",(e,t)=>{q.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}}),Xn=T("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Fn(e,t,r){e.issues.length&&t.issues.push(...Te(r,e.issues)),t.value[r]=e.value}o(Fn,"handleArrayResult");var Yn=T("$ZodArray",(e,t)=>{q.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 s=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?s.push(f.then(g=>Fn(g,r,c))):Fn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Nt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Te(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Nt,"handlePropertyResult");function Cu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Sn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Cu,"normalizeDef");function Uu(e,t,r,n,i,s){let c=[],l=i.keySet,f=i.catchall._zod,g=f.def.type,v=f.optout==="optional";for(let b in t){if(l.has(b))continue;if(g==="never"){c.push(b);continue}let _=f.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(u=>Nt(u,r,b,t,v))):Nt(_,r,b,t,v)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(Uu,"handleCatchall");var Qn=T("$ZodObject",(e,t)=>{if(q.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=$t(()=>Cu(t));Y(e._zod,"propValues",()=>{let l=t.shape,f={};for(let g in l){let v=l[g]._zod;if(v.values){f[g]??(f[g]=new Set);for(let b of v.values)f[g].add(b)}}return f});let i=tt,s=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let g=l.value;if(!i(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let v=[],b=c.shape;for(let _ of c.keys){let u=b[_],d=u._zod.optout==="optional",y=u._zod.run({value:g[_],issues:[]},f);y instanceof Promise?v.push(y.then(m=>Nt(m,l,_,g,d))):Nt(y,l,_,g,d)}return s?Uu(v,g,l,f,n.value,e):v.length?Promise.all(v).then(()=>l):l}});function Bn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!Fe(s));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(s=>s.issues.map(c=>be(c,n,ye())))}),t)}o(Bn,"handleUnionResults");var _r=T("$ZodUnion",(e,t)=>{q.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>kt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,l=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},s);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(f=>Bn(f,i,e,s)):Bn(l,i,e,s)}});var eo=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_r.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let i={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let g of f)i[l].add(g)}}return i});let n=$t(()=>{let i=t.options,s=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(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(i,s)=>{let c=i.value;if(!tt(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,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var to=T("$ZodRecord",(e,t)=>{q.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 s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let v=t.valueType._zod.run({value:i[g],issues:[]},n);v instanceof Promise?s.push(v.then(b=>{b.issues.length&&r.issues.push(...Te(g,b.issues)),r.value[g]=b.value})):(v.issues.length&&r.issues.push(...Te(g,v.issues)),r.value[g]=v.value)}let f;for(let g in i)l.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&gr.test(l)&&f.issues.length){let b=t.keyType._zod.run({value:Number(l),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>be(b,n,ye())),input:l,path:[l],inst:e});continue}let v=t.valueType._zod.run({value:i[l],issues:[]},n);v instanceof Promise?s.push(v.then(b=>{b.issues.length&&r.issues.push(...Te(l,b.issues)),r.value[f.value]=b.value})):(v.issues.length&&r.issues.push(...Te(l,v.issues)),r.value[f.value]=v.value)}}return s.length?Promise.all(s).then(()=>r):r}});var ro=T("$ZodEnum",(e,t)=>{q.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>En.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),no=T("$ZodLiteral",(e,t)=>{if(q.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"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var oo=T("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new de;return r.value=i,r}});function Vn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Vn,"handleOptionalResult");var io=T("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${kt(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(s=>Vn(s,r.value)):Vn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ao=T("$ZodNullable",(e,t)=>{q.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${kt(r.source)}|null)$`):void 0}),Y(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 so=T("$ZodPipe",(e,t)=>{q.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Rt(c,t.in,n)):Rt(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Rt(s,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var uo=T("$ZodCustom",(e,t)=>{Ie.init(e,t),q.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(s=>Zn(s,r,n,e));Zn(i,r,n,e)}});function Zn(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(fr(i))}}o(Zn,"handleRefineResult");var lo;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 po(){return new Pr}o(po,"registry");(lo=globalThis).__zod_globalRegistry??(lo.__zod_globalRegistry=po());var Tr=globalThis.__zod_globalRegistry;function mo(e,t){return new e({type:"string",...H(t)})}o(mo,"_string");function fo(e,t){return new e({type:"string",coerce:!0,...H(t)})}o(fo,"_coercedString");function go(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}o(go,"_url");function yo(e,t){return new e({type:"number",checks:[],...H(t)})}o(yo,"_number");function ho(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}o(ho,"_coercedNumber");function vo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}o(vo,"_int");function xo(e,t){return new e({type:"boolean",...H(t)})}o(xo,"_boolean");function _o(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}o(_o,"_coercedBoolean");function Po(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}o(Po,"_coercedBigint");function To(e){return new e({type:"any"})}o(To,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function Io(e,t){return new e({type:"void",...H(t)})}o(Io,"_void");function Eo(e,t){return new e({type:"date",coerce:!0,...H(t)})}o(Eo,"_coercedDate");function Ct(e,t){return new Dn({check:"greater_than",...H(t),value:e,inclusive:!0})}o(Ct,"_gte");function le(e,t){return new Un({check:"min_length",...H(t),minimum:e})}o(le,"_minLength");function Ee(e,t){return new Mn({check:"string_format",format:"regex",...H(t),pattern:e})}o(Ee,"_regex");function So(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(So,"_custom");var Q=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");q.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>wt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=T("ZodMiniString",(e,t)=>{Dt.init(e,t),Q.init(e,t)});function a(e){return mo(Mt,e)}o(a,"string");var Ao=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Mt.init(e,t)});var Ju=T("ZodMiniURL",(e,t)=>{Hn.init(e,t),Ao.init(e,t)});function $o(e){return go(Ju,e)}o($o,"url");var Lt=T("ZodMiniNumber",(e,t)=>{vr.init(e,t),Q.init(e,t)});function re(e){return yo(Lt,e)}o(re,"number");var Xu=T("ZodMiniNumberFormat",(e,t)=>{Gn.init(e,t),Lt.init(e,t)});function ko(e){return vo(Xu,e)}o(ko,"int");var br=T("ZodMiniBoolean",(e,t)=>{xr.init(e,t),Q.init(e,t)});function V(e){return xo(br,e)}o(V,"boolean");var zo=T("ZodMiniBigInt",(e,t)=>{qn.init(e,t),Q.init(e,t)});var Yu=T("ZodMiniAny",(e,t)=>{Wn.init(e,t),Q.init(e,t)});function at(){return To(Yu)}o(at,"any");var Qu=T("ZodMiniUnknown",(e,t)=>{Kn.init(e,t),Q.init(e,t)});function O(){return bo(Qu)}o(O,"unknown");var ec=T("ZodMiniVoid",(e,t)=>{Jn.init(e,t),Q.init(e,t)});function Oo(e){return Io(ec,e)}o(Oo,"_void");var wo=T("ZodMiniDate",(e,t)=>{Xn.init(e,t),Q.init(e,t)});var tc=T("ZodMiniArray",(e,t)=>{Yn.init(e,t),Q.init(e,t)});function N(e,t){return new tc({type:"array",element:e,...H(t)})}o(N,"array");var rc=T("ZodMiniObject",(e,t)=>{Qn.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...H(t)};return new rc(r)}o(p,"object");var nc=T("ZodMiniUnion",(e,t)=>{_r.init(e,t),Q.init(e,t)});function D(e,t){return new nc({type:"union",options:e,...H(t)})}o(D,"union");var oc=T("ZodMiniDiscriminatedUnion",(e,t)=>{eo.init(e,t),Q.init(e,t)});function Se(e,t,r){return new oc({type:"union",options:t,discriminator:e,...H(r)})}o(Se,"discriminatedUnion");var ic=T("ZodMiniRecord",(e,t)=>{to.init(e,t),Q.init(e,t)});function w(e,t,r){return new ic({type:"record",keyType:e,valueType:t,...H(r)})}o(w,"record");var ac=T("ZodMiniEnum",(e,t)=>{ro.init(e,t),Q.init(e,t),e.options=Object.values(t.entries)});function M(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ac({type:"enum",entries:r,...H(t)})}o(M,"_enum");var sc=T("ZodMiniLiteral",(e,t)=>{no.init(e,t),Q.init(e,t)});function A(e,t){return new sc({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}o(A,"literal");var uc=T("ZodMiniTransform",(e,t)=>{oo.init(e,t),Q.init(e,t)});function Ae(e){return new uc({type:"transform",transform:e})}o(Ae,"transform");var cc=T("ZodMiniOptional",(e,t)=>{io.init(e,t),Q.init(e,t)});function h(e){return new cc({type:"optional",innerType:e})}o(h,"optional");var lc=T("ZodMiniNullable",(e,t)=>{ao.init(e,t),Q.init(e,t)});function st(e){return new lc({type:"nullable",innerType:e})}o(st,"nullable");var pc=T("ZodMiniPipe",(e,t)=>{so.init(e,t),Q.init(e,t)});function $e(e,t){return new pc({type:"pipe",in:e,out:t})}o($e,"pipe");var dc=T("ZodMiniCustom",(e,t)=>{uo.init(e,t),Q.init(e,t)});function jt(e,t){return So(dc,e??(()=>!0),t)}o(jt,"custom");var ut={};xn(ut,{bigint:()=>vc,boolean:()=>hc,date:()=>xc,number:()=>yc,string:()=>gc});function gc(e){return fo(Mt,e)}o(gc,"string");function yc(e){return ho(Lt,e)}o(yc,"number");function hc(e){return _o(br,e)}o(hc,"boolean");function vc(e){return Po(zo,e)}o(vc,"bigint");function xc(e){return Eo(wo,e)}o(xc,"date");var Er=p({retryOnFailure:p({defaultValue:h(V()),hide:h(V())}),continueOnFailure:p({defaultValue:h(V()),hide:h(V())})}),Ir=class{constructor(t,r,n,i,s,c,l,f,g,v,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=v;this.aiMetadata=b}static{o(this,"IAction")}},W=o(e=>new Ir(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:A(t),required:V(),defaultValue:h(at())}),"TPropertyValue");var ie=p({...B.shape,...C(a(),"SHORT_TEXT").shape}),he=p({...B.shape,...C(a(),"LONG_TEXT").shape});var No=p({label:a(),value:O()}),Ft=p({disabled:h(V()),placeholder:h(a()),options:N(No)});var ae=p({...B.shape,options:Ft,...C(O(),"STATIC_DROPDOWN").shape}),ve=p({...B.shape,options:Ft,...C(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Sr=p({...B.shape,...C(O(),"DROPDOWN").shape,refreshers:N(a())}),ct=p({...B.shape,...C(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var xe=p({...B.shape,...C(V(),"CHECKBOX").shape});var _e=p({...B.shape,...C(re(),"NUMBER").shape});var lt=p({...B.shape,streaming:h(V()),...C(O(),"FILE").shape});var pt=p({...B.shape,...C(a(),"DATE_TIME").shape});var Do=w(a(),D([ie,he,ae,ct,ve,xe,_e,lt,pt])),dt=p({...B.shape,properties:Do,...C(N(O()),"ARRAY").shape});var mt=p({...B.shape,...C(D([w(a(),O())]),"JSON").shape});var Co=D([ie,ae,mt,dt,ve]),Pc=w(a(),Co),Ar=p({refreshers:N(a()),...B.shape,...C(O(),"DYNAMIC").shape});var Bt=p({...B.shape,...C(Oo(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ve=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Ve||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),$r="both_client_credentials_and_authorization_code";var ke=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ke||{}),yt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(yt||{}),Tc=p({strategy:M(yt),paramName:h(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Vt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vt||{}),Uo=p({status:h(re()),body:h(O()),headers:h(w(a(),a()))}),Mo=p({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(M(Vt))}),Lo=p({type:A("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Uo,handlerId:h(a()),streamStepProgress:h(M(Vt))}),bc=D([Mo,Lo]);var Ic=p({body:O(),rawBody:h(O()),headers:w(a(),a()),queryParams:w(a(),a())});function ee(e){return e==null}o(ee,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var kr=Le(require("crypto"),1);var Ec=128,De,Ze,Sc=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*Ec),kr.default.randomFillSync(De),Ze=0):Ze+e>De.length&&(kr.default.randomFillSync(De),Ze=0),Ze+=e},"fillPool"),Ac=o(e=>(Sc(e|=0),De.subarray(Ze-e,Ze)),"random"),$c=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===s)return c}}},"customRandom"),Fo=o((e,t=21)=>$c(e,t,Ac),"customAlphabet");var kc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bo=21,jT=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Bo}}$`))),zc=Fo(kc,Bo);var ze=$e(Ae(e=>e instanceof Date?e.toISOString():e),a()),se={id:a(),created:ze,updated:ze},G=o(e=>h(st(e)),"Nullable");function zr(e){return h(st(M(e)))}o(zr,"NullableEnum");var VT=$e(Ae(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(V())),Ht=o(e=>$e(Ae(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var GT=w(a(),O());var xt=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(xt||{});var ob=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var ab=p({filename:a(),data:O(),type:A("file"),mimetype:h(a())});var Oc=Le(Zo());var mb=p({...se,name:a(),permissions:N(a()),platformId:G(a()),type:a(),userCount:h(re())});var Ho=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ho||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),wr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wr||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var wc=p({mode:M(Ho),value:O()}),Rc=p({auth:h(a()),fields:w(a(),wc)}),Nc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(Rc)}),Dc=p({type:A("PIECE"),toolName:a().check(le(1)),pieceMetadata:Nc}),Cc=p({type:A("none")}),Uc=p({type:A("access_token"),accessToken:a()}),Mc=p({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),Lc=p({type:A("headers"),headers:w(a(),a())}),jc=Se("type",[Cc,Uc,Mc,Lc]),Go=p({type:A("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:h(a())}),qo=p({type:A("MCP"),toolName:a().check(le(1)),serverUrl:$o(),protocol:M(wr),auth:jc}),Wo=p({type:A("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:M(Or),sourceId:a(),sourceName:a()}),Fc=Se("type",[Dc,Go,qo,Wo]),Bc=p({displayName:a(),description:h(a()),type:M(Rr)}),Ko=p({type:A("MARKDOWN"),markdown:a()}),He={type:A("TOOL_CALL"),input:G(w(a(),O())),output:h(O()),toolName:a(),status:M(Nr),toolCallId:a(),startTime:a(),endTime:h(a())},Zb=p(He),Jo=Se("toolCallType",[p({...He,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:A("UNKNOWN"),displayName:a()})]),Vc=D([Ko,Jo]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),Pe=p({apiKey:a()}),Zc=Pe,Hc=p({apiKey:a(),apiKeyHash:a()}),Gc=Pe,qc=Pe,Wc=Pe,Kc=Pe,Jc=Pe,Xc=Pe,Yc=Pe,ti=p({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Qc=p({}),el=p({}),tl=p({}),rl=p({}),nl=p({}),ol=p({}),ri=p({modelId:a(),modelName:a(),modelType:M(Dr)}),ni=p({apiKeyHeader:a(),baseUrl:a(),models:N(ri),defaultHeaders:h(w(a(),a()))}),oi=p({accountId:a(),gatewayId:a(),models:N(ri),vertexProject:h(a()),vertexRegion:h(a())}),ii=p({resourceName:a(),apiVersion:$e(Ae(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ai=p({region:a().check(le(1))}),il=D([Zc,Wc,Kc,Jc,Xc,qc,Gc,Hc,ti,Yc]),si=D([ni,oi,ii,ai,Qc,tl,rl,nl,el,ol]),al=p({id:a(),name:a(),type:M(Dr)}),sl=p({id:a(),name:a(),provider:M(xt),config:si,enabledForChat:V()}),ul=p({provider:M(xt),config:si,auth:il,platformId:a()});var Wb={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Xo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],cl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],ll=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Yo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],pl=["grok-4.20","grok-4.1-fast"],dl={openai:Xo,anthropic:cl,google:Yo,activepieces:[...ll.map(e=>`anthropic/${e}`),...Xo.map(e=>`openai/${e}`),...Yo.map(e=>`google/${e}`),...pl.map(e=>`x-ai/${e}`)]};var Qo=128e3,ml={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function fl({provider:e}){return e?ml[e]??Qo:Qo}o(fl,"getMaxContextTokens");var ei={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"},gl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},yl=new Set(["anthropic","mistral"]);function me(e){return{chatModels:dl[e],maxContextTokens:fl({provider:e}),defaultEmbeddingModel:ei[e],supportsEmbedding:ei[e]!==void 0,supportsImageGeneration:!yl.has(e),webSearch:gl[e]}}o(me,"buildProviderCapabilities");var hl={openai:me("openai"),anthropic:me("anthropic"),openrouter:me("openrouter"),azure:me("azure"),google:me("google"),"cloudflare-gateway":me("cloudflare-gateway"),custom:me("custom"),bedrock:me("bedrock"),mistral:me("mistral"),activepieces:me("activepieces")};var vl=p({base64Url:a(),fileName:a(),extension:h(a())}),xl=p({mimeType:a(),url:a(),fileName:h(a())}),Cr=D([vl,xl]);var _l=D([p({type:A("file"),value:Cr}),p({type:A("markdown"),value:a(),files:h(N(Cr))})]),Pl=p({sessionId:a(),message:a(),files:h(N(a()))});var ci=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ci||{}),li=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(li||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var Tl=D([p({...se,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...se,name:a(),externalId:a(),type:D([A("TEXT"),A("NUMBER"),A("DATE")]),tableId:a(),projectId:a()})]),bl=p({...se,name:a(),folderId:G(a()),projectId:a(),externalId:a(),status:zr(li),trigger:zr(ci)}),Il=p({...se,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),El=p({events:N(M(Ur)),webhookUrl:a(),flowId:a()}),Sl=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),Al=p({projectId:a(),limit:h(ut.number()),cursor:h(a()),name:h(a()),externalIds:Ht(a()),folderId:h(a()),folderIds:Ht(a())}),$l=p({records:N(N(p({fieldId:a(),value:di()}))),tableId:a()}),kl=p({cells:h(N(p({fieldId:a(),value:di()}))),tableId:a(),agentUpdate:h(V())}),pi=Se("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),ui("exists"),ui("not_exists")]),zl=p({tableId:a(),limit:h(ut.number()),cursor:h(a()),filters:Ht(pi)});function di(){return $e(Ae(e=>e==null?e:String(e)),st(a()))}o(di,"coerceToString");function Ce(e){return p({fieldId:a(),operator:A(e),value:a()})}o(Ce,"valueFilter");function ui(e){return p({fieldId:a(),operator:A(e)})}o(ui,"existenceFilter");var Ol=p({status:h(re()),body:h(O()),headers:h(w(a(),a()))}),wl=p({...se,deleted:G(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:G(a())});var mi=p({name:a(),description:h(a()),type:a(),required:V()}),Rl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(mi),returnsResponse:V()})});var fi="^[0-9]+\\.[0-9]+\\.[0-9]+$",mI=new RegExp(fi),Dl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",fI=a().check(Ee(new RegExp(fi))),gI=a().check(Ee(new RegExp(Dl))),Cl=p({packageType:A("ARCHIVE"),pieceType:M(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),gi=p({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),yi=p({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),yI=D([gi,yi]),hI=D([Cl,gi,yi]);var Ul=Se("type",[p({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:A("INTERVAL"),intervalMs:ko().check(Ct(6e4))})]),vI=p({...se,type:M(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:G(Ul),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:G(a()),simulate:V()}),hi=(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))(hi||{}),vi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(vi||{}),xi=(r=>(r.S3="S3",r.DB="DB",r))(xi||{}),xI=p({...se,projectId:G(a()),platformId:G(a()),type:M(hi),compression:M(vi),data:h(O()),location:M(xi),size:G(re()),fileName:G(a()),s3Key:G(a()),metadata:G(w(a(),a()))}),_i=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_i||{}),Pi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Pi||{}),_I=p({id:a(),email:a(),firstName:a(),status:M(Pi),externalId:G(a()),platformId:G(a()),platformRole:M(_i),lastName:a(),created:ze,updated:ze,lastActiveDate:G(ze),imageUrl:G(a())});var Mr=p({...B.shape,...C(w(a(),O()),"OBJECT").shape});var Ei=p({...B.shape,...C(a(),"COLOR").shape});var Lr=D([ie,he,Bt,xe,ae,ve,Sr,ct,Ar,_e,dt,Mr,mt,pt,lt,Ei]),I={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var fe=p({displayName:a(),description:h(a())});var Si=p({username:a(),password:a()}),jr=p({...fe.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(Si,"BASIC_AUTH").shape});var Fl=w(a(),D([ie,he,_e,xe,ae])),Fr=p({...fe.shape,props:Fl,...C(O(),"CUSTOM_AUTH").shape});var Ue=p({...fe.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Bl=w(a(),D([ie,he,Ue,_e,xe,ae,ve,Bt])),Ai=p({...fe.shape,props:Bl,...C(O(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),$i=D([ie,Ue,ae]),ki=w(a(),$i),Vl=p({props:h(w(a(),$i)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([A("none"),A("consent"),A("login"),A("omit")])),pkce:h(V()),pkceMethod:h(D([A("plain"),A("S256")])),authorizationMethod:h(M(Br)),grantType:h(D([M(gt),A($r)])),extra:h(w(a(),a()))}),zi=p({access_token:a(),props:h(ki),data:w(a(),at())}),Vr=p({...fe.shape,...Vl.shape,...C(zi,"OAUTH2").shape});var Ge=D([jr,Fr,Ai,Vr,Ue]),_t="Connection",Zr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||_t}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||_t,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||_t}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||_t}},None(){}};var YE={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 Zl=p({...B.shape,...C(O(),"CUSTOM").shape,code:a()});var Hl=D([Lr,Ge]),Hr=w(a(),Hl),vS=w(a(),Lr);var Oi=D([p({strategy:A("CRON"),cronExpression:a()}),p({strategy:A("NONE")})]),qe=class{constructor(t,r,n,i,s,c,l,f,g,v,b,_,u,d,y,m,x,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=v;this.onEnable=b;this.onDisable=_;this.onStart=u;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=j}static{o(this,"ITrigger")}},wi=o(e=>{switch(e.type){case"WEBHOOK":return new qe(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 qe(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 qe(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 qe(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ee(e.sampleData)&&ee(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ri="2",qt="0.82.0";var Gr=class{constructor(t,r,n,i,s,c,l,f,g=qt,v,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=v;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ri}),"getContextInfo");(!Gl(g)||ql(g,qt))&&(this.minimumSupportedRelease=qt),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}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}},Ni=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Gr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Gl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Gl,"isValidSimpleSemver");function ql(e,t){let[r,n,i]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<l}o(ql,"isSemverLessThan");var Wl=h(w(a(),w(a(),a()))),Di=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Ge,N(Ge)])),version:a(),categories:h(N(M(Ve))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(V()),i18n:Wl}),Kl=M(["human","ai","both"]),Ci=p({description:h(a()),idempotent:h(V())}),Ui=p({name:a(),displayName:a(),description:a(),props:Hr,requireAuth:V(),errorHandlingOptions:h(Er),outputSchema:h(jt()),audience:h(Kl),aiMetadata:h(Ci)}),Mi=p({name:a(),displayName:a(),description:a(),props:Hr,errorHandlingOptions:h(Er),type:M(ke),sampleData:O(),handshakeConfiguration:h(jt()),renewConfiguration:h(Oi),testStrategy:M(ht),outputSchema:h(jt()),aiMetadata:h(Ci)}),Jl=p({...Di.shape,actions:w(a(),Ui),triggers:w(a(),Mi)}),Xl=p({...Di.shape,actions:re(),triggers:re(),suggestedActions:h(N(Ui)),suggestedTriggers:h(N(Mi))}),Li=p({projectUsage:re(),pieceType:M(Be),packageType:M(ft),platformId:h(a()),archiveId:h(a())}),vA=p({...Jl.shape,...Li.shape}),xA=p({...Xl.shape,...Li.shape}),_A=p({name:a(),version:a()});var Yl=Le(require("path")),Ql=Le(require("fs/promises"));var Bi=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((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new qr,r=new Wr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},qr=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 Jt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Xt=class extends Wt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,oe]of Object.entries(c))i.append(j,oe);let l=i.toString(),f=l?`${n}?${l}`:n,g=t.responseType??"json",v=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:u,isStream:d}=ep(t.body,s),y=rp({...s,...u}),m=await tp(async()=>{let j=new AbortController,oe=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:y,body:_,redirect:v?"follow":"manual",signal:j.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(f,ce)}finally{oe!==void 0&&clearTimeout(oe)}},b),x=v?300:400;if(m.status<200||m.status>=x){let j=await ji(m,g),oe=new Jt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",oe),oe}let P=await ji(m,g);return{status:m.status,headers:np(m.headers),body:P}}};function ep(e,t){if(ip(e))return{body:void 0,extraHeaders:{},isStream:!1};if(op(e)){let n=new Bi.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(ep,"serializeBody");async function ji(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(ji,"parseResponseBody");async function tp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Fi(n);continue}return i}catch(i){if(r=i,n<t){await Fi(n);continue}throw i}throw r}o(tp,"sendWithRetries");function Fi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Fi,"backoff");function rp(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(rp,"normalizeHeaders");function np(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(np,"toHttpHeaders");function op(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(op,"isNodeFormData");function ip(e){return e==null}o(ip,"isNil");var J=new Xt;var ue=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ue||{});var Gd=Le(require("fs")),Ws=Le(qs());var qd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function Wd(e){let t=e.split(";")[0].trim().toLowerCase();return qd[t]??""}o(Wd,"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"),Jd=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 Ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:l,authLocation:f="headers"}){return W({audience:"human",name:s||"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:I.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:I.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Jd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:I.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ue).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:I.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:I.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:I.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:I.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let v=g,b={};switch(v){case"none":break;case"json":b.data=I.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=I.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=I.Array({displayName:"Form Data",required:!0,properties:{fieldName:I.ShortText({displayName:"Field Name",required:!0}),fieldType:I.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:I.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:I.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:I.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:I.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:I.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:I.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async g=>{let{method:v,url:b,headers:_,queryParams:u,body:d,body_type:y,failsafe:m,timeout:x,response_is_binary:P,followRedirects:j}=g.propsValue;Zt(v,"Method"),Zt(b,"URL");let oe=ee(r)?{}:await r(g.auth,g.propsValue),ce=b.url,Qe=ce.startsWith("http://")||ce.startsWith("https://")?ce:Kd({baseUrl:t(g.auth),relativePath:ce}),Ne={method:v,url:Qe,headers:{..._??{},...f==="headers"||!ee(f)?oe:{}},queryParams:{...f==="queryParams"?oe:{},...u??{}},timeout:x?x*1e3:0,followRedirects:j};if(P&&(Ne.responseType="arraybuffer"),d)if(y&&y!=="none"){let ge=d.data;if(y==="form_data"){let xu=ge,Et=new Ws.default;for(let{fieldName:yn,fieldType:hn,textFieldValue:vn,fileFieldValue:cr}of xu)hn==="text"&&!vt(vn)?Et.append(yn,vn):hn==="file"&&!vt(cr)&&Et.append(yn,cr.data,{filename:cr?.filename});Ne.body=Et,Ne.headers={...Ne.headers,...Et.getHeaders()}}else Ne.body=ge}else y||(Ne.body=d);try{let ge=await J.sendRequest(Ne);return await Xd(g.files,ge.body,ge.status,ge.headers,P)}catch(ge){if(m)return ge.errorMessage();throw ge}},"run")})}o(Ks,"createCustomApiCallAction");var Xd=o(async(e,t,r,n,i)=>{let s;if(i&&Yd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Wd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:f})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Yd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var It={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(ee(l))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),g=f.reduce((v,b)=>Math.max(v,b.epochMilliSeconds),l);return await t.put("lastPoll",g),f.filter(v=>v.epochMilliSeconds>l).map(v=>v.data)}case 1:{let l=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:s,server:c}),g=f.findIndex(_=>_.id===l),v=[];ee(l)||g==-1?v=f??[]:v=f?.slice(0,g)??[],ee(i)||(v=v.slice(-i));let b=v?.[0]?.id;return ee(b)||await t.put("lastItem",b),v.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;ee(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:s});break}}return Qd(c.map(l=>l.data))}};function Qd(e){return e.length<=5?e:e.slice(0,5)}o(Qd,"getFirstFiveOrAll");var Z=Zr.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:["https://www.googleapis.com/auth/tasks"]});var U={baseUrl:"https://tasks.googleapis.com",tasksList:I.Dropdown({displayName:"Tasks List",auth:Z,refreshers:[],required:!0,options:o(async({auth:e})=>e?{disabled:!1,options:(await em(e)).map(n=>({label:n.title,value:n.id}))}:{disabled:!0,placeholder:"Please connect your account first",options:[]},"options")}),title:I.ShortText({displayName:"Title",required:!0}),notes:I.LongText({displayName:"Notes",required:!1}),due:I.DateTime({displayName:"Due Date",description:"Due date of the task (YYYY-MM-DD)",required:!1}),completed:I.Checkbox({displayName:"Completed",description:"Mark task as completed",required:!1})};async function em(e){let t={method:"GET",url:`${U.baseUrl}/tasks/v1/users/@me/lists`,authentication:{type:"BEARER_TOKEN",token:e.access_token}};return(await J.sendRequest(t)).body.items}o(em,"getLists");async function sr(e,t,r){let n={method:"GET",url:`${U.baseUrl}/tasks/v1/lists/${t}/tasks`,authentication:{type:"BEARER_TOKEN",token:e.access_token},queryParams:r};return(await J.sendRequest(n)).body.items??[]}o(sr,"getTasks");async function Js(e,t,r){let n={method:"POST",url:`${U.baseUrl}/tasks/v1/lists/${t}/tasks`,authentication:{type:"BEARER_TOKEN",token:e.access_token},body:r};return J.sendRequest(n)}o(Js,"createTask");var Re=[{key:"title",label:"Title"},{key:"status",label:"Status"},{key:"id",label:"Task ID"},{key:"notes",label:"Notes"},{key:"due",label:"Due Date",format:"date"},{key:"completed",label:"Completed At",format:"datetime"},{key:"updated",label:"Updated At",format:"datetime"},{key:"parent",label:"Parent Task ID"},{key:"position",label:"Position"},{key:"webViewLink",label:"Task Link",format:"url"}],tm=[{key:"title",label:"Title"},{key:"id",label:"Task List ID"},{key:"updated",label:"Updated At",format:"datetime"}],Xs={fields:Re},Ys={fields:Re},Qs={fields:Re},eu={fields:Re},tu={fields:Re},ru={fields:[{key:"body",label:"Task",value:"body",children:Re}]},nu={fields:[{key:"tasks",label:"Tasks",listItems:Re,labelKey:"title"},{key:"count",label:"Count",format:"number"}]},ou={fields:[{key:"taskLists",label:"Task Lists",listItems:tm,labelKey:"title"},{key:"count",label:"Count",format:"number"}]},iu={fields:[{key:"cleared",label:"Cleared",format:"boolean"}]},au={fields:[{key:"deleted",label:"Deleted",format:"boolean"},{key:"alreadyAbsent",label:"Already Absent",format:"boolean"}]},su={fields:Re};var uu=W({auth:Z,name:"add_task",description:"Add a new task to a specified task list",audience:"human",aiMetadata:{description:"Creates a new task in a specific Google Tasks list, with optional notes, due date, and a completed flag. Use to add a to-do item for the authenticated user; requires a valid task-list ID (resolve it first if you only have a list name). Not idempotent: each call appends a separate task even with identical input.",idempotent:!1},displayName:"Add Task",outputSchema:ru,props:{tasks_list:U.tasksList,title:U.title,notes:U.notes,due:U.due,completed:U.completed},async run({auth:e,propsValue:t}){let r={kind:"tasks#task",status:t.completed?"completed":"needsAction",title:t.title,completed:t.completed?new Date().toISOString():"",notes:t.notes,due:t.due?`${new Date(t.due).toISOString().split("T")[0]}T00:00:00Z`:void 0};return Js(e,t.tasks_list,r)}});var cu=W({auth:Z,name:"find_tasks",displayName:"Find Tasks",description:"Search and list tasks in a task list with optional date-range and status filters.",audience:"ai",aiMetadata:{description:"List tasks in a task list, filtered by due/completed/updated date ranges and status. The piece is otherwise write-only \u2014 call this first to find a task's id before completing, updating, or deleting it. Read-only.",idempotent:!0},outputSchema:nu,props:{tasks_list:U.tasksList,show_completed:I.Checkbox({displayName:"Show Completed",description:"Include completed tasks in results. Defaults to true.",required:!1,defaultValue:!0}),show_hidden:I.Checkbox({displayName:"Show Hidden",description:"Include hidden tasks (tasks that have been completed and a day has passed). Defaults to false.",required:!1,defaultValue:!1}),due_min:I.DateTime({displayName:"Due Date From",description:"Return tasks due on or after this date. RFC 3339 timestamp, e.g. 2026-06-01T00:00:00Z.",required:!1}),due_max:I.DateTime({displayName:"Due Date To",description:"Return tasks due before this date (exclusive). RFC 3339 timestamp, e.g. 2026-07-01T00:00:00Z.",required:!1}),completed_min:I.DateTime({displayName:"Completed Date From",description:"Return tasks completed on or after this date. RFC 3339 timestamp.",required:!1}),completed_max:I.DateTime({displayName:"Completed Date To",description:"Return tasks completed before this date (exclusive). RFC 3339 timestamp.",required:!1}),updated_min:I.DateTime({displayName:"Updated Since",description:'Return tasks last modified on or after this date. Useful for "since last run" incremental reads. RFC 3339 timestamp.',required:!1}),max_results:I.Number({displayName:"Max Results",description:"Maximum number of tasks to return (1\u2013100). Defaults to 20 when omitted.",required:!1})},async run({auth:e,propsValue:t}){let r=e,n={};t.show_completed!==void 0&&t.show_completed!==null&&(n.showCompleted=t.show_completed),t.show_hidden!==void 0&&t.show_hidden!==null&&(n.showHidden=t.show_hidden),t.due_min&&(n.dueMin=new Date(t.due_min).toISOString()),t.due_max&&(n.dueMax=new Date(t.due_max).toISOString()),t.completed_min&&(n.completedMin=new Date(t.completed_min).toISOString()),t.completed_max&&(n.completedMax=new Date(t.completed_max).toISOString()),t.updated_min&&(n.updatedMin=new Date(t.updated_min).toISOString()),t.max_results&&(n.maxResults=t.max_results);let i=await sr(r,t.tasks_list,n);return{tasks:i,count:i.length}}});var lu=W({auth:Z,name:"complete_task",displayName:"Mark Task Complete",description:"Mark an existing task as completed.",audience:"ai",aiMetadata:{description:"Mark an existing task as completed (by task id). Idempotent \u2014 re-completing a done task is a no-op. Use Update Task to reopen or edit other fields.",idempotent:!0},outputSchema:Ys,props:{tasks_list:U.tasksList,task_id:I.ShortText({displayName:"Task ID",description:"The ID of the task to mark as completed. Obtain the id from Find Tasks.",required:!0})},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n,task_id:i}=t;return(await J.sendRequest({method:"PATCH",url:`${U.baseUrl}/tasks/v1/lists/${n}/tasks/${i}`,authentication:{type:"BEARER_TOKEN",token:r.access_token},body:{status:"completed"}})).body}});var pu=W({auth:Z,name:"update_task",displayName:"Update Task",description:"Edit an existing task \u2014 title, notes, due date, or status.",audience:"ai",aiMetadata:{description:"Edit an existing task's title, notes, due date, or status (e.g. rename, change due date, reopen). Partial update \u2014 only provided fields change. Not idempotent (use Mark Task Complete for the common complete case).",idempotent:!1},outputSchema:tu,props:{tasks_list:U.tasksList,task_id:I.ShortText({displayName:"Task ID",description:"The ID of the task to update. Obtain the id from Find Tasks.",required:!0}),title:I.ShortText({displayName:"Title",description:"New title for the task.",required:!1}),notes:I.LongText({displayName:"Notes",description:"New notes / description for the task.",required:!1}),due:I.DateTime({displayName:"Due Date",description:"New due date for the task. RFC 3339 timestamp, e.g. 2026-07-15T00:00:00Z.",required:!1}),status:I.StaticDropdown({displayName:"Status",description:"Task status. To simply complete a task prefer Mark Task Complete; set needsAction here to reopen a completed task.",required:!1,options:{options:[{label:"Needs Action",value:"needsAction"},{label:"Completed",value:"completed"}]}})},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n,task_id:i,title:s,notes:c,due:l,status:f}=t,g={};return s!=null&&s!==""&&(g.title=s),c!=null&&(g.notes=c),l!=null&&(g.due=`${new Date(l).toISOString().split("T")[0]}T00:00:00Z`),f!=null&&(g.status=f),(await J.sendRequest({method:"PATCH",url:`${U.baseUrl}/tasks/v1/lists/${n}/tasks/${i}`,authentication:{type:"BEARER_TOKEN",token:r.access_token},body:g})).body}});var du=W({auth:Z,name:"delete_task",displayName:"Delete Task",description:"Permanently delete a task by ID.",audience:"ai",aiMetadata:{description:"Delete a task by id. Idempotent \u2014 deleting an already-removed task succeeds (converges to absent).",idempotent:!0},outputSchema:au,props:{tasks_list:U.tasksList,task_id:I.ShortText({displayName:"Task ID",description:"The ID of the task to delete. Obtain the id from Find Tasks.",required:!0})},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n,task_id:i}=t;try{await J.sendRequest({method:"DELETE",url:`${U.baseUrl}/tasks/v1/lists/${n}/tasks/${i}`,authentication:{type:"BEARER_TOKEN",token:r.access_token}})}catch(s){if(s?.response?.status===404||s?.status===404)return{deleted:!0,alreadyAbsent:!0};throw s}return{deleted:!0,alreadyAbsent:!1}}});var mu=W({auth:Z,name:"create_task",displayName:"Create Task",description:"Create a new task in a task list, optionally as a subtask and/or positioned after a sibling.",audience:"ai",aiMetadata:{description:"Create a new task in a task list, optionally as a subtask of a parent task (parent_task_id) and/or positioned after a sibling (previous_task_id); resolve those ids via Find Tasks. Use to add a single to-do; for marking an existing task done use Mark Task Complete. Not idempotent \u2014 each call creates a separate task.",idempotent:!1},outputSchema:Qs,props:{tasks_list:U.tasksList,title:U.title,notes:U.notes,due_date:U.due,parent_task_id:I.ShortText({displayName:"Parent Task ID",description:"Make this a subtask of the task with this id (must be in the same list). Obtain the id from Find Tasks. Omit to create a top-level task.",required:!1}),previous_task_id:I.ShortText({displayName:"Previous Task ID",description:"Place the new task immediately after the sibling with this id. Obtain the id from Find Tasks. Omit to place it first among its siblings.",required:!1})},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n,title:i,notes:s,due_date:c,parent_task_id:l,previous_task_id:f}=t,g={kind:"tasks#task",status:"needsAction",title:i,notes:s,due:c?`${new Date(c).toISOString().split("T")[0]}T00:00:00Z`:void 0},v={};l&&(v.parent=l),f&&(v.previous=f);let b={method:"POST",url:`${U.baseUrl}/tasks/v1/lists/${n}/tasks`,authentication:{type:"BEARER_TOKEN",token:r.access_token},body:g,queryParams:v};return(await J.sendRequest(b)).body}});var fu=W({auth:Z,name:"get_task",displayName:"Get Task",description:"Fetch a single task by its ID.",audience:"ai",aiMetadata:{description:"Fetch a single task's full details (title, notes, due, status, parent, position, links) by its id. Use when you already have a specific task id and want its current state; to find tasks by criteria use Find Tasks instead. Read-only.",idempotent:!0},outputSchema:Xs,props:{tasks_list:U.tasksList,task_id:I.ShortText({displayName:"Task ID",description:"The ID of the task to fetch. Obtain the id from Find Tasks.",required:!0})},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n,task_id:i}=t;return(await J.sendRequest({method:"GET",url:`${U.baseUrl}/tasks/v1/lists/${n}/tasks/${i}`,authentication:{type:"BEARER_TOKEN",token:r.access_token}})).body}});var gu=W({auth:Z,name:"move_task",displayName:"Move Task",description:"Reposition or reparent a task within its list, or move it to another list.",audience:"ai",aiMetadata:{description:"Move a task to a new position within its list \u2014 reparent it under another task (parent_task_id) and/or place it after a sibling (previous_task_id); omit both to move it to the top level. Optionally move it to a different list (destination_tasklist_id). All ids come from Find Tasks, and parent/previous must reference tasks in the destination list. Use this for reordering/nesting; use Update Task to change a task's fields. Not idempotent \u2014 position depends on current order.",idempotent:!1},outputSchema:eu,props:{tasks_list:U.tasksList,task_id:I.ShortText({displayName:"Task ID",description:"The ID of the task to move. Obtain the id from Find Tasks.",required:!0}),parent_task_id:I.ShortText({displayName:"Parent Task ID",description:"Reparent the task under the task with this id (must be in the destination list). Obtain the id from Find Tasks. Omit to move it to the top level.",required:!1}),previous_task_id:I.ShortText({displayName:"Previous Task ID",description:"Place the task immediately after the sibling with this id (must be in the destination list). Obtain the id from Find Tasks. Omit to place it first among its siblings; to move it to the end, pass the last sibling's id (read the current order with Find Tasks).",required:!1}),destination_tasklist_id:I.ShortText({displayName:"Destination Task List ID",description:"Move the task to this task list. Omit to keep it in the current list. Recurring tasks cannot be moved between lists.",required:!1})},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n,task_id:i,parent_task_id:s,previous_task_id:c,destination_tasklist_id:l}=t,f={};s&&(f.parent=s),c&&(f.previous=c),l&&(f.destinationTasklist=l);let g={method:"POST",url:`${U.baseUrl}/tasks/v1/lists/${n}/tasks/${i}/move`,authentication:{type:"BEARER_TOKEN",token:r.access_token},queryParams:f};return(await J.sendRequest(g)).body}});var yu=W({auth:Z,name:"clear_completed_tasks",displayName:"Clear Completed Tasks",description:"Hide all completed tasks in a task list.",audience:"ai",aiMetadata:{description:"Hide all completed tasks in a task list (they are marked hidden and drop out of the default view, not permanently deleted). Use to tidy a list after a batch of completions. Affects every completed task at once \u2014 there is no per-task selection; to remove a single task use Delete Task. Not idempotent \u2014 operates on whatever is completed at call time.",idempotent:!1},outputSchema:iu,props:{tasks_list:U.tasksList},async run({auth:e,propsValue:t}){let r=e,{tasks_list:n}=t;return await J.sendRequest({method:"POST",url:`${U.baseUrl}/tasks/v1/lists/${n}/clear`,authentication:{type:"BEARER_TOKEN",token:r.access_token}}),{cleared:!0}}});var hu=W({auth:Z,name:"list_task_lists",displayName:"List Task Lists",description:"List the authenticated user's task lists (id and title).",audience:"ai",aiMetadata:{description:"List the authenticated user's task lists, returning each list's id and title. Use to resolve a list name to its id before operating on tasks, or to discover available lists. Read-only.",idempotent:!0},outputSchema:ou,props:{max_results:I.Number({displayName:"Max Results",description:"Maximum number of task lists to return (1\u2013100). Defaults to 20 when omitted.",required:!1})},async run({auth:e,propsValue:t}){let r=e,{max_results:n}=t,i={};n&&(i.maxResults=String(n));let s={method:"GET",url:`${U.baseUrl}/tasks/v1/users/@me/lists`,authentication:{type:"BEARER_TOKEN",token:r.access_token},queryParams:i},l=(await J.sendRequest(s)).body.items??[];return{taskLists:l,count:l.length}}});var nm={tasks_list:U.tasksList},ur={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>(await sr(e,t.tasks_list)).filter(s=>Date.parse(s.updated??"0")>r).map(s=>({epochMilliSeconds:Date.parse(s.updated??"0"),data:s})),"items")},vu=wi({auth:Z,name:"new_task",displayName:"New Task",description:"Triggers when a task is created",aiMetadata:{description:"Fires when a task in the selected Google Tasks list is newly created or updated since the last poll, emitting the task that changed. Use to react to additions or edits in a specific task list."},type:"POLLING",props:nm,outputSchema:su,sampleData:{},async test(e){let t=e.store,r=e.auth,n=e.propsValue;return await It.test(ur,{store:t,auth:r,propsValue:n,files:e.files})},async onEnable(e){let t=e.store,r=e.auth,n=e.propsValue;await It.onEnable(ur,{store:t,auth:r,propsValue:n})},async onDisable(e){let t=e.store,r=e.auth,n=e.propsValue;await It.onEnable(ur,{store:t,auth:r,propsValue:n})},async run(e){let t=e.store,r=e.auth,n=e.propsValue;return await It.poll(ur,{store:t,auth:r,propsValue:n,files:e.files})}});var om=Ni({minimumSupportedRelease:"0.86.4",logoUrl:"https://cdn.activepieces.com/pieces/google-tasks.png",categories:["PRODUCTIVITY"],actions:[uu,cu,lu,pu,du,mu,fu,gu,yu,hu,Ks({baseUrl:o(()=>U.baseUrl,"baseUrl"),auth:Z,authMapping:o(async e=>({Authorization:`Bearer ${e.access_token}`}),"authMapping")})],displayName:"Google Tasks",description:"Task list management application",authors:["Salem-Alaa","kishanprmr","MoShizzle","khaledmashaly","abuaboud"],triggers:[vu],auth:Z});0&&(module.exports={googleTasks});
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
mime-types/index.js:
|
|
7
|
+
(*!
|
|
8
|
+
* mime-types
|
|
9
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
10
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*)
|
|
13
|
+
*/
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,+JAoBtB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAIwC;AACxC,iDAAqD;AACrD,qDAAqE;AACrE,yCAAiD;AACjD,sDAAyD;AACzD,qCAA6C;AAEhC,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,sDAAsD;IAC/D,UAAU,EAAE,CAAC,sBAAa,CAAC,YAAY,CAAC;IACxC,OAAO,EAAE;QACP,sCAA2B;QAC3B,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,0BAAiB,CAAC,OAAO;YACxC,IAAI,EAAE,sBAAe;YACrB,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,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,kCAAkC;IAE/C,OAAO,EAAE,CAAC,YAAY,EAAC,YAAY,EAAC,WAAW,EAAC,eAAe,EAAC,UAAU,CAAC;IAC3E,QAAQ,EAAE,CAAC,yBAAc,CAAC;IAC1B,IAAI,EAAE,sBAAe;CACtB,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const googleTasksAddNewTaskAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
-
tasks_list: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
3
|
-
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
5
|
-
due: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
6
|
-
completed: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=new-task.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-task.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/new-task.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,2BAA2B;;;;;;EAiCtC,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleTasksAddNewTaskAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const common_1 = require("../common");
|
|
7
|
-
const auth_1 = require("../auth");
|
|
8
|
-
exports.googleTasksAddNewTaskAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.googleTasksAuth,
|
|
10
|
-
name: 'add_task',
|
|
11
|
-
description: 'Add a new task to a specified task list',
|
|
12
|
-
audience: 'both',
|
|
13
|
-
aiMetadata: {
|
|
14
|
-
description: 'Creates a new task in a specific Google Tasks list, with optional notes, due date, and a completed flag. Use to add a to-do item for the authenticated user; requires a valid task-list ID (resolve it first if you only have a list name). Not idempotent: each call appends a separate task even with identical input.',
|
|
15
|
-
idempotent: false,
|
|
16
|
-
},
|
|
17
|
-
displayName: 'Add Task',
|
|
18
|
-
props: {
|
|
19
|
-
tasks_list: common_1.googleTasksCommon.tasksList,
|
|
20
|
-
title: common_1.googleTasksCommon.title,
|
|
21
|
-
notes: common_1.googleTasksCommon.notes,
|
|
22
|
-
due: common_1.googleTasksCommon.due,
|
|
23
|
-
completed: common_1.googleTasksCommon.completed,
|
|
24
|
-
},
|
|
25
|
-
run(_a) {
|
|
26
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
27
|
-
const task = {
|
|
28
|
-
kind: 'tasks#task',
|
|
29
|
-
status: propsValue.completed
|
|
30
|
-
? common_1.TaskStatus.COMPLETED
|
|
31
|
-
: common_1.TaskStatus.NEEDS_ACTION,
|
|
32
|
-
title: propsValue.title,
|
|
33
|
-
completed: propsValue.completed ? new Date().toISOString() : '',
|
|
34
|
-
notes: propsValue.notes,
|
|
35
|
-
due: propsValue.due
|
|
36
|
-
? `${new Date(propsValue.due).toISOString().split('T')[0]}T00:00:00Z`
|
|
37
|
-
: undefined,
|
|
38
|
-
};
|
|
39
|
-
return (0, common_1.createTask)(auth, propsValue.tasks_list, task);
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=new-task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-task.js","sourceRoot":"","sources":["../../../../src/lib/actions/new-task.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,sCAA4E;AAC5E,kCAA0C;AAE7B,QAAA,2BAA2B,GAAG,IAAA,+BAAY,EAAC;IACtD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,0TAA0T;QACvU,UAAU,EAAE,KAAK;KAClB;IACD,WAAW,EAAE,UAAU;IACvB,KAAK,EAAE;QACL,UAAU,EAAE,0BAAiB,CAAC,SAAS;QACvC,KAAK,EAAE,0BAAiB,CAAC,KAAK;QAC9B,KAAK,EAAE,0BAAiB,CAAC,KAAK;QAC9B,GAAG,EAAE,0BAAiB,CAAC,GAAG;QAC1B,SAAS,EAAE,0BAAiB,CAAC,SAAS;KACvC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,IAAI,GAAS;gBACjB,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,UAAU,CAAC,SAAS;oBAC1B,CAAC,CAAC,mBAAU,CAAC,SAAS;oBACtB,CAAC,CAAC,mBAAU,CAAC,YAAY;gBAC3B,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE;gBAC/D,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,GAAG,EAAE,UAAU,CAAC,GAAG;oBACjB,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY;oBACrE,CAAC,CAAC,SAAS;aACd,CAAC;YAEF,OAAO,IAAA,mBAAU,EAAC,IAAI,EAAE,UAAU,CAAC,UAAW,EAAE,IAAI,CAAC,CAAC;QACxD,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,eAAe,+GAO1B,CAAC"}
|
package/src/lib/auth.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleTasksAuth = void 0;
|
|
4
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
|
-
exports.googleTasksAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
6
|
-
description: '',
|
|
7
|
-
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
8
|
-
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
9
|
-
required: true,
|
|
10
|
-
scope: ['https://www.googleapis.com/auth/tasks'],
|
|
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,eAAe,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,EAAE;IAEf,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC,uCAAuC,CAAC;CACjD,CAAC,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { OAuth2PropertyValue } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare enum TaskStatus {
|
|
3
|
-
NEEDS_ACTION = "needsAction",
|
|
4
|
-
COMPLETED = "completed"
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* @see https://developers.google.com/tasks/reference/rest/v1/tasklists/list#response-body
|
|
8
|
-
*/
|
|
9
|
-
export type TasksListResponse = {
|
|
10
|
-
kind: string;
|
|
11
|
-
etag: string;
|
|
12
|
-
nextPageToken: string;
|
|
13
|
-
items: TasksList[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @see https://developers.google.com/tasks/reference/rest/v1/tasklists#resource:-tasklist
|
|
17
|
-
*/
|
|
18
|
-
export type TasksList = {
|
|
19
|
-
kind: string;
|
|
20
|
-
id: string;
|
|
21
|
-
etag: string;
|
|
22
|
-
title: string;
|
|
23
|
-
updated: string;
|
|
24
|
-
selfLink: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* @see https://developers.google.com/tasks/reference/rest/v1/tasks#resource:-task
|
|
28
|
-
*/
|
|
29
|
-
export type Task = {
|
|
30
|
-
kind: 'tasks#task';
|
|
31
|
-
title: string;
|
|
32
|
-
status: TaskStatus;
|
|
33
|
-
notes?: string;
|
|
34
|
-
/**
|
|
35
|
-
* *Optional* RFC 3339 timestamp of due date of the task
|
|
36
|
-
*/
|
|
37
|
-
due?: string;
|
|
38
|
-
/**
|
|
39
|
-
* *Optional* RFC 3339 timestamp of completion.
|
|
40
|
-
* Filled automatically if `status === 'completed'`
|
|
41
|
-
*/
|
|
42
|
-
completed?: string;
|
|
43
|
-
};
|
|
44
|
-
export declare const googleTasksCommon: {
|
|
45
|
-
baseUrl: string;
|
|
46
|
-
/**
|
|
47
|
-
* @property Target task list ID where the new task will be created
|
|
48
|
-
*/
|
|
49
|
-
tasksList: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
|
50
|
-
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
51
|
-
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
52
|
-
due: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
53
|
-
completed: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
54
|
-
};
|
|
55
|
-
export declare function getLists(authProp: OAuth2PropertyValue): Promise<TasksList[]>;
|
|
56
|
-
export declare function getTasks(authProp: OAuth2PropertyValue, tasklist: string): Promise<TasksList[]>;
|
|
57
|
-
export declare function createTask(authProp: OAuth2PropertyValue, taskListId: string, task: Task): Promise<import("@activepieces/pieces-common").HttpResponse<any>>;
|
|
58
|
-
//# 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,EAAY,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAS/E,oBAAY,UAAU;IACpB,YAAY,gBAAgB;IAC5B,SAAS,cAAc;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;IAG5B;;OAEG;;;;;;CA+CJ,CAAC;AAEF,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,SAAS,EAAE,CAAC,CAYtB;AAED,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,SAAS,EAAE,CAAC,CAYtB;AAED,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,IAAI,oEAaX"}
|
package/src/lib/common/index.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleTasksCommon = exports.TaskStatus = void 0;
|
|
4
|
-
exports.getLists = getLists;
|
|
5
|
-
exports.getTasks = getTasks;
|
|
6
|
-
exports.createTask = createTask;
|
|
7
|
-
const tslib_1 = require("tslib");
|
|
8
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
9
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
-
const auth_1 = require("../auth");
|
|
11
|
-
var TaskStatus;
|
|
12
|
-
(function (TaskStatus) {
|
|
13
|
-
TaskStatus["NEEDS_ACTION"] = "needsAction";
|
|
14
|
-
TaskStatus["COMPLETED"] = "completed";
|
|
15
|
-
})(TaskStatus || (exports.TaskStatus = TaskStatus = {}));
|
|
16
|
-
exports.googleTasksCommon = {
|
|
17
|
-
baseUrl: `https://tasks.googleapis.com`,
|
|
18
|
-
/**
|
|
19
|
-
* @property Target task list ID where the new task will be created
|
|
20
|
-
*/
|
|
21
|
-
tasksList: pieces_framework_1.Property.Dropdown({
|
|
22
|
-
displayName: 'Tasks List',
|
|
23
|
-
auth: auth_1.googleTasksAuth,
|
|
24
|
-
refreshers: [],
|
|
25
|
-
required: true,
|
|
26
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
27
|
-
if (!auth) {
|
|
28
|
-
return {
|
|
29
|
-
disabled: true,
|
|
30
|
-
placeholder: 'Please connect your account first',
|
|
31
|
-
options: [],
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const authProp = auth;
|
|
35
|
-
const tasksLists = yield getLists(authProp);
|
|
36
|
-
return {
|
|
37
|
-
disabled: false,
|
|
38
|
-
options: tasksLists.map((list) => {
|
|
39
|
-
return {
|
|
40
|
-
label: list.title,
|
|
41
|
-
value: list.id,
|
|
42
|
-
};
|
|
43
|
-
}),
|
|
44
|
-
};
|
|
45
|
-
}),
|
|
46
|
-
}),
|
|
47
|
-
title: pieces_framework_1.Property.ShortText({
|
|
48
|
-
displayName: 'Title',
|
|
49
|
-
required: true,
|
|
50
|
-
}),
|
|
51
|
-
notes: pieces_framework_1.Property.LongText({
|
|
52
|
-
displayName: 'Notes',
|
|
53
|
-
required: false,
|
|
54
|
-
}),
|
|
55
|
-
due: pieces_framework_1.Property.DateTime({
|
|
56
|
-
displayName: 'Due Date',
|
|
57
|
-
description: 'Due date of the task (YYYY-MM-DD)',
|
|
58
|
-
required: false,
|
|
59
|
-
}),
|
|
60
|
-
completed: pieces_framework_1.Property.Checkbox({
|
|
61
|
-
displayName: 'Completed',
|
|
62
|
-
description: 'Mark task as completed',
|
|
63
|
-
required: false,
|
|
64
|
-
}),
|
|
65
|
-
};
|
|
66
|
-
function getLists(authProp) {
|
|
67
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
// docs: https://developers.google.com/tasks/reference/rest/v1/tasklists/list
|
|
69
|
-
const request = {
|
|
70
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
71
|
-
url: `${exports.googleTasksCommon.baseUrl}/tasks/v1/users/@me/lists`,
|
|
72
|
-
authentication: {
|
|
73
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
74
|
-
token: authProp.access_token,
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
78
|
-
return response.body.items;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function getTasks(authProp, tasklist) {
|
|
82
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
// docs: https://developers.google.com/tasks/reference/rest/v1/tasklists/list
|
|
84
|
-
const request = {
|
|
85
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
86
|
-
url: `${exports.googleTasksCommon.baseUrl}/tasks/v1/lists/${tasklist}/tasks`,
|
|
87
|
-
authentication: {
|
|
88
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
89
|
-
token: authProp.access_token,
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
93
|
-
return response.body.items;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function createTask(authProp, taskListId, task) {
|
|
97
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const request = {
|
|
99
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
100
|
-
url: `${exports.googleTasksCommon.baseUrl}/tasks/v1/lists/${taskListId}/tasks`,
|
|
101
|
-
authentication: {
|
|
102
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
103
|
-
token: authProp.access_token,
|
|
104
|
-
},
|
|
105
|
-
body: task,
|
|
106
|
-
};
|
|
107
|
-
return pieces_common_1.httpClient.sendRequest(request);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;AA+GA,4BAcC;AAED,4BAeC;AAED,gCAgBC;;AAhKD,qEAA+E;AAC/E,+DAKqC;AACrC,kCAA0C;AAE1C,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,0CAA4B,CAAA;IAC5B,qCAAuB,CAAA;AACzB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA6CY,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,8BAA8B;IAEvC;;OAEG;IACH,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAqC;QAC/D,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,sBAAe;QACrB,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;YACtB,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,mCAAmC;oBAChD,OAAO,EAAE,EAAE;iBACZ,CAAC;YACJ,CAAC;YAED,MAAM,QAAQ,GAAwB,IAA2B,CAAC;YAClE,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAE5C,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBAC/B,OAAO;wBACL,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,KAAK,EAAE,IAAI,CAAC,EAAE;qBACf,CAAC;gBACJ,CAAC,CAAC;aACH,CAAC;QACJ,CAAC,CAAA;KACF,CAAC;IACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;QACxB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QACvB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,KAAK;KAChB,CAAC;IACF,GAAG,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QACrB,WAAW,EAAE,UAAU;QACvB,WAAW,EAAE,mCAAmC;QAChD,QAAQ,EAAE,KAAK;KAChB,CAAC;IACF,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;QAC3B,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,KAAK;KAChB,CAAC;CACH,CAAC;AAEF,SAAsB,QAAQ,CAC5B,QAA6B;;QAE7B,6EAA6E;QAC7E,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,yBAAiB,CAAC,OAAO,2BAA2B;YAC5D,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAoB,OAAO,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7B,CAAC;CAAA;AAED,SAAsB,QAAQ,CAC5B,QAA6B,EAC7B,QAAgB;;QAEhB,6EAA6E;QAC7E,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,yBAAiB,CAAC,OAAO,mBAAmB,QAAQ,QAAQ;YACpE,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAoB,OAAO,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7B,CAAC;CAAA;AAED,SAAsB,UAAU,CAC9B,QAA6B,EAC7B,UAAkB,EAClB,IAAU;;QAEV,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,GAAG,yBAAiB,CAAC,OAAO,mBAAmB,UAAU,QAAQ;YACtE,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;YACD,IAAI,EAAE,IAAI;SACX,CAAC;QAEF,OAAO,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { OAuth2Props, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newTaskTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>, {
|
|
3
|
-
tasks_list: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>>;
|
|
4
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>, {
|
|
5
|
-
tasks_list: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>>;
|
|
6
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>, {
|
|
7
|
-
tasks_list: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>>;
|
|
8
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>, {
|
|
9
|
-
tasks_list: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<OAuth2Props>>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=new-task.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-task.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAiCxC,eAAO,MAAM,cAAc;;;;;;;;EAmCzB,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newTaskTrigger = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../auth");
|
|
7
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
const props = {
|
|
10
|
-
tasks_list: common_1.googleTasksCommon.tasksList,
|
|
11
|
-
};
|
|
12
|
-
const polling = {
|
|
13
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
14
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
15
|
-
const records = yield (0, common_1.getTasks)(auth, propsValue.tasks_list);
|
|
16
|
-
const filtered_records = records.filter((record) => {
|
|
17
|
-
const updated = Date.parse(record.updated);
|
|
18
|
-
return updated > lastFetchEpochMS;
|
|
19
|
-
});
|
|
20
|
-
return filtered_records.map((record) => ({
|
|
21
|
-
epochMilliSeconds: Date.parse(record.updated),
|
|
22
|
-
data: record,
|
|
23
|
-
}));
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
exports.newTaskTrigger = (0, pieces_framework_1.createTrigger)({
|
|
27
|
-
auth: auth_1.googleTasksAuth,
|
|
28
|
-
name: 'new_task',
|
|
29
|
-
displayName: 'New Task',
|
|
30
|
-
description: 'Triggers when a task is created',
|
|
31
|
-
aiMetadata: {
|
|
32
|
-
description: 'Fires when a task in the selected Google Tasks list is newly created or updated since the last poll, emitting the task that changed. Use to react to additions or edits in a specific task list.',
|
|
33
|
-
},
|
|
34
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
35
|
-
props,
|
|
36
|
-
sampleData: {},
|
|
37
|
-
test(context) {
|
|
38
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const store = context.store;
|
|
40
|
-
const auth = context.auth;
|
|
41
|
-
const propsValue = context.propsValue;
|
|
42
|
-
return yield pieces_common_1.pollingHelper.test(polling, { store, auth, propsValue, files: context.files });
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
onEnable(context) {
|
|
46
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const store = context.store;
|
|
48
|
-
const auth = context.auth;
|
|
49
|
-
const propsValue = context.propsValue;
|
|
50
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, { store, auth, propsValue });
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
onDisable(context) {
|
|
54
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const store = context.store;
|
|
56
|
-
const auth = context.auth;
|
|
57
|
-
const propsValue = context.propsValue;
|
|
58
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, { store, auth, propsValue });
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
run(context) {
|
|
62
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
|
-
const store = context.store;
|
|
64
|
-
const auth = context.auth;
|
|
65
|
-
const propsValue = context.propsValue;
|
|
66
|
-
return yield pieces_common_1.pollingHelper.poll(polling, { store, auth, propsValue, files: context.files });
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=new-task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-task.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-task.ts"],"names":[],"mappings":";;;;AAAA,qEAOwC;AACxC,kCAA0C;AAC1C,+DAIqC;AACrC,sCAAwD;AAExD,MAAM,KAAK,GAAG;IACZ,UAAU,EAAE,0BAAiB,CAAC,SAAS;CACxC,CAAC;AAEF,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE;QAClD,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAQ,EAAC,IAAI,EAAE,UAAU,CAAC,UAAW,CAAC,CAAC;QAE7D,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YACjD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC3C,OAAO,OAAO,GAAG,gBAAgB,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YACvC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;YAC7C,IAAI,EAAE,MAAM;SACb,CAAC,CAAC,CAAC;IACN,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,gCAAa,EAAC;IAC1C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,iCAAiC;IAC9C,UAAU,EAAE;QACV,WAAW,EAAE,kMAAkM;KAChN;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK;IACL,UAAU,EAAE,EAAE;IACR,IAAI,CAAC,OAAO;;YAChB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9F,CAAC;KAAA;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACrE,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACrE,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC5B,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC9F,CAAC;KAAA;CACF,CAAC,CAAC"}
|