Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@picahq/authkit

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@picahq/authkit - npm Package Compare versions

Comparing version
1.0.4
to
1.0.5
+1
-1
dist/index.esm.js

@@ -1,1 +0,1 @@

function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function n(e,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}function i(e,n,i){return(n=t(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}var o=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"linkTokenEndpoint",void 0),i(this,"linkHeaders",void 0),i(this,"baseUrl",void 0),i(this,"onClose",void 0),i(this,"title",void 0),i(this,"selectedConnection",void 0),i(this,"showNameInput",void 0),i(this,"appTheme",void 0),this.linkTokenEndpoint=t.token.url,this.linkHeaders=t.token.headers,this.baseUrl=t.baseUrl,this.onClose=t.onClose,this.title=t.title,this.selectedConnection=t.selectedConnection,this.showNameInput=t.showNameInput,this.appTheme=t.appTheme},(t=[{key:"_getBaseUrl",value:function(){return this.baseUrl?this.baseUrl:"https://authkit.picaos.com"}},{key:"openLink",value:function(){var e=this,t=document.createElement("iframe"),n=JSON.stringify({linkTokenEndpoint:this.linkTokenEndpoint,linkHeaders:this.linkHeaders,title:this.title,selectedConnection:this.selectedConnection,showNameInput:this.showNameInput,appTheme:this.appTheme}),i=btoa(n),o=new URLSearchParams({data:i}).toString(),r="".concat(this._getBaseUrl(),"?").concat(o);document.body.appendChild(t),t.style.height="100%",t.style.width="100%",t.style.position="fixed",t.style.display="hidden",t.style.visibility="hidden",t.style.zIndex="9999",t.style.backgroundColor="transparent",t.style.inset="0px",t.style.borderWidth="0px",t.id="event-link",t.src=r,t.style.overflow="hidden auto",t.onload=function(){var n;setTimeout((function(){t.style.display="block",t.style.visibility="visible"}),100),null===(n=t.contentWindow)||void 0===n||n.postMessage({linkTokenEndpoint:e.linkTokenEndpoint,linkHeaders:e.linkHeaders,title:e.title,selectedConnection:e.selectedConnection,showNameInput:e.showNameInput,appTheme:e.appTheme},r)}}},{key:"closeLink",value:function(){var e=document.getElementById("event-link");e&&e.remove()}}])&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}(),r=function(t){var n=function(e){return new o(e)}(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){i(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t));"undefined"!=typeof window&&window.addEventListener("message",(function(e){var i,o,r,s,l;if("undefined"!=typeof window){var a,c,d=document.getElementById("event-link");if("block"===(null==d||null===(a=d.style)||void 0===a?void 0:a.display))switch(null===(c=e.data)||void 0===c?void 0:c.messageType){case"EXIT_EVENT_LINK":null===(i=t.onClose)||void 0===i||i.call(t),setTimeout((function(){n.closeLink()}),200);break;case"LINK_SUCCESS":null===(o=t.onSuccess)||void 0===o||o.call(t,null===(r=e.data)||void 0===r?void 0:r.message);break;case"LINK_ERROR":null===(s=t.onError)||void 0===s||s.call(t,null===(l=e.data)||void 0===l?void 0:l.message)}}}));return{open:function(){n.openLink()},close:function(){n.closeLink()}}};export{r as useAuthKit};
function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function n(e,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}function i(e,n,i){return(n=t(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}var o=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"linkTokenEndpoint",void 0),i(this,"linkHeaders",void 0),i(this,"baseUrl",void 0),i(this,"onClose",void 0),i(this,"title",void 0),i(this,"imageUrl",void 0),i(this,"companyName",void 0),i(this,"selectedConnection",void 0),i(this,"showNameInput",void 0),i(this,"appTheme",void 0),this.linkTokenEndpoint=t.token.url,this.linkHeaders=t.token.headers,this.baseUrl=t.baseUrl,this.onClose=t.onClose,this.title=t.title,this.imageUrl=t.imageUrl,this.companyName=t.companyName,this.selectedConnection=t.selectedConnection,this.showNameInput=t.showNameInput,this.appTheme=t.appTheme},(t=[{key:"_getBaseUrl",value:function(){return this.baseUrl?this.baseUrl:"https://authkit.picaos.com"}},{key:"openLink",value:function(){var e=this,t=document.createElement("iframe"),n=JSON.stringify({linkTokenEndpoint:this.linkTokenEndpoint,linkHeaders:this.linkHeaders,title:this.title,imageUrl:this.imageUrl,companyName:this.companyName,selectedConnection:this.selectedConnection,showNameInput:this.showNameInput,appTheme:this.appTheme}),i=btoa(n),o=new URLSearchParams({data:i}).toString(),r="".concat(this._getBaseUrl(),"?").concat(o);document.body.appendChild(t),t.style.height="100%",t.style.width="100%",t.style.position="fixed",t.style.display="hidden",t.style.visibility="hidden",t.style.zIndex="9999",t.style.backgroundColor="transparent",t.style.inset="0px",t.style.borderWidth="0px",t.id="event-link",t.src=r,t.style.overflow="hidden auto",t.onload=function(){var n;setTimeout((function(){t.style.display="block",t.style.visibility="visible"}),100),null===(n=t.contentWindow)||void 0===n||n.postMessage({linkTokenEndpoint:e.linkTokenEndpoint,linkHeaders:e.linkHeaders,title:e.title,imageUrl:e.imageUrl,companyName:e.companyName,selectedConnection:e.selectedConnection,showNameInput:e.showNameInput,appTheme:e.appTheme},r)}}},{key:"closeLink",value:function(){var e=document.getElementById("event-link");e&&e.remove()}}])&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}(),r=function(t){var n=function(e){return new o(e)}(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){i(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t));"undefined"!=typeof window&&window.addEventListener("message",(function(e){var i,o,r,s,a;if("undefined"!=typeof window){var l,c,d=document.getElementById("event-link");if("block"===(null==d||null===(l=d.style)||void 0===l?void 0:l.display))switch(null===(c=e.data)||void 0===c?void 0:c.messageType){case"EXIT_EVENT_LINK":null===(i=t.onClose)||void 0===i||i.call(t),setTimeout((function(){n.closeLink()}),200);break;case"LINK_SUCCESS":null===(o=t.onSuccess)||void 0===o||o.call(t,null===(r=e.data)||void 0===r?void 0:r.message);break;case"LINK_ERROR":null===(s=t.onError)||void 0===s||s.call(t,null===(a=e.data)||void 0===a?void 0:a.message)}}}));return{open:function(){n.openLink()},close:function(){n.closeLink()}}};export{r as useAuthKit};

@@ -1,1 +0,1 @@

"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function n(e,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}function i(e,n,i){return(n=t(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}Object.defineProperty(exports,"__esModule",{value:!0});var o=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"linkTokenEndpoint",void 0),i(this,"linkHeaders",void 0),i(this,"baseUrl",void 0),i(this,"onClose",void 0),i(this,"title",void 0),i(this,"selectedConnection",void 0),i(this,"showNameInput",void 0),i(this,"appTheme",void 0),this.linkTokenEndpoint=t.token.url,this.linkHeaders=t.token.headers,this.baseUrl=t.baseUrl,this.onClose=t.onClose,this.title=t.title,this.selectedConnection=t.selectedConnection,this.showNameInput=t.showNameInput,this.appTheme=t.appTheme},(t=[{key:"_getBaseUrl",value:function(){return this.baseUrl?this.baseUrl:"https://authkit.picaos.com"}},{key:"openLink",value:function(){var e=this,t=document.createElement("iframe"),n=JSON.stringify({linkTokenEndpoint:this.linkTokenEndpoint,linkHeaders:this.linkHeaders,title:this.title,selectedConnection:this.selectedConnection,showNameInput:this.showNameInput,appTheme:this.appTheme}),i=btoa(n),o=new URLSearchParams({data:i}).toString(),r="".concat(this._getBaseUrl(),"?").concat(o);document.body.appendChild(t),t.style.height="100%",t.style.width="100%",t.style.position="fixed",t.style.display="hidden",t.style.visibility="hidden",t.style.zIndex="9999",t.style.backgroundColor="transparent",t.style.inset="0px",t.style.borderWidth="0px",t.id="event-link",t.src=r,t.style.overflow="hidden auto",t.onload=function(){var n;setTimeout((function(){t.style.display="block",t.style.visibility="visible"}),100),null===(n=t.contentWindow)||void 0===n||n.postMessage({linkTokenEndpoint:e.linkTokenEndpoint,linkHeaders:e.linkHeaders,title:e.title,selectedConnection:e.selectedConnection,showNameInput:e.showNameInput,appTheme:e.appTheme},r)}}},{key:"closeLink",value:function(){var e=document.getElementById("event-link");e&&e.remove()}}])&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}();exports.useAuthKit=function(t){var n=function(e){return new o(e)}(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){i(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t));"undefined"!=typeof window&&window.addEventListener("message",(function(e){var i,o,r,s,l;if("undefined"!=typeof window){var a,c,d=document.getElementById("event-link");if("block"===(null==d||null===(a=d.style)||void 0===a?void 0:a.display))switch(null===(c=e.data)||void 0===c?void 0:c.messageType){case"EXIT_EVENT_LINK":null===(i=t.onClose)||void 0===i||i.call(t),setTimeout((function(){n.closeLink()}),200);break;case"LINK_SUCCESS":null===(o=t.onSuccess)||void 0===o||o.call(t,null===(r=e.data)||void 0===r?void 0:r.message);break;case"LINK_ERROR":null===(s=t.onError)||void 0===s||s.call(t,null===(l=e.data)||void 0===l?void 0:l.message)}}}));return{open:function(){n.openLink()},close:function(){n.closeLink()}}};
"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function n(e,n){for(var i=0;i<n.length;i++){var o=n[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,t(o.key),o)}}function i(e,n,i){return(n=t(n))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}Object.defineProperty(exports,"__esModule",{value:!0});var o=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"linkTokenEndpoint",void 0),i(this,"linkHeaders",void 0),i(this,"baseUrl",void 0),i(this,"onClose",void 0),i(this,"title",void 0),i(this,"imageUrl",void 0),i(this,"companyName",void 0),i(this,"selectedConnection",void 0),i(this,"showNameInput",void 0),i(this,"appTheme",void 0),this.linkTokenEndpoint=t.token.url,this.linkHeaders=t.token.headers,this.baseUrl=t.baseUrl,this.onClose=t.onClose,this.title=t.title,this.imageUrl=t.imageUrl,this.companyName=t.companyName,this.selectedConnection=t.selectedConnection,this.showNameInput=t.showNameInput,this.appTheme=t.appTheme},(t=[{key:"_getBaseUrl",value:function(){return this.baseUrl?this.baseUrl:"https://authkit.picaos.com"}},{key:"openLink",value:function(){var e=this,t=document.createElement("iframe"),n=JSON.stringify({linkTokenEndpoint:this.linkTokenEndpoint,linkHeaders:this.linkHeaders,title:this.title,imageUrl:this.imageUrl,companyName:this.companyName,selectedConnection:this.selectedConnection,showNameInput:this.showNameInput,appTheme:this.appTheme}),i=btoa(n),o=new URLSearchParams({data:i}).toString(),r="".concat(this._getBaseUrl(),"?").concat(o);document.body.appendChild(t),t.style.height="100%",t.style.width="100%",t.style.position="fixed",t.style.display="hidden",t.style.visibility="hidden",t.style.zIndex="9999",t.style.backgroundColor="transparent",t.style.inset="0px",t.style.borderWidth="0px",t.id="event-link",t.src=r,t.style.overflow="hidden auto",t.onload=function(){var n;setTimeout((function(){t.style.display="block",t.style.visibility="visible"}),100),null===(n=t.contentWindow)||void 0===n||n.postMessage({linkTokenEndpoint:e.linkTokenEndpoint,linkHeaders:e.linkHeaders,title:e.title,imageUrl:e.imageUrl,companyName:e.companyName,selectedConnection:e.selectedConnection,showNameInput:e.showNameInput,appTheme:e.appTheme},r)}}},{key:"closeLink",value:function(){var e=document.getElementById("event-link");e&&e.remove()}}])&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}();exports.useAuthKit=function(t){var n=function(e){return new o(e)}(function(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){i(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({},t));"undefined"!=typeof window&&window.addEventListener("message",(function(e){var i,o,r,s,l;if("undefined"!=typeof window){var a,c,d=document.getElementById("event-link");if("block"===(null==d||null===(a=d.style)||void 0===a?void 0:a.display))switch(null===(c=e.data)||void 0===c?void 0:c.messageType){case"EXIT_EVENT_LINK":null===(i=t.onClose)||void 0===i||i.call(t),setTimeout((function(){n.closeLink()}),200);break;case"LINK_SUCCESS":null===(o=t.onSuccess)||void 0===o||o.call(t,null===(r=e.data)||void 0===r?void 0:r.message);break;case"LINK_ERROR":null===(s=t.onError)||void 0===s||s.call(t,null===(l=e.data)||void 0===l?void 0:l.message)}}}));return{open:function(){n.openLink()},close:function(){n.closeLink()}}};

@@ -1,81 +0,1 @@

export interface SourceEventLink {
openLink: ({
group,
integrationTypes,
linkTokenEndpoint,
linkHeaders,
}: SourceEventLinkProps) => void;
initialize: ({
baseUrl,
environment,
}: {
baseUrl?: string;
environment?: "sandbox" | "production";
}) => void;
}
export interface DestinationEventLink {
openLink: ({
group,
integrationTypes,
linkTokenEndpoint,
linkHeaders,
}: DestinationEventLinkProps) => void;
initialize: () => void;
}
export type SourceIntegrationTypes =
| "stripe"
| "shopify"
| "adyen"
| "alchemy"
| "checkout.com"
| "circleci"
| "datadog"
| "ftp"
| "github_repos"
| "gitlab"
| "pagerduty"
| "paypal"
| "shipstation"
| "square"
| "webflow"
| "woocommerce";
export type DestinationIntegrationTypes =
| "stripe"
| "bigquery"
| "elasticsearch"
| "firestore"
| "mongodb"
| "postgresql"
| "shopify"
| "webhook";
export interface SourceEventLinkProps {
group: string;
integrationTypes?: SourceIntegrationTypes[];
linkTokenEndpoint: string;
linkHeaders?: Record<string, unknown>;
environment?: "sandbox" | "production";
baseUrl?: string;
title?: string;
onSuccess?: (source?: LinkIntegrationResponse) => void;
onError?: (error: string) => void;
onClose?: () => void;
}
export interface DestinationEventLinkProps {
group: string;
integrationTypes?: DestinationIntegrationTypes[];
linkTokenEndpoint: string;
linkHeaders?: Record<string, unknown>;
environment?: "sandbox" | "production";
baseUrl?: string;
title?: string;
onSuccess?: (destination?: LinkIntegrationResponse) => void;
onError?: (error: string) => void;
onClose?: () => void;
}
export interface EventLinkProps {

@@ -85,2 +5,4 @@ baseUrl?: string;

title?: string;
imageUrl?: string;
companyName?: string;
onClose?: () => void;

@@ -97,14 +19,2 @@ onSuccess?: (connection: ConnectionRecord) => void;

export interface WindowProps {
group: string;
linkTokenEndpoint: string;
connectionType: "source" | "target";
linkHeaders?: Record<string, unknown>;
baseUrl?: string;
environment?: "sandbox" | "production";
title?: string;
onClose?: () => void;
integrationTypes?: string[];
}
export interface EventLinkWindowProps {

@@ -117,2 +27,4 @@ // linkTokenEndpoint: string;

title?: string;
imageUrl?: string;
companyName?: string;
onClose?: () => void;

@@ -127,20 +39,2 @@ selectedConnection?: string;

export interface LinkIntegrationResponse {
_id: string;
label: string;
group: string;
type: string;
connectionType: string;
createdAt: number;
updatedAt?: number;
expiresAt?: number;
createdDate: string;
token: string;
integration: {
id: string;
image: string;
key: string;
};
}
export interface ConnectionRecord {

@@ -177,37 +71,2 @@ _id: string;

}
type XeroScopes =
| "offline_access"
| "accounting.transactions"
| "accounting.settings"
| "accounting.contacts"
| "accounting.attachments"
| "payroll.employees"
| "payroll.payruns"
| "payroll.payslips"
| "payroll.settings"
| "payroll.timesheets"
| "files"
| "assets"
| "projects";
type SageScopes = "full_access" | "full_access_with_payroll";
export type OauthDestinations = "xero";
export type OauthScopes<T> = T extends "xero"
? XeroScopes
: T extends "sage"
? SageScopes
: [];
interface OauthDestinationProps<T extends OauthDestinations> {
scopes: [OauthScopes<T>, ...OauthScopes<T>[]];
type: T;
state?: string;
redirectUri: string;
clientId: string;
}
export interface EventProps {

@@ -214,0 +73,0 @@ data: {

@@ -8,2 +8,4 @@ import { EventLinkWindowProps } from "../types";

private title?;
private imageUrl?;
private companyName?;
private selectedConnection?;

@@ -10,0 +12,0 @@ private showNameInput?;

{
"name": "@picahq/authkit",
"version": "1.0.4",
"version": "1.0.5",
"description": "Frontend bindings for Pica AuthKit",

@@ -66,2 +66,2 @@ "files": [

"homepage": "https://picaos.com"
}
}

@@ -1,81 +0,1 @@

export interface SourceEventLink {
openLink: ({
group,
integrationTypes,
linkTokenEndpoint,
linkHeaders,
}: SourceEventLinkProps) => void;
initialize: ({
baseUrl,
environment,
}: {
baseUrl?: string;
environment?: "sandbox" | "production";
}) => void;
}
export interface DestinationEventLink {
openLink: ({
group,
integrationTypes,
linkTokenEndpoint,
linkHeaders,
}: DestinationEventLinkProps) => void;
initialize: () => void;
}
export type SourceIntegrationTypes =
| "stripe"
| "shopify"
| "adyen"
| "alchemy"
| "checkout.com"
| "circleci"
| "datadog"
| "ftp"
| "github_repos"
| "gitlab"
| "pagerduty"
| "paypal"
| "shipstation"
| "square"
| "webflow"
| "woocommerce";
export type DestinationIntegrationTypes =
| "stripe"
| "bigquery"
| "elasticsearch"
| "firestore"
| "mongodb"
| "postgresql"
| "shopify"
| "webhook";
export interface SourceEventLinkProps {
group: string;
integrationTypes?: SourceIntegrationTypes[];
linkTokenEndpoint: string;
linkHeaders?: Record<string, unknown>;
environment?: "sandbox" | "production";
baseUrl?: string;
title?: string;
onSuccess?: (source?: LinkIntegrationResponse) => void;
onError?: (error: string) => void;
onClose?: () => void;
}
export interface DestinationEventLinkProps {
group: string;
integrationTypes?: DestinationIntegrationTypes[];
linkTokenEndpoint: string;
linkHeaders?: Record<string, unknown>;
environment?: "sandbox" | "production";
baseUrl?: string;
title?: string;
onSuccess?: (destination?: LinkIntegrationResponse) => void;
onError?: (error: string) => void;
onClose?: () => void;
}
export interface EventLinkProps {

@@ -85,2 +5,4 @@ baseUrl?: string;

title?: string;
imageUrl?: string;
companyName?: string;
onClose?: () => void;

@@ -97,14 +19,2 @@ onSuccess?: (connection: ConnectionRecord) => void;

export interface WindowProps {
group: string;
linkTokenEndpoint: string;
connectionType: "source" | "target";
linkHeaders?: Record<string, unknown>;
baseUrl?: string;
environment?: "sandbox" | "production";
title?: string;
onClose?: () => void;
integrationTypes?: string[];
}
export interface EventLinkWindowProps {

@@ -117,2 +27,4 @@ // linkTokenEndpoint: string;

title?: string;
imageUrl?: string;
companyName?: string;
onClose?: () => void;

@@ -127,20 +39,2 @@ selectedConnection?: string;

export interface LinkIntegrationResponse {
_id: string;
label: string;
group: string;
type: string;
connectionType: string;
createdAt: number;
updatedAt?: number;
expiresAt?: number;
createdDate: string;
token: string;
integration: {
id: string;
image: string;
key: string;
};
}
export interface ConnectionRecord {

@@ -177,37 +71,2 @@ _id: string;

}
type XeroScopes =
| "offline_access"
| "accounting.transactions"
| "accounting.settings"
| "accounting.contacts"
| "accounting.attachments"
| "payroll.employees"
| "payroll.payruns"
| "payroll.payslips"
| "payroll.settings"
| "payroll.timesheets"
| "files"
| "assets"
| "projects";
type SageScopes = "full_access" | "full_access_with_payroll";
export type OauthDestinations = "xero";
export type OauthScopes<T> = T extends "xero"
? XeroScopes
: T extends "sage"
? SageScopes
: [];
interface OauthDestinationProps<T extends OauthDestinations> {
scopes: [OauthScopes<T>, ...OauthScopes<T>[]];
type: T;
state?: string;
redirectUri: string;
clientId: string;
}
export interface EventProps {

@@ -214,0 +73,0 @@ data: {

@@ -9,2 +9,4 @@ import { EventLinkWindowProps } from "../types";

private title?: string;
private imageUrl?: string;
private companyName?: string;
private selectedConnection?: string;

@@ -20,2 +22,4 @@ private showNameInput?: boolean;

this.title = props.title;
this.imageUrl = props.imageUrl;
this.companyName = props.companyName;
this.selectedConnection = props.selectedConnection;

@@ -40,2 +44,4 @@ this.showNameInput = props.showNameInput;

title: this.title,
imageUrl: this.imageUrl,
companyName: this.companyName,
selectedConnection: this.selectedConnection,

@@ -76,2 +82,4 @@ showNameInput: this.showNameInput,

title: this.title,
imageUrl: this.imageUrl,
companyName: this.companyName,
selectedConnection: this.selectedConnection,

@@ -78,0 +86,0 @@ showNameInput: this.showNameInput,