@talkpilot/core-db 1.3.50 → 1.3.52
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/.cursor/rules/development.mdc +65 -65
- package/AGENTS.md +49 -49
- package/DEVELOPMENT.md +141 -141
- package/README.md +797 -778
- package/dist/configuration/models/models.constants.d.ts +1 -1
- package/dist/configuration/models/models.constants.d.ts.map +1 -1
- package/dist/configuration/models/models.constants.js +1 -6
- package/dist/configuration/models/models.constants.js.map +1 -1
- package/dist/talkpilot/auditLogs/auditLogs.getters.d.ts +8 -0
- package/dist/talkpilot/auditLogs/auditLogs.getters.d.ts.map +1 -0
- package/dist/talkpilot/auditLogs/auditLogs.getters.js +26 -0
- package/dist/talkpilot/auditLogs/auditLogs.getters.js.map +1 -0
- package/dist/talkpilot/auditLogs/auditLogs.setters.d.ts +3 -0
- package/dist/talkpilot/auditLogs/auditLogs.setters.d.ts.map +1 -0
- package/dist/talkpilot/auditLogs/auditLogs.setters.js +9 -0
- package/dist/talkpilot/auditLogs/auditLogs.setters.js.map +1 -0
- package/dist/talkpilot/auditLogs/auditLogs.types.d.ts +12 -0
- package/dist/talkpilot/auditLogs/auditLogs.types.d.ts.map +1 -0
- package/dist/talkpilot/auditLogs/auditLogs.types.js +3 -0
- package/dist/talkpilot/auditLogs/auditLogs.types.js.map +1 -0
- package/dist/talkpilot/auditLogs/index.d.ts +3 -0
- package/dist/talkpilot/auditLogs/index.d.ts.map +1 -0
- package/dist/talkpilot/auditLogs/index.js +19 -0
- package/dist/talkpilot/auditLogs/index.js.map +1 -0
- package/dist/talkpilot/calls/calls.constants.d.ts +1 -1
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.d.ts +4 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.d.ts.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.js +9 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.js.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.d.ts +3 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.d.ts.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.js +9 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.js.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.d.ts +10 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.d.ts.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.js +3 -0
- package/dist/talkpilot/clientDeletionLogs/clientDeletionLogs.types.js.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/index.d.ts +4 -0
- package/dist/talkpilot/clientDeletionLogs/index.d.ts.map +1 -0
- package/dist/talkpilot/clientDeletionLogs/index.js +20 -0
- package/dist/talkpilot/clientDeletionLogs/index.js.map +1 -0
- package/dist/talkpilot/clients/clients.constants.d.ts +3 -0
- package/dist/talkpilot/clients/clients.constants.d.ts.map +1 -0
- package/dist/talkpilot/clients/clients.constants.js +6 -0
- package/dist/talkpilot/clients/clients.constants.js.map +1 -0
- package/dist/talkpilot/clients/clients.getters.d.ts +1 -0
- package/dist/talkpilot/clients/clients.getters.d.ts.map +1 -1
- package/dist/talkpilot/clients/clients.getters.js +8 -1
- package/dist/talkpilot/clients/clients.getters.js.map +1 -1
- package/dist/talkpilot/clients/clients.lifecycle.d.ts +10 -0
- package/dist/talkpilot/clients/clients.lifecycle.d.ts.map +1 -0
- package/dist/talkpilot/clients/clients.lifecycle.js +95 -0
- package/dist/talkpilot/clients/clients.lifecycle.js.map +1 -0
- package/dist/talkpilot/clients/clients.types.d.ts +21 -0
- package/dist/talkpilot/clients/clients.types.d.ts.map +1 -1
- package/dist/talkpilot/clients/index.d.ts +2 -0
- package/dist/talkpilot/clients/index.d.ts.map +1 -1
- package/dist/talkpilot/clients/index.js +2 -0
- package/dist/talkpilot/clients/index.js.map +1 -1
- package/dist/talkpilot/flows/flows.getter.d.ts +1 -4
- package/dist/talkpilot/flows/flows.getter.d.ts.map +1 -1
- package/dist/talkpilot/flows/flows.getter.js +1 -12
- package/dist/talkpilot/flows/flows.getter.js.map +1 -1
- package/dist/talkpilot/flows/flows.schema.d.ts +0 -31
- package/dist/talkpilot/flows/flows.schema.d.ts.map +1 -1
- package/dist/talkpilot/flows/flows.schema.js +0 -25
- package/dist/talkpilot/flows/flows.schema.js.map +1 -1
- package/dist/talkpilot/flows/flows.types.d.ts +0 -14
- package/dist/talkpilot/flows/flows.types.d.ts.map +1 -1
- package/dist/talkpilot/flows/index.d.ts +1 -1
- package/dist/talkpilot/flows/index.d.ts.map +1 -1
- package/dist/talkpilot/flows/index.js +1 -3
- package/dist/talkpilot/flows/index.js.map +1 -1
- package/dist/talkpilot/index.d.ts +1 -0
- package/dist/talkpilot/index.d.ts.map +1 -1
- package/dist/talkpilot/index.js +1 -0
- package/dist/talkpilot/index.js.map +1 -1
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.d.ts +11 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.d.ts.map +1 -1
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.js +60 -1
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.js.map +1 -1
- package/dist/talkpilot/results/index.d.ts +3 -0
- package/dist/talkpilot/results/index.d.ts.map +1 -1
- package/dist/talkpilot/results/index.js +22 -1
- package/dist/talkpilot/results/index.js.map +1 -1
- package/dist/talkpilot/results/results.constants.d.ts +9 -0
- package/dist/talkpilot/results/results.constants.d.ts.map +1 -0
- package/dist/talkpilot/results/results.constants.js +12 -0
- package/dist/talkpilot/results/results.constants.js.map +1 -0
- package/dist/talkpilot/results/results.getter.d.ts.map +1 -1
- package/dist/talkpilot/results/results.getter.js +3 -2
- package/dist/talkpilot/results/results.getter.js.map +1 -1
- package/dist/talkpilot/results/results.statistics.getters.d.ts +7 -0
- package/dist/talkpilot/results/results.statistics.getters.d.ts.map +1 -0
- package/dist/talkpilot/results/results.statistics.getters.js +244 -0
- package/dist/talkpilot/results/results.statistics.getters.js.map +1 -0
- package/dist/talkpilot/results/results.statistics.types.d.ts +42 -0
- package/dist/talkpilot/results/results.statistics.types.d.ts.map +1 -0
- package/dist/talkpilot/results/results.statistics.types.js +3 -0
- package/dist/talkpilot/results/results.statistics.types.js.map +1 -0
- package/dist/test-utils/factories/index.d.ts +2 -0
- package/dist/test-utils/factories/index.d.ts.map +1 -1
- package/dist/test-utils/factories/index.js +2 -0
- package/dist/test-utils/factories/index.js.map +1 -1
- package/dist/test-utils/factories/talkpilot/clients.d.ts +14 -0
- package/dist/test-utils/factories/talkpilot/clients.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/clients.js +19 -0
- package/dist/test-utils/factories/talkpilot/clients.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/results.d.ts +16 -0
- package/dist/test-utils/factories/talkpilot/results.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/results.js +40 -0
- package/dist/test-utils/factories/talkpilot/results.js.map +1 -0
- package/jest.config.js +20 -20
- package/package.json +46 -46
- package/src/__tests__/setup.ts +20 -20
- package/src/bulkWrite/__tests__/bulkWrite.spec.ts +65 -65
- package/src/bulkWrite/bulkWrite.ops.ts +45 -45
- package/src/bulkWrite/bulkWrite.types.ts +4 -4
- package/src/bulkWrite/index.ts +2 -2
- package/src/config.ts +9 -9
- package/src/configuration/index.ts +17 -17
- package/src/configuration/internalModels/index.ts +3 -3
- package/src/configuration/internalModels/internalModels.constants.ts +1 -1
- package/src/configuration/internalModels/internalModels.getters.ts +33 -33
- package/src/configuration/internalModels/internalModels.types.ts +12 -12
- package/src/configuration/models/index.ts +25 -25
- package/src/configuration/models/models.constants.ts +13 -18
- package/src/configuration/models/models.getters.ts +53 -53
- package/src/configuration/models/models.types.ts +79 -79
- package/src/configuration/mongodb-client.ts +62 -62
- package/src/configuration/prompts/index.ts +2 -2
- package/src/configuration/prompts/prompts.getters.ts +49 -49
- package/src/configuration/prompts/prompts.types.ts +11 -11
- package/src/connection.ts +81 -81
- package/src/index.ts +46 -46
- package/src/municipal/__tests__/validation.spec.ts +62 -62
- package/src/municipal/cities/cities.getters.ts +50 -50
- package/src/municipal/cities/cities.types.ts +11 -11
- package/src/municipal/cities/index.ts +2 -2
- package/src/municipal/departmentsSubjects/__tests__/departmentsSubjects.spec.ts +272 -272
- package/src/municipal/departmentsSubjects/departmentsSubjects.getters.ts +317 -317
- package/src/municipal/departmentsSubjects/departmentsSubjects.types.ts +73 -73
- package/src/municipal/departmentsSubjects/index.ts +9 -9
- package/src/municipal/index.ts +22 -22
- package/src/municipal/mongodb-client.ts +61 -61
- package/src/municipal/muniIssues/__tests__/muniIssues.setters.spec.ts +94 -94
- package/src/municipal/muniIssues/__tests__/muniIssues.setup.spec.ts +92 -92
- package/src/municipal/muniIssues/index.ts +17 -17
- package/src/municipal/muniIssues/muniIssues.constants.ts +18 -18
- package/src/municipal/muniIssues/muniIssues.getters.ts +24 -24
- package/src/municipal/muniIssues/muniIssues.schema.ts +66 -66
- package/src/municipal/muniIssues/muniIssues.setters.ts +24 -24
- package/src/municipal/muniIssues/muniIssues.setup.ts +65 -65
- package/src/municipal/muniIssues/muniIssues.types.ts +37 -37
- package/src/municipal/streets/__tests__/streets.spec.ts +253 -253
- package/src/municipal/streets/index.ts +2 -2
- package/src/municipal/streets/streets.getters.ts +140 -140
- package/src/municipal/streets/streets.types.ts +19 -19
- package/src/municipal/systemInstructions/__tests__/getters.spec.ts +113 -113
- package/src/municipal/systemInstructions/__tests__/setters.spec.ts +274 -274
- package/src/municipal/systemInstructions/index.ts +7 -7
- package/src/municipal/systemInstructions/instructions.getters.ts +57 -57
- package/src/municipal/systemInstructions/instructions.setters.ts +119 -119
- package/src/municipal/systemInstructions/instructions.types.ts +30 -30
- package/src/municipal/tickets/__tests__/tickets.getters.spec.ts +30 -30
- package/src/municipal/tickets/__tests__/tickets.statistics.spec.ts +99 -99
- package/src/municipal/tickets/index.ts +9 -9
- package/src/municipal/tickets/tickets.constants.ts +8 -8
- package/src/municipal/tickets/tickets.getters.ts +121 -121
- package/src/municipal/tickets/tickets.statistics.aggregation.ts +110 -110
- package/src/municipal/tickets/tickets.statistics.getters.ts +145 -145
- package/src/municipal/tickets/tickets.types.ts +54 -54
- package/src/municipal/utils/types.ts +11 -11
- package/src/talkpilot/__tests__/db.spec.ts +38 -38
- package/src/talkpilot/__tests__/mongodb-client.spec.ts +18 -18
- package/src/talkpilot/__tests__/validation.spec.ts +68 -68
- package/src/talkpilot/agents/__tests__/agents.getters.spec.ts +29 -29
- package/src/talkpilot/agents/agents.getters.ts +34 -34
- package/src/talkpilot/agents/agents.types.ts +14 -14
- package/src/talkpilot/agents/index.ts +2 -2
- package/src/talkpilot/auditLogs/__tests__/auditLogs.spec.ts +92 -0
- package/src/talkpilot/auditLogs/auditLogs.getters.ts +26 -0
- package/src/talkpilot/auditLogs/auditLogs.types.ts +13 -0
- package/src/talkpilot/auditLogs/index.ts +2 -0
- package/src/talkpilot/backgroundToolResults/__tests__/backgroundToolResults.getters.spec.ts +147 -147
- package/src/talkpilot/backgroundToolResults/backgroundToolResults.getters.ts +65 -65
- package/src/talkpilot/backgroundToolResults/backgroundToolResults.types.ts +23 -23
- package/src/talkpilot/backgroundToolResults/index.ts +2 -2
- package/src/talkpilot/calls/__tests__/callStats.utils.spec.ts +128 -128
- package/src/talkpilot/calls/__tests__/calls.dashboard.spec.ts +229 -229
- package/src/talkpilot/calls/__tests__/calls.spec.ts +471 -471
- package/src/talkpilot/calls/__tests__/calls.statistics.spec.ts +483 -483
- package/src/talkpilot/calls/calls.constants.ts +49 -49
- package/src/talkpilot/calls/calls.getters.ts +277 -277
- package/src/talkpilot/calls/calls.statistics.getters.ts +668 -668
- package/src/talkpilot/calls/calls.statistics.types.ts +48 -48
- package/src/talkpilot/calls/calls.types.ts +149 -149
- package/src/talkpilot/calls/dashboard/calls.dashboard.ts +295 -295
- package/src/talkpilot/calls/dashboard/calls.dashboard.types.ts +57 -57
- package/src/talkpilot/calls/index.ts +6 -6
- package/src/talkpilot/clientAudioBuffers/__tests__/clientAudioBuffer.getters.spec.ts +160 -160
- package/src/talkpilot/clientAudioBuffers/clientAudioBuffer.getters.ts +117 -117
- package/src/talkpilot/clientAudioBuffers/clientsAudioBuffers.types.ts +25 -25
- package/src/talkpilot/clientAudioBuffers/index.ts +2 -2
- package/src/talkpilot/clients/__tests__/clients.getters.spec.ts +33 -0
- package/src/talkpilot/clients/__tests__/clients.lifecycle.spec.ts +166 -0
- package/src/talkpilot/clients/__tests__/clients.quota.spec.ts +123 -123
- package/src/talkpilot/clients/clients.constants.ts +2 -0
- package/src/talkpilot/clients/clients.getters.ts +23 -16
- package/src/talkpilot/clients/clients.lifecycle.ts +116 -0
- package/src/talkpilot/clients/clients.quota.getters.ts +119 -119
- package/src/talkpilot/clients/clients.quota.types.ts +27 -27
- package/src/talkpilot/clients/clients.types.ts +37 -18
- package/src/talkpilot/clients/index.ts +6 -4
- package/src/talkpilot/clientsConfig/__tests__/clientsConfig.getters.spec.ts +423 -423
- package/src/talkpilot/clientsConfig/__tests__/clientsConfig.spec.ts +212 -212
- package/src/talkpilot/clientsConfig/clientsConfig.constants.ts +2 -2
- package/src/talkpilot/clientsConfig/clientsConfig.getters.ts +247 -247
- package/src/talkpilot/clientsConfig/clientsConfig.types.ts +136 -136
- package/src/talkpilot/clientsConfig/index.ts +3 -3
- package/src/talkpilot/contextNotes/__tests__/contextNotes.getters.spec.ts +217 -217
- package/src/talkpilot/contextNotes/contextNotes.getters.ts +85 -85
- package/src/talkpilot/contextNotes/contextNotes.types.ts +20 -20
- package/src/talkpilot/contextNotes/index.ts +2 -2
- package/src/talkpilot/flows/__tests__/flows.schema.spec.ts +99 -124
- package/src/talkpilot/flows/flows.getter.ts +14 -34
- package/src/talkpilot/flows/flows.schema.ts +155 -180
- package/src/talkpilot/flows/flows.types.ts +189 -211
- package/src/talkpilot/flows/index.ts +2 -7
- package/src/talkpilot/groups/__tests__/groups.spec.ts +90 -90
- package/src/talkpilot/groups/__tests__/phone.utils.spec.ts +32 -32
- package/src/talkpilot/groups/groups.getters.ts +30 -30
- package/src/talkpilot/groups/groups.types.ts +29 -29
- package/src/talkpilot/groups/index.ts +3 -3
- package/src/talkpilot/groups/phone.utils.ts +46 -46
- package/src/talkpilot/index.ts +32 -31
- package/src/talkpilot/leads/index.ts +2 -2
- package/src/talkpilot/leads/leads.getter.ts +6 -6
- package/src/talkpilot/leads/leads.schema.ts +33 -33
- package/src/talkpilot/leads/leads.types.ts +20 -20
- package/src/talkpilot/mongodb-client.ts +78 -78
- package/src/talkpilot/phone_numbers/__tests__/phone_numbers.spec.ts +496 -282
- package/src/talkpilot/phone_numbers/index.ts +2 -2
- package/src/talkpilot/phone_numbers/phone_numbers.getter.ts +251 -176
- package/src/talkpilot/phone_numbers/phone_numbers.schema.ts +17 -17
- package/src/talkpilot/phone_numbers/phone_numbers.types.ts +30 -30
- package/src/talkpilot/plans/__tests__/plans.spec.ts +70 -70
- package/src/talkpilot/plans/index.ts +2 -2
- package/src/talkpilot/plans/plans.getters.ts +132 -132
- package/src/talkpilot/plans/plans.types.ts +89 -89
- package/src/talkpilot/products/__tests__/products.getters.spec.ts +44 -44
- package/src/talkpilot/products/index.ts +2 -2
- package/src/talkpilot/products/products.getters.ts +12 -12
- package/src/talkpilot/products/products.types.ts +9 -9
- package/src/talkpilot/results/__tests__/results.statistics.spec.ts +226 -0
- package/src/talkpilot/results/index.ts +16 -7
- package/src/talkpilot/results/results.constants.ts +11 -0
- package/src/talkpilot/results/results.getter.ts +40 -39
- package/src/talkpilot/results/results.schema.ts +25 -25
- package/src/talkpilot/results/results.statistics.getters.ts +329 -0
- package/src/talkpilot/results/results.statistics.types.ts +45 -0
- package/src/talkpilot/results/results.types.ts +34 -34
- package/src/talkpilot/retry_analyze/__tests__/retryAnalyze.getters.spec.ts +156 -156
- package/src/talkpilot/retry_analyze/index.ts +2 -2
- package/src/talkpilot/retry_analyze/retryAnalyze.getters.ts +84 -84
- package/src/talkpilot/retry_analyze/retryAnalyze.types.ts +13 -13
- package/src/talkpilot/sessions/__tests__/sessions.spec.ts +147 -147
- package/src/talkpilot/sessions/index.ts +2 -2
- package/src/talkpilot/sessions/sessions.getter.ts +92 -92
- package/src/talkpilot/sessions/sessions.schema.ts +34 -34
- package/src/talkpilot/sessions/sessions.types.ts +30 -30
- package/src/talkpilot/subscriptions/__tests__/subscriptions.getters.utils.spec.ts +45 -45
- package/src/talkpilot/subscriptions/index.ts +3 -3
- package/src/talkpilot/subscriptions/subscriptions.getters.ts +146 -146
- package/src/talkpilot/subscriptions/subscriptions.getters.utils.ts +33 -33
- package/src/talkpilot/subscriptions/subscriptions.types.ts +66 -66
- package/src/talkpilot/utils/__tests__/query.utils.spec.ts +49 -49
- package/src/talkpilot/utils/query.utils.ts +21 -21
- package/src/test-utils/db-utils.ts +33 -33
- package/src/test-utils/factories/index.ts +20 -18
- package/src/test-utils/factories/municipal/cities.ts +16 -16
- package/src/test-utils/factories/municipal/departmentsSubjects.ts +37 -37
- package/src/test-utils/factories/municipal/muniIssues.ts +32 -32
- package/src/test-utils/factories/municipal/streets.ts +22 -22
- package/src/test-utils/factories/municipal/tickets.ts +39 -39
- package/src/test-utils/factories/talkpilot/agents.ts +19 -19
- package/src/test-utils/factories/talkpilot/calls.ts +37 -37
- package/src/test-utils/factories/talkpilot/clientAudioBuffers.ts +20 -20
- package/src/test-utils/factories/talkpilot/clients.ts +21 -0
- package/src/test-utils/factories/talkpilot/clientsConfig.ts +18 -18
- package/src/test-utils/factories/talkpilot/contextNotes.ts +40 -40
- package/src/test-utils/factories/talkpilot/flows.ts +33 -33
- package/src/test-utils/factories/talkpilot/groups.ts +33 -33
- package/src/test-utils/factories/talkpilot/phone_numbers.ts +22 -22
- package/src/test-utils/factories/talkpilot/results.ts +43 -0
- package/src/test-utils/factories/talkpilot/sessions.ts +35 -35
- package/src/test-utils/factories/websitalk/knowledgeDocuments.ts +29 -29
- package/src/test-utils/factories/websitalk/scanResources.ts +26 -26
- package/src/test-utils/factories/websitalk/scans.ts +29 -29
- package/src/test-utils/factories/websitalk/websiteUrls.ts +17 -17
- package/src/utils/date.utils.ts +126 -126
- package/src/utils/shared.types.ts +4 -4
- package/src/utils/validation.ts +23 -23
- package/src/websitalk/index.ts +18 -18
- package/src/websitalk/knowledgeDocuments/__tests__/knowledgeDocuments.spec.ts +186 -186
- package/src/websitalk/knowledgeDocuments/index.ts +3 -3
- package/src/websitalk/knowledgeDocuments/knowledgeDocuments.constants.ts +17 -17
- package/src/websitalk/knowledgeDocuments/knowledgeDocuments.getters.ts +78 -78
- package/src/websitalk/knowledgeDocuments/knowledgeDocuments.types.ts +62 -62
- package/src/websitalk/mongodb-client.ts +61 -61
- package/src/websitalk/scanResources/__tests__/scanResources.spec.ts +193 -193
- package/src/websitalk/scanResources/index.ts +4 -4
- package/src/websitalk/scanResources/scanResources.constants.ts +47 -47
- package/src/websitalk/scanResources/scanResources.getters.ts +102 -102
- package/src/websitalk/scanResources/scanResources.types.ts +90 -90
- package/src/websitalk/scanResources/scanResources.utils.ts +31 -31
- package/src/websitalk/scans/__tests__/scans.spec.ts +313 -313
- package/src/websitalk/scans/index.ts +4 -4
- package/src/websitalk/scans/scans.constants.ts +15 -15
- package/src/websitalk/scans/scans.getters.ts +166 -166
- package/src/websitalk/scans/scans.types.ts +54 -54
- package/src/websitalk/scans/scans.utils.ts +5 -5
- package/src/websitalk/websiteUrls/__tests__/websiteUrls.spec.ts +77 -77
- package/src/websitalk/websiteUrls/index.ts +2 -2
- package/src/websitalk/websiteUrls/websiteUrls.getters.ts +65 -65
- package/src/websitalk/websiteUrls/websiteUrls.types.ts +13 -13
- package/tsconfig.json +23 -23
- package/dist/talkpilot/clients/clients.quota.constants.d.ts +0 -2
- package/dist/talkpilot/clients/clients.quota.constants.d.ts.map +0 -1
- package/dist/talkpilot/clients/clients.quota.constants.js +0 -5
- package/dist/talkpilot/clients/clients.quota.constants.js.map +0 -1
- package/dist/talkpilot/clients/clients.quota.utils.d.ts +0 -8
- package/dist/talkpilot/clients/clients.quota.utils.d.ts.map +0 -1
- package/dist/talkpilot/clients/clients.quota.utils.js +0 -45
- package/dist/talkpilot/clients/clients.quota.utils.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const MODELS_COLLECTION = "models";
|
|
2
2
|
export declare const MODEL_TYPES: readonly ["realtime", "stt"];
|
|
3
|
-
export declare const REALTIME_MODEL_PROVIDERS: readonly ["openai", "gemini", "xai"
|
|
3
|
+
export declare const REALTIME_MODEL_PROVIDERS: readonly ["openai", "gemini", "xai"];
|
|
4
4
|
export declare const STT_MODEL_PROVIDERS: readonly ["openai-stt", "google-stt", "deepgram-stt", "deepgram-flux", "elevenlabs-scribe", "gladia-stt"];
|
|
5
5
|
//# sourceMappingURL=models.constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.constants.d.ts","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,WAAW,8BAA+B,CAAC;AAExD,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"models.constants.d.ts","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,WAAW,8BAA+B,CAAC;AAExD,eAAO,MAAM,wBAAwB,sCAAuC,CAAC;AAC7E,eAAO,MAAM,mBAAmB,2GAOtB,CAAC"}
|
|
@@ -3,12 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STT_MODEL_PROVIDERS = exports.REALTIME_MODEL_PROVIDERS = exports.MODEL_TYPES = exports.MODELS_COLLECTION = void 0;
|
|
4
4
|
exports.MODELS_COLLECTION = "models";
|
|
5
5
|
exports.MODEL_TYPES = ["realtime", "stt"];
|
|
6
|
-
exports.REALTIME_MODEL_PROVIDERS = [
|
|
7
|
-
"openai",
|
|
8
|
-
"gemini",
|
|
9
|
-
"xai",
|
|
10
|
-
"elevenlabs",
|
|
11
|
-
];
|
|
6
|
+
exports.REALTIME_MODEL_PROVIDERS = ["openai", "gemini", "xai"];
|
|
12
7
|
exports.STT_MODEL_PROVIDERS = [
|
|
13
8
|
"openai-stt",
|
|
14
9
|
"google-stt",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.constants.js","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE7B,QAAA,WAAW,GAAG,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AAE3C,QAAA,wBAAwB,GAAG
|
|
1
|
+
{"version":3,"file":"models.constants.js","sourceRoot":"","sources":["../../../src/configuration/models/models.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,QAAQ,CAAC;AAE7B,QAAA,WAAW,GAAG,CAAC,UAAU,EAAE,KAAK,CAAU,CAAC;AAE3C,QAAA,wBAAwB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAChE,QAAA,mBAAmB,GAAG;IACjC,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,YAAY;CACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Collection } from "mongodb";
|
|
2
|
+
import { QueryOptions } from "../utils/query.utils";
|
|
3
|
+
import { AuditLogDoc, AuditLogEntry } from "./auditLogs.types";
|
|
4
|
+
export declare const getAuditLogsCollection: () => Collection<AuditLogEntry>;
|
|
5
|
+
export declare const insertAuditLog: (entry: AuditLogEntry) => Promise<void>;
|
|
6
|
+
export declare const findAuditLogs: (options: Pick<QueryOptions, "skip"> & Required<Pick<QueryOptions, "limit">>) => Promise<AuditLogDoc[]>;
|
|
7
|
+
export declare const countAuditLogs: () => Promise<number>;
|
|
8
|
+
//# sourceMappingURL=auditLogs.getters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditLogs.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAqB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/D,eAAO,MAAM,sBAAsB,QAAO,UAAU,CAAC,aAAa,CAEjE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,OAAO,aAAa,KAAG,OAAO,CAAC,IAAI,CAEvE,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,SAAS,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,KAC1E,OAAO,CAAC,WAAW,EAAE,CAMvB,CAAC;AAEF,eAAO,MAAM,cAAc,QAAa,OAAO,CAAC,MAAM,CAErD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countAuditLogs = exports.findAuditLogs = exports.insertAuditLog = exports.getAuditLogsCollection = void 0;
|
|
4
|
+
const index_1 = require("../index");
|
|
5
|
+
const query_utils_1 = require("../utils/query.utils");
|
|
6
|
+
const getAuditLogsCollection = () => {
|
|
7
|
+
return (0, index_1.getDb)().collection("auditLogs");
|
|
8
|
+
};
|
|
9
|
+
exports.getAuditLogsCollection = getAuditLogsCollection;
|
|
10
|
+
const insertAuditLog = async (entry) => {
|
|
11
|
+
await (0, exports.getAuditLogsCollection)().insertOne(entry);
|
|
12
|
+
};
|
|
13
|
+
exports.insertAuditLog = insertAuditLog;
|
|
14
|
+
const findAuditLogs = async (options) => {
|
|
15
|
+
const cursor = (0, exports.getAuditLogsCollection)().find({});
|
|
16
|
+
return (0, query_utils_1.applyQueryOptions)(cursor, {
|
|
17
|
+
sort: { timestamp: -1 },
|
|
18
|
+
...options,
|
|
19
|
+
}).toArray();
|
|
20
|
+
};
|
|
21
|
+
exports.findAuditLogs = findAuditLogs;
|
|
22
|
+
const countAuditLogs = async () => {
|
|
23
|
+
return (0, exports.getAuditLogsCollection)().countDocuments({});
|
|
24
|
+
};
|
|
25
|
+
exports.countAuditLogs = countAuditLogs;
|
|
26
|
+
//# sourceMappingURL=auditLogs.getters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditLogs.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.getters.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AACjC,sDAAuE;AAGhE,MAAM,sBAAsB,GAAG,GAA8B,EAAE;IACpE,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAgB,WAAW,CAAC,CAAC;AACxD,CAAC,CAAC;AAFW,QAAA,sBAAsB,0BAEjC;AAEK,MAAM,cAAc,GAAG,KAAK,EAAE,KAAoB,EAAiB,EAAE;IAC1E,MAAM,IAAA,8BAAsB,GAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEK,MAAM,aAAa,GAAG,KAAK,EAChC,OAA2E,EACnD,EAAE;IAC1B,MAAM,MAAM,GAAG,IAAA,8BAAsB,GAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,OAAO,IAAA,+BAAiB,EAAC,MAAM,EAAE;QAC/B,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE;QACvB,GAAG,OAAO;KACX,CAAC,CAAC,OAAO,EAAE,CAAC;AACf,CAAC,CAAC;AARW,QAAA,aAAa,iBAQxB;AAEK,MAAM,cAAc,GAAG,KAAK,IAAqB,EAAE;IACxD,OAAO,IAAA,8BAAsB,GAAE,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;AACrD,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditLogs.setters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.setters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAO,MAAM,cAAc,GAAU,OAAO,aAAa,KAAG,OAAO,CAAC,IAAI,CAEvE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.insertAuditLog = void 0;
|
|
4
|
+
const auditLogs_getters_1 = require("./auditLogs.getters");
|
|
5
|
+
const insertAuditLog = async (entry) => {
|
|
6
|
+
await (0, auditLogs_getters_1.getAuditLogsCollection)().insertOne(entry);
|
|
7
|
+
};
|
|
8
|
+
exports.insertAuditLog = insertAuditLog;
|
|
9
|
+
//# sourceMappingURL=auditLogs.setters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditLogs.setters.js","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.setters.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAGtD,MAAM,cAAc,GAAG,KAAK,EAAE,KAAoB,EAAiB,EAAE;IAC1E,MAAM,IAAA,0CAAsB,GAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WithId } from "mongodb";
|
|
2
|
+
export type AuditLogEntry = {
|
|
3
|
+
clientId: string;
|
|
4
|
+
adminEmail: string;
|
|
5
|
+
action: "delete";
|
|
6
|
+
timestamp: Date;
|
|
7
|
+
env?: string;
|
|
8
|
+
allSucceeded?: boolean;
|
|
9
|
+
failedCollections?: string[];
|
|
10
|
+
};
|
|
11
|
+
export type AuditLogDoc = WithId<AuditLogEntry>;
|
|
12
|
+
//# sourceMappingURL=auditLogs.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditLogs.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditLogs.types.js","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/auditLogs.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,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("./auditLogs.types"), exports);
|
|
18
|
+
__exportStar(require("./auditLogs.getters"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/auditLogs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC"}
|
|
@@ -31,5 +31,5 @@ export declare const CallStatusValues: {
|
|
|
31
31
|
readonly Failed: "failed";
|
|
32
32
|
readonly Canceled: "canceled";
|
|
33
33
|
};
|
|
34
|
-
export declare const ALL_CALL_STATUSES: ("in-progress" | "
|
|
34
|
+
export declare const ALL_CALL_STATUSES: ("in-progress" | "completed" | "failed" | "no-answer" | "busy" | "answered" | "canceled" | "initiated" | "ringing")[];
|
|
35
35
|
//# sourceMappingURL=calls.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDeletionLogs.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,eAAO,MAAM,+BAA+B,QACtC,UAAU,CAAC,sBAAsB,CAEpC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClientDeletionLogsCollection = void 0;
|
|
4
|
+
const index_1 = require("../index");
|
|
5
|
+
const getClientDeletionLogsCollection = () => {
|
|
6
|
+
return (0, index_1.getDb)().collection("clientDeletionLogs");
|
|
7
|
+
};
|
|
8
|
+
exports.getClientDeletionLogsCollection = getClientDeletionLogsCollection;
|
|
9
|
+
//# sourceMappingURL=clientDeletionLogs.getters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDeletionLogs.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.getters.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAG1B,MAAM,+BAA+B,GAC1C,GAAuC,EAAE;IACvC,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAyB,oBAAoB,CAAC,CAAC;AAC1E,CAAC,CAAC;AAHS,QAAA,+BAA+B,mCAGxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDeletionLogs.setters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,eAAO,MAAM,cAAc,GACzB,OAAO,sBAAsB,KAC5B,OAAO,CAAC,IAAI,CAEd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.insertAuditLog = void 0;
|
|
4
|
+
const clientDeletionLogs_getters_1 = require("./clientDeletionLogs.getters");
|
|
5
|
+
const insertAuditLog = async (entry) => {
|
|
6
|
+
await (0, clientDeletionLogs_getters_1.getClientDeletionLogsCollection)().insertOne(entry);
|
|
7
|
+
};
|
|
8
|
+
exports.insertAuditLog = insertAuditLog;
|
|
9
|
+
//# sourceMappingURL=clientDeletionLogs.setters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDeletionLogs.setters.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.setters.ts"],"names":[],"mappings":";;;AAAA,6EAA+E;AAGxE,MAAM,cAAc,GAAG,KAAK,EACjC,KAA6B,EACd,EAAE;IACjB,MAAM,IAAA,4DAA+B,GAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAC;AAJW,QAAA,cAAc,kBAIzB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WithId } from "mongodb";
|
|
2
|
+
export type ClientDeletionLogEntry = {
|
|
3
|
+
clientId: string;
|
|
4
|
+
adminEmail: string;
|
|
5
|
+
action: "delete";
|
|
6
|
+
timestamp: Date;
|
|
7
|
+
env?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ClientDeletionLogDoc = WithId<ClientDeletionLogEntry>;
|
|
10
|
+
//# sourceMappingURL=clientDeletionLogs.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDeletionLogs.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;IACjB,SAAS,EAAE,IAAI,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDeletionLogs.types.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/clientDeletionLogs.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./clientDeletionLogs.types"), exports);
|
|
18
|
+
__exportStar(require("./clientDeletionLogs.getters"), exports);
|
|
19
|
+
__exportStar(require("./clientDeletionLogs.setters"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/clientDeletionLogs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,+DAA6C;AAC7C,+DAA6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.constants.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.constants.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,eAAO,MAAM,eAAe,EAAE,MAAM,EAAkB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DELETE_DENYLIST = void 0;
|
|
4
|
+
/** Collections to always skip during client deletion — e.g. auditLogs, which must survive it. */
|
|
5
|
+
exports.DELETE_DENYLIST = ["auditLogs"];
|
|
6
|
+
//# sourceMappingURL=clients.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.constants.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.constants.ts"],"names":[],"mappings":";;;AAAA,iGAAiG;AACpF,QAAA,eAAe,GAAa,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -2,4 +2,5 @@ import { Client } from "../index";
|
|
|
2
2
|
import { Collection } from "mongodb";
|
|
3
3
|
export declare const getClientsCollection: () => Collection<Client>;
|
|
4
4
|
export declare const getClientByAPIKey: (apiKey: string) => Promise<Client | null>;
|
|
5
|
+
export declare const getAllClientCredits: () => Promise<Map<string, number>>;
|
|
5
6
|
//# sourceMappingURL=clients.getters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,oBAAoB,QAAO,UAAU,CAAC,MAAM,CAExD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,KACb,OAAO,CAAC,MAAM,GAAG,IAAI,CAMvB,CAAC"}
|
|
1
|
+
{"version":3,"file":"clients.getters.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.getters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,eAAO,MAAM,oBAAoB,QAAO,UAAU,CAAC,MAAM,CAExD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,KACb,OAAO,CAAC,MAAM,GAAG,IAAI,CAMvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAa,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAKvE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getClientByAPIKey = exports.getClientsCollection = void 0;
|
|
3
|
+
exports.getAllClientCredits = exports.getClientByAPIKey = exports.getClientsCollection = void 0;
|
|
4
4
|
const index_1 = require("../index");
|
|
5
5
|
const getClientsCollection = () => {
|
|
6
6
|
return (0, index_1.getDb)().collection("clients");
|
|
@@ -14,4 +14,11 @@ const getClientByAPIKey = async (apiKey) => {
|
|
|
14
14
|
return client ? client : null;
|
|
15
15
|
};
|
|
16
16
|
exports.getClientByAPIKey = getClientByAPIKey;
|
|
17
|
+
const getAllClientCredits = async () => {
|
|
18
|
+
const docs = await (0, exports.getClientsCollection)()
|
|
19
|
+
.find({}, { projection: { clientId: 1, credits: 1 } })
|
|
20
|
+
.toArray();
|
|
21
|
+
return new Map(docs.map((c) => [c.clientId, c.credits ?? 0]));
|
|
22
|
+
};
|
|
23
|
+
exports.getAllClientCredits = getAllClientCredits;
|
|
17
24
|
//# sourceMappingURL=clients.getters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.getters.ts"],"names":[],"mappings":";;;AAAA,oCAAyC;AAGlC,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;AAEK,MAAM,iBAAiB,GAAG,KAAK,EACpC,MAAc,EACU,EAAE;IAC1B,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAoB,GAAE,CAAC,OAAO,CAAC;QAClD,MAAM;QACN,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
|
|
1
|
+
{"version":3,"file":"clients.getters.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.getters.ts"],"names":[],"mappings":";;;AAAA,oCAAyC;AAGlC,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;AAEK,MAAM,iBAAiB,GAAG,KAAK,EACpC,MAAc,EACU,EAAE;IAC1B,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAoB,GAAE,CAAC,OAAO,CAAC;QAClD,MAAM;QACN,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B;AAEK,MAAM,mBAAmB,GAAG,KAAK,IAAkC,EAAE;IAC1E,MAAM,IAAI,GAAG,MAAM,IAAA,4BAAoB,GAAE;SACtC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;SACrD,OAAO,EAAE,CAAC;IACb,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAChE,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DeleteClientDataSummary } from "./clients.types";
|
|
2
|
+
export declare const clientExistsInAnyCollection: (clientId: string) => Promise<boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Deletes a client's data across talkpilot/municipal collections and logs the action.
|
|
5
|
+
*
|
|
6
|
+
* ⚠️ Does NOT delete website-talk data — `scans`/`websiteUrls` are the lookup key an
|
|
7
|
+
* external API needs to clean up that domain. Callers must invoke that API separately.
|
|
8
|
+
*/
|
|
9
|
+
export declare const deleteClientDataAcrossDomains: (clientId: string, adminEmail: string) => Promise<DeleteClientDataSummary>;
|
|
10
|
+
//# sourceMappingURL=clients.lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.lifecycle.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.lifecycle.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAoBzB,eAAO,MAAM,2BAA2B,GACtC,UAAU,MAAM,KACf,OAAO,CAAC,OAAO,CAMjB,CAAC;AAgCF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GACxC,UAAU,MAAM,EAChB,YAAY,MAAM,KACjB,OAAO,CAAC,uBAAuB,CAsCjC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteClientDataAcrossDomains = exports.clientExistsInAnyCollection = void 0;
|
|
4
|
+
const index_1 = require("../index");
|
|
5
|
+
const municipal_1 = require("../../municipal");
|
|
6
|
+
const clients_constants_1 = require("./clients.constants");
|
|
7
|
+
// Skips websitalk on purpose — see the warning on `deleteClientDataAcrossDomains` below.
|
|
8
|
+
const findClientMatchInDb = async (db, clientId) => {
|
|
9
|
+
const collections = await db.listCollections().toArray();
|
|
10
|
+
return Promise.all(collections
|
|
11
|
+
.filter((c) => !clients_constants_1.DELETE_DENYLIST.includes(c.name))
|
|
12
|
+
.map(async (c) => {
|
|
13
|
+
const doc = await db
|
|
14
|
+
.collection(c.name)
|
|
15
|
+
.findOne({ $or: [{ clientId }, { client_id: clientId }] });
|
|
16
|
+
return { collectionName: c.name, matched: !!doc };
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
const clientExistsInAnyCollection = async (clientId) => {
|
|
20
|
+
const [talkpilotResults, municipalResults] = await Promise.all([
|
|
21
|
+
findClientMatchInDb((0, index_1.getDb)(), clientId),
|
|
22
|
+
findClientMatchInDb((0, municipal_1.getDb)(), clientId),
|
|
23
|
+
]);
|
|
24
|
+
return [...talkpilotResults, ...municipalResults].some((r) => r.matched);
|
|
25
|
+
};
|
|
26
|
+
exports.clientExistsInAnyCollection = clientExistsInAnyCollection;
|
|
27
|
+
const deleteClientFromDb = async (db, clientId) => {
|
|
28
|
+
const collections = await db.listCollections().toArray();
|
|
29
|
+
return Promise.all(collections
|
|
30
|
+
.filter((c) => !clients_constants_1.DELETE_DENYLIST.includes(c.name))
|
|
31
|
+
.map(async (c) => {
|
|
32
|
+
try {
|
|
33
|
+
const result = await db
|
|
34
|
+
.collection(c.name)
|
|
35
|
+
.deleteMany({ $or: [{ clientId }, { client_id: clientId }] });
|
|
36
|
+
return {
|
|
37
|
+
collectionName: c.name,
|
|
38
|
+
deletedCount: result.deletedCount,
|
|
39
|
+
success: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return {
|
|
44
|
+
collectionName: c.name,
|
|
45
|
+
deletedCount: 0,
|
|
46
|
+
success: false,
|
|
47
|
+
error: error instanceof Error ? error.message : String(error),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Deletes a client's data across talkpilot/municipal collections and logs the action.
|
|
54
|
+
*
|
|
55
|
+
* ⚠️ Does NOT delete website-talk data — `scans`/`websiteUrls` are the lookup key an
|
|
56
|
+
* external API needs to clean up that domain. Callers must invoke that API separately.
|
|
57
|
+
*/
|
|
58
|
+
const deleteClientDataAcrossDomains = async (clientId, adminEmail) => {
|
|
59
|
+
const exists = await (0, exports.clientExistsInAnyCollection)(clientId);
|
|
60
|
+
if (!exists) {
|
|
61
|
+
return {
|
|
62
|
+
clientId,
|
|
63
|
+
deleted: false,
|
|
64
|
+
reason: "Client does not exist in any collection",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const [talkpilotResults, municipalResults] = await Promise.all([
|
|
68
|
+
deleteClientFromDb((0, index_1.getDb)(), clientId),
|
|
69
|
+
deleteClientFromDb((0, municipal_1.getDb)(), clientId),
|
|
70
|
+
]);
|
|
71
|
+
const results = [...talkpilotResults, ...municipalResults];
|
|
72
|
+
const allSucceeded = results.every((r) => r.success);
|
|
73
|
+
await (0, index_1.insertAuditLog)({
|
|
74
|
+
clientId,
|
|
75
|
+
adminEmail,
|
|
76
|
+
action: "delete",
|
|
77
|
+
timestamp: new Date(),
|
|
78
|
+
allSucceeded,
|
|
79
|
+
...(allSucceeded
|
|
80
|
+
? {}
|
|
81
|
+
: {
|
|
82
|
+
failedCollections: results
|
|
83
|
+
.filter((r) => !r.success)
|
|
84
|
+
.map((r) => r.collectionName),
|
|
85
|
+
}),
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
clientId,
|
|
89
|
+
deleted: true,
|
|
90
|
+
results,
|
|
91
|
+
allSucceeded,
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
exports.deleteClientDataAcrossDomains = deleteClientDataAcrossDomains;
|
|
95
|
+
//# sourceMappingURL=clients.lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.lifecycle.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.lifecycle.ts"],"names":[],"mappings":"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"}
|
|
@@ -15,4 +15,25 @@ export type Client = {
|
|
|
15
15
|
export type ClientDoc = Client & {
|
|
16
16
|
_id: ObjectId;
|
|
17
17
|
};
|
|
18
|
+
export type CollectionMatch = {
|
|
19
|
+
collectionName: string;
|
|
20
|
+
matched: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type CollectionDeleteResult = {
|
|
23
|
+
collectionName: string;
|
|
24
|
+
deletedCount: number;
|
|
25
|
+
success: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
};
|
|
28
|
+
/** Discriminated union: `deleted` tells you which shape you got without guessing. */
|
|
29
|
+
export type DeleteClientDataSummary = {
|
|
30
|
+
clientId: string;
|
|
31
|
+
deleted: false;
|
|
32
|
+
reason: string;
|
|
33
|
+
} | {
|
|
34
|
+
clientId: string;
|
|
35
|
+
deleted: true;
|
|
36
|
+
results: CollectionDeleteResult[];
|
|
37
|
+
allSucceeded: boolean;
|
|
38
|
+
};
|
|
18
39
|
//# sourceMappingURL=clients.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clients.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE3I,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,QAAQ,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"clients.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/clients.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE3I,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,GAAG,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACpD;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export * from "./clients.constants";
|
|
1
2
|
export * from "./clients.getters";
|
|
2
3
|
export * from "./clients.types";
|
|
3
4
|
export * from "./clients.quota.getters";
|
|
4
5
|
export * from "./clients.quota.types";
|
|
6
|
+
export * from "./clients.lifecycle";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clients/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
|
@@ -14,8 +14,10 @@ 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
|
+
__exportStar(require("./clients.constants"), exports);
|
|
17
18
|
__exportStar(require("./clients.getters"), exports);
|
|
18
19
|
__exportStar(require("./clients.types"), exports);
|
|
19
20
|
__exportStar(require("./clients.quota.getters"), exports);
|
|
20
21
|
__exportStar(require("./clients.quota.types"), exports);
|
|
22
|
+
__exportStar(require("./clients.lifecycle"), exports);
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/talkpilot/clients/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,oDAAkC;AAClC,kDAAgC;AAChC,0DAAwC;AACxC,wDAAsC;AACtC,sDAAoC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Collection, ObjectId, WithId } from "mongodb";
|
|
2
|
-
import type { Flow
|
|
2
|
+
import type { Flow } from "./flows.types";
|
|
3
3
|
export declare const getFlowsCollection: () => Collection<Flow>;
|
|
4
4
|
export declare const findFlowById: (flowId: ObjectId, clientId: string) => Promise<WithId<Flow> | null>;
|
|
5
|
-
export declare const createFlow: (flow: Flow) => Promise<WithId<Flow>>;
|
|
6
|
-
/** Returns false when no flow matches the id for this client. */
|
|
7
|
-
export declare const updateFlowById: (flowId: ObjectId, clientId: string, update: FlowUpdateParams) => Promise<boolean>;
|
|
8
5
|
//# sourceMappingURL=flows.getter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.getter.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/flows/flows.getter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"flows.getter.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/flows/flows.getter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,kBAAkB,QAAO,UAAU,CAAC,IAAI,CAEpD,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,QAAQ,QAAQ,EAChB,UAAU,MAAM,KACf,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAE7B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.findFlowById = exports.getFlowsCollection = void 0;
|
|
4
4
|
const index_1 = require("../index");
|
|
5
5
|
const getFlowsCollection = () => {
|
|
6
6
|
return (0, index_1.getDb)().collection("flows");
|
|
@@ -10,15 +10,4 @@ const findFlowById = (flowId, clientId) => {
|
|
|
10
10
|
return (0, exports.getFlowsCollection)().findOne({ _id: flowId, clientId });
|
|
11
11
|
};
|
|
12
12
|
exports.findFlowById = findFlowById;
|
|
13
|
-
const createFlow = async (flow) => {
|
|
14
|
-
const { insertedId } = await (0, exports.getFlowsCollection)().insertOne(flow);
|
|
15
|
-
return { ...flow, _id: insertedId };
|
|
16
|
-
};
|
|
17
|
-
exports.createFlow = createFlow;
|
|
18
|
-
/** Returns false when no flow matches the id for this client. */
|
|
19
|
-
const updateFlowById = async (flowId, clientId, update) => {
|
|
20
|
-
const { matchedCount } = await (0, exports.getFlowsCollection)().updateOne({ _id: flowId, clientId }, { $set: { ...update, updatedAt: new Date() } });
|
|
21
|
-
return matchedCount > 0;
|
|
22
|
-
};
|
|
23
|
-
exports.updateFlowById = updateFlowById;
|
|
24
13
|
//# sourceMappingURL=flows.getter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows.getter.js","sourceRoot":"","sources":["../../../src/talkpilot/flows/flows.getter.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAG1B,MAAM,kBAAkB,GAAG,GAAqB,EAAE;IACvD,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAO,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,YAAY,GAAG,CAC1B,MAAgB,EAChB,QAAgB,EACc,EAAE;IAChC,OAAO,IAAA,0BAAkB,GAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB
|
|
1
|
+
{"version":3,"file":"flows.getter.js","sourceRoot":"","sources":["../../../src/talkpilot/flows/flows.getter.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAG1B,MAAM,kBAAkB,GAAG,GAAqB,EAAE;IACvD,OAAO,IAAA,aAAK,GAAE,CAAC,UAAU,CAAO,OAAO,CAAC,CAAC;AAC3C,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,YAAY,GAAG,CAC1B,MAAgB,EAChB,QAAgB,EACc,EAAE;IAChC,OAAO,IAAA,0BAAkB,GAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AACjE,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB"}
|