@karmaniverous/entity-manager 7.3.1 → 7.3.2
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.
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Base EntityClient class. Integrates {@link EntityManager | `EntityManager`} with injected logging & enhanced batch processing.
|
|
5
5
|
*
|
|
6
|
-
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s
|
|
6
|
+
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s
|
|
7
|
+
* {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeRegistry | `TranscodeRegistry`}.
|
|
8
|
+
* If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
9
|
+
* @typeParam CF - Values-first config literal type captured by the manager (phantom; type-only). Propagated so
|
|
10
|
+
* client-facing calls that return `IndexTokensOf<CF>` retain the narrowed union.
|
|
7
11
|
*
|
|
8
12
|
* @category EntityClient
|
|
9
13
|
*/
|
|
10
14
|
class BaseEntityClient {
|
|
11
15
|
/**
|
|
12
|
-
*
|
|
16
|
+
* Base EntityClient constructor.
|
|
13
17
|
*
|
|
14
18
|
* @param options - {@link BaseEntityClientOptions | `BaseEntityClientOptions`} object.
|
|
15
19
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -741,11 +741,11 @@ type EntityRecord<CC extends BaseConfigMap> = EntityItem<CC> & EntityKey<CC>;
|
|
|
741
741
|
*
|
|
742
742
|
* @category EntityClient
|
|
743
743
|
*/
|
|
744
|
-
interface BaseEntityClientOptions<CC extends BaseConfigMap> {
|
|
744
|
+
interface BaseEntityClientOptions<CC extends BaseConfigMap, CF = unknown> {
|
|
745
745
|
/** Default batch process options. */
|
|
746
746
|
batchProcessOptions?: Omit<BatchProcessOptions<unknown, unknown>, 'batchHandler' | 'unprocessedItemExtractor'>;
|
|
747
747
|
/** {@link EntityManager | `EntityManager`} instance. */
|
|
748
|
-
entityManager: EntityManager<CC>;
|
|
748
|
+
entityManager: EntityManager<CC, CF>;
|
|
749
749
|
/** Injected logger object. Must support `debug` and `error` methods. Default: `console` */
|
|
750
750
|
logger?: Pick<Console, 'debug' | 'error'>;
|
|
751
751
|
}
|
|
@@ -753,23 +753,27 @@ interface BaseEntityClientOptions<CC extends BaseConfigMap> {
|
|
|
753
753
|
/**
|
|
754
754
|
* Base EntityClient class. Integrates {@link EntityManager | `EntityManager`} with injected logging & enhanced batch processing.
|
|
755
755
|
*
|
|
756
|
-
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s
|
|
756
|
+
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s
|
|
757
|
+
* {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeRegistry | `TranscodeRegistry`}.
|
|
758
|
+
* If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
759
|
+
* @typeParam CF - Values-first config literal type captured by the manager (phantom; type-only). Propagated so
|
|
760
|
+
* client-facing calls that return `IndexTokensOf<CF>` retain the narrowed union.
|
|
757
761
|
*
|
|
758
762
|
* @category EntityClient
|
|
759
763
|
*/
|
|
760
|
-
declare abstract class BaseEntityClient<CC extends BaseConfigMap> {
|
|
764
|
+
declare abstract class BaseEntityClient<CC extends BaseConfigMap, CF = unknown> {
|
|
761
765
|
/** Default batch process options. */
|
|
762
|
-
readonly batchProcessOptions: NonNullable<BaseEntityClientOptions<CC>['batchProcessOptions']>;
|
|
766
|
+
readonly batchProcessOptions: NonNullable<BaseEntityClientOptions<CC, CF>['batchProcessOptions']>;
|
|
763
767
|
/** {@link EntityManager | `EntityManager`} instance. */
|
|
764
|
-
readonly entityManager: EntityManager<CC>;
|
|
768
|
+
readonly entityManager: EntityManager<CC, CF>;
|
|
765
769
|
/** Injected logger object. Must support `debug` and `error` methods. Default: `console` */
|
|
766
|
-
readonly logger: NonNullable<BaseEntityClientOptions<CC>['logger']>;
|
|
770
|
+
readonly logger: NonNullable<BaseEntityClientOptions<CC, CF>['logger']>;
|
|
767
771
|
/**
|
|
768
|
-
*
|
|
772
|
+
* Base EntityClient constructor.
|
|
769
773
|
*
|
|
770
774
|
* @param options - {@link BaseEntityClientOptions | `BaseEntityClientOptions`} object.
|
|
771
775
|
*/
|
|
772
|
-
constructor(options: BaseEntityClientOptions<CC>);
|
|
776
|
+
constructor(options: BaseEntityClientOptions<CC, CF>);
|
|
773
777
|
}
|
|
774
778
|
|
|
775
779
|
type ConfigOfClient<EC> = EC extends BaseEntityClient<infer CC> ? CC : never;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base EntityClient class. Integrates {@link EntityManager | `EntityManager`} with injected logging & enhanced batch processing.
|
|
3
3
|
*
|
|
4
|
-
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s
|
|
4
|
+
* @typeParam CC - {@link ConfigMap | `ConfigMap`} that defines an {@link Config | `EntityManager configuration`}'s
|
|
5
|
+
* {@link EntityMap | `EntityMap`}, key properties, and {@link TranscodeRegistry | `TranscodeRegistry`}.
|
|
6
|
+
* If omitted, defaults to {@link BaseConfigMap | `BaseConfigMap`}.
|
|
7
|
+
* @typeParam CF - Values-first config literal type captured by the manager (phantom; type-only). Propagated so
|
|
8
|
+
* client-facing calls that return `IndexTokensOf<CF>` retain the narrowed union.
|
|
5
9
|
*
|
|
6
10
|
* @category EntityClient
|
|
7
11
|
*/
|
|
8
12
|
class BaseEntityClient {
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
14
|
+
* Base EntityClient constructor.
|
|
11
15
|
*
|
|
12
16
|
* @param options - {@link BaseEntityClientOptions | `BaseEntityClientOptions`} object.
|
|
13
17
|
*/
|
package/package.json
CHANGED