@talkpilot/core-db 1.3.45 → 1.3.46
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/AGENTS.md +49 -0
- package/dist/configuration/models/models.constants.d.ts +1 -1
- package/dist/configuration/models/models.constants.d.ts.map +1 -1
- package/dist/configuration/models/models.constants.js +1 -1
- package/dist/configuration/models/models.constants.js.map +1 -1
- package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.d.ts +10 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.d.ts.map +1 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.js +15 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.js.map +1 -0
- package/dist/municipal/streets/streets.setters.d.ts +10 -0
- package/dist/municipal/streets/streets.setters.d.ts.map +1 -0
- package/dist/municipal/streets/streets.setters.js +15 -0
- package/dist/municipal/streets/streets.setters.js.map +1 -0
- package/dist/reconcile/index.d.ts +5 -0
- package/dist/reconcile/index.d.ts.map +1 -0
- package/dist/reconcile/index.js +21 -0
- package/dist/reconcile/index.js.map +1 -0
- package/dist/reconcile/reconcile.diff.d.ts +4 -0
- package/dist/reconcile/reconcile.diff.d.ts.map +1 -0
- package/dist/reconcile/reconcile.diff.js +36 -0
- package/dist/reconcile/reconcile.diff.js.map +1 -0
- package/dist/reconcile/reconcile.execute.d.ts +7 -0
- package/dist/reconcile/reconcile.execute.d.ts.map +1 -0
- package/dist/reconcile/reconcile.execute.js +20 -0
- package/dist/reconcile/reconcile.execute.js.map +1 -0
- package/dist/reconcile/reconcile.ops.d.ts +12 -0
- package/dist/reconcile/reconcile.ops.d.ts.map +1 -0
- package/dist/reconcile/reconcile.ops.js +24 -0
- package/dist/reconcile/reconcile.ops.js.map +1 -0
- package/dist/reconcile/reconcile.types.d.ts +32 -0
- package/dist/reconcile/reconcile.types.d.ts.map +1 -0
- package/dist/reconcile/reconcile.types.js +3 -0
- package/dist/reconcile/reconcile.types.js.map +1 -0
- package/dist/talkpilot/calls/calls.types.d.ts +14 -0
- package/dist/talkpilot/calls/calls.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/configuration/models/models.constants.ts +1 -1
- package/src/talkpilot/calls/calls.types.ts +15 -0
- package/dist/talkpilot/clients/clients.quota.constants.d.ts +0 -2
- package/dist/talkpilot/clients/clients.quota.constants.d.ts.map +0 -1
- package/dist/talkpilot/clients/clients.quota.constants.js +0 -5
- package/dist/talkpilot/clients/clients.quota.constants.js.map +0 -1
- package/dist/talkpilot/clients/clients.quota.utils.d.ts +0 -8
- package/dist/talkpilot/clients/clients.quota.utils.d.ts.map +0 -1
- package/dist/talkpilot/clients/clients.quota.utils.js +0 -45
- package/dist/talkpilot/clients/clients.quota.utils.js.map +0 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# AI Agent Guide for core-db
|
|
2
|
+
|
|
3
|
+
Ground truth for AI coding agents in this repository. This is `@talkpilot/core-db` — the only package that should talk to Mongo. `.cursor/rules/development.mdc` exists but may lag (TalkPilot + Municipal only); do not expand those rules in an unrelated ticket.
|
|
4
|
+
|
|
5
|
+
## What this is
|
|
6
|
+
Shared Mongo layer: typed getters, schemas, factories, indexes. Consumed by TalkPilot, municipal, WebsiteTalk, and clinic services. Publishing a version here is how other repos pick up schema/getter changes.
|
|
7
|
+
|
|
8
|
+
## Coding philosophy
|
|
9
|
+
- Strict TypeScript. No `any`; use `unknown` and narrow.
|
|
10
|
+
- No narrating comments.
|
|
11
|
+
- Split types, getters, and schemas into separate files.
|
|
12
|
+
|
|
13
|
+
## Project structure
|
|
14
|
+
- `src/talkpilot/` — calls, flows, sessions, clients, phone numbers, subscriptions, …
|
|
15
|
+
- `src/municipal/` — cities, streets, tickets, departmentsSubjects, …
|
|
16
|
+
- `src/websitalk/` — scans, scanResources, websiteUrls.
|
|
17
|
+
- `src/configuration/` — prompts, models.
|
|
18
|
+
- `src/test-utils/` — Fishery factories and test DB helpers.
|
|
19
|
+
- `src/utils/` — validation, pagination, shared types.
|
|
20
|
+
- `dist/` is what consumers import — generated, tests excluded from the build.
|
|
21
|
+
|
|
22
|
+
## Copy this
|
|
23
|
+
New getter: `src/<domain>/<entity>/<entity>.types.ts` + `<entity>.getter.ts` (or `*.getters.ts`) + optional `<entity>.schema.ts` + barrel `index.ts` + `__tests__/<entity>.spec.ts`.
|
|
24
|
+
Export it from `src/index.ts`.
|
|
25
|
+
Examples: `src/talkpilot/calls/calls.getters.ts`, `src/talkpilot/phone_numbers/phone_numbers.getter.ts`.
|
|
26
|
+
|
|
27
|
+
Naming: `find*` for many, `get*ById` (or equivalent single-doc) for one. Always use that domain’s `getDb()` / collection helper — never another domain’s client. Exception already on disk: `src/talkpilot/calls/calls.statistics.getters.ts` imports municipal `tickets.statistics.getters` — do not “clean that up.”
|
|
28
|
+
|
|
29
|
+
## Where data lives
|
|
30
|
+
This repo **owns** `mongodb`. Four isolated clients — connect each independently:
|
|
31
|
+
|
|
32
|
+
- `mongodbClient` — TalkPilot
|
|
33
|
+
- `municipalDataMongodbClient` — municipal
|
|
34
|
+
- `websitalkMongodbClient` — WebsiteTalk
|
|
35
|
+
- `configurationMongodbClient` — configuration
|
|
36
|
+
|
|
37
|
+
Do not cross-import getters across domains, except the talkpilot call-stats → municipal tickets exception above.
|
|
38
|
+
|
|
39
|
+
## Do / don't
|
|
40
|
+
- Do not put HTTP, Express, or business orchestration here.
|
|
41
|
+
- Validate `MONGO_URI` (and siblings) on demand in `connect()`, using `src/utils/validation`.
|
|
42
|
+
- After a getter/schema change: bump package version, build, publish; then bump the consumer. Downstream pins skew — do not assume they are on latest.
|
|
43
|
+
- `prepare` runs `build` on install.
|
|
44
|
+
|
|
45
|
+
## Siblings
|
|
46
|
+
Every Node service should call getters from here. If a service is about to `getDb().collection` or `import from 'mongodb'`, the getter belongs in this PR first.
|
|
47
|
+
|
|
48
|
+
## Tests
|
|
49
|
+
Jest + `mongodb-memory-server` (`src/__tests__/setup.ts`). Factories in `src/test-utils/factories/`. Colocate `__tests__/` under the domain.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const MODELS_COLLECTION = "models";
|
|
2
2
|
export declare const MODEL_TYPES: readonly ["realtime", "stt"];
|
|
3
|
-
export declare const REALTIME_MODEL_PROVIDERS: readonly ["openai", "gemini"];
|
|
3
|
+
export declare const REALTIME_MODEL_PROVIDERS: readonly ["openai", "gemini", "xai"];
|
|
4
4
|
export declare const STT_MODEL_PROVIDERS: readonly ["openai-stt", "google-stt", "deepgram-stt", "deepgram-flux", "elevenlabs-scribe", "gladia-stt"];
|
|
5
5
|
//# sourceMappingURL=models.constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.constants.d.ts","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,WAAW,8BAA+B,CAAC;AAExD,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"models.constants.d.ts","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,WAAW,8BAA+B,CAAC;AAExD,eAAO,MAAM,wBAAwB,sCAAuC,CAAC;AAC7E,eAAO,MAAM,mBAAmB,2GAOtB,CAAC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STT_MODEL_PROVIDERS = exports.REALTIME_MODEL_PROVIDERS = exports.MODEL_TYPES = exports.MODELS_COLLECTION = void 0;
|
|
4
4
|
exports.MODELS_COLLECTION = "models";
|
|
5
5
|
exports.MODEL_TYPES = ["realtime", "stt"];
|
|
6
|
-
exports.REALTIME_MODEL_PROVIDERS = ["openai", "gemini"];
|
|
6
|
+
exports.REALTIME_MODEL_PROVIDERS = ["openai", "gemini", "xai"];
|
|
7
7
|
exports.STT_MODEL_PROVIDERS = [
|
|
8
8
|
"openai-stt",
|
|
9
9
|
"google-stt",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.constants.js","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE7B,QAAA,WAAW,GAAG,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AAE3C,QAAA,wBAAwB,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"models.constants.js","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE7B,QAAA,WAAW,GAAG,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AAE3C,QAAA,wBAAwB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAChE,QAAA,mBAAmB,GAAG;IACjC,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,YAAY;CACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyBulkWriteOperation, BulkWriteOptions, BulkWriteResult } from "mongodb";
|
|
2
|
+
import { DepartmentSubject } from "./departmentsSubjects.types";
|
|
3
|
+
/**
|
|
4
|
+
* Generic batch write for the departmentsSubjects collection — a thin passthrough to the
|
|
5
|
+
* driver's bulkWrite, with no diffing/key-building/business logic. `operations` must be
|
|
6
|
+
* non-empty (the driver throws on an empty batch). Errors (including partial failures under
|
|
7
|
+
* `{ ordered: false }`) propagate unchanged, so callers can still catch `MongoBulkWriteError`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const bulkWriteDepartmentsSubjects: (operations: AnyBulkWriteOperation<DepartmentSubject>[], options?: BulkWriteOptions) => Promise<BulkWriteResult>;
|
|
10
|
+
//# sourceMappingURL=departmentsSubjects.setters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"departmentsSubjects.setters.d.ts","sourceRoot":"","sources":["../../../src/municipal/departmentsSubjects/departmentsSubjects.setters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGhE;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,GACvC,YAAY,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,EACtD,UAAU,gBAAgB,KACzB,OAAO,CAAC,eAAe,CAEzB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bulkWriteDepartmentsSubjects = void 0;
|
|
4
|
+
const departmentsSubjects_getters_1 = require("./departmentsSubjects.getters");
|
|
5
|
+
/**
|
|
6
|
+
* Generic batch write for the departmentsSubjects collection — a thin passthrough to the
|
|
7
|
+
* driver's bulkWrite, with no diffing/key-building/business logic. `operations` must be
|
|
8
|
+
* non-empty (the driver throws on an empty batch). Errors (including partial failures under
|
|
9
|
+
* `{ ordered: false }`) propagate unchanged, so callers can still catch `MongoBulkWriteError`.
|
|
10
|
+
*/
|
|
11
|
+
const bulkWriteDepartmentsSubjects = async (operations, options) => {
|
|
12
|
+
return (0, departmentsSubjects_getters_1.getDepartmentsSubjectsCollection)().bulkWrite(operations, options);
|
|
13
|
+
};
|
|
14
|
+
exports.bulkWriteDepartmentsSubjects = bulkWriteDepartmentsSubjects;
|
|
15
|
+
//# sourceMappingURL=departmentsSubjects.setters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"departmentsSubjects.setters.js","sourceRoot":"","sources":["../../../src/municipal/departmentsSubjects/departmentsSubjects.setters.ts"],"names":[],"mappings":";;;AAEA,+EAAiF;AAEjF;;;;;GAKG;AACI,MAAM,4BAA4B,GAAG,KAAK,EAC/C,UAAsD,EACtD,OAA0B,EACA,EAAE;IAC5B,OAAO,IAAA,8DAAgC,GAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3E,CAAC,CAAC;AALW,QAAA,4BAA4B,gCAKvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnyBulkWriteOperation, BulkWriteOptions, BulkWriteResult } from "mongodb";
|
|
2
|
+
import { Street } from "./streets.types";
|
|
3
|
+
/**
|
|
4
|
+
* Generic batch write for the streets collection — a thin passthrough to the driver's
|
|
5
|
+
* bulkWrite, with no diffing/key-building/business logic. `operations` must be non-empty
|
|
6
|
+
* (the driver throws on an empty batch). Errors (including partial failures under
|
|
7
|
+
* `{ ordered: false }`) propagate unchanged, so callers can still catch `MongoBulkWriteError`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const bulkWriteStreets: (operations: AnyBulkWriteOperation<Street>[], options?: BulkWriteOptions) => Promise<BulkWriteResult>;
|
|
10
|
+
//# sourceMappingURL=streets.setters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streets.setters.d.ts","sourceRoot":"","sources":["../../../src/municipal/streets/streets.setters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,qBAAqB,CAAC,MAAM,CAAC,EAAE,EAC3C,UAAU,gBAAgB,KACzB,OAAO,CAAC,eAAe,CAEzB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bulkWriteStreets = void 0;
|
|
4
|
+
const streets_getters_1 = require("./streets.getters");
|
|
5
|
+
/**
|
|
6
|
+
* Generic batch write for the streets collection — a thin passthrough to the driver's
|
|
7
|
+
* bulkWrite, with no diffing/key-building/business logic. `operations` must be non-empty
|
|
8
|
+
* (the driver throws on an empty batch). Errors (including partial failures under
|
|
9
|
+
* `{ ordered: false }`) propagate unchanged, so callers can still catch `MongoBulkWriteError`.
|
|
10
|
+
*/
|
|
11
|
+
const bulkWriteStreets = async (operations, options) => {
|
|
12
|
+
return (0, streets_getters_1.getStreetsCollection)().bulkWrite(operations, options);
|
|
13
|
+
};
|
|
14
|
+
exports.bulkWriteStreets = bulkWriteStreets;
|
|
15
|
+
//# sourceMappingURL=streets.setters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streets.setters.js","sourceRoot":"","sources":["../../../src/municipal/streets/streets.setters.ts"],"names":[],"mappings":";;;AAEA,uDAAyD;AAEzD;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,KAAK,EACnC,UAA2C,EAC3C,OAA0B,EACA,EAAE;IAC5B,OAAO,IAAA,sCAAoB,GAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reconcile/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./reconcile.types"), exports);
|
|
18
|
+
__exportStar(require("./reconcile.ops"), exports);
|
|
19
|
+
__exportStar(require("./reconcile.diff"), exports);
|
|
20
|
+
__exportStar(require("./reconcile.execute"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reconcile/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,kDAAgC;AAChC,mDAAiC;AACjC,sDAAoC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Document } from "mongodb";
|
|
2
|
+
import { ReconcileConfig, ReconcileDiffResult } from "./reconcile.types";
|
|
3
|
+
export declare function computeReconcileDiff<TSource, TDb extends Document, TKey extends string | number>(config: ReconcileConfig<TSource, TDb, TKey>, now?: Date): ReconcileDiffResult<TDb>;
|
|
4
|
+
//# sourceMappingURL=reconcile.diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.diff.d.ts","sourceRoot":"","sources":["../../src/reconcile/reconcile.diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,GAAG,SAAS,QAAQ,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAC9F,MAAM,EAAE,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAC3C,GAAG,GAAE,IAAiB,GACrB,mBAAmB,CAAC,GAAG,CAAC,CA8C1B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeReconcileDiff = computeReconcileDiff;
|
|
4
|
+
function computeReconcileDiff(config, now = new Date()) {
|
|
5
|
+
const { source, dbRecords, getSourceKey, getDbKey, buildInsertOp, buildUpdateOp, buildDeactivateOp, shouldDeactivate = () => true, } = config;
|
|
6
|
+
const dbByKey = new Map(dbRecords.map((dbRecord) => [getDbKey(dbRecord), dbRecord]));
|
|
7
|
+
const sourceKeys = new Set();
|
|
8
|
+
const bulkOps = [];
|
|
9
|
+
const counts = { inserted: 0, updated: 0, deactivated: 0, exists: 0 };
|
|
10
|
+
for (const sourceRecord of source) {
|
|
11
|
+
const key = getSourceKey(sourceRecord);
|
|
12
|
+
sourceKeys.add(key);
|
|
13
|
+
const dbRecord = dbByKey.get(key);
|
|
14
|
+
if (!dbRecord) {
|
|
15
|
+
bulkOps.push(buildInsertOp(sourceRecord, now));
|
|
16
|
+
counts.inserted++;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const updateOp = buildUpdateOp(sourceRecord, dbRecord, now);
|
|
20
|
+
if (updateOp) {
|
|
21
|
+
bulkOps.push(updateOp);
|
|
22
|
+
counts.updated++;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
counts.exists++;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const dbRecord of dbRecords) {
|
|
29
|
+
if (!sourceKeys.has(getDbKey(dbRecord)) && shouldDeactivate(dbRecord)) {
|
|
30
|
+
bulkOps.push(buildDeactivateOp(dbRecord, now));
|
|
31
|
+
counts.deactivated++;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { bulkOps, counts };
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=reconcile.diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.diff.js","sourceRoot":"","sources":["../../src/reconcile/reconcile.diff.ts"],"names":[],"mappings":";;AAGA,oDAiDC;AAjDD,SAAgB,oBAAoB,CAClC,MAA2C,EAC3C,MAAY,IAAI,IAAI,EAAE;IAEtB,MAAM,EACJ,MAAM,EACN,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GAAG,GAAG,EAAE,CAAC,IAAI,GAC9B,GAAG,MAAM,CAAC;IAEX,MAAM,OAAO,GAAG,IAAI,GAAG,CAAY,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChG,MAAM,UAAU,GAAG,IAAI,GAAG,EAAQ,CAAC;IAEnC,MAAM,OAAO,GAAwC,EAAE,CAAC;IACxD,MAAM,MAAM,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAEtE,KAAK,MAAM,YAAY,IAAI,MAAM,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QACvC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,SAAS;QACX,CAAC;QAED,MAAM,QAAQ,GAAG,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC5D,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACvB,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BulkWriteOptions, Collection, Document } from "mongodb";
|
|
2
|
+
import { BulkWriteOp } from "./reconcile.types";
|
|
3
|
+
export interface ExecuteReconcileBulkWriteResult {
|
|
4
|
+
errors: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function executeReconcileBulkWrite<TDb extends Document>(collection: Collection<TDb>, bulkOps: BulkWriteOp<TDb>[], options?: BulkWriteOptions): Promise<ExecuteReconcileBulkWriteResult>;
|
|
7
|
+
//# sourceMappingURL=reconcile.execute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.execute.d.ts","sourceRoot":"","sources":["../../src/reconcile/reconcile.execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAuB,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAsB,yBAAyB,CAAC,GAAG,SAAS,QAAQ,EAClE,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,EAC3B,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,EAC3B,OAAO,GAAE,gBAAqC,GAC7C,OAAO,CAAC,+BAA+B,CAAC,CAa1C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeReconcileBulkWrite = executeReconcileBulkWrite;
|
|
4
|
+
const mongodb_1 = require("mongodb");
|
|
5
|
+
async function executeReconcileBulkWrite(collection, bulkOps, options = { ordered: false }) {
|
|
6
|
+
if (bulkOps.length === 0)
|
|
7
|
+
return { errors: [] };
|
|
8
|
+
try {
|
|
9
|
+
await collection.bulkWrite(bulkOps, options);
|
|
10
|
+
return { errors: [] };
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
if (err instanceof mongodb_1.MongoBulkWriteError) {
|
|
14
|
+
const writeErrors = [err.writeErrors].flat();
|
|
15
|
+
return { errors: writeErrors.map((writeError) => `Write error: ${writeError.errmsg}`) };
|
|
16
|
+
}
|
|
17
|
+
return { errors: [err instanceof Error ? err.message : String(err)] };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=reconcile.execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.execute.js","sourceRoot":"","sources":["../../src/reconcile/reconcile.execute.ts"],"names":[],"mappings":";;AAOA,8DAiBC;AAxBD,qCAAsF;AAO/E,KAAK,UAAU,yBAAyB,CAC7C,UAA2B,EAC3B,OAA2B,EAC3B,UAA4B,EAAE,OAAO,EAAE,KAAK,EAAE;IAE9C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAEhD,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACxB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,6BAAmB,EAAE,CAAC;YACvC,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,gBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;QAC1F,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document, Filter } from "mongodb";
|
|
2
|
+
import { BulkWriteOp } from "./reconcile.types";
|
|
3
|
+
/**
|
|
4
|
+
* updateOne with a plain $set — e.g. a deactivation:
|
|
5
|
+
* buildSetOp({ _id }, { isActive: false, updatedAt: now })
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildSetOp<T extends Document>(filter: Filter<T>, setFields: Partial<T>): BulkWriteOp<T>;
|
|
8
|
+
/**
|
|
9
|
+
* updateOne with $set + $setOnInsert + upsert:true.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildUpsertOp<T extends Document>(filter: Filter<T>, setFields: Partial<T>, setOnInsertFields?: Partial<T>): BulkWriteOp<T>;
|
|
12
|
+
//# sourceMappingURL=reconcile.ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.ops.d.ts","sourceRoot":"","sources":["../../src/reconcile/reconcile.ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAEvG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,QAAQ,EAC9C,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EACjB,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EACrB,iBAAiB,GAAE,OAAO,CAAC,CAAC,CAAM,GACjC,WAAW,CAAC,CAAC,CAAC,CAQhB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildSetOp = buildSetOp;
|
|
4
|
+
exports.buildUpsertOp = buildUpsertOp;
|
|
5
|
+
/**
|
|
6
|
+
* updateOne with a plain $set — e.g. a deactivation:
|
|
7
|
+
* buildSetOp({ _id }, { isActive: false, updatedAt: now })
|
|
8
|
+
*/
|
|
9
|
+
function buildSetOp(filter, setFields) {
|
|
10
|
+
return { updateOne: { filter, update: { $set: setFields } } };
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* updateOne with $set + $setOnInsert + upsert:true.
|
|
14
|
+
*/
|
|
15
|
+
function buildUpsertOp(filter, setFields, setOnInsertFields = {}) {
|
|
16
|
+
return {
|
|
17
|
+
updateOne: {
|
|
18
|
+
filter,
|
|
19
|
+
update: { $set: setFields, $setOnInsert: setOnInsertFields },
|
|
20
|
+
upsert: true,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=reconcile.ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.ops.js","sourceRoot":"","sources":["../../src/reconcile/reconcile.ops.ts"],"names":[],"mappings":";;AAOA,gCAEC;AAKD,sCAYC;AAvBD;;;GAGG;AACH,SAAgB,UAAU,CAAqB,MAAiB,EAAE,SAAqB;IACrF,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAChE,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAC3B,MAAiB,EACjB,SAAqB,EACrB,oBAAgC,EAAE;IAElC,OAAO;QACL,SAAS,EAAE;YACT,MAAM;YACN,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE;YAC5D,MAAM,EAAE,IAAI;SACb;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AnyBulkWriteOperation, Document } from "mongodb";
|
|
2
|
+
export type BulkWriteOp<T extends Document> = AnyBulkWriteOperation<T>;
|
|
3
|
+
export interface ReconcileCounts {
|
|
4
|
+
inserted: number;
|
|
5
|
+
updated: number;
|
|
6
|
+
deactivated: number;
|
|
7
|
+
exists: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ReconcileDiffResult<TDb extends Document> {
|
|
10
|
+
bulkOps: BulkWriteOp<TDb>[];
|
|
11
|
+
counts: ReconcileCounts;
|
|
12
|
+
}
|
|
13
|
+
export interface ReconcileConfig<TSource, TDb extends Document, TKey extends string | number> {
|
|
14
|
+
source: TSource[];
|
|
15
|
+
dbRecords: TDb[];
|
|
16
|
+
getSourceKey: (source: TSource) => TKey;
|
|
17
|
+
getDbKey: (dbRecord: TDb) => TKey;
|
|
18
|
+
buildInsertOp: (source: TSource, now: Date) => BulkWriteOp<TDb>;
|
|
19
|
+
/** Return null when unchanged — counted as `exists`, no op emitted. */
|
|
20
|
+
buildUpdateOp: (source: TSource, existing: TDb, now: Date) => BulkWriteOp<TDb> | null;
|
|
21
|
+
/**
|
|
22
|
+
* Called for every dbRecord missing from source (and passing shouldDeactivate).
|
|
23
|
+
* The caller decides the op shape entirely — typically via buildSetOp.
|
|
24
|
+
*/
|
|
25
|
+
buildDeactivateOp: (dbRecord: TDb, now: Date) => BulkWriteOp<TDb>;
|
|
26
|
+
/**
|
|
27
|
+
* Whether a missing dbRecord should even be considered for deactivation.
|
|
28
|
+
* Defaults to always true — core-db has no opinion on what "already inactive" means.
|
|
29
|
+
*/
|
|
30
|
+
shouldDeactivate?: (dbRecord: TDb) => boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=reconcile.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.types.d.ts","sourceRoot":"","sources":["../../src/reconcile/reconcile.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB,CAAC,GAAG,SAAS,QAAQ;IACvD,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,eAAe,CAAC,OAAO,EAAE,GAAG,SAAS,QAAQ,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM;IAC1F,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;IAChE,uEAAuE;IACvE,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,KAAK,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACtF;;;OAGG;IACH,iBAAiB,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;IAClE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,OAAO,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.types.js","sourceRoot":"","sources":["../../src/reconcile/reconcile.types.ts"],"names":[],"mappings":""}
|
|
@@ -33,9 +33,23 @@ export type Call = {
|
|
|
33
33
|
isConferenceCall?: boolean;
|
|
34
34
|
conferenceRole?: ConferenceRole;
|
|
35
35
|
redirectedCall?: boolean;
|
|
36
|
+
/** Present only on redirected calls: what the dialled leg did. */
|
|
37
|
+
redirectCallLog?: RedirectCallLog;
|
|
36
38
|
toolExecutions?: ToolExecution[];
|
|
37
39
|
transcriptionComparison?: Record<string, TranscriptionSegment[]>;
|
|
38
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* The outcome of the <Dial> that transferred a call, reported by Twilio when the
|
|
43
|
+
* dialled leg ends. `durationSeconds` is the bridged time, which is 0 when the
|
|
44
|
+
* destination never answered.
|
|
45
|
+
*/
|
|
46
|
+
export type RedirectCallLog = {
|
|
47
|
+
childCallSid?: string;
|
|
48
|
+
to?: string;
|
|
49
|
+
status: CallStatus;
|
|
50
|
+
durationSeconds: number;
|
|
51
|
+
endedAt: Date;
|
|
52
|
+
};
|
|
39
53
|
export type ToolExecution = {
|
|
40
54
|
toolName: string;
|
|
41
55
|
executedAt: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calls.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/calls/calls.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,cAAc,GACtB,OAAO,wBAAwB,GAC/B,OAAO,0BAA0B,GACjC,IAAI,CAAC;AAET,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAElF,MAAM,MAAM,IAAI,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACvC,MAAM,CAAC,EAAE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AAC;CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ export const MODELS_COLLECTION = "models";
|
|
|
2
2
|
|
|
3
3
|
export const MODEL_TYPES = ["realtime", "stt"] as const;
|
|
4
4
|
|
|
5
|
-
export const REALTIME_MODEL_PROVIDERS = ["openai", "gemini"] as const;
|
|
5
|
+
export const REALTIME_MODEL_PROVIDERS = ["openai", "gemini", "xai"] as const;
|
|
6
6
|
export const STT_MODEL_PROVIDERS = [
|
|
7
7
|
"openai-stt",
|
|
8
8
|
"google-stt",
|
|
@@ -44,10 +44,25 @@ export type Call = {
|
|
|
44
44
|
isConferenceCall?: boolean;
|
|
45
45
|
conferenceRole?: ConferenceRole;
|
|
46
46
|
redirectedCall?: boolean;
|
|
47
|
+
/** Present only on redirected calls: what the dialled leg did. */
|
|
48
|
+
redirectCallLog?: RedirectCallLog;
|
|
47
49
|
toolExecutions?: ToolExecution[];
|
|
48
50
|
transcriptionComparison?: Record<string, TranscriptionSegment[]>;
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The outcome of the <Dial> that transferred a call, reported by Twilio when the
|
|
55
|
+
* dialled leg ends. `durationSeconds` is the bridged time, which is 0 when the
|
|
56
|
+
* destination never answered.
|
|
57
|
+
*/
|
|
58
|
+
export type RedirectCallLog = {
|
|
59
|
+
childCallSid?: string;
|
|
60
|
+
to?: string;
|
|
61
|
+
status: CallStatus;
|
|
62
|
+
durationSeconds: number;
|
|
63
|
+
endedAt: Date;
|
|
64
|
+
};
|
|
65
|
+
|
|
51
66
|
export type ToolExecution = {
|
|
52
67
|
toolName: string;
|
|
53
68
|
executedAt: Date;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.quota.constants.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.quota.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.quota.constants.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.quota.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,GAAG,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ClientQuotaNotifications, ClientQuotaState, ClientQuotaStatus, QuotaThresholdAlert } from "./clients.quota.types";
|
|
2
|
-
export declare const computeClientQuotaStatus: (quota: ClientQuotaState | null) => ClientQuotaStatus;
|
|
3
|
-
export declare const getQuotaAlerts: (quota?: ClientQuotaState) => QuotaThresholdAlert[];
|
|
4
|
-
export declare const findFullQuotaAlertIndex: (alerts: QuotaThresholdAlert[]) => number;
|
|
5
|
-
export declare const getFullQuotaAlert: (quota?: ClientQuotaState) => QuotaThresholdAlert | undefined;
|
|
6
|
-
export declare const isFullQuotaAlert: (thresholdPct: number) => boolean;
|
|
7
|
-
export declare const toClientQuotaNotifications: (quota: ClientQuotaState | null) => ClientQuotaNotifications;
|
|
8
|
-
//# sourceMappingURL=clients.quota.utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.quota.utils.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.quota.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAQ/B,eAAO,MAAM,wBAAwB,GACnC,OAAO,gBAAgB,GAAG,IAAI,KAC7B,iBAiBF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,gBAAgB,KAAG,mBAAmB,EAClC,CAAC;AAE5C,eAAO,MAAM,uBAAuB,GAAI,QAAQ,mBAAmB,EAAE,KAAG,MACP,CAAC;AAElE,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,gBAAgB,KACvB,mBAAmB,GAAG,SAIxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,cAAc,MAAM,KAAG,OAClB,CAAC;AAEvC,eAAO,MAAM,0BAA0B,GACrC,OAAO,gBAAgB,GAAG,IAAI,KAC7B,wBASD,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toClientQuotaNotifications = exports.isFullQuotaAlert = exports.getFullQuotaAlert = exports.findFullQuotaAlertIndex = exports.getQuotaAlerts = exports.computeClientQuotaStatus = void 0;
|
|
4
|
-
const clients_quota_constants_1 = require("./clients.quota.constants");
|
|
5
|
-
const computeUsagePct = (usedQuota, totalQuota) => totalQuota > 0 ? Math.round((usedQuota / totalQuota) * 100) : 0;
|
|
6
|
-
const isPastExpiration = (expiresAt) => expiresAt ? Date.now() > new Date(expiresAt).getTime() : false;
|
|
7
|
-
const computeClientQuotaStatus = (quota) => {
|
|
8
|
-
if (!quota) {
|
|
9
|
-
return { hasQuota: false };
|
|
10
|
-
}
|
|
11
|
-
const totalQuota = quota.totalQuota;
|
|
12
|
-
const usedQuota = quota.usedQuota ?? 0;
|
|
13
|
-
return {
|
|
14
|
-
hasQuota: true,
|
|
15
|
-
totalQuota,
|
|
16
|
-
usedQuota,
|
|
17
|
-
pct: computeUsagePct(usedQuota, totalQuota),
|
|
18
|
-
expiresAt: quota.expiresAt ? new Date(quota.expiresAt).toISOString() : null,
|
|
19
|
-
isExceeded: usedQuota >= totalQuota,
|
|
20
|
-
isExpired: isPastExpiration(quota.expiresAt),
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
exports.computeClientQuotaStatus = computeClientQuotaStatus;
|
|
24
|
-
const getQuotaAlerts = (quota) => quota?.alerts?.length ? quota.alerts : [];
|
|
25
|
-
exports.getQuotaAlerts = getQuotaAlerts;
|
|
26
|
-
const findFullQuotaAlertIndex = (alerts) => alerts.findIndex((a) => a.thresholdPct >= clients_quota_constants_1.FULL_QUOTA_THRESHOLD);
|
|
27
|
-
exports.findFullQuotaAlertIndex = findFullQuotaAlertIndex;
|
|
28
|
-
const getFullQuotaAlert = (quota) => {
|
|
29
|
-
const alerts = (0, exports.getQuotaAlerts)(quota);
|
|
30
|
-
const index = (0, exports.findFullQuotaAlertIndex)(alerts);
|
|
31
|
-
return index >= 0 ? alerts[index] : undefined;
|
|
32
|
-
};
|
|
33
|
-
exports.getFullQuotaAlert = getFullQuotaAlert;
|
|
34
|
-
const isFullQuotaAlert = (thresholdPct) => thresholdPct >= clients_quota_constants_1.FULL_QUOTA_THRESHOLD;
|
|
35
|
-
exports.isFullQuotaAlert = isFullQuotaAlert;
|
|
36
|
-
const toClientQuotaNotifications = (quota) => ({
|
|
37
|
-
alerts: (0, exports.getQuotaAlerts)(quota ?? undefined).map(({ thresholdPct, recipientEmails, thresholdSent }) => ({
|
|
38
|
-
thresholdPct,
|
|
39
|
-
recipientEmails: recipientEmails ?? [],
|
|
40
|
-
...(thresholdSent ? { thresholdSent: true } : {}),
|
|
41
|
-
})),
|
|
42
|
-
...(quota?.expiredSent ? { expiredSent: true } : {}),
|
|
43
|
-
});
|
|
44
|
-
exports.toClientQuotaNotifications = toClientQuotaNotifications;
|
|
45
|
-
//# sourceMappingURL=clients.quota.utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clients.quota.utils.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.quota.utils.ts"],"names":[],"mappings":";;;AAAA,uEAAiE;AAQjE,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAE,UAAkB,EAAU,EAAE,CACxE,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAElE,MA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