@onyx.dev/onyx-database 2.1.0 → 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.0";
5
+ var version = "2.3.0";
6
6
 
7
7
  // src/config/defaults.ts
8
8
  var DEFAULT_BASE_URL = "https://api.onyx.dev";
@@ -228,7 +228,6 @@ async function resolveConfig(input) {
228
228
  const maxRetries = retryConfig.maxRetries ?? 3;
229
229
  const retryInitialDelayMs = retryConfig.initialDelayMs ?? 300;
230
230
  const missing = [];
231
- if (!databaseId) missing.push("databaseId");
232
231
  if (!apiKey) missing.push("apiKey");
233
232
  if (!apiSecret) missing.push("apiSecret");
234
233
  if (missing.length) {
@@ -1428,6 +1427,27 @@ var OnyxDatabaseImpl = class {
1428
1427
  const { http } = await this.ensureAiClient();
1429
1428
  return http.request("POST", "/api/script-approvals", input);
1430
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
+ }
1431
1451
  from(table) {
1432
1452
  return new QueryBuilderImpl(this, String(table), this.defaultPartition);
1433
1453
  }