@vtecx/vtecxnext 1.1.11 → 2.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.
@@ -1,5 +1,4 @@
1
- /// <reference types="node" />
2
- import { IncomingMessage, ServerResponse } from 'http';
1
+ import { NextRequest } from 'next/server';
3
2
  import type { Readable } from 'node:stream';
4
3
  /**
5
4
  * Hello world.
@@ -9,874 +8,795 @@ type StatusMessage = {
9
8
  status: number;
10
9
  message: string;
11
10
  };
12
- /**
13
- * X-Requested-With header check.
14
- * If not specified, set status 417 to the response.
15
- * @param req request
16
- * @param res response
17
- * @return false if no X-Requested-With header is specified
18
- */
19
- export declare const checkXRequestedWith: (req: IncomingMessage, res: ServerResponse) => boolean;
20
- /**
21
- * Sends an feed response(including message) to the client using the specified status.
22
- * @param res response
23
- * @param statusCode status code
24
- * @param message message
25
- * @return true
26
- */
27
- export declare const sendMessage: (res: ServerResponse, statusCode: number, message: string) => boolean;
28
- /**
29
- * login.
30
- * Request authentication with WSSE.
31
- * If the login is successful, sets the authentication information in a cookie.
32
- * @param req request
33
- * @param res response
34
- * @param wsse WSSE
35
- * @param reCaptchaToken reCAPTCHA token
36
- * @return status and message
37
- */
38
- export declare const login: (req: IncomingMessage, res: ServerResponse, wsse: string, reCaptchaToken?: string) => Promise<StatusMessage>;
39
- /**
40
- * login with RXID.
41
- * If the login is successful, sets the authentication information in a cookie.
42
- * @param req request
43
- * @param res response
44
- * @param rxid RXID
45
- * @return status and message
46
- */
47
- export declare const loginWithRxid: (req: IncomingMessage, res: ServerResponse, rxid: string) => Promise<StatusMessage>;
48
- /**
49
- * login with Time-based One Time Password.
50
- * If the login is successful, sets the authentication information in a cookie.
51
- * @param req request
52
- * @param res response
53
- * @param totp Time-based One Time Password
54
- * @param isTrustedDevice true if trusted device
55
- * @return status and message
56
- */
57
- export declare const loginWithTotp: (req: IncomingMessage, res: ServerResponse, totp: string, isTrustedDevice: boolean) => Promise<StatusMessage>;
58
- /**
59
- * logout.
60
- * If the logout is successful, delete the authentication information in a cookie.
61
- * @param req request
62
- * @param res response
63
- * @return status and message
64
- */
65
- export declare const logout: (req: IncomingMessage, res: ServerResponse) => Promise<StatusMessage>;
66
- /**
67
- * get current datetime
68
- * @return current datetime
69
- */
70
- export declare const now: () => Promise<string>;
71
- /**
72
- * get login uid
73
- * @param req request
74
- * @param res response
75
- * @return uid
76
- */
77
- export declare const uid: (req: IncomingMessage, res: ServerResponse) => Promise<string>;
78
- /**
79
- * get login account
80
- * @param req request
81
- * @param res response
82
- * @return account
83
- */
84
- export declare const account: (req: IncomingMessage, res: ServerResponse) => Promise<string>;
85
- /**
86
- * get login whoami
87
- * @param req request (for authentication)
88
- * @param res response (for authentication)
89
- * @return login user information
90
- */
91
- export declare const whoami: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
92
- /**
93
- * whether you are logged in
94
- * @param req request (for authentication)
95
- * @param res response (for authentication)
96
- * @return true if logged in
97
- */
98
- export declare const isLoggedin: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
99
- /**
100
- * get login service
101
- * @param req request
102
- * @param res response
103
- * @return service
104
- */
105
- export declare const service: (req: IncomingMessage, res: ServerResponse) => Promise<string>;
106
- /**
107
- * get RXID
108
- * @param req request
109
- * @param res response
110
- * @return RXID
111
- */
112
- export declare const rxid: (req: IncomingMessage, res: ServerResponse) => Promise<string>;
113
- /**
114
- * register a log entry
115
- * @param req request (for authentication)
116
- * @param res response (for authentication)
117
- * @param message message
118
- * @param title title
119
- * @param subtitle subtitle
120
- * @return true if successful
121
- */
122
- export declare const log: (req: IncomingMessage | undefined, res: ServerResponse | undefined, message: string, title?: string, subtitle?: string) => Promise<boolean>;
123
- /**
124
- * get entry
125
- * @param req request (for authentication)
126
- * @param res response (for authentication)
127
- * @param uri key
128
- * @param targetService target service name (for service linkage)
129
- * @return entry
130
- */
131
- export declare const getEntry: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, targetService?: string) => Promise<any>;
132
- /**
133
- * get feed
134
- * @param req request (for authentication)
135
- * @param res response (for authentication)
136
- * @param uri key and conditions
137
- * @return feed (entry array)
138
- */
139
- export declare const getFeed: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, targetService?: string) => Promise<any>;
140
- /**
141
- * get feed
142
- * @param req request (for authentication)
143
- * @param res response (for authentication)
144
- * @param uri key and conditions
145
- * @return feed (entry array). Returns a cursor in the header if more data is available. (x-vtecx-nextpage)
146
- */
147
- export declare const getFeedResponse: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, targetService?: string) => Promise<VtecxResponse>;
148
- /**
149
- * get count
150
- * @param req request (for authentication)
151
- * @param res response (for authentication)
152
- * @param uri key and conditions
153
- * @return count
154
- */
155
- export declare const count: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, targetService?: string) => Promise<number | null>;
156
- /**
157
- * get count
158
- * @param req request (for authentication)
159
- * @param res response (for authentication)
160
- * @param uri key and conditions
161
- * @return feed. Returns a cursor in the header if more data is available. (x-vtecx-nextpage)
162
- */
163
- export declare const countResponse: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, targetService?: string) => Promise<VtecxResponse>;
164
- /**
165
- * register entries
166
- * @param req request (for authentication)
167
- * @param res response (for authentication)
168
- * @param feed entries (JSON)
169
- * @param uri parent key if not specified in entry
170
- * @return registed entries
171
- */
172
- export declare const post: (req: IncomingMessage | undefined, res: ServerResponse | undefined, feed: any, uri?: string, targetService?: string) => Promise<any>;
173
- /**
174
- * update entries
175
- * @param req request (for authentication)
176
- * @param res response (for authentication)
177
- * @param feed entries (JSON)
178
- * @param isbulk Forcibly execute even if it exceeds the upper limit of entries of request feed.
179
- * @param parallel Execute parallel if this param is true. Valid only if 'isbulk' is true.
180
- * @param async Execute asynchronous if this param is true. Valid only if 'isbulk' is true.
181
- * @return updated entries
182
- */
183
- export declare const put: (req: IncomingMessage | undefined, res: ServerResponse | undefined, feed: any, isbulk?: boolean, parallel?: boolean, async?: boolean, targetService?: string) => Promise<any>;
184
- /**
185
- * delete entry
186
- * @param req request (for authentication)
187
- * @param res response (for authentication)
188
- * @param uri key
189
- * @param revision number of revision
190
- * @return true if successful
191
- */
192
- export declare const deleteEntry: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, revision?: number, targetService?: string) => Promise<boolean>;
193
- /**
194
- * delete folder
195
- * @param req request (for authentication)
196
- * @param res response (for authentication)
197
- * @param uri parent key
198
- * @param async execute async
199
- * @return true if successful
200
- */
201
- export declare const deleteFolder: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, async?: boolean, targetService?: string) => Promise<boolean>;
202
- /**
203
- * clear folder
204
- * @param req request (for authentication)
205
- * @param res response (for authentication)
206
- * @param uri parent key
207
- * @param async execute async
208
- * @return true if successful
209
- */
210
- export declare const clearFolder: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, async?: boolean, targetService?: string) => Promise<boolean>;
211
- /**
212
- * allocate numbers
213
- * @param req request (for authentication)
214
- * @param res response (for authentication)
215
- * @param uri key
216
- * @param num number to allocate
217
- * @return allocated numbers. comma separated if multiple.
218
- */
219
- export declare const allocids: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, num: number, targetService?: string) => Promise<string>;
220
- /**
221
- * add a number
222
- * @param req request (for authentication)
223
- * @param res response (for authentication)
224
- * @param uri key
225
- * @param num number to add
226
- * @return added number
227
- */
228
- export declare const addids: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, num: number, targetService?: string) => Promise<number | null>;
229
- /**
230
- * get a added number
231
- * @param req request (for authentication)
232
- * @param res response (for authentication)
233
- * @param uri key
234
- * @return added number
235
- */
236
- export declare const getids: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, targetService?: string) => Promise<number | null>;
237
- /**
238
- * set a number
239
- * @param req request (for authentication)
240
- * @param res response (for authentication)
241
- * @param uri key
242
- * @param num number to set
243
- * @return set number
244
- */
245
- export declare const setids: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, num: number, targetService?: string) => Promise<number | null>;
246
- /**
247
- * set a addition range
248
- * @param req request (for authentication)
249
- * @param res response (for authentication)
250
- * @param uri key
251
- * @param range addition range
252
- * @return addition range
253
- */
254
- export declare const rangeids: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string, range: string) => Promise<string>;
255
- /**
256
- * get a addition range
257
- * @param req request (for authentication)
258
- * @param res response (for authentication)
259
- * @param uri key
260
- * @return addition range
261
- */
262
- export declare const getRangeids: (req: IncomingMessage | undefined, res: ServerResponse | undefined, uri: string) => Promise<string>;
263
- /**
264
- * set feed to session
265
- * @param req request (for authentication)
266
- * @param res response (for authentication)
267
- * @param name name
268
- * @param feed entries (JSON)
269
- * @return true if successful
270
- */
271
- export declare const setSessionFeed: (req: IncomingMessage, res: ServerResponse, name: string, feed: any) => Promise<boolean>;
272
- /**
273
- * set entry to session
274
- * @param req request (for authentication)
275
- * @param res response (for authentication)
276
- * @param name name
277
- * @param entry entry (JSON)
278
- * @return true if successful
279
- */
280
- export declare const setSessionEntry: (req: IncomingMessage, res: ServerResponse, name: string, entry: any) => Promise<boolean>;
281
- /**
282
- * set string to session
283
- * @param req request (for authentication)
284
- * @param res response (for authentication)
285
- * @param name name
286
- * @param str string
287
- * @return true if successful
288
- */
289
- export declare const setSessionString: (req: IncomingMessage, res: ServerResponse, name: string, str: string) => Promise<boolean>;
290
- /**
291
- * set number to session
292
- * @param req request (for authentication)
293
- * @param res response (for authentication)
294
- * @param name name
295
- * @param num number
296
- * @return true if successful
297
- */
298
- export declare const setSessionLong: (req: IncomingMessage, res: ServerResponse, name: string, num: number) => Promise<boolean>;
299
- /**
300
- * add number in session
301
- * @param req request (for authentication)
302
- * @param res response (for authentication)
303
- * @param name name
304
- * @param num number to add
305
- * @return true if successful
306
- */
307
- export declare const incrementSession: (req: IncomingMessage, res: ServerResponse, name: string, num: number) => Promise<number | null>;
308
- /**
309
- * delete feed from session
310
- * @param req request (for authentication)
311
- * @param res response (for authentication)
312
- * @param name name
313
- * @return true if successful
314
- */
315
- export declare const deleteSessionFeed: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<boolean>;
316
- /**
317
- * delete entry from session
318
- * @param req request (for authentication)
319
- * @param res response (for authentication)
320
- * @param name name
321
- * @return true if successful
322
- */
323
- export declare const deleteSessionEntry: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<boolean>;
324
- /**
325
- * delete string from session
326
- * @param req request (for authentication)
327
- * @param res response (for authentication)
328
- * @param name name
329
- * @return true if successful
330
- */
331
- export declare const deleteSessionString: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<boolean>;
332
- /**
333
- * delete number from session
334
- * @param req request (for authentication)
335
- * @param res response (for authentication)
336
- * @param name name
337
- * @return true if successful
338
- */
339
- export declare const deleteSessionLong: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<boolean>;
340
- /**
341
- * get feed from session
342
- * @param req request (for authentication)
343
- * @param res response (for authentication)
344
- * @param name name
345
- * @return feed
346
- */
347
- export declare const getSessionFeed: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<any>;
348
- /**
349
- * get entry from session
350
- * @param req request (for authentication)
351
- * @param res response (for authentication)
352
- * @param name name
353
- * @return entry
354
- */
355
- export declare const getSessionEntry: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<any>;
356
- /**
357
- * get string from session
358
- * @param req request (for authentication)
359
- * @param res response (for authentication)
360
- * @param name name
361
- * @return string
362
- */
363
- export declare const getSessionString: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<string | null>;
364
- /**
365
- * get number from session
366
- * @param req request (for authentication)
367
- * @param res response (for authentication)
368
- * @param name name
369
- * @return number
370
- */
371
- export declare const getSessionLong: (req: IncomingMessage, res: ServerResponse, name: string) => Promise<number | null>;
372
- /**
373
- * pagination
374
- * @param req request (for authentication)
375
- * @param res response (for authentication)
376
- * @param uri key and conditions
377
- * @param pagerange page range
378
- * @return feed Maximum number of pages in the specified page range, and total count.
379
- */
380
- export declare const pagination: (req: IncomingMessage, res: ServerResponse, uri: string, pagerange: string, targetService?: string) => Promise<any>;
381
- /**
382
- * get page
383
- * @param req request (for authentication)
384
- * @param res response (for authentication)
385
- * @param uri key and conditions
386
- * @param num page number
387
- * @return feed Maximum number of pages in the specified page range, and total count.
388
- */
389
- export declare const getPage: (req: IncomingMessage, res: ServerResponse, uri: string, num: number, targetService?: string) => Promise<any>;
390
- /**
391
- * post data to bigquery
392
- * @param req request (for authentication)
393
- * @param res response (for authentication)
394
- * @param feed entries (JSON)
395
- * @param async execute async
396
- * @param tablenames key:entity's prop name, value:BigQuery table name
397
- * @return true if successful
398
- */
399
- export declare const postBQ: (req: IncomingMessage, res: ServerResponse, feed: any, async?: boolean, tablenames?: any) => Promise<boolean>;
400
- /**
401
- * delete data from bigquery
402
- * @param req request (for authentication)
403
- * @param res response (for authentication)
404
- * @param keys delete keys
405
- * @param async execute async
406
- * @param tablenames key:entity's prop name, value:BigQuery table name
407
- * @return true if successful
408
- */
409
- export declare const deleteBQ: (req: IncomingMessage, res: ServerResponse, keys: string[], async?: boolean, tablenames?: any) => Promise<boolean>;
410
- /**
411
- * query bigquery
412
- * @param req request (for authentication)
413
- * @param res response (for authentication)
414
- * @param sql query sql
415
- * @param values values of query arguments
416
- * @param parent parent name of result json
417
- * @return query results in JSON format
418
- */
419
- export declare const getBQ: (req: IncomingMessage, res: ServerResponse, sql: string, values?: any[], parent?: string) => Promise<any>;
420
- /**
421
- * query bigquery
422
- * @param req request (for authentication)
423
- * @param res response (for authentication)
424
- * @param sql query sql
425
- * @param values values of query arguments
426
- * @param parent parent name of result json
427
- * @return query results in JSON format
428
- */
429
- export declare const execBQ: (req: IncomingMessage, res: ServerResponse, sql: string, values?: any[], parent?: string) => Promise<any>;
430
- /**
431
- * Search BigQuery and return results in CSV format.
432
- * @param req request (for authentication)
433
- * @param res response
434
- * @param sql query sql
435
- * @param values values of query arguments
436
- * @param filename file name of csv
437
- * @param parent parent name of result json
438
- * @return true
439
- */
440
- export declare const getBQCsv: (req: IncomingMessage, res: ServerResponse, sql: string, values?: any[], filename?: string, parent?: string) => Promise<boolean>;
441
- /**
442
- * Execute a query SQL to the database and get the result.
443
- * @param req request (for authentication)
444
- * @param res response (for authentication)
445
- * @param sql query sql
446
- * @param values values of query arguments
447
- * @param parent parent name of result json
448
- * @return query results in JSON format
449
- */
450
- export declare const queryRDB: (req: IncomingMessage, res: ServerResponse, sql: string, values?: any[], parent?: string) => Promise<any>;
451
- /**
452
- * Search RDB and return results in CSV format.
453
- * @param req request (for authentication)
454
- * @param res response
455
- * @param sql query sql
456
- * @param values values of query arguments
457
- * @param filename file name of csv
458
- * @param parent parent name of result json
459
- * @return true
460
- */
461
- export declare const queryRDBCsv: (req: IncomingMessage, res: ServerResponse, sql: string, values?: any[], filename?: string, parent?: string) => Promise<boolean>;
462
- /**
463
- * Execute SQL to the database.
464
- * If there are multiple SQLs, they will be wrapped in a transaction.
465
- * @param req request (for authentication)
466
- * @param res response (for authentication)
467
- * @param sqls sql list
468
- * @param values values of query arguments
469
- */
470
- export declare const execRDB: (req: IncomingMessage, res: ServerResponse, sqls: string[], values?: any[][]) => Promise<any>;
471
- /**
472
- * Create PDF.
473
- * Writes a PDF to the response.
474
- * @param req request (for authentication)
475
- * @param res response
476
- * @param htmlTemplate PDF layout
477
- * @param filename PDF file name
478
- * @return true
479
- */
480
- export declare const toPdf: (req: IncomingMessage, res: ServerResponse, htmlTemplate: string, filename?: string) => Promise<boolean>;
481
- /**
482
- * put the signature of uri and revision.
483
- * @param req request (for authentication)
484
- * @param res response (for authentication)
485
- * @param uri key
486
- * @param revision revision
487
- * @return signed entry
488
- */
489
- export declare const putSignature: (req: IncomingMessage, res: ServerResponse, uri: string, revision?: number) => Promise<any>;
490
- /**
491
- * puts the signature of uri and revision.
492
- * @param req request (for authentication)
493
- * @param res response (for authentication)
494
- * @param feed entries
495
- * @return signed entries
496
- */
497
- export declare const putSignatures: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
498
- /**
499
- * delete the signature.
500
- * @param req request (for authentication)
501
- * @param res response (for authentication)
502
- * @param uri key
503
- * @param revision revision
504
- * @return true if successful
505
- */
506
- export declare const deleteSignature: (req: IncomingMessage, res: ServerResponse, uri: string, revision?: number) => Promise<boolean>;
507
- /**
508
- * check the signature.
509
- * @param req request (for authentication)
510
- * @param res response (for authentication)
511
- * @param uri key
512
- * @return true if the signature is valid
513
- */
514
- export declare const checkSignature: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<boolean>;
515
- /**
516
- * Send an mail (with attachments)
517
- * @param req request (for authentication)
518
- * @param res response (for authentication)
519
- * @param entry email contents
520
- * @param to email addresses to
521
- * @param cc email addresses cc
522
- * @param bcc email addresses bcc
523
- * @param attachments keys of attachment files
524
- * @return true if successful
525
- */
526
- export declare const sendMail: (req: IncomingMessage, res: ServerResponse, entry: any, to: string[], cc?: string[], bcc?: string[], attachments?: string[]) => Promise<boolean>;
527
- /**
528
- * push notification to clients.
529
- * @param req request (for authentication)
530
- * @param res response (for authentication)
531
- * @param message message
532
- * @param to clients to
533
- * @param title title
534
- * @param subtitle subtitle (Expo)
535
- * @param imageUrl url of image (FCM)
536
- * @param data key value data (Expo)
537
- * @return true if successful
538
- */
539
- export declare const pushNotification: (req: IncomingMessage, res: ServerResponse, message: string, to: string[], title?: string, subtitle?: string, imageUrl?: string, data?: any) => Promise<boolean>;
540
- /**
541
- * set status of MessageQueue.
542
- * @param req request (for authentication)
543
- * @param res response (for authentication)
544
- * @param flag true if on, false if off
545
- * @param channel channel
546
- */
547
- export declare const setMessageQueueStatus: (req: IncomingMessage, res: ServerResponse, flag: boolean, channel: string) => Promise<boolean>;
548
- /**
549
- * get status of MessageQueue.
550
- * @param req request (for authentication)
551
- * @param res response (for authentication)
552
- * @param name name
553
- * @return feed
554
- */
555
- export declare const getMessageQueueStatus: (req: IncomingMessage, res: ServerResponse, channel: string) => Promise<any>;
556
- /**
557
- * set MessageQueue.
558
- * @param req request (for authentication)
559
- * @param res response (for authentication)
560
- * @param feed entries (JSON)
561
- * @param channel channel
562
- * @return true if successful
563
- */
564
- export declare const setMessageQueue: (req: IncomingMessage, res: ServerResponse, feed: any, channel: string) => Promise<boolean>;
565
- /**
566
- * get messageQueue.
567
- * @param req request (for authentication)
568
- * @param res response (for authentication)
569
- * @param name name
570
- * @return feed
571
- */
572
- export declare const getMessageQueue: (req: IncomingMessage, res: ServerResponse, channel: string) => Promise<any>;
573
- /**
574
- * join to the group
575
- * @param req request (for authentication)
576
- * @param res response (for authentication)
577
- * @param group group
578
- * @param selfid hierarchical name under my group alias
579
- * @return feed
580
- */
581
- export declare const joinGroup: (req: IncomingMessage, res: ServerResponse, group: string, selfid: string) => Promise<any>;
582
- /**
583
- * leave from the group
584
- * @param req request (for authentication)
585
- * @param res response (for authentication)
586
- * @param group group
587
- * @return feed
588
- */
589
- export declare const leaveGroup: (req: IncomingMessage, res: ServerResponse, group: string) => Promise<boolean>;
590
- /**
591
- * Get entries that have entries in a group, but are not in the group.
592
- * (for entries with no signature or with an incorrect signature, if the user group requires a signature)
593
- * @param req request (for authentication)
594
- * @param res response (for authentication)
595
- * @param uri group key
596
- * @return feed (entry array)
597
- */
598
- export declare const noGroupMember: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
599
- /**
600
- * Get groups
601
- * @param req request (for authentication)
602
- * @param res response (for authentication)
603
- * @param uri group key
604
- * @return feed (entry array)
605
- */
606
- export declare const getGroups: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
607
- /**
608
- * whether you are in the group
609
- * @param req request (for authentication)
610
- * @param res response (for authentication)
611
- * @param uri group key
612
- * @return true/false
613
- */
614
- export declare const isGroupMember: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<boolean>;
615
- /**
616
- * whether you are in the admin group
617
- * @param req request (for authentication)
618
- * @param res response (for authentication)
619
- * @return true/false
620
- */
621
- export declare const isAdmin: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
622
- /**
623
- * add user
624
- * @param req request (for authentication)
625
- * @param res response (for authentication)
626
- * @param feed entry (JSON)
627
- * @param reCaptchaToken reCAPTCHA token
628
- * @return message feed
629
- */
630
- export declare const adduser: (req: IncomingMessage, res: ServerResponse, feed: any, reCaptchaToken: string) => Promise<any>;
631
- /**
632
- * add user by user admin
633
- * @param req request (for authentication)
634
- * @param res response (for authentication)
635
- * @param feed entries (JSON)
636
- * @param reCaptchaToken reCAPTCHA token
637
- * @return message feed
638
- */
639
- export declare const adduserByAdmin: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
640
- /**
641
- * Send email for password reset
642
- * @param req request (for authentication)
643
- * @param res response (for authentication)
644
- * @param feed entry (JSON)
645
- * @param reCaptchaToken reCAPTCHA token
646
- * @return message feed
647
- */
648
- export declare const passreset: (req: IncomingMessage, res: ServerResponse, feed: any, reCaptchaToken?: string) => Promise<any>;
649
- /**
650
- * change password
651
- * @param req request (for authentication)
652
- * @param res response (for authentication)
653
- * @param feed entry (JSON)
654
- * @return message feed
655
- */
656
- export declare const changepass: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
657
- /**
658
- * change password by user admin
659
- * @param req request (for authentication)
660
- * @param res response (for authentication)
661
- * @param feed entry (JSON)
662
- * @return message feed
663
- */
664
- export declare const changepassByAdmin: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
665
- /**
666
- * change login user's account
667
- * @param req request (for authentication)
668
- * @param res response (for authentication)
669
- * @param feed entries (JSON)
670
- * @return message feed
671
- */
672
- export declare const changeaccount: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
673
- /**
674
- * verify to change login user's account
675
- * @param req request (for authentication)
676
- * @param res response (for authentication)
677
- * @param verifyCode verify code
678
- * @return message feed
679
- */
680
- export declare const changeaccount_verify: (req: IncomingMessage, res: ServerResponse, verifyCode: string) => Promise<any>;
681
- /**
682
- * get user status
683
- * @param req request (for authentication)
684
- * @param res response (for authentication)
685
- * @param account account
686
- * @return user status
687
- */
688
- export declare const userstatus: (req: IncomingMessage, res: ServerResponse, account?: string) => Promise<any>;
689
- /**
690
- * revoke user
691
- * @param req request (for authentication)
692
- * @param res response (for authentication)
693
- * @param account account
694
- * @return message feed
695
- */
696
- export declare const revokeuser: (req: IncomingMessage, res: ServerResponse, account: string) => Promise<any>;
697
- /**
698
- * revoke users
699
- * @param req request (for authentication)
700
- * @param res response (for authentication)
701
- * @param feed entries (JSON)
702
- * @return message feed
703
- */
704
- export declare const revokeusers: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
705
- /**
706
- * activate user
707
- * @param req request (for authentication)
708
- * @param res response (for authentication)
709
- * @param account account
710
- * @return message feed
711
- */
712
- export declare const activateuser: (req: IncomingMessage, res: ServerResponse, account: string) => Promise<any>;
713
- /**
714
- * activate users
715
- * @param req request (for authentication)
716
- * @param res response (for authentication)
717
- * @param feed entries (JSON)
718
- * @return message feed
719
- */
720
- export declare const activateusers: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
721
- /**
722
- * cancel user.
723
- * @param req request (for authentication)
724
- * @param res response (for authentication)
725
- * @param account account
726
- * @return message feed
727
- */
728
- export declare const canceluser: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
729
- /**
730
- * delete user
731
- * @param req request (for authentication)
732
- * @param res response (for authentication)
733
- * @param account account
734
- * @return message feed
735
- */
736
- export declare const deleteuser: (req: IncomingMessage, res: ServerResponse, account: string) => Promise<any>;
737
- /**
738
- * revoke users
739
- * @param req request (for authentication)
740
- * @param res response (for authentication)
741
- * @param feed entries (JSON)
742
- * @return message feed
743
- */
744
- export declare const deleteusers: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
745
- /**
746
- * save files
747
- * @param req request
748
- * @param res respose (for authentication)
749
- * @param uri key
750
- * @returns message
751
- */
752
- export declare const savefiles: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
753
- /**
754
- * upload content
755
- * @param req request (for authentication)
756
- * @param res response (for authentication)
757
- * @param uri key
758
- * @return message
759
- */
760
- export declare const putcontent: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
761
- /**
762
- * delete content
763
- * @param req request (for authentication)
764
- * @param res response (for authentication)
765
- * @param uri key
766
- * @return message
767
- */
768
- export declare const deletecontent: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
769
- /**
770
- * get content.
771
- * Writes a content to the response.
772
- * @param req request (for authentication)
773
- * @param res response (for authentication)
774
- * @param uri key
775
- * @return true
776
- */
777
- export declare const getcontent: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<boolean>;
778
- /**
779
- * get content url.
780
- * @param uri key
781
- * @return content url
782
- */
783
- export declare const getcontenturl: (uri: string) => Promise<string>;
784
- /**
785
- * add acl
786
- * @param req request (for authentication)
787
- * @param res response (for authentication)
788
- * @param feed entries
789
- * @return message
790
- */
791
- export declare const addacl: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
792
- /**
793
- * remove acl
794
- * @param req request (for authentication)
795
- * @param res response (for authentication)
796
- * @param feed entries
797
- * @return message
798
- */
799
- export declare const removeacl: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
800
- /**
801
- * add alias
802
- * @param req request (for authentication)
803
- * @param res response (for authentication)
804
- * @param feed entries
805
- * @return message
806
- */
807
- export declare const addalias: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
808
- /**
809
- * remove alias
810
- * @param req request (for authentication)
811
- * @param res response (for authentication)
812
- * @param feed entries
813
- * @return message
814
- */
815
- export declare const removealias: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
816
- /**
817
- * OAuth authorization request to LINE
818
- * @param req request (for authentication)
819
- * @param res response (for authentication)
820
- */
821
- export declare const oauthLine: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
822
- /**
823
- * OAuth authorization request to LINE
824
- * @param req request (for authentication)
825
- * @param res response (for authentication)
826
- */
827
- export declare const oauthCallbackLine: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
828
- /**
829
- * get binary data from stream
830
- * @param readable Readable
831
- * @returns buffer
832
- */
833
- export declare const buffer: (readable: Readable) => Promise<Buffer>;
834
- /**
835
- * get TOTP link
836
- * @param req request (for authentication)
837
- * @param res response (for authentication)
838
- * @param chs length of one side of QR code
839
- * @return QR code URL in feed.title
840
- */
841
- export declare const getTotpLink: (req: IncomingMessage, res: ServerResponse, chs?: number) => Promise<any>;
842
- /**
843
- * create TOTP
844
- * @param req request (for authentication)
845
- * @param res response (for authentication)
846
- * @param feed one-time password for feed.title when you do book registration
847
- * @return message
848
- */
849
- export declare const createTotp: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
850
- /**
851
- * delete TOTP
852
- * @param req request (for authentication)
853
- * @param res response (for authentication)
854
- * @param account target account (for service admin user)
855
- * @return message
856
- */
857
- export declare const deleteTotp: (req: IncomingMessage, res: ServerResponse, account?: string) => Promise<any>;
858
- /**
859
- * change TDID (Trusted device ID)
860
- * @param req request (for authentication)
861
- * @param res response (for authentication)
862
- * @param account target account (for service admin user)
863
- * @return message
864
- */
865
- export declare const changeTdid: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
866
- /**
867
- * Merge an existing user with an line oauth user.
868
- * @param req request (for authentication)
869
- * @param res response (for authentication)
870
- * @param rxid RXID
871
- * @return message feed
872
- */
873
- export declare const mergeOAuthUserLine: (req: IncomingMessage, res: ServerResponse, rxid: string) => Promise<any>;
874
- /**
875
- * null、undefined、空文字の判定
876
- * @param val チェック値
877
- * @returns null、undefined、空文字の場合true
878
- */
879
- export declare const isBlank: (val: any) => boolean;
11
+ export declare class VtecxNext {
12
+ /** Request */
13
+ readonly req: NextRequest;
14
+ /** Response status */
15
+ private resStatus;
16
+ /** Response headers */
17
+ private resHeaders;
18
+ /** binary data */
19
+ private bufferData;
20
+ /**
21
+ * constructor
22
+ * @param req Request
23
+ */
24
+ constructor(req: NextRequest);
25
+ /**
26
+ * get url parameter.
27
+ * @param name parameter name
28
+ * @returns parameter value
29
+ */
30
+ getParameter: (name: string) => string | undefined;
31
+ /**
32
+ * Check if URL parameters exist.
33
+ * @param name パラメータ名
34
+ * @return URLパラメータがある場合true
35
+ */
36
+ hasParameter: (name: string) => boolean;
37
+ /**
38
+ * get binary data from stream
39
+ * @param readable if undefined, return the request buffer.
40
+ * @returns buffer
41
+ */
42
+ buffer: (readable?: Readable) => Promise<Uint8Array>;
43
+ /**
44
+ * null、undefined、空文字の判定
45
+ * @param val チェック値
46
+ * @returns null、undefined、空文字の場合true
47
+ */
48
+ isBlank: (val: any) => boolean;
49
+ /**
50
+ * X-Requested-With header check.
51
+ * If not specified, set status 417 to the response.
52
+ * @return Response if no X-Requested-With header is specified
53
+ */
54
+ checkXRequestedWith: () => Response | undefined;
55
+ /**
56
+ * set response header
57
+ * @param name name
58
+ * @param value value
59
+ */
60
+ setResponseHeader: (name: string, value: string) => void;
61
+ /**
62
+ * response
63
+ * @param status response status code
64
+ * @param data response data
65
+ * @returns Response object
66
+ */
67
+ response: (status?: number, data?: any) => Response;
68
+ /**
69
+ * Sends an feed response(including message) to the client using the specified status.
70
+ * @param statusCode status code
71
+ * @param message message
72
+ * @return true
73
+ */
74
+ sendMessage: (statusCode: number, message: string) => Response;
75
+ /**
76
+ * whether you are logged in
77
+ * @return true if logged in
78
+ */
79
+ isLoggedin: () => Promise<boolean>;
80
+ /**
81
+ * get current datetime
82
+ * @return current datetime
83
+ */
84
+ now: () => Promise<string>;
85
+ /**
86
+ * get login uid
87
+ * @return uid
88
+ */
89
+ uid: () => Promise<string>;
90
+ /**
91
+ * get login account
92
+ * @return account
93
+ */
94
+ account: () => Promise<string>;
95
+ /**
96
+ * get login service
97
+ * @return service
98
+ */
99
+ service: () => Promise<string>;
100
+ /**
101
+ * get RXID
102
+ * @return RXID
103
+ */
104
+ rxid: () => Promise<string>;
105
+ /**
106
+ * login.
107
+ * Request authentication with WSSE.
108
+ * If the login is successful, sets the authentication information in a cookie.
109
+ * @param wsse WSSE
110
+ * @param reCaptchaToken reCAPTCHA token
111
+ * @return status and message
112
+ */
113
+ login: (wsse: string, reCaptchaToken?: string) => Promise<StatusMessage>;
114
+ /**
115
+ * login with RXID.
116
+ * If the login is successful, sets the authentication information in a cookie.
117
+ * @param rxid RXID
118
+ * @return status and message
119
+ */
120
+ loginWithRxid: (rxid: string) => Promise<StatusMessage>;
121
+ /**
122
+ * login with Time-based One Time Password.
123
+ * If the login is successful, sets the authentication information in a cookie.
124
+ * @param totp Time-based One Time Password
125
+ * @param isTrustedDevice true if trusted device
126
+ * @return status and message
127
+ */
128
+ loginWithTotp: (totp: string, isTrustedDevice: boolean) => Promise<StatusMessage>;
129
+ /**
130
+ * logout.
131
+ * If the logout is successful, delete the authentication information in a cookie.
132
+ * @return status and message
133
+ */
134
+ logout: () => Promise<StatusMessage>;
135
+ /**
136
+ * get login whoami
137
+ * @return login user information
138
+ */
139
+ whoami: () => Promise<any>;
140
+ /**
141
+ * register a log entry
142
+ * @param message message
143
+ * @param title title
144
+ * @param subtitle subtitle
145
+ * @return true if successful
146
+ */
147
+ log: (message: string, title?: string, subtitle?: string) => Promise<boolean>;
148
+ /**
149
+ * get entry
150
+ * @param uri key
151
+ * @param targetService target service name (for service linkage)
152
+ * @return entry
153
+ */
154
+ getEntry: (uri: string, targetService?: string) => Promise<any>;
155
+ /**
156
+ * get feed
157
+ * @param uri key and conditions
158
+ * @param targetService target service name (for service linkage)
159
+ * @return feed (entry array)
160
+ */
161
+ getFeed: (uri: string, targetService?: string) => Promise<any>;
162
+ /**
163
+ * get feed
164
+ * @param uri key and conditions
165
+ * @param targetService target service name (for service linkage)
166
+ * @return feed (entry array). Returns a cursor in the header if more data is available. (x-vtecx-nextpage)
167
+ */
168
+ getFeedResponse: (uri: string, targetService?: string) => Promise<VtecxResponse>;
169
+ /**
170
+ * get count
171
+ * @param uri key and conditions
172
+ * @param targetService target service name (for service linkage)
173
+ * @return count
174
+ */
175
+ count: (uri: string, targetService?: string) => Promise<number | null>;
176
+ /**
177
+ * get count
178
+ * @param uri key and conditions
179
+ * @param targetService target service name (for service linkage)
180
+ * @return feed. Returns a cursor in the header if more data is available. (x-vtecx-nextpage)
181
+ */
182
+ countResponse: (uri: string, targetService?: string) => Promise<VtecxResponse>;
183
+ /**
184
+ * register entries
185
+ * @param feed entries (JSON)
186
+ * @param uri parent key if not specified in entry
187
+ * @param targetService target service name (for service linkage)
188
+ * @return registed entries
189
+ */
190
+ post: (feed: any, uri?: string, targetService?: string) => Promise<any>;
191
+ /**
192
+ * update entries
193
+ * @param feed entries (JSON)
194
+ * @param isbulk Forcibly execute even if it exceeds the upper limit of entries of request feed.
195
+ * @param parallel Execute parallel if this param is true. Valid only if 'isbulk' is true.
196
+ * @param async Execute asynchronous if this param is true. Valid only if 'isbulk' is true.
197
+ * @param targetService target service name (for service linkage)
198
+ * @return updated entries
199
+ */
200
+ put: (feed: any, isbulk?: boolean, parallel?: boolean, async?: boolean, targetService?: string) => Promise<any>;
201
+ /**
202
+ * delete entry
203
+ * @param uri key
204
+ * @param revision number of revision
205
+ * @param targetService target service name (for service linkage)
206
+ * @return true if successful
207
+ */
208
+ deleteEntry: (uri: string, revision?: number, targetService?: string) => Promise<boolean>;
209
+ /**
210
+ * delete folder
211
+ * @param uri parent key
212
+ * @param async execute async
213
+ * @param targetService target service name (for service linkage)
214
+ * @return true if successful
215
+ */
216
+ deleteFolder: (uri: string, async?: boolean, targetService?: string) => Promise<boolean>;
217
+ /**
218
+ * clear folder
219
+ * @param uri parent key
220
+ * @param async execute async
221
+ * @param targetService target service name (for service linkage)
222
+ * @return true if successful
223
+ */
224
+ clearFolder: (uri: string, async?: boolean, targetService?: string) => Promise<boolean>;
225
+ /**
226
+ * allocate numbers
227
+ * @param uri key
228
+ * @param num number to allocate
229
+ * @param targetService target service name (for service linkage)
230
+ * @return allocated numbers. comma separated if multiple.
231
+ */
232
+ allocids: (uri: string, num: number, targetService?: string) => Promise<string>;
233
+ /**
234
+ * add a number
235
+ * @param uri key
236
+ * @param num number to add
237
+ * @param targetService target service name (for service linkage)
238
+ * @return added number
239
+ */
240
+ addids: (uri: string, num: number, targetService?: string) => Promise<number | null>;
241
+ /**
242
+ * get a added number
243
+ * @param uri key
244
+ * @param targetService target service name (for service linkage)
245
+ * @return added number
246
+ */
247
+ getids: (uri: string, targetService?: string) => Promise<number | null>;
248
+ /**
249
+ * set a number
250
+ * @param uri key
251
+ * @param num number to set
252
+ * @param targetService target service name (for service linkage)
253
+ * @return set number
254
+ */
255
+ setids: (uri: string, num: number, targetService?: string) => Promise<number | null>;
256
+ /**
257
+ * set a addition range
258
+ * @param uri key
259
+ * @param range addition range
260
+ * @param targetService target service name (for service linkage)
261
+ * @return addition range
262
+ */
263
+ rangeids: (uri: string, range: string) => Promise<string>;
264
+ /**
265
+ * get a addition range
266
+ * @param uri key
267
+ * @param targetService target service name (for service linkage)
268
+ * @return addition range
269
+ */
270
+ getRangeids: (uri: string) => Promise<string>;
271
+ /**
272
+ * set feed to session
273
+ * @param name name
274
+ * @param feed entries (JSON)
275
+ * @return true if successful
276
+ */
277
+ setSessionFeed: (name: string, feed: any) => Promise<boolean>;
278
+ /**
279
+ * set entry to session
280
+ * @param name name
281
+ * @param entry entry (JSON)
282
+ * @return true if successful
283
+ */
284
+ setSessionEntry: (name: string, entry: any) => Promise<boolean>;
285
+ /**
286
+ * set string to session
287
+ * @param name name
288
+ * @param str string
289
+ * @return true if successful
290
+ */
291
+ setSessionString: (name: string, str: string) => Promise<boolean>;
292
+ /**
293
+ * set number to session
294
+ * @param name name
295
+ * @param num number
296
+ * @return true if successful
297
+ */
298
+ setSessionLong: (name: string, num: number) => Promise<boolean>;
299
+ /**
300
+ * add number in session
301
+ * @param name name
302
+ * @param num number to add
303
+ * @return true if successful
304
+ */
305
+ incrementSession: (name: string, num: number) => Promise<number | null>;
306
+ /**
307
+ * delete feed from session
308
+ * @param name name
309
+ * @return true if successful
310
+ */
311
+ deleteSessionFeed: (name: string) => Promise<boolean>;
312
+ /**
313
+ * delete entry from session
314
+ * @param name name
315
+ * @return true if successful
316
+ */
317
+ deleteSessionEntry: (name: string) => Promise<boolean>;
318
+ /**
319
+ * delete string from session
320
+ * @param name name
321
+ * @return true if successful
322
+ */
323
+ deleteSessionString: (name: string) => Promise<boolean>;
324
+ /**
325
+ * delete number from session
326
+ * @param name name
327
+ * @return true if successful
328
+ */
329
+ deleteSessionLong: (name: string) => Promise<boolean>;
330
+ /**
331
+ * get feed from session
332
+ * @param name name
333
+ * @return feed
334
+ */
335
+ getSessionFeed: (name: string) => Promise<any>;
336
+ /**
337
+ * get entry from session
338
+ * @param name name
339
+ * @return entry
340
+ */
341
+ getSessionEntry: (name: string) => Promise<any>;
342
+ /**
343
+ * get string from session
344
+ * @param name name
345
+ * @return string
346
+ */
347
+ getSessionString: (name: string) => Promise<string | null>;
348
+ /**
349
+ * get number from session
350
+ * @param name name
351
+ * @return number
352
+ */
353
+ getSessionLong: (name: string) => Promise<number | null>;
354
+ /**
355
+ * pagination
356
+ * @param uri key and conditions
357
+ * @param pagerange page range
358
+ * @param targetService target service name (for service linkage)
359
+ * @return feed Maximum number of pages in the specified page range, and total count.
360
+ */
361
+ pagination: (uri: string, pagerange: string, targetService?: string) => Promise<any>;
362
+ /**
363
+ * get page
364
+ * @param uri key and conditions
365
+ * @param num page number
366
+ * @param targetService target service name (for service linkage)
367
+ * @return feed Maximum number of pages in the specified page range, and total count.
368
+ */
369
+ getPage: (uri: string, num: number, targetService?: string) => Promise<any>;
370
+ /**
371
+ * post data to bigquery
372
+ * @param feed entries (JSON)
373
+ * @param async execute async
374
+ * @param tablenames key:entity's prop name, value:BigQuery table name
375
+ * @return true if successful
376
+ */
377
+ postBQ: (feed: any, async?: boolean, tablenames?: any) => Promise<boolean>;
378
+ /**
379
+ * delete data from bigquery
380
+ * @param keys delete keys
381
+ * @param async execute async
382
+ * @param tablenames key:entity's prop name, value:BigQuery table name
383
+ * @return true if successful
384
+ */
385
+ deleteBQ: (keys: string[], async?: boolean, tablenames?: any) => Promise<boolean>;
386
+ /**
387
+ * query bigquery
388
+ * @param sql query sql
389
+ * @param values values of query arguments
390
+ * @param parent parent name of result json
391
+ * @return query results in JSON format
392
+ */
393
+ getBQ: (sql: string, values?: any[], parent?: string) => Promise<any>;
394
+ /**
395
+ * query bigquery
396
+ * @param sql query sql
397
+ * @param values values of query arguments
398
+ * @param parent parent name of result json
399
+ * @return query results in JSON format
400
+ */
401
+ execBQ: (sql: string, values?: any[], parent?: string) => Promise<any>;
402
+ /**
403
+ * Search BigQuery and return results in CSV format.
404
+ * @param sql query sql
405
+ * @param values values of query arguments
406
+ * @param filename file name of csv
407
+ * @param parent parent name of result json
408
+ * @return true
409
+ */
410
+ getBQCsv: (sql: string, values?: any[], filename?: string, parent?: string) => Promise<boolean>;
411
+ /**
412
+ * Execute a query SQL to the database and get the result.
413
+ * @param sql query sql
414
+ * @param values values of query arguments
415
+ * @param parent parent name of result json
416
+ * @return query results in JSON format
417
+ */
418
+ queryRDB: (sql: string, values?: any[], parent?: string) => Promise<any>;
419
+ /**
420
+ * Search RDB and return results in CSV format.
421
+ * @param sql query sql
422
+ * @param values values of query arguments
423
+ * @param filename file name of csv
424
+ * @param parent parent name of result json
425
+ * @return true
426
+ */
427
+ queryRDBCsv: (sql: string, values?: any[], filename?: string, parent?: string) => Promise<boolean>;
428
+ /**
429
+ * Execute SQL to the database.
430
+ * If there are multiple SQLs, they will be wrapped in a transaction.
431
+ * @param sqls sql list
432
+ * @param values values of query arguments
433
+ * @param async execute async
434
+ * @param isbulk execute with autocommit
435
+ */
436
+ execRDB: (sqls: string[], values?: any[][], async?: boolean, isbulk?: boolean) => Promise<any>;
437
+ /**
438
+ * Create PDF.
439
+ * Writes a PDF to the response.
440
+ * @param htmlTemplate PDF layout
441
+ * @param filename PDF file name
442
+ * @return true
443
+ */
444
+ toPdf: (htmlTemplate: string, filename?: string) => Promise<boolean>;
445
+ /**
446
+ * put the signature of uri and revision.
447
+ * @param uri key
448
+ * @param revision revision
449
+ * @return signed entry
450
+ */
451
+ putSignature: (uri: string, revision?: number) => Promise<any>;
452
+ /**
453
+ * puts the signature of uri and revision.
454
+ * @param feed entries
455
+ * @return signed entries
456
+ */
457
+ putSignatures: (feed: any) => Promise<any>;
458
+ /**
459
+ * delete the signature.
460
+ * @param uri key
461
+ * @param revision revision
462
+ * @return true if successful
463
+ */
464
+ deleteSignature: (uri: string, revision?: number) => Promise<boolean>;
465
+ /**
466
+ * check the signature.
467
+ * @param uri key
468
+ * @return true if the signature is valid
469
+ */
470
+ checkSignature: (uri: string) => Promise<boolean>;
471
+ /**
472
+ * Send an mail (with attachments)
473
+ * @param entry email contents
474
+ * @param to email addresses to
475
+ * @param cc email addresses cc
476
+ * @param bcc email addresses bcc
477
+ * @param attachments keys of attachment files
478
+ * @return true if successful
479
+ */
480
+ sendMail: (entry: any, to: string[], cc?: string[], bcc?: string[], attachments?: string[]) => Promise<boolean>;
481
+ /**
482
+ * push notification to clients.
483
+ * @param message message
484
+ * @param to clients to
485
+ * @param title title
486
+ * @param subtitle subtitle (Expo)
487
+ * @param imageUrl url of image (FCM)
488
+ * @param data key value data (Expo)
489
+ * @return true if successful
490
+ */
491
+ pushNotification: (message: string, to: string[], title?: string, subtitle?: string, imageUrl?: string, data?: any) => Promise<boolean>;
492
+ /**
493
+ * set status of MessageQueue.
494
+ * @param flag true if on, false if off
495
+ * @param channel channel
496
+ */
497
+ setMessageQueueStatus: (flag: boolean, channel: string) => Promise<boolean>;
498
+ /**
499
+ * get status of MessageQueue.
500
+ * @param name name
501
+ * @return feed
502
+ */
503
+ getMessageQueueStatus: (channel: string) => Promise<any>;
504
+ /**
505
+ * set MessageQueue.
506
+ * @param feed entries (JSON)
507
+ * @param channel channel
508
+ * @return true if successful
509
+ */
510
+ setMessageQueue: (feed: any, channel: string) => Promise<boolean>;
511
+ /**
512
+ * get messageQueue.
513
+ * @param name name
514
+ * @return feed
515
+ */
516
+ getMessageQueue: (channel: string) => Promise<any>;
517
+ /**
518
+ * join to the group
519
+ * @param group group
520
+ * @param selfid hierarchical name under my group alias
521
+ * @return feed
522
+ */
523
+ joinGroup: (group: string, selfid: string) => Promise<any>;
524
+ /**
525
+ * leave from the group
526
+ * @param group group
527
+ * @return feed
528
+ */
529
+ leaveGroup: (group: string) => Promise<boolean>;
530
+ /**
531
+ * Get entries that have entries in a group, but are not in the group.
532
+ * (for entries with no signature or with an incorrect signature, if the user group requires a signature)
533
+ * @param uri group key
534
+ * @return feed (entry array)
535
+ */
536
+ noGroupMember: (uri: string) => Promise<any>;
537
+ /**
538
+ * Get groups
539
+ * @param uri group key
540
+ * @return feed (entry array)
541
+ */
542
+ getGroups: () => Promise<any>;
543
+ /**
544
+ * whether you are in the group
545
+ * @param uri group key
546
+ * @return true/false
547
+ */
548
+ isGroupMember: (uri: string) => Promise<boolean>;
549
+ /**
550
+ * whether you are in the admin group
551
+ * @return true/false
552
+ */
553
+ isAdmin: () => Promise<boolean>;
554
+ /**
555
+ * add user
556
+ * @param feed entry (JSON)
557
+ * @param reCaptchaToken reCAPTCHA token
558
+ * @return message feed
559
+ */
560
+ adduser: (feed: any, reCaptchaToken: string) => Promise<any>;
561
+ /**
562
+ * add user by user admin
563
+ * @param feed entries (JSON)
564
+ * @param reCaptchaToken reCAPTCHA token
565
+ * @return message feed
566
+ */
567
+ adduserByAdmin: (feed: any) => Promise<any>;
568
+ /**
569
+ * Send email for password reset
570
+ * @param feed entry (JSON)
571
+ * @param reCaptchaToken reCAPTCHA token
572
+ * @return message feed
573
+ */
574
+ passreset: (feed: any, reCaptchaToken?: string) => Promise<any>;
575
+ /**
576
+ * change password
577
+ * @param feed entry (JSON)
578
+ * @return message feed
579
+ */
580
+ changepass: (feed: any) => Promise<any>;
581
+ /**
582
+ * change password by user admin
583
+ * @param feed entry (JSON)
584
+ * @return message feed
585
+ */
586
+ changepassByAdmin: (feed: any) => Promise<any>;
587
+ /**
588
+ * change login user's account
589
+ * @param feed entries (JSON)
590
+ * @return message feed
591
+ */
592
+ changeaccount: (feed: any) => Promise<any>;
593
+ /**
594
+ * verify to change login user's account
595
+ * @param verifyCode verify code
596
+ * @return message feed
597
+ */
598
+ changeaccount_verify: (verifyCode: string) => Promise<any>;
599
+ /**
600
+ * get user status
601
+ * @param account account
602
+ * @return user status
603
+ */
604
+ userstatus: (account?: string) => Promise<any>;
605
+ /**
606
+ * revoke user
607
+ * @param account account
608
+ * @return message feed
609
+ */
610
+ revokeuser: (account: string) => Promise<any>;
611
+ /**
612
+ * revoke users
613
+ * @param feed entries (JSON)
614
+ * @return message feed
615
+ */
616
+ revokeusers: (feed: any) => Promise<any>;
617
+ /**
618
+ * activate user
619
+ * @param account account
620
+ * @return message feed
621
+ */
622
+ activateuser: (account: string) => Promise<any>;
623
+ /**
624
+ * activate users
625
+ * @param feed entries (JSON)
626
+ * @return message feed
627
+ */
628
+ activateusers: (feed: any) => Promise<any>;
629
+ /**
630
+ * cancel user.
631
+ * @param account account
632
+ * @return message feed
633
+ */
634
+ canceluser: () => Promise<any>;
635
+ /**
636
+ * delete user
637
+ * @param account account
638
+ * @return message feed
639
+ */
640
+ deleteuser: (account: string) => Promise<any>;
641
+ /**
642
+ * revoke users
643
+ * @param feed entries (JSON)
644
+ * @return message feed
645
+ */
646
+ deleteusers: (feed: any) => Promise<any>;
647
+ /**
648
+ * add acl
649
+ * @param feed entries
650
+ * @return message
651
+ */
652
+ addacl: (feed: any) => Promise<any>;
653
+ /**
654
+ * remove acl
655
+ * @param feed entries
656
+ * @return message
657
+ */
658
+ removeacl: (feed: any) => Promise<any>;
659
+ /**
660
+ * add alias
661
+ * @param feed entries
662
+ * @return message
663
+ */
664
+ addalias: (feed: any) => Promise<any>;
665
+ /**
666
+ * remove alias
667
+ * @param feed entries
668
+ * @return message
669
+ */
670
+ removealias: (feed: any) => Promise<any>;
671
+ /**
672
+ * get content url.
673
+ * @param uri key
674
+ * @return content url
675
+ */
676
+ getcontenturl: (uri: string) => Promise<string>;
677
+ /**
678
+ * save files
679
+ * @param uri key
680
+ * @returns message
681
+ */
682
+ savefiles: (uri: string) => Promise<any>;
683
+ /**
684
+ * upload content
685
+ * @param uri key
686
+ * @return message
687
+ */
688
+ putcontent: (uri: string) => Promise<any>;
689
+ /**
690
+ * delete content
691
+ * @param uri key
692
+ * @return message
693
+ */
694
+ deletecontent: (uri: string) => Promise<any>;
695
+ /**
696
+ * get content.
697
+ * Writes a content to the response.
698
+ * @param uri key
699
+ * @return true
700
+ */
701
+ getcontent: (uri: string) => Promise<boolean>;
702
+ /**
703
+ * OAuth authorization request to LINE.
704
+ * If the OAuth request is successful, this module retains the redirect information.
705
+ */
706
+ oauthLine: () => Promise<boolean>;
707
+ /**
708
+ * OAuth authorization request to LINE
709
+ */
710
+ oauthCallbackLine: () => Promise<boolean>;
711
+ /**
712
+ * get TOTP link
713
+ * @param chs length of one side of QR code
714
+ * @return QR code URL in feed.title
715
+ */
716
+ getTotpLink: (chs?: number) => Promise<any>;
717
+ /**
718
+ * create TOTP
719
+ * @param feed one-time password for feed.title when you do book registration
720
+ * @return message
721
+ */
722
+ createTotp: (feed: any) => Promise<any>;
723
+ /**
724
+ * delete TOTP
725
+ * @param account target account (for service admin user)
726
+ * @return message
727
+ */
728
+ deleteTotp: (account?: string) => Promise<any>;
729
+ /**
730
+ * change TDID (Trusted device ID)
731
+ * @param account target account (for service admin user)
732
+ * @return message
733
+ */
734
+ changeTdid: () => Promise<any>;
735
+ /**
736
+ * Merge an existing user with an line oauth user.
737
+ * @param rxid RXID
738
+ * @return message feed
739
+ */
740
+ mergeOAuthUserLine: (rxid: string) => Promise<any>;
741
+ /**
742
+ * vte.cxへリクエスト
743
+ * @param method メソッド
744
+ * @param url サーブレットパス以降のURL
745
+ * @param req リクエスト。認証情報設定に使用。
746
+ * @param body リクエストデータ
747
+ * @param additionalHeaders リクエストヘッダ追加分
748
+ * @param targetService 連携サービス名
749
+ * @param mode RequestMode ("cors" | "navigate" | "no-cors" | "same-origin")
750
+ * @returns promise
751
+ */
752
+ private requestVtecx;
753
+ /**
754
+ * vte.cxからのset-cookieを、ブラウザへレスポンスする。
755
+ * @param response vte.cxからのレスポンス
756
+ */
757
+ private setCookie;
758
+ /**
759
+ * vte.cxからのレスポンスヘッダを、ブラウザへレスポンスする。
760
+ * コンテンツの戻し時に使用。
761
+ * @param response vte.cxからのレスポンス
762
+ * @param res ブラウザへのレスポンス
763
+ */
764
+ private setResponseHeaders;
765
+ /**
766
+ * OAuth authorization request
767
+ * @param provider OAuth provider name
768
+ * @param oauthUrl OAuth authorization request url
769
+ * @return true
770
+ */
771
+ private oauth;
772
+ /**
773
+ * OAuth authorization request
774
+ * @param provider OAuth provider name
775
+ * @param oauthUrl OAuth get accesstoken request url
776
+ * @return {'client_id', 'client_secret', 'redirect_uri', 'state', 'access_token'}
777
+ */
778
+ private oauthGetAccesstoken;
779
+ /**
780
+ * OAuth get userinfo request
781
+ * @param oauthInfo OAuth info {'client_id', 'client_secret', 'redirect_uri', 'state', 'access_token'}
782
+ * @return userinfo {'guid', 'nickname', 'state'}
783
+ */
784
+ private oauthGetUserinfoLine;
785
+ /**
786
+ * OAuth user link.
787
+ * @param provider OAuth provider name
788
+ * @param userInfo user info
789
+ * @return true if log in has been successful.
790
+ */
791
+ private oauthLink;
792
+ /**
793
+ * Merge an existing user with an oauth user.
794
+ * @param provider OAuth provider name
795
+ * @param rxid RXID
796
+ * @return message feed
797
+ */
798
+ private mergeOAuthUser;
799
+ }
880
800
  /**
881
801
  * response class
882
802
  */