@vtecx/vtecxnext 2.2.5 → 2.2.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.
@@ -407,13 +407,14 @@ export declare class VtecxNext {
407
407
  * @param targetService target service name (for service linkage)
408
408
  * @return feed (entry array)
409
409
  */
410
- practicalPaging: (uri: string, num: number, targetService?: string) => Promise<any>;
410
+ getPageWithPagination: (uri: string, num: number, targetService?: string) => Promise<any>;
411
411
  /**
412
412
  * ページングのカーソルリスト作成処理
413
413
  * 続きがある場合、次のカーソルリスト作成処理を実行する
414
414
  * @param vtecxnext
415
415
  * @param uri キーとパラメータ
416
416
  * @param prevLastPage 前回の最終ページ
417
+ * @param targetService 対象サービス
417
418
  */
418
419
  private nextPagination;
419
420
  /**
package/dist/vtecxnext.js CHANGED
@@ -1430,15 +1430,15 @@ class VtecxNext {
1430
1430
  * @param targetService target service name (for service linkage)
1431
1431
  * @return feed (entry array)
1432
1432
  */
1433
- practicalPaging = async (uri, num, targetService) => {
1434
- //console.log(`[practicalPaging] start. uri=${uri} num=${num} ${targetService ? 'targetService=' + targetService : ''}`)
1433
+ getPageWithPagination = async (uri, num, targetService) => {
1434
+ //console.log(`[getPageWithPagination] start. uri=${uri} num=${num} ${targetService ? 'targetService=' + targetService : ''}`)
1435
1435
  // ページ数が1の場合、カーソルリスト作成処理を行う
1436
1436
  if (num === 1) {
1437
- //console.log(`[practicalPaging] pagination start. uri=${uri}`)
1438
- const paginationInfo = await this.pagination(uri, `1,${String(PAGINATION_NUM)}`);
1437
+ //console.log(`[getPageWithPagination] pagination start. uri=${uri}`)
1438
+ const paginationInfo = await this.pagination(uri, `1,${String(PAGINATION_NUM)}`, targetService);
1439
1439
  if (paginationInfo.hasNext) {
1440
1440
  // 次のカーソルリスト作成 (非同期のまま)
1441
- this.nextPagination(uri, PAGINATION_NUM);
1441
+ this.nextPagination(uri, PAGINATION_NUM, targetService);
1442
1442
  }
1443
1443
  if (paginationInfo.lastPageNumber === 0) {
1444
1444
  // データが存在しない場合終了
@@ -1446,9 +1446,9 @@ class VtecxNext {
1446
1446
  }
1447
1447
  }
1448
1448
  // ページ取得
1449
- //console.log(`[practicalPaging] getPage start. uri=${uri} num=${num}`)
1449
+ //console.log(`[getPageWithPagination] getPage start. uri=${uri} num=${num}`)
1450
1450
  try {
1451
- return await this.getPage(uri, num);
1451
+ return await this.getPage(uri, num, targetService);
1452
1452
  }
1453
1453
  catch (error) {
1454
1454
  if ((0, exports.isVtecxNextError)(error)) {
@@ -1466,13 +1466,14 @@ class VtecxNext {
1466
1466
  * @param vtecxnext
1467
1467
  * @param uri キーとパラメータ
1468
1468
  * @param prevLastPage 前回の最終ページ
1469
+ * @param targetService 対象サービス
1469
1470
  */
1470
- nextPagination = async (uri, prevLastPage) => {
1471
+ nextPagination = async (uri, prevLastPage, targetService) => {
1471
1472
  const firstPage = prevLastPage + 1;
1472
1473
  const lastPage = prevLastPage + prevLastPage;
1473
- const paginationInfo = await this.pagination(uri, `${String(firstPage)},${String(lastPage)}`);
1474
+ const paginationInfo = await this.pagination(uri, `${String(firstPage)},${String(lastPage)}`, targetService);
1474
1475
  if (paginationInfo.hasNext) {
1475
- await this.nextPagination(uri, lastPage);
1476
+ await this.nextPagination(uri, lastPage, targetService);
1476
1477
  }
1477
1478
  };
1478
1479
  /**
@@ -2288,20 +2289,17 @@ class VtecxNext {
2288
2289
  //console.log(`[vtecxnext addGroupByAdmin] start. group=${group} selfid=${selfid} uids=${uids}`)
2289
2290
  // 入力チェック
2290
2291
  checkUri(group, 'group key');
2292
+ checkNotNull(uids, 'uid');
2291
2293
  //checkNotNull(selfid, 'selfid (hierarchical name under my group alias)')
2292
2294
  // vte.cxへリクエスト
2293
2295
  const method = 'POST';
2294
2296
  const url = `${SERVLETPATH_PROVIDER}${group}?_addgroupByAdmin${selfid ? '&_selfid=' + selfid : ''}`;
2295
- let value;
2296
- if (uids) {
2297
- const feed = [];
2298
- for (const uid of uids) {
2299
- const entry = { 'link': [{ '___rel': 'self', '___href': `/_user/${uid}` }] };
2300
- feed.push(entry);
2301
- }
2302
- value = JSON.stringify(feed);
2297
+ const feed = [];
2298
+ for (const uid of uids) {
2299
+ const entry = { 'link': [{ '___rel': 'self', '___href': `/_user/${uid}` }] };
2300
+ feed.push(entry);
2303
2301
  }
2304
- checkNotNull(value, 'uid');
2302
+ const value = JSON.stringify(feed);
2305
2303
  let response;
2306
2304
  try {
2307
2305
  response = await this.requestVtecx(method, url, value);
@@ -4173,7 +4171,7 @@ const isBlank = (val) => {
4173
4171
  if (val === null || val === undefined || val === '') {
4174
4172
  return true;
4175
4173
  }
4176
- if (Array.isArray(val) && val.length === 0) {
4174
+ if (Array.isArray(val) && val.length <= 0) {
4177
4175
  return true;
4178
4176
  }
4179
4177
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtecx/vtecxnext",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "description": "vte.cx Next.js api",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -22,13 +22,13 @@
22
22
  },
23
23
  "homepage": "https://github.com/reflexworks/vtecxnext#readme",
24
24
  "devDependencies": {
25
- "@types/node": "^20.12.13",
25
+ "@types/node": "^22.7.9",
26
26
  "@types/sqlstring": "^2.3.2",
27
27
  "ts-node": "^10.9.2",
28
- "typescript": "^5.4.5"
28
+ "typescript": "^5.6.3"
29
29
  },
30
30
  "dependencies": {
31
- "next": "^14.2.3",
31
+ "next": "^14.2.16",
32
32
  "sqlstring": "^2.3.2"
33
33
  }
34
34
  }