@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.
- package/dist/{node/adapters → adapters}/botpress-table.js +4 -8
- package/dist/index.d.ts +917 -0
- package/dist/{node/operations → operations}/check.js +1 -2
- package/dist/{node/operations → operations}/extract.js +1 -2
- package/dist/{node/operations → operations}/filter.js +3 -5
- package/dist/{node/operations → operations}/label.js +4 -8
- package/dist/{node/operations → operations}/rewrite.js +1 -2
- package/dist/{node/operations → operations}/summarize.js +1 -2
- package/dist/{node/operations → operations}/text.js +1 -2
- package/dist/{node/zai.js → zai.js} +2 -3
- package/package.json +6 -18
- package/src/adapters/botpress-table.ts +1 -4
- package/tsconfig.json +2 -2
- package/dist/browser/index.js +0 -4071
- package/scripts/update-models.mts +0 -76
- package/scripts/update-types.mts +0 -49
- package/tsup.config.ts +0 -16
- package/vitest.config.ts +0 -9
- package/vitest.setup.ts +0 -24
- /package/dist/{node/adapters → adapters}/adapter.js +0 -0
- /package/dist/{node/adapters → adapters}/memory.js +0 -0
- /package/dist/{node/index.js → index.js} +0 -0
- /package/dist/{node/models.js → models.js} +0 -0
- /package/dist/{node/operations → operations}/constants.js +0 -0
- /package/dist/{node/operations → operations}/errors.js +0 -0
- /package/dist/{node/utils.js → utils.js} +0 -0
|
@@ -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((
|
|
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 (
|
|
148
|
-
issues.push(`Tag ${key} is ${
|
|
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 =
|
|
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";
|