@karmaniverous/entity-manager 6.13.1 → 6.13.3

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.
@@ -53,7 +53,7 @@ class EntityManager {
53
53
  * Encode a generated property value. Returns a string or undefined if atomicity requirement of sharded properties not met.
54
54
  *
55
55
  * @param property - {@link Config.generatedProperties | Generated property} key.
56
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
56
+ * @param item - {@link EntityItem | `EntityItem`} object.
57
57
  *
58
58
  * @returns Encoded generated property value.
59
59
  *
@@ -103,7 +103,10 @@ const configSchema = zod.z
103
103
  .record(zod.z.object({
104
104
  hashKey: zod.z.string().min(1),
105
105
  rangeKey: zod.z.string().min(1),
106
- projections: componentArray.optional(),
106
+ projections: zod.z
107
+ .array(zod.z.string().min(1))
108
+ .superRefine(validateArrayUnique)
109
+ .optional(),
107
110
  }))
108
111
  .optional()
109
112
  .default({}),
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
11
11
  * @param element - The {@link Entity | `Entity`} generated property element or ungenerated index component to encode.
12
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
12
+ * @param item - {@link EntityItem | `EntityItem`} object.
13
13
  *
14
14
  * @returns Encoded value.
15
15
  *
@@ -8,7 +8,7 @@ var validateGeneratedProperty = require('./validateGeneratedProperty.js');
8
8
  *
9
9
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
10
10
  * @param property - {@link Config.generatedProperties | Generated property} key.
11
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
11
+ * @param item - {@link EntityItem | `EntityItem`} object.
12
12
  *
13
13
  * @returns Encoded generated property value.
14
14
  *
@@ -6,11 +6,11 @@ var getShardBump = require('./getShardBump.js');
6
6
  var validateEntityToken = require('./validateEntityToken.js');
7
7
 
8
8
  /**
9
- * Update the hash key on a partial {@link ItemMap | `ItemMap`} object.
9
+ * Update the hash key on an partial {@link EntityItem | `EntityItem`} object.
10
10
  *
11
11
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
12
12
  * @param entityToken - {@link Config.entities | `this.config.entities`} key.
13
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
13
+ * @param item - {@link EntityItem | `EntityItem`} object.
14
14
  * @param overwrite - Overwrite existing {@link ConfigKeys.hashKey | `this.config.hashKey`} property value (default `false`).
15
15
  *
16
16
  * @returns Shallow clone of `item` with updated hash key.
@@ -4,11 +4,11 @@ var entityTools = require('@karmaniverous/entity-tools');
4
4
  var validateEntityToken = require('./validateEntityToken.js');
5
5
 
6
6
  /**
7
- * Update the range key on a partial {@link ItemMap | `ItemMap`} object.
7
+ * Update the range key on an {@link EntityItem | `EntityItem`} object.
8
8
  *
9
9
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
10
10
  * @param entityToken - {@link Config.entities | `this.config.entities`} key.
11
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
11
+ * @param item - {@link EntityItem | `EntityItem`} object.
12
12
  * @param overwrite - Overwrite existing {@link ConfigKeys.rangeKey | `this.config.rangeKey`} property value (default `false`).
13
13
  *
14
14
  * @returns Shallow clone of `item` with updated range key.
package/dist/index.d.ts CHANGED
@@ -194,15 +194,15 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
194
194
  indexes: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
195
195
  hashKey: z.ZodString;
196
196
  rangeKey: z.ZodString;
197
- projections: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "atleastone">, [string, ...string[]], [string, ...string[]]>>;
197
+ projections: z.ZodOptional<z.ZodEffects<z.ZodArray<z.ZodString, "many">, string[], string[]>>;
198
198
  }, "strip", z.ZodTypeAny, {
199
199
  hashKey: string;
200
200
  rangeKey: string;
201
- projections?: [string, ...string[]] | undefined;
201
+ projections?: string[] | undefined;
202
202
  }, {
203
203
  hashKey: string;
204
204
  rangeKey: string;
205
- projections?: [string, ...string[]] | undefined;
205
+ projections?: string[] | undefined;
206
206
  }>>>>;
207
207
  generatedKeyDelimiter: z.ZodDefault<z.ZodOptional<z.ZodString>>;
208
208
  generatedValueDelimiter: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -241,7 +241,7 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
241
241
  indexes: Record<string, {
242
242
  hashKey: string;
243
243
  rangeKey: string;
244
- projections?: [string, ...string[]] | undefined;
244
+ projections?: string[] | undefined;
245
245
  }>;
246
246
  generatedKeyDelimiter: string;
247
247
  generatedValueDelimiter: string;
@@ -273,7 +273,7 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
273
273
  indexes?: Record<string, {
274
274
  hashKey: string;
275
275
  rangeKey: string;
276
- projections?: [string, ...string[]] | undefined;
276
+ projections?: string[] | undefined;
277
277
  }> | undefined;
278
278
  generatedKeyDelimiter?: string | undefined;
279
279
  generatedValueDelimiter?: string | undefined;
@@ -305,7 +305,7 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
305
305
  indexes: Record<string, {
306
306
  hashKey: string;
307
307
  rangeKey: string;
308
- projections?: [string, ...string[]] | undefined;
308
+ projections?: string[] | undefined;
309
309
  }>;
310
310
  generatedKeyDelimiter: string;
311
311
  generatedValueDelimiter: string;
@@ -337,7 +337,7 @@ declare const configSchema: z.ZodEffects<z.ZodObject<{
337
337
  indexes?: Record<string, {
338
338
  hashKey: string;
339
339
  rangeKey: string;
340
- projections?: [string, ...string[]] | undefined;
340
+ projections?: string[] | undefined;
341
341
  }> | undefined;
342
342
  generatedKeyDelimiter?: string | undefined;
343
343
  generatedValueDelimiter?: string | undefined;
@@ -545,7 +545,7 @@ declare class EntityManager<C extends BaseConfigMap> {
545
545
  * Encode a generated property value. Returns a string or undefined if atomicity requirement of sharded properties not met.
546
546
  *
547
547
  * @param property - {@link Config.generatedProperties | Generated property} key.
548
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
548
+ * @param item - {@link EntityItem | `EntityItem`} object.
549
549
  *
550
550
  * @returns Encoded generated property value.
551
551
  *
@@ -51,7 +51,7 @@ class EntityManager {
51
51
  * Encode a generated property value. Returns a string or undefined if atomicity requirement of sharded properties not met.
52
52
  *
53
53
  * @param property - {@link Config.generatedProperties | Generated property} key.
54
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
54
+ * @param item - {@link EntityItem | `EntityItem`} object.
55
55
  *
56
56
  * @returns Encoded generated property value.
57
57
  *
@@ -101,7 +101,10 @@ const configSchema = z
101
101
  .record(z.object({
102
102
  hashKey: z.string().min(1),
103
103
  rangeKey: z.string().min(1),
104
- projections: componentArray.optional(),
104
+ projections: z
105
+ .array(z.string().min(1))
106
+ .superRefine(validateArrayUnique)
107
+ .optional(),
105
108
  }))
106
109
  .optional()
107
110
  .default({}),
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
9
9
  * @param element - The {@link Entity | `Entity`} generated property element or ungenerated index component to encode.
10
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
10
+ * @param item - {@link EntityItem | `EntityItem`} object.
11
11
  *
12
12
  * @returns Encoded value.
13
13
  *
@@ -6,7 +6,7 @@ import { validateGeneratedProperty } from './validateGeneratedProperty.js';
6
6
  *
7
7
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
8
8
  * @param property - {@link Config.generatedProperties | Generated property} key.
9
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
9
+ * @param item - {@link EntityItem | `EntityItem`} object.
10
10
  *
11
11
  * @returns Encoded generated property value.
12
12
  *
@@ -4,11 +4,11 @@ import { getShardBump } from './getShardBump.js';
4
4
  import { validateEntityToken } from './validateEntityToken.js';
5
5
 
6
6
  /**
7
- * Update the hash key on a partial {@link ItemMap | `ItemMap`} object.
7
+ * Update the hash key on an partial {@link EntityItem | `EntityItem`} object.
8
8
  *
9
9
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
10
10
  * @param entityToken - {@link Config.entities | `this.config.entities`} key.
11
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
11
+ * @param item - {@link EntityItem | `EntityItem`} object.
12
12
  * @param overwrite - Overwrite existing {@link ConfigKeys.hashKey | `this.config.hashKey`} property value (default `false`).
13
13
  *
14
14
  * @returns Shallow clone of `item` with updated hash key.
@@ -2,11 +2,11 @@ import { isNil } from '@karmaniverous/entity-tools';
2
2
  import { validateEntityToken } from './validateEntityToken.js';
3
3
 
4
4
  /**
5
- * Update the range key on a partial {@link ItemMap | `ItemMap`} object.
5
+ * Update the range key on an {@link EntityItem | `EntityItem`} object.
6
6
  *
7
7
  * @param entityManager - {@link EntityManager | `EntityManager`} instance.
8
8
  * @param entityToken - {@link Config.entities | `this.config.entities`} key.
9
- * @param item - Partial {@link ItemMap | `ItemMap`} object.
9
+ * @param item - {@link EntityItem | `EntityItem`} object.
10
10
  * @param overwrite - Overwrite existing {@link ConfigKeys.rangeKey | `this.config.rangeKey`} property value (default `false`).
11
11
  *
12
12
  * @returns Shallow clone of `item` with updated range key.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@karmaniverous/batch-process": "^0.1.0",
8
- "@karmaniverous/entity-tools": "^0.6.5",
8
+ "@karmaniverous/entity-tools": "^0.6.6",
9
9
  "@karmaniverous/string-utilities": "^0.2.1",
10
10
  "lz-string": "^1.5.0",
11
11
  "radash": "^12.1.0",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "description": "Rational indexing & cross-shard querying at scale in your NoSQL database so you can focus on your application logic.",
16
16
  "devDependencies": {
17
- "@dotenvx/dotenvx": "^1.22.1",
17
+ "@dotenvx/dotenvx": "^1.23.0",
18
18
  "@eslint/js": "^9.14.0",
19
19
  "@faker-js/faker": "^9.2.0",
20
20
  "@karmaniverous/mock-db": "^0.3.4",
@@ -39,14 +39,14 @@
39
39
  "eslint-plugin-simple-import-sort": "^12.1.1",
40
40
  "eslint-plugin-tsdoc": "^0.3.0",
41
41
  "jsdom-global": "^3.0.2",
42
- "knip": "^5.36.7",
42
+ "knip": "^5.37.0",
43
43
  "lefthook": "^1.8.2",
44
44
  "mocha": "^10.8.2",
45
45
  "nyc": "^17.1.0",
46
46
  "prettier": "^3.3.3",
47
47
  "release-it": "^17.10.0",
48
48
  "rimraf": "^6.0.1",
49
- "rollup": "^4.25.0",
49
+ "rollup": "^4.26.0",
50
50
  "rollup-plugin-dts": "^6.1.1",
51
51
  "source-map-support": "^0.5.21",
52
52
  "ts-node": "^10.9.2",
@@ -132,5 +132,5 @@
132
132
  },
133
133
  "type": "module",
134
134
  "types": "dist/index.d.ts",
135
- "version": "6.13.1"
135
+ "version": "6.13.3"
136
136
  }