@raclettejs/core 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +2 -2
  3. package/services/backend/src/core/backgroundTasks/taskManager.ts +1 -1
  4. package/services/backend/src/core/sockets/socketManager.ts +2 -0
  5. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/account.service.ts +7 -3
  6. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/account/routes/route.account.hardDelete.ts +16 -11
  7. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/composition.service.ts +13 -5
  8. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.getAll.ts +1 -0
  9. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/composition/routes/route.composition.hardDelete.ts +16 -11
  10. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/interactionLink.service.ts +12 -7
  11. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.getAll.ts +1 -0
  12. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/interactionLink/routes/route.interactionLink.hardDelete.ts +14 -7
  13. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/project/project.service.ts +8 -4
  14. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/routes/route.tag.hardDelete.ts +14 -7
  15. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/tag/tag.service.ts +10 -3
  16. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/index.ts +2 -0
  17. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.getAll.ts +1 -1
  18. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/routes/route.user.hardDelete.ts +55 -0
  19. package/services/backend/src/corePlugins/raclette__core/backend/datatypes/user/user.service.ts +32 -0
  20. package/services/frontend/src/core/lib/data/fetchDataHandler.ts +22 -14
  21. package/services/frontend/src/core/lib/data/responseTypeHandler.ts +1 -1
  22. package/services/frontend/src/core/lib/data/writeDataHandler.ts +10 -3
  23. package/services/frontend/src/core/lib/userNotifier.ts +2 -1
  24. package/services/frontend/src/orchestrator/i18n/de-DE.json +2 -0
  25. package/services/frontend/src/orchestrator/i18n/en-EU.json +2 -0
  26. package/services/frontend/src/orchestrator/i18n/sk.json +2 -0
  27. package/yarn.lock +4 -4
package/CHANGELOG.md CHANGED
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.17] - 06.11.2025 <a href="https://gitlab.com/raclettejs/core/-/compare/v0.1.15...v0.1.17" target="_blank" rel="noopener"><b>Overview of all changes</b></a>
11
+
12
+ ### Fixed
13
+
14
+ - Frontend: axios Delete handling
15
+ - Frontend: retrieval of deleted compositions/interactionLinks during socket join
16
+ - Frontend: notifications for delete events now show name
17
+ -
18
+
19
+ ### Added
20
+
21
+ - Frontend: added i18n keys
22
+ - Frontend: hard delete of core datatypes
23
+ - Backend: getAll routes for core datatypes do now respect set filters
24
+
10
25
  ## [0.1.15] - 02.11.2025 <a href="https://gitlab.com/raclettejs/core/-/compare/v0.1.13...v0.1.15" target="_blank" rel="noopener"><b>Overview of all changes</b></a>
11
26
 
12
27
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raclettejs/core",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "racletteJS core package",
5
5
  "repository": "https://gitlab.com/raclettejs/core",
6
6
  "author": "Pacifico Digital Explorations GmbH <info@raclettejs.com>",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@eslint/js": "9.35.0",
72
- "@raclettejs/types": "0.1.15",
72
+ "@raclettejs/types": "^0.1.17",
73
73
  "@types/fs-extra": "11.0.4",
74
74
  "@types/js-yaml": "4.0.9",
75
75
  "@types/node": "24.5.1",
@@ -122,7 +122,7 @@ const setupTaskManager = (fastify: FastifyInstance) => {
122
122
 
123
123
  if (removed) {
124
124
  taskMetadata.delete(name)
125
- fastify.log.info(`Cancelled task: ${name}`)
125
+ fastify.log.info(`Canceled task: ${name}`)
126
126
  } else {
127
127
  fastify.log.warn(`Task not found: ${name}`)
128
128
  }
@@ -93,6 +93,7 @@ const registerSocketEvents = (fastify: FastifyInstance): void => {
93
93
  "composition",
94
94
  "readAll",
95
95
  fastify,
96
+ { isDeleted: false },
96
97
  )
97
98
  }
98
99
 
@@ -103,6 +104,7 @@ const registerSocketEvents = (fastify: FastifyInstance): void => {
103
104
  "interactionLink",
104
105
  "readAll",
105
106
  fastify,
107
+ { isDeleted: false },
106
108
  )
107
109
  }
108
110
 
@@ -6,7 +6,7 @@ import type {
6
6
  import type { PluginFastifyInstance } from "types"
7
7
  import { v4 as uuidv4, validate } from "uuid"
8
8
  import { createAccountPayload } from "./helpers/payload"
9
- import { Model } from "mongoose"
9
+ import type { Model } from "mongoose"
10
10
 
11
11
  export type AccountBody = Partial<Omit<AccountType, "_id">> & {
12
12
  _id?: string
@@ -277,9 +277,13 @@ export class AccountService {
277
277
  )
278
278
  }
279
279
 
280
- await this.accountModel.deleteOne({ _id: id })
280
+ const res = await account.deleteOne()
281
281
 
282
- return account.toObject ? account.toObject() : account
282
+ if (res?.deletedCount === 1) {
283
+ return account.toObject ? account.toObject() : account
284
+ }
285
+
286
+ throw new Error(`Deletion of Account with ID ${id} was not successful.`)
283
287
  } catch (error: any) {
284
288
  fastify.log.error(error.message)
285
289
  throw error
@@ -2,6 +2,7 @@ import type { Static } from "@sinclair/typebox"
2
2
  import type { FastifyReply, FastifyRequest } from "fastify"
3
3
  import type { PluginFastifyInstance } from "types"
4
4
  import { Type } from "@sinclair/typebox"
5
+ import { ForbiddenError } from "@/utils/errors"
5
6
 
6
7
  const ParamsSchema = Type.Object({
7
8
  _id: Type.String(),
@@ -17,19 +18,23 @@ export default (fastify: PluginFastifyInstance) => {
17
18
  }>,
18
19
  reply: FastifyReply,
19
20
  ) => {
20
- try {
21
- const { _id } = req.params
21
+ if (req.user.isAdmin) {
22
+ try {
23
+ const { _id } = req.params
22
24
 
23
- const payload = await accountService.hardDeleteAccount(
24
- fastify,
25
- req.requestParams,
26
- _id,
27
- )
25
+ const payload = await accountService.hardDeleteAccount(
26
+ fastify,
27
+ req.requestParams,
28
+ _id,
29
+ )
28
30
 
29
- return payload
30
- } catch (error: any) {
31
- fastify.log.error(error.message)
32
- return reply.internalServerError(error.message)
31
+ return payload
32
+ } catch (error: any) {
33
+ fastify.log.error(error.message)
34
+ return reply.internalServerError(error.message)
35
+ }
36
+ } else {
37
+ throw new ForbiddenError("Only admins can hard delete this core datatype")
33
38
  }
34
39
  }
35
40
 
@@ -94,11 +94,12 @@ export class CompositionService {
94
94
  */
95
95
  async _readAllCompositions(
96
96
  fastify: PluginFastifyInstance,
97
+ filters: Record<string, any> = {},
97
98
  ): Promise<CompositionType[]> {
98
99
  try {
99
100
  return await this.compositionModel
100
101
  .find({
101
- isDeleted: false,
102
+ ...filters,
102
103
  })
103
104
  .lean()
104
105
  } catch (error: any) {
@@ -113,8 +114,9 @@ export class CompositionService {
113
114
  async getAllCompositions(
114
115
  fastify: PluginFastifyInstance,
115
116
  requestData: FrontendPayloadRequestData,
117
+ filters: Record<string, any> = {},
116
118
  ): Promise<FrontendPayload<CompositionType[]>> {
117
- const compositions = await this._readAllCompositions(fastify)
119
+ const compositions = await this._readAllCompositions(fastify, filters)
118
120
 
119
121
  return createCompositionPayload(fastify, compositions, requestData)
120
122
  }
@@ -290,7 +292,7 @@ export class CompositionService {
290
292
  ): Promise<CompositionType> {
291
293
  try {
292
294
  const composition = await this.compositionModel.findOne({
293
- id,
295
+ _id: id,
294
296
  isDeleted: true,
295
297
  })
296
298
 
@@ -300,9 +302,15 @@ export class CompositionService {
300
302
  )
301
303
  }
302
304
 
303
- await this.compositionModel.deleteOne({ _id: id })
305
+ const res = await composition.deleteOne()
304
306
 
305
- return composition.toObject ? composition.toObject() : composition
307
+ if (res?.deletedCount === 1) {
308
+ return composition.toObject ? composition.toObject() : composition
309
+ }
310
+
311
+ throw new Error(
312
+ `Deletion of Composition with ID ${id} was not successful.`,
313
+ )
306
314
  } catch (error: any) {
307
315
  fastify.log.error(error.message)
308
316
  throw error
@@ -9,6 +9,7 @@ export default (fastify: PluginFastifyInstance) => {
9
9
  const payload = await compositionService.getAllCompositions(
10
10
  fastify,
11
11
  req.requestParams,
12
+ req.query,
12
13
  )
13
14
 
14
15
  return payload
@@ -2,6 +2,7 @@ import type { Static } from "@sinclair/typebox"
2
2
  import type { FastifyReply, FastifyRequest } from "fastify"
3
3
  import type { PluginFastifyInstance } from "types"
4
4
  import { Type } from "@sinclair/typebox"
5
+ import { ForbiddenError } from "@/utils/errors"
5
6
 
6
7
  const ParamsSchema = Type.Object({
7
8
  _id: Type.String(),
@@ -17,19 +18,23 @@ export default (fastify: PluginFastifyInstance) => {
17
18
  }>,
18
19
  reply: FastifyReply,
19
20
  ) => {
20
- try {
21
- const { _id } = req.params
21
+ if (req.user.isAdmin) {
22
+ try {
23
+ const { _id } = req.params
22
24
 
23
- const payload = await compositionService.hardDeleteComposition(
24
- fastify,
25
- req.requestParams,
26
- _id,
27
- )
25
+ const payload = await compositionService.hardDeleteComposition(
26
+ fastify,
27
+ req.requestParams,
28
+ _id,
29
+ )
28
30
 
29
- return payload
30
- } catch (error: any) {
31
- fastify.log.error(error.message)
32
- return reply.internalServerError(error.message)
31
+ return payload
32
+ } catch (error: any) {
33
+ fastify.log.error(error.message)
34
+ return reply.internalServerError(error.message)
35
+ }
36
+ } else {
37
+ throw new ForbiddenError("Only admins can hard delete this core datatype")
33
38
  }
34
39
  }
35
40
 
@@ -5,8 +5,8 @@ import type {
5
5
  } from "@c/payload/payloadTypes"
6
6
  import { v4 as uuidv4, validate } from "uuid"
7
7
  import { createInteractionLinkPayload } from "./helpers/payload"
8
- import { PluginFastifyInstance } from "types"
9
- import { Model } from "mongoose"
8
+ import type { PluginFastifyInstance } from "types"
9
+ import type { Model } from "mongoose"
10
10
 
11
11
  export type InteractionLinkBody = Partial<Omit<InteractionLinkType, "_id">> & {
12
12
  _id?: string
@@ -102,7 +102,6 @@ export class InteractionLinkService {
102
102
  try {
103
103
  return await this.interactionLinkModel
104
104
  .find({
105
- isDeleted: false,
106
105
  ...filters,
107
106
  })
108
107
  .lean()
@@ -353,11 +352,17 @@ export class InteractionLinkService {
353
352
  )
354
353
  }
355
354
 
356
- await this.interactionLinkModel.deleteOne({ id })
355
+ const res = await interactionLink.deleteOne()
357
356
 
358
- return interactionLink.toObject
359
- ? interactionLink.toObject()
360
- : interactionLink
357
+ if (res?.deletedCount === 1) {
358
+ return interactionLink.toObject
359
+ ? interactionLink.toObject()
360
+ : interactionLink
361
+ }
362
+
363
+ throw new Error(
364
+ `Deletion of InteractionLink with ID ${id} was not successful.`,
365
+ )
361
366
  } catch (error: any) {
362
367
  fastify.log.error(error.message)
363
368
  throw error
@@ -9,6 +9,7 @@ export default (fastify: PluginFastifyInstance) => {
9
9
  const payload = await interactionLinkService.getAllInteractionLinks(
10
10
  fastify,
11
11
  req.requestParams,
12
+ req.query,
12
13
  )
13
14
 
14
15
  return payload
@@ -2,6 +2,7 @@ import type { Static } from "@sinclair/typebox"
2
2
  import type { FastifyReply, FastifyRequest } from "fastify"
3
3
  import { PluginFastifyInstance } from "types"
4
4
  import { Type } from "@sinclair/typebox"
5
+ import { ForbiddenError } from "@/utils/errors"
5
6
 
6
7
  const ParamsSchema = Type.Object({
7
8
  _id: Type.String(),
@@ -18,15 +19,21 @@ export default (fastify: PluginFastifyInstance) => {
18
19
  reply: FastifyReply,
19
20
  ) => {
20
21
  try {
21
- const { _id } = req.params
22
+ if (req.user.isAdmin) {
23
+ const { _id } = req.params
22
24
 
23
- const payload = await interactionLinkService.hardDeleteInteractionLink(
24
- fastify,
25
- req.requestParams,
26
- _id,
27
- )
25
+ const payload = await interactionLinkService.hardDeleteInteractionLink(
26
+ fastify,
27
+ req.requestParams,
28
+ _id,
29
+ )
28
30
 
29
- return payload
31
+ return payload
32
+ } else {
33
+ throw new ForbiddenError(
34
+ "Only admins can hard delete this core datatype",
35
+ )
36
+ }
30
37
  } catch (error: any) {
31
38
  fastify.log.error(error.message)
32
39
  return reply.internalServerError(error.message)
@@ -10,8 +10,8 @@ import type {
10
10
  import type { QueryOptions } from "@m/database/providers/mongodb/service"
11
11
  import { v4 as uuidv4, validate } from "uuid"
12
12
  import { createProjectPayload } from "./helpers/payload"
13
- import { Model } from "mongoose"
14
- import { PluginFastifyInstance } from "types"
13
+ import type { Model } from "mongoose"
14
+ import type { PluginFastifyInstance } from "types"
15
15
 
16
16
  export type ProjectBody = Partial<Omit<ProjectType, "_id">> & { _id?: string }
17
17
 
@@ -316,9 +316,13 @@ export class ProjectService {
316
316
  )
317
317
  }
318
318
 
319
- await this.projectModel.deleteOne({ _id: id })
319
+ const res = await project.deleteOne()
320
320
 
321
- return project.toObject ? project.toObject() : project
321
+ if (res?.deletedCount === 1) {
322
+ return project.toObject ? project.toObject() : project
323
+ }
324
+
325
+ throw new Error(`Deletion of Project with ID ${id} was not successful.`)
322
326
  } catch (error: any) {
323
327
  fastify.log.error(error.message)
324
328
  throw error
@@ -2,6 +2,7 @@ import type { Static } from "@sinclair/typebox"
2
2
  import type { FastifyReply, FastifyRequest } from "fastify"
3
3
  import { PluginFastifyInstance } from "types"
4
4
  import { Type } from "@sinclair/typebox"
5
+ import { ForbiddenError } from "@/utils/errors"
5
6
 
6
7
  const ParamsSchema = Type.Object({
7
8
  _id: Type.String(),
@@ -16,15 +17,21 @@ export default (fastify: PluginFastifyInstance) => {
16
17
  reply: FastifyReply,
17
18
  ) => {
18
19
  try {
19
- const { _id } = req.params
20
+ if (req.user.isAdmin) {
21
+ const { _id } = req.params
20
22
 
21
- const payloadWithTag = await tagService.hardDeleteTag(
22
- fastify,
23
- req.requestParams,
24
- _id,
25
- )
23
+ const payloadWithTag = await tagService.hardDeleteTag(
24
+ fastify,
25
+ req.requestParams,
26
+ _id,
27
+ )
26
28
 
27
- return payloadWithTag
29
+ return payloadWithTag
30
+ } else {
31
+ throw new ForbiddenError(
32
+ "Only admins can hard delete this core datatype",
33
+ )
34
+ }
28
35
  } catch (error: any) {
29
36
  fastify.log.error(error.message)
30
37
  return reply.internalServerError(error.message)
@@ -318,7 +318,10 @@ export class TagService {
318
318
  id: string,
319
319
  ): Promise<TagType> {
320
320
  try {
321
- const tag = await this.tagModel.findOne({ _id: id, isDeleted: true })
321
+ const tag = await this.tagModel.findOne({
322
+ _id: id,
323
+ isDeleted: true,
324
+ })
322
325
 
323
326
  if (!tag) {
324
327
  throw new Error(
@@ -326,9 +329,13 @@ export class TagService {
326
329
  )
327
330
  }
328
331
 
329
- await this.tagModel.deleteOne({ _id: id })
332
+ const res = await tag.deleteOne()
330
333
 
331
- return tag.toObject ? tag.toObject() : tag
334
+ if (res?.deletedCount === 1) {
335
+ return tag.toObject ? tag.toObject() : tag
336
+ }
337
+
338
+ throw new Error(`Deletion of Tag with ID ${id} was not successful.`)
332
339
  } catch (error: any) {
333
340
  fastify.log.error(error.message)
334
341
  throw error
@@ -5,6 +5,7 @@ import patch from "./route.user.patch"
5
5
  import patchLastProject from "./route.user.patchLastProject"
6
6
  import post from "./route.user.post"
7
7
  import remove from "./route.user.remove"
8
+ import hardDelete from "./route.user.hardDelete"
8
9
 
9
10
  const registerRoutes = async (fastify: PluginFastifyInstance) => {
10
11
  await fastify.get("/user/all", getAll(fastify))
@@ -12,6 +13,7 @@ const registerRoutes = async (fastify: PluginFastifyInstance) => {
12
13
  await fastify.patch("/user/:_id", patch(fastify))
13
14
  await fastify.post("/user", post(fastify))
14
15
  await fastify.delete("/user/:_id", remove(fastify))
16
+ await fastify.delete("/user/:_id/hard", hardDelete(fastify))
15
17
  await fastify.patch(
16
18
  "/user/last-project/:projectId",
17
19
  patchLastProject(fastify),
@@ -19,7 +19,7 @@ export default (fastify: PluginFastifyInstance) => {
19
19
  ) => {
20
20
  try {
21
21
  //TODO rework this once we have permission system in place
22
- const filter: any = { isDeleted: false }
22
+ const filter: any = { isDeleted: req.query?.isDeleted || false }
23
23
  if (req.query.account) {
24
24
  filter.account = req.query.account
25
25
  }
@@ -0,0 +1,55 @@
1
+ import type { Static } from "@sinclair/typebox"
2
+ import type { FastifyReply, FastifyRequest } from "fastify"
3
+ import { PluginFastifyInstance } from "types"
4
+ import { Type } from "@sinclair/typebox"
5
+ import { ForbiddenError } from "@/utils/errors"
6
+
7
+ const ParamsSchema = Type.Object({
8
+ _id: Type.String(),
9
+ })
10
+ type Params = Static<typeof ParamsSchema>
11
+
12
+ export default (fastify: PluginFastifyInstance) => {
13
+ const userService = fastify.custom.userService
14
+
15
+ const handler = async (
16
+ req: FastifyRequest<{ Params: Params }>,
17
+ reply: FastifyReply,
18
+ ) => {
19
+ try {
20
+ if (req.user.isAdmin) {
21
+ const { _id } = req.params
22
+
23
+ const payloadWithUser = await userService.hardDeleteUser(
24
+ fastify,
25
+ req.requestParams,
26
+ _id,
27
+ )
28
+
29
+ return payloadWithUser
30
+ } else {
31
+ throw new ForbiddenError(
32
+ "Only admins can hard delete this core datatype",
33
+ )
34
+ }
35
+ } catch (error: any) {
36
+ fastify.log.error(error.message)
37
+ return reply.internalServerError(error.message)
38
+ }
39
+ }
40
+
41
+ return {
42
+ handler,
43
+ onRequest: [fastify.authenticate],
44
+ config: {
45
+ type: "dataHardDeleted",
46
+ broadcastChannels: ["userHardDeleted"],
47
+ },
48
+ schema: {
49
+ summary: "Permanently delete a user by id",
50
+ description: "Hard delete a user",
51
+ tags: ["core/user"],
52
+ params: ParamsSchema,
53
+ },
54
+ }
55
+ }
@@ -287,6 +287,38 @@ export class UserService {
287
287
  return payload
288
288
  }
289
289
 
290
+ /**
291
+ * Core function to hard delete an interaction link (returns raw data)
292
+ */
293
+ async _hardDeleteUser(
294
+ fastify: PluginFastifyInstance,
295
+ id: string,
296
+ ): Promise<UserType> {
297
+ try {
298
+ const user = await this.userModel.findOne({
299
+ _id: id,
300
+ isDeleted: true,
301
+ })
302
+
303
+ if (!user) {
304
+ throw new Error(
305
+ `User with ID ${id} not found or not marked for deletion`,
306
+ )
307
+ }
308
+
309
+ const res = await user.deleteOne()
310
+
311
+ if (res?.deletedCount === 1) {
312
+ return user.toObject ? user.toObject() : user
313
+ }
314
+
315
+ throw new Error(`Deletion of User with ID ${id} was not successful.`)
316
+ } catch (error: any) {
317
+ fastify.log.error(error.message)
318
+ throw error
319
+ }
320
+ }
321
+
290
322
  /**
291
323
  * Core function to update user's last accessed project (returns raw data)
292
324
  */
@@ -164,11 +164,11 @@ const cacheOperations = {
164
164
  },
165
165
  }
166
166
 
167
- const finishRemoteQuery = (actionIdentifier, result, params, options) => {
167
+ const finishRemoteQuery = (actionIdentifier, result = {}, params, options) => {
168
168
  const { actionId, cacheKey } = actionIdentifier
169
169
  log.api("finishRemoteQuery", { actionId, params, result })
170
170
 
171
- if (!result.data) {
171
+ if (!result?.data) {
172
172
  return
173
173
  }
174
174
  let resultBody = structuredClone(result.data.body)
@@ -238,18 +238,26 @@ const handleRemoteRequest = async (
238
238
  const response =
239
239
  method === "GET"
240
240
  ? await $api.axios.get(target, config).catch((e) => {
241
- $eventbus.emit("ui/addToSnackbar", {
242
- message: e.response.data.message,
243
- color: "error",
244
- })
245
- throw e
241
+ if (e.name !== "CanceledError") {
242
+ $eventbus.emit("ui/addToSnackbar", {
243
+ message: e.response?.data?.message || "error",
244
+ color: "error",
245
+ })
246
+ throw e
247
+ }
248
+ log.api("axios/get/error", e)
249
+ return {}
246
250
  })
247
251
  : await $api.axios.post(target, params, config).catch((e) => {
248
- $eventbus.emit("ui/addToSnackbar", {
249
- message: e.response.data.message,
250
- color: "error",
251
- })
252
- throw e
252
+ if (e.name !== "CanceledError") {
253
+ $eventbus.emit("ui/addToSnackbar", {
254
+ message: e.response?.data?.message || "error",
255
+ color: "error",
256
+ })
257
+ throw e
258
+ }
259
+ log.api("axios/post/error", e)
260
+ return {}
253
261
  })
254
262
 
255
263
  return {
@@ -258,7 +266,7 @@ const handleRemoteRequest = async (
258
266
  }
259
267
  } catch (e) {
260
268
  if (e.name === "AbortError" || e.name === "CanceledError") {
261
- log.api(`${method} request was cancelled for actionId:`, actionIdentifier)
269
+ log.api(`${method} request was canceled for actionId:`, actionIdentifier)
262
270
  throw e
263
271
  }
264
272
 
@@ -442,7 +450,7 @@ const executeRoute = async (actionIdentifier, validTarget, params, options) => {
442
450
 
443
451
  if (error.name === "AbortError" || error.name === "CanceledError") {
444
452
  log.api(
445
- "HTTP request was cancelled for actionId:",
453
+ "HTTP request was canceled for actionId:",
446
454
  actionIdentifier.actionId,
447
455
  )
448
456
  throw error
@@ -162,7 +162,7 @@ const handler = {
162
162
  requestId,
163
163
  data,
164
164
  })
165
- const deleted = data.deleted || []
165
+ const deleted = data.items || []
166
166
  $store.dispatch({ type: "data/hardDelete", payload: deleted })
167
167
  if (notify) {
168
168
  userNotifier.dataDelete(isOwnRequest, isSystemAction, deleted)
@@ -10,7 +10,6 @@ const createAxiosConfig = (appRequestCode, pluginItemRequestConfig) => {
10
10
  "app-request-code": appRequestCode,
11
11
  },
12
12
  }
13
-
14
13
  const channels = []
15
14
  if (pluginItemRequestConfig.broadcast) {
16
15
  channels.push("data")
@@ -77,6 +76,12 @@ const storeActions = {
77
76
  })
78
77
  },
79
78
  }
79
+ const getAxiosPromise = async (method, target, source, config) => {
80
+ if (method === "delete") {
81
+ return await $api.axios.delete(target, config, { data: { source } })
82
+ }
83
+ return await $api.axios[method](target, source, config)
84
+ }
80
85
  const writeData = async (actionId, operationDefinition, item, options) => {
81
86
  const type = operationDefinition.dataTypeName
82
87
  const cleanItem = removeCacheAttributes(item)
@@ -112,7 +117,8 @@ const writeData = async (actionId, operationDefinition, item, options) => {
112
117
  config,
113
118
  )
114
119
  }
115
- return await $api.axios[operationDefinition.method](
120
+ return await getAxiosPromise(
121
+ operationDefinition.method,
116
122
  validTarget,
117
123
  cleanItem,
118
124
  config,
@@ -124,7 +130,8 @@ const writeData = async (actionId, operationDefinition, item, options) => {
124
130
  })
125
131
  .catch((e) => reportError(e))
126
132
  } else {
127
- return await $api.axios[operationDefinition.method](
133
+ return await getAxiosPromise(
134
+ operationDefinition.method,
128
135
  validTarget,
129
136
  cleanItem,
130
137
  config,
@@ -129,7 +129,7 @@ const userConfigUpdate = (isAnswerToOwnRequest, isSystemAction, items) =>
129
129
  color: "info",
130
130
  })
131
131
 
132
- const dataDelete = (isAnswerToOwnRequest, isSystemAction, deletedItems) =>
132
+ const dataDelete = (isAnswerToOwnRequest, isSystemAction, deletedItems) => {
133
133
  deletedItems.forEach((item) => {
134
134
  if (isAnswerToOwnRequest) {
135
135
  $eventbus.emit("ui/addToSnackbar", {
@@ -153,6 +153,7 @@ const dataDelete = (isAnswerToOwnRequest, isSystemAction, deletedItems) =>
153
153
  })
154
154
  }
155
155
  })
156
+ }
156
157
 
157
158
  const dataMove = (isAnswerToOwnRequest, isSystemAction, items) => {
158
159
  items.forEach((item) => {
@@ -72,6 +72,8 @@
72
72
  "noAccountYet": "Noch kein Konto?",
73
73
  "moreInformation": "Weitere Informationen"
74
74
  },
75
+ "showDeleted": "Zeige gelöschte",
76
+ "hideDeleted": "Verstecke gelöschte",
75
77
  "cancel": "Abbrechen",
76
78
  "close": "Schließen",
77
79
  "clear": "Leeren",
@@ -72,6 +72,8 @@
72
72
  "noAccountYet": "Don't have an account yet?",
73
73
  "moreInformation": "More information"
74
74
  },
75
+ "showDeleted": "Show deleted",
76
+ "hideDeleted": "Hide deleted",
75
77
  "cancel": "Cancel",
76
78
  "close": "Close",
77
79
  "clear": "Clear",
@@ -72,6 +72,8 @@
72
72
  "noAccountYet": "Ešte nemáte účet?",
73
73
  "moreInformation": "Viac informácií"
74
74
  },
75
+ "showDeleted": "relácia vymazaná",
76
+ "hideDeleted": "skryť odstránené",
75
77
  "cancel": "Zrušiť",
76
78
  "close": "Zavrieť",
77
79
  "clear": "Vyčistiť",
package/yarn.lock CHANGED
@@ -295,10 +295,10 @@
295
295
  resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.2.9.tgz#d229a7b7f9dac167a156992ef23c7f023653f53b"
296
296
  integrity sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==
297
297
 
298
- "@raclettejs/types@^0.1.14":
299
- version "0.1.14"
300
- resolved "https://registry.yarnpkg.com/@raclettejs/types/-/types-0.1.14.tgz#585958921aaecab98dc301be4e1ce7207e90aeae"
301
- integrity sha512-Uh3006SOIUDQw5LFvPj2ewLKglBnORNY+9IE9cqsDFHXZo++/9eBwaEGPvQKTJ6XbjpJPxUezKvbtaaE8MMIFg==
298
+ "@raclettejs/types@^0.1.17":
299
+ version "0.1.17"
300
+ resolved "https://registry.yarnpkg.com/@raclettejs/types/-/types-0.1.17.tgz#ced377e5fa8879a5790b1c0c838f621917032690"
301
+ integrity sha512-WBhi6Nf/XJPlisF1stEB0KGo5TWw+EMaTuYt39fJKc+Vtyf/SFmZqP2D3BKlssE5N/8bo2DFgf2qUeKowo0onA==
302
302
  dependencies:
303
303
  "@types/node" "24.5.2"
304
304
  fastify "5.6.0"