@activepieces/piece-algolia 0.0.3 → 0.0.5
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 -42
- package/src/index.d.ts +0 -4
- package/src/index.js.map +0 -1
- package/src/lib/actions/browse-records.d.ts +0 -13
- package/src/lib/actions/browse-records.js +0 -41
- package/src/lib/actions/browse-records.js.map +0 -1
- package/src/lib/actions/delete-records.d.ts +0 -13
- package/src/lib/actions/delete-records.js +0 -40
- package/src/lib/actions/delete-records.js.map +0 -1
- package/src/lib/actions/save-records.d.ts +0 -7
- package/src/lib/actions/save-records.js +0 -43
- package/src/lib/actions/save-records.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -4
- package/src/lib/common/auth.js +0 -50
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -21
- package/src/lib/common/client.js +0 -139
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -9
- package/src/lib/common/props.js +0 -52
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/common/types.d.ts +0 -31
- package/src/lib/common/types.js +0 -3
- package/src/lib/common/types.js.map +0 -1
- package/src/lib/common/utils.d.ts +0 -5
- package/src/lib/common/utils.js +0 -69
- package/src/lib/common/utils.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-algolia",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
15
|
-
"lint": "eslint 'src/**/*.ts'"
|
|
16
|
-
}
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/index.js",
|
|
9
|
+
"package.json",
|
|
10
|
+
"src/i18n"
|
|
11
|
+
]
|
|
17
12
|
}
|
package/src/index.js
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.algolia = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
description: 'Manage your Algolia search indices — add, browse, and delete records.',
|
|
15
|
-
minimumSupportedRelease: '0.36.1',
|
|
16
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/algolia.png',
|
|
17
|
-
categories: [shared_1.PieceCategory.DEVELOPER_TOOLS],
|
|
18
|
-
authors: ['veri5ied'],
|
|
19
|
-
auth: auth_1.algoliaAuth,
|
|
20
|
-
actions: [
|
|
21
|
-
save_records_1.saveRecordsAction,
|
|
22
|
-
browse_records_1.browseRecordsAction,
|
|
23
|
-
delete_records_1.deleteRecordsAction,
|
|
24
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
25
|
-
auth: auth_1.algoliaAuth,
|
|
26
|
-
baseUrl: (auth) => {
|
|
27
|
-
if (!auth) {
|
|
28
|
-
return '';
|
|
29
|
-
}
|
|
30
|
-
return `https://${auth.props.applicationId}.algolia.net/1`;
|
|
31
|
-
},
|
|
32
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
return ({
|
|
34
|
-
'x-algolia-application-id': auth.props.applicationId,
|
|
35
|
-
'x-algolia-api-key': auth.props.apiKey,
|
|
36
|
-
});
|
|
37
|
-
}),
|
|
38
|
-
}),
|
|
39
|
-
],
|
|
40
|
-
triggers: [],
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var uu=Object.create;var Ke=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var lu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty;var o=(e,t)=>Ke(e,"name",{value:t,configurable:!0});var T=(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)Ke(e,r,{get:t[r],enumerable:!0})},Pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lu(t))!du.call(e,i)&&i!==r&&Ke(e,i,{get:()=>t[i],enumerable:!(n=cu(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?uu(pu(e)):{},Pn(t||!e||!e.__esModule?Ke(r,"default",{value:e,enumerable:!0}):r,e)),mu=e=>Pn(Ke({},"__esModule",{value:!0}),e);var Vo=T((Zo,Zt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function y(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],_,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>d)return null;for(M=d-f,_=":";M--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let Q=s.split(":"),ne=[];for(let qe=0;qe<Q.length;qe++)ne.push(parseInt(Q[qe],16));return ne})(),{parts:d,zoneId:v}}o(y,"expandIPv6");function h(s,d,f,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=f-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=f,v+=1}return!0}o(h,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function A(s,d){for(;s.length<d;)s=`0${s}`;return s}o(A,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<d.length;f++)if(m=d[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,M;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(M=m[_],f&&M!==0)return null;M!==8&&(f=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(f[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,f,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(_[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(d[2]);if(f>=0&&f<=32){let m=[this.parse(d[1]),f];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,f,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let M=0;M<v.length;M++)f=v[M],_.push(P(f));return _})();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,f){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");f&&(this.zoneId=f)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(_=m[v],f&&_!==0)return null;_!==16&&(f=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,f=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],f.push(d>>8),f.push(d&255);return f},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(A(this.parts[v].toString(16),4));return m}).call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),f=d[0],m=d[1];return new x.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(f);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(f[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,f,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(_[f],10)),f++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(f[2]),d>=0&&d<=128))return m=[this.parse(f[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,f,m,v,_,M;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return y(s,8);if((m=s.match(p.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=y(d+M,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<_.length;f++)if(v=_[f],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,f){let m,v,_,M;f==null&&(f="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(M=_[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return v}return f},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Zo)});var Hi=T((SS,Vi)=>{var Zi=require("stream").Stream,Kl=require("util");Vi.exports=ae;function ae(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ae,"DelayedStream");Kl.inherits(ae,Zi);ae.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(ae.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ae.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ae.prototype.resume=function(){this._released||this.release(),this.source.resume()};ae.prototype.pause=function(){this.source.pause()};ae.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ae.prototype.pipe=function(){var e=Zi.prototype.pipe.apply(this,arguments);return this.resume(),e};ae.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)};ae.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=T((OS,qi)=>{var Jl=require("util"),Wi=require("stream").Stream,Gi=Hi();qi.exports=W;function W(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(W,"CombinedStream");Jl.inherits(W,Wi);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof 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};W.prototype.pipe=function(e,t){return Wi.prototype.pipe.call(this,e,t),this.resume(),e};W.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};W.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Xi=T((wS,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=T(Y=>{"use strict";var Xt=Xi(),Xl=require("path").extname,Yi=/^\s*([^;\s]*)(?:;|\s|$)/,Yl=/^text\//i;Y.charset=Qi;Y.charsets={lookup:Qi};Y.contentType=Ql;Y.extension=ep;Y.extensions=Object.create(null);Y.lookup=tp;Y.types=Object.create(null);rp(Y.extensions,Y.types);function Qi(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Xt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Yl.test(t[1])?"UTF-8":!1}o(Qi,"charset");function Ql(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Ql,"contentType");function ep(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ep,"extension");function tp(e){if(!e||typeof e!="string")return!1;var t=Xl("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(tp,"lookup");function rp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xt).forEach(o(function(i){var u=Xt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var y=c[p];if(t[y]){var h=r.indexOf(Xt[t[y]].source),P=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(h>P||h===P&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(rp,"populateMaps")});var ra=T((DS,ta)=>{ta.exports=np;function np(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(np,"defer")});var Wr=T((US,oa)=>{var na=ra();oa.exports=op;function op(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(op,"async")});var qr=T((LS,ia)=>{ia.exports=ip;function ip(e){Object.keys(e.jobs).forEach(ap.bind(e)),e.jobs={}}o(ip,"abort");function ap(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(ap,"clean")});var Kr=T((FS,sa)=>{var aa=Wr(),sp=qr();sa.exports=up;function up(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=cp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?sp(r):r.results[i]=c,n(u,r.results))})}o(up,"iterate");function cp(e,t,r,n){var i;return e.length==2?i=e(r,aa(n)):i=e(r,t,aa(n)),i}o(cp,"runJob")});var Jr=T((ZS,ua)=>{ua.exports=lp;function lp(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(lp,"state")});var Xr=T((HS,ca)=>{var pp=qr(),dp=Wr();ca.exports=mp;function mp(e){Object.keys(this.jobs).length&&(this.index=this.size,pp(this),dp(e)(null,this.results))}o(mp,"terminator")});var pa=T((WS,la)=>{var fp=Kr(),gp=Jr(),yp=Xr();la.exports=hp;function hp(e,t,r){for(var n=gp(e);n.index<(n.keyedList||e).length;)fp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return yp.bind(n,r)}o(hp,"parallel")});var Yr=T((KS,Yt)=>{var da=Kr(),vp=Jr(),xp=Xr();Yt.exports=Pp;Yt.exports.ascending=ma;Yt.exports.descending=_p;function Pp(e,t,r,n){var i=vp(e,r);return da(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){da(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),xp.bind(i,n)}o(Pp,"serialOrdered");function ma(e,t){return e<t?-1:e>t?1:0}o(ma,"ascending");function _p(e,t){return-1*ma(e,t)}o(_p,"descending")});var ga=T((XS,fa)=>{var bp=Yr();fa.exports=Ip;function Ip(e,t,r){return bp(e,t,null,r)}o(Ip,"serial")});var ha=T((QS,ya)=>{ya.exports={parallel:pa(),serial:ga(),serialOrdered:Yr()}});var Qr=T((ez,va)=>{"use strict";va.exports=Object});var Pa=T((tz,xa)=>{"use strict";xa.exports=Error});var ba=T((rz,_a)=>{"use strict";_a.exports=EvalError});var Ta=T((nz,Ia)=>{"use strict";Ia.exports=RangeError});var Aa=T((oz,Ea)=>{"use strict";Ea.exports=ReferenceError});var Sa=T((iz,$a)=>{"use strict";$a.exports=SyntaxError});var Qt=T((az,za)=>{"use strict";za.exports=TypeError});var ka=T((sz,Oa)=>{"use strict";Oa.exports=URIError});var Ra=T((uz,wa)=>{"use strict";wa.exports=Math.abs});var Da=T((cz,Na)=>{"use strict";Na.exports=Math.floor});var Ua=T((lz,Ca)=>{"use strict";Ca.exports=Math.max});var La=T((pz,Ma)=>{"use strict";Ma.exports=Math.min});var Fa=T((dz,ja)=>{"use strict";ja.exports=Math.pow});var Za=T((mz,Ba)=>{"use strict";Ba.exports=Math.round});var Ha=T((fz,Va)=>{"use strict";Va.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Wa=T((yz,Ga)=>{"use strict";var Tp=Ha();Ga.exports=o(function(t){return Tp(t)||t===0?t:t<0?-1:1},"sign")});var Ka=T((vz,qa)=>{"use strict";qa.exports=Object.getOwnPropertyDescriptor});var en=T((xz,Ja)=>{"use strict";var er=Ka();if(er)try{er([],"length")}catch{er=null}Ja.exports=er});var Ya=T((Pz,Xa)=>{"use strict";var tr=Object.defineProperty||!1;if(tr)try{tr({},"a",{value:1})}catch{tr=!1}Xa.exports=tr});var tn=T((_z,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 u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var rs=T((Iz,ts)=>{"use strict";var es=typeof Symbol<"u"&&Symbol,Ep=tn();ts.exports=o(function(){return typeof es!="function"||typeof Symbol!="function"||typeof es("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ep()},"hasNativeSymbols")});var rn=T((Ez,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nn=T((Az,os)=>{"use strict";var Ap=Qr();os.exports=Ap.getPrototypeOf||null});var ss=T(($z,as)=>{"use strict";var $p="Function.prototype.bind called on incompatible ",Sp=Object.prototype.toString,zp=Math.max,Op="[object Function]",is=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),kp=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),wp=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"||Sp.apply(r)!==Op)throw new TypeError($p+r);for(var n=kp(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,is(n,arguments));return Object(P)===P?P:this}return r.apply(t,is(n,arguments))},"binder"),c=zp(0,r.length-n.length),p=[],y=0;y<c;y++)p[y]="$"+y;if(i=Function("binder","return function ("+wp(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Be=T((zz,us)=>{"use strict";var Rp=ss();us.exports=Function.prototype.bind||Rp});var rr=T((Oz,cs)=>{"use strict";cs.exports=Function.prototype.call});var on=T((kz,ls)=>{"use strict";ls.exports=Function.prototype.apply});var ds=T((wz,ps)=>{"use strict";ps.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var fs=T((Rz,ms)=>{"use strict";var Np=Be(),Dp=on(),Cp=rr(),Up=ds();ms.exports=Up||Np.call(Cp,Dp)});var ys=T((Nz,gs)=>{"use strict";var Mp=Be(),Lp=Qt(),jp=rr(),Fp=fs();gs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Lp("a function is required");return Fp(Mp,jp,t)},"callBindBasic")});var bs=T((Cz,_s)=>{"use strict";var Bp=ys(),hs=en(),xs;try{xs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var an=!!xs&&hs&&hs(Object.prototype,"__proto__"),Ps=Object,vs=Ps.getPrototypeOf;_s.exports=an&&typeof an.get=="function"?Bp([an.get]):typeof vs=="function"?o(function(t){return vs(t==null?t:Ps(t))},"getDunder"):!1});var $s=T((Mz,As)=>{"use strict";var Is=rn(),Ts=nn(),Es=bs();As.exports=Is?o(function(t){return Is(t)},"getProto"):Ts?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ts(t)},"getProto"):Es?o(function(t){return Es(t)},"getProto"):null});var sn=T((jz,Ss)=>{"use strict";var Zp=Function.prototype.call,Vp=Object.prototype.hasOwnProperty,Hp=Be();Ss.exports=Hp.call(Zp,Vp)});var Ds=T((Fz,Ns)=>{"use strict";var U,Gp=Qr(),Wp=Pa(),qp=ba(),Kp=Ta(),Jp=Aa(),Ge=Sa(),He=Qt(),Xp=ka(),Yp=Ra(),Qp=Da(),ed=Ua(),td=La(),rd=Fa(),nd=Za(),od=Wa(),ws=Function,un=o(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=en(),id=Ya(),cn=o(function(){throw new He},"throwTypeError"),ad=vt?(function(){try{return arguments.callee,cn}catch{try{return vt(arguments,"callee").get}catch{return cn}}})():cn,Ze=rs()(),J=$s(),sd=nn(),ud=rn(),Rs=on(),xt=rr(),Ve={},cd=typeof Uint8Array>"u"||!J?U:J(Uint8Array),Re={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&J?J([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":Ve,"%AsyncGenerator%":Ve,"%AsyncGeneratorFunction%":Ve,"%AsyncIteratorPrototype%":Ve,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Wp,"%eval%":eval,"%EvalError%":qp,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":ws,"%GeneratorFunction%":Ve,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&J?J(J([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!J?U:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Gp,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Kp,"%ReferenceError%":Jp,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!J?U:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&J?J(""[Symbol.iterator]()):U,"%Symbol%":Ze?Symbol:U,"%SyntaxError%":Ge,"%ThrowTypeError%":ad,"%TypedArray%":cd,"%TypeError%":He,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":Xp,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":Rs,"%Object.defineProperty%":id,"%Object.getPrototypeOf%":sd,"%Math.abs%":Yp,"%Math.floor%":Qp,"%Math.max%":ed,"%Math.min%":td,"%Math.pow%":rd,"%Math.round%":nd,"%Math.sign%":od,"%Reflect.getPrototypeOf%":ud};if(J)try{null.error}catch(e){zs=J(J(e)),Re["%Error.prototype%"]=zs}var zs,ld=o(function e(t){var r;if(t==="%AsyncFunction%")r=un("async function () {}");else if(t==="%GeneratorFunction%")r=un("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=un("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&J&&(r=J(i.prototype))}return Re[t]=r,r},"doEval"),Os={__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"]},Pt=Be(),nr=sn(),pd=Pt.call(xt,Array.prototype.concat),dd=Pt.call(Rs,Array.prototype.splice),ks=Pt.call(xt,String.prototype.replace),or=Pt.call(xt,String.prototype.slice),md=Pt.call(xt,RegExp.prototype.exec),fd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,gd=/\\(\\)?/g,yd=o(function(t){var r=or(t,0,1),n=or(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var i=[];return ks(t,fd,function(u,c,p,y){i[i.length]=p?ks(y,gd,"$1"):c||u}),i},"stringToPath"),hd=o(function(t,r){var n=t,i;if(nr(Os,n)&&(i=Os[n],n="%"+i[0]+"%"),nr(Re,n)){var u=Re[n];if(u===Ve&&(u=ld(n)),typeof u>"u"&&!r)throw new He("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new He("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new He('"allowMissing" argument must be a boolean');if(md(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=yd(t),i=n.length>0?n[0]:"",u=hd("%"+i+"%",r),c=u.name,p=u.value,y=!1,h=u.alias;h&&(i=h[0],dd(n,pd([0,1],h)));for(var P=1,A=!0;P<n.length;P+=1){var x=n[P],s=or(x,0,1),d=or(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ge("property names with quotes must have matching quotes");if((x==="constructor"||!A)&&(y=!0),i+="."+x,c="%"+i+"%",nr(Re,c))p=Re[c];else if(p!=null){if(!(x in p)){if(!r)throw new He("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&P+1>=n.length){var f=vt(p,x);A=!!f,A&&"get"in f&&!("originalValue"in f.get)?p=f.get:p=p[x]}else A=nr(p,x),p=p[x];A&&!y&&(Re[c]=p)}}return p},"GetIntrinsic")});var Us=T((Zz,Cs)=>{"use strict";var vd=tn();Cs.exports=o(function(){return vd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var js=T((Hz,Ls)=>{"use strict";var xd=Ds(),Ms=xd("%Object.defineProperty%",!0),Pd=Us()(),_d=sn(),bd=Qt(),ir=Pd?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 bd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ir&&(n||!_d(t,ir))&&(Ms?Ms(t,ir,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ir]=r)},"setToStringTag")});var Bs=T((Wz,Fs)=>{"use strict";var Id=Function.prototype.call,Td=Object.prototype.hasOwnProperty,Ed=Be();Fs.exports=Ed.call(Id,Td)});var Vs=T((qz,Zs)=>{"use strict";Zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ws=T((Kz,Gs)=>{"use strict";var mn=Ki(),Ad=require("util"),ln=require("path"),$d=require("http"),Sd=require("https"),zd=require("url").parse,Od=require("fs"),kd=require("stream").Stream,wd=require("crypto"),pn=ea(),Rd=ha(),Nd=js(),Se=Bs(),dn=Vs();function Hs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Hs,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],mn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Ad.inherits(L,mn);L.LINE_BREAK=`\r
|
|
2
|
+
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=mn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Se(t,"httpVersion"))&&!(t instanceof kd))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Se(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Od.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Se(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Se(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Hs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&dn(c,r.header);var p;for(var y in c)if(Se(c,y)){if(p=c[y],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=y+": "+p.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=ln.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=ln.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Se(e,"httpVersion")&&(r=ln.basename(e.client._httpMessage.path||"")),r)return'filename="'+Hs(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pn.lookup(e.name)),!r&&e&&e.path&&(r=pn.lookup(e.path)),!r&&e&&e.readable&&Se(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Se(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+wd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Rd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=zd(e),n=dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=dn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Sd.request(n):r=$d.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,y=o(function(h,P){return r.removeListener("error",y),r.removeListener("response",p),t.call(this,h,P)},"callback");p=y.bind(this,null),r.on("error",y),r.on("response",p)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};Nd(L.prototype,"FormData");Gs.exports=L});var qd={};xn(qd,{algolia:()=>Wd});module.exports=mu(qd);var fu=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,y){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:y,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,y);let h=c.prototype,P=Object.keys(h);for(let A=0;A<P.length;A++){let x=P[A];x in p||(p[x]=h[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var y;let h=r?.Parent?new u:this;n(h,p),(y=h._zod).deferred??(y.deferred=[]);for(let P of h._zod.deferred)P();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var ue=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},cr={};function de(e){return e&&Object.assign(cr,e),cr}o(de,"config");function pr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(pr,"getEnumValues");function bn(e,t){return typeof t=="bigint"?t.toString():t}o(bn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Et,"cached");function In(e){return e==null}o(In,"nullish");function At(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(At,"cleanRegex");var _n=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_n)return n===void 0&&(n=_n,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Je,"isObject");var gu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Tn(e){if(Je(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Je(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Tn,"isPlainObject");var En=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o($t,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function An(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(An,"optionalKeys");var $n={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 Ce(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(Ce,"aborted");function xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(xe,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}o(Tt,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Pe,"finalizeIssue");function Sn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Sn,"getLengthableOrigin");function mr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(mr,"issue");var zn=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,bn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),On=b("$ZodError",zn),Xe=b("$ZodError",zn,{Parent:Error});var hu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new ue;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(y=>Pe(y,u,de())));throw dr(p,i?.callee),p}return c.value},"_parse"),St=hu(Xe),vu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(y=>Pe(y,u,de())));throw dr(p,i?.callee),p}return c.value},"_parseAsync"),zt=vu(Xe),xu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new ue;return u.issues.length?{success:!1,error:new(e??On)(u.issues.map(c=>Pe(c,i,de())))}:{success:!0,data:u.value}},"_safeParse"),Ye=xu(Xe),Pu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Pe(c,i,de())))}:{success:!0,data:u.value}},"_safeParseAsync"),Qe=Pu(Xe);var _u="(?:(?:\\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])))",bu=new RegExp(`^${_u}$`);var kn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),wn=/^-?\d+n?$/,Rn=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,Nn=/^(?:true|false)$/i;var _e=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Iu={number:"number",bigint:"bigint",object:"date"};var Dn=b("$ZodCheckGreaterThan",(e,t)=>{_e.init(e,t);let r=Iu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Cn=b("$ZodCheckNumberFormat",(e,t)=>{_e.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=$n[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Rn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Un=b("$ZodCheckMinLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!In(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=Sn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var gr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;_e.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Mn=b("$ZodCheckRegex",(e,t)=>{gr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var jn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,y)=>{let h=Ce(c),P;for(let A of p){if(A._zod.def.when){if(!A._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=A._zod.check(c);if(s instanceof Promise&&y?.async===!1)throw new ue;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Ce(c,x)))});else{if(c.issues.length===x)continue;h||(h=Ce(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,p,y)=>{if(Ce(c))return c.aborted=!0,c;let h=i(p,n,y);if(h instanceof Promise){if(y.async===!1)throw new ue;return h.then(P=>e._zod.parse(P,y))}return e._zod.parse(h,y)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(P=>u(P,c,p)):u(h,c,p)}let y=e._zod.parse(c,p);if(y instanceof Promise){if(p.async===!1)throw new ue;return y.then(h=>i(h,n,p))}return i(y,n,p)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=Ye(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Qe(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),yr=b("$ZodStringFormat",(e,t)=>{gr.init(e,t),wt.init(e,t)});var Hn=b("$ZodURL",(e,t)=>{yr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var hr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??fr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Gn=b("$ZodNumberFormat",(e,t)=>{Cn.init(e,t),hr.init(e,t)}),vr=b("$ZodBoolean",(e,t)=>{H.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}}),Wn=b("$ZodBigInt",(e,t)=>{H.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 qn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Kn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Jn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Xn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Fn(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(Fn,"handleArrayResult");var Yn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],y=t.element._zod.run({value:p,issues:[]},n);y instanceof Promise?u.push(y.then(h=>Fn(h,r,c))):Fn(y,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function kt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(kt,"handlePropertyResult");function Tu(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=An(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Tu,"normalizeDef");function Eu(e,t,r,n,i,u){let c=[],p=i.keySet,y=i.catchall._zod,h=y.def.type,P=y.optout==="optional";for(let A in t){if(p.has(A))continue;if(h==="never"){c.push(A);continue}let x=y.run({value:t[A],issues:[]},n);x instanceof Promise?e.push(x.then(s=>kt(s,r,A,t,P))):kt(x,r,A,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Eu,"handleCatchall");var Qn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...p};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=Et(()=>Tu(t));q(e._zod,"propValues",()=>{let p=t.shape,y={};for(let h in p){let P=p[h]._zod;if(P.values){y[h]??(y[h]=new Set);for(let A of P.values)y[h].add(A)}}return y});let i=Je,u=t.catchall,c;e._zod.parse=(p,y)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let P=[],A=c.shape;for(let x of c.keys){let s=A[x],d=s._zod.optout==="optional",f=s._zod.run({value:h[x],issues:[]},y);f instanceof Promise?P.push(f.then(m=>kt(m,p,x,h,d))):kt(f,p,x,h,d)}return u?Eu(P,h,p,y,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function Bn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ce(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Pe(c,n,de())))}),t)}o(Bn,"handleUnionResults");var xr=b("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>At(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let y of t.options){let h=y._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(y=>Bn(y,i,e,u)):Bn(p,i,e,u)}});var eo=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,y]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of y)i[p].add(h)}}return i});let n=Et(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let y of p){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Je(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var to=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Tn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:i[h],issues:[]},n);P instanceof Promise?u.push(P.then(A=>{A.issues.length&&r.issues.push(...xe(h,A.issues)),r.value[h]=A.value})):(P.issues.length&&r.issues.push(...xe(h,P.issues)),r.value[h]=P.value)}let y;for(let h in i)p.has(h)||(y=y??[],y.push(h));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let y=t.keyType._zod.run({value:p,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&fr.test(p)&&y.issues.length){let A=t.keyType._zod.run({value:Number(p),issues:[]},n);if(A instanceof Promise)throw new Error("Async schemas not supported in object keys currently");A.issues.length===0&&(y=A)}if(y.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(A=>Pe(A,n,de())),input:p,path:[p],inst:e});continue}let P=t.valueType._zod.run({value:i[p],issues:[]},n);P instanceof Promise?u.push(P.then(A=>{A.issues.length&&r.issues.push(...xe(p,A.issues)),r.value[y.value]=A.value})):(P.issues.length&&r.issues.push(...xe(p,P.issues)),r.value[y.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var ro=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=pr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>En.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),no=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var oo=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ue;return r.value=i,r}});function Zn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Zn,"handleOptionalResult");var io=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Zn(u,r.value)):Zn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ao=b("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var so=b("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Ot(c,t.in,n)):Ot(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ot(u,t.out,n)):Ot(i,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Ot,"handlePipeResult");var uo=b("$ZodCustom",(e,t)=>{_e.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Vn(u,r,n,e));Vn(i,r,n,e)}});function Vn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(mr(i))}}o(Vn,"handleRefineResult");var 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 _r=globalThis.__zod_globalRegistry;function mo(e,t){return new e({type:"string",...Z(t)})}o(mo,"_string");function fo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(fo,"_coercedString");function go(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(go,"_url");function yo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(yo,"_number");function ho(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(ho,"_coercedNumber");function vo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(vo,"_int");function xo(e,t){return new e({type:"boolean",...Z(t)})}o(xo,"_boolean");function Po(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(Po,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(_o,"_coercedBigint");function bo(e){return new e({type:"any"})}o(bo,"_any");function Io(e){return new e({type:"unknown"})}o(Io,"_unknown");function To(e,t){return new e({type:"void",...Z(t)})}o(To,"_void");function Eo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(Eo,"_coercedDate");function Rt(e,t){return new Dn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Rt,"_gte");function oe(e,t){return new Un({check:"min_length",...Z(t),minimum:e})}o(oe,"_minLength");function be(e,t){return new Mn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(be,"_regex");function Ao(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Ao,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>St(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ye(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Qe(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)=>$t(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Dt=b("ZodMiniString",(e,t)=>{wt.init(e,t),K.init(e,t)});function a(e){return mo(Dt,e)}o(a,"string");var $o=b("ZodMiniStringFormat",(e,t)=>{yr.init(e,t),Dt.init(e,t)});var Mu=b("ZodMiniURL",(e,t)=>{Hn.init(e,t),$o.init(e,t)});function So(e){return go(Mu,e)}o(So,"url");var Ct=b("ZodMiniNumber",(e,t)=>{hr.init(e,t),K.init(e,t)});function X(e){return yo(Ct,e)}o(X,"number");var Lu=b("ZodMiniNumberFormat",(e,t)=>{Gn.init(e,t),Ct.init(e,t)});function zo(e){return vo(Lu,e)}o(zo,"int");var br=b("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function F(e){return xo(br,e)}o(F,"boolean");var Oo=b("ZodMiniBigInt",(e,t)=>{Wn.init(e,t),K.init(e,t)});var ju=b("ZodMiniAny",(e,t)=>{qn.init(e,t),K.init(e,t)});function tt(){return bo(ju)}o(tt,"any");var Fu=b("ZodMiniUnknown",(e,t)=>{Kn.init(e,t),K.init(e,t)});function O(){return Io(Fu)}o(O,"unknown");var Bu=b("ZodMiniVoid",(e,t)=>{Jn.init(e,t),K.init(e,t)});function ko(e){return To(Bu,e)}o(ko,"_void");var wo=b("ZodMiniDate",(e,t)=>{Xn.init(e,t),K.init(e,t)});var Zu=b("ZodMiniArray",(e,t)=>{Yn.init(e,t),K.init(e,t)});function R(e,t){return new Zu({type:"array",element:e,...Z(t)})}o(R,"array");var Vu=b("ZodMiniObject",(e,t)=>{Qn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Vu(r)}o(l,"object");var Hu=b("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Hu({type:"union",options:e,...Z(t)})}o(N,"union");var Gu=b("ZodMiniDiscriminatedUnion",(e,t)=>{eo.init(e,t),K.init(e,t)});function Ie(e,t,r){return new Gu({type:"union",options:t,discriminator:e,...Z(r)})}o(Ie,"discriminatedUnion");var Wu=b("ZodMiniRecord",(e,t)=>{to.init(e,t),K.init(e,t)});function k(e,t,r){return new Wu({type:"record",keyType:e,valueType:t,...Z(r)})}o(k,"record");var qu=b("ZodMiniEnum",(e,t)=>{ro.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function C(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new qu({type:"enum",entries:r,...Z(t)})}o(C,"_enum");var Ku=b("ZodMiniLiteral",(e,t)=>{no.init(e,t),K.init(e,t)});function E(e,t){return new Ku({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(E,"literal");var Ju=b("ZodMiniTransform",(e,t)=>{oo.init(e,t),K.init(e,t)});function Te(e){return new Ju({type:"transform",transform:e})}o(Te,"transform");var Xu=b("ZodMiniOptional",(e,t)=>{io.init(e,t),K.init(e,t)});function g(e){return new Xu({type:"optional",innerType:e})}o(g,"optional");var Yu=b("ZodMiniNullable",(e,t)=>{ao.init(e,t),K.init(e,t)});function rt(e){return new Yu({type:"nullable",innerType:e})}o(rt,"nullable");var Qu=b("ZodMiniPipe",(e,t)=>{so.init(e,t),K.init(e,t)});function Ee(e,t){return new Qu({type:"pipe",in:e,out:t})}o(Ee,"pipe");var ec=b("ZodMiniCustom",(e,t)=>{uo.init(e,t),K.init(e,t)});function Ut(e,t){return Ao(ec,e??(()=>!0),t)}o(Ut,"custom");var nt={};xn(nt,{bigint:()=>ac,boolean:()=>ic,date:()=>sc,number:()=>oc,string:()=>nc});function nc(e){return fo(Dt,e)}o(nc,"string");function oc(e){return ho(Ct,e)}o(oc,"number");function ic(e){return Po(br,e)}o(ic,"boolean");function ac(e){return _o(Oo,e)}o(ac,"bigint");function sc(e){return Eo(wo,e)}o(sc,"date");var Tr=l({retryOnFailure:l({defaultValue:g(F()),hide:g(F())}),continueOnFailure:l({defaultValue:g(F()),hide:g(F())})}),Ir=class{constructor(t,r,n,i,u,c,p,y,h,P,A){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=y;this.outputSchema=h;this.audience=P;this.aiMetadata=A}static{o(this,"IAction")}},Ae=o(e=>new Ir(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var j=l({displayName:a(),description:g(a())}),D=o((e,t)=>l({type:E(t),required:F(),defaultValue:g(tt())}),"TPropertyValue");var ee=l({...j.shape,...D(a(),"SHORT_TEXT").shape}),me=l({...j.shape,...D(a(),"LONG_TEXT").shape});var No=l({label:a(),value:O()}),Mt=l({disabled:g(F()),placeholder:g(a()),options:R(No)});var te=l({...j.shape,options:Mt,...D(O(),"STATIC_DROPDOWN").shape}),fe=l({...j.shape,options:Mt,...D(R(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=l({...j.shape,...D(O(),"DROPDOWN").shape,refreshers:R(a())}),ot=l({...j.shape,...D(R(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var ge=l({...j.shape,...D(F(),"CHECKBOX").shape});var ye=l({...j.shape,...D(X(),"NUMBER").shape});var it=l({...j.shape,streaming:g(F()),...D(O(),"FILE").shape});var at=l({...j.shape,...D(a(),"DATE_TIME").shape});var Do=k(a(),N([ee,me,te,ot,fe,ge,ye,it,at])),st=l({...j.shape,properties:Do,...D(R(O()),"ARRAY").shape});var ut=l({...j.shape,...D(N([k(a(),O())]),"JSON").shape});var Co=N([ee,te,ut,st,fe]),cc=k(a(),Co),Ar=l({refreshers:R(a()),...j.shape,...D(O(),"DYNAMIC").shape});var Lt=l({...j.shape,...D(ko(),"MARKDOWN").shape});var ct=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ct||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Me||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),$r="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),pt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(pt||{}),lc=l({strategy:C(pt),paramName:g(a())}),dt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(dt||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),Uo=l({status:g(X()),body:g(O()),headers:g(k(a(),a()))}),Mo=l({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(C(jt))}),Lo=l({type:E("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:Uo,handlerId:g(a()),streamStepProgress:g(C(jt))}),pc=N([Mo,Lo]);var dc=l({body:O(),rawBody:g(O()),headers:k(a(),a()),queryParams:k(a(),a())});function ie(e){return e==null}o(ie,"isNil");function mt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(mt,"isEmpty");function Ft(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ft,"assertNotNullOrUndefined");async function ft(e){try{return{data:await e(),error:null}}catch(t){return{data:null,error:t}}}o(ft,"tryCatch");var Sr=Ne(require("crypto"),1);var mc=128,Oe,Le,fc=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*mc),Sr.default.randomFillSync(Oe),Le=0):Le+e>Oe.length&&(Sr.default.randomFillSync(Oe),Le=0),Le+=e},"fillPool"),gc=o(e=>(fc(e|=0),Oe.subarray(Le-e,Le)),"random"),yc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),y=i;for(;y--;)if(c+=e[p[y]&n]||"",c.length===u)return c}}},"customRandom"),Fo=o((e,t=21)=>yc(e,t,gc),"customAlphabet");var hc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bo=21,zb=a().check(be(new RegExp(`^[0-9a-zA-Z]{${Bo}}$`))),vc=Fo(hc,Bo);var $e=Ee(Te(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:$e,updated:$e},V=o(e=>g(rt(e)),"Nullable");function zr(e){return g(rt(C(e)))}o(zr,"NullableEnum");var wb=Ee(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(F())),Bt=o(e=>Ee(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(R(e))),"OptionalArrayFromQuery");var Db=k(a(),O());var gt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(gt||{});var Wb=a().check(be(/^#[0-9A-Fa-f]{6}$/));var Kb=l({filename:a(),data:O(),type:E("file"),mimetype:g(a())});var xc=Ne(Vo());var rI=l({...re,name:a(),permissions:R(a()),platformId:V(a()),type:a(),userCount:g(X())});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||{}),kr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(kr||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var Rr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Rr||{});var Pc=l({mode:C(Ho),value:O()}),_c=l({auth:g(a()),fields:k(a(),Pc)}),bc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(_c)}),Ic=l({type:E("PIECE"),toolName:a().check(oe(1)),pieceMetadata:bc}),Tc=l({type:E("none")}),Ec=l({type:E("access_token"),accessToken:a()}),Ac=l({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),$c=l({type:E("headers"),headers:k(a(),a())}),Sc=Ie("type",[Tc,Ec,Ac,$c]),Go=l({type:E("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:g(a())}),Wo=l({type:E("MCP"),toolName:a().check(oe(1)),serverUrl:So(),protocol:C(kr),auth:Sc}),qo=l({type:E("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:C(Or),sourceId:a(),sourceName:a()}),zc=Ie("type",[Ic,Go,Wo,qo]),Oc=l({displayName:a(),description:g(a()),type:C(wr)}),Ko=l({type:E("MARKDOWN"),markdown:a()}),je={type:E("TOOL_CALL"),input:V(k(a(),O())),output:g(O()),toolName:a(),status:C(Rr),toolCallId:a(),startTime:a(),endTime:g(a())},RI=l(je),Jo=Ie("toolCallType",[l({...je,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...je,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),l({...je,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),l({...je,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...je,toolCallType:E("UNKNOWN"),displayName:a()})]),kc=N([Ko,Jo]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),he=l({apiKey:a()}),wc=he,Rc=l({apiKey:a(),apiKeyHash:a()}),Nc=he,Dc=he,Cc=he,Uc=he,Mc=he,Lc=he,jc=he,ti=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),Fc=l({}),Bc=l({}),Zc=l({}),Vc=l({}),Hc=l({}),Gc=l({}),ri=l({modelId:a(),modelName:a(),modelType:C(Nr)}),ni=l({apiKeyHeader:a(),baseUrl:a(),models:R(ri),defaultHeaders:g(k(a(),a()))}),oi=l({accountId:a(),gatewayId:a(),models:R(ri),vertexProject:g(a()),vertexRegion:g(a())}),ii=l({resourceName:a(),apiVersion:Ee(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),ai=l({region:a().check(oe(1))}),Wc=N([wc,Cc,Uc,Mc,Lc,Dc,Nc,Rc,ti,jc]),si=N([ni,oi,ii,ai,Fc,Zc,Vc,Hc,Bc,Gc]),qc=l({id:a(),name:a(),type:C(Nr)}),Kc=l({id:a(),name:a(),provider:C(gt),config:si,enabledForChat:F()}),Jc=l({provider:C(gt),config:si,auth:Wc,platformId:a()});var UI={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"],Xc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Yc=["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"],Qc=["grok-4.20","grok-4.1-fast"],el={openai:Xo,anthropic:Xc,google:Yo,activepieces:[...Yc.map(e=>`anthropic/${e}`),...Xo.map(e=>`openai/${e}`),...Yo.map(e=>`google/${e}`),...Qc.map(e=>`x-ai/${e}`)]};var Qo=128e3,tl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function rl({provider:e}){return e?tl[e]??Qo:Qo}o(rl,"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"},nl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},ol=new Set(["anthropic","mistral"]);function ce(e){return{chatModels:el[e],maxContextTokens:rl({provider:e}),defaultEmbeddingModel:ei[e],supportsEmbedding:ei[e]!==void 0,supportsImageGeneration:!ol.has(e),webSearch:nl[e]}}o(ce,"buildProviderCapabilities");var il={openai:ce("openai"),anthropic:ce("anthropic"),openrouter:ce("openrouter"),azure:ce("azure"),google:ce("google"),"cloudflare-gateway":ce("cloudflare-gateway"),custom:ce("custom"),bedrock:ce("bedrock"),mistral:ce("mistral"),activepieces:ce("activepieces")};var al=l({base64Url:a(),fileName:a(),extension:g(a())}),sl=l({mimeType:a(),url:a(),fileName:g(a())}),Dr=N([al,sl]);var ul=N([l({type:E("file"),value:Dr}),l({type:E("markdown"),value:a(),files:g(R(Dr))})]),cl=l({sessionId:a(),message:a(),files:g(R(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||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var ll=N([l({...re,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:R(l({value:a()}))})}),l({...re,name:a(),externalId:a(),type:N([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),pl=l({...re,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:zr(li),trigger:zr(ci)}),dl=l({...re,tableId:a(),projectId:a(),cells:k(a(),l({updated:a(),created:a(),value:O(),fieldName:a()}))}),ml=l({events:R(C(Cr)),webhookUrl:a(),flowId:a()}),fl=l({fields:R(l({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),gl=l({projectId:a(),limit:g(nt.number()),cursor:g(a()),name:g(a()),externalIds:Bt(a()),folderId:g(a()),folderIds:Bt(a())}),yl=l({records:R(R(l({fieldId:a(),value:di()}))),tableId:a()}),hl=l({cells:g(R(l({fieldId:a(),value:di()}))),tableId:a(),agentUpdate:g(F())}),pi=Ie("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),ui("exists"),ui("not_exists")]),vl=l({tableId:a(),limit:g(nt.number()),cursor:g(a()),filters:Bt(pi)});function di(){return Ee(Te(e=>e==null?e:String(e)),rt(a()))}o(di,"coerceToString");function ke(e){return l({fieldId:a(),operator:E(e),value:a()})}o(ke,"valueFilter");function ui(e){return l({fieldId:a(),operator:E(e)})}o(ui,"existenceFilter");var xl=l({status:g(X()),body:g(O()),headers:g(k(a(),a()))}),Pl=l({...re,deleted:V($e),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var mi=l({name:a(),description:g(a()),type:a(),required:F()}),_l=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:R(mi),returnsResponse:F()})});var fi="^[0-9]+\\.[0-9]+\\.[0-9]+$",rT=new RegExp(fi),Il="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",nT=a().check(be(new RegExp(fi))),oT=a().check(be(new RegExp(Il))),Tl=l({packageType:E("ARCHIVE"),pieceType:C(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),gi=l({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),yi=l({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),iT=N([gi,yi]),aT=N([Tl,gi,yi]);var El=Ie("type",[l({type:E("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:E("INTERVAL"),intervalMs:zo().check(Rt(6e4))})]),sT=l({...re,type:C(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:V(El),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:F()}),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||{}),uT=l({...re,projectId:V(a()),platformId:V(a()),type:C(hi),compression:C(vi),data:g(O()),location:C(xi),size:V(X()),fileName:V(a()),s3Key:V(a()),metadata:V(k(a(),a()))}),Pi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Pi||{}),_i=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_i||{}),cT=l({id:a(),email:a(),firstName:a(),status:C(_i),externalId:V(a()),platformId:V(a()),platformRole:C(Pi),lastName:a(),created:$e,updated:$e,lastActiveDate:V($e),imageUrl:V(a())});var Ur=l({...j.shape,...D(k(a(),O()),"OBJECT").shape});var Ei=l({...j.shape,...D(a(),"COLOR").shape});var Mr=N([ee,me,Lt,ge,te,fe,Er,ot,Ar,ye,st,Ur,ut,at,it,Ei]),B={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var le=l({displayName:a(),description:g(a())});var Ai=l({username:a(),password:a()}),Lr=l({...le.shape,username:l({displayName:a(),description:g(a())}),password:l({displayName:a(),description:g(a())}),...D(Ai,"BASIC_AUTH").shape});var zl=k(a(),N([ee,me,ye,ge,te])),jr=l({...le.shape,props:zl,...D(O(),"CUSTOM_AUTH").shape});var we=l({...le.shape,...D(l({auth:a()}),"SECRET_TEXT").shape});var Ol=k(a(),N([ee,me,we,ye,ge,te,fe,Lt])),$i=l({...le.shape,props:Ol,...D(O(),"OIDC").shape});var Fr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Fr||{}),Si=N([ee,we,te]),zi=k(a(),Si),kl=l({props:g(k(a(),Si)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:g(N([E("none"),E("consent"),E("login"),E("omit")])),pkce:g(F()),pkceMethod:g(N([E("plain"),E("S256")])),authorizationMethod:g(C(Fr)),grantType:g(N([C(lt),E($r)])),extra:g(k(a(),a()))}),Oi=l({access_token:a(),props:g(zi),data:k(a(),tt())}),Br=l({...le.shape,...kl.shape,...D(Oi,"OAUTH2").shape});var Fe=N([Lr,jr,$i,Br,we]),yt="Connection",Vt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var FE={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 wl=l({...j.shape,...D(O(),"CUSTOM").shape,code:a()});var Rl=N([Mr,Fe]),Zr=k(a(),Rl),sA=k(a(),Mr);var ki=N([l({strategy:E("CRON"),cronExpression:a()}),l({strategy:E("NONE")})]);var wi="2",Ht="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,p,y,h=Ht,P,A="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=y;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=A;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wi}),"getContextInfo");(!Nl(h)||Dl(h,Ht))&&(this.minimumSupportedRelease=Ht),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ri=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Vr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Nl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Nl,"isValidSimpleSemver");function Dl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Dl,"isSemverLessThan");var Cl=g(k(a(),k(a(),a()))),Ni=l({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:g(a()),directoryPath:g(a()),auth:g(N([Fe,R(Fe)])),version:a(),categories:g(R(C(Me))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),deprecated:g(F()),i18n:Cl}),Ul=C(["human","ai","both"]),Di=l({description:g(a()),idempotent:g(F())}),Ci=l({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:F(),errorHandlingOptions:g(Tr),outputSchema:g(Ut()),audience:g(Ul),aiMetadata:g(Di)}),Ui=l({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:g(Tr),type:C(ze),sampleData:O(),handshakeConfiguration:g(Ut()),renewConfiguration:g(ki),testStrategy:C(dt),outputSchema:g(Ut()),aiMetadata:g(Di)}),Ml=l({...Ni.shape,actions:k(a(),Ci),triggers:k(a(),Ui)}),Ll=l({...Ni.shape,actions:X(),triggers:X(),suggestedActions:g(R(Ci)),suggestedTriggers:g(R(Ui))}),Mi=l({projectUsage:X(),pieceType:C(Ue),packageType:C(ct),platformId:g(a()),archiveId:g(a())}),s$=l({...Ml.shape,...Mi.shape}),u$=l({...Ll.shape,...Mi.shape}),c$=l({name:a(),version:a()});var jl=Ne(require("path")),Fl=Ne(require("fs/promises"));var Bi=require("node:stream");var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Wt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new Gr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Gr=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 ht=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Li({error:e,requestBody:t}){return e instanceof ht?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Li,"toFailsafeOutput");var qt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(qt||{});var Kt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,Q]of Object.entries(c))i.append(M,Q);let p=i.toString(),y=p?`${n}?${p}`:n,h=t.responseType??"json",P=t.followRedirects??!0,A=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Bl(t.method)?Zl(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},f=Hl({...u,...s}),m=await Vl(async()=>{let M=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:f,body:x,redirect:P?"follow":"manual",signal:M.signal};return d&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(y,ne)}finally{Q!==void 0&&clearTimeout(Q)}},A),v=P?300:400;if(m.status<200||m.status>=v){let M=await ji(m,h),Q=new ht(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let _=await ji(m,h);return{status:m.status,headers:Gl(m.headers),body:_}}};function Bl(e){return e!=="GET"&&e!=="HEAD"}o(Bl,"acceptsRequestBody");function Zl(e,t){if(ql(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Wl(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(Zl,"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 Vl(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(Vl,"sendWithRetries");function Fi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Fi,"backoff");function Hl(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(Hl,"normalizeHeaders");function Gl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Gl,"toHttpHeaders");function Wl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Wl,"isNodeFormData");function ql(e){return e==null}o(ql,"isNil");var Jt=new Kt;var Dd=Ne(require("fs")),qs=Ne(Ws());var Cd={"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 Ud(e){let t=e.split(";")[0].trim().toLowerCase();return Cd[t]??""}o(Ud,"contentTypeToExtension");var Md=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Ld=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:u,props:c,extraProps:p,authLocation:y="headers"}){return Ae({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:B.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:B.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Ld(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:B.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(qt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:B.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:B.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:B.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:B.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let P=h,A={};switch(P){case"none":break;case"json":A.data=B.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":A.data=B.LongText({displayName:"Raw Body",required:!0});break;case"form_data":A.data=B.Array({displayName:"Form Data",required:!0,properties:{fieldName:B.ShortText({displayName:"Field Name",required:!0}),fieldType:B.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:B.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:B.File({displayName:"File Field Value",required:!1})}});break}return A},"props")}),response_is_binary:B.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:B.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:B.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:B.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:P,url:A,headers:x,queryParams:s,body:d,body_type:f,failsafe:m,timeout:v,response_is_binary:_,followRedirects:M}=h.propsValue;Ft(P,"Method"),Ft(A,"URL");let Q=ie(r)?{}:await r(h.auth,h.propsValue),ne=A.url,qe=ne.startsWith("http://")||ne.startsWith("https://")?ne:Md({baseUrl:t(h.auth),relativePath:ne}),ve={method:P,url:qe,headers:{...x??{},...y==="headers"||!ie(y)?Q:{}},queryParams:{...y==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:M};if(_&&(ve.responseType="arraybuffer"),d)if(f&&f!=="none"){let pe=d.data;if(f==="form_data"){let su=pe,bt=new qs.default;for(let{fieldName:yn,fieldType:hn,textFieldValue:vn,fileFieldValue:ur}of su)hn==="text"&&!mt(vn)?bt.append(yn,vn):hn==="file"&&!mt(ur)&&bt.append(yn,ur.data,{filename:ur?.filename});ve.body=bt,ve.headers={...ve.headers,...bt.getHeaders()}}else ve.body=pe}else f||(ve.body=d);try{let pe=await Jt.sendRequest(ve);return await jd(h.files,pe.body,pe.status,pe.headers,_)}catch(pe){if(m)return Li({error:pe,requestBody:ve.body});throw pe}},"run")})}o(Ks,"createCustomApiCallAction");var jd=o(async(e,t,r,n,i)=>{let u;if(i&&Fd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Ud(c??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Fd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");async function Js(e){await fn({auth:e,limit:1})}o(Js,"validateAlgoliaAuth");async function fn({auth:e,limit:t=1e3}){let r=[],n=0;for(;r.length<t;){let i=t-r.length,u=await _t({auth:e,method:"GET",path:"/indexes",queryParams:{page:String(n),hitsPerPage:String(Math.min(i,Zd))}});if(r.push(...u.items),u.items.length===0||n+1>=u.nbPages)break;n+=1}return r}o(fn,"listAlgoliaIndices");async function Xs({auth:e,indexName:t,records:r}){let n=await _t({auth:e,method:"POST",path:`/indexes/${encodeURIComponent(t)}/batch`,body:{requests:r.map(i=>({action:"addObject",body:i}))}});return await eu({auth:e,indexName:t,taskId:n.taskID}),n}o(Xs,"saveAlgoliaRecords");async function Ys({auth:e,indexName:t,limit:r=1e4}){let n=[],i;do{let u=await _t({auth:e,method:"POST",path:`/indexes/${encodeURIComponent(t)}/browse`,body:i?{cursor:i}:{}});n.push(...u.hits),i=u.cursor}while(i&&n.length<r);return n.slice(0,r)}o(Ys,"browseAlgoliaRecords");async function Qs({auth:e,indexName:t,objectIDs:r}){let n=await _t({auth:e,method:"POST",path:`/indexes/${encodeURIComponent(t)}/batch`,body:{requests:r.map(i=>({action:"deleteObject",body:{objectID:i}}))}});return await eu({auth:e,indexName:t,taskId:n.taskID}),n}o(Qs,"deleteAlgoliaRecords");async function eu({auth:e,indexName:t,taskId:r}){for(let n=0;n<Vd;n+=1){if((await _t({auth:e,method:"GET",path:`/indexes/${encodeURIComponent(t)}/task/${r}`})).status==="published")return;await Bd(Hd)}throw new Error("The Algolia operation is taking too long. Try again or check your Algolia dashboard for the task status.")}o(eu,"waitForTask");async function _t({auth:e,method:t,path:r,body:n,queryParams:i}){let u={method:t,url:`https://${e.props.applicationId}.algolia.net/1${r}`,headers:{"x-algolia-application-id":e.props.applicationId,"x-algolia-api-key":e.props.apiKey,Accept:"application/json","Content-Type":"application/json"},...n?{body:n}:{},...i?{queryParams:i}:{}};return(await Jt.sendRequest(u)).body}o(_t,"sendRequest");function Bd(e){return new Promise(t=>{setTimeout(t,e)})}o(Bd,"sleep");var Zd=1e3,Vd=30,Hd=1e3;var se=Vt.CustomAuth({displayName:"Connection",description:"Authenticate with your Algolia Application ID and API key.\n\nTo get your credentials:\n1. Sign in to the Algolia dashboard.\n2. Open **Settings > API Keys**.\n3. Copy your **Application ID**.\n4. Copy an API key that can list indexes and manage records.\n\nThis piece needs permissions for `listIndexes`, `browse`, `addObject`, and `deleteObject`. Search-only API keys won't work for these actions.",required:!0,props:{applicationId:B.ShortText({displayName:"Application ID",description:"Your Algolia application ID.",required:!0}),apiKey:Vt.SecretText({displayName:"API Key",description:"An Algolia API key with index browsing and record write permissions.",required:!0})},validate:o(async({auth:e})=>{let{error:t}=await ft(()=>Js({props:{applicationId:e.applicationId,apiKey:e.apiKey}}));return t?{valid:!1,error:"Invalid Algolia credentials or missing required index permissions."}:{valid:!0}},"validate")});function We(e,t){if(typeof e!="string"||e.trim().length===0)throw new Error(`${t} is required.`);return e.trim()}o(We,"parseRequiredString");function tu(e,t){if(!Array.isArray(e)||e.length===0)throw new Error(`${t} must contain at least one value.`);return e.map((r,n)=>{if(typeof r!="string"||r.trim().length===0)throw new Error(`${t} item ${n+1} must be a non-empty string.`);return r.trim()})}o(tu,"parseStringArray");function ru(e){if(!Array.isArray(e)||e.length===0)throw new Error("Records must be a non-empty array of JSON objects.");return e.map((t,r)=>{if(!Gd(t))throw new Error(`Record ${r+1} must be a JSON object with JSON-compatible values.`);return t})}o(ru,"parseAlgoliaRecordArray");function nu(e){if(!ar(e))return!1;let t=e.props;return ar(t)?typeof t.applicationId=="string"&&t.applicationId.trim().length>0&&typeof t.apiKey=="string"&&t.apiKey.trim().length>0:!1}o(nu,"isAlgoliaAuthValue");function Gd(e){return ar(e)?Object.values(e).every(gn):!1}o(Gd,"isAlgoliaRecord");function gn(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null?!0:Array.isArray(e)?e.every(gn):ar(e)&&Object.values(e).every(gn)}o(gn,"isAlgoliaJsonValue");function ar(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ar,"isObject");var sr={index:o((e=!0)=>B.Dropdown({auth:se,displayName:"Index",description:"Select the Algolia index to use.",required:e,refreshers:["auth"],options:o(async({auth:t})=>{if(!nu(t))return{disabled:!0,options:[],placeholder:"Connect your account first"};let{data:r,error:n}=await ft(()=>fn({auth:t}));return n?{disabled:!0,options:[],placeholder:"Failed to load indices. Check your connection."}:r.length===0?{disabled:!1,options:[],placeholder:"No indices found. Save records to a new index first."}:{disabled:!1,options:r.map(i=>({label:i.name,value:i.name}))}},"options")}),"index")};var ou=Ae({auth:se,name:"browse-records",displayName:"Browse Records",description:"Retrieves records from an Algolia index.",audience:"both",aiMetadata:{description:"Retrieves the raw records stored in an Algolia index, paging through them up to an optional limit (default 10,000). Use this to dump or inspect index contents; it is a read-only lookup, not a relevance-ranked query, so it does not accept a search term. Idempotent.",idempotent:!0},props:{indexName:sr.index(),limit:B.Number({displayName:"Limit",description:"Maximum number of records to retrieve. Defaults to 10,000.",required:!1,defaultValue:1e4})},async run(e){let t=We(e.propsValue.indexName,"Index");return Ys({auth:e.auth,indexName:t,limit:e.propsValue.limit??1e4})}});var iu=Ae({auth:se,name:"delete-records",displayName:"Delete Records",description:"Deletes records from an Algolia index by objectID.",audience:"both",aiMetadata:{description:"Deletes records from an Algolia index by their objectIDs. Provide an array of the exact objectIDs to remove from the selected index. Idempotent: deleting the same IDs again leaves the index in the same state (already-absent IDs are simply no-ops).",idempotent:!0},props:{indexName:sr.index(),recordIds:B.Array({displayName:"Record IDs",description:"Provide the Algolia objectIDs to delete from the selected index.",required:!0})},async run(e){let t=We(e.propsValue.indexName,"Index"),r=tu(e.propsValue.recordIds,"Record IDs");return Qs({auth:e.auth,indexName:t,objectIDs:r})}});var au=Ae({auth:se,name:"save-records",displayName:"Save Records",description:"Adds or updates records in an Algolia index.",audience:"both",aiMetadata:{description:"Adds or updates one or more records in an Algolia search index (creating the index if it does not yet exist). Pass an array of JSON objects; include an `objectID` on a record to overwrite that existing record, or omit it to have Algolia generate a new one. Not idempotent: records without an `objectID` create a fresh record on every call, so repeating the call appends duplicates.",idempotent:!1},props:{indexName:B.ShortText({displayName:"Index Name",description:"Enter an existing index name or a new one \u2014 Algolia creates it automatically.",required:!0}),records:B.Json({displayName:"Records",description:"Provide an array of JSON objects to save. Include `objectID` to update an existing record, or omit it to let Algolia create one.",required:!0})},async run(e){let t=We(e.propsValue.indexName,"Index Name"),r=ru(e.propsValue.records);return Xs({auth:e.auth,indexName:t,records:r})}});var Wd=Ri({displayName:"Algolia",description:"Manage your Algolia search indices \u2014 add, browse, and delete records.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/algolia.png",categories:["DEVELOPER_TOOLS"],authors:["veri5ied"],auth:se,actions:[au,ou,iu,Ks({auth:se,baseUrl:o(e=>e?`https://${e.props.applicationId}.algolia.net/1`:"","baseUrl"),authMapping:o(async e=>({"x-algolia-application-id":e.props.applicationId,"x-algolia-api-key":e.props.apiKey}),"authMapping")})],triggers:[]});0&&(module.exports={algolia});
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
mime-types/index.js:
|
|
7
|
+
(*!
|
|
8
|
+
* mime-types
|
|
9
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
10
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*)
|
|
13
|
+
*/
|
package/src/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const algolia: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>>;
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AAErD,iEAAmE;AACnE,iEAAmE;AACnE,6DAA+D;AAC/D,4CAAgD;AAEnC,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,uEAAuE;IACzE,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,IAAI,EAAE,kBAAW;IACjB,OAAO,EAAE;QACP,gCAAiB;QACjB,oCAAmB;QACnB,oCAAmB;QACnB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,kBAAW;YACjB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO,EAAE,CAAC;gBACZ,CAAC;gBAED,OAAO,WAAW,IAAI,CAAC,KAAK,CAAC,aAAa,gBAAgB,CAAC;YAC7D,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;oBACpD,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;iBACvC,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const browseRecordsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
indexName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>>;
|
|
12
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
13
|
-
}>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.browseRecordsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
const utils_1 = require("../common/utils");
|
|
10
|
-
exports.browseRecordsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.algoliaAuth,
|
|
12
|
-
name: 'browse-records',
|
|
13
|
-
displayName: 'Browse Records',
|
|
14
|
-
description: 'Retrieves records from an Algolia index.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Retrieves the raw records stored in an Algolia index, paging through them up to an optional limit (default 10,000). Use this to dump or inspect index contents; it is a read-only lookup, not a relevance-ranked query, so it does not accept a search term. Idempotent.',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
indexName: props_1.algoliaProps.index(),
|
|
22
|
-
limit: pieces_framework_1.Property.Number({
|
|
23
|
-
displayName: 'Limit',
|
|
24
|
-
description: 'Maximum number of records to retrieve. Defaults to 10,000.',
|
|
25
|
-
required: false,
|
|
26
|
-
defaultValue: 10000,
|
|
27
|
-
}),
|
|
28
|
-
},
|
|
29
|
-
run(context) {
|
|
30
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
var _a;
|
|
32
|
-
const indexName = (0, utils_1.parseRequiredString)(context.propsValue.indexName, 'Index');
|
|
33
|
-
return (0, client_1.browseAlgoliaRecords)({
|
|
34
|
-
auth: context.auth,
|
|
35
|
-
indexName,
|
|
36
|
-
limit: (_a = context.propsValue.limit) !== null && _a !== void 0 ? _a : 10000,
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=browse-records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browse-records.js","sourceRoot":"","sources":["../../../../src/lib/actions/browse-records.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yCAA6C;AAC7C,6CAAwD;AACxD,2CAA+C;AAC/C,2CAAsD;AAEzC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,0QAA0Q;QACvR,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,oBAAY,CAAC,KAAK,EAAE;QAC/B,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAM;SACrB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAE7E,OAAO,IAAA,6BAAoB,EAAC;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS;gBACT,KAAK,EAAE,MAAA,OAAO,CAAC,UAAU,CAAC,KAAK,mCAAI,KAAM;aAC1C,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const deleteRecordsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
indexName: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
9
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
11
|
-
}>>;
|
|
12
|
-
recordIds: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
13
|
-
}>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteRecordsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
const utils_1 = require("../common/utils");
|
|
10
|
-
exports.deleteRecordsAction = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.algoliaAuth,
|
|
12
|
-
name: 'delete-records',
|
|
13
|
-
displayName: 'Delete Records',
|
|
14
|
-
description: 'Deletes records from an Algolia index by objectID.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Deletes records from an Algolia index by their objectIDs. Provide an array of the exact objectIDs to remove from the selected index. Idempotent: deleting the same IDs again leaves the index in the same state (already-absent IDs are simply no-ops).',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
indexName: props_1.algoliaProps.index(),
|
|
22
|
-
recordIds: pieces_framework_1.Property.Array({
|
|
23
|
-
displayName: 'Record IDs',
|
|
24
|
-
description: 'Provide the Algolia objectIDs to delete from the selected index.',
|
|
25
|
-
required: true,
|
|
26
|
-
}),
|
|
27
|
-
},
|
|
28
|
-
run(context) {
|
|
29
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const indexName = (0, utils_1.parseRequiredString)(context.propsValue.indexName, 'Index');
|
|
31
|
-
const objectIDs = (0, utils_1.parseStringArray)(context.propsValue.recordIds, 'Record IDs');
|
|
32
|
-
return (0, client_1.deleteAlgoliaRecords)({
|
|
33
|
-
auth: context.auth,
|
|
34
|
-
indexName,
|
|
35
|
-
objectIDs,
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=delete-records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-records.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-records.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yCAA6C;AAC7C,6CAAwD;AACxD,2CAA+C;AAC/C,2CAAwE;AAE3D,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,oDAAoD;IACjE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,yPAAyP;QACtQ,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,oBAAY,CAAC,KAAK,EAAE;QAC/B,SAAS,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACxB,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,kEAAkE;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC7E,MAAM,SAAS,GAAG,IAAA,wBAAgB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAE/E,OAAO,IAAA,6BAAoB,EAAC;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS;gBACT,SAAS;aACV,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const saveRecordsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
-
}>, {
|
|
5
|
-
indexName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
-
records: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
7
|
-
}>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.saveRecordsAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const auth_1 = require("../common/auth");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const utils_1 = require("../common/utils");
|
|
9
|
-
exports.saveRecordsAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.algoliaAuth,
|
|
11
|
-
name: 'save-records',
|
|
12
|
-
displayName: 'Save Records',
|
|
13
|
-
description: 'Adds or updates records in an Algolia index.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Adds or updates one or more records in an Algolia search index (creating the index if it does not yet exist). Pass an array of JSON objects; include an `objectID` on a record to overwrite that existing record, or omit it to have Algolia generate a new one. Not idempotent: records without an `objectID` create a fresh record on every call, so repeating the call appends duplicates.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
indexName: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Index Name',
|
|
22
|
-
description: 'Enter an existing index name or a new one — Algolia creates it automatically.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
records: pieces_framework_1.Property.Json({
|
|
26
|
-
displayName: 'Records',
|
|
27
|
-
description: 'Provide an array of JSON objects to save. Include `objectID` to update an existing record, or omit it to let Algolia create one.',
|
|
28
|
-
required: true,
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
run(context) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const indexName = (0, utils_1.parseRequiredString)(context.propsValue.indexName, 'Index Name');
|
|
34
|
-
const records = (0, utils_1.parseAlgoliaRecordArray)(context.propsValue.records);
|
|
35
|
-
return (0, client_1.saveAlgoliaRecords)({
|
|
36
|
-
auth: context.auth,
|
|
37
|
-
indexName,
|
|
38
|
-
records,
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=save-records.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"save-records.js","sourceRoot":"","sources":["../../../../src/lib/actions/save-records.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AAExE,yCAA6C;AAC7C,6CAAsD;AACtD,2CAA+E;AAElE,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,+XAA+X;QAC5Y,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EACT,+EAA+E;YACjF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACrB,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,kIAAkI;YACpI,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAmB,EAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAClF,MAAM,OAAO,GAAG,IAAA,+BAAuB,EAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAEpE,OAAO,IAAA,2BAAkB,EAAC;gBACxB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,SAAS;gBACT,OAAO;aACR,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/auth.d.ts
DELETED
package/src/lib/common/auth.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.algoliaAuth = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const client_1 = require("./client");
|
|
8
|
-
exports.algoliaAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
9
|
-
displayName: 'Connection',
|
|
10
|
-
description: `Authenticate with your Algolia Application ID and API key.
|
|
11
|
-
|
|
12
|
-
To get your credentials:
|
|
13
|
-
1. Sign in to the Algolia dashboard.
|
|
14
|
-
2. Open **Settings > API Keys**.
|
|
15
|
-
3. Copy your **Application ID**.
|
|
16
|
-
4. Copy an API key that can list indexes and manage records.
|
|
17
|
-
|
|
18
|
-
This piece needs permissions for \`listIndexes\`, \`browse\`, \`addObject\`, and \`deleteObject\`. Search-only API keys won't work for these actions.`,
|
|
19
|
-
required: true,
|
|
20
|
-
props: {
|
|
21
|
-
applicationId: pieces_framework_1.Property.ShortText({
|
|
22
|
-
displayName: 'Application ID',
|
|
23
|
-
description: 'Your Algolia application ID.',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
apiKey: pieces_framework_1.PieceAuth.SecretText({
|
|
27
|
-
displayName: 'API Key',
|
|
28
|
-
description: 'An Algolia API key with index browsing and record write permissions.',
|
|
29
|
-
required: true,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
33
|
-
const { error } = yield (0, shared_1.tryCatch)(() => (0, client_1.validateAlgoliaAuth)({
|
|
34
|
-
props: {
|
|
35
|
-
applicationId: auth.applicationId,
|
|
36
|
-
apiKey: auth.apiKey,
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
if (error) {
|
|
40
|
-
return {
|
|
41
|
-
valid: false,
|
|
42
|
-
error: 'Invalid Algolia credentials or missing required index permissions.',
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
valid: true,
|
|
47
|
-
};
|
|
48
|
-
}),
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAAqE;AACrE,iDAAgD;AAEhD,qCAA+C;AAElC,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE;;;;;;;;sJAQuI;IACpJ,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,sEAAsE;YACnF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,CACpC,IAAA,4BAAmB,EAAC;YAClB,KAAK,EAAE;gBACL,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;SACF,CAAC,CACH,CAAC;QAEF,IAAI,KAAK,EAAE,CAAC;YACV,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EACH,oEAAoE;aACvE,CAAC;QACJ,CAAC;QAED,OAAO;YACL,KAAK,EAAE,IAAI;SACZ,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AlgoliaAuthValue, AlgoliaBatchResponse, AlgoliaIndex, AlgoliaRecord } from './types';
|
|
2
|
-
export declare function validateAlgoliaAuth(auth: AlgoliaAuthValue): Promise<void>;
|
|
3
|
-
export declare function listAlgoliaIndices({ auth, limit, }: {
|
|
4
|
-
auth: AlgoliaAuthValue;
|
|
5
|
-
limit?: number;
|
|
6
|
-
}): Promise<AlgoliaIndex[]>;
|
|
7
|
-
export declare function saveAlgoliaRecords({ auth, indexName, records, }: {
|
|
8
|
-
auth: AlgoliaAuthValue;
|
|
9
|
-
indexName: string;
|
|
10
|
-
records: AlgoliaRecord[];
|
|
11
|
-
}): Promise<AlgoliaBatchResponse>;
|
|
12
|
-
export declare function browseAlgoliaRecords({ auth, indexName, limit, }: {
|
|
13
|
-
auth: AlgoliaAuthValue;
|
|
14
|
-
indexName: string;
|
|
15
|
-
limit?: number;
|
|
16
|
-
}): Promise<AlgoliaRecord[]>;
|
|
17
|
-
export declare function deleteAlgoliaRecords({ auth, indexName, objectIDs, }: {
|
|
18
|
-
auth: AlgoliaAuthValue;
|
|
19
|
-
indexName: string;
|
|
20
|
-
objectIDs: string[];
|
|
21
|
-
}): Promise<AlgoliaBatchResponse>;
|
package/src/lib/common/client.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateAlgoliaAuth = validateAlgoliaAuth;
|
|
4
|
-
exports.listAlgoliaIndices = listAlgoliaIndices;
|
|
5
|
-
exports.saveAlgoliaRecords = saveAlgoliaRecords;
|
|
6
|
-
exports.browseAlgoliaRecords = browseAlgoliaRecords;
|
|
7
|
-
exports.deleteAlgoliaRecords = deleteAlgoliaRecords;
|
|
8
|
-
const tslib_1 = require("tslib");
|
|
9
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
-
function validateAlgoliaAuth(auth) {
|
|
11
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
yield listAlgoliaIndices({
|
|
13
|
-
auth,
|
|
14
|
-
limit: 1,
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function listAlgoliaIndices(_a) {
|
|
19
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, limit = 1000, }) {
|
|
20
|
-
const indices = [];
|
|
21
|
-
let page = 0;
|
|
22
|
-
while (indices.length < limit) {
|
|
23
|
-
const remaining = limit - indices.length;
|
|
24
|
-
const response = yield sendRequest({
|
|
25
|
-
auth,
|
|
26
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
27
|
-
path: '/indexes',
|
|
28
|
-
queryParams: {
|
|
29
|
-
page: String(page),
|
|
30
|
-
hitsPerPage: String(Math.min(remaining, ALGOLIA_MAX_PAGE_SIZE)),
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
indices.push(...response.items);
|
|
34
|
-
if (response.items.length === 0 || page + 1 >= response.nbPages) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
page += 1;
|
|
38
|
-
}
|
|
39
|
-
return indices;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function saveAlgoliaRecords(_a) {
|
|
43
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, records, }) {
|
|
44
|
-
const response = yield sendRequest({
|
|
45
|
-
auth,
|
|
46
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
47
|
-
path: `/indexes/${encodeURIComponent(indexName)}/batch`,
|
|
48
|
-
body: {
|
|
49
|
-
requests: records.map((record) => ({
|
|
50
|
-
action: 'addObject',
|
|
51
|
-
body: record,
|
|
52
|
-
})),
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
yield waitForTask({
|
|
56
|
-
auth,
|
|
57
|
-
indexName,
|
|
58
|
-
taskId: response.taskID,
|
|
59
|
-
});
|
|
60
|
-
return response;
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function browseAlgoliaRecords(_a) {
|
|
64
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, limit = 10000, }) {
|
|
65
|
-
const records = [];
|
|
66
|
-
let cursor;
|
|
67
|
-
do {
|
|
68
|
-
const response = yield sendRequest({
|
|
69
|
-
auth,
|
|
70
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
71
|
-
path: `/indexes/${encodeURIComponent(indexName)}/browse`,
|
|
72
|
-
body: cursor ? { cursor } : {},
|
|
73
|
-
});
|
|
74
|
-
records.push(...response.hits);
|
|
75
|
-
cursor = response.cursor;
|
|
76
|
-
} while (cursor && records.length < limit);
|
|
77
|
-
return records.slice(0, limit);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function deleteAlgoliaRecords(_a) {
|
|
81
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, objectIDs, }) {
|
|
82
|
-
const response = yield sendRequest({
|
|
83
|
-
auth,
|
|
84
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
85
|
-
path: `/indexes/${encodeURIComponent(indexName)}/batch`,
|
|
86
|
-
body: {
|
|
87
|
-
requests: objectIDs.map((objectID) => ({
|
|
88
|
-
action: 'deleteObject',
|
|
89
|
-
body: {
|
|
90
|
-
objectID,
|
|
91
|
-
},
|
|
92
|
-
})),
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
yield waitForTask({
|
|
96
|
-
auth,
|
|
97
|
-
indexName,
|
|
98
|
-
taskId: response.taskID,
|
|
99
|
-
});
|
|
100
|
-
return response;
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
function waitForTask(_a) {
|
|
104
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, indexName, taskId, }) {
|
|
105
|
-
for (let attempt = 0; attempt < ALGOLIA_TASK_MAX_ATTEMPTS; attempt += 1) {
|
|
106
|
-
const response = yield sendRequest({
|
|
107
|
-
auth,
|
|
108
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
109
|
-
path: `/indexes/${encodeURIComponent(indexName)}/task/${taskId}`,
|
|
110
|
-
});
|
|
111
|
-
if (response.status === 'published') {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
yield sleep(ALGOLIA_TASK_POLL_INTERVAL_MILLISECONDS);
|
|
115
|
-
}
|
|
116
|
-
throw new Error('The Algolia operation is taking too long. Try again or check your Algolia dashboard for the task status.');
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function sendRequest(_a) {
|
|
120
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, method, path, body, queryParams, }) {
|
|
121
|
-
const request = Object.assign(Object.assign({ method, url: `https://${auth.props.applicationId}.algolia.net/1${path}`, headers: {
|
|
122
|
-
'x-algolia-application-id': auth.props.applicationId,
|
|
123
|
-
'x-algolia-api-key': auth.props.apiKey,
|
|
124
|
-
Accept: 'application/json',
|
|
125
|
-
'Content-Type': 'application/json',
|
|
126
|
-
} }, (body ? { body } : {})), (queryParams ? { queryParams } : {}));
|
|
127
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
128
|
-
return response.body;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
function sleep(milliseconds) {
|
|
132
|
-
return new Promise((resolve) => {
|
|
133
|
-
setTimeout(resolve, milliseconds);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
const ALGOLIA_MAX_PAGE_SIZE = 1000;
|
|
137
|
-
const ALGOLIA_TASK_MAX_ATTEMPTS = 30;
|
|
138
|
-
const ALGOLIA_TASK_POLL_INTERVAL_MILLISECONDS = 1000;
|
|
139
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;AAIA,kDAKC;AAED,gDAgCC;AAED,gDA4BC;AAED,oDAyBC;AAED,oDA8BC;;AApID,+DAAkF;AAIlF,SAAsB,mBAAmB,CAAC,IAAsB;;QAC9D,MAAM,kBAAkB,CAAC;YACvB,IAAI;YACJ,KAAK,EAAE,CAAC;SACT,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAsB,kBAAkB;iEAAC,EACvC,IAAI,EACJ,KAAK,GAAG,IAAI,GAIb;QACC,MAAM,OAAO,GAAmB,EAAE,CAAC;QACnC,IAAI,IAAI,GAAG,CAAC,CAAC;QAEb,OAAO,OAAO,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;YAC9B,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;YACzC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAA2B;gBAC3D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE;oBACX,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;oBAClB,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;iBAChE;aACF,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEhC,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;gBAChE,MAAM;YACR,CAAC;YAED,IAAI,IAAI,CAAC,CAAC;QACZ,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAED,SAAsB,kBAAkB;iEAAC,EACvC,IAAI,EACJ,SAAS,EACT,OAAO,GAKR;QACC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAuB;YACvD,IAAI;YACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,IAAI,EAAE,YAAY,kBAAkB,CAAC,SAAS,CAAC,QAAQ;YACvD,IAAI,EAAE;gBACJ,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;oBACjC,MAAM,EAAE,WAAW;oBACnB,IAAI,EAAE,MAAM;iBACb,CAAC,CAAC;aACJ;SACF,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC;YAChB,IAAI;YACJ,SAAS;YACT,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAED,SAAsB,oBAAoB;iEAAC,EACzC,IAAI,EACJ,SAAS,EACT,KAAK,GAAG,KAAM,GAKf;QACC,MAAM,OAAO,GAAoB,EAAE,CAAC;QACpC,IAAI,MAA0B,CAAC;QAE/B,GAAG,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAwB;gBACxD,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,YAAY,kBAAkB,CAAC,SAAS,CAAC,SAAS;gBACxD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE;aAC/B,CAAC,CAAC;YAEH,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/B,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC3B,CAAC,QAAQ,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,KAAK,EAAE;QAE3C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;CAAA;AAED,SAAsB,oBAAoB;iEAAC,EACzC,IAAI,EACJ,SAAS,EACT,SAAS,GAKV;QACC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAuB;YACvD,IAAI;YACJ,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,IAAI,EAAE,YAAY,kBAAkB,CAAC,SAAS,CAAC,QAAQ;YACvD,IAAI,EAAE;gBACJ,QAAQ,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBACrC,MAAM,EAAE,cAAc;oBACtB,IAAI,EAAE;wBACJ,QAAQ;qBACT;iBACF,CAAC,CAAC;aACJ;SACF,CAAC,CAAC;QAEH,MAAM,WAAW,CAAC;YAChB,IAAI;YACJ,SAAS;YACT,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAED,SAAe,WAAW;iEAAC,EACzB,IAAI,EACJ,SAAS,EACT,MAAM,GAKP;QACC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,yBAAyB,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;YACxE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAA4B;gBAC5D,IAAI;gBACJ,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,YAAY,kBAAkB,CAAC,SAAS,CAAC,SAAS,MAAM,EAAE;aACjE,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBACpC,OAAO;YACT,CAAC;YAED,MAAM,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;IAC9H,CAAC;CAAA;AAED,SAAe,WAAW;iEAAY,EACpC,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,WAAW,GAOZ;QACC,MAAM,OAAO,iCACX,MAAM,EACN,GAAG,EAAE,WAAW,IAAI,CAAC,KAAK,CAAC,aAAa,iBAAiB,IAAI,EAAE,EAC/D,OAAO,EAAE;gBACP,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;gBACpD,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;gBACtC,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC,IACE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GACtB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACxC,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAY,OAAO,CAAC,CAAC;QAClE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CAAA;AAED,SAAS,KAAK,CAAC,YAAoB;IACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,qBAAqB,GAAG,IAAI,CAAC;AACnC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,MAAM,uCAAuC,GAAG,IAAI,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const algoliaProps: {
|
|
2
|
-
index: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
|
-
}>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
applicationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
-
}>>;
|
|
9
|
-
};
|
package/src/lib/common/props.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.algoliaProps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const shared_1 = require("@activepieces/shared");
|
|
7
|
-
const auth_1 = require("./auth");
|
|
8
|
-
const client_1 = require("./client");
|
|
9
|
-
const utils_1 = require("./utils");
|
|
10
|
-
exports.algoliaProps = {
|
|
11
|
-
index: (required = true) => pieces_framework_1.Property.Dropdown({
|
|
12
|
-
auth: auth_1.algoliaAuth,
|
|
13
|
-
displayName: 'Index',
|
|
14
|
-
description: 'Select the Algolia index to use.',
|
|
15
|
-
required,
|
|
16
|
-
refreshers: ['auth'],
|
|
17
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
18
|
-
if (!(0, utils_1.isAlgoliaAuthValue)(auth)) {
|
|
19
|
-
return {
|
|
20
|
-
disabled: true,
|
|
21
|
-
options: [],
|
|
22
|
-
placeholder: 'Connect your account first',
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const { data: indices, error } = yield (0, shared_1.tryCatch)(() => (0, client_1.listAlgoliaIndices)({
|
|
26
|
-
auth,
|
|
27
|
-
}));
|
|
28
|
-
if (error) {
|
|
29
|
-
return {
|
|
30
|
-
disabled: true,
|
|
31
|
-
options: [],
|
|
32
|
-
placeholder: 'Failed to load indices. Check your connection.',
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (indices.length === 0) {
|
|
36
|
-
return {
|
|
37
|
-
disabled: false,
|
|
38
|
-
options: [],
|
|
39
|
-
placeholder: 'No indices found. Save records to a new index first.',
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return {
|
|
43
|
-
disabled: false,
|
|
44
|
-
options: indices.map((index) => ({
|
|
45
|
-
label: index.name,
|
|
46
|
-
value: index.name,
|
|
47
|
-
})),
|
|
48
|
-
};
|
|
49
|
-
}),
|
|
50
|
-
}),
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,iDAAgD;AAEhD,iCAAqC;AACrC,qCAA8C;AAC9C,mCAA6C;AAEhC,QAAA,YAAY,GAAG;IAC1B,KAAK,EAAE,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE,CACzB,2BAAQ,CAAC,QAAQ,CAAC;QAChB,IAAI,EAAE,kBAAW;QACjB,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,kCAAkC;QAC/C,QAAQ;QACR,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;YACtB,IAAI,CAAC,IAAA,0BAAkB,EAAC,IAAI,CAAC,EAAE,CAAC;gBAC9B,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,4BAA4B;iBAC1C,CAAC;YACJ,CAAC;YAED,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,CACnD,IAAA,2BAAkB,EAAC;gBACjB,IAAI;aACL,CAAC,CACH,CAAC;YAEF,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,gDAAgD;iBAC9D,CAAC;YACJ,CAAC;YAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,sDAAsD;iBACpE,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;oBAC/B,KAAK,EAAE,KAAK,CAAC,IAAI;oBACjB,KAAK,EAAE,KAAK,CAAC,IAAI;iBAClB,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC,CAAA;KACF,CAAC;CACL,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export type AlgoliaAuthValue = {
|
|
2
|
-
props: {
|
|
3
|
-
applicationId: string;
|
|
4
|
-
apiKey: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
|
-
export type AlgoliaRecord = {
|
|
8
|
-
[key: string]: AlgoliaJsonValue;
|
|
9
|
-
};
|
|
10
|
-
export type AlgoliaJsonValue = string | number | boolean | null | AlgoliaRecord | AlgoliaJsonValue[];
|
|
11
|
-
export type AlgoliaIndex = {
|
|
12
|
-
name: string;
|
|
13
|
-
entries?: number;
|
|
14
|
-
dataSize?: number;
|
|
15
|
-
updatedAt?: string;
|
|
16
|
-
};
|
|
17
|
-
export type AlgoliaIndexListResponse = {
|
|
18
|
-
items: AlgoliaIndex[];
|
|
19
|
-
nbPages: number;
|
|
20
|
-
};
|
|
21
|
-
export type AlgoliaBrowseResponse = {
|
|
22
|
-
hits: AlgoliaRecord[];
|
|
23
|
-
cursor?: string;
|
|
24
|
-
};
|
|
25
|
-
export type AlgoliaBatchResponse = {
|
|
26
|
-
taskID: number;
|
|
27
|
-
objectIDs?: string[];
|
|
28
|
-
};
|
|
29
|
-
export type AlgoliaTaskStatusResponse = {
|
|
30
|
-
status: 'published' | 'notPublished';
|
|
31
|
-
};
|
package/src/lib/common/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/common/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AlgoliaAuthValue, AlgoliaRecord } from './types';
|
|
2
|
-
export declare function parseRequiredString(value: unknown, fieldName: string): string;
|
|
3
|
-
export declare function parseStringArray(value: unknown, fieldName: string): string[];
|
|
4
|
-
export declare function parseAlgoliaRecordArray(value: unknown): AlgoliaRecord[];
|
|
5
|
-
export declare function isAlgoliaAuthValue(value: unknown): value is AlgoliaAuthValue;
|
package/src/lib/common/utils.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseRequiredString = parseRequiredString;
|
|
4
|
-
exports.parseStringArray = parseStringArray;
|
|
5
|
-
exports.parseAlgoliaRecordArray = parseAlgoliaRecordArray;
|
|
6
|
-
exports.isAlgoliaAuthValue = isAlgoliaAuthValue;
|
|
7
|
-
function parseRequiredString(value, fieldName) {
|
|
8
|
-
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
9
|
-
throw new Error(`${fieldName} is required.`);
|
|
10
|
-
}
|
|
11
|
-
return value.trim();
|
|
12
|
-
}
|
|
13
|
-
function parseStringArray(value, fieldName) {
|
|
14
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
15
|
-
throw new Error(`${fieldName} must contain at least one value.`);
|
|
16
|
-
}
|
|
17
|
-
return value.map((entry, index) => {
|
|
18
|
-
if (typeof entry !== 'string' || entry.trim().length === 0) {
|
|
19
|
-
throw new Error(`${fieldName} item ${index + 1} must be a non-empty string.`);
|
|
20
|
-
}
|
|
21
|
-
return entry.trim();
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function parseAlgoliaRecordArray(value) {
|
|
25
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
26
|
-
throw new Error('Records must be a non-empty array of JSON objects.');
|
|
27
|
-
}
|
|
28
|
-
return value.map((entry, index) => {
|
|
29
|
-
if (!isAlgoliaRecord(entry)) {
|
|
30
|
-
throw new Error(`Record ${index + 1} must be a JSON object with JSON-compatible values.`);
|
|
31
|
-
}
|
|
32
|
-
return entry;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function isAlgoliaAuthValue(value) {
|
|
36
|
-
if (!isObject(value)) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
const props = value['props'];
|
|
40
|
-
if (!isObject(props)) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
return (typeof props['applicationId'] === 'string' &&
|
|
44
|
-
props['applicationId'].trim().length > 0 &&
|
|
45
|
-
typeof props['apiKey'] === 'string' &&
|
|
46
|
-
props['apiKey'].trim().length > 0);
|
|
47
|
-
}
|
|
48
|
-
function isAlgoliaRecord(value) {
|
|
49
|
-
if (!isObject(value)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return Object.values(value).every(isAlgoliaJsonValue);
|
|
53
|
-
}
|
|
54
|
-
function isAlgoliaJsonValue(value) {
|
|
55
|
-
if (typeof value === 'string' ||
|
|
56
|
-
typeof value === 'number' ||
|
|
57
|
-
typeof value === 'boolean' ||
|
|
58
|
-
value === null) {
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
if (Array.isArray(value)) {
|
|
62
|
-
return value.every(isAlgoliaJsonValue);
|
|
63
|
-
}
|
|
64
|
-
return isObject(value) && Object.values(value).every(isAlgoliaJsonValue);
|
|
65
|
-
}
|
|
66
|
-
function isObject(value) {
|
|
67
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/lib/common/utils.ts"],"names":[],"mappings":";;AAEA,kDAMC;AAED,4CAYC;AAED,0DAcC;AAED,gDAgBC;AAtDD,SAAgB,mBAAmB,CAAC,KAAc,EAAE,SAAiB;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,eAAe,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAgB,gBAAgB,CAAC,KAAc,EAAE,SAAiB;IAChE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,mCAAmC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,SAAS,KAAK,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,uBAAuB,CAAC,KAAc;IACpD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAChC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,UAAU,KAAK,GAAG,CAAC,qDAAqD,CACzE,CAAC;QACJ,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAc;IAC/C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CACL,OAAO,KAAK,CAAC,eAAe,CAAC,KAAK,QAAQ;QAC1C,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QACxC,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ;QACnC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,KAAK,KAAK,IAAI,EACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|