@lunnoa/client 1.5.0 → 2.0.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.js CHANGED
@@ -701,12 +701,12 @@ var AgentsResource = class {
701
701
  });
702
702
  }
703
703
  /**
704
- * Upsert an agent by project-scoped slug.
704
+ * Upsert an agent by slug inside the workspace on the API key.
705
705
  * Prefer the CLI (`npx @lunnoa/client agents deploy`) for happy-path deploy.
706
706
  */
707
- upsertBySlug(projectId, body, options) {
707
+ upsertBySlug(body, options) {
708
708
  const payload = "kind" in body && body.kind === "agent" ? agentDefinitionToUpsert(body, options) : body;
709
- return this.http.post(`/api/projects/${projectId}/agents/upsert`, {
709
+ return this.http.post("/api/agents/upsert", {
710
710
  body: payload
711
711
  });
712
712
  }
@@ -1130,10 +1130,8 @@ var TablesResource = class {
1130
1130
  }
1131
1131
  http;
1132
1132
  /** Lists tables in the API key's workspace (without columns and rows). */
1133
- list(options = {}) {
1134
- return this.http.get("/api/tables", {
1135
- query: { projectId: options.projectId }
1136
- });
1133
+ list() {
1134
+ return this.http.get("/api/tables");
1137
1135
  }
1138
1136
  /** Returns a single table by ID, including columns and rows. */
1139
1137
  get(id) {
@@ -1553,30 +1551,6 @@ var KnowledgeResource = class {
1553
1551
  }
1554
1552
  };
1555
1553
 
1556
- // src/resources/projects.ts
1557
- var ProjectsResource = class {
1558
- constructor(http) {
1559
- this.http = http;
1560
- }
1561
- http;
1562
- /** Lists projects in the workspace, most recently updated first. */
1563
- list(options) {
1564
- return this.http.get("/api/projects", {
1565
- query: serializeListQuery(options)
1566
- });
1567
- }
1568
- /** Returns a single project. */
1569
- get(projectId, options) {
1570
- return this.http.get(`/api/projects/${projectId}`, {
1571
- query: serializeListQuery(options)
1572
- });
1573
- }
1574
- /** Creates a project. */
1575
- create(data) {
1576
- return this.http.post("/api/projects", { body: data });
1577
- }
1578
- };
1579
-
1580
1554
  // src/resources/queue-items.ts
1581
1555
  var QueueItemsResource = class {
1582
1556
  constructor(http) {
@@ -1856,7 +1830,7 @@ var RunsResource = class {
1856
1830
  * Start a linear multi-step ad-hoc Execution.
1857
1831
  *
1858
1832
  * Accepts a `defineWorkflow` result, a step array, or an explicit
1859
- * `{ steps, projectId?, name? }` payload.
1833
+ * `{ steps, name? }` payload.
1860
1834
  */
1861
1835
  start(input) {
1862
1836
  const options = normalizeStartRunInput(input);
@@ -2074,15 +2048,14 @@ var WorkflowsResource = class {
2074
2048
  });
2075
2049
  }
2076
2050
  /**
2077
- * Upsert a workflow by project-scoped slug from a linear step list.
2051
+ * Upsert a workflow by slug inside the workspace on the API key.
2078
2052
  * Prefer the CLI (`npx @lunnoa/client workflows deploy`) for happy-path deploy.
2079
2053
  */
2080
- upsertBySlug(projectId, body) {
2054
+ upsertBySlug(body) {
2081
2055
  const payload = "kind" in body && body.kind === "workflow" ? workflowDefinitionToUpsert(body) : body;
2082
- return this.http.post(
2083
- `/api/projects/${projectId}/workflows/upsert`,
2084
- { body: payload }
2085
- );
2056
+ return this.http.post("/api/workflows/upsert", {
2057
+ body: payload
2058
+ });
2086
2059
  }
2087
2060
  /**
2088
2061
  * Starts a new execution of the workflow with the given trigger inputs.
@@ -2144,7 +2117,6 @@ var LunnoaClient = class {
2144
2117
  variables;
2145
2118
  scorecards;
2146
2119
  connections;
2147
- projects;
2148
2120
  workflowApps;
2149
2121
  discovery;
2150
2122
  constructor(options) {
@@ -2168,7 +2140,6 @@ var LunnoaClient = class {
2168
2140
  this.variables = new VariablesResource(this.http);
2169
2141
  this.scorecards = new ScorecardsResource(this.http);
2170
2142
  this.connections = new ConnectionsResource(this.http);
2171
- this.projects = new ProjectsResource(this.http);
2172
2143
  this.discovery = new DiscoveryResource(this.http);
2173
2144
  }
2174
2145
  };
@@ -2245,6 +2216,6 @@ function createServerClient(options) {
2245
2216
  });
2246
2217
  }
2247
2218
 
2248
- export { API_KEY_PREFIX, ActionsResource, AgentChatClient, AgentChatStream, AgentsResource, ApprovalsResource, AuthResource, ConnectionsResource, DEFINE_KINDS, DiscoveryResource, EntitiesResource, EntityTypesResource, ExecutionProgressStream, ExecutionTimeoutError, ExecutionsResource, HttpClient, KnowledgeResource, LunnoaApiError, LunnoaClient, ProjectsResource, QueueItemsResource, QueuesResource, RunsResource, ScorecardsResource, SsoAuthResource, TablesResource, TasksResource, VariablesResource, WorkflowAppsResource, WorkflowsResource, assertApiKeyAllowedInEnvironment, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, parseSseEvents, parseSseStream, resolveActionAppId, resolveActionId };
2219
+ export { API_KEY_PREFIX, ActionsResource, AgentChatClient, AgentChatStream, AgentsResource, ApprovalsResource, AuthResource, ConnectionsResource, DEFINE_KINDS, DiscoveryResource, EntitiesResource, EntityTypesResource, ExecutionProgressStream, ExecutionTimeoutError, ExecutionsResource, HttpClient, KnowledgeResource, LunnoaApiError, LunnoaClient, QueueItemsResource, QueuesResource, RunsResource, ScorecardsResource, SsoAuthResource, TablesResource, TasksResource, VariablesResource, WorkflowAppsResource, WorkflowsResource, assertApiKeyAllowedInEnvironment, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, parseSseEvents, parseSseStream, resolveActionAppId, resolveActionId };
2249
2220
  //# sourceMappingURL=index.js.map
2250
2221
  //# sourceMappingURL=index.js.map