@trustpayments/3ds-sdk-js 1.2.116 → 1.2.117

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.
Files changed (2) hide show
  1. package/README.md +27 -21
  2. package/package.json +40 -35
package/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # 3DS SDK JS
2
2
 
3
3
  ## Warning!
4
+
4
5
  This package is for internal purposes only.
5
6
 
6
7
  ## Config
8
+
7
9
  - `challengeDisplayMode` - `POPUP | INLINE`. Default: `POPUP`<br><br>
8
10
 
9
11
  - `challengeDisplayInlineTargetElementId` - `string`. Default: `undefined`.<br>Must be the existing DOM Element when using `challengeDisplayMode` = `INLINE`.<br><br>
@@ -13,7 +15,7 @@ This package is for internal purposes only.
13
15
  - `translations` - `{cancel: string; }`. Default: `{ cancel: 'X' }`<br><br>
14
16
 
15
17
  - `processingScreenMode` - `OVERLAY` | `ATTACH_TO_ELEMENT`. Default: `OVERLAY`<br>
16
- `ATTACH_TO_ELEMENT` requires additional property `processingScreenWrapperElementId`<br><br>
18
+ `ATTACH_TO_ELEMENT` requires additional property `processingScreenWrapperElementId`<br><br>
17
19
 
18
20
  - `processingScreenWrapperElementId` - `string`. Default: `undefined`<br>Must be the existing DOM Element when using `processingScreenMode` = `ATTACH_TO_ELEMENT`.<br><br>
19
21
 
@@ -24,8 +26,9 @@ This package is for internal purposes only.
24
26
  ### init$()
25
27
 
26
28
  Initializes the library and returns the Observable with the config.
29
+
27
30
  ```
28
- init$(config: ConfigInterface): Observable<ConfigInterface | never>;
31
+ init$(config: IConfigInterface): Observable<IConfigInterface | never>;
29
32
  ```
30
33
 
31
34
  Default values for config are:<br>
@@ -33,20 +36,20 @@ Default values for config are:<br>
33
36
  `loggingLevel: LoggingLevel.ERROR`
34
37
 
35
38
  ```ts
36
- interface ConfigInterface {
39
+ interface IConfigInterface {
37
40
  challengeDisplayMode?: ChallengeDisplayMode;
38
41
  challengeDisplayInlineTargetElementId?: string;
39
42
  loggingLevel?: LoggingLevel;
40
43
  }
41
44
 
42
45
  enum ChallengeDisplayMode {
43
- POPUP = 'POPUP',
44
- INLINE = 'INLINE',
46
+ POPUP = "POPUP",
47
+ INLINE = "INLINE",
45
48
  }
46
49
 
47
50
  enum LoggingLevel {
48
- ERROR = 'ERROR',
49
- ALL = 'ALL',
51
+ ERROR = "ERROR",
52
+ ALL = "ALL",
50
53
  }
51
54
  ```
52
55
 
@@ -55,22 +58,23 @@ enum LoggingLevel {
55
58
  Runs 3DS method and returns the result.
56
59
 
57
60
  ```
58
- run3DSMethod$(transactionId: string, notificationURL: string, methodURL: string): Observable<MethodURLResultInterface | never>;
61
+ run3DSMethod$(transactionId: string, notificationURL: string, methodURL: string): Observable<IMethodURLResultInterface | never>;
59
62
  ```
63
+
60
64
  ```ts
61
- interface MethodURLResultInterface {
65
+ interface IMethodURLResultInterface {
62
66
  status: ResultActionCode;
63
67
  description: string;
64
68
  transactionId: string;
65
69
  }
66
70
 
67
71
  enum ResultActionCode {
68
- SUCCESS = 'SUCCESS',
69
- FAILURE = 'FAILURE',
70
- ERROR = 'ERROR',
71
- NOACTION = 'NOACTION',
72
- CANCELLED = 'CANCELLED',
73
- COMPLETED = 'COMPLETED',
72
+ SUCCESS = "SUCCESS",
73
+ FAILURE = "FAILURE",
74
+ ERROR = "ERROR",
75
+ NOACTION = "NOACTION",
76
+ CANCELLED = "CANCELLED",
77
+ COMPLETED = "COMPLETED",
74
78
  }
75
79
  ```
76
80
 
@@ -78,6 +82,7 @@ Possible `ResultActionCode` values are: `SUCCESS`, `FAILURE`, `ERROR`, and `UNCO
78
82
  `UNCOMPLETED` timeout can be set via config property `threeDSMethodTimeout`. Default values is 10 seconds.
79
83
 
80
84
  ### doChallenge$()
85
+
81
86
  Initializes the challenge process. This method handles both versions `1.0.0` and `2.1.0 | 2.2.0`.<br>
82
87
  For version `1.0.0`, `termURL` and `merchantData` parameters are required.
83
88
 
@@ -88,11 +93,11 @@ doChallenge$(
88
93
  challengeURL: string,
89
94
  termURL?: string,
90
95
  merchantData?: string,
91
- ): Observable<ChallengeResultInterface | never>;
96
+ ): Observable<IChallengeResultInterface | never>;
92
97
  ```
93
98
 
94
99
  ```
95
- export interface ChallengeResultInterface {
100
+ export interface IChallengeResultInterface {
96
101
  status: ResultActionCode; // ResultActionCode is shared between challenge and method URL
97
102
  description: string;
98
103
  transactionId?: string;
@@ -105,8 +110,9 @@ Possible `ResultActionCode` values are: `SUCCESS`, `FAILURE`, `ERROR`, `CANCELLE
105
110
  ### getBrowserData()
106
111
 
107
112
  - `getBrowserData()` returns an object with the following interface:
113
+
108
114
  ```ts
109
- interface BrowserDataInterface {
115
+ interface IBrowserDataInterface {
110
116
  browserJavaEnabled: boolean;
111
117
  browserJavascriptEnabled: boolean;
112
118
  browserLanguage: string;
@@ -124,9 +130,9 @@ interface BrowserDataInterface {
124
130
 
125
131
  ```ts
126
132
  export enum CardType {
127
- MASTER_CARD = 'MASTERCARD',
128
- VISA = 'VISA',
129
- };
133
+ MASTER_CARD = "MASTERCARD",
134
+ VISA = "VISA",
135
+ }
130
136
  ```
131
137
 
132
138
  ### hideProcessingScreen()
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Trust Payments <support@trustpayments.com>",
3
3
  "homepage": "https://docs.trustpayments.com",
4
4
  "name": "@trustpayments/3ds-sdk-js",
5
- "version": "1.2.116",
5
+ "version": "1.2.117",
6
6
  "description": "",
7
7
  "main": "./dist/index.js",
8
8
  "browser": "./dist/index.js",
@@ -15,8 +15,8 @@
15
15
  "access": "public"
16
16
  },
17
17
  "engines": {
18
- "node": "20.5.1",
19
- "npm": "9.8.0"
18
+ "node": "20.14.0",
19
+ "npm": "10.7.0"
20
20
  },
21
21
  "scripts": {
22
22
  "build:declarations": "npx dts-bundle-generator ./src/index.ts -o ./dist/index.d.ts --project ./.cicd_scripts/execute/config/js/tsconfig.json --no-banner",
@@ -33,50 +33,55 @@
33
33
  "test:watch": "npx jest --config jest.config.ts --watchAll",
34
34
  "coverage": "npx jest --coverage",
35
35
  "coverage:watch": "npx jest --coverage --watchAll",
36
+ "prettier": "prettier --check .",
37
+ "format": "prettier --write .",
38
+ "typescript:check": "npx tsc --noEmit -p tsconfig.json",
36
39
  "lint": "npx eslint ./src",
37
40
  "lint:fix": "npx eslint --fix ./src",
38
- "install:pack": "npm pack && npm install file:./trustpayments-3ds-sdk-js-0.0.0.tgz && rm -rf trustpayments-3ds-sdk-js-0.0.0.tgz",
39
- "preinstall": "npx force-resolutions"
41
+ "install:pack": "npm pack && npm install file:./trustpayments-3ds-sdk-js-0.0.0.tgz && rm -rf trustpayments-3ds-sdk-js-0.0.0.tgz"
40
42
  },
41
43
  "devDependencies": {
42
- "@babel/runtime": "7.23.1",
43
- "@types/core-js": "2.5.6",
44
- "@types/jest": "29.5.5",
45
- "@types/jsdom": "21.1.2",
46
- "@types/node": "20.7.2",
47
- "@types/uuid": "9.0.4",
48
- "@typescript-eslint/eslint-plugin": "6.7.3",
49
- "@typescript-eslint/parser": "6.7.3",
50
- "concurrently": "8.2.1",
51
- "css-loader": "6.8.1",
52
- "dts-bundle-generator": "8.0.1",
53
- "eslint": "8.50.0",
54
- "eslint-plugin-compat": "4.2.0",
55
- "eslint-plugin-import": "2.28.1",
56
- "eslint-plugin-jest": "27.4.2",
57
- "eslint-plugin-unused-imports": "3.0.0",
44
+ "@babel/runtime": "7.26.0",
45
+ "@eslint/js": "^9.14.0",
46
+ "@types/core-js": "2.5.8",
47
+ "@types/eslint__js": "^8.42.3",
48
+ "@types/jest": "29.5.14",
49
+ "@types/jsdom": "21.1.7",
50
+ "@types/node": "20.17.6",
51
+ "@types/uuid": "9.0.8",
52
+ "@typescript-eslint/eslint-plugin": "^8.13.0",
53
+ "@typescript-eslint/parser": "^8.13.0",
54
+ "concurrently": "8.2.2",
55
+ "css-loader": "6.11.0",
56
+ "dts-bundle-generator": "8.1.2",
57
+ "eslint-config-prettier": "^9.1.0",
58
+ "eslint-plugin-compat": "^6.0.1",
59
+ "eslint-plugin-jest": "^28.8.3",
60
+ "eslint-plugin-prettier": "^5.2.1",
61
+ "eslint-plugin-unused-imports": "4.1.4",
58
62
  "jest": "29.7.0",
59
63
  "jest-environment-jsdom": "29.7.0",
60
- "lerna": "7.1.4",
61
- "nodemon": "3.0.1",
62
- "npm-force-resolutions": "0.0.10",
64
+ "nodemon": "3.1.7",
65
+ "prettier": "3.3.3",
63
66
  "process": "0.11.10",
64
- "style-loader": "3.3.3",
65
- "ts-jest": "29.1.1",
66
- "ts-loader": "9.4.4",
67
+ "style-loader": "3.3.4",
68
+ "ts-jest": "29.2.5",
69
+ "ts-loader": "9.5.1",
67
70
  "ts-mockito": "2.6.1",
68
- "ts-node": "10.9.1",
69
- "typescript": "5.2.2",
70
- "webpack": "5.88.2",
71
+ "ts-node": "10.9.2",
72
+ "typescript": "^5.6.3",
73
+ "typescript-eslint": "^8.13.0",
74
+ "webpack": "5.96.1",
71
75
  "webpack-cli": "5.1.4",
72
- "webpack-merge": "5.9.0"
76
+ "webpack-merge": "5.10.0"
73
77
  },
74
78
  "dependencies": {
75
- "@trustpayments/http-client": "2.0.175",
76
- "core-js": "3.32.2",
79
+ "@trustpayments/http-client": "2.0.242",
80
+ "core-js": "3.39.0",
77
81
  "element-remove-polyfill": "1.1.0",
78
82
  "jsdom": "16.7.0",
79
- "reflect-metadata": "0.1.13",
83
+ "lerna": "8.1.8",
84
+ "reflect-metadata": "0.2.2",
80
85
  "rxjs": "7.8.1",
81
86
  "typedi": "0.10.0",
82
87
  "uuid": "9.0.1"
@@ -103,5 +108,5 @@
103
108
  "npm run lint:fix"
104
109
  ]
105
110
  },
106
- "gitHead": "db65a8da77cfcb611ff91b8109b8162db253b69a"
111
+ "gitHead": "f316e78eab07d89399f8f65e3b4be8b89aec68b2"
107
112
  }