refactor: make PALDRA match PDCA style exactly - remove redundant instanceConfig parameter and convert to pure singleton
Build and Push Docker Image / build (push) Successful in 20s
CI / Security audit (push) Successful in 1m18s
CI / Tests & coverage (push) Successful in 1m14s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 54s

- Remove instanceConfig parameter from all retriever methods (getTags, getQueue, getHistory)
- Retriever instances now use this.url, this.apiKey, this.id instead of passed parameter
- Convert ArrRetrieverRegistry from class with convenience functions to pure singleton object
- Export singleton instance directly instead of class + convenience functions
- Update poller.js and historyFetcher.js to call methods on singleton directly
- All 261 tests pass with zero behavior changes
This commit is contained in:
2026-05-19 14:51:22 +01:00
parent 627329df2f
commit 6e199925aa
6 changed files with 66 additions and 95 deletions
+3 -6
View File
@@ -44,25 +44,22 @@ class ArrRetriever {
/**
* Get tags from this *arr instance
* @param {Object} instanceConfig - Configuration for the instance
* @returns {Promise<Array>} Array of tag objects
*/
async getTags(instanceConfig) {
async getTags() {
throw new Error('getTags() must be implemented by subclass');
}
/**
* Get queue from this *arr instance
* @param {Object} instanceConfig - Configuration for the instance
* @returns {Promise<Object>} Queue object with records array
*/
async getQueue(instanceConfig) {
async getQueue() {
throw new Error('getQueue() must be implemented by subclass');
}
/**
* Get history from this *arr instance
* @param {Object} instanceConfig - Configuration for the instance
* @param {Object} options - Optional parameters for history fetch
* @param {number} [options.pageSize] - Number of records to fetch
* @param {string} [options.sortKey] - Field to sort by
@@ -73,7 +70,7 @@ class ArrRetriever {
* @param {string} [options.startDate] - ISO date string for filtering
* @returns {Promise<Object>} History object with records array
*/
async getHistory(instanceConfig, options = {}) {
async getHistory(options = {}) {
throw new Error('getHistory() must be implemented by subclass');
}
}