@activepieces/piece-cryptolens 0.0.6 → 0.0.8
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 -38
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-customer.d.ts +0 -10
- package/src/lib/actions/add-customer.d.ts.map +0 -1
- package/src/lib/actions/add-customer.js +0 -80
- package/src/lib/actions/add-customer.js.map +0 -1
- package/src/lib/actions/block-key.d.ts +0 -5
- package/src/lib/actions/block-key.d.ts.map +0 -1
- package/src/lib/actions/block-key.js +0 -42
- package/src/lib/actions/block-key.js.map +0 -1
- package/src/lib/actions/create-key.d.ts +0 -21
- package/src/lib/actions/create-key.d.ts.map +0 -1
- package/src/lib/actions/create-key.js +0 -169
- package/src/lib/actions/create-key.js.map +0 -1
- package/src/lib/actions/extend-license.d.ts +0 -6
- package/src/lib/actions/extend-license.d.ts.map +0 -1
- package/src/lib/actions/extend-license.js +0 -45
- package/src/lib/actions/extend-license.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -2
- package/src/lib/common/auth.d.ts.map +0 -1
- package/src/lib/common/auth.js +0 -37
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -4
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -27
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/triggers/new-api-event.d.ts +0 -23
- package/src/lib/triggers/new-api-event.d.ts.map +0 -1
- package/src/lib/triggers/new-api-event.js +0 -114
- package/src/lib/triggers/new-api-event.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-cryptolens",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
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,38 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cryptolens = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
displayName: 'Cryptolens',
|
|
15
|
-
auth: auth_1.cryptolensAuth,
|
|
16
|
-
minimumSupportedRelease: '0.36.1',
|
|
17
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/cryptolens.png',
|
|
18
|
-
authors: ['sanket-a11y'],
|
|
19
|
-
categories: [shared_1.PieceCategory.DEVELOPER_TOOLS],
|
|
20
|
-
description: 'Cryptolens is a Software Licensing as a Service (SLaaS) platform that provides developers with tools to manage software licenses, protect against piracy, and analyze usage data.',
|
|
21
|
-
actions: [
|
|
22
|
-
add_customer_1.addCustomer,
|
|
23
|
-
block_key_1.blockKey,
|
|
24
|
-
create_key_1.createKey,
|
|
25
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
26
|
-
auth: auth_1.cryptolensAuth,
|
|
27
|
-
baseUrl: () => 'https://api.cryptolens.io/api',
|
|
28
|
-
authLocation: 'queryParams',
|
|
29
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
-
return {
|
|
31
|
-
token: `${auth.secret_text}`,
|
|
32
|
-
};
|
|
33
|
-
}),
|
|
34
|
-
}),
|
|
35
|
-
],
|
|
36
|
-
triggers: [new_api_event_1.newApiEvent],
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var Qs=Object.create;var Xe=Object.defineProperty;var eu=Object.getOwnPropertyDescriptor;var tu=Object.getOwnPropertyNames;var ru=Object.getPrototypeOf,nu=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},yn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},hn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tu(t))!nu.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=eu(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?Qs(ru(e)):{},hn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),ou=e=>hn(Xe({},"__esModule",{value:!0}),e);var Fo=S((jo,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 f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],_,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(L=d-g,_=":";L--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ee=s.split(":"),oe=[];for(let Je=0;Je<ee.length;Je++)oe.push(parseInt(ee[Je],16));return oe})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let P={};P.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,L;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(L=m[_],g&&L!==0)return null;L!==8&&(g=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),P.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(s){return this.parser(s)!==null},P.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(s){return!!(P.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(s)||!d?!1:P.IPv4.isValidFourPartDecimal(d[1])},P.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},P.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let L=0;L<v.length;L++)g=v[L],_.push(x(g));return _})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(x(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},P.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new P.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),P.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},P.IPv6.isIPv6=function(s){return this.parser(s)!==null},P.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},P.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},P.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(s){let d,g,m,v,_,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.fromByteArray=function(s){let d=s.length;if(d===4)return new P.IPv4(s);if(d===16)return new P.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(s){return P.IPv6.isValid(s)||P.IPv4.isValid(s)},P.isValidCIDR=function(s){return P.IPv6.isValidCIDR(s)||P.IPv4.isValidCIDR(s)},P.parse=function(s){if(P.IPv6.isValid(s))return P.IPv6.parse(s);if(P.IPv4.isValid(s))return P.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(s){try{return P.IPv6.parseCIDR(s)}catch{try{return P.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},P.subnetMatch=function(s,d,g){let m,v,_,L;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(L=_[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return g},typeof Zt<"u"&&Zt.exports?Zt.exports=P:e.ipaddr=P})(jo)});var Vi=S((PA,Bi)=>{var Fi=require("stream").Stream,jp=require("util");Bi.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");jp.inherits(ae,Fi);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=Fi.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 Wi=S((bA,Gi)=>{var Fp=require("util"),Hi=require("stream").Stream,Zi=Vi();Gi.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");Fp.inherits(W,Hi);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 Zi)){var r=Zi.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 Hi.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 Ki=S((TA,qi)=>{"use strict";qi.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 Yi=S(Q=>{"use strict";var Jt=Ki(),Bp=require("path").extname,Ji=/^\s*([^;\s]*)(?:;|\s|$)/,Vp=/^text\//i;Q.charset=Xi;Q.charsets={lookup:Xi};Q.contentType=Zp;Q.extension=Hp;Q.extensions=Object.create(null);Q.lookup=Gp;Q.types=Object.create(null);Wp(Q.extensions,Q.types);function Xi(e){if(!e||typeof e!="string")return!1;var t=Ji.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Vp.test(t[1])?"UTF-8":!1}o(Xi,"charset");function Zp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Q.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Q.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Zp,"contentType");function Hp(e){if(!e||typeof e!="string")return!1;var t=Ji.exec(e),r=t&&Q.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Hp,"extension");function Gp(e){if(!e||typeof e!="string")return!1;var t=Bp("x."+e).toLowerCase().substr(1);return t&&Q.types[t]||!1}o(Gp,"lookup");function Wp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var h=r.indexOf(Jt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>x||h===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Wp,"populateMaps")});var ea=S(($A,Qi)=>{Qi.exports=qp;function qp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(qp,"defer")});var Gr=S((zA,ra)=>{var ta=ea();ra.exports=Kp;function Kp(e){var t=!1;return ta(function(){t=!0}),o(function(n,i){t?e(n,i):ta(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Kp,"async")});var Wr=S((kA,na)=>{na.exports=Jp;function Jp(e){Object.keys(e.jobs).forEach(Xp.bind(e)),e.jobs={}}o(Jp,"abort");function Xp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Xp,"clean")});var qr=S((RA,ia)=>{var oa=Gr(),Yp=Wr();ia.exports=Qp;function Qp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=el(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Yp(r):r.results[i]=c,n(u,r.results))})}o(Qp,"iterate");function el(e,t,r,n){var i;return e.length==2?i=e(r,oa(n)):i=e(r,t,oa(n)),i}o(el,"runJob")});var Kr=S((DA,aa)=>{aa.exports=tl;function tl(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(tl,"state")});var Jr=S((UA,sa)=>{var rl=Wr(),nl=Gr();sa.exports=ol;function ol(e){Object.keys(this.jobs).length&&(this.index=this.size,rl(this),nl(e)(null,this.results))}o(ol,"terminator")});var ca=S((LA,ua)=>{var il=qr(),al=Kr(),sl=Jr();ua.exports=ul;function ul(e,t,r){for(var n=al(e);n.index<(n.keyedList||e).length;)il(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 sl.bind(n,r)}o(ul,"parallel")});var Xr=S((FA,Xt)=>{var pa=qr(),cl=Kr(),pl=Jr();Xt.exports=ll;Xt.exports.ascending=la;Xt.exports.descending=dl;function ll(e,t,r,n){var i=cl(e,r);return pa(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){pa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),pl.bind(i,n)}o(ll,"serialOrdered");function la(e,t){return e<t?-1:e>t?1:0}o(la,"ascending");function dl(e,t){return-1*la(e,t)}o(dl,"descending")});var ma=S((VA,da)=>{var ml=Xr();da.exports=fl;function fl(e,t,r){return ml(e,t,null,r)}o(fl,"serial")});var ga=S((HA,fa)=>{fa.exports={parallel:ca(),serial:ma(),serialOrdered:Xr()}});var Yr=S((GA,ya)=>{"use strict";ya.exports=Object});var va=S((WA,ha)=>{"use strict";ha.exports=Error});var Pa=S((qA,xa)=>{"use strict";xa.exports=EvalError});var ba=S((KA,_a)=>{"use strict";_a.exports=RangeError});var Ta=S((JA,Ia)=>{"use strict";Ia.exports=ReferenceError});var Sa=S((XA,Ea)=>{"use strict";Ea.exports=SyntaxError});var Yt=S((YA,$a)=>{"use strict";$a.exports=TypeError});var za=S((QA,Aa)=>{"use strict";Aa.exports=URIError});var ka=S((ez,Oa)=>{"use strict";Oa.exports=Math.abs});var Ra=S((tz,wa)=>{"use strict";wa.exports=Math.floor});var Da=S((rz,Na)=>{"use strict";Na.exports=Math.max});var Ua=S((nz,Ca)=>{"use strict";Ca.exports=Math.min});var La=S((oz,Ma)=>{"use strict";Ma.exports=Math.pow});var Fa=S((iz,ja)=>{"use strict";ja.exports=Math.round});var Va=S((az,Ba)=>{"use strict";Ba.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ha=S((uz,Za)=>{"use strict";var gl=Va();Za.exports=o(function(t){return gl(t)||t===0?t:t<0?-1:1},"sign")});var Wa=S((pz,Ga)=>{"use strict";Ga.exports=Object.getOwnPropertyDescriptor});var Qr=S((lz,qa)=>{"use strict";var Qt=Wa();if(Qt)try{Qt([],"length")}catch{Qt=null}qa.exports=Qt});var Ja=S((dz,Ka)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Ka.exports=er});var en=S((mz,Xa)=>{"use strict";Xa.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 es=S((gz,Qa)=>{"use strict";var Ya=typeof Symbol<"u"&&Symbol,yl=en();Qa.exports=o(function(){return typeof Ya!="function"||typeof Symbol!="function"||typeof Ya("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yl()},"hasNativeSymbols")});var tn=S((hz,ts)=>{"use strict";ts.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rn=S((vz,rs)=>{"use strict";var hl=Yr();rs.exports=hl.getPrototypeOf||null});var is=S((xz,os)=>{"use strict";var vl="Function.prototype.bind called on incompatible ",xl=Object.prototype.toString,Pl=Math.max,_l="[object Function]",ns=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"),bl=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"),Il=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");os.exports=o(function(t){var r=this;if(typeof r!="function"||xl.apply(r)!==_l)throw new TypeError(vl+r);for(var n=bl(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,ns(n,arguments));return Object(x)===x?x:this}return r.apply(t,ns(n,arguments))},"binder"),c=Pl(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Il(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var He=S((_z,as)=>{"use strict";var Tl=is();as.exports=Function.prototype.bind||Tl});var tr=S((bz,ss)=>{"use strict";ss.exports=Function.prototype.call});var nn=S((Iz,us)=>{"use strict";us.exports=Function.prototype.apply});var ps=S((Tz,cs)=>{"use strict";cs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ds=S((Ez,ls)=>{"use strict";var El=He(),Sl=nn(),$l=tr(),Al=ps();ls.exports=Al||El.call($l,Sl)});var fs=S((Sz,ms)=>{"use strict";var zl=He(),Ol=Yt(),kl=tr(),wl=ds();ms.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Ol("a function is required");return wl(zl,kl,t)},"callBindBasic")});var Ps=S((Az,xs)=>{"use strict";var Rl=fs(),gs=Qr(),hs;try{hs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var on=!!hs&&gs&&gs(Object.prototype,"__proto__"),vs=Object,ys=vs.getPrototypeOf;xs.exports=on&&typeof on.get=="function"?Rl([on.get]):typeof ys=="function"?o(function(t){return ys(t==null?t:vs(t))},"getDunder"):!1});var Es=S((Oz,Ts)=>{"use strict";var _s=tn(),bs=rn(),Is=Ps();Ts.exports=_s?o(function(t){return _s(t)},"getProto"):bs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return bs(t)},"getProto"):Is?o(function(t){return Is(t)},"getProto"):null});var an=S((wz,Ss)=>{"use strict";var Nl=Function.prototype.call,Dl=Object.prototype.hasOwnProperty,Cl=He();Ss.exports=Cl.call(Nl,Dl)});var Rs=S((Rz,ws)=>{"use strict";var M,Ul=Yr(),Ml=va(),Ll=Pa(),jl=ba(),Fl=Ta(),Ke=Sa(),qe=Yt(),Bl=za(),Vl=ka(),Zl=Ra(),Hl=Da(),Gl=Ua(),Wl=La(),ql=Fa(),Kl=Ha(),Os=Function,sn=o(function(e){try{return Os('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=Qr(),Jl=Ja(),un=o(function(){throw new qe},"throwTypeError"),Xl=xt?(function(){try{return arguments.callee,un}catch{try{return xt(arguments,"callee").get}catch{return un}}})():un,Ge=es()(),X=Es(),Yl=rn(),Ql=tn(),ks=nn(),Pt=tr(),We={},ed=typeof Uint8Array>"u"||!X?M:X(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&X?X([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ml,"%eval%":eval,"%EvalError%":Ll,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":Os,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&X?X(X([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!X?M:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ul,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":jl,"%ReferenceError%":Fl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!X?M:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&X?X(""[Symbol.iterator]()):M,"%Symbol%":Ge?Symbol:M,"%SyntaxError%":Ke,"%ThrowTypeError%":Xl,"%TypedArray%":ed,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Bl,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":ks,"%Object.defineProperty%":Jl,"%Object.getPrototypeOf%":Yl,"%Math.abs%":Vl,"%Math.floor%":Zl,"%Math.max%":Hl,"%Math.min%":Gl,"%Math.pow%":Wl,"%Math.round%":ql,"%Math.sign%":Kl,"%Reflect.getPrototypeOf%":Ql};if(X)try{null.error}catch(e){$s=X(X(e)),Ne["%Error.prototype%"]=$s}var $s,td=o(function e(t){var r;if(t==="%AsyncFunction%")r=sn("async function () {}");else if(t==="%GeneratorFunction%")r=sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Ne[t]=r,r},"doEval"),As={__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"]},_t=He(),rr=an(),rd=_t.call(Pt,Array.prototype.concat),nd=_t.call(ks,Array.prototype.splice),zs=_t.call(Pt,String.prototype.replace),nr=_t.call(Pt,String.prototype.slice),od=_t.call(Pt,RegExp.prototype.exec),id=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ad=/\\(\\)?/g,sd=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return zs(t,id,function(u,c,p,f){i[i.length]=p?zs(f,ad,"$1"):c||u}),i},"stringToPath"),ud=o(function(t,r){var n=t,i;if(rr(As,n)&&(i=As[n],n="%"+i[0]+"%"),rr(Ne,n)){var u=Ne[n];if(u===We&&(u=td(n)),typeof u>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ws.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(od(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=sd(t),i=n.length>0?n[0]:"",u=ud("%"+i+"%",r),c=u.name,p=u.value,f=!1,h=u.alias;h&&(i=h[0],nd(n,rd([0,1],h)));for(var x=1,I=!0;x<n.length;x+=1){var P=n[x],s=nr(P,0,1),d=nr(P,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((P==="constructor"||!I)&&(f=!0),i+="."+P,c="%"+i+"%",rr(Ne,c))p=Ne[c];else if(p!=null){if(!(P in p)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&x+1>=n.length){var g=xt(p,P);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?p=g.get:p=p[P]}else I=rr(p,P),p=p[P];I&&!f&&(Ne[c]=p)}}return p},"GetIntrinsic")});var Ds=S((Dz,Ns)=>{"use strict";var cd=en();Ns.exports=o(function(){return cd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ms=S((Uz,Us)=>{"use strict";var pd=Rs(),Cs=pd("%Object.defineProperty%",!0),ld=Ds()(),dd=an(),md=Yt(),or=ld?Symbol.toStringTag:null;Us.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 md("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!dd(t,or))&&(Cs?Cs(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var js=S((Lz,Ls)=>{"use strict";var fd=Function.prototype.call,gd=Object.prototype.hasOwnProperty,yd=He();Ls.exports=yd.call(fd,gd)});var Bs=S((jz,Fs)=>{"use strict";Fs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Hs=S((Fz,Zs)=>{"use strict";var dn=Wi(),hd=require("util"),cn=require("path"),vd=require("http"),xd=require("https"),Pd=require("url").parse,_d=require("fs"),bd=require("stream").Stream,Id=require("crypto"),pn=Yi(),Td=ga(),Ed=Ms(),ze=js(),ln=Bs();function Vs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Vs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],dn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");hd.inherits(j,dn);j.LINE_BREAK=`\r
|
|
2
|
+
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=dn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ze(t,"httpVersion"))&&!(t instanceof bd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){ze(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):_d.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ze(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ze(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Vs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ln(c,r.header);var p;for(var f in c)if(ze(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=cn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=cn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ze(e,"httpVersion")&&(r=cn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Vs(r)+'"'};j.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&&ze(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=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ze(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Id.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Td.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Pd(e),n=ln({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=ln(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=xd.request(n):r=vd.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,f=o(function(h,x){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,h,x)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Ed(j.prototype,"FormData");Zs.exports=j});var Ld={};yn(Ld,{cryptolens:()=>Md});module.exports=ou(Ld);var iu=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let h=c.prototype,x=Object.keys(h);for(let I=0;I<x.length;I++){let P=x[I];P in p||(p[P]=h[P].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 f;let h=r?.Parent?new u:this;n(h,p),(f=h._zod).deferred??(f.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(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.")}},Tt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},sr={};function de(e){return e&&Object.assign(sr,e),sr}o(de,"config");function cr(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(cr,"getEnumValues");function xn(e,t){return typeof t=="bigint"?t.toString():t}o(xn,"jsonStringifyReplacer");function St(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(St,"cached");function Pn(e){return e==null}o(Pn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var vn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==vn)return n===void 0&&(n=vn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var pr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var au=St(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var bn=new Set(["string","number","symbol"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ce,"escapeRegex");function At(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(At,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function In(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(In,"optionalKeys");var Tn={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 Ue(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(Ue,"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 Et(e){return typeof e=="string"?e:e?.message}o(Et,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Et(e.inst?._zod.def?.error?.(e))??Et(t?.error?.(e))??Et(r.customError?.(e))??Et(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Pe,"finalizeIssue");function En(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(En,"getLengthableOrigin");function lr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(lr,"issue");var Sn=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,xn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$n=b("$ZodError",Sn),Qe=b("$ZodError",Sn,{Parent:Error});var uu=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(f=>Pe(f,u,de())));throw pr(p,i?.callee),p}return c.value},"_parse"),zt=uu(Qe),cu=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(f=>Pe(f,u,de())));throw pr(p,i?.callee),p}return c.value},"_parseAsync"),Ot=cu(Qe),pu=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??$n)(u.issues.map(c=>Pe(c,i,de())))}:{success:!0,data:u.value}},"_safeParse"),et=pu(Qe),lu=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"),tt=lu(Qe);var du="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mu=new RegExp(`^${du}$`);var An=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),zn=/^-?\d+n?$/,On=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,kn=/^(?: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=[])}),fu={number:"number",bigint:"bigint",object:"date"};var wn=b("$ZodCheckGreaterThan",(e,t)=>{_e.init(e,t);let r=fu[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 Rn=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]=Tn[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=On)}),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 Nn=b("$ZodCheckMinLength",(e,t)=>{var r;_e.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Pn(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=En(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var mr=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=()=>{})}),Dn=b("$ZodCheckRegex",(e,t)=>{mr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Un={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let 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,f)=>{let h=Ue(c),x;for(let I of p){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let P=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ue;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==P&&(h||(h=Ue(c,P)))});else{if(c.issues.length===P)continue;h||(h=Ue(c,P))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ue(c))return c.aborted=!0,c;let h=i(p,n,f);if(h instanceof Promise){if(f.async===!1)throw new ue;return h.then(x=>e._zod.parse(x,f))}return e._zod.parse(h,f)},"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(x=>u(x,c,p)):u(h,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new ue;return f.then(h=>i(h,n,p))}return i(f,n,p)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=et(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return tt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??An(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}}),fr=b("$ZodStringFormat",(e,t)=>{mr.init(e,t),Rt.init(e,t)});var Bn=b("$ZodURL",(e,t)=>{fr.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 gr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??dr,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}}),Vn=b("$ZodNumberFormat",(e,t)=>{Rn.init(e,t),gr.init(e,t)}),yr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=kn,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}}),Zn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=zn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Hn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Gn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Wn=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}}),qn=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 Mn(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(Mn,"handleArrayResult");var Kn=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],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(h=>Mn(h,r,c))):Mn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function gu(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=In(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(gu,"normalizeDef");function yu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,h=f.def.type,x=f.optout==="optional";for(let I in t){if(p.has(I))continue;if(h==="never"){c.push(I);continue}let P=f.run({value:t[I],issues:[]},n);P instanceof Promise?e.push(P.then(s=>wt(s,r,I,t,x))):wt(P,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(yu,"handleCatchall");var Jn=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 f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=St(()=>gu(t));q(e._zod,"propValues",()=>{let p=t.shape,f={};for(let h in p){let x=p[h]._zod;if(x.values){f[h]??(f[h]=new Set);for(let I of x.values)f[h].add(I)}}return f});let i=Ye,u=t.catchall,c;e._zod.parse=(p,f)=>{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 x=[],I=c.shape;for(let P of c.keys){let s=I[P],d=s._zod.optout==="optional",g=s._zod.run({value:h[P],issues:[]},f);g instanceof Promise?x.push(g.then(m=>wt(m,p,P,h,d))):wt(g,p,P,h,d)}return u?yu(x,h,p,f,n.value,e):x.length?Promise.all(x).then(()=>p):p}});function Ln(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=>!Ue(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(Ln,"handleUnionResults");var hr=b("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let h=f._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(f=>Ln(f,i,e,u)):Ln(p,i,e,u)}});var Xn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.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,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of f)i[p].add(h)}}return i});let n=St(()=>{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 f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Ye(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let 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 Yn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(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 x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...xe(h,I.issues)),r.value[h]=I.value})):(x.issues.length&&r.issues.push(...xe(h,x.issues)),r.value[h]=x.value)}let f;for(let h in i)p.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&dr.test(p)&&f.issues.length){let I=t.keyType._zod.run({value:Number(p),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Pe(I,n,de())),input:p,path:[p],inst:e});continue}let x=t.valueType._zod.run({value:i[p],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...xe(p,I.issues)),r.value[f.value]=I.value})):(x.issues.length&&r.issues.push(...xe(p,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Qn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=cr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>bn.has(typeof i)).map(i=>typeof i=="string"?Ce(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}}),eo=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"?Ce(n):n?Ce(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 to=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ue;return r.value=i,r}});function jn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(jn,"handleOptionalResult");var ro=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>jn(u,r.value)):jn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=b("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var oo=b("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var io=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=>Fn(u,r,n,e));Fn(i,r,n,e)}});function Fn(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(lr(i))}}o(Fn,"handleRefineResult");var so;var vr=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 uo(){return new vr}o(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var xr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...V(t)})}o(co,"_string");function po(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(po,"_coercedString");function lo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(lo,"_url");function mo(e,t){return new e({type:"number",checks:[],...V(t)})}o(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(fo,"_coercedNumber");function go(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(go,"_int");function yo(e,t){return new e({type:"boolean",...V(t)})}o(yo,"_boolean");function ho(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(ho,"_coercedBoolean");function vo(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(vo,"_coercedBigint");function xo(e){return new e({type:"any"})}o(xo,"_any");function Po(e){return new e({type:"unknown"})}o(Po,"_unknown");function _o(e,t){return new e({type:"void",...V(t)})}o(_o,"_void");function bo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(bo,"_coercedDate");function Nt(e,t){return new wn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Nt,"_gte");function ie(e,t){return new Nn({check:"min_length",...V(t),minimum:e})}o(ie,"_minLength");function be(e,t){return new Dn({check:"string_format",format:"regex",...V(t),pattern:e})}o(be,"_regex");function Io(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Io,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>At(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ct=b("ZodMiniString",(e,t)=>{Rt.init(e,t),K.init(e,t)});function a(e){return co(Ct,e)}o(a,"string");var To=b("ZodMiniStringFormat",(e,t)=>{fr.init(e,t),Ct.init(e,t)});var zu=b("ZodMiniURL",(e,t)=>{Bn.init(e,t),To.init(e,t)});function Eo(e){return lo(zu,e)}o(Eo,"url");var Ut=b("ZodMiniNumber",(e,t)=>{gr.init(e,t),K.init(e,t)});function Y(e){return mo(Ut,e)}o(Y,"number");var Ou=b("ZodMiniNumberFormat",(e,t)=>{Vn.init(e,t),Ut.init(e,t)});function So(e){return go(Ou,e)}o(So,"int");var Pr=b("ZodMiniBoolean",(e,t)=>{yr.init(e,t),K.init(e,t)});function B(e){return yo(Pr,e)}o(B,"boolean");var $o=b("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),K.init(e,t)});var ku=b("ZodMiniAny",(e,t)=>{Hn.init(e,t),K.init(e,t)});function nt(){return xo(ku)}o(nt,"any");var wu=b("ZodMiniUnknown",(e,t)=>{Gn.init(e,t),K.init(e,t)});function k(){return Po(wu)}o(k,"unknown");var Ru=b("ZodMiniVoid",(e,t)=>{Wn.init(e,t),K.init(e,t)});function Ao(e){return _o(Ru,e)}o(Ao,"_void");var zo=b("ZodMiniDate",(e,t)=>{qn.init(e,t),K.init(e,t)});var Nu=b("ZodMiniArray",(e,t)=>{Kn.init(e,t),K.init(e,t)});function N(e,t){return new Nu({type:"array",element:e,...V(t)})}o(N,"array");var Du=b("ZodMiniObject",(e,t)=>{Jn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new Du(r)}o(l,"object");var Cu=b("ZodMiniUnion",(e,t)=>{hr.init(e,t),K.init(e,t)});function D(e,t){return new Cu({type:"union",options:e,...V(t)})}o(D,"union");var Uu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Xn.init(e,t),K.init(e,t)});function Ie(e,t,r){return new Uu({type:"union",options:t,discriminator:e,...V(r)})}o(Ie,"discriminatedUnion");var Mu=b("ZodMiniRecord",(e,t)=>{Yn.init(e,t),K.init(e,t)});function w(e,t,r){return new Mu({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var Lu=b("ZodMiniEnum",(e,t)=>{Qn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Lu({type:"enum",entries:r,...V(t)})}o(U,"_enum");var ju=b("ZodMiniLiteral",(e,t)=>{eo.init(e,t),K.init(e,t)});function $(e,t){return new ju({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o($,"literal");var Fu=b("ZodMiniTransform",(e,t)=>{to.init(e,t),K.init(e,t)});function Te(e){return new Fu({type:"transform",transform:e})}o(Te,"transform");var Bu=b("ZodMiniOptional",(e,t)=>{ro.init(e,t),K.init(e,t)});function y(e){return new Bu({type:"optional",innerType:e})}o(y,"optional");var Vu=b("ZodMiniNullable",(e,t)=>{no.init(e,t),K.init(e,t)});function ot(e){return new Vu({type:"nullable",innerType:e})}o(ot,"nullable");var Zu=b("ZodMiniPipe",(e,t)=>{oo.init(e,t),K.init(e,t)});function Ee(e,t){return new Zu({type:"pipe",in:e,out:t})}o(Ee,"pipe");var Hu=b("ZodMiniCustom",(e,t)=>{io.init(e,t),K.init(e,t)});function Mt(e,t){return Io(Hu,e??(()=>!0),t)}o(Mt,"custom");var it={};yn(it,{bigint:()=>Xu,boolean:()=>Ju,date:()=>Yu,number:()=>Ku,string:()=>qu});function qu(e){return po(Ct,e)}o(qu,"string");function Ku(e){return fo(Ut,e)}o(Ku,"number");function Ju(e){return ho(Pr,e)}o(Ju,"boolean");function Xu(e){return vo($o,e)}o(Xu,"bigint");function Yu(e){return bo(zo,e)}o(Yu,"date");var br=l({retryOnFailure:l({defaultValue:y(B()),hide:y(B())}),continueOnFailure:l({defaultValue:y(B()),hide:y(B())})}),_r=class{constructor(t,r,n,i,u,c,p,f,h,x,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=x;this.aiMetadata=I}static{o(this,"IAction")}},Se=o(e=>new _r(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:y(a())}),C=o((e,t)=>l({type:$(t),required:B(),defaultValue:y(nt())}),"TPropertyValue");var te=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),me=l({...F.shape,...C(a(),"LONG_TEXT").shape});var ko=l({label:a(),value:k()}),Lt=l({disabled:y(B()),placeholder:y(a()),options:N(ko)});var re=l({...F.shape,options:Lt,...C(k(),"STATIC_DROPDOWN").shape}),fe=l({...F.shape,options:Lt,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ir=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),at=l({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ge=l({...F.shape,...C(B(),"CHECKBOX").shape});var ye=l({...F.shape,...C(Y(),"NUMBER").shape});var st=l({...F.shape,streaming:y(B()),...C(k(),"FILE").shape});var ut=l({...F.shape,...C(a(),"DATE_TIME").shape});var wo=w(a(),D([te,me,re,at,fe,ge,ye,st,ut])),ct=l({...F.shape,properties:wo,...C(N(k()),"ARRAY").shape});var pt=l({...F.shape,...C(D([w(a(),k())]),"JSON").shape});var Ro=D([te,re,pt,ct,fe]),ec=w(a(),Ro),Tr=l({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var jt=l({...F.shape,...C(Ao(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),Le=(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))(Le||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),Er="both_client_credentials_and_authorization_code";var $e=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))($e||{}),mt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(mt||{}),tc=l({strategy:U(mt),paramName:y(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),No=l({status:y(Y()),body:y(k()),headers:y(w(a(),a()))}),Do=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Ft))}),Co=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:No,handlerId:y(a()),streamStepProgress:y(U(Ft))}),rc=D([Do,Co]);var nc=l({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function J(e){return e==null}o(J,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var Sr=De(require("crypto"),1);var oc=128,ke,je,ic=o(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*oc),Sr.default.randomFillSync(ke),je=0):je+e>ke.length&&(Sr.default.randomFillSync(ke),je=0),je+=e},"fillPool"),ac=o(e=>(ic(e|=0),ke.subarray(je-e,je)),"random"),sc=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),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),Mo=o((e,t=21)=>sc(e,t,ac),"customAlphabet");var uc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Lo=21,Pb=a().check(be(new RegExp(`^[0-9a-zA-Z]{${Lo}}$`))),cc=Mo(uc,Lo);var Ae=Ee(Te(e=>e instanceof Date?e.toISOString():e),a()),ne={id:a(),created:Ae,updated:Ae},Z=o(e=>y(ot(e)),"Nullable");function $r(e){return y(ot(U(e)))}o($r,"NullableEnum");var Ib=Ee(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),Vt=o(e=>Ee(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var Sb=w(a(),k());var yt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(yt||{});var Mb=a().check(be(/^#[0-9A-Fa-f]{6}$/));var jb=l({filename:a(),data:k(),type:$("file"),mimetype:y(a())});var pc=De(Fo());var Wb=l({...ne,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:y(Y())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),Ar=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ar||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var Or=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Or||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var lc=l({mode:U(Bo),value:k()}),dc=l({auth:y(a()),fields:w(a(),lc)}),mc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(dc)}),fc=l({type:$("PIECE"),toolName:a().check(ie(1)),pieceMetadata:mc}),gc=l({type:$("none")}),yc=l({type:$("access_token"),accessToken:a()}),hc=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),vc=l({type:$("headers"),headers:w(a(),a())}),xc=Ie("type",[gc,yc,hc,vc]),Vo=l({type:$("FLOW"),toolName:a().check(ie(1)),externalFlowId:a(),flowDisplayName:y(a())}),Zo=l({type:$("MCP"),toolName:a().check(ie(1)),serverUrl:Eo(),protocol:U(zr),auth:xc}),Ho=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(ie(1)),sourceType:U(Ar),sourceId:a(),sourceName:a()}),Pc=Ie("type",[fc,Vo,Zo,Ho]),_c=l({displayName:a(),description:y(a()),type:U(Or)}),Go=l({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:Z(w(a(),k())),output:y(k()),toolName:a(),status:U(kr),toolCallId:a(),startTime:a(),endTime:y(a())},TI=l(Fe),Wo=Ie("toolCallType",[l({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),bc=D([Go,Wo]);var wr=(r=>(r.IMAGE="image",r.TEXT="text",r))(wr||{}),he=l({apiKey:a()}),Ic=he,Tc=l({apiKey:a(),apiKeyHash:a()}),Ec=he,Sc=he,$c=he,Ac=he,zc=he,Oc=he,kc=he,Yo=l({accessKeyId:a().check(ie(1)),secretAccessKey:a().check(ie(1))}),wc=l({}),Rc=l({}),Nc=l({}),Dc=l({}),Cc=l({}),Uc=l({}),Qo=l({modelId:a(),modelName:a(),modelType:U(wr)}),ei=l({apiKeyHeader:a(),baseUrl:a(),models:N(Qo),defaultHeaders:y(w(a(),a()))}),ti=l({accountId:a(),gatewayId:a(),models:N(Qo),vertexProject:y(a()),vertexRegion:y(a())}),ri=l({resourceName:a(),apiVersion:Ee(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),ni=l({region:a().check(ie(1))}),Mc=D([Ic,$c,Ac,zc,Oc,Sc,Ec,Tc,Yo,kc]),oi=D([ei,ti,ri,ni,wc,Nc,Dc,Cc,Rc,Uc]),Lc=l({id:a(),name:a(),type:U(wr)}),jc=l({id:a(),name:a(),provider:U(yt),config:oi,enabledForChat:B()}),Fc=l({provider:U(yt),config:oi,auth:Mc,platformId:a()});var AI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},qo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Bc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Vc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ko=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Zc=["grok-4.20","grok-4.1-fast"],Hc={openai:qo,anthropic:Bc,google:Ko,activepieces:[...Vc.map(e=>`anthropic/${e}`),...qo.map(e=>`openai/${e}`),...Ko.map(e=>`google/${e}`),...Zc.map(e=>`x-ai/${e}`)]};var Jo=128e3,Gc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Wc({provider:e}){return e?Gc[e]??Jo:Jo}o(Wc,"getMaxContextTokens");var Xo={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"},qc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Kc=new Set(["anthropic","mistral"]);function ce(e){return{chatModels:Hc[e],maxContextTokens:Wc({provider:e}),defaultEmbeddingModel:Xo[e],supportsEmbedding:Xo[e]!==void 0,supportsImageGeneration:!Kc.has(e),webSearch:qc[e]}}o(ce,"buildProviderCapabilities");var Jc={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 Xc=l({base64Url:a(),fileName:a(),extension:y(a())}),Yc=l({mimeType:a(),url:a(),fileName:y(a())}),Rr=D([Xc,Yc]);var Qc=D([l({type:$("file"),value:Rr}),l({type:$("markdown"),value:a(),files:y(N(Rr))})]),ep=l({sessionId:a(),message:a(),files:y(N(a()))});var ai=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ai||{}),si=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(si||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var tp=D([l({...ne,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ne,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),rp=l({...ne,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:$r(si),trigger:$r(ai)}),np=l({...ne,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),op=l({events:N(U(Nr)),webhookUrl:a(),flowId:a()}),ip=l({fields:N(l({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),ap=l({projectId:a(),limit:y(it.number()),cursor:y(a()),name:y(a()),externalIds:Vt(a()),folderId:y(a()),folderIds:Vt(a())}),sp=l({records:N(N(l({fieldId:a(),value:ci()}))),tableId:a()}),up=l({cells:y(N(l({fieldId:a(),value:ci()}))),tableId:a(),agentUpdate:y(B())}),ui=Ie("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),ii("exists"),ii("not_exists")]),cp=l({tableId:a(),limit:y(it.number()),cursor:y(a()),filters:Vt(ui)});function ci(){return Ee(Te(e=>e==null?e:String(e)),ot(a()))}o(ci,"coerceToString");function we(e){return l({fieldId:a(),operator:$(e),value:a()})}o(we,"valueFilter");function ii(e){return l({fieldId:a(),operator:$(e)})}o(ii,"existenceFilter");var pp=l({status:y(Y()),body:y(k()),headers:y(w(a(),a()))}),lp=l({...ne,deleted:Z(Ae),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var pi=l({name:a(),description:y(a()),type:a(),required:B()}),dp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(pi),returnsResponse:B()})});var li="^[0-9]+\\.[0-9]+\\.[0-9]+$",WI=new RegExp(li),fp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",qI=a().check(be(new RegExp(li))),KI=a().check(be(new RegExp(fp))),gp=l({packageType:$("ARCHIVE"),pieceType:U(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),di=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),mi=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),JI=D([di,mi]),XI=D([gp,di,mi]);var yp=Ie("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:So().check(Nt(6e4))})]),YI=l({...ne,type:U($e),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(yp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),fi=(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))(fi||{}),gi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(gi||{}),yi=(r=>(r.S3="S3",r.DB="DB",r))(yi||{}),QI=l({...ne,projectId:Z(a()),platformId:Z(a()),type:U(fi),compression:U(gi),data:y(k()),location:U(yi),size:Z(Y()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),hi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(hi||{}),vi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(vi||{}),eT=l({id:a(),email:a(),firstName:a(),status:U(vi),externalId:Z(a()),platformId:Z(a()),platformRole:U(hi),lastName:a(),created:Ae,updated:Ae,lastActiveDate:Z(Ae),imageUrl:Z(a())});var Dr=l({...F.shape,...C(w(a(),k()),"OBJECT").shape});var bi=l({...F.shape,...C(a(),"COLOR").shape});var Cr=D([te,me,jt,ge,re,fe,Ir,at,Tr,ye,ct,Dr,pt,ut,st,bi]),E={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var pe=l({displayName:a(),description:y(a())});var Ii=l({username:a(),password:a()}),Ur=l({...pe.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(Ii,"BASIC_AUTH").shape});var Pp=w(a(),D([te,me,ye,ge,re])),Mr=l({...pe.shape,props:Pp,...C(k(),"CUSTOM_AUTH").shape});var Re=l({...pe.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var _p=w(a(),D([te,me,Re,ye,ge,re,fe,jt])),Ti=l({...pe.shape,props:_p,...C(k(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),Ei=D([te,Re,re]),Si=w(a(),Ei),bp=l({props:y(w(a(),Ei)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:y(B()),pkceMethod:y(D([$("plain"),$("S256")])),authorizationMethod:y(U(Lr)),grantType:y(D([U(dt),$(Er)])),extra:y(w(a(),a()))}),$i=l({access_token:a(),props:y(Si),data:w(a(),nt())}),jr=l({...pe.shape,...bp.shape,...C($i,"OAUTH2").shape});var Be=D([Ur,Mr,Ti,jr,Re]),ht="Connection",Fr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var wE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Ip=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Tp=D([Cr,Be]),Br=w(a(),Tp),YE=w(a(),Cr);var Ai=D([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]),Ve=class{constructor(t,r,n,i,u,c,p,f,h,x,I,P,s,d,g,m,v,_,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=x;this.onEnable=I;this.onDisable=P;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=_;this.aiMetadata=L}static{o(this,"ITrigger")}},zi=o(e=>{switch(e.type){case"WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,J(e.sampleData)&&J(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Oi="2",Ht="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,p,f,h=Ht,x,I="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=I;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Oi}),"getContextInfo");(!Ep(h)||Sp(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}},ki=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 Ep(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Ep,"isValidSimpleSemver");function Sp(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(Sp,"isSemverLessThan");var $p=y(w(a(),w(a(),a()))),wi=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([Be,N(Be)])),version:a(),categories:y(N(U(Le))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(B()),i18n:$p}),Ap=U(["human","ai","both"]),Ri=l({description:y(a()),idempotent:y(B())}),Ni=l({name:a(),displayName:a(),description:a(),props:Br,requireAuth:B(),errorHandlingOptions:y(br),outputSchema:y(Mt()),audience:y(Ap),aiMetadata:y(Ri)}),Di=l({name:a(),displayName:a(),description:a(),props:Br,errorHandlingOptions:y(br),type:U($e),sampleData:k(),handshakeConfiguration:y(Mt()),renewConfiguration:y(Ai),testStrategy:U(ft),outputSchema:y(Mt()),aiMetadata:y(Ri)}),zp=l({...wi.shape,actions:w(a(),Ni),triggers:w(a(),Di)}),Op=l({...wi.shape,actions:Y(),triggers:Y(),suggestedActions:y(N(Ni)),suggestedTriggers:y(N(Di))}),Ci=l({projectUsage:Y(),pieceType:U(Me),packageType:U(lt),platformId:y(a()),archiveId:y(a())}),YS=l({...zp.shape,...Ci.shape}),QS=l({...Op.shape,...Ci.shape}),e$=l({name:a(),version:a()});var kp=De(require("path")),wp=De(require("fs/promises"));var ji=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 Zr,r=new Hr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Hr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var vt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Ui({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Ui,"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[L,ee]of Object.entries(c))i.append(L,ee);let p=i.toString(),f=p?`${n}?${p}`:n,h=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:P,extraHeaders:s,isStream:d}=Rp(t.method)?Np(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=Cp({...u,...s}),m=await Dp(async()=>{let L=new AbortController,ee=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let oe={method:t.method.toString(),headers:g,body:P,redirect:x?"follow":"manual",signal:L.signal};return d&&(oe.duplex="half"),r?.dispatcher!==void 0&&(oe.dispatcher=r.dispatcher),await fetch(f,oe)}finally{ee!==void 0&&clearTimeout(ee)}},I),v=x?300:400;if(m.status<200||m.status>=v){let L=await Mi(m,h),ee=new vt(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ee),ee}let _=await Mi(m,h);return{status:m.status,headers:Up(m.headers),body:_}}};function Rp(e){return e!=="GET"&&e!=="HEAD"}o(Rp,"acceptsRequestBody");function Np(e,t){if(Lp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Mp(e)){let n=new ji.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(Np,"serializeBody");async function Mi(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(Mi,"parseResponseBody");async function Dp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Li(n);continue}return i}catch(i){if(r=i,n<t){await Li(n);continue}throw i}throw r}o(Dp,"sendWithRetries");function Li(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Li,"backoff");function Cp(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(Cp,"normalizeHeaders");function Up(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Up,"toHttpHeaders");function Mp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Mp,"isNodeFormData");function Lp(e){return e==null}o(Lp,"isNil");var Ze=new Kt;var Sd=De(require("fs")),Gs=De(Hs());var $d={"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 Ad(e){let t=e.split(";")[0].trim().toLowerCase();return $d[t]??""}o(Ad,"contentTypeToExtension");var zd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Od=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 Ws({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return Se({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:E.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:E.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Od(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:E.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(qt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:E.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:E.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:E.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:E.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,I={};switch(x){case"none":break;case"json":I.data=E.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=E.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=E.Array({displayName:"Form Data",required:!0,properties:{fieldName:E.ShortText({displayName:"Field Name",required:!0}),fieldType:E.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:E.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:E.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:E.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:E.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:E.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:E.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:x,url:I,headers:P,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:L}=h.propsValue;Bt(x,"Method"),Bt(I,"URL");let ee=J(r)?{}:await r(h.auth,h.propsValue),oe=I.url,Je=oe.startsWith("http://")||oe.startsWith("https://")?oe:zd({baseUrl:t(h.auth),relativePath:oe}),ve={method:x,url:Je,headers:{...P??{},...f==="headers"||!J(f)?ee:{}},queryParams:{...f==="queryParams"?ee:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(_&&(ve.responseType="arraybuffer"),d)if(g&&g!=="none"){let le=d.data;if(g==="form_data"){let Ys=le,It=new Gs.default;for(let{fieldName:mn,fieldType:fn,textFieldValue:gn,fileFieldValue:ar}of Ys)fn==="text"&&!gt(gn)?It.append(mn,gn):fn==="file"&&!gt(ar)&&It.append(mn,ar.data,{filename:ar?.filename});ve.body=It,ve.headers={...ve.headers,...It.getHeaders()}}else ve.body=le}else g||(ve.body=d);try{let le=await Ze.sendRequest(ve);return await kd(h.files,le.body,le.status,le.headers,_)}catch(le){if(m)return Ui({error:le,requestBody:ve.body});throw le}},"run")})}o(Ws,"createCustomApiCallAction");var kd=o(async(e,t,r,n,i)=>{let u;if(i&&wd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Ad(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),wd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var bt={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(J(p))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:c}),h=f.reduce((x,I)=>Math.max(x,I.epochMilliSeconds),p);return await t.put("lastPoll",h),f.filter(x=>x.epochMilliSeconds>p).map(x=>x.data)}case 1:{let p=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:u,server:c}),h=f.findIndex(P=>P.id===p),x=[];J(p)||h==-1?x=f??[]:x=f?.slice(0,h)??[],J(i)||(x=x.slice(-i));let I=x?.[0]?.id;return J(I)||await t.put("lastItem",I),x.map(P=>P.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;J(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:u}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:u});break}}return Rd(c.map(p=>p.data))}};function Rd(e){return e.length<=5?e:e.slice(0,5)}o(Rd,"getFirstFiveOrAll");var Nd="https://api.cryptolens.io/api";async function Dd(e){try{return await Ze.sendRequest({method:"GET",url:`${Nd}/auth/GetToken?token=${encodeURIComponent(e)}`}),!0}catch{return!1}}o(Dd,"validateAccessToken");var se=Fr.SecretText({displayName:"Access Token",description:"Your Cryptolens access token. Get it from https://app.cryptolens.io/User/AccessToken",required:!0,validate:o(async({auth:e})=>await Dd(e)?{valid:!0}:{valid:!1,error:"Invalid access token"},"validate")});var Cd="https://api.cryptolens.io/api";async function Oe(e,t,r,n){try{let i=`${Cd}${r}?token=${encodeURIComponent(e)}`;return(await Ze.sendRequest({method:t,url:i,headers:{"Content-Type":"application/json"},body:n})).body}catch(i){throw new Error(`Unexpected error: ${i.message||String(i)}`)}}o(Oe,"makeRequest");var qs=Se({auth:se,name:"addCustomer",displayName:"Add Customer",description:"Add a new customer to your Cryptolens account",audience:"both",aiMetadata:{description:"Creates a new customer record in a Cryptolens account, optionally enabling a customer portal so the customer can self-manage their licenses and device activations. Use to onboard a license holder before associating keys with them. Requires name, email, and company name; not idempotent \u2014 each call creates a separate customer.",idempotent:!1},props:{name:E.ShortText({displayName:"Name",description:"The name of the customer (max 100 characters)",required:!0}),email:E.ShortText({displayName:"Email",description:"The email of the customer (max 100 characters)",required:!0}),companyName:E.ShortText({displayName:"Company Name",description:"The company name the customer belongs to (max 100 characters)",required:!0}),notes:E.LongText({displayName:"Notes",description:"Optional notes field (max 1000 characters)",required:!1}),enableCustomerAssociation:E.Checkbox({displayName:"Enable Customer Portal",description:"If enabled, a portal link will be returned where the customer can view their licenses",required:!1}),allowActivationManagement:E.Checkbox({displayName:"Allow Activation Management",description:"If enabled, the customer can activate and deactivate devices through the customer portal",required:!1}),allowMultipleUserAssociation:E.Checkbox({displayName:"Allow Multiple User Association",description:"If enabled, multiple user accounts can be associated with this customer",required:!1})},async run(e){let t=new URLSearchParams({Name:e.propsValue.name,Email:e.propsValue.email,CompanyName:e.propsValue.companyName});return e.propsValue.notes&&t.append("Notes",e.propsValue.notes),e.propsValue.enableCustomerAssociation&&t.append("EnableCustomerAssociation","true"),e.propsValue.allowActivationManagement&&t.append("AllowActivationManagement","true"),e.propsValue.allowMultipleUserAssociation&&t.append("AllowMultipleUserAssociation","true"),await Oe(e.auth.secret_text,"POST",`/customer/AddCustomer?${t.toString()}`)}});var Ks=Se({auth:se,name:"blockKey",displayName:"Block Key",description:"Block a license key to prevent it from being accessible by most Web API methods",audience:"both",aiMetadata:{description:"Blocks a specific license key for a product so it is rejected by most Cryptolens Web API methods (e.g. activation/validation). Use to revoke or suspend a license. Requires the product ID and the serial key string. Blocking is a state change, but re-blocking an already-blocked key has no additional effect.",idempotent:!0},props:{productId:E.Number({displayName:"Product ID",description:"The product ID",required:!0}),key:E.ShortText({displayName:"License Key",description:"The serial key string to block",required:!0})},async run(e){let t=new URLSearchParams({ProductId:String(e.propsValue.productId),Key:e.propsValue.key});return await Oe(e.auth.secret_text,"POST",`/key/BlockKey?${t.toString()}`)}});var Js=Se({auth:se,name:"createKey",displayName:"Create Key",description:"Create a new license key for a product",audience:"both",aiMetadata:{description:"Generates one or more new license keys for a Cryptolens product, with configurable validity period, feature flags (F1-F8), machine activation limits, trial activation, and optional association to a customer or reseller. Use to issue licenses for a product. Requires the product ID; not idempotent \u2014 each call mints new key(s), and Number of Keys can generate up to 1000 at once.",idempotent:!1},props:{productId:E.Number({displayName:"Product ID",description:"The product ID",required:!0}),period:E.Number({displayName:"Validity Period (days)",description:"The number of days from today the license key should be valid. Default is 0 (no expiration).",required:!1}),f1:E.Checkbox({displayName:"Feature 1",description:"Enable Feature 1",required:!1}),f2:E.Checkbox({displayName:"Feature 2",description:"Enable Feature 2",required:!1}),f3:E.Checkbox({displayName:"Feature 3",description:"Enable Feature 3",required:!1}),f4:E.Checkbox({displayName:"Feature 4",description:"Enable Feature 4",required:!1}),f5:E.Checkbox({displayName:"Feature 5",description:"Enable Feature 5",required:!1}),f6:E.Checkbox({displayName:"Feature 6",description:"Enable Feature 6",required:!1}),f7:E.Checkbox({displayName:"Feature 7",description:"Enable Feature 7",required:!1}),f8:E.Checkbox({displayName:"Feature 8",description:"Enable Feature 8",required:!1}),notes:E.LongText({displayName:"Notes",description:"Additional notes about the license key (max 500 characters)",required:!1}),block:E.Checkbox({displayName:"Block Key",description:"Block the key from being accessed by the Activation method",required:!1}),customerId:E.Number({displayName:"Customer ID",description:"The ID of the customer to associate with this license key",required:!1}),trialActivation:E.Checkbox({displayName:"Enable Trial Activation",description:"Enable or disable trial activation",required:!1}),maxNoOfMachines:E.Number({displayName:"Max Number of Machines",description:"The maximum number of computers that can activate the key. Default is 0 (unlimited).",required:!1}),allowedMachines:E.LongText({displayName:"Allowed Machines",description:"A list of machine codes (separated by new lines) that will be prioritized during activation",required:!1}),resellerId:E.Number({displayName:"Reseller ID",description:"The ID of the reseller to associate with this license key",required:!1}),noOfKeys:E.Number({displayName:"Number of Keys",description:"The number of keys to generate. Default is 1. Maximum 1000 per request.",required:!1})},async run(e){let t=new URLSearchParams({ProductId:String(e.propsValue.productId)});return e.propsValue.period!==void 0&&e.propsValue.period!==null&&t.append("Period",String(e.propsValue.period)),e.propsValue.f1&&t.append("F1","true"),e.propsValue.f2&&t.append("F2","true"),e.propsValue.f3&&t.append("F3","true"),e.propsValue.f4&&t.append("F4","true"),e.propsValue.f5&&t.append("F5","true"),e.propsValue.f6&&t.append("F6","true"),e.propsValue.f7&&t.append("F7","true"),e.propsValue.f8&&t.append("F8","true"),e.propsValue.notes&&t.append("Notes",e.propsValue.notes),e.propsValue.block&&t.append("Block","true"),e.propsValue.customerId!==void 0&&e.propsValue.customerId!==null&&t.append("CustomerId",String(e.propsValue.customerId)),e.propsValue.trialActivation&&t.append("TrialActivation","true"),e.propsValue.maxNoOfMachines!==void 0&&e.propsValue.maxNoOfMachines!==null&&t.append("MaxNoOfMachines",String(e.propsValue.maxNoOfMachines)),e.propsValue.allowedMachines&&t.append("AllowedMachines",e.propsValue.allowedMachines),e.propsValue.resellerId!==void 0&&e.propsValue.resellerId!==null&&t.append("ResellerId",String(e.propsValue.resellerId)),e.propsValue.noOfKeys!==void 0&&e.propsValue.noOfKeys!==null&&t.append("NoOfKeys",String(e.propsValue.noOfKeys)),await Oe(e.auth.secret_text,"POST",`/key/CreateKey?${t.toString()}`)}});var Ud={productId:E.Number({displayName:"Product ID",description:"Filter events for a specific product (optional)",required:!1}),key:E.ShortText({displayName:"License Key",description:"Filter events for a specific license key (requires Product ID)",required:!1}),states:E.LongText({displayName:"Event States",description:"Filter by event states (comma-separated numbers). E.g., 1010 for validation, 2010 for activation, 3010 for key creation, 6010 for deactivation",required:!1}),limit:E.Number({displayName:"Limit",description:"Maximum number of events to fetch per poll (default 100, max 1000)",required:!1})},ir={strategy:0,items:o(async({propsValue:e,auth:t,lastFetchEpochMS:r})=>{let n=new URLSearchParams;e.productId&&n.append("ProductId",String(e.productId)),e.key&&e.productId&&n.append("Key",e.key),e.states&&n.append("States",e.states);let i=e.limit||100;if(n.append("Limit",String(i)),r){let p=JSON.stringify({gte:Math.floor(r/1e3)});n.append("Time",p)}else{let p=Math.floor((Date.now()-36e5)/1e3),f=JSON.stringify({gte:p});n.append("Time",f)}let c=await Oe(t.secret_text,"GET",`/ai/GetWebAPILog?${n.toString()}`);return c.result!==0||!c.Events?[]:c.Events.map(p=>({epochMilliSeconds:p.Created*1e3,data:p}))},"items")},Xs=zi({auth:se,name:"newApiEvent",displayName:"New API Event",description:"Trigger when a new API event is logged (activation, deactivation, key creation, etc.)",aiMetadata:{description:"Fires when a new Web API event is logged in Cryptolens, such as a license activation, deactivation, validation, or key creation. Polls the audit log on an interval and can optionally be scoped to a specific product, a specific key, or particular event-state codes."},props:Ud,sampleData:{Id:1,Created:1426545812,ResourceType:3,ResourceAction:1,AffectedObjectId:12345,ObjectOwnerUserId:999,PerformedByUserId:"user123",Data:'{"key": "value"}'},type:"POLLING",async test(e){return await bt.test(ir,e)},async onEnable(e){let{store:t,auth:r,propsValue:n}=e;await bt.onEnable(ir,{store:t,auth:r,propsValue:n})},async onDisable(e){let{store:t,auth:r,propsValue:n}=e;await bt.onDisable(ir,{store:t,auth:r,propsValue:n})},async run(e){return await bt.poll(ir,e)}});var Md=ki({displayName:"Cryptolens",auth:se,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/cryptolens.png",authors:["sanket-a11y"],categories:["DEVELOPER_TOOLS"],description:"Cryptolens is a Software Licensing as a Service (SLaaS) platform that provides developers with tools to manage software licenses, protect against piracy, and analyze usage data.",actions:[qs,Ks,Js,Ws({auth:se,baseUrl:o(()=>"https://api.cryptolens.io/api","baseUrl"),authLocation:"queryParams",authMapping:o(async e=>({token:`${e.secret_text}`}),"authMapping")})],triggers:[Xs]});0&&(module.exports={cryptolens});
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
mime-types/index.js:
|
|
7
|
+
(*!
|
|
8
|
+
* mime-types
|
|
9
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
10
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*)
|
|
13
|
+
*/
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,mHAyBrB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,4CAAmD;AACnD,6DAAyD;AACzD,uDAAmD;AACnD,yDAAqD;AACrD,gEAA2D;AAC3D,+DAAwE;AACxE,iDAAqD;AAExC,QAAA,UAAU,GAAG,IAAA,8BAAW,EAAC;IACpC,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,qBAAc;IACpB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,oDAAoD;IAC7D,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,UAAU,EAAE,CAAC,sBAAa,CAAC,eAAe,CAAC;IAC3C,WAAW,EACT,mLAAmL;IACrL,OAAO,EAAE;QACP,0BAAW;QACX,oBAAQ;QACR,sBAAS;QACT,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,qBAAc;YACpB,OAAO,EAAE,GAAG,EAAE,CAAC,+BAA+B;YAC9C,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE;iBAC7B,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,2BAAW,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const addCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
companyName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
-
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
-
enableCustomerAssociation: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
-
allowActivationManagement: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
|
-
allowMultipleUserAssociation: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=add-customer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-customer.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;;;;;;EA8EtB,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addCustomer = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const client_1 = require("../common/client");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.addCustomer = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.cryptolensAuth,
|
|
11
|
-
name: 'addCustomer',
|
|
12
|
-
displayName: 'Add Customer',
|
|
13
|
-
description: 'Add a new customer to your Cryptolens account',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Creates a new customer record in a Cryptolens account, optionally enabling a customer portal so the customer can self-manage their licenses and device activations. Use to onboard a license holder before associating keys with them. Requires name, email, and company name; not idempotent — each call creates a separate customer.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
name: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Name',
|
|
22
|
-
description: 'The name of the customer (max 100 characters)',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
email: pieces_framework_1.Property.ShortText({
|
|
26
|
-
displayName: 'Email',
|
|
27
|
-
description: 'The email of the customer (max 100 characters)',
|
|
28
|
-
required: true,
|
|
29
|
-
}),
|
|
30
|
-
companyName: pieces_framework_1.Property.ShortText({
|
|
31
|
-
displayName: 'Company Name',
|
|
32
|
-
description: 'The company name the customer belongs to (max 100 characters)',
|
|
33
|
-
required: true,
|
|
34
|
-
}),
|
|
35
|
-
notes: pieces_framework_1.Property.LongText({
|
|
36
|
-
displayName: 'Notes',
|
|
37
|
-
description: 'Optional notes field (max 1000 characters)',
|
|
38
|
-
required: false,
|
|
39
|
-
}),
|
|
40
|
-
enableCustomerAssociation: pieces_framework_1.Property.Checkbox({
|
|
41
|
-
displayName: 'Enable Customer Portal',
|
|
42
|
-
description: 'If enabled, a portal link will be returned where the customer can view their licenses',
|
|
43
|
-
required: false,
|
|
44
|
-
}),
|
|
45
|
-
allowActivationManagement: pieces_framework_1.Property.Checkbox({
|
|
46
|
-
displayName: 'Allow Activation Management',
|
|
47
|
-
description: 'If enabled, the customer can activate and deactivate devices through the customer portal',
|
|
48
|
-
required: false,
|
|
49
|
-
}),
|
|
50
|
-
allowMultipleUserAssociation: pieces_framework_1.Property.Checkbox({
|
|
51
|
-
displayName: 'Allow Multiple User Association',
|
|
52
|
-
description: 'If enabled, multiple user accounts can be associated with this customer',
|
|
53
|
-
required: false,
|
|
54
|
-
}),
|
|
55
|
-
},
|
|
56
|
-
run(context) {
|
|
57
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const params = new URLSearchParams({
|
|
59
|
-
Name: context.propsValue.name,
|
|
60
|
-
Email: context.propsValue.email,
|
|
61
|
-
CompanyName: context.propsValue.companyName,
|
|
62
|
-
});
|
|
63
|
-
if (context.propsValue.notes) {
|
|
64
|
-
params.append('Notes', context.propsValue.notes);
|
|
65
|
-
}
|
|
66
|
-
if (context.propsValue.enableCustomerAssociation) {
|
|
67
|
-
params.append('EnableCustomerAssociation', 'true');
|
|
68
|
-
}
|
|
69
|
-
if (context.propsValue.allowActivationManagement) {
|
|
70
|
-
params.append('AllowActivationManagement', 'true');
|
|
71
|
-
}
|
|
72
|
-
if (context.propsValue.allowMultipleUserAssociation) {
|
|
73
|
-
params.append('AllowMultipleUserAssociation', 'true');
|
|
74
|
-
}
|
|
75
|
-
const response = yield (0, client_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/customer/AddCustomer?${params.toString()}`);
|
|
76
|
-
return response;
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=add-customer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-customer.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6CAA+C;AAC/C,yCAAgD;AAChD,+DAAyD;AAE5C,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,+CAA+C;IAC5D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,wUAAwU;QACrV,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,+DAA+D;YAC5E,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,yBAAyB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3C,WAAW,EAAE,wBAAwB;YACrC,WAAW,EAAE,uFAAuF;YACpG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,yBAAyB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3C,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EAAE,0FAA0F;YACvG,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,4BAA4B,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC9C,WAAW,EAAE,iCAAiC;YAC9C,WAAW,EAAE,yEAAyE;YACtF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;gBACjC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;gBAC7B,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;gBAC/B,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;aAC5C,CAAC,CAAC;YAEH,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBAC7B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YACnD,CAAC;YAED,IAAI,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC;gBACjD,MAAM,CAAC,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;YACrD,CAAC;YAED,IAAI,OAAO,CAAC,UAAU,CAAC,yBAAyB,EAAE,CAAC;gBACjD,MAAM,CAAC,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;YACrD,CAAC;YAED,IAAI,OAAO,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC;gBACpD,MAAM,CAAC,MAAM,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC;YACxD,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,yBAAyB,MAAM,CAAC,QAAQ,EAAE,EAAE,CAC7C,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const blockKey: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
3
|
-
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=block-key.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-key.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/block-key.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;EAoCnB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.blockKey = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const client_1 = require("../common/client");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.blockKey = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.cryptolensAuth,
|
|
11
|
-
name: 'blockKey',
|
|
12
|
-
displayName: 'Block Key',
|
|
13
|
-
description: 'Block a license key to prevent it from being accessible by most Web API methods',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Blocks a specific license key for a product so it is rejected by most Cryptolens Web API methods (e.g. activation/validation). Use to revoke or suspend a license. Requires the product ID and the serial key string. Blocking is a state change, but re-blocking an already-blocked key has no additional effect.',
|
|
17
|
-
idempotent: true,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
productId: pieces_framework_1.Property.Number({
|
|
21
|
-
displayName: 'Product ID',
|
|
22
|
-
description: 'The product ID',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
key: pieces_framework_1.Property.ShortText({
|
|
26
|
-
displayName: 'License Key',
|
|
27
|
-
description: 'The serial key string to block',
|
|
28
|
-
required: true,
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
run(context) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const params = new URLSearchParams({
|
|
34
|
-
ProductId: String(context.propsValue.productId),
|
|
35
|
-
Key: context.propsValue.key,
|
|
36
|
-
});
|
|
37
|
-
const response = yield (0, client_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/key/BlockKey?${params.toString()}`);
|
|
38
|
-
return response;
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=block-key.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"block-key.js","sourceRoot":"","sources":["../../../../src/lib/actions/block-key.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6CAA+C;AAC/C,yCAAgD;AAChD,+DAAyD;AAE5C,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,iFAAiF;IAC9F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,oTAAoT;QACjU,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;gBACjC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;gBAC/C,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;aAC5B,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,iBAAiB,MAAM,CAAC,QAAQ,EAAE,EAAE,CACrC,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare const createKey: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
3
|
-
period: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
4
|
-
f1: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
5
|
-
f2: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
6
|
-
f3: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
-
f4: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
8
|
-
f5: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
-
f6: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
10
|
-
f7: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
|
-
f8: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
12
|
-
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
13
|
-
block: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
14
|
-
customerId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
15
|
-
trialActivation: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
-
maxNoOfMachines: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
17
|
-
allowedMachines: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
18
|
-
resellerId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
19
|
-
noOfKeys: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
20
|
-
}>;
|
|
21
|
-
//# sourceMappingURL=create-key.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-key.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-key.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;EAuLpB,CAAC"}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createKey = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const client_1 = require("../common/client");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.createKey = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.cryptolensAuth,
|
|
11
|
-
name: 'createKey',
|
|
12
|
-
displayName: 'Create Key',
|
|
13
|
-
description: 'Create a new license key for a product',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Generates one or more new license keys for a Cryptolens product, with configurable validity period, feature flags (F1-F8), machine activation limits, trial activation, and optional association to a customer or reseller. Use to issue licenses for a product. Requires the product ID; not idempotent — each call mints new key(s), and Number of Keys can generate up to 1000 at once.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
productId: pieces_framework_1.Property.Number({
|
|
21
|
-
displayName: 'Product ID',
|
|
22
|
-
description: 'The product ID',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
period: pieces_framework_1.Property.Number({
|
|
26
|
-
displayName: 'Validity Period (days)',
|
|
27
|
-
description: 'The number of days from today the license key should be valid. Default is 0 (no expiration).',
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
f1: pieces_framework_1.Property.Checkbox({
|
|
31
|
-
displayName: 'Feature 1',
|
|
32
|
-
description: 'Enable Feature 1',
|
|
33
|
-
required: false,
|
|
34
|
-
}),
|
|
35
|
-
f2: pieces_framework_1.Property.Checkbox({
|
|
36
|
-
displayName: 'Feature 2',
|
|
37
|
-
description: 'Enable Feature 2',
|
|
38
|
-
required: false,
|
|
39
|
-
}),
|
|
40
|
-
f3: pieces_framework_1.Property.Checkbox({
|
|
41
|
-
displayName: 'Feature 3',
|
|
42
|
-
description: 'Enable Feature 3',
|
|
43
|
-
required: false,
|
|
44
|
-
}),
|
|
45
|
-
f4: pieces_framework_1.Property.Checkbox({
|
|
46
|
-
displayName: 'Feature 4',
|
|
47
|
-
description: 'Enable Feature 4',
|
|
48
|
-
required: false,
|
|
49
|
-
}),
|
|
50
|
-
f5: pieces_framework_1.Property.Checkbox({
|
|
51
|
-
displayName: 'Feature 5',
|
|
52
|
-
description: 'Enable Feature 5',
|
|
53
|
-
required: false,
|
|
54
|
-
}),
|
|
55
|
-
f6: pieces_framework_1.Property.Checkbox({
|
|
56
|
-
displayName: 'Feature 6',
|
|
57
|
-
description: 'Enable Feature 6',
|
|
58
|
-
required: false,
|
|
59
|
-
}),
|
|
60
|
-
f7: pieces_framework_1.Property.Checkbox({
|
|
61
|
-
displayName: 'Feature 7',
|
|
62
|
-
description: 'Enable Feature 7',
|
|
63
|
-
required: false,
|
|
64
|
-
}),
|
|
65
|
-
f8: pieces_framework_1.Property.Checkbox({
|
|
66
|
-
displayName: 'Feature 8',
|
|
67
|
-
description: 'Enable Feature 8',
|
|
68
|
-
required: false,
|
|
69
|
-
}),
|
|
70
|
-
notes: pieces_framework_1.Property.LongText({
|
|
71
|
-
displayName: 'Notes',
|
|
72
|
-
description: 'Additional notes about the license key (max 500 characters)',
|
|
73
|
-
required: false,
|
|
74
|
-
}),
|
|
75
|
-
block: pieces_framework_1.Property.Checkbox({
|
|
76
|
-
displayName: 'Block Key',
|
|
77
|
-
description: 'Block the key from being accessed by the Activation method',
|
|
78
|
-
required: false,
|
|
79
|
-
}),
|
|
80
|
-
customerId: pieces_framework_1.Property.Number({
|
|
81
|
-
displayName: 'Customer ID',
|
|
82
|
-
description: 'The ID of the customer to associate with this license key',
|
|
83
|
-
required: false,
|
|
84
|
-
}),
|
|
85
|
-
trialActivation: pieces_framework_1.Property.Checkbox({
|
|
86
|
-
displayName: 'Enable Trial Activation',
|
|
87
|
-
description: 'Enable or disable trial activation',
|
|
88
|
-
required: false,
|
|
89
|
-
}),
|
|
90
|
-
maxNoOfMachines: pieces_framework_1.Property.Number({
|
|
91
|
-
displayName: 'Max Number of Machines',
|
|
92
|
-
description: 'The maximum number of computers that can activate the key. Default is 0 (unlimited).',
|
|
93
|
-
required: false,
|
|
94
|
-
}),
|
|
95
|
-
allowedMachines: pieces_framework_1.Property.LongText({
|
|
96
|
-
displayName: 'Allowed Machines',
|
|
97
|
-
description: 'A list of machine codes (separated by new lines) that will be prioritized during activation',
|
|
98
|
-
required: false,
|
|
99
|
-
}),
|
|
100
|
-
resellerId: pieces_framework_1.Property.Number({
|
|
101
|
-
displayName: 'Reseller ID',
|
|
102
|
-
description: 'The ID of the reseller to associate with this license key',
|
|
103
|
-
required: false,
|
|
104
|
-
}),
|
|
105
|
-
noOfKeys: pieces_framework_1.Property.Number({
|
|
106
|
-
displayName: 'Number of Keys',
|
|
107
|
-
description: 'The number of keys to generate. Default is 1. Maximum 1000 per request.',
|
|
108
|
-
required: false,
|
|
109
|
-
}),
|
|
110
|
-
},
|
|
111
|
-
run(context) {
|
|
112
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
const params = new URLSearchParams({
|
|
114
|
-
ProductId: String(context.propsValue.productId),
|
|
115
|
-
});
|
|
116
|
-
if (context.propsValue.period !== undefined &&
|
|
117
|
-
context.propsValue.period !== null) {
|
|
118
|
-
params.append('Period', String(context.propsValue.period));
|
|
119
|
-
}
|
|
120
|
-
if (context.propsValue.f1)
|
|
121
|
-
params.append('F1', 'true');
|
|
122
|
-
if (context.propsValue.f2)
|
|
123
|
-
params.append('F2', 'true');
|
|
124
|
-
if (context.propsValue.f3)
|
|
125
|
-
params.append('F3', 'true');
|
|
126
|
-
if (context.propsValue.f4)
|
|
127
|
-
params.append('F4', 'true');
|
|
128
|
-
if (context.propsValue.f5)
|
|
129
|
-
params.append('F5', 'true');
|
|
130
|
-
if (context.propsValue.f6)
|
|
131
|
-
params.append('F6', 'true');
|
|
132
|
-
if (context.propsValue.f7)
|
|
133
|
-
params.append('F7', 'true');
|
|
134
|
-
if (context.propsValue.f8)
|
|
135
|
-
params.append('F8', 'true');
|
|
136
|
-
if (context.propsValue.notes) {
|
|
137
|
-
params.append('Notes', context.propsValue.notes);
|
|
138
|
-
}
|
|
139
|
-
if (context.propsValue.block) {
|
|
140
|
-
params.append('Block', 'true');
|
|
141
|
-
}
|
|
142
|
-
if (context.propsValue.customerId !== undefined &&
|
|
143
|
-
context.propsValue.customerId !== null) {
|
|
144
|
-
params.append('CustomerId', String(context.propsValue.customerId));
|
|
145
|
-
}
|
|
146
|
-
if (context.propsValue.trialActivation) {
|
|
147
|
-
params.append('TrialActivation', 'true');
|
|
148
|
-
}
|
|
149
|
-
if (context.propsValue.maxNoOfMachines !== undefined &&
|
|
150
|
-
context.propsValue.maxNoOfMachines !== null) {
|
|
151
|
-
params.append('MaxNoOfMachines', String(context.propsValue.maxNoOfMachines));
|
|
152
|
-
}
|
|
153
|
-
if (context.propsValue.allowedMachines) {
|
|
154
|
-
params.append('AllowedMachines', context.propsValue.allowedMachines);
|
|
155
|
-
}
|
|
156
|
-
if (context.propsValue.resellerId !== undefined &&
|
|
157
|
-
context.propsValue.resellerId !== null) {
|
|
158
|
-
params.append('ResellerId', String(context.propsValue.resellerId));
|
|
159
|
-
}
|
|
160
|
-
if (context.propsValue.noOfKeys !== undefined &&
|
|
161
|
-
context.propsValue.noOfKeys !== null) {
|
|
162
|
-
params.append('NoOfKeys', String(context.propsValue.noOfKeys));
|
|
163
|
-
}
|
|
164
|
-
const response = yield (0, client_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/key/CreateKey?${params.toString()}`);
|
|
165
|
-
return response;
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
//# sourceMappingURL=create-key.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-key.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-key.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const extendLicense: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
3
|
-
key: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
noOfDays: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=extend-license.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extend-license.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/extend-license.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;EAwCxB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendLicense = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const client_1 = require("../common/client");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
exports.extendLicense = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.cryptolensAuth,
|
|
11
|
-
name: 'extendLicense',
|
|
12
|
-
displayName: 'Extend License',
|
|
13
|
-
description: 'Extend a license key by a specified number of days',
|
|
14
|
-
props: {
|
|
15
|
-
productId: pieces_framework_1.Property.Number({
|
|
16
|
-
displayName: 'Product ID',
|
|
17
|
-
description: 'The product ID',
|
|
18
|
-
required: true,
|
|
19
|
-
}),
|
|
20
|
-
key: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'License Key',
|
|
22
|
-
description: 'The serial key string to extend',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
noOfDays: pieces_framework_1.Property.Number({
|
|
26
|
-
displayName: 'Number of Days',
|
|
27
|
-
description: 'The number of days to extend the license. Use negative numbers to decrease the expiration date.',
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
},
|
|
31
|
-
run(context) {
|
|
32
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const params = new URLSearchParams({
|
|
34
|
-
ProductId: String(context.propsValue.productId),
|
|
35
|
-
Key: context.propsValue.key,
|
|
36
|
-
});
|
|
37
|
-
if (context.propsValue.noOfDays !== undefined && context.propsValue.noOfDays !== null) {
|
|
38
|
-
params.append('NoOfDays', String(context.propsValue.noOfDays));
|
|
39
|
-
}
|
|
40
|
-
const response = yield (0, client_1.makeRequest)(context.auth.secret_text, pieces_common_1.HttpMethod.POST, `/key/ExtendLicense?${params.toString()}`);
|
|
41
|
-
return response;
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=extend-license.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extend-license.js","sourceRoot":"","sources":["../../../../src/lib/actions/extend-license.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6CAA+C;AAC/C,yCAAgD;AAChD,+DAAyD;AAE5C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,oDAAoD;IACjE,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,iGAAiG;YAC9G,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC;gBACjC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;gBAC/C,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;aAC5B,CAAC,CAAC;YAEH,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtF,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YACjE,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,OAAO,CAAC,IAAI,CAAC,WAAW,EACxB,0BAAU,CAAC,IAAI,EACf,sBAAsB,MAAM,CAAC,QAAQ,EAAE,EAAE,CAC1C,CAAC;YAEF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/auth.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,cAAc,mEAezB,CAAC"}
|
package/src/lib/common/auth.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cryptolensAuth = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const CRYPTOLENS_API_BASE_URL = 'https://api.cryptolens.io/api';
|
|
8
|
-
function validateAccessToken(token) {
|
|
9
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
-
try {
|
|
11
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
12
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
13
|
-
url: `${CRYPTOLENS_API_BASE_URL}/auth/GetToken?token=${encodeURIComponent(token)}`,
|
|
14
|
-
});
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
catch (_a) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
exports.cryptolensAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
23
|
-
displayName: 'Access Token',
|
|
24
|
-
description: 'Your Cryptolens access token. Get it from https://app.cryptolens.io/User/AccessToken',
|
|
25
|
-
required: true,
|
|
26
|
-
validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
27
|
-
const isValid = yield validateAccessToken(auth);
|
|
28
|
-
if (isValid) {
|
|
29
|
-
return { valid: true };
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
valid: false,
|
|
33
|
-
error: 'Invalid access token',
|
|
34
|
-
};
|
|
35
|
-
}),
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAA2D;AAE3D,MAAM,uBAAuB,GAAG,+BAA+B,CAAC;AAEhE,SAAe,mBAAmB,CAAC,KAAa;;QAC9C,IAAI,CAAC;YACH,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,uBAAuB,wBAAwB,kBAAkB,CACvE,KAAK,CACN,EAAE;aACJ,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,WAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CAAA;AAEY,QAAA,cAAc,GAAG,4BAAS,CAAC,UAAU,CAAC;IACjD,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,sFAAsF;IACxF,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QACD,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,sBAAsB;SAC9B,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { HttpMethod } from '@activepieces/pieces-common';
|
|
2
|
-
export declare const BASE_URL = "https://api.cryptolens.io/api";
|
|
3
|
-
export declare function makeRequest(access_token: string, method: HttpMethod, path: string, body?: unknown): Promise<any>;
|
|
4
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,6BAA6B,CAAC;AAErE,eAAO,MAAM,QAAQ,kCAAkC,CAAC;AAExD,wBAAsB,WAAW,CAC/B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,gBAiBf"}
|
package/src/lib/common/client.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BASE_URL = void 0;
|
|
4
|
-
exports.makeRequest = makeRequest;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
exports.BASE_URL = `https://api.cryptolens.io/api`;
|
|
8
|
-
function makeRequest(access_token, method, path, body) {
|
|
9
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
-
try {
|
|
11
|
-
const url = `${exports.BASE_URL}${path}?token=${encodeURIComponent(access_token)}`;
|
|
12
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
13
|
-
method,
|
|
14
|
-
url,
|
|
15
|
-
headers: {
|
|
16
|
-
'Content-Type': 'application/json',
|
|
17
|
-
},
|
|
18
|
-
body,
|
|
19
|
-
});
|
|
20
|
-
return response.body;
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
throw new Error(`Unexpected error: ${error.message || String(error)}`);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/common/client.ts"],"names":[],"mappings":";;;AAIA,kCAqBC;;AAzBD,+DAAqE;AAExD,QAAA,QAAQ,GAAG,+BAA+B,CAAC;AAExD,SAAsB,WAAW,CAC/B,YAAoB,EACpB,MAAkB,EAClB,IAAY,EACZ,IAAc;;QAEd,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,GAAG,gBAAQ,GAAG,IAAI,UAAU,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;YAE3E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM;gBACN,GAAG;gBACH,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newApiEvent: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
3
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
4
|
-
key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
states: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
7
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
8
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
|
-
key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
states: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
11
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
12
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
13
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
14
|
-
key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
15
|
-
states: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
16
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
17
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
18
|
-
productId: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
19
|
-
key: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
20
|
-
states: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
21
|
-
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
22
|
-
}>;
|
|
23
|
-
//# sourceMappingURL=new-api-event.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-api-event.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-api-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAGhB,MAAM,gCAAgC,CAAC;AA+GxC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;EAmCtB,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newApiEvent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const client_1 = require("../common/client");
|
|
8
|
-
const auth_1 = require("../common/auth");
|
|
9
|
-
const pieces_common_2 = require("@activepieces/pieces-common");
|
|
10
|
-
const props = {
|
|
11
|
-
productId: pieces_framework_1.Property.Number({
|
|
12
|
-
displayName: 'Product ID',
|
|
13
|
-
description: 'Filter events for a specific product (optional)',
|
|
14
|
-
required: false,
|
|
15
|
-
}),
|
|
16
|
-
key: pieces_framework_1.Property.ShortText({
|
|
17
|
-
displayName: 'License Key',
|
|
18
|
-
description: 'Filter events for a specific license key (requires Product ID)',
|
|
19
|
-
required: false,
|
|
20
|
-
}),
|
|
21
|
-
states: pieces_framework_1.Property.LongText({
|
|
22
|
-
displayName: 'Event States',
|
|
23
|
-
description: 'Filter by event states (comma-separated numbers). E.g., 1010 for validation, 2010 for activation, 3010 for key creation, 6010 for deactivation',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
limit: pieces_framework_1.Property.Number({
|
|
27
|
-
displayName: 'Limit',
|
|
28
|
-
description: 'Maximum number of events to fetch per poll (default 100, max 1000)',
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
};
|
|
32
|
-
const polling = {
|
|
33
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
34
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ propsValue, auth, lastFetchEpochMS }) {
|
|
35
|
-
const params = new URLSearchParams();
|
|
36
|
-
if (propsValue.productId) {
|
|
37
|
-
params.append('ProductId', String(propsValue.productId));
|
|
38
|
-
}
|
|
39
|
-
if (propsValue.key && propsValue.productId) {
|
|
40
|
-
params.append('Key', propsValue.key);
|
|
41
|
-
}
|
|
42
|
-
if (propsValue.states) {
|
|
43
|
-
params.append('States', propsValue.states);
|
|
44
|
-
}
|
|
45
|
-
const limit = propsValue.limit || 100;
|
|
46
|
-
params.append('Limit', String(limit));
|
|
47
|
-
// Add time filter to get events since last fetch
|
|
48
|
-
if (lastFetchEpochMS) {
|
|
49
|
-
const timeFilter = JSON.stringify({
|
|
50
|
-
gte: Math.floor(lastFetchEpochMS / 1000),
|
|
51
|
-
});
|
|
52
|
-
params.append('Time', timeFilter);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// On first run, fetch events from the last hour to avoid missing recent events
|
|
56
|
-
const oneHourAgo = Math.floor((Date.now() - 3600 * 1000) / 1000);
|
|
57
|
-
const timeFilter = JSON.stringify({ gte: oneHourAgo });
|
|
58
|
-
params.append('Time', timeFilter);
|
|
59
|
-
}
|
|
60
|
-
const response = yield (0, client_1.makeRequest)(auth.secret_text, pieces_common_2.HttpMethod.GET, `/ai/GetWebAPILog?${params.toString()}`);
|
|
61
|
-
const responseBody = response;
|
|
62
|
-
if (responseBody.result !== 0 || !responseBody.Events) {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
return responseBody.Events.map((log) => ({
|
|
66
|
-
epochMilliSeconds: log.Created * 1000,
|
|
67
|
-
data: log,
|
|
68
|
-
}));
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
|
-
exports.newApiEvent = (0, pieces_framework_1.createTrigger)({
|
|
72
|
-
auth: auth_1.cryptolensAuth,
|
|
73
|
-
name: 'newApiEvent',
|
|
74
|
-
displayName: 'New API Event',
|
|
75
|
-
description: 'Trigger when a new API event is logged (activation, deactivation, key creation, etc.)',
|
|
76
|
-
aiMetadata: {
|
|
77
|
-
description: 'Fires when a new Web API event is logged in Cryptolens, such as a license activation, deactivation, validation, or key creation. Polls the audit log on an interval and can optionally be scoped to a specific product, a specific key, or particular event-state codes.',
|
|
78
|
-
},
|
|
79
|
-
props,
|
|
80
|
-
sampleData: {
|
|
81
|
-
Id: 1,
|
|
82
|
-
Created: 1426545812,
|
|
83
|
-
ResourceType: 3,
|
|
84
|
-
ResourceAction: 1,
|
|
85
|
-
AffectedObjectId: 12345,
|
|
86
|
-
ObjectOwnerUserId: 999,
|
|
87
|
-
PerformedByUserId: 'user123',
|
|
88
|
-
Data: '{"key": "value"}',
|
|
89
|
-
},
|
|
90
|
-
type: pieces_framework_1.TriggerStrategy.POLLING,
|
|
91
|
-
test(context) {
|
|
92
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
return yield pieces_common_1.pollingHelper.test(polling, context);
|
|
94
|
-
});
|
|
95
|
-
},
|
|
96
|
-
onEnable(context) {
|
|
97
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
const { store, auth, propsValue } = context;
|
|
99
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, { store, auth, propsValue });
|
|
100
|
-
});
|
|
101
|
-
},
|
|
102
|
-
onDisable(context) {
|
|
103
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
const { store, auth, propsValue } = context;
|
|
105
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, { store, auth, propsValue });
|
|
106
|
-
});
|
|
107
|
-
},
|
|
108
|
-
run(context) {
|
|
109
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
return yield pieces_common_1.pollingHelper.poll(polling, context);
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
//# sourceMappingURL=new-api-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-api-event.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-api-event.ts"],"names":[],"mappings":"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"}
|