Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
7b442e5
fix: Reduce TypeScript errors across the codebase
kriszyp Apr 28, 2026
861be3d
fix: Further reduce TypeScript errors across core files
kriszyp Apr 28, 2026
7100c23
fix: Strengthen types and remove 'any' casts
kriszyp Apr 28, 2026
7fb4686
fix: Properly wrap DatabaseTransaction in Context and support primiti…
kriszyp Apr 28, 2026
c0d043f
fix: Resolve intermittent LMDB segfault by providing default CommitOp…
kriszyp Apr 28, 2026
ca7ea69
fix: Resolve LMDBTransaction properties and continue Table.ts typing
kriszyp Apr 28, 2026
38384a5
fix: Strengthen types and resolve TS errors across multiple modules
kriszyp Apr 28, 2026
091f010
fix: Strengthen types and resolve TS errors in Table.ts, search.ts, R…
kriszyp Apr 28, 2026
5a4add0
fix: Further refine and strengthen types for serialization and http c…
kriszyp Apr 28, 2026
cb15a2e
Update resources/Resource.ts
kriszyp Apr 28, 2026
22087ef
Update resources/Resource.ts
kriszyp Apr 28, 2026
e1e685e
fix: Restore original create method signature and resolve export.js t…
kriszyp Apr 29, 2026
4fc0d70
fix: Resolve CRL verification test failure and TS errors
kriszyp Apr 29, 2026
7d52c92
Formatting
kriszyp Apr 29, 2026
b6411cc
fix: Restore missing hasContent: false caching directives and fix tes…
kriszyp Apr 29, 2026
08e71d8
fix: Resolve LMDBTransaction pooling and caching regressions
kriszyp Apr 29, 2026
4fe9eb0
fix: Resolve 250+ TS errors and fix transaction/caching regressions
kriszyp Apr 30, 2026
a959e1a
fix: Resolve all remaining TypeScript errors and stabilize test suite
kriszyp Apr 30, 2026
4292fac
fix: Resolve missing TypeScript errors in secondary files
kriszyp Apr 30, 2026
be10340
chore: Remove errors.txt tracking file
kriszyp Apr 30, 2026
db86dd6
Merge origin/main into ts-fixes, resolving all conflicts and TS regre…
kriszyp Apr 30, 2026
a590460
style: Fix remaining ESLint 'no-unused-vars' warnings and format code…
kriszyp Apr 30, 2026
e1875db
fix: Resolve LMDB testing errors and resource connect typing
kriszyp May 2, 2026
2646aa3
style: Clean up unused CompartmentOptions import in jsLoader.ts
kriszyp May 2, 2026
ed60382
Merge origin/main into ts-fixes and resolve regressions
kriszyp May 2, 2026
d9b9538
fix: Address PR #413 review feedback
kriszyp May 2, 2026
618d30d
fix: Revert unintentional argument parsing behavioral changes
kriszyp May 2, 2026
4c1b1f7
Formatting
kriszyp May 2, 2026
8dacd0e
refactor: Convert security/cryptoHash.js to TypeScript
kriszyp May 2, 2026
b1cb11e
refactor: Convert foundational utility/errors directory to TypeScript
kriszyp May 2, 2026
b875428
refactor: Convert security/fastifyAuth.js and data_objects to TypeScript
kriszyp May 2, 2026
a900330
refactor: Convert security/keys.js and environmentManager.js to TypeS…
kriszyp May 2, 2026
5fbb450
fix: Resolve initialization order error for util in security/keys.ts
kriszyp May 2, 2026
54c6b02
refactor: Convert multiple root utility scripts to TypeScript
kriszyp May 2, 2026
71e97df
fix: Resolve runtime TypeError in logger and initialization order for…
kriszyp May 2, 2026
276ab1a
fix: Consolidate remaining uncommitted style changes
kriszyp May 2, 2026
9708185
fix: Resolve runtime TypeErrors during Harper startup
kriszyp May 2, 2026
37b7a7e
fix: Resolve runtime module resolution failures for harperConfigEnvVars
kriszyp May 2, 2026
f0035d8
chore: Regenerate package-lock.json to include missing optional nativ…
kriszyp May 2, 2026
82eedc6
fix: Resolve ESM module transpilation issues in dataLayer/bulkLoad.js
kriszyp May 2, 2026
9aa43fc
fix: Resolve mock mapping failures in unit tests caused by module tra…
kriszyp May 2, 2026
5e64361
fix: Resolve test runner failures for mount_hdb and PermissionRespons…
kriszyp May 2, 2026
20c2752
Revert back to main's package state
kriszyp May 2, 2026
8818e7f
Formatting
kriszyp May 2, 2026
91f0ee3
refactor: Convert multiple root utility scripts to TypeScript
kriszyp May 2, 2026
f25506e
refactor: Convert utility/common_utils.js to TypeScript
kriszyp May 2, 2026
dc37d4a
fix: Commit dangling TS resolution adjustments for OperationFunctionC…
kriszyp May 2, 2026
c38cf85
refactor: Convert utility/globalSchema.js to TypeScript
kriszyp May 2, 2026
3e7716d
fix: Resolve missing databases.ts compilation output module references
kriszyp May 2, 2026
e50d36c
refactor: Convert security/role.js to TypeScript
kriszyp May 2, 2026
fc0569d
refactor: Convert utility/operation_authorization.js to TypeScript
kriszyp May 2, 2026
331ddaf
refactor: Convert dataLayer Objects to TypeScript
kriszyp May 2, 2026
600355d
fix: Resolve ESM module transpilation export mapping across DataLayer…
kriszyp May 2, 2026
fc0b2ff
refactor: Convert all remaining root DataLayer modules to TypeScript
kriszyp May 3, 2026
cf3c8e3
fix: Update explicit .ts requires to .js extensions for ESM compatibi…
kriszyp May 3, 2026
683beaa
refactor: Convert core LMDB utility bridge structures and tools to Ty…
kriszyp May 3, 2026
62145ed
fix: Resolve missing prototype methods, mock bridges, and undefined d…
kriszyp May 3, 2026
e3518ac
refactor: Convert root validation endpoints and rulesets to TypeScript
kriszyp May 3, 2026
d842414
fix: Resolve function name assertions and missing ESM module exports
kriszyp May 3, 2026
e5f8922
fix: adjust installValidator require logic and other exports to handl…
kriszyp May 3, 2026
a185955
refactor: Convert foundational logging functions logRotator, readLog,…
kriszyp May 3, 2026
e5bfd56
refactor: Convert sqlTranslator endpoints to TypeScript
kriszyp May 3, 2026
79d2062
refactor: Convert core utility/logging/harper_logger.js to TypeScript
kriszyp May 3, 2026
60d1162
refactor: Convert server/jobs to TypeScript and resolve AST translati…
kriszyp May 3, 2026
520959e
refactor: Convert upgrade components to TypeScript and adapt associat…
kriszyp May 4, 2026
84561c7
refactor: Convert bin/ scripts to TypeScript and fix global logger ex…
kriszyp May 4, 2026
32b8faf
fix: resolve SelectValidator not a constructor in search.ts
kriszyp May 5, 2026
b4fdb2f
fix: resolve SQLSearch not a constructor in search.ts
kriszyp May 5, 2026
bb7ae9d
chore: remove leftover duplicate .js files in upgrade directory
kriszyp May 5, 2026
34a1fdc
fix: safely handle missing system database during keys initialization
kriszyp May 5, 2026
5ceced5
fix: resolve harperBridge missing method errors caused by circular Co…
kriszyp May 5, 2026
52a6376
fix: resolve papaParse module extension assignment error by explicitl…
kriszyp May 5, 2026
938e62e
Merge origin/main
kriszyp May 5, 2026
7c6cfdc
Fix callback conversion
kriszyp May 6, 2026
20db20b
Merge origin/main
kriszyp May 6, 2026
7e9165e
fix(blob): re-apply missing blob cleanup fixes after origin/main merg…
kriszyp May 6, 2026
307d871
fix: resolve lint:required errors by cleaning up unused imports and v…
kriszyp May 6, 2026
6730e77
Formatting
kriszyp May 6, 2026
a8b5999
Try to restore package-lock.json
kriszyp May 6, 2026
0ca6f49
Some cleanup
kriszyp May 11, 2026
b62f156
fix(merge): resolve TS typing conflicts and infinite db recursion dur…
kriszyp May 11, 2026
b0b21ab
chore: run formatter
kriszyp May 13, 2026
9a44c07
fix(merge): successfully resolve all origin/main merge conflicts and …
kriszyp May 13, 2026
5996e51
test: stabilize unit tests after NodeNext migration
kriszyp May 14, 2026
8ada7e8
test: fix keys.test.js mock certificate pollution and state leaks
kriszyp May 14, 2026
47a80be
fix: resolve test failures and Bun startup crash from PR #413 TypeScr…
kriszyp May 14, 2026
9e69554
fix: address PR review comments - remove debug code, fix test auth flow
kriszyp May 14, 2026
72f3348
fix: remove premature getDatabases() calls from test utilities
kriszyp May 14, 2026
89fb93c
fix: restore loadedDatabases guard before definedDatabases reset
kriszyp May 14, 2026
ac0a111
fix: explicitly load system database before overriding test paths in …
kriszyp May 14, 2026
3df2946
fix: restore eager session table initialization in auth.ts
kriszyp May 14, 2026
ec563fa
fix: silence pre-existing lint warnings and fix auth bypass for API t…
kriszyp May 15, 2026
a9483ba
fix: restore bunServeConfigs export to fix Bun integration test crash
kriszyp May 15, 2026
dea242a
Merge origin/main into ts-fixes
kriszyp May 15, 2026
7057f53
fix: strengthen auth bypass to not depend on IP check in test environ…
kriszyp May 15, 2026
22029cf
fix: restore after:'authentication' ordering in REST middleware regis…
kriszyp May 15, 2026
d217a33
fix: scope auth bypass to no-credential requests only
kriszyp May 15, 2026
c7dca38
fix(test): restore hdb_certificate after keys test to prevent MQTT TL…
kriszyp May 15, 2026
672bd43
fix(imports): correct module extension references for node type-strip…
kriszyp May 15, 2026
df85073
fix(imports): convert require(.ts) to imports; strip extensions from …
kriszyp May 15, 2026
7e8f58a
fix(imports): convert package require() to import in TypeScript modules
kriszyp May 15, 2026
172897b
Merge remote-tracking branch 'origin/main' into merge-main-into-ts-fixes
kriszyp May 15, 2026
a752a7d
fix(imports): revert require→import where unit tests use rewire mocking
kriszyp May 15, 2026
5b962b0
fix(tests): align rewire variable names with compiled TS import names
kriszyp May 15, 2026
8f02671
fix: revert packageUtils to CJS .js + fix TS build errors
kriszyp May 15, 2026
be86b60
fix: restore .ts extensions in require() calls referencing TS source
kriszyp May 15, 2026
55eaa57
chore: apply prettier formatting
kriszyp May 15, 2026
1a81ccc
chore: format subscriptionReplay test
kriszyp May 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/copyDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
const sourceDbisDb = rootStore.dbisDb;
const sourceAuditStore = rootStore.auditStore;
const targetEnv = open(new OpenEnvironmentObject(targetDatabasePath));
const targetDbisDb = targetEnv.openDB(INTERNAL_DBIS_NAME);
const targetDbisDb = targetEnv.openDB({ name: INTERNAL_DBIS_NAME });
let written;
let outstandingWrites = 0;
// we use a single transaction to get a snapshot, also we can't use snapshot: false on dupsort dbs
Expand Down Expand Up @@ -194,8 +194,8 @@
sourceDbi.decoderCopies = false;
sourceDbi.encoding = 'binary';
dbiInit.compression = newCompression;
const targetDbi = targetEnv.openDB(key, dbiInit);

Check failure on line 197 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Argument of type 'OpenDBIObject' is not assignable to parameter of type 'DatabaseOptions'.

Check failure on line 197 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Argument of type 'OpenDBIObject' is not assignable to parameter of type 'DatabaseOptions'.

Check failure on line 197 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Argument of type 'OpenDBIObject' is not assignable to parameter of type 'DatabaseOptions'.

Check failure on line 197 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Argument of type 'OpenDBIObject' is not assignable to parameter of type 'DatabaseOptions'.

Check failure on line 197 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Argument of type 'OpenDBIObject' is not assignable to parameter of type 'DatabaseOptions'.

Check failure on line 197 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Argument of type 'OpenDBIObject' is not assignable to parameter of type 'DatabaseOptions'.
targetDbi.encoder = null;

Check failure on line 198 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Property 'encoder' does not exist on type 'Database<any, Key>'.

Check failure on line 198 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Property 'encoder' does not exist on type 'Database<any, Key>'.

Check failure on line 198 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Property 'encoder' does not exist on type 'Database<any, Key>'.

Check failure on line 198 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Property 'encoder' does not exist on type 'Database<any, Key>'.

Check failure on line 198 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Property 'encoder' does not exist on type 'Database<any, Key>'.

Check failure on line 198 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Property 'encoder' does not exist on type 'Database<any, Key>'.
console.log('copying', key, 'from', sourceDatabase, 'to', targetDatabasePath);
await copyDbi(sourceDbi, targetDbi, isPrimary, transaction);
}
Expand Down Expand Up @@ -289,7 +289,7 @@
}
let db;
if (options.dupSort) {
db = RocksDatabase.open(new RocksIndexStore(path, options));

Check failure on line 292 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v24)

Argument of type 'RocksIndexStore' is not assignable to parameter of type 'string | Store'.

Check failure on line 292 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v20)

Argument of type 'RocksIndexStore' is not assignable to parameter of type 'string | Store'.

Check failure on line 292 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Build Harper (Node.js v22)

Argument of type 'RocksIndexStore' is not assignable to parameter of type 'string | Store'.

Check failure on line 292 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v24)

Argument of type 'RocksIndexStore' is not assignable to parameter of type 'string | Store'.

Check failure on line 292 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v20)

Argument of type 'RocksIndexStore' is not assignable to parameter of type 'string | Store'.

Check failure on line 292 in bin/copyDb.ts

View workflow job for this annotation

GitHub Actions / Unit Test (Node.js v22)

Argument of type 'RocksIndexStore' is not assignable to parameter of type 'string | Store'.
} else {
db = RocksDatabase.open(path, options);
db.encoder.name = options.name;
Expand Down
2 changes: 1 addition & 1 deletion components/ComponentV1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ComponentV1Details {
}

export class ComponentV1 {
readonly config: Readonly<ComponentV1Config>;
readonly config: ComponentV1Config;
readonly name: string;
readonly directory: string;
readonly module: Readonly<ComponentV1Module>;
Expand Down
57 changes: 38 additions & 19 deletions dataLayer/harperBridge/BridgeMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,98 @@
*/

class BridgeMethods {
createSchema() {
/** @param {...any} args */
createSchema(...args) {

Check failure on line 9 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('createSchema bridge method is not defined');
}

dropSchema() {
/** @param {...any} args */
dropSchema(...args) {

Check failure on line 14 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('dropSchema bridge method is not defined');
}

createTable() {
/** @param {...any} args */
createTable(...args) {

Check failure on line 19 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('createTable bridge method is not defined');
}

dropTable() {
/** @param {...any} args */
dropTable(...args) {

Check failure on line 24 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('dropTable bridge method is not defined');
}

createRecords() {
/** @param {...any} args */
createRecords(...args) {

Check failure on line 29 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('createRecords bridge method is not defined');
}

updateRecords() {
/** @param {...any} args */
updateRecords(...args) {

Check failure on line 34 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('updateRecords bridge method is not defined');
}

async upsertRecords() {
/** @param {...any} args */
async upsertRecords(...args) {

Check failure on line 39 in dataLayer/harperBridge/BridgeMethods.js

View workflow job for this annotation

GitHub Actions / runLinter

eslint(no-unused-vars)

Parameter 'args' is declared but never used. Unused parameters should start with a '_'.
throw new Error('upsertRecords bridge method is not defined');
}

deleteRecords() {
/** @param {...any} args */
deleteRecords(...args) {
throw new Error('deleteRecords bridge method is not defined');
}

createAttribute() {
/** @param {...any} args */
createAttribute(...args) {
throw new Error('createAttribute bridge method is not defined');
}

dropAttribute() {
/** @param {...any} args */
dropAttribute(...args) {
throw new Error('dropAttribute bridge method is not defined');
}

searchByConditions() {
/** @param {...any} args */
searchByConditions(...args) {
throw new Error('searchByConditions bridge method is not defined');
}

searchByHash() {
/** @param {...any} args */
searchByHash(...args) {
throw new Error('searchByHash bridge method is not defined');
}

searchByValue() {
/** @param {...any} args */
searchByValue(...args) {
throw new Error('searchByValue bridge method is not defined');
}

getDataByHash() {
/** @param {...any} args */
getDataByHash(...args) {
throw new Error('getDataByHash bridge method is not defined');
}

async getDataByValue(_searchObject, _comparator) {
/** @param {...any} args */
async getDataByValue(...args) {
throw new Error('getDataByValue bridge method is not defined');
}

async deleteRecordsBefore(_deleteObj) {
/** @param {...any} args */
async deleteRecordsBefore(...args) {
throw new Error('deleteRecordsBefore bridge method is not defined');
}

async deleteAuditLogsBefore(_deleteObj) {
/** @param {...any} args */
async deleteAuditLogsBefore(...args) {
throw new Error('deleteAuditLogsBefore bridge method is not defined');
}

async deleteTransactionLogsBefore(_deleteObj) {
/** @param {...any} args */
async deleteTransactionLogsBefore(...args) {
throw new Error('deleteTransactionLogsBefore bridge method is not defined');
}

async readAuditLog(_readAuditLogObj) {
/** @param {...any} args */
async readAuditLog(...args) {
throw new Error('readAuditLog bridge method is not defined');
}
}
Expand Down
44 changes: 25 additions & 19 deletions dataLayer/harperBridge/ResourceBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ export class ResourceBridge extends BridgeMethods {
{
conditions: searchObject.conditions,
//set the operator to always be lowercase for later evaluations
operator: searchObject.operator ? searchObject.operator.toLowerCase() : undefined,
operator: searchObject.operator ? (searchObject.operator as any).toLowerCase() : undefined,
limit: searchObject.limit,
offset: searchObject.offset,
reverse: searchObject.reverse,
select: getSelect(searchObject, table),
sort: searchObject.sort,
allowFullScan: true, // operations API can do full scans by default, but REST is more cautious about what it allows
},
} as any,
{
onlyIfCached: searchObject.onlyIfCached,
noCacheStore: searchObject.noCacheStore,
Expand Down Expand Up @@ -143,7 +143,7 @@ export class ResourceBridge extends BridgeMethods {
{
name: createAttributeObj.attribute,
indexed: createAttributeObj.indexed ?? true,
},
} as any,
]);
return `attribute ${createAttributeObj.schema}.${createAttributeObj.table}.${createAttributeObj.attribute} successfully created.`;
}
Expand Down Expand Up @@ -198,8 +198,9 @@ export class ResourceBridge extends BridgeMethods {
return this.upsertRecords(updateObj);
}

// @ts-expect-error property is not assignable to base type
async upsertRecords(upsertObj) {
const { attributes } = insertUpdateValidate(upsertObj);
const { attributes } = await insertUpdateValidate(upsertObj);

let new_attributes;
const Table = getDatabases()[upsertObj.schema][upsertObj.table];
Expand Down Expand Up @@ -266,7 +267,7 @@ export class ResourceBridge extends BridgeMethods {
keys.push(record[Table.primaryKey]);
}
return {
txn_time: transaction.timestamp,
txn_time: (transaction as any).timestamp,
written_hashes: keys,
new_attributes,
skipped_hashes: skipped,
Expand All @@ -288,7 +289,7 @@ export class ResourceBridge extends BridgeMethods {
if (await Table.delete(id, context)) deleted.push(id);
else skipped.push(id);
}
return createDeleteResponse(deleted, skipped, transaction.timestamp);
return createDeleteResponse(deleted, skipped, (transaction as any).timestamp);
});
}

Expand All @@ -303,6 +304,7 @@ export class ResourceBridge extends BridgeMethods {
* }
* @returns {undefined}
*/
// @ts-expect-error property is not assignable to base type
async deleteRecordsBefore(deleteObj) {
const Table = getDatabases()[deleteObj.schema][deleteObj.table];
if (!Table.createdTimeProperty) {
Expand All @@ -319,7 +321,7 @@ export class ResourceBridge extends BridgeMethods {
comparator: VALUE_SEARCH_COMPARATORS.LESS,
},
],
});
} as any);

let deleteCalled = false;
const deletedIds = [];
Expand Down Expand Up @@ -376,7 +378,7 @@ export class ResourceBridge extends BridgeMethods {
async getDataByHash(searchObject) {
const map = new Map();
searchObject._returnKeyValue = true;
for await (const { key, value } of getRecords(searchObject, true)) {
for await (const { key, value } of getRecords(searchObject, true) as any) {
map.set(key, value);
}
return map;
Expand All @@ -386,9 +388,10 @@ export class ResourceBridge extends BridgeMethods {
if (comparator && VALUE_SEARCH_COMPARATORS_REVERSE_LOOKUP[comparator] === undefined) {
throw new Error(`Value search comparator - ${comparator} - is not valid`);
}
if (searchObject.select !== undefined) searchObject.get_attributes = searchObject.select;
if (searchObject.search_attribute !== undefined) searchObject.attribute = searchObject.search_attribute;
if (searchObject.search_value !== undefined) searchObject.value = searchObject.search_value;
const obj = searchObject as any;
if (obj.select !== undefined) obj.get_attributes = obj.select;
if (obj.search_attribute !== undefined) obj.attribute = obj.search_attribute;
if (obj.search_value !== undefined) obj.value = obj.search_value;

const validationError = searchValidator(searchObject, 'value');
if (validationError) {
Expand All @@ -399,7 +402,7 @@ export class ResourceBridge extends BridgeMethods {
if (!table) {
throw new ClientError(`Table ${searchObject.table} not found`);
}
let value = searchObject.value;
let value: any = searchObject.value;
if (value.includes?.('*')) {
if (value.startsWith('*')) {
if (value.endsWith('*')) {
Expand Down Expand Up @@ -435,18 +438,19 @@ export class ResourceBridge extends BridgeMethods {
limit: searchObject.limit,
offset: searchObject.offset,
reverse: searchObject.reverse,
sort: searchObject.sort,
sort: (searchObject as any).sort,
select: getSelect(searchObject, table),
},
} as any,
{
onlyIfCached: searchObject.onlyIfCached,
noCacheStore: searchObject.noCacheStore,
noCache: searchObject.noCache,
replicateFrom: searchObject.replicateFrom,
onlyIfCached: (searchObject as any).onlyIfCached,
noCacheStore: (searchObject as any).noCacheStore,
noCache: (searchObject as any).noCache,
replicateFrom: (searchObject as any).replicateFrom,
}
);
}

// @ts-expect-error property is not assignable to base type
async getDataByValue(searchObject: SearchObject, comparator?: string) {
const map = new Map();
const table = getTable(searchObject);
Expand All @@ -469,6 +473,7 @@ export class ResourceBridge extends BridgeMethods {
* @param deleteObj The request body
* @returns
*/
// @ts-expect-error property is not assignable to base type
async deleteTransactionLogsBefore(deleteObj: {
schema?: string; // deprecated in favor of `database`
database?: string;
Expand Down Expand Up @@ -506,6 +511,7 @@ export class ResourceBridge extends BridgeMethods {
return totalResults;
}

// @ts-expect-error property is not assignable to base type
async readAuditLog(readAuditLogObj) {
const table = getTable(readAuditLogObj);
const histories = {};
Expand Down Expand Up @@ -599,7 +605,7 @@ function getRecords(searchObject, returnKeyValue?) {
const id = ids[i++];
let record;
try {
record = await table.get({ id, lazy, select }, context);
record = await table.get({ id, lazy, select } as any, context);
record = record && collapseData(record);
} catch (error) {
record = {
Expand Down
Loading
Loading