rhythia-api 155.0.0 → 156.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.
@@ -0,0 +1,23 @@
1
+ import { NextResponse } from "next/server";
2
+ import z from "zod";
3
+ import { protectedApi, validUser } from "../utils/requestUtils";
4
+
5
+ export const Schema = {
6
+ input: z.strictObject({}),
7
+ output: z.object({
8
+ time: z.number(),
9
+ }),
10
+ };
11
+
12
+ export async function POST(request: Request) {
13
+ return protectedApi({
14
+ request,
15
+ schema: Schema,
16
+ authorization: validUser,
17
+ activity: handler,
18
+ });
19
+ }
20
+
21
+ export async function handler(data: (typeof Schema)["input"]["_type"]) {
22
+ return NextResponse.json({ time: Date.now() });
23
+ }
package/index.ts CHANGED
@@ -494,6 +494,19 @@ import { Schema as GetScore } from "./api/getScore"
494
494
  export { Schema as SchemaGetScore } from "./api/getScore"
495
495
  export const getScore = handleApi({url:"/api/getScore",...GetScore})
496
496
 
497
+ // ./api/getTimestamp.ts API
498
+
499
+ /*
500
+ export const Schema = {
501
+ input: z.strictObject({}),
502
+ output: z.object({
503
+ time: z.number(),
504
+ }),
505
+ };*/
506
+ import { Schema as GetTimestamp } from "./api/getTimestamp"
507
+ export { Schema as SchemaGetTimestamp } from "./api/getTimestamp"
508
+ export const getTimestamp = handleApi({url:"/api/getTimestamp",...GetTimestamp})
509
+
497
510
  // ./api/getUserScores.ts API
498
511
 
499
512
  /*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhythia-api",
3
- "version": "155.0.0",
3
+ "version": "156.0.0",
4
4
  "main": "index.ts",
5
5
  "scripts": {
6
6
  "update": "bun ./scripts/update.ts",