@dexto/storage 1.6.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/LICENSE +44 -0
- package/README.md +80 -0
- package/dist/blob/factories/index.cjs +31 -0
- package/dist/blob/factories/index.d.cts +6 -0
- package/dist/blob/factories/index.d.ts +6 -0
- package/dist/blob/factories/index.d.ts.map +1 -0
- package/dist/blob/factories/index.js +6 -0
- package/dist/blob/factories/local.cjs +38 -0
- package/dist/blob/factories/local.d.cts +21 -0
- package/dist/blob/factories/local.d.ts +17 -0
- package/dist/blob/factories/local.d.ts.map +1 -0
- package/dist/blob/factories/local.js +14 -0
- package/dist/blob/factories/memory.cjs +44 -0
- package/dist/blob/factories/memory.d.cts +21 -0
- package/dist/blob/factories/memory.d.ts +17 -0
- package/dist/blob/factories/memory.d.ts.map +1 -0
- package/dist/blob/factories/memory.js +20 -0
- package/dist/blob/factory.cjs +16 -0
- package/dist/blob/factory.d.cts +36 -0
- package/dist/blob/factory.d.ts +35 -0
- package/dist/blob/factory.d.ts.map +1 -0
- package/dist/blob/factory.js +0 -0
- package/dist/blob/index.cjs +45 -0
- package/dist/blob/index.d.cts +8 -0
- package/dist/blob/index.d.ts +26 -0
- package/dist/blob/index.d.ts.map +1 -0
- package/dist/blob/index.js +19 -0
- package/dist/blob/local-blob-store.cjs +532 -0
- package/dist/blob/local-blob-store.d.cts +56 -0
- package/dist/blob/local-blob-store.d.ts +54 -0
- package/dist/blob/local-blob-store.d.ts.map +1 -0
- package/dist/blob/local-blob-store.js +498 -0
- package/dist/blob/memory-blob-store.cjs +327 -0
- package/dist/blob/memory-blob-store.d.cts +69 -0
- package/dist/blob/memory-blob-store.d.ts +67 -0
- package/dist/blob/memory-blob-store.d.ts.map +1 -0
- package/dist/blob/memory-blob-store.js +303 -0
- package/dist/blob/schemas.cjs +52 -0
- package/dist/blob/schemas.d.cts +87 -0
- package/dist/blob/schemas.d.ts +86 -0
- package/dist/blob/schemas.d.ts.map +1 -0
- package/dist/blob/schemas.js +25 -0
- package/dist/blob/types.cjs +16 -0
- package/dist/blob/types.d.cts +1 -0
- package/dist/blob/types.d.ts +2 -0
- package/dist/blob/types.d.ts.map +1 -0
- package/dist/blob/types.js +0 -0
- package/dist/cache/factories/index.cjs +31 -0
- package/dist/cache/factories/index.d.cts +6 -0
- package/dist/cache/factories/index.d.ts +6 -0
- package/dist/cache/factories/index.d.ts.map +1 -0
- package/dist/cache/factories/index.js +6 -0
- package/dist/cache/factories/memory.cjs +39 -0
- package/dist/cache/factories/memory.d.cts +21 -0
- package/dist/cache/factories/memory.d.ts +17 -0
- package/dist/cache/factories/memory.d.ts.map +1 -0
- package/dist/cache/factories/memory.js +15 -0
- package/dist/cache/factories/redis.cjs +65 -0
- package/dist/cache/factories/redis.d.cts +24 -0
- package/dist/cache/factories/redis.d.ts +20 -0
- package/dist/cache/factories/redis.d.ts.map +1 -0
- package/dist/cache/factories/redis.js +31 -0
- package/dist/cache/factory.cjs +16 -0
- package/dist/cache/factory.d.cts +42 -0
- package/dist/cache/factory.d.ts +41 -0
- package/dist/cache/factory.d.ts.map +1 -0
- package/dist/cache/factory.js +0 -0
- package/dist/cache/index.cjs +42 -0
- package/dist/cache/index.d.cts +7 -0
- package/dist/cache/index.d.ts +25 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +17 -0
- package/dist/cache/memory-cache-store.cjs +106 -0
- package/dist/cache/memory-cache-store.d.cts +27 -0
- package/dist/cache/memory-cache-store.d.ts +25 -0
- package/dist/cache/memory-cache-store.d.ts.map +1 -0
- package/dist/cache/memory-cache-store.js +82 -0
- package/dist/cache/redis-store.cjs +176 -0
- package/dist/cache/redis-store.d.cts +34 -0
- package/dist/cache/redis-store.d.ts +32 -0
- package/dist/cache/redis-store.d.ts.map +1 -0
- package/dist/cache/redis-store.js +152 -0
- package/dist/cache/schemas.cjs +70 -0
- package/dist/cache/schemas.d.cts +93 -0
- package/dist/cache/schemas.d.ts +91 -0
- package/dist/cache/schemas.d.ts.map +1 -0
- package/dist/cache/schemas.js +43 -0
- package/dist/cache/types.cjs +16 -0
- package/dist/cache/types.d.cts +1 -0
- package/dist/cache/types.d.ts +2 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +0 -0
- package/dist/database/factories/index.cjs +34 -0
- package/dist/database/factories/index.d.cts +7 -0
- package/dist/database/factories/index.d.ts +7 -0
- package/dist/database/factories/index.d.ts.map +1 -0
- package/dist/database/factories/index.js +8 -0
- package/dist/database/factories/memory.cjs +39 -0
- package/dist/database/factories/memory.d.cts +20 -0
- package/dist/database/factories/memory.d.ts +16 -0
- package/dist/database/factories/memory.d.ts.map +1 -0
- package/dist/database/factories/memory.js +15 -0
- package/dist/database/factories/postgres.cjs +61 -0
- package/dist/database/factories/postgres.d.cts +23 -0
- package/dist/database/factories/postgres.d.ts +19 -0
- package/dist/database/factories/postgres.d.ts.map +1 -0
- package/dist/database/factories/postgres.js +27 -0
- package/dist/database/factories/sqlite.cjs +65 -0
- package/dist/database/factories/sqlite.d.cts +24 -0
- package/dist/database/factories/sqlite.d.ts +20 -0
- package/dist/database/factories/sqlite.d.ts.map +1 -0
- package/dist/database/factories/sqlite.js +31 -0
- package/dist/database/factory.cjs +16 -0
- package/dist/database/factory.d.cts +42 -0
- package/dist/database/factory.d.ts +41 -0
- package/dist/database/factory.d.ts.map +1 -0
- package/dist/database/factory.js +0 -0
- package/dist/database/index.cjs +46 -0
- package/dist/database/index.d.cts +8 -0
- package/dist/database/index.d.ts +26 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +24 -0
- package/dist/database/memory-database-store.cjs +121 -0
- package/dist/database/memory-database-store.d.cts +30 -0
- package/dist/database/memory-database-store.d.ts +28 -0
- package/dist/database/memory-database-store.d.ts.map +1 -0
- package/dist/database/memory-database-store.js +97 -0
- package/dist/database/postgres-store.cjs +342 -0
- package/dist/database/postgres-store.d.cts +57 -0
- package/dist/database/postgres-store.d.ts +55 -0
- package/dist/database/postgres-store.d.ts.map +1 -0
- package/dist/database/postgres-store.js +318 -0
- package/dist/database/schemas.cjs +82 -0
- package/dist/database/schemas.d.cts +127 -0
- package/dist/database/schemas.d.ts +125 -0
- package/dist/database/schemas.d.ts.map +1 -0
- package/dist/database/schemas.js +54 -0
- package/dist/database/sqlite-store.cjs +270 -0
- package/dist/database/sqlite-store.d.cts +35 -0
- package/dist/database/sqlite-store.d.ts +33 -0
- package/dist/database/sqlite-store.d.ts.map +1 -0
- package/dist/database/sqlite-store.js +236 -0
- package/dist/database/types.cjs +16 -0
- package/dist/database/types.d.cts +1 -0
- package/dist/database/types.d.ts +2 -0
- package/dist/database/types.d.ts.map +1 -0
- package/dist/database/types.js +0 -0
- package/dist/index.cjs +82 -0
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/schemas.cjs +67 -0
- package/dist/schemas.d.cts +72 -0
- package/dist/schemas.d.ts +70 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +46 -0
- package/package.json +55 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
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 index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
|
+
BLOB_STORE_TYPES: () => import_schemas.BLOB_STORE_TYPES,
|
|
22
|
+
BlobStoreConfigSchema: () => import_schemas.BlobStoreConfigSchema,
|
|
23
|
+
CACHE_TYPES: () => import_schemas.CACHE_TYPES,
|
|
24
|
+
CacheConfigSchema: () => import_schemas.CacheConfigSchema,
|
|
25
|
+
DATABASE_TYPES: () => import_schemas.DATABASE_TYPES,
|
|
26
|
+
DatabaseConfigSchema: () => import_schemas.DatabaseConfigSchema,
|
|
27
|
+
InMemoryBlobStoreSchema: () => import_schemas.InMemoryBlobStoreSchema,
|
|
28
|
+
LocalBlobStore: () => import_local_blob_store.LocalBlobStore,
|
|
29
|
+
LocalBlobStoreSchema: () => import_schemas.LocalBlobStoreSchema,
|
|
30
|
+
MemoryBlobStore: () => import_memory_blob_store.MemoryBlobStore,
|
|
31
|
+
MemoryCacheStore: () => import_memory_cache_store.MemoryCacheStore,
|
|
32
|
+
MemoryDatabaseStore: () => import_memory_database_store.MemoryDatabaseStore,
|
|
33
|
+
PostgresStore: () => import_postgres_store.PostgresStore,
|
|
34
|
+
RedisStore: () => import_redis_store.RedisStore,
|
|
35
|
+
SQLiteStore: () => import_sqlite_store.SQLiteStore,
|
|
36
|
+
StorageSchema: () => import_schemas.StorageSchema,
|
|
37
|
+
inMemoryBlobStoreFactory: () => import_factories3.inMemoryBlobStoreFactory,
|
|
38
|
+
inMemoryCacheFactory: () => import_factories.inMemoryCacheFactory,
|
|
39
|
+
inMemoryDatabaseFactory: () => import_factories2.inMemoryDatabaseFactory,
|
|
40
|
+
localBlobStoreFactory: () => import_factories3.localBlobStoreFactory,
|
|
41
|
+
postgresDatabaseFactory: () => import_factories2.postgresDatabaseFactory,
|
|
42
|
+
redisCacheFactory: () => import_factories.redisCacheFactory,
|
|
43
|
+
sqliteDatabaseFactory: () => import_factories2.sqliteDatabaseFactory
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(index_exports);
|
|
46
|
+
var import_schemas = require("./schemas.js");
|
|
47
|
+
var import_factories = require("./cache/factories/index.js");
|
|
48
|
+
var import_memory_cache_store = require("./cache/memory-cache-store.js");
|
|
49
|
+
var import_redis_store = require("./cache/redis-store.js");
|
|
50
|
+
var import_factories2 = require("./database/factories/index.js");
|
|
51
|
+
var import_memory_database_store = require("./database/memory-database-store.js");
|
|
52
|
+
var import_sqlite_store = require("./database/sqlite-store.js");
|
|
53
|
+
var import_postgres_store = require("./database/postgres-store.js");
|
|
54
|
+
var import_factories3 = require("./blob/factories/index.js");
|
|
55
|
+
var import_local_blob_store = require("./blob/local-blob-store.js");
|
|
56
|
+
var import_memory_blob_store = require("./blob/memory-blob-store.js");
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
BLOB_STORE_TYPES,
|
|
60
|
+
BlobStoreConfigSchema,
|
|
61
|
+
CACHE_TYPES,
|
|
62
|
+
CacheConfigSchema,
|
|
63
|
+
DATABASE_TYPES,
|
|
64
|
+
DatabaseConfigSchema,
|
|
65
|
+
InMemoryBlobStoreSchema,
|
|
66
|
+
LocalBlobStore,
|
|
67
|
+
LocalBlobStoreSchema,
|
|
68
|
+
MemoryBlobStore,
|
|
69
|
+
MemoryCacheStore,
|
|
70
|
+
MemoryDatabaseStore,
|
|
71
|
+
PostgresStore,
|
|
72
|
+
RedisStore,
|
|
73
|
+
SQLiteStore,
|
|
74
|
+
StorageSchema,
|
|
75
|
+
inMemoryBlobStoreFactory,
|
|
76
|
+
inMemoryCacheFactory,
|
|
77
|
+
inMemoryDatabaseFactory,
|
|
78
|
+
localBlobStoreFactory,
|
|
79
|
+
postgresDatabaseFactory,
|
|
80
|
+
redisCacheFactory,
|
|
81
|
+
sqliteDatabaseFactory
|
|
82
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { StorageConfig, StorageSchema, ValidatedStorageConfig } from './schemas.cjs';
|
|
2
|
+
export { CacheFactory } from './cache/factory.cjs';
|
|
3
|
+
export { inMemoryCacheFactory } from './cache/factories/memory.cjs';
|
|
4
|
+
export { redisCacheFactory } from './cache/factories/redis.cjs';
|
|
5
|
+
export { CACHE_TYPES, CacheConfig, CacheConfigSchema, CacheType, InMemoryCacheConfig, RedisCacheConfig } from './cache/schemas.cjs';
|
|
6
|
+
export { MemoryCacheStore } from './cache/memory-cache-store.cjs';
|
|
7
|
+
export { RedisStore } from './cache/redis-store.cjs';
|
|
8
|
+
export { DatabaseFactory } from './database/factory.cjs';
|
|
9
|
+
export { inMemoryDatabaseFactory } from './database/factories/memory.cjs';
|
|
10
|
+
export { sqliteDatabaseFactory } from './database/factories/sqlite.cjs';
|
|
11
|
+
export { postgresDatabaseFactory } from './database/factories/postgres.cjs';
|
|
12
|
+
export { DATABASE_TYPES, DatabaseConfig, DatabaseConfigSchema, DatabaseType, InMemoryDatabaseConfig, PostgresDatabaseConfig, SqliteDatabaseConfig } from './database/schemas.cjs';
|
|
13
|
+
export { MemoryDatabaseStore } from './database/memory-database-store.cjs';
|
|
14
|
+
export { SQLiteStore } from './database/sqlite-store.cjs';
|
|
15
|
+
export { PostgresStore } from './database/postgres-store.cjs';
|
|
16
|
+
export { BlobStoreFactory } from './blob/factory.cjs';
|
|
17
|
+
export { localBlobStoreFactory } from './blob/factories/local.cjs';
|
|
18
|
+
export { inMemoryBlobStoreFactory } from './blob/factories/memory.cjs';
|
|
19
|
+
export { BLOB_STORE_TYPES, BlobStoreConfig, BlobStoreConfigSchema, BlobStoreType, InMemoryBlobStoreConfig, InMemoryBlobStoreConfigInput, InMemoryBlobStoreSchema, LocalBlobStoreConfig, LocalBlobStoreConfigInput, LocalBlobStoreSchema } from './blob/schemas.cjs';
|
|
20
|
+
export { LocalBlobStore } from './blob/local-blob-store.cjs';
|
|
21
|
+
export { MemoryBlobStore } from './blob/memory-blob-store.cjs';
|
|
22
|
+
import 'zod';
|
|
23
|
+
import '@dexto/core';
|
|
24
|
+
import 'pg';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @dexto/storage
|
|
3
|
+
*
|
|
4
|
+
* Concrete storage backends + config schemas + factory objects.
|
|
5
|
+
*
|
|
6
|
+
* Core keeps only the storage *interfaces* (`BlobStore`, `Database`, `Cache`) and `StorageManager`.
|
|
7
|
+
* Product layers (CLI/server/platform) choose which factories to include via images.
|
|
8
|
+
*/
|
|
9
|
+
export type { StorageConfig, ValidatedStorageConfig } from './schemas.js';
|
|
10
|
+
export { StorageSchema, CACHE_TYPES, DATABASE_TYPES, BLOB_STORE_TYPES, CacheConfigSchema, DatabaseConfigSchema, BlobStoreConfigSchema, InMemoryBlobStoreSchema, LocalBlobStoreSchema, } from './schemas.js';
|
|
11
|
+
export type { CacheType, DatabaseType, BlobStoreType, CacheConfig, InMemoryCacheConfig, RedisCacheConfig, DatabaseConfig, InMemoryDatabaseConfig, SqliteDatabaseConfig, PostgresDatabaseConfig, BlobStoreConfig, InMemoryBlobStoreConfigInput, InMemoryBlobStoreConfig, LocalBlobStoreConfigInput, LocalBlobStoreConfig, } from './schemas.js';
|
|
12
|
+
export type { CacheFactory } from './cache/index.js';
|
|
13
|
+
export { inMemoryCacheFactory, redisCacheFactory } from './cache/factories/index.js';
|
|
14
|
+
export { MemoryCacheStore } from './cache/memory-cache-store.js';
|
|
15
|
+
export { RedisStore } from './cache/redis-store.js';
|
|
16
|
+
export type { DatabaseFactory } from './database/index.js';
|
|
17
|
+
export { inMemoryDatabaseFactory, sqliteDatabaseFactory, postgresDatabaseFactory, } from './database/factories/index.js';
|
|
18
|
+
export { MemoryDatabaseStore } from './database/memory-database-store.js';
|
|
19
|
+
export { SQLiteStore } from './database/sqlite-store.js';
|
|
20
|
+
export { PostgresStore } from './database/postgres-store.js';
|
|
21
|
+
export type { BlobStoreFactory } from './blob/index.js';
|
|
22
|
+
export { localBlobStoreFactory, inMemoryBlobStoreFactory } from './blob/factories/index.js';
|
|
23
|
+
export { LocalBlobStore } from './blob/local-blob-store.js';
|
|
24
|
+
export { MemoryBlobStore } from './blob/memory-blob-store.js';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EACH,aAAa,EACb,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACvB,MAAM,cAAc,CAAC;AACtB,YAAY,EACR,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,GACvB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACH,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StorageSchema,
|
|
3
|
+
CACHE_TYPES,
|
|
4
|
+
DATABASE_TYPES,
|
|
5
|
+
BLOB_STORE_TYPES,
|
|
6
|
+
CacheConfigSchema,
|
|
7
|
+
DatabaseConfigSchema,
|
|
8
|
+
BlobStoreConfigSchema,
|
|
9
|
+
InMemoryBlobStoreSchema,
|
|
10
|
+
LocalBlobStoreSchema
|
|
11
|
+
} from "./schemas.js";
|
|
12
|
+
import { inMemoryCacheFactory, redisCacheFactory } from "./cache/factories/index.js";
|
|
13
|
+
import { MemoryCacheStore } from "./cache/memory-cache-store.js";
|
|
14
|
+
import { RedisStore } from "./cache/redis-store.js";
|
|
15
|
+
import {
|
|
16
|
+
inMemoryDatabaseFactory,
|
|
17
|
+
sqliteDatabaseFactory,
|
|
18
|
+
postgresDatabaseFactory
|
|
19
|
+
} from "./database/factories/index.js";
|
|
20
|
+
import { MemoryDatabaseStore } from "./database/memory-database-store.js";
|
|
21
|
+
import { SQLiteStore } from "./database/sqlite-store.js";
|
|
22
|
+
import { PostgresStore } from "./database/postgres-store.js";
|
|
23
|
+
import { localBlobStoreFactory, inMemoryBlobStoreFactory } from "./blob/factories/index.js";
|
|
24
|
+
import { LocalBlobStore } from "./blob/local-blob-store.js";
|
|
25
|
+
import { MemoryBlobStore } from "./blob/memory-blob-store.js";
|
|
26
|
+
export {
|
|
27
|
+
BLOB_STORE_TYPES,
|
|
28
|
+
BlobStoreConfigSchema,
|
|
29
|
+
CACHE_TYPES,
|
|
30
|
+
CacheConfigSchema,
|
|
31
|
+
DATABASE_TYPES,
|
|
32
|
+
DatabaseConfigSchema,
|
|
33
|
+
InMemoryBlobStoreSchema,
|
|
34
|
+
LocalBlobStore,
|
|
35
|
+
LocalBlobStoreSchema,
|
|
36
|
+
MemoryBlobStore,
|
|
37
|
+
MemoryCacheStore,
|
|
38
|
+
MemoryDatabaseStore,
|
|
39
|
+
PostgresStore,
|
|
40
|
+
RedisStore,
|
|
41
|
+
SQLiteStore,
|
|
42
|
+
StorageSchema,
|
|
43
|
+
inMemoryBlobStoreFactory,
|
|
44
|
+
inMemoryCacheFactory,
|
|
45
|
+
inMemoryDatabaseFactory,
|
|
46
|
+
localBlobStoreFactory,
|
|
47
|
+
postgresDatabaseFactory,
|
|
48
|
+
redisCacheFactory,
|
|
49
|
+
sqliteDatabaseFactory
|
|
50
|
+
};
|
package/dist/schemas.cjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
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 schemas_exports = {};
|
|
20
|
+
__export(schemas_exports, {
|
|
21
|
+
BLOB_STORE_TYPES: () => import_schemas3.BLOB_STORE_TYPES,
|
|
22
|
+
BlobStoreConfigSchema: () => import_schemas3.BlobStoreConfigSchema,
|
|
23
|
+
CACHE_TYPES: () => import_schemas.CACHE_TYPES,
|
|
24
|
+
CacheConfigSchema: () => import_schemas.CacheConfigSchema,
|
|
25
|
+
DATABASE_TYPES: () => import_schemas2.DATABASE_TYPES,
|
|
26
|
+
DatabaseConfigSchema: () => import_schemas2.DatabaseConfigSchema,
|
|
27
|
+
InMemoryBlobStoreSchema: () => import_schemas3.InMemoryBlobStoreSchema,
|
|
28
|
+
InMemoryCacheSchema: () => import_schemas.InMemoryCacheSchema,
|
|
29
|
+
InMemoryDatabaseSchema: () => import_schemas2.InMemoryDatabaseSchema,
|
|
30
|
+
LocalBlobStoreSchema: () => import_schemas3.LocalBlobStoreSchema,
|
|
31
|
+
PostgresDatabaseSchema: () => import_schemas2.PostgresDatabaseSchema,
|
|
32
|
+
RedisCacheSchema: () => import_schemas.RedisCacheSchema,
|
|
33
|
+
SqliteDatabaseSchema: () => import_schemas2.SqliteDatabaseSchema,
|
|
34
|
+
StorageSchema: () => StorageSchema
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
37
|
+
var import_zod = require("zod");
|
|
38
|
+
var import_schemas = require("./cache/schemas.js");
|
|
39
|
+
var import_schemas2 = require("./database/schemas.js");
|
|
40
|
+
var import_schemas3 = require("./blob/schemas.js");
|
|
41
|
+
var import_schemas4 = require("./cache/schemas.js");
|
|
42
|
+
var import_schemas5 = require("./database/schemas.js");
|
|
43
|
+
var import_schemas6 = require("./blob/schemas.js");
|
|
44
|
+
const StorageSchema = import_zod.z.object({
|
|
45
|
+
cache: import_schemas4.CacheConfigSchema.describe("Cache configuration (fast, ephemeral)"),
|
|
46
|
+
database: import_schemas5.DatabaseConfigSchema.describe("Database configuration (persistent, reliable)"),
|
|
47
|
+
blob: import_schemas6.BlobStoreConfigSchema.describe(
|
|
48
|
+
"Blob store configuration (for large, unstructured data)"
|
|
49
|
+
)
|
|
50
|
+
}).strict().describe("Storage configuration with cache, database, and blob store").brand();
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
BLOB_STORE_TYPES,
|
|
54
|
+
BlobStoreConfigSchema,
|
|
55
|
+
CACHE_TYPES,
|
|
56
|
+
CacheConfigSchema,
|
|
57
|
+
DATABASE_TYPES,
|
|
58
|
+
DatabaseConfigSchema,
|
|
59
|
+
InMemoryBlobStoreSchema,
|
|
60
|
+
InMemoryCacheSchema,
|
|
61
|
+
InMemoryDatabaseSchema,
|
|
62
|
+
LocalBlobStoreSchema,
|
|
63
|
+
PostgresDatabaseSchema,
|
|
64
|
+
RedisCacheSchema,
|
|
65
|
+
SqliteDatabaseSchema,
|
|
66
|
+
StorageSchema
|
|
67
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { CACHE_TYPES, CacheConfig, CacheConfigSchema, CacheType, InMemoryCacheConfig, InMemoryCacheSchema, RedisCacheConfig, RedisCacheSchema } from './cache/schemas.cjs';
|
|
3
|
+
export { DATABASE_TYPES, DatabaseConfig, DatabaseConfigSchema, DatabaseType, InMemoryDatabaseConfig, InMemoryDatabaseSchema, PostgresDatabaseConfig, PostgresDatabaseSchema, SqliteDatabaseConfig, SqliteDatabaseSchema } from './database/schemas.cjs';
|
|
4
|
+
export { BLOB_STORE_TYPES, BlobStoreConfig, BlobStoreConfigSchema, BlobStoreType, InMemoryBlobStoreConfig, InMemoryBlobStoreConfigInput, InMemoryBlobStoreSchema, LocalBlobStoreConfig, LocalBlobStoreConfigInput, LocalBlobStoreSchema } from './blob/schemas.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Top-level storage configuration schema
|
|
8
|
+
* Composes cache, database, and blob store configurations
|
|
9
|
+
*
|
|
10
|
+
* Note: detailed backend validation happens in the resolver (`@dexto/agent-config`)
|
|
11
|
+
* via each image factory's `configSchema`. This schema validates only the structural
|
|
12
|
+
* shape required for config parsing and defaults.
|
|
13
|
+
*/
|
|
14
|
+
declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
15
|
+
cache: z.ZodObject<{
|
|
16
|
+
type: z.ZodString;
|
|
17
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
18
|
+
type: z.ZodString;
|
|
19
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
20
|
+
type: z.ZodString;
|
|
21
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
22
|
+
database: z.ZodObject<{
|
|
23
|
+
type: z.ZodString;
|
|
24
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
27
|
+
type: z.ZodString;
|
|
28
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
29
|
+
blob: z.ZodObject<{
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
32
|
+
type: z.ZodString;
|
|
33
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
34
|
+
type: z.ZodString;
|
|
35
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
database: {
|
|
38
|
+
type: string;
|
|
39
|
+
} & {
|
|
40
|
+
[k: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
cache: {
|
|
43
|
+
type: string;
|
|
44
|
+
} & {
|
|
45
|
+
[k: string]: unknown;
|
|
46
|
+
};
|
|
47
|
+
blob: {
|
|
48
|
+
type: string;
|
|
49
|
+
} & {
|
|
50
|
+
[k: string]: unknown;
|
|
51
|
+
};
|
|
52
|
+
}, {
|
|
53
|
+
database: {
|
|
54
|
+
type: string;
|
|
55
|
+
} & {
|
|
56
|
+
[k: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
cache: {
|
|
59
|
+
type: string;
|
|
60
|
+
} & {
|
|
61
|
+
[k: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
blob: {
|
|
64
|
+
type: string;
|
|
65
|
+
} & {
|
|
66
|
+
[k: string]: unknown;
|
|
67
|
+
};
|
|
68
|
+
}>, "ValidatedStorageConfig">;
|
|
69
|
+
type StorageConfig = z.input<typeof StorageSchema>;
|
|
70
|
+
type ValidatedStorageConfig = z.output<typeof StorageSchema>;
|
|
71
|
+
|
|
72
|
+
export { type StorageConfig, StorageSchema, type ValidatedStorageConfig };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { CACHE_TYPES, CacheConfigSchema, type CacheType, type CacheConfig, InMemoryCacheSchema, type InMemoryCacheConfig, RedisCacheSchema, type RedisCacheConfig, } from './cache/schemas.js';
|
|
3
|
+
export { DATABASE_TYPES, DatabaseConfigSchema, type DatabaseType, type DatabaseConfig, InMemoryDatabaseSchema, type InMemoryDatabaseConfig, SqliteDatabaseSchema, type SqliteDatabaseConfig, PostgresDatabaseSchema, type PostgresDatabaseConfig, } from './database/schemas.js';
|
|
4
|
+
export { BLOB_STORE_TYPES, BlobStoreConfigSchema, InMemoryBlobStoreSchema, LocalBlobStoreSchema, type BlobStoreType, type BlobStoreConfig, type InMemoryBlobStoreConfigInput, type InMemoryBlobStoreConfig, type LocalBlobStoreConfigInput, type LocalBlobStoreConfig, } from './blob/schemas.js';
|
|
5
|
+
/**
|
|
6
|
+
* Top-level storage configuration schema
|
|
7
|
+
* Composes cache, database, and blob store configurations
|
|
8
|
+
*
|
|
9
|
+
* Note: detailed backend validation happens in the resolver (`@dexto/agent-config`)
|
|
10
|
+
* via each image factory's `configSchema`. This schema validates only the structural
|
|
11
|
+
* shape required for config parsing and defaults.
|
|
12
|
+
*/
|
|
13
|
+
export declare const StorageSchema: z.ZodBranded<z.ZodObject<{
|
|
14
|
+
cache: z.ZodObject<{
|
|
15
|
+
type: z.ZodString;
|
|
16
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
17
|
+
type: z.ZodString;
|
|
18
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
19
|
+
type: z.ZodString;
|
|
20
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
21
|
+
database: z.ZodObject<{
|
|
22
|
+
type: z.ZodString;
|
|
23
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
24
|
+
type: z.ZodString;
|
|
25
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
26
|
+
type: z.ZodString;
|
|
27
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
28
|
+
blob: z.ZodObject<{
|
|
29
|
+
type: z.ZodString;
|
|
30
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
31
|
+
type: z.ZodString;
|
|
32
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
33
|
+
type: z.ZodString;
|
|
34
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
database: {
|
|
37
|
+
type: string;
|
|
38
|
+
} & {
|
|
39
|
+
[k: string]: unknown;
|
|
40
|
+
};
|
|
41
|
+
cache: {
|
|
42
|
+
type: string;
|
|
43
|
+
} & {
|
|
44
|
+
[k: string]: unknown;
|
|
45
|
+
};
|
|
46
|
+
blob: {
|
|
47
|
+
type: string;
|
|
48
|
+
} & {
|
|
49
|
+
[k: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
database: {
|
|
53
|
+
type: string;
|
|
54
|
+
} & {
|
|
55
|
+
[k: string]: unknown;
|
|
56
|
+
};
|
|
57
|
+
cache: {
|
|
58
|
+
type: string;
|
|
59
|
+
} & {
|
|
60
|
+
[k: string]: unknown;
|
|
61
|
+
};
|
|
62
|
+
blob: {
|
|
63
|
+
type: string;
|
|
64
|
+
} & {
|
|
65
|
+
[k: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
}>, "ValidatedStorageConfig">;
|
|
68
|
+
export type StorageConfig = z.input<typeof StorageSchema>;
|
|
69
|
+
export type ValidatedStorageConfig = z.output<typeof StorageSchema>;
|
|
70
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EACH,WAAW,EACX,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,gBAAgB,EAChB,KAAK,gBAAgB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACH,cAAc,EACd,oBAAoB,EACpB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,sBAAsB,EACtB,KAAK,sBAAsB,GAC9B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACH,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC5B,MAAM,mBAAmB,CAAC;AAO3B;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAUY,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
CACHE_TYPES,
|
|
4
|
+
CacheConfigSchema,
|
|
5
|
+
InMemoryCacheSchema,
|
|
6
|
+
RedisCacheSchema
|
|
7
|
+
} from "./cache/schemas.js";
|
|
8
|
+
import {
|
|
9
|
+
DATABASE_TYPES,
|
|
10
|
+
DatabaseConfigSchema,
|
|
11
|
+
InMemoryDatabaseSchema,
|
|
12
|
+
SqliteDatabaseSchema,
|
|
13
|
+
PostgresDatabaseSchema
|
|
14
|
+
} from "./database/schemas.js";
|
|
15
|
+
import {
|
|
16
|
+
BLOB_STORE_TYPES,
|
|
17
|
+
BlobStoreConfigSchema,
|
|
18
|
+
InMemoryBlobStoreSchema,
|
|
19
|
+
LocalBlobStoreSchema
|
|
20
|
+
} from "./blob/schemas.js";
|
|
21
|
+
import { CacheConfigSchema as CacheConfigSchema2 } from "./cache/schemas.js";
|
|
22
|
+
import { DatabaseConfigSchema as DatabaseConfigSchema2 } from "./database/schemas.js";
|
|
23
|
+
import { BlobStoreConfigSchema as BlobStoreConfigSchema2 } from "./blob/schemas.js";
|
|
24
|
+
const StorageSchema = z.object({
|
|
25
|
+
cache: CacheConfigSchema2.describe("Cache configuration (fast, ephemeral)"),
|
|
26
|
+
database: DatabaseConfigSchema2.describe("Database configuration (persistent, reliable)"),
|
|
27
|
+
blob: BlobStoreConfigSchema2.describe(
|
|
28
|
+
"Blob store configuration (for large, unstructured data)"
|
|
29
|
+
)
|
|
30
|
+
}).strict().describe("Storage configuration with cache, database, and blob store").brand();
|
|
31
|
+
export {
|
|
32
|
+
BLOB_STORE_TYPES,
|
|
33
|
+
BlobStoreConfigSchema,
|
|
34
|
+
CACHE_TYPES,
|
|
35
|
+
CacheConfigSchema,
|
|
36
|
+
DATABASE_TYPES,
|
|
37
|
+
DatabaseConfigSchema,
|
|
38
|
+
InMemoryBlobStoreSchema,
|
|
39
|
+
InMemoryCacheSchema,
|
|
40
|
+
InMemoryDatabaseSchema,
|
|
41
|
+
LocalBlobStoreSchema,
|
|
42
|
+
PostgresDatabaseSchema,
|
|
43
|
+
RedisCacheSchema,
|
|
44
|
+
SqliteDatabaseSchema,
|
|
45
|
+
StorageSchema
|
|
46
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dexto/storage",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "Storage backends and factories for Dexto agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./schemas": {
|
|
14
|
+
"types": "./dist/schemas.d.ts",
|
|
15
|
+
"import": "./dist/schemas.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"dexto",
|
|
20
|
+
"storage"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"zod": "^3.25.0",
|
|
24
|
+
"@dexto/core": "1.6.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"better-sqlite3": "^11.10.0",
|
|
28
|
+
"ioredis": "^5.7.0",
|
|
29
|
+
"pg": "^8.15.4"
|
|
30
|
+
},
|
|
31
|
+
"peerDependenciesMeta": {
|
|
32
|
+
"better-sqlite3": {
|
|
33
|
+
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"ioredis": {
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
"pg": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"tsup": "^8.0.0",
|
|
44
|
+
"typescript": "^5.3.3"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsup",
|
|
52
|
+
"typecheck": "tsc --noEmit",
|
|
53
|
+
"clean": "rm -rf dist"
|
|
54
|
+
}
|
|
55
|
+
}
|