@prismatic-io/components-gusto 0.0.1 → 0.1.1
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/dist/index.js +1 -1
- package/npm-dist/index.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -224,4 +224,4 @@ e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=
|
|
|
224
224
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
225
225
|
* @license MIT
|
|
226
226
|
*/
|
|
227
|
-
let t=Fm(),n=Im(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;let i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(K(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||fe(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(K(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return le(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return de(e).length;default:if(i)return r?-1:le(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return F(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return N(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return I(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,fe(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(fe(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return G(le(t,e.length-n),e,n,r)}function E(e,t,n,r){return G(W(t),e,n,r)}function D(e,t,n,r){return G(de(t),e,n,r)}function O(e,t,n,r){return G(ue(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return M(r)}let j=4096;function M(e){let t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=j));return n}function N(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function F(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=pe[e[r]];return i}function I(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function L(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!1,52,8)};function R(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function z(e,t,n,r,i){ae(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function ee(e,t,n,r,i){ae(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=me(function(e,t=0){return z(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=me(function(e,t=0){return ee(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=me(function(e,t=0){return z(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=me(function(e,t=0){return ee(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function te(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function B(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)};function V(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let H={};function ne(e,t,n){H[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ne(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ne(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ne(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=re(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=re(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function re(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function ie(e,t,n){U(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&oe(t,e.length-(n+1))}function ae(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new H.ERR_OUT_OF_RANGE(`value`,i,e)}ie(r,i,a)}function U(e,t){if(typeof e!=`number`)throw new H.ERR_INVALID_ARG_TYPE(t,`number`,e)}function oe(e,t,n){throw Math.floor(e)===e?t<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(U(e,n),new H.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let se=/[^+/0-9A-Za-z-_]/g;function ce(e){if(e=e.split(`=`)[0],e=e.trim().replace(se,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function le(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function W(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ue(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function de(e){return t.toByteArray(ce(e))}function G(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function fe(e){return e!==e}let pe=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function me(e){return typeof BigInt>`u`?he:e}function he(){throw Error(`BigInt not supported`)}})),Rm=a(((e,t)=>{let n=Pm(),r=typeof window<`u`?Lm().Buffer:global.Buffer;function i(e){return 12+4*Math.ceil(e.length/4)}function a(){return!(typeof window<`u`&&typeof document<`u`)}function o(e){return e.BYTES_PER_ELEMENT?e.length*e.BYTES_PER_ELEMENT:-1}function s(e){let t=0;try{let n=e;if(e instanceof Map?n=Object.fromEntries(e):e instanceof Set&&(n=Array.from(e)),ArrayBuffer.isView(e))return o(e);let i=JSON.stringify(n,(e,t)=>typeof t==`bigint`||typeof t==`function`?t.toString():t===void 0?`undefined`:typeof t==`symbol`||t instanceof RegExp?t.toString():t);t=r.byteLength(i,`utf8`)}catch{return Error(-1)}return t}function c(e){let t=[],o=[e],s=0;for(;o.length;){let c=o.pop();if(typeof c==`boolean`)s+=n.BYTES;else if(typeof c==`string`)a()?s+=i(c):s+=c.length*n.STRING;else if(typeof c==`number`)s+=n.NUMBER;else if(typeof c==`symbol`)Symbol.keyFor&&Symbol.keyFor(e)?s+=Symbol.keyFor(e).length*n.STRING:s+=(e.toString().length-8)*n.STRING;else if(typeof c==`bigint`)s+=r.from(c.toString()).byteLength;else if(typeof c==`function`)s+=c.toString().length;else if(typeof c==`object`&&t.indexOf(c)===-1){t.push(c);for(let e in c)o.push(c[e])}}return s}t.exports=function(e){let t=0;return t=typeof e==`object`&&e?s(e):c(e),t}})),zm=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.inputs=e.debugRequest=e.fileDataFileNames=e.fileData=e.formData=e.retryAllErrors=e.useExponentialBackoff=e.retryDelayMS=e.maxRetries=e.queryParams=e.headers=e.responseType=e.method=e.timeout=e.data=e.url=void 0;let t=Om();e.url=(0,t.input)({label:`URL`,placeholder:`URL to call`,type:`string`,required:!0,comments:`This is the URL to call.`,example:`/sobjects/Account`,clean:e=>t.util.types.toString(e)}),e.data=(0,t.input)({label:`Data`,placeholder:`Data to send`,type:`string`,required:!1,comments:`The HTTP body payload to send to the URL.`,example:`{"exampleKey": "Example Data"}`}),e.timeout=(0,t.input)({label:`Timeout`,type:`string`,required:!1,comments:`The maximum time that a client will await a response to its request`,example:`2000`,clean:e=>t.util.types.toNumber(e)}),e.method=(0,t.input)({label:`Method`,type:`string`,required:!0,model:[`DELETE`,`GET`,`HEAD`,`LINK`,`OPTIONS`,`PATCH`,`POST`,`PURGE`,`PUT`,`UNLINK`].map(e=>({label:e,value:e})),comments:`The HTTP method to use.`,clean:e=>t.util.types.toString(e)}),e.responseType=(0,t.input)({label:`Response Type`,placeholder:`Response Type`,type:`string`,default:`json`,required:!0,comments:`The type of data you expect in the response. You can request json, text, or binary data.`,model:[`arraybuffer`,`document`,`json`,`text`].map(e=>({label:e,value:e})),clean:e=>t.util.types.toString(e)}),e.headers=(0,t.input)({label:`Header`,placeholder:`Header`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`A list of headers to send with the request.`,example:`User-Agent: curl/7.64.1`}),e.queryParams=(0,t.input)({label:`Query Parameter`,placeholder:`Query Parameter`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.`}),e.maxRetries=(0,t.input)({label:`Max Retry Count`,placeholder:`Max Retries`,type:`string`,required:!1,comments:`The maximum number of retries to attempt. Specify 0 for no retries.`,default:`0`,clean:e=>t.util.types.toNumber(e)}),e.retryDelayMS=(0,t.input)({label:`Retry Delay (ms)`,placeholder:`Retry Delay`,type:`string`,required:!1,comments:`The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.`,default:`0`,clean:e=>t.util.types.toNumber(e,0)}),e.useExponentialBackoff=(0,t.input)({label:`Use Exponential Backoff`,type:`boolean`,default:`false`,required:!1,comments:`Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.`,clean:e=>t.util.types.toBool(e)}),e.retryAllErrors=(0,t.input)({label:`Retry On All Errors`,type:`boolean`,default:`false`,required:!1,comments:`If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.`,clean:e=>t.util.types.toBool(e)}),e.formData=(0,t.input)({label:`Form Data`,placeholder:`Data to send`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`The Form Data to be sent as a multipart form upload.`,example:`[{"key": "Example Key", "value": new Buffer("Hello World")}]`}),e.fileData=(0,t.input)({label:`File Data`,placeholder:`Data to send`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`File Data to be sent as a multipart form upload.`,example:`[{key: "example.txt", value: "My File Contents"}]`}),e.fileDataFileNames=(0,t.input)({label:`File Data File Names`,placeholder:`The file name to apply to a file`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`File names to apply to the file data inputs. Keys must match the file data keys above.`,clean:e=>e?t.util.types.keyValPairListToObject(e):void 0}),e.debugRequest=(0,t.input)({label:`Debug Request`,type:`boolean`,required:!1,comments:`Enabling this flag will log out the current request.`,clean:e=>t.util.types.toBool(e)}),e.inputs={url:e.url,method:e.method,data:e.data,formData:e.formData,fileData:e.fileData,fileDataFileNames:e.fileDataFileNames,queryParams:e.queryParams,headers:e.headers,responseType:e.responseType,timeout:e.timeout,debugRequest:e.debugRequest,retryDelayMS:e.retryDelayMS,retryAllErrors:e.retryAllErrors,maxRetries:e.maxRetries,useExponentialBackoff:e.useExponentialBackoff}})),Bm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},a=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.inputs=e.buildRawRequestAction=e.sendRawRequest=e.handleErrors=e.createClient=e.toAxiosRetryConfig=void 0;let s=o(Nu()),c=r(Mm()),l=o(bu()),u=o(Nm()),d=o(Rm()),f=Om(),p=o(dl()),m=zm();Object.defineProperty(e,"inputs",{enumerable:!0,get:function(){return m.inputs}});let h=/^(cookie|set-cookie)$|auth|token|secret|password|api[-_]?key/i,g=e=>typeof e==`object`&&!!e&&typeof e.toJSON==`function`,_=e=>{let t=g(e)?e.toJSON():Object.assign({},e);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,h.test(e)?`[REDACTED]`:t]))},v=e=>{let t=p.default.types.toString(e.token?.access_token);if(t)return{Authorization:`Bearer ${t}`};let n=p.default.types.toString(e.fields?.apiKey);if(n)return{Authorization:`Bearer ${n}`};let r=p.default.types.toString(e.fields?.username),i=p.default.types.toString(e.fields?.password);if(r&&i)return{Authorization:`Basic ${Buffer.from(`${r}:${i}`).toString(`base64`)}`};throw Error(`Failed to guess at authorization parameters for Connection: ${e.key}`)},y=(e,t,n={})=>{let r=new l.default;return(e||[]).map(({key:e,value:t})=>r.append(e,t)),(t||[]).map(({key:e,value:t})=>r.append(e,p.default.types.toBufferDataPayload(t).data,{filename:n?.[e]||e})),r},b=(e,t)=>t?typeof e==`number`?t=>2**(t-1)*e:c.exponentialDelay:typeof e==`number`?()=>e:e;e.toAxiosRetryConfig=e=>{var{retryDelay:t,retryAllErrors:n,retryCondition:r,useExponentialBackoff:i}=e,o=a(e,[`retryDelay`,`retryAllErrors`,`retryCondition`,`useExponentialBackoff`]);return Object.assign(Object.assign({},o),{retryDelay:b(t,i),retryCondition:n?()=>!0:typeof r==`function`?r:c.isNetworkOrIdempotentRequestError})},e.createClient=({baseUrl:t,responseType:n,headers:r,timeout:i,params:a,debug:o=!1,retryConfig:l})=>{let u=s.default.create({baseURL:t,responseType:n,headers:r,timeout:i,params:a,maxContentLength:1/0,maxBodyLength:1/0});return o&&(u.interceptors.request.use(e=>{let{baseURL:t,headers:n,method:r,timeout:i,url:a,data:o,params:s}=e,c=(0,d.default)(o);return console.log(p.default.types.toJSON({type:`request`,baseURL:t,params:s,url:a,headers:_(n),method:r,timeout:i,data:c>1024*10||Buffer.isBuffer(o)?`<data (${c} bytes)>`:o},!0,!0)),e}),u.interceptors.response.use(e=>{let{headers:t,status:n,statusText:r,data:i}=e,a=(0,d.default)(i);return console.log(p.default.types.toJSON({type:`response`,headers:_(t),status:n,statusText:r,data:a>1024*10||Buffer.isBuffer(i)?`<data (${a} bytes)>`:i},!0,!0)),e})),l&&(0,c.default)(u,(0,e.toAxiosRetryConfig)(l)),u},e.handleErrors=e=>{if(s.default.isAxiosError(e)){let{message:t,response:n}=e;return{message:t,data:n?.data,status:n?.status,headers:n?.headers}}return e},e.sendRawRequest=(t,n,...r)=>i(void 0,[t,n,...r],void 0,function*(t,n,r={}){if(n.data&&(!(0,u.default)(n.formData)||!(0,u.default)(n.fileData)))throw Error(`Cannot specify both Data and File/Form Data.`);let i=!(0,u.default)(n.formData)||!(0,u.default)(n.fileData)?y(n.formData,n.fileData,n.fileDataFileNames):n.data;return yield(0,e.createClient)({baseUrl:t,debug:n.debugRequest,responseType:n.responseType,timeout:n.timeout,retryConfig:{retries:n.maxRetries,retryDelay:n.retryDelayMS,retryAllErrors:n.retryAllErrors,useExponentialBackoff:n.useExponentialBackoff}}).request({method:n.method,url:n.url,headers:Object.assign(Object.assign(Object.assign({},p.default.types.keyValPairListToObject(n.headers)),i instanceof l.default?i.getHeaders():{}),r),params:p.default.types.keyValPairListToObject(n.queryParams),data:i||void 0})}),e.buildRawRequestAction=(t,n=`Raw Request`,r=`Issue a raw HTTP request`)=>(0,f.action)({display:{label:n,description:r},inputs:Object.assign({connection:{label:`Connection`,type:`connection`,required:!0}},m.inputs),perform:(n,r)=>i(void 0,void 0,void 0,function*(){var{connection:n}=r,i=a(r,[`connection`]);let{data:o}=yield(0,e.sendRawRequest)(t,i,v(n));return{data:o}})})}))();const Vm=async(e,t)=>{let{clientId:n,clientSecret:r,tokenUrl:i}=e.fields,{data:a}=await(0,Bm.createClient)({baseUrl:$.util.types.toString(i),headers:{"Content-Type":`application/json`},debug:t}).post(``,{grant_type:`system_access`,client_id:$.util.types.toString(n),client_secret:$.util.types.toString(r)});return a.access_token},Hm=e=>e?$.util.types.toObject(e):{},Um=e=>e?$.util.types.toString(e):void 0,Wm=async(e,t)=>{let n=[],r=1,i=!0;do{let{data:a,headers:o}=await e.get(t,{params:{page:r}});n.push(...a),i=$.util.types.toNumber(o[`x-total-pages`])>$.util.types.toNumber(o[`x-page`]),r+=1}while(i);return n},Gm=async(e,t,n)=>{let r=[],i,a=!0;do{let o={...n,limit:$.util.types.toString(100)};i&&(o.starting_after_uuid=i);let{data:s,headers:c}=await e.get(t,{params:o});r.push(...s),a=$.util.types.toString(c[`x-has-next-page`])===`true`&&s.length>0,a&&(i=s[s.length-1].uuid)}while(a);return r},Km=(0,$.input)({label:`Connection`,required:!0,type:`connection`}),qm=(0,$.input)({label:`Fetch All`,type:`boolean`,clean:$.util.types.toBool,comments:`When enabled, automatically fetches all pages of results. Pagination inputs are ignored when this is enabled.`,required:!1,default:`false`}),Jm=(0,$.input)({label:`Additional Fields`,type:`code`,language:`json`,comments:`Additional fields that might not be covered by the standard inputs.`,required:!1,placeholder:`Enter additional fields`,example:JSON.stringify({preferred_first_name:`John`},null,2),clean:Hm}),Ym=(0,$.input)({label:`Company ID`,required:!0,type:`string`,comments:`A UUID representing a company.`,example:`00000000-0000-0000-0000-000000000000`,dataSource:`selectCompany`,clean:$.util.types.toString}),Xm=(0,$.input)({label:`Employee ID`,required:!0,type:`string`,comments:`A UUID representing a employee.`,example:`00000000-0000-0000-0000-000000000000`,dataSource:`selectEmployee`,clean:$.util.types.toString}),Zm=(0,$.input)({label:`Pay Schedule ID`,required:!0,type:`string`,comments:`A UUID representing a pay schedule.`,example:`00000000-0000-0000-0000-000000000000`,dataSource:`selectPaySchedule`,clean:$.util.types.toString}),Qm=(0,$.input)({label:`Pagination Page`,required:!1,type:`string`,comments:`Which page of results to fetch. See [Gusto API documentation](https://docs.gusto.com/app-integrations/docs/pagination) for more information.`,clean:e=>$.util.types.toInt(e)||void 0}),$m=(0,$.input)({label:`First Name`,required:!0,type:`string`,comments:`The employee's first name.`,clean:$.util.types.toString}),eh=(0,$.input)({label:`Middle Initial`,required:!1,type:`string`,comments:`The employee's middle initial.`,clean:e=>e?$.util.types.toString(e):void 0}),th=(0,$.input)({label:`Last Name`,required:!0,type:`string`,comments:`The employee's last name.`,clean:$.util.types.toString}),nh=(0,$.input)({label:`Date of Birth`,required:!1,type:`string`,comments:`The employee's date of birth.`,clean:$.util.types.toString,example:`1990-12-30`}),rh=(0,$.input)({label:`Email Address`,required:!1,type:`string`,comments:`The employee's personal email address.`,clean:$.util.types.toString,example:`john.doe@example.com`}),ih=(0,$.input)({label:`Self Onboarding`,required:!1,type:`boolean`,comments:`If true, employee is expected to self-onboard. If false, payroll admin is expected to enter in the employee's onboarding information.`,clean:$.util.types.toBool,default:`false`}),ah=(0,$.input)({label:`Social Security Number`,required:!1,type:`string`,comments:`The employee's social security number.`,clean:$.util.types.toString,example:`123-45-6789`}),oh=(0,$.input)({label:`Termination Date`,required:!0,type:`string`,comments:`The date the employee was terminated.`,clean:$.util.types.toString,example:`2020-12-30`}),sh=(0,$.input)({label:`Run Termination Payroll?`,required:!0,type:`boolean`,comments:`Whether to run a termination payroll for the employee.`,clean:$.util.types.toBool}),ch=(0,$.input)({label:`Webhook URL`,required:!0,type:`string`,comments:`The URL for the webhook subscription.`,example:`https://example.com/webhooks`,clean:$.util.types.toString}),lh=(0,$.input)({label:`Subscription Types`,required:!0,type:`text`,comments:`Types of notifications to receive when entities change. Enter as comma-separated values.`,example:`type1,type2`,clean:$.util.types.toString}),uh=(0,$.input)({label:`Webhook Subscription UUID`,required:!0,type:`string`,comments:`The webhook subscription UUID.`,example:`00000000-0000-0000-0000-000000000000`,clean:$.util.types.toString}),dh=(0,$.input)({label:`Starting After UUID`,required:!1,type:`string`,comments:`Serves as a cursor, returns all events occurring after specified UUID (exclusive).`,clean:Um}),fh=(0,$.input)({label:`Event Type`,required:!1,type:`string`,comments:`A string containing the exact event name or use a wildcard match to filter for a group of events.`,example:`employee.created`,clean:Um}),ph=(0,$.input)({label:`Limit`,required:!1,type:`string`,comments:`Limits the number of objects returned in a single response, between 1 and 100. Defaults to 25.`,clean:Um}),mh=(0,$.input)({label:`Resource UUID`,required:!1,type:`string`,comments:`The UUID of the company. If not specified, will return all events for all companies.`,example:`00000000-0000-0000-0000-000000000000`,clean:Um}),hh=(0,$.input)({label:`Sort Order`,required:!1,type:`string`,model:[{label:`Ascending`,value:`asc`},{label:`Descending`,value:`desc`}],comments:`Sort resulting events in ascending (asc) or descending (desc) chronological order.`,clean:Um}),gh=(0,$.input)({label:`API Version`,required:!0,type:`string`,comments:`The API version to use.`,example:Am,default:Am,clean:$.util.types.toString}),_h=e=>e.fields.authorizeUrl===`https://api.gusto.com/oauth/authorize`?`https://api.gusto.com/v1`:`https://api.gusto-demo.com/v1`,vh=(e,t=!1)=>(0,Bm.createClient)({baseUrl:_h(e),headers:{Authorization:`Bearer ${e.token?.access_token}`,"X-Gusto-API-Version":Am},debug:t}),yh=async(e,t)=>{let n=await Vm(e,t);return(0,Bm.createClient)({baseUrl:_h(e),headers:{Authorization:`Bearer ${n}`,"X-Gusto-API-Version":Am},debug:t})},bh={uuid:`c7a07c73-a703-4462-9343-1b181182b6e0`,name:`Shoppe Studios LLC`,trade_name:`Record Shoppe`,is_partner_managed:!0,tier:`complete`,locations:[{street_1:`412 Kiera Stravenue`,street_2:`Suite 391`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`,active:!0},{street_1:`644 Fay Vista`,street_2:`Suite 842`,city:`Richmond`,state:`VA`,zip:`23218`,country:`USA`,active:!0}],ein:`00-0000001`,entity_type:`C-Corporation`,pay_schedule_type:`by_department`,join_date:`2024-01-15`,funding_type:`ach`,slug:`shoppe-studios-llc`,is_suspended:!1,company_status:`Approved`,is_high_risk_business:!1,is_marijuana_business:!1,contractor_only:!1,compensations:{hourly:[{uuid:`7da6b57d-22f9-11f1-ad28-0242ac100003`,name:`Overtime`,multiple:1.5},{uuid:`7da6b5ec-22f9-11f1-ad28-0242ac100003`,name:`Double overtime`,multiple:2},{uuid:`7da6b22f-22f9-11f1-ad28-0242ac100003`,name:`Regular`,multiple:1},{uuid:`7da6b3ac-22f9-11f1-ad28-0242ac100003`,name:`Outstanding vacation`,multiple:1},{uuid:`7da6b532-22f9-11f1-ad28-0242ac100003`,name:`Holiday`,multiple:1},{uuid:`7da6b44e-22f9-11f1-ad28-0242ac100003`,name:`Emergency sick - self care`,multiple:1},{uuid:`7da6b49d-22f9-11f1-ad28-0242ac100003`,name:`Emergency sick - caring for others`,multiple:1},{uuid:`7da6b4e6-22f9-11f1-ad28-0242ac100003`,name:`FMLA Public Health Emergency Leave`,multiple:1}],fixed:[{uuid:`7da68d82-22f9-11f1-ad28-0242ac100003`,name:`Bonus`},{uuid:`7da69024-22f9-11f1-ad28-0242ac100003`,name:`Commission`},{uuid:`7da69104-22f9-11f1-ad28-0242ac100003`,name:`Paycheck Tips`},{uuid:`7da6918f-22f9-11f1-ad28-0242ac100003`,name:`Cash Tips`},{uuid:`7da69216-22f9-11f1-ad28-0242ac100003`,name:`Correction Payment`},{uuid:`7da692a6-22f9-11f1-ad28-0242ac100003`,name:`Severance`},{uuid:`7da69356-22f9-11f1-ad28-0242ac100003`,name:`Minimum Wage Adjustment`},{uuid:null,name:`Reimbursement`}],paid_time_off:[{uuid:`7dcdcb77-22f9-11f1-ad28-0242ac100003`,name:`Vacation Hours`},{uuid:`7dcdcc8b-22f9-11f1-ad28-0242ac100003`,name:`Sick Hours`},{uuid:null,name:`Holiday Hours`}]},primary_signatory:{uuid:`2d7cd96f-e2fb-4db7-8c04-99ef531b4527`,first_name:`Alda`,middle_initial:``,last_name:`Carter`,phone:`4160000000`,email:`louie.hessel7757869450111547@zemlak.biz`,home_address:{street_1:`524 Roob Divide`,street_2:`Suite 565`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`}},primary_payroll_admin:{first_name:`Ian`,last_name:`Labadie`,phone:`1-565-710-7559`,email:`louie.hessel7757869450111547@zemlak.biz`}},xh={data:{data:[bh],headers:{}}},Sh={data:{data:bh,headers:{}}},Ch={data:{data:[{uuid:`987058cc-23ee-46e9-81ef-5cee086cceca`,first_name:`John`,last_name:`Smith`,email:`jsmith99@gmail.com`,phone:`8009360383`}],headers:{}}},wh={uuid:`d7282d99-ab6b-42f5-ba45-f4a670e886a8`,first_name:`Boaty`,middle_initial:null,last_name:`Koss`,email:`keena.feest@kiehn.co.uk`,company_uuid:`e904cc79-818a-4da8-9d37-0be0a86fdda8`,manager_uuid:null,version:`a5cec1f1c0135feb3e76ca6ea3c46176`,current_employment_status:`full_time`,onboarding_status:`onboarding_completed`,preferred_first_name:null,department_uuid:null,employee_code:`46f036`,payment_method:`Direct Deposit`,department:null,terminated:!1,two_percent_shareholder:!1,onboarded:!0,historical:!1,has_ssn:!0,onboarding_documents_config:{uuid:null,i9_document:!1},jobs:[{uuid:`bc875f9d-adc5-40f6-99db-ed8470bda25f`,version:`863bcd01c51fcfa2468d604cffec7413`,employee_uuid:`d7282d99-ab6b-42f5-ba45-f4a670e886a8`,current_compensation_uuid:`2ec164d0-808b-446c-8120-8cfb500945d0`,payment_unit:`Year`,primary:!0,two_percent_shareholder:!1,state_wc_covered:null,state_wc_class_code:null,title:``,compensations:[{uuid:`2ec164d0-808b-446c-8120-8cfb500945d0`,employee_uuid:`d7282d99-ab6b-42f5-ba45-f4a670e886a8`,version:`db7bfb49a4f0893432cb562311bfcad9`,payment_unit:`Year`,flsa_status:`Exempt`,adjust_for_minimum_wage:!1,minimum_wages:[],job_uuid:`bc875f9d-adc5-40f6-99db-ed8470bda25f`,effective_date:`2025-06-09`,rate:`80000.00`}],rate:`80000.00`,hire_date:`2024-06-09`}],eligible_paid_time_off:[],terminations:[],garnishments:[],date_of_birth:`2005-06-09`,ssn:``,phone:null,work_email:null,current_home_address:{street_1:`412 Kiera Stravenue`,street_2:`Suite 391`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`,active:!0,uiud:`sample-uuid-123231`},all_home_addresses:[{street_1:`412 Kiera Stravenue`,street_2:`Suite 391`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`,active:!0,uiud:`sample-uuid-123231`},{street_1:`123 Example Rd`,street_2:null,city:`Example City`,state:`EX`,zip:`12345`,country:`USA`,active:!1,uiud:`another-sample-uuid-456789`}],member_portal_invitation_status:{status:`sent`,token_expired:!1,welcome_email_sent_at:`2024-01-15T14:30:00Z`,last_password_resent_at:null},partner_portal_invitation_sent:!0},Th={data:{data:[wh],headers:{}}},Eh={data:{data:wh,headers:{}}},Dh={data:{data:wh,headers:{}}},Oh={data:{data:wh,headers:{}}},kh={uuid:`f2a69c38-e2f9-4e31-b5c5-4754fc60a052`,version:`68934a3e9455fa72420237eb05902327`,frequency:`Monthly`,anchor_pay_date:`2022-12-11`,anchor_end_of_pay_period:`2022-11-13`,day_1:11,day_2:null,name:null,custom_name:`every 11th of the month`,auto_pilot:!0,active:!0,auto_payroll_enablement_blockers:null},Ah={data:{data:[kh],headers:{}}},jh={data:{data:[kh],headers:{}}},Mh={data:{data:{uuid:`f8a034b0-91e3-4976-b762-3f8a1d47c950`,employee_uuid:`9779767c-6044-48e0-bf68-aeb370b9a2e7`,active:!0,effective_date:`2024-03-15`,run_termination_payroll:!1},headers:{}}},Nh={uuid:`c5fdae57-5483-4529-9aae-f0edceed92d4`,url:`https://partner-app.com/subscriber`,status:`verified`,subscription_types:[`BankAccount`,`Company`,`CompanyBenefit`,`Contractor`,`ContractorPayment`,`Employee`,`EmployeeBenefit`,`EmployeeJobCompensation`,`ExternalPayroll`,`Form`,`Location`,`Notification`,`Payroll`,`PayrollSync`,`PaySchedule`,`Signatory`]},Ph={data:{data:[Nh],headers:{}}},Fh={data:{data:Nh,headers:{}}},Ih={data:{data:Nh,headers:{}}},Lh={data:{data:Nh,headers:{}}},Rh={data:{message:`The resource was deleted successfully.`}},zh={data:{data:[{uuid:`f7397a24-57ad-4fae-b011-d258e8232900`,event_type:`employee.created`,resource_type:`Company`,resource_uuid:`92a20431-9489-4bde-ad27-6feb20b969d5`,entity_type:`Employee`,entity_uuid:`92a20431-9489-4bde-ad27-6feb20b969d5`,timestamp:1686784995}],headers:{}}},Bh=(0,$.action)({display:{label:`List Companies`,description:`List all companies that the currently authenticated user is a part of`},inputs:{connection:Km,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:xh});var Vh={getCompany:(0,$.action)({display:{label:`Get Company by ID`,description:`Get company metadata by ID`},inputs:{connection:Km,companyId:Ym},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).get(`/companies/${t.companyId}`);return{data:{data:n,headers:r}}},examplePayload:Sh}),listCompanies:Bh,listCompanyAdmins:(0,$.action)({display:{label:`List Company Admins`,description:`List all admin users at a company`},inputs:{connection:Km,companyId:Ym,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies/${t.companyId}/admins`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies/${t.companyId}/admins`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:Ch})};const Hh=(0,$.action)({display:{label:`List Employees`,description:`List employees of a company`},inputs:{connection:Km,companyId:Ym,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies/${t.companyId}/employees`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies/${t.companyId}/employees`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:Th}),Uh=(0,$.action)({display:{label:`Get Employee`,description:`Get an employee by ID`},inputs:{connection:Km,employeeId:Xm},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).get(`/employees/${t.employeeId}`);return{data:{data:n,headers:r}}},examplePayload:Eh});var Wh={createEmployee:(0,$.action)({display:{label:`Create Employee`,description:`Create an employee of a company`},inputs:{connection:Km,companyId:Ym,firstName:$m,middleInitial:eh,lastName:th,dateOfBirth:nh,email:{...rh,comments:`${rh.comments} Required if Self Onboarding is true.`},ssn:ah,selfOnboarding:ih,additionalFields:Jm},perform:async(e,t)=>{if(t.selfOnboarding&&!t.email)throw Error(`Email Address is required when Self Onboarding is enabled.`);let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).post(`/companies/${t.companyId}/employees`,{first_name:t.firstName,middle_initial:t.middleInitial,last_name:t.lastName,date_of_birth:t.dateOfBirth,email:t.email,ssn:t.ssn,self_onboarding:t.selfOnboarding,...t.additionalFields});return{data:{data:n,headers:r}}},examplePayload:Dh}),findEmployeeByEmail:(0,$.action)({display:{label:`Find Employee by Email`,description:`Get an employee by personal email address.`},inputs:{connection:Km,companyId:Ym,email:{...rh,required:!0}},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled),r=1,i=!0;do{let{data:e,headers:a}=await n.get(`/companies/${t.companyId}/employees`,{params:{page:r,per:5}});for(let n of e)if(n.email===t.email)return{data:{data:n,headers:a}};i=a[`x-total-pages`]>a[`x-page`],r+=1}while(i);throw Error(`Employee not found`)},examplePayload:Oh}),getEmployee:Uh,listEmployees:Hh};const Gh=(0,$.action)({display:{label:`List Pay Schedules`,description:`List pay schedules for a company`},inputs:{connection:Km,companyId:Ym,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies/${t.companyId}/pay_schedules`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies/${t.companyId}/pay_schedules`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:Ah});var Kh={getPaySchedule:(0,$.action)({display:{label:`Get Pay Schedule by ID`,description:`Get a pay schedules for a company by pay schedule ID`},inputs:{connection:Km,companyId:Ym,payScheduleId:Zm},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).get(`/companies/${t.companyId}/pay_schedules/${t.payScheduleId}`);return{data:{data:n,headers:r}}},examplePayload:jh}),listPaySchedules:Gh},qh={terminateEmployee:(0,$.action)({display:{label:`Terminate Employee`,description:`End an employee's employment`},inputs:{connection:Km,employeeId:Xm,terminationDate:oh,runTerminationPayroll:sh},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).post(`/employees/${t.employeeId}/terminations`,{effective_date:t.terminationDate,run_termination_payroll:t.runTerminationPayroll});return{data:{data:n,headers:r}}},examplePayload:Mh})},Jh={listWebhookSubscriptions:(0,$.action)({display:{label:`List Webhook Subscriptions`,description:`Returns all webhook subscriptions associated with the provided Partner API token for Gusto.`},inputs:{connection:Km},perform:async(e,t)=>{let{data:n,headers:r}=await(await yh(t.connection,e.debug.enabled)).get(`/webhook_subscriptions`);return{data:{data:n,headers:r}}},examplePayload:Ph}),getWebhookSubscription:(0,$.action)({display:{label:`Get Webhook Subscription`,description:`Returns the Webhook Subscription associated with the provided UUID for Gusto.`},inputs:{connection:Km,webhookSubscriptionUuid:uh},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled),r=`/webhook_subscriptions/${t.webhookSubscriptionUuid}`,{data:i,headers:a}=await n.get(r);return{data:{data:i,headers:a}}},examplePayload:Fh}),createWebhookSubscription:(0,$.action)({display:{label:`Create Webhook Subscription`,description:`Creates a Webhook Subscription to receive notifications when entities change for Gusto.`},inputs:{connection:Km,webhookUrl:ch,subscriptionTypes:lh},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled),r=t.subscriptionTypes.split(`,`).map(e=>e.trim()),i={url:t.webhookUrl,subscription_types:r},{data:a,headers:o}=await n.post(`/webhook_subscriptions`,i);return{data:{data:a,headers:o}}},examplePayload:Ih}),updateWebhookSubscription:(0,$.action)({display:{label:`Update Webhook Subscription`,description:`Updates the Webhook Subscription associated with the provided UUID for Gusto.`},inputs:{connection:Km,webhookSubscriptionUuid:uh,subscriptionTypes:lh},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled),r={subscription_types:t.subscriptionTypes.split(`,`).map(e=>e.trim())},{data:i,headers:a}=await n.put(`/webhook_subscriptions/${t.webhookSubscriptionUuid}`,r);return{data:{data:i,headers:a}}},examplePayload:Lh}),deleteWebhookSubscription:(0,$.action)({display:{label:`Delete Webhook Subscription`,description:`Deletes the Webhook Subscription associated with the provided UUID for Gusto.`},inputs:{connection:Km,webhookSubscriptionUuid:uh},perform:async(e,t)=>(await(await yh(t.connection,e.debug.enabled)).delete(`/webhook_subscriptions/${t.webhookSubscriptionUuid}`),{data:{message:`The resource was deleted successfully.`}}),examplePayload:Rh}),getWebhookEvents:(0,$.action)({display:{label:`Get Webhook Events`,description:`Get webhook events based on the partner application's scopes for Gusto.`},inputs:{connection:Km,resourceUuid:mh,eventType:fh,sortOrder:hh,fetchAll:qm,startingAfterUuid:dh,limit:ph},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Gm(n,`/events`,{resource_uuid:t.resourceUuid,event_type:t.eventType,sort_order:t.sortOrder}),headers:{}}};let r={resource_uuid:t.resourceUuid,event_type:t.eventType,starting_after_uuid:t.startingAfterUuid,limit:t.limit,sort_order:t.sortOrder},{data:i,headers:a}=await n.get(`/events`,{params:r});return{data:{data:i,headers:a}}},examplePayload:zh})};const{debugRequest:Yh,...Xh}=Bm.inputs,Zh=(0,$.action)({display:{label:`Raw Request`,description:`Send raw HTTP request to Gusto`},inputs:{connection:Km,apiVersion:gh,...Xh,url:{...Xh.url,comments:`Input the path only (/provision), The base URL is already included (https://api.gusto.com/v1). For example, to connect to https://api.gusto.com/v1/provision, only /provision is entered in this field.`,example:`/provision`}},perform:async(e,{connection:t,apiVersion:n,...r})=>{let{data:i,headers:a}=await(0,Bm.sendRawRequest)(_h(t),{...r,debugRequest:e.debug.enabled},{Authorization:`Bearer ${t.token?.access_token}`,"X-Gusto-API-Version":n});return{data:{data:i,headers:a}}}});var Qh={...Vh,...Wh,...Kh,...qh,...Jh,rawRequest:Zh},$h={selectCompany:(0,$.dataSource)({display:{label:`Select Company`,description:`A picklist of companies in your Gusto account.`},dataSourceType:`picklist`,inputs:{connection:Km},perform:async(e,{connection:t})=>{let{data:n}=await vh(t).get(`/companies`);return{result:n.map(e=>({label:e.name,key:e.uuid.toString()})).sort((e,t)=>(e.label??``)<(t.label??``)?-1:1)}},examplePayload:{result:[{label:`Acme Corporation`,key:`c44d66dc-c41b-4a60-9e25-5e93ff8583f2`}]}}),selectEmployee:(0,$.dataSource)({display:{label:`Select Employee`,description:`A picklist of employees for the selected company.`},dataSourceType:`picklist`,inputs:{connection:Km,companyId:{...Ym,dataSource:void 0}},perform:async(e,{connection:t,companyId:n})=>{let r=vh(t),i=1,a=!0,o=[];do{let{data:e,headers:t}=await r.get(`/companies/${n}/employees`,{params:{page:i}});o.push(...e),a=t[`x-total-pages`]>t[`x-page`],i+=1}while(a);return{result:o.map(e=>({label:`${e.first_name} ${e.last_name}`,key:e.uuid.toString()})).sort((e,t)=>(e.label??``)<(t.label??``)?-1:1)}},examplePayload:{result:[{label:`Nicole Boehm`,key:`9779767c-6044-48e0-bf68-aeb370b9a2e7`}]}}),selectPaySchedule:(0,$.dataSource)({display:{label:`Select Pay Schedule`,description:`A picklist of pay schedules for the selected company.`},dataSourceType:`picklist`,inputs:{connection:Km,companyId:{...Ym,dataSource:void 0}},perform:async(e,{connection:t,companyId:n})=>{let r=vh(t),i=1,a=!0,o=[];do{let{data:e,headers:t}=await r.get(`/companies/${n}/pay_schedules`,{params:{page:i}});o.push(...e),a=t[`x-total-pages`]>t[`x-page`],i+=1}while(a);return{result:o.map(e=>({label:`${e.name} (${e.frequency})`,key:e.uuid.toString()})).sort((e,t)=>(e.label??``)<(t.label??``)?-1:1)}},examplePayload:{result:[{label:`Engineering (Twice per month)`,key:`2097fe08-407a-46d7-b35c-a32402a2355e`}]}})};async function eg(e){let{data:t}=await e.get(`/webhook_subscriptions`);return t}async function tg(e,t,n){let r=`/webhook_subscriptions/${t}/verify`;try{return(await e.put(r,{verification_token:n})).data}catch(e){throw console.error(`Error verifying webhook:`,e),e}}var ng={gustoWebhookTrigger:(0,$.trigger)({display:{label:`Webhook`,description:`Receive and validate webhook requests from Gusto for webhooks you configure.`},scheduleSupport:`invalid`,synchronousResponseSupport:`valid`,allowsBranching:!0,inputs:{connection:Km},staticBranchNames:[`Notification`,`URL Validation`],perform:async(e,t,n)=>{let r=$.util.types.lowerCaseHeaders(t.headers),i=await yh(n.connection,e.debug.enabled),a=await eg(i),o=e.webhookUrls[e.flow.name],s=a.find(e=>e.url===o),c;if(typeof t.body.data==`object`&&t.body.data!==null){let e=t.body.data;typeof e.verification_token==`string`&&(c=e.verification_token)}return c&&s?(await tg(i,s.uuid,c),Promise.resolve({payload:t,response:{statusCode:200,headers:{...r,accept:`application/json`},body:JSON.stringify({verification_token:c}),contentType:`application/json`},branch:`URL Validation`})):Promise.resolve({payload:t,response:{statusCode:200,contentType:`text/plain`},branch:`Notification`})}})},rg=(0,$.component)({key:`gusto`,public:!0,documentationUrl:`https://prismatic.io/docs/components/gusto/`,display:{category:`Application Connectors`,label:`Gusto`,description:`Manage payroll, benefits, and human resource within Gusto`,iconPath:`icon.png`},actions:Qh,connections:km,dataSources:$h,triggers:ng,hooks:{error:Bm.handleErrors}});exports.default=rg;
|
|
227
|
+
let t=Fm(),n=Im(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50;let i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return d(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return f(e,t);if(ArrayBuffer.isView(e))return m(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=g(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function u(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return u(e,t,n)};function d(e){return l(e),o(e<0?0:_(e)|0)}s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)};function f(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=y(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function p(e){let t=e.length<0?0:_(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function m(e){if(K(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}function h(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function g(e){if(s.isBuffer(e)){let t=_(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||fe(e.length)?o(0):p(e);if(e.type===`Buffer`&&Array.isArray(e.data))return p(e.data)}function _(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function v(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(K(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function y(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return le(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return de(e).length;default:if(i)return r?-1:le(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=y;function b(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return F(this,t,n);case`utf8`:case`utf-8`:return A(this,t,n);case`ascii`:return N(this,t,n);case`latin1`:case`binary`:return P(this,t,n);case`base64`:return k(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return I(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function x(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)x(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)x(this,t,t+3),x(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)x(this,t,t+7),x(this,t+1,t+6),x(this,t+2,t+5),x(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?A(this,0,e):b.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function S(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,fe(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:C(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function C(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return S(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return S(this,e,t,n,!1)};function w(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(fe(r))return o;e[n+o]=r}return o}function T(e,t,n,r){return G(le(t,e.length-n),e,n,r)}function E(e,t,n,r){return G(W(t),e,n,r)}function D(e,t,n,r){return G(de(t),e,n,r)}function O(e,t,n,r){return G(ue(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return w(this,e,t,n);case`utf8`:case`utf-8`:return T(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return E(this,e,t,n);case`base64`:return D(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return O(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function A(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return M(r)}let j=4096;function M(e){let t=e.length;if(t<=j)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=j));return n}function N(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function P(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function F(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=pe[e[r]];return i}function I(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function L(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=me(function(e){e>>>=0,U(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),n.read(this,e,!1,52,8)};function R(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;R(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function z(e,t,n,r,i){ae(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function ee(e,t,n,r,i){ae(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=me(function(e,t=0){return z(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=me(function(e,t=0){return ee(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);R(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=me(function(e,t=0){return z(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=me(function(e,t=0){return ee(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function te(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function B(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)};function V(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};let H={};function ne(e,t,n){H[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ne(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ne(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ne(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=re(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=re(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function re(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function ie(e,t,n){U(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&oe(t,e.length-(n+1))}function ae(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new H.ERR_OUT_OF_RANGE(`value`,i,e)}ie(r,i,a)}function U(e,t){if(typeof e!=`number`)throw new H.ERR_INVALID_ARG_TYPE(t,`number`,e)}function oe(e,t,n){throw Math.floor(e)===e?t<0?new H.ERR_BUFFER_OUT_OF_BOUNDS:new H.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(U(e,n),new H.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}let se=/[^+/0-9A-Za-z-_]/g;function ce(e){if(e=e.split(`=`)[0],e=e.trim().replace(se,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function le(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function W(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function ue(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function de(e){return t.toByteArray(ce(e))}function G(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function fe(e){return e!==e}let pe=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function me(e){return typeof BigInt>`u`?he:e}function he(){throw Error(`BigInt not supported`)}})),Rm=a(((e,t)=>{let n=Pm(),r=typeof window<`u`?Lm().Buffer:global.Buffer;function i(e){return 12+4*Math.ceil(e.length/4)}function a(){return!(typeof window<`u`&&typeof document<`u`)}function o(e){return e.BYTES_PER_ELEMENT?e.length*e.BYTES_PER_ELEMENT:-1}function s(e){let t=0;try{let n=e;if(e instanceof Map?n=Object.fromEntries(e):e instanceof Set&&(n=Array.from(e)),ArrayBuffer.isView(e))return o(e);let i=JSON.stringify(n,(e,t)=>typeof t==`bigint`||typeof t==`function`?t.toString():t===void 0?`undefined`:typeof t==`symbol`||t instanceof RegExp?t.toString():t);t=r.byteLength(i,`utf8`)}catch{return Error(-1)}return t}function c(e){let t=[],o=[e],s=0;for(;o.length;){let c=o.pop();if(typeof c==`boolean`)s+=n.BYTES;else if(typeof c==`string`)a()?s+=i(c):s+=c.length*n.STRING;else if(typeof c==`number`)s+=n.NUMBER;else if(typeof c==`symbol`)Symbol.keyFor&&Symbol.keyFor(e)?s+=Symbol.keyFor(e).length*n.STRING:s+=(e.toString().length-8)*n.STRING;else if(typeof c==`bigint`)s+=r.from(c.toString()).byteLength;else if(typeof c==`function`)s+=c.toString().length;else if(typeof c==`object`&&t.indexOf(c)===-1){t.push(c);for(let e in c)o.push(c[e])}}return s}t.exports=function(e){let t=0;return t=typeof e==`object`&&e?s(e):c(e),t}})),zm=a((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.inputs=e.debugRequest=e.fileDataFileNames=e.fileData=e.formData=e.retryAllErrors=e.useExponentialBackoff=e.retryDelayMS=e.maxRetries=e.queryParams=e.headers=e.responseType=e.method=e.timeout=e.data=e.url=void 0;let t=Om();e.url=(0,t.input)({label:`URL`,placeholder:`URL to call`,type:`string`,required:!0,comments:`This is the URL to call.`,example:`/sobjects/Account`,clean:e=>t.util.types.toString(e)}),e.data=(0,t.input)({label:`Data`,placeholder:`Data to send`,type:`string`,required:!1,comments:`The HTTP body payload to send to the URL.`,example:`{"exampleKey": "Example Data"}`}),e.timeout=(0,t.input)({label:`Timeout`,type:`string`,required:!1,comments:`The maximum time that a client will await a response to its request`,example:`2000`,clean:e=>t.util.types.toNumber(e)}),e.method=(0,t.input)({label:`Method`,type:`string`,required:!0,model:[`DELETE`,`GET`,`HEAD`,`LINK`,`OPTIONS`,`PATCH`,`POST`,`PURGE`,`PUT`,`UNLINK`].map(e=>({label:e,value:e})),comments:`The HTTP method to use.`,clean:e=>t.util.types.toString(e)}),e.responseType=(0,t.input)({label:`Response Type`,placeholder:`Response Type`,type:`string`,default:`json`,required:!0,comments:`The type of data you expect in the response. You can request json, text, or binary data.`,model:[`arraybuffer`,`document`,`json`,`text`].map(e=>({label:e,value:e})),clean:e=>t.util.types.toString(e)}),e.headers=(0,t.input)({label:`Header`,placeholder:`Header`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`A list of headers to send with the request.`,example:`User-Agent: curl/7.64.1`}),e.queryParams=(0,t.input)({label:`Query Parameter`,placeholder:`Query Parameter`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.`}),e.maxRetries=(0,t.input)({label:`Max Retry Count`,placeholder:`Max Retries`,type:`string`,required:!1,comments:`The maximum number of retries to attempt. Specify 0 for no retries.`,default:`0`,clean:e=>t.util.types.toNumber(e)}),e.retryDelayMS=(0,t.input)({label:`Retry Delay (ms)`,placeholder:`Retry Delay`,type:`string`,required:!1,comments:`The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.`,default:`0`,clean:e=>t.util.types.toNumber(e,0)}),e.useExponentialBackoff=(0,t.input)({label:`Use Exponential Backoff`,type:`boolean`,default:`false`,required:!1,comments:`Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.`,clean:e=>t.util.types.toBool(e)}),e.retryAllErrors=(0,t.input)({label:`Retry On All Errors`,type:`boolean`,default:`false`,required:!1,comments:`If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.`,clean:e=>t.util.types.toBool(e)}),e.formData=(0,t.input)({label:`Form Data`,placeholder:`Data to send`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`The Form Data to be sent as a multipart form upload.`,example:`[{"key": "Example Key", "value": new Buffer("Hello World")}]`}),e.fileData=(0,t.input)({label:`File Data`,placeholder:`Data to send`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`File Data to be sent as a multipart form upload.`,example:`[{key: "example.txt", value: "My File Contents"}]`}),e.fileDataFileNames=(0,t.input)({label:`File Data File Names`,placeholder:`The file name to apply to a file`,type:`string`,collection:`keyvaluelist`,required:!1,comments:`File names to apply to the file data inputs. Keys must match the file data keys above.`,clean:e=>e?t.util.types.keyValPairListToObject(e):void 0}),e.debugRequest=(0,t.input)({label:`Debug Request`,type:`boolean`,required:!1,comments:`Enabling this flag will log out the current request.`,clean:e=>t.util.types.toBool(e)}),e.inputs={url:e.url,method:e.method,data:e.data,formData:e.formData,fileData:e.fileData,fileDataFileNames:e.fileDataFileNames,queryParams:e.queryParams,headers:e.headers,responseType:e.responseType,timeout:e.timeout,debugRequest:e.debugRequest,retryDelayMS:e.retryDelayMS,retryAllErrors:e.retryAllErrors,maxRetries:e.maxRetries,useExponentialBackoff:e.useExponentialBackoff}})),Bm=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!=="default"&&t(i,r,a[o]);return n(i,r),i}})(),i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},a=e&&e.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.inputs=e.buildRawRequestAction=e.sendRawRequest=e.handleErrors=e.createClient=e.toAxiosRetryConfig=void 0;let s=o(Nu()),c=r(Mm()),l=o(bu()),u=o(Nm()),d=o(Rm()),f=Om(),p=o(dl()),m=zm();Object.defineProperty(e,"inputs",{enumerable:!0,get:function(){return m.inputs}});let h=/^(cookie|set-cookie)$|auth|token|secret|password|api[-_]?key/i,g=e=>typeof e==`object`&&!!e&&typeof e.toJSON==`function`,_=e=>{let t=g(e)?e.toJSON():Object.assign({},e);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,h.test(e)?`[REDACTED]`:t]))},v=e=>{let t=p.default.types.toString(e.token?.access_token);if(t)return{Authorization:`Bearer ${t}`};let n=p.default.types.toString(e.fields?.apiKey);if(n)return{Authorization:`Bearer ${n}`};let r=p.default.types.toString(e.fields?.username),i=p.default.types.toString(e.fields?.password);if(r&&i)return{Authorization:`Basic ${Buffer.from(`${r}:${i}`).toString(`base64`)}`};throw Error(`Failed to guess at authorization parameters for Connection: ${e.key}`)},y=(e,t,n={})=>{let r=new l.default;return(e||[]).map(({key:e,value:t})=>r.append(e,t)),(t||[]).map(({key:e,value:t})=>r.append(e,p.default.types.toBufferDataPayload(t).data,{filename:n?.[e]||e})),r},b=(e,t)=>t?typeof e==`number`?t=>2**(t-1)*e:c.exponentialDelay:typeof e==`number`?()=>e:e;e.toAxiosRetryConfig=e=>{var{retryDelay:t,retryAllErrors:n,retryCondition:r,useExponentialBackoff:i}=e,o=a(e,[`retryDelay`,`retryAllErrors`,`retryCondition`,`useExponentialBackoff`]);return Object.assign(Object.assign({},o),{retryDelay:b(t,i),retryCondition:n?()=>!0:typeof r==`function`?r:c.isNetworkOrIdempotentRequestError})},e.createClient=({baseUrl:t,responseType:n,headers:r,timeout:i,params:a,debug:o=!1,retryConfig:l})=>{let u=s.default.create({baseURL:t,responseType:n,headers:r,timeout:i,params:a,maxContentLength:1/0,maxBodyLength:1/0});return o&&(u.interceptors.request.use(e=>{let{baseURL:t,headers:n,method:r,timeout:i,url:a,data:o,params:s}=e,c=(0,d.default)(o);return console.log(p.default.types.toJSON({type:`request`,baseURL:t,params:s,url:a,headers:_(n),method:r,timeout:i,data:c>1024*10||Buffer.isBuffer(o)?`<data (${c} bytes)>`:o},!0,!0)),e}),u.interceptors.response.use(e=>{let{headers:t,status:n,statusText:r,data:i}=e,a=(0,d.default)(i);return console.log(p.default.types.toJSON({type:`response`,headers:_(t),status:n,statusText:r,data:a>1024*10||Buffer.isBuffer(i)?`<data (${a} bytes)>`:i},!0,!0)),e})),l&&(0,c.default)(u,(0,e.toAxiosRetryConfig)(l)),u},e.handleErrors=e=>{if(s.default.isAxiosError(e)){let{message:t,response:n}=e;return{message:t,data:n?.data,status:n?.status,headers:n?.headers}}return e},e.sendRawRequest=(t,n,...r)=>i(void 0,[t,n,...r],void 0,function*(t,n,r={}){if(n.data&&(!(0,u.default)(n.formData)||!(0,u.default)(n.fileData)))throw Error(`Cannot specify both Data and File/Form Data.`);let i=!(0,u.default)(n.formData)||!(0,u.default)(n.fileData)?y(n.formData,n.fileData,n.fileDataFileNames):n.data;return yield(0,e.createClient)({baseUrl:t,debug:n.debugRequest,responseType:n.responseType,timeout:n.timeout,retryConfig:{retries:n.maxRetries,retryDelay:n.retryDelayMS,retryAllErrors:n.retryAllErrors,useExponentialBackoff:n.useExponentialBackoff}}).request({method:n.method,url:n.url,headers:Object.assign(Object.assign(Object.assign({},p.default.types.keyValPairListToObject(n.headers)),i instanceof l.default?i.getHeaders():{}),r),params:p.default.types.keyValPairListToObject(n.queryParams),data:i||void 0})}),e.buildRawRequestAction=(t,n=`Raw Request`,r=`Issue a raw HTTP request`)=>(0,f.action)({display:{label:n,description:r},inputs:Object.assign({connection:{label:`Connection`,type:`connection`,required:!0}},m.inputs),perform:(n,r)=>i(void 0,void 0,void 0,function*(){var{connection:n}=r,i=a(r,[`connection`]);let{data:o}=yield(0,e.sendRawRequest)(t,i,v(n));return{data:o}})})}))();const Vm=async(e,t)=>{let{clientId:n,clientSecret:r,tokenUrl:i}=e.fields,{data:a}=await(0,Bm.createClient)({baseUrl:$.util.types.toString(i),headers:{"Content-Type":`application/json`},debug:t}).post(``,{grant_type:`system_access`,client_id:$.util.types.toString(n),client_secret:$.util.types.toString(r)});return a.access_token},Hm=e=>e?$.util.types.toObject(e):{},Um=e=>e?$.util.types.toString(e):void 0,Wm=async(e,t)=>{let n=[],r=1,i=!0;do{let{data:a,headers:o}=await e.get(t,{params:{page:r}});n.push(...a),i=$.util.types.toNumber(o[`x-total-pages`])>$.util.types.toNumber(o[`x-page`]),r+=1}while(i);return n},Gm=async(e,t,n)=>{let r=[],i,a=!0;do{let o={...n,limit:$.util.types.toString(100)};i&&(o.starting_after_uuid=i);let{data:s,headers:c}=await e.get(t,{params:o});r.push(...s),a=$.util.types.toString(c[`x-has-next-page`])===`true`&&s.length>0,a&&(i=s[s.length-1].uuid)}while(a);return r},Km=(0,$.input)({label:`Connection`,required:!0,type:`connection`}),qm=(0,$.input)({label:`Fetch All`,type:`boolean`,clean:$.util.types.toBool,comments:`When enabled, automatically fetches all pages of results. Pagination inputs are ignored when this is enabled.`,required:!1,default:`false`}),Jm=(0,$.input)({label:`Additional Fields`,type:`code`,language:`json`,comments:`Additional fields that might not be covered by the standard inputs.`,required:!1,placeholder:`Enter additional fields`,example:JSON.stringify({preferred_first_name:`John`},null,2),clean:Hm}),Ym=(0,$.input)({label:`Company ID`,required:!0,type:`string`,comments:`A UUID representing a company.`,example:`00000000-0000-0000-0000-000000000000`,dataSource:`selectCompany`,clean:$.util.types.toString}),Xm=(0,$.input)({label:`Employee ID`,required:!0,type:`string`,comments:`A UUID representing a employee.`,example:`00000000-0000-0000-0000-000000000000`,dataSource:`selectEmployee`,clean:$.util.types.toString}),Zm=(0,$.input)({label:`Pay Schedule ID`,required:!0,type:`string`,comments:`A UUID representing a pay schedule.`,example:`00000000-0000-0000-0000-000000000000`,dataSource:`selectPaySchedule`,clean:$.util.types.toString}),Qm=(0,$.input)({label:`Pagination Page`,required:!1,type:`string`,comments:`Which page of results to fetch. See [Gusto API documentation](https://docs.gusto.com/app-integrations/docs/pagination) for more information.`,clean:e=>$.util.types.toInt(e)||void 0}),$m=(0,$.input)({label:`First Name`,required:!0,type:`string`,comments:`The employee's first name.`,clean:$.util.types.toString}),eh=(0,$.input)({label:`Middle Initial`,required:!1,type:`string`,comments:`The employee's middle initial.`,clean:e=>e?$.util.types.toString(e):void 0}),th=(0,$.input)({label:`Last Name`,required:!0,type:`string`,comments:`The employee's last name.`,clean:$.util.types.toString}),nh=(0,$.input)({label:`Date of Birth`,required:!1,type:`string`,comments:`The employee's date of birth.`,clean:$.util.types.toString,example:`1990-12-30`}),rh=(0,$.input)({label:`Email Address`,required:!1,type:`string`,comments:`The employee's personal email address.`,clean:$.util.types.toString,example:`john.doe@example.com`}),ih=(0,$.input)({label:`Self Onboarding`,required:!1,type:`boolean`,comments:`If true, employee is expected to self-onboard. If false, payroll admin is expected to enter in the employee's onboarding information.`,clean:$.util.types.toBool,default:`false`}),ah=(0,$.input)({label:`Social Security Number`,required:!1,type:`string`,comments:`The employee's social security number.`,clean:$.util.types.toString,example:`123-45-6789`}),oh=(0,$.input)({label:`Termination Date`,required:!0,type:`string`,comments:`The date the employee was terminated.`,clean:$.util.types.toString,example:`2020-12-30`}),sh=(0,$.input)({label:`Run Termination Payroll?`,required:!0,type:`boolean`,comments:`Whether to run a termination payroll for the employee.`,clean:$.util.types.toBool}),ch=(0,$.input)({label:`Webhook URL`,required:!0,type:`string`,comments:`The URL for the webhook subscription.`,example:`https://example.com/webhooks`,clean:$.util.types.toString}),lh=(0,$.input)({label:`Subscription Types`,required:!0,type:`text`,comments:`Types of notifications to receive when entities change. Enter as comma-separated values.`,example:`type1,type2`,clean:$.util.types.toString}),uh=(0,$.input)({label:`Webhook Subscription UUID`,required:!0,type:`string`,comments:`The webhook subscription UUID.`,example:`00000000-0000-0000-0000-000000000000`,clean:$.util.types.toString}),dh=(0,$.input)({label:`Starting After UUID`,required:!1,type:`string`,comments:`Serves as a cursor, returns all events occurring after specified UUID (exclusive).`,clean:Um}),fh=(0,$.input)({label:`Event Type`,required:!1,type:`string`,comments:`A string containing the exact event name or use a wildcard match to filter for a group of events.`,example:`employee.created`,clean:Um}),ph=(0,$.input)({label:`Limit`,required:!1,type:`string`,comments:`Limits the number of objects returned in a single response, between 1 and 100. Defaults to 25.`,clean:Um}),mh=(0,$.input)({label:`Resource UUID`,required:!1,type:`string`,comments:`The UUID of the company. If not specified, will return all events for all companies.`,example:`00000000-0000-0000-0000-000000000000`,clean:Um}),hh=(0,$.input)({label:`Sort Order`,required:!1,type:`string`,model:[{label:`Ascending`,value:`asc`},{label:`Descending`,value:`desc`}],comments:`Sort resulting events in ascending (asc) or descending (desc) chronological order.`,clean:Um}),gh=(0,$.input)({label:`API Version`,required:!0,type:`string`,comments:`The API version to use.`,example:Am,default:Am,clean:$.util.types.toString}),_h=e=>e.fields.authorizeUrl===`https://api.gusto.com/oauth/authorize`?`https://api.gusto.com/v1`:`https://api.gusto-demo.com/v1`,vh=(e,t=!1)=>(0,Bm.createClient)({baseUrl:_h(e),headers:{Authorization:`Bearer ${e.token?.access_token}`,"X-Gusto-API-Version":Am},debug:t}),yh=async(e,t)=>{let n=await Vm(e,t);return(0,Bm.createClient)({baseUrl:_h(e),headers:{Authorization:`Bearer ${n}`,"X-Gusto-API-Version":Am},debug:t})},bh={uuid:`c7a07c73-a703-4462-9343-1b181182b6e0`,name:`Shoppe Studios LLC`,trade_name:`Record Shoppe`,is_partner_managed:!0,tier:`complete`,locations:[{street_1:`412 Kiera Stravenue`,street_2:`Suite 391`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`,active:!0},{street_1:`644 Fay Vista`,street_2:`Suite 842`,city:`Richmond`,state:`VA`,zip:`23218`,country:`USA`,active:!0}],ein:`00-0000001`,entity_type:`C-Corporation`,pay_schedule_type:`by_department`,join_date:`2024-01-15`,funding_type:`ach`,slug:`shoppe-studios-llc`,is_suspended:!1,company_status:`Approved`,is_high_risk_business:!1,is_marijuana_business:!1,contractor_only:!1,compensations:{hourly:[{uuid:`7da6b57d-22f9-11f1-ad28-0242ac100003`,name:`Overtime`,multiple:1.5},{uuid:`7da6b5ec-22f9-11f1-ad28-0242ac100003`,name:`Double overtime`,multiple:2},{uuid:`7da6b22f-22f9-11f1-ad28-0242ac100003`,name:`Regular`,multiple:1},{uuid:`7da6b3ac-22f9-11f1-ad28-0242ac100003`,name:`Outstanding vacation`,multiple:1},{uuid:`7da6b532-22f9-11f1-ad28-0242ac100003`,name:`Holiday`,multiple:1},{uuid:`7da6b44e-22f9-11f1-ad28-0242ac100003`,name:`Emergency sick - self care`,multiple:1},{uuid:`7da6b49d-22f9-11f1-ad28-0242ac100003`,name:`Emergency sick - caring for others`,multiple:1},{uuid:`7da6b4e6-22f9-11f1-ad28-0242ac100003`,name:`FMLA Public Health Emergency Leave`,multiple:1}],fixed:[{uuid:`7da68d82-22f9-11f1-ad28-0242ac100003`,name:`Bonus`},{uuid:`7da69024-22f9-11f1-ad28-0242ac100003`,name:`Commission`},{uuid:`7da69104-22f9-11f1-ad28-0242ac100003`,name:`Paycheck Tips`},{uuid:`7da6918f-22f9-11f1-ad28-0242ac100003`,name:`Cash Tips`},{uuid:`7da69216-22f9-11f1-ad28-0242ac100003`,name:`Correction Payment`},{uuid:`7da692a6-22f9-11f1-ad28-0242ac100003`,name:`Severance`},{uuid:`7da69356-22f9-11f1-ad28-0242ac100003`,name:`Minimum Wage Adjustment`},{uuid:null,name:`Reimbursement`}],paid_time_off:[{uuid:`7dcdcb77-22f9-11f1-ad28-0242ac100003`,name:`Vacation Hours`},{uuid:`7dcdcc8b-22f9-11f1-ad28-0242ac100003`,name:`Sick Hours`},{uuid:null,name:`Holiday Hours`}]},primary_signatory:{uuid:`2d7cd96f-e2fb-4db7-8c04-99ef531b4527`,first_name:`Alda`,middle_initial:``,last_name:`Carter`,phone:`4160000000`,email:`louie.hessel7757869450111547@zemlak.biz`,home_address:{street_1:`524 Roob Divide`,street_2:`Suite 565`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`}},primary_payroll_admin:{first_name:`Ian`,last_name:`Labadie`,phone:`1-565-710-7559`,email:`louie.hessel7757869450111547@zemlak.biz`}},xh={data:{data:[bh],headers:{}}},Sh={data:{data:bh,headers:{}}},Ch={data:{data:[{uuid:`987058cc-23ee-46e9-81ef-5cee086cceca`,first_name:`John`,last_name:`Smith`,email:`jsmith99@gmail.com`,phone:`8009360383`}],headers:{}}},wh={uuid:`d7282d99-ab6b-42f5-ba45-f4a670e886a8`,first_name:`Boaty`,middle_initial:null,last_name:`Koss`,email:`keena.feest@kiehn.co.uk`,company_uuid:`e904cc79-818a-4da8-9d37-0be0a86fdda8`,manager_uuid:null,version:`a5cec1f1c0135feb3e76ca6ea3c46176`,current_employment_status:`full_time`,onboarding_status:`onboarding_completed`,preferred_first_name:null,department_uuid:null,employee_code:`46f036`,payment_method:`Direct Deposit`,department:null,terminated:!1,two_percent_shareholder:!1,onboarded:!0,historical:!1,has_ssn:!0,onboarding_documents_config:{uuid:null,i9_document:!1},jobs:[{uuid:`bc875f9d-adc5-40f6-99db-ed8470bda25f`,version:`863bcd01c51fcfa2468d604cffec7413`,employee_uuid:`d7282d99-ab6b-42f5-ba45-f4a670e886a8`,current_compensation_uuid:`2ec164d0-808b-446c-8120-8cfb500945d0`,payment_unit:`Year`,primary:!0,two_percent_shareholder:!1,state_wc_covered:null,state_wc_class_code:null,title:``,compensations:[{uuid:`2ec164d0-808b-446c-8120-8cfb500945d0`,employee_uuid:`d7282d99-ab6b-42f5-ba45-f4a670e886a8`,version:`db7bfb49a4f0893432cb562311bfcad9`,payment_unit:`Year`,flsa_status:`Exempt`,adjust_for_minimum_wage:!1,minimum_wages:[],job_uuid:`bc875f9d-adc5-40f6-99db-ed8470bda25f`,effective_date:`2025-06-09`,rate:`80000.00`}],rate:`80000.00`,hire_date:`2024-06-09`}],eligible_paid_time_off:[],terminations:[],garnishments:[],date_of_birth:`2005-06-09`,ssn:``,phone:null,work_email:null,current_home_address:{street_1:`412 Kiera Stravenue`,street_2:`Suite 391`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`,active:!0,uiud:`sample-uuid-123231`},all_home_addresses:[{street_1:`412 Kiera Stravenue`,street_2:`Suite 391`,city:`San Francisco`,state:`CA`,zip:`94107`,country:`USA`,active:!0,uiud:`sample-uuid-123231`},{street_1:`123 Example Rd`,street_2:null,city:`Example City`,state:`EX`,zip:`12345`,country:`USA`,active:!1,uiud:`another-sample-uuid-456789`}],member_portal_invitation_status:{status:`sent`,token_expired:!1,welcome_email_sent_at:`2024-01-15T14:30:00Z`,last_password_resent_at:null},partner_portal_invitation_sent:!0},Th={data:{data:[wh],headers:{}}},Eh={data:{data:wh,headers:{}}},Dh={data:{data:wh,headers:{}}},Oh={data:{data:wh,headers:{}}},kh={uuid:`f2a69c38-e2f9-4e31-b5c5-4754fc60a052`,version:`68934a3e9455fa72420237eb05902327`,frequency:`Monthly`,anchor_pay_date:`2022-12-11`,anchor_end_of_pay_period:`2022-11-13`,day_1:11,day_2:null,name:null,custom_name:`every 11th of the month`,auto_pilot:!0,active:!0,auto_payroll_enablement_blockers:null},Ah={data:{data:[kh],headers:{}}},jh={data:{data:[kh],headers:{}}},Mh={data:{data:{uuid:`f8a034b0-91e3-4976-b762-3f8a1d47c950`,employee_uuid:`9779767c-6044-48e0-bf68-aeb370b9a2e7`,active:!0,effective_date:`2024-03-15`,run_termination_payroll:!1},headers:{}}},Nh={uuid:`c5fdae57-5483-4529-9aae-f0edceed92d4`,url:`https://partner-app.com/subscriber`,status:`verified`,subscription_types:[`BankAccount`,`Company`,`CompanyBenefit`,`Contractor`,`ContractorPayment`,`Employee`,`EmployeeBenefit`,`EmployeeJobCompensation`,`ExternalPayroll`,`Form`,`Location`,`Notification`,`Payroll`,`PayrollSync`,`PaySchedule`,`Signatory`]},Ph={data:{data:[Nh],headers:{}}},Fh={data:{data:Nh,headers:{}}},Ih={data:{data:Nh,headers:{}}},Lh={data:{data:Nh,headers:{}}},Rh={data:{message:`The resource was deleted successfully.`}},zh={data:{data:[{uuid:`f7397a24-57ad-4fae-b011-d258e8232900`,event_type:`employee.created`,resource_type:`Company`,resource_uuid:`92a20431-9489-4bde-ad27-6feb20b969d5`,entity_type:`Employee`,entity_uuid:`92a20431-9489-4bde-ad27-6feb20b969d5`,timestamp:1686784995}],headers:{}}},Bh=(0,$.action)({display:{label:`List Companies`,description:`List all companies that the currently authenticated user is a part of`},inputs:{connection:Km,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:xh});var Vh={getCompany:(0,$.action)({display:{label:`Get Company by ID`,description:`Get company metadata by ID`},inputs:{connection:Km,companyId:Ym},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).get(`/companies/${t.companyId}`);return{data:{data:n,headers:r}}},examplePayload:Sh}),listCompanies:Bh,listCompanyAdmins:(0,$.action)({display:{label:`List Company Admins`,description:`List all admin users at a company`},inputs:{connection:Km,companyId:Ym,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies/${t.companyId}/admins`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies/${t.companyId}/admins`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:Ch})};const Hh=(0,$.action)({display:{label:`List Employees`,description:`List employees of a company`},inputs:{connection:Km,companyId:Ym,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies/${t.companyId}/employees`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies/${t.companyId}/employees`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:Th}),Uh=(0,$.action)({display:{label:`Get Employee`,description:`Get an employee by ID`},inputs:{connection:Km,employeeId:Xm},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).get(`/employees/${t.employeeId}`);return{data:{data:n,headers:r}}},examplePayload:Eh});var Wh={createEmployee:(0,$.action)({display:{label:`Create Employee`,description:`Create an employee of a company`},inputs:{connection:Km,companyId:Ym,firstName:$m,middleInitial:eh,lastName:th,dateOfBirth:nh,email:{...rh,comments:`${rh.comments} Required if Self Onboarding is true.`},ssn:ah,selfOnboarding:ih,additionalFields:Jm},perform:async(e,t)=>{if(t.selfOnboarding&&!t.email)throw Error(`Email Address is required when Self Onboarding is enabled.`);let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).post(`/companies/${t.companyId}/employees`,{first_name:t.firstName,middle_initial:t.middleInitial,last_name:t.lastName,date_of_birth:t.dateOfBirth,email:t.email,ssn:t.ssn,self_onboarding:t.selfOnboarding,...t.additionalFields});return{data:{data:n,headers:r}}},examplePayload:Dh}),findEmployeeByEmail:(0,$.action)({display:{label:`Find Employee by Email`,description:`Get an employee by personal email address.`},inputs:{connection:Km,companyId:Ym,email:{...rh,required:!0}},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled),r=1,i=!0;do{let{data:e,headers:a}=await n.get(`/companies/${t.companyId}/employees`,{params:{page:r,per:5}});for(let n of e)if(n.email===t.email)return{data:{data:n,headers:a}};i=a[`x-total-pages`]>a[`x-page`],r+=1}while(i);throw Error(`Employee not found`)},examplePayload:Oh}),getEmployee:Uh,listEmployees:Hh};const Gh=(0,$.action)({display:{label:`List Pay Schedules`,description:`List pay schedules for a company`},inputs:{connection:Km,companyId:Ym,fetchAll:qm,page:Qm},perform:async(e,t)=>{let n=vh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Wm(n,`/companies/${t.companyId}/pay_schedules`),headers:{}}};let{data:r,headers:i}=await n.get(`/companies/${t.companyId}/pay_schedules`,{params:{page:t.page}});return{data:{data:r,headers:i}}},examplePayload:Ah});var Kh={getPaySchedule:(0,$.action)({display:{label:`Get Pay Schedule by ID`,description:`Get a pay schedules for a company by pay schedule ID`},inputs:{connection:Km,companyId:Ym,payScheduleId:Zm},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).get(`/companies/${t.companyId}/pay_schedules/${t.payScheduleId}`);return{data:{data:n,headers:r}}},examplePayload:jh}),listPaySchedules:Gh},qh={terminateEmployee:(0,$.action)({display:{label:`Terminate Employee`,description:`End an employee's employment`},inputs:{connection:Km,employeeId:Xm,terminationDate:oh,runTerminationPayroll:sh},perform:async(e,t)=>{let{data:n,headers:r}=await vh(t.connection,e.debug.enabled).post(`/employees/${t.employeeId}/terminations`,{effective_date:t.terminationDate,run_termination_payroll:t.runTerminationPayroll});return{data:{data:n,headers:r}}},examplePayload:Mh})},Jh={listWebhookSubscriptions:(0,$.action)({display:{label:`List Webhook Subscriptions`,description:`Returns all webhook subscriptions associated with the provided Partner API token for Gusto.`},inputs:{connection:Km},perform:async(e,t)=>{let{data:n,headers:r}=await(await yh(t.connection,e.debug.enabled)).get(`/webhook_subscriptions`);return{data:{data:n,headers:r}}},examplePayload:Ph}),getWebhookSubscription:(0,$.action)({display:{label:`Get Webhook Subscription`,description:`Returns the Webhook Subscription associated with the provided UUID for Gusto.`},inputs:{connection:Km,webhookSubscriptionUuid:uh},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled),r=`/webhook_subscriptions/${t.webhookSubscriptionUuid}`,{data:i,headers:a}=await n.get(r);return{data:{data:i,headers:a}}},examplePayload:Fh}),createWebhookSubscription:(0,$.action)({display:{label:`Create Webhook Subscription`,description:`Creates a Webhook Subscription to receive notifications when entities change for Gusto.`},inputs:{connection:Km,webhookUrl:ch,subscriptionTypes:lh},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled),r=t.subscriptionTypes.split(`,`).map(e=>e.trim()),i={url:t.webhookUrl,subscription_types:r},{data:a,headers:o}=await n.post(`/webhook_subscriptions`,i);return{data:{data:a,headers:o}}},examplePayload:Ih}),updateWebhookSubscription:(0,$.action)({display:{label:`Update Webhook Subscription`,description:`Updates the Webhook Subscription associated with the provided UUID for Gusto.`},inputs:{connection:Km,webhookSubscriptionUuid:uh,subscriptionTypes:lh},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled),r={subscription_types:t.subscriptionTypes.split(`,`).map(e=>e.trim())},{data:i,headers:a}=await n.put(`/webhook_subscriptions/${t.webhookSubscriptionUuid}`,r);return{data:{data:i,headers:a}}},examplePayload:Lh}),deleteWebhookSubscription:(0,$.action)({display:{label:`Delete Webhook Subscription`,description:`Deletes the Webhook Subscription associated with the provided UUID for Gusto.`},inputs:{connection:Km,webhookSubscriptionUuid:uh},perform:async(e,t)=>(await(await yh(t.connection,e.debug.enabled)).delete(`/webhook_subscriptions/${t.webhookSubscriptionUuid}`),{data:{message:`The resource was deleted successfully.`}}),examplePayload:Rh}),getWebhookEvents:(0,$.action)({display:{label:`Get Webhook Events`,description:`Get webhook events based on the partner application's scopes for Gusto.`},inputs:{connection:Km,resourceUuid:mh,eventType:fh,sortOrder:hh,fetchAll:qm,startingAfterUuid:dh,limit:ph},perform:async(e,t)=>{let n=await yh(t.connection,e.debug.enabled);if(t.fetchAll)return{data:{data:await Gm(n,`/events`,{resource_uuid:t.resourceUuid,event_type:t.eventType,sort_order:t.sortOrder}),headers:{}}};let r={resource_uuid:t.resourceUuid,event_type:t.eventType,starting_after_uuid:t.startingAfterUuid,limit:t.limit,sort_order:t.sortOrder},{data:i,headers:a}=await n.get(`/events`,{params:r});return{data:{data:i,headers:a}}},examplePayload:zh})};const{debugRequest:Yh,...Xh}=Bm.inputs,Zh=(0,$.action)({display:{label:`Raw Request`,description:`Send raw HTTP request to Gusto`},inputs:{connection:Km,apiVersion:gh,...Xh,url:{...Xh.url,comments:`Input the path only (/provision), The base URL is already included (https://api.gusto.com/v1). For example, to connect to https://api.gusto.com/v1/provision, only /provision is entered in this field.`,example:`/provision`}},perform:async(e,{connection:t,apiVersion:n,...r})=>{let{data:i,headers:a}=await(0,Bm.sendRawRequest)(_h(t),{...r,debugRequest:e.debug.enabled},{Authorization:`Bearer ${t.token?.access_token}`,"X-Gusto-API-Version":n});return{data:{data:i,headers:a}}}});var Qh={...Vh,...Wh,...Kh,...qh,...Jh,rawRequest:Zh},$h={selectCompany:(0,$.dataSource)({display:{label:`Select Company`,description:`A picklist of companies in your Gusto account.`},dataSourceType:`picklist`,inputs:{connection:Km},perform:async(e,{connection:t})=>{let{data:n}=await vh(t).get(`/companies`);return{result:n.map(e=>({label:e.name,key:e.uuid.toString()})).sort((e,t)=>(e.label??``)<(t.label??``)?-1:1)}},examplePayload:{result:[{label:`Acme Corporation`,key:`c44d66dc-c41b-4a60-9e25-5e93ff8583f2`}]}}),selectEmployee:(0,$.dataSource)({display:{label:`Select Employee`,description:`A picklist of employees for the selected company.`},dataSourceType:`picklist`,inputs:{connection:Km,companyId:{...Ym,dataSource:void 0}},perform:async(e,{connection:t,companyId:n})=>{let r=vh(t),i=1,a=!0,o=[];do{let{data:e,headers:t}=await r.get(`/companies/${n}/employees`,{params:{page:i}});o.push(...e),a=t[`x-total-pages`]>t[`x-page`],i+=1}while(a);return{result:o.map(e=>({label:`${e.first_name} ${e.last_name}`,key:e.uuid.toString()})).sort((e,t)=>(e.label??``)<(t.label??``)?-1:1)}},examplePayload:{result:[{label:`Nicole Boehm`,key:`9779767c-6044-48e0-bf68-aeb370b9a2e7`}]}}),selectPaySchedule:(0,$.dataSource)({display:{label:`Select Pay Schedule`,description:`A picklist of pay schedules for the selected company.`},dataSourceType:`picklist`,inputs:{connection:Km,companyId:{...Ym,dataSource:void 0}},perform:async(e,{connection:t,companyId:n})=>{let r=vh(t),i=1,a=!0,o=[];do{let{data:e,headers:t}=await r.get(`/companies/${n}/pay_schedules`,{params:{page:i}});o.push(...e),a=t[`x-total-pages`]>t[`x-page`],i+=1}while(a);return{result:o.map(e=>({label:`${e.name} (${e.frequency})`,key:e.uuid.toString()})).sort((e,t)=>(e.label??``)<(t.label??``)?-1:1)}},examplePayload:{result:[{label:`Engineering (Twice per month)`,key:`2097fe08-407a-46d7-b35c-a32402a2355e`}]}})};async function eg(e){let{data:t}=await e.get(`/webhook_subscriptions`);return t}async function tg(e,t,n){let r=`/webhook_subscriptions/${t}/verify`;try{return(await e.put(r,{verification_token:n})).data}catch(e){throw console.error(`Error verifying webhook:`,e),e}}var ng={gustoWebhookTrigger:(0,$.trigger)({display:{label:`Webhook`,description:`Receive and validate webhook requests from Gusto for webhooks you configure.`},scheduleSupport:`invalid`,synchronousResponseSupport:`valid`,allowsBranching:!0,inputs:{connection:Km},staticBranchNames:[`Notification`,`URL Validation`],perform:async(e,t,n)=>{let r=$.util.types.lowerCaseHeaders(t.headers),i=await yh(n.connection,e.debug.enabled),a=await eg(i),o=e.webhookUrls[e.flow.name],s=a.find(e=>e.url===o),c;if(typeof t.body.data==`object`&&t.body.data!==null){let e=t.body.data;typeof e.verification_token==`string`&&(c=e.verification_token)}return c&&s?(await tg(i,s.uuid,c),Promise.resolve({payload:t,response:{statusCode:200,headers:{...r,accept:`application/json`},body:JSON.stringify({verification_token:c}),contentType:`application/json`},branch:`URL Validation`})):Promise.resolve({payload:t,response:{statusCode:200,contentType:`text/plain`},branch:`Notification`})}})},rg=(0,$.component)({key:`gusto`,public:!0,documentationUrl:`https://prismatic.io/docs/components/gusto/`,display:{category:`Application Connectors`,label:`Gusto`,description:`Manage companies, employees, pay schedules, and webhook subscriptions in Gusto.`,iconPath:`icon.png`},actions:Qh,connections:km,dataSources:$h,triggers:ng,hooks:{error:Bm.handleErrors}});exports.default=rg;
|
package/npm-dist/index.cjs
CHANGED
|
@@ -1319,7 +1319,7 @@ var src_default = (0, _prismatic_io_spectral.component)({
|
|
|
1319
1319
|
display: {
|
|
1320
1320
|
category: "Application Connectors",
|
|
1321
1321
|
label: "Gusto",
|
|
1322
|
-
description: "Manage
|
|
1322
|
+
description: "Manage companies, employees, pay schedules, and webhook subscriptions in Gusto.",
|
|
1323
1323
|
iconPath: "icon.png"
|
|
1324
1324
|
},
|
|
1325
1325
|
actions: actions_default,
|