@vtecx/vtecxnext 2.2.16 → 2.2.18
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 +38 -13
- package/package.json +9 -10
package/dist/vtecxnext.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -416,6 +426,8 @@ class VtecxNext {
|
|
|
416
426
|
}
|
|
417
427
|
// vte.cxからのset-cookieを転記
|
|
418
428
|
this.setCookie(response);
|
|
429
|
+
// 引き続きAPIで処理を行う場合のため、set-cookie情報を保持しておく
|
|
430
|
+
this.setLoginCookie(response);
|
|
419
431
|
const data = await response.json();
|
|
420
432
|
return { status: response.status, message: data.feed.title };
|
|
421
433
|
};
|
|
@@ -447,6 +459,8 @@ class VtecxNext {
|
|
|
447
459
|
}
|
|
448
460
|
// vte.cxからのset-cookieを転記
|
|
449
461
|
this.setCookie(response);
|
|
462
|
+
// 引き続きAPIで処理を行う場合のため、set-cookie情報を保持しておく
|
|
463
|
+
this.setLoginCookie(response);
|
|
450
464
|
const data = await response.json();
|
|
451
465
|
return { status: response.status, message: data.feed.title };
|
|
452
466
|
};
|
|
@@ -1438,9 +1452,9 @@ class VtecxNext {
|
|
|
1438
1452
|
if (num === 1) {
|
|
1439
1453
|
//console.log(`[getPageWithPagination] pagination start. uri=${uri}`)
|
|
1440
1454
|
const paginationInfo = await this.pagination(uri, `1,${String(PAGINATION_NUM)}`, targetService);
|
|
1441
|
-
//
|
|
1455
|
+
// メモリソートの場合はvte.cx側で全てのカーソルリストを作成する
|
|
1442
1456
|
if (paginationInfo.hasNext && !paginationInfo.isMemorysort) {
|
|
1443
|
-
//
|
|
1457
|
+
// メモリソートでない場合、次のカーソルリスト作成 (非同期のまま)
|
|
1444
1458
|
this.nextPagination(uri, PAGINATION_NUM, targetService);
|
|
1445
1459
|
}
|
|
1446
1460
|
if (paginationInfo.lastPageNumber === 0) {
|
|
@@ -1473,10 +1487,21 @@ class VtecxNext {
|
|
|
1473
1487
|
*/
|
|
1474
1488
|
nextPagination = async (uri, prevLastPage, targetService) => {
|
|
1475
1489
|
const firstPage = prevLastPage + 1;
|
|
1476
|
-
const lastPage = prevLastPage +
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
await this.
|
|
1490
|
+
const lastPage = prevLastPage + PAGINATION_NUM;
|
|
1491
|
+
//console.log(`[vtecxnext getPageWithPagination - nextPagination] firstPage=${firstPage} lastPage=${lastPage}`)
|
|
1492
|
+
try {
|
|
1493
|
+
const paginationInfo = await this.pagination(uri, `${String(firstPage)},${String(lastPage)}`, targetService);
|
|
1494
|
+
if (paginationInfo.hasNext) {
|
|
1495
|
+
await this.nextPagination(uri, lastPage, targetService);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
catch (e) {
|
|
1499
|
+
// Do nothing.
|
|
1500
|
+
//if (isVtecxNextError(e)) {
|
|
1501
|
+
//console.log(`[vtecxnext getPageWithPagination - nextPagination] status=${e.status} message=${e.message}`)
|
|
1502
|
+
//} else {
|
|
1503
|
+
//console.log(`[vtecxnext getPageWithPagination - nextPagination] Error occured. ${e}`)
|
|
1504
|
+
//}
|
|
1480
1505
|
}
|
|
1481
1506
|
};
|
|
1482
1507
|
/**
|
package/package.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtecx/vtecxnext",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.18",
|
|
4
4
|
"description": "vte.cx Next.js api",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "tsc",
|
|
11
|
-
"prepublishOnly": "npm run build"
|
|
12
|
-
},
|
|
13
9
|
"repository": {
|
|
14
10
|
"type": "git",
|
|
15
11
|
"url": "git+https://github.com/reflexworks/vtecxnext.git"
|
|
@@ -22,13 +18,16 @@
|
|
|
22
18
|
},
|
|
23
19
|
"homepage": "https://github.com/reflexworks/vtecxnext#readme",
|
|
24
20
|
"devDependencies": {
|
|
25
|
-
"@types/node": "^22.
|
|
21
|
+
"@types/node": "^22.10.5",
|
|
26
22
|
"@types/sqlstring": "^2.3.2",
|
|
27
23
|
"ts-node": "^10.9.2",
|
|
28
|
-
"typescript": "^5.
|
|
24
|
+
"typescript": "^5.7.3"
|
|
29
25
|
},
|
|
30
26
|
"dependencies": {
|
|
31
|
-
"next": "^15.
|
|
32
|
-
"sqlstring": "^2.3.
|
|
27
|
+
"next": "^15.1.4",
|
|
28
|
+
"sqlstring": "^2.3.3"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc"
|
|
33
32
|
}
|
|
34
|
-
}
|
|
33
|
+
}
|