skyflow-js 1.12.2 → 1.15.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.12.2",
5
+ "version": "1.15.0",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -44,6 +44,7 @@
44
44
  "jwt-decode": "^3.1.2",
45
45
  "lodash": "^4.17.21",
46
46
  "node-polyfill-webpack-plugin": "^1.1.4",
47
+ "qs": "^6.10.3",
47
48
  "regex-parser": "^2.2.11",
48
49
  "set-value": "^4.0.1",
49
50
  "xml-js": "^1.6.11"
@@ -1,6 +1,6 @@
1
1
  import { ISkyflow } from '../Skyflow';
2
2
  export interface IClientRequest {
3
- body?: Record<string, any>;
3
+ body?: any;
4
4
  headers?: Record<string, string>;
5
5
  requestMethod: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'PATCH';
6
6
  url: string;
@@ -57,7 +57,9 @@ export declare enum ElementType {
57
57
  CARD_NUMBER = "CARD_NUMBER",
58
58
  CARDHOLDER_NAME = "CARDHOLDER_NAME",
59
59
  INPUT_FIELD = "INPUT_FIELD",
60
- PIN = "PIN"
60
+ PIN = "PIN",
61
+ EXPIRATION_MONTH = "EXPIRATION_MONTH",
62
+ EXPIRATION_YEAR = "EXPIRATION_YEAR"
61
63
  }
62
64
  export declare enum CardType {
63
65
  VISA = "VISA",
@@ -69,7 +71,8 @@ export declare enum CardType {
69
71
  MAESTRO = "MAESTRO",
70
72
  UNIONPAY = "UNIONPAY",
71
73
  HIPERCARD = "HIPERCARD",
72
- DEFAULT = "DEFAULT"
74
+ DEFAULT = "DEFAULT",
75
+ UNKNOWN = "UNKNOWN"
73
76
  }
74
77
  export declare const CARD_NUMBER_MASK: {
75
78
  AMEX: (string | {
@@ -102,6 +105,9 @@ export declare const CARD_NUMBER_MASK: {
102
105
  DEFAULT: (string | {
103
106
  X: string;
104
107
  })[];
108
+ UNKNOWN: (string | {
109
+ X: string;
110
+ })[];
105
111
  };
106
112
  export declare const ELEMENTS: {
107
113
  textarea: {
@@ -161,6 +167,27 @@ export declare const ELEMENTS: {
161
167
  };
162
168
  sensitive: boolean;
163
169
  };
170
+ EXPIRATION_MONTH: {
171
+ name: string;
172
+ attributes: {
173
+ maxLength: number;
174
+ type: string;
175
+ autocomplete: string;
176
+ };
177
+ sensitive: boolean;
178
+ mask: (string | {
179
+ X: string;
180
+ })[];
181
+ };
182
+ EXPIRATION_YEAR: {
183
+ name: string;
184
+ attributes: {
185
+ maxLength: number;
186
+ type: string;
187
+ autocomplete: string;
188
+ };
189
+ sensitive: boolean;
190
+ };
164
191
  CVV: {
165
192
  name: string;
166
193
  attributes: {
@@ -226,7 +253,7 @@ export declare const INPUT_WITH_ICON_DEFAULT_STYLES: {
226
253
  'text-indent': string;
227
254
  padding: string;
228
255
  };
229
- export declare const INPUT_ICON_STYLES = "position: absolute; left:8px; top:calc(50% - 10px)";
256
+ export declare const INPUT_ICON_STYLES = "position: absolute; left:8px; top:calc(50% - 12px)";
230
257
  export declare const ERROR_TEXT_STYLES: {
231
258
  color: string;
232
259
  padding: string;
@@ -334,24 +361,30 @@ export declare const CARD_ENCODED_ICONS: {
334
361
  };
335
362
  export declare const EXPIRY_DATE_MASK: {
336
363
  'MM/YYYY': (string | {
337
- X: string;
338
364
  Y: string;
339
365
  })[];
340
366
  'MM/YY': (string | {
341
- X: string;
342
367
  Y: string;
343
368
  })[];
344
369
  'YYYY/MM': (string | {
345
- X: string;
346
370
  Y: string;
347
371
  })[];
348
372
  'YY/MM': (string | {
349
- X: string;
373
+ Y: string;
374
+ })[];
375
+ };
376
+ export declare const EXPIRY_YEAR_MASK: {
377
+ YYYY: (string | {
378
+ Y: string;
379
+ })[];
380
+ YY: (string | {
350
381
  Y: string;
351
382
  })[];
352
383
  };
353
384
  export declare const DEFAULT_EXPIRATION_DATE_FORMAT = "MM/YY";
354
385
  export declare const ALLOWED_EXPIRY_DATE_FORMATS: string[];
386
+ export declare const DEFAULT_EXPIRATION_YEAR_FORMAT = "YY";
387
+ export declare const ALLOWED_EXPIRY_YEAR_FORMATS: string[];
355
388
  export declare const soapReqXmlErrors: {
356
389
  code: number;
357
390
  description: string;
@@ -363,3 +396,10 @@ export declare const soapResXmlErrors: {
363
396
  export declare const PATH_NOT_FOUND_IN_RES_XML = "skyflow: Path not found";
364
397
  export declare const FORMAT_REGEX = ":FORMAT_REGEX:";
365
398
  export declare const REPLACE_TEXT = ":REPLACE_TEXT:";
399
+ export declare enum ContentType {
400
+ APPLICATIONORJSON = "application/json",
401
+ TEXTORPLAIN = "text/plain",
402
+ TEXTORXML = "text/xml",
403
+ FORMURLENCODED = "application/x-www-form-urlencoded",
404
+ FORMDATA = "multipart/form-data"
405
+ }
@@ -24,14 +24,14 @@ export declare class IFrameFormElement extends EventEmitter {
24
24
  label?: string;
25
25
  doesClientHasError: boolean;
26
26
  clientErrorText: string | undefined;
27
- expirationDateFormat: string;
27
+ format: string;
28
28
  constructor(name: string, label: string, metaData: any, context: Context);
29
29
  onFocusChange: (focus: boolean) => void;
30
30
  changeFocus: (focus: boolean) => void;
31
31
  setReplacePattern(pattern: string[]): void;
32
32
  setMask(mask: string[]): void;
33
33
  setValidation(validations: IValidationRule[] | undefined): void;
34
- setExpirationDateFormat(format: string): void;
34
+ setFormat(format: string): void;
35
35
  setSensitive(sensitive?: boolean): void;
36
36
  setValue: (value?: string, valid?: boolean) => void;
37
37
  getValue: () => string | undefined;
@@ -1,3 +1,4 @@
1
1
  export declare function getCollectElementValue(key: any, elementIframename: any): Promise<unknown>;
2
2
  export declare function getRevealElementValue(key: any, revealFrameName: any, client: any): Promise<unknown>;
3
3
  export declare function getAccessToken(clientId: any): Promise<unknown>;
4
+ export declare function updateElementState(frameName: string, value: any): void;
@@ -1,3 +1,4 @@
1
+ import { IConnectionConfig } from '../common';
1
2
  export declare const flattenObject: (obj: any, roots?: any, sep?: string) => any;
2
3
  export declare function deletePropertyPath(obj: any, path: any): void;
3
4
  export declare function clearEmpties(o: any): void;
@@ -13,3 +14,13 @@ export declare function replaceIframeNameWithValues(requestXml: string, elementV
13
14
  export declare function lowercaseKeys(obj: {
14
15
  [key: string]: any;
15
16
  }): any;
17
+ export declare function updateRequestBodyInConnection(config: IConnectionConfig): {
18
+ connectionURL: string;
19
+ methodName: import("../common").RequestMethod;
20
+ pathParams?: any;
21
+ queryParams?: any;
22
+ requestBody?: any;
23
+ requestHeader?: any;
24
+ responseBody?: any;
25
+ };
26
+ export declare const appendZeroToOne: (value: any) => any;
@@ -208,10 +208,12 @@ declare const logs: {
208
208
  };
209
209
  warnLogs: {
210
210
  INVALID_EXPIRATION_DATE_FORMAT: string;
211
+ INVALID_EXPIRATION_YEAR_FORMAT: string;
211
212
  UNABLE_TO_SET_VALUE_IN_PROD_ENV: string;
212
213
  UNABLE_TO_CLEAR_VALUE_IN_PROD_ENV: string;
213
214
  COLLECT_ALT_TEXT_DEPERECATED: string;
214
215
  NO_MATCH_FOUND_FOR_FORMAT_REGEX: string;
216
+ DEPRECATE_INVOKE_CONNECTION: string;
215
217
  };
216
218
  };
217
219
  export default logs;
@@ -6,7 +6,10 @@ import { IInsertRecordInput, IDetokenizeInput, IGetByIdInput, IConnectionConfig,
6
6
  export declare const validateCreditCardNumber: (cardNumber: string) => boolean;
7
7
  export declare const detectCardType: (cardNumber: string) => CardType.DEFAULT;
8
8
  export declare const validateExpiryDate: (date: string, format: string) => boolean;
9
+ export declare const validateExpiryYear: (year: string, format: string) => boolean;
10
+ export declare const validateExpiryMonth: (month: string) => boolean;
9
11
  export declare const isValidExpiryDateFormat: (format: string) => boolean;
12
+ export declare const isValidExpiryYearFormat: (format: string) => boolean;
10
13
  export declare const validateInsertRecords: (recordObj: IInsertRecordInput, options: any) => void;
11
14
  export declare const validateAdditionalFieldsInCollect: (recordObj: IInsertRecordInput) => void;
12
15
  export declare const validateDetokenizeInput: (detokenizeInput: IDetokenizeInput) => void;