latticesql 1.13.6 → 1.13.7
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 +2 -0
- package/dist/cli.js +36 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2201,6 +2201,8 @@ The cloud rejects redemption if the caller's claimed email doesn't match the inv
|
|
|
2201
2201
|
|
|
2202
2202
|
**Same flows from the GUI.** The local `lattice gui` Project Config view drives the entire teams lifecycle — create / join, invite by email, share tables, link rows, see sync status. Identity (display name + email) comes from `~/.lattice/identity.json` and is prefilled in every modal.
|
|
2203
2203
|
|
|
2204
|
+
**Joining via the GUI is one click (v1.13.7+).** When you click "Join via invite" and the redeem succeeds, the team's cloud URL is automatically saved as a switchable database credential and a sibling YAML config is written to your project directory. The new entry shows up in the database dropdown as `<team-name>.config`. Clicking it opens the SPA with the team's shared tables already populated — no YAML editing, no `db.define()` calls.
|
|
2205
|
+
|
|
2204
2206
|
**Cloud server mode**: `lattice gui --team-cloud` boots the same binary as a cloud server. It exposes the bearer-token-gated `/api/team*` endpoints + the `/objects`/`/changes`/`/rows`/`/links` sync routes, and disables the local dev-tool surface (table viewer, CRUD endpoints, register-and-create modal).
|
|
2205
2207
|
|
|
2206
2208
|
The full architecture, schema, and HTTP surface live in [docs/teams.md](./docs/teams.md).
|
package/dist/cli.js
CHANGED
|
@@ -12262,8 +12262,19 @@ async function listenWithPortFallback(server, startPort, host) {
|
|
|
12262
12262
|
}
|
|
12263
12263
|
async function entitiesWithCounts(db, configPath, outputDir) {
|
|
12264
12264
|
const payload = getGuiEntities(configPath, outputDir);
|
|
12265
|
+
const yamlNames = new Set(payload.tables.map((t) => t.name));
|
|
12266
|
+
const extraTables = db.getRegisteredTableNames().filter((name) => !yamlNames.has(name)).filter((name) => !name.startsWith("__lattice_")).filter((name) => !name.startsWith("_lattice_")).map((name) => {
|
|
12267
|
+
const cols = db.getRegisteredColumns(name) ?? {};
|
|
12268
|
+
return {
|
|
12269
|
+
name,
|
|
12270
|
+
columns: Object.keys(cols),
|
|
12271
|
+
outputFile: `.schema-only/${name}.md`,
|
|
12272
|
+
relations: {}
|
|
12273
|
+
};
|
|
12274
|
+
});
|
|
12275
|
+
const allTables = [...payload.tables, ...extraTables];
|
|
12265
12276
|
const enrichedTables = await Promise.all(
|
|
12266
|
-
|
|
12277
|
+
allTables.map(async (t) => {
|
|
12267
12278
|
const rowCount = t.columns.includes("deleted_at") ? await db.count(t.name, { filters: [{ col: "deleted_at", op: "isNull" }] }) : await db.count(t.name);
|
|
12268
12279
|
return { ...t, rowCount };
|
|
12269
12280
|
})
|
|
@@ -12465,6 +12476,30 @@ async function openConfig(configPath, outputDir) {
|
|
|
12465
12476
|
);
|
|
12466
12477
|
const teamsClient = new TeamsClient(db);
|
|
12467
12478
|
await teamsClient.attachWriteHooks();
|
|
12479
|
+
try {
|
|
12480
|
+
const connections = await teamsClient.listConnections();
|
|
12481
|
+
for (const conn of connections) {
|
|
12482
|
+
try {
|
|
12483
|
+
const result = await teamsClient.syncSharedSchemas(conn);
|
|
12484
|
+
for (const obj of result.applied) {
|
|
12485
|
+
validTables.add(obj.table);
|
|
12486
|
+
}
|
|
12487
|
+
if (result.conflicts.length > 0) {
|
|
12488
|
+
console.warn(
|
|
12489
|
+
`[openConfig] schema conflicts on team ${conn.team_name}:`,
|
|
12490
|
+
result.conflicts.map((c) => `${c.table}: ${c.reason}`).join("; ")
|
|
12491
|
+
);
|
|
12492
|
+
}
|
|
12493
|
+
} catch (e) {
|
|
12494
|
+
console.warn(
|
|
12495
|
+
`[openConfig] could not auto-sync shared schemas for team ${conn.team_name}:`,
|
|
12496
|
+
e.message
|
|
12497
|
+
);
|
|
12498
|
+
}
|
|
12499
|
+
}
|
|
12500
|
+
} catch (e) {
|
|
12501
|
+
console.warn("[openConfig] could not enumerate team connections:", e.message);
|
|
12502
|
+
}
|
|
12468
12503
|
return {
|
|
12469
12504
|
configPath,
|
|
12470
12505
|
outputDir,
|
package/package.json
CHANGED