@quickscores/chat 0.1.1 → 0.2.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 CHANGED
@@ -5,7 +5,7 @@ Shared TypeScript types and Zod schemas for the QuickScores chat API. Use from R
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install @quickscores/chat
8
+ pnpm add @quickscores/chat
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -29,7 +29,7 @@ export declare const threadSchema: z.ZodObject<{
29
29
  }, z.core.$strip>;
30
30
  export type Thread = z.infer<typeof threadSchema>;
31
31
  /**
32
- * Thread list row – one row per thread from chat_thread_list view.
32
+ * Thread list row – one row from GET /chat-threads (includes channel and optional team/league fields).
33
33
  */
34
34
  export declare const threadListRowSchema: z.ZodObject<{
35
35
  thread_id: z.ZodString;
@@ -47,8 +47,15 @@ export declare const threadListRowSchema: z.ZodObject<{
47
47
  last_read_message_id: z.ZodNullable<z.ZodString>;
48
48
  last_message_at: z.ZodNullable<z.ZodString>;
49
49
  last_message_preview: z.ZodNullable<z.ZodString>;
50
+ last_message_by: z.ZodNullable<z.ZodString>;
50
51
  unread_count: z.ZodNumber;
51
52
  other_participant_ids: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
53
+ team_id: z.ZodNullable<z.ZodNumber>;
54
+ league_id: z.ZodNullable<z.ZodNumber>;
55
+ team_name: z.ZodNullable<z.ZodString>;
56
+ league_name: z.ZodNullable<z.ZodString>;
57
+ sport_type: z.ZodNullable<z.ZodString>;
58
+ channel: z.ZodString;
52
59
  }, z.core.$strip>;
53
60
  export type ThreadListRow = z.infer<typeof threadListRowSchema>;
54
61
  //# sourceMappingURL=thread.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/types/thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;EAA4C,CAAC;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;iBAQvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAa9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/types/thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;EAA4C,CAAC;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;iBAQvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;iBAoB9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -20,7 +20,7 @@ exports.threadSchema = zod_1.z.object({
20
20
  created_at: zod_1.z.string(),
21
21
  });
22
22
  /**
23
- * Thread list row – one row per thread from chat_thread_list view.
23
+ * Thread list row – one row from GET /chat-threads (includes channel and optional team/league fields).
24
24
  */
25
25
  exports.threadListRowSchema = zod_1.z.object({
26
26
  thread_id: zod_1.z.string().uuid(),
@@ -33,6 +33,13 @@ exports.threadListRowSchema = zod_1.z.object({
33
33
  last_read_message_id: zod_1.z.string().uuid().nullable(),
34
34
  last_message_at: zod_1.z.string().nullable(),
35
35
  last_message_preview: zod_1.z.string().nullable(),
36
+ last_message_by: zod_1.z.string().nullable(),
36
37
  unread_count: zod_1.z.number().int().min(0),
37
38
  other_participant_ids: zod_1.z.array(zod_1.z.number().int()).nullable(),
39
+ team_id: zod_1.z.number().int().nullable(),
40
+ league_id: zod_1.z.number().int().nullable(),
41
+ team_name: zod_1.z.string().nullable(),
42
+ league_name: zod_1.z.string().nullable(),
43
+ sport_type: zod_1.z.string().nullable(),
44
+ channel: zod_1.z.string(),
38
45
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quickscores/chat",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "description": "Shared chat types and Zod schemas for QuickScores (RN, web)",
6
6
  "main": "./dist/types/index.js",
@@ -8,20 +8,6 @@
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
- "scripts": {
12
- "build": "tsc -p tsconfig.build.json",
13
- "prepublishOnly": "npm run build",
14
- "db:start": "supabase start",
15
- "db:stop": "supabase stop",
16
- "db:reset": "supabase db reset",
17
- "db:migrate": "supabase db push",
18
- "db:diff": "supabase db diff -f",
19
- "types:check": "tsc --noEmit",
20
- "lint": "prettier --check \"src/**/*.ts\" \"scripts/**/*.ts\" \"supabase/functions/**/*.ts\"",
21
- "lint:fix": "prettier --write \"src/**/*.ts\" \"scripts/**/*.ts\" \"supabase/functions/**/*.ts\"",
22
- "test:api": "tsx scripts/test-chat-api.ts",
23
- "test:league-team-rooms": "tsx scripts/test-league-team-rooms.ts"
24
- },
25
11
  "dependencies": {
26
12
  "zod": "4.3.5"
27
13
  },
@@ -52,5 +38,19 @@
52
38
  "import": "./dist/types/index.js",
53
39
  "default": "./dist/types/index.js"
54
40
  }
41
+ },
42
+ "scripts": {
43
+ "build": "tsc -p tsconfig.build.json",
44
+ "db:start": "supabase start",
45
+ "db:stop": "supabase stop",
46
+ "db:reset": "supabase db reset",
47
+ "db:migrate": "supabase db push",
48
+ "db:diff": "supabase db diff -f",
49
+ "functions:serve": "supabase functions serve --env-file supabase/functions/.env",
50
+ "types:check": "tsc --noEmit",
51
+ "lint": "prettier --check \"src/**/*.ts\" \"scripts/**/*.ts\" \"supabase/functions/**/*.ts\"",
52
+ "lint:fix": "prettier --write \"src/**/*.ts\" \"scripts/**/*.ts\" \"supabase/functions/**/*.ts\"",
53
+ "test:api": "tsx scripts/test-chat-api.ts",
54
+ "test:league-team-rooms": "tsx scripts/test-league-team-rooms.ts"
55
55
  }
56
- }
56
+ }