tsv2-library 1.1.0-dev-alpha.14 → 1.1.0-dev-alpha.16
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios, { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
GetAssetsQueryParams,
|
|
4
4
|
GetAssetDetailParams,
|
|
5
5
|
GetAssetMapParams,
|
|
6
6
|
GetAssetMapResponse,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from '@/dto/assets.dto';
|
|
10
10
|
import { AssetOptionField } from '@/components/v2/DialogSelectAsset/DialogSelectAsset.vue.d';
|
|
11
11
|
import { buildBodyParams } from '@/utils';
|
|
12
|
+
import { QueryParams } from '@/components/v2/DataTable/DataTable.vue.d';
|
|
12
13
|
|
|
13
14
|
export interface ServiceOptions {
|
|
14
15
|
headers?: Record<string, unknown>;
|
|
@@ -38,25 +39,26 @@ export const API = ({
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
const postAssetList = (
|
|
41
|
-
params?:
|
|
42
|
+
params?: GetAssetsQueryParams,
|
|
42
43
|
): Promise<AxiosResponse> => {
|
|
43
44
|
const body = buildBodyParams(params);
|
|
44
45
|
return API().post('/list', body);
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
const postAssetOption = (
|
|
48
|
-
params?:
|
|
49
|
+
params?: GetAssetsQueryParams,
|
|
49
50
|
): Promise<AxiosResponse> => {
|
|
50
51
|
const body = buildBodyParams(params);
|
|
51
52
|
return API().post('/list/options', body);
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
const getAllAssets = (
|
|
55
|
-
params: GetAllAssetsQueryParams,
|
|
56
|
-
): Promise<AxiosResponse> => {
|
|
55
|
+
const getAllAssets = (params: GetAssetsQueryParams): Promise<AxiosResponse> => {
|
|
57
56
|
return API({ params }).get('/');
|
|
58
57
|
};
|
|
59
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated - use postAssetAvailableList instead
|
|
61
|
+
*/
|
|
60
62
|
const getAvailableAssets = (
|
|
61
63
|
params: GetAvailableAssetsQueryParams,
|
|
62
64
|
): Promise<AxiosResponse> => {
|
|
@@ -64,7 +66,7 @@ const getAvailableAssets = (
|
|
|
64
66
|
};
|
|
65
67
|
|
|
66
68
|
const postAssetAvailableList = (
|
|
67
|
-
params?:
|
|
69
|
+
params?: GetAssetsQueryParams | GetAvailableAssetsQueryParams,
|
|
68
70
|
): Promise<AxiosResponse> => {
|
|
69
71
|
const body = buildBodyParams(params);
|
|
70
72
|
return API().post('/available/list', body);
|
|
@@ -75,7 +77,7 @@ const scanAsset = (tag: string): Promise<AxiosResponse> => {
|
|
|
75
77
|
};
|
|
76
78
|
|
|
77
79
|
/**
|
|
78
|
-
* @deprecated - Replaced with
|
|
80
|
+
* @deprecated - Replaced with postAssetsList
|
|
79
81
|
*/
|
|
80
82
|
const getAssetsById = (
|
|
81
83
|
_id: string,
|
|
@@ -84,6 +86,13 @@ const getAssetsById = (
|
|
|
84
86
|
return API({ params: { _id, ...params } }).get('/by-id');
|
|
85
87
|
};
|
|
86
88
|
|
|
89
|
+
const postAvailableListOptions = (
|
|
90
|
+
params?: QueryParams,
|
|
91
|
+
): Promise<AxiosResponse> => {
|
|
92
|
+
const body = buildBodyParams(params);
|
|
93
|
+
return API().post('/available/list/options', body);
|
|
94
|
+
};
|
|
95
|
+
|
|
87
96
|
const getOptions = (
|
|
88
97
|
endpoint?: 'unlinked' | 'by-id',
|
|
89
98
|
params?: Partial<Record<AssetOptionField, boolean>> & {
|
|
@@ -114,6 +123,9 @@ const getLinkedAssetFamily = (
|
|
|
114
123
|
return API({ params: { id } }).get('/family');
|
|
115
124
|
};
|
|
116
125
|
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated - Replaced with postAssetsList
|
|
128
|
+
*/
|
|
117
129
|
const matchAssetWithTag = (
|
|
118
130
|
id: string,
|
|
119
131
|
tag?: string,
|
|
@@ -149,6 +161,7 @@ export default {
|
|
|
149
161
|
postAssetOption,
|
|
150
162
|
getAvailableAssets,
|
|
151
163
|
postAssetAvailableList,
|
|
164
|
+
postAvailableListOptions,
|
|
152
165
|
getAssetsById,
|
|
153
166
|
getAssetDetail,
|
|
154
167
|
matchAssetWithTag,
|