@botpress/runtime 1.12.0 → 1.12.2

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/internal.js CHANGED
@@ -48,7 +48,7 @@ var init_define_BUILD = __esm({
48
48
  var define_PACKAGE_VERSIONS_default;
49
49
  var init_define_PACKAGE_VERSIONS = __esm({
50
50
  "<define:__PACKAGE_VERSIONS__>"() {
51
- define_PACKAGE_VERSIONS_default = { runtime: "1.12.0", adk: "1.12.0", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
51
+ define_PACKAGE_VERSIONS_default = { runtime: "1.12.2", adk: "1.12.2", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
52
52
  }
53
53
  });
54
54
 
@@ -48097,6 +48097,9 @@ var init_table = __esm({
48097
48097
  factor;
48098
48098
  columns;
48099
48099
  schema;
48100
+ type = "table";
48101
+ keyColumn;
48102
+ tags;
48100
48103
  nullableColumns = /* @__PURE__ */ new Set();
48101
48104
  searchableColumns = /* @__PURE__ */ new Set();
48102
48105
  computedColumns = /* @__PURE__ */ new Set();
@@ -48108,6 +48111,7 @@ var init_table = __esm({
48108
48111
  (name) => /^[a-zA-Z_$][a-zA-Z0-9_]{0,29}Table$/.test(name),
48109
48112
  "Table name must start with a letter/underscore, be 35 chars or less, contain only letters/numbers/underscores, and end with 'Table'"
48110
48113
  );
48114
+ const tagsSchema = z26.record(z26.string().min(3).max(50), z26.string().min(1).max(255)).optional();
48111
48115
  const validation = tableNameSchema.safeParse(props.name);
48112
48116
  if (!validation.success) {
48113
48117
  throw new Errors.InvalidPrimitiveError(`Invalid table name '${props.name}'`, validation.error);
@@ -48116,7 +48120,19 @@ var init_table = __esm({
48116
48120
  if (props.description !== void 0) {
48117
48121
  this.description = props.description;
48118
48122
  }
48123
+ if (props.factor !== void 0 && (props.factor < 1 || props.factor > 30)) {
48124
+ throw new Errors.InvalidPrimitiveError(
48125
+ `Invalid factor for table '${props.name}': must be between 1 and 30 but got ${props.factor}`
48126
+ );
48127
+ }
48119
48128
  this.factor = props.factor ?? 1;
48129
+ if (props.tags !== void 0) {
48130
+ const parsed = tagsSchema.safeParse(props.tags);
48131
+ if (!parsed.success) {
48132
+ throw new Errors.InvalidPrimitiveError(`Invalid tags for table '${props.name}'`, parsed.error);
48133
+ }
48134
+ this.tags = props.tags;
48135
+ }
48120
48136
  this.columns = {};
48121
48137
  let schema = z26.object({});
48122
48138
  for (const [key, value] of Object.entries(props.columns)) {
@@ -48166,6 +48182,14 @@ var init_table = __esm({
48166
48182
  };
48167
48183
  }
48168
48184
  }
48185
+ if (props.keyColumn) {
48186
+ if (typeof props.keyColumn !== "string" || !(props.keyColumn in this.columns)) {
48187
+ throw new Errors.InvalidPrimitiveError(
48188
+ `Invalid keyColumn '${String(props.keyColumn)}' for table '${props.name}': column does not exist`
48189
+ );
48190
+ }
48191
+ this.keyColumn = String(props.keyColumn);
48192
+ }
48169
48193
  this.schema = schema;
48170
48194
  }
48171
48195
  /** @internal */
@@ -48186,7 +48210,9 @@ var init_table = __esm({
48186
48210
  type: "table",
48187
48211
  name: this.name,
48188
48212
  schema,
48189
- factor: this.factor
48213
+ factor: this.factor,
48214
+ keyColumn: this.keyColumn,
48215
+ tags: this.tags
48190
48216
  };
48191
48217
  }
48192
48218
  async getRow(props) {