@vtecx/vtecxnext 2.2.6 → 2.2.8

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.
@@ -28,6 +28,7 @@ export type PaginationInfo = {
28
28
  lastPageNumber: number;
29
29
  countWithinRange: number;
30
30
  hasNext: boolean;
31
+ isMemorysort: boolean;
31
32
  };
32
33
  export declare class VtecxNext {
33
34
  /** Request */
package/dist/vtecxnext.js CHANGED
@@ -47,6 +47,8 @@ const SERVLETPATH_OAUTH = '/o';
47
47
  const HEADER_NEXTPAGE = 'x-vtecx-nextpage';
48
48
  /** The number of cursors to create (for practical paging) */
49
49
  const PAGINATION_NUM = 7;
50
+ /** pagination memorysort */
51
+ const MEMORYSORT = 'memorysort';
50
52
  class VtecxNext {
51
53
  /** Request */
52
54
  req;
@@ -1388,7 +1390,8 @@ class VtecxNext {
1388
1390
  const pagenationInfo = {
1389
1391
  'lastPageNumber': Number(respJson.feed.title),
1390
1392
  'countWithinRange': Number(respJson.feed.subtitle),
1391
- 'hasNext': hasNext
1393
+ 'hasNext': hasNext,
1394
+ 'isMemorysort': respJson.feed.rights === MEMORYSORT
1392
1395
  };
1393
1396
  return pagenationInfo;
1394
1397
  };
@@ -1436,7 +1439,8 @@ class VtecxNext {
1436
1439
  if (num === 1) {
1437
1440
  //console.log(`[getPageWithPagination] pagination start. uri=${uri}`)
1438
1441
  const paginationInfo = await this.pagination(uri, `1,${String(PAGINATION_NUM)}`, targetService);
1439
- if (paginationInfo.hasNext) {
1442
+ // メモリソートの場合は全てのカーソルリストを作成する
1443
+ if (paginationInfo.hasNext && !paginationInfo.isMemorysort) {
1440
1444
  // 次のカーソルリスト作成 (非同期のまま)
1441
1445
  this.nextPagination(uri, PAGINATION_NUM, targetService);
1442
1446
  }
@@ -2289,20 +2293,17 @@ class VtecxNext {
2289
2293
  //console.log(`[vtecxnext addGroupByAdmin] start. group=${group} selfid=${selfid} uids=${uids}`)
2290
2294
  // 入力チェック
2291
2295
  checkUri(group, 'group key');
2296
+ checkNotNull(uids, 'uid');
2292
2297
  //checkNotNull(selfid, 'selfid (hierarchical name under my group alias)')
2293
2298
  // vte.cxへリクエスト
2294
2299
  const method = 'POST';
2295
2300
  const url = `${SERVLETPATH_PROVIDER}${group}?_addgroupByAdmin${selfid ? '&_selfid=' + selfid : ''}`;
2296
- let value;
2297
- if (uids) {
2298
- const feed = [];
2299
- for (const uid of uids) {
2300
- const entry = { 'link': [{ '___rel': 'self', '___href': `/_user/${uid}` }] };
2301
- feed.push(entry);
2302
- }
2303
- value = JSON.stringify(feed);
2301
+ const feed = [];
2302
+ for (const uid of uids) {
2303
+ const entry = { 'link': [{ '___rel': 'self', '___href': `/_user/${uid}` }] };
2304
+ feed.push(entry);
2304
2305
  }
2305
- checkNotNull(value, 'uid');
2306
+ const value = JSON.stringify(feed);
2306
2307
  let response;
2307
2308
  try {
2308
2309
  response = await this.requestVtecx(method, url, value);
@@ -4174,7 +4175,7 @@ const isBlank = (val) => {
4174
4175
  if (val === null || val === undefined || val === '') {
4175
4176
  return true;
4176
4177
  }
4177
- if (Array.isArray(val) && val.length === 0) {
4178
+ if (Array.isArray(val) && val.length <= 0) {
4178
4179
  return true;
4179
4180
  }
4180
4181
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtecx/vtecxnext",
3
- "version": "2.2.6",
3
+ "version": "2.2.8",
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
  }