@dexto/storage 1.7.2 → 1.8.0
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 +51 -38
- package/dist/blob/index.cjs +2 -7
- package/dist/blob/index.d.ts +3 -14
- package/dist/blob/index.d.ts.map +1 -1
- package/dist/blob/index.js +1 -4
- package/dist/cache/index.cjs +3 -5
- package/dist/cache/index.d.ts +4 -14
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +2 -3
- package/dist/cache/schemas.cjs +5 -5
- package/dist/cache/schemas.js +1 -1
- package/dist/database/index.cjs +8 -9
- package/dist/database/index.d.ts +5 -15
- package/dist/database/index.d.ts.map +1 -1
- package/dist/database/index.js +5 -9
- package/dist/database/memory-database-store.cjs +16 -0
- package/dist/database/memory-database-store.d.ts +4 -0
- package/dist/database/memory-database-store.d.ts.map +1 -1
- package/dist/database/memory-database-store.js +16 -0
- package/dist/database/postgres-store.cjs +25 -0
- package/dist/database/postgres-store.d.ts +4 -0
- package/dist/database/postgres-store.d.ts.map +1 -1
- package/dist/database/postgres-store.js +25 -0
- package/dist/database/schemas.cjs +6 -6
- package/dist/database/schemas.js +1 -1
- package/dist/database/sqlite-store.cjs +18 -0
- package/dist/database/sqlite-store.d.ts +4 -0
- package/dist/database/sqlite-store.d.ts.map +1 -1
- package/dist/database/sqlite-store.js +18 -0
- package/dist/index.cjs +12 -19
- package/dist/index.d.cts +17 -225
- package/dist/index.d.ts +4 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -15
- package/package.json +3 -3
- package/dist/blob/factories/index.cjs +0 -31
- package/dist/blob/factories/index.d.ts +0 -6
- package/dist/blob/factories/index.d.ts.map +0 -1
- package/dist/blob/factories/index.js +0 -6
- package/dist/blob/factories/local.cjs +0 -38
- package/dist/blob/factories/local.d.ts +0 -17
- package/dist/blob/factories/local.d.ts.map +0 -1
- package/dist/blob/factories/local.js +0 -14
- package/dist/blob/factories/memory.cjs +0 -44
- package/dist/blob/factories/memory.d.ts +0 -17
- package/dist/blob/factories/memory.d.ts.map +0 -1
- package/dist/blob/factories/memory.js +0 -20
- package/dist/blob/factory.cjs +0 -16
- package/dist/blob/factory.d.ts +0 -35
- package/dist/blob/factory.d.ts.map +0 -1
- package/dist/blob/factory.js +0 -0
- package/dist/cache/factories/index.cjs +0 -31
- package/dist/cache/factories/index.d.ts +0 -6
- package/dist/cache/factories/index.d.ts.map +0 -1
- package/dist/cache/factories/index.js +0 -6
- package/dist/cache/factories/memory.cjs +0 -39
- package/dist/cache/factories/memory.d.ts +0 -17
- package/dist/cache/factories/memory.d.ts.map +0 -1
- package/dist/cache/factories/memory.js +0 -15
- package/dist/cache/factories/redis.cjs +0 -65
- package/dist/cache/factories/redis.d.ts +0 -20
- package/dist/cache/factories/redis.d.ts.map +0 -1
- package/dist/cache/factories/redis.js +0 -31
- package/dist/cache/factory.cjs +0 -16
- package/dist/cache/factory.d.ts +0 -41
- package/dist/cache/factory.d.ts.map +0 -1
- package/dist/cache/factory.js +0 -0
- package/dist/database/factories/index.cjs +0 -34
- package/dist/database/factories/index.d.ts +0 -7
- package/dist/database/factories/index.d.ts.map +0 -1
- package/dist/database/factories/index.js +0 -8
- package/dist/database/factories/memory.cjs +0 -39
- package/dist/database/factories/memory.d.ts +0 -16
- package/dist/database/factories/memory.d.ts.map +0 -1
- package/dist/database/factories/memory.js +0 -15
- package/dist/database/factories/postgres.cjs +0 -61
- package/dist/database/factories/postgres.d.ts +0 -19
- package/dist/database/factories/postgres.d.ts.map +0 -1
- package/dist/database/factories/postgres.js +0 -27
- package/dist/database/factories/sqlite.cjs +0 -65
- package/dist/database/factories/sqlite.d.ts +0 -20
- package/dist/database/factories/sqlite.d.ts.map +0 -1
- package/dist/database/factories/sqlite.js +0 -31
- package/dist/database/factory.cjs +0 -16
- package/dist/database/factory.d.ts +0 -41
- package/dist/database/factory.d.ts.map +0 -1
- package/dist/database/factory.js +0 -0
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var memory_exports = {};
|
|
20
|
-
__export(memory_exports, {
|
|
21
|
-
inMemoryBlobStoreFactory: () => inMemoryBlobStoreFactory
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(memory_exports);
|
|
24
|
-
var import_schemas = require("../schemas.js");
|
|
25
|
-
var import_memory_blob_store = require("../memory-blob-store.js");
|
|
26
|
-
const inMemoryBlobStoreFactory = {
|
|
27
|
-
configSchema: import_schemas.InMemoryBlobStoreSchema,
|
|
28
|
-
create: (config, logger) => new import_memory_blob_store.MemoryBlobStore(
|
|
29
|
-
{
|
|
30
|
-
maxBlobSize: config.maxBlobSize,
|
|
31
|
-
maxTotalSize: config.maxTotalSize
|
|
32
|
-
},
|
|
33
|
-
logger
|
|
34
|
-
),
|
|
35
|
-
metadata: {
|
|
36
|
-
displayName: "In-Memory",
|
|
37
|
-
description: "Store blobs in RAM (ephemeral, for testing and development)",
|
|
38
|
-
requiresNetwork: false
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
inMemoryBlobStoreFactory
|
|
44
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { InMemoryBlobStoreConfig } from '../schemas.js';
|
|
2
|
-
import type { BlobStoreFactory } from '../factory.js';
|
|
3
|
-
/**
|
|
4
|
-
* Factory for in-memory blob storage.
|
|
5
|
-
*
|
|
6
|
-
* This factory stores blobs in RAM, making it ideal for testing and
|
|
7
|
-
* development. All data is lost when the process exits.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Zero dependencies
|
|
11
|
-
* - Extremely fast (no I/O)
|
|
12
|
-
* - Configurable size limits
|
|
13
|
-
* - No network required
|
|
14
|
-
* - Perfect for unit tests
|
|
15
|
-
*/
|
|
16
|
-
export declare const inMemoryBlobStoreFactory: BlobStoreFactory<InMemoryBlobStoreConfig>;
|
|
17
|
-
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/blob/factories/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAG7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,uBAAuB,CAe9E,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { InMemoryBlobStoreSchema } from "../schemas.js";
|
|
2
|
-
import { MemoryBlobStore } from "../memory-blob-store.js";
|
|
3
|
-
const inMemoryBlobStoreFactory = {
|
|
4
|
-
configSchema: InMemoryBlobStoreSchema,
|
|
5
|
-
create: (config, logger) => new MemoryBlobStore(
|
|
6
|
-
{
|
|
7
|
-
maxBlobSize: config.maxBlobSize,
|
|
8
|
-
maxTotalSize: config.maxTotalSize
|
|
9
|
-
},
|
|
10
|
-
logger
|
|
11
|
-
),
|
|
12
|
-
metadata: {
|
|
13
|
-
displayName: "In-Memory",
|
|
14
|
-
description: "Store blobs in RAM (ephemeral, for testing and development)",
|
|
15
|
-
requiresNetwork: false
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
inMemoryBlobStoreFactory
|
|
20
|
-
};
|
package/dist/blob/factory.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var factory_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(factory_exports);
|
package/dist/blob/factory.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { BlobStore } from './types.js';
|
|
2
|
-
import type { Logger } from '@dexto/core';
|
|
3
|
-
import type { z } from 'zod';
|
|
4
|
-
/**
|
|
5
|
-
* Factory interface for creating blob store instances.
|
|
6
|
-
*
|
|
7
|
-
* Factories are plain exports (no global registries). Images decide which factories are
|
|
8
|
-
* available by including them in `image.storage.blob`.
|
|
9
|
-
*/
|
|
10
|
-
export interface BlobStoreFactory<TConfig = unknown> {
|
|
11
|
-
/**
|
|
12
|
-
* Zod schema for validating factory-specific configuration.
|
|
13
|
-
* The schema must output the `TConfig` type.
|
|
14
|
-
*/
|
|
15
|
-
configSchema: z.ZodType<TConfig, unknown>;
|
|
16
|
-
/**
|
|
17
|
-
* Factory function to create a BlobStore instance.
|
|
18
|
-
* @param config - Validated configuration specific to this backend
|
|
19
|
-
* @param logger - Logger instance for the blob store
|
|
20
|
-
* @returns A BlobStore implementation
|
|
21
|
-
*/
|
|
22
|
-
create(config: TConfig, logger: Logger): BlobStore | Promise<BlobStore>;
|
|
23
|
-
/**
|
|
24
|
-
* Optional metadata for documentation, UIs, and discovery.
|
|
25
|
-
*/
|
|
26
|
-
metadata?: {
|
|
27
|
-
/** Human-readable name (e.g., "Local Filesystem", "Amazon S3") */
|
|
28
|
-
displayName: string;
|
|
29
|
-
/** Brief description of this storage backend */
|
|
30
|
-
description: string;
|
|
31
|
-
/** Whether this backend requires network connectivity */
|
|
32
|
-
requiresNetwork?: boolean;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/blob/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,GAAG,OAAO;IAC/C;;;OAGG;IACH,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAExE;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP,kEAAkE;QAClE,WAAW,EAAE,MAAM,CAAC;QACpB,gDAAgD;QAChD,WAAW,EAAE,MAAM,CAAC;QACpB,yDAAyD;QACzD,eAAe,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACL"}
|
package/dist/blob/factory.js
DELETED
|
File without changes
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var factories_exports = {};
|
|
20
|
-
__export(factories_exports, {
|
|
21
|
-
inMemoryCacheFactory: () => import_memory.inMemoryCacheFactory,
|
|
22
|
-
redisCacheFactory: () => import_redis.redisCacheFactory
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(factories_exports);
|
|
25
|
-
var import_memory = require("./memory.js");
|
|
26
|
-
var import_redis = require("./redis.js");
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
inMemoryCacheFactory,
|
|
30
|
-
redisCacheFactory
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/factories/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var memory_exports = {};
|
|
20
|
-
__export(memory_exports, {
|
|
21
|
-
inMemoryCacheFactory: () => inMemoryCacheFactory
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(memory_exports);
|
|
24
|
-
var import_schemas = require("../schemas.js");
|
|
25
|
-
var import_memory_cache_store = require("../memory-cache-store.js");
|
|
26
|
-
const inMemoryCacheFactory = {
|
|
27
|
-
configSchema: import_schemas.InMemoryCacheSchema,
|
|
28
|
-
create: (_config, _logger) => new import_memory_cache_store.MemoryCacheStore(),
|
|
29
|
-
metadata: {
|
|
30
|
-
displayName: "In-Memory",
|
|
31
|
-
description: "Store cache data in RAM (ephemeral, for testing and development)",
|
|
32
|
-
requiresNetwork: false,
|
|
33
|
-
supportsTTL: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
inMemoryCacheFactory
|
|
39
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { InMemoryCacheConfig } from '../schemas.js';
|
|
2
|
-
import type { CacheFactory } from '../factory.js';
|
|
3
|
-
/**
|
|
4
|
-
* Factory for in-memory cache storage.
|
|
5
|
-
*
|
|
6
|
-
* This factory stores data in RAM and is ideal for development,
|
|
7
|
-
* testing, and ephemeral use cases where persistence is not required.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Zero external dependencies
|
|
11
|
-
* - Fast in-memory operations
|
|
12
|
-
* - TTL support for automatic expiration
|
|
13
|
-
* - No network required
|
|
14
|
-
* - Data is lost on restart
|
|
15
|
-
*/
|
|
16
|
-
export declare const inMemoryCacheFactory: CacheFactory<InMemoryCacheConfig>;
|
|
17
|
-
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/cache/factories/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,mBAAmB,CASlE,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { InMemoryCacheSchema } from "../schemas.js";
|
|
2
|
-
import { MemoryCacheStore } from "../memory-cache-store.js";
|
|
3
|
-
const inMemoryCacheFactory = {
|
|
4
|
-
configSchema: InMemoryCacheSchema,
|
|
5
|
-
create: (_config, _logger) => new MemoryCacheStore(),
|
|
6
|
-
metadata: {
|
|
7
|
-
displayName: "In-Memory",
|
|
8
|
-
description: "Store cache data in RAM (ephemeral, for testing and development)",
|
|
9
|
-
requiresNetwork: false,
|
|
10
|
-
supportsTTL: true
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
inMemoryCacheFactory
|
|
15
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var redis_exports = {};
|
|
30
|
-
__export(redis_exports, {
|
|
31
|
-
redisCacheFactory: () => redisCacheFactory
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(redis_exports);
|
|
34
|
-
var import_schemas = require("../schemas.js");
|
|
35
|
-
var import_core = require("@dexto/core");
|
|
36
|
-
const redisCacheFactory = {
|
|
37
|
-
configSchema: import_schemas.RedisCacheSchema,
|
|
38
|
-
create: async (config, logger) => {
|
|
39
|
-
try {
|
|
40
|
-
const module2 = await import("../redis-store.js");
|
|
41
|
-
logger.info(`Connecting to Redis at ${config.host || config.url}`);
|
|
42
|
-
return new module2.RedisStore(config, logger);
|
|
43
|
-
} catch (error) {
|
|
44
|
-
const err = error;
|
|
45
|
-
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
46
|
-
throw import_core.StorageError.dependencyNotInstalled(
|
|
47
|
-
"Redis",
|
|
48
|
-
"ioredis",
|
|
49
|
-
"npm install ioredis"
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
throw error;
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
metadata: {
|
|
56
|
-
displayName: "Redis",
|
|
57
|
-
description: "Production Redis cache with TTL and pub/sub support",
|
|
58
|
-
requiresNetwork: true,
|
|
59
|
-
supportsTTL: true
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
-
0 && (module.exports = {
|
|
64
|
-
redisCacheFactory
|
|
65
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RedisCacheConfig } from '../schemas.js';
|
|
2
|
-
import type { CacheFactory } from '../factory.js';
|
|
3
|
-
/**
|
|
4
|
-
* Factory for Redis cache storage.
|
|
5
|
-
*
|
|
6
|
-
* This factory stores data in a Redis server using the ioredis package.
|
|
7
|
-
* It's ideal for production deployments requiring scalability, persistence,
|
|
8
|
-
* and multi-machine access.
|
|
9
|
-
*
|
|
10
|
-
* Features:
|
|
11
|
-
* - Native TTL support
|
|
12
|
-
* - Connection pooling
|
|
13
|
-
* - Pub/sub capabilities (via additional methods)
|
|
14
|
-
* - Suitable for distributed deployments
|
|
15
|
-
*
|
|
16
|
-
* Note: ioredis is an optional dependency. Install it with:
|
|
17
|
-
* npm install ioredis
|
|
18
|
-
*/
|
|
19
|
-
export declare const redisCacheFactory: CacheFactory<RedisCacheConfig>;
|
|
20
|
-
//# sourceMappingURL=redis.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../../src/cache/factories/redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,gBAAgB,CAyB5D,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { RedisCacheSchema } from "../schemas.js";
|
|
2
|
-
import { StorageError } from "@dexto/core";
|
|
3
|
-
const redisCacheFactory = {
|
|
4
|
-
configSchema: RedisCacheSchema,
|
|
5
|
-
create: async (config, logger) => {
|
|
6
|
-
try {
|
|
7
|
-
const module = await import("../redis-store.js");
|
|
8
|
-
logger.info(`Connecting to Redis at ${config.host || config.url}`);
|
|
9
|
-
return new module.RedisStore(config, logger);
|
|
10
|
-
} catch (error) {
|
|
11
|
-
const err = error;
|
|
12
|
-
if (err.code === "ERR_MODULE_NOT_FOUND") {
|
|
13
|
-
throw StorageError.dependencyNotInstalled(
|
|
14
|
-
"Redis",
|
|
15
|
-
"ioredis",
|
|
16
|
-
"npm install ioredis"
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
metadata: {
|
|
23
|
-
displayName: "Redis",
|
|
24
|
-
description: "Production Redis cache with TTL and pub/sub support",
|
|
25
|
-
requiresNetwork: true,
|
|
26
|
-
supportsTTL: true
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
redisCacheFactory
|
|
31
|
-
};
|
package/dist/cache/factory.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var factory_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(factory_exports);
|
package/dist/cache/factory.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { Cache } from './types.js';
|
|
2
|
-
import type { Logger } from '@dexto/core';
|
|
3
|
-
import type { z } from 'zod';
|
|
4
|
-
/**
|
|
5
|
-
* Factory interface for creating cache instances.
|
|
6
|
-
*
|
|
7
|
-
* Factories are plain exports (no global registries). Images decide which factories are
|
|
8
|
-
* available by including them in `image.storage.cache`.
|
|
9
|
-
*/
|
|
10
|
-
export interface CacheFactory<TConfig = unknown> {
|
|
11
|
-
/**
|
|
12
|
-
* Zod schema for validating factory-specific configuration.
|
|
13
|
-
* The schema must output the `TConfig` type.
|
|
14
|
-
*/
|
|
15
|
-
configSchema: z.ZodType<TConfig, unknown>;
|
|
16
|
-
/**
|
|
17
|
-
* Factory function to create a Cache instance.
|
|
18
|
-
*
|
|
19
|
-
* Cache factories may return a Promise to support lazy loading of optional
|
|
20
|
-
* dependencies (e.g., `ioredis`).
|
|
21
|
-
*
|
|
22
|
-
* @param config - Validated configuration specific to this backend
|
|
23
|
-
* @param logger - Logger instance for the cache
|
|
24
|
-
* @returns A Cache implementation (or Promise for async backends)
|
|
25
|
-
*/
|
|
26
|
-
create(config: TConfig, logger: Logger): Cache | Promise<Cache>;
|
|
27
|
-
/**
|
|
28
|
-
* Optional metadata for documentation, UIs, and discovery.
|
|
29
|
-
*/
|
|
30
|
-
metadata?: {
|
|
31
|
-
/** Human-readable name (e.g., "Redis", "Memcached") */
|
|
32
|
-
displayName: string;
|
|
33
|
-
/** Brief description of this cache backend */
|
|
34
|
-
description: string;
|
|
35
|
-
/** Whether this backend requires network connectivity */
|
|
36
|
-
requiresNetwork?: boolean;
|
|
37
|
-
/** Whether this backend supports TTL (time-to-live) */
|
|
38
|
-
supportsTTL?: boolean;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/cache/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,WAAW,YAAY,CAAC,OAAO,GAAG,OAAO;IAC3C;;;OAGG;IACH,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE1C;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhE;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP,uDAAuD;QACvD,WAAW,EAAE,MAAM,CAAC;QACpB,8CAA8C;QAC9C,WAAW,EAAE,MAAM,CAAC;QACpB,yDAAyD;QACzD,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,uDAAuD;QACvD,WAAW,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACL"}
|
package/dist/cache/factory.js
DELETED
|
File without changes
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var factories_exports = {};
|
|
20
|
-
__export(factories_exports, {
|
|
21
|
-
inMemoryDatabaseFactory: () => import_memory.inMemoryDatabaseFactory,
|
|
22
|
-
postgresDatabaseFactory: () => import_postgres.postgresDatabaseFactory,
|
|
23
|
-
sqliteDatabaseFactory: () => import_sqlite.sqliteDatabaseFactory
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(factories_exports);
|
|
26
|
-
var import_memory = require("./memory.js");
|
|
27
|
-
var import_sqlite = require("./sqlite.js");
|
|
28
|
-
var import_postgres = require("./postgres.js");
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
inMemoryDatabaseFactory,
|
|
32
|
-
postgresDatabaseFactory,
|
|
33
|
-
sqliteDatabaseFactory
|
|
34
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/factories/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var memory_exports = {};
|
|
20
|
-
__export(memory_exports, {
|
|
21
|
-
inMemoryDatabaseFactory: () => inMemoryDatabaseFactory
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(memory_exports);
|
|
24
|
-
var import_schemas = require("../schemas.js");
|
|
25
|
-
var import_memory_database_store = require("../memory-database-store.js");
|
|
26
|
-
const inMemoryDatabaseFactory = {
|
|
27
|
-
configSchema: import_schemas.InMemoryDatabaseSchema,
|
|
28
|
-
create: (_config, _logger) => new import_memory_database_store.MemoryDatabaseStore(),
|
|
29
|
-
metadata: {
|
|
30
|
-
displayName: "In-Memory",
|
|
31
|
-
description: "Store data in RAM (ephemeral, for testing and development)",
|
|
32
|
-
requiresNetwork: false,
|
|
33
|
-
supportsListOperations: true
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
inMemoryDatabaseFactory
|
|
39
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { InMemoryDatabaseConfig } from '../schemas.js';
|
|
2
|
-
import type { DatabaseFactory } from '../factory.js';
|
|
3
|
-
/**
|
|
4
|
-
* Factory for in-memory database storage.
|
|
5
|
-
*
|
|
6
|
-
* This factory stores data in RAM and is ideal for development,
|
|
7
|
-
* testing, and ephemeral use cases where persistence is not required.
|
|
8
|
-
*
|
|
9
|
-
* Features:
|
|
10
|
-
* - Zero external dependencies
|
|
11
|
-
* - Fast in-memory operations
|
|
12
|
-
* - No network required
|
|
13
|
-
* - Data is lost on restart
|
|
14
|
-
*/
|
|
15
|
-
export declare const inMemoryDatabaseFactory: DatabaseFactory<InMemoryDatabaseConfig>;
|
|
16
|
-
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/database/factories/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,sBAAsB,CAS3E,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { InMemoryDatabaseSchema } from "../schemas.js";
|
|
2
|
-
import { MemoryDatabaseStore } from "../memory-database-store.js";
|
|
3
|
-
const inMemoryDatabaseFactory = {
|
|
4
|
-
configSchema: InMemoryDatabaseSchema,
|
|
5
|
-
create: (_config, _logger) => new MemoryDatabaseStore(),
|
|
6
|
-
metadata: {
|
|
7
|
-
displayName: "In-Memory",
|
|
8
|
-
description: "Store data in RAM (ephemeral, for testing and development)",
|
|
9
|
-
requiresNetwork: false,
|
|
10
|
-
supportsListOperations: true
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
inMemoryDatabaseFactory
|
|
15
|
-
};
|