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 May 10, 2023
1 parent 360e528 commit f35d82b
Show file tree
Hide file tree
Showing 120 changed files with 2,408 additions and 234 deletions.
149 changes: 0 additions & 149 deletions .github/workflows/ci.yaml

This file was deleted.

47 changes: 2 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,45 +1,2 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

.vscode

.DS_Store

/.yarn_home
/dist
/deno_dist

/node_modules
5 changes: 5 additions & 0 deletions axios/createAxiosSharedClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { AxiosInstance } from "axios";
import type { UnknownSharedRoute } from "..";
import { HandlerCreator } from "..";
export declare const createAxiosHandlerCreator: <SharedRoutes extends Record<string, UnknownSharedRoute>>(axios: AxiosInstance) => HandlerCreator<SharedRoutes>;
export declare const createAxiosSharedClient: <SharedRoutes extends Record<string, UnknownSharedRoute>>(sharedRouters: SharedRoutes, axios: AxiosInstance) => import("..").HttpClient<SharedRoutes>;
92 changes: 92 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, createAxiosHandlerCreator, } from "./createAxiosSharedClient";
7 changes: 7 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 { SharedRoute, UnknownSharedRoute } from "./defineRoutes";
import { PathParameters, ReplaceParamsInUrl, Url } from "./pathParameters";
type AnyObj = Record<string, unknown>;
type EmptyObj = Record<string, never>;
export type HttpResponse<ResponseBody> = {
status: number;
body: ResponseBody;
};
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<HttpResponse<z.infer<SharedRoute["responseBodySchema"]>>>;
export type HttpClient<SharedRoutes extends Record<string, UnknownSharedRoute>> = {
[RouteName in keyof SharedRoutes]: (...params: [SharedRoutes[RouteName], PathParameters<SharedRoutes[RouteName]["url"]>] extends [SharedRoute<Url, void, void, unknown, void>, EmptyObj] ? [] : [HandlerParams<SharedRoutes[RouteName]>]) => Promise<HttpResponse<z.infer<SharedRoutes[RouteName]["responseBodySchema"]>>>;
};
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.

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

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

Loading

0 comments on commit f35d82b

Please sign in to comment.