@talkpilot/core-db 1.3.31 → 1.3.33

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 (138) hide show
  1. package/README.md +12 -23
  2. package/dist/bulkWrite/bulkWrite.ops.d.ts +17 -0
  3. package/dist/bulkWrite/bulkWrite.ops.d.ts.map +1 -0
  4. package/dist/bulkWrite/bulkWrite.ops.js +35 -0
  5. package/dist/bulkWrite/bulkWrite.ops.js.map +1 -0
  6. package/dist/bulkWrite/bulkWrite.types.d.ts +4 -0
  7. package/dist/bulkWrite/bulkWrite.types.d.ts.map +1 -0
  8. package/dist/{talkpilot/clients/clients.quota.types.js → bulkWrite/bulkWrite.types.js} +1 -1
  9. package/dist/bulkWrite/bulkWrite.types.js.map +1 -0
  10. package/dist/bulkWrite/index.d.ts +3 -0
  11. package/dist/bulkWrite/index.d.ts.map +1 -0
  12. package/dist/bulkWrite/index.js +19 -0
  13. package/dist/bulkWrite/index.js.map +1 -0
  14. package/dist/configuration/index.d.ts +7 -0
  15. package/dist/configuration/index.d.ts.map +1 -0
  16. package/dist/configuration/index.js +34 -0
  17. package/dist/configuration/index.js.map +1 -0
  18. package/dist/configuration/mongodb-client.d.ts +13 -0
  19. package/dist/configuration/mongodb-client.d.ts.map +1 -0
  20. package/dist/configuration/mongodb-client.js +56 -0
  21. package/dist/configuration/mongodb-client.js.map +1 -0
  22. package/dist/configuration/prompts/index.d.ts +3 -0
  23. package/dist/configuration/prompts/index.d.ts.map +1 -0
  24. package/dist/configuration/prompts/index.js +18 -0
  25. package/dist/configuration/prompts/index.js.map +1 -0
  26. package/dist/configuration/prompts/prompts.getters.d.ts +21 -0
  27. package/dist/configuration/prompts/prompts.getters.d.ts.map +1 -0
  28. package/dist/configuration/prompts/prompts.getters.js +35 -0
  29. package/dist/configuration/prompts/prompts.getters.js.map +1 -0
  30. package/dist/configuration/prompts/prompts.types.d.ts +9 -0
  31. package/dist/configuration/prompts/prompts.types.d.ts.map +1 -0
  32. package/dist/configuration/prompts/prompts.types.js +3 -0
  33. package/dist/configuration/prompts/prompts.types.js.map +1 -0
  34. package/dist/connection.d.ts.map +1 -1
  35. package/dist/connection.js +11 -0
  36. package/dist/connection.js.map +1 -1
  37. package/dist/index.d.ts +8 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +11 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.d.ts +15 -1
  42. package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.d.ts.map +1 -1
  43. package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.js +24 -1
  44. package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.js.map +1 -1
  45. package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.d.ts +10 -0
  46. package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.d.ts.map +1 -0
  47. package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.js +15 -0
  48. package/dist/municipal/departmentsSubjects/departmentsSubjects.setters.js.map +1 -0
  49. package/dist/municipal/departmentsSubjects/departmentsSubjects.types.d.ts +1 -0
  50. package/dist/municipal/departmentsSubjects/departmentsSubjects.types.d.ts.map +1 -1
  51. package/dist/municipal/streets/streets.getters.d.ts +2 -1
  52. package/dist/municipal/streets/streets.getters.d.ts.map +1 -1
  53. package/dist/municipal/streets/streets.getters.js +6 -1
  54. package/dist/municipal/streets/streets.getters.js.map +1 -1
  55. package/dist/municipal/streets/streets.setters.d.ts +10 -0
  56. package/dist/municipal/streets/streets.setters.d.ts.map +1 -0
  57. package/dist/municipal/streets/streets.setters.js +15 -0
  58. package/dist/municipal/streets/streets.setters.js.map +1 -0
  59. package/dist/municipal/streets/streets.types.d.ts +1 -0
  60. package/dist/municipal/streets/streets.types.d.ts.map +1 -1
  61. package/dist/reconcile/index.d.ts +5 -0
  62. package/dist/reconcile/index.d.ts.map +1 -0
  63. package/dist/reconcile/index.js +21 -0
  64. package/dist/reconcile/index.js.map +1 -0
  65. package/dist/reconcile/reconcile.diff.d.ts +4 -0
  66. package/dist/reconcile/reconcile.diff.d.ts.map +1 -0
  67. package/dist/reconcile/reconcile.diff.js +36 -0
  68. package/dist/reconcile/reconcile.diff.js.map +1 -0
  69. package/dist/reconcile/reconcile.execute.d.ts +7 -0
  70. package/dist/reconcile/reconcile.execute.d.ts.map +1 -0
  71. package/dist/reconcile/reconcile.execute.js +20 -0
  72. package/dist/reconcile/reconcile.execute.js.map +1 -0
  73. package/dist/reconcile/reconcile.ops.d.ts +12 -0
  74. package/dist/reconcile/reconcile.ops.d.ts.map +1 -0
  75. package/dist/reconcile/reconcile.ops.js +24 -0
  76. package/dist/reconcile/reconcile.ops.js.map +1 -0
  77. package/dist/reconcile/reconcile.types.d.ts +32 -0
  78. package/dist/reconcile/reconcile.types.d.ts.map +1 -0
  79. package/dist/reconcile/reconcile.types.js +3 -0
  80. package/dist/reconcile/reconcile.types.js.map +1 -0
  81. package/dist/talkpilot/clients/clients.types.d.ts +0 -3
  82. package/dist/talkpilot/clients/clients.types.d.ts.map +1 -1
  83. package/dist/talkpilot/clients/index.d.ts +0 -2
  84. package/dist/talkpilot/clients/index.d.ts.map +1 -1
  85. package/dist/talkpilot/clients/index.js +0 -2
  86. package/dist/talkpilot/clients/index.js.map +1 -1
  87. package/dist/talkpilot/clientsConfig/clientsConfig.getters.d.ts +0 -5
  88. package/dist/talkpilot/clientsConfig/clientsConfig.getters.d.ts.map +1 -1
  89. package/dist/talkpilot/clientsConfig/clientsConfig.getters.js +1 -37
  90. package/dist/talkpilot/clientsConfig/clientsConfig.getters.js.map +1 -1
  91. package/dist/talkpilot/clientsConfig/clientsConfig.types.d.ts +3 -4
  92. package/dist/talkpilot/clientsConfig/clientsConfig.types.d.ts.map +1 -1
  93. package/dist/talkpilot/clientsConfig/clientsConfig.types.js.map +1 -1
  94. package/dist/test-utils/db-utils.d.ts.map +1 -1
  95. package/dist/test-utils/db-utils.js +2 -0
  96. package/dist/test-utils/db-utils.js.map +1 -1
  97. package/package.json +1 -1
  98. package/src/bulkWrite/__tests__/bulkWrite.spec.ts +65 -0
  99. package/src/bulkWrite/bulkWrite.ops.ts +45 -0
  100. package/src/bulkWrite/bulkWrite.types.ts +4 -0
  101. package/src/bulkWrite/index.ts +2 -0
  102. package/src/configuration/index.ts +15 -0
  103. package/src/configuration/mongodb-client.ts +61 -0
  104. package/src/configuration/prompts/index.ts +2 -0
  105. package/src/configuration/prompts/prompts.getters.ts +37 -0
  106. package/src/configuration/prompts/prompts.types.ts +10 -0
  107. package/src/connection.ts +13 -0
  108. package/src/index.ts +14 -0
  109. package/src/municipal/departmentsSubjects/__tests__/departmentsSubjects.spec.ts +272 -0
  110. package/src/municipal/departmentsSubjects/departmentsSubjects.getters.ts +38 -3
  111. package/src/municipal/departmentsSubjects/departmentsSubjects.types.ts +1 -0
  112. package/src/municipal/streets/__tests__/streets.spec.ts +253 -0
  113. package/src/municipal/streets/streets.getters.ts +16 -1
  114. package/src/municipal/streets/streets.types.ts +1 -0
  115. package/src/talkpilot/clients/clients.types.ts +0 -4
  116. package/src/talkpilot/clients/index.ts +0 -2
  117. package/src/talkpilot/clientsConfig/__tests__/clientsConfig.spec.ts +0 -21
  118. package/src/talkpilot/clientsConfig/clientsConfig.getters.ts +0 -54
  119. package/src/talkpilot/clientsConfig/clientsConfig.types.ts +3 -5
  120. package/src/test-utils/db-utils.ts +8 -1
  121. package/dist/talkpilot/clients/clients.quota.constants.d.ts +0 -2
  122. package/dist/talkpilot/clients/clients.quota.constants.d.ts.map +0 -1
  123. package/dist/talkpilot/clients/clients.quota.constants.js +0 -5
  124. package/dist/talkpilot/clients/clients.quota.constants.js.map +0 -1
  125. package/dist/talkpilot/clients/clients.quota.getters.d.ts +0 -7
  126. package/dist/talkpilot/clients/clients.quota.getters.d.ts.map +0 -1
  127. package/dist/talkpilot/clients/clients.quota.getters.js +0 -80
  128. package/dist/talkpilot/clients/clients.quota.getters.js.map +0 -1
  129. package/dist/talkpilot/clients/clients.quota.types.d.ts +0 -22
  130. package/dist/talkpilot/clients/clients.quota.types.d.ts.map +0 -1
  131. package/dist/talkpilot/clients/clients.quota.types.js.map +0 -1
  132. package/dist/talkpilot/clients/clients.quota.utils.d.ts +0 -8
  133. package/dist/talkpilot/clients/clients.quota.utils.d.ts.map +0 -1
  134. package/dist/talkpilot/clients/clients.quota.utils.js +0 -45
  135. package/dist/talkpilot/clients/clients.quota.utils.js.map +0 -1
  136. package/src/talkpilot/clients/__tests__/clients.quota.spec.ts +0 -123
  137. package/src/talkpilot/clients/clients.quota.getters.ts +0 -119
  138. package/src/talkpilot/clients/clients.quota.types.ts +0 -25
package/README.md CHANGED
@@ -16,6 +16,7 @@ L1:# @talkpilot/core-db
16
16
  - **Product-specific clients (future)** – While the package currently exposes the shared TalkPilot + municipal clients, we expect each product (CIS, MIS, TalkPilot Server) to eventually get its own domain-specific client helpers or wrappers so the shared core can remain stable while new consumers add targeted extensions.
17
17
  - **Test helpers** – `src/test-utils/` plus `src/__tests__/` reuse `MongoMemoryServer` and shared factories so tests start with clean data regardless of the consuming repo.
18
18
  - **Utility layers** – `src/utils/` contains shared validation, pagination, and environment helpers that complement the getters.
19
+ - **Bulk-write helpers** – `src/bulkWrite/` exposes small, domain-agnostic functions (`buildSetOp`, `buildUpsertOp`, `buildInsertOp`, `buildDeleteOp`) that construct correctly-shaped MongoDB bulk-write operations from a filter and field values — no collection- or domain-specific knowledge required.
19
20
  - **Environment awareness** – Defaults, fallbacks, and `process.env` lookups ensure local, CI, and Cloud Run clients all connect using the right URI/DB names.
20
21
 
21
22
  ## Key Components
@@ -24,6 +25,7 @@ L1:# @talkpilot/core-db
24
25
  - `src/talkpilot/` – Call history, agents, flows, sessions, leads, subscriptions, and support helpers exposed as getters plus helper enums/types for each collection.
25
26
  - `src/municipal/` – Municipal-specific collections (`cities`, `streets`, `departmentsSubjects`, `tickets`, etc.) plus vector search helpers and Ash Bina helpers used by MIS.
26
27
  - `src/utils/` – Shared helpers such as `resolveConnection`, pagination utilities, and schema validation helper functions.
28
+ - `src/bulkWrite/` – Generic bulk-write op constructors (`buildSetOp`, `buildUpsertOp`, `buildInsertOp`, `buildDeleteOp`) usable with any collection's document type.
27
29
  - `src/test-utils/` and `src/__tests__/` – Utilities that bootstrap `MongoMemoryServer`, expose factories, and make sure Jest environments can stub database calls predictably.
28
30
  - `dist/` – Compiled output consumed by downstream repos (CJS + ESM + type defs).
29
31
 
@@ -157,8 +159,7 @@ Refer to `DEVELOPMENT.md` for the full walkthrough, token instructions, and fact
157
159
  | 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. |
158
160
  | 1.3.24 | **Breaking:** removed `flowId` from `WebsiteTalkProduct` — flow source of truth is `phone_numbers.flow_id`. Added `getPrimaryPhoneFlowId(clientId)`. |
159
161
  | 1.3.25 | Added `disconnectDb()` to close all MongoDB clients opened by `ensureDbConnected()` — for one-shot scripts that must exit cleanly. |
160
- | 1.3.31 | Added optional `ClientConfig.clientDisplayName` and `getClientDisplayName(clientId)` getter (falls back to `clientId`). |
161
- | 1.3.29 | Added client call-quota module (CP-1500): `ClientConfig.quota` for usage limits (`totalQuota`, `usedQuota`, `expiresAt`), alert settings on `clients`, and getters for state, increment/reset, threshold alerts, and expiry notification tracking. |
162
+ | 1.3.28 | Soft-delete (`isActive`) on Streets/DepartmentSubjects, new bulk-write getters, MongoDB type re-exports, and the generic `bulkWrite` op-builder module. |
162
163
  ### 1.1.9
163
164
 
164
165
  1. `npm run build`.
@@ -524,36 +525,24 @@ Combines the CP-1093 tool-execution-steps work (1.3.21) with the `CallsFilterPar
524
525
 
525
526
  `CallStatus` still does not include `"redirected"` — tracked separately.
526
527
 
527
- ### 1.3.29Client call quota (CP-1500)
528
+ ### 1.3.28Soft-delete support and generic bulk-write helpers
528
529
 
529
- Per-client call quota with usage counters, optional expiration, and configurable threshold/expiry email alerts. Usage lives on `clientsConfig`; alert config and send-tracking live on `clients`. TalkPilot Server consumes these getters to block calls when quota is exceeded or expired and to send notification emails.
530
-
531
- **Data model**
532
-
533
- | Location | Field | Purpose |
534
- | --- | --- | --- |
535
- | `clientsConfig.quota` | `totalQuota`, `usedQuota`, `expiresAt?` | Call allowance and consumption. `getClientQuotaState` returns `null` when `totalQuota` is unset (quota disabled for that client). |
536
- | `clients.quota` | `alerts?`, `expiredSent?` | Up to 3 threshold alerts (each with up to 3 recipient emails) and a flag set after the expiry email is sent. |
530
+ Adds an `isActive` soft-delete convention, bulk-write getters for Streets/DepartmentSubjects, MongoDB type re-exports, and a generic bulk-write op-builder module.
537
531
 
538
532
  **Added**
539
533
 
540
534
  | Export | Purpose |
541
535
  | --- | --- |
542
- | `ClientQuotaUsage` | Usage shape: `totalQuota`, `usedQuota`, optional `expiresAt`. |
543
- | `ClientQuotaSettings` | Alert settings on the `clients` doc: `alerts`, `expiredSent`. |
544
- | `ClientQuotaState` | Merged view returned by `getClientQuotaState` (usage + settings). |
545
- | `QuotaThresholdAlert` / `QuotaAlertInput` | Threshold alert with `thresholdPct`, `recipientEmails`, and optional `thresholdSent` send-tracking. |
546
- | `getClientQuotaState(clientId)` | Read combined quota state; `null` when no quota is configured. |
547
- | `incrementClientQuotaUsage(clientId, amount?)` | Atomically increment `clientsConfig.quota.usedQuota` (default `amount = 1`). No-op when `quota.totalQuota` is absent. |
548
- | `resetClientQuotaUsage(clientId)` | Reset `usedQuota` to `0` and clear alert/expiry send flags via `resetClientQuotaSettings`. |
549
- | `updateQuotaAlertsConfig(clientId, alerts)` | Replace threshold alert config; preserves `thresholdSent` for unchanged thresholds. |
550
- | `markQuotaAlertSent(clientId, alertIndex)` | Idempotently mark a threshold alert as sent; returns whether the update applied. |
551
- | `markQuotaExpiredSent(clientId)` | Idempotently mark the expiry notification as sent; returns whether the update applied. |
552
- | `resetClientQuotaSettings(clientId)` | Clear `expiredSent` and strip `thresholdSent` from alerts (keeps alert definitions). |
536
+ | `Street.isActive` / `DepartmentSubject.isActive` | Optional soft-delete flag; `createStreet` defaults it to `true`. |
537
+ | `bulkWriteStreets` / `bulkWriteDepartmentsSubjects` | Passthrough bulk-write for each collection. |
538
+ | `findDepartmentSubjectsByFilter` | Query subjects by an arbitrary filter. |
539
+ | `updateDepartmentSubjectActive` | Set `isActive` on a subject by `_id`. |
540
+ | `ObjectId`, `Filter`, `BulkWriteOp`, `BulkWriteError`, `OptionalUnlessRequiredId` | Re-exported from `mongodb`. |
541
+ | `buildSetOp`, `buildUpsertOp`, `buildInsertOp`, `buildDeleteOp` | Generic bulk-write op builders filter/fields in, a shaped op out. |
553
542
 
554
543
  **Do I need to update my app?**
555
544
 
556
- No — purely additive. **TalkPilot Server** should upgrade to **1.3.29** (or later) to enforce quota on inbound/outbound calls and to drive threshold/expiry emails via the new getters.
545
+ No — purely additive.
557
546
 
558
547
  ## 🛠 CI/CD & deployment
559
548
 
@@ -0,0 +1,17 @@
1
+ import { Document, Filter, OptionalId } from "mongodb";
2
+ import { BulkWriteOp } from "./bulkWrite.types";
3
+ /**
4
+ * Updates specific fields on the record matching filter.
5
+ * Does nothing if no record matches.
6
+ */
7
+ export declare function buildSetOp<T extends Document>(filter: Filter<T>, setFields: Partial<T>): BulkWriteOp<T>;
8
+ /**
9
+ * Updates specific fields on the record matching the filter or creates a new record if none matches.
10
+ * setOnInsertFields are only applied when a new record is created; they're ignored on an update.
11
+ */
12
+ export declare function buildUpsertOp<T extends Document>(filter: Filter<T>, setFields: Partial<T>, setOnInsertFields?: Partial<T>): BulkWriteOp<T>;
13
+ /** Creates a new record. */
14
+ export declare function buildInsertOp<T extends Document>(document: OptionalId<T>): BulkWriteOp<T>;
15
+ /** Permanently removes the record matching the filter. */
16
+ export declare function buildDeleteOp<T extends Document>(filter: Filter<T>): BulkWriteOp<T>;
17
+ //# sourceMappingURL=bulkWrite.ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulkWrite.ops.d.ts","sourceRoot":"","sources":["../../src/bulkWrite/bulkWrite.ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,QAAQ,EAC3C,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EACjB,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,GACpB,WAAW,CAAC,CAAC,CAAC,CAEhB;AAED;;;GAGG;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;AAED,4BAA4B;AAC5B,wBAAgB,aAAa,CAAC,CAAC,SAAS,QAAQ,EAC9C,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GACtB,WAAW,CAAC,CAAC,CAAC,CAEhB;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAAC,CAAC,SAAS,QAAQ,EAC9C,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAChB,WAAW,CAAC,CAAC,CAAC,CAEhB"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildSetOp = buildSetOp;
4
+ exports.buildUpsertOp = buildUpsertOp;
5
+ exports.buildInsertOp = buildInsertOp;
6
+ exports.buildDeleteOp = buildDeleteOp;
7
+ /**
8
+ * Updates specific fields on the record matching filter.
9
+ * Does nothing if no record matches.
10
+ */
11
+ function buildSetOp(filter, setFields) {
12
+ return { updateOne: { filter, update: { $set: setFields } } };
13
+ }
14
+ /**
15
+ * Updates specific fields on the record matching the filter or creates a new record if none matches.
16
+ * setOnInsertFields are only applied when a new record is created; they're ignored on an update.
17
+ */
18
+ function buildUpsertOp(filter, setFields, setOnInsertFields = {}) {
19
+ return {
20
+ updateOne: {
21
+ filter,
22
+ update: { $set: setFields, $setOnInsert: setOnInsertFields },
23
+ upsert: true,
24
+ },
25
+ };
26
+ }
27
+ /** Creates a new record. */
28
+ function buildInsertOp(document) {
29
+ return { insertOne: { document } };
30
+ }
31
+ /** Permanently removes the record matching the filter. */
32
+ function buildDeleteOp(filter) {
33
+ return { deleteOne: { filter } };
34
+ }
35
+ //# sourceMappingURL=bulkWrite.ops.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulkWrite.ops.js","sourceRoot":"","sources":["../../src/bulkWrite/bulkWrite.ops.ts"],"names":[],"mappings":";;AAOA,gCAKC;AAMD,sCAYC;AAGD,sCAIC;AAGD,sCAIC;AAzCD;;;GAGG;AACH,SAAgB,UAAU,CACxB,MAAiB,EACjB,SAAqB;IAErB,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAChE,CAAC;AAED;;;GAGG;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;AAED,4BAA4B;AAC5B,SAAgB,aAAa,CAC3B,QAAuB;IAEvB,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC;AACrC,CAAC;AAED,0DAA0D;AAC1D,SAAgB,aAAa,CAC3B,MAAiB;IAEjB,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;AACnC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { AnyBulkWriteOperation, Document } from "mongodb";
2
+ /** A single MongoDB bulk-write operation, typed against the target document shape. */
3
+ export type BulkWriteOp<T extends Document> = AnyBulkWriteOperation<T>;
4
+ //# sourceMappingURL=bulkWrite.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulkWrite.types.d.ts","sourceRoot":"","sources":["../../src/bulkWrite/bulkWrite.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D,sFAAsF;AACtF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,QAAQ,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=clients.quota.types.js.map
3
+ //# sourceMappingURL=bulkWrite.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bulkWrite.types.js","sourceRoot":"","sources":["../../src/bulkWrite/bulkWrite.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from "./bulkWrite.types";
2
+ export * from "./bulkWrite.ops";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bulkWrite/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,19 @@
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("./bulkWrite.types"), exports);
18
+ __exportStar(require("./bulkWrite.ops"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bulkWrite/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,kDAAgC"}
@@ -0,0 +1,7 @@
1
+ import { Db, ObjectId as MongoObjectId } from "mongodb";
2
+ export * from "./prompts";
3
+ export { configurationMongodbClient } from "./mongodb-client";
4
+ export declare const setDb: (d: Db) => void;
5
+ export declare const getDb: () => Db;
6
+ export declare const ObjectId: typeof MongoObjectId;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAExD,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAG9D,eAAO,MAAM,KAAK,GAAI,GAAG,EAAE,SAE1B,CAAC;AAEF,eAAO,MAAM,KAAK,QAAO,EAGxB,CAAC;AACF,eAAO,MAAM,QAAQ,sBAAgB,CAAC"}
@@ -0,0 +1,34 @@
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
+ exports.ObjectId = exports.getDb = exports.setDb = exports.configurationMongodbClient = void 0;
18
+ const mongodb_1 = require("mongodb");
19
+ __exportStar(require("./prompts"), exports);
20
+ var mongodb_client_1 = require("./mongodb-client");
21
+ Object.defineProperty(exports, "configurationMongodbClient", { enumerable: true, get: function () { return mongodb_client_1.configurationMongodbClient; } });
22
+ let db;
23
+ const setDb = (d) => {
24
+ db = d;
25
+ };
26
+ exports.setDb = setDb;
27
+ const getDb = () => {
28
+ if (!db)
29
+ throw new Error("Configuration DB not initialised");
30
+ return db;
31
+ };
32
+ exports.getDb = getDb;
33
+ exports.ObjectId = mongodb_1.ObjectId;
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/configuration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAwD;AAExD,4CAA0B;AAC1B,mDAA8D;AAArD,4HAAA,0BAA0B,OAAA;AAEnC,IAAI,EAAM,CAAC;AACJ,MAAM,KAAK,GAAG,CAAC,CAAK,EAAE,EAAE;IAC7B,EAAE,GAAG,CAAC,CAAC;AACT,CAAC,CAAC;AAFW,QAAA,KAAK,SAEhB;AAEK,MAAM,KAAK,GAAG,GAAO,EAAE;IAC5B,IAAI,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC7D,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAHW,QAAA,KAAK,SAGhB;AACW,QAAA,QAAQ,GAAG,kBAAa,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Db } from "mongodb";
2
+ declare class ConfigurationMongoDBClient {
3
+ private client;
4
+ private db;
5
+ private readonly defaultDbName;
6
+ connect(uri?: string, dbName?: string): Promise<void>;
7
+ disconnect(): Promise<void>;
8
+ getDb(): Db;
9
+ isConnected(): boolean;
10
+ }
11
+ export declare const configurationMongodbClient: ConfigurationMongoDBClient;
12
+ export {};
13
+ //# sourceMappingURL=mongodb-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-client.d.ts","sourceRoot":"","sources":["../../src/configuration/mongodb-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAE,MAAM,SAAS,CAAC;AAI1C,cAAM,0BAA0B;IAC9B,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,EAAE,CAAmB;IAC7B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmB;IAE3C,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAcjC,KAAK,IAAI,EAAE;IASX,WAAW,IAAI,OAAO;CAGvB;AAED,eAAO,MAAM,0BAA0B,4BAAmC,CAAC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configurationMongodbClient = void 0;
4
+ const mongodb_1 = require("mongodb");
5
+ const index_1 = require("./index");
6
+ const validation_1 = require("../utils/validation");
7
+ class ConfigurationMongoDBClient {
8
+ client = null;
9
+ db = null;
10
+ defaultDbName = "configuration";
11
+ async connect(uri, dbName) {
12
+ if (this.client) {
13
+ return;
14
+ }
15
+ const mongodbUri = uri || process.env.MONGO_URI || process.env.MONGODB_URI;
16
+ (0, validation_1.validateConfig)("MONGO_URI", mongodbUri);
17
+ (0, validation_1.validateMongoUri)(mongodbUri);
18
+ try {
19
+ this.client = new mongodb_1.MongoClient(mongodbUri);
20
+ await this.client.connect();
21
+ const targetDbName = dbName || process.env.CONFIGURATION_DB_NAME || this.defaultDbName;
22
+ this.db = this.client.db(targetDbName);
23
+ (0, index_1.setDb)(this.db);
24
+ console.info(`[core-db] Configuration MongoDB connected: ${targetDbName}`);
25
+ }
26
+ catch (error) {
27
+ console.error("[core-db] Configuration connection failed", error);
28
+ throw error;
29
+ }
30
+ }
31
+ async disconnect() {
32
+ if (this.client) {
33
+ try {
34
+ await this.client.close();
35
+ this.client = null;
36
+ this.db = null;
37
+ console.info("Configuration MongoDB disconnected successfully");
38
+ }
39
+ catch (error) {
40
+ console.error("[core-db] Configuration disconnection failed", error);
41
+ throw error;
42
+ }
43
+ }
44
+ }
45
+ getDb() {
46
+ if (!this.db) {
47
+ throw new Error("Configuration database not initialized. Call connect() first.");
48
+ }
49
+ return this.db;
50
+ }
51
+ isConnected() {
52
+ return this.client !== null && this.client !== undefined;
53
+ }
54
+ }
55
+ exports.configurationMongodbClient = new ConfigurationMongoDBClient();
56
+ //# sourceMappingURL=mongodb-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb-client.js","sourceRoot":"","sources":["../../src/configuration/mongodb-client.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,mCAAgC;AAChC,oDAAuE;AAEvE,MAAM,0BAA0B;IACtB,MAAM,GAAuB,IAAI,CAAC;IAClC,EAAE,GAAc,IAAI,CAAC;IACZ,aAAa,GAAG,eAAe,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,GAAY,EAAE,MAAe;QACzC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,MAAM,UAAU,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;Q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;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC;IAC3D,CAAC;CACF;AAEY,QAAA,0BAA0B,GAAG,IAAI,0BAA0B,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./prompts.getters";
2
+ export type { Prompt } from "./prompts.types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/configuration/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,18 @@
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("./prompts.getters"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/configuration/prompts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
@@ -0,0 +1,21 @@
1
+ import { Collection, Filter } from "mongodb";
2
+ import { Prompt } from "./prompts.types";
3
+ export declare const getPromptsCollection: () => Collection<Prompt>;
4
+ /**
5
+ * Get a prompt by its unique name.
6
+ * @param name prompt name
7
+ * @returns the prompt or null if not found
8
+ */
9
+ export declare const getPromptByName: (name: string) => Promise<Prompt | null>;
10
+ /**
11
+ * Find prompts by filter.
12
+ * @param filter filter to apply
13
+ * @returns array of matching prompts
14
+ */
15
+ export declare const findPrompts: (filter?: Filter<Prompt>) => Promise<Prompt[]>;
16
+ /**
17
+ * Get all prompts.
18
+ * @returns array of all prompts
19
+ */
20
+ export declare const getAllPrompts: () => Promise<Prompt[]>;
21
+ //# sourceMappingURL=prompts.getters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.getters.d.ts","sourceRoot":"","sources":["../../../src/configuration/prompts/prompts.getters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,eAAO,MAAM,oBAAoB,QAAO,UAAU,CAAC,MAAM,CAExD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,MAAM,KACX,OAAO,CAAC,MAAM,GAAG,IAAI,CAEvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GACtB,SAAQ,MAAM,CAAC,MAAM,CAAM,KAC1B,OAAO,CAAC,MAAM,EAAE,CAElB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,MAAM,EAAE,CAEtD,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllPrompts = exports.findPrompts = exports.getPromptByName = exports.getPromptsCollection = void 0;
4
+ const index_1 = require("../index");
5
+ const getPromptsCollection = () => {
6
+ return (0, index_1.getDb)().collection("Prompts");
7
+ };
8
+ exports.getPromptsCollection = getPromptsCollection;
9
+ /**
10
+ * Get a prompt by its unique name.
11
+ * @param name prompt name
12
+ * @returns the prompt or null if not found
13
+ */
14
+ const getPromptByName = async (name) => {
15
+ return await (0, exports.getPromptsCollection)().findOne({ name });
16
+ };
17
+ exports.getPromptByName = getPromptByName;
18
+ /**
19
+ * Find prompts by filter.
20
+ * @param filter filter to apply
21
+ * @returns array of matching prompts
22
+ */
23
+ const findPrompts = async (filter = {}) => {
24
+ return await (0, exports.getPromptsCollection)().find(filter).toArray();
25
+ };
26
+ exports.findPrompts = findPrompts;
27
+ /**
28
+ * Get all prompts.
29
+ * @returns array of all prompts
30
+ */
31
+ const getAllPrompts = async () => {
32
+ return await (0, exports.findPrompts)();
33
+ };
34
+ exports.getAllPrompts = getAllPrompts;
35
+ //# sourceMappingURL=prompts.getters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.getters.js","sourceRoot":"","sources":["../../../src/configuration/prompts/prompts.getters.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AAI1B,MAAM,oBAAoB,GAAG,GAAuB,EAAE;IAC3D,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAS,SAAS,CAAC,CAAC;AAC/C,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B;AAEF;;;;GAIG;AACI,MAAM,eAAe,GAAG,KAAK,EAClC,IAAY,EACY,EAAE;IAC1B,OAAO,MAAM,IAAA,4BAAoB,GAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AACxD,CAAC,CAAC;AAJW,QAAA,eAAe,mBAI1B;AAEF;;;;GAIG;AACI,MAAM,WAAW,GAAG,KAAK,EAC9B,SAAyB,EAAE,EACR,EAAE;IACrB,OAAO,MAAM,IAAA,4BAAoB,GAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;AAC7D,CAAC,CAAC;AAJW,QAAA,WAAW,eAItB;AAEF;;;GAGG;AACI,MAAM,aAAa,GAAG,KAAK,IAAuB,EAAE;IACzD,OAAO,MAAM,IAAA,mBAAW,GAAE,CAAC;AAC7B,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
@@ -0,0 +1,9 @@
1
+ import { ObjectId } from "mongodb";
2
+ export type Prompt = {
3
+ _id: ObjectId;
4
+ name: string;
5
+ content: string;
6
+ createdAt: Date;
7
+ updatedAt: Date;
8
+ };
9
+ //# sourceMappingURL=prompts.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.types.d.ts","sourceRoot":"","sources":["../../../src/configuration/prompts/prompts.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,QAAQ,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=prompts.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.types.js","sourceRoot":"","sources":["../../../src/configuration/prompts/prompts.types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,iBAAiB,kBA2CtC;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAWlD"}
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAsB,iBAAiB,kBAsDtC;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAYlD"}
@@ -5,6 +5,7 @@ exports.disconnectDb = disconnectDb;
5
5
  const talkpilot_1 = require("./talkpilot");
6
6
  const municipal_1 = require("./municipal");
7
7
  const websitalk_1 = require("./websitalk");
8
+ const configuration_1 = require("./configuration");
8
9
  let isConnected = false;
9
10
  /**
10
11
  * Ensures the database clients are initialized.
@@ -18,6 +19,7 @@ async function ensureDbConnected() {
18
19
  const talkpilotUri = mongoUri;
19
20
  const municipalUri = mongoUri;
20
21
  const websiteTalkUri = mongoUri;
22
+ const configurationUri = mongoUri;
21
23
  if (!talkpilotUri) {
22
24
  console.warn("[core-db] MONGO_URI is not set");
23
25
  }
@@ -44,6 +46,14 @@ async function ensureDbConnected() {
44
46
  await websitalk_1.websitalkMongodbClient.connect(websiteTalkUri, dbName);
45
47
  console.info(`[core-db] Connected to Website Talk MongoDB: ${dbName || "website-talk (default)"}`);
46
48
  }
49
+ if (!configurationUri) {
50
+ console.warn("[core-db] MONGO_URI is not set");
51
+ }
52
+ else {
53
+ const dbName = process.env.CONFIGURATION_DB_NAME;
54
+ await configuration_1.configurationMongodbClient.connect(configurationUri, dbName);
55
+ console.info(`[core-db] Connected to Configuration MongoDB: ${dbName || "configuration (default)"}`);
56
+ }
47
57
  isConnected = true;
48
58
  }
49
59
  async function disconnectDb() {
@@ -54,6 +64,7 @@ async function disconnectDb() {
54
64
  talkpilot_1.mongodbClient.disconnect(),
55
65
  municipal_1.municipalDataMongodbClient.disconnect(),
56
66
  websitalk_1.websitalkMongodbClient.disconnect(),
67
+ configuration_1.configurationMongodbClient.disconnect(),
57
68
  ]);
58
69
  isConnected = false;
59
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;AAUA,8CA2CC;AAED,oCAWC;AAlED,2CAA4C;AAC5C,2CAAyD;AACzD,2CAAqD;AAErD,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB;;;GAGG;AACI,KAAK,UAAU,iBAAiB;IACrC,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,G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;QACN,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QACjD,MAAM,0CAA0B,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACnE,OAAO,CAAC,IAAI,CACV,iDAAiD,MAAM,IAAI,yBAAyB,EAAE,CACvF,CAAC;IACJ,CAAC;IAED,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC;AAEM,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,yBAAa,CAAC,UAAU,EAAE;QAC1B,sCAA0B,CAAC,UAAU,EAAE;QACvC,kCAAsB,CAAC,UAAU,EAAE;QACnC,0CAA0B,CAAC,UAAU,EAAE;KACxC,CAAC,CAAC;IACH,WAAW,GAAG,KAAK,CAAC;AACtB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./talkpilot";
2
2
  export * from "./connection";
3
+ export * from "./bulkWrite";
3
4
  export { municipalDataMongodbClient, getDb as getMunicipalDataDb, setDb as setMunicipalDataDb, ObjectId as MunicipalDataObjectId, } from "./municipal";
4
5
  export * from "./municipal/cities";
5
6
  export * from "./municipal/streets";
@@ -12,4 +13,11 @@ export { websitalkMongodbClient, getDb as getWebsitalkDb, setDb as setWebsitalkD
12
13
  export * from "./websitalk/scans/scans.getters";
13
14
  export type * from "./websitalk/scans/scans.types";
14
15
  export * from "./websitalk/websiteUrls";
16
+ export { configurationMongodbClient, getDb as getConfigurationDb, setDb as setConfigurationDb, } from "./configuration";
17
+ export * from "./configuration/prompts";
18
+ export { ObjectId } from "mongodb";
19
+ export type { Filter } from "mongodb";
20
+ export type { AnyBulkWriteOperation as BulkWriteOp } from "mongodb";
21
+ export { MongoBulkWriteError as BulkWriteError } from "mongodb";
22
+ export type { OptionalUnlessRequiredId } from "mongodb";
15
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,0BAA0B,EAC1B,KAAK,IAAI,kBAAkB,EAC3B,KAAK,IAAI,kBAAkB,EAC3B,QAAQ,IAAI,qBAAqB,GAClC,MAAM,aAAa,CAAC;AACrB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AAExC,OAAO,EACL,sBAAsB,EACtB,KAAK,IAAI,cAAc,EACvB,KAAK,IAAI,cAAc,EACvB,QAAQ,IAAI,iBAAiB,GAC9B,MAAM,aAAa,CAAC;AACrB,cAAc,iCAAiC,CAAC;AAChD,mBAAmB,+BAA+B,CAAC;AACnD,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,EACL,0BAA0B,EAC1B,KAAK,IAAI,kBAAkB,EAC3B,KAAK,IAAI,kBAAkB,EAC3B,QAAQ,IAAI,qBAAqB,GAClC,MAAM,aAAa,CAAC;AACrB,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AAExC,OAAO,EACL,sBAAsB,EACtB,KAAK,IAAI,cAAc,EACvB,KAAK,IAAI,cAAc,EACvB,QAAQ,IAAI,iBAAiB,GAC9B,MAAM,aAAa,CAAC;AACrB,cAAc,iCAAiC,CAAC;AAChD,mBAAmB,+BAA+B,CAAC;AACnD,cAAc,yBAAyB,CAAC;AAExC,OAAO,EACL,0BAA0B,EAC1B,KAAK,IAAI,kBAAkB,EAC3B,KAAK,IAAI,kBAAkB,GAC5B,MAAM,iBAAiB,CAAC;AACzB,cAAc,yBAAyB,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,YAAY,EAAE,qBAAqB,IAAI,WAAW,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,SAAS,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -14,10 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.WebsitalkObjectId = exports.setWebsitalkDb = exports.getWebsitalkDb = exports.websitalkMongodbClient = exports.MunicipalDataObjectId = exports.setMunicipalDataDb = exports.getMunicipalDataDb = exports.municipalDataMongodbClient = void 0;
17
+ exports.BulkWriteError = exports.ObjectId = exports.setConfigurationDb = exports.getConfigurationDb = exports.configurationMongodbClient = exports.WebsitalkObjectId = exports.setWebsitalkDb = exports.getWebsitalkDb = exports.websitalkMongodbClient = exports.MunicipalDataObjectId = exports.setMunicipalDataDb = exports.getMunicipalDataDb = exports.municipalDataMongodbClient = void 0;
18
18
  // TalkPilot DB exports
19
19
  __exportStar(require("./talkpilot"), exports);
20
20
  __exportStar(require("./connection"), exports);
21
+ __exportStar(require("./bulkWrite"), exports);
21
22
  var municipal_1 = require("./municipal");
22
23
  Object.defineProperty(exports, "municipalDataMongodbClient", { enumerable: true, get: function () { return municipal_1.municipalDataMongodbClient; } });
23
24
  Object.defineProperty(exports, "getMunicipalDataDb", { enumerable: true, get: function () { return municipal_1.getDb; } });
@@ -37,4 +38,13 @@ Object.defineProperty(exports, "setWebsitalkDb", { enumerable: true, get: functi
37
38
  Object.defineProperty(exports, "WebsitalkObjectId", { enumerable: true, get: function () { return websitalk_1.ObjectId; } });
38
39
  __exportStar(require("./websitalk/scans/scans.getters"), exports);
39
40
  __exportStar(require("./websitalk/websiteUrls"), exports);
41
+ var configuration_1 = require("./configuration");
42
+ Object.defineProperty(exports, "configurationMongodbClient", { enumerable: true, get: function () { return configuration_1.configurationMongodbClient; } });
43
+ Object.defineProperty(exports, "getConfigurationDb", { enumerable: true, get: function () { return configuration_1.getDb; } });
44
+ Object.defineProperty(exports, "setConfigurationDb", { enumerable: true, get: function () { return configuration_1.setDb; } });
45
+ __exportStar(require("./configuration/prompts"), exports);
46
+ var mongodb_1 = require("mongodb");
47
+ Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return mongodb_1.ObjectId; } });
48
+ var mongodb_2 = require("mongodb");
49
+ Object.defineProperty(exports, "BulkWriteError", { enumerable: true, get: function () { return mongodb_2.MongoBulkWriteError; } });
40
50
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,8CAA4B;AAC5B,+CAA6B;AAE7B,yCAKqB;AAJnB,uHAAA,0BAA0B,OAAA;AAC1B,+GAAA,KAAK,OAAsB;AAC3B,+GAAA,KAAK,OAAsB;AAC3B,kHAAA,QAAQ,OAAyB;AAEnC,qDAAmC;AACnC,sDAAoC;AACpC,kEAAgD;AAChD,sDAAoC;AACpC,iEAA+C;AAC/C,yDAAuC;AACvC,0DAAwC;AAExC,yCAKqB;AAJnB,mHAAA,sBAAsB,OAAA;AACtB,2GAAA,KAAK,OAAkB;AACvB,2GAAA,KAAK,OAAkB;AACvB,8GAAA,QAAQ,OAAqB;AAE/B,kEAAgD;AAEhD,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,8CAA4B;AAC5B,+CAA6B;AAC7B,8CAA4B;AAE5B,yCAKqB;AAJnB,uHAAA,0BAA0B,OAAA;AAC1B,+GAAA,KAAK,OAAsB;AAC3B,+GAAA,KAAK,OAAsB;AAC3B,kHAAA,QAAQ,OAAyB;AAEnC,qDAAmC;AACnC,sDAAoC;AACpC,kEAAgD;AAChD,sDAAoC;AACpC,iEAA+C;AAC/C,yDAAuC;AACvC,0DAAwC;AAExC,yCAKqB;AAJnB,mHAAA,sBAAsB,OAAA;AACtB,2GAAA,KAAK,OAAkB;AACvB,2GAAA,KAAK,OAAkB;AACvB,8GAAA,QAAQ,OAAqB;AAE/B,kEAAgD;AAEhD,0DAAwC;AAExC,iDAIyB;AAHvB,2HAAA,0BAA0B,OAAA;AAC1B,mHAAA,KAAK,OAAsB;AAC3B,mHAAA,KAAK,OAAsB;AAE7B,0DAAwC;AAExC,mCAAmC;AAA1B,mGAAA,QAAQ,OAAA;AAGjB,mCAAgE;AAAvD,yGAAA,mBAAmB,OAAkB"}
@@ -1,7 +1,8 @@
1
1
  import { CityName, DepartmentSubject } from "../index";
2
- import { Collection, Filter } from "mongodb";
2
+ import { AnyBulkWriteOperation, BulkWriteOptions, BulkWriteResult, Collection, Filter, ObjectId } from "mongodb";
3
3
  import { VectorSearchResult } from "./departmentsSubjects.types";
4
4
  export declare const getDepartmentsSubjectsCollection: () => Collection<DepartmentSubject>;
5
+ export declare const bulkWriteDepartmentsSubjects: (operations: AnyBulkWriteOperation<DepartmentSubject>[], options?: BulkWriteOptions) => Promise<BulkWriteResult>;
5
6
  /**
6
7
  * Get all departments subjects for a given city.
7
8
  * No DB sort; tree build does not depend on order. Callers that need alphabetical order
@@ -59,4 +60,17 @@ export declare const updateDepartmentSubjectGuidelines: (filter: Filter<Departme
59
60
  */
60
61
  export declare const deleteDepartmentSubjectGuidelines: (filter: Filter<DepartmentSubject>) => Promise<DepartmentSubject | null>;
61
62
  export declare const findSubjectByQuery: (query: Partial<DepartmentSubject>) => Promise<import("mongodb").WithId<DepartmentSubject> | null>;
63
+ /**
64
+ * Get department subjects matching a filter
65
+ * @param filter - Mongo filter
66
+ * @returns Array of matching documents
67
+ */
68
+ export declare const findDepartmentSubjectsByFilter: (filter: Filter<DepartmentSubject>) => Promise<DepartmentSubject[]>;
69
+ /**
70
+ * Update the isActive flag for a subject
71
+ * @param id - _id of the document to update
72
+ * @param isActive - Active status to set
73
+ * @returns Updated DepartmentSubject document, null if not found
74
+ */
75
+ export declare const updateDepartmentSubjectActive: (id: ObjectId, isActive: boolean) => Promise<DepartmentSubject | null>;
62
76
  //# sourceMappingURL=departmentsSubjects.getters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"departmentsSubjects.getters.d.ts","sourceRoot":"","sources":["../../../src/municipal/departmentsSubjects/departmentsSubjects.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAS,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,eAAO,MAAM,gCAAgC,QACvC,UAAU,CAAC,iBAAiB,CAE/B,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC1C,UAAU,QAAQ,EAClB,iBAAgB,OAAe,KAC9B,OAAO,CAAC,iBAAiB,EAAE,CAW7B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC1C,aAAa,MAAM,EAAE,EACrB,UAAU,QAAQ,EAClB,QAAO,MAAU,EACjB,gBAAe,MAAY,KAC1B,OAA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ACjC,iBAAiB,MAAM,KACtB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAWlC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,GAC3C,WAAW,MAAM,EACjB,cAAc,MAAM,EACpB,UAAU,QAAQ,KACjB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAelC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,GAC5C,QAAQ,MAAM,CAAC,iBAAiB,CAAC,EACjC,YAAY,MAAM,KACjB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAQlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,GAC5C,QAAQ,MAAM,CAAC,iBAAiB,CAAC,KAChC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAQlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAU,OAAO,OAAO,CAAC,iBAAiB,CAAC,gEAEzE,CAAC"}
1
+ {"version":3,"file":"departmentsSubjects.getters.d.ts","sourceRoot":"","sources":["../../../src/municipal/departmentsSubjects/departmentsSubjects.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,iBAAiB,EAAQ,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAC,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChH,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAE/D,eAAO,MAAM,gCAAgC,QACvC,UAAU,CAAC,iBAAiB,CAE/B,CAAC;AAEJ,eAAO,MAAM,4BAA4B,GACvC,YAAY,qBAAqB,CAAC,iBAAiB,CAAC,EAAE,EACtD,UAAU,gBAAgB,KACzB,OAAO,CAAC,eAAe,CAEzB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAC1C,UAAU,QAAQ,EAClB,iBAAgB,OAAe,KAC9B,OAAO,CAA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