@talkpilot/core-db 1.1.14 → 1.1.17

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.
Files changed (32) hide show
  1. package/dist/talkpilot/index.d.ts +1 -0
  2. package/dist/talkpilot/index.d.ts.map +1 -1
  3. package/dist/talkpilot/index.js +1 -0
  4. package/dist/talkpilot/index.js.map +1 -1
  5. package/dist/talkpilot/results/index.d.ts +1 -1
  6. package/dist/talkpilot/results/index.d.ts.map +1 -1
  7. package/dist/talkpilot/results/index.js +3 -1
  8. package/dist/talkpilot/results/index.js.map +1 -1
  9. package/dist/talkpilot/results/results.getter.d.ts +3 -1
  10. package/dist/talkpilot/results/results.getter.d.ts.map +1 -1
  11. package/dist/talkpilot/results/results.getter.js +11 -2
  12. package/dist/talkpilot/results/results.getter.js.map +1 -1
  13. package/dist/talkpilot/retry_analyze/index.d.ts +3 -0
  14. package/dist/talkpilot/retry_analyze/index.d.ts.map +1 -0
  15. package/dist/talkpilot/retry_analyze/index.js +19 -0
  16. package/dist/talkpilot/retry_analyze/index.js.map +1 -0
  17. package/dist/talkpilot/retry_analyze/retryAnalyze.getters.d.ts +10 -0
  18. package/dist/talkpilot/retry_analyze/retryAnalyze.getters.d.ts.map +1 -0
  19. package/dist/talkpilot/retry_analyze/retryAnalyze.getters.js +60 -0
  20. package/dist/talkpilot/retry_analyze/retryAnalyze.getters.js.map +1 -0
  21. package/dist/talkpilot/retry_analyze/retryAnalyze.types.d.ts +12 -0
  22. package/dist/talkpilot/retry_analyze/retryAnalyze.types.d.ts.map +1 -0
  23. package/dist/talkpilot/retry_analyze/retryAnalyze.types.js +3 -0
  24. package/dist/talkpilot/retry_analyze/retryAnalyze.types.js.map +1 -0
  25. package/package.json +1 -1
  26. package/src/talkpilot/index.ts +1 -0
  27. package/src/talkpilot/results/index.ts +2 -0
  28. package/src/talkpilot/results/results.getter.ts +10 -2
  29. package/src/talkpilot/retry_analyze/__tests__/retryAnalyze.getters.spec.ts +156 -0
  30. package/src/talkpilot/retry_analyze/index.ts +2 -0
  31. package/src/talkpilot/retry_analyze/retryAnalyze.getters.ts +75 -0
  32. package/src/talkpilot/retry_analyze/retryAnalyze.types.ts +13 -0
@@ -13,6 +13,7 @@ export * from "./calls";
13
13
  export * from "./clientAudioBuffers";
14
14
  export * from "./clientsConfig";
15
15
  export * from "./backgroundToolResults";
16
+ export * from "./retry_analyze";
16
17
  export { mongodbClient } from "./mongodb-client";
17
18
  export declare const setDb: (d: Db) => void;
18
19
  export declare const getDb: () => Db;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/talkpilot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAExD,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,eAAO,MAAM,KAAK,GAAI,GAAG,EAAE,SAE1B,CAAC;AACF,eAAO,MAAM,KAAK,QAAO,EAGxB,CAAC;AAEF,eAAO,MAAM,QAAQ,sBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/talkpilot/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAExD,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,eAAO,MAAM,KAAK,GAAI,GAAG,EAAE,SAE1B,CAAC;AACF,eAAO,MAAM,KAAK,QAAO,EAGxB,CAAC;AAEF,eAAO,MAAM,QAAQ,sBAAgB,CAAC"}
@@ -30,6 +30,7 @@ __exportStar(require("./calls"), exports);
30
30
  __exportStar(require("./clientAudioBuffers"), exports);
31
31
  __exportStar(require("./clientsConfig"), exports);
32
32
  __exportStar(require("./backgroundToolResults"), exports);
33
+ __exportStar(require("./retry_analyze"), exports);
33
34
  var mongodb_client_1 = require("./mongodb-client");
34
35
  Object.defineProperty(exports, "mongodbClient", { enumerable: true, get: function () { return mongodb_client_1.mongodbClient; } });
35
36
  let db;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/talkpilot/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAwD;AAExD,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,kDAAgC;AAChC,0CAAwB;AACxB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB;AACxB,uDAAqC;AACrC,kDAAgC;AAChC,0DAAwC;AACxC,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAEtB,IAAI,EAAM,CAAC;AACJ,MAAM,KAAK,GAAG,CAAC,CAAK,EAAE,EAAE;IAC7B,EAAE,GAAG,CAAC,CAAC;AACT,CAAC,CAAC;AAFW,QAAA,KAAK,SAEhB;AACK,MAAM,KAAK,GAAG,GAAO,EAAE;IAC5B,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC/C,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAHW,QAAA,KAAK,SAGhB;AAEW,QAAA,QAAQ,GAAG,kBAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/talkpilot/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAwD;AAExD,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,kDAAgC;AAChC,0CAAwB;AACxB,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,kDAAgC;AAChC,2CAAyB;AACzB,0CAAwB;AACxB,uDAAqC;AACrC,kDAAgC;AAChC,0DAAwC;AACxC,kDAAgC;AAChC,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAEtB,IAAI,EAAM,CAAC;AACJ,MAAM,KAAK,GAAG,CAAC,CAAK,EAAE,EAAE;IAC7B,EAAE,GAAG,CAAC,CAAC;AACT,CAAC,CAAC;AAFW,QAAA,KAAK,SAEhB;AACK,MAAM,KAAK,GAAG,GAAO,EAAE;IAC5B,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC/C,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAHW,QAAA,KAAK,SAGhB;AAEW,QAAA,QAAQ,GAAG,kBAAa,CAAC"}
@@ -1,3 +1,3 @@
1
- export { getResultsCollection, initializeResultDocument, } from "./results.getter";
1
+ export { getResultsCollection, initializeResultDocument, findResultById, findResultByCallSid, } from "./results.getter";
2
2
  export type * from "./results.types";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,mBAAmB,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,mBAAmB,iBAAiB,CAAC"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initializeResultDocument = exports.getResultsCollection = void 0;
3
+ exports.findResultByCallSid = exports.findResultById = exports.initializeResultDocument = exports.getResultsCollection = void 0;
4
4
  var results_getter_1 = require("./results.getter");
5
5
  Object.defineProperty(exports, "getResultsCollection", { enumerable: true, get: function () { return results_getter_1.getResultsCollection; } });
6
6
  Object.defineProperty(exports, "initializeResultDocument", { enumerable: true, get: function () { return results_getter_1.initializeResultDocument; } });
7
+ Object.defineProperty(exports, "findResultById", { enumerable: true, get: function () { return results_getter_1.findResultById; } });
8
+ Object.defineProperty(exports, "findResultByCallSid", { enumerable: true, get: function () { return results_getter_1.findResultByCallSid; } });
7
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/results/index.ts"],"names":[],"mappings":";;;AAAA,mDAG0B;AAFxB,sHAAA,oBAAoB,OAAA;AACpB,0HAAA,wBAAwB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/results/index.ts"],"names":[],"mappings":";;;AAAA,mDAK0B;AAJxB,sHAAA,oBAAoB,OAAA;AACpB,0HAAA,wBAAwB,OAAA;AACxB,gHAAA,cAAc,OAAA;AACd,qHAAA,mBAAmB,OAAA"}
@@ -1,7 +1,9 @@
1
- import type { Collection } from "mongodb";
1
+ import { Collection, ObjectId } from "mongodb";
2
2
  import { Session } from "../index";
3
3
  import type { Result } from "./results.types";
4
4
  export declare const getResultsCollection: () => Collection<Result>;
5
5
  export declare const createRunId: () => string;
6
6
  export declare const initializeResultDocument: (clientId: string, session?: Session) => Promise<Result>;
7
+ export declare const findResultById: (resultId: string | ObjectId) => Promise<Result | null>;
8
+ export declare const findResultByCallSid: (callSid: string) => Promise<Result | null>;
7
9
  //# sourceMappingURL=results.getter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"results.getter.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/results.getter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAmB,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,eAAO,MAAM,oBAAoB,QAAO,UAAU,CAAC,MAAM,CAClB,CAAC;AAExC,eAAO,MAAM,WAAW,QAAO,MAE9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,UAAU,MAAM,EAChB,UAAU,OAAO,KAChB,OAAO,CAAC,MAAM,CAYhB,CAAC"}
1
+ {"version":3,"file":"results.getter.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/results.getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAS,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,eAAO,MAAM,oBAAoB,QAAO,UAAU,CAAC,MAAM,CAClB,CAAC;AAExC,eAAO,MAAM,WAAW,QAAO,MAE9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,UAAU,MAAM,EAChB,UAAU,OAAO,KAChB,OAAO,CAAC,MAAM,CAYhB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,UAAU,MAAM,GAAG,QAAQ,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAEvF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAEhF,CAAC"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initializeResultDocument = exports.createRunId = exports.getResultsCollection = void 0;
3
+ exports.findResultByCallSid = exports.findResultById = exports.initializeResultDocument = exports.createRunId = exports.getResultsCollection = void 0;
4
+ const mongodb_1 = require("mongodb");
4
5
  const index_1 = require("../index");
5
6
  const getResultsCollection = () => (0, index_1.getDb)().collection("results");
6
7
  exports.getResultsCollection = getResultsCollection;
7
8
  const createRunId = () => {
8
- return `run_${new index_1.ObjectId().toString()}`;
9
+ return `run_${new mongodb_1.ObjectId().toString()}`;
9
10
  };
10
11
  exports.createRunId = createRunId;
11
12
  const initializeResultDocument = async (clientId, session) => {
@@ -23,4 +24,12 @@ const initializeResultDocument = async (clientId, session) => {
23
24
  return result;
24
25
  };
25
26
  exports.initializeResultDocument = initializeResultDocument;
27
+ const findResultById = async (resultId) => {
28
+ return (0, exports.getResultsCollection)().findOne({ _id: new mongodb_1.ObjectId(resultId) });
29
+ };
30
+ exports.findResultById = findResultById;
31
+ const findResultByCallSid = async (callSid) => {
32
+ return (0, exports.getResultsCollection)().findOne({ "calls.callSid": callSid });
33
+ };
34
+ exports.findResultByCallSid = findResultByCallSid;
26
35
  //# sourceMappingURL=results.getter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"results.getter.js","sourceRoot":"","sources":["../../../src/talkpilot/results/results.getter.ts"],"names":[],"mappings":";;;AACA,oCAAoD;AAG7C,MAAM,oBAAoB,GAAG,GAAuB,EAAE,CAC3D,IAAA,aAAK,GAAE,CAAC,UAAU,CAAS,SAAS,CAA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 +1,3 @@
1
+ export * from "./retryAnalyze.types";
2
+ export * from "./retryAnalyze.getters";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/retry_analyze/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./retryAnalyze.types"), exports);
18
+ __exportStar(require("./retryAnalyze.getters"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/retry_analyze/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,yDAAuC"}
@@ -0,0 +1,10 @@
1
+ import { Collection, ObjectId } from "mongodb";
2
+ import type { RetryAnalyzeDoc, RetryAnalyzeWithId } from "./retryAnalyze.types";
3
+ export declare const getRetryAnalyzeCollection: () => Collection<RetryAnalyzeDoc>;
4
+ export declare const getAllRetryAnalyzeDocs: () => Promise<RetryAnalyzeWithId[]>;
5
+ export declare const insertRetryAnalyzeDoc: (doc: Omit<RetryAnalyzeDoc, "_id">) => Promise<ObjectId>;
6
+ export declare const upsertRetryAnalyzeDoc: (doc: Pick<RetryAnalyzeDoc, "callSid" | "errorLog" | "clientId">) => Promise<ObjectId | null>;
7
+ export declare const deleteRetryAnalyzeDocById: (id: ObjectId) => Promise<boolean>;
8
+ export declare const deleteRetryAnalyzeDocByCallSid: (callSid: string) => Promise<boolean>;
9
+ export declare const updateRetryAnalyzeErrorLog: (id: ObjectId, errorLog: string) => Promise<boolean>;
10
+ //# sourceMappingURL=retryAnalyze.getters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retryAnalyze.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/retry_analyze/retryAnalyze.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAIhF,eAAO,MAAM,yBAAyB,QAAO,UAAU,CAAC,eAAe,CAEtE,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAa,OAAO,CAAC,kBAAkB,EAAE,CAM3E,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,KAAK,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,KAChC,OAAO,CAAC,QAAQ,CAGlB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,KAAK,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC,KAC9D,OAAO,CAAC,QAAQ,GAAG,IAAI,CAuBzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,IAAI,QAAQ,KAAG,OAAO,CAAC,OAAO,CAG7E,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAGrF,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,IAAI,QAAQ,EACZ,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CASjB,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateRetryAnalyzeErrorLog = exports.deleteRetryAnalyzeDocByCallSid = exports.deleteRetryAnalyzeDocById = exports.upsertRetryAnalyzeDoc = exports.insertRetryAnalyzeDoc = exports.getAllRetryAnalyzeDocs = exports.getRetryAnalyzeCollection = void 0;
4
+ const index_1 = require("../index");
5
+ const COLLECTION_NAME = "retryAnalyze";
6
+ const getRetryAnalyzeCollection = () => {
7
+ return (0, index_1.getDb)().collection(COLLECTION_NAME);
8
+ };
9
+ exports.getRetryAnalyzeCollection = getRetryAnalyzeCollection;
10
+ const getAllRetryAnalyzeDocs = async () => {
11
+ return (0, exports.getRetryAnalyzeCollection)()
12
+ .find({
13
+ $or: [{ retry: { $lt: 5 } }, { retry: { $exists: false } }],
14
+ })
15
+ .toArray();
16
+ };
17
+ exports.getAllRetryAnalyzeDocs = getAllRetryAnalyzeDocs;
18
+ const insertRetryAnalyzeDoc = async (doc) => {
19
+ const result = await (0, exports.getRetryAnalyzeCollection)().insertOne(doc);
20
+ return result.insertedId;
21
+ };
22
+ exports.insertRetryAnalyzeDoc = insertRetryAnalyzeDoc;
23
+ const upsertRetryAnalyzeDoc = async (doc) => {
24
+ const now = new Date();
25
+ const result = await (0, exports.getRetryAnalyzeCollection)().updateOne({ callSid: doc.callSid }, {
26
+ $set: {
27
+ errorLog: doc.errorLog,
28
+ updatedAt: now,
29
+ },
30
+ $setOnInsert: {
31
+ createdAt: now,
32
+ clientId: doc.clientId,
33
+ retry: 0,
34
+ },
35
+ }, { upsert: true });
36
+ if (result.matchedCount > 0) {
37
+ await (0, exports.getRetryAnalyzeCollection)().updateOne({ callSid: doc.callSid }, { $inc: { retry: 1 } });
38
+ }
39
+ return result.upsertedId || null;
40
+ };
41
+ exports.upsertRetryAnalyzeDoc = upsertRetryAnalyzeDoc;
42
+ const deleteRetryAnalyzeDocById = async (id) => {
43
+ const result = await (0, exports.getRetryAnalyzeCollection)().deleteOne({ _id: id });
44
+ return result.deletedCount === 1;
45
+ };
46
+ exports.deleteRetryAnalyzeDocById = deleteRetryAnalyzeDocById;
47
+ const deleteRetryAnalyzeDocByCallSid = async (callSid) => {
48
+ const result = await (0, exports.getRetryAnalyzeCollection)().deleteOne({ callSid });
49
+ return result.deletedCount === 1;
50
+ };
51
+ exports.deleteRetryAnalyzeDocByCallSid = deleteRetryAnalyzeDocByCallSid;
52
+ const updateRetryAnalyzeErrorLog = async (id, errorLog) => {
53
+ const result = await (0, exports.getRetryAnalyzeCollection)().updateOne({ _id: id }, {
54
+ $set: { errorLog, updatedAt: new Date() },
55
+ $inc: { retry: 1 },
56
+ });
57
+ return result.modifiedCount === 1;
58
+ };
59
+ exports.updateRetryAnalyzeErrorLog = updateRetryAnalyzeErrorLog;
60
+ //# sourceMappingURL=retryAnalyze.getters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retryAnalyze.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/retry_analyze/retryAnalyze.getters.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAGjC,MAAM,eAAe,GAAG,cAAc,CAAC;AAEhC,MAAM,yBAAyB,GAAG,GAAgC,EAAE;IACzE,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAkB,eAAe,CAAC,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC;AAEK,MAAM,sBAAsB,GAAG,KAAK,IAAmC,EAAE;IAC9E,OAAO,IAAA,iCAAyB,GAAE;SAC/B,IAAI,CAAC;QACJ,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC;KAC5D,CAAC;SACD,OAAO,EAAE,CAAC;AACf,CAAC,CAAC;AANW,QAAA,sBAAsB,0BAMjC;AAEK,MA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nC,CAAC,CAAC;AAHW,QAAA,yBAAyB,6BAGpC;AAEK,MAAM,8BAA8B,GAAG,KAAK,EAAE,OAAe,EAAoB,EAAE;IACxF,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAyB,GAAE,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC,YAAY,KAAK,CAAC,CAAC;AACnC,CAAC,CAAC;AAHW,QAAA,8BAA8B,kCAGzC;AAEK,MAAM,0BAA0B,GAAG,KAAK,EAC7C,EAAY,EACZ,QAAgB,EACE,EAAE;IACpB,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAyB,GAAE,CAAC,SAAS,CACxD,EAAE,GAAG,EAAE,EAAE,EAAE,EACX;QACE,IAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE;QACzC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;KACnB,CACF,CAAC;IACF,OAAO,MAAM,CAAC,aAAa,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC"}
@@ -0,0 +1,12 @@
1
+ import { ObjectId, WithId } from "mongodb";
2
+ export type RetryAnalyzeDoc = {
3
+ _id?: ObjectId;
4
+ callSid: string;
5
+ retry: number;
6
+ clientId: string;
7
+ errorLog: string;
8
+ updatedAt: Date;
9
+ createdAt: Date;
10
+ };
11
+ export type RetryAnalyzeWithId = WithId<RetryAnalyzeDoc>;
12
+ //# sourceMappingURL=retryAnalyze.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retryAnalyze.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/retry_analyze/retryAnalyze.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=retryAnalyze.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retryAnalyze.types.js","sourceRoot":"","sources":["../../../src/talkpilot/retry_analyze/retryAnalyze.types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talkpilot/core-db",
3
- "version": "1.1.14",
3
+ "version": "1.1.17",
4
4
  "description": "Core database package for centralized connections and ORM integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,6 +14,7 @@ export * from "./calls";
14
14
  export * from "./clientAudioBuffers";
15
15
  export * from "./clientsConfig";
16
16
  export * from "./backgroundToolResults";
17
+ export * from "./retry_analyze";
17
18
  export { mongodbClient } from "./mongodb-client";
18
19
 
19
20
  let db: Db;
@@ -1,5 +1,7 @@
1
1
  export {
2
2
  getResultsCollection,
3
3
  initializeResultDocument,
4
+ findResultById,
5
+ findResultByCallSid,
4
6
  } from "./results.getter";
5
7
  export type * from "./results.types";
@@ -1,5 +1,5 @@
1
- import type { Collection } from "mongodb";
2
- import { getDb, ObjectId, Session } from "../index";
1
+ import { Collection, ObjectId } from "mongodb";
2
+ import { getDb, Session } from "../index";
3
3
  import type { Result } from "./results.types";
4
4
 
5
5
  export const getResultsCollection = (): Collection<Result> =>
@@ -25,3 +25,11 @@ export const initializeResultDocument = async (
25
25
  if (!result) throw new Error("Failed to initialized result");
26
26
  return result;
27
27
  };
28
+
29
+ export const findResultById = async (resultId: string | ObjectId): Promise<Result | null> => {
30
+ return getResultsCollection().findOne({ _id: new ObjectId(resultId) });
31
+ };
32
+
33
+ export const findResultByCallSid = async (callSid: string): Promise<Result | null> => {
34
+ return getResultsCollection().findOne({ "calls.callSid": callSid });
35
+ };
@@ -0,0 +1,156 @@
1
+ import { describe, it, expect, beforeEach, jest } from "@jest/globals";
2
+ import { ObjectId } from "mongodb";
3
+ import {
4
+ getAllRetryAnalyzeDocs,
5
+ upsertRetryAnalyzeDoc,
6
+ insertRetryAnalyzeDoc,
7
+ updateRetryAnalyzeErrorLog,
8
+ } from "../retryAnalyze.getters";
9
+ import { setDb } from "../../index";
10
+ import { RetryAnalyzeDoc } from "../retryAnalyze.types";
11
+
12
+ describe("retryAnalyze.getters", () => {
13
+ let mockCollection: any;
14
+ let mockDb: any;
15
+
16
+ beforeEach(() => {
17
+ mockCollection = {
18
+ find: jest.fn().mockReturnThis(),
19
+ toArray: jest.fn(),
20
+ insertOne: jest.fn(),
21
+ updateOne: jest.fn(),
22
+ deleteOne: jest.fn(),
23
+ };
24
+ mockDb = {
25
+ collection: jest.fn().mockReturnValue(mockCollection),
26
+ };
27
+ setDb(mockDb as any);
28
+ });
29
+
30
+ describe("getAllRetryAnalyzeDocs", () => {
31
+ it("should filter documents with retry >= 5 and include old format docs", async () => {
32
+ const mockDocs = [
33
+ { _id: new ObjectId(), callSid: "old-doc", errorLog: "{}" },
34
+ { _id: new ObjectId(), callSid: "retry-1", errorLog: "{}", retry: 1 },
35
+ { _id: new ObjectId(), callSid: "retry-5", errorLog: "{}", retry: 5 },
36
+ ];
37
+
38
+ mockCollection.toArray.mockResolvedValue(mockDocs);
39
+
40
+ await getAllRetryAnalyzeDocs();
41
+
42
+ expect(mockCollection.find).toHaveBeenCalledWith({
43
+ $or: [{ retry: { $lt: 5 } }, { retry: { $exists: false } }],
44
+ });
45
+ });
46
+ });
47
+
48
+ describe("upsertRetryAnalyzeDoc", () => {
49
+ const error429 = JSON.stringify({
50
+ error: {
51
+ code: 429,
52
+ message: "Resource exhausted. Please try again later.",
53
+ status: "RESOURCE_EXHAUSTED",
54
+ },
55
+ });
56
+
57
+ it("should upsert document correctly with $setOnInsert for clientId and createdAt", async () => {
58
+ const doc = {
59
+ callSid: "call-123",
60
+ errorLog: error429,
61
+ clientId: "client-1",
62
+ };
63
+
64
+ mockCollection.updateOne.mockResolvedValue({
65
+ upsertedId: new ObjectId(),
66
+ matchedCount: 0,
67
+ });
68
+
69
+ await upsertRetryAnalyzeDoc(doc);
70
+
71
+ expect(mockCollection.updateOne).toHaveBeenCalledWith(
72
+ { callSid: doc.callSid },
73
+ expect.objectContaining({
74
+ $set: expect.objectContaining({
75
+ errorLog: doc.errorLog,
76
+ updatedAt: expect.any(Date),
77
+ }),
78
+ $setOnInsert: expect.objectContaining({
79
+ createdAt: expect.any(Date),
80
+ clientId: doc.clientId,
81
+ retry: 0,
82
+ }),
83
+ }),
84
+ { upsert: true },
85
+ );
86
+ });
87
+
88
+ it("should ensure only one document exists for the same callSid even on multiple failures", async () => {
89
+ const doc = {
90
+ callSid: "CA_SINGLE_DOC",
91
+ errorLog: error429,
92
+ clientId: "client-1",
93
+ };
94
+
95
+ mockCollection.updateOne
96
+ .mockResolvedValueOnce({ upsertedId: new ObjectId(), matchedCount: 0 })
97
+ .mockResolvedValueOnce({ upsertedId: null, matchedCount: 1 });
98
+
99
+ await upsertRetryAnalyzeDoc(doc);
100
+ await upsertRetryAnalyzeDoc(doc);
101
+
102
+ expect(mockCollection.updateOne).toHaveBeenCalledWith(
103
+ { callSid: doc.callSid },
104
+ expect.objectContaining({
105
+ $setOnInsert: expect.objectContaining({ retry: 0 }),
106
+ }),
107
+ { upsert: true },
108
+ );
109
+
110
+ expect(mockCollection.updateOne).toHaveBeenLastCalledWith(
111
+ { callSid: doc.callSid },
112
+ { $inc: { retry: 1 } },
113
+ );
114
+ });
115
+ });
116
+
117
+ describe("insertRetryAnalyzeDoc", () => {
118
+ it("should perform a simple insert", async () => {
119
+ const doc: Omit<RetryAnalyzeDoc, "_id"> = {
120
+ callSid: "call-456",
121
+ retry: 0,
122
+ clientId: "client-2",
123
+ errorLog: "err",
124
+ updatedAt: new Date(),
125
+ createdAt: new Date(),
126
+ };
127
+
128
+ mockCollection.insertOne.mockResolvedValue({
129
+ insertedId: new ObjectId(),
130
+ });
131
+
132
+ await insertRetryAnalyzeDoc(doc);
133
+
134
+ expect(mockCollection.insertOne).toHaveBeenCalledWith(doc);
135
+ });
136
+ });
137
+
138
+ describe("updateRetryAnalyzeErrorLog", () => {
139
+ it("should update errorLog, updatedAt and increment retry", async () => {
140
+ const id = new ObjectId();
141
+ const errorLog = "new retry error";
142
+
143
+ mockCollection.updateOne.mockResolvedValue({ modifiedCount: 1 });
144
+
145
+ await updateRetryAnalyzeErrorLog(id, errorLog);
146
+
147
+ expect(mockCollection.updateOne).toHaveBeenCalledWith(
148
+ { _id: id },
149
+ {
150
+ $set: { errorLog, updatedAt: expect.any(Date) },
151
+ $inc: { retry: 1 },
152
+ },
153
+ );
154
+ });
155
+ });
156
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./retryAnalyze.types";
2
+ export * from "./retryAnalyze.getters";
@@ -0,0 +1,75 @@
1
+ import { Collection, ObjectId } from "mongodb";
2
+ import { getDb } from "../index";
3
+ import type { RetryAnalyzeDoc, RetryAnalyzeWithId } from "./retryAnalyze.types";
4
+
5
+ const COLLECTION_NAME = "retryAnalyze";
6
+
7
+ export const getRetryAnalyzeCollection = (): Collection<RetryAnalyzeDoc> => {
8
+ return getDb().collection<RetryAnalyzeDoc>(COLLECTION_NAME);
9
+ };
10
+
11
+ export const getAllRetryAnalyzeDocs = async (): Promise<RetryAnalyzeWithId[]> => {
12
+ return getRetryAnalyzeCollection()
13
+ .find({
14
+ $or: [{ retry: { $lt: 5 } }, { retry: { $exists: false } }],
15
+ })
16
+ .toArray();
17
+ };
18
+
19
+ export const insertRetryAnalyzeDoc = async (
20
+ doc: Omit<RetryAnalyzeDoc, "_id">,
21
+ ): Promise<ObjectId> => {
22
+ const result = await getRetryAnalyzeCollection().insertOne(doc);
23
+ return result.insertedId;
24
+ };
25
+
26
+ export const upsertRetryAnalyzeDoc = async (
27
+ doc: Pick<RetryAnalyzeDoc, "callSid" | "errorLog" | "clientId">,
28
+ ): Promise<ObjectId | null> => {
29
+ const now = new Date();
30
+ const result = await getRetryAnalyzeCollection().updateOne(
31
+ { callSid: doc.callSid },
32
+ {
33
+ $set: {
34
+ errorLog: doc.errorLog,
35
+ updatedAt: now,
36
+ },
37
+ $setOnInsert: {
38
+ createdAt: now,
39
+ clientId: doc.clientId,
40
+ retry: 0,
41
+ },
42
+ },
43
+ { upsert: true },
44
+ );
45
+
46
+ if (result.matchedCount > 0) {
47
+ await getRetryAnalyzeCollection().updateOne({ callSid: doc.callSid }, { $inc: { retry: 1 } });
48
+ }
49
+
50
+ return result.upsertedId || null;
51
+ };
52
+
53
+ export const deleteRetryAnalyzeDocById = async (id: ObjectId): Promise<boolean> => {
54
+ const result = await getRetryAnalyzeCollection().deleteOne({ _id: id });
55
+ return result.deletedCount === 1;
56
+ };
57
+
58
+ export const deleteRetryAnalyzeDocByCallSid = async (callSid: string): Promise<boolean> => {
59
+ const result = await getRetryAnalyzeCollection().deleteOne({ callSid });
60
+ return result.deletedCount === 1;
61
+ };
62
+
63
+ export const updateRetryAnalyzeErrorLog = async (
64
+ id: ObjectId,
65
+ errorLog: string,
66
+ ): Promise<boolean> => {
67
+ const result = await getRetryAnalyzeCollection().updateOne(
68
+ { _id: id },
69
+ {
70
+ $set: { errorLog, updatedAt: new Date() },
71
+ $inc: { retry: 1 },
72
+ },
73
+ );
74
+ return result.modifiedCount === 1;
75
+ };
@@ -0,0 +1,13 @@
1
+ import { ObjectId, WithId } from "mongodb";
2
+
3
+ export type RetryAnalyzeDoc = {
4
+ _id?: ObjectId;
5
+ callSid: string;
6
+ retry: number;
7
+ clientId: string;
8
+ errorLog: string;
9
+ updatedAt: Date;
10
+ createdAt: Date;
11
+ };
12
+
13
+ export type RetryAnalyzeWithId = WithId<RetryAnalyzeDoc>;