@talkpilot/core-db 1.2.2 → 1.3.1

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_OLD.md CHANGED
@@ -1,160 +1,160 @@
1
- # @talkpilot/core-db
2
-
3
- [NPM Version](https://www.npmjs.com/package/@talkpilot/core-db)
4
-
5
- A TypeScript-based core database management package designed to provide centralized database connections, ORM integrations, and client utilities for other projects. This package manages connections to both **TalkPilot** and **Municipal** MongoDB databases.
6
-
7
- ## Features
8
-
9
- - 🚀 **Multi-Domain Database Management**: Centralized handlers for both TalkPilot and Municipal Data domains.
10
- - 📦 **Reusable Getters**: Standardized functions for fetching data from various collections (calls, agents, leads, cities, etc.).
11
- - 🏗️ **Type-safe**: Built with TypeScript for full type safety across all your database interactions.
12
- - 🛠️ **Environment Aware**: Configurable via environment variables or explicit parameters.
13
-
14
- ## Installation
15
-
16
- This package is intended to be used as a dependency in other projects. If you're working locally, you can install it using a file path:
17
-
18
- ```bash
19
- # In your other project:
20
- npm install /path/to/core-db
21
- # or if published to a registry:
22
- npm install @talkpilot/core-db
23
- # or via GitHub
24
- npm install github:talkpilot/core-db
25
- ```
26
-
27
- ## Quick Start
28
-
29
- ### 1. Initialize Database Connections
30
-
31
- You must initialize the database clients before using any of the getters.
32
-
33
- ```typescript
34
- import { mongodbClient, municipalDataMongodbClient } from '@talkpilot/core-db';
35
-
36
- async function bootstrap() {
37
- // Initialize TalkPilot DB
38
- await mongodbClient.connect(process.env.TALKPILOT_MONGO_URI);
39
-
40
- // Initialize Municipal Data DB (optional)
41
- await municipalDataMongodbClient.connect(process.env.MUNICIPAL_MONGO_URI);
42
- }
43
-
44
- bootstrap().catch(console.error);
45
- ```
46
-
47
- ### 2. Using Getters
48
-
49
- Once initialized, you can import and use any of the exported database getters.
50
-
51
- ```typescript
52
- import { findAgents, findCities } from '@talkpilot/core-db';
53
-
54
- async function getSummary() {
55
- // Get all agents from TalkPilot DB
56
- const agents = await findAgents();
57
- console.log('Total Agents:', agents.length);
58
-
59
- // Get all cities from Municipal Data DB
60
- const cities = await findCities();
61
- console.log('Total Cities:', cities.length);
62
- }
63
- ```
64
-
65
- ## Available Domains
66
-
67
- The package exports two main sets of tools:
68
-
69
- ### TalkPilot Domain
70
-
71
- Includes access to:
72
-
73
- - `agents`, `calls`, `clients`, `flows`, `leads`, `phone_numbers`, `plans`, `results`, `sessions`, `subscriptions`, etc.
74
- - Exported as root level functions or via `mongodbClient`.
75
-
76
- ### Municipal Domain
77
-
78
- Includes access to:
79
-
80
- - `cities`, `streets`, `departmentsSubjects`, `tickets`.
81
- - Functions are prefixed where necessary or accessible via `getMunicipalDataDb`.
82
-
83
- ## Environment Variables
84
-
85
- The clients will automatically attempt to use the following environment variables if no URI is provided to the `connect()` method:
86
-
87
- - `MONGO_URI` or `MONGODB_URI`: Primary MongoDB connection string.
88
- - `MONGODB_DB_NAME`: Database name (defaults to 'municipal-data' for the municipal client if not specified).
89
-
90
- ## Development
91
-
92
- ### Setup
93
-
94
- 1. Clone the repository and install dependencies:
95
- ```bash
96
- git clone https://github.com/talkpilot/core-db.git
97
- cd core-db
98
- npm install
99
- ```
100
- 2. Build the project:
101
- ```bash
102
- npm run build
103
- ```
104
-
105
- This will generate the `dist/` directory with the compiled JavaScript and type definitions.
106
-
107
- ### Publishing New Versions
108
-
109
- To publish a new version of the package:
110
-
111
- 1. **Test your changes**:
112
- ```bash
113
- npm test
114
- ```
115
- 2. **Update the version**:
116
- ```bash
117
- # Bumps patch version (0.1.0 -> 0.1.1)
118
- npm version patch
119
- # Or for minor changes (0.1.0 -> 0.2.0)
120
- # npm version minor
121
- # Or for major changes (0.1.0 -> 1.0.0)
122
- # npm version major
123
- ```
124
- 3. **Publish to npm**:
125
- Ensure you have the shared team token in your `~/.npmrc` (see [Development Guide](./DEVELOPMENT.md#team-access--authentication)).
126
- 4. **Update in other repos**:
127
- ```bash
128
- npm update @talkpilot/core-db
129
- ```
130
-
131
- ## License
132
-
133
- MIT
134
-
135
- ---
136
-
137
- **Interested in contributing?** Check out our [Development Guide](./DEVELOPMENT.md) for standards and setup instructions.
138
-
139
- ## Release Notes
140
-
141
- ### 1.1.9
142
-
143
- - `getPhoneNumbersForFlows(clientId)` — lists each phone number linked to a flow for that client (newest first), with `flowId`, `phoneNumber`, and `isPrimary`.
144
- ### 1.1.5
145
-
146
- - `createPurchasedPhoneNumber` for API-bought numbers (Twilio/Telnyx metadata); optional `flowId` until linked to a flow. Types/schema updated accordingly.
147
-
148
- ### 1.0.16
149
-
150
- - Fixed critical issues present in version 1.0.15.
151
- - **Warning**: Version 1.0.15 is bugged and should not be used. Please use at least version 1.0.16.
152
-
153
- ### 1.0.20
154
-
155
- - Added to Moked106Config this param: withNeedAttentionCalls
156
- - withNeedAttentionCalls?: boolean
157
-
158
- ### 1.0.27
159
- - Added an optional `language` field to `ClientConfig` (e.g. Hebrew/English/Russian/French/Spanish) and updated tests.
160
-
1
+ # @talkpilot/core-db
2
+
3
+ [NPM Version](https://www.npmjs.com/package/@talkpilot/core-db)
4
+
5
+ A TypeScript-based core database management package designed to provide centralized database connections, ORM integrations, and client utilities for other projects. This package manages connections to both **TalkPilot** and **Municipal** MongoDB databases.
6
+
7
+ ## Features
8
+
9
+ - 🚀 **Multi-Domain Database Management**: Centralized handlers for both TalkPilot and Municipal Data domains.
10
+ - 📦 **Reusable Getters**: Standardized functions for fetching data from various collections (calls, agents, leads, cities, etc.).
11
+ - 🏗️ **Type-safe**: Built with TypeScript for full type safety across all your database interactions.
12
+ - 🛠️ **Environment Aware**: Configurable via environment variables or explicit parameters.
13
+
14
+ ## Installation
15
+
16
+ This package is intended to be used as a dependency in other projects. If you're working locally, you can install it using a file path:
17
+
18
+ ```bash
19
+ # In your other project:
20
+ npm install /path/to/core-db
21
+ # or if published to a registry:
22
+ npm install @talkpilot/core-db
23
+ # or via GitHub
24
+ npm install github:talkpilot/core-db
25
+ ```
26
+
27
+ ## Quick Start
28
+
29
+ ### 1. Initialize Database Connections
30
+
31
+ You must initialize the database clients before using any of the getters.
32
+
33
+ ```typescript
34
+ import { mongodbClient, municipalDataMongodbClient } from '@talkpilot/core-db';
35
+
36
+ async function bootstrap() {
37
+ // Initialize TalkPilot DB
38
+ await mongodbClient.connect(process.env.TALKPILOT_MONGO_URI);
39
+
40
+ // Initialize Municipal Data DB (optional)
41
+ await municipalDataMongodbClient.connect(process.env.MUNICIPAL_MONGO_URI);
42
+ }
43
+
44
+ bootstrap().catch(console.error);
45
+ ```
46
+
47
+ ### 2. Using Getters
48
+
49
+ Once initialized, you can import and use any of the exported database getters.
50
+
51
+ ```typescript
52
+ import { findAgents, findCities } from '@talkpilot/core-db';
53
+
54
+ async function getSummary() {
55
+ // Get all agents from TalkPilot DB
56
+ const agents = await findAgents();
57
+ console.log('Total Agents:', agents.length);
58
+
59
+ // Get all cities from Municipal Data DB
60
+ const cities = await findCities();
61
+ console.log('Total Cities:', cities.length);
62
+ }
63
+ ```
64
+
65
+ ## Available Domains
66
+
67
+ The package exports two main sets of tools:
68
+
69
+ ### TalkPilot Domain
70
+
71
+ Includes access to:
72
+
73
+ - `agents`, `calls`, `clients`, `flows`, `leads`, `phone_numbers`, `plans`, `results`, `sessions`, `subscriptions`, etc.
74
+ - Exported as root level functions or via `mongodbClient`.
75
+
76
+ ### Municipal Domain
77
+
78
+ Includes access to:
79
+
80
+ - `cities`, `streets`, `departmentsSubjects`, `tickets`.
81
+ - Functions are prefixed where necessary or accessible via `getMunicipalDataDb`.
82
+
83
+ ## Environment Variables
84
+
85
+ The clients will automatically attempt to use the following environment variables if no URI is provided to the `connect()` method:
86
+
87
+ - `MONGO_URI` or `MONGODB_URI`: Primary MongoDB connection string.
88
+ - `MONGODB_DB_NAME`: Database name (defaults to 'municipal-data' for the municipal client if not specified).
89
+
90
+ ## Development
91
+
92
+ ### Setup
93
+
94
+ 1. Clone the repository and install dependencies:
95
+ ```bash
96
+ git clone https://github.com/talkpilot/core-db.git
97
+ cd core-db
98
+ npm install
99
+ ```
100
+ 2. Build the project:
101
+ ```bash
102
+ npm run build
103
+ ```
104
+
105
+ This will generate the `dist/` directory with the compiled JavaScript and type definitions.
106
+
107
+ ### Publishing New Versions
108
+
109
+ To publish a new version of the package:
110
+
111
+ 1. **Test your changes**:
112
+ ```bash
113
+ npm test
114
+ ```
115
+ 2. **Update the version**:
116
+ ```bash
117
+ # Bumps patch version (0.1.0 -> 0.1.1)
118
+ npm version patch
119
+ # Or for minor changes (0.1.0 -> 0.2.0)
120
+ # npm version minor
121
+ # Or for major changes (0.1.0 -> 1.0.0)
122
+ # npm version major
123
+ ```
124
+ 3. **Publish to npm**:
125
+ Ensure you have the shared team token in your `~/.npmrc` (see [Development Guide](./DEVELOPMENT.md#team-access--authentication)).
126
+ 4. **Update in other repos**:
127
+ ```bash
128
+ npm update @talkpilot/core-db
129
+ ```
130
+
131
+ ## License
132
+
133
+ MIT
134
+
135
+ ---
136
+
137
+ **Interested in contributing?** Check out our [Development Guide](./DEVELOPMENT.md) for standards and setup instructions.
138
+
139
+ ## Release Notes
140
+
141
+ ### 1.1.9
142
+
143
+ - `getPhoneNumbersForFlows(clientId)` — lists each phone number linked to a flow for that client (newest first), with `flowId`, `phoneNumber`, and `isPrimary`.
144
+ ### 1.1.5
145
+
146
+ - `createPurchasedPhoneNumber` for API-bought numbers (Twilio/Telnyx metadata); optional `flowId` until linked to a flow. Types/schema updated accordingly.
147
+
148
+ ### 1.0.16
149
+
150
+ - Fixed critical issues present in version 1.0.15.
151
+ - **Warning**: Version 1.0.15 is bugged and should not be used. Please use at least version 1.0.16.
152
+
153
+ ### 1.0.20
154
+
155
+ - Added to Moked106Config this param: withNeedAttentionCalls
156
+ - withNeedAttentionCalls?: boolean
157
+
158
+ ### 1.0.27
159
+ - Added an optional `language` field to `ClientConfig` (e.g. Hebrew/English/Russian/French/Spanish) and updated tests.
160
+
@@ -1,5 +1,6 @@
1
1
  import { ObjectId, Sort, WithId } from "mongodb";
2
2
  import { TranscriptionSegment } from "../results";
3
+ import { LeadProperty } from "../leads";
3
4
  export declare const CONFERENCE_ROLE_CUSTOMER: "customer";
4
5
  export declare const CONFERENCE_ROLE_SUPERVISOR: "supervisor";
5
6
  export type ConferenceRole = typeof CONFERENCE_ROLE_CUSTOMER | typeof CONFERENCE_ROLE_SUPERVISOR | null;
@@ -17,7 +18,7 @@ export type Call = {
17
18
  callLength: number;
18
19
  transcription?: TranscriptionSegment[];
19
20
  status?: string;
20
- leads?: Record<string, string>[];
21
+ leads?: LeadProperty[];
21
22
  summary?: string;
22
23
  recordingUrl?: string;
23
24
  env: 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;AAElD,eAAO,MAAM,wBAAwB,EAAG,UAAmB,CAAC;AAC5D,eAAO,MAAM,0BAA0B,EAAG,YAAqB,CAAC;AAEhE,MAAM,MAAM,cAAc,GACtB,OAAO,wBAAwB,GAC/B,OAAO,0BAA0B,GACjC,IAAI,CAAC;AAET,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,MAAM,CAAC;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AAqB,CAAC"}
1
+ {"version":3,"file":"calls.types.js","sourceRoot":"","sources":["../../../src/talkpilot/calls/calls.types.ts"],"names":[],"mappings":";;;AAIa,QAAA,wBAAwB,GAAG,UAAmB,CAAC;AAC/C,QAAA,0BAA0B,GAAG,YAAqB,CAAC"}
@@ -1,36 +1,4 @@
1
1
  import { DashboardReportQuery, DashboardReportResponse } from "./calls.dashboard.types";
2
- import { CallLengthThresholds } from "src/utils/shared.types";
3
- export declare function buildCallLengthBucketsPipeline(thresholds: CallLengthThresholds): {
4
- $group: {
5
- _id: null;
6
- short: {
7
- $sum: {
8
- $cond: (number | {
9
- $lt: (string | number)[];
10
- })[];
11
- };
12
- };
13
- medium: {
14
- $sum: {
15
- $cond: (number | {
16
- $and: ({
17
- $gte: (string | number)[];
18
- $lte?: undefined;
19
- } | {
20
- $lte: (string | number)[];
21
- $gte?: undefined;
22
- })[];
23
- })[];
24
- };
25
- };
26
- long: {
27
- $sum: {
28
- $cond: (number | {
29
- $gt: (string | number)[];
30
- })[];
31
- };
32
- };
33
- };
34
- }[];
2
+ export type { DashboardVolumeGranularity, DashboardReportQuery, DashboardReportResponse, } from "./calls.dashboard.types";
35
3
  export declare function getDashboardStats(params: DashboardReportQuery): Promise<DashboardReportResponse>;
36
4
  //# sourceMappingURL=calls.dashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calls.dashboard.d.ts","sourceRoot":"","sources":["../../../../src/talkpilot/calls/dashboard/calls.dashboard.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,oBAAoB,EACpB,uBAAuB,EAIxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AA+E9D,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BjC;AAgCD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,uBAAuB,CAAC,CAkFlC"}
1
+ {"version":3,"file":"calls.dashboard.d.ts","sourceRoot":"","sources":["../../../../src/talkpilot/calls/dashboard/calls.dashboard.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,oBAAoB,EACpB,uBAAuB,EAGxB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAuMjC,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,uBAAuB,CAAC,CAsElC"}