@vtecx/vtecxnext 2.2.13 → 2.2.15
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 -5
- package/dist/vtecxnext.js +99 -95
- package/package.json +1 -1
package/dist/vtecxnext.d.ts
CHANGED
|
@@ -714,20 +714,22 @@ 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
|
|
721
|
+
* @param isDeleteGroups true if delete groups
|
|
721
722
|
* @return message feed
|
|
722
723
|
*/
|
|
723
|
-
revokeuser: (account: string) => Promise<any>;
|
|
724
|
+
revokeuser: (account: string, isDeleteGroups?: boolean) => Promise<any>;
|
|
724
725
|
/**
|
|
725
726
|
* revoke users
|
|
726
727
|
* @param accounts account list
|
|
727
728
|
* @param uids uid list
|
|
729
|
+
* @param isDeleteGroups true if delete groups
|
|
728
730
|
* @return message feed
|
|
729
731
|
*/
|
|
730
|
-
revokeusers: (accounts?: string[], uids?: string[]) => Promise<any>;
|
|
732
|
+
revokeusers: (accounts?: string[], uids?: string[], isDeleteGroups?: boolean) => Promise<any>;
|
|
731
733
|
/**
|
|
732
734
|
* activate user
|
|
733
735
|
* @param account account
|
|
@@ -743,10 +745,10 @@ export declare class VtecxNext {
|
|
|
743
745
|
activateusers: (accounts?: string[], uids?: string[]) => Promise<any>;
|
|
744
746
|
/**
|
|
745
747
|
* cancel user.
|
|
746
|
-
* @param
|
|
748
|
+
* @param isDeleteGroups true if delete groups
|
|
747
749
|
* @return message feed
|
|
748
750
|
*/
|
|
749
|
-
canceluser: () => Promise<any>;
|
|
751
|
+
canceluser: (isDeleteGroups?: boolean) => Promise<any>;
|
|
750
752
|
/**
|
|
751
753
|
* delete user
|
|
752
754
|
* @param account account
|
package/dist/vtecxnext.js
CHANGED
|
@@ -192,8 +192,7 @@ class VtecxNext {
|
|
|
192
192
|
if (this.resStatus !== 204) {
|
|
193
193
|
if (data) {
|
|
194
194
|
if (data instanceof Object) {
|
|
195
|
-
if (!('content-type' in this.resHeaders) &&
|
|
196
|
-
!('Content-Type' in this.resHeaders)) {
|
|
195
|
+
if (!('content-type' in this.resHeaders) && !('Content-Type' in this.resHeaders)) {
|
|
197
196
|
this.resHeaders['content-type'] = 'application/json';
|
|
198
197
|
}
|
|
199
198
|
resData = JSON.stringify(data);
|
|
@@ -222,7 +221,7 @@ class VtecxNext {
|
|
|
222
221
|
* @return true
|
|
223
222
|
*/
|
|
224
223
|
sendMessage = (statusCode, message) => {
|
|
225
|
-
const resJson = {
|
|
224
|
+
const resJson = { feed: { title: message } };
|
|
226
225
|
return this.response(statusCode, resJson);
|
|
227
226
|
};
|
|
228
227
|
/**
|
|
@@ -434,7 +433,7 @@ class VtecxNext {
|
|
|
434
433
|
// ログイン
|
|
435
434
|
const method = 'GET';
|
|
436
435
|
const url = `${SERVLETPATH_DATA}/?_login`;
|
|
437
|
-
const headers = {
|
|
436
|
+
const headers = { Authorization: `TOTP ${totp}` };
|
|
438
437
|
if (isTrustedDevice) {
|
|
439
438
|
headers['X-TRUSTED-DEVICE'] = 'true';
|
|
440
439
|
}
|
|
@@ -514,7 +513,7 @@ class VtecxNext {
|
|
|
514
513
|
log = async (message, title, subtitle) => {
|
|
515
514
|
const logTitle = title ?? 'JavaScript';
|
|
516
515
|
const logSubtitle = subtitle ?? 'INFO';
|
|
517
|
-
const feed = [{
|
|
516
|
+
const feed = [{ title: logTitle, subtitle: logSubtitle, summary: message }];
|
|
518
517
|
const method = 'POST';
|
|
519
518
|
const url = `${SERVLETPATH_PROVIDER}/?_log`;
|
|
520
519
|
let response;
|
|
@@ -941,7 +940,7 @@ class VtecxNext {
|
|
|
941
940
|
// vte.cxへリクエスト
|
|
942
941
|
const method = 'PUT';
|
|
943
942
|
const url = `${SERVLETPATH_PROVIDER}${uri}?_rangeids`;
|
|
944
|
-
const feed = {
|
|
943
|
+
const feed = { feed: { title: range } };
|
|
945
944
|
let response;
|
|
946
945
|
try {
|
|
947
946
|
response = await this.requestVtecx(method, url, JSON.stringify(feed));
|
|
@@ -1028,7 +1027,7 @@ class VtecxNext {
|
|
|
1028
1027
|
// vte.cxへリクエスト
|
|
1029
1028
|
const method = 'PUT';
|
|
1030
1029
|
const url = `${SERVLETPATH_PROVIDER}/?_sessionentry=${name}`;
|
|
1031
|
-
const feed = {
|
|
1030
|
+
const feed = { feed: { entry: entry } };
|
|
1032
1031
|
let response;
|
|
1033
1032
|
try {
|
|
1034
1033
|
response = await this.requestVtecx(method, url, JSON.stringify(feed));
|
|
@@ -1057,7 +1056,7 @@ class VtecxNext {
|
|
|
1057
1056
|
// vte.cxへリクエスト
|
|
1058
1057
|
const method = 'PUT';
|
|
1059
1058
|
const url = `${SERVLETPATH_PROVIDER}/?_sessionstring=${name}`;
|
|
1060
|
-
const feed = {
|
|
1059
|
+
const feed = { feed: { title: str } };
|
|
1061
1060
|
let response;
|
|
1062
1061
|
try {
|
|
1063
1062
|
response = await this.requestVtecx(method, url, JSON.stringify(feed));
|
|
@@ -1086,7 +1085,7 @@ class VtecxNext {
|
|
|
1086
1085
|
// vte.cxへリクエスト
|
|
1087
1086
|
const method = 'PUT';
|
|
1088
1087
|
const url = `${SERVLETPATH_PROVIDER}/?_sessionlong=${name}`;
|
|
1089
|
-
const feed = {
|
|
1088
|
+
const feed = { feed: { title: String(num) } };
|
|
1090
1089
|
let response;
|
|
1091
1090
|
try {
|
|
1092
1091
|
response = await this.requestVtecx(method, url, JSON.stringify(feed));
|
|
@@ -1388,10 +1387,10 @@ class VtecxNext {
|
|
|
1388
1387
|
hasNext = true;
|
|
1389
1388
|
}
|
|
1390
1389
|
const pagenationInfo = {
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1390
|
+
lastPageNumber: Number(respJson.feed.title),
|
|
1391
|
+
countWithinRange: Number(respJson.feed.subtitle),
|
|
1392
|
+
hasNext: hasNext,
|
|
1393
|
+
isMemorysort: respJson.feed.rights === MEMORYSORT
|
|
1395
1394
|
};
|
|
1396
1395
|
return pagenationInfo;
|
|
1397
1396
|
};
|
|
@@ -1492,7 +1491,7 @@ class VtecxNext {
|
|
|
1492
1491
|
// 入力チェック
|
|
1493
1492
|
checkNotNull(feed, 'Feed');
|
|
1494
1493
|
// リクエストデータ
|
|
1495
|
-
const reqFeed = 'feed' in feed ? feed : {
|
|
1494
|
+
const reqFeed = 'feed' in feed ? feed : { feed: { entry: feed } };
|
|
1496
1495
|
// テーブル名の指定がある場合は指定
|
|
1497
1496
|
const tablenamesStr = editBqTableNames(tablenames);
|
|
1498
1497
|
if (tablenamesStr) {
|
|
@@ -1533,10 +1532,10 @@ class VtecxNext {
|
|
|
1533
1532
|
let idx = 0;
|
|
1534
1533
|
for (const key of keys) {
|
|
1535
1534
|
//console.log(`[vtecxnext deleteBQ] key=${key}`)
|
|
1536
|
-
links[idx] = {
|
|
1535
|
+
links[idx] = { ___href: key };
|
|
1537
1536
|
idx++;
|
|
1538
1537
|
}
|
|
1539
|
-
const feed = {
|
|
1538
|
+
const feed = { feed: {} };
|
|
1540
1539
|
if (tablenamesStr) {
|
|
1541
1540
|
feed.feed['title'] = tablenamesStr;
|
|
1542
1541
|
}
|
|
@@ -1660,7 +1659,7 @@ class VtecxNext {
|
|
|
1660
1659
|
checkUri(uri);
|
|
1661
1660
|
}
|
|
1662
1661
|
// リクエストデータ
|
|
1663
|
-
const reqFeed = 'feed' in feed ? feed : {
|
|
1662
|
+
const reqFeed = 'feed' in feed ? feed : { feed: { entry: feed } };
|
|
1664
1663
|
// テーブル名の指定がある場合は指定
|
|
1665
1664
|
const tablenamesStr = editBqTableNames(tablenames);
|
|
1666
1665
|
if (tablenamesStr) {
|
|
@@ -1699,7 +1698,7 @@ class VtecxNext {
|
|
|
1699
1698
|
checkUri(uri);
|
|
1700
1699
|
}
|
|
1701
1700
|
// リクエストデータ
|
|
1702
|
-
const reqFeed = 'feed' in feed ? feed : {
|
|
1701
|
+
const reqFeed = 'feed' in feed ? feed : { feed: { entry: feed } };
|
|
1703
1702
|
// テーブル名の指定がある場合は指定
|
|
1704
1703
|
const tablenamesStr = editBqTableNames(tablenames);
|
|
1705
1704
|
//console.log(`[putBDBQ] tableamesStr=${tablenamesStr}`)
|
|
@@ -1740,10 +1739,10 @@ class VtecxNext {
|
|
|
1740
1739
|
let idx = 0;
|
|
1741
1740
|
for (const key of keys) {
|
|
1742
1741
|
//console.log(`[vtecxnext deleteBDBQ] key=${key}`)
|
|
1743
|
-
links[idx] = {
|
|
1742
|
+
links[idx] = { ___href: key };
|
|
1744
1743
|
idx++;
|
|
1745
1744
|
}
|
|
1746
|
-
const feed = {
|
|
1745
|
+
const feed = { feed: {} };
|
|
1747
1746
|
if (tablenamesStr) {
|
|
1748
1747
|
feed.feed['title'] = tablenamesStr;
|
|
1749
1748
|
}
|
|
@@ -2057,7 +2056,7 @@ class VtecxNext {
|
|
|
2057
2056
|
}
|
|
2058
2057
|
}
|
|
2059
2058
|
//console.log(`[vtecxnext sendMail] links = ${JSON.stringify(links)}`)
|
|
2060
|
-
let feed = {
|
|
2059
|
+
let feed = { feed: { entry: [entry], link: links } };
|
|
2061
2060
|
//console.log(`[vtecxnext sendMail] feed = ${JSON.stringify(feed)}`)
|
|
2062
2061
|
// vte.cxへリクエスト
|
|
2063
2062
|
const method = 'POST';
|
|
@@ -2094,21 +2093,21 @@ class VtecxNext {
|
|
|
2094
2093
|
// 引数編集
|
|
2095
2094
|
const links = [];
|
|
2096
2095
|
for (const destination of to) {
|
|
2097
|
-
const link = {
|
|
2096
|
+
const link = { ___rel: 'to', ___href: destination };
|
|
2098
2097
|
links.push(link);
|
|
2099
2098
|
}
|
|
2100
2099
|
const categories = [];
|
|
2101
2100
|
if (imageUrl) {
|
|
2102
|
-
const category = {
|
|
2101
|
+
const category = { ___scheme: 'imageurl', ___label: imageUrl };
|
|
2103
2102
|
categories.push(category);
|
|
2104
2103
|
}
|
|
2105
2104
|
if (data) {
|
|
2106
2105
|
for (const name in data) {
|
|
2107
|
-
const category = {
|
|
2106
|
+
const category = { ___scheme: name, ___label: data[name] };
|
|
2108
2107
|
categories.push(category);
|
|
2109
2108
|
}
|
|
2110
2109
|
}
|
|
2111
|
-
const content = {
|
|
2110
|
+
const content = { ______text: message };
|
|
2112
2111
|
const entry = {};
|
|
2113
2112
|
if (title) {
|
|
2114
2113
|
entry['title'] = title;
|
|
@@ -2120,9 +2119,10 @@ class VtecxNext {
|
|
|
2120
2119
|
if (categories) {
|
|
2121
2120
|
entry['category'] = categories;
|
|
2122
2121
|
}
|
|
2123
|
-
const feed = {
|
|
2124
|
-
|
|
2125
|
-
|
|
2122
|
+
const feed = {
|
|
2123
|
+
feed: {
|
|
2124
|
+
entry: [entry],
|
|
2125
|
+
link: links
|
|
2126
2126
|
}
|
|
2127
2127
|
};
|
|
2128
2128
|
//console.log(`[vtecxnext pushNotification] feed = ${JSON.stringify(feed)}`)
|
|
@@ -2300,7 +2300,7 @@ class VtecxNext {
|
|
|
2300
2300
|
const url = `${SERVLETPATH_PROVIDER}${group}?_addgroupByAdmin${selfid ? '&_selfid=' + selfid : ''}`;
|
|
2301
2301
|
const feed = [];
|
|
2302
2302
|
for (const uid of uids) {
|
|
2303
|
-
const entry = {
|
|
2303
|
+
const entry = { link: [{ ___rel: 'self', ___href: `/_user/${uid}` }] };
|
|
2304
2304
|
feed.push(entry);
|
|
2305
2305
|
}
|
|
2306
2306
|
const value = JSON.stringify(feed);
|
|
@@ -2391,7 +2391,7 @@ class VtecxNext {
|
|
|
2391
2391
|
const url = `${SERVLETPATH_PROVIDER}${group}?_leavegroupByAdmin`;
|
|
2392
2392
|
const feed = [];
|
|
2393
2393
|
for (const uid of uids) {
|
|
2394
|
-
const entry = {
|
|
2394
|
+
const entry = { link: [{ ___rel: 'self', ___href: `/_user/${uid}` }] };
|
|
2395
2395
|
feed.push(entry);
|
|
2396
2396
|
}
|
|
2397
2397
|
const value = JSON.stringify(feed);
|
|
@@ -2549,13 +2549,15 @@ class VtecxNext {
|
|
|
2549
2549
|
*/
|
|
2550
2550
|
convertAdduserInfoToEntry = (adduserInfo, isNoPswd) => {
|
|
2551
2551
|
return {
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
'
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2552
|
+
contributor: [
|
|
2553
|
+
{
|
|
2554
|
+
uri: `urn:vte.cx:auth:${this.null2blank(adduserInfo.username)}${isNoPswd ? '' : ',' + this.null2blank(adduserInfo.pswd)}`,
|
|
2555
|
+
name: adduserInfo.nickname
|
|
2556
|
+
}
|
|
2557
|
+
],
|
|
2558
|
+
title: adduserInfo.emailSubject,
|
|
2559
|
+
summary: adduserInfo.emailText,
|
|
2560
|
+
content: { ______text: adduserInfo.emailHtml }
|
|
2559
2561
|
};
|
|
2560
2562
|
};
|
|
2561
2563
|
/**
|
|
@@ -2665,17 +2667,17 @@ class VtecxNext {
|
|
|
2665
2667
|
// 入力チェック
|
|
2666
2668
|
checkNotNull(newpswd, 'new password');
|
|
2667
2669
|
const contributors = [];
|
|
2668
|
-
const newPswdContributor = {
|
|
2670
|
+
const newPswdContributor = { uri: `urn:vte.cx:auth:,${newpswd}` };
|
|
2669
2671
|
contributors.push(newPswdContributor);
|
|
2670
2672
|
if (oldpswd) {
|
|
2671
|
-
const oldPswdContributor = {
|
|
2673
|
+
const oldPswdContributor = { uri: `urn:vte.cx:oldphash:${oldpswd}` };
|
|
2672
2674
|
contributors.push(oldPswdContributor);
|
|
2673
2675
|
}
|
|
2674
2676
|
if (passresetToken) {
|
|
2675
|
-
const passresetTokenContributor = {
|
|
2677
|
+
const passresetTokenContributor = { uri: `urn:vte.cx:passreset_token:${passresetToken}` };
|
|
2676
2678
|
contributors.push(passresetTokenContributor);
|
|
2677
2679
|
}
|
|
2678
|
-
const feed = [{
|
|
2680
|
+
const feed = [{ contributor: contributors }];
|
|
2679
2681
|
// vte.cxへリクエスト
|
|
2680
2682
|
const method = 'PUT';
|
|
2681
2683
|
const url = `${SERVLETPATH_DATA}/?_changephash`;
|
|
@@ -2708,12 +2710,8 @@ class VtecxNext {
|
|
|
2708
2710
|
checkNotNull(changepassByAdminInfo.uid, 'password change information');
|
|
2709
2711
|
checkNotNull(changepassByAdminInfo.pswd, 'password change information');
|
|
2710
2712
|
const entry = {
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
],
|
|
2714
|
-
'link': [
|
|
2715
|
-
{ '___rel': 'self', '___href': `/_user/${changepassByAdminInfo.uid}/auth` }
|
|
2716
|
-
]
|
|
2713
|
+
contributor: [{ uri: `urn:vte.cx:auth:,${changepassByAdminInfo.pswd}` }],
|
|
2714
|
+
link: [{ ___rel: 'self', ___href: `/_user/${changepassByAdminInfo.uid}/auth` }]
|
|
2717
2715
|
};
|
|
2718
2716
|
feed.push(entry);
|
|
2719
2717
|
}
|
|
@@ -2811,21 +2809,26 @@ class VtecxNext {
|
|
|
2811
2809
|
this.setCookie(response);
|
|
2812
2810
|
// レスポンスのエラーチェック
|
|
2813
2811
|
await checkVtecxResponse(response);
|
|
2812
|
+
const retJson = await getJson(response);
|
|
2814
2813
|
// 戻り値
|
|
2815
|
-
|
|
2814
|
+
if (account && retJson) {
|
|
2815
|
+
return retJson.summary;
|
|
2816
|
+
}
|
|
2817
|
+
return retJson;
|
|
2816
2818
|
};
|
|
2817
2819
|
/**
|
|
2818
2820
|
* revoke user
|
|
2819
2821
|
* @param account account
|
|
2822
|
+
* @param isDeleteGroups true if delete groups
|
|
2820
2823
|
* @return message feed
|
|
2821
2824
|
*/
|
|
2822
|
-
revokeuser = async (account) => {
|
|
2825
|
+
revokeuser = async (account, isDeleteGroups) => {
|
|
2823
2826
|
//console.log('[vtecxnext revokeuser] start.')
|
|
2824
2827
|
// 入力値チェック
|
|
2825
2828
|
checkNotNull(account, 'account');
|
|
2826
2829
|
// vte.cxへリクエスト
|
|
2827
2830
|
const method = 'PUT';
|
|
2828
|
-
const url = `${SERVLETPATH_DATA}/?_revokeuser=${account}`;
|
|
2831
|
+
const url = `${SERVLETPATH_DATA}/?_revokeuser=${account}${isDeleteGroups ? '&_deletegroup=true' : ''}`;
|
|
2829
2832
|
let response;
|
|
2830
2833
|
try {
|
|
2831
2834
|
response = await this.requestVtecx(method, url);
|
|
@@ -2845,9 +2848,10 @@ class VtecxNext {
|
|
|
2845
2848
|
* revoke users
|
|
2846
2849
|
* @param accounts account list
|
|
2847
2850
|
* @param uids uid list
|
|
2851
|
+
* @param isDeleteGroups true if delete groups
|
|
2848
2852
|
* @return message feed
|
|
2849
2853
|
*/
|
|
2850
|
-
revokeusers = async (accounts, uids) => {
|
|
2854
|
+
revokeusers = async (accounts, uids, isDeleteGroups) => {
|
|
2851
2855
|
//console.log(`[vtecxnext revokeusers] start. feed=${feed}`)
|
|
2852
2856
|
// 入力チェック
|
|
2853
2857
|
if (isBlank(accounts) && isBlank(uids)) {
|
|
@@ -2856,19 +2860,19 @@ class VtecxNext {
|
|
|
2856
2860
|
const feed = [];
|
|
2857
2861
|
if (accounts) {
|
|
2858
2862
|
for (const account of accounts) {
|
|
2859
|
-
const entry = {
|
|
2863
|
+
const entry = { title: account };
|
|
2860
2864
|
feed.push(entry);
|
|
2861
2865
|
}
|
|
2862
2866
|
}
|
|
2863
2867
|
if (uids) {
|
|
2864
2868
|
for (const uid of uids) {
|
|
2865
|
-
const entry = {
|
|
2869
|
+
const entry = { link: [{ ___rel: 'self', ___href: `/_user/${uid}` }] };
|
|
2866
2870
|
feed.push(entry);
|
|
2867
2871
|
}
|
|
2868
2872
|
}
|
|
2869
2873
|
// vte.cxへリクエスト
|
|
2870
2874
|
const method = 'PUT';
|
|
2871
|
-
const url = `${SERVLETPATH_DATA}/?_revokeuser`;
|
|
2875
|
+
const url = `${SERVLETPATH_DATA}/?_revokeuser${isDeleteGroups ? '&_deletegroup=true' : ''}`;
|
|
2872
2876
|
let response;
|
|
2873
2877
|
try {
|
|
2874
2878
|
response = await this.requestVtecx(method, url, JSON.stringify(feed));
|
|
@@ -2925,13 +2929,13 @@ class VtecxNext {
|
|
|
2925
2929
|
const feed = [];
|
|
2926
2930
|
if (accounts) {
|
|
2927
2931
|
for (const account of accounts) {
|
|
2928
|
-
const entry = {
|
|
2932
|
+
const entry = { title: account };
|
|
2929
2933
|
feed.push(entry);
|
|
2930
2934
|
}
|
|
2931
2935
|
}
|
|
2932
2936
|
if (uids) {
|
|
2933
2937
|
for (const uid of uids) {
|
|
2934
|
-
const entry = {
|
|
2938
|
+
const entry = { link: [{ ___rel: 'self', ___href: `/_user/${uid}` }] };
|
|
2935
2939
|
feed.push(entry);
|
|
2936
2940
|
}
|
|
2937
2941
|
}
|
|
@@ -2954,14 +2958,14 @@ class VtecxNext {
|
|
|
2954
2958
|
};
|
|
2955
2959
|
/**
|
|
2956
2960
|
* cancel user.
|
|
2957
|
-
* @param
|
|
2961
|
+
* @param isDeleteGroups true if delete groups
|
|
2958
2962
|
* @return message feed
|
|
2959
2963
|
*/
|
|
2960
|
-
canceluser = async () => {
|
|
2964
|
+
canceluser = async (isDeleteGroups) => {
|
|
2961
2965
|
//console.log('[vtecxnext canceluser] start.')
|
|
2962
2966
|
// vte.cxへリクエスト
|
|
2963
2967
|
const method = 'DELETE';
|
|
2964
|
-
const url = `${SERVLETPATH_DATA}/?_canceluser`;
|
|
2968
|
+
const url = `${SERVLETPATH_DATA}/?_canceluser${isDeleteGroups ? '&_deletegroup=true' : ''}`;
|
|
2965
2969
|
let response;
|
|
2966
2970
|
try {
|
|
2967
2971
|
response = await this.requestVtecx(method, url);
|
|
@@ -3019,13 +3023,13 @@ class VtecxNext {
|
|
|
3019
3023
|
const feed = [];
|
|
3020
3024
|
if (accounts) {
|
|
3021
3025
|
for (const account of accounts) {
|
|
3022
|
-
const entry = {
|
|
3026
|
+
const entry = { title: account };
|
|
3023
3027
|
feed.push(entry);
|
|
3024
3028
|
}
|
|
3025
3029
|
}
|
|
3026
3030
|
if (uids) {
|
|
3027
3031
|
for (const uid of uids) {
|
|
3028
|
-
const entry = {
|
|
3032
|
+
const entry = { link: [{ ___rel: 'self', ___href: `/_user/${uid}` }] };
|
|
3029
3033
|
feed.push(entry);
|
|
3030
3034
|
}
|
|
3031
3035
|
}
|
|
@@ -3215,7 +3219,7 @@ class VtecxNext {
|
|
|
3215
3219
|
// レスポンスのエラーチェック
|
|
3216
3220
|
await checkVtecxResponse(response);
|
|
3217
3221
|
}
|
|
3218
|
-
return {
|
|
3222
|
+
return { feed: { title: contentUris } };
|
|
3219
3223
|
};
|
|
3220
3224
|
/**
|
|
3221
3225
|
* save files registering with specified size
|
|
@@ -3632,12 +3636,12 @@ class VtecxNext {
|
|
|
3632
3636
|
checkNotNull(createGroupadminInfo.group, 'group name');
|
|
3633
3637
|
checkContainSlash(createGroupadminInfo.group, 'group name');
|
|
3634
3638
|
checkNotNull(createGroupadminInfo.uids, 'uid');
|
|
3635
|
-
const links = [{
|
|
3639
|
+
const links = [{ ___rel: 'self', ___href: `/_group/${createGroupadminInfo.group}` }];
|
|
3636
3640
|
for (const uid of createGroupadminInfo.uids) {
|
|
3637
|
-
const link = {
|
|
3641
|
+
const link = { ___rel: 'via', ___title: uid };
|
|
3638
3642
|
links.push(link);
|
|
3639
3643
|
}
|
|
3640
|
-
const entry = {
|
|
3644
|
+
const entry = { link: links };
|
|
3641
3645
|
feed.push(entry);
|
|
3642
3646
|
}
|
|
3643
3647
|
// vte.cxへリクエスト
|
|
@@ -3671,8 +3675,8 @@ class VtecxNext {
|
|
|
3671
3675
|
for (const groupName of groupNames) {
|
|
3672
3676
|
checkNotNull(groupName, 'group name');
|
|
3673
3677
|
checkContainSlash(groupName, 'group name');
|
|
3674
|
-
const links = [{
|
|
3675
|
-
const entry = {
|
|
3678
|
+
const links = [{ ___rel: 'self', ___href: `/_group/${groupName}` }];
|
|
3679
|
+
const entry = { link: links };
|
|
3676
3680
|
feed.push(entry);
|
|
3677
3681
|
}
|
|
3678
3682
|
// vte.cxへリクエスト
|
|
@@ -3739,7 +3743,7 @@ class VtecxNext {
|
|
|
3739
3743
|
// cookieの値をvte.cxへのリクエストヘッダに設定
|
|
3740
3744
|
const cookie = this.editRequestCookie();
|
|
3741
3745
|
//console.log(`[requestVtecx] cookie = ${cookie}`)
|
|
3742
|
-
const headers = cookie ? {
|
|
3746
|
+
const headers = cookie ? { Cookie: cookie } : {};
|
|
3743
3747
|
if (this.accessToken) {
|
|
3744
3748
|
headers.Authorization = `Token ${this.accessToken}`;
|
|
3745
3749
|
}
|
|
@@ -3952,11 +3956,11 @@ class VtecxNext {
|
|
|
3952
3956
|
// アクセストークン取得URL生成
|
|
3953
3957
|
const accesstokenMethod = 'POST';
|
|
3954
3958
|
const accessTokenData = {
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3959
|
+
grant_type: 'authorization_code',
|
|
3960
|
+
code: code,
|
|
3961
|
+
redirect_uri: redirect_uri,
|
|
3962
|
+
client_id: client_id,
|
|
3963
|
+
client_secret: client_secret
|
|
3960
3964
|
};
|
|
3961
3965
|
const accesstokenBody = createURLSearchParams(accessTokenData).toString();
|
|
3962
3966
|
//const accesstokenBodyStr = `grant_type=authorization_code&code=${code}&redirect_uri=${encodeRedirect_uri}&client_id=${client_id}&client_secret=${client_secret}`
|
|
@@ -3966,11 +3970,11 @@ class VtecxNext {
|
|
|
3966
3970
|
const requestInit = {
|
|
3967
3971
|
headers: {
|
|
3968
3972
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
3969
|
-
'Content-Length': String(accesstokenBody.length)
|
|
3973
|
+
'Content-Length': String(accesstokenBody.length)
|
|
3970
3974
|
},
|
|
3971
3975
|
body: accesstokenBody,
|
|
3972
3976
|
method: accesstokenMethod,
|
|
3973
|
-
cache: 'no-cache'
|
|
3977
|
+
cache: 'no-cache'
|
|
3974
3978
|
};
|
|
3975
3979
|
let accesstokenResponse;
|
|
3976
3980
|
try {
|
|
@@ -3991,11 +3995,11 @@ class VtecxNext {
|
|
|
3991
3995
|
throw new VtecxNextError(401, `Get accesstoken failed.`);
|
|
3992
3996
|
}
|
|
3993
3997
|
return {
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3998
|
+
client_id: client_id,
|
|
3999
|
+
client_secret: client_secret,
|
|
4000
|
+
redirect_uri: redirect_uri,
|
|
4001
|
+
state: state,
|
|
4002
|
+
access_token: access_token
|
|
3999
4003
|
};
|
|
4000
4004
|
};
|
|
4001
4005
|
/**
|
|
@@ -4008,12 +4012,12 @@ class VtecxNext {
|
|
|
4008
4012
|
// LINEユーザ識別情報取得リクエスト
|
|
4009
4013
|
const url = 'https://api.line.me/v2/profile';
|
|
4010
4014
|
const method = 'GET';
|
|
4011
|
-
const headers = {
|
|
4015
|
+
const headers = { Authorization: `Bearer ${oauthInfo.access_token}` };
|
|
4012
4016
|
//console.log(`[vtecxnext oauthGetUserinfoLine] url=${url}`)
|
|
4013
4017
|
const requestInit = {
|
|
4014
4018
|
headers: headers,
|
|
4015
4019
|
method: method,
|
|
4016
|
-
cache: 'no-cache'
|
|
4020
|
+
cache: 'no-cache'
|
|
4017
4021
|
};
|
|
4018
4022
|
let response;
|
|
4019
4023
|
try {
|
|
@@ -4032,9 +4036,9 @@ class VtecxNext {
|
|
|
4032
4036
|
throw new VtecxNextError(401, `Get user information failed. `);
|
|
4033
4037
|
}
|
|
4034
4038
|
return {
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4039
|
+
guid: guid,
|
|
4040
|
+
nickname: nickname,
|
|
4041
|
+
state: oauthInfo.state
|
|
4038
4042
|
};
|
|
4039
4043
|
};
|
|
4040
4044
|
/**
|
|
@@ -4051,7 +4055,7 @@ class VtecxNext {
|
|
|
4051
4055
|
const param = '';
|
|
4052
4056
|
const method = 'POST';
|
|
4053
4057
|
const url = `${SERVLETPATH_OAUTH}/${provider}/link?state=${userInfo.state}${param}`;
|
|
4054
|
-
const reqFeed = [{
|
|
4058
|
+
const reqFeed = [{ title: userInfo.guid, subtitle: userInfo.nickname }];
|
|
4055
4059
|
let response;
|
|
4056
4060
|
try {
|
|
4057
4061
|
response = await fetchVtecx(method, url, {}, JSON.stringify(reqFeed));
|
|
@@ -4087,7 +4091,7 @@ class VtecxNext {
|
|
|
4087
4091
|
// vte.cxへリクエスト
|
|
4088
4092
|
const method = 'PUT';
|
|
4089
4093
|
const url = `${SERVLETPATH_DATA}/?_mergeoauthuser`;
|
|
4090
|
-
const feed = {
|
|
4094
|
+
const feed = { feed: { subtitle: provider, rights: rxid } };
|
|
4091
4095
|
let response;
|
|
4092
4096
|
try {
|
|
4093
4097
|
response = await this.requestVtecx(method, url, JSON.stringify(feed));
|
|
@@ -4153,16 +4157,16 @@ exports.FetchError = FetchError;
|
|
|
4153
4157
|
*/
|
|
4154
4158
|
const isVtecxNextError = (value) => {
|
|
4155
4159
|
// 値がオブジェクトであるかの判定
|
|
4156
|
-
if (typeof value !==
|
|
4160
|
+
if (typeof value !== 'object' || value === null) {
|
|
4157
4161
|
return false;
|
|
4158
4162
|
}
|
|
4159
4163
|
const { status, message } = value;
|
|
4160
4164
|
// statusプロパティーが数値型かを判定
|
|
4161
|
-
if (typeof status !==
|
|
4165
|
+
if (typeof status !== 'number') {
|
|
4162
4166
|
return false;
|
|
4163
4167
|
}
|
|
4164
4168
|
// messageプロパティーが文字列型かを判定
|
|
4165
|
-
if (typeof message !==
|
|
4169
|
+
if (typeof message !== 'string') {
|
|
4166
4170
|
return false;
|
|
4167
4171
|
}
|
|
4168
4172
|
return true;
|
|
@@ -4201,7 +4205,7 @@ const fetchVtecx = async (method, url, pHeaders, body, mode) => {
|
|
|
4201
4205
|
body: body,
|
|
4202
4206
|
method: method,
|
|
4203
4207
|
headers: headers,
|
|
4204
|
-
cache: 'no-cache'
|
|
4208
|
+
cache: 'no-cache'
|
|
4205
4209
|
};
|
|
4206
4210
|
if (mode) {
|
|
4207
4211
|
requestInit['mode'] = mode;
|
|
@@ -4379,7 +4383,7 @@ const editSqlArgument = (sql, values, parent) => {
|
|
|
4379
4383
|
const editSql = values ? formatSql(sql, values) : sql;
|
|
4380
4384
|
//console.log(`[vtecxnext editSqlArgument] sql=${editSql}`)
|
|
4381
4385
|
// 引数
|
|
4382
|
-
const entry = {
|
|
4386
|
+
const entry = { title: editSql };
|
|
4383
4387
|
if (parent) {
|
|
4384
4388
|
entry['subtitle'] = parent;
|
|
4385
4389
|
}
|
|
@@ -4411,7 +4415,7 @@ const editSqlsArgument = (sqls, values) => {
|
|
|
4411
4415
|
const feed = [];
|
|
4412
4416
|
let i = 0;
|
|
4413
4417
|
for (const editSql of editedSqls) {
|
|
4414
|
-
const entry = {
|
|
4418
|
+
const entry = { title: editSql };
|
|
4415
4419
|
feed[i] = entry;
|
|
4416
4420
|
i++;
|
|
4417
4421
|
}
|
|
@@ -4442,7 +4446,7 @@ const getLinks = (rel, hrefs) => {
|
|
|
4442
4446
|
const links = [];
|
|
4443
4447
|
let idx = 0;
|
|
4444
4448
|
for (const href of hrefs) {
|
|
4445
|
-
const link = {
|
|
4449
|
+
const link = { ___rel: rel, ___href: href };
|
|
4446
4450
|
links[idx] = link;
|
|
4447
4451
|
idx++;
|
|
4448
4452
|
}
|
|
@@ -4469,6 +4473,6 @@ const getOrigin = (oauthUrl) => {
|
|
|
4469
4473
|
*/
|
|
4470
4474
|
const createURLSearchParams = (data) => {
|
|
4471
4475
|
const params = new url_1.URLSearchParams();
|
|
4472
|
-
Object.keys(data).forEach(key => params.append(key, data[key]));
|
|
4476
|
+
Object.keys(data).forEach((key) => params.append(key, data[key]));
|
|
4473
4477
|
return params;
|
|
4474
4478
|
};
|