@vtecx/vtecxnext 1.1.5 → 1.1.7
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/vtecxnext.js +17 -1
- package/package.json +3 -3
package/dist/vtecxnext.js
CHANGED
|
@@ -3077,7 +3077,18 @@ const requestVtecx = async (method, url, req, body, additionalHeaders, targetSer
|
|
|
3077
3077
|
}
|
|
3078
3078
|
if (targetService) {
|
|
3079
3079
|
// サービス連携の場合
|
|
3080
|
-
|
|
3080
|
+
let servicekey = process.env[`SERVICEKEY_${targetService}`];
|
|
3081
|
+
if (!servicekey) {
|
|
3082
|
+
const max = 10;
|
|
3083
|
+
for (let i = 1; i <= max; i++) {
|
|
3084
|
+
const iStr = String(i);
|
|
3085
|
+
const tmpServiceName = process.env[`SERVICELINKAGE_${iStr}`];
|
|
3086
|
+
if (targetService == tmpServiceName) {
|
|
3087
|
+
servicekey = process.env[`SERVICEKEY_${iStr}`];
|
|
3088
|
+
break;
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3081
3092
|
//console.log(`[requestVtecx] targetService=${targetService} servicekey=${servicekey}`)
|
|
3082
3093
|
if (servicekey) {
|
|
3083
3094
|
headers['X-SERVICELINKAGE'] = targetService;
|
|
@@ -3295,6 +3306,11 @@ const getJson = async (response) => {
|
|
|
3295
3306
|
if (response.status === 204) {
|
|
3296
3307
|
return null;
|
|
3297
3308
|
}
|
|
3309
|
+
// content-length=0の場合nullを返す
|
|
3310
|
+
const contentLength = response.headers.get('content-length');
|
|
3311
|
+
if (contentLength === '0') {
|
|
3312
|
+
return null;
|
|
3313
|
+
}
|
|
3298
3314
|
try {
|
|
3299
3315
|
return await response.json();
|
|
3300
3316
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtecx/vtecxnext",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "vte.cx Next.js api",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"homepage": "https://github.com/reflexworks/vtecxnext#readme",
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/formidable": "^2.0.5",
|
|
26
|
-
"@types/node": "^18.
|
|
26
|
+
"@types/node": "^18.16.12",
|
|
27
27
|
"@types/sqlstring": "^2.3.0",
|
|
28
28
|
"ts-node": "^10.9.1",
|
|
29
|
-
"typescript": "^4.9.
|
|
29
|
+
"typescript": "^4.9.5"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"formidable": "^2.1.1",
|