rhythia-api 63.0.0 → 64.0.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.
@@ -6,23 +6,22 @@ export const Schema = {
6
6
  input: z.object({
7
7
  id: z.string(),
8
8
  }),
9
- output: z
10
- .object({
11
- about_me: z.string().nullable(),
12
- avatar_url: z.string().nullable(),
13
- badges: z.any().nullable(),
14
- created_at: z.number().nullable(),
15
- flag: z.string().nullable(),
16
- id: z.number(),
17
- uid: z.string().nullable(),
18
- username: z.string().nullable(),
19
- verified: z.boolean().nullable(),
20
- })
21
- .or(
22
- z.object({
23
- error: z.string(),
9
+ output: z.object({
10
+ error: z.string().optional(),
11
+ user: z
12
+ .object({
13
+ about_me: z.string().nullable(),
14
+ avatar_url: z.string().nullable(),
15
+ badges: z.any().nullable(),
16
+ created_at: z.number().nullable(),
17
+ flag: z.string().nullable(),
18
+ id: z.number(),
19
+ uid: z.string().nullable(),
20
+ username: z.string().nullable(),
21
+ verified: z.boolean().nullable(),
24
22
  })
25
- ),
23
+ .optional(),
24
+ }),
26
25
  };
27
26
 
28
27
  const supabase = createClient<Database>(
@@ -55,6 +54,8 @@ export async function GET(
55
54
 
56
55
  const user = profiles[0];
57
56
  return {
58
- ...user,
57
+ user: {
58
+ ...user,
59
+ },
59
60
  };
60
61
  }
package/index.ts CHANGED
@@ -5,8 +5,8 @@ import { Schema as EditUser } from "./api/editUser"
5
5
  export { Schema as SchemaEditUser } from "./api/editUser"
6
6
  export const editUser = handleApi({url:"/api/editUser",...EditUser})
7
7
 
8
- // ./api/getUser.ts API
9
- import { Schema as GetUser } from "./api/getUser"
10
- export { Schema as SchemaGetUser } from "./api/getUser"
11
- export const getUser = handleApi({url:"/api/getUser",...GetUser})
8
+ // ./api/getProfile.ts API
9
+ import { Schema as GetProfile } from "./api/getProfile"
10
+ export { Schema as SchemaGetProfile } from "./api/getProfile"
11
+ export const getProfile = handleApi({url:"/api/getProfile",...GetProfile})
12
12
  export { handleApi } from "./handleApi"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhythia-api",
3
- "version": "63.0.0",
3
+ "version": "64.0.0",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "update": "bun ./scripts/update.ts",
@@ -2,6 +2,7 @@ import fs from "fs";
2
2
  import * as git from "isomorphic-git";
3
3
  import http from "isomorphic-git/http/node";
4
4
  import path from "path";
5
+ import { getUser } from "..";
5
6
 
6
7
  // Set up the repository URL
7
8
  const repoUrl = `https://${process.env.GIT_KEY}@github.com/cunev/rhythia-api.git`;
@@ -74,3 +75,7 @@ async function cloneBranch() {
74
75
  }
75
76
 
76
77
  cloneBranch();
78
+
79
+ const user = await getUser({ id: "0" });
80
+ if (user) {
81
+ }