@karmaniverous/entity-manager 6.1.0-0 → 6.1.0-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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  var tslib_es6 = require('../node_modules/tslib/tslib.es6.js');
4
4
  var conditionalize = require('./conditionalize.js');
5
+ var typed = require('../node_modules/radash/dist/esm/typed.js');
5
6
 
6
7
  var _EntityManagerClient_options;
7
8
  /**
@@ -10,10 +11,13 @@ var _EntityManagerClient_options;
10
11
  * @category Client
11
12
  */
12
13
  class EntityManagerClient {
13
- constructor({ batchSize = 25, delayIncrement = 100, maxRetries = 5, throttle = 10, logger = console, logInternals = false, ...options }) {
14
+ constructor({ batchSize = 25, delayIncrement = 100, maxRetries = 5, throttle = 10, logger = console, logInternals = false, ...childOptions }) {
14
15
  _EntityManagerClient_options.set(this, void 0);
16
+ if (!typed.isFunction(logger.debug))
17
+ throw new Error('logger must support debug method');
18
+ if (!typed.isFunction(logger.error))
19
+ throw new Error('logger must support error method');
15
20
  tslib_es6.__classPrivateFieldSet(this, _EntityManagerClient_options, {
16
- ...options,
17
21
  batchSize,
18
22
  delayIncrement,
19
23
  maxRetries,
@@ -23,6 +27,7 @@ class EntityManagerClient {
23
27
  ...logger,
24
28
  debug: conditionalize.conditionalize(logger.debug, logInternals),
25
29
  },
30
+ ...childOptions,
26
31
  }, "f");
27
32
  }
28
33
  /**
package/dist/index.d.cts CHANGED
@@ -890,11 +890,21 @@ type EntityManagerClientOptions = EntityManagerClientBatchOptions & LoggerOption
890
890
  */
891
891
  declare abstract class EntityManagerClient<O extends EntityManagerClientOptions> {
892
892
  #private;
893
- constructor({ batchSize, delayIncrement, maxRetries, throttle, logger, logInternals, ...options }: O);
893
+ constructor({ batchSize, delayIncrement, maxRetries, throttle, logger, logInternals, ...childOptions }: O);
894
894
  /**
895
895
  * Returns the options used to create the EntityManagerClient instance.
896
896
  */
897
897
  get options(): Required<O>;
898
898
  }
899
899
 
900
- export { type Config, type ConfigEntities, type ConfigEntity, type ConfigEntityGenerated, type ConfigKeys, type ConfigTranscodes, EntityManager, EntityManagerClient, type EntityManagerClientBatchOptions, type EntityManagerClientOptions, type EntityMap, type ExclusiveKey, type ItemMap, type Logger, type LoggerEndpoint, type LoggerOptions, type ParsedConfig, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryResult, type Unwrap, conditionalize };
900
+ /**
901
+ * Returns an object type with specific properties rendered required and non-nullable.
902
+ *
903
+ * @typeParam T - The object type to modify.
904
+ * @typeParam K - Union of keys of `T` to render required and non-nullable.
905
+ */
906
+ type WithRequiredAndNonNullable<T, K extends keyof T> = T & {
907
+ [P in K]-?: NonNullable<T[P]>;
908
+ };
909
+
910
+ export { type Config, type ConfigEntities, type ConfigEntity, type ConfigEntityGenerated, type ConfigKeys, type ConfigTranscodes, EntityManager, EntityManagerClient, type EntityManagerClientBatchOptions, type EntityManagerClientOptions, type EntityMap, type ExclusiveKey, type ItemMap, type Logger, type LoggerEndpoint, type LoggerOptions, type ParsedConfig, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryResult, type Unwrap, type WithRequiredAndNonNullable, conditionalize };
package/dist/index.d.mts CHANGED
@@ -890,11 +890,21 @@ type EntityManagerClientOptions = EntityManagerClientBatchOptions & LoggerOption
890
890
  */
891
891
  declare abstract class EntityManagerClient<O extends EntityManagerClientOptions> {
892
892
  #private;
893
- constructor({ batchSize, delayIncrement, maxRetries, throttle, logger, logInternals, ...options }: O);
893
+ constructor({ batchSize, delayIncrement, maxRetries, throttle, logger, logInternals, ...childOptions }: O);
894
894
  /**
895
895
  * Returns the options used to create the EntityManagerClient instance.
896
896
  */
897
897
  get options(): Required<O>;
898
898
  }
899
899
 
900
- export { type Config, type ConfigEntities, type ConfigEntity, type ConfigEntityGenerated, type ConfigKeys, type ConfigTranscodes, EntityManager, EntityManagerClient, type EntityManagerClientBatchOptions, type EntityManagerClientOptions, type EntityMap, type ExclusiveKey, type ItemMap, type Logger, type LoggerEndpoint, type LoggerOptions, type ParsedConfig, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryResult, type Unwrap, conditionalize };
900
+ /**
901
+ * Returns an object type with specific properties rendered required and non-nullable.
902
+ *
903
+ * @typeParam T - The object type to modify.
904
+ * @typeParam K - Union of keys of `T` to render required and non-nullable.
905
+ */
906
+ type WithRequiredAndNonNullable<T, K extends keyof T> = T & {
907
+ [P in K]-?: NonNullable<T[P]>;
908
+ };
909
+
910
+ export { type Config, type ConfigEntities, type ConfigEntity, type ConfigEntityGenerated, type ConfigKeys, type ConfigTranscodes, EntityManager, EntityManagerClient, type EntityManagerClientBatchOptions, type EntityManagerClientOptions, type EntityMap, type ExclusiveKey, type ItemMap, type Logger, type LoggerEndpoint, type LoggerOptions, type ParsedConfig, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryResult, type Unwrap, type WithRequiredAndNonNullable, conditionalize };
package/dist/index.d.ts CHANGED
@@ -890,11 +890,21 @@ type EntityManagerClientOptions = EntityManagerClientBatchOptions & LoggerOption
890
890
  */
891
891
  declare abstract class EntityManagerClient<O extends EntityManagerClientOptions> {
892
892
  #private;
893
- constructor({ batchSize, delayIncrement, maxRetries, throttle, logger, logInternals, ...options }: O);
893
+ constructor({ batchSize, delayIncrement, maxRetries, throttle, logger, logInternals, ...childOptions }: O);
894
894
  /**
895
895
  * Returns the options used to create the EntityManagerClient instance.
896
896
  */
897
897
  get options(): Required<O>;
898
898
  }
899
899
 
900
- export { type Config, type ConfigEntities, type ConfigEntity, type ConfigEntityGenerated, type ConfigKeys, type ConfigTranscodes, EntityManager, EntityManagerClient, type EntityManagerClientBatchOptions, type EntityManagerClientOptions, type EntityMap, type ExclusiveKey, type ItemMap, type Logger, type LoggerEndpoint, type LoggerOptions, type ParsedConfig, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryResult, type Unwrap, conditionalize };
900
+ /**
901
+ * Returns an object type with specific properties rendered required and non-nullable.
902
+ *
903
+ * @typeParam T - The object type to modify.
904
+ * @typeParam K - Union of keys of `T` to render required and non-nullable.
905
+ */
906
+ type WithRequiredAndNonNullable<T, K extends keyof T> = T & {
907
+ [P in K]-?: NonNullable<T[P]>;
908
+ };
909
+
910
+ export { type Config, type ConfigEntities, type ConfigEntity, type ConfigEntityGenerated, type ConfigKeys, type ConfigTranscodes, EntityManager, EntityManagerClient, type EntityManagerClientBatchOptions, type EntityManagerClientOptions, type EntityMap, type ExclusiveKey, type ItemMap, type Logger, type LoggerEndpoint, type LoggerOptions, type ParsedConfig, type QueryOptions, type QueryResult, type ShardBump, type ShardQueryFunction, type ShardQueryResult, type Unwrap, type WithRequiredAndNonNullable, conditionalize };
@@ -1,5 +1,6 @@
1
1
  import { __classPrivateFieldSet, __classPrivateFieldGet } from '../node_modules/tslib/tslib.es6.js';
2
2
  import { conditionalize } from './conditionalize.js';
3
+ import { isFunction } from '../node_modules/radash/dist/esm/typed.js';
3
4
 
4
5
  var _EntityManagerClient_options;
5
6
  /**
@@ -8,10 +9,13 @@ var _EntityManagerClient_options;
8
9
  * @category Client
9
10
  */
10
11
  class EntityManagerClient {
11
- constructor({ batchSize = 25, delayIncrement = 100, maxRetries = 5, throttle = 10, logger = console, logInternals = false, ...options }) {
12
+ constructor({ batchSize = 25, delayIncrement = 100, maxRetries = 5, throttle = 10, logger = console, logInternals = false, ...childOptions }) {
12
13
  _EntityManagerClient_options.set(this, void 0);
14
+ if (!isFunction(logger.debug))
15
+ throw new Error('logger must support debug method');
16
+ if (!isFunction(logger.error))
17
+ throw new Error('logger must support error method');
13
18
  __classPrivateFieldSet(this, _EntityManagerClient_options, {
14
- ...options,
15
19
  batchSize,
16
20
  delayIncrement,
17
21
  maxRetries,
@@ -21,6 +25,7 @@ class EntityManagerClient {
21
25
  ...logger,
22
26
  debug: conditionalize(logger.debug, logInternals),
23
27
  },
28
+ ...childOptions,
24
29
  }, "f");
25
30
  }
26
31
  /**
package/package.json CHANGED
@@ -132,5 +132,5 @@
132
132
  },
133
133
  "type": "module",
134
134
  "types": "dist/index.d.ts",
135
- "version": "6.1.0-0"
135
+ "version": "6.1.0-2"
136
136
  }