@trayio/commons 0.0.1-beta
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/LICENSE.txt +22 -0
- package/dist/base64/Base64.d.ts +18 -0
- package/dist/base64/Base64.d.ts.map +1 -0
- package/dist/base64/Base64.js +52 -0
- package/dist/base64/Base64.unit.test.d.ts +2 -0
- package/dist/base64/Base64.unit.test.d.ts.map +1 -0
- package/dist/base64/Base64.unit.test.js +50 -0
- package/dist/buffer/BufferExtensions.d.ts +9 -0
- package/dist/buffer/BufferExtensions.d.ts.map +1 -0
- package/dist/buffer/BufferExtensions.js +68 -0
- package/dist/buffer/BufferExtensions.unit.test.d.ts +2 -0
- package/dist/buffer/BufferExtensions.unit.test.d.ts.map +1 -0
- package/dist/buffer/BufferExtensions.unit.test.js +47 -0
- package/dist/callsite/CallSite.d.ts +9 -0
- package/dist/callsite/CallSite.d.ts.map +1 -0
- package/dist/callsite/CallSite.js +50 -0
- package/dist/cli/CliLogging.d.ts +11 -0
- package/dist/cli/CliLogging.d.ts.map +1 -0
- package/dist/cli/CliLogging.js +9 -0
- package/dist/codec/Codec.abstract.test.d.ts +8 -0
- package/dist/codec/Codec.abstract.test.d.ts.map +1 -0
- package/dist/codec/Codec.abstract.test.js +42 -0
- package/dist/codec/Codec.d.ts +6 -0
- package/dist/codec/Codec.d.ts.map +1 -0
- package/dist/codec/Codec.js +2 -0
- package/dist/codec/CompositeCodec.d.ts +11 -0
- package/dist/codec/CompositeCodec.d.ts.map +1 -0
- package/dist/codec/CompositeCodec.js +44 -0
- package/dist/codec/RemoveNullValuesCodec.d.ts +12 -0
- package/dist/codec/RemoveNullValuesCodec.d.ts.map +1 -0
- package/dist/codec/RemoveNullValuesCodec.js +76 -0
- package/dist/codec/TypeCodec.d.ts +16 -0
- package/dist/codec/TypeCodec.d.ts.map +1 -0
- package/dist/codec/TypeCodec.js +58 -0
- package/dist/codec/TypeCodec.unit.test.d.ts +2 -0
- package/dist/codec/TypeCodec.unit.test.d.ts.map +1 -0
- package/dist/codec/TypeCodec.unit.test.js +97 -0
- package/dist/dynamictype/DynamicType.d.ts +20 -0
- package/dist/dynamictype/DynamicType.d.ts.map +1 -0
- package/dist/dynamictype/DynamicType.js +49 -0
- package/dist/error/Error.d.ts +2 -0
- package/dist/error/Error.d.ts.map +1 -0
- package/dist/error/Error.js +13 -0
- package/dist/file/FakeFileStorage.d.ts +12 -0
- package/dist/file/FakeFileStorage.d.ts.map +1 -0
- package/dist/file/FakeFileStorage.integration.test.d.ts +2 -0
- package/dist/file/FakeFileStorage.integration.test.d.ts.map +1 -0
- package/dist/file/FakeFileStorage.integration.test.js +7 -0
- package/dist/file/FakeFileStorage.js +60 -0
- package/dist/file/File.d.ts +29 -0
- package/dist/file/File.d.ts.map +1 -0
- package/dist/file/File.js +36 -0
- package/dist/file/FileStorage.abstract.test.d.ts +3 -0
- package/dist/file/FileStorage.abstract.test.d.ts.map +1 -0
- package/dist/file/FileStorage.abstract.test.js +109 -0
- package/dist/file/NodeFsFileStorage.d.ts +12 -0
- package/dist/file/NodeFsFileStorage.d.ts.map +1 -0
- package/dist/file/NodeFsFileStorage.integration.test.d.ts +2 -0
- package/dist/file/NodeFsFileStorage.integration.test.d.ts.map +1 -0
- package/dist/file/NodeFsFileStorage.integration.test.js +7 -0
- package/dist/file/NodeFsFileStorage.js +82 -0
- package/dist/http/Http.d.ts +55 -0
- package/dist/http/Http.d.ts.map +1 -0
- package/dist/http/Http.js +64 -0
- package/dist/http/HttpClient.abstract.test.d.ts +3 -0
- package/dist/http/HttpClient.abstract.test.d.ts.map +1 -0
- package/dist/http/HttpClient.abstract.test.js +354 -0
- package/dist/http/HttpClient.d.ts +6 -0
- package/dist/http/HttpClient.d.ts.map +1 -0
- package/dist/http/HttpClient.js +2 -0
- package/dist/http/HttpController.d.ts +11 -0
- package/dist/http/HttpController.d.ts.map +1 -0
- package/dist/http/HttpController.js +2 -0
- package/dist/logging/Logging.d.ts +10 -0
- package/dist/logging/Logging.d.ts.map +1 -0
- package/dist/logging/Logging.js +2 -0
- package/dist/record/Record.d.ts +4 -0
- package/dist/record/Record.d.ts.map +1 -0
- package/dist/record/Record.js +35 -0
- package/dist/result/Result.d.ts +31 -0
- package/dist/result/Result.d.ts.map +1 -0
- package/dist/result/Result.js +68 -0
- package/dist/serialization/JsonSerialization.d.ts +10 -0
- package/dist/serialization/JsonSerialization.d.ts.map +1 -0
- package/dist/serialization/JsonSerialization.js +49 -0
- package/dist/serialization/JsonSerialization.unit.test.d.ts +2 -0
- package/dist/serialization/JsonSerialization.unit.test.d.ts.map +1 -0
- package/dist/serialization/JsonSerialization.unit.test.js +5 -0
- package/dist/serialization/Serialization.abstract.test.d.ts +3 -0
- package/dist/serialization/Serialization.abstract.test.d.ts.map +1 -0
- package/dist/serialization/Serialization.abstract.test.js +54 -0
- package/dist/serialization/Serialization.d.ts +10 -0
- package/dist/serialization/Serialization.d.ts.map +1 -0
- package/dist/serialization/Serialization.js +7 -0
- package/dist/string/StringConversions.d.ts +6 -0
- package/dist/string/StringConversions.d.ts.map +1 -0
- package/dist/string/StringConversions.js +16 -0
- package/dist/string/StringConversions.unit.test.d.ts +2 -0
- package/dist/string/StringConversions.unit.test.d.ts.map +1 -0
- package/dist/string/StringConversions.unit.test.js +36 -0
- package/dist/string/StringExtensions.d.ts +6 -0
- package/dist/string/StringExtensions.d.ts.map +1 -0
- package/dist/string/StringExtensions.js +8 -0
- package/dist/string/StringExtensions.unit.test.d.ts +2 -0
- package/dist/string/StringExtensions.unit.test.d.ts.map +1 -0
- package/dist/string/StringExtensions.unit.test.js +39 -0
- package/dist/task/Task.d.ts +7 -0
- package/dist/task/Task.d.ts.map +1 -0
- package/dist/task/Task.js +14 -0
- package/dist/try/Try.d.ts +3 -0
- package/dist/try/Try.d.ts.map +1 -0
- package/dist/try/Try.js +37 -0
- package/package.json +41 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.TypeCodec = void 0;
|
|
30
|
+
const E = __importStar(require("fp-ts/lib/Either"));
|
|
31
|
+
const t = __importStar(require("io-ts"));
|
|
32
|
+
const io_ts_reporters_1 = __importDefault(require("io-ts-reporters"));
|
|
33
|
+
const Record_1 = require("fp-ts/Record");
|
|
34
|
+
const function_1 = require("fp-ts/function");
|
|
35
|
+
class TypeCodec {
|
|
36
|
+
static fromDescriptor(descriptor) {
|
|
37
|
+
return new TypeCodec(descriptor);
|
|
38
|
+
}
|
|
39
|
+
constructor(descriptor) {
|
|
40
|
+
this.descriptor = descriptor;
|
|
41
|
+
}
|
|
42
|
+
encode(value) {
|
|
43
|
+
return this.descriptor.encode(value);
|
|
44
|
+
}
|
|
45
|
+
decode(value) {
|
|
46
|
+
const result = this.descriptor.decode(value);
|
|
47
|
+
const report = io_ts_reporters_1.default.report(result);
|
|
48
|
+
return (0, function_1.pipe)(result, E.mapLeft((e) => new Error(report.join(', '))));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.TypeCodec = TypeCodec;
|
|
52
|
+
TypeCodec.undefined = TypeCodec.fromDescriptor(t.undefined);
|
|
53
|
+
TypeCodec.unknown = TypeCodec.fromDescriptor(t.unknown);
|
|
54
|
+
TypeCodec.emptyRecord = TypeCodec.fromDescriptor(t.type({}));
|
|
55
|
+
TypeCodec.stringRecord = TypeCodec.fromDescriptor(t.record(t.string, t.string));
|
|
56
|
+
// Added support for partial records as IO-TS does not support them
|
|
57
|
+
// https://github.com/gcanti/io-ts/issues/429#issuecomment-862472408
|
|
58
|
+
TypeCodec.partialRecord = (k, type) => t.partial((0, Record_1.map)(() => type)(k.keys));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeCodec.unit.test.d.ts","sourceRoot":"","sources":["../../src/codec/TypeCodec.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const E = __importStar(require("fp-ts/Either"));
|
|
27
|
+
const O = __importStar(require("fp-ts/Option"));
|
|
28
|
+
const t = __importStar(require("io-ts"));
|
|
29
|
+
const io_ts_types_1 = require("io-ts-types");
|
|
30
|
+
const TypeCodec_1 = require("./TypeCodec");
|
|
31
|
+
const Codec_abstract_test_1 = require("./Codec.abstract.test");
|
|
32
|
+
const testTypeCodec = TypeCodec_1.TypeCodec.fromDescriptor(t.type({
|
|
33
|
+
strField: t.string,
|
|
34
|
+
intField: (0, io_ts_types_1.optionFromNullable)(t.number),
|
|
35
|
+
}));
|
|
36
|
+
(0, Codec_abstract_test_1.testCodec)(testTypeCodec);
|
|
37
|
+
describe('Type Codec Test', () => {
|
|
38
|
+
test('should encode option some without the extra layer', () => {
|
|
39
|
+
const testValue = {
|
|
40
|
+
strField: 'str',
|
|
41
|
+
intField: O.some(123),
|
|
42
|
+
};
|
|
43
|
+
const result = testTypeCodec.encode(testValue);
|
|
44
|
+
const expected = {
|
|
45
|
+
strField: 'str',
|
|
46
|
+
intField: 123,
|
|
47
|
+
};
|
|
48
|
+
expect(result).toStrictEqual(expected);
|
|
49
|
+
});
|
|
50
|
+
test('should encode option none without the extra layer', () => {
|
|
51
|
+
const testValue = {
|
|
52
|
+
strField: 'str',
|
|
53
|
+
intField: O.none,
|
|
54
|
+
};
|
|
55
|
+
const result = testTypeCodec.encode(testValue);
|
|
56
|
+
const expected = {
|
|
57
|
+
strField: 'str',
|
|
58
|
+
intField: null,
|
|
59
|
+
};
|
|
60
|
+
expect(result).toStrictEqual(expected);
|
|
61
|
+
});
|
|
62
|
+
test('should decode option some without the extra layer', () => {
|
|
63
|
+
const testValueEncoded = {
|
|
64
|
+
strField: 'str',
|
|
65
|
+
intField: 123,
|
|
66
|
+
};
|
|
67
|
+
const result = testTypeCodec.decode(testValueEncoded);
|
|
68
|
+
const expected = E.right({
|
|
69
|
+
strField: 'str',
|
|
70
|
+
intField: O.some(123),
|
|
71
|
+
});
|
|
72
|
+
expect(result).toStrictEqual(expected);
|
|
73
|
+
});
|
|
74
|
+
test('should decode option none without the extra layer from null', () => {
|
|
75
|
+
const testValueEncoded = {
|
|
76
|
+
strField: 'str',
|
|
77
|
+
intField: null,
|
|
78
|
+
};
|
|
79
|
+
const result = testTypeCodec.decode(testValueEncoded);
|
|
80
|
+
const expected = E.right({
|
|
81
|
+
strField: 'str',
|
|
82
|
+
intField: O.none,
|
|
83
|
+
});
|
|
84
|
+
expect(result).toStrictEqual(expected);
|
|
85
|
+
});
|
|
86
|
+
test('should decode option none without the extra layer from a non existing property', () => {
|
|
87
|
+
const testValueEncoded = {
|
|
88
|
+
strField: 'str',
|
|
89
|
+
};
|
|
90
|
+
const result = testTypeCodec.decode(testValueEncoded);
|
|
91
|
+
const expected = E.right({
|
|
92
|
+
strField: 'str',
|
|
93
|
+
intField: O.none,
|
|
94
|
+
});
|
|
95
|
+
expect(result).toStrictEqual(expected);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as TE from 'fp-ts/TaskEither';
|
|
2
|
+
import * as E from 'fp-ts/Either';
|
|
3
|
+
import * as t from 'io-ts';
|
|
4
|
+
import { Codec } from '../codec/Codec';
|
|
5
|
+
export type DynamicType = string | number | boolean | null | DynamicObject | DynamicArray;
|
|
6
|
+
export type DynamicObject = {
|
|
7
|
+
[x: string]: DynamicType;
|
|
8
|
+
};
|
|
9
|
+
export type DynamicArray = Array<DynamicType>;
|
|
10
|
+
export interface DynamicTypeInterface {
|
|
11
|
+
readFromFile: (path: string) => E.Either<Error, DynamicType>;
|
|
12
|
+
writeToFile: (path: string, value: DynamicType) => E.Either<Error, undefined>;
|
|
13
|
+
writeToFileAsync: (path: string, value: DynamicType) => TE.TaskEither<Error, undefined>;
|
|
14
|
+
safeCast: <T>(dynamicType: DynamicType, codec: Codec<T>) => E.Either<Error, T>;
|
|
15
|
+
}
|
|
16
|
+
export declare const DynamicType: DynamicTypeInterface;
|
|
17
|
+
export declare const dynamicTypeDescriptor: t.Type<DynamicType>;
|
|
18
|
+
export declare const dynamicObjectTypeDescriptor: t.Type<DynamicObject>;
|
|
19
|
+
export declare const dynamicArrayTypeDescriptor: t.Type<DynamicArray>;
|
|
20
|
+
//# sourceMappingURL=DynamicType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicType.d.ts","sourceRoot":"","sources":["../../src/dynamictype/DynamicType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGvC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,MAAM,MAAM,WAAW,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,aAAa,GACb,YAAY,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAEzD,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;AAE9C,MAAM,WAAW,oBAAoB;IACpC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC7D,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC9E,gBAAgB,EAAE,CACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,WAAW,KACd,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,EACX,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KACX,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,EAAE,oBAuBzB,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAWrD,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAG7D,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAG3D,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.dynamicArrayTypeDescriptor = exports.dynamicObjectTypeDescriptor = exports.dynamicTypeDescriptor = exports.DynamicType = void 0;
|
|
27
|
+
const TE = __importStar(require("fp-ts/TaskEither"));
|
|
28
|
+
const fs = __importStar(require("fs"));
|
|
29
|
+
const fse = __importStar(require("fs-extra"));
|
|
30
|
+
const E = __importStar(require("fp-ts/Either"));
|
|
31
|
+
const function_1 = require("fp-ts/function");
|
|
32
|
+
const t = __importStar(require("io-ts"));
|
|
33
|
+
const Try_1 = require("../try/Try");
|
|
34
|
+
exports.DynamicType = {
|
|
35
|
+
readFromFile: (path) => (0, Try_1.tryToEither)(() => JSON.parse(fs.readFileSync(path, 'utf8'))),
|
|
36
|
+
writeToFile: (path, value) => (0, function_1.pipe)((0, Try_1.tryToEither)(() => fs.writeFileSync(path, JSON.stringify(value))), E.map(() => undefined)),
|
|
37
|
+
writeToFileAsync: (path, value) => (0, function_1.pipe)(TE.tryCatch(() => fse.writeFile(path, JSON.stringify(value)), (err) => new Error(err.message)), TE.map(() => undefined)),
|
|
38
|
+
safeCast: (dynamicType, codec) => codec.decode(dynamicType),
|
|
39
|
+
};
|
|
40
|
+
exports.dynamicTypeDescriptor = t.recursion('DynamicType', () => t.union([
|
|
41
|
+
t.string,
|
|
42
|
+
t.number,
|
|
43
|
+
t.boolean,
|
|
44
|
+
t.null,
|
|
45
|
+
exports.dynamicObjectTypeDescriptor,
|
|
46
|
+
exports.dynamicArrayTypeDescriptor,
|
|
47
|
+
]));
|
|
48
|
+
exports.dynamicObjectTypeDescriptor = t.recursion('DynamicObject', () => t.record(t.string, exports.dynamicTypeDescriptor));
|
|
49
|
+
exports.dynamicArrayTypeDescriptor = t.recursion('DynamicArray', () => t.array(exports.dynamicTypeDescriptor));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../src/error/Error.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,KASvC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.castError = void 0;
|
|
4
|
+
const castError = (error) => {
|
|
5
|
+
if (typeof error === 'string') {
|
|
6
|
+
return new Error(error);
|
|
7
|
+
}
|
|
8
|
+
if (error instanceof Error) {
|
|
9
|
+
return error;
|
|
10
|
+
}
|
|
11
|
+
return new Error('Internal Error');
|
|
12
|
+
};
|
|
13
|
+
exports.castError = castError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as TE from 'fp-ts/TaskEither';
|
|
2
|
+
import { File, FileStorage, SharedUrl } from './File';
|
|
3
|
+
export declare class FakeFileStorage implements FileStorage {
|
|
4
|
+
files: Map<string, File>;
|
|
5
|
+
constructor();
|
|
6
|
+
write(file: File): TE.TaskEither<Error, File>;
|
|
7
|
+
read(fileName: string): TE.TaskEither<Error, File>;
|
|
8
|
+
delete(fileName: string): TE.TaskEither<Error, undefined>;
|
|
9
|
+
getSharedUrl(key: string): TE.TaskEither<Error, SharedUrl>;
|
|
10
|
+
createDirectory(key: string): TE.TaskEither<Error, undefined>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=FakeFileStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FakeFileStorage.d.ts","sourceRoot":"","sources":["../../src/file/FakeFileStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIvC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEtD,qBAAa,eAAgB,YAAW,WAAW;IAClD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;;IAMzB,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;IAY7C,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;IAkBlD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAYzD,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAI1D,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;CAgB7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FakeFileStorage.integration.test.d.ts","sourceRoot":"","sources":["../../src/file/FakeFileStorage.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FileStorage_abstract_test_1 = require("./FileStorage.abstract.test");
|
|
4
|
+
const FakeFileStorage_1 = require("./FakeFileStorage");
|
|
5
|
+
describe('FakeFileStorage Tests', () => {
|
|
6
|
+
(0, FileStorage_abstract_test_1.fileStorageTest)(new FakeFileStorage_1.FakeFileStorage());
|
|
7
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.FakeFileStorage = void 0;
|
|
27
|
+
const TE = __importStar(require("fp-ts/TaskEither"));
|
|
28
|
+
const E = __importStar(require("fp-ts/Either"));
|
|
29
|
+
const function_1 = require("fp-ts/lib/function");
|
|
30
|
+
const stream_1 = require("stream");
|
|
31
|
+
class FakeFileStorage {
|
|
32
|
+
constructor() {
|
|
33
|
+
this.files = new Map();
|
|
34
|
+
}
|
|
35
|
+
write(file) {
|
|
36
|
+
return (0, function_1.pipe)(TE.fromEither(E.tryCatch(() => this.files.set(file.key, file), (error) => new Error(error))), TE.map(() => file));
|
|
37
|
+
}
|
|
38
|
+
read(fileName) {
|
|
39
|
+
return (0, function_1.pipe)(TE.fromEither(E.tryCatch(() => this.files.get(fileName), (error) => new Error(error))), TE.chain((file) => {
|
|
40
|
+
if (file === undefined) {
|
|
41
|
+
return TE.left(new Error(`File ${fileName} not found`));
|
|
42
|
+
}
|
|
43
|
+
return TE.right(file);
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
delete(fileName) {
|
|
47
|
+
return (0, function_1.pipe)(TE.fromEither(E.tryCatch(() => this.files.delete(fileName), (error) => new Error(error))), TE.map(() => undefined));
|
|
48
|
+
}
|
|
49
|
+
getSharedUrl(key) {
|
|
50
|
+
return TE.right({ url: key });
|
|
51
|
+
}
|
|
52
|
+
createDirectory(key) {
|
|
53
|
+
return (0, function_1.pipe)(TE.fromEither(E.tryCatch(() => this.files.set(key, {
|
|
54
|
+
key,
|
|
55
|
+
metadata: { name: key },
|
|
56
|
+
content: stream_1.Readable.from(''),
|
|
57
|
+
}), (error) => new Error(error))), TE.map(() => undefined));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.FakeFileStorage = FakeFileStorage;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from 'stream';
|
|
3
|
+
import { TaskEither } from 'fp-ts/TaskEither';
|
|
4
|
+
import * as t from 'io-ts';
|
|
5
|
+
import { Option } from 'fp-ts/lib/Option';
|
|
6
|
+
import { DynamicObject } from '../dynamictype/DynamicType';
|
|
7
|
+
export type FileMetadata = {
|
|
8
|
+
name: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
contentType?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const fileMetadataDescriptor: t.Type<FileMetadata, unknown>;
|
|
13
|
+
export type File = {
|
|
14
|
+
key: string;
|
|
15
|
+
metadata: FileMetadata;
|
|
16
|
+
content: Readable;
|
|
17
|
+
};
|
|
18
|
+
export type SharedUrl = {
|
|
19
|
+
url: string;
|
|
20
|
+
expires?: number;
|
|
21
|
+
};
|
|
22
|
+
export interface FileStorage {
|
|
23
|
+
write(file: File, writeOptions: Option<DynamicObject>): TaskEither<Error, File>;
|
|
24
|
+
read(key: string, name?: string): TaskEither<Error, File>;
|
|
25
|
+
getSharedUrl(key: string): TaskEither<Error, SharedUrl>;
|
|
26
|
+
delete(key: string): TaskEither<Error, undefined>;
|
|
27
|
+
createDirectory(key: string): TaskEither<Error, undefined>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=File.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/file/File.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAY/D,CAAC;AAKH,MAAM,MAAM,IAAI,GAAG;IAElB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,QAAQ,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC3B,KAAK,CACJ,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,GACjC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1D,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClD,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CAC3D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.fileMetadataDescriptor = void 0;
|
|
27
|
+
const t = __importStar(require("io-ts"));
|
|
28
|
+
exports.fileMetadataDescriptor = t.intersection([
|
|
29
|
+
t.type({
|
|
30
|
+
name: t.string,
|
|
31
|
+
}),
|
|
32
|
+
t.partial({
|
|
33
|
+
size: t.number,
|
|
34
|
+
contentType: t.string,
|
|
35
|
+
}),
|
|
36
|
+
], 'FileMetadata');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileStorage.abstract.test.d.ts","sourceRoot":"","sources":["../../src/file/FileStorage.abstract.test.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAQ,MAAM,QAAQ,CAAC;AAE3C,eAAO,MAAM,eAAe,gBAAiB,WAAW,SA0FvD,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.fileStorageTest = void 0;
|
|
36
|
+
const E = __importStar(require("fp-ts/Either"));
|
|
37
|
+
const uuid_1 = require("uuid");
|
|
38
|
+
const O = __importStar(require("fp-ts/Option"));
|
|
39
|
+
const stream_1 = require("stream");
|
|
40
|
+
const JsonSerialization_1 = require("../serialization/JsonSerialization");
|
|
41
|
+
const fileStorageTest = (fileStorage) => {
|
|
42
|
+
describe('FileStorage Tests', () => {
|
|
43
|
+
describe('Writing a file', () => {
|
|
44
|
+
describe("when it's successful", () => {
|
|
45
|
+
it('should write a file, read the file then delete the file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
+
const serialization = new JsonSerialization_1.JsonSerialization();
|
|
47
|
+
const fileContent = { test: 'someValue' };
|
|
48
|
+
const readableStream = new stream_1.Readable({
|
|
49
|
+
read() {
|
|
50
|
+
this.push(Buffer.from(serialization.serialize(fileContent)));
|
|
51
|
+
this.push(null);
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const fileName = `test-${(0, uuid_1.v4)()}.json`;
|
|
55
|
+
const file = {
|
|
56
|
+
key: fileName,
|
|
57
|
+
metadata: {
|
|
58
|
+
name: fileName,
|
|
59
|
+
},
|
|
60
|
+
content: readableStream,
|
|
61
|
+
};
|
|
62
|
+
const writtenFile = yield fileStorage.write(file, O.none)();
|
|
63
|
+
expect(writtenFile).toEqual(E.right(file));
|
|
64
|
+
const sharedUrl = yield fileStorage.getSharedUrl(file.key)();
|
|
65
|
+
expect(sharedUrl).toEqual(E.right(expect.objectContaining({
|
|
66
|
+
url: expect.any(String),
|
|
67
|
+
})));
|
|
68
|
+
if (E.isRight(sharedUrl)) {
|
|
69
|
+
if (typeof sharedUrl.right.expires !== 'undefined') {
|
|
70
|
+
expect(sharedUrl.right.expires).toEqual(expect.any(Number));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const read = yield fileStorage.read(file.key)();
|
|
74
|
+
const readResponse = E.getOrElse(() => {
|
|
75
|
+
throw new Error('Expected right');
|
|
76
|
+
})(read);
|
|
77
|
+
let data = '';
|
|
78
|
+
yield new Promise((resolve) => {
|
|
79
|
+
readResponse.content.on('data', (chunk) => {
|
|
80
|
+
data += chunk;
|
|
81
|
+
});
|
|
82
|
+
readResponse.content.on('end', () => {
|
|
83
|
+
resolve(undefined);
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
const deserializedData = serialization.deserialize(Buffer.from(data));
|
|
87
|
+
if (E.isLeft(deserializedData)) {
|
|
88
|
+
throw new Error('failed to deserialise stream contents');
|
|
89
|
+
}
|
|
90
|
+
expect(deserializedData.right).toStrictEqual(fileContent);
|
|
91
|
+
const deleted = yield fileStorage.delete(file.key)();
|
|
92
|
+
expect(deleted).toEqual(E.right(undefined));
|
|
93
|
+
}));
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
describe('Reading a file', () => {
|
|
97
|
+
describe('when the file does not exist', () => {
|
|
98
|
+
it('should return does not exist error', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
+
const read = yield fileStorage.read(`fail_test-${(0, uuid_1.v4)()}.zip`)();
|
|
100
|
+
if (E.isRight(read)) {
|
|
101
|
+
throw new Error('Expected left');
|
|
102
|
+
}
|
|
103
|
+
expect(read.left).toBeInstanceOf(Error);
|
|
104
|
+
}));
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
exports.fileStorageTest = fileStorageTest;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as TE from 'fp-ts/lib/TaskEither';
|
|
2
|
+
import { File, FileStorage, SharedUrl } from './File';
|
|
3
|
+
export declare class NodeFsFileStorage implements FileStorage {
|
|
4
|
+
private basePath;
|
|
5
|
+
constructor(basePath?: string);
|
|
6
|
+
write(file: File): TE.TaskEither<Error, File>;
|
|
7
|
+
read(key: string, name?: string): TE.TaskEither<Error, File>;
|
|
8
|
+
getSharedUrl(key: string): TE.TaskEither<Error, SharedUrl>;
|
|
9
|
+
delete(key: string): TE.TaskEither<Error, undefined>;
|
|
10
|
+
createDirectory(key: string): TE.TaskEither<Error, undefined>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=NodeFsFileStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeFsFileStorage.d.ts","sourceRoot":"","sources":["../../src/file/NodeFsFileStorage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAgB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGpE,qBAAa,iBAAkB,YAAW,WAAW;IACxC,OAAO,CAAC,QAAQ;gBAAR,QAAQ,GAAE,MAAe;IAE7C,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;IAa7C,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAY,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC;IAkBjE,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAW1D,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAYpD,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;CAW7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeFsFileStorage.integration.test.d.ts","sourceRoot":"","sources":["../../src/file/NodeFsFileStorage.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FileStorage_abstract_test_1 = require("./FileStorage.abstract.test");
|
|
4
|
+
const NodeFsFileStorage_1 = require("./NodeFsFileStorage");
|
|
5
|
+
describe('NodeFsFileStorage Tests', () => {
|
|
6
|
+
(0, FileStorage_abstract_test_1.fileStorageTest)(new NodeFsFileStorage_1.NodeFsFileStorage());
|
|
7
|
+
});
|