@karmaniverous/entity-manager 6.11.2 → 6.11.4
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/dist/cjs/EntityManager.js +4 -4
- package/dist/cjs/addKeys.js +1 -1
- package/dist/cjs/removeKeys.js +3 -3
- package/dist/index.d.ts +16 -16
- package/dist/mjs/EntityManager.js +4 -4
- package/dist/mjs/addKeys.js +1 -1
- package/dist/mjs/removeKeys.js +3 -3
- package/package.json +1 -1
|
@@ -54,7 +54,7 @@ class EntityManager {
|
|
|
54
54
|
* @param item - {@link EntityItem | `EntityItem`} object.
|
|
55
55
|
* @param overwrite - Overwrite existing properties (default `false`).
|
|
56
56
|
*
|
|
57
|
-
* @returns
|
|
57
|
+
* @returns {@link EntityRecord | `EntityRecord`} object with updated properties.
|
|
58
58
|
*
|
|
59
59
|
* @throws `Error` if `entityToken` is invalid.
|
|
60
60
|
*/
|
|
@@ -79,12 +79,12 @@ class EntityManager {
|
|
|
79
79
|
: addKeys.addKeys(this, entityToken, item, overwrite), [this.config.hashKey, this.config.rangeKey]);
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Strips generated properties, hash key, and range key from an {@link
|
|
82
|
+
* Strips generated properties, hash key, and range key from an {@link EntityRecord | `EntityRecord`} object.
|
|
83
83
|
*
|
|
84
84
|
* @param entityToken - {@link Config | `Config`} `entities` key.
|
|
85
|
-
* @param item - {@link
|
|
85
|
+
* @param item - {@link EntityRecord | `EntityRecord`} object.
|
|
86
86
|
*
|
|
87
|
-
* @returns
|
|
87
|
+
* @returns {@link EntityItem | `EntityItem`} with generated properties, hash key & range key removed.
|
|
88
88
|
*
|
|
89
89
|
* @throws `Error` if `entityToken` is invalid.
|
|
90
90
|
*/
|
package/dist/cjs/addKeys.js
CHANGED
|
@@ -14,7 +14,7 @@ var validateEntityToken = require('./validateEntityToken.js');
|
|
|
14
14
|
* @param item - {@link EntityItem | `EntityItem`} object.
|
|
15
15
|
* @param overwrite - Overwrite existing properties (default `false`).
|
|
16
16
|
*
|
|
17
|
-
* @returns
|
|
17
|
+
* @returns {@link EntityRecord | `EntityRecord`} object with updated properties.
|
|
18
18
|
*
|
|
19
19
|
* @throws `Error` if `entityToken` is invalid.
|
|
20
20
|
*/
|
package/dist/cjs/removeKeys.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var validateEntityToken = require('./validateEntityToken.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Strips generated properties, hash key, and range key from an {@link
|
|
6
|
+
* Strips generated properties, hash key, and range key from an {@link EntityRecord | `EntityRecord`} object.
|
|
7
7
|
*
|
|
8
8
|
* @param entityManager - {@link EntityManager | `EntityManager`} instance.
|
|
9
9
|
* @param entityToken - {@link Config.entities | `entityManager.config.entities`} key.
|
|
10
|
-
* @param item - {@link
|
|
10
|
+
* @param item - {@link EntityRecord | `EntityRecord`} object.
|
|
11
11
|
*
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns {@link EntityItem | `EntityItem`} with generated properties, hash key & range key removed.
|
|
13
13
|
*
|
|
14
14
|
* @throws `Error` if `entityToken` is invalid.
|
|
15
15
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,16 @@ type EntityItem<C extends BaseConfigMap> = Partial<FlattenEntityMap<C['EntityMap
|
|
|
96
96
|
*/
|
|
97
97
|
type EntityKey<C extends BaseConfigMap> = Record<C['HashKey'] | C['RangeKey'], string>;
|
|
98
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Database-facing record type from a {@link BaseConfigMap | `ConfigMap`} with required hash & range keys.
|
|
101
|
+
*
|
|
102
|
+
* @typeParam C - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeMap | `TranscodeMap`}. If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
103
|
+
*
|
|
104
|
+
* @category EntityManager
|
|
105
|
+
* @protected
|
|
106
|
+
*/
|
|
107
|
+
type EntityRecord<C extends BaseConfigMap> = EntityItem<C> & EntityKey<C>;
|
|
108
|
+
|
|
99
109
|
/**
|
|
100
110
|
* Extracts entity tokens from a {@link ConfigMap | `ConfigMap`}.
|
|
101
111
|
*
|
|
@@ -538,11 +548,11 @@ declare class EntityManager<C extends BaseConfigMap> {
|
|
|
538
548
|
* @param item - {@link EntityItem | `EntityItem`} object.
|
|
539
549
|
* @param overwrite - Overwrite existing properties (default `false`).
|
|
540
550
|
*
|
|
541
|
-
* @returns
|
|
551
|
+
* @returns {@link EntityRecord | `EntityRecord`} object with updated properties.
|
|
542
552
|
*
|
|
543
553
|
* @throws `Error` if `entityToken` is invalid.
|
|
544
554
|
*/
|
|
545
|
-
addKeys(entityToken: EntityToken<C>, item: EntityItem<C>, overwrite?: boolean):
|
|
555
|
+
addKeys(entityToken: EntityToken<C>, item: EntityItem<C>, overwrite?: boolean): EntityRecord<C>;
|
|
546
556
|
/**
|
|
547
557
|
* Convert an {@link EntityItem | `EntityItem`} into an {@link EntityKey | `EntityKey`}.
|
|
548
558
|
*
|
|
@@ -556,16 +566,16 @@ declare class EntityManager<C extends BaseConfigMap> {
|
|
|
556
566
|
*/
|
|
557
567
|
getPrimaryKey(entityToken: EntityToken<C>, item: EntityItem<C>, overwrite?: boolean): EntityKey<C>;
|
|
558
568
|
/**
|
|
559
|
-
* Strips generated properties, hash key, and range key from an {@link
|
|
569
|
+
* Strips generated properties, hash key, and range key from an {@link EntityRecord | `EntityRecord`} object.
|
|
560
570
|
*
|
|
561
571
|
* @param entityToken - {@link Config | `Config`} `entities` key.
|
|
562
|
-
* @param item - {@link
|
|
572
|
+
* @param item - {@link EntityRecord | `EntityRecord`} object.
|
|
563
573
|
*
|
|
564
|
-
* @returns
|
|
574
|
+
* @returns {@link EntityItem | `EntityItem`} with generated properties, hash key & range key removed.
|
|
565
575
|
*
|
|
566
576
|
* @throws `Error` if `entityToken` is invalid.
|
|
567
577
|
*/
|
|
568
|
-
removeKeys(entityToken: EntityToken<C>, item:
|
|
578
|
+
removeKeys(entityToken: EntityToken<C>, item: EntityRecord<C>): EntityItem<C>;
|
|
569
579
|
/**
|
|
570
580
|
* Query a database entity across shards in a provider-generic fashion.
|
|
571
581
|
*
|
|
@@ -736,14 +746,4 @@ type ConfigMap<M extends Partial<BaseConfigMap> = Partial<BaseConfigMap>> = Vali
|
|
|
736
746
|
TranscodeMap: 'TranscodeMap' extends keyof M ? NonNullable<M['TranscodeMap']> : DefaultTranscodeMap;
|
|
737
747
|
}>;
|
|
738
748
|
|
|
739
|
-
/**
|
|
740
|
-
* Database-facing record type from a {@link BaseConfigMap | `ConfigMap`} with required hash & range keys.
|
|
741
|
-
*
|
|
742
|
-
* @typeParam C - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeMap | `TranscodeMap`}. If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
743
|
-
*
|
|
744
|
-
* @category EntityManager
|
|
745
|
-
* @protected
|
|
746
|
-
*/
|
|
747
|
-
type EntityRecord<C extends BaseConfigMap> = EntityItem<C> & EntityKey<C>;
|
|
748
|
-
|
|
749
749
|
export { type BaseConfigMap, BaseEntityClient, type BaseEntityClientOptions, BaseQueryBuilder, type BaseQueryBuilderOptions, type Config, type ConfigMap, type EntityItem, type EntityKey, EntityManager, type EntityRecord, type EntityToken, type PageKey, type ParsedConfig, type QueryBuilderQueryOptions, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryMap, type ShardQueryResult, type ValidateConfigMap };
|
|
@@ -52,7 +52,7 @@ class EntityManager {
|
|
|
52
52
|
* @param item - {@link EntityItem | `EntityItem`} object.
|
|
53
53
|
* @param overwrite - Overwrite existing properties (default `false`).
|
|
54
54
|
*
|
|
55
|
-
* @returns
|
|
55
|
+
* @returns {@link EntityRecord | `EntityRecord`} object with updated properties.
|
|
56
56
|
*
|
|
57
57
|
* @throws `Error` if `entityToken` is invalid.
|
|
58
58
|
*/
|
|
@@ -77,12 +77,12 @@ class EntityManager {
|
|
|
77
77
|
: addKeys(this, entityToken, item, overwrite), [this.config.hashKey, this.config.rangeKey]);
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* Strips generated properties, hash key, and range key from an {@link
|
|
80
|
+
* Strips generated properties, hash key, and range key from an {@link EntityRecord | `EntityRecord`} object.
|
|
81
81
|
*
|
|
82
82
|
* @param entityToken - {@link Config | `Config`} `entities` key.
|
|
83
|
-
* @param item - {@link
|
|
83
|
+
* @param item - {@link EntityRecord | `EntityRecord`} object.
|
|
84
84
|
*
|
|
85
|
-
* @returns
|
|
85
|
+
* @returns {@link EntityItem | `EntityItem`} with generated properties, hash key & range key removed.
|
|
86
86
|
*
|
|
87
87
|
* @throws `Error` if `entityToken` is invalid.
|
|
88
88
|
*/
|
package/dist/mjs/addKeys.js
CHANGED
|
@@ -12,7 +12,7 @@ import { validateEntityToken } from './validateEntityToken.js';
|
|
|
12
12
|
* @param item - {@link EntityItem | `EntityItem`} object.
|
|
13
13
|
* @param overwrite - Overwrite existing properties (default `false`).
|
|
14
14
|
*
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns {@link EntityRecord | `EntityRecord`} object with updated properties.
|
|
16
16
|
*
|
|
17
17
|
* @throws `Error` if `entityToken` is invalid.
|
|
18
18
|
*/
|
package/dist/mjs/removeKeys.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { validateEntityToken } from './validateEntityToken.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Strips generated properties, hash key, and range key from an {@link
|
|
4
|
+
* Strips generated properties, hash key, and range key from an {@link EntityRecord | `EntityRecord`} object.
|
|
5
5
|
*
|
|
6
6
|
* @param entityManager - {@link EntityManager | `EntityManager`} instance.
|
|
7
7
|
* @param entityToken - {@link Config.entities | `entityManager.config.entities`} key.
|
|
8
|
-
* @param item - {@link
|
|
8
|
+
* @param item - {@link EntityRecord | `EntityRecord`} object.
|
|
9
9
|
*
|
|
10
|
-
* @returns
|
|
10
|
+
* @returns {@link EntityItem | `EntityItem`} with generated properties, hash key & range key removed.
|
|
11
11
|
*
|
|
12
12
|
* @throws `Error` if `entityToken` is invalid.
|
|
13
13
|
*/
|
package/package.json
CHANGED