skyflow-js 2.5.0-beta.8 → 2.5.0
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/README.md +142 -1
- package/dist/sdkNodeBuild/index.js +1 -1
- package/dist/sdkNodeBuild/index.js.gz +0 -0
- package/package.json +1 -1
- package/types/client/index.d.ts +9 -7
- package/types/core/constants.d.ts +2 -26
- package/types/core/external/collect/collect-container.d.ts +29 -3
- package/types/core/external/collect/collect-element.d.ts +5 -2
- package/types/core/external/collect/compose-collect-container.d.ts +8 -3
- package/types/core/external/collect/compose-collect-element.d.ts +3 -3
- package/types/core/external/common/iframe.d.ts +5 -3
- package/types/core/external/common/skyflow-element.d.ts +7 -7
- package/types/core/external/reveal/reveal-container.d.ts +3 -2
- package/types/core/external/reveal/reveal-element.d.ts +2 -1
- package/types/core/external/skyflow-container.d.ts +4 -2
- package/types/core/internal/frame-element-init.d.ts +0 -11
- package/types/core/internal/iframe-form/index.d.ts +0 -5
- package/types/core/internal/index.d.ts +1 -2
- package/types/core/internal/internal-types/index.d.ts +72 -0
- package/types/core/internal/reveal/reveal-frame.d.ts +1 -6
- package/types/core/internal/skyflow-frame/skyflow-frame-controller.d.ts +11 -8
- package/types/core-utils/collect.d.ts +10 -7
- package/types/core-utils/delete.d.ts +2 -2
- package/types/core-utils/reveal.d.ts +4 -31
- package/types/index-node.d.ts +1 -1
- package/types/libs/element-options.d.ts +4 -2
- package/types/libs/jss-styles.d.ts +1 -1
- package/types/skyflow.d.ts +11 -6
- package/types/utils/bus-events/index.d.ts +1 -1
- package/types/utils/common/index.d.ts +22 -21
- package/types/utils/constants.d.ts +44 -8
- package/types/utils/helpers/index.d.ts +8 -8
- package/types/utils/logs.d.ts +14 -5
- package/types/utils/validators/index.d.ts +4 -3
- package/types/core/external/reveal/composable-reveal-container.d.ts +0 -14
- package/types/core/external/reveal/composable-reveal-element.d.ts +0 -12
- package/types/core/external/reveal/composable-reveal-internal.d.ts +0 -29
- package/types/core/internal/composable-frame-element-init.d.ts +0 -21
|
Binary file
|
package/package.json
CHANGED
package/types/client/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ISkyflow } from '../skyflow';
|
|
2
|
+
import { ClientMetadata } from '../core/internal/internal-types';
|
|
2
3
|
export interface IClientRequest {
|
|
3
|
-
body?:
|
|
4
|
+
body?: Document | XMLHttpRequestBodyInit | null;
|
|
4
5
|
headers?: Record<string, string>;
|
|
5
6
|
requestMethod: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'PATCH';
|
|
6
7
|
url: string;
|
|
@@ -9,15 +10,16 @@ export interface SdkInfo {
|
|
|
9
10
|
sdkName: string;
|
|
10
11
|
sdkVersion: string;
|
|
11
12
|
}
|
|
13
|
+
export interface ClientToJSON {
|
|
14
|
+
config: ISkyflow;
|
|
15
|
+
metaData: ClientMetadata;
|
|
16
|
+
}
|
|
12
17
|
declare class Client {
|
|
13
18
|
#private;
|
|
14
19
|
config: ISkyflow;
|
|
15
|
-
constructor(config: ISkyflow, metadata:
|
|
16
|
-
toJSON():
|
|
17
|
-
|
|
18
|
-
metaData: any;
|
|
19
|
-
};
|
|
20
|
-
static fromJSON(json: any): Client;
|
|
20
|
+
constructor(config: ISkyflow, metadata: ClientMetadata);
|
|
21
|
+
toJSON(): ClientToJSON;
|
|
22
|
+
static fromJSON(json: ClientToJSON): Client;
|
|
21
23
|
request: (request: IClientRequest) => Promise<unknown>;
|
|
22
24
|
}
|
|
23
25
|
export default Client;
|
|
@@ -9,12 +9,10 @@ export declare const SDK_IFRAME_EVENT = "SDK IFRAME EVENT";
|
|
|
9
9
|
export declare const DOMAIN = "US2";
|
|
10
10
|
export declare const CORALOGIX_DOMAIN = "https://cdn.rum-ingress-coralogix.com/coralogix/browser/latest/coralogix-browser-sdk.js";
|
|
11
11
|
export declare const FRAME_ELEMENT = "element";
|
|
12
|
-
export declare const COMPOSABLE_REVEAL = "reveal-composable";
|
|
13
12
|
export declare const ELEMENT_TYPES: {
|
|
14
13
|
COLLECT: string;
|
|
15
14
|
REVEAL: string;
|
|
16
15
|
COMPOSE: string;
|
|
17
|
-
REVEAL_COMPOSE: string;
|
|
18
16
|
};
|
|
19
17
|
export declare const EVENT_TYPES: {
|
|
20
18
|
MOUNTED: string;
|
|
@@ -32,7 +30,6 @@ export declare const METRIC_TYPES: {
|
|
|
32
30
|
COLLECT: string;
|
|
33
31
|
REVEAL: string;
|
|
34
32
|
COMPOSE: string;
|
|
35
|
-
REVEAL_COMPOSE: string;
|
|
36
33
|
};
|
|
37
34
|
ELEMENT_TYPE_KEY: string;
|
|
38
35
|
DIV_ID: string;
|
|
@@ -65,6 +62,7 @@ export declare const PUREJS_TYPES: {
|
|
|
65
62
|
GET_BY_SKYFLOWID: string;
|
|
66
63
|
GET: string;
|
|
67
64
|
DELETE: string;
|
|
65
|
+
UPDATE: string;
|
|
68
66
|
};
|
|
69
67
|
export declare const COLLECT_TYPES: {
|
|
70
68
|
COLLECT: string;
|
|
@@ -89,19 +87,8 @@ export declare const ELEMENT_EVENTS_TO_CLIENT: {
|
|
|
89
87
|
HEIGHT: string;
|
|
90
88
|
};
|
|
91
89
|
export declare const ELEMENT_EVENTS_TO_IFRAME: {
|
|
92
|
-
MULTIPLE_UPLOAD_FILES_RESPONSE: string;
|
|
93
|
-
RENDER_MOUNTED: string;
|
|
94
|
-
HEIGHT_CALLBACK: string;
|
|
95
|
-
HEIGHT_CALLBACK_COMPOSABLE: string;
|
|
96
|
-
COMPOSABLE_REVEAL: string;
|
|
97
|
-
MULTIPLE_UPLOAD_FILES: string;
|
|
98
90
|
COLLECT_CALL_REQUESTS: string;
|
|
99
|
-
COMPOSABLE_CALL_REQUESTS: string;
|
|
100
|
-
COMPOSABLE_CALL_RESPONSE: string;
|
|
101
|
-
COMPOSABLE_FILE_CALL_RESPONSE: string;
|
|
102
|
-
COMPOSABLE_CONTAINER: string;
|
|
103
91
|
REVEAL_CALL_REQUESTS: string;
|
|
104
|
-
REVEAL_CALL_RESPONSE: string;
|
|
105
92
|
FRAME_READY: string;
|
|
106
93
|
READY_FOR_CLIENT: string;
|
|
107
94
|
TOKENIZATION_REQUEST: string;
|
|
@@ -154,8 +141,7 @@ export declare enum ElementType {
|
|
|
154
141
|
PIN = "PIN",
|
|
155
142
|
EXPIRATION_MONTH = "EXPIRATION_MONTH",
|
|
156
143
|
EXPIRATION_YEAR = "EXPIRATION_YEAR",
|
|
157
|
-
FILE_INPUT = "FILE_INPUT"
|
|
158
|
-
MULTI_FILE_INPUT = "MULTI_FILE_INPUT"
|
|
144
|
+
FILE_INPUT = "FILE_INPUT"
|
|
159
145
|
}
|
|
160
146
|
export declare enum CardType {
|
|
161
147
|
VISA = "VISA",
|
|
@@ -337,14 +323,6 @@ export declare const ELEMENTS: {
|
|
|
337
323
|
type: string;
|
|
338
324
|
};
|
|
339
325
|
};
|
|
340
|
-
MULTI_FILE_INPUT: {
|
|
341
|
-
name: string;
|
|
342
|
-
sensitive: boolean;
|
|
343
|
-
attributes: {
|
|
344
|
-
type: string;
|
|
345
|
-
multiple: string;
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
326
|
};
|
|
349
327
|
export declare const CARDNUMBER_INPUT_FORMAT: {
|
|
350
328
|
SPACE_FORMAT: string;
|
|
@@ -573,7 +551,6 @@ export declare const DEFAULT_ERROR_TEXT_ELEMENT_TYPES: {
|
|
|
573
551
|
EXPIRATION_MONTH: string;
|
|
574
552
|
EXPIRATION_YEAR: string;
|
|
575
553
|
FILE_INPUT: string;
|
|
576
|
-
MULTI_FILE_INPUT: string;
|
|
577
554
|
};
|
|
578
555
|
export declare const DEFAULT_REQUIRED_TEXT_ELEMENT_TYPES: {
|
|
579
556
|
CVV: string;
|
|
@@ -585,7 +562,6 @@ export declare const DEFAULT_REQUIRED_TEXT_ELEMENT_TYPES: {
|
|
|
585
562
|
EXPIRATION_MONTH: string;
|
|
586
563
|
EXPIRATION_YEAR: string;
|
|
587
564
|
FILE_INPUT: string;
|
|
588
|
-
MULTI_FILE_INPUT: string;
|
|
589
565
|
};
|
|
590
566
|
export declare const INPUT_KEYBOARD_EVENTS: {
|
|
591
567
|
ENTER: string;
|
|
@@ -1,12 +1,38 @@
|
|
|
1
|
-
import { CollectElementInput, CollectElementOptions, CollectResponse, ICollectOptions, UploadFilesResponse } from '../../../utils/common';
|
|
1
|
+
import { Context, CollectElementInput, CollectElementOptions, CollectResponse, ICollectOptions, UploadFilesResponse, ContainerOptions } from '../../../utils/common';
|
|
2
|
+
import { ElementType } from '../../constants';
|
|
2
3
|
import Container from '../common/container';
|
|
3
4
|
import CollectElement from './collect-element';
|
|
5
|
+
import { Metadata, SkyflowElementProps } from '../../internal/internal-types';
|
|
6
|
+
export interface ICollectElement {
|
|
7
|
+
elementType: ElementType;
|
|
8
|
+
elementName: string;
|
|
9
|
+
name: string;
|
|
10
|
+
table?: string;
|
|
11
|
+
column?: string;
|
|
12
|
+
sensitive?: boolean;
|
|
13
|
+
replacePattern?: RegExp;
|
|
14
|
+
mask?: string[];
|
|
15
|
+
value?: string;
|
|
16
|
+
isMounted: boolean;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface ElementGroupItem extends CollectElementInput, CollectElementOptions {
|
|
20
|
+
elementType: ElementType;
|
|
21
|
+
name?: string;
|
|
22
|
+
accept?: string[];
|
|
23
|
+
elementName?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ElementGroup {
|
|
26
|
+
rows: Array<{
|
|
27
|
+
elements: Array<ElementGroupItem>;
|
|
28
|
+
}>;
|
|
29
|
+
}
|
|
4
30
|
declare class CollectContainer extends Container {
|
|
5
31
|
#private;
|
|
6
32
|
type: string;
|
|
7
|
-
constructor(
|
|
33
|
+
constructor(metaData: Metadata, skyflowElements: Array<SkyflowElementProps>, context: Context, options?: ContainerOptions);
|
|
8
34
|
create: (input: CollectElementInput, options?: CollectElementOptions) => CollectElement;
|
|
9
35
|
collect: (options?: ICollectOptions) => Promise<CollectResponse>;
|
|
10
|
-
uploadFiles: (options
|
|
36
|
+
uploadFiles: (options?: ICollectOptions) => Promise<UploadFilesResponse>;
|
|
11
37
|
}
|
|
12
38
|
export default CollectContainer;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import EventEmitter from '../../../event-emitter';
|
|
2
2
|
import { CollectElementUpdateOptions, Context } from '../../../utils/common';
|
|
3
3
|
import SkyflowElement from '../common/skyflow-element';
|
|
4
|
+
import { Metadata, ContainerProps } from '../../internal/internal-types';
|
|
4
5
|
declare class CollectElement extends SkyflowElement {
|
|
5
6
|
#private;
|
|
6
7
|
elementType: string;
|
|
7
8
|
type: string;
|
|
8
9
|
containerId: string;
|
|
9
10
|
resizeObserver: ResizeObserver | null;
|
|
10
|
-
constructor(elementId: string, elementGroup: any, metaData:
|
|
11
|
+
constructor(elementId: string, elementGroup: any, metaData: Metadata, container: ContainerProps, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
|
|
11
12
|
getID: () => string;
|
|
12
13
|
mount: (domElement: HTMLElement | string) => void;
|
|
13
14
|
unmount: () => void;
|
|
14
15
|
updateElementGroup: (group: any) => void;
|
|
15
|
-
updateElement: (elementOptions:
|
|
16
|
+
updateElement: (elementOptions: {
|
|
17
|
+
elementName: string;
|
|
18
|
+
} & CollectElementUpdateOptions) => void;
|
|
16
19
|
update: (options: CollectElementUpdateOptions) => void;
|
|
17
20
|
getState: () => {
|
|
18
21
|
isEmpty: boolean;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { CollectElementInput, CollectElementOptions, ICollectOptions, CollectResponse,
|
|
1
|
+
import { Context, CollectElementInput, CollectElementOptions, ICollectOptions, CollectResponse, InputStyles, ErrorTextStyles, ContainerOptions } from '../../../utils/common';
|
|
2
2
|
import Container from '../common/container';
|
|
3
3
|
import ComposableElement from './compose-collect-element';
|
|
4
|
+
import { ElementGroup } from './collect-container';
|
|
5
|
+
import { Metadata, SkyflowElementProps } from '../../internal/internal-types';
|
|
6
|
+
export interface ComposableElementGroup extends ElementGroup {
|
|
7
|
+
styles: InputStyles;
|
|
8
|
+
errorTextStyles: ErrorTextStyles;
|
|
9
|
+
}
|
|
4
10
|
declare class ComposableContainer extends Container {
|
|
5
11
|
#private;
|
|
6
12
|
type: string;
|
|
7
|
-
constructor(
|
|
13
|
+
constructor(metaData: Metadata, skyflowElements: Array<SkyflowElementProps>, context: Context, options: ContainerOptions);
|
|
8
14
|
create: (input: CollectElementInput, options?: CollectElementOptions) => ComposableElement;
|
|
9
15
|
on: (eventName: string, handler: Function) => void;
|
|
10
16
|
mount: (domElement: HTMLElement | string) => void;
|
|
11
17
|
unmount: () => void;
|
|
12
18
|
collect: (options?: ICollectOptions) => Promise<CollectResponse>;
|
|
13
|
-
uploadFiles: (options: ICollectOptions) => Promise<UploadFilesResponse>;
|
|
14
19
|
}
|
|
15
20
|
export default ComposableContainer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import EventEmitter from '../../../event-emitter';
|
|
2
|
+
import { CollectElementUpdateOptions } from '../../../utils/common';
|
|
2
3
|
declare class ComposableElement {
|
|
3
4
|
#private;
|
|
4
5
|
type: string;
|
|
5
|
-
constructor(name:
|
|
6
|
+
constructor(name: string, eventEmitter: EventEmitter, iframeName: string);
|
|
6
7
|
on(eventName: string, handler: Function): void;
|
|
7
8
|
iframeName(): string;
|
|
8
9
|
getID(): string;
|
|
9
10
|
update: (options: CollectElementUpdateOptions) => void;
|
|
10
|
-
uploadMultipleFiles: (metaData?: MetaData) => Promise<unknown>;
|
|
11
11
|
}
|
|
12
12
|
export default ComposableElement;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { LogLevel } from '../../../index-node';
|
|
2
|
+
import { Metadata } from '../../internal/internal-types';
|
|
1
3
|
export default class IFrame {
|
|
2
4
|
name: string;
|
|
3
|
-
metadata:
|
|
5
|
+
metadata: Metadata;
|
|
4
6
|
iframe: HTMLIFrameElement;
|
|
5
7
|
container?: Element;
|
|
6
|
-
constructor(name:
|
|
7
|
-
mount: (domElement:
|
|
8
|
+
constructor(name: string, metadata: Metadata, containerId: string, logLevel: LogLevel);
|
|
9
|
+
mount: (domElement: HTMLElement | string, elementId?: string, data?: any) => void;
|
|
8
10
|
setIframeHeight: (height: any) => void;
|
|
9
11
|
unmount: () => void;
|
|
10
12
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare abstract class SkyflowElement {
|
|
2
|
-
abstract mount(domElementSelector:
|
|
3
|
-
abstract unmount():
|
|
4
|
-
abstract setError(clientErrorText: string):
|
|
5
|
-
abstract resetError():
|
|
6
|
-
abstract setErrorOverride(customErrorText: string):
|
|
7
|
-
abstract iframeName():
|
|
8
|
-
abstract getID():
|
|
2
|
+
abstract mount(domElementSelector: HTMLElement | string): void;
|
|
3
|
+
abstract unmount(): void;
|
|
4
|
+
abstract setError(clientErrorText: string): void;
|
|
5
|
+
abstract resetError(): void;
|
|
6
|
+
abstract setErrorOverride(customErrorText: string): void;
|
|
7
|
+
abstract iframeName(): string;
|
|
8
|
+
abstract getID(): string;
|
|
9
9
|
}
|
|
10
10
|
export default SkyflowElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { RedactionType, RevealResponse } from '../../../utils/common';
|
|
1
|
+
import { ContainerOptions, Context, RedactionType, RevealResponse } from '../../../utils/common';
|
|
2
2
|
import Container from '../common/container';
|
|
3
3
|
import RevealElement from './reveal-element';
|
|
4
|
+
import { Metadata, SkyflowElementProps } from '../../internal/internal-types';
|
|
4
5
|
export interface IRevealElementInput {
|
|
5
6
|
token?: string;
|
|
6
7
|
skyflowID?: string;
|
|
@@ -21,7 +22,7 @@ export interface IRevealElementOptions {
|
|
|
21
22
|
declare class RevealContainer extends Container {
|
|
22
23
|
#private;
|
|
23
24
|
type: string;
|
|
24
|
-
constructor(metaData:
|
|
25
|
+
constructor(metaData: Metadata, skyflowElements: Array<SkyflowElementProps>, context: Context, options?: ContainerOptions);
|
|
25
26
|
create(record: IRevealElementInput, options?: IRevealElementOptions): RevealElement;
|
|
26
27
|
reveal(): Promise<RevealResponse>;
|
|
27
28
|
}
|
|
@@ -1,9 +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 { Metadata, RevealContainerProps } from '../../internal/internal-types';
|
|
4
5
|
declare class RevealElement extends SkyflowElement {
|
|
5
6
|
#private;
|
|
6
|
-
constructor(record: IRevealElementInput, options: IRevealElementOptions | undefined, metaData:
|
|
7
|
+
constructor(record: IRevealElementInput, options: IRevealElementOptions | undefined, metaData: Metadata, container: RevealContainerProps, elementId: string, context: Context);
|
|
7
8
|
getID(): string;
|
|
8
9
|
mount(domElementSelector: HTMLElement | string): void;
|
|
9
10
|
renderFile(): Promise<RenderFileResponse>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Client from '../../client';
|
|
2
|
+
import { IDetokenizeInput, IGetInput, Context, IGetByIdInput, IInsertOptions, IDeleteOptions, IDeleteRecordInput, IGetOptions, InsertResponse, GetByIdResponse, GetResponse, DeleteResponse, IInsertRecordInput, DetokenizeResponse, IUpdateRequest, UpdateResponse, IUpdateOptions } from '../../utils/common';
|
|
2
3
|
declare class SkyflowContainer {
|
|
3
4
|
#private;
|
|
4
5
|
isControllerFrameReady: boolean;
|
|
5
|
-
constructor(client:
|
|
6
|
+
constructor(client: Client, context: Context);
|
|
6
7
|
detokenize(detokenizeInput: IDetokenizeInput): Promise<DetokenizeResponse>;
|
|
7
8
|
insert(records: IInsertRecordInput, options?: IInsertOptions): Promise<InsertResponse>;
|
|
9
|
+
update(record: IUpdateRequest, options?: IUpdateOptions): Promise<UpdateResponse>;
|
|
8
10
|
getById(getByIdInput: IGetByIdInput): Promise<GetByIdResponse>;
|
|
9
11
|
get(getInput: IGetInput, options?: IGetOptions): Promise<GetResponse>;
|
|
10
12
|
delete(records: IDeleteRecordInput, options?: IDeleteOptions): Promise<DeleteResponse>;
|
|
@@ -10,18 +10,7 @@ export default class FrameElementInit {
|
|
|
10
10
|
private static frameEle?;
|
|
11
11
|
containerId: string;
|
|
12
12
|
group: any;
|
|
13
|
-
frameList: FrameElement[];
|
|
14
|
-
iframeFormList: IFrameFormElement[];
|
|
15
13
|
constructor();
|
|
16
|
-
private handleCollectCall;
|
|
17
|
-
private parallelUploadFiles;
|
|
18
|
-
uploadFiles: (fileElement: any, clientConfig: any) => Promise<unknown>;
|
|
19
|
-
private tokenize;
|
|
20
|
-
private multipleUploadFiles;
|
|
21
|
-
private validateFiles;
|
|
22
|
-
private createInsertRequest;
|
|
23
|
-
private extractSkyflowIDs;
|
|
24
|
-
private insertDataCallInMultiFiles;
|
|
25
14
|
updateGroupData: () => void;
|
|
26
15
|
createIframeElement: (frameName: any, label: any, skyflowID: any, isRequired: any) => IFrameFormElement;
|
|
27
16
|
static startFrameElement: () => void;
|
|
@@ -44,11 +44,6 @@ export default class IFrameFormElement extends EventEmitter {
|
|
|
44
44
|
changeFocus: (focus: boolean) => void;
|
|
45
45
|
setReplacePattern(pattern: string[]): void;
|
|
46
46
|
setMask(mask: string[]): void;
|
|
47
|
-
getFileDetails: (value: FileList | File | null) => Array<{
|
|
48
|
-
name: string;
|
|
49
|
-
size: number;
|
|
50
|
-
type: string;
|
|
51
|
-
}>;
|
|
52
47
|
setValidation(validations: IValidationRule[] | undefined): void;
|
|
53
48
|
setFormat(format: string): void;
|
|
54
49
|
setSensitive(sensitive?: boolean): void;
|
|
@@ -20,8 +20,7 @@ export default class FrameElement {
|
|
|
20
20
|
private selectionStart?;
|
|
21
21
|
private selectionEnd?;
|
|
22
22
|
private selectedData?;
|
|
23
|
-
|
|
24
|
-
constructor(iFrameFormElement: IFrameFormElement, options: any, htmlDivElement: HTMLDivElement, clientDomain?: string);
|
|
23
|
+
constructor(iFrameFormElement: IFrameFormElement, options: any, htmlDivElement: HTMLDivElement);
|
|
25
24
|
mount: () => void;
|
|
26
25
|
setupInputField(newValue?: boolean): void;
|
|
27
26
|
updateParentDiv: (newDiv: HTMLDivElement) => void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ClientToJSON } from '../../../client';
|
|
2
|
+
import EventEmitter from '../../../event-emitter';
|
|
3
|
+
import { CollectContainer, ComposableContainer, RevealContainer } from '../../../index-node';
|
|
4
|
+
import { ContainerType } from '../../../skyflow';
|
|
5
|
+
import { CollectElementOptions, ICollectOptions } from '../../../utils/common';
|
|
6
|
+
import { ElementType } from '../../constants';
|
|
7
|
+
import SkyflowContainer from '../../external/skyflow-container';
|
|
8
|
+
export interface ElementInfo {
|
|
9
|
+
frameId: string;
|
|
10
|
+
elementId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TokenizeDataInput extends ICollectOptions {
|
|
13
|
+
type: string;
|
|
14
|
+
elementIds: Array<ElementInfo>;
|
|
15
|
+
containerId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface UploadFileDataInput extends ICollectOptions {
|
|
18
|
+
type: string;
|
|
19
|
+
elementIds: Array<string>;
|
|
20
|
+
containerId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface BatchInsertRequestBody {
|
|
23
|
+
method: string;
|
|
24
|
+
quorum?: boolean;
|
|
25
|
+
tableName: string;
|
|
26
|
+
fields?: Record<string, any>;
|
|
27
|
+
upsert?: string;
|
|
28
|
+
ID?: string;
|
|
29
|
+
tokenization?: boolean;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export interface ContainerProps {
|
|
33
|
+
containerId: string;
|
|
34
|
+
isMounted: boolean;
|
|
35
|
+
type: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RevealContainerProps {
|
|
38
|
+
containerId: string;
|
|
39
|
+
isMounted: boolean;
|
|
40
|
+
eventEmitter: EventEmitter;
|
|
41
|
+
}
|
|
42
|
+
export interface InternalState {
|
|
43
|
+
isEmpty: boolean;
|
|
44
|
+
isValid: boolean;
|
|
45
|
+
isFocused: boolean;
|
|
46
|
+
isRequired: boolean;
|
|
47
|
+
name: string;
|
|
48
|
+
elementType: ElementType;
|
|
49
|
+
isComplete: boolean;
|
|
50
|
+
value: string | Blob | undefined;
|
|
51
|
+
selectedCardScheme: string;
|
|
52
|
+
}
|
|
53
|
+
export interface FormattedCollectElementOptions extends CollectElementOptions {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export interface SkyflowElementProps {
|
|
57
|
+
id: string;
|
|
58
|
+
type: ElementType;
|
|
59
|
+
element: HTMLElement;
|
|
60
|
+
container: CollectContainer | RevealContainer | ComposableContainer;
|
|
61
|
+
}
|
|
62
|
+
export interface ClientMetadata {
|
|
63
|
+
uuid: string;
|
|
64
|
+
clientDomain: string;
|
|
65
|
+
sdkVersion?: string;
|
|
66
|
+
sessionId?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface Metadata extends ClientMetadata {
|
|
69
|
+
clientJSON: ClientToJSON;
|
|
70
|
+
containerType: ContainerType;
|
|
71
|
+
skyflowContainer: SkyflowContainer;
|
|
72
|
+
}
|
|
@@ -4,12 +4,7 @@ declare class RevealFrame {
|
|
|
4
4
|
private domCopy?;
|
|
5
5
|
private isRevealCalled?;
|
|
6
6
|
static init(): void;
|
|
7
|
-
constructor(record: any, context: any, id: any
|
|
8
|
-
responseUpdate: (data: any) => void;
|
|
9
|
-
getConfig: () => void;
|
|
10
|
-
getData: () => any;
|
|
11
|
-
private sub2;
|
|
12
|
-
private renderFile;
|
|
7
|
+
constructor(record: any, context: any, id: any);
|
|
13
8
|
private getExtension;
|
|
14
9
|
private addFileRender;
|
|
15
10
|
private setRevealError;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { IRevealRecord } from '../../../utils/common';
|
|
1
|
+
import { IRevealRecord, IInsertRecordInput, IInsertOptions, UploadFilesResponse, RevealResponse, InsertResponse, CollectResponse, IRenderResponseType, IUpdateRequest, UpdateResponse, IUpdateOptions } from '../../../utils/common';
|
|
2
|
+
import { TokenizeDataInput, UploadFileDataInput } from '../internal-types';
|
|
3
|
+
import IFrameFormElement from '../iframe-form';
|
|
2
4
|
declare class SkyflowFrameController {
|
|
3
5
|
#private;
|
|
4
6
|
constructor(clientId: string);
|
|
5
|
-
static init(clientId:
|
|
6
|
-
revealData(revealRecords: IRevealRecord[], containerId:
|
|
7
|
-
insertData(records:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
static init(clientId: string): SkyflowFrameController;
|
|
8
|
+
revealData(revealRecords: IRevealRecord[], containerId: string): Promise<RevealResponse>;
|
|
9
|
+
insertData(records: IInsertRecordInput, options: IInsertOptions): Promise<InsertResponse>;
|
|
10
|
+
updateData(updateData: IUpdateRequest, options?: IUpdateOptions): Promise<UpdateResponse>;
|
|
11
|
+
renderFile(data: IRevealRecord, iframeName: string): Promise<IRenderResponseType>;
|
|
12
|
+
tokenize: (options: TokenizeDataInput) => Promise<CollectResponse>;
|
|
13
|
+
parallelUploadFiles: (options: UploadFileDataInput) => Promise<UploadFilesResponse>;
|
|
14
|
+
uploadFiles: (fileElement: IFrameFormElement) => Promise<unknown>;
|
|
12
15
|
}
|
|
13
16
|
export default SkyflowFrameController;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import Client from '../client';
|
|
2
|
-
import { IInsertRecordInput, IInsertRecord, IValidationRule } from '../utils/common';
|
|
2
|
+
import { IInsertRecordInput, IInsertRecord, IValidationRule, InsertResponse, IUpdateRequest, IUpdateOptions, UpdateResponse } from '../utils/common';
|
|
3
3
|
import IFrameFormElement from '../core/internal/iframe-form';
|
|
4
|
+
import { BatchInsertRequestBody } from '../core/internal/internal-types';
|
|
4
5
|
export interface IUpsertOptions {
|
|
5
6
|
table: string;
|
|
6
7
|
column: string;
|
|
7
8
|
}
|
|
8
9
|
export declare const getUpsertColumn: (tableName: string, options: Array<IUpsertOptions> | undefined) => string;
|
|
9
|
-
export declare const constructInsertRecordRequest: (records: IInsertRecordInput, options?: Record<string, any>) =>
|
|
10
|
-
export declare const constructInsertRecordResponse: (responseBody: any, tokens: boolean, records: IInsertRecord[]) =>
|
|
11
|
-
|
|
10
|
+
export declare const constructInsertRecordRequest: (records: IInsertRecordInput, options?: Record<string, any>) => Array<BatchInsertRequestBody>;
|
|
11
|
+
export declare const constructInsertRecordResponse: (responseBody: any, tokens: boolean, records: IInsertRecord[]) => InsertResponse;
|
|
12
|
+
export declare const constructUpdateRecordRequest: (updateData: IUpdateRequest, options?: IUpdateOptions) => {
|
|
13
|
+
record: {
|
|
14
|
+
fields: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
tokenization: boolean;
|
|
12
17
|
};
|
|
18
|
+
export declare const constructUpdateRecordResponse: (responseBody: any, tokenization: boolean) => UpdateResponse;
|
|
13
19
|
export declare const constructFinalUpdateRecordResponse: (responseBody: any, tokens: boolean, records: any) => {
|
|
14
20
|
table: any;
|
|
15
21
|
fields: any;
|
|
@@ -28,8 +34,5 @@ export declare const constructElementsInsertReq: (req: any, update: any, options
|
|
|
28
34
|
records?: undefined;
|
|
29
35
|
})[];
|
|
30
36
|
export declare const updateRecordsBySkyflowID: (skyflowIdRecords: any, client: Client, options: any) => Promise<unknown>;
|
|
31
|
-
export declare const updateRecordsBySkyflowIDComposable: (skyflowIdRecords: any, client: Client, options: any, authToken: string) => Promise<unknown>;
|
|
32
|
-
export declare const insertDataInCollect: (records: any, client: Client, options: any, finalInsertRecords: any, authToken: string) => Promise<unknown>;
|
|
33
|
-
export declare const insertDataInMultipleFiles: (records: any, client: Client, options: any, finalInsertRecords: any, authToken: string) => Promise<unknown>;
|
|
34
37
|
export declare const checkForElementMatchRule: (validations: IValidationRule[]) => boolean;
|
|
35
38
|
export declare const checkForValueMatch: (validations: IValidationRule[], element: IFrameFormElement) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import Client from '../client';
|
|
2
|
-
import { IDeleteRecord, IDeleteResponseType } from '../utils/common';
|
|
2
|
+
import { IDeleteOptions, IDeleteRecord, IDeleteRecordInput, IDeleteResponseType } from '../utils/common';
|
|
3
3
|
export declare const deleteRecordsFromVault: (record: IDeleteRecord, authToken: String, client: Client) => Promise<any>;
|
|
4
|
-
export declare const deleteData: (records:
|
|
4
|
+
export declare const deleteData: (records: IDeleteRecordInput, options: IDeleteOptions, client: Client) => Promise<IDeleteResponseType>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import Client from '../client';
|
|
2
|
-
import { IRevealRecord, IRevealResponseType, IGetRecord, ISkyflowIdRecord, IRenderResponseType, IGetOptions, RenderFileResponse,
|
|
2
|
+
import { IRevealRecord, IRevealResponseType, IGetRecord, ISkyflowIdRecord, IRenderResponseType, IGetOptions, RenderFileResponse, RevealResponse, GetResponse, GetByIdResponse } 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 getFileURLFromVaultBySkyflowIDComposable: (skyflowIdRecord: IRevealRecord, client: Client, authToken: string) => Promise<IRenderResponseType>;
|
|
6
5
|
export declare const fetchRecordsByTokenId: (tokenIdRecords: IRevealRecord[], client: Client) => Promise<IRevealResponseType>;
|
|
7
|
-
export declare const fetchRecordsByTokenIdComposable: (tokenIdRecords: IRevealRecordComposable[], client: Client, authToken: string) => Promise<IRevealResponseType>;
|
|
8
6
|
export declare const formatRecordsForIframe: (response: IRevealResponseType) => Record<string, string>;
|
|
9
7
|
export declare const formatRecordsForRender: (response: IRenderResponseType, column: any, skyflowID: any) => {
|
|
10
8
|
column: any;
|
|
@@ -12,31 +10,6 @@ export declare const formatRecordsForRender: (response: IRenderResponseType, col
|
|
|
12
10
|
url: string;
|
|
13
11
|
};
|
|
14
12
|
export declare const formatForRenderClient: (response: IRenderResponseType, column: string) => RenderFileResponse;
|
|
15
|
-
export declare const formatRecordsForClient: (response: IRevealResponseType) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
valueType: string;
|
|
19
|
-
}[];
|
|
20
|
-
errors: Record<string, any>[];
|
|
21
|
-
} | {
|
|
22
|
-
success: {
|
|
23
|
-
token: string;
|
|
24
|
-
valueType: string;
|
|
25
|
-
}[];
|
|
26
|
-
errors?: undefined;
|
|
27
|
-
} | {
|
|
28
|
-
errors: Record<string, any>[] | undefined;
|
|
29
|
-
success?: undefined;
|
|
30
|
-
};
|
|
31
|
-
export declare const formatRecordsForClientComposable: (response: any) => {
|
|
32
|
-
success: never[];
|
|
33
|
-
errors: never[];
|
|
34
|
-
} | {
|
|
35
|
-
success: never[];
|
|
36
|
-
errors?: undefined;
|
|
37
|
-
} | {
|
|
38
|
-
errors: never[];
|
|
39
|
-
success?: undefined;
|
|
40
|
-
};
|
|
41
|
-
export declare const fetchRecordsGET: (skyflowIdRecords: IGetRecord[], client: Client, options?: IGetOptions) => Promise<unknown>;
|
|
42
|
-
export declare const fetchRecordsBySkyflowID: (skyflowIdRecords: ISkyflowIdRecord[], client: Client) => Promise<unknown>;
|
|
13
|
+
export declare const formatRecordsForClient: (response: IRevealResponseType) => RevealResponse;
|
|
14
|
+
export declare const fetchRecordsGET: (skyflowIdRecords: IGetRecord[], client: Client, options?: IGetOptions) => Promise<GetResponse>;
|
|
15
|
+
export declare const fetchRecordsBySkyflowID: (skyflowIdRecords: ISkyflowIdRecord[], client: Client) => Promise<GetByIdResponse>;
|
package/types/index-node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Skyflow from './skyflow';
|
|
2
|
-
export { IInsertRecordInput as InsertRequest, IInsertRecord as InsertRecord, IInsertOptions as InsertOptions, InsertResponse, IDetokenizeInput as DetokenizeRequest, DetokenizeRecord, DetokenizeResponse, IDeleteRecordInput as DeleteRequest, IDeleteRecord as DeleteRecord, IDeleteOptions as DeleteOptions, DeleteResponse, IGetInput as GetRequest, IGetRecord as GetRecord, IGetOptions as GetOptions, GetResponse, IGetByIdInput as GetByIdRequest, GetByIdResponse, ContainerOptions, CollectElementInput, CollectElementUpdateOptions, CollectElementOptions, ICollectOptions as CollectOptions, CollectResponse, UploadFilesResponse, CardMetadata, InputStyles, LabelStyles, ErrorTextStyles, RedactionType, IRevealRecord as RevealRecord, RevealResponse, RenderFileResponse, IValidationRule as ValidationRule, ValidationRuleType, EventName, LogLevel, Env, ElementState, } from './utils/common';
|
|
2
|
+
export { IInsertRecordInput as InsertRequest, IInsertRecord as InsertRecord, IInsertOptions as InsertOptions, IUpdateRequest as UpdateRequest, IUpdateOptions as UpdateOptions, UpdateResponse, InsertResponse, IDetokenizeInput as DetokenizeRequest, DetokenizeRecord, DetokenizeResponse, IDeleteRecordInput as DeleteRequest, IDeleteRecord as DeleteRecord, IDeleteOptions as DeleteOptions, DeleteResponse, IGetInput as GetRequest, IGetRecord as GetRecord, IGetOptions as GetOptions, GetResponse, IGetByIdInput as GetByIdRequest, GetByIdResponse, ContainerOptions, CollectElementInput, CollectElementUpdateOptions, CollectElementOptions, ICollectOptions as CollectOptions, CollectResponse, UploadFilesResponse, CardMetadata, InputStyles, LabelStyles, ErrorTextStyles, RedactionType, IRevealRecord as RevealRecord, RevealResponse, RenderFileResponse, IValidationRule as ValidationRule, ValidationRuleType, EventName, LogLevel, Env, ElementState, } from './utils/common';
|
|
3
3
|
export { IRevealElementInput as RevealElementInput, IRevealElementOptions as RevealElementOptions, } from './core/external/reveal/reveal-container';
|
|
4
4
|
export { ThreeDSBrowserDetails } from './core/external/threeds/threeds';
|
|
5
5
|
export { CardType, ElementType, } from './core/constants';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementType } from '../core/constants';
|
|
2
|
+
import { FormattedCollectElementOptions } from '../core/internal/internal-types';
|
|
3
|
+
import { CollectElementOptions, IValidationRule, LogLevel } from '../utils/common';
|
|
2
4
|
export declare function validateElementOptions(elementType: string, oldOptions: any, newOptions?: any): void;
|
|
3
5
|
export declare function validateAndSetupGroupOptions(oldGroup: any, newGroup?: any, setup?: boolean): any;
|
|
4
6
|
export declare const getElements: (group: any) => string[];
|
|
5
7
|
export declare const getValueAndItsUnit: (string?: string, defaultValue?: string, defaultUnit?: string) => string[];
|
|
6
8
|
export declare const formatValidations: (validations?: IValidationRule[]) => IValidationRule[] | undefined;
|
|
7
|
-
export declare const formatOptions: (elementType:
|
|
9
|
+
export declare const formatOptions: (elementType: ElementType, options: CollectElementOptions, logLevel: LogLevel) => FormattedCollectElementOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default function getCssClassesFromJss(styles: any, name:
|
|
1
|
+
export default function getCssClassesFromJss(styles: any, name: string): import("jss").Classes<string | number | symbol>;
|
|
2
2
|
export declare function generateCssWithoutClass(styles: any): import("jss").Classes<string | number | symbol>;
|