@infisale-client/api 0.0.24 → 0.0.26
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/lib/index.ts +54 -0
- package/package.json +2 -2
package/lib/index.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export * from './api';
|
|
2
|
+
import * as doc from './api';
|
|
3
|
+
import Axios from 'axios';
|
|
4
|
+
import type { AxiosInstance } from 'axios';
|
|
5
|
+
|
|
6
|
+
declare module 'axios' {
|
|
7
|
+
interface AxiosInstance {
|
|
8
|
+
UserApi: doc.UserApi;
|
|
9
|
+
AuthApi: doc.AuthApi;
|
|
10
|
+
NotificationApi: doc.NotificationApi;
|
|
11
|
+
CompanyApi: doc.CompanyApi;
|
|
12
|
+
OperationApi: doc.OperationApi;
|
|
13
|
+
FileApi: doc.FileApi;
|
|
14
|
+
AddressApi: doc.AddressApi;
|
|
15
|
+
PageApi: doc.PageApi;
|
|
16
|
+
CategoryApi: doc.CategoryApi;
|
|
17
|
+
ProductApi: doc.ProductApi;
|
|
18
|
+
BrandApi: doc.BrandApi;
|
|
19
|
+
CollectionApi: doc.CollectionApi;
|
|
20
|
+
ThemeApi: doc.ThemeApi;
|
|
21
|
+
TemplateApi: doc.TemplateApi;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const generateApiClient = (baseURL: string, options?: { headers?: Record<string, string> }): AxiosInstance => {
|
|
26
|
+
const api: AxiosInstance = Axios.create({
|
|
27
|
+
baseURL,
|
|
28
|
+
headers: {
|
|
29
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
30
|
+
Accept: 'application/json',
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
...options?.headers,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
api.UserApi = new doc.UserApi(undefined, baseURL, api);
|
|
37
|
+
api.AuthApi = new doc.AuthApi(undefined, baseURL, api);
|
|
38
|
+
api.NotificationApi = new doc.NotificationApi(undefined, baseURL, api);
|
|
39
|
+
api.CompanyApi = new doc.CompanyApi(undefined, baseURL, api);
|
|
40
|
+
api.OperationApi = new doc.OperationApi(undefined, baseURL, api);
|
|
41
|
+
api.FileApi = new doc.FileApi(undefined, baseURL, api);
|
|
42
|
+
api.AddressApi = new doc.AddressApi(undefined, baseURL, api);
|
|
43
|
+
api.PageApi = new doc.PageApi(undefined, baseURL, api);
|
|
44
|
+
api.CategoryApi = new doc.CategoryApi(undefined, baseURL, api);
|
|
45
|
+
api.ProductApi = new doc.ProductApi(undefined, baseURL, api);
|
|
46
|
+
api.BrandApi = new doc.BrandApi(undefined, baseURL, api);
|
|
47
|
+
api.CollectionApi = new doc.CollectionApi(undefined, baseURL, api);
|
|
48
|
+
api.ThemeApi = new doc.ThemeApi(undefined, baseURL, api);
|
|
49
|
+
api.TemplateApi = new doc.TemplateApi(undefined, baseURL, api);
|
|
50
|
+
|
|
51
|
+
return api;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default generateApiClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infisale-client/api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "api-sdk",
|
|
5
5
|
"author": "Muhammet KÖKLÜ <105980019+byhipernova@users.noreply.github.com>",
|
|
6
6
|
"homepage": "https://github.com/infisale/infisale-client#readme",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"bugs": {
|
|
29
29
|
"url": "https://github.com/infisale/infisale-client/issues"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "04c20ae58e9a1c8c37731e8caf11b49d5641ec82"
|
|
32
32
|
}
|