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