@lunnoa/client 1.3.0 → 1.5.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 +15 -5
- package/dist/cli.js +232 -17
- package/dist/index.cjs +37 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1331 -1066
- package/dist/index.d.ts +1331 -1066
- package/dist/index.js +37 -3
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +56 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +704 -613
- package/dist/react.d.ts +704 -613
- package/dist/react.js +56 -3
- package/dist/react.js.map +1 -1
- package/package.json +3 -6
- package/skills/lunnoa-client/SKILL.md +18 -6
- package/skills/lunnoa-solution-design/SKILL.md +20 -4
package/dist/react.js
CHANGED
|
@@ -5,6 +5,24 @@ import { DefaultChatTransport } from 'ai';
|
|
|
5
5
|
// src/react/auth.tsx
|
|
6
6
|
|
|
7
7
|
// src/auth/token-store.ts
|
|
8
|
+
function createMemoryTokenStore(initial) {
|
|
9
|
+
let accessToken = null;
|
|
10
|
+
let refreshToken = null;
|
|
11
|
+
return {
|
|
12
|
+
getAccessToken: () => accessToken,
|
|
13
|
+
getRefreshToken: () => refreshToken,
|
|
14
|
+
setTokens: (tokens) => {
|
|
15
|
+
accessToken = tokens.accessToken;
|
|
16
|
+
if (tokens.refreshToken !== void 0) {
|
|
17
|
+
refreshToken = tokens.refreshToken;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
clear: () => {
|
|
21
|
+
accessToken = null;
|
|
22
|
+
refreshToken = null;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
8
26
|
function createLocalStorageTokenStore(options = {}) {
|
|
9
27
|
const accessTokenKey = options.accessTokenKey ?? "accessToken";
|
|
10
28
|
const refreshTokenKey = options.refreshTokenKey ?? "refreshToken";
|
|
@@ -1063,7 +1081,7 @@ var EntityTypesResource = class {
|
|
|
1063
1081
|
}
|
|
1064
1082
|
http;
|
|
1065
1083
|
/**
|
|
1066
|
-
* Lists entity types
|
|
1084
|
+
* Lists entity types granted to the API key's workspace. Request
|
|
1067
1085
|
* `expansion: ['attributeSchema', 'stateSchema']` for the field and state
|
|
1068
1086
|
* machine definitions the codegen CLI builds types from.
|
|
1069
1087
|
*/
|
|
@@ -1088,7 +1106,9 @@ var EntityTypesResource = class {
|
|
|
1088
1106
|
});
|
|
1089
1107
|
}
|
|
1090
1108
|
/**
|
|
1091
|
-
* Creates or updates an entity type by
|
|
1109
|
+
* Creates or updates an entity type by deployment-wide slug.
|
|
1110
|
+
* A new slug is granted to the API key's workspace. A slug already shared
|
|
1111
|
+
* with another workspace is rejected unless the key belongs to a platform admin.
|
|
1092
1112
|
* Prefer the CLI (`npx @lunnoa/client entity-types deploy`) for happy-path deploy.
|
|
1093
1113
|
*/
|
|
1094
1114
|
upsertBySlug(definition) {
|
|
@@ -1102,6 +1122,35 @@ var EntityTypesResource = class {
|
|
|
1102
1122
|
}
|
|
1103
1123
|
};
|
|
1104
1124
|
|
|
1125
|
+
// src/resources/tables.ts
|
|
1126
|
+
var TablesResource = class {
|
|
1127
|
+
constructor(http) {
|
|
1128
|
+
this.http = http;
|
|
1129
|
+
}
|
|
1130
|
+
http;
|
|
1131
|
+
/** Lists tables in the API key's workspace (without columns and rows). */
|
|
1132
|
+
list(options = {}) {
|
|
1133
|
+
return this.http.get("/api/tables", {
|
|
1134
|
+
query: { projectId: options.projectId }
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
/** Returns a single table by ID, including columns and rows. */
|
|
1138
|
+
get(id) {
|
|
1139
|
+
return this.http.get(`/api/tables/${id}`);
|
|
1140
|
+
}
|
|
1141
|
+
/** Returns a single table by its workspace slug, including columns and rows. */
|
|
1142
|
+
getBySlug(slug) {
|
|
1143
|
+
return this.http.get(`/api/tables/slug/${slug}`);
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Creates or updates a table by workspace slug. Omitted columns or rows
|
|
1147
|
+
* keep their current value. Marks `managedByCode` by default.
|
|
1148
|
+
*/
|
|
1149
|
+
upsertBySlug(input) {
|
|
1150
|
+
return this.http.post("/api/tables/upsert", { body: input });
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1105
1154
|
// src/resources/approvals.ts
|
|
1106
1155
|
var ApprovalsResource = class {
|
|
1107
1156
|
constructor(http) {
|
|
@@ -2086,6 +2135,8 @@ var LunnoaClient = class {
|
|
|
2086
2135
|
approvals;
|
|
2087
2136
|
entities;
|
|
2088
2137
|
entityTypes;
|
|
2138
|
+
/** Small reference / lookup tables (rows stored inline; use entities for transactional data). */
|
|
2139
|
+
tables;
|
|
2089
2140
|
knowledge;
|
|
2090
2141
|
queues;
|
|
2091
2142
|
queueItems;
|
|
@@ -2109,6 +2160,7 @@ var LunnoaClient = class {
|
|
|
2109
2160
|
this.workflows = new WorkflowsResource(this.http, this.executions);
|
|
2110
2161
|
this.entities = new EntitiesResource(this.http);
|
|
2111
2162
|
this.entityTypes = new EntityTypesResource(this.http);
|
|
2163
|
+
this.tables = new TablesResource(this.http);
|
|
2112
2164
|
this.knowledge = new KnowledgeResource(this.http);
|
|
2113
2165
|
this.queues = new QueuesResource(this.http);
|
|
2114
2166
|
this.queueItems = new QueueItemsResource(this.http);
|
|
@@ -2146,7 +2198,8 @@ function resolveClient(props) {
|
|
|
2146
2198
|
}
|
|
2147
2199
|
return createBrowserClient({
|
|
2148
2200
|
baseUrl: options.baseUrl,
|
|
2149
|
-
|
|
2201
|
+
// SSR (e.g. Next.js) has no localStorage; the browser builds its own client on hydration.
|
|
2202
|
+
tokenStore: options.tokenStore ?? (typeof window === "undefined" ? createMemoryTokenStore() : void 0),
|
|
2150
2203
|
autoRefresh: options.autoRefresh,
|
|
2151
2204
|
fetch: options.fetch,
|
|
2152
2205
|
headers: options.headers
|