skyflow-js 2.5.0-beta.4 → 2.5.0-beta.6

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.
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "skyflow-js",
3
3
  "preferGlobal": true,
4
4
  "analyze": false,
5
- "version": "2.5.0-beta.4",
5
+ "version": "2.5.0-beta.6",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -9,10 +9,12 @@ 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";
12
13
  export declare const ELEMENT_TYPES: {
13
14
  COLLECT: string;
14
15
  REVEAL: string;
15
16
  COMPOSE: string;
17
+ REVEAL_COMPOSE: string;
16
18
  };
17
19
  export declare const EVENT_TYPES: {
18
20
  MOUNTED: string;
@@ -30,6 +32,7 @@ export declare const METRIC_TYPES: {
30
32
  COLLECT: string;
31
33
  REVEAL: string;
32
34
  COMPOSE: string;
35
+ REVEAL_COMPOSE: string;
33
36
  };
34
37
  ELEMENT_TYPE_KEY: string;
35
38
  DIV_ID: string;
@@ -86,10 +89,17 @@ export declare const ELEMENT_EVENTS_TO_CLIENT: {
86
89
  HEIGHT: string;
87
90
  };
88
91
  export declare const ELEMENT_EVENTS_TO_IFRAME: {
89
- COLLECT_INVOKE_REQUEST: string;
90
- COLLECT_DATA_REQUEST: string;
92
+ RENDER_MOUNTED: string;
93
+ HEIGHT_CALLBACK: string;
94
+ HEIGHT_CALLBACK_COMPOSABLE: string;
95
+ COMPOSABLE_REVEAL: string;
91
96
  COLLECT_CALL_REQUESTS: string;
97
+ COMPOSABLE_CALL_REQUESTS: string;
98
+ COMPOSABLE_CALL_RESPONSE: string;
99
+ COMPOSABLE_FILE_CALL_RESPONSE: string;
100
+ COMPOSABLE_CONTAINER: string;
92
101
  REVEAL_CALL_REQUESTS: string;
102
+ REVEAL_CALL_RESPONSE: string;
93
103
  FRAME_READY: string;
94
104
  READY_FOR_CLIENT: string;
95
105
  TOKENIZATION_REQUEST: string;
@@ -8,6 +8,5 @@ declare class CollectContainer extends Container {
8
8
  create: (input: CollectElementInput, options?: CollectElementOptions) => CollectElement;
9
9
  collect: (options?: ICollectOptions) => Promise<CollectResponse>;
10
10
  uploadFiles: (options: ICollectOptions) => Promise<UploadFilesResponse>;
11
- checkIfFrameExistsInShadowRoot: (shadowRoot: ShadowRoot | null, frameName: string) => boolean;
12
11
  }
13
12
  export default CollectContainer;
@@ -10,8 +10,6 @@ declare class CollectElement extends SkyflowElement {
10
10
  constructor(elementId: string, elementGroup: any, metaData: any, container: any, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
11
11
  getID: () => string;
12
12
  mount: (domElement: HTMLElement | string) => void;
13
- getShadowRoot: () => ShadowRoot | null;
14
- emitEventFromShadowRoot: (eventName: string, options?: Record<string, any>, callback?: any) => void;
15
13
  unmount: () => void;
16
14
  updateElementGroup: (group: any) => void;
17
15
  updateElement: (elementOptions: any) => void;
@@ -1,4 +1,4 @@
1
- import { CollectElementInput, CollectElementOptions, ICollectOptions, CollectResponse } from '../../../utils/common';
1
+ import { CollectElementInput, CollectElementOptions, ICollectOptions, CollectResponse, UploadFilesResponse } from '../../../utils/common';
2
2
  import Container from '../common/container';
3
3
  import ComposableElement from './compose-collect-element';
4
4
  declare class ComposableContainer extends Container {
@@ -10,5 +10,6 @@ declare class ComposableContainer extends Container {
10
10
  mount: (domElement: HTMLElement | string) => void;
11
11
  unmount: () => void;
12
12
  collect: (options?: ICollectOptions) => Promise<CollectResponse>;
13
+ uploadFiles: (options: ICollectOptions) => Promise<UploadFilesResponse>;
13
14
  }
14
15
  export default ComposableContainer;
@@ -0,0 +1,14 @@
1
+ import Container from '../common/container';
2
+ import ComposableRevealElement from './composable-reveal-element';
3
+ import { RevealElementInput, RevealResponse } from '../../../index-node';
4
+ import { IRevealElementOptions } from './reveal-container';
5
+ declare class ComposableRevealContainer extends Container {
6
+ #private;
7
+ type: string;
8
+ constructor(options: any, metaData: any, skyflowElements: any, context: any);
9
+ create: (input: RevealElementInput, options?: IRevealElementOptions) => ComposableRevealElement;
10
+ mount: (domElement: HTMLElement | string) => void;
11
+ unmount: () => void;
12
+ reveal(): Promise<RevealResponse>;
13
+ }
14
+ export default ComposableRevealContainer;
@@ -0,0 +1,10 @@
1
+ import { RenderFileResponse } from '../../../utils/common';
2
+ declare class ComposableRevealElement {
3
+ #private;
4
+ type: string;
5
+ constructor(name: any, eventEmitter: any, iframeName: any);
6
+ iframeName(): string;
7
+ getID(): string;
8
+ renderFile(): Promise<RenderFileResponse>;
9
+ }
10
+ export default ComposableRevealElement;
@@ -0,0 +1,29 @@
1
+ import { Context, RenderFileResponse } from '../../../utils/common';
2
+ import SkyflowElement from '../common/skyflow-element';
3
+ import { IRevealElementInput, IRevealElementOptions } from './reveal-container';
4
+ export interface RevealComposableGroup {
5
+ record: IRevealElementInput;
6
+ options: IRevealElementOptions;
7
+ }
8
+ declare class ComposableRevealInternalElement extends SkyflowElement {
9
+ #private;
10
+ constructor(elementId: string, recordGroup: RevealComposableGroup[], metaData: any, container: any, isSingleElementAPI: boolean | undefined, context: Context);
11
+ private setupRenderFileEventListener;
12
+ getID(): string;
13
+ mount(domElementSelector: HTMLElement | string): void;
14
+ renderFile(recordData: any): Promise<RenderFileResponse>;
15
+ iframeName(): string;
16
+ isMounted(): boolean;
17
+ hasToken(): boolean;
18
+ isClientSetError(): boolean;
19
+ getRecordData(): any;
20
+ setErrorOverride(clientErrorText: string): void;
21
+ setError(clientErrorText: string): void;
22
+ resetError(): void;
23
+ setAltText(altText: string): void;
24
+ clearAltText(): void;
25
+ setToken(token: string): void;
26
+ unmount(): void;
27
+ update(options: IRevealElementInput): void;
28
+ }
29
+ export default ComposableRevealInternalElement;
@@ -5,8 +5,6 @@ declare class RevealElement extends SkyflowElement {
5
5
  #private;
6
6
  constructor(record: IRevealElementInput, options: IRevealElementOptions | undefined, metaData: any, container: any, elementId: string, context: Context);
7
7
  getID(): string;
8
- getShadowRoot: () => ShadowRoot | null;
9
- emitEventFromShadowRoot: (eventName: string, options?: Record<string, any>) => void;
10
8
  mount(domElementSelector: HTMLElement | string): void;
11
9
  renderFile(): Promise<RenderFileResponse>;
12
10
  iframeName(): string;
@@ -0,0 +1,21 @@
1
+ import { IRevealRecordComposable } from '../../utils/common';
2
+ import IFrameFormElement from './iframe-form';
3
+ import FrameElement from '.';
4
+ export default class RevealComposableFrameElementInit {
5
+ #private;
6
+ iframeFormElement: IFrameFormElement | undefined;
7
+ clientMetaData: any;
8
+ frameElement: FrameElement;
9
+ private static frameEle?;
10
+ containerId: string;
11
+ group: any;
12
+ frameList: FrameElement[];
13
+ iframeFormList: IFrameFormElement[];
14
+ revealFrameList: any[];
15
+ rootDiv: HTMLDivElement;
16
+ constructor();
17
+ updateGroupData: () => void;
18
+ static startFrameElement: () => void;
19
+ revealData(revealRecords: IRevealRecordComposable[], containerId: any, authToken: any): Promise<unknown>;
20
+ createContainerDiv: (newGroup: any) => void;
21
+ }
@@ -10,7 +10,13 @@ export default class FrameElementInit {
10
10
  private static frameEle?;
11
11
  containerId: string;
12
12
  group: any;
13
+ frameList: FrameElement[];
14
+ iframeFormList: IFrameFormElement[];
13
15
  constructor();
16
+ private handleCollectCall;
17
+ private parallelUploadFiles;
18
+ uploadFiles: (fileElement: any, clientConfig: any) => Promise<unknown>;
19
+ private tokenize;
14
20
  updateGroupData: () => void;
15
21
  createIframeElement: (frameName: any, label: any, skyflowID: any, isRequired: any) => IFrameFormElement;
16
22
  static startFrameElement: () => void;
@@ -35,34 +35,7 @@ export default class IFrameFormElement extends EventEmitter {
35
35
  preserveFileName: boolean;
36
36
  allowedFileType: any;
37
37
  blockEmptyFiles: boolean;
38
- containerId: string;
39
- clientId: string;
40
38
  constructor(name: string, label: string, metaData: any, context: Context, skyflowID?: string);
41
- getProperties: () => {
42
- state: {
43
- value: any;
44
- isFocused: boolean;
45
- isValid: boolean;
46
- isEmpty: boolean;
47
- isComplete: boolean;
48
- name: string;
49
- isRequired: boolean;
50
- isTouched: boolean;
51
- selectedCardScheme: string;
52
- };
53
- value: any;
54
- fieldType: string;
55
- doesClientHasError: boolean;
56
- clientErrorText: string | undefined;
57
- errorText: string | undefined;
58
- onFocusChange: (focus: boolean) => void;
59
- setValue: (value?: any, valid?: boolean, isReset?: boolean) => void;
60
- validations: IValidationRule[] | undefined;
61
- isMatchEqual: (index: number, value: string, validation: IValidationRule) => boolean;
62
- tableName: string | undefined;
63
- skyflowID: string | undefined;
64
- preserveFileName: boolean;
65
- };
66
39
  isMatchEqual(index: number, value: string, validation: IValidationRule): boolean;
67
40
  checkMatch(index: number, validation: IValidationRule): void;
68
41
  listenForMatchRule(): void;
@@ -20,7 +20,8 @@ export default class FrameElement {
20
20
  private selectionStart?;
21
21
  private selectionEnd?;
22
22
  private selectedData?;
23
- constructor(iFrameFormElement: IFrameFormElement, options: any, htmlDivElement: HTMLDivElement);
23
+ private clientDomain;
24
+ constructor(iFrameFormElement: IFrameFormElement, options: any, htmlDivElement: HTMLDivElement, clientDomain?: string);
24
25
  mount: () => void;
25
26
  setupInputField(newValue?: boolean): void;
26
27
  updateParentDiv: (newDiv: HTMLDivElement) => void;
@@ -4,7 +4,12 @@ declare class RevealFrame {
4
4
  private domCopy?;
5
5
  private isRevealCalled?;
6
6
  static init(): void;
7
- constructor(record: any, context: any, id: any);
7
+ constructor(record: any, context: any, id: any, rootDiv?: any);
8
+ responseUpdate: (data: any) => void;
9
+ getConfig: () => void;
10
+ getData: () => any;
11
+ private sub2;
12
+ private renderFile;
8
13
  private getExtension;
9
14
  private addFileRender;
10
15
  private setRevealError;
@@ -5,8 +5,7 @@ declare class SkyflowFrameController {
5
5
  static init(clientId: any): SkyflowFrameController;
6
6
  revealData(revealRecords: IRevealRecord[], containerId: any): Promise<unknown>;
7
7
  insertData(records: any, options: any): Promise<unknown>;
8
- renderFile(data: any, iframeName: any, shadowRoot?: boolean): Promise<unknown>;
9
- getProperties(element: any, containerId: string): any;
8
+ renderFile(data: any, iframeName: any): Promise<unknown>;
10
9
  tokenize: (options: any) => Promise<unknown>;
11
10
  parallelUploadFiles: (options: any) => Promise<unknown>;
12
11
  uploadFiles: (fileElement: any) => Promise<unknown>;
@@ -28,5 +28,7 @@ export declare const constructElementsInsertReq: (req: any, update: any, options
28
28
  records?: undefined;
29
29
  })[];
30
30
  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>;
31
33
  export declare const checkForElementMatchRule: (validations: IValidationRule[]) => boolean;
32
34
  export declare const checkForValueMatch: (validations: IValidationRule[], element: IFrameFormElement) => boolean;
@@ -1,8 +1,10 @@
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, 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
+ export declare const getFileURLFromVaultBySkyflowIDComposable: (skyflowIdRecord: IRevealRecord, client: Client, authToken: string) => Promise<IRenderResponseType>;
5
6
  export declare const fetchRecordsByTokenId: (tokenIdRecords: IRevealRecord[], client: Client) => Promise<IRevealResponseType>;
7
+ export declare const fetchRecordsByTokenIdComposable: (tokenIdRecords: IRevealRecordComposable[], client: Client, authToken: string) => Promise<IRevealResponseType>;
6
8
  export declare const formatRecordsForIframe: (response: IRevealResponseType) => Record<string, string>;
7
9
  export declare const formatRecordsForRender: (response: IRenderResponseType, column: any, skyflowID: any) => {
8
10
  column: any;
@@ -26,5 +28,15 @@ export declare const formatRecordsForClient: (response: IRevealResponseType) =>
26
28
  errors: Record<string, any>[] | undefined;
27
29
  success?: undefined;
28
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
+ };
29
41
  export declare const fetchRecordsGET: (skyflowIdRecords: IGetRecord[], client: Client, options?: IGetOptions) => Promise<unknown>;
30
42
  export declare const fetchRecordsBySkyflowID: (skyflowIdRecords: ISkyflowIdRecord[], client: Client) => Promise<unknown>;
@@ -5,10 +5,12 @@ import SkyflowError from './libs/skyflow-error';
5
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';
6
6
  import ComposableContainer from './core/external/collect/compose-collect-container';
7
7
  import ThreeDS from './core/external/threeds/threeds';
8
+ import ComposableRevealContainer from './core/external/reveal/composable-reveal-container';
8
9
  export declare enum ContainerType {
9
10
  COLLECT = "COLLECT",
10
11
  REVEAL = "REVEAL",
11
- COMPOSABLE = "COMPOSABLE"
12
+ COMPOSABLE = "COMPOSABLE",
13
+ COMPOSE_REVEAL = "COMPOSABLE_REVEAL"
12
14
  }
13
15
  export interface ISkyflow {
14
16
  vaultID?: string;
@@ -23,6 +25,7 @@ declare class Skyflow {
23
25
  container(type: ContainerType.COLLECT, options?: ContainerOptions): CollectContainer;
24
26
  container(type: ContainerType.COMPOSABLE, options?: ContainerOptions): ComposableContainer;
25
27
  container(type: ContainerType.REVEAL, options?: ContainerOptions): RevealContainer;
28
+ container(type: ContainerType.COMPOSE_REVEAL, options?: ContainerOptions): ComposableRevealContainer;
26
29
  insert(records: IInsertRecordInput, options?: IInsertOptions): Promise<InsertResponse>;
27
30
  detokenize(detokenizeInput: IDetokenizeInput): Promise<DetokenizeResponse>;
28
31
  getById(getByIdInput: IGetByIdInput): Promise<GetByIdResponse>;
@@ -60,6 +60,14 @@ export interface IRevealRecord {
60
60
  skyflowID?: string;
61
61
  table?: string;
62
62
  }
63
+ export interface IRevealRecordComposable {
64
+ token?: string;
65
+ redaction?: RedactionType;
66
+ column?: string;
67
+ skyflowID?: string;
68
+ table?: string;
69
+ iframeName?: string;
70
+ }
63
71
  export interface IInsertResponse {
64
72
  records: IInsertResponseReocrds[];
65
73
  }
@@ -1,4 +1,8 @@
1
1
  declare const SKYFLOW_ERROR_CODE: {
2
+ INVALID_REVEAL_COMPOSABLE_INPUT: {
3
+ code: number;
4
+ description: string;
5
+ };
2
6
  INVALID_FILE_NAME: {
3
7
  code: number;
4
8
  description: string;
@@ -1,12 +1,10 @@
1
1
  declare const logs: {
2
2
  infoLogs: {
3
- TOKENIZE_REQUEST: string;
4
- TOKENIZE_REQUEST_INSERT: string;
5
- TOKENIZE_REQUEST_CREATED: string;
6
3
  INITIALIZE_CLIENT: string;
7
4
  CLIENT_INITIALIZED: string;
8
5
  CREATE_COLLECT_CONTAINER: string;
9
6
  COLLECT_CONTAINER_CREATED: string;
7
+ INITIALIZE_COMPOSABLE_CLIENT: string;
10
8
  CREATE_REVEAL_CONTAINER: string;
11
9
  REVEAL_CONTAINER_CREATED: string;
12
10
  VALIDATE_RECORDS: string;
@@ -77,7 +75,7 @@ declare const logs: {
77
75
  VALIDATE_GET_BY_ID_INPUT: string;
78
76
  };
79
77
  errorLogs: {
80
- FRAME_COLLECT_EMIT_TIMEOUT: string;
78
+ INVALID_REVEAL_COMPOSABLE_INPUT: string;
81
79
  NO_ELEMENTS_IN_COLLECT: string;
82
80
  NO_ELEMENTS_IN_COMPOSABLE: string;
83
81
  NO_ELEMENTS_IN_REVEAL: string;