@tscircuit/cli 0.0.82 → 0.0.84

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/bun.lockb CHANGED
Binary file
Binary file
@@ -12,6 +12,7 @@ export default withEdgeSpec({
12
12
  dev_package_example_id: z.coerce.number(),
13
13
  file_path: z.string(),
14
14
  tscircuit_soup: z.any(),
15
+ completed_edit_events: z.array(z.any()).nullable().default(null),
15
16
  is_loading: z.boolean(),
16
17
  error: z.string().nullable().optional().default(null),
17
18
  last_updated_at: z.string().datetime(),
@@ -35,6 +36,9 @@ export default withEdgeSpec({
35
36
  ...r,
36
37
  is_loading: r.is_loading === 1,
37
38
  tscircuit_soup: JSON.parse(r.tscircuit_soup),
39
+ completed_edit_events: r.completed_edit_events
40
+ ? JSON.parse(r.completed_edit_events)
41
+ : null,
38
42
  })),
39
43
  })
40
44
  })
@@ -24,6 +24,7 @@ export default withEdgeSpec({
24
24
  "file_path",
25
25
  "export_name",
26
26
  "last_updated_at",
27
+ "soup_last_updated_at",
27
28
  sql`(is_loading = 1)`.$castTo<boolean>().as("is_loading"),
28
29
  ])
29
30
  .execute()
@@ -7,6 +7,7 @@ export default withEdgeSpec({
7
7
  jsonBody: z.object({
8
8
  dev_package_example_id: z.coerce.number(),
9
9
  tscircuit_soup: z.any().optional(),
10
+ completed_edit_events: z.array(z.any()).optional(),
10
11
  error: z.string().nullable().optional().default(null),
11
12
  }),
12
13
  jsonResponse: z.object({
@@ -23,10 +24,23 @@ export default withEdgeSpec({
23
24
  dev_package_example: await ctx.db
24
25
  .updateTable("dev_package_example")
25
26
  .set({
26
- tscircuit_soup: req.jsonBody.tscircuit_soup,
27
- error: req.jsonBody.error,
28
27
  last_updated_at: new Date().toISOString(),
29
28
  })
29
+ .$if(req.jsonBody.tscircuit_soup !== undefined, (q) =>
30
+ q
31
+ .set("tscircuit_soup", req.jsonBody.tscircuit_soup)
32
+ .set("error", null)
33
+ .set("soup_last_updated_at", new Date().toISOString())
34
+ )
35
+ .$if(req.jsonBody.error !== undefined, (q) =>
36
+ q.set("error", req.jsonBody.error)
37
+ )
38
+ .$if(req.jsonBody.completed_edit_events !== undefined, (q) =>
39
+ q.set(
40
+ "completed_edit_events",
41
+ JSON.stringify(req.jsonBody.completed_edit_events)
42
+ )
43
+ )
30
44
  .returningAll()
31
45
  .where("dev_package_example_id", "=", req.jsonBody.dev_package_example_id)
32
46
  .executeTakeFirstOrThrow(),
@@ -1,6 +1,7 @@
1
1
  import type { DbClient } from "./get-db"
2
2
 
3
3
  export const createSchema = async (db: DbClient) => {
4
+ console.log("Creating schema...")
4
5
  await db.schema
5
6
  .createTable("dev_package_example")
6
7
  .addColumn("dev_package_example_id", "integer", (col) =>
@@ -9,8 +10,10 @@ export const createSchema = async (db: DbClient) => {
9
10
  .addColumn("file_path", "text", (col) => col.unique())
10
11
  .addColumn("export_name", "text")
11
12
  .addColumn("tscircuit_soup", "json")
13
+ .addColumn("completed_edit_events", "json")
12
14
  .addColumn("error", "text")
13
15
  .addColumn("is_loading", "boolean", (cb) => cb.defaultTo(0).notNull())
16
+ .addColumn("soup_last_updated_at", "text")
14
17
  .addColumn("last_updated_at", "text")
15
18
  .execute()
16
19
 
@@ -6,11 +6,13 @@ import * as Path from "path"
6
6
  export interface DevPackageExample {
7
7
  dev_package_example_id: Generated<number>
8
8
  tscircuit_soup: any
9
+ completed_edit_events: any
9
10
  file_path: string
10
11
  export_name: string
11
12
  error: string | null
12
13
  is_loading: 1 | 0
13
14
  last_updated_at: string
15
+ soup_last_updated_at: string
14
16
  }
15
17
 
16
18
  export interface ExportRequest {
Binary file