@kelpie/server 0.1.0
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/LICENSE +661 -0
- package/README.md +57 -0
- package/dist/app.d.ts +36 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +98 -0
- package/dist/app.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/actor.d.ts +71 -0
- package/dist/lib/actor.d.ts.map +1 -0
- package/dist/lib/actor.js +48 -0
- package/dist/lib/actor.js.map +1 -0
- package/dist/lib/changes.d.ts +17 -0
- package/dist/lib/changes.d.ts.map +1 -0
- package/dist/lib/changes.js +35 -0
- package/dist/lib/changes.js.map +1 -0
- package/dist/lib/columns.d.ts +152 -0
- package/dist/lib/columns.d.ts.map +1 -0
- package/dist/lib/columns.js +126 -0
- package/dist/lib/columns.js.map +1 -0
- package/dist/lib/config.d.ts +36 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +52 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/database.d.ts +57 -0
- package/dist/lib/database.d.ts.map +1 -0
- package/dist/lib/database.js +91 -0
- package/dist/lib/database.js.map +1 -0
- package/dist/lib/dates.d.ts +11 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +17 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/email.d.ts +42 -0
- package/dist/lib/email.d.ts.map +1 -0
- package/dist/lib/email.js +38 -0
- package/dist/lib/email.js.map +1 -0
- package/dist/lib/errors.d.ts +76 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +102 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/http.d.ts +59 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +89 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/ids.d.ts +55 -0
- package/dist/lib/ids.d.ts.map +1 -0
- package/dist/lib/ids.js +56 -0
- package/dist/lib/ids.js.map +1 -0
- package/dist/lib/logger.d.ts +22 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +43 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/moduleConfig.d.ts +14 -0
- package/dist/lib/moduleConfig.d.ts.map +1 -0
- package/dist/lib/moduleConfig.js +56 -0
- package/dist/lib/moduleConfig.js.map +1 -0
- package/dist/lib/normalisation.d.ts +19 -0
- package/dist/lib/normalisation.d.ts.map +1 -0
- package/dist/lib/normalisation.js +32 -0
- package/dist/lib/normalisation.js.map +1 -0
- package/dist/lib/pagination.d.ts +104 -0
- package/dist/lib/pagination.d.ts.map +1 -0
- package/dist/lib/pagination.js +189 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/passwords.d.ts +32 -0
- package/dist/lib/passwords.d.ts.map +1 -0
- package/dist/lib/passwords.js +51 -0
- package/dist/lib/passwords.js.map +1 -0
- package/dist/lib/search.d.ts +11 -0
- package/dist/lib/search.d.ts.map +1 -0
- package/dist/lib/search.js +25 -0
- package/dist/lib/search.js.map +1 -0
- package/dist/lib/secrets.d.ts +40 -0
- package/dist/lib/secrets.d.ts.map +1 -0
- package/dist/lib/secrets.js +152 -0
- package/dist/lib/secrets.js.map +1 -0
- package/dist/lib/timezones.d.ts +38 -0
- package/dist/lib/timezones.d.ts.map +1 -0
- package/dist/lib/timezones.js +55 -0
- package/dist/lib/timezones.js.map +1 -0
- package/dist/lib/tokens.d.ts +10 -0
- package/dist/lib/tokens.d.ts.map +1 -0
- package/dist/lib/tokens.js +31 -0
- package/dist/lib/tokens.js.map +1 -0
- package/dist/lib/url.d.ts +25 -0
- package/dist/lib/url.d.ts.map +1 -0
- package/dist/lib/url.js +41 -0
- package/dist/lib/url.js.map +1 -0
- package/dist/modules/activities/index.d.ts +18 -0
- package/dist/modules/activities/index.d.ts.map +1 -0
- package/dist/modules/activities/index.js +34 -0
- package/dist/modules/activities/index.js.map +1 -0
- package/dist/modules/activities/recorder.d.ts +53 -0
- package/dist/modules/activities/recorder.d.ts.map +1 -0
- package/dist/modules/activities/recorder.js +36 -0
- package/dist/modules/activities/recorder.js.map +1 -0
- package/dist/modules/activities/repository.d.ts +52 -0
- package/dist/modules/activities/repository.d.ts.map +1 -0
- package/dist/modules/activities/repository.js +127 -0
- package/dist/modules/activities/repository.js.map +1 -0
- package/dist/modules/activities/routes.d.ts +17 -0
- package/dist/modules/activities/routes.d.ts.map +1 -0
- package/dist/modules/activities/routes.js +45 -0
- package/dist/modules/activities/routes.js.map +1 -0
- package/dist/modules/activities/schema.d.ts +188 -0
- package/dist/modules/activities/schema.d.ts.map +1 -0
- package/dist/modules/activities/schema.js +34 -0
- package/dist/modules/activities/schema.js.map +1 -0
- package/dist/modules/activities/service.d.ts +32 -0
- package/dist/modules/activities/service.d.ts.map +1 -0
- package/dist/modules/activities/service.js +28 -0
- package/dist/modules/activities/service.js.map +1 -0
- package/dist/modules/activities/tools.d.ts +4 -0
- package/dist/modules/activities/tools.d.ts.map +1 -0
- package/dist/modules/activities/tools.js +26 -0
- package/dist/modules/activities/tools.js.map +1 -0
- package/dist/modules/activities/wording.d.ts +79 -0
- package/dist/modules/activities/wording.d.ts.map +1 -0
- package/dist/modules/activities/wording.js +134 -0
- package/dist/modules/activities/wording.js.map +1 -0
- package/dist/modules/agent-tasks/catalog.d.ts +16 -0
- package/dist/modules/agent-tasks/catalog.d.ts.map +1 -0
- package/dist/modules/agent-tasks/catalog.js +694 -0
- package/dist/modules/agent-tasks/catalog.js.map +1 -0
- package/dist/modules/agent-tasks/dispatch.d.ts +61 -0
- package/dist/modules/agent-tasks/dispatch.d.ts.map +1 -0
- package/dist/modules/agent-tasks/dispatch.js +139 -0
- package/dist/modules/agent-tasks/dispatch.js.map +1 -0
- package/dist/modules/agent-tasks/index.d.ts +17 -0
- package/dist/modules/agent-tasks/index.d.ts.map +1 -0
- package/dist/modules/agent-tasks/index.js +54 -0
- package/dist/modules/agent-tasks/index.js.map +1 -0
- package/dist/modules/agent-tasks/prompt.d.ts +41 -0
- package/dist/modules/agent-tasks/prompt.d.ts.map +1 -0
- package/dist/modules/agent-tasks/prompt.js +78 -0
- package/dist/modules/agent-tasks/prompt.js.map +1 -0
- package/dist/modules/agent-tasks/repository.d.ts +32 -0
- package/dist/modules/agent-tasks/repository.d.ts.map +1 -0
- package/dist/modules/agent-tasks/repository.js +83 -0
- package/dist/modules/agent-tasks/repository.js.map +1 -0
- package/dist/modules/agent-tasks/resolve.d.ts +44 -0
- package/dist/modules/agent-tasks/resolve.d.ts.map +1 -0
- package/dist/modules/agent-tasks/resolve.js +396 -0
- package/dist/modules/agent-tasks/resolve.js.map +1 -0
- package/dist/modules/agent-tasks/routes.d.ts +55 -0
- package/dist/modules/agent-tasks/routes.d.ts.map +1 -0
- package/dist/modules/agent-tasks/routes.js +173 -0
- package/dist/modules/agent-tasks/routes.js.map +1 -0
- package/dist/modules/agent-tasks/schema.d.ts +346 -0
- package/dist/modules/agent-tasks/schema.d.ts.map +1 -0
- package/dist/modules/agent-tasks/schema.js +47 -0
- package/dist/modules/agent-tasks/schema.js.map +1 -0
- package/dist/modules/agent-tasks/service.d.ts +79 -0
- package/dist/modules/agent-tasks/service.d.ts.map +1 -0
- package/dist/modules/agent-tasks/service.js +210 -0
- package/dist/modules/agent-tasks/service.js.map +1 -0
- package/dist/modules/agent-tasks/wire.d.ts +35 -0
- package/dist/modules/agent-tasks/wire.d.ts.map +1 -0
- package/dist/modules/agent-tasks/wire.js +31 -0
- package/dist/modules/agent-tasks/wire.js.map +1 -0
- package/dist/modules/api-keys/index.d.ts +9 -0
- package/dist/modules/api-keys/index.d.ts.map +1 -0
- package/dist/modules/api-keys/index.js +29 -0
- package/dist/modules/api-keys/index.js.map +1 -0
- package/dist/modules/api-keys/keys.d.ts +25 -0
- package/dist/modules/api-keys/keys.d.ts.map +1 -0
- package/dist/modules/api-keys/keys.js +40 -0
- package/dist/modules/api-keys/keys.js.map +1 -0
- package/dist/modules/api-keys/repository.d.ts +15 -0
- package/dist/modules/api-keys/repository.d.ts.map +1 -0
- package/dist/modules/api-keys/repository.js +48 -0
- package/dist/modules/api-keys/repository.js.map +1 -0
- package/dist/modules/api-keys/routes.d.ts +8 -0
- package/dist/modules/api-keys/routes.d.ts.map +1 -0
- package/dist/modules/api-keys/routes.js +52 -0
- package/dist/modules/api-keys/routes.js.map +1 -0
- package/dist/modules/api-keys/schema.d.ts +166 -0
- package/dist/modules/api-keys/schema.d.ts.map +1 -0
- package/dist/modules/api-keys/schema.js +23 -0
- package/dist/modules/api-keys/schema.js.map +1 -0
- package/dist/modules/api-keys/service.d.ts +37 -0
- package/dist/modules/api-keys/service.d.ts.map +1 -0
- package/dist/modules/api-keys/service.js +95 -0
- package/dist/modules/api-keys/service.js.map +1 -0
- package/dist/modules/attachedRecords.d.ts +39 -0
- package/dist/modules/attachedRecords.d.ts.map +1 -0
- package/dist/modules/attachedRecords.js +52 -0
- package/dist/modules/attachedRecords.js.map +1 -0
- package/dist/modules/auth/actor.d.ts +11 -0
- package/dist/modules/auth/actor.d.ts.map +1 -0
- package/dist/modules/auth/actor.js +10 -0
- package/dist/modules/auth/actor.js.map +1 -0
- package/dist/modules/auth/credentials.d.ts +18 -0
- package/dist/modules/auth/credentials.d.ts.map +1 -0
- package/dist/modules/auth/credentials.js +105 -0
- package/dist/modules/auth/credentials.js.map +1 -0
- package/dist/modules/auth/index.d.ts +3 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +41 -0
- package/dist/modules/auth/index.js.map +1 -0
- package/dist/modules/auth/preferences.d.ts +34 -0
- package/dist/modules/auth/preferences.d.ts.map +1 -0
- package/dist/modules/auth/preferences.js +30 -0
- package/dist/modules/auth/preferences.js.map +1 -0
- package/dist/modules/auth/repository.d.ts +54 -0
- package/dist/modules/auth/repository.d.ts.map +1 -0
- package/dist/modules/auth/repository.js +137 -0
- package/dist/modules/auth/repository.js.map +1 -0
- package/dist/modules/auth/routes.d.ts +10 -0
- package/dist/modules/auth/routes.d.ts.map +1 -0
- package/dist/modules/auth/routes.js +181 -0
- package/dist/modules/auth/routes.js.map +1 -0
- package/dist/modules/auth/schema.d.ts +530 -0
- package/dist/modules/auth/schema.d.ts.map +1 -0
- package/dist/modules/auth/schema.js +67 -0
- package/dist/modules/auth/schema.js.map +1 -0
- package/dist/modules/auth/service.d.ts +73 -0
- package/dist/modules/auth/service.d.ts.map +1 -0
- package/dist/modules/auth/service.js +288 -0
- package/dist/modules/auth/service.js.map +1 -0
- package/dist/modules/auth/session.d.ts +16 -0
- package/dist/modules/auth/session.d.ts.map +1 -0
- package/dist/modules/auth/session.js +30 -0
- package/dist/modules/auth/session.js.map +1 -0
- package/dist/modules/companies/index.d.ts +9 -0
- package/dist/modules/companies/index.d.ts.map +1 -0
- package/dist/modules/companies/index.js +37 -0
- package/dist/modules/companies/index.js.map +1 -0
- package/dist/modules/companies/repository.d.ts +40 -0
- package/dist/modules/companies/repository.d.ts.map +1 -0
- package/dist/modules/companies/repository.js +112 -0
- package/dist/modules/companies/repository.js.map +1 -0
- package/dist/modules/companies/routes.d.ts +89 -0
- package/dist/modules/companies/routes.d.ts.map +1 -0
- package/dist/modules/companies/routes.js +125 -0
- package/dist/modules/companies/routes.js.map +1 -0
- package/dist/modules/companies/schema.d.ts +381 -0
- package/dist/modules/companies/schema.d.ts.map +1 -0
- package/dist/modules/companies/schema.js +51 -0
- package/dist/modules/companies/schema.js.map +1 -0
- package/dist/modules/companies/service.d.ts +49 -0
- package/dist/modules/companies/service.d.ts.map +1 -0
- package/dist/modules/companies/service.js +184 -0
- package/dist/modules/companies/service.js.map +1 -0
- package/dist/modules/companies/tools.d.ts +4 -0
- package/dist/modules/companies/tools.d.ts.map +1 -0
- package/dist/modules/companies/tools.js +27 -0
- package/dist/modules/companies/tools.js.map +1 -0
- package/dist/modules/core.d.ts +21 -0
- package/dist/modules/core.d.ts.map +1 -0
- package/dist/modules/core.js +82 -0
- package/dist/modules/core.js.map +1 -0
- package/dist/modules/crudTools.d.ts +99 -0
- package/dist/modules/crudTools.d.ts.map +1 -0
- package/dist/modules/crudTools.js +123 -0
- package/dist/modules/crudTools.js.map +1 -0
- package/dist/modules/dashboard/attention.d.ts +39 -0
- package/dist/modules/dashboard/attention.d.ts.map +1 -0
- package/dist/modules/dashboard/attention.js +57 -0
- package/dist/modules/dashboard/attention.js.map +1 -0
- package/dist/modules/dashboard/index.d.ts +15 -0
- package/dist/modules/dashboard/index.d.ts.map +1 -0
- package/dist/modules/dashboard/index.js +44 -0
- package/dist/modules/dashboard/index.js.map +1 -0
- package/dist/modules/dashboard/repository.d.ts +83 -0
- package/dist/modules/dashboard/repository.d.ts.map +1 -0
- package/dist/modules/dashboard/repository.js +217 -0
- package/dist/modules/dashboard/repository.js.map +1 -0
- package/dist/modules/dashboard/routes.d.ts +21 -0
- package/dist/modules/dashboard/routes.d.ts.map +1 -0
- package/dist/modules/dashboard/routes.js +116 -0
- package/dist/modules/dashboard/routes.js.map +1 -0
- package/dist/modules/dashboard/service.d.ts +122 -0
- package/dist/modules/dashboard/service.d.ts.map +1 -0
- package/dist/modules/dashboard/service.js +215 -0
- package/dist/modules/dashboard/service.js.map +1 -0
- package/dist/modules/dashboard/tools.d.ts +4 -0
- package/dist/modules/dashboard/tools.d.ts.map +1 -0
- package/dist/modules/dashboard/tools.js +33 -0
- package/dist/modules/dashboard/tools.js.map +1 -0
- package/dist/modules/deals/index.d.ts +11 -0
- package/dist/modules/deals/index.d.ts.map +1 -0
- package/dist/modules/deals/index.js +38 -0
- package/dist/modules/deals/index.js.map +1 -0
- package/dist/modules/deals/repository.d.ts +44 -0
- package/dist/modules/deals/repository.d.ts.map +1 -0
- package/dist/modules/deals/repository.js +160 -0
- package/dist/modules/deals/repository.js.map +1 -0
- package/dist/modules/deals/routes.d.ts +50 -0
- package/dist/modules/deals/routes.d.ts.map +1 -0
- package/dist/modules/deals/routes.js +132 -0
- package/dist/modules/deals/routes.js.map +1 -0
- package/dist/modules/deals/schema.d.ts +419 -0
- package/dist/modules/deals/schema.d.ts.map +1 -0
- package/dist/modules/deals/schema.js +61 -0
- package/dist/modules/deals/schema.js.map +1 -0
- package/dist/modules/deals/service.d.ts +71 -0
- package/dist/modules/deals/service.d.ts.map +1 -0
- package/dist/modules/deals/service.js +277 -0
- package/dist/modules/deals/service.js.map +1 -0
- package/dist/modules/deals/tools.d.ts +4 -0
- package/dist/modules/deals/tools.d.ts.map +1 -0
- package/dist/modules/deals/tools.js +33 -0
- package/dist/modules/deals/tools.js.map +1 -0
- package/dist/modules/decisions/index.d.ts +11 -0
- package/dist/modules/decisions/index.d.ts.map +1 -0
- package/dist/modules/decisions/index.js +34 -0
- package/dist/modules/decisions/index.js.map +1 -0
- package/dist/modules/decisions/repository.d.ts +38 -0
- package/dist/modules/decisions/repository.d.ts.map +1 -0
- package/dist/modules/decisions/repository.js +126 -0
- package/dist/modules/decisions/repository.js.map +1 -0
- package/dist/modules/decisions/routes.d.ts +42 -0
- package/dist/modules/decisions/routes.d.ts.map +1 -0
- package/dist/modules/decisions/routes.js +131 -0
- package/dist/modules/decisions/routes.js.map +1 -0
- package/dist/modules/decisions/schema.d.ts +228 -0
- package/dist/modules/decisions/schema.d.ts.map +1 -0
- package/dist/modules/decisions/schema.js +41 -0
- package/dist/modules/decisions/schema.js.map +1 -0
- package/dist/modules/decisions/service.d.ts +60 -0
- package/dist/modules/decisions/service.d.ts.map +1 -0
- package/dist/modules/decisions/service.js +122 -0
- package/dist/modules/decisions/service.js.map +1 -0
- package/dist/modules/decisions/tools.d.ts +4 -0
- package/dist/modules/decisions/tools.d.ts.map +1 -0
- package/dist/modules/decisions/tools.js +32 -0
- package/dist/modules/decisions/tools.js.map +1 -0
- package/dist/modules/forms/embed.d.ts +50 -0
- package/dist/modules/forms/embed.d.ts.map +1 -0
- package/dist/modules/forms/embed.js +236 -0
- package/dist/modules/forms/embed.js.map +1 -0
- package/dist/modules/forms/fields.d.ts +71 -0
- package/dist/modules/forms/fields.d.ts.map +1 -0
- package/dist/modules/forms/fields.js +122 -0
- package/dist/modules/forms/fields.js.map +1 -0
- package/dist/modules/forms/index.d.ts +15 -0
- package/dist/modules/forms/index.d.ts.map +1 -0
- package/dist/modules/forms/index.js +53 -0
- package/dist/modules/forms/index.js.map +1 -0
- package/dist/modules/forms/mapping.d.ts +99 -0
- package/dist/modules/forms/mapping.d.ts.map +1 -0
- package/dist/modules/forms/mapping.js +152 -0
- package/dist/modules/forms/mapping.js.map +1 -0
- package/dist/modules/forms/publicRoutes.d.ts +11 -0
- package/dist/modules/forms/publicRoutes.d.ts.map +1 -0
- package/dist/modules/forms/publicRoutes.js +68 -0
- package/dist/modules/forms/publicRoutes.js.map +1 -0
- package/dist/modules/forms/repository.d.ts +65 -0
- package/dist/modules/forms/repository.d.ts.map +1 -0
- package/dist/modules/forms/repository.js +139 -0
- package/dist/modules/forms/repository.js.map +1 -0
- package/dist/modules/forms/routes.d.ts +106 -0
- package/dist/modules/forms/routes.d.ts.map +1 -0
- package/dist/modules/forms/routes.js +204 -0
- package/dist/modules/forms/routes.js.map +1 -0
- package/dist/modules/forms/schema.d.ts +643 -0
- package/dist/modules/forms/schema.d.ts.map +1 -0
- package/dist/modules/forms/schema.js +87 -0
- package/dist/modules/forms/schema.js.map +1 -0
- package/dist/modules/forms/service.d.ts +62 -0
- package/dist/modules/forms/service.d.ts.map +1 -0
- package/dist/modules/forms/service.js +208 -0
- package/dist/modules/forms/service.js.map +1 -0
- package/dist/modules/forms/submission.d.ts +30 -0
- package/dist/modules/forms/submission.d.ts.map +1 -0
- package/dist/modules/forms/submission.js +337 -0
- package/dist/modules/forms/submission.js.map +1 -0
- package/dist/modules/forms/tools.d.ts +4 -0
- package/dist/modules/forms/tools.d.ts.map +1 -0
- package/dist/modules/forms/tools.js +46 -0
- package/dist/modules/forms/tools.js.map +1 -0
- package/dist/modules/handbook/index.d.ts +15 -0
- package/dist/modules/handbook/index.d.ts.map +1 -0
- package/dist/modules/handbook/index.js +37 -0
- package/dist/modules/handbook/index.js.map +1 -0
- package/dist/modules/handbook/repository.d.ts +52 -0
- package/dist/modules/handbook/repository.d.ts.map +1 -0
- package/dist/modules/handbook/repository.js +109 -0
- package/dist/modules/handbook/repository.js.map +1 -0
- package/dist/modules/handbook/routes.d.ts +38 -0
- package/dist/modules/handbook/routes.d.ts.map +1 -0
- package/dist/modules/handbook/routes.js +103 -0
- package/dist/modules/handbook/routes.js.map +1 -0
- package/dist/modules/handbook/schema.d.ts +206 -0
- package/dist/modules/handbook/schema.d.ts.map +1 -0
- package/dist/modules/handbook/schema.js +37 -0
- package/dist/modules/handbook/schema.js.map +1 -0
- package/dist/modules/handbook/service.d.ts +59 -0
- package/dist/modules/handbook/service.d.ts.map +1 -0
- package/dist/modules/handbook/service.js +246 -0
- package/dist/modules/handbook/service.js.map +1 -0
- package/dist/modules/handbook/slugs.d.ts +28 -0
- package/dist/modules/handbook/slugs.d.ts.map +1 -0
- package/dist/modules/handbook/slugs.js +48 -0
- package/dist/modules/handbook/slugs.js.map +1 -0
- package/dist/modules/handbook/tools.d.ts +4 -0
- package/dist/modules/handbook/tools.d.ts.map +1 -0
- package/dist/modules/handbook/tools.js +26 -0
- package/dist/modules/handbook/tools.js.map +1 -0
- package/dist/modules/handbook/tree.d.ts +69 -0
- package/dist/modules/handbook/tree.d.ts.map +1 -0
- package/dist/modules/handbook/tree.js +117 -0
- package/dist/modules/handbook/tree.js.map +1 -0
- package/dist/modules/hiring/candidates.d.ts +70 -0
- package/dist/modules/hiring/candidates.d.ts.map +1 -0
- package/dist/modules/hiring/candidates.js +243 -0
- package/dist/modules/hiring/candidates.js.map +1 -0
- package/dist/modules/hiring/index.d.ts +15 -0
- package/dist/modules/hiring/index.d.ts.map +1 -0
- package/dist/modules/hiring/index.js +48 -0
- package/dist/modules/hiring/index.js.map +1 -0
- package/dist/modules/hiring/repository.d.ts +52 -0
- package/dist/modules/hiring/repository.d.ts.map +1 -0
- package/dist/modules/hiring/repository.js +137 -0
- package/dist/modules/hiring/repository.js.map +1 -0
- package/dist/modules/hiring/roles.d.ts +42 -0
- package/dist/modules/hiring/roles.d.ts.map +1 -0
- package/dist/modules/hiring/roles.js +104 -0
- package/dist/modules/hiring/roles.js.map +1 -0
- package/dist/modules/hiring/routes.d.ts +73 -0
- package/dist/modules/hiring/routes.d.ts.map +1 -0
- package/dist/modules/hiring/routes.js +170 -0
- package/dist/modules/hiring/routes.js.map +1 -0
- package/dist/modules/hiring/schema.d.ts +308 -0
- package/dist/modules/hiring/schema.d.ts.map +1 -0
- package/dist/modules/hiring/schema.js +62 -0
- package/dist/modules/hiring/schema.js.map +1 -0
- package/dist/modules/hiring/tools.d.ts +8 -0
- package/dist/modules/hiring/tools.d.ts.map +1 -0
- package/dist/modules/hiring/tools.js +50 -0
- package/dist/modules/hiring/tools.js.map +1 -0
- package/dist/modules/import-export/csv.d.ts +47 -0
- package/dist/modules/import-export/csv.d.ts.map +1 -0
- package/dist/modules/import-export/csv.js +138 -0
- package/dist/modules/import-export/csv.js.map +1 -0
- package/dist/modules/import-export/drafts.d.ts +83 -0
- package/dist/modules/import-export/drafts.d.ts.map +1 -0
- package/dist/modules/import-export/drafts.js +97 -0
- package/dist/modules/import-export/drafts.js.map +1 -0
- package/dist/modules/import-export/exportRows.d.ts +8 -0
- package/dist/modules/import-export/exportRows.d.ts.map +1 -0
- package/dist/modules/import-export/exportRows.js +71 -0
- package/dist/modules/import-export/exportRows.js.map +1 -0
- package/dist/modules/import-export/index.d.ts +15 -0
- package/dist/modules/import-export/index.d.ts.map +1 -0
- package/dist/modules/import-export/index.js +43 -0
- package/dist/modules/import-export/index.js.map +1 -0
- package/dist/modules/import-export/mapping.d.ts +46 -0
- package/dist/modules/import-export/mapping.d.ts.map +1 -0
- package/dist/modules/import-export/mapping.js +115 -0
- package/dist/modules/import-export/mapping.js.map +1 -0
- package/dist/modules/import-export/plan.d.ts +107 -0
- package/dist/modules/import-export/plan.d.ts.map +1 -0
- package/dist/modules/import-export/plan.js +178 -0
- package/dist/modules/import-export/plan.js.map +1 -0
- package/dist/modules/import-export/presets.d.ts +39 -0
- package/dist/modules/import-export/presets.d.ts.map +1 -0
- package/dist/modules/import-export/presets.js +151 -0
- package/dist/modules/import-export/presets.js.map +1 -0
- package/dist/modules/import-export/repository.d.ts +171 -0
- package/dist/modules/import-export/repository.d.ts.map +1 -0
- package/dist/modules/import-export/repository.js +343 -0
- package/dist/modules/import-export/repository.js.map +1 -0
- package/dist/modules/import-export/routes.d.ts +9 -0
- package/dist/modules/import-export/routes.d.ts.map +1 -0
- package/dist/modules/import-export/routes.js +199 -0
- package/dist/modules/import-export/routes.js.map +1 -0
- package/dist/modules/import-export/schema.d.ts +494 -0
- package/dist/modules/import-export/schema.d.ts.map +1 -0
- package/dist/modules/import-export/schema.js +99 -0
- package/dist/modules/import-export/schema.js.map +1 -0
- package/dist/modules/import-export/service.d.ts +74 -0
- package/dist/modules/import-export/service.d.ts.map +1 -0
- package/dist/modules/import-export/service.js +561 -0
- package/dist/modules/import-export/service.js.map +1 -0
- package/dist/modules/import-export/streams.d.ts +4 -0
- package/dist/modules/import-export/streams.d.ts.map +1 -0
- package/dist/modules/import-export/streams.js +55 -0
- package/dist/modules/import-export/streams.js.map +1 -0
- package/dist/modules/import-export/tools.d.ts +22 -0
- package/dist/modules/import-export/tools.d.ts.map +1 -0
- package/dist/modules/import-export/tools.js +116 -0
- package/dist/modules/import-export/tools.js.map +1 -0
- package/dist/modules/import-export/validation.d.ts +7 -0
- package/dist/modules/import-export/validation.d.ts.map +1 -0
- package/dist/modules/import-export/validation.js +114 -0
- package/dist/modules/import-export/validation.js.map +1 -0
- package/dist/modules/import-export/writes.d.ts +45 -0
- package/dist/modules/import-export/writes.d.ts.map +1 -0
- package/dist/modules/import-export/writes.js +247 -0
- package/dist/modules/import-export/writes.js.map +1 -0
- package/dist/modules/integrations/schema.d.ts +185 -0
- package/dist/modules/integrations/schema.d.ts.map +1 -0
- package/dist/modules/integrations/schema.js +26 -0
- package/dist/modules/integrations/schema.js.map +1 -0
- package/dist/modules/mcp/index.d.ts +26 -0
- package/dist/modules/mcp/index.d.ts.map +1 -0
- package/dist/modules/mcp/index.js +45 -0
- package/dist/modules/mcp/index.js.map +1 -0
- package/dist/modules/mcp/protocol.d.ts +166 -0
- package/dist/modules/mcp/protocol.d.ts.map +1 -0
- package/dist/modules/mcp/protocol.js +292 -0
- package/dist/modules/mcp/protocol.js.map +1 -0
- package/dist/modules/mcp/router.d.ts +23 -0
- package/dist/modules/mcp/router.d.ts.map +1 -0
- package/dist/modules/mcp/router.js +298 -0
- package/dist/modules/mcp/router.js.map +1 -0
- package/dist/modules/notes/index.d.ts +9 -0
- package/dist/modules/notes/index.d.ts.map +1 -0
- package/dist/modules/notes/index.js +37 -0
- package/dist/modules/notes/index.js.map +1 -0
- package/dist/modules/notes/repository.d.ts +34 -0
- package/dist/modules/notes/repository.d.ts.map +1 -0
- package/dist/modules/notes/repository.js +70 -0
- package/dist/modules/notes/repository.js.map +1 -0
- package/dist/modules/notes/routes.d.ts +37 -0
- package/dist/modules/notes/routes.d.ts.map +1 -0
- package/dist/modules/notes/routes.js +124 -0
- package/dist/modules/notes/routes.js.map +1 -0
- package/dist/modules/notes/schema.d.ts +176 -0
- package/dist/modules/notes/schema.d.ts.map +1 -0
- package/dist/modules/notes/schema.js +35 -0
- package/dist/modules/notes/schema.js.map +1 -0
- package/dist/modules/notes/service.d.ts +49 -0
- package/dist/modules/notes/service.d.ts.map +1 -0
- package/dist/modules/notes/service.js +118 -0
- package/dist/modules/notes/service.js.map +1 -0
- package/dist/modules/notes/tools.d.ts +4 -0
- package/dist/modules/notes/tools.d.ts.map +1 -0
- package/dist/modules/notes/tools.js +41 -0
- package/dist/modules/notes/tools.js.map +1 -0
- package/dist/modules/opportunities/index.d.ts +11 -0
- package/dist/modules/opportunities/index.d.ts.map +1 -0
- package/dist/modules/opportunities/index.js +38 -0
- package/dist/modules/opportunities/index.js.map +1 -0
- package/dist/modules/opportunities/repository.d.ts +28 -0
- package/dist/modules/opportunities/repository.d.ts.map +1 -0
- package/dist/modules/opportunities/repository.js +89 -0
- package/dist/modules/opportunities/repository.js.map +1 -0
- package/dist/modules/opportunities/routes.d.ts +39 -0
- package/dist/modules/opportunities/routes.d.ts.map +1 -0
- package/dist/modules/opportunities/routes.js +104 -0
- package/dist/modules/opportunities/routes.js.map +1 -0
- package/dist/modules/opportunities/schema.d.ts +266 -0
- package/dist/modules/opportunities/schema.d.ts.map +1 -0
- package/dist/modules/opportunities/schema.js +41 -0
- package/dist/modules/opportunities/schema.js.map +1 -0
- package/dist/modules/opportunities/service.d.ts +60 -0
- package/dist/modules/opportunities/service.d.ts.map +1 -0
- package/dist/modules/opportunities/service.js +212 -0
- package/dist/modules/opportunities/service.js.map +1 -0
- package/dist/modules/opportunities/tools.d.ts +4 -0
- package/dist/modules/opportunities/tools.d.ts.map +1 -0
- package/dist/modules/opportunities/tools.js +33 -0
- package/dist/modules/opportunities/tools.js.map +1 -0
- package/dist/modules/partnerships/index.d.ts +11 -0
- package/dist/modules/partnerships/index.d.ts.map +1 -0
- package/dist/modules/partnerships/index.js +38 -0
- package/dist/modules/partnerships/index.js.map +1 -0
- package/dist/modules/partnerships/repository.d.ts +47 -0
- package/dist/modules/partnerships/repository.d.ts.map +1 -0
- package/dist/modules/partnerships/repository.js +169 -0
- package/dist/modules/partnerships/repository.js.map +1 -0
- package/dist/modules/partnerships/routes.d.ts +46 -0
- package/dist/modules/partnerships/routes.d.ts.map +1 -0
- package/dist/modules/partnerships/routes.js +122 -0
- package/dist/modules/partnerships/routes.js.map +1 -0
- package/dist/modules/partnerships/schema.d.ts +338 -0
- package/dist/modules/partnerships/schema.d.ts.map +1 -0
- package/dist/modules/partnerships/schema.js +54 -0
- package/dist/modules/partnerships/schema.js.map +1 -0
- package/dist/modules/partnerships/service.d.ts +71 -0
- package/dist/modules/partnerships/service.d.ts.map +1 -0
- package/dist/modules/partnerships/service.js +273 -0
- package/dist/modules/partnerships/service.js.map +1 -0
- package/dist/modules/partnerships/tools.d.ts +4 -0
- package/dist/modules/partnerships/tools.d.ts.map +1 -0
- package/dist/modules/partnerships/tools.js +35 -0
- package/dist/modules/partnerships/tools.js.map +1 -0
- package/dist/modules/people/index.d.ts +9 -0
- package/dist/modules/people/index.d.ts.map +1 -0
- package/dist/modules/people/index.js +37 -0
- package/dist/modules/people/index.js.map +1 -0
- package/dist/modules/people/repository.d.ts +31 -0
- package/dist/modules/people/repository.d.ts.map +1 -0
- package/dist/modules/people/repository.js +109 -0
- package/dist/modules/people/repository.js.map +1 -0
- package/dist/modules/people/routes.d.ts +111 -0
- package/dist/modules/people/routes.d.ts.map +1 -0
- package/dist/modules/people/routes.js +134 -0
- package/dist/modules/people/routes.js.map +1 -0
- package/dist/modules/people/schema.d.ts +354 -0
- package/dist/modules/people/schema.d.ts.map +1 -0
- package/dist/modules/people/schema.js +61 -0
- package/dist/modules/people/schema.js.map +1 -0
- package/dist/modules/people/service.d.ts +56 -0
- package/dist/modules/people/service.d.ts.map +1 -0
- package/dist/modules/people/service.js +190 -0
- package/dist/modules/people/service.js.map +1 -0
- package/dist/modules/people/tools.d.ts +4 -0
- package/dist/modules/people/tools.d.ts.map +1 -0
- package/dist/modules/people/tools.js +27 -0
- package/dist/modules/people/tools.js.map +1 -0
- package/dist/modules/pipelines/index.d.ts +9 -0
- package/dist/modules/pipelines/index.d.ts.map +1 -0
- package/dist/modules/pipelines/index.js +37 -0
- package/dist/modules/pipelines/index.js.map +1 -0
- package/dist/modules/pipelines/repository.d.ts +26 -0
- package/dist/modules/pipelines/repository.d.ts.map +1 -0
- package/dist/modules/pipelines/repository.js +67 -0
- package/dist/modules/pipelines/repository.js.map +1 -0
- package/dist/modules/pipelines/routes.d.ts +33 -0
- package/dist/modules/pipelines/routes.d.ts.map +1 -0
- package/dist/modules/pipelines/routes.js +98 -0
- package/dist/modules/pipelines/routes.js.map +1 -0
- package/dist/modules/pipelines/schema.d.ts +170 -0
- package/dist/modules/pipelines/schema.d.ts.map +1 -0
- package/dist/modules/pipelines/schema.js +30 -0
- package/dist/modules/pipelines/schema.js.map +1 -0
- package/dist/modules/pipelines/service.d.ts +49 -0
- package/dist/modules/pipelines/service.d.ts.map +1 -0
- package/dist/modules/pipelines/service.js +227 -0
- package/dist/modules/pipelines/service.js.map +1 -0
- package/dist/modules/pipelines/tools.d.ts +4 -0
- package/dist/modules/pipelines/tools.d.ts.map +1 -0
- package/dist/modules/pipelines/tools.js +43 -0
- package/dist/modules/pipelines/tools.js.map +1 -0
- package/dist/modules/plans/index.d.ts +10 -0
- package/dist/modules/plans/index.d.ts.map +1 -0
- package/dist/modules/plans/index.js +33 -0
- package/dist/modules/plans/index.js.map +1 -0
- package/dist/modules/plans/repository.d.ts +49 -0
- package/dist/modules/plans/repository.d.ts.map +1 -0
- package/dist/modules/plans/repository.js +94 -0
- package/dist/modules/plans/repository.js.map +1 -0
- package/dist/modules/plans/routes.d.ts +46 -0
- package/dist/modules/plans/routes.d.ts.map +1 -0
- package/dist/modules/plans/routes.js +152 -0
- package/dist/modules/plans/routes.js.map +1 -0
- package/dist/modules/plans/schema.d.ts +209 -0
- package/dist/modules/plans/schema.d.ts.map +1 -0
- package/dist/modules/plans/schema.js +37 -0
- package/dist/modules/plans/schema.js.map +1 -0
- package/dist/modules/plans/service.d.ts +57 -0
- package/dist/modules/plans/service.d.ts.map +1 -0
- package/dist/modules/plans/service.js +125 -0
- package/dist/modules/plans/service.js.map +1 -0
- package/dist/modules/plans/tools.d.ts +4 -0
- package/dist/modules/plans/tools.d.ts.map +1 -0
- package/dist/modules/plans/tools.js +39 -0
- package/dist/modules/plans/tools.js.map +1 -0
- package/dist/modules/positions/index.d.ts +9 -0
- package/dist/modules/positions/index.d.ts.map +1 -0
- package/dist/modules/positions/index.js +36 -0
- package/dist/modules/positions/index.js.map +1 -0
- package/dist/modules/positions/repository.d.ts +34 -0
- package/dist/modules/positions/repository.d.ts.map +1 -0
- package/dist/modules/positions/repository.js +71 -0
- package/dist/modules/positions/repository.js.map +1 -0
- package/dist/modules/positions/routes.d.ts +22 -0
- package/dist/modules/positions/routes.d.ts.map +1 -0
- package/dist/modules/positions/routes.js +56 -0
- package/dist/modules/positions/routes.js.map +1 -0
- package/dist/modules/positions/schema.d.ts +154 -0
- package/dist/modules/positions/schema.d.ts.map +1 -0
- package/dist/modules/positions/schema.js +36 -0
- package/dist/modules/positions/schema.js.map +1 -0
- package/dist/modules/positions/service.d.ts +46 -0
- package/dist/modules/positions/service.d.ts.map +1 -0
- package/dist/modules/positions/service.js +159 -0
- package/dist/modules/positions/service.js.map +1 -0
- package/dist/modules/positions/tools.d.ts +4 -0
- package/dist/modules/positions/tools.d.ts.map +1 -0
- package/dist/modules/positions/tools.js +26 -0
- package/dist/modules/positions/tools.js.map +1 -0
- package/dist/modules/raises/index.d.ts +11 -0
- package/dist/modules/raises/index.d.ts.map +1 -0
- package/dist/modules/raises/index.js +38 -0
- package/dist/modules/raises/index.js.map +1 -0
- package/dist/modules/raises/repository.d.ts +48 -0
- package/dist/modules/raises/repository.d.ts.map +1 -0
- package/dist/modules/raises/repository.js +164 -0
- package/dist/modules/raises/repository.js.map +1 -0
- package/dist/modules/raises/routes.d.ts +48 -0
- package/dist/modules/raises/routes.d.ts.map +1 -0
- package/dist/modules/raises/routes.js +126 -0
- package/dist/modules/raises/routes.js.map +1 -0
- package/dist/modules/raises/schema.d.ts +356 -0
- package/dist/modules/raises/schema.d.ts.map +1 -0
- package/dist/modules/raises/schema.js +55 -0
- package/dist/modules/raises/schema.js.map +1 -0
- package/dist/modules/raises/service.d.ts +79 -0
- package/dist/modules/raises/service.d.ts.map +1 -0
- package/dist/modules/raises/service.js +275 -0
- package/dist/modules/raises/service.js.map +1 -0
- package/dist/modules/raises/tools.d.ts +4 -0
- package/dist/modules/raises/tools.d.ts.map +1 -0
- package/dist/modules/raises/tools.js +33 -0
- package/dist/modules/raises/tools.js.map +1 -0
- package/dist/modules/recordTargets.d.ts +55 -0
- package/dist/modules/recordTargets.d.ts.map +1 -0
- package/dist/modules/recordTargets.js +107 -0
- package/dist/modules/recordTargets.js.map +1 -0
- package/dist/modules/references.d.ts +8 -0
- package/dist/modules/references.d.ts.map +1 -0
- package/dist/modules/references.js +40 -0
- package/dist/modules/references.js.map +1 -0
- package/dist/modules/reseal.d.ts +33 -0
- package/dist/modules/reseal.d.ts.map +1 -0
- package/dist/modules/reseal.js +108 -0
- package/dist/modules/reseal.js.map +1 -0
- package/dist/modules/search/index.d.ts +21 -0
- package/dist/modules/search/index.d.ts.map +1 -0
- package/dist/modules/search/index.js +50 -0
- package/dist/modules/search/index.js.map +1 -0
- package/dist/modules/search/query.d.ts +44 -0
- package/dist/modules/search/query.d.ts.map +1 -0
- package/dist/modules/search/query.js +88 -0
- package/dist/modules/search/query.js.map +1 -0
- package/dist/modules/search/repository.d.ts +44 -0
- package/dist/modules/search/repository.d.ts.map +1 -0
- package/dist/modules/search/repository.js +252 -0
- package/dist/modules/search/repository.js.map +1 -0
- package/dist/modules/search/routes.d.ts +17 -0
- package/dist/modules/search/routes.d.ts.map +1 -0
- package/dist/modules/search/routes.js +93 -0
- package/dist/modules/search/routes.js.map +1 -0
- package/dist/modules/search/service.d.ts +55 -0
- package/dist/modules/search/service.d.ts.map +1 -0
- package/dist/modules/search/service.js +69 -0
- package/dist/modules/search/service.js.map +1 -0
- package/dist/modules/search/tools.d.ts +4 -0
- package/dist/modules/search/tools.d.ts.map +1 -0
- package/dist/modules/search/tools.js +52 -0
- package/dist/modules/search/tools.js.map +1 -0
- package/dist/modules/stagedRecords.d.ts +28 -0
- package/dist/modules/stagedRecords.d.ts.map +1 -0
- package/dist/modules/stagedRecords.js +50 -0
- package/dist/modules/stagedRecords.js.map +1 -0
- package/dist/modules/webhooks/delivery.d.ts +98 -0
- package/dist/modules/webhooks/delivery.d.ts.map +1 -0
- package/dist/modules/webhooks/delivery.js +237 -0
- package/dist/modules/webhooks/delivery.js.map +1 -0
- package/dist/modules/webhooks/index.d.ts +23 -0
- package/dist/modules/webhooks/index.d.ts.map +1 -0
- package/dist/modules/webhooks/index.js +48 -0
- package/dist/modules/webhooks/index.js.map +1 -0
- package/dist/modules/webhooks/payloads.d.ts +31 -0
- package/dist/modules/webhooks/payloads.d.ts.map +1 -0
- package/dist/modules/webhooks/payloads.js +52 -0
- package/dist/modules/webhooks/payloads.js.map +1 -0
- package/dist/modules/webhooks/repository.d.ts +70 -0
- package/dist/modules/webhooks/repository.d.ts.map +1 -0
- package/dist/modules/webhooks/repository.js +140 -0
- package/dist/modules/webhooks/repository.js.map +1 -0
- package/dist/modules/webhooks/routes.d.ts +47 -0
- package/dist/modules/webhooks/routes.d.ts.map +1 -0
- package/dist/modules/webhooks/routes.js +170 -0
- package/dist/modules/webhooks/routes.js.map +1 -0
- package/dist/modules/webhooks/schema.d.ts +396 -0
- package/dist/modules/webhooks/schema.d.ts.map +1 -0
- package/dist/modules/webhooks/schema.js +61 -0
- package/dist/modules/webhooks/schema.js.map +1 -0
- package/dist/modules/webhooks/service.d.ts +65 -0
- package/dist/modules/webhooks/service.d.ts.map +1 -0
- package/dist/modules/webhooks/service.js +202 -0
- package/dist/modules/webhooks/service.js.map +1 -0
- package/dist/modules/webhooks/signing.d.ts +57 -0
- package/dist/modules/webhooks/signing.d.ts.map +1 -0
- package/dist/modules/webhooks/signing.js +69 -0
- package/dist/modules/webhooks/signing.js.map +1 -0
- package/dist/modules/webhooks/tools.d.ts +4 -0
- package/dist/modules/webhooks/tools.d.ts.map +1 -0
- package/dist/modules/webhooks/tools.js +77 -0
- package/dist/modules/webhooks/tools.js.map +1 -0
- package/dist/modules/webhooks/url.d.ts +10 -0
- package/dist/modules/webhooks/url.d.ts.map +1 -0
- package/dist/modules/webhooks/url.js +9 -0
- package/dist/modules/webhooks/url.js.map +1 -0
- package/dist/modules/workspace/capabilities.d.ts +9 -0
- package/dist/modules/workspace/capabilities.d.ts.map +1 -0
- package/dist/modules/workspace/capabilities.js +12 -0
- package/dist/modules/workspace/capabilities.js.map +1 -0
- package/dist/modules/workspace/idempotencyMiddleware.d.ts +16 -0
- package/dist/modules/workspace/idempotencyMiddleware.d.ts.map +1 -0
- package/dist/modules/workspace/idempotencyMiddleware.js +142 -0
- package/dist/modules/workspace/idempotencyMiddleware.js.map +1 -0
- package/dist/modules/workspace/idempotencyRepository.d.ts +43 -0
- package/dist/modules/workspace/idempotencyRepository.d.ts.map +1 -0
- package/dist/modules/workspace/idempotencyRepository.js +75 -0
- package/dist/modules/workspace/idempotencyRepository.js.map +1 -0
- package/dist/modules/workspace/index.d.ts +9 -0
- package/dist/modules/workspace/index.d.ts.map +1 -0
- package/dist/modules/workspace/index.js +53 -0
- package/dist/modules/workspace/index.js.map +1 -0
- package/dist/modules/workspace/repository.d.ts +112 -0
- package/dist/modules/workspace/repository.d.ts.map +1 -0
- package/dist/modules/workspace/repository.js +266 -0
- package/dist/modules/workspace/repository.js.map +1 -0
- package/dist/modules/workspace/roles.d.ts +22 -0
- package/dist/modules/workspace/roles.d.ts.map +1 -0
- package/dist/modules/workspace/roles.js +31 -0
- package/dist/modules/workspace/roles.js.map +1 -0
- package/dist/modules/workspace/routes.d.ts +41 -0
- package/dist/modules/workspace/routes.d.ts.map +1 -0
- package/dist/modules/workspace/routes.js +158 -0
- package/dist/modules/workspace/routes.js.map +1 -0
- package/dist/modules/workspace/schema.d.ts +719 -0
- package/dist/modules/workspace/schema.d.ts.map +1 -0
- package/dist/modules/workspace/schema.js +102 -0
- package/dist/modules/workspace/schema.js.map +1 -0
- package/dist/modules/workspace/service.d.ts +94 -0
- package/dist/modules/workspace/service.d.ts.map +1 -0
- package/dist/modules/workspace/service.js +528 -0
- package/dist/modules/workspace/service.js.map +1 -0
- package/dist/modules/workspace/starters.d.ts +22 -0
- package/dist/modules/workspace/starters.d.ts.map +1 -0
- package/dist/modules/workspace/starters.js +56 -0
- package/dist/modules/workspace/starters.js.map +1 -0
- package/dist/modules/workspace/tools.d.ts +4 -0
- package/dist/modules/workspace/tools.d.ts.map +1 -0
- package/dist/modules/workspace/tools.js +95 -0
- package/dist/modules/workspace/tools.js.map +1 -0
- package/dist/runtime/entitlements.d.ts +66 -0
- package/dist/runtime/entitlements.d.ts.map +1 -0
- package/dist/runtime/entitlements.js +62 -0
- package/dist/runtime/entitlements.js.map +1 -0
- package/dist/runtime/events.d.ts +139 -0
- package/dist/runtime/events.d.ts.map +1 -0
- package/dist/runtime/events.js +98 -0
- package/dist/runtime/events.js.map +1 -0
- package/dist/runtime/migrate.d.ts +28 -0
- package/dist/runtime/migrate.d.ts.map +1 -0
- package/dist/runtime/migrate.js +43 -0
- package/dist/runtime/migrate.js.map +1 -0
- package/dist/runtime/module.d.ts +138 -0
- package/dist/runtime/module.d.ts.map +1 -0
- package/dist/runtime/module.js +2 -0
- package/dist/runtime/module.js.map +1 -0
- package/dist/runtime/moduleConfig.d.ts +21 -0
- package/dist/runtime/moduleConfig.d.ts.map +1 -0
- package/dist/runtime/moduleConfig.js +54 -0
- package/dist/runtime/moduleConfig.js.map +1 -0
- package/dist/runtime/order.d.ts +21 -0
- package/dist/runtime/order.d.ts.map +1 -0
- package/dist/runtime/order.js +72 -0
- package/dist/runtime/order.js.map +1 -0
- package/dist/runtime/registry.d.ts +66 -0
- package/dist/runtime/registry.d.ts.map +1 -0
- package/dist/runtime/registry.js +148 -0
- package/dist/runtime/registry.js.map +1 -0
- package/dist/runtime/transaction.d.ts +34 -0
- package/dist/runtime/transaction.d.ts.map +1 -0
- package/dist/runtime/transaction.js +24 -0
- package/dist/runtime/transaction.js.map +1 -0
- package/dist/schema/index.d.ts +30 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +30 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/testing/app.d.ts +42 -0
- package/dist/testing/app.d.ts.map +1 -0
- package/dist/testing/app.js +31 -0
- package/dist/testing/app.js.map +1 -0
- package/dist/testing/client.d.ts +34 -0
- package/dist/testing/client.d.ts.map +1 -0
- package/dist/testing/client.js +70 -0
- package/dist/testing/client.js.map +1 -0
- package/dist/testing/database.d.ts +17 -0
- package/dist/testing/database.d.ts.map +1 -0
- package/dist/testing/database.js +84 -0
- package/dist/testing/database.js.map +1 -0
- package/dist/testing/environment.d.ts +17 -0
- package/dist/testing/environment.d.ts.map +1 -0
- package/dist/testing/environment.js +19 -0
- package/dist/testing/environment.js.map +1 -0
- package/dist/testing/fixtures.d.ts +22 -0
- package/dist/testing/fixtures.d.ts.map +1 -0
- package/dist/testing/fixtures.js +55 -0
- package/dist/testing/fixtures.js.map +1 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/services.d.ts +18 -0
- package/dist/testing/services.d.ts.map +1 -0
- package/dist/testing/services.js +43 -0
- package/dist/testing/services.js.map +1 -0
- package/migrations/0000_initial_schema.sql +597 -0
- package/migrations/0001_uneven_lockjaw.sql +11 -0
- package/migrations/0002_neat_madame_web.sql +2 -0
- package/migrations/0003_bright_shockwave.sql +1 -0
- package/migrations/0004_drop_unused_import_columns.sql +2 -0
- package/migrations/0005_import_job_rows.sql +23 -0
- package/migrations/0006_drop_webhook_secret_hash.sql +1 -0
- package/migrations/0007_add_webhook_secret_encrypted.sql +1 -0
- package/migrations/0008_rich_mister_sinister.sql +3 -0
- package/migrations/0009_natural_proemial_gods.sql +1 -0
- package/migrations/0010_fine_brood.sql +1 -0
- package/migrations/0011_add_webhook_previous_secret.sql +2 -0
- package/migrations/0012_idempotency_keys_response_nullable.sql +1 -0
- package/migrations/0013_add_agent_run_failure_reason.sql +1 -0
- package/migrations/0014_right_shinko_yamashiro.sql +12 -0
- package/migrations/0015_peaceful_chimera.sql +33 -0
- package/migrations/meta/0000_snapshot.json +4467 -0
- package/migrations/meta/0001_snapshot.json +4539 -0
- package/migrations/meta/0002_snapshot.json +4539 -0
- package/migrations/meta/0003_snapshot.json +4544 -0
- package/migrations/meta/0004_snapshot.json +4531 -0
- package/migrations/meta/0005_snapshot.json +4674 -0
- package/migrations/meta/0006_snapshot.json +4668 -0
- package/migrations/meta/0007_snapshot.json +4674 -0
- package/migrations/meta/0008_snapshot.json +4694 -0
- package/migrations/meta/0009_snapshot.json +4700 -0
- package/migrations/meta/0010_snapshot.json +4694 -0
- package/migrations/meta/0011_snapshot.json +4706 -0
- package/migrations/meta/0012_snapshot.json +4706 -0
- package/migrations/meta/0013_snapshot.json +4712 -0
- package/migrations/meta/0014_snapshot.json +4802 -0
- package/migrations/meta/0015_snapshot.json +5077 -0
- package/migrations/meta/_journal.json +118 -0
- package/package.json +68 -0
- package/src/app.ts +157 -0
- package/src/index.ts +113 -0
- package/src/lib/actor.ts +99 -0
- package/src/lib/changes.ts +43 -0
- package/src/lib/columns.ts +170 -0
- package/src/lib/config.ts +86 -0
- package/src/lib/database.ts +118 -0
- package/src/lib/dates.ts +18 -0
- package/src/lib/email.ts +65 -0
- package/src/lib/errors.ts +156 -0
- package/src/lib/http.ts +109 -0
- package/src/lib/ids.ts +61 -0
- package/src/lib/logger.ts +73 -0
- package/src/lib/moduleConfig.ts +65 -0
- package/src/lib/normalisation.ts +36 -0
- package/src/lib/pagination.ts +291 -0
- package/src/lib/passwords.ts +56 -0
- package/src/lib/search.ts +29 -0
- package/src/lib/secrets.ts +223 -0
- package/src/lib/timezones.ts +59 -0
- package/src/lib/tokens.ts +37 -0
- package/src/lib/url.ts +52 -0
- package/src/modules/activities/index.ts +43 -0
- package/src/modules/activities/recorder.ts +108 -0
- package/src/modules/activities/repository.ts +196 -0
- package/src/modules/activities/routes.ts +78 -0
- package/src/modules/activities/schema.ts +41 -0
- package/src/modules/activities/service.ts +93 -0
- package/src/modules/activities/tools.ts +40 -0
- package/src/modules/activities/wording.ts +168 -0
- package/src/modules/agent-tasks/catalog.ts +712 -0
- package/src/modules/agent-tasks/dispatch.ts +188 -0
- package/src/modules/agent-tasks/index.ts +79 -0
- package/src/modules/agent-tasks/prompt.ts +140 -0
- package/src/modules/agent-tasks/repository.ts +152 -0
- package/src/modules/agent-tasks/resolve.ts +704 -0
- package/src/modules/agent-tasks/routes.ts +260 -0
- package/src/modules/agent-tasks/schema.ts +57 -0
- package/src/modules/agent-tasks/service.ts +370 -0
- package/src/modules/agent-tasks/wire.ts +61 -0
- package/src/modules/api-keys/index.ts +34 -0
- package/src/modules/api-keys/keys.ts +59 -0
- package/src/modules/api-keys/repository.ts +82 -0
- package/src/modules/api-keys/routes.ts +83 -0
- package/src/modules/api-keys/schema.ts +28 -0
- package/src/modules/api-keys/service.ts +152 -0
- package/src/modules/attachedRecords.ts +85 -0
- package/src/modules/auth/actor.ts +17 -0
- package/src/modules/auth/credentials.ts +153 -0
- package/src/modules/auth/index.ts +49 -0
- package/src/modules/auth/preferences.ts +57 -0
- package/src/modules/auth/repository.ts +240 -0
- package/src/modules/auth/routes.ts +247 -0
- package/src/modules/auth/schema.ts +77 -0
- package/src/modules/auth/service.ts +441 -0
- package/src/modules/auth/session.ts +40 -0
- package/src/modules/companies/index.ts +43 -0
- package/src/modules/companies/repository.ts +185 -0
- package/src/modules/companies/routes.ts +170 -0
- package/src/modules/companies/schema.ts +66 -0
- package/src/modules/companies/service.ts +267 -0
- package/src/modules/companies/tools.ts +32 -0
- package/src/modules/core.ts +93 -0
- package/src/modules/crudTools.ts +226 -0
- package/src/modules/dashboard/attention.ts +67 -0
- package/src/modules/dashboard/index.ts +49 -0
- package/src/modules/dashboard/repository.ts +360 -0
- package/src/modules/dashboard/routes.ts +171 -0
- package/src/modules/dashboard/service.ts +449 -0
- package/src/modules/dashboard/tools.ts +39 -0
- package/src/modules/deals/index.ts +44 -0
- package/src/modules/deals/repository.ts +251 -0
- package/src/modules/deals/routes.ts +166 -0
- package/src/modules/deals/schema.ts +72 -0
- package/src/modules/deals/service.ts +433 -0
- package/src/modules/deals/tools.ts +39 -0
- package/src/modules/decisions/index.ts +40 -0
- package/src/modules/decisions/repository.ts +204 -0
- package/src/modules/decisions/routes.ts +184 -0
- package/src/modules/decisions/schema.ts +56 -0
- package/src/modules/decisions/service.ts +223 -0
- package/src/modules/decisions/tools.ts +38 -0
- package/src/modules/forms/embed.ts +274 -0
- package/src/modules/forms/fields.ts +206 -0
- package/src/modules/forms/index.ts +61 -0
- package/src/modules/forms/mapping.ts +222 -0
- package/src/modules/forms/publicRoutes.ts +92 -0
- package/src/modules/forms/repository.ts +223 -0
- package/src/modules/forms/routes.ts +276 -0
- package/src/modules/forms/schema.ts +135 -0
- package/src/modules/forms/service.ts +362 -0
- package/src/modules/forms/submission.ts +496 -0
- package/src/modules/forms/tools.ts +66 -0
- package/src/modules/handbook/index.ts +43 -0
- package/src/modules/handbook/repository.ts +173 -0
- package/src/modules/handbook/routes.ts +145 -0
- package/src/modules/handbook/schema.ts +43 -0
- package/src/modules/handbook/service.ts +399 -0
- package/src/modules/handbook/slugs.ts +54 -0
- package/src/modules/handbook/tools.ts +32 -0
- package/src/modules/handbook/tree.ts +158 -0
- package/src/modules/hiring/candidates.ts +391 -0
- package/src/modules/hiring/index.ts +55 -0
- package/src/modules/hiring/repository.ts +244 -0
- package/src/modules/hiring/roles.ts +174 -0
- package/src/modules/hiring/routes.ts +257 -0
- package/src/modules/hiring/schema.ts +93 -0
- package/src/modules/hiring/tools.ts +73 -0
- package/src/modules/import-export/csv.ts +180 -0
- package/src/modules/import-export/drafts.ts +182 -0
- package/src/modules/import-export/exportRows.ts +85 -0
- package/src/modules/import-export/index.ts +49 -0
- package/src/modules/import-export/mapping.ts +154 -0
- package/src/modules/import-export/plan.ts +311 -0
- package/src/modules/import-export/presets.ts +183 -0
- package/src/modules/import-export/repository.ts +603 -0
- package/src/modules/import-export/routes.ts +276 -0
- package/src/modules/import-export/schema.ts +142 -0
- package/src/modules/import-export/service.ts +842 -0
- package/src/modules/import-export/streams.ts +98 -0
- package/src/modules/import-export/tools.ts +153 -0
- package/src/modules/import-export/validation.ts +163 -0
- package/src/modules/import-export/writes.ts +365 -0
- package/src/modules/integrations/schema.ts +31 -0
- package/src/modules/mcp/index.ts +52 -0
- package/src/modules/mcp/protocol.ts +442 -0
- package/src/modules/mcp/router.ts +425 -0
- package/src/modules/notes/index.ts +43 -0
- package/src/modules/notes/repository.ts +130 -0
- package/src/modules/notes/routes.ts +170 -0
- package/src/modules/notes/schema.ts +42 -0
- package/src/modules/notes/service.ts +204 -0
- package/src/modules/notes/tools.ts +46 -0
- package/src/modules/opportunities/index.ts +44 -0
- package/src/modules/opportunities/repository.ts +157 -0
- package/src/modules/opportunities/routes.ts +152 -0
- package/src/modules/opportunities/schema.ts +47 -0
- package/src/modules/opportunities/service.ts +342 -0
- package/src/modules/opportunities/tools.ts +39 -0
- package/src/modules/partnerships/index.ts +44 -0
- package/src/modules/partnerships/repository.ts +274 -0
- package/src/modules/partnerships/routes.ts +170 -0
- package/src/modules/partnerships/schema.ts +65 -0
- package/src/modules/partnerships/service.ts +442 -0
- package/src/modules/partnerships/tools.ts +41 -0
- package/src/modules/people/index.ts +43 -0
- package/src/modules/people/repository.ts +167 -0
- package/src/modules/people/routes.ts +175 -0
- package/src/modules/people/schema.ts +89 -0
- package/src/modules/people/service.ts +284 -0
- package/src/modules/people/tools.ts +32 -0
- package/src/modules/pipelines/index.ts +43 -0
- package/src/modules/pipelines/repository.ts +116 -0
- package/src/modules/pipelines/routes.ts +157 -0
- package/src/modules/pipelines/schema.ts +37 -0
- package/src/modules/pipelines/service.ts +339 -0
- package/src/modules/pipelines/tools.ts +52 -0
- package/src/modules/plans/index.ts +39 -0
- package/src/modules/plans/repository.ts +174 -0
- package/src/modules/plans/routes.ts +212 -0
- package/src/modules/plans/schema.ts +45 -0
- package/src/modules/plans/service.ts +223 -0
- package/src/modules/plans/tools.ts +45 -0
- package/src/modules/positions/index.ts +42 -0
- package/src/modules/positions/repository.ts +136 -0
- package/src/modules/positions/routes.ts +97 -0
- package/src/modules/positions/schema.ts +42 -0
- package/src/modules/positions/service.ts +253 -0
- package/src/modules/positions/tools.ts +32 -0
- package/src/modules/raises/index.ts +44 -0
- package/src/modules/raises/repository.ts +254 -0
- package/src/modules/raises/routes.ts +160 -0
- package/src/modules/raises/schema.ts +66 -0
- package/src/modules/raises/service.ts +442 -0
- package/src/modules/raises/tools.ts +39 -0
- package/src/modules/recordTargets.ts +194 -0
- package/src/modules/references.ts +44 -0
- package/src/modules/reseal.ts +178 -0
- package/src/modules/search/index.ts +55 -0
- package/src/modules/search/query.ts +104 -0
- package/src/modules/search/repository.ts +388 -0
- package/src/modules/search/routes.ts +131 -0
- package/src/modules/search/service.ts +153 -0
- package/src/modules/search/tools.ts +60 -0
- package/src/modules/stagedRecords.ts +91 -0
- package/src/modules/webhooks/delivery.ts +349 -0
- package/src/modules/webhooks/index.ts +85 -0
- package/src/modules/webhooks/payloads.ts +84 -0
- package/src/modules/webhooks/repository.ts +244 -0
- package/src/modules/webhooks/routes.ts +240 -0
- package/src/modules/webhooks/schema.ts +78 -0
- package/src/modules/webhooks/service.ts +347 -0
- package/src/modules/webhooks/signing.ts +95 -0
- package/src/modules/webhooks/tools.ts +108 -0
- package/src/modules/webhooks/url.ts +21 -0
- package/src/modules/workspace/capabilities.ts +14 -0
- package/src/modules/workspace/idempotencyMiddleware.ts +207 -0
- package/src/modules/workspace/idempotencyRepository.ts +111 -0
- package/src/modules/workspace/index.ts +64 -0
- package/src/modules/workspace/repository.ts +420 -0
- package/src/modules/workspace/roles.ts +38 -0
- package/src/modules/workspace/routes.ts +255 -0
- package/src/modules/workspace/schema.ts +130 -0
- package/src/modules/workspace/service.ts +798 -0
- package/src/modules/workspace/starters.ts +69 -0
- package/src/modules/workspace/tools.ts +141 -0
- package/src/runtime/entitlements.ts +142 -0
- package/src/runtime/events.ts +185 -0
- package/src/runtime/migrate.ts +75 -0
- package/src/runtime/module.ts +147 -0
- package/src/runtime/moduleConfig.ts +68 -0
- package/src/runtime/order.ts +90 -0
- package/src/runtime/registry.ts +263 -0
- package/src/runtime/transaction.ts +80 -0
- package/src/schema/index.ts +30 -0
- package/src/testing/app.ts +79 -0
- package/src/testing/client.ts +118 -0
- package/src/testing/database.ts +106 -0
- package/src/testing/environment.ts +22 -0
- package/src/testing/fixtures.ts +70 -0
- package/src/testing/index.ts +13 -0
- package/src/testing/services.ts +67 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { mountAuthRoutes } from './routes.js';
|
|
3
|
+
import * as schema from './schema.js';
|
|
4
|
+
import { createAuthService } from './service.js';
|
|
5
|
+
/**
|
|
6
|
+
* Accounts, sessions, and password recovery.
|
|
7
|
+
*
|
|
8
|
+
* Registers before `workspace`, because `workspace_members.user_id` references
|
|
9
|
+
* `users`.
|
|
10
|
+
*/
|
|
11
|
+
const authConfigSchema = z.object({
|
|
12
|
+
/** Cookies go out `Secure` everywhere except development. */
|
|
13
|
+
NODE_ENV: z.enum(['development', 'test', 'production']),
|
|
14
|
+
});
|
|
15
|
+
export function createAuthModule(migrationsDirectory) {
|
|
16
|
+
return {
|
|
17
|
+
id: 'auth',
|
|
18
|
+
structural: true,
|
|
19
|
+
register(context) {
|
|
20
|
+
const config = context.config(authConfigSchema);
|
|
21
|
+
const service = createAuthService({
|
|
22
|
+
db: context.db,
|
|
23
|
+
transaction: context.transaction,
|
|
24
|
+
email: context.email,
|
|
25
|
+
createId: context.createId,
|
|
26
|
+
now: context.now,
|
|
27
|
+
});
|
|
28
|
+
context.schema(schema, migrationsDirectory);
|
|
29
|
+
context.routes((router) => {
|
|
30
|
+
mountAuthRoutes(router, {
|
|
31
|
+
db: context.db,
|
|
32
|
+
now: context.now,
|
|
33
|
+
service,
|
|
34
|
+
cookie: { secure: config.NODE_ENV === 'production' },
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return Promise.resolve();
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AC,CAAA;YAEF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ThemePreference } from '@kelpie/schemas';
|
|
2
|
+
/**
|
|
3
|
+
* What an account's preferences are before anyone has saved any, and how a
|
|
4
|
+
* partial change becomes the whole row.
|
|
5
|
+
*
|
|
6
|
+
* `user_preferences` has no row until the first save. The alternative, seeding
|
|
7
|
+
* one at signup, would leave every account created before this table was written
|
|
8
|
+
* to without one, so the read path has to answer for a missing row regardless.
|
|
9
|
+
* Given that, defaults live here rather than in the database, where a `PATCH`
|
|
10
|
+
* would still have to know them to build an insert.
|
|
11
|
+
*/
|
|
12
|
+
export interface PreferenceValues {
|
|
13
|
+
readonly timezone: string;
|
|
14
|
+
readonly theme: ThemePreference;
|
|
15
|
+
readonly emailDigest: boolean;
|
|
16
|
+
readonly mentionEmails: boolean;
|
|
17
|
+
readonly productUpdates: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* UTC, not the workspace's zone. An account is global and may belong to several
|
|
21
|
+
* workspaces in different zones, so deriving from one of them would be picking
|
|
22
|
+
* arbitrarily and calling it the person's answer.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEFAULT_PREFERENCES: PreferenceValues;
|
|
25
|
+
export type PreferenceChanges = Partial<PreferenceValues>;
|
|
26
|
+
/**
|
|
27
|
+
* Folds a `PATCH` body onto what is stored, or onto the defaults when nothing is.
|
|
28
|
+
*
|
|
29
|
+
* The result is always a complete row, which is what makes the write an upsert
|
|
30
|
+
* with no read-modify-write hazard in the caller: the same request applied twice
|
|
31
|
+
* produces the same row.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyPreferenceChanges(stored: PreferenceValues | undefined, changes: PreferenceChanges): PreferenceValues;
|
|
34
|
+
//# sourceMappingURL=preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/preferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD;;;;;;;;;GASG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAA;IAC/B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CACjC;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAEzD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,CAUlB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTC, not the workspace's zone. An account is global and may belong to several
|
|
3
|
+
* workspaces in different zones, so deriving from one of them would be picking
|
|
4
|
+
* arbitrarily and calling it the person's answer.
|
|
5
|
+
*/
|
|
6
|
+
export const DEFAULT_PREFERENCES = {
|
|
7
|
+
timezone: 'UTC',
|
|
8
|
+
theme: 'system',
|
|
9
|
+
emailDigest: true,
|
|
10
|
+
mentionEmails: true,
|
|
11
|
+
productUpdates: false,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Folds a `PATCH` body onto what is stored, or onto the defaults when nothing is.
|
|
15
|
+
*
|
|
16
|
+
* The result is always a complete row, which is what makes the write an upsert
|
|
17
|
+
* with no read-modify-write hazard in the caller: the same request applied twice
|
|
18
|
+
* produces the same row.
|
|
19
|
+
*/
|
|
20
|
+
export function applyPreferenceChanges(stored, changes) {
|
|
21
|
+
const current = stored ?? DEFAULT_PREFERENCES;
|
|
22
|
+
return {
|
|
23
|
+
timezone: changes.timezone ?? current.timezone,
|
|
24
|
+
theme: changes.theme ?? current.theme,
|
|
25
|
+
emailDigest: changes.emailDigest ?? current.emailDigest,
|
|
26
|
+
mentionEmails: changes.mentionEmails ?? current.mentionEmails,
|
|
27
|
+
productUpdates: changes.productUpdates ?? current.productUpdates,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.js","sourceRoot":"","sources":["../../../src/modules/auth/preferences.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,KAAK;CACtB,CAAA;AAID;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAoC,EACpC,OAA0B;IAE1B,MAAM,OAAO,GAAG,MAAM,IAAI,mBAAmB,CAAA;IAE7C,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ;QAC9C,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK;QACrC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW;QACvD,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa;QAC7D,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,cAAc;KACjE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Database } from '../../lib/database.ts';
|
|
2
|
+
import type { Transaction } from '../../runtime/transaction.ts';
|
|
3
|
+
import { workspaceMembers } from '../workspace/schema.ts';
|
|
4
|
+
import { passwordResetTokens, sessions, userPreferences, users } from './schema.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Drizzle queries for accounts and sessions. No business logic: the service
|
|
7
|
+
* decides, these read and write.
|
|
8
|
+
*
|
|
9
|
+
* Users and sessions are global rather than workspace-scoped, so unlike the CRM
|
|
10
|
+
* repositories these do not take a `workspaceId` first argument.
|
|
11
|
+
*/
|
|
12
|
+
/** Either the pool or an open transaction. Repositories never open one themselves. */
|
|
13
|
+
export type Queryable = Database | Transaction;
|
|
14
|
+
export type UserRecord = typeof users.$inferSelect;
|
|
15
|
+
export type SessionRecord = typeof sessions.$inferSelect;
|
|
16
|
+
export type UserPreferencesRecord = typeof userPreferences.$inferSelect;
|
|
17
|
+
export declare function findUserByEmail(db: Queryable, email: string): Promise<UserRecord | undefined>;
|
|
18
|
+
export declare function findUserById(db: Queryable, userId: string): Promise<UserRecord | undefined>;
|
|
19
|
+
export declare function insertUser(db: Queryable, values: typeof users.$inferInsert): Promise<UserRecord>;
|
|
20
|
+
export declare function updateUserPassword(db: Queryable, userId: string, passwordHash: string, now: Date): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Writes name and email. Not the password: that one has its own function because
|
|
23
|
+
* it also ends sessions, and the two must not be reachable through one call.
|
|
24
|
+
*/
|
|
25
|
+
export declare function updateUserProfile(db: Queryable, userId: string, changes: {
|
|
26
|
+
readonly name?: string;
|
|
27
|
+
readonly email?: string;
|
|
28
|
+
}, now: Date): Promise<UserRecord | undefined>;
|
|
29
|
+
export declare function findPreferences(db: Queryable, userId: string): Promise<UserPreferencesRecord | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Inserts the row or replaces it, since the caller always has a complete set of
|
|
32
|
+
* values. Repeating a save writes the same row rather than failing on the
|
|
33
|
+
* primary key.
|
|
34
|
+
*/
|
|
35
|
+
export declare function upsertPreferences(db: Queryable, values: typeof userPreferences.$inferInsert): Promise<UserPreferencesRecord>;
|
|
36
|
+
export declare function insertSession(db: Queryable, values: typeof sessions.$inferInsert): Promise<SessionRecord>;
|
|
37
|
+
/** Only returns sessions that have not expired; an expired row is not a session. */
|
|
38
|
+
export declare function findLiveSessionByTokenHash(db: Queryable, tokenHash: string, now: Date): Promise<SessionRecord | undefined>;
|
|
39
|
+
export declare function listSessionsForUser(db: Queryable, userId: string): Promise<SessionRecord[]>;
|
|
40
|
+
export declare function touchSession(db: Queryable, sessionId: string, now: Date): Promise<void>;
|
|
41
|
+
export declare function deleteSession(db: Queryable, userId: string, sessionId: string): Promise<number>;
|
|
42
|
+
export declare function deleteAllSessionsForUser(db: Queryable, userId: string): Promise<void>;
|
|
43
|
+
/** Signs every other device out while leaving the caller where they are. */
|
|
44
|
+
export declare function deleteOtherSessionsForUser(db: Queryable, userId: string, keepSessionId: string): Promise<void>;
|
|
45
|
+
export declare function setActiveWorkspace(db: Queryable, sessionId: string, workspaceId: string): Promise<void>;
|
|
46
|
+
export declare function insertPasswordResetToken(db: Queryable, values: typeof passwordResetTokens.$inferInsert): Promise<void>;
|
|
47
|
+
/** Unused and unexpired. A used or stale token is not a token. */
|
|
48
|
+
export declare function findUsablePasswordResetToken(db: Queryable, tokenHash: string, now: Date): Promise<typeof passwordResetTokens.$inferSelect | undefined>;
|
|
49
|
+
export declare function markPasswordResetTokenUsed(db: Queryable, id: string, now: Date): Promise<void>;
|
|
50
|
+
/** The membership a session's active workspace resolves to, if any. */
|
|
51
|
+
export declare function findMembership(db: Queryable, workspaceId: string, userId: string): Promise<typeof workspaceMembers.$inferSelect | undefined>;
|
|
52
|
+
/** The workspace a returning user lands in when their session has no active one. */
|
|
53
|
+
export declare function findFirstMembership(db: Queryable, userId: string): Promise<typeof workspaceMembers.$inferSelect | undefined>;
|
|
54
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,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C,EAAE,EAAE,SAAS,EACb,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,wBAAwB,CAC5C,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,OAAO,mBAAmB,CAAC,YAAY,GAC9C,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,kEAAkE;AAClE,wBAAsB,4BAA4B,CAChD,EAAE,EAAE,SAAS,EACb,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,IAAI,GACR,OAAO,CAAC,OAAO,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAAC,CAc9D;AAED,wBAAsB,0BAA0B,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAKpG;AAED,uEAAuE;AACvE,wBAAsB,cAAc,CAClC,EAAE,EAAE,SAAS,EACb,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,gBAAgB,CAAC,YAAY,GAAG,SAAS,CAAC,CAQ3D;AAED,oFAAoF;AACpF,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,gBAAgB,CAAC,YAAY,GAAG,SAAS,CAAC,CAS3D"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { and, desc, eq, gt, isNull, ne } from 'drizzle-orm';
|
|
2
|
+
import { workspaceMembers } from '../workspace/schema.js';
|
|
3
|
+
import { passwordResetTokens, sessions, userPreferences, users } from './schema.js';
|
|
4
|
+
export async function findUserByEmail(db, email) {
|
|
5
|
+
const [found] = await db.select().from(users).where(eq(users.email, email)).limit(1);
|
|
6
|
+
return found;
|
|
7
|
+
}
|
|
8
|
+
export async function findUserById(db, userId) {
|
|
9
|
+
const [found] = await db.select().from(users).where(eq(users.id, userId)).limit(1);
|
|
10
|
+
return found;
|
|
11
|
+
}
|
|
12
|
+
export async function insertUser(db, values) {
|
|
13
|
+
const [created] = await db.insert(users).values(values).returning();
|
|
14
|
+
if (created === undefined) {
|
|
15
|
+
throw new Error(`Inserting user ${values.id} returned no row`);
|
|
16
|
+
}
|
|
17
|
+
return created;
|
|
18
|
+
}
|
|
19
|
+
export async function updateUserPassword(db, userId, passwordHash, now) {
|
|
20
|
+
await db
|
|
21
|
+
.update(users)
|
|
22
|
+
.set({ passwordHash, updatedAt: now })
|
|
23
|
+
.where(eq(users.id, userId));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Writes name and email. Not the password: that one has its own function because
|
|
27
|
+
* it also ends sessions, and the two must not be reachable through one call.
|
|
28
|
+
*/
|
|
29
|
+
export async function updateUserProfile(db, userId, changes, now) {
|
|
30
|
+
const [updated] = await db
|
|
31
|
+
.update(users)
|
|
32
|
+
.set({ ...changes, updatedAt: now })
|
|
33
|
+
.where(eq(users.id, userId))
|
|
34
|
+
.returning();
|
|
35
|
+
return updated;
|
|
36
|
+
}
|
|
37
|
+
export async function findPreferences(db, userId) {
|
|
38
|
+
const [found] = await db
|
|
39
|
+
.select()
|
|
40
|
+
.from(userPreferences)
|
|
41
|
+
.where(eq(userPreferences.userId, userId))
|
|
42
|
+
.limit(1);
|
|
43
|
+
return found;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Inserts the row or replaces it, since the caller always has a complete set of
|
|
47
|
+
* values. Repeating a save writes the same row rather than failing on the
|
|
48
|
+
* primary key.
|
|
49
|
+
*/
|
|
50
|
+
export async function upsertPreferences(db, values) {
|
|
51
|
+
const [saved] = await db
|
|
52
|
+
.insert(userPreferences)
|
|
53
|
+
.values(values)
|
|
54
|
+
.onConflictDoUpdate({ target: userPreferences.userId, set: values })
|
|
55
|
+
.returning();
|
|
56
|
+
if (saved === undefined) {
|
|
57
|
+
throw new Error(`Upserting preferences for ${values.userId} returned no row`);
|
|
58
|
+
}
|
|
59
|
+
return saved;
|
|
60
|
+
}
|
|
61
|
+
export async function insertSession(db, values) {
|
|
62
|
+
const [created] = await db.insert(sessions).values(values).returning();
|
|
63
|
+
if (created === undefined) {
|
|
64
|
+
throw new Error(`Inserting session ${values.id} returned no row`);
|
|
65
|
+
}
|
|
66
|
+
return created;
|
|
67
|
+
}
|
|
68
|
+
/** Only returns sessions that have not expired; an expired row is not a session. */
|
|
69
|
+
export async function findLiveSessionByTokenHash(db, tokenHash, now) {
|
|
70
|
+
const [found] = await db
|
|
71
|
+
.select()
|
|
72
|
+
.from(sessions)
|
|
73
|
+
.where(and(eq(sessions.tokenHash, tokenHash), gt(sessions.expiresAt, now)))
|
|
74
|
+
.limit(1);
|
|
75
|
+
return found;
|
|
76
|
+
}
|
|
77
|
+
export async function listSessionsForUser(db, userId) {
|
|
78
|
+
return db.select().from(sessions).where(eq(sessions.userId, userId)).orderBy(desc(sessions.lastActiveAt));
|
|
79
|
+
}
|
|
80
|
+
export async function touchSession(db, sessionId, now) {
|
|
81
|
+
await db.update(sessions).set({ lastActiveAt: now }).where(eq(sessions.id, sessionId));
|
|
82
|
+
}
|
|
83
|
+
export async function deleteSession(db, userId, sessionId) {
|
|
84
|
+
const deleted = await db
|
|
85
|
+
.delete(sessions)
|
|
86
|
+
.where(and(eq(sessions.id, sessionId), eq(sessions.userId, userId)))
|
|
87
|
+
.returning({ id: sessions.id });
|
|
88
|
+
return deleted.length;
|
|
89
|
+
}
|
|
90
|
+
export async function deleteAllSessionsForUser(db, userId) {
|
|
91
|
+
await db.delete(sessions).where(eq(sessions.userId, userId));
|
|
92
|
+
}
|
|
93
|
+
/** Signs every other device out while leaving the caller where they are. */
|
|
94
|
+
export async function deleteOtherSessionsForUser(db, userId, keepSessionId) {
|
|
95
|
+
await db.delete(sessions).where(and(eq(sessions.userId, userId), ne(sessions.id, keepSessionId)));
|
|
96
|
+
}
|
|
97
|
+
export async function setActiveWorkspace(db, sessionId, workspaceId) {
|
|
98
|
+
await db.update(sessions).set({ activeWorkspaceId: workspaceId }).where(eq(sessions.id, sessionId));
|
|
99
|
+
}
|
|
100
|
+
export async function insertPasswordResetToken(db, values) {
|
|
101
|
+
await db.insert(passwordResetTokens).values(values);
|
|
102
|
+
}
|
|
103
|
+
/** Unused and unexpired. A used or stale token is not a token. */
|
|
104
|
+
export async function findUsablePasswordResetToken(db, tokenHash, now) {
|
|
105
|
+
const [found] = await db
|
|
106
|
+
.select()
|
|
107
|
+
.from(passwordResetTokens)
|
|
108
|
+
.where(and(eq(passwordResetTokens.tokenHash, tokenHash), isNull(passwordResetTokens.usedAt), gt(passwordResetTokens.expiresAt, now)))
|
|
109
|
+
.limit(1);
|
|
110
|
+
return found;
|
|
111
|
+
}
|
|
112
|
+
export async function markPasswordResetTokenUsed(db, id, now) {
|
|
113
|
+
await db
|
|
114
|
+
.update(passwordResetTokens)
|
|
115
|
+
.set({ usedAt: now })
|
|
116
|
+
.where(eq(passwordResetTokens.id, id));
|
|
117
|
+
}
|
|
118
|
+
/** The membership a session's active workspace resolves to, if any. */
|
|
119
|
+
export async function findMembership(db, workspaceId, userId) {
|
|
120
|
+
const [found] = await db
|
|
121
|
+
.select()
|
|
122
|
+
.from(workspaceMembers)
|
|
123
|
+
.where(and(eq(workspaceMembers.workspaceId, workspaceId), eq(workspaceMembers.userId, userId)))
|
|
124
|
+
.limit(1);
|
|
125
|
+
return found;
|
|
126
|
+
}
|
|
127
|
+
/** The workspace a returning user lands in when their session has no active one. */
|
|
128
|
+
export async function findFirstMembership(db, userId) {
|
|
129
|
+
const [found] = await db
|
|
130
|
+
.select()
|
|
131
|
+
.from(workspaceMembers)
|
|
132
|
+
.where(eq(workspaceMembers.userId, userId))
|
|
133
|
+
.orderBy(workspaceMembers.joinedAt)
|
|
134
|
+
.limit(1);
|
|
135
|
+
return found;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot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Ed,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE;SACrB,MAAM,EAAE;SACR,IAAI,CAAC,gBAAgB,CAAC;SACtB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;SAC9F,KAAK,CAAC,CAAC,CAAC,CAAA;IAEX,OAAO,KAAK,CAAA;AACd,CAAC;AAED,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,EAAa,EACb,MAAc;IAEd,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE;SACrB,MAAM,EAAE;SACR,IAAI,CAAC,gBAAgB,CAAC;SACtB,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC1C,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC;SAClC,KAAK,CAAC,CAAC,CAAC,CAAA;IAEX,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Hono } from 'hono';
|
|
2
|
+
import type { CredentialDependencies } from './credentials.ts';
|
|
3
|
+
import type { AuthService } from './service.ts';
|
|
4
|
+
import type { SessionCookieOptions } from './session.ts';
|
|
5
|
+
export interface AuthRoutesDependencies extends CredentialDependencies {
|
|
6
|
+
readonly service: AuthService;
|
|
7
|
+
readonly cookie: SessionCookieOptions;
|
|
8
|
+
}
|
|
9
|
+
export declare function mountAuthRoutes(router: Hono, dependencies: AuthRoutesDependencies): void;
|
|
10
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,MAAM,CAAA;AAQzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAE9D,OAAO,KAAK,EAAe,WAAW,EAA8B,MAAM,cAAc,CAAA;AAExF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAwDxD,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAA;CACtC;AAsDD,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,sBAAsB,GAAG,IAAI,CAwHxF"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { THEME_PREFERENCES } from '@kelpie/schemas';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AppError, toErrorDetails } from '../../lib/errors.js';
|
|
4
|
+
import { timezoneSchema } from '../../lib/timezones.js';
|
|
5
|
+
import { requireSessionActor } from './actor.js';
|
|
6
|
+
import { resolveActorFrom } from './credentials.js';
|
|
7
|
+
import { clearSessionCookie, writeSessionCookie } from './session.js';
|
|
8
|
+
/**
|
|
9
|
+
* Wire shapes for `/v1/auth/*`. Bodies are `snake_case` per `api.md`; the service
|
|
10
|
+
* layer speaks `camelCase`. The mapping happens here and nowhere else.
|
|
11
|
+
*/
|
|
12
|
+
const signUpBody = z.object({
|
|
13
|
+
email: z.string().min(1),
|
|
14
|
+
name: z.string().min(1),
|
|
15
|
+
password: z.string().min(1),
|
|
16
|
+
});
|
|
17
|
+
const logInBody = z.object({
|
|
18
|
+
email: z.string().min(1),
|
|
19
|
+
password: z.string().min(1),
|
|
20
|
+
});
|
|
21
|
+
const resetRequestBody = z.object({
|
|
22
|
+
email: z.string().min(1),
|
|
23
|
+
/** Where the emailed link points. `{token}` is replaced with the reset token. */
|
|
24
|
+
reset_url_template: z.string().min(1).includes('{token}'),
|
|
25
|
+
});
|
|
26
|
+
const resetConfirmBody = z.object({
|
|
27
|
+
token: z.string().min(1),
|
|
28
|
+
password: z.string().min(1),
|
|
29
|
+
});
|
|
30
|
+
const changePasswordBody = z.object({
|
|
31
|
+
current_password: z.string().min(1),
|
|
32
|
+
new_password: z.string().min(1),
|
|
33
|
+
});
|
|
34
|
+
const updateAccountBody = z
|
|
35
|
+
.strictObject({
|
|
36
|
+
name: z.string().min(1),
|
|
37
|
+
email: z.string().min(1),
|
|
38
|
+
current_password: z.string().min(1),
|
|
39
|
+
})
|
|
40
|
+
.partial()
|
|
41
|
+
.refine((body) => body.email === undefined || body.current_password !== undefined, {
|
|
42
|
+
message: 'Current password is required to change email',
|
|
43
|
+
path: ['current_password'],
|
|
44
|
+
});
|
|
45
|
+
const updatePreferencesBody = z
|
|
46
|
+
.strictObject({
|
|
47
|
+
timezone: timezoneSchema,
|
|
48
|
+
theme: z.enum(THEME_PREFERENCES),
|
|
49
|
+
email_digest: z.boolean(),
|
|
50
|
+
mention_emails: z.boolean(),
|
|
51
|
+
product_updates: z.boolean(),
|
|
52
|
+
})
|
|
53
|
+
.partial();
|
|
54
|
+
/** Parses a body into `T` or throws the `422` `api.md` describes. */
|
|
55
|
+
async function readBody(context, schema) {
|
|
56
|
+
const raw = await context.req.json().catch(() => {
|
|
57
|
+
throw new AppError('bad_request', 'Body must be valid JSON');
|
|
58
|
+
});
|
|
59
|
+
const parsed = schema.safeParse(raw);
|
|
60
|
+
if (!parsed.success) {
|
|
61
|
+
throw AppError.validationFailed('Request body is invalid', toErrorDetails(parsed.error.issues));
|
|
62
|
+
}
|
|
63
|
+
return parsed.data;
|
|
64
|
+
}
|
|
65
|
+
/** The device and location shown on the Security page come from the request itself. */
|
|
66
|
+
function describeClient(context) {
|
|
67
|
+
const userAgent = context.req.header('User-Agent');
|
|
68
|
+
return userAgent === undefined ? {} : { device: userAgent };
|
|
69
|
+
}
|
|
70
|
+
function accountResponse(issued) {
|
|
71
|
+
return {
|
|
72
|
+
account: { id: issued.account.id, email: issued.account.email, name: issued.account.name },
|
|
73
|
+
active_workspace_id: issued.activeWorkspaceId,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function accountBody(account) {
|
|
77
|
+
return { id: account.id, email: account.email, name: account.name };
|
|
78
|
+
}
|
|
79
|
+
function preferencesResponse(preferences) {
|
|
80
|
+
return {
|
|
81
|
+
timezone: preferences.timezone,
|
|
82
|
+
theme: preferences.theme,
|
|
83
|
+
email_digest: preferences.emailDigest,
|
|
84
|
+
mention_emails: preferences.mentionEmails,
|
|
85
|
+
product_updates: preferences.productUpdates,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function sessionResponse(session) {
|
|
89
|
+
return {
|
|
90
|
+
id: session.id,
|
|
91
|
+
device: session.device,
|
|
92
|
+
location: session.location,
|
|
93
|
+
last_active_at: session.lastActiveAt.toISOString(),
|
|
94
|
+
current: session.current,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function mountAuthRoutes(router, dependencies) {
|
|
98
|
+
/** Every endpoint here manages a human's own credentials, so a key cannot call them. */
|
|
99
|
+
const requireActor = async (context) => requireSessionActor(await resolveActorFrom(dependencies, context));
|
|
100
|
+
router.post('/auth/signup', async (context) => {
|
|
101
|
+
const body = await readBody(context, signUpBody);
|
|
102
|
+
const issued = await dependencies.service.signUp({ ...body, ...describeClient(context) });
|
|
103
|
+
writeSessionCookie(context, issued.sessionToken, dependencies.cookie);
|
|
104
|
+
return context.json(accountResponse(issued), 201);
|
|
105
|
+
});
|
|
106
|
+
router.post('/auth/login', async (context) => {
|
|
107
|
+
const body = await readBody(context, logInBody);
|
|
108
|
+
const issued = await dependencies.service.logIn({ ...body, ...describeClient(context) });
|
|
109
|
+
writeSessionCookie(context, issued.sessionToken, dependencies.cookie);
|
|
110
|
+
return context.json(accountResponse(issued), 200);
|
|
111
|
+
});
|
|
112
|
+
router.post('/auth/logout', async (context) => {
|
|
113
|
+
await dependencies.service.logOut(await requireActor(context));
|
|
114
|
+
clearSessionCookie(context, dependencies.cookie);
|
|
115
|
+
return context.body(null, 204);
|
|
116
|
+
});
|
|
117
|
+
router.get('/auth/me', async (context) => {
|
|
118
|
+
const actor = await requireActor(context);
|
|
119
|
+
return context.json({
|
|
120
|
+
user_id: actor.userId,
|
|
121
|
+
session_id: actor.sessionId,
|
|
122
|
+
workspace_id: actor.workspaceId,
|
|
123
|
+
role: actor.role,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
/**
|
|
127
|
+
* `/account` rather than `/auth/account`: `/auth/*` is how a browser gets a
|
|
128
|
+
* session, and this is the person that session belongs to. The auth module
|
|
129
|
+
* owns both because it owns the `users` table.
|
|
130
|
+
*/
|
|
131
|
+
router.get('/account', async (context) => context.json(accountBody(await dependencies.service.getAccount(await requireActor(context)))));
|
|
132
|
+
router.patch('/account', async (context) => {
|
|
133
|
+
const body = await readBody(context, updateAccountBody);
|
|
134
|
+
const account = await dependencies.service.updateAccount(await requireActor(context), {
|
|
135
|
+
...(body.name === undefined ? {} : { name: body.name }),
|
|
136
|
+
...(body.email === undefined ? {} : { email: body.email }),
|
|
137
|
+
...(body.current_password === undefined ? {} : { currentPassword: body.current_password }),
|
|
138
|
+
});
|
|
139
|
+
return context.json(accountBody(account));
|
|
140
|
+
});
|
|
141
|
+
router.get('/account/preferences', async (context) => context.json(preferencesResponse(await dependencies.service.getPreferences(await requireActor(context)))));
|
|
142
|
+
router.patch('/account/preferences', async (context) => {
|
|
143
|
+
const body = await readBody(context, updatePreferencesBody);
|
|
144
|
+
const preferences = await dependencies.service.updatePreferences(await requireActor(context), {
|
|
145
|
+
...(body.timezone === undefined ? {} : { timezone: body.timezone }),
|
|
146
|
+
...(body.theme === undefined ? {} : { theme: body.theme }),
|
|
147
|
+
...(body.email_digest === undefined ? {} : { emailDigest: body.email_digest }),
|
|
148
|
+
...(body.mention_emails === undefined ? {} : { mentionEmails: body.mention_emails }),
|
|
149
|
+
...(body.product_updates === undefined ? {} : { productUpdates: body.product_updates }),
|
|
150
|
+
});
|
|
151
|
+
return context.json(preferencesResponse(preferences));
|
|
152
|
+
});
|
|
153
|
+
router.get('/auth/sessions', async (context) => {
|
|
154
|
+
const sessions = await dependencies.service.listSessions(await requireActor(context));
|
|
155
|
+
return context.json({ data: sessions.map(sessionResponse), next_cursor: null });
|
|
156
|
+
});
|
|
157
|
+
router.delete('/auth/sessions/:id', async (context) => {
|
|
158
|
+
await dependencies.service.revokeSession(await requireActor(context), context.req.param('id'));
|
|
159
|
+
return context.body(null, 204);
|
|
160
|
+
});
|
|
161
|
+
router.patch('/auth/password', async (context) => {
|
|
162
|
+
const body = await readBody(context, changePasswordBody);
|
|
163
|
+
await dependencies.service.changePassword(await requireActor(context), body.current_password, body.new_password);
|
|
164
|
+
return context.body(null, 204);
|
|
165
|
+
});
|
|
166
|
+
/**
|
|
167
|
+
* Answers 202 whether or not the address is registered. A different answer
|
|
168
|
+
* would turn this endpoint into an account-existence oracle.
|
|
169
|
+
*/
|
|
170
|
+
router.post('/auth/password-reset', async (context) => {
|
|
171
|
+
const body = await readBody(context, resetRequestBody);
|
|
172
|
+
await dependencies.service.requestPasswordReset(body.email, body.reset_url_template);
|
|
173
|
+
return context.body(null, 202);
|
|
174
|
+
});
|
|
175
|
+
router.post('/auth/password-reset/confirm', async (context) => {
|
|
176
|
+
const body = await readBody(context, resetConfirmBody);
|
|
177
|
+
await dependencies.service.confirmPasswordReset(body.token, body.password);
|
|
178
|
+
return context.body(null, 204);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/modules/auth/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAA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