rhythia-api 55.0.0 → 57.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.
package/api/createUser.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import z from "zod";
2
2
 
3
3
  export const Schema = {
4
- url: "/api/createUser",
5
4
  input: z.object({
6
5
  name: z.string(),
7
6
  age: z.number(),
package/index.ts CHANGED
@@ -2,11 +2,11 @@ import { handleApi } from "./handleApi"
2
2
 
3
3
  // ./api/createUser.ts API
4
4
  import { Schema as CreateUser } from "./api/createUser"
5
- export { Schema as CreateUser } from "./api/createUser"
6
- export const createUser = handleApi(CreateUser)
5
+ export { Schema as SchemaCreateUser } from "./api/createUser"
6
+ export const createUser = handleApi({url:"/api/createUser",...CreateUser})
7
7
 
8
8
  // ./api/editUser.ts API
9
9
  import { Schema as EditUser } from "./api/editUser"
10
- export { Schema as EditUser } from "./api/editUser"
11
- export const editUser = handleApi(EditUser)
10
+ export { Schema as SchemaEditUser } from "./api/editUser"
11
+ export const editUser = handleApi({url:"/api/editUser",...EditUser})
12
12
  export { handleApi } from "./handleApi"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhythia-api",
3
- "version": "55.0.0",
3
+ "version": "57.0.0",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "update": "bun scripts/update.ts",
package/scripts/update.ts CHANGED
@@ -31,11 +31,13 @@ for (const api of apis) {
31
31
  `import { Schema as ${upperFirst(apiName)} } from "./api/${apiName}"`
32
32
  );
33
33
  exports.push(
34
- `export { Schema as ${upperFirst(apiName)} } from "./api/${apiName}"`
34
+ `export { Schema as Schema${upperFirst(apiName)} } from "./api/${apiName}"`
35
35
  );
36
36
 
37
37
  exports.push(
38
- `export const ${lowerFirst(apiName)} = handleApi(${upperFirst(apiName)})`
38
+ `export const ${lowerFirst(
39
+ apiName
40
+ )} = handleApi({url:"/api/${apiName}",...${upperFirst(apiName)}})`
39
41
  );
40
42
  }
41
43
  exports.push(`export { handleApi } from "./handleApi"`);