@talkpilot/core-db 1.3.5 → 1.3.6
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/DEVELOPMENT.md +28 -13
- package/dist/talkpilot/calls/calls.types.d.ts +5 -0
- package/dist/talkpilot/calls/calls.types.d.ts.map +1 -1
- package/dist/talkpilot/contextNotes/contextNotes.getters.d.ts +19 -0
- package/dist/talkpilot/contextNotes/contextNotes.getters.d.ts.map +1 -0
- package/dist/talkpilot/contextNotes/contextNotes.getters.js +57 -0
- package/dist/talkpilot/contextNotes/contextNotes.getters.js.map +1 -0
- package/dist/talkpilot/contextNotes/contextNotes.types.d.ts +19 -0
- package/dist/talkpilot/contextNotes/contextNotes.types.d.ts.map +1 -0
- package/dist/talkpilot/contextNotes/contextNotes.types.js +3 -0
- package/dist/talkpilot/contextNotes/contextNotes.types.js.map +1 -0
- package/dist/talkpilot/contextNotes/index.d.ts +3 -0
- package/dist/talkpilot/contextNotes/index.d.ts.map +1 -0
- package/dist/talkpilot/contextNotes/index.js +19 -0
- package/dist/talkpilot/contextNotes/index.js.map +1 -0
- package/dist/talkpilot/flows/flows.types.d.ts +1 -0
- package/dist/talkpilot/flows/flows.types.d.ts.map +1 -1
- package/dist/talkpilot/index.d.ts +2 -0
- package/dist/talkpilot/index.d.ts.map +1 -1
- package/dist/talkpilot/index.js +2 -0
- package/dist/talkpilot/index.js.map +1 -1
- package/dist/talkpilot/products/index.d.ts +3 -0
- package/dist/talkpilot/products/index.d.ts.map +1 -0
- package/dist/talkpilot/products/index.js +19 -0
- package/dist/talkpilot/products/index.js.map +1 -0
- package/dist/talkpilot/products/products.getters.d.ts +6 -0
- package/dist/talkpilot/products/products.getters.d.ts.map +1 -0
- package/dist/talkpilot/products/products.getters.js +14 -0
- package/dist/talkpilot/products/products.getters.js.map +1 -0
- package/dist/talkpilot/products/products.types.d.ts +9 -0
- package/dist/talkpilot/products/products.types.d.ts.map +1 -0
- package/dist/talkpilot/products/products.types.js +3 -0
- package/dist/talkpilot/products/products.types.js.map +1 -0
- package/dist/test-utils/factories/index.d.ts +1 -0
- package/dist/test-utils/factories/index.d.ts.map +1 -1
- package/dist/test-utils/factories/index.js +1 -0
- package/dist/test-utils/factories/index.js.map +1 -1
- package/dist/test-utils/factories/talkpilot/contextNotes.d.ts +16 -0
- package/dist/test-utils/factories/talkpilot/contextNotes.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/contextNotes.js +30 -0
- package/dist/test-utils/factories/talkpilot/contextNotes.js.map +1 -0
- package/jest.config.js +1 -0
- package/package.json +1 -1
- package/src/talkpilot/calls/calls.types.ts +3 -0
- package/src/talkpilot/contextNotes/__tests__/contextNotes.getters.spec.ts +176 -0
- package/src/talkpilot/contextNotes/contextNotes.getters.ts +86 -0
- package/src/talkpilot/contextNotes/contextNotes.types.ts +20 -0
- package/src/talkpilot/contextNotes/index.ts +2 -0
- package/src/talkpilot/flows/flows.types.ts +2 -0
- package/src/talkpilot/index.ts +2 -0
- package/src/talkpilot/products/__tests__/products.getters.spec.ts +45 -0
- package/src/talkpilot/products/index.ts +2 -0
- package/src/talkpilot/products/products.getters.ts +12 -0
- package/src/talkpilot/products/products.types.ts +9 -0
- package/src/test-utils/factories/index.ts +1 -0
- package/src/test-utils/factories/talkpilot/contextNotes.ts +33 -0
- package/.claude/settings.local.json +0 -11
- package/dist/municipal/tickets/tickets.deprecated.getters.d.ts +0 -12
- package/dist/municipal/tickets/tickets.deprecated.getters.d.ts.map +0 -1
- package/dist/municipal/tickets/tickets.deprecated.getters.js +0 -131
- package/dist/municipal/tickets/tickets.deprecated.getters.js.map +0 -1
- package/dist/municipal/tickets/tickets.statistics.dates.d.ts +0 -7
- package/dist/municipal/tickets/tickets.statistics.dates.d.ts.map +0 -1
- package/dist/municipal/tickets/tickets.statistics.dates.js +0 -40
- package/dist/municipal/tickets/tickets.statistics.dates.js.map +0 -1
- package/dist/municipal/tickets/tickets.statistics.pipeline.d.ts +0 -53
- package/dist/municipal/tickets/tickets.statistics.pipeline.d.ts.map +0 -1
- package/dist/municipal/tickets/tickets.statistics.pipeline.js +0 -112
- package/dist/municipal/tickets/tickets.statistics.pipeline.js.map +0 -1
- package/dist/municipal/tickets/tickets.statistics.utils.d.ts +0 -7
- package/dist/municipal/tickets/tickets.statistics.utils.d.ts.map +0 -1
- package/dist/municipal/tickets/tickets.statistics.utils.js +0 -40
- package/dist/municipal/tickets/tickets.statistics.utils.js.map +0 -1
- package/dist/talkpilot/calls/calls.statistics.ticketScope.d.ts +0 -12
- package/dist/talkpilot/calls/calls.statistics.ticketScope.d.ts.map +0 -1
- package/dist/talkpilot/calls/calls.statistics.ticketScope.js +0 -37
- package/dist/talkpilot/calls/calls.statistics.ticketScope.js.map +0 -1
- package/dist/talkpilot/calls/calls.statistics.tickets.d.ts +0 -17
- package/dist/talkpilot/calls/calls.statistics.tickets.d.ts.map +0 -1
- package/dist/talkpilot/calls/calls.statistics.tickets.js +0 -33
- package/dist/talkpilot/calls/calls.statistics.tickets.js.map +0 -1
- package/dist/utils/statistics.aggregation.d.ts +0 -20
- package/dist/utils/statistics.aggregation.d.ts.map +0 -1
- package/dist/utils/statistics.aggregation.js +0 -43
- package/dist/utils/statistics.aggregation.js.map +0 -1
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getContextNotesCollection,
|
|
3
|
+
getContextNotes,
|
|
4
|
+
getActiveContextNotes,
|
|
5
|
+
createContextNote,
|
|
6
|
+
setContextNoteEntries,
|
|
7
|
+
setContextNoteConfig,
|
|
8
|
+
deleteContextNoteEntry,
|
|
9
|
+
} from "../contextNotes.getters";
|
|
10
|
+
import { ObjectId } from "../../index";
|
|
11
|
+
import {
|
|
12
|
+
createContextNote as buildContextNote,
|
|
13
|
+
createContextNoteEntry,
|
|
14
|
+
} from "../../../test-utils/factories/talkpilot/contextNotes";
|
|
15
|
+
|
|
16
|
+
describe("contextNotes getters", () => {
|
|
17
|
+
it('should return the "contextNotes" collection', () => {
|
|
18
|
+
const collection = getContextNotesCollection();
|
|
19
|
+
expect(collection.collectionName).toBe("contextNotes");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("should create a context note document and return its id", async () => {
|
|
23
|
+
const doc = buildContextNote({ notes: [createContextNoteEntry()] });
|
|
24
|
+
const id = await createContextNote(doc);
|
|
25
|
+
expect(id).toBeInstanceOf(ObjectId);
|
|
26
|
+
|
|
27
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
28
|
+
expect(saved).toBeDefined();
|
|
29
|
+
expect(saved?.clientId).toBe(doc.clientId);
|
|
30
|
+
expect(saved?.notes).toHaveLength(1);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should return documents matching clientId and product", async () => {
|
|
34
|
+
const clientId = new ObjectId().toString();
|
|
35
|
+
await createContextNote(buildContextNote({ clientId, product: "Municipal" }));
|
|
36
|
+
await createContextNote(buildContextNote({ clientId, product: "Clinics" }));
|
|
37
|
+
await createContextNote(buildContextNote({ product: "Municipal" })); // different client
|
|
38
|
+
|
|
39
|
+
const results = await getContextNotes(clientId, "Municipal");
|
|
40
|
+
expect(results).toHaveLength(1);
|
|
41
|
+
expect(results[0].clientId).toBe(clientId);
|
|
42
|
+
expect(results[0].product).toBe("Municipal");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("should not return documents for a different product", async () => {
|
|
46
|
+
const clientId = new ObjectId().toString();
|
|
47
|
+
await createContextNote(buildContextNote({ clientId, product: "Municipal" }));
|
|
48
|
+
await createContextNote(buildContextNote({ clientId, product: "Clinics" }));
|
|
49
|
+
|
|
50
|
+
const results = await getContextNotes(clientId, "Rcure");
|
|
51
|
+
expect(results).toHaveLength(0);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("should return only active notes for a client and product", async () => {
|
|
55
|
+
const clientId = new ObjectId().toString();
|
|
56
|
+
const now = new Date();
|
|
57
|
+
const past = new Date(now.getTime() - 10000);
|
|
58
|
+
const future = new Date(now.getTime() + 10000);
|
|
59
|
+
|
|
60
|
+
const activeNote = createContextNoteEntry({ activeFrom: past, expiresAt: future });
|
|
61
|
+
const expiredNote = createContextNoteEntry({ activeFrom: past, expiresAt: past });
|
|
62
|
+
const notYetActiveNote = createContextNoteEntry({ activeFrom: future, expiresAt: null });
|
|
63
|
+
const noExpiryNote = createContextNoteEntry({ activeFrom: past, expiresAt: null });
|
|
64
|
+
|
|
65
|
+
await createContextNote(buildContextNote({
|
|
66
|
+
clientId,
|
|
67
|
+
product: "Municipal",
|
|
68
|
+
notes: [activeNote, expiredNote, notYetActiveNote, noExpiryNote],
|
|
69
|
+
}));
|
|
70
|
+
|
|
71
|
+
const results = await getActiveContextNotes(clientId, "Municipal");
|
|
72
|
+
expect(results).toHaveLength(2);
|
|
73
|
+
expect(results.map((n) => n._id.toString())).toEqual(
|
|
74
|
+
expect.arrayContaining([activeNote._id.toString(), noExpiryNote._id.toString()]),
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("should replace the notes array on a document", async () => {
|
|
79
|
+
const doc = buildContextNote({ notes: [createContextNoteEntry(), createContextNoteEntry()] });
|
|
80
|
+
const id = await createContextNote(doc);
|
|
81
|
+
|
|
82
|
+
const newNotes = [createContextNoteEntry({ title: "updated" })];
|
|
83
|
+
const updated = await setContextNoteEntries(id, doc.clientId, newNotes);
|
|
84
|
+
expect(updated).toBe(true);
|
|
85
|
+
|
|
86
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
87
|
+
expect(saved?.notes).toHaveLength(1);
|
|
88
|
+
expect(saved?.notes[0].title).toBe("updated");
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("should return false when setContextNoteEntries targets a non-existent document", async () => {
|
|
92
|
+
const result = await setContextNoteEntries(new ObjectId(), "nobody", []);
|
|
93
|
+
expect(result).toBe(false);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("should store and retrieve a systemPrompt set at creation", async () => {
|
|
97
|
+
const doc = buildContextNote({ systemPrompt: "Treat this information as highly reliable." });
|
|
98
|
+
const id = await createContextNote(doc);
|
|
99
|
+
|
|
100
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
101
|
+
expect(saved?.systemPrompt).toBe("Treat this information as highly reliable.");
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("should not touch systemPrompt or product when setContextNoteEntries is called", async () => {
|
|
105
|
+
const doc = buildContextNote({
|
|
106
|
+
notes: [],
|
|
107
|
+
systemPrompt: "Original instructions.",
|
|
108
|
+
product: "Municipal",
|
|
109
|
+
});
|
|
110
|
+
const id = await createContextNote(doc);
|
|
111
|
+
|
|
112
|
+
await setContextNoteEntries(id, doc.clientId, [createContextNoteEntry()]);
|
|
113
|
+
|
|
114
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
115
|
+
expect(saved?.systemPrompt).toBe("Original instructions.");
|
|
116
|
+
expect(saved?.product).toBe("Municipal");
|
|
117
|
+
expect(saved?.notes).toHaveLength(1);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("should update systemPrompt via setContextNoteConfig", async () => {
|
|
121
|
+
const doc = buildContextNote({ notes: [] });
|
|
122
|
+
const id = await createContextNote(doc);
|
|
123
|
+
|
|
124
|
+
const updated = await setContextNoteConfig(id, doc.clientId, { systemPrompt: "New instructions." });
|
|
125
|
+
expect(updated).toBe(true);
|
|
126
|
+
|
|
127
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
128
|
+
expect(saved?.systemPrompt).toBe("New instructions.");
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("should update product via setContextNoteConfig", async () => {
|
|
132
|
+
const doc = buildContextNote({ product: "Municipal" });
|
|
133
|
+
const id = await createContextNote(doc);
|
|
134
|
+
|
|
135
|
+
const updated = await setContextNoteConfig(id, doc.clientId, { product: "Clinics" });
|
|
136
|
+
expect(updated).toBe(true);
|
|
137
|
+
|
|
138
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
139
|
+
expect(saved?.product).toBe("Clinics");
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("should return false from setContextNoteConfig when no fields are provided", async () => {
|
|
143
|
+
const doc = buildContextNote({});
|
|
144
|
+
const id = await createContextNote(doc);
|
|
145
|
+
|
|
146
|
+
const result = await setContextNoteConfig(id, doc.clientId, {});
|
|
147
|
+
expect(result).toBe(false);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it("should return false from setContextNoteConfig for a non-existent document", async () => {
|
|
151
|
+
const result = await setContextNoteConfig(new ObjectId(), "nobody", { systemPrompt: "x" });
|
|
152
|
+
expect(result).toBe(false);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it("should delete a single note entry by id", async () => {
|
|
156
|
+
const noteToKeep = createContextNoteEntry();
|
|
157
|
+
const noteToDelete = createContextNoteEntry();
|
|
158
|
+
const doc = buildContextNote({ notes: [noteToKeep, noteToDelete] });
|
|
159
|
+
const id = await createContextNote(doc);
|
|
160
|
+
|
|
161
|
+
const deleted = await deleteContextNoteEntry(id, doc.clientId, noteToDelete._id);
|
|
162
|
+
expect(deleted).toBe(true);
|
|
163
|
+
|
|
164
|
+
const saved = await getContextNotesCollection().findOne({ _id: id });
|
|
165
|
+
expect(saved?.notes).toHaveLength(1);
|
|
166
|
+
expect(saved?.notes[0]._id.toString()).toBe(noteToKeep._id.toString());
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it("should return false when deleteContextNoteEntry targets a non-existent note", async () => {
|
|
170
|
+
const doc = buildContextNote({ notes: [] });
|
|
171
|
+
const id = await createContextNote(doc);
|
|
172
|
+
|
|
173
|
+
const result = await deleteContextNoteEntry(id, doc.clientId, new ObjectId());
|
|
174
|
+
expect(result).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Collection, ObjectId, WithId } from "mongodb";
|
|
2
|
+
import { getDb } from "../index";
|
|
3
|
+
import type { ContextNote, ContextNoteEntry } from "./contextNotes.types";
|
|
4
|
+
|
|
5
|
+
export const getContextNotesCollection = (): Collection<ContextNote> => {
|
|
6
|
+
return getDb().collection<ContextNote>("contextNotes");
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** Returns all context note documents matching a clientId and product. */
|
|
10
|
+
export const getContextNotes = (
|
|
11
|
+
clientId: string,
|
|
12
|
+
product: string,
|
|
13
|
+
): Promise<WithId<ContextNote>[]> => {
|
|
14
|
+
return getContextNotesCollection()
|
|
15
|
+
.find({ clientId, product })
|
|
16
|
+
.toArray();
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** Returns all currently active note entries across matching documents */
|
|
20
|
+
export const getActiveContextNotes = async (
|
|
21
|
+
clientId: string,
|
|
22
|
+
product: string,
|
|
23
|
+
): Promise<ContextNoteEntry[]> => {
|
|
24
|
+
const docs = await getContextNotes(clientId, product);
|
|
25
|
+
const now = new Date();
|
|
26
|
+
return docs.flatMap((doc) =>
|
|
27
|
+
doc.notes.filter(
|
|
28
|
+
(note) =>
|
|
29
|
+
note.activeFrom <= now &&
|
|
30
|
+
(note.expiresAt === null || note.expiresAt > now),
|
|
31
|
+
),
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Creates a new context note document. */
|
|
36
|
+
export const createContextNote = (
|
|
37
|
+
data: Omit<ContextNote, "_id">,
|
|
38
|
+
): Promise<ObjectId> => {
|
|
39
|
+
return getContextNotesCollection()
|
|
40
|
+
.insertOne({ ...data, _id: new ObjectId() } as ContextNote)
|
|
41
|
+
.then((r) => r.insertedId);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** Replaces the full notes array on a context note document. */
|
|
45
|
+
export const setContextNoteEntries = async (
|
|
46
|
+
id: ObjectId,
|
|
47
|
+
clientId: string,
|
|
48
|
+
notes: ContextNoteEntry[],
|
|
49
|
+
): Promise<boolean> => {
|
|
50
|
+
const result = await getContextNotesCollection().updateOne(
|
|
51
|
+
{ _id: id, clientId },
|
|
52
|
+
{ $set: { notes } },
|
|
53
|
+
);
|
|
54
|
+
return result.matchedCount > 0;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Updates the configuration fields (systemPrompt, product) on a context note document. */
|
|
58
|
+
export const setContextNoteConfig = async (
|
|
59
|
+
id: ObjectId,
|
|
60
|
+
clientId: string,
|
|
61
|
+
config: { systemPrompt?: string; product?: string },
|
|
62
|
+
): Promise<boolean> => {
|
|
63
|
+
const fields: Partial<ContextNote> = {};
|
|
64
|
+
if (config.systemPrompt !== undefined) fields.systemPrompt = config.systemPrompt;
|
|
65
|
+
if (config.product !== undefined) fields.product = config.product;
|
|
66
|
+
if (!Object.keys(fields).length) return false;
|
|
67
|
+
|
|
68
|
+
const result = await getContextNotesCollection().updateOne(
|
|
69
|
+
{ _id: id, clientId },
|
|
70
|
+
{ $set: fields },
|
|
71
|
+
);
|
|
72
|
+
return result.matchedCount > 0;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** Removes a single note entry from a document by its _id. */
|
|
76
|
+
export const deleteContextNoteEntry = async (
|
|
77
|
+
id: ObjectId,
|
|
78
|
+
clientId: string,
|
|
79
|
+
noteId: ObjectId,
|
|
80
|
+
): Promise<boolean> => {
|
|
81
|
+
const result = await getContextNotesCollection().updateOne(
|
|
82
|
+
{ _id: id, clientId },
|
|
83
|
+
{ $pull: { notes: { _id: noteId } as any } },
|
|
84
|
+
);
|
|
85
|
+
return result.modifiedCount > 0;
|
|
86
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ObjectId } from "mongodb";
|
|
2
|
+
|
|
3
|
+
export type ContextNoteEntry = {
|
|
4
|
+
_id: ObjectId;
|
|
5
|
+
title: string;
|
|
6
|
+
content: string;
|
|
7
|
+
activeFrom: Date;
|
|
8
|
+
expiresAt: Date | null;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type ContextNote = {
|
|
14
|
+
_id: ObjectId;
|
|
15
|
+
clientId: string;
|
|
16
|
+
product: string;
|
|
17
|
+
notes: ContextNoteEntry[];
|
|
18
|
+
/** instructions for how the LLM should treat context info */
|
|
19
|
+
systemPrompt?: string;
|
|
20
|
+
};
|
package/src/talkpilot/index.ts
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getProductsCollection, getAllProducts } from "../products.getters";
|
|
2
|
+
import { ObjectId } from "../../index";
|
|
3
|
+
|
|
4
|
+
describe("products getters", () => {
|
|
5
|
+
it('should return the "products" collection', () => {
|
|
6
|
+
const collection = getProductsCollection();
|
|
7
|
+
expect(collection.collectionName).toBe("products");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("should return all product documents", async () => {
|
|
11
|
+
await getProductsCollection().insertMany([
|
|
12
|
+
{ _id: new ObjectId(), name: "Municipal" },
|
|
13
|
+
{ _id: new ObjectId(), name: "Clinics" },
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
const results = await getAllProducts();
|
|
17
|
+
expect(results.length).toBeGreaterThanOrEqual(2);
|
|
18
|
+
expect(results.map((p) => p.name)).toEqual(
|
|
19
|
+
expect.arrayContaining(["Municipal", "Clinics"]),
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("should store and retrieve displayName locale map", async () => {
|
|
24
|
+
const id = new ObjectId();
|
|
25
|
+
await getProductsCollection().insertOne({
|
|
26
|
+
_id: id,
|
|
27
|
+
name: "Municipal",
|
|
28
|
+
displayName: { he: "עירייה", en: "Municipal" },
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const results = await getAllProducts();
|
|
32
|
+
const saved = results.find((p) => p._id.equals(id));
|
|
33
|
+
expect(saved?.displayName).toEqual({ he: "עירייה", en: "Municipal" });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("should return products without displayName without error", async () => {
|
|
37
|
+
const id = new ObjectId();
|
|
38
|
+
await getProductsCollection().insertOne({ _id: id, name: "Rcure" });
|
|
39
|
+
|
|
40
|
+
const results = await getAllProducts();
|
|
41
|
+
const saved = results.find((p) => p._id.equals(id));
|
|
42
|
+
expect(saved?.displayName).toBeUndefined();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Collection, WithId } from "mongodb";
|
|
2
|
+
import { getDb } from "../index";
|
|
3
|
+
import type { Product } from "./products.types";
|
|
4
|
+
|
|
5
|
+
export const getProductsCollection = (): Collection<Product> => {
|
|
6
|
+
return getDb().collection<Product>("products");
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** Returns all product documents */
|
|
10
|
+
export const getAllProducts = (): Promise<WithId<Product>[]> => {
|
|
11
|
+
return getProductsCollection().find().toArray();
|
|
12
|
+
};
|
|
@@ -3,6 +3,7 @@ export * from "./talkpilot/calls";
|
|
|
3
3
|
export * from "./talkpilot/clientAudioBuffers";
|
|
4
4
|
export * from "./talkpilot/clientsConfig";
|
|
5
5
|
export * from "./talkpilot/flows";
|
|
6
|
+
export * from "./talkpilot/contextNotes";
|
|
6
7
|
export * from "./talkpilot/groups";
|
|
7
8
|
export * from "./talkpilot/phone_numbers";
|
|
8
9
|
export * from "./talkpilot/sessions";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Factory } from "fishery";
|
|
2
|
+
import { ObjectId } from "mongodb";
|
|
3
|
+
import { faker } from "@faker-js/faker";
|
|
4
|
+
import type { ContextNote, ContextNoteEntry } from "../../../talkpilot";
|
|
5
|
+
|
|
6
|
+
export const contextNoteEntryFactory = Factory.define<ContextNoteEntry>(() => ({
|
|
7
|
+
_id: new ObjectId(),
|
|
8
|
+
title: faker.lorem.words(3),
|
|
9
|
+
content: faker.lorem.sentences(2),
|
|
10
|
+
activeFrom: new Date(),
|
|
11
|
+
expiresAt: null,
|
|
12
|
+
createdAt: new Date(),
|
|
13
|
+
updatedAt: new Date(),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
export const contextNoteFactory = Factory.define<ContextNote & { _id: ObjectId }>(() => ({
|
|
17
|
+
_id: new ObjectId(),
|
|
18
|
+
clientId: faker.string.uuid(),
|
|
19
|
+
product: "Municipal",
|
|
20
|
+
notes: [],
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
export function createContextNoteEntry(
|
|
24
|
+
overrides?: Partial<ContextNoteEntry>,
|
|
25
|
+
): ContextNoteEntry {
|
|
26
|
+
return { ...contextNoteEntryFactory.build(), ...overrides } as ContextNoteEntry;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function createContextNote(
|
|
30
|
+
overrides?: Partial<ContextNote>,
|
|
31
|
+
): ContextNote & { _id: ObjectId } {
|
|
32
|
+
return { ...contextNoteFactory.build(), ...overrides } as ContextNote & { _id: ObjectId };
|
|
33
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(npx jest *)",
|
|
5
|
-
"Bash(git reset *)",
|
|
6
|
-
"Bash(git tag *)",
|
|
7
|
-
"Bash(node -p \"require\\('./package.json'\\).version\")",
|
|
8
|
-
"Bash(echo \"version: $\\(node -p \"require\\('./package.json'\\).version\"\\)\")"
|
|
9
|
-
]
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { SubjectStatsItem } from "./tickets.types";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use `findCallSidsWithTicketsByCity` with `ticketStatsDateScopeFromYmd` instead.
|
|
4
|
-
* Will be removed in 3.0.0.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getTicketsCountByCityAndDateRange(cityName: string, startStr: string, endStr: string, timezone: string): Promise<number>;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use `findFilteredCallSids` + `findSubjectsByCallSids` instead.
|
|
9
|
-
* Will be removed in 3.0.0.
|
|
10
|
-
*/
|
|
11
|
-
export declare function getTicketsSubjectStats(cityName: string, startStr: string, endStr: string, timezone: string): Promise<SubjectStatsItem[]>;
|
|
12
|
-
//# sourceMappingURL=tickets.deprecated.getters.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tickets.deprecated.getters.d.ts","sourceRoot":"","sources":["../../../src/municipal/tickets/tickets.deprecated.getters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;GAGG;AACH,wBAAsB,iCAAiC,CACrD,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAoG7B"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTicketsCountByCityAndDateRange = getTicketsCountByCityAndDateRange;
|
|
4
|
-
exports.getTicketsSubjectStats = getTicketsSubjectStats;
|
|
5
|
-
const tickets_getters_1 = require("./tickets.getters");
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Use `findCallSidsWithTicketsByCity` with `ticketStatsDateScopeFromYmd` instead.
|
|
8
|
-
* Will be removed in 3.0.0.
|
|
9
|
-
*/
|
|
10
|
-
async function getTicketsCountByCityAndDateRange(cityName, startStr, endStr, timezone) {
|
|
11
|
-
const doc = await (0, tickets_getters_1.getTicketsCollection)()
|
|
12
|
-
.aggregate([
|
|
13
|
-
{ $match: { cityName, callSid: { $exists: true, $nin: [null, ""] } } },
|
|
14
|
-
{
|
|
15
|
-
$addFields: {
|
|
16
|
-
dateLocal: {
|
|
17
|
-
$dateToString: { format: "%Y-%m-%d", date: "$createdAt", timezone },
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{ $match: { dateLocal: { $gte: startStr, $lte: endStr } } },
|
|
22
|
-
{ $count: "n" },
|
|
23
|
-
])
|
|
24
|
-
.next();
|
|
25
|
-
return doc?.n ?? 0;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Use `findFilteredCallSids` + `findSubjectsByCallSids` instead.
|
|
29
|
-
* Will be removed in 3.0.0.
|
|
30
|
-
*/
|
|
31
|
-
async function getTicketsSubjectStats(cityName, startStr, endStr, timezone) {
|
|
32
|
-
const rows = await (0, tickets_getters_1.getTicketsCollection)()
|
|
33
|
-
.aggregate([
|
|
34
|
-
{ $match: { cityName } },
|
|
35
|
-
{
|
|
36
|
-
$addFields: {
|
|
37
|
-
dateLocal: {
|
|
38
|
-
$dateToString: { format: "%Y-%m-%d", date: "$createdAt", timezone },
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{ $match: { dateLocal: { $gte: startStr, $lte: endStr } } },
|
|
43
|
-
{
|
|
44
|
-
$addFields: {
|
|
45
|
-
effectiveSubjectId: {
|
|
46
|
-
$ifNull: [
|
|
47
|
-
"$externalCallFields.event_subject_id",
|
|
48
|
-
{
|
|
49
|
-
$ifNull: [
|
|
50
|
-
"$externalCallFields.event_sub_subject_id",
|
|
51
|
-
"$externalCallFields.event_sub_subject_id2",
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
$lookup: {
|
|
60
|
-
from: "departmentsSubjects",
|
|
61
|
-
let: { sid: "$effectiveSubjectId", c: cityName },
|
|
62
|
-
pipeline: [
|
|
63
|
-
{
|
|
64
|
-
$match: {
|
|
65
|
-
$expr: {
|
|
66
|
-
$and: [
|
|
67
|
-
{ $eq: ["$cityName", "$$c"] },
|
|
68
|
-
{
|
|
69
|
-
$or: [
|
|
70
|
-
{ $eq: ["$subject_id", { $ifNull: ["$$sid", ""] }] },
|
|
71
|
-
{
|
|
72
|
-
$eq: ["$sub_subject_id", { $ifNull: ["$$sid", ""] }],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
$eq: ["$sub_subject_id2", { $ifNull: ["$$sid", ""] }],
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{ $limit: 1 },
|
|
84
|
-
],
|
|
85
|
-
as: "subj",
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
$addFields: {
|
|
90
|
-
subject_id: {
|
|
91
|
-
$cond: {
|
|
92
|
-
if: { $gt: [{ $size: "$subj" }, 0] },
|
|
93
|
-
then: {
|
|
94
|
-
$ifNull: [{ $arrayElemAt: ["$subj.subject_id", 0] }, ""],
|
|
95
|
-
},
|
|
96
|
-
else: "",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
subject: {
|
|
100
|
-
$cond: {
|
|
101
|
-
if: { $gt: [{ $size: "$subj" }, 0] },
|
|
102
|
-
then: {
|
|
103
|
-
$ifNull: [
|
|
104
|
-
{ $arrayElemAt: ["$subj.subjectName", 0] },
|
|
105
|
-
"Unclassified",
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
else: "Unclassified",
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
$group: {
|
|
115
|
-
_id: "$subject_id",
|
|
116
|
-
subject: { $first: "$subject" },
|
|
117
|
-
count: { $sum: 1 },
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
{ $sort: { count: -1 } },
|
|
121
|
-
])
|
|
122
|
-
.toArray();
|
|
123
|
-
const total = rows.reduce((sum, row) => sum + row.count, 0);
|
|
124
|
-
return rows.map((row) => ({
|
|
125
|
-
subject_name: row.subject,
|
|
126
|
-
subject_id: row._id,
|
|
127
|
-
count: row.count,
|
|
128
|
-
percentage: total > 0 ? Math.round((row.count / total) * 100) : 0,
|
|
129
|
-
}));
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=tickets.deprecated.getters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tickets.deprecated.getters.js","sourceRoot":"","sources":["../../../src/municipal/tickets/tickets.deprecated.getters.ts"],"names":[],"mappings":";;AAOA,8EAqBC;AAMD,wDAyGC;AA3ID,uDAAyD;AAGzD;;;GAGG;AACI,KAAK,UAAU,iCAAiC,CACrD,QAAgB,EAChB,QAAgB,EAChB,MAAc,EACd,QAAgB;IAEhB,MAAM,GAAG,GAAG,MAAM,IAAA,sCAAoB,GAAE;SACrC,SAAS,CAAgB;QACxB,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;QACtE;YACE,UAAU,EAAE;gBACV,SAAS,EAAE;oBACT,aAAa,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE;iBACpE;aACF;SACF;QACD,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QAC3D,EAAE,MAAM,EAAE,GAAG,EAAE;KAChB,CAAC;SACD,IAAI,EAAE,CAAC;IACV,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,sBAAsB,CAC1C,QAAgB,EAChB,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E,GAAG,CAAC,GAAG;QACnB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,UAAU,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KAClE,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TicketStatsDateScope } from "./tickets.types";
|
|
2
|
-
export declare const resolveTicketStatsDateRange: (dateScope?: TicketStatsDateScope) => {
|
|
3
|
-
from: Date;
|
|
4
|
-
to: Date;
|
|
5
|
-
};
|
|
6
|
-
export declare const ticketStatsDateScopeFromYmd: (startStr: string, endStr: string, timezone: string) => TicketStatsDateScope;
|
|
7
|
-
//# sourceMappingURL=tickets.statistics.dates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tickets.statistics.dates.d.ts","sourceRoot":"","sources":["../../../src/municipal/tickets/tickets.statistics.dates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAiC5D,eAAO,MAAM,2BAA2B,GACtC,YAAY,oBAAoB,KAC/B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,CAAA;CAKxB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,UAAU,MAAM,EAChB,QAAQ,MAAM,EACd,UAAU,MAAM,KACf,oBAGD,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ticketStatsDateScopeFromYmd = exports.resolveTicketStatsDateRange = void 0;
|
|
4
|
-
const DEFAULT_LOOKBACK_DAYS = 30;
|
|
5
|
-
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
6
|
-
const formatYmdInTz = (date, timezone) => new Intl.DateTimeFormat("en-CA", { timeZone: timezone }).format(date);
|
|
7
|
-
const dateAtNoonUtc = (dateStr) => {
|
|
8
|
-
const [y, m, d] = dateStr.split("-").map(Number);
|
|
9
|
-
return new Date(Date.UTC(y, m - 1, d, 12, 0, 0));
|
|
10
|
-
};
|
|
11
|
-
const startOfCalendarDayInTz = (dateStr, timezone) => {
|
|
12
|
-
const anchor = dateAtNoonUtc(dateStr).getTime();
|
|
13
|
-
let low = anchor - 2 * DAY_MS;
|
|
14
|
-
let high = anchor + DAY_MS;
|
|
15
|
-
while (high - low > 1) {
|
|
16
|
-
const mid = Math.floor((low + high) / 2);
|
|
17
|
-
if (formatYmdInTz(new Date(mid), timezone) >= dateStr)
|
|
18
|
-
high = mid;
|
|
19
|
-
else
|
|
20
|
-
low = mid;
|
|
21
|
-
}
|
|
22
|
-
return new Date(high);
|
|
23
|
-
};
|
|
24
|
-
const endOfCalendarDayInTz = (dateStr, timezone) => {
|
|
25
|
-
const [y, m, d] = dateStr.split("-").map(Number);
|
|
26
|
-
const nextDay = new Date(Date.UTC(y, m - 1, d + 1)).toISOString().slice(0, 10);
|
|
27
|
-
return new Date(startOfCalendarDayInTz(nextDay, timezone).getTime() - 1);
|
|
28
|
-
};
|
|
29
|
-
const resolveTicketStatsDateRange = (dateScope) => {
|
|
30
|
-
const to = dateScope?.to ?? new Date();
|
|
31
|
-
const from = dateScope?.from ?? new Date(to.getTime() - DEFAULT_LOOKBACK_DAYS * DAY_MS);
|
|
32
|
-
return { from, to };
|
|
33
|
-
};
|
|
34
|
-
exports.resolveTicketStatsDateRange = resolveTicketStatsDateRange;
|
|
35
|
-
const ticketStatsDateScopeFromYmd = (startStr, endStr, timezone) => ({
|
|
36
|
-
from: startOfCalendarDayInTz(startStr, timezone),
|
|
37
|
-
to: endOfCalendarDayInTz(endStr, timezone),
|
|
38
|
-
});
|
|
39
|
-
exports.ticketStatsDateScopeFromYmd = ticketStatsDateScopeFromYmd;
|
|
40
|
-
//# sourceMappingURL=tickets.statistics.dates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tickets.statistics.dates.js","sourceRoot":"","sources":["../../../src/municipal/tickets/tickets.statistics.dates.ts"],"names":[],"mappings":";;;AAEA,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAM,aAAa,GAAG,CAAC,IAAU,EAAE,QAAgB,EAAU,EAAE,CAC7D,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAExE,MAAM,aAAa,GAAG,CAAC,OAAe,EAAQ,EAAE;IAC9C,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,OAAe,EAAE,QAAgB,EAAQ,EAAE;IACzE,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IAChD,IAAI,GAAG,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IAC9B,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAE3B,OAAO,IAAI,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,IAAI,aA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