@uninspired/unproxied-client 0.0.1
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/README.md +15 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +10 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +10 -0
- package/dist/types/index.d.ts +16 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @uninspired/unproxied-client
|
|
2
|
+
|
|
3
|
+
To install dependencies:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bun install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
To run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run src/index.ts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This project was created using `bun init` in bun v1.2.22. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var{defineProperty:i,getOwnPropertyNames:s,getOwnPropertyDescriptor:u}=Object,y=Object.prototype.hasOwnProperty;var n=new WeakMap,R=(t)=>{var e=n.get(t),r;if(e)return e;if(e=i({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function")s(t).map((p)=>!y.call(e,p)&&i(e,p,{get:()=>t[p],enumerable:!(r=u(t,p))||r.enumerable}));return n.set(t,e),e};var a=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0,configurable:!0,set:(p)=>e[r]=()=>p})};var l={};a(l,{makeUnproxiedClient:()=>d});module.exports=R(l);var o=require("hono/client"),d=(t,e,r)=>{return o.hc(t,{...r,headers:{...r?.headers,"X-API-Key":e}})};
|
|
2
|
+
|
|
3
|
+
//# debugId=3E8054A1191F30D564756E2164756E21
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { ApiRouter } from \"../../../apps/api/src\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type UnproxiedClient = ReturnType<typeof hc<ApiRouter>>;\n\nexport const makeUnproxiedClient = (\n baseUrl: string,\n apiKey: string,\n options?: ClientRequestOptions\n): UnproxiedClient => {\n return hc<ApiRouter>(baseUrl, {\n ...options,\n headers: {\n ...options?.headers,\n \"X-API-Key\": apiKey,\n },\n });\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "ugBAC8C,IAA9C,yBAIa,EAAsB,CACjC,EACA,EACA,IACoB,CACpB,OAAO,KAAc,EAAS,IACzB,EACH,QAAS,IACJ,GAAS,QACZ,YAAa,CACf,CACF,CAAC",
|
|
8
|
+
"debugId": "3E8054A1191F30D564756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { ApiRouter } from \"../../../apps/api/src\";\nimport { hc, type ClientRequestOptions } from \"hono/client\";\n\nexport type UnproxiedClient = ReturnType<typeof hc<ApiRouter>>;\n\nexport const makeUnproxiedClient = (\n baseUrl: string,\n apiKey: string,\n options?: ClientRequestOptions\n): UnproxiedClient => {\n return hc<ApiRouter>(baseUrl, {\n ...options,\n headers: {\n ...options?.headers,\n \"X-API-Key\": apiKey,\n },\n });\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "AACA,aAAS,oBAIF,IAAM,EAAsB,CACjC,EACA,EACA,IACoB,CACpB,OAAO,EAAc,EAAS,IACzB,EACH,QAAS,IACJ,GAAS,QACZ,YAAa,CACf,CACF,CAAC",
|
|
8
|
+
"debugId": "473A0804EBEB50AE64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as hono_hono_base from 'hono/hono-base';
|
|
2
|
+
import * as hono_types from 'hono/types';
|
|
3
|
+
import { hc, ClientRequestOptions } from 'hono/client';
|
|
4
|
+
|
|
5
|
+
declare const apiRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
6
|
+
"/api/v1": {
|
|
7
|
+
$get: any;
|
|
8
|
+
};
|
|
9
|
+
}, "/api/v1">;
|
|
10
|
+
type ApiRouter = typeof apiRouter;
|
|
11
|
+
|
|
12
|
+
type UnproxiedClient = ReturnType<typeof hc<ApiRouter>>;
|
|
13
|
+
declare const makeUnproxiedClient: (baseUrl: string, apiKey: string, options?: ClientRequestOptions) => UnproxiedClient;
|
|
14
|
+
|
|
15
|
+
export { makeUnproxiedClient };
|
|
16
|
+
export type { UnproxiedClient };
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uninspired/unproxied-client",
|
|
3
|
+
"main": "dist/cjs/index.js",
|
|
4
|
+
"module": "dist/esm/index.js",
|
|
5
|
+
"types": "dist/types/index.d.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"private": false,
|
|
8
|
+
"version": "0.0.1",
|
|
9
|
+
"description": "Auth client for Uninspired Studio Products",
|
|
10
|
+
"author": "Chris Kolb <chris@uninspired.studio>",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"files": [
|
|
13
|
+
"package.json",
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "bun run scripts/build.ts"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
21
|
+
"@types/bun": "latest",
|
|
22
|
+
"@types/semver": "^7.7.1",
|
|
23
|
+
"rollup": "^4.52.5",
|
|
24
|
+
"rollup-plugin-dts": "^6.2.3",
|
|
25
|
+
"semver": "^7.7.3"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"typescript": "^5"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"hono": "4.9.12"
|
|
32
|
+
}
|
|
33
|
+
}
|