skyflow-js 2.5.0-beta.9 → 2.6.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 +1 -0
- 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 -2
- package/types/core/external/common/iframe.d.ts +4 -2
- package/types/core/external/common/skyflow-element.d.ts +7 -7
- package/types/core/external/reveal/composable-reveal-container.d.ts +4 -2
- package/types/core/external/reveal/composable-reveal-element.d.ts +2 -1
- package/types/core/external/reveal/composable-reveal-internal.d.ts +4 -4
- 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/composable-frame-element-init.d.ts +1 -1
- package/types/core/internal/internal-types/index.d.ts +75 -0
- package/types/core/internal/reveal/reveal-frame.d.ts +2 -1
- package/types/core/internal/skyflow-frame/skyflow-frame-controller.d.ts +11 -8
- package/types/core-utils/collect.d.ts +10 -4
- package/types/core-utils/delete.d.ts +2 -2
- package/types/core-utils/reveal.d.ts +4 -19
- package/types/index-node.d.ts +3 -1
- package/types/libs/element-options.d.ts +4 -2
- package/types/libs/jss-styles.d.ts +1 -1
- package/types/skyflow.d.ts +10 -2
- package/types/utils/bus-events/index.d.ts +1 -1
- package/types/utils/common/index.d.ts +27 -10
- package/types/utils/constants.d.ts +64 -0
- package/types/utils/helpers/index.d.ts +8 -8
- package/types/utils/logs.d.ts +19 -0
- package/types/utils/validators/index.d.ts +4 -3
|
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;
|
|
@@ -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,10 +1,16 @@
|
|
|
1
|
-
import { CollectElementInput, CollectElementOptions, ICollectOptions, CollectResponse, UploadFilesResponse } from '../../../utils/common';
|
|
1
|
+
import { Context, CollectElementInput, CollectElementOptions, ICollectOptions, CollectResponse, InputStyles, ErrorTextStyles, ContainerOptions, UploadFilesResponse } 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;
|
|
@@ -1,9 +1,11 @@
|
|
|
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:
|
|
8
|
+
constructor(name: string, metadata: Metadata, containerId: string, logLevel: LogLevel);
|
|
7
9
|
mount: (domElement: any, elementId?: string, data?: any) => void;
|
|
8
10
|
setIframeHeight: (height: any) => void;
|
|
9
11
|
unmount: () => void;
|
|
@@ -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,11 +1,13 @@
|
|
|
1
|
+
import { Context } from '../../../utils/common';
|
|
1
2
|
import Container from '../common/container';
|
|
2
3
|
import ComposableRevealElement from './composable-reveal-element';
|
|
3
|
-
import { RevealElementInput, RevealResponse } from '../../../index-node';
|
|
4
|
+
import { ContainerOptions, RevealElementInput, RevealResponse } from '../../../index-node';
|
|
4
5
|
import { IRevealElementOptions } from './reveal-container';
|
|
6
|
+
import { Metadata, SkyflowElementProps } from '../../internal/internal-types';
|
|
5
7
|
declare class ComposableRevealContainer extends Container {
|
|
6
8
|
#private;
|
|
7
9
|
type: string;
|
|
8
|
-
constructor(
|
|
10
|
+
constructor(metaData: Metadata, skyflowElements: Array<SkyflowElementProps>, context: Context, options?: ContainerOptions);
|
|
9
11
|
create: (input: RevealElementInput, options?: IRevealElementOptions) => ComposableRevealElement;
|
|
10
12
|
mount: (domElement: HTMLElement | string) => void;
|
|
11
13
|
unmount: () => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import EventEmitter from '../../../event-emitter';
|
|
1
2
|
import { RenderFileResponse } from '../../../utils/common';
|
|
2
3
|
import { IRevealElementInput, IRevealElementOptions } from './reveal-container';
|
|
3
4
|
declare class ComposableRevealElement {
|
|
4
5
|
#private;
|
|
5
6
|
type: string;
|
|
6
|
-
constructor(name:
|
|
7
|
+
constructor(name: string, eventEmitter: EventEmitter, iframeName: string);
|
|
7
8
|
iframeName(): string;
|
|
8
9
|
getID(): string;
|
|
9
10
|
renderFile(): Promise<RenderFileResponse>;
|
|
@@ -1,28 +1,28 @@
|
|
|
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
|
export interface RevealComposableGroup {
|
|
5
6
|
record: IRevealElementInput;
|
|
6
7
|
options: IRevealElementOptions;
|
|
7
8
|
}
|
|
8
9
|
declare class ComposableRevealInternalElement extends SkyflowElement {
|
|
9
10
|
#private;
|
|
10
|
-
|
|
11
|
+
resizeObserver: ResizeObserver | null;
|
|
12
|
+
constructor(elementId: string, recordGroup: any, metaData: Metadata, container: RevealContainerProps, context: Context);
|
|
11
13
|
private setupRenderFileEventListener;
|
|
12
14
|
getID(): string;
|
|
13
15
|
mount(domElementSelector: HTMLElement | string): void;
|
|
14
16
|
renderFile(recordData: any): Promise<RenderFileResponse>;
|
|
15
17
|
iframeName(): string;
|
|
16
18
|
isMounted(): boolean;
|
|
17
|
-
hasToken(): boolean;
|
|
18
19
|
isClientSetError(): boolean;
|
|
19
20
|
getRecordData(): any;
|
|
20
21
|
setErrorOverride(clientErrorText: string): void;
|
|
21
22
|
setError(clientErrorText: string): void;
|
|
22
23
|
resetError(): void;
|
|
23
|
-
setAltText(altText: string): void;
|
|
24
|
+
setAltText(altText: string, record: any): void;
|
|
24
25
|
clearAltText(): void;
|
|
25
|
-
setToken(token: string): void;
|
|
26
26
|
unmount(): void;
|
|
27
27
|
update(options: IRevealElementInput | IRevealElementOptions, record: any): void;
|
|
28
28
|
}
|
|
@@ -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>;
|
|
@@ -16,6 +16,6 @@ export default class RevealComposableFrameElementInit {
|
|
|
16
16
|
constructor();
|
|
17
17
|
updateGroupData: () => void;
|
|
18
18
|
static startFrameElement: () => void;
|
|
19
|
-
revealData(revealRecords: IRevealRecordComposable[], containerId:
|
|
19
|
+
revealData(revealRecords: IRevealRecordComposable[], containerId: string, authToken: string): Promise<unknown>;
|
|
20
20
|
createContainerDiv: (newGroup: any) => void;
|
|
21
21
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
type: string;
|
|
42
|
+
}
|
|
43
|
+
export interface InternalState {
|
|
44
|
+
metaData: any;
|
|
45
|
+
isEmpty: boolean;
|
|
46
|
+
isValid: boolean;
|
|
47
|
+
isFocused: boolean;
|
|
48
|
+
isRequired: boolean;
|
|
49
|
+
name: string;
|
|
50
|
+
elementType: ElementType;
|
|
51
|
+
isComplete: boolean;
|
|
52
|
+
value: string | Blob | undefined;
|
|
53
|
+
selectedCardScheme: string;
|
|
54
|
+
}
|
|
55
|
+
export interface FormattedCollectElementOptions extends CollectElementOptions {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}
|
|
58
|
+
export interface SkyflowElementProps {
|
|
59
|
+
id: string;
|
|
60
|
+
type: ElementType;
|
|
61
|
+
element: HTMLElement;
|
|
62
|
+
container: CollectContainer | RevealContainer | ComposableContainer;
|
|
63
|
+
}
|
|
64
|
+
export interface ClientMetadata {
|
|
65
|
+
uuid: string;
|
|
66
|
+
clientDomain: string;
|
|
67
|
+
sdkVersion?: string;
|
|
68
|
+
sessionId?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface Metadata extends ClientMetadata {
|
|
71
|
+
clientJSON: ClientToJSON;
|
|
72
|
+
containerType: ContainerType;
|
|
73
|
+
skyflowContainer: SkyflowContainer;
|
|
74
|
+
getSkyflowBearerToken: () => Promise<string>;
|
|
75
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Context } from '../../../utils/common';
|
|
1
2
|
declare class RevealFrame {
|
|
2
3
|
#private;
|
|
3
4
|
static revealFrame: RevealFrame;
|
|
4
5
|
private domCopy?;
|
|
5
6
|
private isRevealCalled?;
|
|
6
7
|
static init(): void;
|
|
7
|
-
constructor(record: any, context:
|
|
8
|
+
constructor(record: any, context: Context, id: string, rootDiv?: HTMLDivElement);
|
|
8
9
|
responseUpdate: (data: any) => void;
|
|
9
10
|
getConfig: () => void;
|
|
10
11
|
getData: () => any;
|
|
@@ -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;
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import Client from '../client';
|
|
2
|
-
import { IRevealRecord, IRevealResponseType, IGetRecord, ISkyflowIdRecord, IRenderResponseType, IGetOptions, RenderFileResponse, IRevealRecordComposable } from '../utils/common';
|
|
2
|
+
import { IRevealRecord, IRevealResponseType, IGetRecord, ISkyflowIdRecord, IRenderResponseType, IGetOptions, RenderFileResponse, RevealResponse, GetResponse, GetByIdResponse, IRevealRecordComposable } 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
5
|
export declare const getFileURLFromVaultBySkyflowIDComposable: (skyflowIdRecord: IRevealRecord, client: Client, authToken: string) => Promise<IRenderResponseType>;
|
|
@@ -12,22 +12,7 @@ export declare const formatRecordsForRender: (response: IRenderResponseType, col
|
|
|
12
12
|
url: string;
|
|
13
13
|
};
|
|
14
14
|
export declare const formatForRenderClient: (response: IRenderResponseType, column: string) => RenderFileResponse;
|
|
15
|
-
export declare const formatRecordsForClient: (response: IRevealResponseType) =>
|
|
16
|
-
success: {
|
|
17
|
-
token: string;
|
|
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
|
-
};
|
|
15
|
+
export declare const formatRecordsForClient: (response: IRevealResponseType) => RevealResponse;
|
|
31
16
|
export declare const formatRecordsForClientComposable: (response: any) => {
|
|
32
17
|
success: never[];
|
|
33
18
|
errors: never[];
|
|
@@ -38,5 +23,5 @@ export declare const formatRecordsForClientComposable: (response: any) => {
|
|
|
38
23
|
errors: never[];
|
|
39
24
|
success?: undefined;
|
|
40
25
|
};
|
|
41
|
-
export declare const fetchRecordsGET: (skyflowIdRecords: IGetRecord[], client: Client, options?: IGetOptions) => Promise<
|
|
42
|
-
export declare const fetchRecordsBySkyflowID: (skyflowIdRecords: ISkyflowIdRecord[], client: Client) => Promise<
|
|
26
|
+
export declare const fetchRecordsGET: (skyflowIdRecords: IGetRecord[], client: Client, options?: IGetOptions) => Promise<GetResponse>;
|
|
27
|
+
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';
|
|
@@ -11,4 +11,6 @@ export { default as ComposableElement } from './core/external/collect/compose-co
|
|
|
11
11
|
export { default as RevealContainer } from './core/external/reveal/reveal-container';
|
|
12
12
|
export { default as RevealElement } from './core/external/reveal/reveal-element';
|
|
13
13
|
export { default as ThreeDS } from './core/external/threeds/threeds';
|
|
14
|
+
export { default as ComposableRevealContainer } from './core/external/reveal/composable-reveal-container';
|
|
15
|
+
export { default as ComposableRevealElement } from './core/external/reveal/composable-reveal-element';
|
|
14
16
|
export default Skyflow;
|
|
@@ -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>;
|
package/types/skyflow.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ElementType, CardType } from './core/constants';
|
|
|
2
2
|
import RevealContainer from './core/external/reveal/reveal-container';
|
|
3
3
|
import CollectContainer from './core/external/collect/collect-container';
|
|
4
4
|
import SkyflowError from './libs/skyflow-error';
|
|
5
|
-
import { RequestMethod, IInsertRecordInput, IDetokenizeInput, IGetInput, RedactionType, EventName, Env, LogLevel, ValidationRuleType, IGetByIdInput, IInsertOptions, IDeleteRecordInput, IDeleteOptions, IGetOptions, InsertResponse, GetResponse, GetByIdResponse, DeleteResponse, ContainerOptions, DetokenizeResponse } from './utils/common';
|
|
5
|
+
import { RequestMethod, IInsertRecordInput, IDetokenizeInput, IGetInput, RedactionType, EventName, Env, LogLevel, ValidationRuleType, IGetByIdInput, IInsertOptions, IDeleteRecordInput, IDeleteOptions, IGetOptions, InsertResponse, GetResponse, GetByIdResponse, DeleteResponse, ContainerOptions, DetokenizeResponse, IUpdateRequest, UpdateResponse, IUpdateOptions } from './utils/common';
|
|
6
6
|
import ComposableContainer from './core/external/collect/compose-collect-container';
|
|
7
7
|
import ThreeDS from './core/external/threeds/threeds';
|
|
8
8
|
import ComposableRevealContainer from './core/external/reveal/composable-reveal-container';
|
|
@@ -12,11 +12,18 @@ export declare enum ContainerType {
|
|
|
12
12
|
COMPOSABLE = "COMPOSABLE",
|
|
13
13
|
COMPOSE_REVEAL = "COMPOSABLE_REVEAL"
|
|
14
14
|
}
|
|
15
|
+
export interface SkyflowConfigOptions {
|
|
16
|
+
logLevel?: LogLevel;
|
|
17
|
+
env?: Env;
|
|
18
|
+
trackingKey?: string;
|
|
19
|
+
trackMetrics?: boolean;
|
|
20
|
+
customElementsURL?: string;
|
|
21
|
+
}
|
|
15
22
|
export interface ISkyflow {
|
|
16
23
|
vaultID?: string;
|
|
17
24
|
vaultURL?: string;
|
|
18
25
|
getBearerToken: () => Promise<string>;
|
|
19
|
-
options?:
|
|
26
|
+
options?: SkyflowConfigOptions;
|
|
20
27
|
}
|
|
21
28
|
declare class Skyflow {
|
|
22
29
|
#private;
|
|
@@ -31,6 +38,7 @@ declare class Skyflow {
|
|
|
31
38
|
getById(getByIdInput: IGetByIdInput): Promise<GetByIdResponse>;
|
|
32
39
|
get(getInput: IGetInput, options?: IGetOptions): Promise<GetResponse>;
|
|
33
40
|
delete(records: IDeleteRecordInput, options?: IDeleteOptions): Promise<DeleteResponse>;
|
|
41
|
+
update(record: IUpdateRequest, options?: IUpdateOptions): Promise<UpdateResponse>;
|
|
34
42
|
static get ContainerType(): typeof ContainerType;
|
|
35
43
|
static get ElementType(): typeof ElementType;
|
|
36
44
|
static get RedactionType(): typeof RedactionType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getAccessToken(clientId:
|
|
1
|
+
export declare function getAccessToken(clientId: string): Promise<unknown>;
|
|
2
2
|
export declare function updateElementState(frameName: string, value: any): void;
|
|
@@ -53,6 +53,14 @@ export interface IInsertRecord {
|
|
|
53
53
|
fields: Record<string, any>;
|
|
54
54
|
skyflowID?: string;
|
|
55
55
|
}
|
|
56
|
+
export interface IUpdateRequest {
|
|
57
|
+
table: string;
|
|
58
|
+
fields: Record<string, unknown>;
|
|
59
|
+
skyflowID: string;
|
|
60
|
+
}
|
|
61
|
+
export interface IUpdateOptions {
|
|
62
|
+
tokens?: boolean;
|
|
63
|
+
}
|
|
56
64
|
export interface IRevealRecord {
|
|
57
65
|
token?: string;
|
|
58
66
|
redaction?: RedactionType;
|
|
@@ -167,6 +175,13 @@ export interface InsertResponse {
|
|
|
167
175
|
records?: InsertResponseRecords[];
|
|
168
176
|
errors?: ErrorRecord[];
|
|
169
177
|
}
|
|
178
|
+
export interface UpdateResponseType {
|
|
179
|
+
skyflowID: string;
|
|
180
|
+
[key: string]: unknown;
|
|
181
|
+
}
|
|
182
|
+
export interface UpdateResponse {
|
|
183
|
+
updatedField: UpdateResponseType;
|
|
184
|
+
}
|
|
170
185
|
export interface CollectResponse extends InsertResponse {
|
|
171
186
|
}
|
|
172
187
|
export interface DetokenizeRecord extends IRevealRecord {
|
|
@@ -176,6 +191,7 @@ export interface DetokenizeResponse extends IRevealResponseType {
|
|
|
176
191
|
export interface InsertResponseRecords {
|
|
177
192
|
fields: Record<string, any>;
|
|
178
193
|
table: string;
|
|
194
|
+
skyflow_id?: string;
|
|
179
195
|
}
|
|
180
196
|
export interface ErrorRecord {
|
|
181
197
|
code: number;
|
|
@@ -272,23 +288,24 @@ export interface ICollectOptions {
|
|
|
272
288
|
export interface MetaData {
|
|
273
289
|
[key: string]: any;
|
|
274
290
|
}
|
|
291
|
+
export interface EventConfig {
|
|
292
|
+
authToken: string;
|
|
293
|
+
vaultURL: string;
|
|
294
|
+
vaultID: string;
|
|
295
|
+
}
|
|
275
296
|
export interface UploadFilesResponse {
|
|
276
|
-
fileUploadResponse
|
|
277
|
-
|
|
278
|
-
}];
|
|
279
|
-
errorResponse: [{
|
|
280
|
-
error: ErrorRecord;
|
|
281
|
-
}];
|
|
297
|
+
fileUploadResponse?: Record<string, any>;
|
|
298
|
+
errorResponse?: Record<string, any>;
|
|
282
299
|
}
|
|
283
300
|
export interface RevealResponse {
|
|
284
|
-
success?: {
|
|
301
|
+
success?: Array<{
|
|
285
302
|
token: string;
|
|
286
303
|
valueType: string;
|
|
287
|
-
}
|
|
288
|
-
errors?: {
|
|
304
|
+
}>;
|
|
305
|
+
errors?: Array<{
|
|
289
306
|
error: ErrorRecord;
|
|
290
307
|
token: string;
|
|
291
|
-
}
|
|
308
|
+
}>;
|
|
292
309
|
}
|
|
293
310
|
export interface RenderFileResponse {
|
|
294
311
|
success?: {
|