@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.
@@ -233,7 +233,6 @@ async function resolveConfig(input) {
233
233
  const maxRetries = retryConfig.maxRetries ?? 3;
234
234
  const retryInitialDelayMs = retryConfig.initialDelayMs ?? 300;
235
235
  const missing = [];
236
- if (!databaseId) missing.push("databaseId");
237
236
  if (!apiKey) missing.push("apiKey");
238
237
  if (!apiSecret) missing.push("apiSecret");
239
238
  if (missing.length) {
@@ -1559,6 +1558,27 @@ var OnyxDatabaseImpl = class {
1559
1558
  const { http } = await this.ensureAiClient();
1560
1559
  return http.request("POST", "/api/script-approvals", input);
1561
1560
  }
1561
+ async predict(publishedModelId, inputs) {
1562
+ const { http, databaseId } = await this.ensureClient();
1563
+ const path2 = `/data/${encodeURIComponent(
1564
+ databaseId
1565
+ )}/model-builder/published-model/${encodeURIComponent(publishedModelId)}/predict`;
1566
+ return http.request(
1567
+ "POST",
1568
+ path2,
1569
+ serializeDates({ inputs })
1570
+ );
1571
+ }
1572
+ async predictFromScript(publishedModelId, scriptId, scriptParameters = {}) {
1573
+ const { http, databaseId } = await this.ensureClient();
1574
+ const path2 = `/data/${encodeURIComponent(
1575
+ databaseId
1576
+ )}/model-builder/published-model/${encodeURIComponent(publishedModelId)}/predict/script`;
1577
+ return http.request("POST", path2, {
1578
+ scriptId,
1579
+ scriptParameters
1580
+ });
1581
+ }
1562
1582
  from(table) {
1563
1583
  return new QueryBuilderImpl(this, String(table), this.defaultPartition);
1564
1584
  }