skyflow-js 2.4.0 → 2.5.0-beta.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/CHANGELOG.md +4 -0
- package/dist/sdkNodeBuild/index.js +1 -1
- package/dist/sdkNodeBuild/index.js.gz +0 -0
- package/package.json +1 -1
- package/types/core/constants.d.ts +8 -0
- package/types/core/external/collect/collect-container.d.ts +4 -1
- package/types/core/external/reveal/reveal-container.d.ts +4 -1
- package/types/core/external/reveal/reveal-element.d.ts +2 -0
- package/types/core/external/skyflow-container.d.ts +3 -0
- package/types/core/internal/reveal/reveal-frame.d.ts +2 -0
- package/types/core/internal/skyflow-frame/skyflow-frame-controller.d.ts +7 -2
- package/types/core-utils/collect.d.ts +1 -1
- package/types/core-utils/reveal.d.ts +1 -1
- package/types/utils/bus-events/event-wrapper.d.ts +11 -0
- package/types/utils/common/index.d.ts +7 -3
|
Binary file
|
package/package.json
CHANGED
|
@@ -86,7 +86,14 @@ export declare const ELEMENT_EVENTS_TO_CLIENT: {
|
|
|
86
86
|
HEIGHT: string;
|
|
87
87
|
};
|
|
88
88
|
export declare const ELEMENT_EVENTS_TO_IFRAME: {
|
|
89
|
+
REVEAL_CALL_WINDOW_CLIENT_RESPONSES: string;
|
|
90
|
+
REVEAL_CALL_WINDOW_RESPONSE: string;
|
|
91
|
+
REVEAL_CALL_WINDOW_REQUEST: string;
|
|
92
|
+
SKYFLOW_CONTROLLER_READY: string;
|
|
89
93
|
COLLECT_CALL_REQUESTS: string;
|
|
94
|
+
COLLECT_CALL_REQUEST: string;
|
|
95
|
+
COLLECT: string;
|
|
96
|
+
COLLECT_SUCCESS: string;
|
|
90
97
|
REVEAL_CALL_REQUESTS: string;
|
|
91
98
|
FRAME_READY: string;
|
|
92
99
|
READY_FOR_CLIENT: string;
|
|
@@ -104,6 +111,7 @@ export declare const ELEMENT_EVENTS_TO_IFRAME: {
|
|
|
104
111
|
PUREJS_FRAME_READY: string;
|
|
105
112
|
PUREJS_GET_ACCESS_TOKEN: string;
|
|
106
113
|
GET_BEARER_TOKEN: string;
|
|
114
|
+
GET_ACCESS_TOKEN_BACK: string;
|
|
107
115
|
GET_COLLECT_ELEMENT: string;
|
|
108
116
|
GET_REVEAL_ELEMENT: string;
|
|
109
117
|
COLLECT_ELEMENT_SET_ERROR: string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CollectElementInput, CollectElementOptions, CollectResponse, ICollectOptions, UploadFilesResponse } from '../../../utils/common';
|
|
2
2
|
import Container from '../common/container';
|
|
3
3
|
import CollectElement from './collect-element';
|
|
4
|
+
import EventWrapper from '../../../utils/bus-events/event-wrapper';
|
|
4
5
|
declare class CollectContainer extends Container {
|
|
5
6
|
#private;
|
|
6
7
|
type: string;
|
|
7
|
-
|
|
8
|
+
isShadowDom: boolean;
|
|
9
|
+
eventWrapper: EventWrapper;
|
|
10
|
+
constructor(options: any, metaData: any, skyflowElements: any, context: any, isShadowDom?: boolean);
|
|
8
11
|
create: (input: CollectElementInput, options?: CollectElementOptions) => CollectElement;
|
|
9
12
|
collect: (options?: ICollectOptions) => Promise<CollectResponse>;
|
|
10
13
|
uploadFiles: (options: ICollectOptions) => Promise<UploadFilesResponse>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RedactionType, RevealResponse } from '../../../utils/common';
|
|
2
2
|
import Container from '../common/container';
|
|
3
3
|
import RevealElement from './reveal-element';
|
|
4
|
+
import EventWrapper from '../../../utils/bus-events/event-wrapper';
|
|
4
5
|
export interface IRevealElementInput {
|
|
5
6
|
token?: string;
|
|
6
7
|
skyflowID?: string;
|
|
@@ -21,7 +22,9 @@ export interface IRevealElementOptions {
|
|
|
21
22
|
declare class RevealContainer extends Container {
|
|
22
23
|
#private;
|
|
23
24
|
type: string;
|
|
24
|
-
|
|
25
|
+
isShadowDom: boolean;
|
|
26
|
+
eventWrapper: EventWrapper;
|
|
27
|
+
constructor(metaData: any, skyflowElements: any, context: any, options?: {}, isShadowDom?: boolean);
|
|
25
28
|
create(record: IRevealElementInput, options?: IRevealElementOptions): RevealElement;
|
|
26
29
|
reveal(): Promise<RevealResponse>;
|
|
27
30
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Context, RenderFileResponse } from '../../../utils/common';
|
|
2
2
|
import SkyflowElement from '../common/skyflow-element';
|
|
3
3
|
import { IRevealElementInput, IRevealElementOptions } from './reveal-container';
|
|
4
|
+
import EventWrapper from '../../../utils/bus-events/event-wrapper';
|
|
4
5
|
declare class RevealElement extends SkyflowElement {
|
|
5
6
|
#private;
|
|
7
|
+
eventWrapper: EventWrapper;
|
|
6
8
|
constructor(record: IRevealElementInput, options: IRevealElementOptions | undefined, metaData: any, container: any, elementId: string, context: Context);
|
|
7
9
|
getID(): string;
|
|
8
10
|
mount(domElementSelector: HTMLElement | string): void;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { IDetokenizeInput, IGetInput, IGetByIdInput, IInsertOptions, IDeleteOptions, IDeleteRecordInput, IGetOptions, InsertResponse, GetByIdResponse, GetResponse, DeleteResponse, IInsertRecordInput, DetokenizeResponse } from '../../utils/common';
|
|
2
|
+
import EventWrapper from '../../utils/bus-events/event-wrapper';
|
|
2
3
|
declare class SkyflowContainer {
|
|
3
4
|
#private;
|
|
4
5
|
isControllerFrameReady: boolean;
|
|
6
|
+
eventWrapper: EventWrapper;
|
|
7
|
+
skyflowFrameControllerName: string;
|
|
5
8
|
constructor(client: any, context: any);
|
|
6
9
|
detokenize(detokenizeInput: IDetokenizeInput): Promise<DetokenizeResponse>;
|
|
7
10
|
insert(records: IInsertRecordInput, options?: IInsertOptions): Promise<InsertResponse>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import EventWrapper from '../../../utils/bus-events/event-wrapper';
|
|
1
2
|
declare class RevealFrame {
|
|
2
3
|
#private;
|
|
3
4
|
static revealFrame: RevealFrame;
|
|
4
5
|
private domCopy?;
|
|
5
6
|
private isRevealCalled?;
|
|
7
|
+
eventWrapper: EventWrapper;
|
|
6
8
|
static init(): void;
|
|
7
9
|
constructor(record: any, context: any, id: any);
|
|
8
10
|
private getExtension;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { IRevealRecord } from '../../../utils/common';
|
|
2
|
+
import EventWrapper from '../../../utils/bus-events/event-wrapper';
|
|
2
3
|
declare class SkyflowFrameController {
|
|
3
4
|
#private;
|
|
5
|
+
eventWrapper: EventWrapper;
|
|
4
6
|
constructor(clientId: string);
|
|
5
7
|
static init(clientId: any): SkyflowFrameController;
|
|
6
|
-
revealData(revealRecords: IRevealRecord[], containerId: any): Promise<unknown>;
|
|
8
|
+
revealData(revealRecords: IRevealRecord[], containerId: any, bearerToken: string, type?: string): Promise<unknown>;
|
|
7
9
|
insertData(records: any, options: any): Promise<unknown>;
|
|
8
10
|
renderFile(data: any, iframeName: any): Promise<unknown>;
|
|
9
|
-
tokenize: (options: any) => Promise<unknown>;
|
|
11
|
+
tokenize: (options: any, bearerToken: any) => Promise<unknown>;
|
|
10
12
|
parallelUploadFiles: (options: any) => Promise<unknown>;
|
|
11
13
|
uploadFiles: (fileElement: any) => Promise<unknown>;
|
|
14
|
+
private handleCollectMessage;
|
|
15
|
+
handleRevealMessage: (event: MessageEvent) => void;
|
|
16
|
+
private sendCollectResponse;
|
|
12
17
|
}
|
|
13
18
|
export default SkyflowFrameController;
|
|
@@ -27,6 +27,6 @@ export declare const constructElementsInsertReq: (req: any, update: any, options
|
|
|
27
27
|
updateRecords: IInsertRecord[];
|
|
28
28
|
records?: undefined;
|
|
29
29
|
})[];
|
|
30
|
-
export declare const updateRecordsBySkyflowID: (skyflowIdRecords: any, client: Client, options: any) => Promise<unknown>;
|
|
30
|
+
export declare const updateRecordsBySkyflowID: (skyflowIdRecords: any, client: Client, options: any, bearerToken: any) => Promise<unknown>;
|
|
31
31
|
export declare const checkForElementMatchRule: (validations: IValidationRule[]) => boolean;
|
|
32
32
|
export declare const checkForValueMatch: (validations: IValidationRule[], element: IFrameFormElement) => boolean;
|
|
@@ -2,7 +2,7 @@ import Client from '../client';
|
|
|
2
2
|
import { IRevealRecord, IRevealResponseType, IGetRecord, ISkyflowIdRecord, IRenderResponseType, IGetOptions, RenderFileResponse } from '../utils/common';
|
|
3
3
|
export declare const getFileURLForRender: (skyflowIdRecord: IRevealRecord, client: Client, authToken: string) => Promise<any>;
|
|
4
4
|
export declare const getFileURLFromVaultBySkyflowID: (skyflowIdRecord: IRevealRecord, client: Client) => Promise<IRenderResponseType>;
|
|
5
|
-
export declare const fetchRecordsByTokenId: (tokenIdRecords: IRevealRecord[], client: Client) => Promise<IRevealResponseType>;
|
|
5
|
+
export declare const fetchRecordsByTokenId: (tokenIdRecords: IRevealRecord[], client: Client, bearerToken: string, type?: string) => Promise<IRevealResponseType>;
|
|
6
6
|
export declare const formatRecordsForIframe: (response: IRevealResponseType) => Record<string, string>;
|
|
7
7
|
export declare const formatRecordsForRender: (response: IRenderResponseType, column: any, skyflowID: any) => {
|
|
8
8
|
column: any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FramebusOnHandler, FramebusReplyHandler } from 'framebus/dist/lib/types';
|
|
2
|
+
declare class EventWrapper {
|
|
3
|
+
private listeners;
|
|
4
|
+
private isDestroyed;
|
|
5
|
+
private isShadowMode;
|
|
6
|
+
constructor(isShadowMode?: boolean);
|
|
7
|
+
on(eventName: string, callback: FramebusOnHandler, isShadowMode: boolean, skyflowFrameName: any, messageHandler: (event: MessageEvent) => void): void;
|
|
8
|
+
off(eventName: string, callback: FramebusOnHandler, isShadowMode: boolean): void;
|
|
9
|
+
emit(eventName: string, data: any, callback?: FramebusReplyHandler, isShadowMode?: boolean, skyflowFrameName?: string, window?: Window, parent?: boolean): void;
|
|
10
|
+
}
|
|
11
|
+
export default EventWrapper;
|
|
@@ -235,9 +235,9 @@ export interface CollectElementOptions {
|
|
|
235
235
|
maskingChar?: string;
|
|
236
236
|
}
|
|
237
237
|
export interface CardMetadata {
|
|
238
|
-
scheme
|
|
238
|
+
scheme?: CardType[];
|
|
239
239
|
}
|
|
240
|
-
|
|
240
|
+
interface CollectElementCommonProps {
|
|
241
241
|
table?: string;
|
|
242
242
|
column?: string;
|
|
243
243
|
label?: string;
|
|
@@ -249,7 +249,10 @@ export interface CollectElementUpdateOptions {
|
|
|
249
249
|
validations?: IValidationRule[];
|
|
250
250
|
skyflowID?: string;
|
|
251
251
|
}
|
|
252
|
-
export interface
|
|
252
|
+
export interface CollectElementUpdateOptions extends CollectElementCommonProps {
|
|
253
|
+
cardMetadata?: CardMetadata;
|
|
254
|
+
}
|
|
255
|
+
export interface CollectElementInput extends CollectElementCommonProps {
|
|
253
256
|
type: ElementType;
|
|
254
257
|
}
|
|
255
258
|
export interface ICollectOptions {
|
|
@@ -294,3 +297,4 @@ export interface ElementState {
|
|
|
294
297
|
isRequired: boolean;
|
|
295
298
|
selectedCardScheme?: string;
|
|
296
299
|
}
|
|
300
|
+
export {};
|