@zodic/shared 0.0.171 → 0.0.173

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.
@@ -59,6 +59,9 @@ export class ConceptService {
59
59
  };
60
60
  allNamesEN = data['en-us'] || [];
61
61
  allNamesPT = data['pt-br'] || [];
62
+ } else {
63
+ console.log('!-- Error on fetching url: ', doUrl);
64
+ console.log('!-- Response: ', response);
62
65
  }
63
66
 
64
67
  // ✅ Fetch existing KV data to backfill Durable Object if necessary
@@ -68,19 +71,37 @@ export class ConceptService {
68
71
  // 🔥 If names already exist in KV but not in DO, add them
69
72
  if (existingEN.name && !allNamesEN.includes(existingEN.name)) {
70
73
  console.log(`⚡ Backfilling existing name to DO: ${existingEN.name}`);
71
- await fetch(`${doUrl}/add`, {
72
- method: 'POST',
73
- body: JSON.stringify({ language: 'en-us', name: existingEN.name }),
74
- headers: { 'Content-Type': 'application/json' },
75
- });
74
+ try {
75
+ await fetch(`${doUrl}/add`, {
76
+ method: 'POST',
77
+ body: JSON.stringify({
78
+ language: 'en-us',
79
+ name: existingEN.name,
80
+ }),
81
+ headers: { 'Content-Type': 'application/json' },
82
+ });
83
+ } catch (e) {
84
+ console.log(
85
+ `!-- Error on fetch ConceptNames ${(e as Error).message}`
86
+ );
87
+ }
76
88
  }
77
89
  if (existingPT.name && !allNamesPT.includes(existingPT.name)) {
78
90
  console.log(`⚡ Backfilling existing name to DO: ${existingPT.name}`);
79
- await fetch(`${doUrl}/add`, {
80
- method: 'POST',
81
- body: JSON.stringify({ language: 'pt-br', name: existingPT.name }),
82
- headers: { 'Content-Type': 'application/json' },
83
- });
91
+ try {
92
+ await fetch(`${doUrl}/add`, {
93
+ method: 'POST',
94
+ body: JSON.stringify({
95
+ language: 'pt-br',
96
+ name: existingPT.name,
97
+ }),
98
+ headers: { 'Content-Type': 'application/json' },
99
+ });
100
+ } catch (e) {
101
+ console.log(
102
+ `!-- Error on fetch ConceptNames ${(e as Error).message}`
103
+ );
104
+ }
84
105
  }
85
106
 
86
107
  // ✅ Skip generation if basic info already exists and override is false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.171",
3
+ "version": "0.0.173",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {