@vtecx/vtecxdocument 1.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.
@@ -0,0 +1,243 @@
1
+ # データ操作
2
+
3
+ エントリの取得・登録・更新・削除・ページネーションを行うメソッド群。
4
+
5
+ ---
6
+
7
+ ## データ取得
8
+
9
+ ### `getEntry(uri, targetService?)`
10
+
11
+ ```typescript
12
+ getEntry(uri: string, targetService?: string): Promise<any>
13
+ ```
14
+
15
+ 指定した URI のエントリを 1 件取得する。データが存在しない場合は `null` / `undefined`(204)を返す。
16
+
17
+ ```typescript
18
+ const entry = await vtecxnext.getEntry('/crm/customer/0000000001')
19
+ if (entry == null) {
20
+ // データなし(204)
21
+ }
22
+ ```
23
+
24
+ | 引数 | 型 | 説明 |
25
+ | --- | --- | --- |
26
+ | `uri` | `string` | エントリの URI |
27
+ | `targetService` | `string?` | 連携サービス名(省略可) |
28
+
29
+ ---
30
+
31
+ ### `getFeed(uri, targetService?)`
32
+
33
+ ```typescript
34
+ getFeed(uri: string, targetService?: string): Promise<any>
35
+ ```
36
+
37
+ 指定した URI 配下のエントリ一覧を取得する。データが存在しない場合は `null` / `undefined`(204)を返す。
38
+
39
+ ```typescript
40
+ const entries = await vtecxnext.getFeed('/crm/customer')
41
+ ```
42
+
43
+ ---
44
+
45
+ ### `getFeedResponse(uri, targetService?)`
46
+
47
+ ```typescript
48
+ getFeedResponse(uri: string, targetService?: string): Promise<VtecxResponse>
49
+ ```
50
+
51
+ `getFeed` と同様だが、ステータスコードやヘッダを含む `VtecxResponse` 形式で返す。
52
+
53
+ ---
54
+
55
+ ### `count(uri, targetService?)`
56
+
57
+ ```typescript
58
+ count(uri: string, targetService?: string): Promise<number | null>
59
+ ```
60
+
61
+ 検索条件にマッチするエントリの件数を返す。
62
+
63
+ ```typescript
64
+ const total = await vtecxnext.count('/crm/customer?f&customer.status-eq-active')
65
+ ```
66
+
67
+ ---
68
+
69
+ ### `countResponse(uri, targetService?)`
70
+
71
+ ```typescript
72
+ countResponse(uri: string, targetService?: string): Promise<VtecxResponse>
73
+ ```
74
+
75
+ `count` と同様だが `VtecxResponse` 形式で返す。
76
+
77
+ ---
78
+
79
+ ## データ登録・更新
80
+
81
+ ### `post(feed, uri?, targetService?)`
82
+
83
+ ```typescript
84
+ post(feed: any, uri?: string, targetService?: string): Promise<any>
85
+ ```
86
+
87
+ エントリを新規登録する。ID は vte.cx が自動採番する。
88
+
89
+ | 引数 | 型 | 説明 |
90
+ | --- | --- | --- |
91
+ | `feed` | `any` | 登録する feed データ |
92
+ | `uri` | `string?` | 親フォルダの URI(省略可) |
93
+ | `targetService` | `string?` | 連携サービス名(省略可) |
94
+
95
+ ---
96
+
97
+ ### `put(feed, isbulk?, parallel?, async?, targetService?)`
98
+
99
+ ```typescript
100
+ put(
101
+ feed: any,
102
+ isbulk?: boolean,
103
+ parallel?: boolean,
104
+ async?: boolean,
105
+ targetService?: string
106
+ ): Promise<any>
107
+ ```
108
+
109
+ エントリを登録・更新する。複数エントリを 1 回の呼び出しにまとめること。
110
+
111
+ ```typescript
112
+ await vtecxnext.put({
113
+ feed: {
114
+ entry: [
115
+ {
116
+ link: [{ ___rel: 'self', ___href: '/crm/customer/001' }],
117
+ customer: { name: '株式会社テスト' },
118
+ contributor: [{ uri: 'urn:vte.cx:acl:/_group/$admin,CURD' }],
119
+ },
120
+ ],
121
+ },
122
+ })
123
+ ```
124
+
125
+ | 引数 | 型 | 説明 |
126
+ | --- | --- | --- |
127
+ | `feed` | `any` | 登録・更新する feed データ |
128
+ | `isbulk` | `boolean?` | 大量データフラグ(省略可) |
129
+ | `parallel` | `boolean?` | 並列処理フラグ(省略可) |
130
+ | `async` | `boolean?` | 非同期処理フラグ(省略可) |
131
+ | `targetService` | `string?` | 連携サービス名(省略可) |
132
+
133
+ ---
134
+
135
+ ## データ削除
136
+
137
+ ### `deleteEntry(uri, revision?, targetService?)`
138
+
139
+ ```typescript
140
+ deleteEntry(uri: string, revision?: number, targetService?: string): Promise<boolean>
141
+ ```
142
+
143
+ 指定した URI のエントリを 1 件削除する。
144
+
145
+ | 引数 | 型 | 説明 |
146
+ | --- | --- | --- |
147
+ | `uri` | `string` | 削除するエントリの URI |
148
+ | `revision` | `number?` | リビジョン番号(楽観的排他制御。省略時は強制削除) |
149
+ | `targetService` | `string?` | 連携サービス名(省略可) |
150
+
151
+ ---
152
+
153
+ ### `deleteEntries(feed, isbulk?, parallel?, async?, targetService?)`
154
+
155
+ ```typescript
156
+ deleteEntries(feed: any, isbulk?: boolean, parallel?: boolean, async?: boolean, targetService?: string): Promise<boolean>
157
+ ```
158
+
159
+ 複数エントリを一括削除する。
160
+
161
+ ---
162
+
163
+ ### `deleteFolder(uri, async?, targetService?)`
164
+
165
+ ```typescript
166
+ deleteFolder(uri: string, async?: boolean, targetService?: string): Promise<boolean>
167
+ ```
168
+
169
+ フォルダとその配下のエントリをすべて削除する。
170
+
171
+ ---
172
+
173
+ ### `clearFolder(uri, async?, targetService?)`
174
+
175
+ ```typescript
176
+ clearFolder(uri: string, async?: boolean, targetService?: string): Promise<boolean>
177
+ ```
178
+
179
+ フォルダ自体は残し、配下のエントリをすべて削除する。
180
+
181
+ ---
182
+
183
+ ## ページネーション
184
+
185
+ vte.cx のページネーションは 2 ステップ方式。`getPageWithPagination` がこれを自動処理する。
186
+
187
+ ### `getPageWithPagination(uri, num, targetService?)`
188
+
189
+ ```typescript
190
+ getPageWithPagination(uri: string, num: number, targetService?: string): Promise<any>
191
+ ```
192
+
193
+ `num=1` のとき自動的に `pagination()` を呼び出してカーソルを作成し、指定ページのデータを返す。データなしの場合は `undefined`。
194
+
195
+ ```typescript
196
+ const n = parseInt(vtecxnext.getParameter('n') ?? '1', 10)
197
+ const entries = await vtecxnext.getPageWithPagination('/crm/customer?l=25', n)
198
+ ```
199
+
200
+ ---
201
+
202
+ ### `pagination(uri, pagerange, targetService?)`
203
+
204
+ ```typescript
205
+ pagination(uri: string, pagerange: string, targetService?: string): Promise<PaginationInfo>
206
+ ```
207
+
208
+ カーソルリスト(pageindex)を作成する。`pagerange` は `"1,50"` の形式。
209
+
210
+ ```typescript
211
+ const info = await vtecxnext.pagination('/crm/customer?l=25', '1,50')
212
+ // info.lastPageNumber: 最終ページ番号(0 = データなし)
213
+ // info.hasNext: true = 50ページ以降にもデータがある
214
+ ```
215
+
216
+ ---
217
+
218
+ ### `getPage(uri, num, targetService?)`
219
+
220
+ ```typescript
221
+ getPage(uri: string, num: number, targetService?: string): Promise<any>
222
+ ```
223
+
224
+ 作成済みカーソルを使って指定ページのデータを取得する。`pagination()` 実行後に使用。
225
+
226
+ ---
227
+
228
+ ## 型定義
229
+
230
+ ```typescript
231
+ type VtecxResponse = {
232
+ status: number
233
+ header: any
234
+ data: any
235
+ }
236
+
237
+ type PaginationInfo = {
238
+ lastPageNumber: number // 最終ページ番号(0 = データなし)
239
+ countWithinRange: number // 指定ページ範囲内のエントリ数
240
+ hasNext: boolean // true = endPage を超えるデータが存在する
241
+ isMemorysort: boolean // メモリソートモードかどうか
242
+ }
243
+ ```
package/docs/api/db.md ADDED
@@ -0,0 +1,148 @@
1
+ # 外部DB連携
2
+
3
+ BigQuery・RDB(リレーショナルDB)との連携を行うメソッド群。
4
+
5
+ SQL には `?` プレースホルダを使い、`values` でバインド値を渡す。
6
+
7
+ ---
8
+
9
+ ## BigQuery(クエリ実行)
10
+
11
+ ### `getBQ(sql, values?, parent?)`
12
+
13
+ ```typescript
14
+ getBQ(sql: string, values?: any[], parent?: string): Promise<any>
15
+ ```
16
+
17
+ BigQuery に SELECT クエリを実行し、結果を取得する。
18
+
19
+ ```typescript
20
+ const result = await vtecxnext.getBQ(
21
+ 'SELECT * FROM `dataset.table` WHERE status = ? LIMIT 100',
22
+ ['active']
23
+ )
24
+ ```
25
+
26
+ ---
27
+
28
+ ### `execBQ(sql, values?, parent?)`
29
+
30
+ ```typescript
31
+ execBQ(sql: string, values?: any[], parent?: string): Promise<any>
32
+ ```
33
+
34
+ BigQuery に INSERT / UPDATE / DELETE などのクエリを実行する。
35
+
36
+ ---
37
+
38
+ ### `getBQCsv(sql, values?, filename?, parent?)`
39
+
40
+ ```typescript
41
+ getBQCsv(sql: string, values?: any[], filename?: string, parent?: string): Promise<boolean>
42
+ ```
43
+
44
+ BigQuery クエリの結果を CSV としてレスポンスへ出力する。成功したかどうかを `boolean` で返す。
45
+
46
+ ---
47
+
48
+ ## BigQuery(エントリ連携)
49
+
50
+ vte.cx のエントリを BigQuery にエクスポート・削除する。`tablenames` でエンティティとテーブルの対応を指定する。
51
+
52
+ ### `postBQ(feed, async?, tablenames?)`
53
+
54
+ ```typescript
55
+ postBQ(feed: any, async?: boolean, tablenames?: any): Promise<boolean>
56
+ ```
57
+
58
+ feed のエントリを BigQuery に登録する。
59
+
60
+ ---
61
+
62
+ ### `deleteBQ(keys, async?, tablenames?)`
63
+
64
+ ```typescript
65
+ deleteBQ(keys: string[], async?: boolean, tablenames?: any): Promise<boolean>
66
+ ```
67
+
68
+ 指定したキー(URI)のエントリを BigQuery から削除する。
69
+
70
+ ---
71
+
72
+ ## BigQuery DB(BDBQ)
73
+
74
+ vte.cx データストアと BigQuery を同時に更新する機能。
75
+
76
+ ### `postBDBQ(feed, uri?, tablenames?, async?)`
77
+
78
+ ```typescript
79
+ postBDBQ(feed: any, uri?: string, tablenames?: any, async?: boolean): Promise<any>
80
+ ```
81
+
82
+ エントリをデータストアと BigQuery に新規登録する。
83
+
84
+ ---
85
+
86
+ ### `putBDBQ(feed, uri?, tablenames?, async?, isbulk?)`
87
+
88
+ ```typescript
89
+ putBDBQ(feed: any, uri?: string, tablenames?: any, async?: boolean, isbulk?: boolean): Promise<any>
90
+ ```
91
+
92
+ エントリをデータストアと BigQuery で更新する。
93
+
94
+ ---
95
+
96
+ ### `deleteBDBQ(keys, tablenames?, async?)`
97
+
98
+ ```typescript
99
+ deleteBDBQ(keys: string[], tablenames?: any, async?: boolean): Promise<boolean>
100
+ ```
101
+
102
+ 指定したキー(URI)のエントリをデータストアと BigQuery から削除する。
103
+
104
+ ---
105
+
106
+ ## RDB(リレーショナルDB)
107
+
108
+ ### `queryRDB(sql, values?, parent?)`
109
+
110
+ ```typescript
111
+ queryRDB(sql: string, values?: any[], parent?: string): Promise<any>
112
+ ```
113
+
114
+ RDB に SELECT クエリを実行し、結果を返す。
115
+
116
+ ```typescript
117
+ const rows = await vtecxnext.queryRDB(
118
+ 'SELECT * FROM customers WHERE status = ?',
119
+ ['active']
120
+ )
121
+ ```
122
+
123
+ ---
124
+
125
+ ### `queryRDBCsv(sql, values?, filename?, parent?)`
126
+
127
+ ```typescript
128
+ queryRDBCsv(sql: string, values?: any[], filename?: string, parent?: string): Promise<boolean>
129
+ ```
130
+
131
+ RDB クエリの結果を CSV としてレスポンスへ出力する。成功したかどうかを `boolean` で返す。
132
+
133
+ ---
134
+
135
+ ### `execRDB(sqls, values?, async?, isbulk?)`
136
+
137
+ ```typescript
138
+ execRDB(sqls: string[], values?: any[][], async?: boolean, isbulk?: boolean): Promise<any>
139
+ ```
140
+
141
+ RDB に複数の INSERT / UPDATE / DELETE を実行する。`sqls` は SQL の配列、`values` はそれぞれに対応するバインド値の配列。
142
+
143
+ ```typescript
144
+ await vtecxnext.execRDB(
145
+ ['UPDATE customers SET status = ? WHERE id = ?'],
146
+ [['inactive', customerId]]
147
+ )
148
+ ```
@@ -0,0 +1,151 @@
1
+ # グループ管理
2
+
3
+ ユーザーのグループ参加・脱退・管理者操作などを行うメソッド群。
4
+
5
+ グループは `folderacls.json` に事前登録が必要。詳細は [framework.md](../framework.md#グループ管理) を参照。
6
+
7
+ ---
8
+
9
+ ## グループ参加・脱退
10
+
11
+ ### `addGroup(group, selfid?)`
12
+
13
+ ```typescript
14
+ addGroup(group: string, selfid?: string): Promise<any>
15
+ ```
16
+
17
+ 自分自身をグループに登録する。グループが存在しない場合は作成される。
18
+
19
+ ```typescript
20
+ await vtecxnext.addGroup('/_group/sales')
21
+ ```
22
+
23
+ ---
24
+
25
+ ### `joinGroup(group, selfid?)`
26
+
27
+ ```typescript
28
+ joinGroup(group: string, selfid?: string): Promise<any>
29
+ ```
30
+
31
+ 管理者から招待されたグループへの参加を確認する。
32
+
33
+ ---
34
+
35
+ ### `leaveGroup(group)`
36
+
37
+ ```typescript
38
+ leaveGroup(group: string): Promise<boolean>
39
+ ```
40
+
41
+ 自分自身をグループから脱退させる。
42
+
43
+ ---
44
+
45
+ ## 管理者によるグループ操作
46
+
47
+ ### `addGroupByAdmin(uids, group, selfid?)`
48
+
49
+ ```typescript
50
+ addGroupByAdmin(uids: string[], group: string, selfid?: string): Promise<any>
51
+ ```
52
+
53
+ 管理者権限で指定ユーザー(複数)をグループに追加する。
54
+
55
+ ```typescript
56
+ await vtecxnext.addGroupByAdmin(['uid1', 'uid2'], '/_group/sales')
57
+ ```
58
+
59
+ ---
60
+
61
+ ### `leaveGroupByAdmin(uids, group)`
62
+
63
+ ```typescript
64
+ leaveGroupByAdmin(uids: string[], group: string): Promise<any>
65
+ ```
66
+
67
+ 管理者権限で指定ユーザーをグループから削除する。
68
+
69
+ ---
70
+
71
+ ### `noGroupMember(uri)`
72
+
73
+ ```typescript
74
+ noGroupMember(uri: string): Promise<any>
75
+ ```
76
+
77
+ グループに登録されているが、正式なメンバーになっていないエントリの一覧を取得する(グループが署名を要求する場合に、署名が無い/不正なエントリが対象)。
78
+
79
+ ---
80
+
81
+ ## グループ情報取得
82
+
83
+ ### `getGroups()`
84
+
85
+ ```typescript
86
+ getGroups(): Promise<string[] | null>
87
+ ```
88
+
89
+ ログインユーザーが所属するグループ名の一覧を取得する。所属がない場合は `null`。
90
+
91
+ ```typescript
92
+ const groups = await vtecxnext.getGroups()
93
+ ```
94
+
95
+ ---
96
+
97
+ ### `isGroupMember(uri)`
98
+
99
+ ```typescript
100
+ isGroupMember(uri: string): Promise<boolean>
101
+ ```
102
+
103
+ ログイン中のユーザーが指定グループに所属しているかどうかを返す。
104
+
105
+ ```typescript
106
+ const isSales = await vtecxnext.isGroupMember('/_group/sales')
107
+ // true: 所属, false: 非所属
108
+ ```
109
+
110
+ ---
111
+
112
+ ### `isAdmin()`
113
+
114
+ ```typescript
115
+ isAdmin(): Promise<boolean>
116
+ ```
117
+
118
+ ログイン中のユーザーが管理者グループ(`/_group/$admin`)に所属しているかどうかを返す。
119
+
120
+ ```typescript
121
+ const isAdmin = await vtecxnext.isAdmin()
122
+ ```
123
+
124
+ ---
125
+
126
+ ## グループ管理者
127
+
128
+ ### `createGroupadmin(createGroupadminInfos)`
129
+
130
+ ```typescript
131
+ createGroupadmin(createGroupadminInfos: CreateGroupadminInfo[]): Promise<any>
132
+ ```
133
+
134
+ グループ管理者を作成する。グループ名と管理者 UID の組を配列で渡す。
135
+
136
+ ```typescript
137
+ type CreateGroupadminInfo = {
138
+ group: string // グループ名
139
+ uids: string[] // 管理者にする UID の配列
140
+ }
141
+ ```
142
+
143
+ ---
144
+
145
+ ### `deleteGroupadmin(groupNames, async?)`
146
+
147
+ ```typescript
148
+ deleteGroupadmin(groupNames: string[], async?: boolean): Promise<any>
149
+ ```
150
+
151
+ 指定したグループ(複数)の管理者を削除する。
@@ -0,0 +1,117 @@
1
+ # vtecxnext API インデックス
2
+
3
+ `@vtecx/vtecxnext` v2.3.1 の全メソッド一覧です。
4
+
5
+ 公式リファレンス: https://zenn.dev/vtecx/articles/6a02ab2440ef05
6
+
7
+ ---
8
+
9
+ ## カテゴリ一覧
10
+
11
+ | カテゴリ | ファイル | 主なメソッド |
12
+ | --- | --- | --- |
13
+ | 認証・セッション | [auth.md](auth.md) | `uid`, `login`, `logout`, `loginWithRxid`, `isLoggedin` |
14
+ | データ操作 | [data.md](data.md) | `getEntry`, `getFeed`, `put`, `post`, `deleteEntry`, `pagination` |
15
+ | ユーザー管理 | [user.md](user.md) | `adduser`, `changepass`, `revokeuser`, `deleteuser` |
16
+ | グループ管理 | [group.md](group.md) | `addGroup`, `joinGroup`, `leaveGroup`, `isGroupMember`, `isAdmin` |
17
+ | 採番・カウンタ | [counter.md](counter.md) | `allocids`, `addids`, `getids`, `setids` |
18
+ | サーバーセッション | [session.md](session.md) | `setSessionFeed`, `getSessionFeed`, `setSessionString` |
19
+ | コンテンツ・ファイル | [content.md](content.md) | `putcontent`, `getcontent`, `savefiles`, `getSignedUrlToPutContent` |
20
+ | メール・通知 | [notify.md](notify.md) | `sendMail`, `pushNotification`, `setMessageQueue` |
21
+ | 外部DB連携 | [db.md](db.md) | `getBQ`, `execBQ`, `queryRDB`, `execRDB`, `postBDBQ` |
22
+ | PDF・署名 | [pdf.md](pdf.md) | `toPdf`, `putSignature`, `checkSignature` |
23
+ | OAuth・TOTP | [oauth.md](oauth.md) | `oauthLine`, `getTotpLink`, `createTotp`, `loginWithTotp` |
24
+ | ACL・エイリアス | [acl.md](acl.md) | `addacl`, `removeacl`, `addalias`, `removealias` |
25
+ | ユーティリティ | [util.md](util.md) | `checkXRequestedWith`, `response`, `getParameter`, `log`, `property` |
26
+
27
+ ---
28
+
29
+ ## 全メソッド索引
30
+
31
+ ### 認証・セッション
32
+ `isLoggedin` / `uid` / `account` / `service` / `now` / `rxid` / `whoami` /
33
+ `login` / `loginWithRxid` / `loginWithTotp` / `logout`
34
+
35
+ ### データ操作
36
+ `getEntry` / `getFeed` / `getFeedResponse` / `count` / `countResponse` /
37
+ `post` / `put` / `deleteEntry` / `deleteEntries` / `deleteFolder` / `clearFolder` /
38
+ `pagination` / `getPage` / `getPageWithPagination`
39
+
40
+ ### ユーザー管理
41
+ `adduser` / `adduserByAdmin` / `adduserByGroupadmin` /
42
+ `passreset` / `changepass` / `changepassByAdmin` /
43
+ `changeaccount` / `changeaccount_verify` /
44
+ `userstatus` / `revokeuser` / `revokeusers` / `activateuser` / `activateusers` /
45
+ `canceluser` / `deleteuser` / `deleteusers`
46
+
47
+ ### グループ管理
48
+ `addGroup` / `addGroupByAdmin` / `joinGroup` / `leaveGroup` / `leaveGroupByAdmin` /
49
+ `noGroupMember` / `getGroups` / `isGroupMember` / `isAdmin` /
50
+ `createGroupadmin` / `deleteGroupadmin`
51
+
52
+ ### 採番・カウンタ
53
+ `allocids` / `addids` / `getids` / `setids` / `rangeids` / `getRangeids`
54
+
55
+ ### サーバーセッション
56
+ `setSessionFeed` / `getSessionFeed` / `deleteSessionFeed` /
57
+ `setSessionEntry` / `getSessionEntry` / `deleteSessionEntry` /
58
+ `setSessionString` / `getSessionString` / `deleteSessionString` /
59
+ `setSessionLong` / `getSessionLong` / `deleteSessionLong` / `incrementSession`
60
+
61
+ ### コンテンツ・ファイル
62
+ `getcontenturl` / `savefiles` / `savefilesBySize` /
63
+ `putcontent` / `putcontentBySize` / `postcontent` / `deletecontent` / `getcontent` /
64
+ `getSignedUrlToPutContent` / `getSignedUrlToPostContent` / `getSignedUrlToGetContent`
65
+
66
+ ### メール・通知
67
+ `sendMail` / `pushNotification` /
68
+ `setMessageQueueStatus` / `getMessageQueueStatus` / `setMessageQueue` / `getMessageQueue`
69
+
70
+ ### 外部DB連携
71
+ `postBQ` / `deleteBQ` / `getBQ` / `execBQ` / `getBQCsv` /
72
+ `postBDBQ` / `putBDBQ` / `deleteBDBQ` /
73
+ `queryRDB` / `queryRDBCsv` / `execRDB`
74
+
75
+ ### PDF・署名
76
+ `toPdf` / `putSignature` / `putSignatures` / `deleteSignature` / `checkSignature`
77
+
78
+ ### OAuth・TOTP
79
+ `oauthLine` / `oauthCallbackLine` / `mergeOAuthUserLine` /
80
+ `getTotpLink` / `createTotp` / `deleteTotp` / `loginWithTotp` / `changeTdid`
81
+
82
+ ### ACL・エイリアス
83
+ `addacl` / `removeacl` / `addalias` / `removealias`
84
+
85
+ ### ユーティリティ
86
+ `getParameter` / `hasParameter` / `buffer` / `isBlank` / `null2blank` /
87
+ `checkXRequestedWith` / `setResponseHeader` / `response` / `sendMessage` /
88
+ `property` / `log` / `isVtecxNextError`
89
+
90
+ ---
91
+
92
+ ## 初期化
93
+
94
+ ```typescript
95
+ import { VtecxNext } from '@vtecx/vtecxnext'
96
+
97
+ // Next.js API Route 内で初期化
98
+ const vtecxnext = new VtecxNext(req)
99
+
100
+ // バッチ処理(アクセストークン使用)
101
+ const vtecxnext = new VtecxNext(undefined, accessToken)
102
+ ```
103
+
104
+ ## エラークラス
105
+
106
+ | クラス | 説明 |
107
+ | --- | --- |
108
+ | `VtecxNextError` | vte.cx 関連エラー |
109
+ | `FetchError` | fetch 処理エラー(VtecxNextError を継承) |
110
+
111
+ ```typescript
112
+ import { isVtecxNextError } from '@vtecx/vtecxnext'
113
+
114
+ if (isVtecxNextError(e)) {
115
+ // VtecxNextError の処理
116
+ }
117
+ ```