@agentbadge/database 0.6.17 → 0.6.18
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.
|
@@ -53,6 +53,7 @@ export declare class AgentRequestRepository {
|
|
|
53
53
|
upsertQaPair(qa: AgentQAPairUpsert): Promise<QaRow>;
|
|
54
54
|
retractQaPair(id: string, reason: string, retractedAtMs: number): Promise<QaRow | null>;
|
|
55
55
|
getQaByHash(questionHash: string): Promise<QaRow | null>;
|
|
56
|
+
getQaByHashIncludingRetracted(questionHash: string): Promise<QaRow | null>;
|
|
56
57
|
searchQa(substring: string, limit?: number): Promise<QaRow[]>;
|
|
57
58
|
}
|
|
58
59
|
export {};
|
|
@@ -148,6 +148,11 @@ export class AgentRequestRepository {
|
|
|
148
148
|
}).first();
|
|
149
149
|
return row != null && row.retractedAtMs == null ? row : null;
|
|
150
150
|
}
|
|
151
|
+
async getQaByHashIncludingRetracted(questionHash) {
|
|
152
|
+
return await this.db.orm.public.AgentQAPair.where({
|
|
153
|
+
questionHash,
|
|
154
|
+
}).first();
|
|
155
|
+
}
|
|
151
156
|
async searchQa(substring, limit = 50) {
|
|
152
157
|
const needle = substring.toLowerCase();
|
|
153
158
|
const rows = await this.db.orm.public.AgentQAPair.orderBy((r) => r.createdAtMs.desc())
|
package/package.json
CHANGED