@bigid/apps-infrastructure-node-js 1.181.3 → 1.187.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.
- package/.github/workflows/private-registry-publish.yml +1 -0
- package/.github/workflows/public-registry-publish.yml +1 -0
- package/.github/workflows/tests.yml +17 -0
- package/lib/services/bigidProxyService.js +3 -1
- package/package.json +8 -4
- package/src/services/bigidProxyService.ts +3 -1
- package/test/unit/commands/commands.spec.ts +5 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Run tests for MR
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "**" ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
Test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v2.1.1
|
|
12
|
+
- run: npm i
|
|
13
|
+
- run: tsc
|
|
14
|
+
- run: npm run test
|
|
15
|
+
env:
|
|
16
|
+
TOKEN: ${{ secrets.NPMJS_TOKEN }}
|
|
17
|
+
|
|
@@ -39,9 +39,11 @@ const doCallToUrl = (bigidToken, requestMethod, endpoint, bodyJson) => __awaiter
|
|
|
39
39
|
'Content-Type': 'application/json',
|
|
40
40
|
Authorization: bigidToken,
|
|
41
41
|
};
|
|
42
|
+
const parsedUrl = new URL(endpoint);
|
|
43
|
+
parsedUrl.pathname = parsedUrl.pathname.replace(/\/+/g, '/');
|
|
42
44
|
const requestObj = {
|
|
43
45
|
method: requestMethod,
|
|
44
|
-
url:
|
|
46
|
+
url: parsedUrl.toString(),
|
|
45
47
|
headers: headers,
|
|
46
48
|
httpsAgent: new https_1.Agent({
|
|
47
49
|
rejectUnauthorized: false,
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigid/apps-infrastructure-node-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.187.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"docs": "npx tsc && ./node_modules/.bin/jsdoc -c jsdoc.json"
|
|
7
|
+
"docs": "npx tsc && ./node_modules/.bin/jsdoc -c jsdoc.json",
|
|
8
|
+
"test": "mocha 'test/**/*.ts'"
|
|
8
9
|
},
|
|
9
10
|
"types": "lib/index.d.ts",
|
|
10
11
|
"repository": {
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@types/express": "^4.17.13",
|
|
18
19
|
"@types/http-errors": "^1.8.1",
|
|
20
|
+
"@types/mocha": "10.0.3",
|
|
19
21
|
"@types/node": "^16.11.10",
|
|
20
22
|
"@types/node-schedule": "^2.1.0",
|
|
21
23
|
"@typescript-eslint/eslint-plugin": "4.6.1",
|
|
@@ -29,12 +31,14 @@
|
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
33
|
"axios": "0.24.0",
|
|
32
|
-
"follow-redirects": "1.15.2",
|
|
33
34
|
"express": "4.17.3",
|
|
35
|
+
"follow-redirects": "1.15.2",
|
|
34
36
|
"form-data": "^4.0.0",
|
|
35
37
|
"http-errors": "^1.8.1",
|
|
36
38
|
"jsdoc": "4.0.2",
|
|
37
39
|
"log4js": "^6.4.0",
|
|
38
|
-
"
|
|
40
|
+
"mocha": "10.2.0",
|
|
41
|
+
"node-schedule": "2.1.1",
|
|
42
|
+
"ts-node": "10.9.1"
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -40,10 +40,12 @@ export const doCallToUrl = async (
|
|
|
40
40
|
'Content-Type': 'application/json',
|
|
41
41
|
Authorization: bigidToken,
|
|
42
42
|
};
|
|
43
|
+
const parsedUrl = new URL(endpoint);
|
|
44
|
+
parsedUrl.pathname = parsedUrl.pathname.replace(/\/+/g, '/');
|
|
43
45
|
|
|
44
46
|
const requestObj: Record<string, any> = {
|
|
45
47
|
method: requestMethod,
|
|
46
|
-
url:
|
|
48
|
+
url: parsedUrl.toString(),
|
|
47
49
|
headers: headers,
|
|
48
50
|
httpsAgent: new Agent({
|
|
49
51
|
rejectUnauthorized: false,
|