@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":"results.statistics.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/results/results.statistics.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.statistics.types.js","sourceRoot":"","sources":["../../../src/talkpilot/results/results.statistics.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Factory } from "fishery";
|
|
2
|
-
import { ObjectId } from "mongodb";
|
|
3
|
-
import type { Client } from "../../../talkpilot";
|
|
4
|
-
export declare const clientFactory: Factory<Client & {
|
|
5
|
-
_id?: ObjectId;
|
|
6
|
-
}, any, Client & {
|
|
7
|
-
_id?: ObjectId;
|
|
8
|
-
}, import("fishery").DeepPartialObject<Client & {
|
|
9
|
-
_id?: ObjectId;
|
|
10
|
-
}>>;
|
|
11
|
-
export declare function createClient(overrides?: Partial<Client>): Client & {
|
|
12
|
-
_id?: ObjectId;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=clients.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../../src/test-utils/factories/talkpilot/clients.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,eAAO,MAAM,aAAa;UAAmC,QAAQ;;UAAR,QAAQ;;UAAR,QAAQ;GASpE,CAAC;AAEF,wBAAgB,YAAY,CAC1B,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAC1B,MAAM,GAAG;IAAE,GAAG,CAAC,EAAE,QAAQ,CAAA;CAAE,CAE7B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.clientFactory = void 0;
|
|
4
|
-
exports.createClient = createClient;
|
|
5
|
-
const fishery_1 = require("fishery");
|
|
6
|
-
const mongodb_1 = require("mongodb");
|
|
7
|
-
const faker_1 = require("@faker-js/faker");
|
|
8
|
-
exports.clientFactory = fishery_1.Factory.define(() => ({
|
|
9
|
-
_id: new mongodb_1.ObjectId(),
|
|
10
|
-
clientId: faker_1.faker.string.uuid(),
|
|
11
|
-
isActive: true,
|
|
12
|
-
credits: faker_1.faker.number.int({ min: 0, max: 1000 }),
|
|
13
|
-
createdAt: new Date(),
|
|
14
|
-
updatedAt: new Date(),
|
|
15
|
-
}));
|
|
16
|
-
function createClient(overrides) {
|
|
17
|
-
return exports.clientFactory.build(overrides);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=clients.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../../../src/test-utils/factories/talkpilot/clients.ts"],"names":[],"mappings":";;;AAgBA,oCAIC;AApBD,qCAAkC;AAClC,qCAAmC;AACnC,2CAAwC;AAG3B,QAAA,aAAa,GAAG,iBAAO,CAAC,MAAM,CACzC,GAAG,EAAE,CAAC,CAAC;IACL,GAAG,EAAE,IAAI,kBAAQ,EAAE;IACnB,QAAQ,EAAE,aAAK,CAAC,MAAM,CAAC,IAAI,EAAE;IAC7B,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,aAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IAChD,SAAS,EAAE,IAAI,IAAI,EAAE;IACrB,SAAS,EAAE,IAAI,IAAI,EAAE;CACtB,CAAC,CACH,CAAC;AAEF,SAAgB,YAAY,CAC1B,SAA2B;IAE3B,OAAO,qBAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Factory } from "fishery";
|
|
2
|
-
import { ObjectId } from "mongodb";
|
|
3
|
-
import type { Result, CallResult } from "../../../talkpilot";
|
|
4
|
-
export declare const callResultFactory: Factory<CallResult, any, CallResult, import("fishery").DeepPartialObject<CallResult>>;
|
|
5
|
-
export declare function createCallResult(overrides?: Partial<CallResult>): CallResult;
|
|
6
|
-
export declare const resultFactory: Factory<Result & {
|
|
7
|
-
_id?: ObjectId;
|
|
8
|
-
}, any, Result & {
|
|
9
|
-
_id?: ObjectId;
|
|
10
|
-
}, import("fishery").DeepPartialObject<Result & {
|
|
11
|
-
_id?: ObjectId;
|
|
12
|
-
}>>;
|
|
13
|
-
export declare function createResult(overrides?: Partial<Result>): Result & {
|
|
14
|
-
_id?: ObjectId;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=results.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../../src/test-utils/factories/talkpilot/results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE7D,eAAO,MAAM,iBAAiB,uFAe3B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAE5E;AAED,eAAO,MAAM,aAAa;UAAmC,QAAQ;;UAAR,QAAQ;;UAAR,QAAQ;GAUpE,CAAC;AAEF,wBAAgB,YAAY,CAC1B,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,GAC1B,MAAM,GAAG;IAAE,GAAG,CAAC,EAAE,QAAQ,CAAA;CAAE,CAE7B"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resultFactory = exports.callResultFactory = void 0;
|
|
4
|
-
exports.createCallResult = createCallResult;
|
|
5
|
-
exports.createResult = createResult;
|
|
6
|
-
const fishery_1 = require("fishery");
|
|
7
|
-
const mongodb_1 = require("mongodb");
|
|
8
|
-
const faker_1 = require("@faker-js/faker");
|
|
9
|
-
exports.callResultFactory = fishery_1.Factory.define(() => ({
|
|
10
|
-
callSid: `CA${faker_1.faker.string.alphanumeric(32)}`,
|
|
11
|
-
status: "completed",
|
|
12
|
-
date: new Date(),
|
|
13
|
-
statuses: ["completed"],
|
|
14
|
-
userAnswer: null,
|
|
15
|
-
color: null,
|
|
16
|
-
name: null,
|
|
17
|
-
callLength: "60 seconds",
|
|
18
|
-
answeredBy: null,
|
|
19
|
-
to: faker_1.faker.phone.number(),
|
|
20
|
-
from: faker_1.faker.phone.number(),
|
|
21
|
-
transcription: [],
|
|
22
|
-
flowId: new mongodb_1.ObjectId().toString(),
|
|
23
|
-
recordingUrl: null,
|
|
24
|
-
}));
|
|
25
|
-
function createCallResult(overrides) {
|
|
26
|
-
return exports.callResultFactory.build(overrides);
|
|
27
|
-
}
|
|
28
|
-
exports.resultFactory = fishery_1.Factory.define(() => ({
|
|
29
|
-
_id: new mongodb_1.ObjectId(),
|
|
30
|
-
calls: [],
|
|
31
|
-
clientId: faker_1.faker.string.uuid(),
|
|
32
|
-
date: new Date(),
|
|
33
|
-
runId: `run_${new mongodb_1.ObjectId().toString()}`,
|
|
34
|
-
sessionId: "incomingCall",
|
|
35
|
-
sessionName: "incomingCall",
|
|
36
|
-
}));
|
|
37
|
-
function createResult(overrides) {
|
|
38
|
-
return exports.resultFactory.build(overrides);
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=results.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../../src/test-utils/factories/talkpilot/results.ts"],"names":[],"mappings":";;;AAsBA,4CAEC;AAcD,oCAIC;AA1CD,qCAAkC;AAClC,qCAAmC;AACnC,2CAAwC;AAG3B,QAAA,iBAAiB,GAAG,iBAAO,CAAC,MAAM,CAAa,GAAG,EAAE,CAAC,CAAC;IACjE,OAAO,EAAE,KAAK,aAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE;IAC7C,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,IAAI,IAAI,EAAE;IAChB,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,IAAI;IAChB,EAAE,EAAE,aAAK,CAAC,KAAK,CAAC,MAAM,EAAE;IACxB,IAAI,EAAE,aAAK,CAAC,KAAK,CAAC,MAAM,EAAE;IAC1B,aAAa,EAAE,EAAE;IACjB,MAAM,EAAE,IAAI,kBAAQ,EAAE,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC,CAAC;AAEJ,SAAgB,gBAAgB,CAAC,SAA+B;IAC9D,OAAO,yBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AAEY,QAAA,aAAa,GAAG,iBAAO,CAAC,MAAM,CACzC,GAAG,EAAE,CAAC,CAAC;IACL,GAAG,EAAE,IAAI,kBAAQ,EAAE;IACnB,KAAK,EAAE,EAAE;IACT,QAAQ,EAAE,aAAK,CAAC,MAAM,CAAC,IAAI,EAAE;IAC7B,IAAI,EAAE,IAAI,IAAI,EAAE;IAChB,KAAK,EAAE,OAAO,IAAI,kBAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE;IACzC,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,cAAc;CAC5B,CAAC,CACH,CAAC;AAEF,SAAgB,YAAY,CAC1B,SAA2B;IAE3B,OAAO,qBAAa,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
insertAuditLog,
|
|
3
|
-
getAuditLogsCollection,
|
|
4
|
-
findAuditLogs,
|
|
5
|
-
countAuditLogs,
|
|
6
|
-
} from "../auditLogs.getters";
|
|
7
|
-
import { AuditLogEntry } from "../auditLogs.types";
|
|
8
|
-
|
|
9
|
-
describe("db.auditLogs", () => {
|
|
10
|
-
describe("insertAuditLog", () => {
|
|
11
|
-
it("should write an entry that can be read back with all fields intact", async () => {
|
|
12
|
-
const entry: AuditLogEntry = {
|
|
13
|
-
clientId: "deletedClient1",
|
|
14
|
-
adminEmail: "admin@callai.co.il",
|
|
15
|
-
action: "delete",
|
|
16
|
-
timestamp: new Date("2026-07-15T10:00:00.000Z"),
|
|
17
|
-
env: "prod",
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
await insertAuditLog(entry);
|
|
21
|
-
|
|
22
|
-
const stored = await getAuditLogsCollection().findOne({
|
|
23
|
-
clientId: "deletedClient1",
|
|
24
|
-
});
|
|
25
|
-
expect(stored).toMatchObject(entry);
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe("findAuditLogs", () => {
|
|
30
|
-
const seed = async () => {
|
|
31
|
-
await insertAuditLog({
|
|
32
|
-
clientId: "clientA",
|
|
33
|
-
adminEmail: "admin@callai.co.il",
|
|
34
|
-
action: "delete",
|
|
35
|
-
timestamp: new Date("2026-01-01T00:00:00.000Z"),
|
|
36
|
-
});
|
|
37
|
-
await insertAuditLog({
|
|
38
|
-
clientId: "clientB",
|
|
39
|
-
adminEmail: "admin@callai.co.il",
|
|
40
|
-
action: "delete",
|
|
41
|
-
timestamp: new Date("2026-02-01T00:00:00.000Z"),
|
|
42
|
-
});
|
|
43
|
-
await insertAuditLog({
|
|
44
|
-
clientId: "clientC",
|
|
45
|
-
adminEmail: "admin@callai.co.il",
|
|
46
|
-
action: "delete",
|
|
47
|
-
timestamp: new Date("2026-03-01T00:00:00.000Z"),
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
it("should return a page of entries, newest first", async () => {
|
|
52
|
-
await seed();
|
|
53
|
-
|
|
54
|
-
const page = await findAuditLogs({ limit: 2 });
|
|
55
|
-
|
|
56
|
-
expect(page).toHaveLength(2);
|
|
57
|
-
expect(page.map((e) => e.clientId)).toEqual(["clientC", "clientB"]);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("should skip entries for later pages", async () => {
|
|
61
|
-
await seed();
|
|
62
|
-
|
|
63
|
-
const page = await findAuditLogs({ skip: 2, limit: 2 });
|
|
64
|
-
|
|
65
|
-
expect(page).toHaveLength(1);
|
|
66
|
-
expect(page[0].clientId).toBe("clientA");
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
describe("countAuditLogs", () => {
|
|
71
|
-
it("should return the total number of entries regardless of pagination", async () => {
|
|
72
|
-
await insertAuditLog({
|
|
73
|
-
clientId: "clientA",
|
|
74
|
-
adminEmail: "admin@callai.co.il",
|
|
75
|
-
action: "delete",
|
|
76
|
-
timestamp: new Date(),
|
|
77
|
-
});
|
|
78
|
-
await insertAuditLog({
|
|
79
|
-
clientId: "clientB",
|
|
80
|
-
adminEmail: "admin@callai.co.il",
|
|
81
|
-
action: "delete",
|
|
82
|
-
timestamp: new Date(),
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
expect(await countAuditLogs()).toBe(2);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("should return 0 when there are no entries", async () => {
|
|
89
|
-
expect(await countAuditLogs()).toBe(0);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Collection } from "mongodb";
|
|
2
|
-
import { getDb } from "../index";
|
|
3
|
-
import { applyQueryOptions, QueryOptions } from "../utils/query.utils";
|
|
4
|
-
import { AuditLogDoc, AuditLogEntry } from "./auditLogs.types";
|
|
5
|
-
|
|
6
|
-
export const getAuditLogsCollection = (): Collection<AuditLogEntry> => {
|
|
7
|
-
return getDb().collection<AuditLogEntry>("auditLogs");
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const insertAuditLog = async (entry: AuditLogEntry): Promise<void> => {
|
|
11
|
-
await getAuditLogsCollection().insertOne(entry);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const findAuditLogs = async (
|
|
15
|
-
options: Pick<QueryOptions, "skip"> & Required<Pick<QueryOptions, "limit">>,
|
|
16
|
-
): Promise<AuditLogDoc[]> => {
|
|
17
|
-
const cursor = getAuditLogsCollection().find({});
|
|
18
|
-
return applyQueryOptions(cursor, {
|
|
19
|
-
sort: { timestamp: -1 },
|
|
20
|
-
...options,
|
|
21
|
-
}).toArray();
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const countAuditLogs = async (): Promise<number> => {
|
|
25
|
-
return getAuditLogsCollection().countDocuments({});
|
|
26
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { WithId } from "mongodb";
|
|
2
|
-
|
|
3
|
-
export type AuditLogEntry = {
|
|
4
|
-
clientId: string;
|
|
5
|
-
adminEmail: string;
|
|
6
|
-
action: "delete";
|
|
7
|
-
timestamp: Date;
|
|
8
|
-
env?: string;
|
|
9
|
-
allSucceeded?: boolean;
|
|
10
|
-
failedCollections?: string[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type AuditLogDoc = WithId<AuditLogEntry>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getClientsCollection, getAllClientCredits } from "../clients.getters";
|
|
2
|
-
import { createClient } from "../../../test-utils/factories";
|
|
3
|
-
|
|
4
|
-
describe("db.clients", () => {
|
|
5
|
-
describe("getAllClientCredits", () => {
|
|
6
|
-
it("should return a Map of clientId to credits across all clients", async () => {
|
|
7
|
-
await getClientsCollection().insertMany([
|
|
8
|
-
createClient({ clientId: "creditsClientA", credits: 100 }),
|
|
9
|
-
createClient({ clientId: "creditsClientB", credits: 250 }),
|
|
10
|
-
]);
|
|
11
|
-
|
|
12
|
-
const result = await getAllClientCredits();
|
|
13
|
-
|
|
14
|
-
expect(result).toBeInstanceOf(Map);
|
|
15
|
-
expect(result.get("creditsClientA")).toBe(100);
|
|
16
|
-
expect(result.get("creditsClientB")).toBe(250);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("should default missing credits to 0", async () => {
|
|
20
|
-
const client = createClient({ clientId: "noCreditsClient" });
|
|
21
|
-
delete (client as { credits?: number }).credits;
|
|
22
|
-
await getClientsCollection().insertOne(client);
|
|
23
|
-
|
|
24
|
-
const result = await getAllClientCredits();
|
|
25
|
-
expect(result.get("noCreditsClient")).toBe(0);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("should return an empty Map when there are no clients", async () => {
|
|
29
|
-
const result = await getAllClientCredits();
|
|
30
|
-
expect(result.size).toBe(0);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clientExistsInAnyCollection,
|
|
3
|
-
deleteClientDataAcrossDomains,
|
|
4
|
-
} from "../clients.lifecycle";
|
|
5
|
-
import { getPhoneNumbersCollection } from "../../phone_numbers/phone_numbers.getter";
|
|
6
|
-
import {
|
|
7
|
-
createMuniIssue,
|
|
8
|
-
generateMuniIssueId,
|
|
9
|
-
getAuditLogsCollection,
|
|
10
|
-
getScansCollection,
|
|
11
|
-
} from "../../../index";
|
|
12
|
-
import {
|
|
13
|
-
createPhoneNumber,
|
|
14
|
-
createMuniIssueInput,
|
|
15
|
-
createScanFixture,
|
|
16
|
-
} from "../../../test-utils/factories";
|
|
17
|
-
|
|
18
|
-
describe("db.clients.lifecycle", () => {
|
|
19
|
-
describe("clientExistsInAnyCollection", () => {
|
|
20
|
-
it("should return true when the client exists only in phone_numbers (client_id field)", async () => {
|
|
21
|
-
const clientId = "existsPhoneOnly";
|
|
22
|
-
await getPhoneNumbersCollection().insertOne(
|
|
23
|
-
createPhoneNumber({ client_id: clientId }),
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
expect(await clientExistsInAnyCollection(clientId)).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should return true when the client exists only in muniIssues (municipal DB)", async () => {
|
|
30
|
-
const clientId = "existsMuniOnly";
|
|
31
|
-
await createMuniIssue(
|
|
32
|
-
createMuniIssueInput({ clientId }),
|
|
33
|
-
generateMuniIssueId(),
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
expect(await clientExistsInAnyCollection(clientId)).toBe(true);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("should return false when the client does not exist anywhere", async () => {
|
|
40
|
-
expect(await clientExistsInAnyCollection("noSuchClientAtAll")).toBe(
|
|
41
|
-
false,
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("should not consider websitalk data (scans/websiteUrls) at all", async () => {
|
|
46
|
-
const clientId = "onlyInWebsitalk";
|
|
47
|
-
await getScansCollection().insertOne(createScanFixture({ clientId }));
|
|
48
|
-
|
|
49
|
-
expect(await clientExistsInAnyCollection(clientId)).toBe(false);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("should not be fooled by unrelated collections lacking a clientId/client_id field", async () => {
|
|
53
|
-
await global.db
|
|
54
|
-
.collection("someUnrelatedCollection")
|
|
55
|
-
.insertOne({ someField: "someValue" });
|
|
56
|
-
|
|
57
|
-
expect(await clientExistsInAnyCollection("noSuchClientAtAll")).toBe(
|
|
58
|
-
false,
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
describe("deleteClientDataAcrossDomains", () => {
|
|
64
|
-
it("should return deleted:false with a reason and delete nothing when the client does not exist", async () => {
|
|
65
|
-
await getPhoneNumbersCollection().insertOne(
|
|
66
|
-
createPhoneNumber({ client_id: "unrelatedClient" }),
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const summary = await deleteClientDataAcrossDomains(
|
|
70
|
-
"missingClient",
|
|
71
|
-
"admin@callai.co.il",
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
expect(summary.deleted).toBe(false);
|
|
75
|
-
if (!summary.deleted) {
|
|
76
|
-
expect(summary.reason).toBeTruthy();
|
|
77
|
-
}
|
|
78
|
-
expect(
|
|
79
|
-
await getPhoneNumbersCollection().findOne({
|
|
80
|
-
client_id: "unrelatedClient",
|
|
81
|
-
}),
|
|
82
|
-
).not.toBeNull();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("should not write an audit log entry when the client does not exist", async () => {
|
|
86
|
-
await deleteClientDataAcrossDomains(
|
|
87
|
-
"missingClientNoAudit",
|
|
88
|
-
"admin@callai.co.il",
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
expect(
|
|
92
|
-
await getAuditLogsCollection().findOne({
|
|
93
|
-
clientId: "missingClientNoAudit",
|
|
94
|
-
}),
|
|
95
|
-
).toBeNull();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it("should delete the client's data across talkpilot and municipal domains", async () => {
|
|
99
|
-
const clientId = "deleteMeEverywhere";
|
|
100
|
-
await getPhoneNumbersCollection().insertOne(
|
|
101
|
-
createPhoneNumber({ client_id: clientId }),
|
|
102
|
-
);
|
|
103
|
-
await createMuniIssue(
|
|
104
|
-
createMuniIssueInput({ clientId }),
|
|
105
|
-
generateMuniIssueId(),
|
|
106
|
-
);
|
|
107
|
-
|
|
108
|
-
const adminEmail = "admin@callai.co.il";
|
|
109
|
-
const summary = await deleteClientDataAcrossDomains(
|
|
110
|
-
clientId,
|
|
111
|
-
adminEmail,
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
expect(summary.deleted).toBe(true);
|
|
115
|
-
if (summary.deleted) {
|
|
116
|
-
expect(summary.allSucceeded).toBe(true);
|
|
117
|
-
const byName = (name: string) =>
|
|
118
|
-
summary.results.find((r) => r.collectionName === name);
|
|
119
|
-
expect(byName("phone_numbers")?.deletedCount).toBe(1);
|
|
120
|
-
expect(byName("muniIssues")?.deletedCount).toBe(1);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
expect(await clientExistsInAnyCollection(clientId)).toBe(false);
|
|
124
|
-
|
|
125
|
-
// The audit entry itself must survive the client's own deletion.
|
|
126
|
-
const auditEntry = await getAuditLogsCollection().findOne({ clientId });
|
|
127
|
-
expect(auditEntry).toMatchObject({
|
|
128
|
-
clientId,
|
|
129
|
-
adminEmail,
|
|
130
|
-
action: "delete",
|
|
131
|
-
});
|
|
132
|
-
expect(auditEntry?.timestamp).toBeInstanceOf(Date);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
it("should not touch websitalk data (scans/websiteUrls) — callers must call the external website-talk deletion API separately", async () => {
|
|
136
|
-
const clientId = "hasWebsitalkData";
|
|
137
|
-
await getPhoneNumbersCollection().insertOne(
|
|
138
|
-
createPhoneNumber({ client_id: clientId }),
|
|
139
|
-
);
|
|
140
|
-
await getScansCollection().insertOne(createScanFixture({ clientId }));
|
|
141
|
-
|
|
142
|
-
await deleteClientDataAcrossDomains(clientId, "admin@callai.co.il");
|
|
143
|
-
|
|
144
|
-
expect(
|
|
145
|
-
await getScansCollection().findOne({ clientId }),
|
|
146
|
-
).not.toBeNull();
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it("should not delete unrelated clients' data", async () => {
|
|
150
|
-
const targetClient = "deleteTarget";
|
|
151
|
-
const otherClient = "keepMeClient";
|
|
152
|
-
await getPhoneNumbersCollection().insertOne(
|
|
153
|
-
createPhoneNumber({ client_id: targetClient }),
|
|
154
|
-
);
|
|
155
|
-
await getPhoneNumbersCollection().insertOne(
|
|
156
|
-
createPhoneNumber({ client_id: otherClient }),
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
await deleteClientDataAcrossDomains(targetClient, "admin@callai.co.il");
|
|
160
|
-
|
|
161
|
-
expect(
|
|
162
|
-
await getPhoneNumbersCollection().findOne({ client_id: otherClient }),
|
|
163
|
-
).not.toBeNull();
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { Db } from "mongodb";
|
|
2
|
-
import { getDb, insertAuditLog } from "../index";
|
|
3
|
-
import { getDb as getMunicipalDataDb } from "../../municipal";
|
|
4
|
-
import { DELETE_DENYLIST } from "./clients.constants";
|
|
5
|
-
import {
|
|
6
|
-
CollectionMatch,
|
|
7
|
-
CollectionDeleteResult,
|
|
8
|
-
DeleteClientDataSummary,
|
|
9
|
-
} from "./clients.types";
|
|
10
|
-
|
|
11
|
-
// Skips websitalk on purpose — see the warning on `deleteClientDataAcrossDomains` below.
|
|
12
|
-
const findClientMatchInDb = async (
|
|
13
|
-
db: Db,
|
|
14
|
-
clientId: string,
|
|
15
|
-
): Promise<CollectionMatch[]> => {
|
|
16
|
-
const collections = await db.listCollections().toArray();
|
|
17
|
-
return Promise.all(
|
|
18
|
-
collections
|
|
19
|
-
.filter((c) => !DELETE_DENYLIST.includes(c.name))
|
|
20
|
-
.map(async (c) => {
|
|
21
|
-
const doc = await db
|
|
22
|
-
.collection(c.name)
|
|
23
|
-
.findOne({ $or: [{ clientId }, { client_id: clientId }] });
|
|
24
|
-
return { collectionName: c.name, matched: !!doc };
|
|
25
|
-
}),
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const clientExistsInAnyCollection = async (
|
|
30
|
-
clientId: string,
|
|
31
|
-
): Promise<boolean> => {
|
|
32
|
-
const [talkpilotResults, municipalResults] = await Promise.all([
|
|
33
|
-
findClientMatchInDb(getDb(), clientId),
|
|
34
|
-
findClientMatchInDb(getMunicipalDataDb(), clientId),
|
|
35
|
-
]);
|
|
36
|
-
return [...talkpilotResults, ...municipalResults].some((r) => r.matched);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const deleteClientFromDb = async (
|
|
40
|
-
db: Db,
|
|
41
|
-
clientId: string,
|
|
42
|
-
): Promise<CollectionDeleteResult[]> => {
|
|
43
|
-
const collections = await db.listCollections().toArray();
|
|
44
|
-
return Promise.all(
|
|
45
|
-
collections
|
|
46
|
-
.filter((c) => !DELETE_DENYLIST.includes(c.name))
|
|
47
|
-
.map(async (c) => {
|
|
48
|
-
try {
|
|
49
|
-
const result = await db
|
|
50
|
-
.collection(c.name)
|
|
51
|
-
.deleteMany({ $or: [{ clientId }, { client_id: clientId }] });
|
|
52
|
-
return {
|
|
53
|
-
collectionName: c.name,
|
|
54
|
-
deletedCount: result.deletedCount,
|
|
55
|
-
success: true,
|
|
56
|
-
};
|
|
57
|
-
} catch (error) {
|
|
58
|
-
return {
|
|
59
|
-
collectionName: c.name,
|
|
60
|
-
deletedCount: 0,
|
|
61
|
-
success: false,
|
|
62
|
-
error: error instanceof Error ? error.message : String(error),
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}),
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Deletes a client's data across talkpilot/municipal collections and logs the action.
|
|
71
|
-
*
|
|
72
|
-
* ⚠️ Does NOT delete website-talk data — `scans`/`websiteUrls` are the lookup key an
|
|
73
|
-
* external API needs to clean up that domain. Callers must invoke that API separately.
|
|
74
|
-
*/
|
|
75
|
-
export const deleteClientDataAcrossDomains = async (
|
|
76
|
-
clientId: string,
|
|
77
|
-
adminEmail: string,
|
|
78
|
-
): Promise<DeleteClientDataSummary> => {
|
|
79
|
-
const exists = await clientExistsInAnyCollection(clientId);
|
|
80
|
-
if (!exists) {
|
|
81
|
-
return {
|
|
82
|
-
clientId,
|
|
83
|
-
deleted: false,
|
|
84
|
-
reason: "Client does not exist in any collection",
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const [talkpilotResults, municipalResults] = await Promise.all([
|
|
89
|
-
deleteClientFromDb(getDb(), clientId),
|
|
90
|
-
deleteClientFromDb(getMunicipalDataDb(), clientId),
|
|
91
|
-
]);
|
|
92
|
-
const results = [...talkpilotResults, ...municipalResults];
|
|
93
|
-
const allSucceeded = results.every((r) => r.success);
|
|
94
|
-
|
|
95
|
-
await insertAuditLog({
|
|
96
|
-
clientId,
|
|
97
|
-
adminEmail,
|
|
98
|
-
action: "delete",
|
|
99
|
-
timestamp: new Date(),
|
|
100
|
-
allSucceeded,
|
|
101
|
-
...(allSucceeded
|
|
102
|
-
? {}
|
|
103
|
-
: {
|
|
104
|
-
failedCollections: results
|
|
105
|
-
.filter((r) => !r.success)
|
|
106
|
-
.map((r) => r.collectionName),
|
|
107
|
-
}),
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
clientId,
|
|
112
|
-
deleted: true,
|
|
113
|
-
results,
|
|
114
|
-
allSucceeded,
|
|
115
|
-
};
|
|
116
|
-
};
|