@lunnoa/client 1.5.0 → 2.1.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/README.md +19 -47
- package/dist/cli.js +45 -114
- package/dist/index.cjs +14 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +169 -447
- package/dist/index.d.ts +169 -447
- package/dist/index.js +15 -44
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +14 -43
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +88 -237
- package/dist/react.d.ts +88 -237
- package/dist/react.js +14 -43
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/skills/lunnoa-client/SKILL.md +38 -38
- package/skills/lunnoa-solution-design/SKILL.md +11 -10
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ function isBrowserEnvironment() {
|
|
|
6
6
|
function assertApiKeyAllowedInEnvironment(apiKey) {
|
|
7
7
|
if (isBrowserEnvironment()) {
|
|
8
8
|
throw new Error(
|
|
9
|
-
"Refusing to use a Lunnoa API key (lna_...) in a browser environment. API keys are
|
|
9
|
+
"Refusing to use a Lunnoa API key (lna_...) in a browser environment. API keys are for the CLI and operator scripts, not for app login. Anyone opening dev tools could read the key and act as the service account across its whole workspace. Sign the end user in with lunnoa.auth.login and pass their JWT as `accessToken`."
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
12
|
if (!apiKey.startsWith(API_KEY_PREFIX)) {
|
|
@@ -88,7 +88,7 @@ var HttpClient = class {
|
|
|
88
88
|
}
|
|
89
89
|
if (!options.apiKey && !options.accessToken && !options.tokenStore) {
|
|
90
90
|
throw new Error(
|
|
91
|
-
"LunnoaClient requires an
|
|
91
|
+
"LunnoaClient requires an accessToken or tokenStore (Lunnoa user JWT), or an apiKey for operator scripts."
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
if (options.apiKey) {
|
|
@@ -701,12 +701,12 @@ var AgentsResource = class {
|
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
703
|
/**
|
|
704
|
-
* Upsert an agent by
|
|
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(
|
|
707
|
+
upsertBySlug(body, options) {
|
|
708
708
|
const payload = "kind" in body && body.kind === "agent" ? agentDefinitionToUpsert(body, options) : body;
|
|
709
|
-
return this.http.post(
|
|
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(
|
|
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,
|
|
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
|
|
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(
|
|
2054
|
+
upsertBySlug(body) {
|
|
2081
2055
|
const payload = "kind" in body && body.kind === "workflow" ? workflowDefinitionToUpsert(body) : body;
|
|
2082
|
-
return this.http.post(
|
|
2083
|
-
|
|
2084
|
-
|
|
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.
|
|
@@ -2117,7 +2090,7 @@ var WorkflowsResource = class {
|
|
|
2117
2090
|
var LunnoaClient = class {
|
|
2118
2091
|
/** The underlying HTTP layer, exposed for advanced/escape-hatch requests. */
|
|
2119
2092
|
http;
|
|
2120
|
-
/** Login, refresh, SSO discovery, and session helpers
|
|
2093
|
+
/** Login, refresh, SSO discovery, and session helpers for Lunnoa users. */
|
|
2121
2094
|
auth;
|
|
2122
2095
|
agents;
|
|
2123
2096
|
tasks;
|
|
@@ -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,
|
|
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
|