@vtecx/vtecxnext 2.2.12 → 2.2.14

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.
@@ -635,9 +635,9 @@ export declare class VtecxNext {
635
635
  /**
636
636
  * Get groups
637
637
  * @param uri group key
638
- * @return feed (entry array)
638
+ * @return group array
639
639
  */
640
- getGroups: () => Promise<any>;
640
+ getGroups: () => Promise<string[] | null>;
641
641
  /**
642
642
  * whether you are in the group
643
643
  * @param uri group key
@@ -714,7 +714,7 @@ export declare class VtecxNext {
714
714
  * @param account account
715
715
  * @return user status
716
716
  */
717
- userstatus: (account?: string) => Promise<any>;
717
+ userstatus: (account?: string) => Promise<string | any>;
718
718
  /**
719
719
  * revoke user
720
720
  * @param account account
package/dist/vtecxnext.js CHANGED
@@ -2441,7 +2441,7 @@ class VtecxNext {
2441
2441
  /**
2442
2442
  * Get groups
2443
2443
  * @param uri group key
2444
- * @return feed (entry array)
2444
+ * @return group array
2445
2445
  */
2446
2446
  getGroups = async () => {
2447
2447
  //console.log('[vtecxnext getGroups] start.')
@@ -2461,7 +2461,18 @@ class VtecxNext {
2461
2461
  // レスポンスのエラーチェック
2462
2462
  await checkVtecxResponse(response);
2463
2463
  // 戻り値
2464
- return await getJson(response);
2464
+ const feed = await getJson(response);
2465
+ //console.log(`[vtecxnext getGroups] feed=${JSON.stringify(feed)}`)
2466
+ if (feed && Array.isArray(feed) && feed.length > 0) {
2467
+ const groups = [];
2468
+ for (const entry of feed) {
2469
+ if (entry.link && entry.link.length > 0) {
2470
+ groups.push(entry.link[0].___href);
2471
+ }
2472
+ }
2473
+ return groups;
2474
+ }
2475
+ return null;
2465
2476
  };
2466
2477
  /**
2467
2478
  * whether you are in the group
@@ -2800,8 +2811,12 @@ class VtecxNext {
2800
2811
  this.setCookie(response);
2801
2812
  // レスポンスのエラーチェック
2802
2813
  await checkVtecxResponse(response);
2814
+ const retJson = await getJson(response);
2803
2815
  // 戻り値
2804
- return await getJson(response);
2816
+ if (account && retJson) {
2817
+ return retJson.summary;
2818
+ }
2819
+ return retJson;
2805
2820
  };
2806
2821
  /**
2807
2822
  * revoke user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtecx/vtecxnext",
3
- "version": "2.2.12",
3
+ "version": "2.2.14",
4
4
  "description": "vte.cx Next.js api",
5
5
  "main": "dist/index.js",
6
6
  "files": [