@talkpilot/core-db 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/rules/development.mdc +65 -0
- package/DEVELOPMENT.md +98 -0
- package/README.md +140 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/municipal/cities/cities.getters.d.ts +9 -0
- package/dist/municipal/cities/cities.getters.d.ts.map +1 -0
- package/dist/municipal/cities/cities.getters.js +38 -0
- package/dist/municipal/cities/cities.getters.js.map +1 -0
- package/dist/municipal/cities/cities.types.d.ts +10 -0
- package/dist/municipal/cities/cities.types.d.ts.map +1 -0
- package/dist/municipal/cities/cities.types.js +3 -0
- package/dist/municipal/cities/cities.types.js.map +1 -0
- package/dist/municipal/cities/index.d.ts +3 -0
- package/dist/municipal/cities/index.d.ts.map +1 -0
- package/dist/municipal/cities/index.js +18 -0
- package/dist/municipal/cities/index.js.map +1 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.d.ts +62 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.d.ts.map +1 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.js +180 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.getters.js.map +1 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.types.d.ts +69 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.types.d.ts.map +1 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.types.js +3 -0
- package/dist/municipal/departmentsSubjects/departmentsSubjects.types.js.map +1 -0
- package/dist/municipal/departmentsSubjects/index.d.ts +3 -0
- package/dist/municipal/departmentsSubjects/index.d.ts.map +1 -0
- package/dist/municipal/departmentsSubjects/index.js +18 -0
- package/dist/municipal/departmentsSubjects/index.js.map +1 -0
- package/dist/municipal/index.d.ts +10 -0
- package/dist/municipal/index.d.ts.map +1 -0
- package/dist/municipal/index.js +37 -0
- package/dist/municipal/index.js.map +1 -0
- package/dist/municipal/mongodb-client.d.ts +13 -0
- package/dist/municipal/mongodb-client.d.ts.map +1 -0
- package/dist/municipal/mongodb-client.js +56 -0
- package/dist/municipal/mongodb-client.js.map +1 -0
- package/dist/municipal/streets/index.d.ts +3 -0
- package/dist/municipal/streets/index.d.ts.map +1 -0
- package/dist/municipal/streets/index.js +18 -0
- package/dist/municipal/streets/index.js.map +1 -0
- package/dist/municipal/streets/streets.getters.d.ts +21 -0
- package/dist/municipal/streets/streets.getters.d.ts.map +1 -0
- package/dist/municipal/streets/streets.getters.js +85 -0
- package/dist/municipal/streets/streets.getters.js.map +1 -0
- package/dist/municipal/streets/streets.types.d.ts +16 -0
- package/dist/municipal/streets/streets.types.d.ts.map +1 -0
- package/dist/municipal/streets/streets.types.js +3 -0
- package/dist/municipal/streets/streets.types.js.map +1 -0
- package/dist/municipal/tickets/index.d.ts +3 -0
- package/dist/municipal/tickets/index.d.ts.map +1 -0
- package/dist/municipal/tickets/index.js +18 -0
- package/dist/municipal/tickets/index.js.map +1 -0
- package/dist/municipal/tickets/tickets.getters.d.ts +44 -0
- package/dist/municipal/tickets/tickets.getters.d.ts.map +1 -0
- package/dist/municipal/tickets/tickets.getters.js +199 -0
- package/dist/municipal/tickets/tickets.getters.js.map +1 -0
- package/dist/municipal/tickets/tickets.types.d.ts +35 -0
- package/dist/municipal/tickets/tickets.types.d.ts.map +1 -0
- package/dist/municipal/tickets/tickets.types.js +3 -0
- package/dist/municipal/tickets/tickets.types.js.map +1 -0
- package/dist/talkpilot/agents/agents.getters.d.ts +9 -0
- package/dist/talkpilot/agents/agents.getters.d.ts.map +1 -0
- package/dist/talkpilot/agents/agents.getters.js +34 -0
- package/dist/talkpilot/agents/agents.getters.js.map +1 -0
- package/dist/talkpilot/agents/agents.types.d.ts +13 -0
- package/dist/talkpilot/agents/agents.types.d.ts.map +1 -0
- package/dist/talkpilot/agents/agents.types.js +3 -0
- package/dist/talkpilot/agents/agents.types.js.map +1 -0
- package/dist/talkpilot/agents/index.d.ts +3 -0
- package/dist/talkpilot/agents/index.d.ts.map +1 -0
- package/dist/talkpilot/agents/index.js +19 -0
- package/dist/talkpilot/agents/index.js.map +1 -0
- package/dist/talkpilot/calls/calls.getters.d.ts +24 -0
- package/dist/talkpilot/calls/calls.getters.d.ts.map +1 -0
- package/dist/talkpilot/calls/calls.getters.js +151 -0
- package/dist/talkpilot/calls/calls.getters.js.map +1 -0
- package/dist/talkpilot/calls/calls.types.d.ts +32 -0
- package/dist/talkpilot/calls/calls.types.d.ts.map +1 -0
- package/dist/talkpilot/calls/calls.types.js +3 -0
- package/dist/talkpilot/calls/calls.types.js.map +1 -0
- package/dist/talkpilot/calls/index.d.ts +3 -0
- package/dist/talkpilot/calls/index.d.ts.map +1 -0
- package/dist/talkpilot/calls/index.js +19 -0
- package/dist/talkpilot/calls/index.js.map +1 -0
- package/dist/talkpilot/clientAudioBuffers/clientAudioBuffer.getters.d.ts +9 -0
- package/dist/talkpilot/clientAudioBuffers/clientAudioBuffer.getters.d.ts.map +1 -0
- package/dist/talkpilot/clientAudioBuffers/clientAudioBuffer.getters.js +76 -0
- package/dist/talkpilot/clientAudioBuffers/clientAudioBuffer.getters.js.map +1 -0
- package/dist/talkpilot/clientAudioBuffers/clientsAudioBuffers.types.d.ts +23 -0
- package/dist/talkpilot/clientAudioBuffers/clientsAudioBuffers.types.d.ts.map +1 -0
- package/dist/talkpilot/clientAudioBuffers/clientsAudioBuffers.types.js +3 -0
- package/dist/talkpilot/clientAudioBuffers/clientsAudioBuffers.types.js.map +1 -0
- package/dist/talkpilot/clients/clients.getters.d.ts +5 -0
- package/dist/talkpilot/clients/clients.getters.d.ts.map +1 -0
- package/dist/talkpilot/clients/clients.getters.js +14 -0
- package/dist/talkpilot/clients/clients.getters.js.map +1 -0
- package/dist/talkpilot/clients/clients.types.d.ts +12 -0
- package/dist/talkpilot/clients/clients.types.d.ts.map +1 -0
- package/dist/talkpilot/clients/clients.types.js +3 -0
- package/dist/talkpilot/clients/clients.types.js.map +1 -0
- package/dist/talkpilot/clients/index.d.ts +3 -0
- package/dist/talkpilot/clients/index.d.ts.map +1 -0
- package/dist/talkpilot/clients/index.js +18 -0
- package/dist/talkpilot/clients/index.js.map +1 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.getters.d.ts +7 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.getters.d.ts.map +1 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.getters.js +21 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.getters.js.map +1 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.types.d.ts +53 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.types.d.ts.map +1 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.types.js +3 -0
- package/dist/talkpilot/clientsConfig/clientsConfig.types.js.map +1 -0
- package/dist/talkpilot/clientsConfig/index.d.ts +3 -0
- package/dist/talkpilot/clientsConfig/index.d.ts.map +1 -0
- package/dist/talkpilot/clientsConfig/index.js +19 -0
- package/dist/talkpilot/clientsConfig/index.js.map +1 -0
- package/dist/talkpilot/flows/flows.getter.d.ts +5 -0
- package/dist/talkpilot/flows/flows.getter.d.ts.map +1 -0
- package/dist/talkpilot/flows/flows.getter.js +13 -0
- package/dist/talkpilot/flows/flows.getter.js.map +1 -0
- package/dist/talkpilot/flows/flows.schema.d.ts +154 -0
- package/dist/talkpilot/flows/flows.schema.d.ts.map +1 -0
- package/dist/talkpilot/flows/flows.schema.js +94 -0
- package/dist/talkpilot/flows/flows.schema.js.map +1 -0
- package/dist/talkpilot/flows/flows.types.d.ts +116 -0
- package/dist/talkpilot/flows/flows.types.d.ts.map +1 -0
- package/dist/talkpilot/flows/flows.types.js +3 -0
- package/dist/talkpilot/flows/flows.types.js.map +1 -0
- package/dist/talkpilot/flows/index.d.ts +3 -0
- package/dist/talkpilot/flows/index.d.ts.map +1 -0
- package/dist/talkpilot/flows/index.js +6 -0
- package/dist/talkpilot/flows/index.js.map +1 -0
- package/dist/talkpilot/groups/groups.getters.d.ts +8 -0
- package/dist/talkpilot/groups/groups.getters.d.ts.map +1 -0
- package/dist/talkpilot/groups/groups.getters.js +26 -0
- package/dist/talkpilot/groups/groups.getters.js.map +1 -0
- package/dist/talkpilot/groups/groups.types.d.ts +26 -0
- package/dist/talkpilot/groups/groups.types.d.ts.map +1 -0
- package/dist/talkpilot/groups/groups.types.js +3 -0
- package/dist/talkpilot/groups/groups.types.js.map +1 -0
- package/dist/talkpilot/groups/index.d.ts +3 -0
- package/dist/talkpilot/groups/index.d.ts.map +1 -0
- package/dist/talkpilot/groups/index.js +19 -0
- package/dist/talkpilot/groups/index.js.map +1 -0
- package/dist/talkpilot/groups/phone.utils.d.ts +4 -0
- package/dist/talkpilot/groups/phone.utils.d.ts.map +1 -0
- package/dist/talkpilot/groups/phone.utils.js +42 -0
- package/dist/talkpilot/groups/phone.utils.js.map +1 -0
- package/dist/talkpilot/index.d.ts +19 -0
- package/dist/talkpilot/index.d.ts.map +1 -0
- package/dist/talkpilot/index.js +46 -0
- package/dist/talkpilot/index.js.map +1 -0
- package/dist/talkpilot/leads/index.d.ts +3 -0
- package/dist/talkpilot/leads/index.d.ts.map +1 -0
- package/dist/talkpilot/leads/index.js +6 -0
- package/dist/talkpilot/leads/index.js.map +1 -0
- package/dist/talkpilot/leads/leads.getter.d.ts +4 -0
- package/dist/talkpilot/leads/leads.getter.d.ts.map +1 -0
- package/dist/talkpilot/leads/leads.getter.js +7 -0
- package/dist/talkpilot/leads/leads.getter.js.map +1 -0
- package/dist/talkpilot/leads/leads.schema.d.ts +50 -0
- package/dist/talkpilot/leads/leads.schema.d.ts.map +1 -0
- package/dist/talkpilot/leads/leads.schema.js +37 -0
- package/dist/talkpilot/leads/leads.schema.js.map +1 -0
- package/dist/talkpilot/leads/leads.types.d.ts +18 -0
- package/dist/talkpilot/leads/leads.types.d.ts.map +1 -0
- package/dist/talkpilot/leads/leads.types.js +3 -0
- package/dist/talkpilot/leads/leads.types.js.map +1 -0
- package/dist/talkpilot/mongodb-client.d.ts +13 -0
- package/dist/talkpilot/mongodb-client.d.ts.map +1 -0
- package/dist/talkpilot/mongodb-client.js +71 -0
- package/dist/talkpilot/mongodb-client.js.map +1 -0
- package/dist/talkpilot/phone_numbers/index.d.ts +3 -0
- package/dist/talkpilot/phone_numbers/index.d.ts.map +1 -0
- package/dist/talkpilot/phone_numbers/index.js +18 -0
- package/dist/talkpilot/phone_numbers/index.js.map +1 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.d.ts +8 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.d.ts.map +1 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.js +44 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.getter.js.map +1 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.schema.d.ts +29 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.schema.d.ts.map +1 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.schema.js +18 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.schema.js.map +1 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.types.d.ts +16 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.types.d.ts.map +1 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.types.js +3 -0
- package/dist/talkpilot/phone_numbers/phone_numbers.types.js.map +1 -0
- package/dist/talkpilot/plans/index.d.ts +3 -0
- package/dist/talkpilot/plans/index.d.ts.map +1 -0
- package/dist/talkpilot/plans/index.js +19 -0
- package/dist/talkpilot/plans/index.js.map +1 -0
- package/dist/talkpilot/plans/plans.getters.d.ts +10 -0
- package/dist/talkpilot/plans/plans.getters.d.ts.map +1 -0
- package/dist/talkpilot/plans/plans.getters.js +103 -0
- package/dist/talkpilot/plans/plans.getters.js.map +1 -0
- package/dist/talkpilot/plans/plans.types.d.ts +53 -0
- package/dist/talkpilot/plans/plans.types.d.ts.map +1 -0
- package/dist/talkpilot/plans/plans.types.js +29 -0
- package/dist/talkpilot/plans/plans.types.js.map +1 -0
- package/dist/talkpilot/results/index.d.ts +3 -0
- package/dist/talkpilot/results/index.d.ts.map +1 -0
- package/dist/talkpilot/results/index.js +6 -0
- package/dist/talkpilot/results/index.js.map +1 -0
- package/dist/talkpilot/results/results.getter.d.ts +7 -0
- package/dist/talkpilot/results/results.getter.d.ts.map +1 -0
- package/dist/talkpilot/results/results.getter.js +26 -0
- package/dist/talkpilot/results/results.getter.js.map +1 -0
- package/dist/talkpilot/results/results.schema.d.ts +35 -0
- package/dist/talkpilot/results/results.schema.d.ts.map +1 -0
- package/dist/talkpilot/results/results.schema.js +29 -0
- package/dist/talkpilot/results/results.schema.js.map +1 -0
- package/dist/talkpilot/results/results.types.d.ts +34 -0
- package/dist/talkpilot/results/results.types.d.ts.map +1 -0
- package/dist/talkpilot/results/results.types.js +3 -0
- package/dist/talkpilot/results/results.types.js.map +1 -0
- package/dist/talkpilot/sessions/index.d.ts +3 -0
- package/dist/talkpilot/sessions/index.d.ts.map +1 -0
- package/dist/talkpilot/sessions/index.js +6 -0
- package/dist/talkpilot/sessions/index.js.map +1 -0
- package/dist/talkpilot/sessions/sessions.getter.d.ts +7 -0
- package/dist/talkpilot/sessions/sessions.getter.d.ts.map +1 -0
- package/dist/talkpilot/sessions/sessions.getter.js +26 -0
- package/dist/talkpilot/sessions/sessions.getter.js.map +1 -0
- package/dist/talkpilot/sessions/sessions.schema.d.ts +53 -0
- package/dist/talkpilot/sessions/sessions.schema.d.ts.map +1 -0
- package/dist/talkpilot/sessions/sessions.schema.js +38 -0
- package/dist/talkpilot/sessions/sessions.schema.js.map +1 -0
- package/dist/talkpilot/sessions/sessions.types.d.ts +22 -0
- package/dist/talkpilot/sessions/sessions.types.d.ts.map +1 -0
- package/dist/talkpilot/sessions/sessions.types.js +3 -0
- package/dist/talkpilot/sessions/sessions.types.js.map +1 -0
- package/dist/talkpilot/subscriptions/index.d.ts +4 -0
- package/dist/talkpilot/subscriptions/index.d.ts.map +1 -0
- package/dist/talkpilot/subscriptions/index.js +20 -0
- package/dist/talkpilot/subscriptions/index.js.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.d.ts +13 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.d.ts.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.js +105 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.js.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.utils.d.ts +8 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.utils.d.ts.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.utils.js +27 -0
- package/dist/talkpilot/subscriptions/subscriptions.getters.utils.js.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.types.d.ts +50 -0
- package/dist/talkpilot/subscriptions/subscriptions.types.d.ts.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.types.js +14 -0
- package/dist/talkpilot/subscriptions/subscriptions.types.js.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.utils.d.ts +4 -0
- package/dist/talkpilot/subscriptions/subscriptions.utils.d.ts.map +1 -0
- package/dist/talkpilot/subscriptions/subscriptions.utils.js +20 -0
- package/dist/talkpilot/subscriptions/subscriptions.utils.js.map +1 -0
- package/dist/test-utils/db-utils.d.ts +4 -0
- package/dist/test-utils/db-utils.d.ts.map +1 -0
- package/dist/test-utils/db-utils.js +28 -0
- package/dist/test-utils/db-utils.js.map +1 -0
- package/dist/test-utils/factories/index.d.ts +13 -0
- package/dist/test-utils/factories/index.d.ts.map +1 -0
- package/dist/test-utils/factories/index.js +29 -0
- package/dist/test-utils/factories/index.js.map +1 -0
- package/dist/test-utils/factories/municipal/cities.d.ts +5 -0
- package/dist/test-utils/factories/municipal/cities.d.ts.map +1 -0
- package/dist/test-utils/factories/municipal/cities.js +18 -0
- package/dist/test-utils/factories/municipal/cities.js.map +1 -0
- package/dist/test-utils/factories/municipal/departmentsSubjects.d.ts +5 -0
- package/dist/test-utils/factories/municipal/departmentsSubjects.d.ts.map +1 -0
- package/dist/test-utils/factories/municipal/departmentsSubjects.js +27 -0
- package/dist/test-utils/factories/municipal/departmentsSubjects.js.map +1 -0
- package/dist/test-utils/factories/municipal/streets.d.ts +5 -0
- package/dist/test-utils/factories/municipal/streets.d.ts.map +1 -0
- package/dist/test-utils/factories/municipal/streets.js +19 -0
- package/dist/test-utils/factories/municipal/streets.js.map +1 -0
- package/dist/test-utils/factories/municipal/tickets.d.ts +5 -0
- package/dist/test-utils/factories/municipal/tickets.d.ts.map +1 -0
- package/dist/test-utils/factories/municipal/tickets.js +27 -0
- package/dist/test-utils/factories/municipal/tickets.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/agents.d.ts +5 -0
- package/dist/test-utils/factories/talkpilot/agents.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/agents.js +21 -0
- package/dist/test-utils/factories/talkpilot/agents.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/calls.d.ts +6 -0
- package/dist/test-utils/factories/talkpilot/calls.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/calls.js +39 -0
- package/dist/test-utils/factories/talkpilot/calls.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/clientAudioBuffers.d.ts +5 -0
- package/dist/test-utils/factories/talkpilot/clientAudioBuffers.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/clientAudioBuffers.js +18 -0
- package/dist/test-utils/factories/talkpilot/clientAudioBuffers.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/clientsConfig.d.ts +5 -0
- package/dist/test-utils/factories/talkpilot/clientsConfig.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/clientsConfig.js +18 -0
- package/dist/test-utils/factories/talkpilot/clientsConfig.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/flows.d.ts +14 -0
- package/dist/test-utils/factories/talkpilot/flows.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/flows.js +33 -0
- package/dist/test-utils/factories/talkpilot/flows.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/groups.d.ts +6 -0
- package/dist/test-utils/factories/talkpilot/groups.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/groups.js +34 -0
- package/dist/test-utils/factories/talkpilot/groups.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/phone_numbers.d.ts +16 -0
- package/dist/test-utils/factories/talkpilot/phone_numbers.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/phone_numbers.js +20 -0
- package/dist/test-utils/factories/talkpilot/phone_numbers.js.map +1 -0
- package/dist/test-utils/factories/talkpilot/sessions.d.ts +5 -0
- package/dist/test-utils/factories/talkpilot/sessions.d.ts.map +1 -0
- package/dist/test-utils/factories/talkpilot/sessions.js +37 -0
- package/dist/test-utils/factories/talkpilot/sessions.js.map +1 -0
- package/dist/utils/validation.d.ts +7 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +23 -0
- package/dist/utils/validation.js.map +1 -0
- package/jest.config.js +22 -0
- package/package.json +43 -0
- package/src/__tests__/setup.ts +20 -0
- package/src/index.ts +13 -0
- package/src/municipal/__tests__/validation.spec.ts +50 -0
- package/src/municipal/cities/cities.getters.ts +44 -0
- package/src/municipal/cities/cities.types.ts +11 -0
- package/src/municipal/cities/index.ts +2 -0
- package/src/municipal/departmentsSubjects/departmentsSubjects.getters.ts +273 -0
- package/src/municipal/departmentsSubjects/departmentsSubjects.types.ts +76 -0
- package/src/municipal/departmentsSubjects/index.ts +11 -0
- package/src/municipal/index.ts +18 -0
- package/src/municipal/mongodb-client.ts +58 -0
- package/src/municipal/streets/index.ts +2 -0
- package/src/municipal/streets/streets.getters.ts +105 -0
- package/src/municipal/streets/streets.types.ts +18 -0
- package/src/municipal/tickets/__tests__/tickets.getters.spec.ts +30 -0
- package/src/municipal/tickets/index.ts +2 -0
- package/src/municipal/tickets/tickets.getters.ts +234 -0
- package/src/municipal/tickets/tickets.types.ts +39 -0
- package/src/talkpilot/__tests__/db.spec.ts +38 -0
- package/src/talkpilot/__tests__/mongodb-client.spec.ts +19 -0
- package/src/talkpilot/__tests__/validation.spec.ts +62 -0
- package/src/talkpilot/agents/__tests__/agents.getters.spec.ts +29 -0
- package/src/talkpilot/agents/agents.getters.ts +34 -0
- package/src/talkpilot/agents/agents.types.ts +14 -0
- package/src/talkpilot/agents/index.ts +2 -0
- package/src/talkpilot/calls/__tests__/calls.spec.ts +56 -0
- package/src/talkpilot/calls/calls.getters.ts +134 -0
- package/src/talkpilot/calls/calls.types.ts +45 -0
- package/src/talkpilot/calls/index.ts +2 -0
- package/src/talkpilot/clientAudioBuffers/__tests__/clientAudioBuffer.getters.spec.ts +78 -0
- package/src/talkpilot/clientAudioBuffers/clientAudioBuffer.getters.ts +101 -0
- package/src/talkpilot/clientAudioBuffers/clientsAudioBuffers.types.ts +25 -0
- package/src/talkpilot/clients/clients.getters.ts +11 -0
- package/src/talkpilot/clients/clients.types.ts +12 -0
- package/src/talkpilot/clients/index.ts +2 -0
- package/src/talkpilot/clientsConfig/__tests__/clientsConfig.spec.ts +28 -0
- package/src/talkpilot/clientsConfig/clientsConfig.getters.ts +20 -0
- package/src/talkpilot/clientsConfig/clientsConfig.types.ts +55 -0
- package/src/talkpilot/clientsConfig/index.ts +2 -0
- package/src/talkpilot/flows/flows.getter.ts +11 -0
- package/src/talkpilot/flows/flows.schema.ts +90 -0
- package/src/talkpilot/flows/flows.types.ts +151 -0
- package/src/talkpilot/flows/index.ts +2 -0
- package/src/talkpilot/groups/__tests__/groups.spec.ts +83 -0
- package/src/talkpilot/groups/__tests__/phone.utils.spec.ts +32 -0
- package/src/talkpilot/groups/groups.getters.ts +27 -0
- package/src/talkpilot/groups/groups.types.ts +29 -0
- package/src/talkpilot/groups/index.ts +2 -0
- package/src/talkpilot/groups/phone.utils.ts +40 -0
- package/src/talkpilot/index.ts +27 -0
- package/src/talkpilot/leads/index.ts +2 -0
- package/src/talkpilot/leads/leads.getter.ts +5 -0
- package/src/talkpilot/leads/leads.schema.ts +33 -0
- package/src/talkpilot/leads/leads.types.ts +20 -0
- package/src/talkpilot/mongodb-client.ts +78 -0
- package/src/talkpilot/phone_numbers/__tests__/phone_numbers.spec.ts +43 -0
- package/src/talkpilot/phone_numbers/index.ts +2 -0
- package/src/talkpilot/phone_numbers/phone_numbers.getter.ts +47 -0
- package/src/talkpilot/phone_numbers/phone_numbers.schema.ts +14 -0
- package/src/talkpilot/phone_numbers/phone_numbers.types.ts +15 -0
- package/src/talkpilot/plans/index.ts +2 -0
- package/src/talkpilot/plans/plans.getters.ts +121 -0
- package/src/talkpilot/plans/plans.types.ts +84 -0
- package/src/talkpilot/results/index.ts +2 -0
- package/src/talkpilot/results/results.getter.ts +26 -0
- package/src/talkpilot/results/results.schema.ts +25 -0
- package/src/talkpilot/results/results.types.ts +32 -0
- package/src/talkpilot/sessions/__tests__/sessions.spec.ts +43 -0
- package/src/talkpilot/sessions/index.ts +2 -0
- package/src/talkpilot/sessions/sessions.getter.ts +28 -0
- package/src/talkpilot/sessions/sessions.schema.ts +34 -0
- package/src/talkpilot/sessions/sessions.types.ts +28 -0
- package/src/talkpilot/subscriptions/__tests__/subscriptions.getters.utils.spec.ts +42 -0
- package/src/talkpilot/subscriptions/index.ts +3 -0
- package/src/talkpilot/subscriptions/subscriptions.getters.ts +147 -0
- package/src/talkpilot/subscriptions/subscriptions.getters.utils.ts +26 -0
- package/src/talkpilot/subscriptions/subscriptions.types.ts +65 -0
- package/src/test-utils/db-utils.ts +24 -0
- package/src/test-utils/factories/index.ts +12 -0
- package/src/test-utils/factories/municipal/cities.ts +16 -0
- package/src/test-utils/factories/municipal/departmentsSubjects.ts +29 -0
- package/src/test-utils/factories/municipal/streets.ts +17 -0
- package/src/test-utils/factories/municipal/tickets.ts +27 -0
- package/src/test-utils/factories/talkpilot/agents.ts +19 -0
- package/src/test-utils/factories/talkpilot/calls.ts +37 -0
- package/src/test-utils/factories/talkpilot/clientAudioBuffers.ts +18 -0
- package/src/test-utils/factories/talkpilot/clientsConfig.ts +19 -0
- package/src/test-utils/factories/talkpilot/flows.ts +31 -0
- package/src/test-utils/factories/talkpilot/groups.ts +33 -0
- package/src/test-utils/factories/talkpilot/phone_numbers.ts +20 -0
- package/src/test-utils/factories/talkpilot/sessions.ts +35 -0
- package/src/utils/validation.ts +23 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Street } from '../../../municipal/streets/streets.types';
|
|
5
|
+
|
|
6
|
+
export const streetFactory = Factory.define<Street>(() => ({
|
|
7
|
+
_id: new ObjectId(),
|
|
8
|
+
createdAt: new Date(),
|
|
9
|
+
updatedAt: new Date(),
|
|
10
|
+
id: faker.string.uuid(),
|
|
11
|
+
name: faker.location.street(),
|
|
12
|
+
cityName: faker.helpers.arrayElement(['ashdod', 'maltar', 'billit', 'hashkelon']),
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
export function createStreet(overrides?: Partial<Street>): Street {
|
|
16
|
+
return streetFactory.build(overrides);
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Ticket } from '../../../municipal/tickets/tickets.types';
|
|
5
|
+
import type { CityName } from '../../../municipal/departmentsSubjects/departmentsSubjects.types';
|
|
6
|
+
|
|
7
|
+
const VALID_CITIES: CityName[] = ['ashdod', 'maltar', 'billit', 'hashkelon', 'tests'];
|
|
8
|
+
|
|
9
|
+
export const ticketFactory = Factory.define<Ticket>(() => ({
|
|
10
|
+
_id: new ObjectId(),
|
|
11
|
+
createdAt: new Date(),
|
|
12
|
+
updatedAt: new Date(),
|
|
13
|
+
cityName: faker.helpers.arrayElement(VALID_CITIES),
|
|
14
|
+
externalCallFields: {
|
|
15
|
+
first_name: faker.person.firstName(),
|
|
16
|
+
last_name: faker.person.lastName(),
|
|
17
|
+
event_description: faker.lorem.sentence(),
|
|
18
|
+
street: faker.location.street(),
|
|
19
|
+
house_number: faker.location.buildingNumber(),
|
|
20
|
+
event_subject_id: faker.string.numeric(4),
|
|
21
|
+
event_sub_subject_id: faker.string.numeric(4),
|
|
22
|
+
},
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
export function createTicket(overrides?: Partial<Ticket>): Ticket {
|
|
26
|
+
return ticketFactory.build(overrides);
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Agent } from '../../../talkpilot/agents/agents.types';
|
|
5
|
+
|
|
6
|
+
export const agentFactory = Factory.define<Agent>(() => ({
|
|
7
|
+
name: faker.person.fullName(),
|
|
8
|
+
language: 'en',
|
|
9
|
+
voice: 'alloy',
|
|
10
|
+
instructions: faker.lorem.paragraph(),
|
|
11
|
+
labels: [],
|
|
12
|
+
clientId: new ObjectId().toString(),
|
|
13
|
+
role: 'assistant',
|
|
14
|
+
gender: faker.helpers.arrayElement(['male', 'female']),
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
export function createAgent(overrides?: Partial<Agent>): Agent {
|
|
18
|
+
return agentFactory.build(overrides);
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Call } from '../../../talkpilot/calls/calls.types';
|
|
5
|
+
|
|
6
|
+
export const callFactory = Factory.define<Call>(() => ({
|
|
7
|
+
callSid: faker.string.uuid(),
|
|
8
|
+
flowId: new ObjectId(),
|
|
9
|
+
clientId: faker.string.uuid(),
|
|
10
|
+
sessionId: null,
|
|
11
|
+
resultId: new ObjectId(),
|
|
12
|
+
customerPhoneNumber: faker.phone.number(),
|
|
13
|
+
agentPhoneNumber: faker.phone.number(),
|
|
14
|
+
isIncomingCall: false,
|
|
15
|
+
isOutgoingCall: true,
|
|
16
|
+
callLength: faker.number.int({ min: 0, max: 3600 }),
|
|
17
|
+
env: 'test',
|
|
18
|
+
updatedAt: new Date(),
|
|
19
|
+
createdAt: new Date(),
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
export function createOutGoingCallDoc(overrides?: Partial<Call>): Call {
|
|
23
|
+
return callFactory.build({
|
|
24
|
+
...overrides,
|
|
25
|
+
isIncomingCall: false,
|
|
26
|
+
isOutgoingCall: true,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function createIncomingCallDoc(overrides?: Partial<Call>): Call {
|
|
31
|
+
return callFactory.build({
|
|
32
|
+
...overrides,
|
|
33
|
+
isIncomingCall: true,
|
|
34
|
+
isOutgoingCall: false,
|
|
35
|
+
sessionId: overrides?.sessionId ?? null,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { faker } from '@faker-js/faker';
|
|
3
|
+
import { CreateAudioBufferInput } from '../../../talkpilot/clientAudioBuffers/clientsAudioBuffers.types';
|
|
4
|
+
|
|
5
|
+
export const audioBufferInputFactory = Factory.define<CreateAudioBufferInput>(() => ({
|
|
6
|
+
callSid: 'CA1234567890abcdef1234567890abcdef',
|
|
7
|
+
clientId: faker.string.uuid(),
|
|
8
|
+
bucketStartMs: faker.number.int({ min: 0, max: 1000000 }),
|
|
9
|
+
bucketDurationMs: faker.helpers.arrayElement([500, 1000]),
|
|
10
|
+
data: Buffer.from(faker.string.alphanumeric({ length: 100 })),
|
|
11
|
+
ttlMs: faker.number.int({ min: 1000, max: 3600000 }),
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
export function createAudioBufferInput(
|
|
15
|
+
overrides?: Partial<CreateAudioBufferInput>
|
|
16
|
+
): CreateAudioBufferInput {
|
|
17
|
+
return audioBufferInputFactory.build(overrides ?? {});
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type {
|
|
5
|
+
ClientConfig,
|
|
6
|
+
ClientConfigDoc,
|
|
7
|
+
} from '../../../talkpilot/clientsConfig/clientsConfig.types';
|
|
8
|
+
|
|
9
|
+
export const clientConfigFactory = Factory.define<ClientConfigDoc>(() => ({
|
|
10
|
+
_id: new ObjectId(),
|
|
11
|
+
clientId: faker.string.uuid(),
|
|
12
|
+
products: {},
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
export function createClientConfig(overrides?: Partial<ClientConfig>): ClientConfigDoc {
|
|
16
|
+
return clientConfigFactory.build({
|
|
17
|
+
...overrides,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Flow } from '../../../talkpilot/flows/flows.types';
|
|
5
|
+
|
|
6
|
+
export const flowFactory = Factory.define<Flow & { _id: ObjectId }>(() => {
|
|
7
|
+
const now = new Date();
|
|
8
|
+
return {
|
|
9
|
+
_id: new ObjectId(),
|
|
10
|
+
flowName: faker.lorem.words(2),
|
|
11
|
+
clientId: faker.string.uuid(),
|
|
12
|
+
systemInstructions: faker.lorem.sentences(2),
|
|
13
|
+
initialSentence: faker.lorem.sentence(),
|
|
14
|
+
insights: [],
|
|
15
|
+
interactions: [],
|
|
16
|
+
createdAt: now,
|
|
17
|
+
updatedAt: now,
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export function createFlow(overrides?: Partial<Flow>): Flow & { _id: ObjectId } {
|
|
22
|
+
const now = new Date();
|
|
23
|
+
const base = flowFactory.build();
|
|
24
|
+
return {
|
|
25
|
+
...base,
|
|
26
|
+
...overrides,
|
|
27
|
+
_id: (overrides?._id as ObjectId) ?? base._id,
|
|
28
|
+
updatedAt: now,
|
|
29
|
+
createdAt: overrides?.createdAt ?? now,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Group, GroupContact, GroupDoc } from '../../../talkpilot/groups/groups.types';
|
|
5
|
+
|
|
6
|
+
export const groupContactFactory = Factory.define<GroupContact>(() => ({
|
|
7
|
+
name: faker.person.firstName(),
|
|
8
|
+
phone: {
|
|
9
|
+
national: '500000000',
|
|
10
|
+
національний: '500000000',
|
|
11
|
+
nacionales: '500000000',
|
|
12
|
+
национальные: '500000000',
|
|
13
|
+
e164: '+972500000000' as const,
|
|
14
|
+
region: 'IL',
|
|
15
|
+
countryCallingCode: '972',
|
|
16
|
+
formatted: '+972 50-000-0000',
|
|
17
|
+
},
|
|
18
|
+
gender: faker.helpers.arrayElement(['male', 'female']),
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
export const groupFactory = Factory.define<GroupDoc>(() => ({
|
|
22
|
+
_id: new ObjectId(),
|
|
23
|
+
clientId: faker.string.uuid(),
|
|
24
|
+
createdAt: new Date(),
|
|
25
|
+
updatedAt: new Date(),
|
|
26
|
+
name: faker.company.name(),
|
|
27
|
+
description: faker.lorem.sentence(),
|
|
28
|
+
contacts: groupContactFactory.buildList(2),
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
export function createGroup(overrides?: Partial<Group>): GroupDoc {
|
|
32
|
+
return groupFactory.build(overrides);
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { PhoneNumber } from '../../../talkpilot/phone_numbers/phone_numbers.types';
|
|
5
|
+
|
|
6
|
+
export const phoneNumberFactory = Factory.define<PhoneNumber & { _id?: ObjectId }>(() => ({
|
|
7
|
+
_id: new ObjectId(),
|
|
8
|
+
client_id: faker.string.uuid(),
|
|
9
|
+
flow_id: new ObjectId(),
|
|
10
|
+
phone_number: faker.phone.number(),
|
|
11
|
+
createdAt: new Date(),
|
|
12
|
+
updatedAt: new Date(),
|
|
13
|
+
is_primary: true,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
export function createPhoneNumber(
|
|
17
|
+
overrides?: Partial<PhoneNumber> & { flow_id?: ObjectId }
|
|
18
|
+
): PhoneNumber & { _id?: ObjectId } {
|
|
19
|
+
return phoneNumberFactory.build(overrides);
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { ObjectId } from 'mongodb';
|
|
3
|
+
import { faker } from '@faker-js/faker';
|
|
4
|
+
import type { Session } from '../../../talkpilot/sessions/sessions.types';
|
|
5
|
+
|
|
6
|
+
export const sessionFactory = Factory.define<Session>(() => ({
|
|
7
|
+
_id: new ObjectId(),
|
|
8
|
+
session_name: faker.lorem.word(),
|
|
9
|
+
clientId: faker.string.uuid(),
|
|
10
|
+
flow_id: new ObjectId(),
|
|
11
|
+
phone_numbers: [
|
|
12
|
+
{
|
|
13
|
+
name: faker.person.firstName(),
|
|
14
|
+
phoneNumber: faker.phone.number(),
|
|
15
|
+
gender: 'male' as const,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
json: null,
|
|
19
|
+
metaKeys: null,
|
|
20
|
+
voice: null,
|
|
21
|
+
company_name: null,
|
|
22
|
+
createdAt: new Date(),
|
|
23
|
+
updatedAt: new Date(),
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
export function createSession(overrides?: Partial<Session>): Session {
|
|
27
|
+
const now = new Date();
|
|
28
|
+
const base = sessionFactory.build();
|
|
29
|
+
return {
|
|
30
|
+
...base,
|
|
31
|
+
...overrides,
|
|
32
|
+
createdAt: overrides?.createdAt ?? now,
|
|
33
|
+
updatedAt: now,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple validation utilities for the core-db package.
|
|
3
|
+
* Designed to be lightweight and only run when needed.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const validateConfig = (configName: string, value?: string): string => {
|
|
7
|
+
if (!value || value.trim() === '') {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`[core-db] Configuration Error: '${configName}' is missing. ` +
|
|
10
|
+
`Please provide it via parameters or set the corresponding environment variable.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const validateMongoUri = (uri: string): void => {
|
|
17
|
+
if (!uri.startsWith('mongodb://') && !uri.startsWith('mongodb+srv://')) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`[core-db] Connection Error: The provided MongoDB URI is invalid. ` +
|
|
20
|
+
`It must start with 'mongodb://' or 'mongodb+srv://'. Received: '${uri}'`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"outDir": "dist",
|
|
11
|
+
"rootDir": "src",
|
|
12
|
+
"strict": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"emitDecoratorMetadata": true,
|
|
19
|
+
"baseUrl": ".",
|
|
20
|
+
"paths": {
|
|
21
|
+
"@core/db": ["src/index.ts"],
|
|
22
|
+
"*": ["node_modules/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["src/**/*"],
|
|
26
|
+
"exclude": ["node_modules", "dist", "test", "**/*.test.ts", "**/__tests__/*", "**/*.spec.ts"]
|
|
27
|
+
}
|