@botpress/zai 1.0.1-beta.4 → 1.0.1-beta.7

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.
@@ -47,7 +47,6 @@ export class TableAdapter extends Adapter {
47
47
  client;
48
48
  tableName;
49
49
  status;
50
- errors = [];
51
50
  constructor(props) {
52
51
  super();
53
52
  props = Props.parse(props);
@@ -113,7 +112,6 @@ export class TableAdapter extends Adapter {
113
112
  });
114
113
  }
115
114
  async assertTableExists() {
116
- var _a, _b, _c;
117
115
  if (this.status !== "ready") {
118
116
  return;
119
117
  }
@@ -127,9 +125,8 @@ export class TableAdapter extends Adapter {
127
125
  ...OPTIONAL_TAGS
128
126
  },
129
127
  schema: TableJsonSchema
130
- }).catch((err) => {
128
+ }).catch(() => {
131
129
  this.status = "error";
132
- this.errors = [err.message];
133
130
  return { table: null, created: false };
134
131
  });
135
132
  if (!table) {
@@ -144,12 +141,12 @@ export class TableAdapter extends Adapter {
144
141
  issues.push("Table is not frozen");
145
142
  }
146
143
  for (const [key, value] of Object.entries(CRITICAL_TAGS)) {
147
- if (((_a = table.tags) == null ? void 0 : _a[key]) !== value) {
148
- issues.push(`Tag ${key} is ${(_b = table.tags) == null ? void 0 : _b[key]} instead of ${value}`);
144
+ if (table.tags?.[key] !== value) {
145
+ issues.push(`Tag ${key} is ${table.tags?.[key]} instead of ${value}`);
149
146
  }
150
147
  }
151
148
  for (const key of Object.keys(TableJsonSchema)) {
152
- const column = (_c = table.schema) == null ? void 0 : _c.properties[key];
149
+ const column = table.schema?.properties[key];
153
150
  const expected = TableJsonSchema[key];
154
151
  if (!column) {
155
152
  issues.push(`Column ${key} is missing`);
@@ -164,7 +161,6 @@ export class TableAdapter extends Adapter {
164
161
  }
165
162
  if (issues.length) {
166
163
  this.status = "error";
167
- this.errors = issues;
168
164
  }
169
165
  }
170
166
  this.status = "initialized";