@talkpilot/core-db 1.3.52 → 1.3.53
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.
- package/README.md +2 -21
- package/dist/talkpilot/calls/calls.constants.d.ts +1 -1
- package/dist/talkpilot/clients/clients.getters.d.ts +0 -1
- package/dist/talkpilot/clients/clients.getters.d.ts.map +1 -1
- package/dist/talkpilot/clients/clients.getters.js +1 -8
- package/dist/talkpilot/clients/clients.getters.js.map +1 -1
- package/dist/talkpilot/clients/clients.types.d.ts +0 -21
- package/dist/talkpilot/clients/clients.types.d.ts.map +1 -1
- package/dist/talkpilot/clients/index.d.ts +0 -2
- package/dist/talkpilot/clients/index.d.ts.map +1 -1
- package/dist/talkpilot/clients/index.js +0 -2
- package/dist/talkpilot/clients/index.js.map +1 -1
- package/dist/talkpilot/flows/flows.getter.d.ts +4 -1
- package/dist/talkpilot/flows/flows.getter.d.ts.map +1 -1
- package/dist/talkpilot/flows/flows.getter.js +12 -1
- package/dist/talkpilot/flows/flows.getter.js.map +1 -1
- package/dist/talkpilot/flows/flows.schema.d.ts +31 -0
- package/dist/talkpilot/flows/flows.schema.d.ts.map +1 -1
- package/dist/talkpilot/flows/flows.schema.js +25 -0
- package/dist/talkpilot/flows/flows.schema.js.map +1 -1
- package/dist/talkpilot/flows/flows.types.d.ts +14 -0
- package/dist/talkpilot/flows/flows.types.d.ts.map +1 -1
- package/dist/talkpilot/flows/index.d.ts +1 -1
- package/dist/talkpilot/flows/index.d.ts.map +1 -1
- package/dist/talkpilot/flows/index.js +3 -1
- package/dist/talkpilot/flows/index.js.map +1 -1
- package/dist/talkpilot/index.d.ts +0 -1
- package/dist/talkpilot/index.d.ts.map +1 -1
- package/dist/talkpilot/index.js +0 -1
- package/dist/talkpilot/index.js.map +1 -1
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.d.ts +0 -11
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.d.ts.map +1 -1
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.js +1 -60
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.js.map +1 -1
- package/dist/talkpilot/results/index.d.ts +0 -3
- package/dist/talkpilot/results/index.d.ts.map +1 -1
- package/dist/talkpilot/results/index.js +1 -22
- package/dist/talkpilot/results/index.js.map +1 -1
- package/dist/talkpilot/results/results.getter.d.ts.map +1 -1
- package/dist/talkpilot/results/results.getter.js +2 -3
- package/dist/talkpilot/results/results.getter.js.map +1 -1
- package/dist/test-utils/factories/index.d.ts +0 -2
- package/dist/test-utils/factories/index.d.ts.map +1 -1
- package/dist/test-utils/factories/index.js +0 -2
- package/dist/test-utils/factories/index.js.map +1 -1
- package/dist/websitalk/scanResources/scanResources.getters.d.ts +1 -0
- package/dist/websitalk/scanResources/scanResources.getters.d.ts.map +1 -1
- package/dist/websitalk/scanResources/scanResources.getters.js +6 -1
- package/dist/websitalk/scanResources/scanResources.getters.js.map +1 -1
- package/dist/websitalk/scans/scans.constants.d.ts +3 -1
- package/dist/websitalk/scans/scans.constants.d.ts.map +1 -1
- package/dist/websitalk/scans/scans.constants.js +3 -0
- package/dist/websitalk/scans/scans.constants.js.map +1 -1
- package/dist/websitalk/scans/scans.getters.d.ts +1 -0
- package/dist/websitalk/scans/scans.getters.d.ts.map +1 -1
- package/dist/websitalk/scans/scans.getters.js +6 -1
- package/dist/websitalk/scans/scans.getters.js.map +1 -1
- package/package.json +1 -1
- package/src/talkpilot/clients/clients.getters.ts +0 -7
- package/src/talkpilot/clients/clients.types.ts +0 -19
- package/src/talkpilot/clients/index.ts +0 -2
- package/src/talkpilot/flows/__tests__/flows.schema.spec.ts +25 -0
- package/src/talkpilot/flows/flows.getter.ts +22 -2
- package/src/talkpilot/flows/flows.schema.ts +25 -0
- package/src/talkpilot/flows/flows.types.ts +22 -0
- package/src/talkpilot/flows/index.ts +6 -1
- package/src/talkpilot/index.ts +0 -1
- package/src/talkpilot/phone_numbers/__tests__/phone_numbers.spec.ts +13 -227
- package/src/talkpilot/phone_numbers/phone_numbers.getter.ts +1 -76
- package/src/talkpilot/results/index.ts +0 -9
- package/src/talkpilot/results/results.getter.ts +2 -3
- package/src/test-utils/factories/index.ts +0 -2
- package/src/websitalk/scanResources/__tests__/scanResources.spec.ts +19 -0
- package/src/websitalk/scanResources/scanResources.getters.ts +7 -0
- package/src/websitalk/scans/__tests__/scans.spec.ts +28 -0
- package/src/websitalk/scans/scans.constants.ts +3 -0
- package/src/websitalk/scans/scans.getters.ts +5 -0
- package/dist/talkpilot/auditLogs/auditLogs.getters.d.ts +0 -8
- package/dist/talkpilot/auditLogs/auditLogs.getters.d.ts.map +0 -1
- package/dist/talkpilot/auditLogs/auditLogs.getters.js +0 -26
- package/dist/talkpilot/auditLogs/auditLogs.getters.js.map +0 -1
- package/dist/talkpilot/auditLogs/auditLogs.setters.d.ts +0 -3
- package/dist/talkpilot/auditLogs/auditLogs.setters.d.ts.map +0 -1
- package/dist/talkpilot/auditLogs/auditLogs.setters.js +0 -9
- package/dist/talkpilot/auditLogs/auditLogs.setters.js.map +0 -1
- package/dist/talkpilot/auditLogs/auditLogs.types.d.ts +0 -12
- package/dist/talkpilot/auditLogs/auditLogs.types.d.ts.map +0 -1
- package/dist/talkpilot/auditLogs/auditLogs.types.js +0 -3
- package/dist/talkpilot/auditLogs/auditLogs.types.js.map +0 -1
- package/dist/talkpilot/auditLogs/index.d.ts +0 -3
- package/dist/talkpilot/auditLogs/index.d.ts.map +0 -1
- package/dist/talkpilot/auditLogs/index.js +0 -19
- package/dist/talkpilot/auditLogs/index.js.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.d.ts +0 -4
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.d.ts.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.js +0 -9
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.js.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.d.ts +0 -3
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.d.ts.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.js +0 -9
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.js.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.d.ts +0 -10
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.d.ts.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.js +0 -3
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.js.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/index.d.ts +0 -4
- package/dist/talkpilot/clientDeletionLogs/index.d.ts.map +0 -1
- package/dist/talkpilot/clientDeletionLogs/index.js +0 -20
- package/dist/talkpilot/clientDeletionLogs/index.js.map +0 -1
- package/dist/talkpilot/clients/clients.constants.d.ts +0 -3
- package/dist/talkpilot/clients/clients.constants.d.ts.map +0 -1
- package/dist/talkpilot/clients/clients.constants.js +0 -6
- package/dist/talkpilot/clients/clients.constants.js.map +0 -1
- package/dist/talkpilot/clients/clients.lifecycle.d.ts +0 -10
- package/dist/talkpilot/clients/clients.lifecycle.d.ts.map +0 -1
- package/dist/talkpilot/clients/clients.lifecycle.js +0 -95
- package/dist/talkpilot/clients/clients.lifecycle.js.map +0 -1
- package/dist/talkpilot/results/results.constants.d.ts +0 -9
- package/dist/talkpilot/results/results.constants.d.ts.map +0 -1
- package/dist/talkpilot/results/results.constants.js +0 -12
- package/dist/talkpilot/results/results.constants.js.map +0 -1
- package/dist/talkpilot/results/results.statistics.getters.d.ts +0 -7
- package/dist/talkpilot/results/results.statistics.getters.d.ts.map +0 -1
- package/dist/talkpilot/results/results.statistics.getters.js +0 -244
- package/dist/talkpilot/results/results.statistics.getters.js.map +0 -1
- package/dist/talkpilot/results/results.statistics.types.d.ts +0 -42
- package/dist/talkpilot/results/results.statistics.types.d.ts.map +0 -1
- package/dist/talkpilot/results/results.statistics.types.js +0 -3
- package/dist/talkpilot/results/results.statistics.types.js.map +0 -1
- package/dist/test-utils/factories/talkpilot/clients.d.ts +0 -14
- package/dist/test-utils/factories/talkpilot/clients.d.ts.map +0 -1
- package/dist/test-utils/factories/talkpilot/clients.js +0 -19
- package/dist/test-utils/factories/talkpilot/clients.js.map +0 -1
- package/dist/test-utils/factories/talkpilot/results.d.ts +0 -16
- package/dist/test-utils/factories/talkpilot/results.d.ts.map +0 -1
- package/dist/test-utils/factories/talkpilot/results.js +0 -40
- package/dist/test-utils/factories/talkpilot/results.js.map +0 -1
- package/src/talkpilot/auditLogs/__tests__/auditLogs.spec.ts +0 -92
- package/src/talkpilot/auditLogs/auditLogs.getters.ts +0 -26
- package/src/talkpilot/auditLogs/auditLogs.types.ts +0 -13
- package/src/talkpilot/auditLogs/index.ts +0 -2
- package/src/talkpilot/clients/__tests__/clients.getters.spec.ts +0 -33
- package/src/talkpilot/clients/__tests__/clients.lifecycle.spec.ts +0 -166
- package/src/talkpilot/clients/clients.constants.ts +0 -2
- package/src/talkpilot/clients/clients.lifecycle.ts +0 -116
- package/src/talkpilot/results/__tests__/results.statistics.spec.ts +0 -226
- package/src/talkpilot/results/results.constants.ts +0 -11
- package/src/talkpilot/results/results.statistics.getters.ts +0 -329
- package/src/talkpilot/results/results.statistics.types.ts +0 -45
- package/src/test-utils/factories/talkpilot/clients.ts +0 -21
- package/src/test-utils/factories/talkpilot/results.ts +0 -43
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auditLogs.types.js","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
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("./auditLogs.types"), exports);
|
|
18
|
-
__exportStar(require("./auditLogs.getters"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientDeletionLogs.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,eAAO,MAAM,+BAA+B,QACtC,UAAU,CAAC,sBAAsB,CAEpC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getClientDeletionLogsCollection = void 0;
|
|
4
|
-
const index_1 = require("../index");
|
|
5
|
-
const getClientDeletionLogsCollection = () => {
|
|
6
|
-
return (0, index_1.getDb)().collection("clientDeletionLogs");
|
|
7
|
-
};
|
|
8
|
-
exports.getClientDeletionLogsCollection = getClientDeletionLogsCollection;
|
|
9
|
-
//# sourceMappingURL=clientDeletionLogs.getters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientDeletionLogs.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAG1B,MAAM,+BAA+B,GAC1C,GAAuC,EAAE;IACvC,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAyB,oBAAoB,CAAC,CAAC;AAC1E,CAAC,CAAC;AAHS,QAAA,+BAA+B,mCAGxC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientDeletionLogs.setters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,eAAO,MAAM,cAAc,GACzB,OAAO,sBAAsB,KAC5B,OAAO,CAAC,IAAI,CAEd,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertAuditLog = void 0;
|
|
4
|
-
const clientDeletionLogs_getters_1 = require("./clientDeletionLogs.getters");
|
|
5
|
-
const insertAuditLog = async (entry) => {
|
|
6
|
-
await (0, clientDeletionLogs_getters_1.getClientDeletionLogsCollection)().insertOne(entry);
|
|
7
|
-
};
|
|
8
|
-
exports.insertAuditLog = insertAuditLog;
|
|
9
|
-
//# sourceMappingURL=clientDeletionLogs.setters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientDeletionLogs.setters.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.ts"],"names":[],"mappings":";;;AAAA,6EAA+E;AAGxE,MAAM,cAAc,GAAG,KAAK,EACjC,KAA6B,EACd,EAAE;IACjB,MAAM,IAAA,4DAA+B,GAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAC;AAJW,QAAA,cAAc,kBAIzB"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WithId } from "mongodb";
|
|
2
|
-
export type ClientDeletionLogEntry = {
|
|
3
|
-
clientId: string;
|
|
4
|
-
adminEmail: string;
|
|
5
|
-
action: "delete";
|
|
6
|
-
timestamp: Date;
|
|
7
|
-
env?: string;
|
|
8
|
-
};
|
|
9
|
-
export type ClientDeletionLogDoc = WithId<ClientDeletionLogEntry>;
|
|
10
|
-
//# sourceMappingURL=clientDeletionLogs.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientDeletionLogs.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clientDeletionLogs.types.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
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("./clientDeletionLogs.types"), exports);
|
|
18
|
-
__exportStar(require("./clientDeletionLogs.getters"), exports);
|
|
19
|
-
__exportStar(require("./clientDeletionLogs.setters"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,+DAA6C;AAC7C,+DAA6C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.constants.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.constants.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,eAAO,MAAM,eAAe,EAAE,MAAM,EAAkB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DELETE_DENYLIST = void 0;
|
|
4
|
-
/** Collections to always skip during client deletion — e.g. auditLogs, which must survive it. */
|
|
5
|
-
exports.DELETE_DENYLIST = ["auditLogs"];
|
|
6
|
-
//# sourceMappingURL=clients.constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.constants.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.constants.ts"],"names":[],"mappings":";;;AAAA,iGAAiG;AACpF,QAAA,eAAe,GAAa,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DeleteClientDataSummary } from "./clients.types";
|
|
2
|
-
export declare const clientExistsInAnyCollection: (clientId: string) => Promise<boolean>;
|
|
3
|
-
/**
|
|
4
|
-
* Deletes a client's data across talkpilot/municipal collections and logs the action.
|
|
5
|
-
*
|
|
6
|
-
* ⚠️ Does NOT delete website-talk data — `scans`/`websiteUrls` are the lookup key an
|
|
7
|
-
* external API needs to clean up that domain. Callers must invoke that API separately.
|
|
8
|
-
*/
|
|
9
|
-
export declare const deleteClientDataAcrossDomains: (clientId: string, adminEmail: string) => Promise<DeleteClientDataSummary>;
|
|
10
|
-
//# sourceMappingURL=clients.lifecycle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.lifecycle.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.lifecycle.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAoBzB,eAAO,MAAM,2BAA2B,GACtC,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CAMjB,CAAC;AAgCF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,MAAM,EAChB,YAAY,MAAM,KACjB,OAAO,CAAC,uBAAuB,CAsCjC,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteClientDataAcrossDomains = exports.clientExistsInAnyCollection = void 0;
|
|
4
|
-
const index_1 = require("../index");
|
|
5
|
-
const municipal_1 = require("../../municipal");
|
|
6
|
-
const clients_constants_1 = require("./clients.constants");
|
|
7
|
-
// Skips websitalk on purpose — see the warning on `deleteClientDataAcrossDomains` below.
|
|
8
|
-
const findClientMatchInDb = async (db, clientId) => {
|
|
9
|
-
const collections = await db.listCollections().toArray();
|
|
10
|
-
return Promise.all(collections
|
|
11
|
-
.filter((c) => !clients_constants_1.DELETE_DENYLIST.includes(c.name))
|
|
12
|
-
.map(async (c) => {
|
|
13
|
-
const doc = await db
|
|
14
|
-
.collection(c.name)
|
|
15
|
-
.findOne({ $or: [{ clientId }, { client_id: clientId }] });
|
|
16
|
-
return { collectionName: c.name, matched: !!doc };
|
|
17
|
-
}));
|
|
18
|
-
};
|
|
19
|
-
const clientExistsInAnyCollection = async (clientId) => {
|
|
20
|
-
const [talkpilotResults, municipalResults] = await Promise.all([
|
|
21
|
-
findClientMatchInDb((0, index_1.getDb)(), clientId),
|
|
22
|
-
findClientMatchInDb((0, municipal_1.getDb)(), clientId),
|
|
23
|
-
]);
|
|
24
|
-
return [...talkpilotResults, ...municipalResults].some((r) => r.matched);
|
|
25
|
-
};
|
|
26
|
-
exports.clientExistsInAnyCollection = clientExistsInAnyCollection;
|
|
27
|
-
const deleteClientFromDb = async (db, clientId) => {
|
|
28
|
-
const collections = await db.listCollections().toArray();
|
|
29
|
-
return Promise.all(collections
|
|
30
|
-
.filter((c) => !clients_constants_1.DELETE_DENYLIST.includes(c.name))
|
|
31
|
-
.map(async (c) => {
|
|
32
|
-
try {
|
|
33
|
-
const result = await db
|
|
34
|
-
.collection(c.name)
|
|
35
|
-
.deleteMany({ $or: [{ clientId }, { client_id: clientId }] });
|
|
36
|
-
return {
|
|
37
|
-
collectionName: c.name,
|
|
38
|
-
deletedCount: result.deletedCount,
|
|
39
|
-
success: true,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
return {
|
|
44
|
-
collectionName: c.name,
|
|
45
|
-
deletedCount: 0,
|
|
46
|
-
success: false,
|
|
47
|
-
error: error instanceof Error ? error.message : String(error),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}));
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Deletes a client's data across talkpilot/municipal collections and logs the action.
|
|
54
|
-
*
|
|
55
|
-
* ⚠️ Does NOT delete website-talk data — `scans`/`websiteUrls` are the lookup key an
|
|
56
|
-
* external API needs to clean up that domain. Callers must invoke that API separately.
|
|
57
|
-
*/
|
|
58
|
-
const deleteClientDataAcrossDomains = async (clientId, adminEmail) => {
|
|
59
|
-
const exists = await (0, exports.clientExistsInAnyCollection)(clientId);
|
|
60
|
-
if (!exists) {
|
|
61
|
-
return {
|
|
62
|
-
clientId,
|
|
63
|
-
deleted: false,
|
|
64
|
-
reason: "Client does not exist in any collection",
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
const [talkpilotResults, municipalResults] = await Promise.all([
|
|
68
|
-
deleteClientFromDb((0, index_1.getDb)(), clientId),
|
|
69
|
-
deleteClientFromDb((0, municipal_1.getDb)(), clientId),
|
|
70
|
-
]);
|
|
71
|
-
const results = [...talkpilotResults, ...municipalResults];
|
|
72
|
-
const allSucceeded = results.every((r) => r.success);
|
|
73
|
-
await (0, index_1.insertAuditLog)({
|
|
74
|
-
clientId,
|
|
75
|
-
adminEmail,
|
|
76
|
-
action: "delete",
|
|
77
|
-
timestamp: new Date(),
|
|
78
|
-
allSucceeded,
|
|
79
|
-
...(allSucceeded
|
|
80
|
-
? {}
|
|
81
|
-
: {
|
|
82
|
-
failedCollections: results
|
|
83
|
-
.filter((r) => !r.success)
|
|
84
|
-
.map((r) => r.collectionName),
|
|
85
|
-
}),
|
|
86
|
-
});
|
|
87
|
-
return {
|
|
88
|
-
clientId,
|
|
89
|
-
deleted: true,
|
|
90
|
-
results,
|
|
91
|
-
allSucceeded,
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
exports.deleteClientDataAcrossDomains = deleteClientDataAcrossDomains;
|
|
95
|
-
//# sourceMappingURL=clients.lifecycle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.lifecycle.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.lifecycle.ts"],"names":[],"mappings":";;;AACA,oCAAiD;AACjD,+CAA8D;AAC9D,2DAAsD;AAOtD,yFAAyF;AACzF,MAAM,mBAAmB,GAAG,KAAK,EAC/B,EAAM,EACN,QAAgB,EACY,EAAE;IAC9B,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC;IACzD,OAAO,OAAO,CAAC,GAAG,CAChB,WAAW;SACR,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,mCAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SAChD,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACf,MAAM,GAAG,GAAG,MAAM,EAAE;aACjB,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;aAClB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QAC7D,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;IACpD,CAAC,CAA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C,CAAC,CAAC,CAAC,OAAO,CAAC;qBACzB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;aAChC,CAAC;KACP,CAAC,CAAC;IAEH,OAAO;QACL,QAAQ;QACR,OAAO,EAAE,IAAI;QACb,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,6BAA6B,iCAyCxC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** sessionId used for calls that arrived without an existing session (incoming calls). */
|
|
2
|
-
export declare const INCOMING_SESSION_ID = "incomingCall";
|
|
3
|
-
/** Twilio call statuses considered "currently active" for the live calls summary. */
|
|
4
|
-
export declare const ACTIVE_STATUSES: string[];
|
|
5
|
-
/** Lookback window for the "active calls right now" summary. */
|
|
6
|
-
export declare const ACTIVE_CALLS_WINDOW_MS: number;
|
|
7
|
-
/** Max rows returned by the per-session call stats breakdown. */
|
|
8
|
-
export declare const SESSION_STATS_LIMIT = 20;
|
|
9
|
-
//# sourceMappingURL=results.constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.constants.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/results.constants.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,qFAAqF;AACrF,eAAO,MAAM,eAAe,UAAkB,CAAC;AAE/C,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,QAAqB,CAAC;AAEzD,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,KAAK,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SESSION_STATS_LIMIT = exports.ACTIVE_CALLS_WINDOW_MS = exports.ACTIVE_STATUSES = exports.INCOMING_SESSION_ID = void 0;
|
|
4
|
-
/** sessionId used for calls that arrived without an existing session (incoming calls). */
|
|
5
|
-
exports.INCOMING_SESSION_ID = "incomingCall";
|
|
6
|
-
/** Twilio call statuses considered "currently active" for the live calls summary. */
|
|
7
|
-
exports.ACTIVE_STATUSES = ["in-progress"];
|
|
8
|
-
/** Lookback window for the "active calls right now" summary. */
|
|
9
|
-
exports.ACTIVE_CALLS_WINDOW_MS = 2 * 60 * 60 * 1000;
|
|
10
|
-
/** Max rows returned by the per-session call stats breakdown. */
|
|
11
|
-
exports.SESSION_STATS_LIMIT = 20;
|
|
12
|
-
//# sourceMappingURL=results.constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.constants.js","sourceRoot":"","sources":["../../../src/talkpilot/results/results.constants.ts"],"names":[],"mappings":";;;AAAA,0FAA0F;AAC7E,QAAA,mBAAmB,GAAG,cAAc,CAAC;AAElD,qFAAqF;AACxE,QAAA,eAAe,GAAG,CAAC,aAAa,CAAC,CAAC;AAE/C,gEAAgE;AACnD,QAAA,sBAAsB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzD,iEAAiE;AACpD,QAAA,mBAAmB,GAAG,EAAE,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { StatsDateRangeParams, ActiveCallsSummary, TodayCallsSummary, ClientCallStats, SessionCallStats } from "./results.statistics.types";
|
|
2
|
-
export declare const aggregateActiveCallsSummary: (clientId?: string) => Promise<ActiveCallsSummary>;
|
|
3
|
-
export declare const aggregateTodayCallsSummary: ({ dateFrom, dateTo, clientId, timezone, }: StatsDateRangeParams) => Promise<TodayCallsSummary>;
|
|
4
|
-
export declare const aggregateClientCallStats: ({ dateFrom, dateTo, clientId, timezone, }: StatsDateRangeParams) => Promise<ClientCallStats[]>;
|
|
5
|
-
export declare const aggregateSessionCallStats: ({ dateFrom, dateTo, clientId, timezone, }: StatsDateRangeParams) => Promise<SessionCallStats[]>;
|
|
6
|
-
export declare const findClientIdsByCallSids: (callSids: string[]) => Promise<Map<string, string>>;
|
|
7
|
-
//# sourceMappingURL=results.statistics.getters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.statistics.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/results.statistics.getters.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AA0DpC,eAAO,MAAM,2BAA2B,GACtC,WAAW,MAAM,KAChB,OAAO,CAAC,kBAAkB,CA0E5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAU,2CAK9C,oBAAoB,KAAG,OAAO,CAAC,iBAAiB,CA+DlD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAU,2CAK5C,oBAAoB,KAAG,OAAO,CAAC,eAAe,EAAE,CAyClD,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,2CAK7C,oBAAoB,KAAG,OAAO,CAAC,gBAAgB,EAAE,CAkCnD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAAE,KACjB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAa7B,CAAC"}
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findClientIdsByCallSids = exports.aggregateSessionCallStats = exports.aggregateClientCallStats = exports.aggregateTodayCallsSummary = exports.aggregateActiveCallsSummary = void 0;
|
|
4
|
-
const results_getter_1 = require("./results.getter");
|
|
5
|
-
const date_utils_1 = require("../../utils/date.utils");
|
|
6
|
-
const results_constants_1 = require("./results.constants");
|
|
7
|
-
const dateRangeFilter = (dateFrom, dateTo, timezone) => {
|
|
8
|
-
const today = (0, date_utils_1.formatYmdInTz)(new Date(), timezone);
|
|
9
|
-
return {
|
|
10
|
-
start: (0, date_utils_1.startOfCalendarDayInTz)(dateFrom ?? today, timezone),
|
|
11
|
-
end: (0, date_utils_1.endOfCalendarDayInTz)(dateTo ?? today, timezone),
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
const buildDateRangeMatch = (start, end, clientId) => {
|
|
15
|
-
const clientFilter = clientId ? { clientId } : {};
|
|
16
|
-
return { ...clientFilter, "calls.date": { $gte: start, $lte: end } };
|
|
17
|
-
};
|
|
18
|
-
// Filters on `clientId` (a document-level field) before `$unwind` explodes `calls[]`,
|
|
19
|
-
// so Mongo never has to unwind documents belonging to other clients.
|
|
20
|
-
const clientPreMatchStage = (clientId) => clientId ? [{ $match: { clientId } }] : [];
|
|
21
|
-
// Converts a duration string like "120 seconds" into a number (120) that can be summed inside an aggregation.
|
|
22
|
-
const durationExpr = {
|
|
23
|
-
$convert: {
|
|
24
|
-
input: {
|
|
25
|
-
$arrayElemAt: [
|
|
26
|
-
{ $split: [{ $ifNull: ["$calls.callLength", "0 seconds"] }, " "] },
|
|
27
|
-
0,
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
to: "double",
|
|
31
|
-
onError: 0,
|
|
32
|
-
onNull: 0,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
const statusFields = {
|
|
36
|
-
totalCalls: { $sum: 1 },
|
|
37
|
-
completed: {
|
|
38
|
-
$sum: { $cond: [{ $eq: ["$calls.status", "completed"] }, 1, 0] },
|
|
39
|
-
},
|
|
40
|
-
failed: { $sum: { $cond: [{ $eq: ["$calls.status", "failed"] }, 1, 0] } },
|
|
41
|
-
noAnswer: {
|
|
42
|
-
$sum: { $cond: [{ $eq: ["$calls.status", "no-answer"] }, 1, 0] },
|
|
43
|
-
},
|
|
44
|
-
busy: { $sum: { $cond: [{ $eq: ["$calls.status", "busy"] }, 1, 0] } },
|
|
45
|
-
inProgress: {
|
|
46
|
-
$sum: { $cond: [{ $eq: ["$calls.status", "in-progress"] }, 1, 0] },
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
const aggregateActiveCallsSummary = async (clientId) => {
|
|
50
|
-
const coll = (0, results_getter_1.getResultsCollection)();
|
|
51
|
-
const twoHoursAgo = new Date(Date.now() - results_constants_1.ACTIVE_CALLS_WINDOW_MS);
|
|
52
|
-
const activeMatch = {
|
|
53
|
-
"calls.status": { $in: results_constants_1.ACTIVE_STATUSES },
|
|
54
|
-
"calls.date": { $gte: twoHoursAgo },
|
|
55
|
-
};
|
|
56
|
-
const facetResult = await coll
|
|
57
|
-
.aggregate([
|
|
58
|
-
...clientPreMatchStage(clientId),
|
|
59
|
-
{ $match: { "calls.date": { $gte: twoHoursAgo } } },
|
|
60
|
-
{ $unwind: "$calls" },
|
|
61
|
-
{ $match: activeMatch },
|
|
62
|
-
{
|
|
63
|
-
$facet: {
|
|
64
|
-
counts: [
|
|
65
|
-
{
|
|
66
|
-
$group: {
|
|
67
|
-
_id: null,
|
|
68
|
-
total: { $addToSet: "$calls.callSid" },
|
|
69
|
-
incoming: {
|
|
70
|
-
$addToSet: {
|
|
71
|
-
$cond: [
|
|
72
|
-
{ $eq: ["$sessionId", results_constants_1.INCOMING_SESSION_ID] },
|
|
73
|
-
"$calls.callSid",
|
|
74
|
-
null,
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
outgoing: {
|
|
79
|
-
$addToSet: {
|
|
80
|
-
$cond: [
|
|
81
|
-
{ $ne: ["$sessionId", results_constants_1.INCOMING_SESSION_ID] },
|
|
82
|
-
"$calls.callSid",
|
|
83
|
-
null,
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
$project: {
|
|
91
|
-
_id: 0,
|
|
92
|
-
total: { $size: "$total" },
|
|
93
|
-
incoming: {
|
|
94
|
-
$size: { $setDifference: ["$incoming", [null]] },
|
|
95
|
-
},
|
|
96
|
-
outgoing: {
|
|
97
|
-
$size: { $setDifference: ["$outgoing", [null]] },
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
activeClients: [{ $group: { _id: "$clientId" } }],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
])
|
|
106
|
-
.next();
|
|
107
|
-
const counts = facetResult?.counts?.[0];
|
|
108
|
-
return {
|
|
109
|
-
total: counts?.total ?? 0,
|
|
110
|
-
incoming: counts?.incoming ?? 0,
|
|
111
|
-
outgoing: counts?.outgoing ?? 0,
|
|
112
|
-
activeClientIds: (facetResult?.activeClients ?? []).map((d) => d._id || "Unknown"),
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
exports.aggregateActiveCallsSummary = aggregateActiveCallsSummary;
|
|
116
|
-
const aggregateTodayCallsSummary = async ({ dateFrom, dateTo, clientId, timezone = "UTC", }) => {
|
|
117
|
-
const coll = (0, results_getter_1.getResultsCollection)();
|
|
118
|
-
const { start, end } = dateRangeFilter(dateFrom, dateTo, timezone);
|
|
119
|
-
const match = buildDateRangeMatch(start, end, clientId);
|
|
120
|
-
const facetResult = await coll
|
|
121
|
-
.aggregate([
|
|
122
|
-
...clientPreMatchStage(clientId),
|
|
123
|
-
{ $match: { "calls.date": { $gte: start, $lte: end } } },
|
|
124
|
-
{ $unwind: "$calls" },
|
|
125
|
-
{ $match: match },
|
|
126
|
-
{
|
|
127
|
-
$facet: {
|
|
128
|
-
byStatus: [{ $group: { _id: "$calls.status", count: { $sum: 1 } } }],
|
|
129
|
-
byType: [
|
|
130
|
-
{
|
|
131
|
-
$group: {
|
|
132
|
-
_id: {
|
|
133
|
-
$cond: [
|
|
134
|
-
{ $eq: ["$sessionId", results_constants_1.INCOMING_SESSION_ID] },
|
|
135
|
-
"incoming",
|
|
136
|
-
"outgoing",
|
|
137
|
-
],
|
|
138
|
-
},
|
|
139
|
-
count: { $sum: 1 },
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
total: [{ $group: { _id: null, count: { $sum: 1 } } }],
|
|
144
|
-
totalSeconds: [
|
|
145
|
-
{ $group: { _id: null, seconds: { $sum: durationExpr } } },
|
|
146
|
-
],
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
])
|
|
150
|
-
.next();
|
|
151
|
-
const byStatus = {};
|
|
152
|
-
(facetResult?.byStatus ?? []).forEach((s) => {
|
|
153
|
-
byStatus[s._id] = s.count;
|
|
154
|
-
});
|
|
155
|
-
const byType = {};
|
|
156
|
-
(facetResult?.byType ?? []).forEach((t) => {
|
|
157
|
-
byType[t._id] = t.count;
|
|
158
|
-
});
|
|
159
|
-
const totalSeconds = facetResult?.totalSeconds?.[0]?.seconds ?? 0;
|
|
160
|
-
return {
|
|
161
|
-
total: facetResult?.total?.[0]?.count ?? 0,
|
|
162
|
-
incoming: byType.incoming ?? 0,
|
|
163
|
-
outgoing: byType.outgoing ?? 0,
|
|
164
|
-
completed: byStatus.completed ?? 0,
|
|
165
|
-
failed: byStatus.failed ?? 0,
|
|
166
|
-
busy: byStatus.busy ?? 0,
|
|
167
|
-
noAnswer: byStatus["no-answer"] ?? 0,
|
|
168
|
-
totalMinutes: Math.ceil(totalSeconds / 60),
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
exports.aggregateTodayCallsSummary = aggregateTodayCallsSummary;
|
|
172
|
-
const aggregateClientCallStats = async ({ dateFrom, dateTo, clientId, timezone = "UTC", }) => {
|
|
173
|
-
const coll = (0, results_getter_1.getResultsCollection)();
|
|
174
|
-
const { start, end } = dateRangeFilter(dateFrom, dateTo, timezone);
|
|
175
|
-
const match = buildDateRangeMatch(start, end, clientId);
|
|
176
|
-
const rows = await coll
|
|
177
|
-
.aggregate([
|
|
178
|
-
...clientPreMatchStage(clientId),
|
|
179
|
-
{ $match: { "calls.date": { $gte: start, $lte: end } } },
|
|
180
|
-
{ $unwind: "$calls" },
|
|
181
|
-
{ $match: match },
|
|
182
|
-
{
|
|
183
|
-
$group: {
|
|
184
|
-
_id: "$clientId",
|
|
185
|
-
...statusFields,
|
|
186
|
-
totalSeconds: { $sum: durationExpr },
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
{ $sort: { totalCalls: -1 } },
|
|
190
|
-
])
|
|
191
|
-
.toArray();
|
|
192
|
-
return rows.map((r) => ({
|
|
193
|
-
clientId: r._id || "Unknown",
|
|
194
|
-
totalCalls: r.totalCalls,
|
|
195
|
-
completed: r.completed,
|
|
196
|
-
failed: r.failed,
|
|
197
|
-
noAnswer: r.noAnswer,
|
|
198
|
-
busy: r.busy,
|
|
199
|
-
inProgress: r.inProgress,
|
|
200
|
-
totalMinutes: Math.ceil((r.totalSeconds || 0) / 60),
|
|
201
|
-
}));
|
|
202
|
-
};
|
|
203
|
-
exports.aggregateClientCallStats = aggregateClientCallStats;
|
|
204
|
-
const aggregateSessionCallStats = async ({ dateFrom, dateTo, clientId, timezone = "UTC", }) => {
|
|
205
|
-
const coll = (0, results_getter_1.getResultsCollection)();
|
|
206
|
-
const { start, end } = dateRangeFilter(dateFrom, dateTo, timezone);
|
|
207
|
-
const match = buildDateRangeMatch(start, end, clientId);
|
|
208
|
-
const rows = await coll
|
|
209
|
-
.aggregate([
|
|
210
|
-
...clientPreMatchStage(clientId),
|
|
211
|
-
{ $match: { "calls.date": { $gte: start, $lte: end } } },
|
|
212
|
-
{ $unwind: "$calls" },
|
|
213
|
-
{ $match: match },
|
|
214
|
-
{ $group: { _id: "$sessionName", ...statusFields } },
|
|
215
|
-
{ $sort: { totalCalls: -1 } },
|
|
216
|
-
{ $limit: results_constants_1.SESSION_STATS_LIMIT },
|
|
217
|
-
])
|
|
218
|
-
.toArray();
|
|
219
|
-
return rows.map((r) => ({
|
|
220
|
-
sessionName: r._id || "Unknown",
|
|
221
|
-
totalCalls: r.totalCalls,
|
|
222
|
-
completed: r.completed,
|
|
223
|
-
failed: r.failed,
|
|
224
|
-
noAnswer: r.noAnswer,
|
|
225
|
-
busy: r.busy,
|
|
226
|
-
inProgress: r.inProgress,
|
|
227
|
-
}));
|
|
228
|
-
};
|
|
229
|
-
exports.aggregateSessionCallStats = aggregateSessionCallStats;
|
|
230
|
-
const findClientIdsByCallSids = async (callSids) => {
|
|
231
|
-
if (callSids.length === 0)
|
|
232
|
-
return new Map();
|
|
233
|
-
const docs = await (0, results_getter_1.getResultsCollection)()
|
|
234
|
-
.aggregate([
|
|
235
|
-
{ $match: { "calls.callSid": { $in: callSids } } },
|
|
236
|
-
{ $unwind: "$calls" },
|
|
237
|
-
{ $match: { "calls.callSid": { $in: callSids } } },
|
|
238
|
-
{ $project: { _id: 0, clientId: 1, callSid: "$calls.callSid" } },
|
|
239
|
-
])
|
|
240
|
-
.toArray();
|
|
241
|
-
return new Map(docs.map((d) => [d.callSid, d.clientId]));
|
|
242
|
-
};
|
|
243
|
-
exports.findClientIdsByCallSids = findClientIdsByCallSids;
|
|
244
|
-
//# sourceMappingURL=results.statistics.getters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.statistics.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/results/results.statistics.getters.ts"],"names":[],"mappings":";;;AAAA,qDAAwD;AACxD,uDAIgC;AAChC,2DAK6B;AAS7B,MAAM,eAAe,GAAG,CACtB,QAA4B,EAC5B,MAA0B,EAC1B,QAAgB,EACY,EAAE;IAC9B,MAAM,KAAK,GAAG,IAAA,0BAAa,EAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAC;IAClD,OAAO;QACL,KAAK,EAAE,IAAA,mCAAsB,EAAC,QAAQ,IAAI,KAAK,EAAE,QAAQ,CAAC;QAC1D,GAAG,EAAE,IAAA,iCAAoB,EAAC,MAAM,IAAI,KAAK,EAAE,QAAQ,CAAC;KACrD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAC1B,KAAW,EACX,GAAS,EACT,QAA4B,EAC5B,EAAE;IACF,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,Q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,EAC1C,QAAkB,EACY,EAAE;IAChC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,GAAG,EAAE,CAAC;IAE5C,MAAM,IAAI,GAAG,MAAM,IAAA,qCAAoB,GAAE;SACtC,SAAS,CAAwC;QAChD,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;QAClD,EAAE,OAAO,EAAE,QAAQ,EAAE;QACrB,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;QAClD,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE;KACjE,CAAC;SACD,OAAO,EAAE,CAAC;IAEb,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAfW,QAAA,uBAAuB,2BAelC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export type StatsDateRangeParams = {
|
|
2
|
-
dateFrom?: string;
|
|
3
|
-
dateTo?: string;
|
|
4
|
-
clientId?: string;
|
|
5
|
-
timezone?: string;
|
|
6
|
-
};
|
|
7
|
-
export type ActiveCallsSummary = {
|
|
8
|
-
total: number;
|
|
9
|
-
incoming: number;
|
|
10
|
-
outgoing: number;
|
|
11
|
-
activeClientIds: string[];
|
|
12
|
-
};
|
|
13
|
-
export type TodayCallsSummary = {
|
|
14
|
-
total: number;
|
|
15
|
-
incoming: number;
|
|
16
|
-
outgoing: number;
|
|
17
|
-
completed: number;
|
|
18
|
-
failed: number;
|
|
19
|
-
busy: number;
|
|
20
|
-
noAnswer: number;
|
|
21
|
-
totalMinutes: number;
|
|
22
|
-
};
|
|
23
|
-
export type ClientCallStats = {
|
|
24
|
-
clientId: string;
|
|
25
|
-
totalCalls: number;
|
|
26
|
-
completed: number;
|
|
27
|
-
failed: number;
|
|
28
|
-
noAnswer: number;
|
|
29
|
-
busy: number;
|
|
30
|
-
inProgress: number;
|
|
31
|
-
totalMinutes: number;
|
|
32
|
-
};
|
|
33
|
-
export type SessionCallStats = {
|
|
34
|
-
sessionName: string;
|
|
35
|
-
totalCalls: number;
|
|
36
|
-
completed: number;
|
|
37
|
-
failed: number;
|
|
38
|
-
noAnswer: number;
|
|
39
|
-
busy: number;
|
|
40
|
-
inProgress: number;
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=results.statistics.types.d.ts.map
|