@vtecx/vtecxnext 1.1.12 → 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,876 +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
- * @param async execute async
470
- * @param isbulk execute with autocommit
471
- */
472
- export declare const execRDB: (req: IncomingMessage, res: ServerResponse, sqls: string[], values?: any[][], async?: boolean, isbulk?: boolean) => Promise<any>;
473
- /**
474
- * Create PDF.
475
- * Writes a PDF to the response.
476
- * @param req request (for authentication)
477
- * @param res response
478
- * @param htmlTemplate PDF layout
479
- * @param filename PDF file name
480
- * @return true
481
- */
482
- export declare const toPdf: (req: IncomingMessage, res: ServerResponse, htmlTemplate: string, filename?: string) => Promise<boolean>;
483
- /**
484
- * put the signature of uri and revision.
485
- * @param req request (for authentication)
486
- * @param res response (for authentication)
487
- * @param uri key
488
- * @param revision revision
489
- * @return signed entry
490
- */
491
- export declare const putSignature: (req: IncomingMessage, res: ServerResponse, uri: string, revision?: number) => Promise<any>;
492
- /**
493
- * puts the signature of uri and revision.
494
- * @param req request (for authentication)
495
- * @param res response (for authentication)
496
- * @param feed entries
497
- * @return signed entries
498
- */
499
- export declare const putSignatures: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
500
- /**
501
- * delete the signature.
502
- * @param req request (for authentication)
503
- * @param res response (for authentication)
504
- * @param uri key
505
- * @param revision revision
506
- * @return true if successful
507
- */
508
- export declare const deleteSignature: (req: IncomingMessage, res: ServerResponse, uri: string, revision?: number) => Promise<boolean>;
509
- /**
510
- * check the signature.
511
- * @param req request (for authentication)
512
- * @param res response (for authentication)
513
- * @param uri key
514
- * @return true if the signature is valid
515
- */
516
- export declare const checkSignature: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<boolean>;
517
- /**
518
- * Send an mail (with attachments)
519
- * @param req request (for authentication)
520
- * @param res response (for authentication)
521
- * @param entry email contents
522
- * @param to email addresses to
523
- * @param cc email addresses cc
524
- * @param bcc email addresses bcc
525
- * @param attachments keys of attachment files
526
- * @return true if successful
527
- */
528
- export declare const sendMail: (req: IncomingMessage, res: ServerResponse, entry: any, to: string[], cc?: string[], bcc?: string[], attachments?: string[]) => Promise<boolean>;
529
- /**
530
- * push notification to clients.
531
- * @param req request (for authentication)
532
- * @param res response (for authentication)
533
- * @param message message
534
- * @param to clients to
535
- * @param title title
536
- * @param subtitle subtitle (Expo)
537
- * @param imageUrl url of image (FCM)
538
- * @param data key value data (Expo)
539
- * @return true if successful
540
- */
541
- export declare const pushNotification: (req: IncomingMessage, res: ServerResponse, message: string, to: string[], title?: string, subtitle?: string, imageUrl?: string, data?: any) => Promise<boolean>;
542
- /**
543
- * set status of MessageQueue.
544
- * @param req request (for authentication)
545
- * @param res response (for authentication)
546
- * @param flag true if on, false if off
547
- * @param channel channel
548
- */
549
- export declare const setMessageQueueStatus: (req: IncomingMessage, res: ServerResponse, flag: boolean, channel: string) => Promise<boolean>;
550
- /**
551
- * get status of MessageQueue.
552
- * @param req request (for authentication)
553
- * @param res response (for authentication)
554
- * @param name name
555
- * @return feed
556
- */
557
- export declare const getMessageQueueStatus: (req: IncomingMessage, res: ServerResponse, channel: string) => Promise<any>;
558
- /**
559
- * set MessageQueue.
560
- * @param req request (for authentication)
561
- * @param res response (for authentication)
562
- * @param feed entries (JSON)
563
- * @param channel channel
564
- * @return true if successful
565
- */
566
- export declare const setMessageQueue: (req: IncomingMessage, res: ServerResponse, feed: any, channel: string) => Promise<boolean>;
567
- /**
568
- * get messageQueue.
569
- * @param req request (for authentication)
570
- * @param res response (for authentication)
571
- * @param name name
572
- * @return feed
573
- */
574
- export declare const getMessageQueue: (req: IncomingMessage, res: ServerResponse, channel: string) => Promise<any>;
575
- /**
576
- * join to the group
577
- * @param req request (for authentication)
578
- * @param res response (for authentication)
579
- * @param group group
580
- * @param selfid hierarchical name under my group alias
581
- * @return feed
582
- */
583
- export declare const joinGroup: (req: IncomingMessage, res: ServerResponse, group: string, selfid: string) => Promise<any>;
584
- /**
585
- * leave from the group
586
- * @param req request (for authentication)
587
- * @param res response (for authentication)
588
- * @param group group
589
- * @return feed
590
- */
591
- export declare const leaveGroup: (req: IncomingMessage, res: ServerResponse, group: string) => Promise<boolean>;
592
- /**
593
- * Get entries that have entries in a group, but are not in the group.
594
- * (for entries with no signature or with an incorrect signature, if the user group requires a signature)
595
- * @param req request (for authentication)
596
- * @param res response (for authentication)
597
- * @param uri group key
598
- * @return feed (entry array)
599
- */
600
- export declare const noGroupMember: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
601
- /**
602
- * Get groups
603
- * @param req request (for authentication)
604
- * @param res response (for authentication)
605
- * @param uri group key
606
- * @return feed (entry array)
607
- */
608
- export declare const getGroups: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
609
- /**
610
- * whether you are in the group
611
- * @param req request (for authentication)
612
- * @param res response (for authentication)
613
- * @param uri group key
614
- * @return true/false
615
- */
616
- export declare const isGroupMember: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<boolean>;
617
- /**
618
- * whether you are in the admin group
619
- * @param req request (for authentication)
620
- * @param res response (for authentication)
621
- * @return true/false
622
- */
623
- export declare const isAdmin: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
624
- /**
625
- * add user
626
- * @param req request (for authentication)
627
- * @param res response (for authentication)
628
- * @param feed entry (JSON)
629
- * @param reCaptchaToken reCAPTCHA token
630
- * @return message feed
631
- */
632
- export declare const adduser: (req: IncomingMessage, res: ServerResponse, feed: any, reCaptchaToken: string) => Promise<any>;
633
- /**
634
- * add user by user admin
635
- * @param req request (for authentication)
636
- * @param res response (for authentication)
637
- * @param feed entries (JSON)
638
- * @param reCaptchaToken reCAPTCHA token
639
- * @return message feed
640
- */
641
- export declare const adduserByAdmin: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
642
- /**
643
- * Send email for password reset
644
- * @param req request (for authentication)
645
- * @param res response (for authentication)
646
- * @param feed entry (JSON)
647
- * @param reCaptchaToken reCAPTCHA token
648
- * @return message feed
649
- */
650
- export declare const passreset: (req: IncomingMessage, res: ServerResponse, feed: any, reCaptchaToken?: string) => Promise<any>;
651
- /**
652
- * change password
653
- * @param req request (for authentication)
654
- * @param res response (for authentication)
655
- * @param feed entry (JSON)
656
- * @return message feed
657
- */
658
- export declare const changepass: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
659
- /**
660
- * change password by user admin
661
- * @param req request (for authentication)
662
- * @param res response (for authentication)
663
- * @param feed entry (JSON)
664
- * @return message feed
665
- */
666
- export declare const changepassByAdmin: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
667
- /**
668
- * change login user's account
669
- * @param req request (for authentication)
670
- * @param res response (for authentication)
671
- * @param feed entries (JSON)
672
- * @return message feed
673
- */
674
- export declare const changeaccount: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
675
- /**
676
- * verify to change login user's account
677
- * @param req request (for authentication)
678
- * @param res response (for authentication)
679
- * @param verifyCode verify code
680
- * @return message feed
681
- */
682
- export declare const changeaccount_verify: (req: IncomingMessage, res: ServerResponse, verifyCode: string) => Promise<any>;
683
- /**
684
- * get user status
685
- * @param req request (for authentication)
686
- * @param res response (for authentication)
687
- * @param account account
688
- * @return user status
689
- */
690
- export declare const userstatus: (req: IncomingMessage, res: ServerResponse, account?: string) => Promise<any>;
691
- /**
692
- * revoke user
693
- * @param req request (for authentication)
694
- * @param res response (for authentication)
695
- * @param account account
696
- * @return message feed
697
- */
698
- export declare const revokeuser: (req: IncomingMessage, res: ServerResponse, account: string) => Promise<any>;
699
- /**
700
- * revoke users
701
- * @param req request (for authentication)
702
- * @param res response (for authentication)
703
- * @param feed entries (JSON)
704
- * @return message feed
705
- */
706
- export declare const revokeusers: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
707
- /**
708
- * activate user
709
- * @param req request (for authentication)
710
- * @param res response (for authentication)
711
- * @param account account
712
- * @return message feed
713
- */
714
- export declare const activateuser: (req: IncomingMessage, res: ServerResponse, account: string) => Promise<any>;
715
- /**
716
- * activate users
717
- * @param req request (for authentication)
718
- * @param res response (for authentication)
719
- * @param feed entries (JSON)
720
- * @return message feed
721
- */
722
- export declare const activateusers: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
723
- /**
724
- * cancel user.
725
- * @param req request (for authentication)
726
- * @param res response (for authentication)
727
- * @param account account
728
- * @return message feed
729
- */
730
- export declare const canceluser: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
731
- /**
732
- * delete user
733
- * @param req request (for authentication)
734
- * @param res response (for authentication)
735
- * @param account account
736
- * @return message feed
737
- */
738
- export declare const deleteuser: (req: IncomingMessage, res: ServerResponse, account: string) => Promise<any>;
739
- /**
740
- * revoke users
741
- * @param req request (for authentication)
742
- * @param res response (for authentication)
743
- * @param feed entries (JSON)
744
- * @return message feed
745
- */
746
- export declare const deleteusers: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
747
- /**
748
- * save files
749
- * @param req request
750
- * @param res respose (for authentication)
751
- * @param uri key
752
- * @returns message
753
- */
754
- export declare const savefiles: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
755
- /**
756
- * upload content
757
- * @param req request (for authentication)
758
- * @param res response (for authentication)
759
- * @param uri key
760
- * @return message
761
- */
762
- export declare const putcontent: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
763
- /**
764
- * delete content
765
- * @param req request (for authentication)
766
- * @param res response (for authentication)
767
- * @param uri key
768
- * @return message
769
- */
770
- export declare const deletecontent: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<any>;
771
- /**
772
- * get content.
773
- * Writes a content to the response.
774
- * @param req request (for authentication)
775
- * @param res response (for authentication)
776
- * @param uri key
777
- * @return true
778
- */
779
- export declare const getcontent: (req: IncomingMessage, res: ServerResponse, uri: string) => Promise<boolean>;
780
- /**
781
- * get content url.
782
- * @param uri key
783
- * @return content url
784
- */
785
- export declare const getcontenturl: (uri: string) => Promise<string>;
786
- /**
787
- * add acl
788
- * @param req request (for authentication)
789
- * @param res response (for authentication)
790
- * @param feed entries
791
- * @return message
792
- */
793
- export declare const addacl: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
794
- /**
795
- * remove acl
796
- * @param req request (for authentication)
797
- * @param res response (for authentication)
798
- * @param feed entries
799
- * @return message
800
- */
801
- export declare const removeacl: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
802
- /**
803
- * add alias
804
- * @param req request (for authentication)
805
- * @param res response (for authentication)
806
- * @param feed entries
807
- * @return message
808
- */
809
- export declare const addalias: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
810
- /**
811
- * remove alias
812
- * @param req request (for authentication)
813
- * @param res response (for authentication)
814
- * @param feed entries
815
- * @return message
816
- */
817
- export declare const removealias: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
818
- /**
819
- * OAuth authorization request to LINE
820
- * @param req request (for authentication)
821
- * @param res response (for authentication)
822
- */
823
- export declare const oauthLine: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
824
- /**
825
- * OAuth authorization request to LINE
826
- * @param req request (for authentication)
827
- * @param res response (for authentication)
828
- */
829
- export declare const oauthCallbackLine: (req: IncomingMessage, res: ServerResponse) => Promise<boolean>;
830
- /**
831
- * get binary data from stream
832
- * @param readable Readable
833
- * @returns buffer
834
- */
835
- export declare const buffer: (readable: Readable) => Promise<Buffer>;
836
- /**
837
- * get TOTP link
838
- * @param req request (for authentication)
839
- * @param res response (for authentication)
840
- * @param chs length of one side of QR code
841
- * @return QR code URL in feed.title
842
- */
843
- export declare const getTotpLink: (req: IncomingMessage, res: ServerResponse, chs?: number) => Promise<any>;
844
- /**
845
- * create TOTP
846
- * @param req request (for authentication)
847
- * @param res response (for authentication)
848
- * @param feed one-time password for feed.title when you do book registration
849
- * @return message
850
- */
851
- export declare const createTotp: (req: IncomingMessage, res: ServerResponse, feed: any) => Promise<any>;
852
- /**
853
- * delete TOTP
854
- * @param req request (for authentication)
855
- * @param res response (for authentication)
856
- * @param account target account (for service admin user)
857
- * @return message
858
- */
859
- export declare const deleteTotp: (req: IncomingMessage, res: ServerResponse, account?: string) => Promise<any>;
860
- /**
861
- * change TDID (Trusted device ID)
862
- * @param req request (for authentication)
863
- * @param res response (for authentication)
864
- * @param account target account (for service admin user)
865
- * @return message
866
- */
867
- export declare const changeTdid: (req: IncomingMessage, res: ServerResponse) => Promise<any>;
868
- /**
869
- * Merge an existing user with an line oauth user.
870
- * @param req request (for authentication)
871
- * @param res response (for authentication)
872
- * @param rxid RXID
873
- * @return message feed
874
- */
875
- export declare const mergeOAuthUserLine: (req: IncomingMessage, res: ServerResponse, rxid: string) => Promise<any>;
876
- /**
877
- * null、undefined、空文字の判定
878
- * @param val チェック値
879
- * @returns null、undefined、空文字の場合true
880
- */
881
- 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
+ }
882
800
  /**
883
801
  * response class
884
802
  */