skyflow-js 1.17.0 → 1.19.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.
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": "1.17.0",
5
+ "version": "1.19.0",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -42,6 +42,7 @@ export declare const ELEMENT_EVENTS_TO_IFRAME: {
42
42
  COLLECT_ELEMENT_SET_ERROR: string;
43
43
  REVEAL_ELEMENT_SET_ERROR: string;
44
44
  REVEAL_ELEMENT_UPDATE_OPTIONS: string;
45
+ FILE_UPLOAD: string;
45
46
  };
46
47
  export declare const REVEAL_ELEMENT_OPTIONS_TYPES: {
47
48
  TOKEN: string;
@@ -59,7 +60,8 @@ export declare enum ElementType {
59
60
  INPUT_FIELD = "INPUT_FIELD",
60
61
  PIN = "PIN",
61
62
  EXPIRATION_MONTH = "EXPIRATION_MONTH",
62
- EXPIRATION_YEAR = "EXPIRATION_YEAR"
63
+ EXPIRATION_YEAR = "EXPIRATION_YEAR",
64
+ FILE_INPUT = "FILE_INPUT"
63
65
  }
64
66
  export declare enum CardType {
65
67
  VISA = "VISA",
@@ -214,6 +216,13 @@ export declare const ELEMENTS: {
214
216
  sensitive: boolean;
215
217
  regex: RegExp;
216
218
  };
219
+ FILE_INPUT: {
220
+ name: string;
221
+ sensitive: boolean;
222
+ attributes: {
223
+ type: string;
224
+ };
225
+ };
217
226
  };
218
227
  export declare const IFRAME_DEFAULT_STYLES: {
219
228
  height: string;
@@ -253,7 +262,9 @@ export declare const INPUT_WITH_ICON_DEFAULT_STYLES: {
253
262
  'text-indent': string;
254
263
  padding: string;
255
264
  };
256
- export declare const INPUT_ICON_STYLES = "position: absolute; left:8px; top:calc(50% - 12px)";
265
+ export declare const INPUT_ICON_STYLES = "position: absolute; left:8px; top:calc(50% - 10px)";
266
+ export declare const COLLECT_COPY_ICON_STYLES = "position: absolute; right:8px; top:calc(50% - 10px); cursor:pointer;";
267
+ export declare const REVEAL_COPY_ICON_STYLES = "position: absolute; right:8px; top:calc(50% - 16px); cursor:pointer;";
257
268
  export declare const ERROR_TEXT_STYLES: {
258
269
  color: string;
259
270
  padding: string;
@@ -359,6 +370,12 @@ export declare const CARD_ENCODED_ICONS: {
359
370
  UNIONPAY: any;
360
371
  VISA: any;
361
372
  };
373
+ export declare const COPY_UTILS: {
374
+ copyIcon: any;
375
+ successIcon: any;
376
+ toCopy: string;
377
+ copied: string;
378
+ };
362
379
  export declare const EXPIRY_DATE_MASK: {
363
380
  'MM/YYYY': (string | {
364
381
  Y: string;
@@ -13,6 +13,7 @@ export interface CollectElementInput {
13
13
  type: ElementType;
14
14
  altText?: string;
15
15
  validations?: IValidationRule[];
16
+ skyflowID?: string;
16
17
  }
17
18
  interface ICollectOptions {
18
19
  tokens?: boolean;
@@ -23,5 +24,6 @@ declare class CollectContainer extends Container {
23
24
  constructor(options: any, metaData: any, skyflowElements: any, context: any);
24
25
  create: (input: CollectElementInput, options?: any) => CollectElement;
25
26
  collect: (options?: ICollectOptions) => Promise<unknown>;
27
+ uploadFiles: (options: any) => Promise<unknown>;
26
28
  }
27
29
  export default CollectContainer;
@@ -14,7 +14,7 @@ declare class CollectElement extends SkyflowElement {
14
14
  isComplete: boolean;
15
15
  isValid: boolean;
16
16
  isFocused: boolean;
17
- value: string | Object | undefined;
17
+ value: string | Object | Blob | undefined;
18
18
  };
19
19
  getOptions: () => any;
20
20
  on(eventName: string, handler: any): void;
@@ -13,6 +13,7 @@ export interface IRevealElementInput {
13
13
  export interface IRevealElementOptions {
14
14
  formatRegex?: string | object;
15
15
  replaceText?: string;
16
+ enableCopy?: boolean;
16
17
  }
17
18
  declare class RevealContainer extends Container {
18
19
  #private;
@@ -2,7 +2,7 @@ import EventEmitter from '../../../event-emitter';
2
2
  import { Context, IValidationRule, LogLevel } from '../../../utils/common';
3
3
  export declare class IFrameFormElement extends EventEmitter {
4
4
  state: {
5
- value: string | undefined;
5
+ value: any;
6
6
  isFocused: boolean;
7
7
  isValid: boolean;
8
8
  isEmpty: boolean;
@@ -25,7 +25,8 @@ export declare class IFrameFormElement extends EventEmitter {
25
25
  doesClientHasError: boolean;
26
26
  clientErrorText: string | undefined;
27
27
  format: string;
28
- constructor(name: string, label: string, metaData: any, context: Context);
28
+ skyflowID?: string;
29
+ constructor(name: string, label: string, metaData: any, context: Context, skyflowID?: string);
29
30
  onFocusChange: (focus: boolean) => void;
30
31
  changeFocus: (focus: boolean) => void;
31
32
  setReplacePattern(pattern: string[]): void;
@@ -33,17 +34,17 @@ export declare class IFrameFormElement extends EventEmitter {
33
34
  setValidation(validations: IValidationRule[] | undefined): void;
34
35
  setFormat(format: string): void;
35
36
  setSensitive(sensitive?: boolean): void;
36
- setValue: (value?: string, valid?: boolean) => void;
37
- getValue: () => string | undefined;
38
- getUnformattedValue: () => string | undefined;
37
+ setValue: (value: any, valid?: boolean) => void;
38
+ getValue: () => any;
39
+ getUnformattedValue: () => any;
39
40
  getStatus: () => {
40
41
  isFocused: boolean;
41
42
  isValid: boolean;
42
43
  isEmpty: boolean;
43
44
  isComplete: boolean;
44
- value: string | undefined;
45
+ value: string | Blob | undefined;
45
46
  };
46
- validator(value: string): boolean;
47
+ validator(value: any): boolean;
47
48
  validateCustomValidations(value: string): boolean;
48
49
  collectBusEvents: () => void;
49
50
  sendChangeStatus: (inputEvent?: boolean) => void;
@@ -64,6 +65,8 @@ export declare class IFrameForm {
64
65
  setClientMetadata(clientMetaData: any): void;
65
66
  setContext(context: Context): void;
66
67
  private getOrCreateIFrameFormElement;
68
+ paralleUploadFiles: () => Promise<unknown>;
69
+ uploadFiles: (fileElement: any) => Promise<unknown>;
67
70
  tokenize: (options: any) => Promise<unknown>;
68
71
  private initializeFrame;
69
72
  }
@@ -19,6 +19,9 @@ export declare class FrameElement {
19
19
  private domError?;
20
20
  private domImg?;
21
21
  private inputParent?;
22
+ private domCopy?;
23
+ private copyText?;
24
+ private hasError?;
22
25
  constructor(iFrameFormElement: IFrameFormElement, options: any, htmlDivElement: HTMLDivElement);
23
26
  mount: () => void;
24
27
  setupInputField(newValue?: boolean): void;
@@ -1,6 +1,8 @@
1
1
  declare class RevealFrame {
2
2
  #private;
3
3
  static revealFrame: RevealFrame;
4
+ private domCopy?;
5
+ private isRevealCalled?;
4
6
  static init(): void;
5
7
  constructor(record: any, context: any);
6
8
  private setRevealError;
@@ -3,6 +3,7 @@ export declare const constructInsertRecordRequest: (records: IInsertRecordInput,
3
3
  export declare const constructInsertRecordResponse: (responseBody: any, tokens: boolean, records: IInsertRecord[]) => {
4
4
  records: any;
5
5
  };
6
+ export declare const constructUploadResponse: (response: any) => any;
6
7
  export declare const constructElementsInsertReq: (req: any, options: any) => {
7
8
  records: IInsertRecord[];
8
9
  };
@@ -4,6 +4,7 @@ export declare const iframeDefaultAttributes: {
4
4
  allowtransparency: boolean;
5
5
  scrolling: string;
6
6
  style: string;
7
+ allow: string;
7
8
  };
8
9
  export declare const setAttributes: (element: any, attributes: any) => void;
9
10
  declare const _default: (options?: {}) => HTMLIFrameElement;
@@ -495,5 +495,9 @@ declare const SKYFLOW_ERROR_CODE: {
495
495
  code: number;
496
496
  description: string;
497
497
  };
498
+ INVALID_FILE_TYPE: {
499
+ code: number;
500
+ description: string;
501
+ };
498
502
  };
499
503
  export default SKYFLOW_ERROR_CODE;
@@ -24,4 +24,7 @@ export declare function updateRequestBodyInConnection(config: IConnectionConfig)
24
24
  responseBody?: any;
25
25
  };
26
26
  export declare const appendZeroToOne: (value: any) => any;
27
- export declare const getReturnValue: (value: string, element: string, doesReturnValue: boolean) => string | undefined;
27
+ export declare const getReturnValue: (value: string | Blob, element: string, doesReturnValue: boolean) => string | Blob | undefined;
28
+ export declare const copyToClipboard: (text: string) => void;
29
+ export declare const handleCopyIconClick: (textToCopy: string, domCopy: any) => void;
30
+ export declare const fileValidation: (value: any) => boolean;
@@ -205,6 +205,7 @@ declare const logs: {
205
205
  INVALID_PATH_IN_ARRAY_RES_XML: string;
206
206
  INVALID_FORMAT_REGEX: string;
207
207
  INVALID_REPLACE_TEXT_TYPE: string;
208
+ INVALID_FILE_TYPE: string;
208
209
  };
209
210
  warnLogs: {
210
211
  INVALID_EXPIRATION_DATE_FORMAT: string;
@@ -19,7 +19,7 @@ export declare const isValidURL: (url: string) => boolean;
19
19
  export declare const isValidRegExp: (input: any) => boolean;
20
20
  export declare const validateRevealOptions: (options: IRevealElementOptions) => void;
21
21
  export declare const validateConnectionConfig: (config: IConnectionConfig, initConfig: ISkyflow) => void;
22
- export declare const validateCardNumberLengthCheck: (cardNumber: string) => boolean;
22
+ export declare const validateCardNumberLengthCheck: (cardNumber?: string) => boolean;
23
23
  export declare const validateInitConfig: (initConfig: ISkyflow) => void;
24
24
  export declare const validateInitConfigInConnections: (initConfig: ISkyflow) => void;
25
25
  export declare const validateCollectElementInput: (input: CollectElementInput, logLevel: any) => void;