File tree 7 files changed +8
-13
lines changed
7 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 1
1
import express from "express" ;
2
2
import { asAsync } from "@notainc/typed-api-spec/express" ;
3
- import { ToHandlers , typed } from "@notainc/typed-api-spec/express/ss " ;
3
+ import { ToHandlers , typed } from "@notainc/typed-api-spec/express" ;
4
4
import { pathMap } from "../../spec/valibot" ;
5
5
6
6
const emptyMiddleware = (
Original file line number Diff line number Diff line change 1
1
import express from "express" ;
2
2
import { pathMap } from "../../spec/zod" ;
3
- import { ToHandlers , typed } from "@notainc/typed-api-spec/express/ss " ;
3
+ import { ToHandlers , typed } from "@notainc/typed-api-spec/express" ;
4
4
import { asAsync } from "@notainc/typed-api-spec/express" ;
5
5
6
6
const emptyMiddleware = (
Original file line number Diff line number Diff line change 1
1
import { withValidation } from "@notainc/typed-api-spec/fetch" ;
2
2
import { z } from "zod" ;
3
3
import { SpecValidatorError } from "@notainc/typed-api-spec/fetch" ;
4
- import { SSApiEndpoints } from "@notainc/typed-api-spec/ss " ;
4
+ import { SSApiEndpoints } from "@notainc/typed-api-spec/core " ;
5
5
6
6
const GITHUB_API_ORIGIN = "https://api.github.com" ;
7
7
@@ -28,7 +28,7 @@ const main = async () => {
28
28
const fetchWithV = withValidation ( fetch , spec ) ;
29
29
const response = await fetchWithV (
30
30
`${ GITHUB_API_ORIGIN } /repos/nota/typed-api-spec/topics?page=1` ,
31
- { headers : { Accept : "application/vnd.github+json" } }
31
+ { headers : { Accept : "application/vnd.github+json" } } ,
32
32
) ;
33
33
if ( ! response . ok ) {
34
34
const { message } = await response . json ( ) ;
@@ -44,7 +44,7 @@ const main = async () => {
44
44
try {
45
45
await fetchWithV (
46
46
`${ GITHUB_API_ORIGIN } /repos/nota/typed-api-spec/topics?page=1` ,
47
- { headers : { Accept : "application/vnd.github+json" } }
47
+ { headers : { Accept : "application/vnd.github+json" } } ,
48
48
) ;
49
49
} catch ( e ) {
50
50
if ( e instanceof SpecValidatorError ) {
Original file line number Diff line number Diff line change 1
- import { SSApiEndpoints , ToApiEndpoints } from "@notainc/typed-api-spec/ss " ;
1
+ import { SSApiEndpoints , ToApiEndpoints } from "@notainc/typed-api-spec/core " ;
2
2
import * as v from "valibot" ;
3
3
4
4
const JsonHeader = v . object ( {
Original file line number Diff line number Diff line change 1
- import { SSApiEndpoints , ToApiEndpoints } from "@notainc/typed-api-spec/ss " ;
1
+ import { SSApiEndpoints , ToApiEndpoints } from "@notainc/typed-api-spec/core " ;
2
2
import { z } from "zod" ;
3
3
4
4
const JsonHeader = z . union ( [
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ export * from "./validator/validate";
7
7
export * from "./validator/request" ;
8
8
export * from "./validator/response" ;
9
9
export * from "./openapi" ;
10
+ export * from "./ss" ;
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import request from "supertest";
3
3
import express from "express" ;
4
4
import {
5
5
asAsync ,
6
- RouterT ,
7
6
ToHandlers ,
8
7
typed ,
9
8
ValidateLocals ,
@@ -283,11 +282,6 @@ describe("typed", () => {
283
282
} ,
284
283
} satisfies SSApiEndpoints ;
285
284
286
- type R = RouterT < typeof pathMap , 200 > ;
287
- const r = { } as R ;
288
- r . get ( "/users" , ( req , res ) => {
289
- res . json ( [ { id : "1" , name : "alice" } ] ) ;
290
- } ) ;
291
285
it ( "ok" , async ( ) => {
292
286
const app = newApp ( ) ;
293
287
const wApp = typed ( pathMap , app ) ;
You can’t perform that action at this time.
0 commit comments