diff --git a/package.json b/package.json index c608155..21fa796 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@BridgemanAccessible/ba-polyglot-storage", - "version": "1.0.0", + "version": "1.0.1", "description": "A shared utility library to support Polyglot Storage implementations", "repository": "https://git.bridgemanaccessible.ca/Bridgeman-Accessible/ba-polyglot-storage", "author": "Bridgeman Accessible", diff --git a/src/decorators/PolyglotAdapter.ts b/src/decorators/PolyglotAdapter.ts deleted file mode 100644 index edfe124..0000000 --- a/src/decorators/PolyglotAdapter.ts +++ /dev/null @@ -1,11 +0,0 @@ -import 'reflect-metadata'; - -/** Metadata key used to store the NoSQL adapter of an entity */ -export const POLYGLOT_ADAPTER_META = Symbol('polyglot:adapter'); - -/** Links an Entity to its specific NoSQL Adapter class. */ -export function PolyglotAdapter(adapterClass: any): ClassDecorator { - return (target) => { - Reflect.defineMetadata(POLYGLOT_ADAPTER_META, adapterClass, target); - }; -} \ No newline at end of file diff --git a/src/decorators/index.ts b/src/decorators/index.ts index 2f6dec2..93b1670 100644 --- a/src/decorators/index.ts +++ b/src/decorators/index.ts @@ -1,7 +1,6 @@ import { PartitionKey } from './PartitionKey.js'; import { RowKey } from './RowKey.js'; -import { PolyglotAdapter } from './PolyglotAdapter.js'; import { NoSQLRetrieve } from './NoSQLRetrieve.js'; import { NoSQLSave } from './NoSQLSave.js'; -export { PartitionKey, RowKey, PolyglotAdapter, NoSQLRetrieve, NoSQLSave }; \ No newline at end of file +export { PartitionKey, RowKey, NoSQLRetrieve, NoSQLSave }; \ No newline at end of file diff --git a/src/repos/PolyglotRepository.ts b/src/repos/PolyglotRepository.ts index 21bf776..f078e84 100644 --- a/src/repos/PolyglotRepository.ts +++ b/src/repos/PolyglotRepository.ts @@ -5,7 +5,6 @@ import logMessage, { LogLevel } from '@BridgemanAccessible/ba-logging'; import { PARTITION_KEY_META } from '../decorators/PartitionKey.js' import { ROW_KEY_META } from '../decorators/RowKey.js'; -import { POLYGLOT_ADAPTER_META } from '../decorators/PolyglotAdapter.js'; import { NOSQL_RETRIEVE_META } from '../decorators/NoSQLRetrieve.js'; import { NOSQL_SAVE_META } from '../decorators/NoSQLSave.js'; @@ -42,13 +41,6 @@ export function createPolyglotRepository this.repo = repo; - // Extract Adapter Linkage - const AdapterClass = Reflect.getMetadata(POLYGLOT_ADAPTER_META, this.targetConstructor); - - if(!AdapterClass) { - throw new Error(`Polyglot setup failed: ${this.targetConstructor.name} is missing @PolyglotAdapter()`); - } - this.nosql = nosqlStorage.getAdapter(this.targetConstructor.name); }