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
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _RecordValueSchemaResolver_entries, _EntriesValueSchemaResolver_entries, _EntriesValueSchemaResolver_keySchema;
|
|
13
|
+
import * as v from "./_valibot.js";
|
|
14
|
+
import { InvalidInputError } from "./errors.js";
|
|
15
|
+
// -------------------------------------------------------------------------------------------------
|
|
16
|
+
//
|
|
17
|
+
// 値のスキーマ
|
|
18
|
+
//
|
|
19
|
+
// -------------------------------------------------------------------------------------------------
|
|
20
|
+
/**
|
|
21
|
+
* スキーマ付きの値であることを識別するためのブランドです。
|
|
22
|
+
*
|
|
23
|
+
* 同じライブラリーが複数読み込まれた環境でも認識できるようにグローバルシンボルを使用します。
|
|
24
|
+
*/
|
|
25
|
+
const VALUE_SCHEMA_BRAND = Symbol.for("unikvs.valueSchema");
|
|
26
|
+
/**
|
|
27
|
+
* 値が Valibot のスキーマであるかどうかを判定します。
|
|
28
|
+
*/
|
|
29
|
+
function isGenericSchema(input) {
|
|
30
|
+
return (typeof input === "object" &&
|
|
31
|
+
input !== null &&
|
|
32
|
+
typeof input["~run"] === "function");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 値がスキーマ情報であるかどうかを判定します。
|
|
36
|
+
*/
|
|
37
|
+
function isValueSchemaInfo(input) {
|
|
38
|
+
return (typeof input === "object" &&
|
|
39
|
+
input !== null &&
|
|
40
|
+
input[VALUE_SCHEMA_BRAND] === true);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* スキーマ情報を内部オブジェクトとして生成します。
|
|
44
|
+
*/
|
|
45
|
+
function createValueSchemaDescriptor(kind, schema) {
|
|
46
|
+
return { [VALUE_SCHEMA_BRAND]: true, kind, schema };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-types)
|
|
50
|
+
*
|
|
51
|
+
* プレーンな値のスキーマを定義します。
|
|
52
|
+
*
|
|
53
|
+
* @template TSchema スキーマの型です。
|
|
54
|
+
* @param schema 値の検証に使用する Valibot スキーマです。
|
|
55
|
+
* @returns プレーンな値であることを示す型情報を返します。
|
|
56
|
+
*/
|
|
57
|
+
export function PlainValue(schema) {
|
|
58
|
+
return createValueSchemaDescriptor("plain", schema);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-types)
|
|
62
|
+
*
|
|
63
|
+
* ストリーム形式の値のスキーマを定義します。
|
|
64
|
+
*
|
|
65
|
+
* @template TSchema スキーマの型です。
|
|
66
|
+
* @param schema チャンクデータの検証に使用する Valibot スキーマです。
|
|
67
|
+
* @returns ストリーム形式の値であることを示す型情報を返します。
|
|
68
|
+
*/
|
|
69
|
+
export function StreamValue(schema) {
|
|
70
|
+
return createValueSchemaDescriptor("stream", schema);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-types)
|
|
74
|
+
*
|
|
75
|
+
* プレーンな値とストリーム形式の値の両方で使えるスキーマを定義します。
|
|
76
|
+
*
|
|
77
|
+
* @template TSchema スキーマの型です。
|
|
78
|
+
* @param schema データとチャンクデータの検証に使用する Valibot スキーマです。
|
|
79
|
+
* @returns どちらの形式でも使える値であることを示す型情報を返します。
|
|
80
|
+
*/
|
|
81
|
+
export function Value(schema) {
|
|
82
|
+
return createValueSchemaDescriptor("any", schema);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* `schema` オプションの検証に使用するスキーマです。
|
|
86
|
+
*/
|
|
87
|
+
export const UniKvsSchemaSchema = v.union([
|
|
88
|
+
v.array(v.tuple([
|
|
89
|
+
v.custom(isGenericSchema),
|
|
90
|
+
v.custom(isValueSchemaInfo),
|
|
91
|
+
])),
|
|
92
|
+
v.record(v.string(), v.custom(isValueSchemaInfo)),
|
|
93
|
+
]);
|
|
94
|
+
/**
|
|
95
|
+
* オブジェクト形式のスキーマ定義からスキーマ情報を解決します。
|
|
96
|
+
*/
|
|
97
|
+
class RecordValueSchemaResolver {
|
|
98
|
+
constructor(entries) {
|
|
99
|
+
_RecordValueSchemaResolver_entries.set(this, void 0);
|
|
100
|
+
__classPrivateFieldSet(this, _RecordValueSchemaResolver_entries, new Map(Object.entries(entries)), "f");
|
|
101
|
+
}
|
|
102
|
+
resolve(key) {
|
|
103
|
+
return __classPrivateFieldGet(this, _RecordValueSchemaResolver_entries, "f").get(key);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
_RecordValueSchemaResolver_entries = new WeakMap();
|
|
107
|
+
/**
|
|
108
|
+
* 配列形式のスキーマ定義からスキーマ情報を解決します。
|
|
109
|
+
*
|
|
110
|
+
* キースキーマに最初に一致した定義を採用します。
|
|
111
|
+
*/
|
|
112
|
+
class EntriesValueSchemaResolver {
|
|
113
|
+
constructor(entries) {
|
|
114
|
+
_EntriesValueSchemaResolver_entries.set(this, void 0);
|
|
115
|
+
_EntriesValueSchemaResolver_keySchema.set(this, void 0);
|
|
116
|
+
__classPrivateFieldSet(this, _EntriesValueSchemaResolver_entries, entries, "f");
|
|
117
|
+
__classPrivateFieldSet(this, _EntriesValueSchemaResolver_keySchema, entries.length > 0 ? v.union(entries.map(([keySchema]) => keySchema)) : undefined, "f");
|
|
118
|
+
}
|
|
119
|
+
resolve(key) {
|
|
120
|
+
for (const [keySchema, valueSchema] of __classPrivateFieldGet(this, _EntriesValueSchemaResolver_entries, "f")) {
|
|
121
|
+
const result = v.safeParse(keySchema, key);
|
|
122
|
+
if (result.success) {
|
|
123
|
+
return valueSchema;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (__classPrivateFieldGet(this, _EntriesValueSchemaResolver_keySchema, "f")) {
|
|
127
|
+
const result = v.safeParse(__classPrivateFieldGet(this, _EntriesValueSchemaResolver_keySchema, "f"), key);
|
|
128
|
+
if (!result.success) {
|
|
129
|
+
throw new InvalidInputError({
|
|
130
|
+
value: key,
|
|
131
|
+
issues: result.issues,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
_EntriesValueSchemaResolver_entries = new WeakMap(), _EntriesValueSchemaResolver_keySchema = new WeakMap();
|
|
139
|
+
/**
|
|
140
|
+
* 検証済みのスキーマ定義からスキーマリゾルバーを生成します。
|
|
141
|
+
*
|
|
142
|
+
* @param schema 検証済みのスキーマ定義です。
|
|
143
|
+
* @returns スキーマリゾルバーを返します。
|
|
144
|
+
*/
|
|
145
|
+
export function createValueSchemaResolver(schema) {
|
|
146
|
+
if (Array.isArray(schema)) {
|
|
147
|
+
return new EntriesValueSchemaResolver(schema);
|
|
148
|
+
}
|
|
149
|
+
return new RecordValueSchemaResolver(schema);
|
|
150
|
+
}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -1,176 +1,162 @@
|
|
|
1
1
|
import { ErrorBase, type ErrorOptions, type ErrorMeta, type IStorage } from "@unikvs/core";
|
|
2
2
|
import type { BaseIssue } from "valibot";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @template TMeta エラーのメタデータの型です。
|
|
4
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
7
5
|
*/
|
|
8
6
|
export declare class InvalidUsageErrorBase<TMeta extends ErrorMeta | undefined = ErrorMeta | undefined> extends ErrorBase<TMeta> {
|
|
9
7
|
}
|
|
10
8
|
/**
|
|
11
|
-
*
|
|
9
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
12
10
|
*/
|
|
13
11
|
export type Issue = BaseIssue<unknown>;
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
13
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
16
14
|
*/
|
|
17
15
|
export type InvalidInputErrorMeta = {
|
|
18
16
|
/**
|
|
19
|
-
*
|
|
17
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
20
18
|
*/
|
|
21
19
|
readonly input: unknown;
|
|
22
20
|
/**
|
|
23
|
-
*
|
|
21
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
24
22
|
*/
|
|
25
23
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
26
24
|
};
|
|
27
25
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
26
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
31
27
|
*/
|
|
32
28
|
export type InvalidInputErrorArgs = ErrorOptions & {
|
|
33
29
|
/**
|
|
34
|
-
*
|
|
30
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
35
31
|
*/
|
|
36
32
|
readonly value: unknown;
|
|
37
33
|
/**
|
|
38
|
-
*
|
|
34
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
39
35
|
*/
|
|
40
36
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
41
37
|
};
|
|
42
38
|
/**
|
|
43
|
-
*
|
|
39
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
44
40
|
*/
|
|
45
41
|
export declare class InvalidInputError extends InvalidUsageErrorBase<InvalidInputErrorMeta> {
|
|
46
42
|
constructor(args: InvalidInputErrorArgs);
|
|
47
43
|
}
|
|
48
44
|
/**
|
|
49
|
-
*
|
|
45
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
50
46
|
*/
|
|
51
47
|
export type InvalidOutputErrorMeta = {
|
|
52
48
|
/**
|
|
53
|
-
*
|
|
49
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
54
50
|
*/
|
|
55
51
|
readonly output: unknown;
|
|
56
52
|
/**
|
|
57
|
-
*
|
|
53
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
58
54
|
*/
|
|
59
55
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
60
56
|
};
|
|
61
57
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
58
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
65
59
|
*/
|
|
66
60
|
export type InvalidOutputErrorArgs = ErrorOptions & {
|
|
67
61
|
/**
|
|
68
|
-
*
|
|
62
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
69
63
|
*/
|
|
70
64
|
readonly value: unknown;
|
|
71
65
|
/**
|
|
72
|
-
*
|
|
66
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
73
67
|
*/
|
|
74
68
|
readonly issues: readonly [Issue, ...Issue[]];
|
|
75
69
|
};
|
|
76
70
|
/**
|
|
77
|
-
*
|
|
71
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
78
72
|
*/
|
|
79
73
|
export declare class InvalidOutputError extends InvalidUsageErrorBase<InvalidOutputErrorMeta> {
|
|
80
74
|
constructor(args: InvalidOutputErrorArgs);
|
|
81
75
|
}
|
|
82
76
|
/**
|
|
83
|
-
*
|
|
77
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
84
78
|
*/
|
|
85
79
|
export declare class UniKvsIsOpenError extends ErrorBase<undefined> {
|
|
86
80
|
constructor(options?: ErrorOptions);
|
|
87
81
|
}
|
|
88
82
|
/**
|
|
89
|
-
*
|
|
83
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
90
84
|
*/
|
|
91
85
|
export declare class UniKvsIsNotOpenError extends ErrorBase<undefined> {
|
|
92
86
|
constructor(options?: ErrorOptions);
|
|
93
87
|
}
|
|
94
88
|
/**
|
|
95
|
-
*
|
|
89
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
96
90
|
*/
|
|
97
91
|
export type KeyNotFoundErrorMeta = {
|
|
98
92
|
/**
|
|
99
|
-
*
|
|
93
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
100
94
|
*/
|
|
101
95
|
readonly key: IStorage.Key;
|
|
102
96
|
};
|
|
103
97
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
98
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
107
99
|
*/
|
|
108
100
|
export type KeyNotFoundErrorArgs = ErrorOptions & KeyNotFoundErrorMeta;
|
|
109
101
|
/**
|
|
110
|
-
*
|
|
102
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
111
103
|
*/
|
|
112
104
|
export declare class KeyNotFoundError extends ErrorBase<KeyNotFoundErrorMeta> {
|
|
113
105
|
constructor(args: KeyNotFoundErrorArgs);
|
|
114
106
|
}
|
|
115
107
|
/**
|
|
116
|
-
*
|
|
108
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
117
109
|
*/
|
|
118
110
|
export type StorageIsNotOpenErrorMeta = {
|
|
119
111
|
/**
|
|
120
|
-
*
|
|
112
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
121
113
|
*/
|
|
122
114
|
readonly name: string;
|
|
123
115
|
};
|
|
124
116
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
117
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
128
118
|
*/
|
|
129
119
|
export type StorageIsNotOpenErrorArgs = ErrorOptions & StorageIsNotOpenErrorMeta;
|
|
130
120
|
/**
|
|
131
|
-
*
|
|
121
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
132
122
|
*/
|
|
133
123
|
export declare class StorageIsNotOpenError extends ErrorBase<StorageIsNotOpenErrorMeta> {
|
|
134
124
|
constructor(args: StorageIsNotOpenErrorArgs);
|
|
135
125
|
}
|
|
136
126
|
/**
|
|
137
|
-
*
|
|
127
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
138
128
|
*/
|
|
139
129
|
export type WritableStreamNotSupportedErrorMeta = {
|
|
140
130
|
/**
|
|
141
|
-
*
|
|
131
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
142
132
|
*/
|
|
143
133
|
readonly name: string;
|
|
144
134
|
};
|
|
145
135
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
136
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
149
137
|
*/
|
|
150
138
|
export type WritableStreamNotSupportedErrorArgs = ErrorOptions & WritableStreamNotSupportedErrorMeta;
|
|
151
139
|
/**
|
|
152
|
-
*
|
|
140
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
153
141
|
*/
|
|
154
142
|
export declare class WritableStreamNotSupportedError extends ErrorBase<WritableStreamNotSupportedErrorMeta> {
|
|
155
143
|
constructor(args: WritableStreamNotSupportedErrorArgs);
|
|
156
144
|
}
|
|
157
145
|
/**
|
|
158
|
-
*
|
|
146
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
159
147
|
*/
|
|
160
148
|
export type ReadableStreamNotSupportedErrorMeta = {
|
|
161
149
|
/**
|
|
162
|
-
*
|
|
150
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
163
151
|
*/
|
|
164
152
|
readonly name: string;
|
|
165
153
|
};
|
|
166
154
|
/**
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
155
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
170
156
|
*/
|
|
171
157
|
export type ReadableStreamNotSupportedErrorArgs = ErrorOptions & ReadableStreamNotSupportedErrorMeta;
|
|
172
158
|
/**
|
|
173
|
-
*
|
|
159
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
174
160
|
*/
|
|
175
161
|
export declare class ReadableStreamNotSupportedError extends ErrorBase<ReadableStreamNotSupportedErrorMeta> {
|
|
176
162
|
constructor(args: ReadableStreamNotSupportedErrorArgs);
|
|
@@ -197,144 +183,124 @@ export declare class MultipartWriteNotSupportedError extends ErrorBase<Multipart
|
|
|
197
183
|
constructor(args: MultipartWriteNotSupportedErrorArgs);
|
|
198
184
|
}
|
|
199
185
|
/**
|
|
200
|
-
*
|
|
186
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
201
187
|
*/
|
|
202
188
|
export type TransformerIsNotOpenErrorMeta = {
|
|
203
189
|
/**
|
|
204
|
-
*
|
|
190
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
205
191
|
*/
|
|
206
192
|
readonly name: string;
|
|
207
193
|
};
|
|
208
194
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
195
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
212
196
|
*/
|
|
213
197
|
export type TransformerIsNotOpenErrorArgs = ErrorOptions & TransformerIsNotOpenErrorMeta;
|
|
214
198
|
/**
|
|
215
|
-
*
|
|
199
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
216
200
|
*/
|
|
217
201
|
export declare class TransformerIsNotOpenError extends ErrorBase<TransformerIsNotOpenErrorMeta> {
|
|
218
202
|
constructor(args: TransformerIsNotOpenErrorArgs);
|
|
219
203
|
}
|
|
220
204
|
/**
|
|
221
|
-
*
|
|
205
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
222
206
|
*/
|
|
223
207
|
export type EncodableStreamNotSupportedErrorMeta = {
|
|
224
208
|
/**
|
|
225
|
-
*
|
|
209
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
226
210
|
*/
|
|
227
211
|
readonly name: string;
|
|
228
212
|
};
|
|
229
213
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
214
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
233
215
|
*/
|
|
234
216
|
export type EncodableStreamNotSupportedErrorArgs = ErrorOptions & EncodableStreamNotSupportedErrorMeta;
|
|
235
217
|
/**
|
|
236
|
-
*
|
|
218
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
237
219
|
*/
|
|
238
220
|
export declare class EncodableStreamNotSupportedError extends ErrorBase<EncodableStreamNotSupportedErrorMeta> {
|
|
239
221
|
constructor(args: EncodableStreamNotSupportedErrorArgs);
|
|
240
222
|
}
|
|
241
223
|
/**
|
|
242
|
-
*
|
|
224
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
243
225
|
*/
|
|
244
226
|
export type DecodableStreamNotSupportedErrorMeta = {
|
|
245
227
|
/**
|
|
246
|
-
*
|
|
228
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
247
229
|
*/
|
|
248
230
|
readonly name: string;
|
|
249
231
|
};
|
|
250
232
|
/**
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
233
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
254
234
|
*/
|
|
255
235
|
export type DecodableStreamNotSupportedErrorArgs = ErrorOptions & DecodableStreamNotSupportedErrorMeta;
|
|
256
236
|
/**
|
|
257
|
-
*
|
|
237
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
258
238
|
*/
|
|
259
239
|
export declare class DecodableStreamNotSupportedError extends ErrorBase<DecodableStreamNotSupportedErrorMeta> {
|
|
260
240
|
constructor(args: DecodableStreamNotSupportedErrorArgs);
|
|
261
241
|
}
|
|
262
242
|
/**
|
|
263
|
-
*
|
|
243
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
264
244
|
*/
|
|
265
245
|
export type PluginOperationAggregateErrorMeta = {
|
|
266
246
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
* - `"plugin"`: 複数の種別のプラグインが混在しています。
|
|
270
|
-
* - `"storage"`: ストレージです。
|
|
271
|
-
* - `"transformer"`: トランスフォーマーです。
|
|
247
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
272
248
|
*/
|
|
273
249
|
readonly plugin: "plugin" | "storage" | "transformer";
|
|
274
250
|
/**
|
|
275
|
-
*
|
|
251
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
276
252
|
*/
|
|
277
253
|
readonly action: "open" | "close" | "write" | "read" | "delete" | "clear";
|
|
278
254
|
/**
|
|
279
|
-
*
|
|
255
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
280
256
|
*/
|
|
281
257
|
readonly errors: readonly {
|
|
282
258
|
/**
|
|
283
|
-
*
|
|
259
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
284
260
|
*/
|
|
285
261
|
readonly plugin: "storage" | "transformer";
|
|
286
262
|
/**
|
|
287
|
-
*
|
|
263
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
288
264
|
*/
|
|
289
265
|
readonly reason: unknown;
|
|
290
266
|
}[];
|
|
291
267
|
};
|
|
292
268
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* エラーの追加情報 (`cause`) も含みます。
|
|
269
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
296
270
|
*/
|
|
297
271
|
export type PluginOperationAggregateErrorArgs = ErrorOptions & {
|
|
298
272
|
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* 個々のエラーで種別が指定されていない場合に使用されます。
|
|
273
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
302
274
|
*/
|
|
303
275
|
readonly plugin?: "storage" | "transformer";
|
|
304
276
|
/**
|
|
305
|
-
*
|
|
277
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
306
278
|
*/
|
|
307
279
|
readonly action: "open" | "close" | "write" | "read" | "delete" | "clear";
|
|
308
280
|
/**
|
|
309
|
-
*
|
|
281
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
310
282
|
*/
|
|
311
283
|
readonly errors: readonly {
|
|
312
284
|
/**
|
|
313
|
-
*
|
|
285
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
314
286
|
*/
|
|
315
287
|
readonly plugin?: "storage" | "transformer";
|
|
316
288
|
/**
|
|
317
|
-
*
|
|
289
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
318
290
|
*/
|
|
319
291
|
readonly reason: unknown;
|
|
320
292
|
}[];
|
|
321
293
|
};
|
|
322
294
|
/**
|
|
323
|
-
*
|
|
295
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
324
296
|
*/
|
|
325
297
|
export declare class PluginOperationAggregateError extends ErrorBase<PluginOperationAggregateErrorMeta> {
|
|
326
298
|
constructor(args: PluginOperationAggregateErrorArgs);
|
|
327
299
|
}
|
|
328
300
|
/**
|
|
329
|
-
*
|
|
301
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
|
|
330
302
|
*/
|
|
331
303
|
export declare class MissingStorageError extends ErrorBase<undefined> {
|
|
332
304
|
constructor(options?: ErrorOptions);
|
|
333
305
|
}
|
|
334
|
-
/**
|
|
335
|
-
* ストレージが登録された後にトランスフォーマーを追加しようとした場合に投げられるエラーです。
|
|
336
|
-
*/
|
|
337
|
-
export declare class TransformerRegistrationError extends ErrorBase<undefined> {
|
|
338
|
-
constructor(options?: ErrorOptions);
|
|
339
|
-
}
|
|
340
306
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQzC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQzC;;GAEG;AACH,qBAAa,qBAAqB,CAChC,KAAK,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAC3D,SAAQ,SAAS,CAAC,KAAK,CAAC;CAAG;AAI7B;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,G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