unikvs 0.0.4 → 0.0.5
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/dist/src/_storage.d.ts +9 -9
- package/dist/src/_storage.d.ts.map +1 -1
- package/dist/src/_storage.js +13 -5
- package/dist/src/_transformer.d.ts +2 -2
- package/dist/src/_transformer.d.ts.map +1 -1
- package/dist/src/_transformer.js +10 -4
- package/dist/src/_valibot.d.ts +10 -9
- package/dist/src/_valibot.d.ts.map +1 -1
- package/dist/src/_valibot.js +13 -3
- package/dist/src/errors.d.ts +9 -2
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +25 -15
- package/dist/src/unikvs-config.d.ts +5 -5
- package/dist/src/unikvs-config.d.ts.map +1 -1
- package/dist/src/unikvs-config.js +1 -1
- package/dist/src/unikvs.d.ts +6 -6
- package/dist/src/unikvs.d.ts.map +1 -1
- package/dist/src/unikvs.js +28 -29
- package/package.json +19 -18
- package/src/_storage.ts +30 -13
- package/src/_transformer.ts +16 -6
- package/src/_valibot.ts +50 -10
- package/src/errors.ts +31 -3
- package/src/unikvs-config.ts +5 -8
- package/src/unikvs.ts +35 -36
package/dist/src/_storage.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { Context, IReadableStream, IStorage, IWritableStream
|
|
1
|
+
import type { Context, IReadableStream, IStorage, IWritableStream } from "@unikvs/core";
|
|
2
2
|
import { type PluginOperationAggregateError } from "./errors.js";
|
|
3
|
-
export
|
|
3
|
+
export default class UniKvsStorage {
|
|
4
4
|
private readonly io;
|
|
5
5
|
constructor(io: IStorage);
|
|
6
6
|
open(context: Context, signal: AbortSignal): Promise<void>;
|
|
7
7
|
close(context: Context, signal: AbortSignal): Promise<void>;
|
|
8
|
-
onOtherWriteError(context: Context, signal: AbortSignal, key: Key, error: PluginOperationAggregateError): Promise<void>;
|
|
9
|
-
write(context: Context, signal: AbortSignal, key: Key, data:
|
|
10
|
-
read(context: Context, signal: AbortSignal, key: Key): Promise<
|
|
11
|
-
exists(context: Context, signal: AbortSignal, key: Key): Promise<boolean>;
|
|
12
|
-
delete(context: Context, signal: AbortSignal, key: Key): Promise<void>;
|
|
8
|
+
onOtherWriteError(context: Context, signal: AbortSignal, key: IStorage.Key, error: PluginOperationAggregateError): Promise<void>;
|
|
9
|
+
write(context: Context, signal: AbortSignal, key: IStorage.Key, data: unknown): Promise<void>;
|
|
10
|
+
read(context: Context, signal: AbortSignal, key: IStorage.Key): Promise<unknown>;
|
|
11
|
+
exists(context: Context, signal: AbortSignal, key: IStorage.Key): Promise<boolean>;
|
|
12
|
+
delete(context: Context, signal: AbortSignal, key: IStorage.Key): Promise<void>;
|
|
13
13
|
clear(context: Context, signal: AbortSignal): Promise<void>;
|
|
14
|
-
getWritable(context: Context, signal: AbortSignal, key: Key): Promise<IWritableStream>;
|
|
15
|
-
getReadable(context: Context, signal: AbortSignal, key: Key): Promise<IReadableStream>;
|
|
14
|
+
getWritable(context: Context, signal: AbortSignal, key: IStorage.Key): Promise<IWritableStream>;
|
|
15
|
+
getReadable(context: Context, signal: AbortSignal, key: IStorage.Key): Promise<IReadableStream>;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=_storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_storage.d.ts","sourceRoot":"","sources":["../../src/_storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"_storage.d.ts","sourceRoot":"","sources":["../../src/_storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGxF,OAAO,EACL,KAAK,6BAA6B,EAInC,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,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AAQ,CAAC,GAAG,GAChB,OAAO,CAAC,eAAe,CAAC;CAc5B"}
|
package/dist/src/_storage.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as v from "./_valibot.js";
|
|
1
2
|
import { ReadableStreamNotSupportedError, StorageIsNotOpenError, WritableStreamNotSupportedError, } from "./errors.js";
|
|
2
|
-
export class UniKvsStorage {
|
|
3
|
+
export default class UniKvsStorage {
|
|
3
4
|
constructor(io) {
|
|
4
5
|
this.io = io;
|
|
5
6
|
}
|
|
@@ -43,13 +44,16 @@ export class UniKvsStorage {
|
|
|
43
44
|
if (!this.io.isOpen) {
|
|
44
45
|
throw new StorageIsNotOpenError({ name: this.io.name });
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
+
const output = await this.io.read({ key, signal, context });
|
|
48
|
+
return output;
|
|
47
49
|
}
|
|
48
50
|
async exists(context, signal, key) {
|
|
49
51
|
if (!this.io.isOpen) {
|
|
50
52
|
throw new StorageIsNotOpenError({ name: this.io.name });
|
|
51
53
|
}
|
|
52
|
-
|
|
54
|
+
const output = await this.io.exists({ key, signal, context });
|
|
55
|
+
const parsed = Boolean(output);
|
|
56
|
+
return parsed;
|
|
53
57
|
}
|
|
54
58
|
async delete(context, signal, key) {
|
|
55
59
|
if (!this.io.isOpen) {
|
|
@@ -70,7 +74,9 @@ export class UniKvsStorage {
|
|
|
70
74
|
if (typeof this.io.getWritable !== "function") {
|
|
71
75
|
throw new WritableStreamNotSupportedError({ name: this.io.name });
|
|
72
76
|
}
|
|
73
|
-
|
|
77
|
+
const output = await this.io.getWritable({ key, signal, context });
|
|
78
|
+
const parsed = v.parseOutput(v.instance(WritableStream), output);
|
|
79
|
+
return parsed;
|
|
74
80
|
}
|
|
75
81
|
async getReadable(context, signal, key) {
|
|
76
82
|
if (!this.io.isOpen) {
|
|
@@ -79,6 +85,8 @@ export class UniKvsStorage {
|
|
|
79
85
|
if (typeof this.io.getReadable !== "function") {
|
|
80
86
|
throw new ReadableStreamNotSupportedError({ name: this.io.name });
|
|
81
87
|
}
|
|
82
|
-
|
|
88
|
+
const output = await this.io.getReadable({ key, signal, context });
|
|
89
|
+
const parsed = v.parseOutput(v.instance(ReadableStream), output);
|
|
90
|
+
return parsed;
|
|
83
91
|
}
|
|
84
92
|
}
|
|
@@ -4,8 +4,8 @@ export default class UniKvsTransformer {
|
|
|
4
4
|
constructor(tf: ITransformer);
|
|
5
5
|
open(context: Context, signal: AbortSignal): Promise<void>;
|
|
6
6
|
close(context: Context, signal: AbortSignal): Promise<void>;
|
|
7
|
-
encode(context: Context, signal: AbortSignal, data: any): Promise<
|
|
8
|
-
decode(context: Context, signal: AbortSignal, data: any): Promise<
|
|
7
|
+
encode(context: Context, signal: AbortSignal, data: any): Promise<unknown>;
|
|
8
|
+
decode(context: Context, signal: AbortSignal, data: any): Promise<unknown>;
|
|
9
9
|
getEncodable(context: Context, signal: AbortSignal): Promise<IEncodable>;
|
|
10
10
|
getDecodable(context: Context, signal: AbortSignal): Promise<IDecodable>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_transformer.d.ts","sourceRoot":"","sources":["../../src/_transformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQlF,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAe;gBAEf,EAAE,EAAE,YAAY;IAItB,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAU1D,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"_transformer.d.ts","sourceRoot":"","sources":["../../src/_transformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAQlF,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAe;gBAEf,EAAE,EAAE,YAAY;IAItB,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAU1D,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3D,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAU1E,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAU1E,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAexE,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;CActF"}
|
package/dist/src/_transformer.js
CHANGED
|
@@ -23,13 +23,15 @@ export default class UniKvsTransformer {
|
|
|
23
23
|
if (!this.tf.isOpen) {
|
|
24
24
|
throw new TransformerIsNotOpenError({ name: this.tf.name });
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
const output = await this.tf.encode({ data, signal, context });
|
|
27
|
+
return output;
|
|
27
28
|
}
|
|
28
29
|
async decode(context, signal, data) {
|
|
29
30
|
if (!this.tf.isOpen) {
|
|
30
31
|
throw new TransformerIsNotOpenError({ name: this.tf.name });
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
const output = await this.tf.decode({ data, signal, context });
|
|
34
|
+
return output;
|
|
33
35
|
}
|
|
34
36
|
async getEncodable(context, signal) {
|
|
35
37
|
if (!this.tf.isOpen) {
|
|
@@ -38,7 +40,9 @@ export default class UniKvsTransformer {
|
|
|
38
40
|
if (typeof this.tf.getEncodable !== "function") {
|
|
39
41
|
throw new EncodableStreamNotSupportedError({ name: this.tf.name });
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
const output = await this.tf.getEncodable({ signal, context });
|
|
44
|
+
const parsed = output; // TODO(tai-kun): 要検証
|
|
45
|
+
return parsed;
|
|
42
46
|
}
|
|
43
47
|
async getDecodable(context, signal) {
|
|
44
48
|
if (!this.tf.isOpen) {
|
|
@@ -47,6 +51,8 @@ export default class UniKvsTransformer {
|
|
|
47
51
|
if (typeof this.tf.getDecodable !== "function") {
|
|
48
52
|
throw new DecodableStreamNotSupportedError({ name: this.tf.name });
|
|
49
53
|
}
|
|
50
|
-
|
|
54
|
+
const output = await this.tf.getDecodable({ signal, context });
|
|
55
|
+
const parsed = output; // TODO(tai-kun): 要検証
|
|
56
|
+
return parsed;
|
|
51
57
|
}
|
|
52
58
|
}
|
package/dist/src/_valibot.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { ErrorOptions } from "@unikvs/core";
|
|
1
2
|
import { type InferOutput, safeParse } from "valibot";
|
|
2
|
-
import { type
|
|
3
|
+
import { type InvalidInputErrorArgs, type InvalidOutputErrorArgs } from "./errors.js";
|
|
4
|
+
export { any, omit, pipe, array, tuple, union, number, object, record, string, symbol, unknown, instance, minValue, optional, transform, safeInteger, } from "valibot";
|
|
3
5
|
type BaseSchema = typeof safeParse extends (schema: infer S, ...args: any) => any ? S : never;
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
readonly issues: readonly [Issue, ...Issue[]];
|
|
7
|
-
};
|
|
8
|
-
export interface ParseErrorConstructor {
|
|
9
|
-
new (args: ParseErrorConstructorArgs): Error;
|
|
6
|
+
export interface ParseInputErrorConstructor {
|
|
7
|
+
new (args: InvalidInputErrorArgs, options?: ErrorOptions): Error;
|
|
10
8
|
}
|
|
11
|
-
export declare function
|
|
12
|
-
export {
|
|
9
|
+
export declare function parseInput<const TSchema extends BaseSchema>(schema: TSchema, value: unknown, Error?: ParseInputErrorConstructor): InferOutput<TSchema>;
|
|
10
|
+
export interface ParseOutputErrorConstructor {
|
|
11
|
+
new (args: InvalidOutputErrorArgs, options?: ErrorOptions): Error;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseOutput<const TSchema extends BaseSchema>(schema: TSchema, value: unknown, Error?: ParseOutputErrorConstructor): InferOutput<TSchema>;
|
|
13
14
|
//# sourceMappingURL=_valibot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_valibot.d.ts","sourceRoot":"","sources":["../../src/_valibot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_valibot.d.ts","sourceRoot":"","sources":["../../src/_valibot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,KAAK,UAAU,GAAG,OAAO,SAAS,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAE9F,MAAM,WAAW,0BAA0B;IACzC,KAAK,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;CAClE;AAED,wBAAgB,UAAU,CAAC,KAAK,CAAC,OAAO,SAAS,UAAU,EACzD,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO,EACd,KAAK,GAAE,0BAA8C,GACpD,WAAW,CAAC,OAAO,CAAC,CAStB;AAED,MAAM,WAAW,2BAA2B;IAC1C,KAAK,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,KAAK,CAAC;CACnE;AAED,wBAAgB,WAAW,CAAC,KAAK,CAAC,OAAO,SAAS,UAAU,EAC1D,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,OAAO,EACd,KAAK,GAAE,2BAAgD,GACtD,WAAW,CAAC,OAAO,CAAC,CAStB"}
|
package/dist/src/_valibot.js
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { tryCaptureStackTrace } from "try-capture-stack-trace";
|
|
2
2
|
import { safeParse } from "valibot";
|
|
3
|
-
import { InvalidInputError } from "./errors.js";
|
|
4
|
-
export
|
|
3
|
+
import { InvalidInputError, InvalidOutputError, } from "./errors.js";
|
|
4
|
+
export { any, omit, pipe, array, tuple, union, number, object, record, string, symbol, unknown, instance, minValue, optional, transform, safeInteger, } from "valibot";
|
|
5
|
+
export function parseInput(schema, value, Error = InvalidInputError) {
|
|
5
6
|
const result = safeParse(schema, value);
|
|
6
7
|
if (result.success) {
|
|
7
8
|
return result.output;
|
|
8
9
|
}
|
|
9
10
|
const error = new Error({ value, issues: result.issues });
|
|
10
|
-
tryCaptureStackTrace(error,
|
|
11
|
+
tryCaptureStackTrace(error, parseInput);
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
export function parseOutput(schema, value, Error = InvalidOutputError) {
|
|
15
|
+
const result = safeParse(schema, value);
|
|
16
|
+
if (result.success) {
|
|
17
|
+
return result.output;
|
|
18
|
+
}
|
|
19
|
+
const error = new Error({ value, issues: result.issues });
|
|
20
|
+
tryCaptureStackTrace(error, parseOutput);
|
|
11
21
|
throw error;
|
|
12
22
|
}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBase, type ErrorOptions, type ErrorMeta,
|
|
1
|
+
import { ErrorBase, type ErrorOptions, type ErrorMeta, type IStorage } from "@unikvs/core";
|
|
2
2
|
import type { BaseIssue } from "valibot";
|
|
3
3
|
export declare class InvalidUsageErrorBase<TMeta extends ErrorMeta | undefined = ErrorMeta | undefined> extends ErrorBase<TMeta> {
|
|
4
4
|
}
|
|
@@ -32,7 +32,7 @@ export declare class UniKvsIsNotOpenError extends ErrorBase<undefined> {
|
|
|
32
32
|
constructor(options?: ErrorOptions);
|
|
33
33
|
}
|
|
34
34
|
export type KeyNotFoundErrorMeta = {
|
|
35
|
-
readonly key: Key;
|
|
35
|
+
readonly key: IStorage.Key;
|
|
36
36
|
};
|
|
37
37
|
export type KeyNotFoundErrorArgs = KeyNotFoundErrorMeta;
|
|
38
38
|
export declare class KeyNotFoundError extends ErrorBase<KeyNotFoundErrorMeta> {
|
|
@@ -59,6 +59,13 @@ export type ReadableStreamNotSupportedErrorArgs = ReadableStreamNotSupportedErro
|
|
|
59
59
|
export declare class ReadableStreamNotSupportedError extends ErrorBase<ReadableStreamNotSupportedErrorMeta> {
|
|
60
60
|
constructor(args: ReadableStreamNotSupportedErrorArgs, options?: ErrorOptions);
|
|
61
61
|
}
|
|
62
|
+
export type MultipartWriteNotSupportedErrorMeta = {
|
|
63
|
+
readonly name: string;
|
|
64
|
+
};
|
|
65
|
+
export type MultipartWriteNotSupportedErrorArgs = MultipartWriteNotSupportedErrorMeta;
|
|
66
|
+
export declare class MultipartWriteNotSupportedError extends ErrorBase<MultipartWriteNotSupportedErrorMeta> {
|
|
67
|
+
constructor(args: MultipartWriteNotSupportedErrorArgs, options?: ErrorOptions);
|
|
68
|
+
}
|
|
62
69
|
export type TransformerIsNotOpenErrorMeta = {
|
|
63
70
|
readonly name: string;
|
|
64
71
|
};
|
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,
|
|
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,qBAAa,qBAAqB,CAChC,KAAK,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAC3D,SAAQ,SAAS,CAAC,KAAK,CAAC;CAAG;AAI7B,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAEvC,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;CAC/C,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,qBAAqB,CAAC,qBAAqB,CAAC;gBAK9D,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,YAAY;CAIvE;AAID,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE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5 @@
|
|
|
1
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2
|
-
import { setErrorMessage, ErrorBase } from "@unikvs/core";
|
|
1
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
2
|
+
import { setErrorMessage, ErrorBase, } from "@unikvs/core";
|
|
3
3
|
// -------------------------------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
5
|
// 境界エラー
|
|
@@ -54,7 +54,7 @@ _d = UniKvsIsNotOpenError;
|
|
|
54
54
|
setErrorMessage(UniKvsIsNotOpenError, "UniKvs は開いていません", "ja");
|
|
55
55
|
export class KeyNotFoundError extends ErrorBase {
|
|
56
56
|
constructor(args, options) {
|
|
57
|
-
super(args, ({ key }) => `Key ${JSON.stringify(key)} not found`, options);
|
|
57
|
+
super(args, ({ key }) => `IStorage.Key ${JSON.stringify(key)} not found`, options);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
_e = KeyNotFoundError;
|
|
@@ -92,14 +92,24 @@ _h = ReadableStreamNotSupportedError;
|
|
|
92
92
|
_h.prototype.name = "UniKvsReadableStreamNotSupportedError";
|
|
93
93
|
})();
|
|
94
94
|
setErrorMessage(StorageIsNotOpenError, ({ name }) => `ストレージ "${name}" は読み取り可能なストリームをサポートしていません`, "ja");
|
|
95
|
+
export class MultipartWriteNotSupportedError extends ErrorBase {
|
|
96
|
+
constructor(args, options) {
|
|
97
|
+
super(args, ({ name }) => `Storage "${name}" does not support multipart-write`, options);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
_j = MultipartWriteNotSupportedError;
|
|
101
|
+
(() => {
|
|
102
|
+
_j.prototype.name = "UniKvsMultipartWriteNotSupportedError";
|
|
103
|
+
})();
|
|
104
|
+
setErrorMessage(StorageIsNotOpenError, ({ name }) => `ストレージ "${name}" はマルチパート書き込みをサポートしていません`, "ja");
|
|
95
105
|
export class TransformerIsNotOpenError extends ErrorBase {
|
|
96
106
|
constructor(args, options) {
|
|
97
107
|
super(args, ({ name }) => `Transformer "${name}" is not open`, options);
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
|
-
|
|
110
|
+
_k = TransformerIsNotOpenError;
|
|
101
111
|
(() => {
|
|
102
|
-
|
|
112
|
+
_k.prototype.name = "UniKvsTransformerIsNotOpenError";
|
|
103
113
|
})();
|
|
104
114
|
setErrorMessage(TransformerIsNotOpenError, ({ name }) => `トランスフォーマー "${name}" は開いていません`, "ja");
|
|
105
115
|
export class EncodableStreamNotSupportedError extends ErrorBase {
|
|
@@ -107,9 +117,9 @@ export class EncodableStreamNotSupportedError extends ErrorBase {
|
|
|
107
117
|
super(args, ({ name }) => `Transformer "${name}" does not support encodable stream`, options);
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
|
-
|
|
120
|
+
_l = EncodableStreamNotSupportedError;
|
|
111
121
|
(() => {
|
|
112
|
-
|
|
122
|
+
_l.prototype.name = "UniKvsEncodableStreamNotSupportedError";
|
|
113
123
|
})();
|
|
114
124
|
setErrorMessage(TransformerIsNotOpenError, ({ name }) => `トランスフォーマー "${name}" はエンコード可能なストリームをサポートしていません`, "ja");
|
|
115
125
|
export class DecodableStreamNotSupportedError extends ErrorBase {
|
|
@@ -117,9 +127,9 @@ export class DecodableStreamNotSupportedError extends ErrorBase {
|
|
|
117
127
|
super(args, ({ name }) => `Transformer "${name}" does not support decodable stream`, options);
|
|
118
128
|
}
|
|
119
129
|
}
|
|
120
|
-
|
|
130
|
+
_m = DecodableStreamNotSupportedError;
|
|
121
131
|
(() => {
|
|
122
|
-
|
|
132
|
+
_m.prototype.name = "UniKvsDecodableStreamNotSupportedError";
|
|
123
133
|
})();
|
|
124
134
|
setErrorMessage(TransformerIsNotOpenError, ({ name }) => `トランスフォーマー "${name}" はデコード可能なストリームをサポートしていません`, "ja");
|
|
125
135
|
export class PluginOperationAggregateError extends ErrorBase {
|
|
@@ -136,9 +146,9 @@ export class PluginOperationAggregateError extends ErrorBase {
|
|
|
136
146
|
}, ({ action, errors, plugin }) => `${errors.length} ${plugin}(s) fail ${action} operation`, options);
|
|
137
147
|
}
|
|
138
148
|
}
|
|
139
|
-
|
|
149
|
+
_o = PluginOperationAggregateError;
|
|
140
150
|
(() => {
|
|
141
|
-
|
|
151
|
+
_o.prototype.name = "UniKvsPluginOperationAggregateError";
|
|
142
152
|
})();
|
|
143
153
|
setErrorMessage(PluginOperationAggregateError, ({ action, errors, plugin }) => `${errors.length} 個の${{ plugin: "プラグイン", storage: "ストレージ", transformer: "トランスフォーマー" }[plugin]}が ${action} 操作に失敗`, "ja");
|
|
144
154
|
// -------------------------------------------------------------------------------------------------
|
|
@@ -151,9 +161,9 @@ export class MissingStorageError extends ErrorBase {
|
|
|
151
161
|
super("At least one storage is required to use UniKvs", options);
|
|
152
162
|
}
|
|
153
163
|
}
|
|
154
|
-
|
|
164
|
+
_p = MissingStorageError;
|
|
155
165
|
(() => {
|
|
156
|
-
|
|
166
|
+
_p.prototype.name = "UniKvsMissingStorageError";
|
|
157
167
|
})();
|
|
158
168
|
setErrorMessage(MissingStorageError, "UniKvs を使用するためには最低 1 つのストレージが必要です", "ja");
|
|
159
169
|
// -------------------------------------------------------------------------------------------------
|
|
@@ -162,8 +172,8 @@ export class TransformerRegistrationError extends ErrorBase {
|
|
|
162
172
|
super("Cannot add transformers after storage has already been registered", options);
|
|
163
173
|
}
|
|
164
174
|
}
|
|
165
|
-
|
|
175
|
+
_q = TransformerRegistrationError;
|
|
166
176
|
(() => {
|
|
167
|
-
|
|
177
|
+
_q.prototype.name = "UniKvsTransformerRegistrationError";
|
|
168
178
|
})();
|
|
169
179
|
setErrorMessage(MissingStorageError, "ストレージが登録された後にトランスフォーマーを追加することはできません", "ja");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IReadableStreamStorage, IStorage, IWritableStreamStorage,
|
|
1
|
+
import type { IReadableStreamStorage, IStorage, IWritableStreamStorage, IDecodableStreamTransformer, IEncodableStreamTransformer, ITransformer } from "@unikvs/core";
|
|
2
2
|
import type { ContextSource } from "./context.types.js";
|
|
3
3
|
import type UniKvs from "./unikvs.js";
|
|
4
4
|
import type { ValueOf } from "./utils.types.js";
|
|
@@ -61,16 +61,16 @@ export type StreamValue<TChunkData = any> = [Type: typeof STREAM_VALUE, ChunkDat
|
|
|
61
61
|
/**
|
|
62
62
|
* UniKvs で扱う値の抽象型です。プレーンな値かストリーム値のいずれかになります。
|
|
63
63
|
*
|
|
64
|
-
* @template
|
|
64
|
+
* @template TData データまたはチャンクデータの型です。
|
|
65
65
|
*/
|
|
66
|
-
export type Value<
|
|
66
|
+
export type Value<TData = any> = PlainValue<TData> | StreamValue<TData>;
|
|
67
67
|
/**
|
|
68
68
|
* キーと値のマッピングを定義するオブジェクトの型です。
|
|
69
69
|
*
|
|
70
70
|
* @template T マッピングされる値の型です。
|
|
71
71
|
*/
|
|
72
72
|
export type KeyValueMapping<T = any> = {
|
|
73
|
-
readonly [key: Key]: Value<T>;
|
|
73
|
+
readonly [key: IStorage.Key]: Value<T>;
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
76
|
* PlainValue 型から内部のデータ型を抽出します。
|
|
@@ -89,7 +89,7 @@ export type $InferStreamValueChunkData<TStremValue> = TStremValue extends Stream
|
|
|
89
89
|
*
|
|
90
90
|
* @template TKeyValueMapping 対象となるマッピング型です。
|
|
91
91
|
*/
|
|
92
|
-
export type KeyofKeyValueMapping<TKeyValueMapping extends KeyValueMapping = KeyValueMapping> = Extract<keyof TKeyValueMapping, Key>;
|
|
92
|
+
export type KeyofKeyValueMapping<TKeyValueMapping extends KeyValueMapping = KeyValueMapping> = Extract<keyof TKeyValueMapping, IStorage.Key>;
|
|
93
93
|
/**
|
|
94
94
|
* UniKvs の設定を構築するためのビルダーインターフェースです。
|
|
95
95
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unikvs-config.d.ts","sourceRoot":"","sources":["../../src/unikvs-config.ts"],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UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAM/C;;;;;OAKG;IACI,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,sBAAsB;IAM/D;;;;;;;;OAQG;IACI,iBAAiB,CAAC,WAAW,EAAE,YAAY,GAAG,oBAAoB;CAU1E"}
|
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _UniKvsConfig_UniKvs, _UniKvsConfig_context, _UniKvsConfig_destinations, _UniKvsConfig_transformers;
|
|
13
|
-
import
|
|
13
|
+
import UniKvsStorage from "./_storage.js";
|
|
14
14
|
import UniKvsTransformer from "./_transformer.js";
|
|
15
15
|
import { MissingStorageError } from "./errors.js";
|
|
16
16
|
/**
|
package/dist/src/unikvs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Context,
|
|
2
|
-
import
|
|
1
|
+
import type { Context, IStorage } from "@unikvs/core";
|
|
2
|
+
import UniKvsStorage from "./_storage.js";
|
|
3
3
|
import UniKvsTransformer from "./_transformer.js";
|
|
4
4
|
import type { ContextSource } from "./context.types.js";
|
|
5
5
|
import { type $InferPlainValueData, type $InferStreamValueChunkData, type IUniKvsConfigBuilder, type KeyofKeyValueMapping, type KeyValueMapping, type PlainValue, type StreamValue, type Value } from "./unikvs-config.js";
|
|
@@ -82,7 +82,7 @@ export type SetOptions<TKeyValueMapping extends KeyValueMapping = KeyValueMappin
|
|
|
82
82
|
*
|
|
83
83
|
* @template TKey 対象となるキーの型です。
|
|
84
84
|
*/
|
|
85
|
-
export type GetOptions<TKey = Key> = {
|
|
85
|
+
export type GetOptions<TKey = IStorage.Key> = {
|
|
86
86
|
/**
|
|
87
87
|
* 操作対象を識別するためのキーです。
|
|
88
88
|
*/
|
|
@@ -101,7 +101,7 @@ export type GetOptions<TKey = Key> = {
|
|
|
101
101
|
*
|
|
102
102
|
* @template TKey 対象となるキーの型です。
|
|
103
103
|
*/
|
|
104
|
-
export type StreamOptions<TKey = Key> = {
|
|
104
|
+
export type StreamOptions<TKey = IStorage.Key> = {
|
|
105
105
|
/**
|
|
106
106
|
* 操作対象を識別するためのキーです。
|
|
107
107
|
*/
|
|
@@ -120,7 +120,7 @@ export type StreamOptions<TKey = Key> = {
|
|
|
120
120
|
*
|
|
121
121
|
* @template TKey 対象となるキーの型です。
|
|
122
122
|
*/
|
|
123
|
-
export type HasOptions<TKey = Key> = {
|
|
123
|
+
export type HasOptions<TKey = IStorage.Key> = {
|
|
124
124
|
/**
|
|
125
125
|
* 操作対象を識別するためのキーです。
|
|
126
126
|
*/
|
|
@@ -139,7 +139,7 @@ export type HasOptions<TKey = Key> = {
|
|
|
139
139
|
*
|
|
140
140
|
* @template TKey 対象となるキーの型です。
|
|
141
141
|
*/
|
|
142
|
-
export type DeleteOptions<TKey = Key> = {
|
|
142
|
+
export type DeleteOptions<TKey = IStorage.Key> = {
|
|
143
143
|
/**
|
|
144
144
|
* 操作対象を識別するためのキーです。
|
|
145
145
|
*/
|
package/dist/src/unikvs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unikvs.d.ts","sourceRoot":"","sources":["../../src/unikvs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAmB,
|
|
1
|
+
{"version":3,"file":"unikvs.d.ts","sourceRoot":"","sources":["../../src/unikvs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAmB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMvE,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,iBAAiB,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOxD,OAAqB,EACnB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EA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