skyflow-js 1.35.0 → 1.36.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
@@ -8,8 +8,10 @@
8
8
  "jcb.svg": "8062a86943450f142966.svg",
9
9
  "mastercard.svg": "08ad88dee7d4519954ec.svg",
10
10
  "diners-club.svg": "a9431336dd9f3e17b880.svg",
11
+ "carter-banceris.svg": "bcd5969a8a86792c2995.svg",
11
12
  "visa.svg": "cbee67fb3d652dad9e25.svg",
12
13
  "copyIcon.svg": "362f9fcc6011fc54c62f.svg",
13
14
  "path.svg": "54c18b6916f26474cce8.svg",
14
- "default.svg": "2afb5d11fb02e9292eaf.svg"
15
+ "default.svg": "2afb5d11fb02e9292eaf.svg",
16
+ "drop-down.svg": "83a53e5f338c1bd56555.svg"
15
17
  }
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.35.0",
5
+ "version": "1.36.0",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -1,3 +1,4 @@
1
+ export declare const SESSION_ID = "session_id";
1
2
  export declare const SKY_METADATA_HEADER = "sky-metadata";
2
3
  export declare const SDK_VERSION = "sdkVersion";
3
4
  export declare const COLLECT_FRAME_CONTROLLER = "collect_controller";
@@ -5,6 +6,53 @@ export declare const REVEAL_FRAME_CONTROLLER = "reveal_controller";
5
6
  export declare const SKYFLOW_FRAME_CONTROLLER = "skyflow_controller";
6
7
  export declare const FRAME_REVEAL = "reveal";
7
8
  export declare const FRAME_ELEMENT = "element";
9
+ export declare const ELEMENT_TYPES: {
10
+ COLLECT: string;
11
+ REVEAL: string;
12
+ COMPOSE: string;
13
+ };
14
+ export declare const EVENT_TYPES: {
15
+ MOUNTED: string;
16
+ READY: string;
17
+ };
18
+ export declare const STATUS_TYPES: {
19
+ SUCCESS: string;
20
+ INITIALIZED: string;
21
+ PARTIAL_RENDER: string;
22
+ FAILED: string;
23
+ };
24
+ export declare const METRIC_TYPES: {
25
+ ELEMENT_ID: string;
26
+ ELEMENT_TYPE: {
27
+ COLLECT: string;
28
+ REVEAL: string;
29
+ COMPOSE: string;
30
+ };
31
+ ELEMENT_TYPE_KEY: string;
32
+ DIV_ID: string;
33
+ CONTAINER_ID: string;
34
+ CONTAINER_NAME: string;
35
+ SESSION_ID: string;
36
+ VAULT_ID: string;
37
+ VAULT_URL: string;
38
+ EVENTS: {
39
+ MOUNTED: string;
40
+ READY: string;
41
+ };
42
+ EVENTS_KEY: string;
43
+ CREATED_AT: string;
44
+ REGION: string;
45
+ MOUNT_START_TIME: string;
46
+ MOUNT_END_TIME: string;
47
+ ERROR: string;
48
+ LATENCY: string;
49
+ STATUS: {
50
+ SUCCESS: string;
51
+ INITIALIZED: string;
52
+ PARTIAL_RENDER: string;
53
+ FAILED: string;
54
+ };
55
+ };
8
56
  export declare const PUREJS_TYPES: {
9
57
  INSERT: string;
10
58
  DETOKENIZE: string;
@@ -53,6 +101,7 @@ export declare const ELEMENT_EVENTS_TO_IFRAME: {
53
101
  COMPOSABLE_UPDATE_OPTIONS: string;
54
102
  RENDER_FILE_RESPONSE_READY: string;
55
103
  RENDER_FILE_REQUEST: string;
104
+ PUSH_EVENT: string;
56
105
  };
57
106
  export declare const REVEAL_ELEMENT_OPTIONS_TYPES: {
58
107
  TOKEN: string;
@@ -89,8 +138,23 @@ export declare enum CardType {
89
138
  UNIONPAY = "UNIONPAY",
90
139
  HIPERCARD = "HIPERCARD",
91
140
  DEFAULT = "DEFAULT",
92
- UNKNOWN = "UNKNOWN"
141
+ UNKNOWN = "UNKNOWN",
142
+ CARTES_BANCAIRES = "CARTES BANCAIRES"
93
143
  }
144
+ export declare const CardTypeValues: {
145
+ VISA: string;
146
+ MASTERCARD: string;
147
+ AMEX: string;
148
+ DINERS_CLUB: string;
149
+ DISCOVER: string;
150
+ JCB: string;
151
+ MAESTRO: string;
152
+ UNIONPAY: string;
153
+ HIPERCARD: string;
154
+ DEFAULT: string;
155
+ UNKNOWN: string;
156
+ "CARTES BANCAIRES": string;
157
+ };
94
158
  export declare const CARD_NUMBER_MASK: {
95
159
  AMEX: (string | {
96
160
  X: string;
@@ -287,7 +351,9 @@ export declare const INPUT_WITH_ICON_DEFAULT_STYLES: {
287
351
  'text-indent': string;
288
352
  padding: string;
289
353
  };
290
- export declare const INPUT_ICON_STYLES = "position: absolute; left:8px; bottom:calc(50% - 12px)";
354
+ export declare const INPUT_ICON_STYLES = "position: absolute; left:8px; bottom:calc(50% - 12px); cursor:pointer;";
355
+ export declare const DROPDOWN_ICON_STYLES = "position: absolute; left:46px; bottom:calc(50% - 12px);cursor:pointer;display:none;";
356
+ export declare const DROPDOWN_STYLES = "position: absolute; left:8px; bottom:calc(50% - 12px);appearance: none;padding: unset; box-shadow: none;background: transparent;cursor:pointer;outline:none;opacity:0;width:54px;";
291
357
  export declare const COLLECT_COPY_ICON_STYLES = "position: absolute; right:8px; bottom:calc(50% - 12px); cursor:pointer;";
292
358
  export declare const REVEAL_COPY_ICON_STYLES = "position: absolute; right:8px; top:calc(50% - 12px); cursor:pointer;";
293
359
  export declare const ERROR_TEXT_STYLES: {
@@ -409,6 +475,7 @@ export declare const DEFAULT_CARD_LENGTH_RANGE: number[];
409
475
  export declare const CARD_ENCODED_ICONS: {
410
476
  DEFAULT: any;
411
477
  AMEX: any;
478
+ "CARTES BANCAIRES": any;
412
479
  DINERS_CLUB: any;
413
480
  DISCOVER: any;
414
481
  HIPERCARD: any;
@@ -495,3 +562,4 @@ export declare const DEFAULT_INPUT_FORMAT_TRANSLATION: {
495
562
  };
496
563
  export declare const DEFAULT_FILE_RENDER_ERROR = "File rendering failed. Please try again later.";
497
564
  export declare const FILE_DOWNLOAD_URL_PARAM = "downloadURL=true&contentDisposition=INLINE";
565
+ export declare const DROP_DOWN_ICON: any;
@@ -21,6 +21,7 @@ declare class CollectElement extends SkyflowElement {
21
21
  isFocused: boolean;
22
22
  value: string | Object | Blob | undefined;
23
23
  required: boolean;
24
+ selectedCardScheme: string;
24
25
  };
25
26
  getOptions: () => any;
26
27
  on(eventName: string, handler: any): void;
@@ -4,7 +4,7 @@ export default class IFrame {
4
4
  iframe: HTMLIFrameElement;
5
5
  container?: Element;
6
6
  constructor(name: any, metadata: any, containerId: any, logLevel: any);
7
- mount: (domElement: any) => void;
7
+ mount: (domElement: any, elementId?: string) => void;
8
8
  setIframeHeight: (height: any) => void;
9
9
  unmount: () => void;
10
10
  }
@@ -10,6 +10,7 @@ export declare class IFrameFormElement extends EventEmitter {
10
10
  name: string;
11
11
  isRequired: boolean;
12
12
  isTouched: boolean;
13
+ selectedCardScheme: string;
13
14
  };
14
15
  readonly fieldType: string;
15
16
  private sensitive;
@@ -33,6 +34,7 @@ export declare class IFrameFormElement extends EventEmitter {
33
34
  preserveFileName: boolean;
34
35
  constructor(name: string, label: string, metaData: any, context: Context, skyflowID?: string);
35
36
  onFocusChange: (focus: boolean) => void;
37
+ onDropdownSelect: (cardType: string) => void;
36
38
  changeFocus: (focus: boolean) => void;
37
39
  setReplacePattern(pattern: string[]): void;
38
40
  setMask(mask: string[]): void;
@@ -43,6 +45,7 @@ export declare class IFrameFormElement extends EventEmitter {
43
45
  getValue: () => any;
44
46
  getUnformattedValue: () => any;
45
47
  getStatus: () => {
48
+ selectedCardScheme?: string | undefined;
46
49
  isFocused: boolean;
47
50
  isValid: boolean;
48
51
  isEmpty: boolean;
@@ -23,6 +23,8 @@ export declare class FrameElement {
23
23
  private hasError?;
24
24
  private labelDiv?;
25
25
  private isRequiredLabel?;
26
+ private dropdownIcon?;
27
+ private dropdownSelect?;
26
28
  constructor(iFrameFormElement: IFrameFormElement, options: any, htmlDivElement: HTMLDivElement);
27
29
  mount: () => void;
28
30
  setupInputField(newValue?: boolean): void;
@@ -48,4 +50,5 @@ export declare class FrameElement {
48
50
  setClass(types: string[], dom?: HTMLElement, preText?: string): void;
49
51
  updateOptions(options: any): void;
50
52
  private applyMask;
53
+ private appendDropdown;
51
54
  }
@@ -5,5 +5,6 @@ declare class SkyflowFrameController {
5
5
  static init(clientId: any): SkyflowFrameController;
6
6
  insertData(records: any, options: any): Promise<unknown>;
7
7
  renderFile(data: IRevealRecord, containerId: any, iframeName: any): Promise<unknown>;
8
+ pushEvent(event: any): Promise<unknown>;
8
9
  }
9
10
  export default SkyflowFrameController;
@@ -0,0 +1,7 @@
1
+ import { MeticsObjectType, SharedMeticsObjectType } from '../utils/common';
2
+ export declare const METRIC_OBJECT: SharedMeticsObjectType;
3
+ export declare function initalizeMetricObject(metadata: any, elementId: string): void;
4
+ export declare function updateMetricObjectValue(id: string, key: string, value: any): void;
5
+ export declare function getEventStatus(metricEvent: MeticsObjectType): string;
6
+ export declare function pushEventToMixpanel(elementId: string): void;
7
+ export declare function pushElementEventWithTimeout(elementID: string): void;
@@ -1,4 +1,4 @@
1
- import { ElementType } from './core/constants';
1
+ 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 { IRevealResponseType, RequestMethod, IInsertRecordInput, IDetokenizeInput, IGetInput, RedactionType, EventName, Env, LogLevel, ValidationRuleType, IGetByIdInput, IInsertOptions, IDeleteRecordInput, IDeleteOptions, IGetOptions } from './utils/common';
@@ -32,5 +32,6 @@ declare class Skyflow {
32
32
  static get EventName(): typeof EventName;
33
33
  static get Env(): typeof Env;
34
34
  static get ValidationRuleType(): typeof ValidationRuleType;
35
+ static get CardType(): typeof CardType;
35
36
  }
36
37
  export default Skyflow;
@@ -123,3 +123,28 @@ export interface IDeleteResponseType {
123
123
  records?: Record<string, string>[];
124
124
  errors?: Record<string, any>[];
125
125
  }
126
+ export interface MeticsObjectType {
127
+ element_id: string;
128
+ element_type: string[];
129
+ div_id: string;
130
+ container_id: string;
131
+ container_name: string;
132
+ session_id: string;
133
+ vault_id: string;
134
+ vault_url: string;
135
+ events: string[];
136
+ created_at: number;
137
+ region: string;
138
+ mount_start_time?: number;
139
+ mount_end_time?: number;
140
+ error?: string;
141
+ latency?: number;
142
+ status: 'SUCCESS' | 'INITIALIZED' | 'PARTIAL_RENDER' | 'FAILED' | string;
143
+ sdk_name_version: string;
144
+ sdk_client_device_model: string | undefined;
145
+ sdk_client_os_details: string;
146
+ sdk_runtime_details: string;
147
+ }
148
+ export interface SharedMeticsObjectType {
149
+ records: MeticsObjectType[];
150
+ }
@@ -699,5 +699,13 @@ declare const SKYFLOW_ERROR_CODE: {
699
699
  code: number;
700
700
  description: string;
701
701
  };
702
+ INVALID_OPTION_CARD_METADATA: {
703
+ code: number;
704
+ description: string;
705
+ };
706
+ INVALID_OPTION_CARD_SCHEME: {
707
+ code: number;
708
+ description: string;
709
+ };
702
710
  };
703
711
  export default SKYFLOW_ERROR_CODE;
@@ -49,5 +49,6 @@ export declare function getMetaObject(sdkDetails: any, metaData: any, navigator:
49
49
  sdk_runtime_details: string;
50
50
  };
51
51
  export declare function checkAndSetForCustomUrl(config: ISkyflow): void;
52
+ export declare function getVaultBeffeURL(vaultURL: string): string;
52
53
  export declare const generateUploadFileName: (fileName: string) => string;
53
54
  export {};
@@ -47,6 +47,9 @@ declare const logs: {
47
47
  DELETE_RESOLVED: string;
48
48
  EMIT_EVENT: string;
49
49
  CAPTURE_EVENT: string;
50
+ METRIC_CAPTURE_EVENT: string;
51
+ UNKNOWN_METRIC_CAPTURE_EVENT: string;
52
+ UNKNOWN_RESPONSE_FROM_METRIC_EVENT: string;
50
53
  LISTEN_COLLECT_FRAME_READY: string;
51
54
  EMIT_COLLECT_ELEMENT_FRAME_READY: string;
52
55
  ENTERED_COLLECT_FRAME_READY_CB: string;
@@ -267,6 +270,8 @@ declare const logs: {
267
270
  INVALID_ALLOWED_OPTIONS: string;
268
271
  EMPTY_ALLOWED_OPTIONS_ARRAY: string;
269
272
  INVALID_ALLOWED_FILETYPE_ARRAY: string;
273
+ INVALID_OPTION_CARD_METADATA: string;
274
+ INVALID_OPTION_CARD_SCHEME: string;
270
275
  };
271
276
  warnLogs: {
272
277
  INVALID_EXPIRATION_DATE_FORMAT: string;