unikvs 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/src/_merge-variables.d.ts +13 -0
- package/dist/src/_merge-variables.d.ts.map +1 -0
- package/dist/src/_merge-variables.js +12 -0
- package/dist/src/_storage.d.ts +11 -11
- package/dist/src/_storage.d.ts.map +1 -1
- package/dist/src/_storage.js +31 -22
- package/dist/src/_streams.d.ts +20 -0
- package/dist/src/_streams.d.ts.map +1 -0
- package/dist/src/_streams.js +36 -0
- package/dist/src/_transformer.d.ts +7 -7
- package/dist/src/_transformer.d.ts.map +1 -1
- package/dist/src/_transformer.js +12 -12
- package/dist/src/_valibot.d.ts +2 -2
- package/dist/src/_valibot.d.ts.map +1 -1
- package/dist/src/_valibot.js +1 -1
- package/dist/src/_value-schemas.d.ts +179 -0
- package/dist/src/_value-schemas.d.ts.map +1 -0
- package/dist/src/_value-schemas.js +150 -0
- package/dist/src/errors.d.ts +60 -94
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +15 -31
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/unikvs-config.d.ts +58 -139
- package/dist/src/unikvs-config.d.ts.map +1 -1
- package/dist/src/unikvs-config.js +42 -47
- package/dist/src/unikvs.d.ts +84 -166
- package/dist/src/unikvs.d.ts.map +1 -1
- package/dist/src/unikvs.js +230 -169
- package/dist/src/utils.types.d.ts +1 -3
- package/dist/src/utils.types.d.ts.map +1 -1
- package/dist/src/value-stream.types.d.ts +2 -8
- package/dist/src/value-stream.types.d.ts.map +1 -1
- package/dist/src/variables.types.d.ts +11 -0
- package/dist/src/variables.types.d.ts.map +1 -0
- package/package.json +17 -16
- package/src/_merge-variables.ts +19 -0
- package/src/_storage.ts +47 -24
- package/src/_streams.ts +47 -0
- package/src/_transformer.ts +13 -13
- package/src/_valibot.ts +4 -1
- package/src/_value-schemas.ts +362 -0
- package/src/errors.ts +60 -109
- package/src/index.ts +2 -3
- package/src/unikvs-config.ts +143 -168
- package/src/unikvs.ts +359 -290
- package/src/utils.types.ts +1 -3
- package/src/value-stream.types.ts +2 -8
- package/src/variables.types.ts +13 -0
- package/dist/src/_merge-context.d.ts +0 -13
- package/dist/src/_merge-context.d.ts.map +0 -1
- package/dist/src/_merge-context.js +0 -12
- package/dist/src/context.types.d.ts +0 -17
- package/dist/src/context.types.d.ts.map +0 -1
- package/src/_merge-context.ts +0 -19
- package/src/context.types.ts +0 -19
- /package/dist/src/{context.types.js → variables.types.js} +0 -0
package/src/errors.ts
CHANGED
|
@@ -14,9 +14,7 @@ import type { BaseIssue } from "valibot";
|
|
|
14
14
|
// -------------------------------------------------------------------------------------------------
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @template TMeta エラーのメタデータの型です。
|
|
17
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
20
18
|
*/
|
|
21
19
|
export class InvalidUsageErrorBase<
|
|
22
20
|
TMeta extends ErrorMeta | undefined = ErrorMeta | undefined,
|
|
@@ -25,44 +23,42 @@ export class InvalidUsageErrorBase<
|
|
|
25
23
|
// -------------------------------------------------------------------------------------------------
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
|
-
*
|
|
26
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
29
27
|
*/
|
|
30
28
|
export type Issue = BaseIssue<unknown>;
|
|
31
29
|
|
|
32
30
|
/**
|
|
33
|
-
*
|
|
31
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
34
32
|
*/
|
|
35
33
|
export type InvalidInputErrorMeta = {
|
|
36
34
|
/**
|
|
37
|
-
*
|
|
35
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
38
36
|
*/
|
|
39
37
|
readonly input: unknown;
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
|
-
*
|
|
40
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
43
41
|
*/
|
|
44
42
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
46
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
51
47
|
*/
|
|
52
48
|
export type InvalidInputErrorArgs = ErrorOptions & {
|
|
53
49
|
/**
|
|
54
|
-
*
|
|
50
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
55
51
|
*/
|
|
56
52
|
readonly value: unknown;
|
|
57
53
|
|
|
58
54
|
/**
|
|
59
|
-
*
|
|
55
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
60
56
|
*/
|
|
61
57
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
62
58
|
};
|
|
63
59
|
|
|
64
60
|
/**
|
|
65
|
-
*
|
|
61
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
66
62
|
*/
|
|
67
63
|
export class InvalidInputError extends InvalidUsageErrorBase<InvalidInputErrorMeta> {
|
|
68
64
|
static {
|
|
@@ -79,39 +75,37 @@ export class InvalidInputError extends InvalidUsageErrorBase<InvalidInputErrorMe
|
|
|
79
75
|
// -------------------------------------------------------------------------------------------------
|
|
80
76
|
|
|
81
77
|
/**
|
|
82
|
-
*
|
|
78
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
83
79
|
*/
|
|
84
80
|
export type InvalidOutputErrorMeta = {
|
|
85
81
|
/**
|
|
86
|
-
*
|
|
82
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
87
83
|
*/
|
|
88
84
|
readonly output: unknown;
|
|
89
85
|
|
|
90
86
|
/**
|
|
91
|
-
*
|
|
87
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
92
88
|
*/
|
|
93
89
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
94
90
|
};
|
|
95
91
|
|
|
96
92
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
93
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
100
94
|
*/
|
|
101
95
|
export type InvalidOutputErrorArgs = ErrorOptions & {
|
|
102
96
|
/**
|
|
103
|
-
*
|
|
97
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
104
98
|
*/
|
|
105
99
|
readonly value: unknown;
|
|
106
100
|
|
|
107
101
|
/**
|
|
108
|
-
*
|
|
102
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
109
103
|
*/
|
|
110
104
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
111
105
|
};
|
|
112
106
|
|
|
113
107
|
/**
|
|
114
|
-
*
|
|
108
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
115
109
|
*/
|
|
116
110
|
export class InvalidOutputError extends InvalidUsageErrorBase<InvalidOutputErrorMeta> {
|
|
117
111
|
static {
|
|
@@ -132,7 +126,7 @@ export class InvalidOutputError extends InvalidUsageErrorBase<InvalidOutputError
|
|
|
132
126
|
// -------------------------------------------------------------------------------------------------
|
|
133
127
|
|
|
134
128
|
/**
|
|
135
|
-
*
|
|
129
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
136
130
|
*/
|
|
137
131
|
export class UniKvsIsOpenError extends ErrorBase<undefined> {
|
|
138
132
|
static {
|
|
@@ -147,7 +141,7 @@ export class UniKvsIsOpenError extends ErrorBase<undefined> {
|
|
|
147
141
|
setErrorMessage(UniKvsIsOpenError, "UniKvs は開いています", "ja");
|
|
148
142
|
|
|
149
143
|
/**
|
|
150
|
-
*
|
|
144
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
151
145
|
*/
|
|
152
146
|
export class UniKvsIsNotOpenError extends ErrorBase<undefined> {
|
|
153
147
|
static {
|
|
@@ -162,24 +156,22 @@ export class UniKvsIsNotOpenError extends ErrorBase<undefined> {
|
|
|
162
156
|
setErrorMessage(UniKvsIsNotOpenError, "UniKvs は開いていません", "ja");
|
|
163
157
|
|
|
164
158
|
/**
|
|
165
|
-
*
|
|
159
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
166
160
|
*/
|
|
167
161
|
export type KeyNotFoundErrorMeta = {
|
|
168
162
|
/**
|
|
169
|
-
*
|
|
163
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
170
164
|
*/
|
|
171
165
|
readonly key: IStorage.Key;
|
|
172
166
|
};
|
|
173
167
|
|
|
174
168
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
169
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
178
170
|
*/
|
|
179
171
|
export type KeyNotFoundErrorArgs = ErrorOptions & KeyNotFoundErrorMeta;
|
|
180
172
|
|
|
181
173
|
/**
|
|
182
|
-
*
|
|
174
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
183
175
|
*/
|
|
184
176
|
export class KeyNotFoundError extends ErrorBase<KeyNotFoundErrorMeta> {
|
|
185
177
|
static {
|
|
@@ -224,24 +216,22 @@ setErrorMessage(
|
|
|
224
216
|
// setErrorMessage(StorageIsOpenError, ({ name }) => `ストレージ "${name}" は開いています`, "ja");
|
|
225
217
|
|
|
226
218
|
/**
|
|
227
|
-
*
|
|
219
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
228
220
|
*/
|
|
229
221
|
export type StorageIsNotOpenErrorMeta = {
|
|
230
222
|
/**
|
|
231
|
-
*
|
|
223
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
232
224
|
*/
|
|
233
225
|
readonly name: string;
|
|
234
226
|
};
|
|
235
227
|
|
|
236
228
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
229
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
240
230
|
*/
|
|
241
231
|
export type StorageIsNotOpenErrorArgs = ErrorOptions & StorageIsNotOpenErrorMeta;
|
|
242
232
|
|
|
243
233
|
/**
|
|
244
|
-
*
|
|
234
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
245
235
|
*/
|
|
246
236
|
export class StorageIsNotOpenError extends ErrorBase<StorageIsNotOpenErrorMeta> {
|
|
247
237
|
static {
|
|
@@ -258,25 +248,23 @@ export class StorageIsNotOpenError extends ErrorBase<StorageIsNotOpenErrorMeta>
|
|
|
258
248
|
setErrorMessage(StorageIsNotOpenError, ({ name }) => `ストレージ "${name}" は開いていません`, "ja");
|
|
259
249
|
|
|
260
250
|
/**
|
|
261
|
-
*
|
|
251
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
262
252
|
*/
|
|
263
253
|
export type WritableStreamNotSupportedErrorMeta = {
|
|
264
254
|
/**
|
|
265
|
-
*
|
|
255
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
266
256
|
*/
|
|
267
257
|
readonly name: string;
|
|
268
258
|
};
|
|
269
259
|
|
|
270
260
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
261
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
274
262
|
*/
|
|
275
263
|
export type WritableStreamNotSupportedErrorArgs = ErrorOptions &
|
|
276
264
|
WritableStreamNotSupportedErrorMeta;
|
|
277
265
|
|
|
278
266
|
/**
|
|
279
|
-
*
|
|
267
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
280
268
|
*/
|
|
281
269
|
export class WritableStreamNotSupportedError extends ErrorBase<WritableStreamNotSupportedErrorMeta> {
|
|
282
270
|
static {
|
|
@@ -297,25 +285,23 @@ setErrorMessage(
|
|
|
297
285
|
);
|
|
298
286
|
|
|
299
287
|
/**
|
|
300
|
-
*
|
|
288
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
301
289
|
*/
|
|
302
290
|
export type ReadableStreamNotSupportedErrorMeta = {
|
|
303
291
|
/**
|
|
304
|
-
*
|
|
292
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
305
293
|
*/
|
|
306
294
|
readonly name: string;
|
|
307
295
|
};
|
|
308
296
|
|
|
309
297
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
298
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
313
299
|
*/
|
|
314
300
|
export type ReadableStreamNotSupportedErrorArgs = ErrorOptions &
|
|
315
301
|
ReadableStreamNotSupportedErrorMeta;
|
|
316
302
|
|
|
317
303
|
/**
|
|
318
|
-
*
|
|
304
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
319
305
|
*/
|
|
320
306
|
export class ReadableStreamNotSupportedError extends ErrorBase<ReadableStreamNotSupportedErrorMeta> {
|
|
321
307
|
static {
|
|
@@ -399,24 +385,22 @@ setErrorMessage(
|
|
|
399
385
|
// setErrorMessage(TransformerIsOpenError, ({ name }) => `トランスフォーマー "${name}" は開いています`, "ja");
|
|
400
386
|
|
|
401
387
|
/**
|
|
402
|
-
*
|
|
388
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
403
389
|
*/
|
|
404
390
|
export type TransformerIsNotOpenErrorMeta = {
|
|
405
391
|
/**
|
|
406
|
-
*
|
|
392
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
407
393
|
*/
|
|
408
394
|
readonly name: string;
|
|
409
395
|
};
|
|
410
396
|
|
|
411
397
|
/**
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
398
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
415
399
|
*/
|
|
416
400
|
export type TransformerIsNotOpenErrorArgs = ErrorOptions & TransformerIsNotOpenErrorMeta;
|
|
417
401
|
|
|
418
402
|
/**
|
|
419
|
-
*
|
|
403
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
420
404
|
*/
|
|
421
405
|
export class TransformerIsNotOpenError extends ErrorBase<TransformerIsNotOpenErrorMeta> {
|
|
422
406
|
static {
|
|
@@ -437,25 +421,23 @@ setErrorMessage(
|
|
|
437
421
|
);
|
|
438
422
|
|
|
439
423
|
/**
|
|
440
|
-
*
|
|
424
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
441
425
|
*/
|
|
442
426
|
export type EncodableStreamNotSupportedErrorMeta = {
|
|
443
427
|
/**
|
|
444
|
-
*
|
|
428
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
445
429
|
*/
|
|
446
430
|
readonly name: string;
|
|
447
431
|
};
|
|
448
432
|
|
|
449
433
|
/**
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
434
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
453
435
|
*/
|
|
454
436
|
export type EncodableStreamNotSupportedErrorArgs = ErrorOptions &
|
|
455
437
|
EncodableStreamNotSupportedErrorMeta;
|
|
456
438
|
|
|
457
439
|
/**
|
|
458
|
-
*
|
|
440
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
459
441
|
*/
|
|
460
442
|
export class EncodableStreamNotSupportedError extends ErrorBase<EncodableStreamNotSupportedErrorMeta> {
|
|
461
443
|
static {
|
|
@@ -476,25 +458,23 @@ setErrorMessage(
|
|
|
476
458
|
);
|
|
477
459
|
|
|
478
460
|
/**
|
|
479
|
-
*
|
|
461
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
480
462
|
*/
|
|
481
463
|
export type DecodableStreamNotSupportedErrorMeta = {
|
|
482
464
|
/**
|
|
483
|
-
*
|
|
465
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
484
466
|
*/
|
|
485
467
|
readonly name: string;
|
|
486
468
|
};
|
|
487
469
|
|
|
488
470
|
/**
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
471
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
492
472
|
*/
|
|
493
473
|
export type DecodableStreamNotSupportedErrorArgs = ErrorOptions &
|
|
494
474
|
DecodableStreamNotSupportedErrorMeta;
|
|
495
475
|
|
|
496
476
|
/**
|
|
497
|
-
*
|
|
477
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
498
478
|
*/
|
|
499
479
|
export class DecodableStreamNotSupportedError extends ErrorBase<DecodableStreamNotSupportedErrorMeta> {
|
|
500
480
|
static {
|
|
@@ -521,75 +501,67 @@ setErrorMessage(
|
|
|
521
501
|
// -------------------------------------------------------------------------------------------------
|
|
522
502
|
|
|
523
503
|
/**
|
|
524
|
-
*
|
|
504
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
525
505
|
*/
|
|
526
506
|
export type PluginOperationAggregateErrorMeta = {
|
|
527
507
|
/**
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
* - `"plugin"`: 複数の種別のプラグインが混在しています。
|
|
531
|
-
* - `"storage"`: ストレージです。
|
|
532
|
-
* - `"transformer"`: トランスフォーマーです。
|
|
508
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
533
509
|
*/
|
|
534
510
|
readonly plugin: "plugin" | "storage" | "transformer";
|
|
535
511
|
|
|
536
512
|
/**
|
|
537
|
-
*
|
|
513
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
538
514
|
*/
|
|
539
515
|
readonly action: "open" | "close" | "write" | "read" | "delete" | "clear";
|
|
540
516
|
|
|
541
517
|
/**
|
|
542
|
-
*
|
|
518
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
543
519
|
*/
|
|
544
520
|
readonly errors: readonly {
|
|
545
521
|
/**
|
|
546
|
-
*
|
|
522
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
547
523
|
*/
|
|
548
524
|
readonly plugin: "storage" | "transformer";
|
|
549
525
|
|
|
550
526
|
/**
|
|
551
|
-
*
|
|
527
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
552
528
|
*/
|
|
553
529
|
readonly reason: unknown;
|
|
554
530
|
}[];
|
|
555
531
|
};
|
|
556
532
|
|
|
557
533
|
/**
|
|
558
|
-
*
|
|
559
|
-
*
|
|
560
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
534
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
561
535
|
*/
|
|
562
536
|
export type PluginOperationAggregateErrorArgs = ErrorOptions & {
|
|
563
537
|
/**
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
* 個々のエラーで種別が指定されていない場合に使用されます。
|
|
538
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
567
539
|
*/
|
|
568
540
|
readonly plugin?: "storage" | "transformer";
|
|
569
541
|
|
|
570
542
|
/**
|
|
571
|
-
*
|
|
543
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
572
544
|
*/
|
|
573
545
|
readonly action: "open" | "close" | "write" | "read" | "delete" | "clear";
|
|
574
546
|
|
|
575
547
|
/**
|
|
576
|
-
*
|
|
548
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
577
549
|
*/
|
|
578
550
|
readonly errors: readonly {
|
|
579
551
|
/**
|
|
580
|
-
*
|
|
552
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
581
553
|
*/
|
|
582
554
|
readonly plugin?: "storage" | "transformer";
|
|
583
555
|
|
|
584
556
|
/**
|
|
585
|
-
*
|
|
557
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
586
558
|
*/
|
|
587
559
|
readonly reason: unknown;
|
|
588
560
|
}[];
|
|
589
561
|
};
|
|
590
562
|
|
|
591
563
|
/**
|
|
592
|
-
*
|
|
564
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
593
565
|
*/
|
|
594
566
|
export class PluginOperationAggregateError extends ErrorBase<PluginOperationAggregateErrorMeta> {
|
|
595
567
|
static {
|
|
@@ -631,7 +603,7 @@ setErrorMessage(
|
|
|
631
603
|
// -------------------------------------------------------------------------------------------------
|
|
632
604
|
|
|
633
605
|
/**
|
|
634
|
-
*
|
|
606
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
635
607
|
*/
|
|
636
608
|
export class MissingStorageError extends ErrorBase<undefined> {
|
|
637
609
|
static {
|
|
@@ -648,24 +620,3 @@ setErrorMessage(
|
|
|
648
620
|
"UniKvs を使用するためには最低 1 つのストレージが必要です",
|
|
649
621
|
"ja",
|
|
650
622
|
);
|
|
651
|
-
|
|
652
|
-
// -------------------------------------------------------------------------------------------------
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* ストレージが登録された後にトランスフォーマーを追加しようとした場合に投げられるエラーです。
|
|
656
|
-
*/
|
|
657
|
-
export class TransformerRegistrationError extends ErrorBase<undefined> {
|
|
658
|
-
static {
|
|
659
|
-
this.prototype.name = "UniKvsTransformerRegistrationError";
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
public constructor(options?: ErrorOptions) {
|
|
663
|
-
super("Cannot add transformers after storage has already been registered", options);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
setErrorMessage(
|
|
668
|
-
TransformerRegistrationError,
|
|
669
|
-
"ストレージが登録された後にトランスフォーマーを追加することはできません",
|
|
670
|
-
"ja",
|
|
671
|
-
);
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type * from "./
|
|
1
|
+
export type * from "./variables.types.js";
|
|
2
2
|
|
|
3
3
|
export type {
|
|
4
4
|
DecodableStreamNotSupportedErrorArgs,
|
|
@@ -35,14 +35,13 @@ export {
|
|
|
35
35
|
ReadableStreamNotSupportedError,
|
|
36
36
|
StorageIsNotOpenError,
|
|
37
37
|
TransformerIsNotOpenError,
|
|
38
|
-
TransformerRegistrationError,
|
|
39
38
|
UniKvsIsNotOpenError,
|
|
40
39
|
UniKvsIsOpenError,
|
|
41
40
|
WritableStreamNotSupportedError,
|
|
42
41
|
} from "./errors.js";
|
|
43
42
|
|
|
44
43
|
export type * from "./unikvs-config.js";
|
|
45
|
-
export { default as UniKvsConfig } from "./unikvs-config.js";
|
|
44
|
+
export { PlainValue, StreamValue, Value, default as UniKvsConfig } from "./unikvs-config.js";
|
|
46
45
|
|
|
47
46
|
export type * from "./unikvs.js";
|
|
48
47
|
export { default as UniKvs } from "./unikvs.js";
|