@dev-coindcx/network 1.0.0-test
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/dist/index.cjs +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1472 -0
- package/dist/services/axios.service.d.ts +12 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/utils/api.interface.d.ts +15 -0
- package/dist/wrapper/api-promise.wrapper.d.ts +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { ApiServiceInterface, ApiServiceConfig, ApiServiceResponse } from '../utils/api.interface';
|
|
3
|
+
export declare class AxiosServiceClass implements ApiServiceInterface {
|
|
4
|
+
private axiosInstance;
|
|
5
|
+
constructor();
|
|
6
|
+
get(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
7
|
+
post(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
8
|
+
patch(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
9
|
+
put(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
10
|
+
delete(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
11
|
+
getInstance(): AxiosInstance;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosResponse } from "axios";
|
|
2
|
+
export interface ApiServiceInterface {
|
|
3
|
+
get(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
4
|
+
post(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
5
|
+
patch(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
6
|
+
put(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
7
|
+
delete(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
8
|
+
getInstance(): any;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiServiceConfig extends AxiosRequestConfig {
|
|
11
|
+
body?: any;
|
|
12
|
+
}
|
|
13
|
+
export interface ApiServiceResponse extends AxiosResponse {
|
|
14
|
+
options?: any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiServiceInterface, ApiServiceConfig, ApiServiceResponse } from '../utils/api.interface';
|
|
2
|
+
export declare class ApiServiceProWrapper implements ApiServiceInterface {
|
|
3
|
+
private implementation;
|
|
4
|
+
constructor(implementation: ApiServiceInterface);
|
|
5
|
+
get(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
6
|
+
post(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
7
|
+
patch(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
8
|
+
put(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
9
|
+
delete(url: string, config: ApiServiceConfig): Promise<ApiServiceResponse>;
|
|
10
|
+
getInstance(): Promise<any>;
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dev-coindcx/network",
|
|
3
|
+
"version": "1.0.0-test",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "A networking library for seamless API calls and efficient data handling",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc && vite build"
|
|
15
|
+
},
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^18.15.11",
|
|
19
|
+
"vite": "^4.2.0",
|
|
20
|
+
"vite-plugin-dts": "^2.2.0",
|
|
21
|
+
"typescript": "^4.9.5"
|
|
22
|
+
},
|
|
23
|
+
"author": "Manushivam Maheshwari",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"axios": "^1.4.0"
|
|
26
|
+
}
|
|
27
|
+
}
|