@webitel/api-services 26.12.31 → 26.12.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/api-services",
3
- "version": "26.12.31",
3
+ "version": "26.12.33",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,6 +18,7 @@ import {
18
18
  sanitizeToWire,
19
19
  snakeToCamel,
20
20
  starToSearch,
21
+ translateError,
21
22
  } from '../../transformers';
22
23
  import type {
23
24
  AddItemParams,
@@ -146,6 +147,7 @@ const addFlow = async ({ itemInstance }: AddItemParams) => {
146
147
  return fromResponseItem(response.data);
147
148
  } catch (err) {
148
149
  throw applyTransform(err, [
150
+ translateError,
149
151
  notify,
150
152
  ]);
151
153
  }
@@ -160,6 +162,7 @@ const updateFlow = async ({ itemInstance, itemId: id }: UpdateItemParams) => {
160
162
  return fromResponseItem(response.data);
161
163
  } catch (err) {
162
164
  throw applyTransform(err, [
165
+ translateError,
163
166
  notify,
164
167
  ]);
165
168
  }
@@ -139,7 +139,15 @@ export const getMediaUrl = (
139
139
  );
140
140
 
141
141
  /** [Claude] All files in one request, one notification; fields named `file[n]` as the old dropzone upload sent them */
142
- const uploadMedia = async (files: File[]) => {
142
+ const uploadMedia = async (
143
+ files: File[],
144
+ {
145
+ // [Claude] callers showing their own success toast (e.g. the media import, WTEL-10817) turn it off
146
+ notifySuccess = true,
147
+ }: {
148
+ notifySuccess?: boolean;
149
+ } = {},
150
+ ) => {
143
151
  const formData = new FormData();
144
152
  files.forEach((file, index) => {
145
153
  formData.append(`file[${index}]`, file);
@@ -147,6 +155,7 @@ const uploadMedia = async (files: File[]) => {
147
155
 
148
156
  try {
149
157
  const response = await instance.post('/storage/media', formData);
158
+ if (!notifySuccess) return response.data;
150
159
  return applyTransform(response.data, [
151
160
  notify(({ callback }) =>
152
161
  callback({
@@ -483,10 +483,13 @@ const addMembersBulk = async ({
483
483
  parentId,
484
484
  fileName,
485
485
  items,
486
+ // [Claude] imports save in chunks and show one "imported" toast themselves, so they turn it off (WTEL-10817)
487
+ notifySuccess = true,
486
488
  }: {
487
489
  parentId: ApiId;
488
490
  fileName: string;
489
491
  items: ApiParams[];
492
+ notifySuccess?: boolean;
490
493
  }) => {
491
494
  const body = {
492
495
  parentId,
@@ -498,6 +501,11 @@ const addMembersBulk = async ({
498
501
  String(parentId),
499
502
  body,
500
503
  );
504
+ if (!notifySuccess) {
505
+ return applyTransform(response.data, [
506
+ snakeToCamel(doNotConvertKeys),
507
+ ]);
508
+ }
501
509
  return applyTransform(response.data, [
502
510
  snakeToCamel(doNotConvertKeys),
503
511
  notify(({ callback }: ApiParams) =>
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Schema with this name already exists',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Ya existe un esquema con este nombre',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Мұндай атаумен схема бұрыннан бар',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Schemat o tej nazwie już istnieje',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Există deja o schemă cu acest nume',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Схема с таким названием уже существует',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Схема з такою назвою вже існує',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Bunday nomli sxema allaqachon mavjud',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };
@@ -76,6 +76,13 @@ export default {
76
76
  },
77
77
  },
78
78
  },
79
+ sqlRoutingSchema: {
80
+ save: {
81
+ valid: {
82
+ name: 'Đã tồn tại lược đồ có tên này',
83
+ },
84
+ },
85
+ },
79
86
  },
80
87
  },
81
88
  };