@onyx.dev/onyx-database 2.1.1 → 2.3.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.
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // package.json
4
4
  var name = "@onyx.dev/onyx-database";
5
- var version = "2.1.1";
5
+ var version = "2.3.0";
6
6
 
7
7
  // src/config/defaults.ts
8
8
  var DEFAULT_BASE_URL = "https://api.onyx.dev";
@@ -1427,6 +1427,27 @@ var OnyxDatabaseImpl = class {
1427
1427
  const { http } = await this.ensureAiClient();
1428
1428
  return http.request("POST", "/api/script-approvals", input);
1429
1429
  }
1430
+ async predict(publishedModelId, inputs) {
1431
+ const { http, databaseId } = await this.ensureClient();
1432
+ const path = `/data/${encodeURIComponent(
1433
+ databaseId
1434
+ )}/model-builder/published-model/${encodeURIComponent(publishedModelId)}/predict`;
1435
+ return http.request(
1436
+ "POST",
1437
+ path,
1438
+ serializeDates({ inputs })
1439
+ );
1440
+ }
1441
+ async predictFromScript(publishedModelId, scriptId, scriptParameters = {}) {
1442
+ const { http, databaseId } = await this.ensureClient();
1443
+ const path = `/data/${encodeURIComponent(
1444
+ databaseId
1445
+ )}/model-builder/published-model/${encodeURIComponent(publishedModelId)}/predict/script`;
1446
+ return http.request("POST", path, {
1447
+ scriptId,
1448
+ scriptParameters
1449
+ });
1450
+ }
1430
1451
  from(table) {
1431
1452
  return new QueryBuilderImpl(this, String(table), this.defaultPartition);
1432
1453
  }