@karmaniverous/entity-manager
Advanced tools
Comparing version 6.10.2 to 6.10.3
@@ -16,6 +16,6 @@ 'use strict'; | ||
*/ | ||
constructor(entityManager, options = {}) { | ||
constructor(options) { | ||
const { batchProcessOptions = {}, entityManager, logger = console, } = options; | ||
this.batchProcessOptions = batchProcessOptions; | ||
this.entityManager = entityManager; | ||
const { batchProcessOptions = {}, logger = console } = options; | ||
this.batchProcessOptions = batchProcessOptions; | ||
this.logger = logger; | ||
@@ -22,0 +22,0 @@ } |
@@ -21,16 +21,2 @@ import { EntityMap, TranscodeMap, ConditionalProperty, Exactify, PropertiesOfType, TranscodableProperties, FlattenEntityMap, Transcodes, SortOrder, MutuallyExclusive, NotNever, DefaultTranscodeMap } from '@karmaniverous/entity-tools'; | ||
/** | ||
* Base EntityClient options. | ||
* | ||
* @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`}. | ||
* | ||
* @category EntityClient | ||
*/ | ||
interface BaseEntityClientOptions { | ||
/** Default batch process options. */ | ||
batchProcessOptions?: Omit<BatchProcessOptions<unknown, unknown>, 'batchHandler' | 'unprocessedItemExtractor'>; | ||
/** Injected logger object. Must support `debug` and `error` methods. Default: `console` */ | ||
logger?: Pick<Console, 'debug' | 'error'>; | ||
} | ||
/** | ||
* Defines a single time period in an entity sharding strategy. | ||
@@ -221,3 +207,2 @@ * | ||
rangeKey: string; | ||
throttle: number; | ||
entities: Record<string, { | ||
@@ -247,2 +232,3 @@ defaultLimit: number; | ||
shardKeyDelimiter: string; | ||
throttle: number; | ||
transcodes: Record<string, { | ||
@@ -255,3 +241,2 @@ encode: (args_0: any, ...args: unknown[]) => string; | ||
rangeKey: string; | ||
throttle?: number | undefined; | ||
entities?: Record<string, { | ||
@@ -281,2 +266,3 @@ timestampProperty: string; | ||
shardKeyDelimiter?: string | undefined; | ||
throttle?: number | undefined; | ||
transcodes?: Record<string, { | ||
@@ -289,3 +275,2 @@ encode: (args_0: any, ...args: unknown[]) => string; | ||
rangeKey: string; | ||
throttle: number; | ||
entities: Record<string, { | ||
@@ -315,2 +300,3 @@ defaultLimit: number; | ||
shardKeyDelimiter: string; | ||
throttle: number; | ||
transcodes: Record<string, { | ||
@@ -323,3 +309,2 @@ encode: (args_0: any, ...args: unknown[]) => string; | ||
rangeKey: string; | ||
throttle?: number | undefined; | ||
entities?: Record<string, { | ||
@@ -349,2 +334,3 @@ timestampProperty: string; | ||
shardKeyDelimiter?: string | undefined; | ||
throttle?: number | undefined; | ||
transcodes?: Record<string, { | ||
@@ -596,2 +582,18 @@ encode: (args_0: any, ...args: unknown[]) => string; | ||
/** | ||
* Base EntityClient options. | ||
* | ||
* @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`}. | ||
* | ||
* @category EntityClient | ||
*/ | ||
interface BaseEntityClientOptions<C extends BaseConfigMap> { | ||
/** Default batch process options. */ | ||
batchProcessOptions?: Omit<BatchProcessOptions<unknown, unknown>, 'batchHandler' | 'unprocessedItemExtractor'>; | ||
/** {@link EntityManager | `EntityManager`} instance. */ | ||
entityManager: EntityManager<C>; | ||
/** Injected logger object. Must support `debug` and `error` methods. Default: `console` */ | ||
logger?: Pick<Console, 'debug' | 'error'>; | ||
} | ||
/** | ||
* Base EntityClient class. Integrates {@link EntityManager | `EntityManager`} with injected logging & enhanced batch processing. | ||
@@ -604,5 +606,8 @@ * | ||
declare abstract class BaseEntityClient<C extends BaseConfigMap> { | ||
/** Default batch process options. */ | ||
readonly batchProcessOptions: NonNullable<BaseEntityClientOptions<C>['batchProcessOptions']>; | ||
/** {@link EntityManager | `EntityManager`} instance. */ | ||
readonly entityManager: EntityManager<C>; | ||
readonly batchProcessOptions: NonNullable<BaseEntityClientOptions['batchProcessOptions']>; | ||
readonly logger: NonNullable<BaseEntityClientOptions['logger']>; | ||
/** Injected logger object. Must support `debug` and `error` methods. Default: `console` */ | ||
readonly logger: NonNullable<BaseEntityClientOptions<C>['logger']>; | ||
/** | ||
@@ -613,3 +618,3 @@ * DynamoDB EntityClient constructor. | ||
*/ | ||
constructor(entityManager: EntityManager<C>, options?: BaseEntityClientOptions); | ||
constructor(options: BaseEntityClientOptions<C>); | ||
} | ||
@@ -616,0 +621,0 @@ |
@@ -14,6 +14,6 @@ /** | ||
*/ | ||
constructor(entityManager, options = {}) { | ||
constructor(options) { | ||
const { batchProcessOptions = {}, entityManager, logger = console, } = options; | ||
this.batchProcessOptions = batchProcessOptions; | ||
this.entityManager = entityManager; | ||
const { batchProcessOptions = {}, logger = console } = options; | ||
this.batchProcessOptions = batchProcessOptions; | ||
this.logger = logger; | ||
@@ -20,0 +20,0 @@ } |
@@ -135,3 +135,3 @@ { | ||
"types": "dist/index.d.ts", | ||
"version": "6.10.2" | ||
"version": "6.10.3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
171820
3735