@tonder.io/ionic-lite-sdk 0.0.16 → 0.0.18-beta
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.
- package/.gitlab-ci.yml +28 -28
- package/README.md +496 -496
- package/jest.config.ts +14 -14
- package/package.json +38 -38
- package/rollup.config.js +16 -16
- package/src/classes/errorResponse.ts +16 -16
- package/src/classes/liteCheckout.ts +302 -302
- package/src/helpers/utils.ts +37 -37
- package/src/index.ts +4 -4
- package/src/types/commons.ts +61 -61
- package/src/types/requests.ts +60 -60
- package/src/types/responses.ts +185 -185
- package/src/types/skyflow.ts +17 -17
- package/tests/classes/liteCheckout.test.ts +57 -57
- package/tests/methods/createOrder.test.ts +105 -105
- package/tests/methods/createPayment.test.ts +108 -108
- package/tests/methods/customerRegister.test.ts +105 -105
- package/tests/methods/getBusiness.test.ts +102 -102
- package/tests/methods/getCustomerCards.test.ts +104 -104
- package/tests/methods/getOpenpayDeviceSessionID.test.ts +94 -94
- package/tests/methods/getSkyflowToken.test.ts +136 -136
- package/tests/methods/getVaultToken.test.ts +106 -106
- package/tests/methods/registerCustomerCard.test.ts +104 -104
- package/tests/methods/startCheckoutRouter.test.ts +106 -106
- package/tests/utils/defaultMock.ts +20 -20
- package/tests/utils/mockClasses.ts +538 -538
- package/tsconfig.json +18 -18
package/jest.config.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { JestConfigWithTsJest } from 'ts-jest'
|
|
2
|
-
|
|
3
|
-
const jestConfig: JestConfigWithTsJest = {
|
|
4
|
-
testEnvironment: "jsdom",
|
|
5
|
-
preset: 'ts-jest',
|
|
6
|
-
transform: {
|
|
7
|
-
'^.+\\.tsx?$': [
|
|
8
|
-
'ts-jest',
|
|
9
|
-
{
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
},
|
|
13
|
-
}
|
|
14
|
-
|
|
1
|
+
import type { JestConfigWithTsJest } from 'ts-jest'
|
|
2
|
+
|
|
3
|
+
const jestConfig: JestConfigWithTsJest = {
|
|
4
|
+
testEnvironment: "jsdom",
|
|
5
|
+
preset: 'ts-jest',
|
|
6
|
+
transform: {
|
|
7
|
+
'^.+\\.tsx?$': [
|
|
8
|
+
'ts-jest',
|
|
9
|
+
{
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
|
|
15
15
|
export default jestConfig
|
package/package.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tonder.io/ionic-lite-sdk",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Tonder ionic lite SDK",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc -noEmit && rollup --config",
|
|
9
|
-
"test": "jest",
|
|
10
|
-
"ts-coverage": "typescript-coverage-report"
|
|
11
|
-
},
|
|
12
|
-
"author": "",
|
|
13
|
-
"license": "ISC",
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"skyflow-js": "^1.34.1",
|
|
16
|
-
"ts-node": "^10.9.2"
|
|
17
|
-
},
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public",
|
|
20
|
-
"registry": "https://registry.npmjs.org/"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
24
|
-
"@rollup/plugin-typescript": "11.1.6",
|
|
25
|
-
"@types/crypto-js": "^4.2.2",
|
|
26
|
-
"@types/jest": "^29.5.11",
|
|
27
|
-
"@types/node": "^20.11.5",
|
|
28
|
-
"jest": "^29.7.0",
|
|
29
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
30
|
-
"jsdom": "^24.0.0",
|
|
31
|
-
"rollup": "4.9.6",
|
|
32
|
-
"ts-jest": "^29.1.2",
|
|
33
|
-
"ts-loader": "^9.5.1",
|
|
34
|
-
"tslib": "^2.6.2",
|
|
35
|
-
"typescript": "^5.3.3",
|
|
36
|
-
"typescript-coverage-report": "^0.8.0"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tonder.io/ionic-lite-sdk",
|
|
3
|
+
"version": "0.0.18-beta",
|
|
4
|
+
"description": "Tonder ionic lite SDK",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc -noEmit && rollup --config",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"ts-coverage": "typescript-coverage-report"
|
|
11
|
+
},
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"skyflow-js": "^1.34.1",
|
|
16
|
+
"ts-node": "^10.9.2"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public",
|
|
20
|
+
"registry": "https://registry.npmjs.org/"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
24
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
25
|
+
"@types/crypto-js": "^4.2.2",
|
|
26
|
+
"@types/jest": "^29.5.11",
|
|
27
|
+
"@types/node": "^20.11.5",
|
|
28
|
+
"jest": "^29.7.0",
|
|
29
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
30
|
+
"jsdom": "^24.0.0",
|
|
31
|
+
"rollup": "4.9.6",
|
|
32
|
+
"ts-jest": "^29.1.2",
|
|
33
|
+
"ts-loader": "^9.5.1",
|
|
34
|
+
"tslib": "^2.6.2",
|
|
35
|
+
"typescript": "^5.3.3",
|
|
36
|
+
"typescript-coverage-report": "^0.8.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/rollup.config.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const typescript = require('@rollup/plugin-typescript');
|
|
2
|
-
const terser = require('@rollup/plugin-terser');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
input: './src/index.ts',
|
|
6
|
-
output: {
|
|
7
|
-
dir: 'dist',
|
|
8
|
-
format: 'es',
|
|
9
|
-
plugins: [terser()]
|
|
10
|
-
},
|
|
11
|
-
plugins: [
|
|
12
|
-
typescript({
|
|
13
|
-
exclude: ["tests/**", "jest.config.ts"]
|
|
14
|
-
})
|
|
15
|
-
],
|
|
16
|
-
external: ["skyflow-js", "crypto-js"]
|
|
1
|
+
const typescript = require('@rollup/plugin-typescript');
|
|
2
|
+
const terser = require('@rollup/plugin-terser');
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
input: './src/index.ts',
|
|
6
|
+
output: {
|
|
7
|
+
dir: 'dist',
|
|
8
|
+
format: 'es',
|
|
9
|
+
plugins: [terser()]
|
|
10
|
+
},
|
|
11
|
+
plugins: [
|
|
12
|
+
typescript({
|
|
13
|
+
exclude: ["tests/**", "jest.config.ts"]
|
|
14
|
+
})
|
|
15
|
+
],
|
|
16
|
+
external: ["skyflow-js", "crypto-js"]
|
|
17
17
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IErrorResponse } from "../types/responses";
|
|
2
|
-
|
|
3
|
-
export class ErrorResponse implements IErrorResponse {
|
|
4
|
-
code?: string | undefined;
|
|
5
|
-
body?: string | undefined;
|
|
6
|
-
name!: string;
|
|
7
|
-
message!: string;
|
|
8
|
-
stack?: string | undefined;
|
|
9
|
-
|
|
10
|
-
constructor({ code, body, name, message, stack }: IErrorResponse) {
|
|
11
|
-
this.code = code;
|
|
12
|
-
this.body = body;
|
|
13
|
-
this.name = name;
|
|
14
|
-
this.message = message;
|
|
15
|
-
this.stack = stack;
|
|
16
|
-
}
|
|
1
|
+
import { IErrorResponse } from "../types/responses";
|
|
2
|
+
|
|
3
|
+
export class ErrorResponse implements IErrorResponse {
|
|
4
|
+
code?: string | undefined;
|
|
5
|
+
body?: string | undefined;
|
|
6
|
+
name!: string;
|
|
7
|
+
message!: string;
|
|
8
|
+
stack?: string | undefined;
|
|
9
|
+
|
|
10
|
+
constructor({ code, body, name, message, stack }: IErrorResponse) {
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.body = body;
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.message = message;
|
|
15
|
+
this.stack = stack;
|
|
16
|
+
}
|
|
17
17
|
}
|