@raclettejs/core 0.0.4 → 0.1.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/CHANGELOG.md +23 -0
- package/README.md +7 -0
- package/dist/cli.js +4 -4
- package/dist/index.js +4 -4
- package/package.json +2 -2
- package/scripts/find-i18n-keys.cjs +29 -0
- package/services/backend/package.json +1 -3
- package/services/frontend/src/orchestrator/components/chip/UserChip.vue +1 -1
- package/services/frontend/src/orchestrator/components/menu/UserNotifications.vue +4 -2
- package/services/frontend/src/orchestrator/setup/i18n.ts +251 -157
- package/yarn.lock +4 -4
- package/dist/cli.js.map +0 -7
- package/dist/index.js.map +0 -7
- package/services/.DS_Store +0 -0
- package/services/backend/.DS_Store +0 -0
- package/services/backend/.env +0 -5
- package/services/backend/.vscode/launch.json +0 -18
- package/services/backend/dist/src/app.d.ts +0 -9
- package/services/backend/dist/src/app.js +0 -164
- package/services/backend/dist/src/core/backgroundTasks/taskManager.d.ts +0 -12
- package/services/backend/dist/src/core/backgroundTasks/taskManager.js +0 -135
- package/services/backend/dist/src/core/backgroundTasks/taskManagerTypes.d.ts +0 -19
- package/services/backend/dist/src/core/backgroundTasks/taskManagerTypes.js +0 -2
- package/services/backend/dist/src/core/backgroundTasks/toadSchedulerTypes.d.ts +0 -7
- package/services/backend/dist/src/core/backgroundTasks/toadSchedulerTypes.js +0 -1
- package/services/backend/dist/src/core/config/configService.d.ts +0 -38
- package/services/backend/dist/src/core/config/configService.js +0 -98
- package/services/backend/dist/src/core/config/configTypes.d.ts +0 -33
- package/services/backend/dist/src/core/config/configTypes.js +0 -5
- package/services/backend/dist/src/core/contracting/contractRegistrar.d.ts +0 -13
- package/services/backend/dist/src/core/contracting/contractRegistrar.js +0 -83
- package/services/backend/dist/src/core/contracting/contractTypes.d.ts +0 -18
- package/services/backend/dist/src/core/contracting/contractTypes.js +0 -1
- package/services/backend/dist/src/core/crud/crudRegistrar.d.ts +0 -6
- package/services/backend/dist/src/core/crud/crudRegistrar.js +0 -16
- package/services/backend/dist/src/core/crud/crudTypes.d.ts +0 -8
- package/services/backend/dist/src/core/crud/crudTypes.js +0 -1
- package/services/backend/dist/src/core/eventBus/eventBusEventMap.d.ts +0 -65
- package/services/backend/dist/src/core/eventBus/eventBusEventMap.js +0 -64
- package/services/backend/dist/src/core/eventBus/index.d.ts +0 -3
- package/services/backend/dist/src/core/eventBus/index.js +0 -7
- package/services/backend/dist/src/core/events/eventEmitter.d.ts +0 -13
- package/services/backend/dist/src/core/events/eventEmitter.js +0 -120
- package/services/backend/dist/src/core/http/headers.d.ts +0 -3
- package/services/backend/dist/src/core/http/headers.js +0 -22
- package/services/backend/dist/src/core/http/httpService.d.ts +0 -4
- package/services/backend/dist/src/core/http/httpService.js +0 -28
- package/services/backend/dist/src/core/http/httpTypes.d.ts +0 -15
- package/services/backend/dist/src/core/http/httpTypes.js +0 -1
- package/services/backend/dist/src/core/http/request-params.plugin.d.ts +0 -2
- package/services/backend/dist/src/core/http/request-params.plugin.js +0 -34
- package/services/backend/dist/src/core/payload/payloadRegistrar.d.ts +0 -45
- package/services/backend/dist/src/core/payload/payloadRegistrar.js +0 -121
- package/services/backend/dist/src/core/payload/payloadTypes.d.ts +0 -42
- package/services/backend/dist/src/core/payload/payloadTypes.js +0 -1
- package/services/backend/dist/src/core/pluginSystem/configGenerator/generatorTypes.d.ts +0 -49
- package/services/backend/dist/src/core/pluginSystem/configGenerator/generatorTypes.js +0 -1
- package/services/backend/dist/src/core/pluginSystem/configGenerator/index.d.ts +0 -14
- package/services/backend/dist/src/core/pluginSystem/configGenerator/index.js +0 -342
- package/services/backend/dist/src/core/pluginSystem/pluginFastifyInstance.d.ts +0 -3
- package/services/backend/dist/src/core/pluginSystem/pluginFastifyInstance.js +0 -161
- package/services/backend/dist/src/core/pluginSystem/pluginLoader.d.ts +0 -5
- package/services/backend/dist/src/core/pluginSystem/pluginLoader.js +0 -317
- package/services/backend/dist/src/core/pluginSystem/pluginTypes.d.ts +0 -51
- package/services/backend/dist/src/core/pluginSystem/pluginTypes.js +0 -6
- package/services/backend/dist/src/core/sockets/createSystemEventHandlers.d.ts +0 -20
- package/services/backend/dist/src/core/sockets/createSystemEventHandlers.js +0 -74
- package/services/backend/dist/src/core/sockets/index.d.ts +0 -2
- package/services/backend/dist/src/core/sockets/index.js +0 -65
- package/services/backend/dist/src/core/sockets/socketManager.d.ts +0 -3
- package/services/backend/dist/src/core/sockets/socketManager.js +0 -125
- package/services/backend/dist/src/core/sockets/socketTypes.d.ts +0 -32
- package/services/backend/dist/src/core/sockets/socketTypes.js +0 -1
- package/services/backend/dist/src/core/validation/schemaGenerator.d.ts +0 -6
- package/services/backend/dist/src/core/validation/schemaGenerator.js +0 -242
- package/services/backend/dist/src/core/validation/schemaTypes.d.ts +0 -15
- package/services/backend/dist/src/core/validation/schemaTypes.js +0 -1
- package/services/backend/dist/src/core/validation/sharedSchemas.d.ts +0 -8
- package/services/backend/dist/src/core/validation/sharedSchemas.js +0 -7
- package/services/backend/dist/src/corePlugins/raclette__core/client/generated-config.d.ts +0 -304
- package/services/backend/dist/src/corePlugins/raclette__core/client/generated-config.js +0 -359
- package/services/backend/dist/src/corePlugins/raclette__core/client/index.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/client/index.js +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/account.model.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/account.model.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/account.schema.d.ts +0 -36
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/account.schema.js +0 -29
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/account.service.d.ts +0 -74
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/account.service.js +0 -242
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/events/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/events/index.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/helpers/crud.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/helpers/crud.js +0 -9
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/helpers/payload.d.ts +0 -4
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/helpers/payload.js +0 -13
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/index.d.ts +0 -16
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/index.js +0 -48
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/index.js +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.get.d.ts +0 -24
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.get.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.getAll.d.ts +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.getAll.js +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.hardDelete.d.ts +0 -26
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.hardDelete.js +0 -32
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.patch.d.ts +0 -39
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.patch.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.post.d.ts +0 -30
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.post.js +0 -27
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.remove.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/account/routes/route.account.remove.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/composition.model.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/composition.model.js +0 -92
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/composition.schema.d.ts +0 -128
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/composition.schema.js +0 -97
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/composition.service.d.ts +0 -63
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/composition.service.js +0 -212
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/events/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/events/index.js +0 -22
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/helpers/crud.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/helpers/crud.js +0 -10
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/helpers/payload.d.ts +0 -4
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/helpers/payload.js +0 -11
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/index.d.ts +0 -46
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/index.js +0 -51
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/index.js +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.get.d.ts +0 -24
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.get.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.getAll.d.ts +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.getAll.js +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.hardDelete.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.hardDelete.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.patch.d.ts +0 -49
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.patch.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.post.d.ts +0 -40
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.post.js +0 -27
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.remove.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/composition/routes/route.composition.remove.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/events/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/events/index.js +0 -22
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/helpers/crud.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/helpers/crud.js +0 -9
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/helpers/payload.d.ts +0 -4
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/helpers/payload.js +0 -11
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/index.d.ts +0 -16
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/index.js +0 -48
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/interactionLink.model.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/interactionLink.model.js +0 -61
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/interactionLink.schema.d.ts +0 -86
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/interactionLink.schema.js +0 -74
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/interactionLink.service.d.ts +0 -79
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/interactionLink.service.js +0 -272
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/index.js +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.get.d.ts +0 -24
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.get.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.getAll.d.ts +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.getAll.js +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.hardDelete.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.hardDelete.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.patch.d.ts +0 -39
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.patch.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.post.d.ts +0 -30
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.post.js +0 -27
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.remove.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/interactionLink/routes/route.interactionLink.remove.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/events/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/events/index.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/helpers/crud.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/helpers/crud.js +0 -9
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/helpers/payload.d.ts +0 -4
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/helpers/payload.js +0 -13
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/index.d.ts +0 -17
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/index.js +0 -49
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/project.model.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/project.model.js +0 -30
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/project.schema.d.ts +0 -61
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/project.schema.js +0 -65
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/project.service.d.ts +0 -68
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/project.service.js +0 -230
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/index.js +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.get.d.ts +0 -24
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.get.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.getAll.d.ts +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.getAll.js +0 -28
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.hardDelete.d.ts +0 -26
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.hardDelete.js +0 -32
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.patch.d.ts +0 -38
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.patch.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.post.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.post.js +0 -27
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.remove.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/project/routes/route.project.remove.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/events/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/events/index.js +0 -39
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/helpers/crud.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/helpers/crud.js +0 -9
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/helpers/payload.d.ts +0 -4
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/helpers/payload.js +0 -13
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/index.d.ts +0 -17
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/index.js +0 -49
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/index.js +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.get.d.ts +0 -24
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.get.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.getAll.d.ts +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.getAll.js +0 -28
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.hardDelete.d.ts +0 -26
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.hardDelete.js +0 -32
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.patch.d.ts +0 -39
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.patch.js +0 -34
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.post.d.ts +0 -40
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.post.js +0 -35
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.remove.d.ts +0 -26
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/routes/route.tag.remove.js +0 -32
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/tag.model.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/tag.model.js +0 -74
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/tag.schema.d.ts +0 -68
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/tag.schema.js +0 -71
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/tag.service.d.ts +0 -65
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/tag/tag.service.js +0 -232
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/events/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/events/index.js +0 -31
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/helpers/crud.d.ts +0 -2
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/helpers/crud.js +0 -9
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/helpers/payload.d.ts +0 -4
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/helpers/payload.js +0 -11
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/index.d.ts +0 -17
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/index.js +0 -51
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/index.js +0 -15
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.get.d.ts +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.get.js +0 -33
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.getAll.d.ts +0 -25
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.getAll.js +0 -35
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.patch.d.ts +0 -43
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.patch.js +0 -37
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.patchLastProject.d.ts +0 -23
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.patchLastProject.js +0 -29
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.post.d.ts +0 -34
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.post.js +0 -28
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.remove.d.ts +0 -26
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/routes/route.user.remove.js +0 -35
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/user.model.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/user.model.js +0 -145
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/user.schema.d.ts +0 -120
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/user.schema.js +0 -109
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/user.service.d.ts +0 -69
- package/services/backend/dist/src/corePlugins/raclette__core/server/datatypes/user/user.service.js +0 -225
- package/services/backend/dist/src/corePlugins/raclette__core/server/index.d.ts +0 -3
- package/services/backend/dist/src/corePlugins/raclette__core/server/index.js +0 -32
- package/services/backend/dist/src/domains/index.d.ts +0 -3
- package/services/backend/dist/src/domains/index.js +0 -8
- package/services/backend/dist/src/domains/system/index.d.ts +0 -3
- package/services/backend/dist/src/domains/system/index.js +0 -5
- package/services/backend/dist/src/domains/system/routes/index.d.ts +0 -3
- package/services/backend/dist/src/domains/system/routes/index.js +0 -13
- package/services/backend/dist/src/domains/system/routes/route.admin.redis.d.ts +0 -47
- package/services/backend/dist/src/domains/system/routes/route.admin.redis.js +0 -81
- package/services/backend/dist/src/domains/system/routes/route.deploy.d.ts +0 -14
- package/services/backend/dist/src/domains/system/routes/route.deploy.js +0 -20
- package/services/backend/dist/src/domains/system/routes/route.user.checkToken.d.ts +0 -12
- package/services/backend/dist/src/domains/system/routes/route.user.checkToken.js +0 -40
- package/services/backend/dist/src/domains/system/routes/route.user.login.d.ts +0 -44
- package/services/backend/dist/src/domains/system/routes/route.user.login.js +0 -163
- package/services/backend/dist/src/helpers/index.d.ts +0 -11
- package/services/backend/dist/src/helpers/index.js +0 -13
- package/services/backend/dist/src/index.d.ts +0 -3
- package/services/backend/dist/src/index.js +0 -3
- package/services/backend/dist/src/modules/authentication/index.d.ts +0 -4
- package/services/backend/dist/src/modules/authentication/index.js +0 -80
- package/services/backend/dist/src/modules/cache/cacheManager.d.ts +0 -6
- package/services/backend/dist/src/modules/cache/cacheManager.js +0 -131
- package/services/backend/dist/src/modules/cache/cacheTypes.d.ts +0 -102
- package/services/backend/dist/src/modules/cache/cacheTypes.js +0 -1
- package/services/backend/dist/src/modules/cache/providers/redis/redisConfig.d.ts +0 -11
- package/services/backend/dist/src/modules/cache/providers/redis/redisConfig.js +0 -17
- package/services/backend/dist/src/modules/cache/providers/redis/redisConnection.d.ts +0 -4
- package/services/backend/dist/src/modules/cache/providers/redis/redisConnection.js +0 -65
- package/services/backend/dist/src/modules/cache/providers/redis/redisTypes.d.ts +0 -18
- package/services/backend/dist/src/modules/cache/providers/redis/redisTypes.js +0 -1
- package/services/backend/dist/src/modules/database/providers/mongodb/mongoConnection.d.ts +0 -4
- package/services/backend/dist/src/modules/database/providers/mongodb/mongoConnection.js +0 -21
- package/services/backend/dist/src/modules/database/providers/mongodb/service.d.ts +0 -7
- package/services/backend/dist/src/modules/database/providers/mongodb/service.js +0 -1
- package/services/backend/dist/src/server.d.ts +0 -1
- package/services/backend/dist/src/server.js +0 -98
- package/services/backend/dist/src/shared/helper/mongoHelper.d.ts +0 -3
- package/services/backend/dist/src/shared/helper/mongoHelper.js +0 -59
- package/services/backend/dist/src/shared/helper/pluginHelper.d.ts +0 -19
- package/services/backend/dist/src/shared/helper/pluginHelper.js +0 -33
- package/services/backend/dist/src/shared/schemas/core/Account.schema.d.ts +0 -63
- package/services/backend/dist/src/shared/schemas/core/Account.schema.js +0 -74
- package/services/backend/dist/src/shared/schemas/core/Composition.schema.d.ts +0 -103
- package/services/backend/dist/src/shared/schemas/core/Composition.schema.js +0 -132
- package/services/backend/dist/src/shared/schemas/core/CompositionCreate.schema.d.ts +0 -82
- package/services/backend/dist/src/shared/schemas/core/CompositionCreate.schema.js +0 -105
- package/services/backend/dist/src/shared/schemas/core/CompositionUpdate.schema.d.ts +0 -78
- package/services/backend/dist/src/shared/schemas/core/CompositionUpdate.schema.js +0 -95
- package/services/backend/dist/src/shared/schemas/core/InteractionLink.schema.d.ts +0 -84
- package/services/backend/dist/src/shared/schemas/core/InteractionLink.schema.js +0 -97
- package/services/backend/dist/src/shared/schemas/core/InteractionLinkCreate.schema.d.ts +0 -63
- package/services/backend/dist/src/shared/schemas/core/InteractionLinkCreate.schema.js +0 -70
- package/services/backend/dist/src/shared/schemas/core/InteractionLinkUpdate.schema.d.ts +0 -63
- package/services/backend/dist/src/shared/schemas/core/InteractionLinkUpdate.schema.js +0 -70
- package/services/backend/dist/src/shared/schemas/core/Project.schema.d.ts +0 -53
- package/services/backend/dist/src/shared/schemas/core/Project.schema.js +0 -58
- package/services/backend/dist/src/shared/schemas/core/ProjectCreate.schema.d.ts +0 -41
- package/services/backend/dist/src/shared/schemas/core/ProjectCreate.schema.js +0 -41
- package/services/backend/dist/src/shared/schemas/core/ProjectUpdate.schema.d.ts +0 -38
- package/services/backend/dist/src/shared/schemas/core/ProjectUpdate.schema.js +0 -38
- package/services/backend/dist/src/shared/schemas/core/Tag.schema.d.ts +0 -68
- package/services/backend/dist/src/shared/schemas/core/Tag.schema.js +0 -81
- package/services/backend/dist/src/shared/schemas/core/TagCreate.schema.d.ts +0 -52
- package/services/backend/dist/src/shared/schemas/core/TagCreate.schema.js +0 -60
- package/services/backend/dist/src/shared/schemas/core/TagUpdate.schema.d.ts +0 -47
- package/services/backend/dist/src/shared/schemas/core/TagUpdate.schema.js +0 -55
- package/services/backend/dist/src/shared/schemas/core/Trigger.schema.d.ts +0 -25
- package/services/backend/dist/src/shared/schemas/core/Trigger.schema.js +0 -27
- package/services/backend/dist/src/shared/schemas/core/User.schema.d.ts +0 -161
- package/services/backend/dist/src/shared/schemas/core/User.schema.js +0 -185
- package/services/backend/dist/src/shared/schemas/core/UserCreate.schema.d.ts +0 -59
- package/services/backend/dist/src/shared/schemas/core/UserCreate.schema.js +0 -67
- package/services/backend/dist/src/shared/schemas/core/UserUpdate.schema.d.ts +0 -52
- package/services/backend/dist/src/shared/schemas/core/UserUpdate.schema.js +0 -52
- package/services/backend/dist/src/shared/schemas/core/Widget.schema.d.ts +0 -25
- package/services/backend/dist/src/shared/schemas/core/Widget.schema.js +0 -29
- package/services/backend/dist/src/shared/schemas/core/WidgetLayout.schema.d.ts +0 -34
- package/services/backend/dist/src/shared/schemas/core/WidgetLayout.schema.js +0 -41
- package/services/backend/dist/src/shared/types/core/Account.types.d.ts +0 -19
- package/services/backend/dist/src/shared/types/core/Account.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/Composition.types.d.ts +0 -31
- package/services/backend/dist/src/shared/types/core/Composition.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/CompositionCreate.types.d.ts +0 -25
- package/services/backend/dist/src/shared/types/core/CompositionCreate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/CompositionUpdate.types.d.ts +0 -25
- package/services/backend/dist/src/shared/types/core/CompositionUpdate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/InteractionLink.types.d.ts +0 -25
- package/services/backend/dist/src/shared/types/core/InteractionLink.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/InteractionLinkCreate.types.d.ts +0 -19
- package/services/backend/dist/src/shared/types/core/InteractionLinkCreate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/InteractionLinkUpdate.types.d.ts +0 -19
- package/services/backend/dist/src/shared/types/core/InteractionLinkUpdate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/Project.types.d.ts +0 -18
- package/services/backend/dist/src/shared/types/core/Project.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/ProjectCreate.types.d.ts +0 -15
- package/services/backend/dist/src/shared/types/core/ProjectCreate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/ProjectUpdate.types.d.ts +0 -15
- package/services/backend/dist/src/shared/types/core/ProjectUpdate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/Tag.types.d.ts +0 -21
- package/services/backend/dist/src/shared/types/core/Tag.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/TagCreate.types.d.ts +0 -17
- package/services/backend/dist/src/shared/types/core/TagCreate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/TagUpdate.types.d.ts +0 -17
- package/services/backend/dist/src/shared/types/core/TagUpdate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/Trigger.types.d.ts +0 -11
- package/services/backend/dist/src/shared/types/core/Trigger.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/User.types.d.ts +0 -50
- package/services/backend/dist/src/shared/types/core/User.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/UserCreate.types.d.ts +0 -22
- package/services/backend/dist/src/shared/types/core/UserCreate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/UserUpdate.types.d.ts +0 -21
- package/services/backend/dist/src/shared/types/core/UserUpdate.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/Widget.types.d.ts +0 -14
- package/services/backend/dist/src/shared/types/core/Widget.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/WidgetLayout.types.d.ts +0 -17
- package/services/backend/dist/src/shared/types/core/WidgetLayout.types.js +0 -8
- package/services/backend/dist/src/shared/types/core/index.d.ts +0 -26
- package/services/backend/dist/src/shared/types/core/index.js +0 -8
- package/services/backend/dist/src/shared/types/dataTypes/index.d.ts +0 -5
- package/services/backend/dist/src/shared/types/dataTypes/index.js +0 -6
- package/services/backend/dist/src/shared/types/dataTypes/tags.d.ts +0 -12
- package/services/backend/dist/src/shared/types/dataTypes/tags.js +0 -17
- package/services/backend/dist/src/shared/types/global/api.d.ts +0 -10
- package/services/backend/dist/src/shared/types/global/api.js +0 -1
- package/services/backend/dist/src/shared/types/global/search.d.ts +0 -7
- package/services/backend/dist/src/shared/types/global/search.js +0 -13
- package/services/backend/dist/src/shared/types/index.d.ts +0 -9
- package/services/backend/dist/src/shared/types/index.js +0 -8
- package/services/backend/dist/src/shared/types/plugins/index.d.ts +0 -8
- package/services/backend/dist/src/shared/types/plugins/index.js +0 -8
- package/services/backend/dist/src/types/index.d.ts +0 -12
- package/services/backend/dist/src/types/index.js +0 -12
- package/services/backend/dist/src/utils/errors.d.ts +0 -16
- package/services/backend/dist/src/utils/errors.js +0 -28
- package/services/backend/dist/src/utils/index.d.ts +0 -2
- package/services/backend/dist/src/utils/index.js +0 -2
- package/services/backend/dist/src/utils/request.utils.d.ts +0 -8
- package/services/backend/dist/src/utils/request.utils.js +0 -12
- package/services/backend/dist/types/index.d.ts +0 -3
- package/services/backend/dist/types/index.js +0 -2
- package/services/backend/src/.DS_Store +0 -0
- package/services/backend/src/core/.DS_Store +0 -0
- package/services/backend/src/core/pluginSystem/.DS_Store +0 -0
- package/services/backend/src/domains/.DS_Store +0 -0
- package/services/backend/src/domains/system/.DS_Store +0 -0
- package/services/backend/src/ssh-keys/krake +0 -8
- package/services/backend/src/ssh-keys/krake.pub +0 -1
- package/services/frontend/.DS_Store +0 -0
- package/services/frontend/src/.DS_Store +0 -0
- package/services/frontend/src/core/.DS_Store +0 -0
- package/services/frontend/src/core/lib/.DS_Store +0 -0
- package/services/frontend/src/orchestrator/.DS_Store +0 -0
- package/services/frontend/src/orchestrator/assets/fonts/.DS_Store +0 -0
- package/services/frontend/src/orchestrator/assets/styles/.DS_Store +0 -0
- package/services/frontend/src/orchestrator/components/.DS_Store +0 -0
- package/services/frontend/src/orchestrator/components/utils/.DS_Store +0 -0
- package/services/frontend/src/orchestrator/composables/.DS_Store +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import registerRoutes from "./routes/index.js";
|
|
2
|
-
import { createModels } from "./interactionLink.model.js";
|
|
3
|
-
import { createInteractionLinkService } from "./interactionLink.service.js";
|
|
4
|
-
import { registerCrud } from "./helpers/crud.js";
|
|
5
|
-
import { registerPayload } from "./helpers/payload.js";
|
|
6
|
-
import { registerSchemas } from "./interactionLink.schema.js";
|
|
7
|
-
const registerInteractionLink = async (fastify) => {
|
|
8
|
-
/*
|
|
9
|
-
* ---------------------------------------------------------------------
|
|
10
|
-
* CREATE AND REGISTER ALL YOUR MODELS
|
|
11
|
-
* ---------------------------------------------------------------------
|
|
12
|
-
*/
|
|
13
|
-
const interactionLinkModel = createModels(fastify);
|
|
14
|
-
// create and pass in the model to your service
|
|
15
|
-
const interactionLinkService = createInteractionLinkService(interactionLinkModel);
|
|
16
|
-
// decorate the service to the instance, so we can easily call it everywhere
|
|
17
|
-
fastify.custom.interactionLinkService = interactionLinkService;
|
|
18
|
-
/*
|
|
19
|
-
* ---------------------------------------------------------------------
|
|
20
|
-
* REGISTER ALL YOUR ROUTES
|
|
21
|
-
* ---------------------------------------------------------------------
|
|
22
|
-
*/
|
|
23
|
-
try {
|
|
24
|
-
await fastify.register((instance) => registerRoutes(instance));
|
|
25
|
-
}
|
|
26
|
-
catch (error) {
|
|
27
|
-
fastify.log.error(`Failed to register routes.`, error);
|
|
28
|
-
throw error; // Let the application handle the error
|
|
29
|
-
}
|
|
30
|
-
registerPayload(fastify);
|
|
31
|
-
registerCrud(fastify);
|
|
32
|
-
registerSchemas(fastify);
|
|
33
|
-
return {
|
|
34
|
-
interactionLink: {
|
|
35
|
-
operations: {
|
|
36
|
-
readAll: interactionLinkService._readAllInteractionLinks.bind(interactionLinkService),
|
|
37
|
-
read: interactionLinkService._readInteractionLink.bind(interactionLinkService),
|
|
38
|
-
create: interactionLinkService._createInteractionLink.bind(interactionLinkService),
|
|
39
|
-
delete: interactionLinkService._removeInteractionLink.bind(interactionLinkService),
|
|
40
|
-
},
|
|
41
|
-
keywords: ["interaction", "link", "connection", "relation"],
|
|
42
|
-
metadata: {
|
|
43
|
-
description: "Links between interactive elements",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default registerInteractionLink;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
const { Schema } = mongoose;
|
|
4
|
-
export const MODEL_BASENAME = "interactionLink";
|
|
5
|
-
const triggerSchema = new Schema({
|
|
6
|
-
type: {
|
|
7
|
-
type: String,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
settings: {
|
|
11
|
-
type: Schema.Types.Mixed,
|
|
12
|
-
},
|
|
13
|
-
}, { _id: false });
|
|
14
|
-
const interactionLinkSchema = new Schema({
|
|
15
|
-
_id: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: () => uuidv4(),
|
|
18
|
-
required: true,
|
|
19
|
-
},
|
|
20
|
-
composition: {
|
|
21
|
-
type: Schema.Types.String,
|
|
22
|
-
ref: "raclette__core-composition",
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
slotType: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: true,
|
|
28
|
-
},
|
|
29
|
-
triggers: {
|
|
30
|
-
type: [triggerSchema],
|
|
31
|
-
default: [],
|
|
32
|
-
},
|
|
33
|
-
queryParameters: {
|
|
34
|
-
type: Schema.Types.Array,
|
|
35
|
-
of: Schema.Types.String,
|
|
36
|
-
},
|
|
37
|
-
description: {
|
|
38
|
-
type: String,
|
|
39
|
-
},
|
|
40
|
-
tags: [
|
|
41
|
-
{
|
|
42
|
-
type: Schema.Types.String,
|
|
43
|
-
ref: "raclette__core-tag",
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
author: {
|
|
47
|
-
type: Schema.Types.String,
|
|
48
|
-
ref: "raclette__core-user",
|
|
49
|
-
required: true,
|
|
50
|
-
},
|
|
51
|
-
lastEditor: {
|
|
52
|
-
type: Schema.Types.String,
|
|
53
|
-
ref: "raclette__core-user",
|
|
54
|
-
required: true,
|
|
55
|
-
},
|
|
56
|
-
isLandingPage: { type: Boolean, default: false },
|
|
57
|
-
isDeleted: { type: Boolean, default: false },
|
|
58
|
-
}, { timestamps: true });
|
|
59
|
-
export const createModels = (fastify) => {
|
|
60
|
-
return fastify.createModel(MODEL_BASENAME, interactionLinkSchema);
|
|
61
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import type { Document } from "mongoose";
|
|
3
|
-
import { PluginFastifyInstance } from "../../../../../../types/index.js";
|
|
4
|
-
/**
|
|
5
|
-
* Trigger Schema
|
|
6
|
-
*/
|
|
7
|
-
export declare const triggerSchema: import("@sinclair/typebox").TObject<{
|
|
8
|
-
type: import("@sinclair/typebox").TString;
|
|
9
|
-
settings: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* Full InteractionLink Schema - Used for response serialization and database model
|
|
13
|
-
*/
|
|
14
|
-
export declare const interactionLinkSchema: import("@sinclair/typebox").TObject<{
|
|
15
|
-
author: import("@sinclair/typebox").TString;
|
|
16
|
-
lastEditor: import("@sinclair/typebox").TString;
|
|
17
|
-
createdAt: import("@sinclair/typebox").TString;
|
|
18
|
-
updatedAt: import("@sinclair/typebox").TString;
|
|
19
|
-
isDeleted: import("@sinclair/typebox").TBoolean;
|
|
20
|
-
composition: import("@sinclair/typebox").TString;
|
|
21
|
-
slotType: import("@sinclair/typebox").TString;
|
|
22
|
-
triggers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
23
|
-
type: import("@sinclair/typebox").TString;
|
|
24
|
-
settings: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
|
|
25
|
-
}>>;
|
|
26
|
-
queryParameters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
27
|
-
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
28
|
-
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
29
|
-
isLandingPage: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
30
|
-
_id: import("@sinclair/typebox").TString;
|
|
31
|
-
}>;
|
|
32
|
-
/**
|
|
33
|
-
* InteractionLink Create Schema - For POST operations
|
|
34
|
-
*/
|
|
35
|
-
export declare const interactionLinkCreateSchema: import("@sinclair/typebox").TObject<{
|
|
36
|
-
composition: import("@sinclair/typebox").TString;
|
|
37
|
-
slotType: import("@sinclair/typebox").TString;
|
|
38
|
-
triggers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
39
|
-
type: import("@sinclair/typebox").TString;
|
|
40
|
-
settings: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
|
|
41
|
-
}>>;
|
|
42
|
-
queryParameters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
43
|
-
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
44
|
-
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
45
|
-
isLandingPage: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
46
|
-
}>;
|
|
47
|
-
/**
|
|
48
|
-
* InteractionLink Update Schema - For PATCH operations
|
|
49
|
-
*/
|
|
50
|
-
export declare const interactionLinkUpdateSchema: import("@sinclair/typebox").TObject<{
|
|
51
|
-
composition: import("@sinclair/typebox").TString;
|
|
52
|
-
slotType: import("@sinclair/typebox").TString;
|
|
53
|
-
triggers: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
54
|
-
type: import("@sinclair/typebox").TString;
|
|
55
|
-
settings: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>>;
|
|
56
|
-
}>>;
|
|
57
|
-
queryParameters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
58
|
-
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
59
|
-
tags: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
60
|
-
isLandingPage: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
61
|
-
}>;
|
|
62
|
-
/**
|
|
63
|
-
* Type Utilities
|
|
64
|
-
*/
|
|
65
|
-
type DateTimeFields = {
|
|
66
|
-
createdAt: Date;
|
|
67
|
-
updatedAt: Date;
|
|
68
|
-
};
|
|
69
|
-
type RawTrigger = Static<typeof triggerSchema>;
|
|
70
|
-
export type Trigger = RawTrigger;
|
|
71
|
-
type RawInteractionLink = Static<typeof interactionLinkSchema>;
|
|
72
|
-
export type InteractionLink = Omit<RawInteractionLink, keyof DateTimeFields> & DateTimeFields;
|
|
73
|
-
export interface InteractionLinkDoc extends Document<string, unknown, InteractionLink>, InteractionLink {
|
|
74
|
-
_id: string;
|
|
75
|
-
}
|
|
76
|
-
export type AnyInteractionLink = InteractionLink | InteractionLinkDoc;
|
|
77
|
-
export { interactionLinkSchema as default };
|
|
78
|
-
/**
|
|
79
|
-
* Types for create and update operations
|
|
80
|
-
*/
|
|
81
|
-
export type InteractionLinkCreate = Static<typeof interactionLinkCreateSchema>;
|
|
82
|
-
export type InteractionLinkUpdate = Static<typeof interactionLinkUpdateSchema>;
|
|
83
|
-
/**
|
|
84
|
-
* Register Schema/Type Generation for Shared Folder
|
|
85
|
-
*/
|
|
86
|
-
export declare const registerSchemas: (fastify: PluginFastifyInstance) => void;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
/**
|
|
3
|
-
* Trigger Schema
|
|
4
|
-
*/
|
|
5
|
-
export const triggerSchema = Type.Object({
|
|
6
|
-
type: Type.String(),
|
|
7
|
-
settings: Type.Optional(Type.Record(Type.String(), Type.Any())),
|
|
8
|
-
}, {
|
|
9
|
-
$id: "#trigger/base",
|
|
10
|
-
title: "core/trigger",
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Base InteractionLink Schema - Fields common to all operations
|
|
14
|
-
*/
|
|
15
|
-
const baseInteractionLinkSchema = {
|
|
16
|
-
composition: Type.String(),
|
|
17
|
-
slotType: Type.String(),
|
|
18
|
-
triggers: Type.Array(triggerSchema, { default: [] }),
|
|
19
|
-
queryParameters: Type.Optional(Type.Array(Type.String())),
|
|
20
|
-
description: Type.Optional(Type.String()),
|
|
21
|
-
tags: Type.Array(Type.String(), { default: [] }),
|
|
22
|
-
isLandingPage: Type.Optional(Type.Boolean({ default: false })),
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Full InteractionLink Schema - Used for response serialization and database model
|
|
26
|
-
*/
|
|
27
|
-
export const interactionLinkSchema = Type.Object({
|
|
28
|
-
_id: Type.String(),
|
|
29
|
-
...baseInteractionLinkSchema,
|
|
30
|
-
author: Type.String(),
|
|
31
|
-
lastEditor: Type.String(),
|
|
32
|
-
createdAt: Type.String({ format: "date-time" }),
|
|
33
|
-
updatedAt: Type.String({ format: "date-time" }),
|
|
34
|
-
isDeleted: Type.Boolean({ default: false }),
|
|
35
|
-
}, {
|
|
36
|
-
$id: "#interactionLink/base",
|
|
37
|
-
title: "core/interactionLink",
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* InteractionLink Create Schema - For POST operations
|
|
41
|
-
*/
|
|
42
|
-
export const interactionLinkCreateSchema = Type.Object(baseInteractionLinkSchema, {
|
|
43
|
-
$id: "#interactionLink/create",
|
|
44
|
-
title: "core/interactionLink-create",
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* InteractionLink Update Schema - For PATCH operations
|
|
48
|
-
*/
|
|
49
|
-
export const interactionLinkUpdateSchema = Type.Object(baseInteractionLinkSchema, {
|
|
50
|
-
$id: "#interactionLink/update",
|
|
51
|
-
title: "core/interactionLink-update",
|
|
52
|
-
});
|
|
53
|
-
export { interactionLinkSchema as default };
|
|
54
|
-
/**
|
|
55
|
-
* Register Schema/Type Generation for Shared Folder
|
|
56
|
-
*/
|
|
57
|
-
export const registerSchemas = (fastify) => {
|
|
58
|
-
fastify.registerSchema({
|
|
59
|
-
schema: interactionLinkSchema,
|
|
60
|
-
name: "InteractionLink",
|
|
61
|
-
});
|
|
62
|
-
fastify.registerSchema({
|
|
63
|
-
schema: interactionLinkCreateSchema,
|
|
64
|
-
name: "InteractionLinkCreate",
|
|
65
|
-
});
|
|
66
|
-
fastify.registerSchema({
|
|
67
|
-
schema: interactionLinkUpdateSchema,
|
|
68
|
-
name: "InteractionLinkUpdate",
|
|
69
|
-
});
|
|
70
|
-
fastify.registerSchema({
|
|
71
|
-
schema: triggerSchema,
|
|
72
|
-
name: "Trigger",
|
|
73
|
-
});
|
|
74
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { InteractionLink as InteractionLinkType } from "./interactionLink.schema.js";
|
|
2
|
-
import type { ClientPayload, ClientPayloadRequestData } from "../../../../../core/payload/payloadTypes.js";
|
|
3
|
-
import { PluginFastifyInstance } from "../../../../../../types/index.js";
|
|
4
|
-
import { Model } from "mongoose";
|
|
5
|
-
export type InteractionLinkBody = Partial<Omit<InteractionLinkType, "_id">> & {
|
|
6
|
-
_id?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class InteractionLinkService {
|
|
9
|
-
private interactionLinkModel;
|
|
10
|
-
constructor(model: Model<InteractionLinkType>);
|
|
11
|
-
/**
|
|
12
|
-
* Core function to create an interaction link (returns raw data)
|
|
13
|
-
*/
|
|
14
|
-
_createInteractionLink(fastify: PluginFastifyInstance, interactionLinkBody: InteractionLinkBody, userId: string): Promise<InteractionLinkType>;
|
|
15
|
-
/**
|
|
16
|
-
* Create a new interaction link with payload wrapping and event emission
|
|
17
|
-
*/
|
|
18
|
-
createInteractionLink(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, interactionLinkBody: InteractionLinkBody, userId: string): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
19
|
-
/**
|
|
20
|
-
* Core function to get all interaction links (returns raw data)
|
|
21
|
-
*/
|
|
22
|
-
_readAllInteractionLinks(fastify: PluginFastifyInstance, filters?: Record<string, any>): Promise<InteractionLinkType[]>;
|
|
23
|
-
/**
|
|
24
|
-
* Get all interaction links with payload wrapping
|
|
25
|
-
*/
|
|
26
|
-
getAllInteractionLinks(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, filters?: Record<string, any>): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
27
|
-
/**
|
|
28
|
-
* Core function to get interaction links by composition ID (returns raw data)
|
|
29
|
-
*/
|
|
30
|
-
_readInteractionLinksByComposition(fastify: PluginFastifyInstance, compositionId: string): Promise<InteractionLinkType[]>;
|
|
31
|
-
/**
|
|
32
|
-
* Get interaction links by composition ID with payload wrapping
|
|
33
|
-
*/
|
|
34
|
-
readInteractionLinksByComposition(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, compositionId: string): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
35
|
-
/**
|
|
36
|
-
* Core function to get a specific interaction link (returns raw data)
|
|
37
|
-
*/
|
|
38
|
-
_readInteractionLink(fastify: PluginFastifyInstance, id: string): Promise<InteractionLinkType>;
|
|
39
|
-
/**
|
|
40
|
-
* Get a specific interaction link with payload wrapping
|
|
41
|
-
*/
|
|
42
|
-
readInteractionLink(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, id: string): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
43
|
-
/**
|
|
44
|
-
* Core function to update an interaction link (returns raw data)
|
|
45
|
-
*/
|
|
46
|
-
_updateInteractionLink(fastify: PluginFastifyInstance, id: string, interactionLinkBody: InteractionLinkBody, userId: string | undefined): Promise<{
|
|
47
|
-
updated: InteractionLinkType;
|
|
48
|
-
original: InteractionLinkType;
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Update an interaction link with payload wrapping and event emission
|
|
52
|
-
*/
|
|
53
|
-
updateInteractionLink(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, id: string, interactionLinkBody: InteractionLinkBody): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
54
|
-
/**
|
|
55
|
-
* Core function to soft delete an interaction link (returns raw data)
|
|
56
|
-
*/
|
|
57
|
-
_removeInteractionLink(fastify: PluginFastifyInstance, id: string): Promise<InteractionLinkType>;
|
|
58
|
-
/**
|
|
59
|
-
* Soft delete an interaction link with payload wrapping and event emission
|
|
60
|
-
*/
|
|
61
|
-
removeInteractionLink(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, id: string): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
62
|
-
/**
|
|
63
|
-
* Core function to hard delete an interaction link (returns raw data)
|
|
64
|
-
*/
|
|
65
|
-
_hardDeleteInteractionLink(fastify: PluginFastifyInstance, id: string): Promise<InteractionLinkType>;
|
|
66
|
-
/**
|
|
67
|
-
* Hard delete an interaction link with payload wrapping and event emission
|
|
68
|
-
*/
|
|
69
|
-
hardDeleteInteractionLink(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, id: string): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
70
|
-
/**
|
|
71
|
-
* Core function to get interaction links by trigger type and identifier (returns raw data)
|
|
72
|
-
*/
|
|
73
|
-
_readInteractionLinksByTrigger(fastify: PluginFastifyInstance, triggerType: string, identifier: string): Promise<InteractionLinkType[]>;
|
|
74
|
-
/**
|
|
75
|
-
* Get interaction links by trigger type and identifier with payload wrapping
|
|
76
|
-
*/
|
|
77
|
-
readInteractionLinksByTrigger(fastify: PluginFastifyInstance, requestData: ClientPayloadRequestData, triggerType: string, identifier: string): Promise<ClientPayload<InteractionLinkType[]>>;
|
|
78
|
-
}
|
|
79
|
-
export declare const createInteractionLinkService: (model: Model<InteractionLinkType>) => InteractionLinkService;
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { v4 as uuidv4, validate } from "uuid";
|
|
2
|
-
import { createInteractionLinkPayload } from "./helpers/payload.js";
|
|
3
|
-
// InteractionLink Service class
|
|
4
|
-
export class InteractionLinkService {
|
|
5
|
-
interactionLinkModel;
|
|
6
|
-
constructor(model) {
|
|
7
|
-
this.interactionLinkModel = model;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Core function to create an interaction link (returns raw data)
|
|
11
|
-
*/
|
|
12
|
-
async _createInteractionLink(fastify, interactionLinkBody, userId) {
|
|
13
|
-
try {
|
|
14
|
-
if (interactionLinkBody._id) {
|
|
15
|
-
const uuidValid = validate(interactionLinkBody._id);
|
|
16
|
-
if (!uuidValid) {
|
|
17
|
-
throw new Error("Invalid ID - not a valid uuid v4");
|
|
18
|
-
}
|
|
19
|
-
const duplicate = await this.interactionLinkModel.findOne({
|
|
20
|
-
_id: interactionLinkBody._id,
|
|
21
|
-
});
|
|
22
|
-
if (duplicate) {
|
|
23
|
-
throw new Error("An entry with this id already exists");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
interactionLinkBody._id = uuidv4();
|
|
28
|
-
}
|
|
29
|
-
const interactionLink = new this.interactionLinkModel({
|
|
30
|
-
...interactionLinkBody,
|
|
31
|
-
author: userId,
|
|
32
|
-
lastEditor: userId,
|
|
33
|
-
});
|
|
34
|
-
await interactionLink.save();
|
|
35
|
-
fastify.log.info(`[API] Created interaction link #${interactionLink.id}`);
|
|
36
|
-
return interactionLink.toObject
|
|
37
|
-
? interactionLink.toObject()
|
|
38
|
-
: interactionLink;
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
fastify.log.error(error.message);
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Create a new interaction link with payload wrapping and event emission
|
|
47
|
-
*/
|
|
48
|
-
async createInteractionLink(fastify, requestData, interactionLinkBody, userId) {
|
|
49
|
-
const interactionLink = await this._createInteractionLink(fastify, interactionLinkBody, userId);
|
|
50
|
-
const payload = await createInteractionLinkPayload(fastify, [interactionLink], requestData);
|
|
51
|
-
fastify.emit("interactionLinkCreated", payload);
|
|
52
|
-
return payload;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Core function to get all interaction links (returns raw data)
|
|
56
|
-
*/
|
|
57
|
-
async _readAllInteractionLinks(fastify, filters = {}) {
|
|
58
|
-
try {
|
|
59
|
-
return await this.interactionLinkModel
|
|
60
|
-
.find({
|
|
61
|
-
isDeleted: false,
|
|
62
|
-
...filters,
|
|
63
|
-
})
|
|
64
|
-
.lean();
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
fastify.log.error(error.message);
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Get all interaction links with payload wrapping
|
|
73
|
-
*/
|
|
74
|
-
async getAllInteractionLinks(fastify, requestData, filters = {}) {
|
|
75
|
-
const interactionLinks = await this._readAllInteractionLinks(fastify, filters);
|
|
76
|
-
return createInteractionLinkPayload(fastify, interactionLinks, requestData);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Core function to get interaction links by composition ID (returns raw data)
|
|
80
|
-
*/
|
|
81
|
-
async _readInteractionLinksByComposition(fastify, compositionId) {
|
|
82
|
-
try {
|
|
83
|
-
return await this.interactionLinkModel
|
|
84
|
-
.find({
|
|
85
|
-
composition: compositionId,
|
|
86
|
-
isDeleted: false,
|
|
87
|
-
})
|
|
88
|
-
.lean();
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
fastify.log.error(error.message);
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Get interaction links by composition ID with payload wrapping
|
|
97
|
-
*/
|
|
98
|
-
async readInteractionLinksByComposition(fastify, requestData, compositionId) {
|
|
99
|
-
const interactionLinks = await this._readInteractionLinksByComposition(fastify, compositionId);
|
|
100
|
-
return createInteractionLinkPayload(fastify, interactionLinks, requestData);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Core function to get a specific interaction link (returns raw data)
|
|
104
|
-
*/
|
|
105
|
-
async _readInteractionLink(fastify, id) {
|
|
106
|
-
try {
|
|
107
|
-
const interactionLink = await this.interactionLinkModel
|
|
108
|
-
.findOne({ _id: id })
|
|
109
|
-
.lean();
|
|
110
|
-
if (!interactionLink) {
|
|
111
|
-
throw new Error(`InteractionLink with ID ${id} not found`);
|
|
112
|
-
}
|
|
113
|
-
return interactionLink;
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
fastify.log.error(error.message);
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Get a specific interaction link with payload wrapping
|
|
122
|
-
*/
|
|
123
|
-
async readInteractionLink(fastify, requestData, id) {
|
|
124
|
-
const interactionLink = await this._readInteractionLink(fastify, id);
|
|
125
|
-
return createInteractionLinkPayload(fastify, [interactionLink], requestData);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Core function to update an interaction link (returns raw data)
|
|
129
|
-
*/
|
|
130
|
-
async _updateInteractionLink(fastify, id, interactionLinkBody, userId) {
|
|
131
|
-
try {
|
|
132
|
-
const originalInteractionLink = await this.interactionLinkModel.findOne({
|
|
133
|
-
_id: id,
|
|
134
|
-
});
|
|
135
|
-
if (!originalInteractionLink) {
|
|
136
|
-
throw new Error(`InteractionLink with ID ${id} not found`);
|
|
137
|
-
}
|
|
138
|
-
// Remove protected fields
|
|
139
|
-
delete interactionLinkBody._id;
|
|
140
|
-
if (userId) {
|
|
141
|
-
interactionLinkBody.lastEditor = userId;
|
|
142
|
-
}
|
|
143
|
-
const updatedInteractionLink = await this.interactionLinkModel
|
|
144
|
-
.findOneAndUpdate({ _id: id }, {
|
|
145
|
-
...interactionLinkBody,
|
|
146
|
-
}, { new: true })
|
|
147
|
-
.lean();
|
|
148
|
-
if (!updatedInteractionLink) {
|
|
149
|
-
throw new Error(`Failed to update interaction link with ID ${id}`);
|
|
150
|
-
}
|
|
151
|
-
fastify.log.info(`[API] Updated interaction link #${updatedInteractionLink._id}`);
|
|
152
|
-
return {
|
|
153
|
-
updated: updatedInteractionLink,
|
|
154
|
-
original: originalInteractionLink.toObject
|
|
155
|
-
? originalInteractionLink.toObject()
|
|
156
|
-
: originalInteractionLink,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
catch (error) {
|
|
160
|
-
fastify.log.error(error.message);
|
|
161
|
-
throw error;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Update an interaction link with payload wrapping and event emission
|
|
166
|
-
*/
|
|
167
|
-
async updateInteractionLink(fastify, requestData, id, interactionLinkBody) {
|
|
168
|
-
const { updated, original } = await this._updateInteractionLink(fastify, id, interactionLinkBody, requestData.userId || "");
|
|
169
|
-
const payload = await createInteractionLinkPayload(fastify, [updated], requestData);
|
|
170
|
-
payload.body.prevVersion = original;
|
|
171
|
-
if (requestData.broadcast) {
|
|
172
|
-
fastify.emit("interactionLinkUpdated", payload);
|
|
173
|
-
}
|
|
174
|
-
return payload;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Core function to soft delete an interaction link (returns raw data)
|
|
178
|
-
*/
|
|
179
|
-
async _removeInteractionLink(fastify, id) {
|
|
180
|
-
try {
|
|
181
|
-
const interactionLink = await this.interactionLinkModel
|
|
182
|
-
.findOneAndUpdate({ _id: id }, { isDeleted: true }, { new: true })
|
|
183
|
-
.lean();
|
|
184
|
-
if (!interactionLink) {
|
|
185
|
-
throw new Error(`InteractionLink with ID ${id} not found`);
|
|
186
|
-
}
|
|
187
|
-
return interactionLink;
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
fastify.log.error(error.message);
|
|
191
|
-
throw error;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Soft delete an interaction link with payload wrapping and event emission
|
|
196
|
-
*/
|
|
197
|
-
async removeInteractionLink(fastify, requestData, id) {
|
|
198
|
-
const interactionLink = await this._removeInteractionLink(fastify, id);
|
|
199
|
-
const payload = await createInteractionLinkPayload(fastify, [interactionLink], {
|
|
200
|
-
...requestData,
|
|
201
|
-
type: "dataDeleted",
|
|
202
|
-
});
|
|
203
|
-
payload.body.deleted = [interactionLink._id];
|
|
204
|
-
fastify.emit("interactionLinkDeleted", payload);
|
|
205
|
-
return payload;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Core function to hard delete an interaction link (returns raw data)
|
|
209
|
-
*/
|
|
210
|
-
async _hardDeleteInteractionLink(fastify, id) {
|
|
211
|
-
try {
|
|
212
|
-
const interactionLink = await this.interactionLinkModel.findOne({
|
|
213
|
-
_id: id,
|
|
214
|
-
isDeleted: true,
|
|
215
|
-
});
|
|
216
|
-
if (!interactionLink) {
|
|
217
|
-
throw new Error(`InteractionLink with ID ${id} not found or not marked for deletion`);
|
|
218
|
-
}
|
|
219
|
-
await this.interactionLinkModel.deleteOne({ id });
|
|
220
|
-
return interactionLink.toObject
|
|
221
|
-
? interactionLink.toObject()
|
|
222
|
-
: interactionLink;
|
|
223
|
-
}
|
|
224
|
-
catch (error) {
|
|
225
|
-
fastify.log.error(error.message);
|
|
226
|
-
throw error;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Hard delete an interaction link with payload wrapping and event emission
|
|
231
|
-
*/
|
|
232
|
-
async hardDeleteInteractionLink(fastify, requestData, id) {
|
|
233
|
-
const interactionLink = await this._hardDeleteInteractionLink(fastify, id);
|
|
234
|
-
const payload = await createInteractionLinkPayload(fastify, [interactionLink], {
|
|
235
|
-
...requestData,
|
|
236
|
-
type: "dataHardDeleted",
|
|
237
|
-
});
|
|
238
|
-
payload.body.deleted = [interactionLink._id];
|
|
239
|
-
fastify.emit("interactionLinkHardDeleted", payload);
|
|
240
|
-
return payload;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Core function to get interaction links by trigger type and identifier (returns raw data)
|
|
244
|
-
*/
|
|
245
|
-
async _readInteractionLinksByTrigger(fastify, triggerType, identifier) {
|
|
246
|
-
try {
|
|
247
|
-
return await this.interactionLinkModel
|
|
248
|
-
.find({
|
|
249
|
-
isDeleted: false,
|
|
250
|
-
triggers: {
|
|
251
|
-
$elemMatch: {
|
|
252
|
-
type: triggerType,
|
|
253
|
-
identifier: identifier,
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
})
|
|
257
|
-
.lean();
|
|
258
|
-
}
|
|
259
|
-
catch (error) {
|
|
260
|
-
fastify.log.error(error.message);
|
|
261
|
-
throw error;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Get interaction links by trigger type and identifier with payload wrapping
|
|
266
|
-
*/
|
|
267
|
-
async readInteractionLinksByTrigger(fastify, requestData, triggerType, identifier) {
|
|
268
|
-
const interactionLinks = await this._readInteractionLinksByTrigger(fastify, triggerType, identifier);
|
|
269
|
-
return createInteractionLinkPayload(fastify, interactionLinks, requestData);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
export const createInteractionLinkService = (model) => new InteractionLinkService(model);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import get from "./route.interactionLink.get.js";
|
|
2
|
-
import getAll from "./route.interactionLink.getAll.js";
|
|
3
|
-
import hardDelete from "./route.interactionLink.hardDelete.js";
|
|
4
|
-
import patch from "./route.interactionLink.patch.js";
|
|
5
|
-
import post from "./route.interactionLink.post.js";
|
|
6
|
-
import remove from "./route.interactionLink.remove.js";
|
|
7
|
-
const registerRoutes = async (fastify) => {
|
|
8
|
-
await fastify.get("/interactionLink/all", getAll(fastify));
|
|
9
|
-
await fastify.get("/interactionLink/:_id", get(fastify));
|
|
10
|
-
await fastify.patch("/interactionLink/:_id", patch(fastify));
|
|
11
|
-
await fastify.post("/interactionLink", post(fastify));
|
|
12
|
-
await fastify.delete("/interactionLink/:_id", remove(fastify));
|
|
13
|
-
await fastify.delete("/interactionLink/:_id/hard", hardDelete(fastify));
|
|
14
|
-
};
|
|
15
|
-
export default registerRoutes;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Static } from "@sinclair/typebox";
|
|
2
|
-
import type { FastifyReply, FastifyRequest } from "fastify";
|
|
3
|
-
import { PluginFastifyInstance } from "../../../../../../../types/index.js";
|
|
4
|
-
declare const ParamsSchema: import("@sinclair/typebox").TObject<{
|
|
5
|
-
_id: import("@sinclair/typebox").TString;
|
|
6
|
-
}>;
|
|
7
|
-
type Params = Static<typeof ParamsSchema>;
|
|
8
|
-
declare const _default: (fastify: PluginFastifyInstance) => {
|
|
9
|
-
handler: (req: FastifyRequest<{
|
|
10
|
-
Params: Params;
|
|
11
|
-
}>, reply: FastifyReply) => Promise<any>;
|
|
12
|
-
onRequest: any[];
|
|
13
|
-
config: {
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
schema: {
|
|
17
|
-
summary: string;
|
|
18
|
-
tags: string[];
|
|
19
|
-
params: import("@sinclair/typebox").TObject<{
|
|
20
|
-
_id: import("@sinclair/typebox").TString;
|
|
21
|
-
}>;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export default _default;
|