@vtecx/vtecxnext 2.2.3 → 2.2.4
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.d.ts +7 -2
- package/dist/vtecxnext.js +13 -3
- package/package.json +1 -1
package/dist/vtecxnext.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export type CreateGroupadminInfo = {
|
|
|
24
24
|
group: string;
|
|
25
25
|
uids: string[];
|
|
26
26
|
};
|
|
27
|
+
export type PaginationInfo = {
|
|
28
|
+
lastPageNumber: number;
|
|
29
|
+
countWithinRange: number;
|
|
30
|
+
hasNext: boolean;
|
|
31
|
+
};
|
|
27
32
|
export declare class VtecxNext {
|
|
28
33
|
/** Request */
|
|
29
34
|
readonly req: NextRequest | undefined;
|
|
@@ -383,9 +388,9 @@ export declare class VtecxNext {
|
|
|
383
388
|
* @param uri key and conditions
|
|
384
389
|
* @param pagerange page range
|
|
385
390
|
* @param targetService target service name (for service linkage)
|
|
386
|
-
* @return
|
|
391
|
+
* @return Maximum number of pages in the specified page range, and total count.
|
|
387
392
|
*/
|
|
388
|
-
pagination: (uri: string, pagerange: string, targetService?: string) => Promise<
|
|
393
|
+
pagination: (uri: string, pagerange: string, targetService?: string) => Promise<PaginationInfo>;
|
|
389
394
|
/**
|
|
390
395
|
* get page
|
|
391
396
|
* @param uri key and conditions
|
package/dist/vtecxnext.js
CHANGED
|
@@ -1356,7 +1356,7 @@ class VtecxNext {
|
|
|
1356
1356
|
* @param uri key and conditions
|
|
1357
1357
|
* @param pagerange page range
|
|
1358
1358
|
* @param targetService target service name (for service linkage)
|
|
1359
|
-
* @return
|
|
1359
|
+
* @return Maximum number of pages in the specified page range, and total count.
|
|
1360
1360
|
*/
|
|
1361
1361
|
pagination = async (uri, pagerange, targetService) => {
|
|
1362
1362
|
//console.log('[vtecxnext pagination] start.')
|
|
@@ -1377,8 +1377,18 @@ class VtecxNext {
|
|
|
1377
1377
|
this.setCookie(response);
|
|
1378
1378
|
// レスポンスのエラーチェック
|
|
1379
1379
|
await checkVtecxResponse(response);
|
|
1380
|
-
//
|
|
1381
|
-
|
|
1380
|
+
// 戻り値編集
|
|
1381
|
+
const respJson = await getJson(response);
|
|
1382
|
+
let hasNext = false;
|
|
1383
|
+
if (respJson.feed.link && respJson.feed.link[0]?.___rel === 'next') {
|
|
1384
|
+
hasNext = true;
|
|
1385
|
+
}
|
|
1386
|
+
const pagenationInfo = {
|
|
1387
|
+
'lastPageNumber': Number(respJson.feed.title),
|
|
1388
|
+
'countWithinRange': Number(respJson.feed.subtitle),
|
|
1389
|
+
'hasNext': hasNext
|
|
1390
|
+
};
|
|
1391
|
+
return pagenationInfo;
|
|
1382
1392
|
};
|
|
1383
1393
|
/**
|
|
1384
1394
|
* get page
|