@gooddata/sdk-backend-tiger 11.65.0-alpha.9 → 11.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,26 +23,37 @@ export function convertChatConversationFromBackend(conversation) {
23
23
  };
24
24
  }
25
25
  export function convertChatConversationItemFromBackend(item, responses, history, dateNormalizer, locale, timezone) {
26
- const content = convertChatConversationContentFromBackend(item.content, history, dateNormalizer, locale, timezone);
27
- if (!content) {
28
- return undefined;
26
+ try {
27
+ const content = convertChatConversationContentFromBackend(item.content, history, dateNormalizer, locale, timezone);
28
+ if (!content) {
29
+ return undefined;
30
+ }
31
+ const response = responses?.find((r) => r.responseId === item.responseId);
32
+ return {
33
+ type: "item",
34
+ id: item.itemId,
35
+ role: item.role,
36
+ responseId: item.responseId ?? "",
37
+ replyTo: item.replyTo ?? undefined,
38
+ createdAt: new Date(item.createdAt).getTime(),
39
+ feedback: convertChatConversationFeedbackFromBackend(response),
40
+ content,
41
+ stepId: item.stepId ?? undefined,
42
+ detail: convertChatConversationItemDetailFromBackend(item.detail),
43
+ agentId: item.newAgentId ?? undefined,
44
+ oldAgentId: item.oldAgentId ?? undefined,
45
+ reasoningEffort: item.reasoningEffort ?? undefined,
46
+ };
47
+ }
48
+ catch (e) {
49
+ const error = e;
50
+ console.error("Failed to convert conversation item", item.itemId, e);
51
+ return {
52
+ type: "error",
53
+ code: 0,
54
+ message: error.message,
55
+ };
29
56
  }
30
- const response = responses?.find((r) => r.responseId === item.responseId);
31
- return {
32
- type: "item",
33
- id: item.itemId,
34
- role: item.role,
35
- responseId: item.responseId ?? "",
36
- replyTo: item.replyTo ?? undefined,
37
- createdAt: new Date(item.createdAt).getTime(),
38
- feedback: convertChatConversationFeedbackFromBackend(response),
39
- content,
40
- stepId: item.stepId ?? undefined,
41
- detail: convertChatConversationItemDetailFromBackend(item.detail),
42
- agentId: item.newAgentId ?? undefined,
43
- oldAgentId: item.oldAgentId ?? undefined,
44
- reasoningEffort: item.reasoningEffort ?? undefined,
45
- };
46
57
  }
47
58
  export function convertChatConversationItemsFromBackend(items, responses, dateNormalizer, locale, timezone) {
48
59
  const history = [];
@@ -135,19 +146,30 @@ function convertMultipartParts(rawParts, history, dateNormalizer, locale, timezo
135
146
  const siblings = [];
136
147
  const parts = [];
137
148
  rawParts.forEach((rawPart) => {
138
- const part = convertMultipartPart(rawPart, history, siblings, dateNormalizer, locale, timezone);
139
- // Unknown parts are dropped rather than failing the whole item, so the rest
140
- // of the message (known parts) keeps rendering normally.
141
- if (!part) {
142
- return;
149
+ try {
150
+ const part = convertMultipartPart(rawPart, history, siblings, dateNormalizer, locale, timezone);
151
+ // Unknown parts are dropped rather than failing the whole item, so the rest
152
+ // of the message (known parts) keeps rendering normally.
153
+ if (!part) {
154
+ return;
155
+ }
156
+ siblings.push(part);
157
+ const isPatchBase = rawPart.type === "dashboard" &&
158
+ part.type === "dashboard" &&
159
+ !!part.dashboard &&
160
+ patchedDashboardIds.has(part.dashboard.identifier);
161
+ if (!isPatchBase) {
162
+ parts.push(part);
163
+ }
143
164
  }
144
- siblings.push(part);
145
- const isPatchBase = rawPart.type === "dashboard" &&
146
- part.type === "dashboard" &&
147
- !!part.dashboard &&
148
- patchedDashboardIds.has(part.dashboard.identifier);
149
- if (!isPatchBase) {
150
- parts.push(part);
165
+ catch (e) {
166
+ const error = e;
167
+ history.push({
168
+ type: "error",
169
+ code: 0,
170
+ message: error.message,
171
+ });
172
+ console.error("Failed to convert conversation part", rawPart.type, e);
151
173
  }
152
174
  });
153
175
  return parts;
@@ -601,6 +623,9 @@ function collectRelatedItems(items, siblings, ref) {
601
623
  }
602
624
  };
603
625
  items.forEach((item) => {
626
+ if (item.type === "error") {
627
+ return;
628
+ }
604
629
  if (item.content.type === "multipart") {
605
630
  item.content.parts.forEach(collect);
606
631
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-backend-tiger",
3
- "version": "11.65.0-alpha.9",
3
+ "version": "11.65.0",
4
4
  "description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -34,12 +34,12 @@
34
34
  "ts-invariant": "0.10.3",
35
35
  "tslib": "2.8.1",
36
36
  "uuid": "11.1.1",
37
- "@gooddata/api-client-tiger": "11.65.0-alpha.9",
38
- "@gooddata/sdk-backend-base": "11.65.0-alpha.9",
39
- "@gooddata/sdk-backend-spi": "11.65.0-alpha.9",
40
- "@gooddata/sdk-code-convertors": "11.65.0-alpha.9",
41
- "@gooddata/sdk-model": "11.65.0-alpha.9",
42
- "@gooddata/util": "11.65.0-alpha.9"
37
+ "@gooddata/api-client-tiger": "11.65.0",
38
+ "@gooddata/sdk-backend-base": "11.65.0",
39
+ "@gooddata/sdk-backend-spi": "11.65.0",
40
+ "@gooddata/sdk-code-convertors": "11.65.0",
41
+ "@gooddata/sdk-model": "11.65.0",
42
+ "@gooddata/util": "11.65.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@gooddata/fixtures": "3.7.0",
@@ -64,10 +64,10 @@
64
64
  "oxlint-tsgolint": "7.0.2001",
65
65
  "typescript": "7.0.2",
66
66
  "vitest": "5.0.4",
67
- "@gooddata/catalog-export": "11.65.0-alpha.9",
68
- "@gooddata/eslint-config": "11.65.0-alpha.9",
69
- "@gooddata/oxlint-config": "11.65.0-alpha.9",
70
- "@gooddata/reference-workspace": "11.65.0-alpha.9"
67
+ "@gooddata/eslint-config": "11.65.0",
68
+ "@gooddata/oxlint-config": "11.65.0",
69
+ "@gooddata/catalog-export": "11.65.0",
70
+ "@gooddata/reference-workspace": "11.65.0"
71
71
  },
72
72
  "scripts": {
73
73
  "_phase:build": "npm run build",