@vtecx/vtecxnext 2.3.0 → 3.0.0
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 +190 -77
- package/dist/vtecxnext.js +289 -111
- package/package.json +3 -3
package/dist/vtecxnext.d.ts
CHANGED
|
@@ -4,6 +4,73 @@ import type { Readable } from 'node:stream';
|
|
|
4
4
|
* Hello world.
|
|
5
5
|
*/
|
|
6
6
|
export declare const hello: () => void;
|
|
7
|
+
/** Request feed */
|
|
8
|
+
export interface LegacyFeed {
|
|
9
|
+
feed: Feed;
|
|
10
|
+
}
|
|
11
|
+
/** Message response */
|
|
12
|
+
export interface MessageResponse {
|
|
13
|
+
feed: Feed;
|
|
14
|
+
}
|
|
15
|
+
/** Feed */
|
|
16
|
+
export interface Feed {
|
|
17
|
+
author?: Author[];
|
|
18
|
+
category?: Category[];
|
|
19
|
+
contributor?: Contributor[];
|
|
20
|
+
generator?: Generator;
|
|
21
|
+
icon?: string;
|
|
22
|
+
id?: string;
|
|
23
|
+
link?: Link[];
|
|
24
|
+
logo?: string;
|
|
25
|
+
rights?: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
subtitle?: string;
|
|
28
|
+
updated?: string;
|
|
29
|
+
entry?: Entry[];
|
|
30
|
+
}
|
|
31
|
+
/** Entry */
|
|
32
|
+
export interface Entry {
|
|
33
|
+
author?: Author[];
|
|
34
|
+
category?: Category[];
|
|
35
|
+
content?: Content;
|
|
36
|
+
contributor?: Contributor[];
|
|
37
|
+
id?: string;
|
|
38
|
+
link?: Link[];
|
|
39
|
+
published?: string;
|
|
40
|
+
rights?: string;
|
|
41
|
+
summary?: string;
|
|
42
|
+
title?: string;
|
|
43
|
+
subtitle?: string;
|
|
44
|
+
updated?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Author */
|
|
47
|
+
export interface Author {
|
|
48
|
+
name?: string;
|
|
49
|
+
uri?: string;
|
|
50
|
+
email?: string;
|
|
51
|
+
}
|
|
52
|
+
/** Category */
|
|
53
|
+
export interface Category {
|
|
54
|
+
___term?: string;
|
|
55
|
+
___scheme?: string;
|
|
56
|
+
___label?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Content */
|
|
59
|
+
export interface Content {
|
|
60
|
+
______text: string;
|
|
61
|
+
}
|
|
62
|
+
/** Link */
|
|
63
|
+
export interface Link {
|
|
64
|
+
___href?: string;
|
|
65
|
+
___rel?: string;
|
|
66
|
+
___title?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Contributor */
|
|
69
|
+
export interface Contributor {
|
|
70
|
+
uri?: string;
|
|
71
|
+
email?: string;
|
|
72
|
+
name?: string;
|
|
73
|
+
}
|
|
7
74
|
export type StatusMessage = {
|
|
8
75
|
status: number;
|
|
9
76
|
message: string;
|
|
@@ -34,8 +101,34 @@ export type ContentSignedUrl = {
|
|
|
34
101
|
url: string;
|
|
35
102
|
key: string;
|
|
36
103
|
};
|
|
104
|
+
export interface OAuthInfo {
|
|
105
|
+
client_id?: string;
|
|
106
|
+
client_secret?: string;
|
|
107
|
+
redirect_uri?: string;
|
|
108
|
+
state?: string | string[];
|
|
109
|
+
access_token?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface OAuthUserInfo {
|
|
112
|
+
guid?: string;
|
|
113
|
+
nickname?: string;
|
|
114
|
+
state?: string | string[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* vtecxnext.
|
|
118
|
+
* Executes various operations for the vte.cx service.
|
|
119
|
+
*
|
|
120
|
+
* The following environment variables must be defined.
|
|
121
|
+
*
|
|
122
|
+
* - VTECX_URL: URL of the vte.cx service
|
|
123
|
+
* - VTECX_APIKEY: API key
|
|
124
|
+
*
|
|
125
|
+
* When connecting to other vte.cx services, define the following environment variables.
|
|
126
|
+
*
|
|
127
|
+
* - SERVICEKEY_{service name}: Service key of the target service
|
|
128
|
+
*
|
|
129
|
+
*/
|
|
37
130
|
export declare class VtecxNext {
|
|
38
|
-
/** Request */
|
|
131
|
+
/** Request (for api) */
|
|
39
132
|
readonly req: NextRequest | undefined;
|
|
40
133
|
/** Response status */
|
|
41
134
|
private resStatus;
|
|
@@ -47,9 +140,13 @@ export declare class VtecxNext {
|
|
|
47
140
|
private accessToken;
|
|
48
141
|
/** login cookies */
|
|
49
142
|
private loginCookies;
|
|
143
|
+
/** next cookies (for server action) */
|
|
144
|
+
private cookieStore;
|
|
145
|
+
/** flag whether the next cookies should be created */
|
|
146
|
+
private shouldBeCreatedCookieStore;
|
|
50
147
|
/**
|
|
51
148
|
* constructor
|
|
52
|
-
* @param req Request
|
|
149
|
+
* @param req Request (for api)
|
|
53
150
|
* @param accessToken Access token (for batch)
|
|
54
151
|
*/
|
|
55
152
|
constructor(req?: NextRequest, accessToken?: string);
|
|
@@ -173,7 +270,7 @@ export declare class VtecxNext {
|
|
|
173
270
|
* get login whoami
|
|
174
271
|
* @return login user information
|
|
175
272
|
*/
|
|
176
|
-
whoami: () => Promise<
|
|
273
|
+
whoami: () => Promise<Entry[]>;
|
|
177
274
|
/**
|
|
178
275
|
* register a log entry
|
|
179
276
|
* @param message message
|
|
@@ -188,21 +285,21 @@ export declare class VtecxNext {
|
|
|
188
285
|
* @param targetService target service name (for service linkage)
|
|
189
286
|
* @return entry
|
|
190
287
|
*/
|
|
191
|
-
getEntry: (uri: string, targetService?: string) => Promise<
|
|
288
|
+
getEntry: (uri: string, targetService?: string) => Promise<Entry | undefined>;
|
|
192
289
|
/**
|
|
193
290
|
* get feed
|
|
194
291
|
* @param uri key and conditions
|
|
195
292
|
* @param targetService target service name (for service linkage)
|
|
196
293
|
* @return feed (entry array)
|
|
197
294
|
*/
|
|
198
|
-
getFeed: (uri: string, targetService?: string) => Promise<
|
|
295
|
+
getFeed: (uri: string, targetService?: string) => Promise<Entry[] | undefined>;
|
|
199
296
|
/**
|
|
200
297
|
* get feed
|
|
201
298
|
* @param uri key and conditions
|
|
202
299
|
* @param targetService target service name (for service linkage)
|
|
203
300
|
* @return feed (entry array). Returns a cursor in the header if more data is available. (x-vtecx-nextpage)
|
|
204
301
|
*/
|
|
205
|
-
getFeedResponse: (uri: string, targetService?: string) => Promise<VtecxResponse
|
|
302
|
+
getFeedResponse: (uri: string, targetService?: string) => Promise<VtecxResponse<Entry[] | undefined>>;
|
|
206
303
|
/**
|
|
207
304
|
* get count
|
|
208
305
|
* @param uri key and conditions
|
|
@@ -216,7 +313,7 @@ export declare class VtecxNext {
|
|
|
216
313
|
* @param targetService target service name (for service linkage)
|
|
217
314
|
* @return feed. Returns a cursor in the header if more data is available. (x-vtecx-nextpage)
|
|
218
315
|
*/
|
|
219
|
-
countResponse: (uri: string, targetService?: string) => Promise<VtecxResponse
|
|
316
|
+
countResponse: (uri: string, targetService?: string) => Promise<VtecxResponse<MessageResponse>>;
|
|
220
317
|
/**
|
|
221
318
|
* register entries
|
|
222
319
|
* @param feed entries (JSON)
|
|
@@ -224,7 +321,7 @@ export declare class VtecxNext {
|
|
|
224
321
|
* @param targetService target service name (for service linkage)
|
|
225
322
|
* @return registed entries
|
|
226
323
|
*/
|
|
227
|
-
post: (feed:
|
|
324
|
+
post: (feed: Entry[], uri?: string, targetService?: string) => Promise<MessageResponse>;
|
|
228
325
|
/**
|
|
229
326
|
* update entries
|
|
230
327
|
* @param feed entries (JSON)
|
|
@@ -234,7 +331,7 @@ export declare class VtecxNext {
|
|
|
234
331
|
* @param targetService target service name (for service linkage)
|
|
235
332
|
* @return updated entries
|
|
236
333
|
*/
|
|
237
|
-
put: (feed:
|
|
334
|
+
put: (feed: Entry[], isbulk?: boolean, parallel?: boolean, async?: boolean, targetService?: string) => Promise<Entry[] | MessageResponse>;
|
|
238
335
|
/**
|
|
239
336
|
* delete entry
|
|
240
337
|
* @param uri key
|
|
@@ -252,7 +349,7 @@ export declare class VtecxNext {
|
|
|
252
349
|
* @param targetService target service name (for service linkage)
|
|
253
350
|
* @return true if successful
|
|
254
351
|
*/
|
|
255
|
-
deleteEntries: (feed:
|
|
352
|
+
deleteEntries: (feed: Entry[], isbulk?: boolean, parallel?: boolean, async?: boolean, targetService?: string) => Promise<boolean>;
|
|
256
353
|
/**
|
|
257
354
|
* delete folder
|
|
258
355
|
* @param uri parent key
|
|
@@ -303,7 +400,7 @@ export declare class VtecxNext {
|
|
|
303
400
|
/**
|
|
304
401
|
* set a addition range
|
|
305
402
|
* @param uri key
|
|
306
|
-
* @param range addition range
|
|
403
|
+
* @param range addition range. delete if blank.
|
|
307
404
|
* @param targetService target service name (for service linkage)
|
|
308
405
|
* @return addition range
|
|
309
406
|
*/
|
|
@@ -314,21 +411,21 @@ export declare class VtecxNext {
|
|
|
314
411
|
* @param targetService target service name (for service linkage)
|
|
315
412
|
* @return addition range
|
|
316
413
|
*/
|
|
317
|
-
getRangeids: (uri: string) => Promise<string>;
|
|
414
|
+
getRangeids: (uri: string) => Promise<string | undefined>;
|
|
318
415
|
/**
|
|
319
416
|
* set feed to session
|
|
320
417
|
* @param name name
|
|
321
418
|
* @param feed entries (JSON)
|
|
322
419
|
* @return true if successful
|
|
323
420
|
*/
|
|
324
|
-
setSessionFeed: (name: string, feed:
|
|
421
|
+
setSessionFeed: (name: string, feed: Entry[]) => Promise<boolean>;
|
|
325
422
|
/**
|
|
326
423
|
* set entry to session
|
|
327
424
|
* @param name name
|
|
328
425
|
* @param entry entry (JSON)
|
|
329
426
|
* @return true if successful
|
|
330
427
|
*/
|
|
331
|
-
setSessionEntry: (name: string, entry:
|
|
428
|
+
setSessionEntry: (name: string, entry: Entry) => Promise<boolean>;
|
|
332
429
|
/**
|
|
333
430
|
* set string to session
|
|
334
431
|
* @param name name
|
|
@@ -379,13 +476,13 @@ export declare class VtecxNext {
|
|
|
379
476
|
* @param name name
|
|
380
477
|
* @return feed
|
|
381
478
|
*/
|
|
382
|
-
getSessionFeed: (name: string) => Promise<
|
|
479
|
+
getSessionFeed: (name: string) => Promise<Entry[] | undefined>;
|
|
383
480
|
/**
|
|
384
481
|
* get entry from session
|
|
385
482
|
* @param name name
|
|
386
483
|
* @return entry
|
|
387
484
|
*/
|
|
388
|
-
getSessionEntry: (name: string) => Promise<
|
|
485
|
+
getSessionEntry: (name: string) => Promise<Entry | undefined>;
|
|
389
486
|
/**
|
|
390
487
|
* get string from session
|
|
391
488
|
* @param name name
|
|
@@ -413,7 +510,7 @@ export declare class VtecxNext {
|
|
|
413
510
|
* @param targetService target service name (for service linkage)
|
|
414
511
|
* @return feed (entry array)
|
|
415
512
|
*/
|
|
416
|
-
getPage: (uri: string, num: number, targetService?: string) => Promise<
|
|
513
|
+
getPage: (uri: string, num: number, targetService?: string) => Promise<Entry[] | undefined>;
|
|
417
514
|
/**
|
|
418
515
|
* practical paging
|
|
419
516
|
* If you specify page 1, a new cursor list will be created.
|
|
@@ -422,7 +519,7 @@ export declare class VtecxNext {
|
|
|
422
519
|
* @param targetService target service name (for service linkage)
|
|
423
520
|
* @return feed (entry array)
|
|
424
521
|
*/
|
|
425
|
-
getPageWithPagination: (uri: string, num: number, targetService?: string) => Promise<
|
|
522
|
+
getPageWithPagination: (uri: string, num: number, targetService?: string) => Promise<Entry[] | undefined>;
|
|
426
523
|
/**
|
|
427
524
|
* ページングのカーソルリスト作成処理
|
|
428
525
|
* 続きがある場合、次のカーソルリスト作成処理を実行する
|
|
@@ -439,7 +536,9 @@ export declare class VtecxNext {
|
|
|
439
536
|
* @param tablenames key:entity's prop name, value:BigQuery table name
|
|
440
537
|
* @return true if successful
|
|
441
538
|
*/
|
|
442
|
-
postBQ: (feed:
|
|
539
|
+
postBQ: (feed: Entry[], async?: boolean, tablenames?: {
|
|
540
|
+
[key: string]: string;
|
|
541
|
+
}) => Promise<boolean>;
|
|
443
542
|
/**
|
|
444
543
|
* delete data from bigquery
|
|
445
544
|
* @param keys delete keys
|
|
@@ -447,7 +546,9 @@ export declare class VtecxNext {
|
|
|
447
546
|
* @param tablenames key:entity's prop name, value:BigQuery table name
|
|
448
547
|
* @return true if successful
|
|
449
548
|
*/
|
|
450
|
-
deleteBQ: (keys: string[], async?: boolean, tablenames?:
|
|
549
|
+
deleteBQ: (keys: string[], async?: boolean, tablenames?: {
|
|
550
|
+
[key: string]: string;
|
|
551
|
+
}) => Promise<boolean>;
|
|
451
552
|
/**
|
|
452
553
|
* query bigquery
|
|
453
554
|
* @param sql query sql
|
|
@@ -481,7 +582,9 @@ export declare class VtecxNext {
|
|
|
481
582
|
* @param async execute async
|
|
482
583
|
* @return registed entries
|
|
483
584
|
*/
|
|
484
|
-
postBDBQ: (feed:
|
|
585
|
+
postBDBQ: (feed: Entry[], uri?: string, tablenames?: {
|
|
586
|
+
[key: string]: string;
|
|
587
|
+
}, async?: boolean) => Promise<Entry[] | MessageResponse>;
|
|
485
588
|
/**
|
|
486
589
|
* put data to bdb and post bigquery
|
|
487
590
|
* @param feed entries (JSON)
|
|
@@ -491,7 +594,9 @@ export declare class VtecxNext {
|
|
|
491
594
|
* @param isbulk Forcibly execute even if it exceeds the upper limit of entries of request feed.
|
|
492
595
|
* @return true if successful
|
|
493
596
|
*/
|
|
494
|
-
putBDBQ: (feed:
|
|
597
|
+
putBDBQ: (feed: Entry[], uri?: string, tablenames?: {
|
|
598
|
+
[key: string]: string;
|
|
599
|
+
}, async?: boolean, isbulk?: boolean) => Promise<Entry[] | MessageResponse>;
|
|
495
600
|
/**
|
|
496
601
|
* delete data from bdb and bigquery
|
|
497
602
|
* @param keys delete keys
|
|
@@ -499,7 +604,9 @@ export declare class VtecxNext {
|
|
|
499
604
|
* @param async execute async
|
|
500
605
|
* @return true if successful
|
|
501
606
|
*/
|
|
502
|
-
deleteBDBQ: (keys: string[], tablenames?:
|
|
607
|
+
deleteBDBQ: (keys: string[], tablenames?: {
|
|
608
|
+
[key: string]: string;
|
|
609
|
+
}, async?: boolean) => Promise<boolean>;
|
|
503
610
|
/**
|
|
504
611
|
* Execute a query SQL to the database and get the result.
|
|
505
612
|
* @param sql query sql
|
|
@@ -541,13 +648,13 @@ export declare class VtecxNext {
|
|
|
541
648
|
* @param revision revision
|
|
542
649
|
* @return signed entry
|
|
543
650
|
*/
|
|
544
|
-
putSignature: (uri: string, revision?: number) => Promise<
|
|
651
|
+
putSignature: (uri: string, revision?: number) => Promise<Entry>;
|
|
545
652
|
/**
|
|
546
653
|
* puts the signature of uri and revision.
|
|
547
654
|
* @param feed entries
|
|
548
655
|
* @return signed entries
|
|
549
656
|
*/
|
|
550
|
-
putSignatures: (feed:
|
|
657
|
+
putSignatures: (feed: Entry[]) => Promise<Entry[]>;
|
|
551
658
|
/**
|
|
552
659
|
* delete the signature.
|
|
553
660
|
* @param uri key
|
|
@@ -570,7 +677,7 @@ export declare class VtecxNext {
|
|
|
570
677
|
* @param attachments keys of attachment files
|
|
571
678
|
* @return true if successful
|
|
572
679
|
*/
|
|
573
|
-
sendMail: (entry:
|
|
680
|
+
sendMail: (entry: Entry, to: string[], cc?: string[], bcc?: string[], attachments?: string[]) => Promise<boolean>;
|
|
574
681
|
/**
|
|
575
682
|
* push notification to clients.
|
|
576
683
|
* @param message message
|
|
@@ -581,7 +688,9 @@ export declare class VtecxNext {
|
|
|
581
688
|
* @param data key value data (Expo)
|
|
582
689
|
* @return true if successful
|
|
583
690
|
*/
|
|
584
|
-
pushNotification: (message: string, to: string[], title?: string, subtitle?: string, imageUrl?: string, data?:
|
|
691
|
+
pushNotification: (message: string, to: string[], title?: string, subtitle?: string, imageUrl?: string, data?: {
|
|
692
|
+
[key: string]: string;
|
|
693
|
+
}) => Promise<boolean>;
|
|
585
694
|
/**
|
|
586
695
|
* set status of MessageQueue.
|
|
587
696
|
* @param flag true if on, false if off
|
|
@@ -593,20 +702,20 @@ export declare class VtecxNext {
|
|
|
593
702
|
* @param name name
|
|
594
703
|
* @return feed
|
|
595
704
|
*/
|
|
596
|
-
getMessageQueueStatus: (channel: string) => Promise<
|
|
705
|
+
getMessageQueueStatus: (channel: string) => Promise<MessageResponse>;
|
|
597
706
|
/**
|
|
598
707
|
* set MessageQueue.
|
|
599
708
|
* @param feed entries (JSON)
|
|
600
709
|
* @param channel channel
|
|
601
710
|
* @return true if successful
|
|
602
711
|
*/
|
|
603
|
-
setMessageQueue: (feed:
|
|
712
|
+
setMessageQueue: (feed: Entry[], channel: string) => Promise<boolean>;
|
|
604
713
|
/**
|
|
605
714
|
* get messageQueue.
|
|
606
715
|
* @param name name
|
|
607
716
|
* @return feed
|
|
608
717
|
*/
|
|
609
|
-
getMessageQueue: (channel: string) => Promise<
|
|
718
|
+
getMessageQueue: (channel: string) => Promise<Entry[] | undefined>;
|
|
610
719
|
/**
|
|
611
720
|
* add group
|
|
612
721
|
* (not yet joined)
|
|
@@ -614,7 +723,7 @@ export declare class VtecxNext {
|
|
|
614
723
|
* @param selfid hierarchical name under my group alias
|
|
615
724
|
* @return feed
|
|
616
725
|
*/
|
|
617
|
-
addGroup: (group: string, selfid?: string) => Promise<
|
|
726
|
+
addGroup: (group: string, selfid?: string) => Promise<Entry>;
|
|
618
727
|
/**
|
|
619
728
|
* add group by admin
|
|
620
729
|
* (not yet joined)
|
|
@@ -623,14 +732,14 @@ export declare class VtecxNext {
|
|
|
623
732
|
* @param selfid hierarchical name under my group alias
|
|
624
733
|
* @return feed
|
|
625
734
|
*/
|
|
626
|
-
addGroupByAdmin: (uids: string[], group: string, selfid?: string) => Promise<
|
|
735
|
+
addGroupByAdmin: (uids: string[], group: string, selfid?: string) => Promise<Entry[]>;
|
|
627
736
|
/**
|
|
628
737
|
* join to the group
|
|
629
738
|
* @param group group
|
|
630
739
|
* @param selfid hierarchical name under my group alias
|
|
631
740
|
* @return feed
|
|
632
741
|
*/
|
|
633
|
-
joinGroup: (group: string, selfid?: string) => Promise<
|
|
742
|
+
joinGroup: (group: string, selfid?: string) => Promise<Entry>;
|
|
634
743
|
/**
|
|
635
744
|
* leave from the group
|
|
636
745
|
* @param group group
|
|
@@ -643,14 +752,14 @@ export declare class VtecxNext {
|
|
|
643
752
|
* @param group group
|
|
644
753
|
* @return feed
|
|
645
754
|
*/
|
|
646
|
-
leaveGroupByAdmin: (uids: string[], group: string) => Promise<
|
|
755
|
+
leaveGroupByAdmin: (uids: string[], group: string) => Promise<Entry>;
|
|
647
756
|
/**
|
|
648
757
|
* Get entries that have entries in a group, but are not in the group.
|
|
649
758
|
* (for entries with no signature or with an incorrect signature, if the user group requires a signature)
|
|
650
759
|
* @param uri group key
|
|
651
760
|
* @return feed (entry array)
|
|
652
761
|
*/
|
|
653
|
-
noGroupMember: (uri: string) => Promise<
|
|
762
|
+
noGroupMember: (uri: string) => Promise<Entry[]>;
|
|
654
763
|
/**
|
|
655
764
|
* Get groups
|
|
656
765
|
* @param uri group key
|
|
@@ -674,7 +783,7 @@ export declare class VtecxNext {
|
|
|
674
783
|
* @param reCaptchaToken reCAPTCHA token
|
|
675
784
|
* @return message feed (uid)
|
|
676
785
|
*/
|
|
677
|
-
adduser: (adduserInfo: AdduserInfo, reCaptchaToken: string) => Promise<
|
|
786
|
+
adduser: (adduserInfo: AdduserInfo, reCaptchaToken: string) => Promise<MessageResponse>;
|
|
678
787
|
/**
|
|
679
788
|
* convert adduser info to argument entry
|
|
680
789
|
* @param adduserInfo adduser info
|
|
@@ -687,60 +796,61 @@ export declare class VtecxNext {
|
|
|
687
796
|
* @param feed entries (JSON)
|
|
688
797
|
* @return message feed
|
|
689
798
|
*/
|
|
690
|
-
adduserByAdmin: (adduserInfos: AdduserInfo[]) => Promise<
|
|
799
|
+
adduserByAdmin: (adduserInfos: AdduserInfo[]) => Promise<MessageResponse>;
|
|
691
800
|
/**
|
|
692
801
|
* add user by group admin
|
|
693
802
|
* @param feed entries (JSON)
|
|
694
803
|
* @param groupname group name
|
|
695
804
|
* @return message feed
|
|
696
805
|
*/
|
|
697
|
-
adduserByGroupadmin: (adduserInfos: AdduserInfo[], groupname: string) => Promise<
|
|
806
|
+
adduserByGroupadmin: (adduserInfos: AdduserInfo[], groupname: string) => Promise<MessageResponse>;
|
|
698
807
|
/**
|
|
699
808
|
* Send email for password reset
|
|
700
809
|
* @param adduserInfo mailaddress
|
|
701
810
|
* @param reCaptchaToken reCAPTCHA token
|
|
702
811
|
* @return message feed
|
|
703
812
|
*/
|
|
704
|
-
passreset: (adduserInfo: AdduserInfo, reCaptchaToken?: string) => Promise<
|
|
813
|
+
passreset: (adduserInfo: AdduserInfo, reCaptchaToken?: string) => Promise<MessageResponse>;
|
|
705
814
|
/**
|
|
706
815
|
* change password
|
|
707
816
|
* @param newpswd new password
|
|
708
817
|
* @param oldpswd old password
|
|
709
818
|
* @param passresetToken password reset token
|
|
819
|
+
* @param rxid RXID
|
|
710
820
|
* @return message feed
|
|
711
821
|
*/
|
|
712
|
-
changepass: (newpswd: string, oldpswd?: string, passresetToken?: string) => Promise<
|
|
822
|
+
changepass: (newpswd: string, oldpswd?: string, passresetToken?: string, rxid?: string) => Promise<MessageResponse>;
|
|
713
823
|
/**
|
|
714
824
|
* change password by user admin
|
|
715
825
|
* @param changepassByAdminInfos password change information (uid, password)
|
|
716
826
|
* @return message feed
|
|
717
827
|
*/
|
|
718
|
-
changepassByAdmin: (changepassByAdminInfos: ChangepassByAdminInfo[]) => Promise<
|
|
828
|
+
changepassByAdmin: (changepassByAdminInfos: ChangepassByAdminInfo[]) => Promise<MessageResponse>;
|
|
719
829
|
/**
|
|
720
830
|
* change login user's account
|
|
721
831
|
* @param adduserInfo change user info
|
|
722
832
|
* @return message feed
|
|
723
833
|
*/
|
|
724
|
-
changeaccount: (adduserInfo: AdduserInfo) => Promise<
|
|
834
|
+
changeaccount: (adduserInfo: AdduserInfo) => Promise<MessageResponse>;
|
|
725
835
|
/**
|
|
726
836
|
* verify to change login user's account
|
|
727
837
|
* @param verifyCode verify code
|
|
728
838
|
* @return message feed
|
|
729
839
|
*/
|
|
730
|
-
changeaccount_verify: (verifyCode: string) => Promise<
|
|
840
|
+
changeaccount_verify: (verifyCode: string) => Promise<MessageResponse>;
|
|
731
841
|
/**
|
|
732
842
|
* get user status
|
|
733
843
|
* @param account account
|
|
734
844
|
* @return user status
|
|
735
845
|
*/
|
|
736
|
-
userstatus: (account?: string) => Promise<string |
|
|
846
|
+
userstatus: (account?: string) => Promise<string | Entry[]>;
|
|
737
847
|
/**
|
|
738
848
|
* revoke user
|
|
739
849
|
* @param account account
|
|
740
850
|
* @param isDeleteGroups true if delete groups
|
|
741
851
|
* @return message feed
|
|
742
852
|
*/
|
|
743
|
-
revokeuser: (account: string, isDeleteGroups?: boolean) => Promise<
|
|
853
|
+
revokeuser: (account: string, isDeleteGroups?: boolean) => Promise<Entry>;
|
|
744
854
|
/**
|
|
745
855
|
* revoke users
|
|
746
856
|
* @param accounts account list
|
|
@@ -748,63 +858,63 @@ export declare class VtecxNext {
|
|
|
748
858
|
* @param isDeleteGroups true if delete groups
|
|
749
859
|
* @return message feed
|
|
750
860
|
*/
|
|
751
|
-
revokeusers: (accounts?: string[], uids?: string[], isDeleteGroups?: boolean) => Promise<
|
|
861
|
+
revokeusers: (accounts?: string[], uids?: string[], isDeleteGroups?: boolean) => Promise<Entry[]>;
|
|
752
862
|
/**
|
|
753
863
|
* activate user
|
|
754
864
|
* @param account account
|
|
755
865
|
* @return message feed
|
|
756
866
|
*/
|
|
757
|
-
activateuser: (account: string) => Promise<
|
|
867
|
+
activateuser: (account: string) => Promise<Entry>;
|
|
758
868
|
/**
|
|
759
869
|
* activate users
|
|
760
870
|
* @param accounts account list
|
|
761
871
|
* @param uids uid list
|
|
762
872
|
* @return message feed
|
|
763
873
|
*/
|
|
764
|
-
activateusers: (accounts?: string[], uids?: string[]) => Promise<
|
|
874
|
+
activateusers: (accounts?: string[], uids?: string[]) => Promise<Entry[]>;
|
|
765
875
|
/**
|
|
766
876
|
* cancel user.
|
|
767
877
|
* @param isDeleteGroups true if delete groups
|
|
768
878
|
* @return message feed
|
|
769
879
|
*/
|
|
770
|
-
canceluser: (isDeleteGroups?: boolean) => Promise<
|
|
880
|
+
canceluser: (isDeleteGroups?: boolean) => Promise<MessageResponse>;
|
|
771
881
|
/**
|
|
772
882
|
* delete user
|
|
773
883
|
* @param account account
|
|
774
884
|
* @return message feed
|
|
775
885
|
*/
|
|
776
|
-
deleteuser: (account: string) => Promise<
|
|
886
|
+
deleteuser: (account: string) => Promise<MessageResponse>;
|
|
777
887
|
/**
|
|
778
888
|
* revoke users
|
|
779
889
|
* @param accounts account list
|
|
780
890
|
* @param uids uid list
|
|
781
891
|
* @return message feed
|
|
782
892
|
*/
|
|
783
|
-
deleteusers: (accounts?: string[], uids?: string[]) => Promise<
|
|
893
|
+
deleteusers: (accounts?: string[], uids?: string[]) => Promise<MessageResponse>;
|
|
784
894
|
/**
|
|
785
895
|
* add acl
|
|
786
896
|
* @param feed entries
|
|
787
897
|
* @return message
|
|
788
898
|
*/
|
|
789
|
-
addacl: (feed:
|
|
899
|
+
addacl: (feed: Entry[]) => Promise<MessageResponse>;
|
|
790
900
|
/**
|
|
791
901
|
* remove acl
|
|
792
902
|
* @param feed entries
|
|
793
903
|
* @return message
|
|
794
904
|
*/
|
|
795
|
-
removeacl: (feed:
|
|
905
|
+
removeacl: (feed: Entry[]) => Promise<MessageResponse>;
|
|
796
906
|
/**
|
|
797
907
|
* add alias
|
|
798
908
|
* @param feed entries
|
|
799
909
|
* @return message
|
|
800
910
|
*/
|
|
801
|
-
addalias: (feed:
|
|
911
|
+
addalias: (feed: Entry[]) => Promise<MessageResponse>;
|
|
802
912
|
/**
|
|
803
913
|
* remove alias
|
|
804
914
|
* @param feed entries
|
|
805
915
|
* @return message
|
|
806
916
|
*/
|
|
807
|
-
removealias: (feed:
|
|
917
|
+
removealias: (feed: Entry[]) => Promise<MessageResponse>;
|
|
808
918
|
/**
|
|
809
919
|
* get content url.
|
|
810
920
|
* @param uri key
|
|
@@ -815,53 +925,57 @@ export declare class VtecxNext {
|
|
|
815
925
|
* save files
|
|
816
926
|
* @param uri key
|
|
817
927
|
* @param bysize true if registering with specified size
|
|
928
|
+
* @param saFormData formData by server action
|
|
818
929
|
* @returns message
|
|
819
930
|
*/
|
|
820
|
-
savefiles: (uri: string, bysize?: boolean) => Promise<
|
|
931
|
+
savefiles: (uri: string, bysize?: boolean, saFormData?: FormData) => Promise<MessageResponse>;
|
|
821
932
|
/**
|
|
822
933
|
* save files registering with specified size
|
|
823
934
|
* @param uri key
|
|
935
|
+
* @param saFormData formData by server action
|
|
824
936
|
* @returns message
|
|
825
937
|
*/
|
|
826
|
-
savefilesBySize: (uri: string) => Promise<
|
|
938
|
+
savefilesBySize: (uri: string, saFormData?: FormData) => Promise<MessageResponse>;
|
|
827
939
|
/**
|
|
828
940
|
* upload content
|
|
829
941
|
* @param uri key
|
|
830
942
|
* @param bysize true if registering with specified size
|
|
831
943
|
* @param filename attachment file name
|
|
832
|
-
* @param arrayBuffer content (for batch)
|
|
944
|
+
* @param arrayBuffer content (for batch or server action)
|
|
833
945
|
* @return message
|
|
834
946
|
*/
|
|
835
|
-
putcontent: (uri: string, filename?: string, arrayBuffer?: ArrayBuffer) => Promise<
|
|
947
|
+
putcontent: (uri: string, filename?: string, arrayBuffer?: ArrayBuffer) => Promise<Entry[]>;
|
|
836
948
|
/**
|
|
837
949
|
* upload content
|
|
838
950
|
* @param uri key
|
|
839
951
|
* @param bysize true if registering with specified size
|
|
840
952
|
* @param filename attachment file name
|
|
841
|
-
* @param arrayBuffer content (for batch)
|
|
953
|
+
* @param arrayBuffer content (for batch or server action)
|
|
842
954
|
* @return message
|
|
843
955
|
*/
|
|
844
956
|
private putcontentProc;
|
|
845
957
|
/**
|
|
846
958
|
* upload content registering with specified size
|
|
847
959
|
* @param uri key
|
|
960
|
+
* @param arrayBuffer file array buffer by server action
|
|
848
961
|
* @return message
|
|
849
962
|
*/
|
|
850
|
-
putcontentBySize: (uri: string) => Promise<
|
|
963
|
+
putcontentBySize: (uri: string, arrayBuffer?: ArrayBuffer) => Promise<Entry[]>;
|
|
851
964
|
/**
|
|
852
965
|
* upload content and numbering
|
|
853
966
|
* @param parenturi parent key
|
|
854
967
|
* @param extension extension
|
|
855
968
|
* @param filename attachment file name
|
|
969
|
+
* @param arrayBuffer file array buffer by server action
|
|
856
970
|
* @return numbered key
|
|
857
971
|
*/
|
|
858
|
-
postcontent: (parenturi: string, extension?: string, filename?: string) => Promise<
|
|
972
|
+
postcontent: (parenturi: string, extension?: string, filename?: string, arrayBuffer?: ArrayBuffer) => Promise<Entry[]>;
|
|
859
973
|
/**
|
|
860
974
|
* delete content
|
|
861
975
|
* @param uri key
|
|
862
976
|
* @return message
|
|
863
977
|
*/
|
|
864
|
-
deletecontent: (uri: string) => Promise<
|
|
978
|
+
deletecontent: (uri: string) => Promise<Entry>;
|
|
865
979
|
/**
|
|
866
980
|
* get content.
|
|
867
981
|
* Writes a content to the response.
|
|
@@ -903,44 +1017,44 @@ export declare class VtecxNext {
|
|
|
903
1017
|
* @param chs length of one side of QR code
|
|
904
1018
|
* @return QR code URL in feed.title
|
|
905
1019
|
*/
|
|
906
|
-
getTotpLink: (chs?: number) => Promise<
|
|
1020
|
+
getTotpLink: (chs?: number) => Promise<Entry[]>;
|
|
907
1021
|
/**
|
|
908
1022
|
* create TOTP
|
|
909
1023
|
* @param feed one-time password for feed.title when you do book registration
|
|
910
1024
|
* @return message
|
|
911
1025
|
*/
|
|
912
|
-
createTotp: (feed:
|
|
1026
|
+
createTotp: (feed: LegacyFeed) => Promise<MessageResponse>;
|
|
913
1027
|
/**
|
|
914
1028
|
* delete TOTP
|
|
915
1029
|
* @param account target account (for service admin user)
|
|
916
1030
|
* @return message
|
|
917
1031
|
*/
|
|
918
|
-
deleteTotp: (account?: string) => Promise<
|
|
1032
|
+
deleteTotp: (account?: string) => Promise<MessageResponse>;
|
|
919
1033
|
/**
|
|
920
1034
|
* change TDID (Trusted device ID)
|
|
921
1035
|
* @param account target account (for service admin user)
|
|
922
1036
|
* @return message
|
|
923
1037
|
*/
|
|
924
|
-
changeTdid: () => Promise<
|
|
1038
|
+
changeTdid: () => Promise<MessageResponse>;
|
|
925
1039
|
/**
|
|
926
1040
|
* Merge an existing user with an line oauth user.
|
|
927
1041
|
* @param rxid RXID
|
|
928
|
-
* @return
|
|
1042
|
+
* @return user entry
|
|
929
1043
|
*/
|
|
930
|
-
mergeOAuthUserLine: (rxid: string) => Promise<
|
|
1044
|
+
mergeOAuthUserLine: (rxid: string) => Promise<Entry>;
|
|
931
1045
|
/**
|
|
932
1046
|
* create group admin
|
|
933
1047
|
* @param CreateGroupadminInfo group name and uid list
|
|
934
1048
|
* @return message feed
|
|
935
1049
|
*/
|
|
936
|
-
createGroupadmin: (createGroupadminInfos: CreateGroupadminInfo[]) => Promise<
|
|
1050
|
+
createGroupadmin: (createGroupadminInfos: CreateGroupadminInfo[]) => Promise<MessageResponse>;
|
|
937
1051
|
/**
|
|
938
1052
|
* delete group admin group
|
|
939
1053
|
* @param groupNames group name list
|
|
940
1054
|
* @param async execute async
|
|
941
1055
|
* @return message feed
|
|
942
1056
|
*/
|
|
943
|
-
deleteGroupadmin: (groupNames: string[], async?: boolean) => Promise<
|
|
1057
|
+
deleteGroupadmin: (groupNames: string[], async?: boolean) => Promise<MessageResponse>;
|
|
944
1058
|
/**
|
|
945
1059
|
* get property
|
|
946
1060
|
* @param name property name
|
|
@@ -1012,19 +1126,18 @@ export declare class VtecxNext {
|
|
|
1012
1126
|
* Merge an existing user with an oauth user.
|
|
1013
1127
|
* @param provider OAuth provider name
|
|
1014
1128
|
* @param rxid RXID
|
|
1015
|
-
* @return
|
|
1129
|
+
* @return user entry
|
|
1016
1130
|
*/
|
|
1017
1131
|
private mergeOAuthUser;
|
|
1018
1132
|
}
|
|
1019
1133
|
/**
|
|
1020
1134
|
* response class
|
|
1021
1135
|
*/
|
|
1022
|
-
export
|
|
1136
|
+
export type VtecxResponse<T = unknown> = {
|
|
1023
1137
|
status: number;
|
|
1024
|
-
header:
|
|
1025
|
-
data:
|
|
1026
|
-
|
|
1027
|
-
}
|
|
1138
|
+
header: Record<string, string>;
|
|
1139
|
+
data: T;
|
|
1140
|
+
};
|
|
1028
1141
|
/**
|
|
1029
1142
|
* Error returned from vte.cx
|
|
1030
1143
|
*/
|