@spreeloop/orange_money 1.0.8 → 1.0.9
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/package.json +2 -3
- package/dist/logging/src/log_level.d.ts +0 -24
- package/dist/logging/src/log_level.d.ts.map +0 -1
- package/dist/logging/src/log_level.js +0 -34
- package/dist/logging/src/log_level.js.map +0 -1
- package/dist/logging/src/logging.d.ts +0 -50
- package/dist/logging/src/logging.d.ts.map +0 -1
- package/dist/logging/src/logging.js +0 -87
- package/dist/logging/src/logging.js.map +0 -1
- package/dist/logging/src/printer.d.ts +0 -10
- package/dist/logging/src/printer.d.ts.map +0 -1
- package/dist/logging/src/printer.js +0 -3
- package/dist/logging/src/printer.js.map +0 -1
- package/dist/orange_money/index.d.ts +0 -2
- package/dist/orange_money/index.d.ts.map +0 -1
- package/dist/orange_money/index.js +0 -18
- package/dist/orange_money/index.js.map +0 -1
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts +0 -62
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.js +0 -84
- package/dist/orange_money/src/disbursements/implementations/disbursement_service.js.map +0 -1
- package/dist/orange_money/src/disbursements/implementations/src/live.d.ts +0 -40
- package/dist/orange_money/src/disbursements/implementations/src/live.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/implementations/src/live.js +0 -61
- package/dist/orange_money/src/disbursements/implementations/src/live.js.map +0 -1
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts +0 -40
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.js +0 -110
- package/dist/orange_money/src/disbursements/implementations/src/sandbox.js.map +0 -1
- package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts +0 -28
- package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/operations/create_access_token.js +0 -45
- package/dist/orange_money/src/disbursements/operations/create_access_token.js.map +0 -1
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts +0 -2
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js +0 -106
- package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js.map +0 -1
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts +0 -114
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.js +0 -128
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.js.map +0 -1
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts +0 -2
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js +0 -148
- package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js.map +0 -1
- package/dist/orange_money/src/disbursements/operations/transfer.d.ts +0 -44
- package/dist/orange_money/src/disbursements/operations/transfer.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/operations/transfer.js +0 -74
- package/dist/orange_money/src/disbursements/operations/transfer.js.map +0 -1
- package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts +0 -2
- package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/operations/transfer.spec.js +0 -178
- package/dist/orange_money/src/disbursements/operations/transfer.spec.js.map +0 -1
- package/dist/orange_money/src/disbursements/routes/routes.d.ts +0 -38
- package/dist/orange_money/src/disbursements/routes/routes.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/routes/routes.js +0 -53
- package/dist/orange_money/src/disbursements/routes/routes.js.map +0 -1
- package/dist/orange_money/src/disbursements/utils/constants.d.ts +0 -5
- package/dist/orange_money/src/disbursements/utils/constants.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/utils/constants.js +0 -9
- package/dist/orange_money/src/disbursements/utils/constants.js.map +0 -1
- package/dist/orange_money/src/disbursements/utils/regex.d.ts +0 -9
- package/dist/orange_money/src/disbursements/utils/regex.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/utils/regex.js +0 -12
- package/dist/orange_money/src/disbursements/utils/regex.js.map +0 -1
- package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts +0 -2
- package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/utils/regex.spec.js +0 -32
- package/dist/orange_money/src/disbursements/utils/regex.spec.js.map +0 -1
- package/dist/orange_money/src/disbursements/utils/status.d.ts +0 -53
- package/dist/orange_money/src/disbursements/utils/status.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/utils/status.js +0 -58
- package/dist/orange_money/src/disbursements/utils/status.js.map +0 -1
- package/dist/orange_money/src/disbursements/utils/utils.d.ts +0 -9
- package/dist/orange_money/src/disbursements/utils/utils.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/utils/utils.js +0 -26
- package/dist/orange_money/src/disbursements/utils/utils.js.map +0 -1
- package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts +0 -2
- package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts.map +0 -1
- package/dist/orange_money/src/disbursements/utils/utils.spec.js +0 -43
- package/dist/orange_money/src/disbursements/utils/utils.spec.js.map +0 -1
- package/dist/orange_money/src/index.d.ts +0 -7
- package/dist/orange_money/src/index.d.ts.map +0 -1
- package/dist/orange_money/src/index.js +0 -15
- package/dist/orange_money/src/index.js.map +0 -1
- package/dist/orange_money/src/payments/implementations/fake.d.ts +0 -33
- package/dist/orange_money/src/payments/implementations/fake.d.ts.map +0 -1
- package/dist/orange_money/src/payments/implementations/fake.js +0 -110
- package/dist/orange_money/src/payments/implementations/fake.js.map +0 -1
- package/dist/orange_money/src/payments/implementations/live.d.ts +0 -45
- package/dist/orange_money/src/payments/implementations/live.d.ts.map +0 -1
- package/dist/orange_money/src/payments/implementations/live.js +0 -69
- package/dist/orange_money/src/payments/implementations/live.js.map +0 -1
- package/dist/orange_money/src/payments/operations/get_access_token.d.ts +0 -11
- package/dist/orange_money/src/payments/operations/get_access_token.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/get_access_token.js +0 -47
- package/dist/orange_money/src/payments/operations/get_access_token.js.map +0 -1
- package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts +0 -2
- package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/get_access_token.spec.js +0 -74
- package/dist/orange_money/src/payments/operations/get_access_token.spec.js.map +0 -1
- package/dist/orange_money/src/payments/operations/get_pay_token.d.ts +0 -12
- package/dist/orange_money/src/payments/operations/get_pay_token.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/get_pay_token.js +0 -43
- package/dist/orange_money/src/payments/operations/get_pay_token.js.map +0 -1
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts +0 -2
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.js +0 -74
- package/dist/orange_money/src/payments/operations/get_pay_token.spec.js.map +0 -1
- package/dist/orange_money/src/payments/operations/get_payment_status.d.ts +0 -23
- package/dist/orange_money/src/payments/operations/get_payment_status.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/get_payment_status.js +0 -51
- package/dist/orange_money/src/payments/operations/get_payment_status.js.map +0 -1
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts +0 -2
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.js +0 -101
- package/dist/orange_money/src/payments/operations/get_payment_status.spec.js.map +0 -1
- package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts +0 -22
- package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/initialize_om_payment.js +0 -124
- package/dist/orange_money/src/payments/operations/initialize_om_payment.js.map +0 -1
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts +0 -2
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts.map +0 -1
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js +0 -245
- package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js.map +0 -1
- package/dist/orange_money/src/payments/payments.d.ts +0 -57
- package/dist/orange_money/src/payments/payments.d.ts.map +0 -1
- package/dist/orange_money/src/payments/payments.js +0 -36
- package/dist/orange_money/src/payments/payments.js.map +0 -1
- package/dist/orange_money/src/payments/routes/routes.d.ts +0 -48
- package/dist/orange_money/src/payments/routes/routes.d.ts.map +0 -1
- package/dist/orange_money/src/payments/routes/routes.js +0 -61
- package/dist/orange_money/src/payments/routes/routes.js.map +0 -1
- package/dist/orange_money/src/payments/utils/constants.d.ts +0 -96
- package/dist/orange_money/src/payments/utils/constants.d.ts.map +0 -1
- package/dist/orange_money/src/payments/utils/constants.js +0 -112
- package/dist/orange_money/src/payments/utils/constants.js.map +0 -1
- package/dist/orange_money/src/payments/utils/joi_schema.d.ts +0 -70
- package/dist/orange_money/src/payments/utils/joi_schema.d.ts.map +0 -1
- package/dist/orange_money/src/payments/utils/joi_schema.js +0 -44
- package/dist/orange_money/src/payments/utils/joi_schema.js.map +0 -1
- package/dist/orange_money/src/payments/utils/request_model.d.ts +0 -75
- package/dist/orange_money/src/payments/utils/request_model.d.ts.map +0 -1
- package/dist/orange_money/src/payments/utils/request_model.js +0 -3
- package/dist/orange_money/src/payments/utils/request_model.js.map +0 -1
- package/dist/orange_money/src/payments/utils/utils.d.ts +0 -15
- package/dist/orange_money/src/payments/utils/utils.d.ts.map +0 -1
- package/dist/orange_money/src/payments/utils/utils.js +0 -27
- package/dist/orange_money/src/payments/utils/utils.js.map +0 -1
- package/dist/orange_money/src/utils/https.d.ts +0 -77
- package/dist/orange_money/src/utils/https.d.ts.map +0 -1
- package/dist/orange_money/src/utils/https.js +0 -240
- package/dist/orange_money/src/utils/https.js.map +0 -1
- package/dist/orange_money/src/utils/https.spec.d.ts +0 -2
- package/dist/orange_money/src/utils/https.spec.d.ts.map +0 -1
- package/dist/orange_money/src/utils/https.spec.js +0 -77
- package/dist/orange_money/src/utils/https.spec.js.map +0 -1
- package/dist/orange_money/src/utils/logging_interface.d.ts +0 -23
- package/dist/orange_money/src/utils/logging_interface.d.ts.map +0 -1
- package/dist/orange_money/src/utils/logging_interface.js +0 -3
- package/dist/orange_money/src/utils/logging_interface.js.map +0 -1
- package/dist/orange_money/src/utils/operation_response.d.ts +0 -16
- package/dist/orange_money/src/utils/operation_response.d.ts.map +0 -1
- package/dist/orange_money/src/utils/operation_response.js +0 -3
- package/dist/orange_money/src/utils/operation_response.js.map +0 -1
- package/dist/orange_money/src/utils/utils.d.ts +0 -6
- package/dist/orange_money/src/utils/utils.d.ts.map +0 -1
- package/dist/orange_money/src/utils/utils.js +0 -10
- package/dist/orange_money/src/utils/utils.js.map +0 -1
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.isSuccessfulCodeResponse = exports.encodeDataToXFormUrl = exports.encodeToBase64 = exports.encodeTheBodyOfRequest = exports.hash = exports.parseAxiosError = exports.getRequest = exports.postRequest = exports.RequestStatusCode = void 0;
|
|
30
|
-
const axios = __importStar(require("axios"));
|
|
31
|
-
const axios_1 = require("axios");
|
|
32
|
-
const base64url_1 = __importDefault(require("base64url"));
|
|
33
|
-
const https = __importStar(require("https"));
|
|
34
|
-
var RequestStatusCode;
|
|
35
|
-
(function (RequestStatusCode) {
|
|
36
|
-
RequestStatusCode[RequestStatusCode["unauthorized"] = 401] = "unauthorized";
|
|
37
|
-
RequestStatusCode[RequestStatusCode["expectationFailed"] = 417] = "expectationFailed";
|
|
38
|
-
})(RequestStatusCode || (exports.RequestStatusCode = RequestStatusCode = {}));
|
|
39
|
-
/**
|
|
40
|
-
* Posts an http request to the given route.
|
|
41
|
-
* @param {Record<string, string | undefined> | string} data The data to be posted.
|
|
42
|
-
* @param {string} route The end point url.
|
|
43
|
-
* @param {Record<string, string>} headers The type content of request.
|
|
44
|
-
* @param {LoggerInterface} logger The logger to use when posting data.
|
|
45
|
-
* @return {Promise<unknown | undefined>} The server response.
|
|
46
|
-
*/
|
|
47
|
-
async function postRequest({ data, route, headers, logger, rejectUnauthorized = true, }) {
|
|
48
|
-
try {
|
|
49
|
-
logger.info(`Request on the route ${route} is running with data : ${JSON.stringify({
|
|
50
|
-
headers,
|
|
51
|
-
data,
|
|
52
|
-
route,
|
|
53
|
-
})}`);
|
|
54
|
-
const agent = new https.Agent({
|
|
55
|
-
rejectUnauthorized: rejectUnauthorized,
|
|
56
|
-
});
|
|
57
|
-
const response = await axios.default({
|
|
58
|
-
method: 'post',
|
|
59
|
-
url: route,
|
|
60
|
-
headers: headers,
|
|
61
|
-
data: data,
|
|
62
|
-
httpsAgent: agent,
|
|
63
|
-
});
|
|
64
|
-
logger.info(`Request on the route ${route} completed successfully with data : ${JSON.stringify({
|
|
65
|
-
response: response.data,
|
|
66
|
-
status: response.status,
|
|
67
|
-
statusText: response.statusText,
|
|
68
|
-
})}`);
|
|
69
|
-
return { response: { data: response.data, status: response.status } };
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
logger.warn(`[Axios] failed to post request on the route: ${route} with data : ${JSON.stringify({ headers, data, route })}`);
|
|
73
|
-
const parsedError = parseAxiosError(error);
|
|
74
|
-
logger.warn(JSON.stringify(error));
|
|
75
|
-
if (error instanceof axios_1.AxiosError) {
|
|
76
|
-
if (error.response) {
|
|
77
|
-
return {
|
|
78
|
-
response: {
|
|
79
|
-
status: error.response.status,
|
|
80
|
-
data: error.response.data,
|
|
81
|
-
},
|
|
82
|
-
error: parsedError,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return { error: parsedError };
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
exports.postRequest = postRequest;
|
|
90
|
-
/**
|
|
91
|
-
* Gets an http request to the given route.
|
|
92
|
-
* @param {Record<string, string | undefined> | string} data The data to be posted.
|
|
93
|
-
* @param {string} route The end point url.
|
|
94
|
-
* @param {Record<string, string>} headers The type content of request.
|
|
95
|
-
* @param {LoggerInterface} logger The logger to use when getting data.
|
|
96
|
-
* @return {Promise<unknown | undefined>} The server response.
|
|
97
|
-
*/
|
|
98
|
-
async function getRequest({ data, route, headers, logger, rejectUnauthorized = true, }) {
|
|
99
|
-
try {
|
|
100
|
-
logger.info(`Request on the route ${route} is running with data : ${JSON.stringify({
|
|
101
|
-
headers,
|
|
102
|
-
data,
|
|
103
|
-
route,
|
|
104
|
-
})}`);
|
|
105
|
-
const agent = new https.Agent({
|
|
106
|
-
rejectUnauthorized: rejectUnauthorized,
|
|
107
|
-
});
|
|
108
|
-
const response = await axios.default({
|
|
109
|
-
method: 'get',
|
|
110
|
-
url: route,
|
|
111
|
-
headers: headers,
|
|
112
|
-
data: data,
|
|
113
|
-
httpsAgent: agent,
|
|
114
|
-
});
|
|
115
|
-
logger.info(`Request on the route ${route} completed successfully with data : ${JSON.stringify({
|
|
116
|
-
response: response.data,
|
|
117
|
-
status: response.status,
|
|
118
|
-
statusText: response.statusText,
|
|
119
|
-
})}`);
|
|
120
|
-
return { response: { data: response.data, status: response.status } };
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
logger.warn(`[Axios] failed to get request on the route: ${route} with data : ${JSON.stringify({ headers, data, route })}`);
|
|
124
|
-
const parsedError = parseAxiosError(error);
|
|
125
|
-
logger.warn(JSON.stringify(error));
|
|
126
|
-
if (error instanceof axios_1.AxiosError) {
|
|
127
|
-
if (error.response) {
|
|
128
|
-
return {
|
|
129
|
-
response: {
|
|
130
|
-
status: error.response.status,
|
|
131
|
-
data: error.response.data,
|
|
132
|
-
},
|
|
133
|
-
error: parsedError,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return { error: parsedError };
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.getRequest = getRequest;
|
|
141
|
-
/**
|
|
142
|
-
* Parses an Axios error and returns a modified error object.
|
|
143
|
-
*
|
|
144
|
-
* @param {unknown} error - The error object to be parsed.
|
|
145
|
-
* @return {unknown} The modified error object.
|
|
146
|
-
*/
|
|
147
|
-
function parseAxiosError(error) {
|
|
148
|
-
var _a, _b;
|
|
149
|
-
let err = error;
|
|
150
|
-
if (error instanceof axios_1.AxiosError) {
|
|
151
|
-
if (error.response) {
|
|
152
|
-
err = {
|
|
153
|
-
responseError: {
|
|
154
|
-
data: error.response.data,
|
|
155
|
-
status: error.response.status,
|
|
156
|
-
statusText: error.response.statusText,
|
|
157
|
-
headers: error.response.headers,
|
|
158
|
-
},
|
|
159
|
-
requestBody: error.request.body,
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
else if (error.request) {
|
|
163
|
-
err = {
|
|
164
|
-
requestFailed: {
|
|
165
|
-
headers: (_a = error.config) === null || _a === void 0 ? void 0 : _a.headers,
|
|
166
|
-
data: (_b = error.config) === null || _b === void 0 ? void 0 : _b.data,
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
err = {
|
|
172
|
-
configFailed: error.message,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return err;
|
|
177
|
-
}
|
|
178
|
-
exports.parseAxiosError = parseAxiosError;
|
|
179
|
-
/**
|
|
180
|
-
* Generates a hash using the given key and secret.
|
|
181
|
-
*
|
|
182
|
-
* @param {string} key - The key to be hashed.
|
|
183
|
-
* @param {string} secret - The secret to be hashed.
|
|
184
|
-
* @return {string} - The generated hash.
|
|
185
|
-
*/
|
|
186
|
-
function hash(key, secret) {
|
|
187
|
-
const toHash = `${key}:${secret}`;
|
|
188
|
-
if (!global.btoa) {
|
|
189
|
-
return Buffer.from(toHash).toString('base64');
|
|
190
|
-
}
|
|
191
|
-
return global.btoa(toHash);
|
|
192
|
-
}
|
|
193
|
-
exports.hash = hash;
|
|
194
|
-
/**
|
|
195
|
-
* Encode the body of the request.
|
|
196
|
-
* @param {Record<string, string>} bodyRequest the body request.
|
|
197
|
-
* @return {string} the encoded body request result.
|
|
198
|
-
*/
|
|
199
|
-
function encodeTheBodyOfRequest(bodyRequest) {
|
|
200
|
-
const formBody = [];
|
|
201
|
-
for (const key in bodyRequest) {
|
|
202
|
-
if ({}.hasOwnProperty.call(bodyRequest, key)) {
|
|
203
|
-
const encodedKey = encodeURIComponent(key);
|
|
204
|
-
const encodedValue = encodeURIComponent(bodyRequest[key]);
|
|
205
|
-
formBody.push(encodedKey + '=' + encodedValue);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return formBody.join('&');
|
|
209
|
-
}
|
|
210
|
-
exports.encodeTheBodyOfRequest = encodeTheBodyOfRequest;
|
|
211
|
-
// Encode to base64
|
|
212
|
-
const encodeToBase64 = (apiUsername, apiPassword) => {
|
|
213
|
-
return (0, base64url_1.default)(`${apiUsername}:${apiPassword}`);
|
|
214
|
-
};
|
|
215
|
-
exports.encodeToBase64 = encodeToBase64;
|
|
216
|
-
/**
|
|
217
|
-
* Encode the data to w3 x form encoded url.
|
|
218
|
-
* @param {Record<string, string>} data the data to encode.
|
|
219
|
-
* @return {string} the encoded value.
|
|
220
|
-
*/
|
|
221
|
-
function encodeDataToXFormUrl(data) {
|
|
222
|
-
const segments = [];
|
|
223
|
-
for (const key in data) {
|
|
224
|
-
if (Object.hasOwnProperty.call(data, key)) {
|
|
225
|
-
const encodedKey = encodeURIComponent(key);
|
|
226
|
-
const encodedValue = encodeURIComponent(data[key]);
|
|
227
|
-
segments.push(`${encodedKey}=${encodedValue}`);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return segments.join('&');
|
|
231
|
-
}
|
|
232
|
-
exports.encodeDataToXFormUrl = encodeDataToXFormUrl;
|
|
233
|
-
/**
|
|
234
|
-
* Checks if the code is a successful code response.
|
|
235
|
-
* @param {num} code .
|
|
236
|
-
* @return {boolean} true if the code is valid.
|
|
237
|
-
*/
|
|
238
|
-
const isSuccessfulCodeResponse = (code) => code >= 200 && code < 300;
|
|
239
|
-
exports.isSuccessfulCodeResponse = isSuccessfulCodeResponse;
|
|
240
|
-
//# sourceMappingURL=https.js.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
1
|
-
{"version":3,"file":"https.spec.d.ts","sourceRoot":"","sources":["../../../../src/utils/https.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const https_1 = require("./https");
|
|
4
|
-
const axios_1 = require("axios");
|
|
5
|
-
describe('hash', () => {
|
|
6
|
-
const btoaRef = global.btoa;
|
|
7
|
-
it('should still Hash if the btao function is not available', () => {
|
|
8
|
-
global.btoa = undefined;
|
|
9
|
-
const hashResponse = (0, https_1.hash)('key', 'secret');
|
|
10
|
-
expect(hashResponse).toBe('a2V5OnNlY3JldA==');
|
|
11
|
-
global.btoa = btoaRef;
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
describe('parseAxiosError', () => {
|
|
15
|
-
it('should return initial obj if not instance of axios error', () => {
|
|
16
|
-
const initialObj = { key: 'ERROR_100' };
|
|
17
|
-
const parsedResponse = (0, https_1.parseAxiosError)(initialObj);
|
|
18
|
-
expect(parsedResponse).toBe(initialObj);
|
|
19
|
-
});
|
|
20
|
-
it('should have the configuration failed message when config failed', () => {
|
|
21
|
-
const message = 'configuration failed';
|
|
22
|
-
const parsedResponse = (0, https_1.parseAxiosError)(new axios_1.AxiosError(message));
|
|
23
|
-
expect(parsedResponse).toEqual({
|
|
24
|
-
configFailed: message,
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
it('should return request failed when axios is unable to send the request.', () => {
|
|
28
|
-
const request = {
|
|
29
|
-
headers: {
|
|
30
|
-
'Content-Type': 'application/json',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const parsedResponse = (0, https_1.parseAxiosError)(new axios_1.AxiosError('message', '400', undefined, request));
|
|
34
|
-
expect(parsedResponse).toEqual({
|
|
35
|
-
requestFailed: { data: undefined, headers: undefined },
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
it('should return response error when the request response fail to be retrieve.', () => {
|
|
39
|
-
const request = {
|
|
40
|
-
headers: {
|
|
41
|
-
'Content-Type': 'application/json',
|
|
42
|
-
},
|
|
43
|
-
body: '',
|
|
44
|
-
};
|
|
45
|
-
const response = {
|
|
46
|
-
data: '',
|
|
47
|
-
status: 201,
|
|
48
|
-
statusText: 'created',
|
|
49
|
-
headers: {},
|
|
50
|
-
request: request,
|
|
51
|
-
};
|
|
52
|
-
const parsedResponse = (0, https_1.parseAxiosError)(new axios_1.AxiosError('message', '400', undefined, request, response));
|
|
53
|
-
expect(parsedResponse).toEqual({
|
|
54
|
-
responseError: {
|
|
55
|
-
data: response.data,
|
|
56
|
-
status: response.status,
|
|
57
|
-
statusText: response.statusText,
|
|
58
|
-
headers: response.headers,
|
|
59
|
-
},
|
|
60
|
-
requestBody: request.body,
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
describe('Test the utils function', () => {
|
|
65
|
-
it('Generate the base 64 encoding', async () => {
|
|
66
|
-
const value = (0, https_1.encodeToBase64)('123', '123');
|
|
67
|
-
expect(value).toEqual('MTIzOjEyMw');
|
|
68
|
-
});
|
|
69
|
-
it('encode the body request', async () => {
|
|
70
|
-
const body = {
|
|
71
|
-
amount: '123',
|
|
72
|
-
};
|
|
73
|
-
const value = (0, https_1.encodeTheBodyOfRequest)(body);
|
|
74
|
-
expect(value).toEqual('amount=123');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
//# sourceMappingURL=https.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"https.spec.js","sourceRoot":"","sources":["../../../../src/utils/https.spec.ts"],"names":[],"mappings":";;AAAA,mCAKiB;AACjB,iCAAkD;AAElD,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;IAC5B,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,CAAC,IAAI,GAAG,SAAsC,C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AC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface LoggerInterface {
|
|
2
|
-
/**
|
|
3
|
-
* Logs a debug level message.
|
|
4
|
-
* @param {string[]} args
|
|
5
|
-
*/
|
|
6
|
-
log(...args: string[]): void;
|
|
7
|
-
/**
|
|
8
|
-
* Logs an info level message.
|
|
9
|
-
* @param {string[]} args
|
|
10
|
-
*/
|
|
11
|
-
info(...args: string[]): void;
|
|
12
|
-
/**
|
|
13
|
-
* Logs a waning level message.
|
|
14
|
-
* @param {string[]} args
|
|
15
|
-
*/
|
|
16
|
-
warn(...args: string[]): void;
|
|
17
|
-
/**
|
|
18
|
-
* Logs an error level message.
|
|
19
|
-
* @param {string[]} args
|
|
20
|
-
*/
|
|
21
|
-
error(...args: string[]): void;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=logging_interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logging_interface.d.ts","sourceRoot":"","sources":["../../../../src/utils/logging_interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE7B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logging_interface.js","sourceRoot":"","sources":["../../../../src/utils/logging_interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Data return to user when requesting an operation.
|
|
3
|
-
*/
|
|
4
|
-
export type OperationResponse<T, T2 = unknown, R = unknown> = Promise<SuccessfulOperationResponse<T, T2> | FailedOperationResponse<R>>;
|
|
5
|
-
type SuccessfulOperationResponse<T, T2 = unknown> = {
|
|
6
|
-
data: T;
|
|
7
|
-
raw: T2;
|
|
8
|
-
error?: never;
|
|
9
|
-
};
|
|
10
|
-
type FailedOperationResponse<R = unknown> = {
|
|
11
|
-
data?: never;
|
|
12
|
-
raw?: unknown;
|
|
13
|
-
error: R;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=operation_response.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation_response.d.ts","sourceRoot":"","sources":["../../../../src/utils/operation_response.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,OAAO,CACnE,2BAA2B,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAChE,CAAC;AACF,KAAK,2BAA2B,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,IAAI;IAClD,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,EAAE,CAAC;IACR,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,KAAK,uBAAuB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;CACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation_response.js","sourceRoot":"","sources":["../../../../src/utils/operation_response.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,QAAQ;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TargetEnvironment = void 0;
|
|
4
|
-
var TargetEnvironment;
|
|
5
|
-
(function (TargetEnvironment) {
|
|
6
|
-
TargetEnvironment["sandbox"] = "dev";
|
|
7
|
-
TargetEnvironment["prod"] = "prod";
|
|
8
|
-
TargetEnvironment["fake"] = "fake";
|
|
9
|
-
})(TargetEnvironment || (exports.TargetEnvironment = TargetEnvironment = {}));
|
|
10
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils/utils.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,kCAAa,CAAA;IACb,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|