@talkpilot/core-db 1.3.21 → 1.3.23
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 +32 -0
- package/dist/talkpilot/calls/calls.constants.d.ts +12 -0
- package/dist/talkpilot/calls/calls.constants.d.ts.map +1 -1
- package/dist/talkpilot/calls/calls.constants.js +13 -1
- package/dist/talkpilot/calls/calls.constants.js.map +1 -1
- package/dist/talkpilot/calls/calls.types.d.ts +3 -3
- package/dist/talkpilot/calls/calls.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/talkpilot/calls/calls.constants.ts +14 -0
- package/src/talkpilot/calls/calls.types.ts +3 -11
package/README.md
CHANGED
|
@@ -153,6 +153,8 @@ Refer to `DEVELOPMENT.md` for the full walkthrough, token instructions, and fact
|
|
|
153
153
|
| 1.3.19 | WebsiteTalk flow provisioning (WTIS activate-scan): optional `flowId` on `WebsiteTalkProduct`; `bindClientPhoneToFlow(clientId, flowId)` sets `flow_id` on the client's primary `phone_numbers` document so inbound calls route to the provisioned TalkPilot flow. |
|
|
154
154
|
| 1.3.20 | `FINAL_STATUSES` constant for terminal Twilio call statuses (`no-answer`, `completed`, `busy`, `failed`, `canceled`) in `calls.constants`. |
|
|
155
155
|
| 1.3.21 | Added `ToolExecutionStep` type, `steps` field to `ToolExecution`, and `pushToolExecution` getter (CP-1093). Added `ToolExecutionStepLevel` named type and `TOOL_EXECUTIONS_DEFAULT_LIMIT`/`SKIP` constants. Widened `ToolExecutionStep.data` to `Record<string, unknown> \| string` — allows plain string steps alongside structured JSON. Added optional `ToolExecutionStep.payload` for structured drill-down data. |
|
|
156
|
+
| 1.3.22 | `CallsFilterParams.status` typed as `CallStatus` instead of `string` — aligns call-query filters with the Twilio status union from 1.3.17. |
|
|
157
|
+
| 1.3.23 | Merge of 1.3.21 and 1.3.22 — combines the `ToolExecutionStep`/`steps`/`pushToolExecution` work (CP-1093) with the `CallsFilterParams.status: CallStatus` fix. Adds `CallStatusValues` (const object) with `CallStatus` and `ALL_CALL_STATUSES` derived from it. `CallStatus` still does not include `"redirected"` — tracked separately. |
|
|
156
158
|
### 1.1.9
|
|
157
159
|
|
|
158
160
|
1. `npm run build`.
|
|
@@ -488,6 +490,36 @@ Added `ToolExecutionStep` type, `steps` field on `ToolExecution`, `pushToolExecu
|
|
|
488
490
|
|
|
489
491
|
No — purely additive. All new fields are optional and existing documents continue to work unchanged.
|
|
490
492
|
|
|
493
|
+
### 1.3.22 — `CallsFilterParams.status` type alignment
|
|
494
|
+
|
|
495
|
+
Tightens the `status` filter field on `CallsFilterParams` from `string` to `CallStatus` so call-query consumers get compile-time validation against the Twilio-aligned status union introduced in 1.3.17.
|
|
496
|
+
|
|
497
|
+
**Changed**
|
|
498
|
+
|
|
499
|
+
| Area | What |
|
|
500
|
+
| --- | --- |
|
|
501
|
+
| `CallsFilterParams.status` | `string` → `CallStatus` |
|
|
502
|
+
|
|
503
|
+
**Do I need to update my app?**
|
|
504
|
+
|
|
505
|
+
Only if you pass a non-`CallStatus` string to `CallsFilterParams.status` — fix the value or cast. No runtime behavior change.
|
|
506
|
+
|
|
507
|
+
### 1.3.23 — Merge of 1.3.21 and 1.3.22, plus `CallStatusValues`
|
|
508
|
+
|
|
509
|
+
Combines the CP-1093 tool-execution-steps work (1.3.21) with the `CallsFilterParams.status` type fix (1.3.22); both were published independently from diverging branches.
|
|
510
|
+
|
|
511
|
+
**Added**
|
|
512
|
+
|
|
513
|
+
| Export | Purpose |
|
|
514
|
+
| --- | --- |
|
|
515
|
+
| `CallStatusValues` | `as const` object mapping named keys (`Completed`, `Failed`, ...) to the 9 raw Twilio-aligned status strings — gives enum-like dot access (`CallStatusValues.Completed`) while `CallStatus` stays a plain string-literal union (no breaking change for existing `status === "completed"` comparisons). |
|
|
516
|
+
| `CallStatus` | Now derived from `CallStatusValues` (`(typeof CallStatusValues)[keyof typeof CallStatusValues]`) instead of a hand-written union — single source of truth. |
|
|
517
|
+
| `ALL_CALL_STATUSES` | `CallStatus[]` — `Object.values(CallStatusValues)`, for runtime validation of raw input (e.g. HTTP query params) against `CallStatus`. |
|
|
518
|
+
|
|
519
|
+
**Do I need to update my app?** No — `CallStatus` is structurally identical to before (same 9 string literals); this is a source-only refactor.
|
|
520
|
+
|
|
521
|
+
`CallStatus` still does not include `"redirected"` — tracked separately.
|
|
522
|
+
|
|
491
523
|
## 🛠 CI/CD & deployment
|
|
492
524
|
|
|
493
525
|
- This package is consumed by Cloud Build-based services (TalkPilot Server, MIS, CIS) as a dependency when Docker images are built. Keep `dist/` in sync with your builds because the compiled artifact is what downstream services install.
|
|
@@ -20,4 +20,16 @@ export declare const TREND_MONTH_BUCKET_MIN_MONTHS = 6;
|
|
|
20
20
|
export declare const TREND_WEEK_BUCKET_MIN_MONTHS = 3;
|
|
21
21
|
export declare const TOOL_EXECUTIONS_DEFAULT_SKIP = 0;
|
|
22
22
|
export declare const TOOL_EXECUTIONS_DEFAULT_LIMIT = 50;
|
|
23
|
+
export declare const CallStatusValues: {
|
|
24
|
+
readonly Initiated: "initiated";
|
|
25
|
+
readonly Ringing: "ringing";
|
|
26
|
+
readonly InProgress: "in-progress";
|
|
27
|
+
readonly Answered: "answered";
|
|
28
|
+
readonly Completed: "completed";
|
|
29
|
+
readonly Busy: "busy";
|
|
30
|
+
readonly NoAnswer: "no-answer";
|
|
31
|
+
readonly Failed: "failed";
|
|
32
|
+
readonly Canceled: "canceled";
|
|
33
|
+
};
|
|
34
|
+
export declare const ALL_CALL_STATUSES: ("in-progress" | "answered" | "no-answer" | "completed" | "busy" | "failed" | "canceled" | "initiated" | "ringing")[];
|
|
23
35
|
//# sourceMappingURL=calls.constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calls.constants.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/calls/calls.constants.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,eAAO,MAAM,wBAAwB,EAAG,UAAmB,CAAC;AAE5D,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,EAAG,YAAqB,CAAC;AAEhE,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,sCAAuC,CAAC;AAErE,4EAA4E;AAC5E,eAAO,MAAM,cAAc,mEAMjB,CAAC;AAEX,6BAA6B;AAC7B,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,6BAA6B,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"calls.constants.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/calls/calls.constants.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,eAAO,MAAM,wBAAwB,EAAG,UAAmB,CAAC;AAE5D,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,EAAG,YAAqB,CAAC;AAEhE,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,sCAAuC,CAAC;AAErE,4EAA4E;AAC5E,eAAO,MAAM,cAAc,mEAMjB,CAAC;AAEX,6BAA6B;AAC7B,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,QAAS,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAC/C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUnB,CAAC;AAEX,eAAO,MAAM,iBAAiB,uHAAkC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOOL_EXECUTIONS_DEFAULT_LIMIT = exports.TOOL_EXECUTIONS_DEFAULT_SKIP = exports.TREND_WEEK_BUCKET_MIN_MONTHS = exports.TREND_MONTH_BUCKET_MIN_MONTHS = exports.STATS_MAX_TIME_MS = exports.HOURS_PER_DAY = exports.FINAL_STATUSES = exports.IN_CALL_STATUSES = exports.CONFERENCE_ROLE_SUPERVISOR = exports.CONFERENCE_ROLE_CUSTOMER = void 0;
|
|
3
|
+
exports.ALL_CALL_STATUSES = exports.CallStatusValues = exports.TOOL_EXECUTIONS_DEFAULT_LIMIT = exports.TOOL_EXECUTIONS_DEFAULT_SKIP = exports.TREND_WEEK_BUCKET_MIN_MONTHS = exports.TREND_MONTH_BUCKET_MIN_MONTHS = exports.STATS_MAX_TIME_MS = exports.HOURS_PER_DAY = exports.FINAL_STATUSES = exports.IN_CALL_STATUSES = exports.CONFERENCE_ROLE_SUPERVISOR = exports.CONFERENCE_ROLE_CUSTOMER = void 0;
|
|
4
4
|
/** Customer role within a conference call. */
|
|
5
5
|
exports.CONFERENCE_ROLE_CUSTOMER = "customer";
|
|
6
6
|
/** Supervisor role within a conference call. */
|
|
@@ -29,4 +29,16 @@ exports.TREND_MONTH_BUCKET_MIN_MONTHS = 6;
|
|
|
29
29
|
exports.TREND_WEEK_BUCKET_MIN_MONTHS = 3;
|
|
30
30
|
exports.TOOL_EXECUTIONS_DEFAULT_SKIP = 0;
|
|
31
31
|
exports.TOOL_EXECUTIONS_DEFAULT_LIMIT = 50;
|
|
32
|
+
exports.CallStatusValues = {
|
|
33
|
+
Initiated: "initiated",
|
|
34
|
+
Ringing: "ringing",
|
|
35
|
+
InProgress: "in-progress",
|
|
36
|
+
Answered: "answered",
|
|
37
|
+
Completed: "completed",
|
|
38
|
+
Busy: "busy",
|
|
39
|
+
NoAnswer: "no-answer",
|
|
40
|
+
Failed: "failed",
|
|
41
|
+
Canceled: "canceled",
|
|
42
|
+
};
|
|
43
|
+
exports.ALL_CALL_STATUSES = Object.values(exports.CallStatusValues);
|
|
32
44
|
//# sourceMappingURL=calls.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calls.constants.js","sourceRoot":"","sources":["../../../src/talkpilot/calls/calls.constants.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AACjC,QAAA,wBAAwB,GAAG,UAAmB,CAAC;AAE5D,gDAAgD;AACnC,QAAA,0BAA0B,GAAG,YAAqB,CAAC;AAEhE,wEAAwE;AAC3D,QAAA,gBAAgB,GAAG,CAAC,aAAa,EAAE,UAAU,CAAU,CAAC;AAErE,4EAA4E;AAC/D,QAAA,cAAc,GAAG;IAC5B,WAAW;IACX,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;CACF,CAAC;AAEX,6BAA6B;AAChB,QAAA,aAAa,GAAG,EAAE,CAAC;AAEhC,iEAAiE;AACpD,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;;GAKG;AACU,QAAA,6BAA6B,GAAG,CAAC,CAAC;AAClC,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAEjC,QAAA,4BAA4B,GAAG,CAAC,CAAC;AACjC,QAAA,6BAA6B,GAAG,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"calls.constants.js","sourceRoot":"","sources":["../../../src/talkpilot/calls/calls.constants.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AACjC,QAAA,wBAAwB,GAAG,UAAmB,CAAC;AAE5D,gDAAgD;AACnC,QAAA,0BAA0B,GAAG,YAAqB,CAAC;AAEhE,wEAAwE;AAC3D,QAAA,gBAAgB,GAAG,CAAC,aAAa,EAAE,UAAU,CAAU,CAAC;AAErE,4EAA4E;AAC/D,QAAA,cAAc,GAAG;IAC5B,WAAW;IACX,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;CACF,CAAC;AAEX,6BAA6B;AAChB,QAAA,aAAa,GAAG,EAAE,CAAC;AAEhC,iEAAiE;AACpD,QAAA,iBAAiB,GAAG,MAAM,CAAC;AAExC;;;;;GAKG;AACU,QAAA,6BAA6B,GAAG,CAAC,CAAC;AAClC,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAEjC,QAAA,4BAA4B,GAAG,CAAC,CAAC;AACjC,QAAA,6BAA6B,GAAG,EAAE,CAAC;AAEnC,QAAA,gBAAgB,GAAG;IAC9B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAEE,QAAA,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ObjectId, Sort, WithId } from "mongodb";
|
|
2
2
|
import { TranscriptionSegment } from "../results";
|
|
3
3
|
import { LeadProperty } from "../leads";
|
|
4
|
-
import { CONFERENCE_ROLE_CUSTOMER, CONFERENCE_ROLE_SUPERVISOR } from "./calls.constants";
|
|
4
|
+
import { CallStatusValues, CONFERENCE_ROLE_CUSTOMER, CONFERENCE_ROLE_SUPERVISOR } from "./calls.constants";
|
|
5
5
|
export type ConferenceRole = typeof CONFERENCE_ROLE_CUSTOMER | typeof CONFERENCE_ROLE_SUPERVISOR | null;
|
|
6
|
-
export type CallStatus =
|
|
6
|
+
export type CallStatus = (typeof CallStatusValues)[keyof typeof CallStatusValues];
|
|
7
7
|
export type Call = {
|
|
8
8
|
callSid: string;
|
|
9
9
|
flowId: ObjectId;
|
|
@@ -76,7 +76,7 @@ export type CallsFilterParams = {
|
|
|
76
76
|
callSid?: string;
|
|
77
77
|
startDate?: Date;
|
|
78
78
|
endDate?: Date;
|
|
79
|
-
status?:
|
|
79
|
+
status?: CallStatus;
|
|
80
80
|
customerPhoneNumber?: string;
|
|
81
81
|
agentPhoneNumber?: string;
|
|
82
82
|
flowId?: string;
|
|
@@ -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,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,
|
|
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,EA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CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,qBAAqB,GACrB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,SAAS,GACT,QAAQ,GACR,UAAU,GACV,OAAO,GACP,UAAU,GACV,KAAK,GACL,WAAW,CAAC;AAEhB,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAExE,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAEnC,qDAAqD;AACrD,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;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
|
@@ -33,3 +33,17 @@ export const TREND_WEEK_BUCKET_MIN_MONTHS = 3;
|
|
|
33
33
|
|
|
34
34
|
export const TOOL_EXECUTIONS_DEFAULT_SKIP = 0;
|
|
35
35
|
export const TOOL_EXECUTIONS_DEFAULT_LIMIT = 50;
|
|
36
|
+
|
|
37
|
+
export const CallStatusValues = {
|
|
38
|
+
Initiated: "initiated",
|
|
39
|
+
Ringing: "ringing",
|
|
40
|
+
InProgress: "in-progress",
|
|
41
|
+
Answered: "answered",
|
|
42
|
+
Completed: "completed",
|
|
43
|
+
Busy: "busy",
|
|
44
|
+
NoAnswer: "no-answer",
|
|
45
|
+
Failed: "failed",
|
|
46
|
+
Canceled: "canceled",
|
|
47
|
+
} as const;
|
|
48
|
+
|
|
49
|
+
export const ALL_CALL_STATUSES = Object.values(CallStatusValues);
|
|
@@ -3,6 +3,7 @@ import { TranscriptionSegment } from "../results";
|
|
|
3
3
|
import { LeadProperty } from "../leads";
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
CallStatusValues,
|
|
6
7
|
CONFERENCE_ROLE_CUSTOMER,
|
|
7
8
|
CONFERENCE_ROLE_SUPERVISOR,
|
|
8
9
|
} from "./calls.constants";
|
|
@@ -12,16 +13,7 @@ export type ConferenceRole =
|
|
|
12
13
|
| typeof CONFERENCE_ROLE_SUPERVISOR
|
|
13
14
|
| null;
|
|
14
15
|
|
|
15
|
-
export type CallStatus =
|
|
16
|
-
| "initiated"
|
|
17
|
-
| "ringing"
|
|
18
|
-
| "in-progress"
|
|
19
|
-
| "answered"
|
|
20
|
-
| "completed"
|
|
21
|
-
| "busy"
|
|
22
|
-
| "no-answer"
|
|
23
|
-
| "failed"
|
|
24
|
-
| "canceled";
|
|
16
|
+
export type CallStatus = (typeof CallStatusValues)[keyof typeof CallStatusValues];
|
|
25
17
|
|
|
26
18
|
export type Call = {
|
|
27
19
|
callSid: string;
|
|
@@ -99,7 +91,7 @@ export type CallsFilterParams = {
|
|
|
99
91
|
callSid?: string;
|
|
100
92
|
startDate?: Date;
|
|
101
93
|
endDate?: Date;
|
|
102
|
-
status?:
|
|
94
|
+
status?: CallStatus;
|
|
103
95
|
customerPhoneNumber?: string;
|
|
104
96
|
agentPhoneNumber?: string;
|
|
105
97
|
flowId?: string;
|