@karmaniverous/entity-manager 6.14.3 → 7.0.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 +171 -268
- package/dist/cjs/BaseEntityClient/BaseEntityClient.js +1 -1
- package/dist/cjs/BaseQueryBuilder/BaseQueryBuilder.js +3 -2
- package/dist/cjs/EntityManager/EntityManager.js +1 -1
- package/dist/cjs/EntityManager/createEntityManager.js +42 -0
- package/dist/cjs/EntityManager/decodeGeneratedProperty.js +4 -2
- package/dist/cjs/EntityManager/dehydratePageKeyMap.js +5 -4
- package/dist/cjs/EntityManager/getIndexComponents.js +6 -1
- package/dist/cjs/EntityManager/query.js +26 -11
- package/dist/cjs/EntityManager/rehydratePageKeyMap.js +6 -3
- package/dist/cjs/index.js +2 -0
- package/dist/index.d.ts +318 -117
- package/dist/mjs/BaseEntityClient/BaseEntityClient.js +1 -1
- package/dist/mjs/BaseQueryBuilder/BaseQueryBuilder.js +3 -2
- package/dist/mjs/EntityManager/EntityManager.js +1 -1
- package/dist/mjs/EntityManager/createEntityManager.js +40 -0
- package/dist/mjs/EntityManager/decodeGeneratedProperty.js +4 -2
- package/dist/mjs/EntityManager/dehydratePageKeyMap.js +5 -4
- package/dist/mjs/EntityManager/getIndexComponents.js +6 -1
- package/dist/mjs/EntityManager/query.js +26 -11
- package/dist/mjs/EntityManager/rehydratePageKeyMap.js +6 -3
- package/dist/mjs/index.js +1 -0
- package/package.json +132 -135
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base EntityClient class. Integrates {@link EntityManager | `EntityManager`} with injected logging & enhanced batch processing.
|
|
3
3
|
*
|
|
4
|
-
* @typeParam
|
|
4
|
+
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeRegistry | `TranscodeRegistry`}. If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
5
5
|
*
|
|
6
6
|
* @category EntityClient
|
|
7
7
|
*/
|
|
@@ -3,9 +3,10 @@ import { mapValues } from 'radash';
|
|
|
3
3
|
/**
|
|
4
4
|
* Abstract base class supporting a fluent API for building a {@link ShardQueryMap | `ShardQueryMap`} using a database client.
|
|
5
5
|
*
|
|
6
|
-
* @typeParam
|
|
6
|
+
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeRegistry | `TranscodeRegistry`}. If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
7
7
|
* @typeParam EntityClient - {@link BaseEntityClient | `BaseEntityClient`} derived class instance.
|
|
8
8
|
* @typeParam IndexParams - Database platform-specific, index-specific query parameters.
|
|
9
|
+
* @typeParam CF - Optional values-first config literal type for page key narrowing.
|
|
9
10
|
*
|
|
10
11
|
* @category QueryBuilder
|
|
11
12
|
*/
|
|
@@ -30,7 +31,7 @@ class BaseQueryBuilder {
|
|
|
30
31
|
* @returns - The {@link ShardQueryMap | `ShardQueryMap`} object.
|
|
31
32
|
*/
|
|
32
33
|
build() {
|
|
33
|
-
return mapValues(this.indexParamsMap, (
|
|
34
|
+
return mapValues(this.indexParamsMap, (_indexConfig, indexToken) => this.getShardQueryFunction(indexToken));
|
|
34
35
|
}
|
|
35
36
|
async query(options) {
|
|
36
37
|
const { entityClient: { entityManager }, entityToken, pageKeyMap, } = this;
|
|
@@ -12,7 +12,7 @@ var _EntityManager_config;
|
|
|
12
12
|
* The EntityManager class applies a configuration-driven sharded data model &
|
|
13
13
|
* query strategy to NoSql data.
|
|
14
14
|
*
|
|
15
|
-
* @typeParam
|
|
15
|
+
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines the configuration's {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeRegistry | `TranscodeRegistry`}. If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
18
|
* While the {@link EntityManager.query | `query`} method is `public`, normally it should not be called directly. The `query` method is used by a platform-specific {@link BaseQueryBuilder.query | `QueryBuilder.query`} method to provide a fluent query API.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { EntityManager } from './EntityManager.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Values-first factory that captures literal tokens and index names directly
|
|
5
|
+
* from the provided config value. Runtime config parsing/validation is
|
|
6
|
+
* unchanged (performed in the EntityManager constructor).
|
|
7
|
+
*
|
|
8
|
+
* @typeParam CC - Captured config input (values-first). Prefer `as const` and
|
|
9
|
+
* `satisfies` at call sites to preserve literal keys.
|
|
10
|
+
* @typeParam EM - EntityMap for the manager. Defaults to a minimal derived map
|
|
11
|
+
* from `CC.entitiesSchema` when present; otherwise falls back to EntityMap.
|
|
12
|
+
*/
|
|
13
|
+
function createEntityManager(config, logger = console) {
|
|
14
|
+
// Cast to the existing Config<C> shape for runtime parsing; Zod validation
|
|
15
|
+
// remains authoritative at construction time.
|
|
16
|
+
// Optional dev guardrail: cross-check entitiesSchema keys vs config.entities keys.
|
|
17
|
+
try {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
19
|
+
if (config && 'entitiesSchema' in config && config.entitiesSchema) {
|
|
20
|
+
const schemaKeys = Object.keys(config
|
|
21
|
+
.entitiesSchema ?? {});
|
|
22
|
+
const entitiesKeys = Object.keys(config
|
|
23
|
+
.entities ?? {});
|
|
24
|
+
const missingInEntities = schemaKeys.filter((k) => !entitiesKeys.includes(k));
|
|
25
|
+
const missingInSchema = entitiesKeys.filter((k) => !schemaKeys.includes(k));
|
|
26
|
+
if (missingInEntities.length || missingInSchema.length) {
|
|
27
|
+
logger.debug('entitiesSchema keys mismatch with config.entities', {
|
|
28
|
+
missingInEntities,
|
|
29
|
+
missingInSchema,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// Best-effort warning only; never block construction.
|
|
36
|
+
}
|
|
37
|
+
return new EntityManager(config, logger);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { createEntityManager };
|
|
@@ -5,14 +5,14 @@ import { decodeElement } from './decodeElement.js';
|
|
|
5
5
|
* Decode a generated property value. Returns an {@link EntityItem | `EntityItem`}.
|
|
6
6
|
*
|
|
7
7
|
* @param entityManager - {@link EntityManager | `EntityManager`} instance.
|
|
8
|
-
* @param entityToken - `entityManager.config.entities` key.
|
|
8
|
+
* @param entityToken - {@link Config.entities | `entityManager.config.entities`} key.
|
|
9
9
|
* @param encoded - Encoded generated property value.
|
|
10
10
|
*
|
|
11
11
|
* @returns {@link EntityItem | `EntityItem`} object with updated properties decoded from `encoded`.
|
|
12
12
|
*
|
|
13
13
|
* @throws `Error` if `entityToken` is invalid.
|
|
14
14
|
*/
|
|
15
|
-
function decodeGeneratedProperty(entityManager, encoded) {
|
|
15
|
+
function decodeGeneratedProperty(entityManager, entityToken, encoded) {
|
|
16
16
|
try {
|
|
17
17
|
const { generatedKeyDelimiter, generatedValueDelimiter, hashKey, shardKeyDelimiter, } = entityManager.config;
|
|
18
18
|
// Handle degenerate case.
|
|
@@ -37,6 +37,8 @@ function decodeGeneratedProperty(entityManager, encoded) {
|
|
|
37
37
|
encoded,
|
|
38
38
|
decoded,
|
|
39
39
|
});
|
|
40
|
+
// entityToken used for typing only (ET-narrowed result).
|
|
41
|
+
void entityToken;
|
|
40
42
|
return decoded;
|
|
41
43
|
}
|
|
42
44
|
catch (error) {
|
|
@@ -38,8 +38,8 @@ function dehydratePageKeyMap(entityManager, entityToken, pageKeyMap) {
|
|
|
38
38
|
}
|
|
39
39
|
// Extract, sort & validate indexs.
|
|
40
40
|
const indexes = Object.keys(pageKeyMap).sort();
|
|
41
|
-
indexes.map((
|
|
42
|
-
validateIndexToken(entityManager,
|
|
41
|
+
indexes.map((indexToken) => {
|
|
42
|
+
validateIndexToken(entityManager, indexToken);
|
|
43
43
|
});
|
|
44
44
|
// Extract & sort hash keys.
|
|
45
45
|
const hashKeys = Object.keys(pageKeyMap[indexes[0]]);
|
|
@@ -53,11 +53,12 @@ function dehydratePageKeyMap(entityManager, entityToken, pageKeyMap) {
|
|
|
53
53
|
continue;
|
|
54
54
|
}
|
|
55
55
|
// Compose item from page key
|
|
56
|
-
const
|
|
56
|
+
const pk = pageKeyMap[index][hashKey];
|
|
57
|
+
const item = Object.entries(pk).reduce((item, [property, value]) => {
|
|
57
58
|
if (property === entityManager.config.rangeKey ||
|
|
58
59
|
property in entityManager.config.generatedProperties.sharded ||
|
|
59
60
|
property in entityManager.config.generatedProperties.unsharded)
|
|
60
|
-
Object.assign(item, decodeGeneratedProperty(entityManager, value));
|
|
61
|
+
Object.assign(item, decodeGeneratedProperty(entityManager, entityToken, value));
|
|
61
62
|
else
|
|
62
63
|
Object.assign(item, { [property]: value });
|
|
63
64
|
return item;
|
|
@@ -15,7 +15,12 @@ function getIndexComponents(entityManager, indexToken) {
|
|
|
15
15
|
validateIndexToken(entityManager, indexToken);
|
|
16
16
|
const { hashKey, rangeKey, indexes } = entityManager.config;
|
|
17
17
|
const { hashKey: indexHashKey, rangeKey: indexRangeKey } = indexes[indexToken];
|
|
18
|
-
return unique([
|
|
18
|
+
return unique([
|
|
19
|
+
hashKey,
|
|
20
|
+
rangeKey,
|
|
21
|
+
indexHashKey,
|
|
22
|
+
indexRangeKey,
|
|
23
|
+
]);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
export { getIndexComponents };
|
|
@@ -56,17 +56,20 @@ async function query(entityManager, options) {
|
|
|
56
56
|
// items, which may be >> limit. Probably the way to fix entityManager is to limit the number of shards queried per
|
|
57
57
|
// iteration in order to keep shardsQueried * pageSize > (limit - items.length) but only just.
|
|
58
58
|
// TODO: Test for invalid characters (path delimiters) in index keys & shard key values.
|
|
59
|
+
// Build typed tasks (indexToken, hashKey, pageKey).
|
|
60
|
+
const tasks = [];
|
|
61
|
+
for (const [indexToken, indexPageKeys] of Object.entries(rehydratedPageKeyMap)) {
|
|
62
|
+
for (const [hashKey, pk] of Object.entries(indexPageKeys)) {
|
|
63
|
+
tasks.push([indexToken, hashKey, pk]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
59
66
|
// Query every shard on every index in pageKeyMap.
|
|
60
|
-
const shardQueryResults = await parallel(throttle,
|
|
61
|
-
indexToken,
|
|
62
|
-
hashKey,
|
|
63
|
-
pageKey,
|
|
64
|
-
])), async ([indexToken, hashKey, pageKey]) => ({
|
|
67
|
+
const shardQueryResults = await parallel(throttle, tasks, async ([indexToken, hashKey, pageKey]) => ({
|
|
65
68
|
indexToken,
|
|
66
69
|
queryResult: await shardQueryMap[indexToken](hashKey, pageKey, pageSize),
|
|
67
70
|
hashKey,
|
|
68
71
|
}));
|
|
69
|
-
// Reduce shardQueryResults &
|
|
72
|
+
// Reduce shardQueryResults & update working result.
|
|
70
73
|
workingResult = shardQueryResults.reduce(({ items, pageKeyMap }, { indexToken, queryResult, hashKey }) => {
|
|
71
74
|
Object.assign(rehydratedPageKeyMap[indexToken], {
|
|
72
75
|
[hashKey]: queryResult.pageKey,
|
|
@@ -76,12 +79,24 @@ async function query(entityManager, options) {
|
|
|
76
79
|
pageKeyMap,
|
|
77
80
|
};
|
|
78
81
|
}, workingResult);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
// Repeat while pages remain & limit is not reached.
|
|
83
|
+
let pagesRemain = false;
|
|
84
|
+
for (const idx of Object.keys(workingResult.pageKeyMap)) {
|
|
85
|
+
const inner = workingResult.pageKeyMap[idx];
|
|
86
|
+
for (const h of Object.keys(inner)) {
|
|
87
|
+
if (inner[h] !== undefined) {
|
|
88
|
+
pagesRemain = true;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (pagesRemain)
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
if (!pagesRemain)
|
|
96
|
+
break;
|
|
97
|
+
} while (workingResult.items.length < limit);
|
|
83
98
|
// Dedupe & sort working result.
|
|
84
|
-
workingResult.items = sort(unique(workingResult.items, (
|
|
99
|
+
workingResult.items = sort(unique(workingResult.items, (i) => i[entityManager.config.entities[entityToken]
|
|
85
100
|
.uniqueProperty].toString()), sortOrder);
|
|
86
101
|
const result = {
|
|
87
102
|
count: workingResult.items.length,
|
|
@@ -36,7 +36,7 @@ function rehydratePageKeyMap(entityManager, entityToken, indexTokens, item, dehy
|
|
|
36
36
|
// Validate indexTokens populated.
|
|
37
37
|
if (!indexTokens.length)
|
|
38
38
|
throw new Error('indexTokens empty');
|
|
39
|
-
// Validate indexTokens exist.
|
|
39
|
+
// Validate indexTokens exist and capture hashKeys.
|
|
40
40
|
const hashKeys = unique(indexTokens.map((indexToken) => {
|
|
41
41
|
validateIndexToken(entityManager, indexToken);
|
|
42
42
|
return entityManager.config.indexes[indexToken].hashKey;
|
|
@@ -50,7 +50,10 @@ function rehydratePageKeyMap(entityManager, entityToken, indexTokens, item, dehy
|
|
|
50
50
|
});
|
|
51
51
|
// Shortcut empty dehydrated.
|
|
52
52
|
if (dehydrated && !dehydrated.length)
|
|
53
|
-
return [
|
|
53
|
+
return [
|
|
54
|
+
hashKeyToken,
|
|
55
|
+
{},
|
|
56
|
+
];
|
|
54
57
|
// Get hash key space.
|
|
55
58
|
const hashKeySpace = getHashKeySpace(entityManager, entityToken, hashKeyToken, item, timestampFrom, timestampTo);
|
|
56
59
|
// Default dehydrated.
|
|
@@ -66,7 +69,7 @@ function rehydratePageKeyMap(entityManager, entityToken, indexTokens, item, dehy
|
|
|
66
69
|
if (!dehydratedIndexPageKeyMaps[i])
|
|
67
70
|
return;
|
|
68
71
|
let pageKeyItem = {
|
|
69
|
-
...decodeGeneratedProperty(entityManager, hashKey),
|
|
72
|
+
...decodeGeneratedProperty(entityManager, entityToken, hashKey),
|
|
70
73
|
...rehydrateIndexItem(entityManager, entityToken, index, dehydratedIndexPageKeyMaps[i]),
|
|
71
74
|
};
|
|
72
75
|
pageKeyItem = updateItemRangeKey(entityManager, entityToken, pageKeyItem);
|
package/dist/mjs/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { BaseEntityClient } from './BaseEntityClient/BaseEntityClient.js';
|
|
2
2
|
export { BaseQueryBuilder } from './BaseQueryBuilder/BaseQueryBuilder.js';
|
|
3
|
+
export { createEntityManager } from './EntityManager/createEntityManager.js';
|
|
3
4
|
export { EntityManager } from './EntityManager/EntityManager.js';
|
|
4
5
|
export { configSchema } from './EntityManager/ParsedConfig.js';
|
package/package.json
CHANGED
|
@@ -1,135 +1,132 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": "Jason Williscroft",
|
|
3
|
-
"bugs": {
|
|
4
|
-
"url": "https://github.com/karmaniverous/entity-manager/issues"
|
|
5
|
-
},
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@karmaniverous/batch-process": "^0.1.0",
|
|
8
|
-
"@karmaniverous/entity-tools": "^0.
|
|
9
|
-
"@karmaniverous/string-utilities": "^0.2.1",
|
|
10
|
-
"lz-string": "^1.5.0",
|
|
11
|
-
"radash": "^12.1.1",
|
|
12
|
-
"string-hash": "^1.1.3",
|
|
13
|
-
"zod": "^4.1.12"
|
|
14
|
-
},
|
|
15
|
-
"description": "Rational indexing & cross-shard querying at scale in your NoSQL database so you can focus on your application logic.",
|
|
16
|
-
"devDependencies": {
|
|
17
|
-
"@dotenvx/dotenvx": "^1.51.1",
|
|
18
|
-
"@eslint/js": "^9.39.1",
|
|
19
|
-
"@faker-js/faker": "^10.1.0",
|
|
20
|
-
"@karmaniverous/mock-db": "^0.
|
|
21
|
-
"@rollup/plugin-alias": "^6.0.0",
|
|
22
|
-
"@rollup/plugin-commonjs": "^29.0.0",
|
|
23
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
24
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
25
|
-
"@rollup/plugin-strip": "^3.0.4",
|
|
26
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
27
|
-
"@types/node": "^24.10.
|
|
28
|
-
"@types/string-hash": "^1.1.3",
|
|
29
|
-
"auto-changelog": "^2.5.0",
|
|
30
|
-
"cross-env": "^10.1.0",
|
|
31
|
-
"eslint": "^9.39.1",
|
|
32
|
-
"eslint-config-prettier": "^10.1.8",
|
|
33
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
34
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
35
|
-
"eslint-plugin-tsdoc": "^0.
|
|
36
|
-
"knip": "^5.
|
|
37
|
-
"lefthook": "^2.0.
|
|
38
|
-
"prettier": "^3.6.2",
|
|
39
|
-
"release-it": "^19.0.
|
|
40
|
-
"rimraf": "^6.1.0",
|
|
41
|
-
"rollup": "^4.
|
|
42
|
-
"rollup-plugin-dts": "^6.2.3",
|
|
43
|
-
"tsd": "^0.33.0",
|
|
44
|
-
"tslib": "^2.8.1",
|
|
45
|
-
"typedoc": "^0.28.14",
|
|
46
|
-
"typedoc-plugin-mdn-links": "^5.0.10",
|
|
47
|
-
"typedoc-plugin-replace-text": "^4.2.0",
|
|
48
|
-
"typedoc-plugin-zod": "^1.4.3",
|
|
49
|
-
"@vitest/coverage-v8": "^4.0.
|
|
50
|
-
"@vitest/eslint-plugin": "^1.4.
|
|
51
|
-
"vitest": "^4.0.
|
|
52
|
-
"typescript": "^5.9.3",
|
|
53
|
-
"typescript-eslint": "^8.46.
|
|
54
|
-
},
|
|
55
|
-
"exports": {
|
|
56
|
-
".": {
|
|
57
|
-
"import": {
|
|
58
|
-
"types": "./dist/index.d.ts",
|
|
59
|
-
"default": "./dist/mjs/index.js"
|
|
60
|
-
},
|
|
61
|
-
"require": {
|
|
62
|
-
"types": "./dist/index.d.ts",
|
|
63
|
-
"default": "./dist/cjs/index.js"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"files": [
|
|
68
|
-
"dist"
|
|
69
|
-
],
|
|
70
|
-
"homepage": "https://github.com/karmaniverous/entity-manager#readme",
|
|
71
|
-
"keywords": [
|
|
72
|
-
"dynamo-db",
|
|
73
|
-
"sharding"
|
|
74
|
-
],
|
|
75
|
-
"license": "BSD-3-Clause",
|
|
76
|
-
"main": "dist/cjs/index.js",
|
|
77
|
-
"module": "dist/mjs/index.js",
|
|
78
|
-
"name": "@karmaniverous/entity-manager",
|
|
79
|
-
"publishConfig": {
|
|
80
|
-
"access": "public"
|
|
81
|
-
},
|
|
82
|
-
"release-it": {
|
|
83
|
-
"git": {
|
|
84
|
-
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs",
|
|
85
|
-
"commitMessage": "chore: release v${version}",
|
|
86
|
-
"requireBranch": "main"
|
|
87
|
-
},
|
|
88
|
-
"github": {
|
|
89
|
-
"release": true
|
|
90
|
-
},
|
|
91
|
-
"hooks": {
|
|
92
|
-
"after:init": [
|
|
93
|
-
"npm run lint",
|
|
94
|
-
"npm run test",
|
|
95
|
-
"npm run knip",
|
|
96
|
-
"npm run build"
|
|
97
|
-
],
|
|
98
|
-
"before:npm:release": [
|
|
99
|
-
"npx auto-changelog -p",
|
|
100
|
-
"npm run docs",
|
|
101
|
-
"git add -A"
|
|
102
|
-
],
|
|
103
|
-
"after:release": [
|
|
104
|
-
"git switch -c release/${version}",
|
|
105
|
-
"git push -u origin release/${version}",
|
|
106
|
-
"git switch ${branchName}"
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
|
-
"npm": {
|
|
110
|
-
"publish": true
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"repository": {
|
|
114
|
-
"type": "git",
|
|
115
|
-
"url": "git+https://github.com/karmaniverous/entity-manager.git"
|
|
116
|
-
},
|
|
117
|
-
"scripts": {
|
|
118
|
-
"build": "rimraf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
119
|
-
"changelog": "auto-changelog",
|
|
120
|
-
"docs": "typedoc",
|
|
121
|
-
"knip": "knip",
|
|
122
|
-
"lint": "eslint .",
|
|
123
|
-
"lint:fix": "npm run lint -- --fix .",
|
|
124
|
-
"release": "dotenvx run -f .env.local -- release-it",
|
|
125
|
-
"release:pre": "npm run release -- --no-git.requireBranch --github.prerelease --preRelease",
|
|
126
|
-
"test": "vitest --run --silent",
|
|
127
|
-
"typecheck": "tsc && tsd"
|
|
128
|
-
},
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"types": "dist/index.d.ts",
|
|
134
|
-
"version": "6.14.3"
|
|
135
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"author": "Jason Williscroft",
|
|
3
|
+
"bugs": {
|
|
4
|
+
"url": "https://github.com/karmaniverous/entity-manager/issues"
|
|
5
|
+
},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@karmaniverous/batch-process": "^0.1.0",
|
|
8
|
+
"@karmaniverous/entity-tools": "^0.7.1",
|
|
9
|
+
"@karmaniverous/string-utilities": "^0.2.1",
|
|
10
|
+
"lz-string": "^1.5.0",
|
|
11
|
+
"radash": "^12.1.1",
|
|
12
|
+
"string-hash": "^1.1.3",
|
|
13
|
+
"zod": "^4.1.12"
|
|
14
|
+
},
|
|
15
|
+
"description": "Rational indexing & cross-shard querying at scale in your NoSQL database so you can focus on your application logic.",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@dotenvx/dotenvx": "^1.51.1",
|
|
18
|
+
"@eslint/js": "^9.39.1",
|
|
19
|
+
"@faker-js/faker": "^10.1.0",
|
|
20
|
+
"@karmaniverous/mock-db": "^0.4.0",
|
|
21
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
22
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
23
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
24
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
25
|
+
"@rollup/plugin-strip": "^3.0.4",
|
|
26
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
27
|
+
"@types/node": "^24.10.1",
|
|
28
|
+
"@types/string-hash": "^1.1.3",
|
|
29
|
+
"auto-changelog": "^2.5.0",
|
|
30
|
+
"cross-env": "^10.1.0",
|
|
31
|
+
"eslint": "^9.39.1",
|
|
32
|
+
"eslint-config-prettier": "^10.1.8",
|
|
33
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
34
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
35
|
+
"eslint-plugin-tsdoc": "^0.5.0",
|
|
36
|
+
"knip": "^5.69.1",
|
|
37
|
+
"lefthook": "^2.0.4",
|
|
38
|
+
"prettier": "^3.6.2",
|
|
39
|
+
"release-it": "^19.0.6",
|
|
40
|
+
"rimraf": "^6.1.0",
|
|
41
|
+
"rollup": "^4.53.2",
|
|
42
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
43
|
+
"tsd": "^0.33.0",
|
|
44
|
+
"tslib": "^2.8.1",
|
|
45
|
+
"typedoc": "^0.28.14",
|
|
46
|
+
"typedoc-plugin-mdn-links": "^5.0.10",
|
|
47
|
+
"typedoc-plugin-replace-text": "^4.2.0",
|
|
48
|
+
"typedoc-plugin-zod": "^1.4.3",
|
|
49
|
+
"@vitest/coverage-v8": "^4.0.9",
|
|
50
|
+
"@vitest/eslint-plugin": "^1.4.3",
|
|
51
|
+
"vitest": "^4.0.9",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"typescript-eslint": "^8.46.4"
|
|
54
|
+
},
|
|
55
|
+
"exports": {
|
|
56
|
+
".": {
|
|
57
|
+
"import": {
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"default": "./dist/mjs/index.js"
|
|
60
|
+
},
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./dist/index.d.ts",
|
|
63
|
+
"default": "./dist/cjs/index.js"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"files": [
|
|
68
|
+
"dist"
|
|
69
|
+
],
|
|
70
|
+
"homepage": "https://github.com/karmaniverous/entity-manager#readme",
|
|
71
|
+
"keywords": [
|
|
72
|
+
"dynamo-db",
|
|
73
|
+
"sharding"
|
|
74
|
+
],
|
|
75
|
+
"license": "BSD-3-Clause",
|
|
76
|
+
"main": "dist/cjs/index.js",
|
|
77
|
+
"module": "dist/mjs/index.js",
|
|
78
|
+
"name": "@karmaniverous/entity-manager",
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
81
|
+
},
|
|
82
|
+
"release-it": {
|
|
83
|
+
"git": {
|
|
84
|
+
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/main/templates/changelog-compact.hbs",
|
|
85
|
+
"commitMessage": "chore: release v${version}",
|
|
86
|
+
"requireBranch": "main"
|
|
87
|
+
},
|
|
88
|
+
"github": {
|
|
89
|
+
"release": true
|
|
90
|
+
},
|
|
91
|
+
"hooks": {
|
|
92
|
+
"after:init": [
|
|
93
|
+
"npm run lint",
|
|
94
|
+
"npm run test",
|
|
95
|
+
"npm run knip",
|
|
96
|
+
"npm run build"
|
|
97
|
+
],
|
|
98
|
+
"before:npm:release": [
|
|
99
|
+
"npx auto-changelog -p",
|
|
100
|
+
"npm run docs",
|
|
101
|
+
"git add -A"
|
|
102
|
+
],
|
|
103
|
+
"after:release": [
|
|
104
|
+
"git switch -c release/${version}",
|
|
105
|
+
"git push -u origin release/${version}",
|
|
106
|
+
"git switch ${branchName}"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
"npm": {
|
|
110
|
+
"publish": true
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"repository": {
|
|
114
|
+
"type": "git",
|
|
115
|
+
"url": "git+https://github.com/karmaniverous/entity-manager.git"
|
|
116
|
+
},
|
|
117
|
+
"scripts": {
|
|
118
|
+
"build": "rimraf dist && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
119
|
+
"changelog": "auto-changelog",
|
|
120
|
+
"docs": "typedoc",
|
|
121
|
+
"knip": "knip",
|
|
122
|
+
"lint": "eslint .",
|
|
123
|
+
"lint:fix": "npm run lint -- --fix .",
|
|
124
|
+
"release": "dotenvx run -f .env.local -- release-it",
|
|
125
|
+
"release:pre": "npm run release -- --no-git.requireBranch --github.prerelease --preRelease",
|
|
126
|
+
"test": "vitest --run --silent",
|
|
127
|
+
"typecheck": "tsc && tsd"
|
|
128
|
+
},
|
|
129
|
+
"type": "module",
|
|
130
|
+
"types": "dist/index.d.ts",
|
|
131
|
+
"version": "7.0.0"
|
|
132
|
+
}
|