@lunnoa/client 1.4.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
  }
@@ -1123,6 +1123,33 @@ var EntityTypesResource = class {
1123
1123
  }
1124
1124
  };
1125
1125
 
1126
+ // src/resources/tables.ts
1127
+ var TablesResource = class {
1128
+ constructor(http) {
1129
+ this.http = http;
1130
+ }
1131
+ http;
1132
+ /** Lists tables in the API key's workspace (without columns and rows). */
1133
+ list() {
1134
+ return this.http.get("/api/tables");
1135
+ }
1136
+ /** Returns a single table by ID, including columns and rows. */
1137
+ get(id) {
1138
+ return this.http.get(`/api/tables/${id}`);
1139
+ }
1140
+ /** Returns a single table by its workspace slug, including columns and rows. */
1141
+ getBySlug(slug) {
1142
+ return this.http.get(`/api/tables/slug/${slug}`);
1143
+ }
1144
+ /**
1145
+ * Creates or updates a table by workspace slug. Omitted columns or rows
1146
+ * keep their current value. Marks `managedByCode` by default.
1147
+ */
1148
+ upsertBySlug(input) {
1149
+ return this.http.post("/api/tables/upsert", { body: input });
1150
+ }
1151
+ };
1152
+
1126
1153
  // src/resources/approvals.ts
1127
1154
  var ApprovalsResource = class {
1128
1155
  constructor(http) {
@@ -1524,30 +1551,6 @@ var KnowledgeResource = class {
1524
1551
  }
1525
1552
  };
1526
1553
 
1527
- // src/resources/projects.ts
1528
- var ProjectsResource = class {
1529
- constructor(http) {
1530
- this.http = http;
1531
- }
1532
- http;
1533
- /** Lists projects in the workspace, most recently updated first. */
1534
- list(options) {
1535
- return this.http.get("/api/projects", {
1536
- query: serializeListQuery(options)
1537
- });
1538
- }
1539
- /** Returns a single project. */
1540
- get(projectId, options) {
1541
- return this.http.get(`/api/projects/${projectId}`, {
1542
- query: serializeListQuery(options)
1543
- });
1544
- }
1545
- /** Creates a project. */
1546
- create(data) {
1547
- return this.http.post("/api/projects", { body: data });
1548
- }
1549
- };
1550
-
1551
1554
  // src/resources/queue-items.ts
1552
1555
  var QueueItemsResource = class {
1553
1556
  constructor(http) {
@@ -1827,7 +1830,7 @@ var RunsResource = class {
1827
1830
  * Start a linear multi-step ad-hoc Execution.
1828
1831
  *
1829
1832
  * Accepts a `defineWorkflow` result, a step array, or an explicit
1830
- * `{ steps, projectId?, name? }` payload.
1833
+ * `{ steps, name? }` payload.
1831
1834
  */
1832
1835
  start(input) {
1833
1836
  const options = normalizeStartRunInput(input);
@@ -2045,15 +2048,14 @@ var WorkflowsResource = class {
2045
2048
  });
2046
2049
  }
2047
2050
  /**
2048
- * 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.
2049
2052
  * Prefer the CLI (`npx @lunnoa/client workflows deploy`) for happy-path deploy.
2050
2053
  */
2051
- upsertBySlug(projectId, body) {
2054
+ upsertBySlug(body) {
2052
2055
  const payload = "kind" in body && body.kind === "workflow" ? workflowDefinitionToUpsert(body) : body;
2053
- return this.http.post(
2054
- `/api/projects/${projectId}/workflows/upsert`,
2055
- { body: payload }
2056
- );
2056
+ return this.http.post("/api/workflows/upsert", {
2057
+ body: payload
2058
+ });
2057
2059
  }
2058
2060
  /**
2059
2061
  * Starts a new execution of the workflow with the given trigger inputs.
@@ -2107,13 +2109,14 @@ var LunnoaClient = class {
2107
2109
  approvals;
2108
2110
  entities;
2109
2111
  entityTypes;
2112
+ /** Small reference / lookup tables (rows stored inline; use entities for transactional data). */
2113
+ tables;
2110
2114
  knowledge;
2111
2115
  queues;
2112
2116
  queueItems;
2113
2117
  variables;
2114
2118
  scorecards;
2115
2119
  connections;
2116
- projects;
2117
2120
  workflowApps;
2118
2121
  discovery;
2119
2122
  constructor(options) {
@@ -2130,13 +2133,13 @@ var LunnoaClient = class {
2130
2133
  this.workflows = new WorkflowsResource(this.http, this.executions);
2131
2134
  this.entities = new EntitiesResource(this.http);
2132
2135
  this.entityTypes = new EntityTypesResource(this.http);
2136
+ this.tables = new TablesResource(this.http);
2133
2137
  this.knowledge = new KnowledgeResource(this.http);
2134
2138
  this.queues = new QueuesResource(this.http);
2135
2139
  this.queueItems = new QueueItemsResource(this.http);
2136
2140
  this.variables = new VariablesResource(this.http);
2137
2141
  this.scorecards = new ScorecardsResource(this.http);
2138
2142
  this.connections = new ConnectionsResource(this.http);
2139
- this.projects = new ProjectsResource(this.http);
2140
2143
  this.discovery = new DiscoveryResource(this.http);
2141
2144
  }
2142
2145
  };
@@ -2213,6 +2216,6 @@ function createServerClient(options) {
2213
2216
  });
2214
2217
  }
2215
2218
 
2216
- 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, 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 };
2217
2220
  //# sourceMappingURL=index.js.map
2218
2221
  //# sourceMappingURL=index.js.map