Skip to content

Commit

Permalink
Adding deno distribution files and moving files from /dist to /
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 18, 2023
1 parent 22b2bbc commit bdde22e
Show file tree
Hide file tree
Showing 106 changed files with 2,219 additions and 201 deletions.
161 changes: 0 additions & 161 deletions .github/workflows/ci.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions axios/createAxiosSharedClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { AxiosInstance } from "axios";
import type { UnknownSharedRoute } from "..";
import { HandlerCreator } from "..";
import { ValidationOptions } from "../validations";
export declare const createAxiosHandlerCreator: <SharedRoutes extends Record<string, UnknownSharedRoute>>(axios: AxiosInstance, options?: ValidationOptions) => HandlerCreator<SharedRoutes>;
export declare const createAxiosSharedClient: <SharedRoutes extends Record<string, UnknownSharedRoute>>(sharedRouters: SharedRoutes, axios: AxiosInstance, validationOptions?: ValidationOptions) => import("..").HttpClient<SharedRoutes>;
116 changes: 116 additions & 0 deletions axios/createAxiosSharedClient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions axios/createAxiosSharedClient.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions axios/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { createAxiosSharedClient } from "./createAxiosSharedClient";
6 changes: 6 additions & 0 deletions axios/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions axios/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions configureCreateHttpClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { z } from "zod";
import type { ResponsesToHttpResponse, SharedRoute, UnknownResponses, UnknownSharedRoute } from "./defineRoutes";
import { PathParameters, ReplaceParamsInUrl, Url } from "./pathParameters";
type EmptyObj = Record<string, never>;
type AnyObj = Record<string, unknown>;
export type HttpResponse<Status extends number, ResponseBody> = {
status: Status;
body: ResponseBody;
};
export type HandlerParams<SharedRoute extends UnknownSharedRoute> = (PathParameters<SharedRoute["url"]> extends EmptyObj ? AnyObj : {
urlParams: PathParameters<SharedRoute["url"]>;
}) & (z.infer<SharedRoute["requestBodySchema"]> extends void ? AnyObj : {
body: z.infer<SharedRoute["requestBodySchema"]>;
}) & (z.infer<SharedRoute["queryParamsSchema"]> extends void ? AnyObj : {
queryParams: z.infer<SharedRoute["queryParamsSchema"]>;
}) & (z.infer<SharedRoute["headersSchema"]> extends void ? AnyObj : {
headers: z.infer<SharedRoute["headersSchema"]>;
});
export type Handler<SharedRoute extends UnknownSharedRoute> = (params: HandlerParams<SharedRoute> | EmptyObj) => Promise<ResponsesToHttpResponse<SharedRoute["responses"]>>;
export type HttpClient<SharedRoutes extends Record<string, UnknownSharedRoute>> = {
[RouteName in keyof SharedRoutes]: (...params: [SharedRoutes[RouteName], PathParameters<SharedRoutes[RouteName]["url"]>] extends [SharedRoute<Url, void, void, UnknownResponses, void>, EmptyObj] ? [] : [HandlerParams<SharedRoutes[RouteName]>]) => Promise<ResponsesToHttpResponse<SharedRoutes[RouteName]["responses"]>>;
};
export type HandlerCreator<SharedRoutes extends Record<string, UnknownSharedRoute>> = <R extends keyof SharedRoutes>(routeName: R, routes: SharedRoutes, replaceParamsInUrl: ReplaceParamsInUrl) => Handler<SharedRoutes[R]>;
export declare const configureCreateHttpClient: <S extends Record<string, UnknownSharedRoute>>(handlerCreator: HandlerCreator<S>) => <SharedRoutes extends Record<string, UnknownSharedRoute>>(routes: SharedRoutes) => HttpClient<SharedRoutes>;
export {};
25 changes: 25 additions & 0 deletions configureCreateHttpClient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions configureCreateHttpClient.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions createCustomSharedClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Handler, HttpClient } from "./configureCreateHttpClient";
import { UnknownSharedRoute } from "./defineRoutes";
export declare const createCustomSharedClient: <SharedRoutes extends Record<string, UnknownSharedRoute>>(sharedRoutes: SharedRoutes, customHandlers: { [K in keyof SharedRoutes]: Handler<SharedRoutes[K]>; }) => HttpClient<SharedRoutes>;
12 changes: 12 additions & 0 deletions createCustomSharedClient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bdde22e

Please sign in to comment.