@talkpilot/core-db 1.3.6 → 1.3.8

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.
Files changed (79) hide show
  1. package/.cursor/rules/development.mdc +65 -65
  2. package/DEVELOPMENT.md +141 -141
  3. package/README.md +243 -190
  4. package/README_OLD.md +160 -160
  5. package/dist/municipal/tickets/tickets.statistics.getters.d.ts +4 -0
  6. package/dist/municipal/tickets/tickets.statistics.getters.d.ts.map +1 -1
  7. package/dist/municipal/tickets/tickets.statistics.getters.js +30 -3
  8. package/dist/municipal/tickets/tickets.statistics.getters.js.map +1 -1
  9. package/dist/talkpilot/calls/calls.dashboard.d.ts +3 -0
  10. package/dist/talkpilot/calls/calls.dashboard.d.ts.map +1 -0
  11. package/dist/talkpilot/calls/calls.dashboard.js +191 -0
  12. package/dist/talkpilot/calls/calls.dashboard.js.map +1 -0
  13. package/dist/talkpilot/calls/calls.statistics.getters.js +12 -15
  14. package/dist/talkpilot/calls/calls.statistics.getters.js.map +1 -1
  15. package/dist/talkpilot/calls/calls.statistics.types.d.ts +4 -1
  16. package/dist/talkpilot/calls/calls.statistics.types.d.ts.map +1 -1
  17. package/dist/talkpilot/flows/flows.schema.d.ts +3 -0
  18. package/dist/talkpilot/flows/flows.schema.d.ts.map +1 -1
  19. package/dist/talkpilot/flows/flows.schema.js +1 -0
  20. package/dist/talkpilot/flows/flows.schema.js.map +1 -1
  21. package/dist/talkpilot/flows/flows.types.d.ts +1 -0
  22. package/dist/talkpilot/flows/flows.types.d.ts.map +1 -1
  23. package/jest.config.js +20 -20
  24. package/package.json +46 -46
  25. package/src/connection.ts +54 -54
  26. package/src/index.ts +26 -26
  27. package/src/municipal/index.ts +22 -22
  28. package/src/municipal/muniIssues/__tests__/muniIssues.setters.spec.ts +92 -92
  29. package/src/municipal/muniIssues/__tests__/muniIssues.setup.spec.ts +92 -92
  30. package/src/municipal/muniIssues/index.ts +17 -17
  31. package/src/municipal/muniIssues/muniIssues.constants.ts +18 -18
  32. package/src/municipal/muniIssues/muniIssues.getters.ts +24 -24
  33. package/src/municipal/muniIssues/muniIssues.schema.ts +66 -66
  34. package/src/municipal/muniIssues/muniIssues.setters.ts +24 -24
  35. package/src/municipal/muniIssues/muniIssues.setup.ts +65 -65
  36. package/src/municipal/muniIssues/muniIssues.types.ts +37 -37
  37. package/src/municipal/tickets/__tests__/tickets.getters.spec.ts +30 -30
  38. package/src/municipal/tickets/__tests__/tickets.statistics.spec.ts +68 -51
  39. package/src/municipal/tickets/index.ts +3 -3
  40. package/src/municipal/tickets/tickets.constants.ts +8 -8
  41. package/src/municipal/tickets/tickets.getters.ts +121 -121
  42. package/src/municipal/tickets/tickets.statistics.aggregation.ts +96 -96
  43. package/src/municipal/tickets/tickets.statistics.getters.ts +109 -71
  44. package/src/municipal/tickets/tickets.types.ts +53 -53
  45. package/src/talkpilot/calls/__tests__/calls.dashboard.spec.ts +149 -149
  46. package/src/talkpilot/calls/__tests__/calls.statistics.spec.ts +351 -344
  47. package/src/talkpilot/calls/calls.constants.ts +20 -20
  48. package/src/talkpilot/calls/calls.statistics.getters.ts +587 -587
  49. package/src/talkpilot/calls/calls.statistics.types.ts +47 -44
  50. package/src/talkpilot/calls/calls.types.ts +119 -119
  51. package/src/talkpilot/calls/dashboard/calls.dashboard.ts +292 -292
  52. package/src/talkpilot/calls/dashboard/calls.dashboard.types.ts +57 -57
  53. package/src/talkpilot/calls/index.ts +6 -6
  54. package/src/talkpilot/clientsConfig/__tests__/clientsConfig.spec.ts +190 -190
  55. package/src/talkpilot/contextNotes/__tests__/contextNotes.getters.spec.ts +176 -176
  56. package/src/talkpilot/contextNotes/contextNotes.getters.ts +86 -86
  57. package/src/talkpilot/contextNotes/contextNotes.types.ts +20 -20
  58. package/src/talkpilot/contextNotes/index.ts +2 -2
  59. package/src/talkpilot/flows/__tests__/flows.schema.spec.ts +96 -71
  60. package/src/talkpilot/flows/flows.schema.ts +154 -153
  61. package/src/talkpilot/flows/flows.types.ts +187 -186
  62. package/src/talkpilot/index.ts +31 -31
  63. package/src/talkpilot/products/__tests__/products.getters.spec.ts +45 -45
  64. package/src/talkpilot/products/index.ts +2 -2
  65. package/src/talkpilot/products/products.getters.ts +12 -12
  66. package/src/talkpilot/products/products.types.ts +9 -9
  67. package/src/test-utils/db-utils.ts +26 -26
  68. package/src/test-utils/factories/index.ts +15 -15
  69. package/src/test-utils/factories/municipal/muniIssues.ts +32 -32
  70. package/src/test-utils/factories/talkpilot/contextNotes.ts +33 -33
  71. package/src/test-utils/factories/websitalk/scans.ts +23 -23
  72. package/src/utils/date.utils.ts +116 -116
  73. package/src/websitalk/index.ts +15 -15
  74. package/src/websitalk/mongodb-client.ts +61 -61
  75. package/src/websitalk/scans/__tests__/scans.spec.ts +218 -218
  76. package/src/websitalk/scans/index.ts +2 -2
  77. package/src/websitalk/scans/scans.getters.ts +113 -113
  78. package/src/websitalk/scans/scans.types.ts +53 -53
  79. package/tsconfig.json +23 -23
@@ -1,53 +1,53 @@
1
- import { WithId } from "mongodb";
2
-
3
- export type ScanStatus =
4
- | "CHECKING"
5
- | "PREPARING"
6
- | "SCANNING"
7
- | "PROCESSING"
8
- | "COMPLETED"
9
- | "FAILED";
10
-
11
- export type ActiveScanStatus =
12
- | { isActive: true; status: ScanStatus }
13
- | { isActive: false };
14
-
15
- export type SiteChromeEntry = {
16
- url: string;
17
- urlCanonical?: string | null;
18
- title?: string | null;
19
- h1?: string | null;
20
- language?: string | null;
21
- sourceType?: string | null;
22
- status?: string | null;
23
- context?: string | null;
24
- contentHash?: string | null;
25
- errorMessage?: string | null;
26
- breadcrumbs?: unknown;
27
- description?: string | null;
28
- sourceUrl?: string | null;
29
- fetchedAt?: Date | null;
30
- createdAt?: Date;
31
- updatedAt?: Date;
32
- };
33
-
34
- export type SkippedEntry = {
35
- path: string;
36
- reason: string;
37
- };
38
-
39
- export type Scan = {
40
- clientId: string;
41
- baseUrl: string;
42
- notifyPhoneNumber?: string | null;
43
- status: ScanStatus;
44
- activeTasksCount: number;
45
- pagesScanned: number;
46
- pagesSkipped: number;
47
- skipped: SkippedEntry[];
48
- siteChrome: SiteChromeEntry;
49
- createdAt: Date;
50
- updatedAt: Date;
51
- };
52
-
53
- export type ScanDoc = WithId<Scan>;
1
+ import { WithId } from "mongodb";
2
+
3
+ export type ScanStatus =
4
+ | "CHECKING"
5
+ | "PREPARING"
6
+ | "SCANNING"
7
+ | "PROCESSING"
8
+ | "COMPLETED"
9
+ | "FAILED";
10
+
11
+ export type ActiveScanStatus =
12
+ | { isActive: true; status: ScanStatus }
13
+ | { isActive: false };
14
+
15
+ export type SiteChromeEntry = {
16
+ url: string;
17
+ urlCanonical?: string | null;
18
+ title?: string | null;
19
+ h1?: string | null;
20
+ language?: string | null;
21
+ sourceType?: string | null;
22
+ status?: string | null;
23
+ context?: string | null;
24
+ contentHash?: string | null;
25
+ errorMessage?: string | null;
26
+ breadcrumbs?: unknown;
27
+ description?: string | null;
28
+ sourceUrl?: string | null;
29
+ fetchedAt?: Date | null;
30
+ createdAt?: Date;
31
+ updatedAt?: Date;
32
+ };
33
+
34
+ export type SkippedEntry = {
35
+ path: string;
36
+ reason: string;
37
+ };
38
+
39
+ export type Scan = {
40
+ clientId: string;
41
+ baseUrl: string;
42
+ notifyPhoneNumber?: string | null;
43
+ status: ScanStatus;
44
+ activeTasksCount: number;
45
+ pagesScanned: number;
46
+ pagesSkipped: number;
47
+ skipped: SkippedEntry[];
48
+ siteChrome: SiteChromeEntry;
49
+ createdAt: Date;
50
+ updatedAt: Date;
51
+ };
52
+
53
+ export type ScanDoc = WithId<Scan>;
package/tsconfig.json CHANGED
@@ -1,23 +1,23 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "CommonJS",
5
- "moduleResolution": "node",
6
- "lib": ["ES2022"],
7
- "declaration": true,
8
- "declarationMap": true,
9
- "sourceMap": true,
10
- "outDir": "dist",
11
- "rootDir": "src",
12
- "strict": true,
13
- "esModuleInterop": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "skipLibCheck": true,
16
- "resolveJsonModule": true,
17
- "experimentalDecorators": true,
18
- "emitDecoratorMetadata": true,
19
- "baseUrl": "."
20
- },
21
- "include": ["src/**/*"],
22
- "exclude": ["node_modules", "dist", "test", "**/*.test.ts", "**/__tests__/*", "**/*.spec.ts"]
23
- }
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "CommonJS",
5
+ "moduleResolution": "node",
6
+ "lib": ["ES2022"],
7
+ "declaration": true,
8
+ "declarationMap": true,
9
+ "sourceMap": true,
10
+ "outDir": "dist",
11
+ "rootDir": "src",
12
+ "strict": true,
13
+ "esModuleInterop": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "skipLibCheck": true,
16
+ "resolveJsonModule": true,
17
+ "experimentalDecorators": true,
18
+ "emitDecoratorMetadata": true,
19
+ "baseUrl": "."
20
+ },
21
+ "include": ["src/**/*"],
22
+ "exclude": ["node_modules", "dist", "test", "**/*.test.ts", "**/__tests__/*", "**/*.spec.ts"]
23
+ }