skyflow-js 1.12.1 → 1.14.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.1",
5
+ "version": "1.14.0",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -12,6 +12,7 @@
12
12
  "dist/sdkNodeBuild",
13
13
  "types"
14
14
  ],
15
+ "license": "MIT",
15
16
  "keywords": [
16
17
  "client",
17
18
  "sdk",
@@ -43,6 +44,7 @@
43
44
  "jwt-decode": "^3.1.2",
44
45
  "lodash": "^4.17.21",
45
46
  "node-polyfill-webpack-plugin": "^1.1.4",
47
+ "qs": "^6.10.3",
46
48
  "regex-parser": "^2.2.11",
47
49
  "set-value": "^4.0.1",
48
50
  "xml-js": "^1.6.11"
@@ -71,7 +73,7 @@
71
73
  "eslint": "^7.32.0",
72
74
  "eslint-config-airbnb-base": "^14.2.1",
73
75
  "eslint-config-airbnb-typescript": "^14.0.0",
74
- "eslint-plugin-import": "^2.24.2",
76
+ "eslint-plugin-import": "^2.25.4",
75
77
  "fork-ts-checker-webpack-plugin": "^6.3.2",
76
78
  "html-webpack-plugin": "^5.5.0",
77
79
  "jest": "^27.2.1",
@@ -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",
@@ -161,6 +163,27 @@ export declare const ELEMENTS: {
161
163
  };
162
164
  sensitive: boolean;
163
165
  };
166
+ EXPIRATION_MONTH: {
167
+ name: string;
168
+ attributes: {
169
+ maxLength: number;
170
+ type: string;
171
+ autocomplete: string;
172
+ };
173
+ sensitive: boolean;
174
+ mask: (string | {
175
+ X: string;
176
+ })[];
177
+ };
178
+ EXPIRATION_YEAR: {
179
+ name: string;
180
+ attributes: {
181
+ maxLength: number;
182
+ type: string;
183
+ autocomplete: string;
184
+ };
185
+ sensitive: boolean;
186
+ };
164
187
  CVV: {
165
188
  name: string;
166
189
  attributes: {
@@ -334,24 +357,30 @@ export declare const CARD_ENCODED_ICONS: {
334
357
  };
335
358
  export declare const EXPIRY_DATE_MASK: {
336
359
  'MM/YYYY': (string | {
337
- X: string;
338
360
  Y: string;
339
361
  })[];
340
362
  'MM/YY': (string | {
341
- X: string;
342
363
  Y: string;
343
364
  })[];
344
365
  'YYYY/MM': (string | {
345
- X: string;
346
366
  Y: string;
347
367
  })[];
348
368
  'YY/MM': (string | {
349
- X: string;
369
+ Y: string;
370
+ })[];
371
+ };
372
+ export declare const EXPIRY_YEAR_MASK: {
373
+ YYYY: (string | {
374
+ Y: string;
375
+ })[];
376
+ YY: (string | {
350
377
  Y: string;
351
378
  })[];
352
379
  };
353
380
  export declare const DEFAULT_EXPIRATION_DATE_FORMAT = "MM/YY";
354
381
  export declare const ALLOWED_EXPIRY_DATE_FORMATS: string[];
382
+ export declare const DEFAULT_EXPIRATION_YEAR_FORMAT = "YY";
383
+ export declare const ALLOWED_EXPIRY_YEAR_FORMATS: string[];
355
384
  export declare const soapReqXmlErrors: {
356
385
  code: number;
357
386
  description: string;
@@ -363,3 +392,10 @@ export declare const soapResXmlErrors: {
363
392
  export declare const PATH_NOT_FOUND_IN_RES_XML = "skyflow: Path not found";
364
393
  export declare const FORMAT_REGEX = ":FORMAT_REGEX:";
365
394
  export declare const REPLACE_TEXT = ":REPLACE_TEXT:";
395
+ export declare enum ContentType {
396
+ APPLICATIONORJSON = "application/json",
397
+ TEXTORPLAIN = "text/plain",
398
+ TEXTORXML = "text/xml",
399
+ FORMURLENCODED = "application/x-www-form-urlencoded",
400
+ FORMDATA = "multipart/form-data"
401
+ }
@@ -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;
@@ -10,3 +11,15 @@ export declare function replaceIdInXml(xml: string, elementLookup: any, errors:
10
11
  export declare function replaceIdInResponseXml(xml: string, elementLookup: any, errors: any): string;
11
12
  export declare function getIframeNamesInSoapRequest(requestXml: string): string[] | undefined;
12
13
  export declare function replaceIframeNameWithValues(requestXml: string, elementValuesLookup: any): string;
14
+ export declare function lowercaseKeys(obj: {
15
+ [key: string]: any;
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
+ };
@@ -208,6 +208,7 @@ 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;
@@ -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;