swagger-ts-sdk 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.
@@ -0,0 +1,11 @@
1
+ type SdkClientConstructor = new <T extends object>(ApiClass: new (config: {
2
+ baseUrl: string;
3
+ baseApiParams?: any;
4
+ }) => T, options: {
5
+ baseUrl: string;
6
+ /** Token to attach to every request as Bearer auth. */
7
+ token?: string;
8
+ }) => T;
9
+ declare const SdkClient: SdkClientConstructor;
10
+
11
+ export { SdkClient };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ var g=class{constructor(o,i){let{baseUrl:u,token:e}=i,n=new o({baseUrl:u,baseApiParams:{headers:{...e&&{Authorization:`Bearer ${e}`}}}});return e&&"setSecurityData"in n&&n.setSecurityData(e),new Proxy(n,{get(l,y){let s=l[y];return typeof s=="object"&&s!==null?new Proxy(s,{get(a,c){let r=a[c];return typeof r=="function"?async(...p)=>{try{let t=await r.apply(a,p);return {data:t.data,error:null,status:t.status}}catch(t){return {data:null,error:t?.error?.message||t?.message||"Request failed",status:t?.status||null}}}:r}}):s}})}};export{g as SdkClient};
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "swagger-ts-sdk",
3
+ "version": "0.0.1",
4
+ "author": "codesordinate studio",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "module": "dist/index.js",
10
+ "scripts": {
11
+ "publish-package": " npm publish"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/codesordinatestudio/lucent.git"
16
+ },
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "devDependencies": {
24
+ "@sinclair/typebox": "^0.34.48"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "README.md"
29
+ ]
30
+ }