@front-finance/link
Advanced tools
Comparing version 1.1.6 to 1.1.7
import { FrontOptions, FrontConnection } from './utils/types'; | ||
export declare const createFrontConnection: (options: FrontOptions) => FrontConnection; |
@@ -48,3 +48,3 @@ "use strict"; | ||
function eventsListener(event) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
switch (event.data.type) { | ||
@@ -109,2 +109,3 @@ case 'brokerageAccountAccessToken': { | ||
} | ||
(_l = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onEvent) === null || _l === void 0 ? void 0 : _l.call(currentOptions, { type: 'pageLoaded' }); | ||
break; | ||
@@ -114,3 +115,3 @@ } | ||
if ((0, event_types_1.isFrontEventTypeKey)(event.data.type)) { | ||
(_l = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onEvent) === null || _l === void 0 ? void 0 : _l.call(currentOptions, event.data); | ||
(_m = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onEvent) === null || _m === void 0 ? void 0 : _m.call(currentOptions, event.data); | ||
} | ||
@@ -146,3 +147,3 @@ break; | ||
currentOptions = options; | ||
linkUrl = Buffer.from(linkToken, 'base64').toString(); | ||
linkUrl = window.atob(linkToken); | ||
iframeUrlObject = new URL(linkUrl); | ||
@@ -149,0 +150,0 @@ window.removeEventListener('message', eventsListener); |
export * from './utils/types'; | ||
export * from './utils/event-types'; | ||
export { createFrontConnection } from './FrontConnection'; |
@@ -0,0 +0,0 @@ "use strict"; |
import { FrontPayload, TransferFinishedPayload } from './types'; | ||
export type FrontEventType = IntegrationConnected | IntegrationConnectionError | TransferCompleted | IntegrationSelected | CredentialsEntered | TransferStarted | TransferPreviewed | TransferPreviewError | TransferExecutionError; | ||
declare const FRONT_EVENT_TYPE_KEYS: readonly ["integrationConnected", "integrationConnectionError", "transferCompleted", "integrationSelected", "credentialsEntered", "transferStarted", "transferPreviewed", "transferPreviewError", "transferExecutionError"]; | ||
export type FrontEventType = IntegrationConnected | IntegrationConnectionError | TransferCompleted | IntegrationSelected | CredentialsEntered | TransferStarted | TransferPreviewed | TransferPreviewError | TransferExecutionError | PageLoaded; | ||
declare const FRONT_EVENT_TYPE_KEYS: readonly ["integrationConnected", "integrationConnectionError", "transferCompleted", "integrationSelected", "credentialsEntered", "transferStarted", "transferPreviewed", "transferPreviewError", "transferExecutionError", "pageLoaded"]; | ||
export type FrontEventTypeKeys = (typeof FRONT_EVENT_TYPE_KEYS)[number]; | ||
@@ -9,2 +9,5 @@ export declare function isFrontEventTypeKey(key: string): key is FrontEventTypeKeys; | ||
} | ||
export interface PageLoaded { | ||
type: 'pageLoaded'; | ||
} | ||
export interface IntegrationConnected extends FrontEventBase { | ||
@@ -11,0 +14,0 @@ type: 'integrationConnected'; |
@@ -13,3 +13,4 @@ "use strict"; | ||
'transferPreviewError', | ||
'transferExecutionError' | ||
'transferExecutionError', | ||
'pageLoaded' | ||
]; | ||
@@ -16,0 +17,0 @@ function isFrontEventTypeKey(key) { |
export declare const iframeId = "front-link-popup__iframe"; | ||
export declare function removePopup(): void; | ||
export declare function addPopup(iframeLink: string): void; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import type { BrokerType } from '@front-finance/api'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
import { FrontOptions, FrontConnection } from './utils/types'; | ||
export declare const createFrontConnection: (options: FrontOptions) => FrontConnection; |
@@ -45,3 +45,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function eventsListener(event) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
switch (event.data.type) { | ||
@@ -106,2 +106,3 @@ case 'brokerageAccountAccessToken': { | ||
} | ||
(_l = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onEvent) === null || _l === void 0 ? void 0 : _l.call(currentOptions, { type: 'pageLoaded' }); | ||
break; | ||
@@ -111,3 +112,3 @@ } | ||
if (isFrontEventTypeKey(event.data.type)) { | ||
(_l = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onEvent) === null || _l === void 0 ? void 0 : _l.call(currentOptions, event.data); | ||
(_m = currentOptions === null || currentOptions === void 0 ? void 0 : currentOptions.onEvent) === null || _m === void 0 ? void 0 : _m.call(currentOptions, event.data); | ||
} | ||
@@ -143,3 +144,3 @@ break; | ||
currentOptions = options; | ||
linkUrl = Buffer.from(linkToken, 'base64').toString(); | ||
linkUrl = window.atob(linkToken); | ||
iframeUrlObject = new URL(linkUrl); | ||
@@ -146,0 +147,0 @@ window.removeEventListener('message', eventsListener); |
export * from './utils/types'; | ||
export * from './utils/event-types'; | ||
export { createFrontConnection } from './FrontConnection'; |
export * from './utils/types'; | ||
export * from './utils/event-types'; | ||
export { createFrontConnection } from './FrontConnection'; |
{ | ||
"name": "@front-finance/link", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"description": "Front Finance accounts connection client lib", | ||
@@ -9,3 +9,2 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "^29.5.4", | ||
"@typescript-eslint/eslint-plugin": "^4.21.0", | ||
@@ -17,7 +16,8 @@ "@typescript-eslint/parser": "^4.21.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"jest": "^29.6.4", | ||
"jest-environment-jsdom": "^29.6.4", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.6.4", | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^4.6.4" | ||
"jest": "^29.6.4", | ||
"@types/jest": "^29.5.4", | ||
"jest-environment-jsdom": "^29.6.4" | ||
}, | ||
@@ -43,2 +43,2 @@ "dependencies": {}, | ||
"types": "index.d.ts" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # @front-finance/link |
import { FrontPayload, TransferFinishedPayload } from './types'; | ||
export type FrontEventType = IntegrationConnected | IntegrationConnectionError | TransferCompleted | IntegrationSelected | CredentialsEntered | TransferStarted | TransferPreviewed | TransferPreviewError | TransferExecutionError; | ||
declare const FRONT_EVENT_TYPE_KEYS: readonly ["integrationConnected", "integrationConnectionError", "transferCompleted", "integrationSelected", "credentialsEntered", "transferStarted", "transferPreviewed", "transferPreviewError", "transferExecutionError"]; | ||
export type FrontEventType = IntegrationConnected | IntegrationConnectionError | TransferCompleted | IntegrationSelected | CredentialsEntered | TransferStarted | TransferPreviewed | TransferPreviewError | TransferExecutionError | PageLoaded; | ||
declare const FRONT_EVENT_TYPE_KEYS: readonly ["integrationConnected", "integrationConnectionError", "transferCompleted", "integrationSelected", "credentialsEntered", "transferStarted", "transferPreviewed", "transferPreviewError", "transferExecutionError", "pageLoaded"]; | ||
export type FrontEventTypeKeys = (typeof FRONT_EVENT_TYPE_KEYS)[number]; | ||
@@ -9,2 +9,5 @@ export declare function isFrontEventTypeKey(key: string): key is FrontEventTypeKeys; | ||
} | ||
export interface PageLoaded { | ||
type: 'pageLoaded'; | ||
} | ||
export interface IntegrationConnected extends FrontEventBase { | ||
@@ -11,0 +14,0 @@ type: 'integrationConnected'; |
@@ -10,3 +10,4 @@ var FRONT_EVENT_TYPE_KEYS = [ | ||
'transferPreviewError', | ||
'transferExecutionError' | ||
'transferExecutionError', | ||
'pageLoaded' | ||
]; | ||
@@ -13,0 +14,0 @@ export function isFrontEventTypeKey(key) { |
export declare const iframeId = "front-link-popup__iframe"; | ||
export declare function removePopup(): void; | ||
export declare function addPopup(iframeLink: string): void; |
@@ -0,0 +0,0 @@ var popupId = 'front-link-popup'; |
@@ -0,0 +0,0 @@ import type { BrokerType } from '@front-finance/api'; |
export {}; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
47127
844
0