skyflow-js 2.4.3 → 2.4.4
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 +93 -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/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/collect/compose-collect-element.d.ts +2 -1
- 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 +3 -2
- package/types/core/internal/internal-types/index.d.ts +72 -0
- package/types/core/internal/skyflow-frame/skyflow-frame-controller.d.ts +10 -8
- package/types/core-utils/collect.d.ts +4 -5
- package/types/core-utils/delete.d.ts +2 -2
- package/types/core-utils/reveal.d.ts +4 -19
- package/types/libs/element-options.d.ts +4 -2
- package/types/libs/jss-styles.d.ts +1 -1
- package/types/skyflow.d.ts +8 -1
- package/types/utils/bus-events/index.d.ts +1 -1
- package/types/utils/common/index.d.ts +7 -10
- package/types/utils/helpers/index.d.ts +8 -8
- package/types/utils/validators/index.d.ts +3 -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 } from '../../../utils/common';
|
|
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;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import EventEmitter from '../../../event-emitter';
|
|
1
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;
|
|
@@ -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,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Client from '../../client';
|
|
2
|
+
import { IDetokenizeInput, IGetInput, Context, IGetByIdInput, IInsertOptions, IDeleteOptions, IDeleteRecordInput, IGetOptions, InsertResponse, GetByIdResponse, GetResponse, DeleteResponse, IInsertRecordInput, DetokenizeResponse } 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>;
|
|
8
9
|
getById(getByIdInput: IGetByIdInput): Promise<GetByIdResponse>;
|
|
@@ -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
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { IRevealRecord } from '../../../utils/common';
|
|
1
|
+
import { IRevealRecord, IInsertRecordInput, IInsertOptions, UploadFilesResponse, RevealResponse, InsertResponse, CollectResponse, IRenderResponseType } 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
|
-
renderFile(data:
|
|
9
|
-
tokenize: (options:
|
|
10
|
-
parallelUploadFiles: (options:
|
|
11
|
-
uploadFiles: (fileElement:
|
|
7
|
+
static init(clientId: string): SkyflowFrameController;
|
|
8
|
+
revealData(revealRecords: IRevealRecord[], containerId: string): Promise<RevealResponse>;
|
|
9
|
+
insertData(records: IInsertRecordInput, options: IInsertOptions): Promise<InsertResponse>;
|
|
10
|
+
renderFile(data: IRevealRecord, iframeName: string): Promise<IRenderResponseType>;
|
|
11
|
+
tokenize: (options: TokenizeDataInput) => Promise<CollectResponse>;
|
|
12
|
+
parallelUploadFiles: (options: UploadFileDataInput) => Promise<UploadFilesResponse>;
|
|
13
|
+
uploadFiles: (fileElement: IFrameFormElement) => Promise<unknown>;
|
|
12
14
|
}
|
|
13
15
|
export default SkyflowFrameController;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import Client from '../client';
|
|
2
|
-
import { IInsertRecordInput, IInsertRecord, IValidationRule } from '../utils/common';
|
|
2
|
+
import { IInsertRecordInput, IInsertRecord, IValidationRule, InsertResponse } 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
|
-
records: any;
|
|
12
|
-
};
|
|
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;
|
|
13
12
|
export declare const constructFinalUpdateRecordResponse: (responseBody: any, tokens: boolean, records: any) => {
|
|
14
13
|
table: any;
|
|
15
14
|
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 } from '../utils/common';
|
|
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
5
|
export declare const fetchRecordsByTokenId: (tokenIdRecords: IRevealRecord[], client: Client) => Promise<IRevealResponseType>;
|
|
@@ -10,21 +10,6 @@ export declare const formatRecordsForRender: (response: IRenderResponseType, col
|
|
|
10
10
|
url: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const formatForRenderClient: (response: IRenderResponseType, column: string) => RenderFileResponse;
|
|
13
|
-
export declare const formatRecordsForClient: (response: IRevealResponseType) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
valueType: string;
|
|
17
|
-
}[];
|
|
18
|
-
errors: Record<string, any>[];
|
|
19
|
-
} | {
|
|
20
|
-
success: {
|
|
21
|
-
token: string;
|
|
22
|
-
valueType: string;
|
|
23
|
-
}[];
|
|
24
|
-
errors?: undefined;
|
|
25
|
-
} | {
|
|
26
|
-
errors: Record<string, any>[] | undefined;
|
|
27
|
-
success?: undefined;
|
|
28
|
-
};
|
|
29
|
-
export declare const fetchRecordsGET: (skyflowIdRecords: IGetRecord[], client: Client, options?: IGetOptions) => Promise<unknown>;
|
|
30
|
-
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>;
|
|
@@ -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
|
@@ -10,11 +10,18 @@ export declare enum ContainerType {
|
|
|
10
10
|
REVEAL = "REVEAL",
|
|
11
11
|
COMPOSABLE = "COMPOSABLE"
|
|
12
12
|
}
|
|
13
|
+
export interface SkyflowConfigOptions {
|
|
14
|
+
logLevel?: LogLevel;
|
|
15
|
+
env?: Env;
|
|
16
|
+
trackingKey?: string;
|
|
17
|
+
trackMetrics?: boolean;
|
|
18
|
+
customElementsURL?: string;
|
|
19
|
+
}
|
|
13
20
|
export interface ISkyflow {
|
|
14
21
|
vaultID?: string;
|
|
15
22
|
vaultURL?: string;
|
|
16
23
|
getBearerToken: () => Promise<string>;
|
|
17
|
-
options?:
|
|
24
|
+
options?: SkyflowConfigOptions;
|
|
18
25
|
}
|
|
19
26
|
declare class Skyflow {
|
|
20
27
|
#private;
|
|
@@ -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;
|
|
@@ -167,6 +167,7 @@ export interface DetokenizeResponse extends IRevealResponseType {
|
|
|
167
167
|
export interface InsertResponseRecords {
|
|
168
168
|
fields: Record<string, any>;
|
|
169
169
|
table: string;
|
|
170
|
+
skyflow_id?: string;
|
|
170
171
|
}
|
|
171
172
|
export interface ErrorRecord {
|
|
172
173
|
code: number;
|
|
@@ -261,22 +262,18 @@ export interface ICollectOptions {
|
|
|
261
262
|
upsert?: Array<IUpsertOptions>;
|
|
262
263
|
}
|
|
263
264
|
export interface UploadFilesResponse {
|
|
264
|
-
fileUploadResponse
|
|
265
|
-
|
|
266
|
-
}];
|
|
267
|
-
errorResponse: [{
|
|
268
|
-
error: ErrorRecord;
|
|
269
|
-
}];
|
|
265
|
+
fileUploadResponse?: Record<string, any>;
|
|
266
|
+
errorResponse?: Record<string, any>;
|
|
270
267
|
}
|
|
271
268
|
export interface RevealResponse {
|
|
272
|
-
success?: {
|
|
269
|
+
success?: Array<{
|
|
273
270
|
token: string;
|
|
274
271
|
valueType: string;
|
|
275
|
-
}
|
|
276
|
-
errors?: {
|
|
272
|
+
}>;
|
|
273
|
+
errors?: Array<{
|
|
277
274
|
error: ErrorRecord;
|
|
278
275
|
token: string;
|
|
279
|
-
}
|
|
276
|
+
}>;
|
|
280
277
|
}
|
|
281
278
|
export interface RenderFileResponse {
|
|
282
279
|
success?: {
|
|
@@ -4,19 +4,19 @@ import { ContainerType, ISkyflow } from '../../skyflow';
|
|
|
4
4
|
export declare const flattenObject: (obj: any, roots?: any, sep?: string) => any;
|
|
5
5
|
export declare function formatFrameNameToId(name: string): string;
|
|
6
6
|
export declare function removeSpaces(inputString: string): string;
|
|
7
|
-
export declare function formatVaultURL(vaultURL
|
|
7
|
+
export declare function formatVaultURL(vaultURL?: string): string | undefined;
|
|
8
8
|
export declare function checkIfDuplicateExists(arr: any): boolean;
|
|
9
|
-
export declare const appendZeroToOne: (value:
|
|
9
|
+
export declare const appendZeroToOne: (value: string) => {
|
|
10
10
|
isAppended: boolean;
|
|
11
|
-
value:
|
|
11
|
+
value: string;
|
|
12
12
|
};
|
|
13
|
-
export declare const appendMonthFourDigitYears: (value:
|
|
13
|
+
export declare const appendMonthFourDigitYears: (value: string) => {
|
|
14
14
|
isAppended: boolean;
|
|
15
|
-
value:
|
|
15
|
+
value: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const appendMonthTwoDigitYears: (value:
|
|
17
|
+
export declare const appendMonthTwoDigitYears: (value: string) => {
|
|
18
18
|
isAppended: boolean;
|
|
19
|
-
value:
|
|
19
|
+
value: string;
|
|
20
20
|
};
|
|
21
21
|
export declare const getReturnValue: (value: string | Blob, element: string, doesReturnValue: boolean) => string | Blob | undefined;
|
|
22
22
|
export declare function domReady(fn: any): void;
|
|
@@ -27,7 +27,7 @@ export declare const getMaskedOutput: (input: string, format: string, translatio
|
|
|
27
27
|
export declare const copyToClipboard: (text: string) => void;
|
|
28
28
|
export declare const handleCopyIconClick: (textToCopy: string, domCopy: any) => void;
|
|
29
29
|
export declare const fileValidation: (value: any, required: Boolean | undefined, fileElement: any) => boolean;
|
|
30
|
-
export declare const vaildateFileName: (name:
|
|
30
|
+
export declare const vaildateFileName: (name: string) => boolean;
|
|
31
31
|
export declare const styleToString: (style: any) => string;
|
|
32
32
|
export declare const getContainerType: (frameName: string) => ContainerType;
|
|
33
33
|
export declare const addSeperatorToCardNumberMask: (cardNumberMask: any, seperator?: string) => any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CardType } from '../../core/constants';
|
|
2
2
|
import { IRevealElementInput } from '../../core/external/reveal/reveal-container';
|
|
3
3
|
import { ISkyflow } from '../../skyflow';
|
|
4
|
-
import { IInsertRecordInput, IDetokenizeInput, IGetInput, IGetByIdInput, IDeleteRecordInput, IGetOptions, CollectElementInput } from '../common';
|
|
4
|
+
import { IInsertRecordInput, IDetokenizeInput, IGetInput, IGetByIdInput, IDeleteRecordInput, IGetOptions, CollectElementInput, LogLevel, ContainerOptions } from '../common';
|
|
5
5
|
export declare const validateCreditCardNumber: (cardNumber: string) => boolean;
|
|
6
6
|
export declare const detectCardType: (cardNumber?: string) => CardType.DEFAULT;
|
|
7
7
|
export declare const validateExpiryDate: (date: string, format: string) => boolean;
|
|
@@ -21,8 +21,8 @@ export declare const isValidURL: (url: string) => boolean;
|
|
|
21
21
|
export declare const isValidRegExp: (input: any) => boolean;
|
|
22
22
|
export declare const validateCardNumberLengthCheck: (cardNumber?: string) => boolean;
|
|
23
23
|
export declare const validateInitConfig: (initConfig: ISkyflow) => void;
|
|
24
|
-
export declare const validateCollectElementInput: (input: CollectElementInput, logLevel:
|
|
24
|
+
export declare const validateCollectElementInput: (input: CollectElementInput, logLevel: LogLevel) => void;
|
|
25
25
|
export declare const validateUpsertOptions: (upsertOptions: any) => void;
|
|
26
|
-
export declare const validateComposableContainerOptions: (options:
|
|
26
|
+
export declare const validateComposableContainerOptions: (options: ContainerOptions) => void;
|
|
27
27
|
export declare const validateBooleanOptions: (option: any) => boolean;
|
|
28
28
|
export declare const validateInputFormatOptions: (options: any) => void;
|