univapay-node 3.0.23 → 3.0.24
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/dist/cjs/api/utils/JWT.d.ts +2 -2
- package/dist/cjs/api/utils/JWT.js +4 -4
- package/dist/cjs/api/utils/JWT.js.map +1 -1
- package/dist/cjs/resources/common/Configuration.d.ts +3 -0
- package/dist/esm/api/utils/JWT.d.ts +2 -2
- package/dist/esm/api/utils/JWT.js +4 -4
- package/dist/esm/api/utils/JWT.js.map +1 -1
- package/dist/esm/resources/common/Configuration.d.ts +3 -0
- package/package.json +6 -6
|
@@ -8,8 +8,8 @@ export interface JWTBasePayload {
|
|
|
8
8
|
jti?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare type JWTPayload<Payload> = JWTBasePayload & Payload;
|
|
11
|
-
export declare
|
|
11
|
+
export declare const parseJWT: <Payload>(jwt: string, keepKeys?: boolean) => JWTPayload<Payload>;
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
export declare
|
|
15
|
+
export declare const extractJWT: (response: Response) => string | null;
|
|
@@ -9,7 +9,7 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
const jwt_decode_1 = tslib_1.__importDefault(require("jwt-decode"));
|
|
10
10
|
const JWTError_js_1 = require("../../errors/JWTError.js");
|
|
11
11
|
const object_js_1 = require("../../utils/object.js");
|
|
12
|
-
|
|
12
|
+
const parseJWT = (jwt, keepKeys = false) => {
|
|
13
13
|
if (!jwt) {
|
|
14
14
|
return null;
|
|
15
15
|
}
|
|
@@ -23,13 +23,13 @@ function parseJWT(jwt, keepKeys = false) {
|
|
|
23
23
|
catch {
|
|
24
24
|
throw new JWTError_js_1.JWTError();
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
exports.parseJWT = parseJWT;
|
|
28
28
|
const BearerRegexp = /^Bearer (.*)$/i;
|
|
29
29
|
/**
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
const extractJWT = (response) => {
|
|
33
33
|
const headerNames = ["authorization", "x-amzn-remapped-authorization", "X-REFRESH-AUTHORIZATION"];
|
|
34
34
|
const header = headerNames.reduce((acc, name) => response.headers.get(name) || acc, null);
|
|
35
35
|
if (header === null) {
|
|
@@ -37,6 +37,6 @@ function extractJWT(response) {
|
|
|
37
37
|
}
|
|
38
38
|
const matches = header.match(BearerRegexp);
|
|
39
39
|
return matches === null ? null : matches[1];
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
exports.extractJWT = extractJWT;
|
|
42
42
|
//# sourceMappingURL=JWT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWT.js","sourceRoot":"","sources":["../../../../src/api/utils/JWT.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,oEAAgC;AAEhC,0DAAoD;AACpD,qDAAmE;
|
|
1
|
+
{"version":3,"file":"JWT.js","sourceRoot":"","sources":["../../../../src/api/utils/JWT.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,oEAAgC;AAEhC,0DAAoD;AACpD,qDAAmE;AAc5D,MAAM,QAAQ,GAAG,CAAU,GAAW,EAAE,QAAQ,GAAG,KAAK,EAA8B,EAAE;IAC3F,IAAI,CAAC,GAAG,EAAE;QACN,OAAO,IAAI,CAAC;KACf;IAED,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,MAAM,IAAI,sBAAQ,EAAE,CAAC;KACxB;IAED,IAAI;QACA,MAAM,OAAO,GAAG,IAAA,oBAAM,EAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,yBAAa,EAAC,OAAO,EAAE,uBAAW,CAAC,CAAC;KAClG;IAAC,MAAM;QACJ,MAAM,IAAI,sBAAQ,EAAE,CAAC;KACxB;AACL,CAAC,CAAC;AAfW,QAAA,QAAQ,YAenB;AAEF,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAEtC;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,QAAkB,EAAiB,EAAE;IAC5D,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,+BAA+B,EAAE,yBAAyB,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC;IAE1G,IAAI,MAAM,KAAK,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACf;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3C,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB"}
|
|
@@ -138,6 +138,8 @@ export interface UserTransactionsConfiguration {
|
|
|
138
138
|
enabled?: boolean;
|
|
139
139
|
notifyCustomer?: boolean;
|
|
140
140
|
notifyOnTest?: boolean;
|
|
141
|
+
notifyUserOnFailedTransaction?: boolean;
|
|
142
|
+
notifyCustomerOnFailedTransaction?: boolean;
|
|
141
143
|
notifyOnRecurringTokenCreation?: boolean;
|
|
142
144
|
notifyOnWebhookFailure?: boolean;
|
|
143
145
|
notifyOnWebhookDisabled?: boolean;
|
|
@@ -156,6 +158,7 @@ export interface SubscriptionsConfiguration {
|
|
|
156
158
|
enabled?: boolean;
|
|
157
159
|
failedChargesToCancel: number;
|
|
158
160
|
suspendOnCancel: boolean;
|
|
161
|
+
allowMerchantAmountPatch?: boolean;
|
|
159
162
|
}
|
|
160
163
|
export interface DescriptorProvidedConfiguration {
|
|
161
164
|
name: string;
|
|
@@ -8,8 +8,8 @@ export interface JWTBasePayload {
|
|
|
8
8
|
jti?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare type JWTPayload<Payload> = JWTBasePayload & Payload;
|
|
11
|
-
export declare
|
|
11
|
+
export declare const parseJWT: <Payload>(jwt: string, keepKeys?: boolean) => JWTPayload<Payload>;
|
|
12
12
|
/**
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
export declare
|
|
15
|
+
export declare const extractJWT: (response: Response) => string | null;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import decode from "jwt-decode";
|
|
6
6
|
import { JWTError } from "../../errors/JWTError.js";
|
|
7
7
|
import { toCamelCase, transformKeys } from "../../utils/object.js";
|
|
8
|
-
export
|
|
8
|
+
export const parseJWT = (jwt, keepKeys = false) => {
|
|
9
9
|
if (!jwt) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
@@ -19,12 +19,12 @@ export function parseJWT(jwt, keepKeys = false) {
|
|
|
19
19
|
catch {
|
|
20
20
|
throw new JWTError();
|
|
21
21
|
}
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
const BearerRegexp = /^Bearer (.*)$/i;
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export const extractJWT = (response) => {
|
|
28
28
|
const headerNames = ["authorization", "x-amzn-remapped-authorization", "X-REFRESH-AUTHORIZATION"];
|
|
29
29
|
const header = headerNames.reduce((acc, name) => response.headers.get(name) || acc, null);
|
|
30
30
|
if (header === null) {
|
|
@@ -32,5 +32,5 @@ export function extractJWT(response) {
|
|
|
32
32
|
}
|
|
33
33
|
const matches = header.match(BearerRegexp);
|
|
34
34
|
return matches === null ? null : matches[1];
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
//# sourceMappingURL=JWT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JWT.js","sourceRoot":"","sources":["../../../../src/api/utils/JWT.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAcnE,MAAM,
|
|
1
|
+
{"version":3,"file":"JWT.js","sourceRoot":"","sources":["../../../../src/api/utils/JWT.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAcnE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAU,GAAW,EAAE,QAAQ,GAAG,KAAK,EAA8B,EAAE;IAC3F,IAAI,CAAC,GAAG,EAAE;QACN,OAAO,IAAI,CAAC;KACf;IAED,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,MAAM,IAAI,QAAQ,EAAE,CAAC;KACxB;IAED,IAAI;QACA,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;KAClG;IAAC,MAAM;QACJ,MAAM,IAAI,QAAQ,EAAE,CAAC;KACxB;AACL,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAkB,EAAiB,EAAE;IAC5D,MAAM,WAAW,GAAG,CAAC,eAAe,EAAE,+BAA+B,EAAE,yBAAyB,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,IAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC;IAE1G,IAAI,MAAM,KAAK,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACf;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3C,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC"}
|
|
@@ -138,6 +138,8 @@ export interface UserTransactionsConfiguration {
|
|
|
138
138
|
enabled?: boolean;
|
|
139
139
|
notifyCustomer?: boolean;
|
|
140
140
|
notifyOnTest?: boolean;
|
|
141
|
+
notifyUserOnFailedTransaction?: boolean;
|
|
142
|
+
notifyCustomerOnFailedTransaction?: boolean;
|
|
141
143
|
notifyOnRecurringTokenCreation?: boolean;
|
|
142
144
|
notifyOnWebhookFailure?: boolean;
|
|
143
145
|
notifyOnWebhookDisabled?: boolean;
|
|
@@ -156,6 +158,7 @@ export interface SubscriptionsConfiguration {
|
|
|
156
158
|
enabled?: boolean;
|
|
157
159
|
failedChargesToCancel: number;
|
|
158
160
|
suspendOnCancel: boolean;
|
|
161
|
+
allowMerchantAmountPatch?: boolean;
|
|
159
162
|
}
|
|
160
163
|
export interface DescriptorProvidedConfiguration {
|
|
161
164
|
name: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "univapay-node",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.24",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"@types/sinon": "10.0.13",
|
|
49
49
|
"@types/sinon-chai": "3.2.8",
|
|
50
50
|
"@types/uuid": "8.3.4",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "5.42.
|
|
52
|
-
"@typescript-eslint/parser": "5.42.
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "5.42.1",
|
|
52
|
+
"@typescript-eslint/parser": "5.42.1",
|
|
53
53
|
"c8": "^7.12.0",
|
|
54
54
|
"chai": "4.3.6",
|
|
55
55
|
"chai-arrays": "2.2.0",
|
|
56
56
|
"chai-as-promised": "7.1.1",
|
|
57
57
|
"cross-fetch": "3.1.5",
|
|
58
|
-
"eslint": "8.
|
|
58
|
+
"eslint": "8.27.0",
|
|
59
59
|
"eslint-config-prettier": "8.5.0",
|
|
60
60
|
"eslint-plugin-prettier": "4.2.1",
|
|
61
61
|
"eslint-plugin-simple-import-sort": "8.0.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"sinon": "14.0.1",
|
|
74
74
|
"sinon-chai": "3.7.0",
|
|
75
75
|
"ts-node": "10.9.1",
|
|
76
|
-
"typedoc": "0.23.
|
|
76
|
+
"typedoc": "0.23.20",
|
|
77
77
|
"typedoc-plugin-internal-external": "2.2.0",
|
|
78
78
|
"typescript": "4.8.4",
|
|
79
79
|
"uuid": "9.0.0"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"jwt-decode": "^3.1.2",
|
|
91
91
|
"p-timeout": "^4.1.0",
|
|
92
92
|
"query-string": "^5.1.1",
|
|
93
|
-
"tslib": "^2.4.
|
|
93
|
+
"tslib": "^2.4.1"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"lint": "eslint --cache .",
|