unikvs 0.0.12 → 0.0.13

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.
Files changed (82) hide show
  1. package/README.md +2 -2
  2. package/dist/index.d.ts +1553 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +4032 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +34 -34
  7. package/src/_contexts.ts +1089 -0
  8. package/src/_logger.ts +5 -3
  9. package/src/_middleware.ts +207 -0
  10. package/src/_pipeline-graph.helpers.ts +183 -0
  11. package/src/_pipeline-graph.ts +1307 -0
  12. package/src/_pipeline-graph.types.ts +303 -0
  13. package/src/_pipeline-leaf-resolver.ts +70 -0
  14. package/src/_plugin-lifecycle.ts +201 -0
  15. package/src/_storage.ts +169 -115
  16. package/src/_streams.schemas.ts +21 -0
  17. package/src/_streams.ts +32 -6
  18. package/src/_to-value-stream.ts +22 -11
  19. package/src/_types.ts +237 -0
  20. package/src/_unikvs-branch.ts +94 -0
  21. package/src/_unikvs.schemas.ts +451 -0
  22. package/src/_valibot.ts +17 -6
  23. package/src/_value-schemas.ts +36 -206
  24. package/src/_value-validation.ts +57 -0
  25. package/src/errors.ts +391 -148
  26. package/src/index.ts +46 -25
  27. package/src/{value-stream.types.ts → types.ts} +1 -1
  28. package/src/unikvs-branch.ts +445 -0
  29. package/src/unikvs-builder.ts +706 -0
  30. package/src/unikvs.ts +1423 -1007
  31. package/src/unikvs.types.ts +194 -0
  32. package/src/value-schemas.ts +98 -0
  33. package/dist/src/_logger.d.ts +0 -3
  34. package/dist/src/_logger.d.ts.map +0 -1
  35. package/dist/src/_logger.js +0 -3
  36. package/dist/src/_merge-variables.d.ts +0 -13
  37. package/dist/src/_merge-variables.d.ts.map +0 -1
  38. package/dist/src/_merge-variables.js +0 -12
  39. package/dist/src/_storage.d.ts +0 -18
  40. package/dist/src/_storage.d.ts.map +0 -1
  41. package/dist/src/_storage.js +0 -103
  42. package/dist/src/_streams.d.ts +0 -20
  43. package/dist/src/_streams.d.ts.map +0 -1
  44. package/dist/src/_streams.js +0 -36
  45. package/dist/src/_to-value-stream.d.ts +0 -12
  46. package/dist/src/_to-value-stream.d.ts.map +0 -1
  47. package/dist/src/_to-value-stream.js +0 -102
  48. package/dist/src/_transformer.d.ts +0 -13
  49. package/dist/src/_transformer.d.ts.map +0 -1
  50. package/dist/src/_transformer.js +0 -60
  51. package/dist/src/_valibot.d.ts +0 -15
  52. package/dist/src/_valibot.d.ts.map +0 -1
  53. package/dist/src/_valibot.js +0 -23
  54. package/dist/src/_value-schemas.d.ts +0 -179
  55. package/dist/src/_value-schemas.d.ts.map +0 -1
  56. package/dist/src/_value-schemas.js +0 -150
  57. package/dist/src/errors.d.ts +0 -306
  58. package/dist/src/errors.d.ts.map +0 -1
  59. package/dist/src/errors.js +0 -234
  60. package/dist/src/index.d.ts +0 -10
  61. package/dist/src/index.d.ts.map +0 -1
  62. package/dist/src/index.js +0 -3
  63. package/dist/src/unikvs-config.d.ts +0 -174
  64. package/dist/src/unikvs-config.d.ts.map +0 -1
  65. package/dist/src/unikvs-config.js +0 -100
  66. package/dist/src/unikvs.d.ts +0 -272
  67. package/dist/src/unikvs.d.ts.map +0 -1
  68. package/dist/src/unikvs.js +0 -928
  69. package/dist/src/utils.types.d.ts +0 -5
  70. package/dist/src/utils.types.d.ts.map +0 -1
  71. package/dist/src/utils.types.js +0 -1
  72. package/dist/src/value-stream.types.d.ts +0 -10
  73. package/dist/src/value-stream.types.d.ts.map +0 -1
  74. package/dist/src/value-stream.types.js +0 -1
  75. package/dist/src/variables.types.d.ts +0 -11
  76. package/dist/src/variables.types.d.ts.map +0 -1
  77. package/dist/src/variables.types.js +0 -1
  78. package/src/_merge-variables.ts +0 -19
  79. package/src/_transformer.ts +0 -89
  80. package/src/unikvs-config.ts +0 -401
  81. package/src/utils.types.ts +0 -4
  82. package/src/variables.types.ts +0 -13
@@ -1,306 +0,0 @@
1
- import { ErrorBase, type ErrorOptions, type ErrorMeta, type IStorage } from "@unikvs/core";
2
- import type { BaseIssue } from "valibot";
3
- /**
4
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
5
- */
6
- export declare class InvalidUsageErrorBase<TMeta extends ErrorMeta | undefined = ErrorMeta | undefined> extends ErrorBase<TMeta> {
7
- }
8
- /**
9
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
10
- */
11
- export type Issue = BaseIssue<unknown>;
12
- /**
13
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
14
- */
15
- export type InvalidInputErrorMeta = {
16
- /**
17
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
18
- */
19
- readonly input: unknown;
20
- /**
21
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
22
- */
23
- readonly issues: readonly [Issue, ...Issue[]];
24
- };
25
- /**
26
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
27
- */
28
- export type InvalidInputErrorArgs = ErrorOptions & {
29
- /**
30
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
31
- */
32
- readonly value: unknown;
33
- /**
34
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
35
- */
36
- readonly issues: readonly [Issue, ...Issue[]];
37
- };
38
- /**
39
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
40
- */
41
- export declare class InvalidInputError extends InvalidUsageErrorBase<InvalidInputErrorMeta> {
42
- constructor(args: InvalidInputErrorArgs);
43
- }
44
- /**
45
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
46
- */
47
- export type InvalidOutputErrorMeta = {
48
- /**
49
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
50
- */
51
- readonly output: unknown;
52
- /**
53
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
54
- */
55
- readonly issues: readonly [Issue, ...Issue[]];
56
- };
57
- /**
58
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
59
- */
60
- export type InvalidOutputErrorArgs = ErrorOptions & {
61
- /**
62
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
63
- */
64
- readonly value: unknown;
65
- /**
66
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
67
- */
68
- readonly issues: readonly [Issue, ...Issue[]];
69
- };
70
- /**
71
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
72
- */
73
- export declare class InvalidOutputError extends InvalidUsageErrorBase<InvalidOutputErrorMeta> {
74
- constructor(args: InvalidOutputErrorArgs);
75
- }
76
- /**
77
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
78
- */
79
- export declare class UniKvsIsOpenError extends ErrorBase<undefined> {
80
- constructor(options?: ErrorOptions);
81
- }
82
- /**
83
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
84
- */
85
- export declare class UniKvsIsNotOpenError extends ErrorBase<undefined> {
86
- constructor(options?: ErrorOptions);
87
- }
88
- /**
89
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
90
- */
91
- export type KeyNotFoundErrorMeta = {
92
- /**
93
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
94
- */
95
- readonly key: IStorage.Key;
96
- };
97
- /**
98
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
99
- */
100
- export type KeyNotFoundErrorArgs = ErrorOptions & KeyNotFoundErrorMeta;
101
- /**
102
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
103
- */
104
- export declare class KeyNotFoundError extends ErrorBase<KeyNotFoundErrorMeta> {
105
- constructor(args: KeyNotFoundErrorArgs);
106
- }
107
- /**
108
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
109
- */
110
- export type StorageIsNotOpenErrorMeta = {
111
- /**
112
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
113
- */
114
- readonly name: string;
115
- };
116
- /**
117
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
118
- */
119
- export type StorageIsNotOpenErrorArgs = ErrorOptions & StorageIsNotOpenErrorMeta;
120
- /**
121
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
122
- */
123
- export declare class StorageIsNotOpenError extends ErrorBase<StorageIsNotOpenErrorMeta> {
124
- constructor(args: StorageIsNotOpenErrorArgs);
125
- }
126
- /**
127
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
128
- */
129
- export type WritableStreamNotSupportedErrorMeta = {
130
- /**
131
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
132
- */
133
- readonly name: string;
134
- };
135
- /**
136
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
137
- */
138
- export type WritableStreamNotSupportedErrorArgs = ErrorOptions & WritableStreamNotSupportedErrorMeta;
139
- /**
140
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
141
- */
142
- export declare class WritableStreamNotSupportedError extends ErrorBase<WritableStreamNotSupportedErrorMeta> {
143
- constructor(args: WritableStreamNotSupportedErrorArgs);
144
- }
145
- /**
146
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
147
- */
148
- export type ReadableStreamNotSupportedErrorMeta = {
149
- /**
150
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
151
- */
152
- readonly name: string;
153
- };
154
- /**
155
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
156
- */
157
- export type ReadableStreamNotSupportedErrorArgs = ErrorOptions & ReadableStreamNotSupportedErrorMeta;
158
- /**
159
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
160
- */
161
- export declare class ReadableStreamNotSupportedError extends ErrorBase<ReadableStreamNotSupportedErrorMeta> {
162
- constructor(args: ReadableStreamNotSupportedErrorArgs);
163
- }
164
- /**
165
- * MultipartWriteNotSupportedError に付与されるメタデータです。
166
- */
167
- export type MultipartWriteNotSupportedErrorMeta = {
168
- /**
169
- * 対象のストレージの名前です。
170
- */
171
- readonly name: string;
172
- };
173
- /**
174
- * MultipartWriteNotSupportedError のコンストラクター引数です。
175
- *
176
- * エラーの追加情報 (`cause`) も含みます。
177
- */
178
- export type MultipartWriteNotSupportedErrorArgs = ErrorOptions & MultipartWriteNotSupportedErrorMeta;
179
- /**
180
- * ストレージがマルチパート書き込みをサポートしていない場合に投げられるエラーです。
181
- */
182
- export declare class MultipartWriteNotSupportedError extends ErrorBase<MultipartWriteNotSupportedErrorMeta> {
183
- constructor(args: MultipartWriteNotSupportedErrorArgs);
184
- }
185
- /**
186
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
187
- */
188
- export type TransformerIsNotOpenErrorMeta = {
189
- /**
190
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
191
- */
192
- readonly name: string;
193
- };
194
- /**
195
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
196
- */
197
- export type TransformerIsNotOpenErrorArgs = ErrorOptions & TransformerIsNotOpenErrorMeta;
198
- /**
199
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
200
- */
201
- export declare class TransformerIsNotOpenError extends ErrorBase<TransformerIsNotOpenErrorMeta> {
202
- constructor(args: TransformerIsNotOpenErrorArgs);
203
- }
204
- /**
205
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
206
- */
207
- export type EncodableStreamNotSupportedErrorMeta = {
208
- /**
209
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
210
- */
211
- readonly name: string;
212
- };
213
- /**
214
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
215
- */
216
- export type EncodableStreamNotSupportedErrorArgs = ErrorOptions & EncodableStreamNotSupportedErrorMeta;
217
- /**
218
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
219
- */
220
- export declare class EncodableStreamNotSupportedError extends ErrorBase<EncodableStreamNotSupportedErrorMeta> {
221
- constructor(args: EncodableStreamNotSupportedErrorArgs);
222
- }
223
- /**
224
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
225
- */
226
- export type DecodableStreamNotSupportedErrorMeta = {
227
- /**
228
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
229
- */
230
- readonly name: string;
231
- };
232
- /**
233
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
234
- */
235
- export type DecodableStreamNotSupportedErrorArgs = ErrorOptions & DecodableStreamNotSupportedErrorMeta;
236
- /**
237
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
238
- */
239
- export declare class DecodableStreamNotSupportedError extends ErrorBase<DecodableStreamNotSupportedErrorMeta> {
240
- constructor(args: DecodableStreamNotSupportedErrorArgs);
241
- }
242
- /**
243
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
244
- */
245
- export type PluginOperationAggregateErrorMeta = {
246
- /**
247
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
248
- */
249
- readonly plugin: "plugin" | "storage" | "transformer";
250
- /**
251
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
252
- */
253
- readonly action: "open" | "close" | "write" | "read" | "delete" | "clear";
254
- /**
255
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
256
- */
257
- readonly errors: readonly {
258
- /**
259
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
260
- */
261
- readonly plugin: "storage" | "transformer";
262
- /**
263
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
264
- */
265
- readonly reason: unknown;
266
- }[];
267
- };
268
- /**
269
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
270
- */
271
- export type PluginOperationAggregateErrorArgs = ErrorOptions & {
272
- /**
273
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
274
- */
275
- readonly plugin?: "storage" | "transformer";
276
- /**
277
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
278
- */
279
- readonly action: "open" | "close" | "write" | "read" | "delete" | "clear";
280
- /**
281
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
282
- */
283
- readonly errors: readonly {
284
- /**
285
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
286
- */
287
- readonly plugin?: "storage" | "transformer";
288
- /**
289
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
290
- */
291
- readonly reason: unknown;
292
- }[];
293
- };
294
- /**
295
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
296
- */
297
- export declare class PluginOperationAggregateError extends ErrorBase<PluginOperationAggregateErrorMeta> {
298
- constructor(args: PluginOperationAggregateErrorArgs);
299
- }
300
- /**
301
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
302
- */
303
- export declare class MissingStorageError extends ErrorBase<undefined> {
304
- constructor(options?: ErrorOptions);
305
- }
306
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
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;I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orBase, } from "@unikvs/core";
3
- // -------------------------------------------------------------------------------------------------
4
- //
5
- // 境界エラー
6
- //
7
- // -------------------------------------------------------------------------------------------------
8
- /**
9
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
10
- */
11
- export class InvalidUsageErrorBase extends ErrorBase {
12
- }
13
- /**
14
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
15
- */
16
- export class InvalidInputError extends InvalidUsageErrorBase {
17
- constructor(args) {
18
- const { value: input, issues, ...options } = args;
19
- const meta = { input, issues };
20
- super(meta, ({ issues }) => issues.map((i) => i.message).join(": "), options);
21
- }
22
- }
23
- _a = InvalidInputError;
24
- (() => {
25
- _a.prototype.name = "UniKvsInvalidInputError";
26
- })();
27
- /**
28
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
29
- */
30
- export class InvalidOutputError extends InvalidUsageErrorBase {
31
- constructor(args) {
32
- const { value: output, issues, ...options } = args;
33
- const meta = { output, issues };
34
- super(meta, ({ issues }) => issues.map((i) => i.message).join(": "), options);
35
- }
36
- }
37
- _b = InvalidOutputError;
38
- (() => {
39
- _b.prototype.name = "UniKvsInvalidOutputError";
40
- })();
41
- // -------------------------------------------------------------------------------------------------
42
- //
43
- // UniKvs
44
- //
45
- // -------------------------------------------------------------------------------------------------
46
- /**
47
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
48
- */
49
- export class UniKvsIsOpenError extends ErrorBase {
50
- constructor(options) {
51
- super("UniKvs is open", options);
52
- }
53
- }
54
- _c = UniKvsIsOpenError;
55
- (() => {
56
- _c.prototype.name = "UniKvsIsOpenError";
57
- })();
58
- setErrorMessage(UniKvsIsOpenError, "UniKvs は開いています", "ja");
59
- /**
60
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
61
- */
62
- export class UniKvsIsNotOpenError extends ErrorBase {
63
- constructor(options) {
64
- super("UniKvs is not open", options);
65
- }
66
- }
67
- _d = UniKvsIsNotOpenError;
68
- (() => {
69
- _d.prototype.name = "UniKvsIsNotOpenError";
70
- })();
71
- setErrorMessage(UniKvsIsNotOpenError, "UniKvs は開いていません", "ja");
72
- /**
73
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
74
- */
75
- export class KeyNotFoundError extends ErrorBase {
76
- constructor(args) {
77
- const { key, ...options } = args;
78
- const meta = { key };
79
- super(meta, ({ key }) => `IStorage.Key ${JSON.stringify(key)} not found`, options);
80
- }
81
- }
82
- _e = KeyNotFoundError;
83
- (() => {
84
- _e.prototype.name = "UniKvsKeyNotFoundError";
85
- })();
86
- setErrorMessage(KeyNotFoundError, ({ key }) => `キー ${JSON.stringify(key)} が見つかりません`, "ja");
87
- /**
88
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
89
- */
90
- export class StorageIsNotOpenError extends ErrorBase {
91
- constructor(args) {
92
- const { name, ...options } = args;
93
- const meta = { name };
94
- super(meta, ({ name }) => `Storage "${name}" is not open`, options);
95
- }
96
- }
97
- _f = StorageIsNotOpenError;
98
- (() => {
99
- _f.prototype.name = "UniKvsStorageIsNotOpenError";
100
- })();
101
- setErrorMessage(StorageIsNotOpenError, ({ name }) => `ストレージ "${name}" は開いていません`, "ja");
102
- /**
103
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
104
- */
105
- export class WritableStreamNotSupportedError extends ErrorBase {
106
- constructor(args) {
107
- const { name, ...options } = args;
108
- const meta = { name };
109
- super(meta, ({ name }) => `Storage "${name}" does not support writable stream`, options);
110
- }
111
- }
112
- _g = WritableStreamNotSupportedError;
113
- (() => {
114
- _g.prototype.name = "UniKvsWritableStreamNotSupportedError";
115
- })();
116
- setErrorMessage(WritableStreamNotSupportedError, ({ name }) => `ストレージ "${name}" は書き込み可能なストリームをサポートしていません`, "ja");
117
- /**
118
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
119
- */
120
- export class ReadableStreamNotSupportedError extends ErrorBase {
121
- constructor(args) {
122
- const { name, ...options } = args;
123
- const meta = { name };
124
- super(meta, ({ name }) => `Storage "${name}" does not support readable stream`, options);
125
- }
126
- }
127
- _h = ReadableStreamNotSupportedError;
128
- (() => {
129
- _h.prototype.name = "UniKvsReadableStreamNotSupportedError";
130
- })();
131
- setErrorMessage(ReadableStreamNotSupportedError, ({ name }) => `ストレージ "${name}" は読み取り可能なストリームをサポートしていません`, "ja");
132
- /**
133
- * ストレージがマルチパート書き込みをサポートしていない場合に投げられるエラーです。
134
- */
135
- export class MultipartWriteNotSupportedError extends ErrorBase {
136
- constructor(args) {
137
- const { name, ...options } = args;
138
- const meta = { name };
139
- super(meta, ({ name }) => `Storage "${name}" does not support multipart-write`, options);
140
- }
141
- }
142
- _j = MultipartWriteNotSupportedError;
143
- (() => {
144
- _j.prototype.name = "UniKvsMultipartWriteNotSupportedError";
145
- })();
146
- setErrorMessage(MultipartWriteNotSupportedError, ({ name }) => `ストレージ "${name}" はマルチパート書き込みをサポートしていません`, "ja");
147
- /**
148
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
149
- */
150
- export class TransformerIsNotOpenError extends ErrorBase {
151
- constructor(args) {
152
- const { name, ...options } = args;
153
- const meta = { name };
154
- super(meta, ({ name }) => `Transformer "${name}" is not open`, options);
155
- }
156
- }
157
- _k = TransformerIsNotOpenError;
158
- (() => {
159
- _k.prototype.name = "UniKvsTransformerIsNotOpenError";
160
- })();
161
- setErrorMessage(TransformerIsNotOpenError, ({ name }) => `トランスフォーマー "${name}" は開いていません`, "ja");
162
- /**
163
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
164
- */
165
- export class EncodableStreamNotSupportedError extends ErrorBase {
166
- constructor(args) {
167
- const { name, ...options } = args;
168
- const meta = { name };
169
- super(meta, ({ name }) => `Transformer "${name}" does not support encodable stream`, options);
170
- }
171
- }
172
- _l = EncodableStreamNotSupportedError;
173
- (() => {
174
- _l.prototype.name = "UniKvsEncodableStreamNotSupportedError";
175
- })();
176
- setErrorMessage(EncodableStreamNotSupportedError, ({ name }) => `トランスフォーマー "${name}" はエンコード可能なストリームをサポートしていません`, "ja");
177
- /**
178
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
179
- */
180
- export class DecodableStreamNotSupportedError extends ErrorBase {
181
- constructor(args) {
182
- const { name, ...options } = args;
183
- const meta = { name };
184
- super(meta, ({ name }) => `Transformer "${name}" does not support decodable stream`, options);
185
- }
186
- }
187
- _m = DecodableStreamNotSupportedError;
188
- (() => {
189
- _m.prototype.name = "UniKvsDecodableStreamNotSupportedError";
190
- })();
191
- setErrorMessage(DecodableStreamNotSupportedError, ({ name }) => `トランスフォーマー "${name}" はデコード可能なストリームをサポートしていません`, "ja");
192
- /**
193
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
194
- */
195
- export class PluginOperationAggregateError extends ErrorBase {
196
- constructor(args) {
197
- const { plugin, action, errors, ...options } = args;
198
- // 個々のエラーで種別が指定されていない場合は、既定の種別で補完します。
199
- const normalizedErrors = errors.map((error) => ({
200
- plugin: error.plugin ?? plugin ?? "",
201
- reason: error.reason,
202
- }));
203
- const plugins = [...new Set(normalizedErrors.map((error) => error.plugin))];
204
- const meta = {
205
- plugin: plugins.length === 1 ? plugins[0] : "plugin",
206
- action,
207
- errors: normalizedErrors,
208
- };
209
- super(meta, ({ action, errors, plugin }) => `${errors.length} ${plugin}(s) fail ${action} operation`, options);
210
- }
211
- }
212
- _o = PluginOperationAggregateError;
213
- (() => {
214
- _o.prototype.name = "UniKvsPluginOperationAggregateError";
215
- })();
216
- setErrorMessage(PluginOperationAggregateError, ({ action, errors, plugin }) => `${errors.length} 個の${{ plugin: "プラグイン", storage: "ストレージ", transformer: "トランスフォーマー" }[plugin]}が ${action} 操作に失敗`, "ja");
217
- // -------------------------------------------------------------------------------------------------
218
- //
219
- // その他
220
- //
221
- // -------------------------------------------------------------------------------------------------
222
- /**
223
- * [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#errors)
224
- */
225
- export class MissingStorageError extends ErrorBase {
226
- constructor(options) {
227
- super("At least one storage is required to use UniKvs", options);
228
- }
229
- }
230
- _p = MissingStorageError;
231
- (() => {
232
- _p.prototype.name = "UniKvsMissingStorageError";
233
- })();
234
- setErrorMessage(MissingStorageError, "UniKvs を使用するためには最低 1 つのストレージが必要です", "ja");
@@ -1,10 +0,0 @@
1
- export type * from "./variables.types.js";
2
- export type { DecodableStreamNotSupportedErrorArgs, DecodableStreamNotSupportedErrorMeta, EncodableStreamNotSupportedErrorArgs, EncodableStreamNotSupportedErrorMeta, InvalidInputErrorArgs, InvalidInputErrorMeta, InvalidOutputErrorArgs, InvalidOutputErrorMeta, Issue, KeyNotFoundErrorArgs, KeyNotFoundErrorMeta, PluginOperationAggregateErrorArgs, PluginOperationAggregateErrorMeta, ReadableStreamNotSupportedErrorArgs, ReadableStreamNotSupportedErrorMeta, StorageIsNotOpenErrorArgs, StorageIsNotOpenErrorMeta, TransformerIsNotOpenErrorArgs, TransformerIsNotOpenErrorMeta, WritableStreamNotSupportedErrorArgs, WritableStreamNotSupportedErrorMeta, } from "./errors.js";
3
- export { DecodableStreamNotSupportedError, EncodableStreamNotSupportedError, InvalidInputError, InvalidOutputError, InvalidUsageErrorBase, KeyNotFoundError, MissingStorageError, PluginOperationAggregateError, ReadableStreamNotSupportedError, StorageIsNotOpenError, TransformerIsNotOpenError, UniKvsIsNotOpenError, UniKvsIsOpenError, WritableStreamNotSupportedError, } from "./errors.js";
4
- export type * from "./unikvs-config.js";
5
- export { PlainValue, StreamValue, Value, default as UniKvsConfig } from "./unikvs-config.js";
6
- export type * from "./unikvs.js";
7
- export { default as UniKvs } from "./unikvs.js";
8
- export type * from "./utils.types.js";
9
- export type * from "./value-stream.types.js";
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,sBAAsB,CAAC;AAE1C,YAAY,EACV,oCAAoC,EACpC,oCAAoC,EACpC,oCAAoC,EACpC,oCAAoC,EACpC,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACpB,iCAAiC,EACjC,iCAAiC,EACjC,mCAAmC,EACnC,mCAAmC,EACnC,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gCAAgC,EAChC,gCAAgC,EAChC,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC7B,+BAA+B,EAC/B,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,+BAA+B,GAChC,MAAM,aAAa,CAAC;AAErB,mBAAmB,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7F,mBAAmB,aAAa,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhD,mBAAmB,kBAAkB,CAAC;AAEtC,mBAAmB,yBAAyB,CAAC"}
package/dist/src/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { DecodableStreamNotSupportedError, EncodableStreamNotSupportedError, InvalidInputError, InvalidOutputError, InvalidUsageErrorBase, KeyNotFoundError, MissingStorageError, PluginOperationAggregateError, ReadableStreamNotSupportedError, StorageIsNotOpenError, TransformerIsNotOpenError, UniKvsIsNotOpenError, UniKvsIsOpenError, WritableStreamNotSupportedError, } from "./errors.js";
2
- export { PlainValue, StreamValue, Value, default as UniKvsConfig } from "./unikvs-config.js";
3
- export { default as UniKvs } from "./unikvs.js";