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.
@@ -2,7 +2,8 @@ import { AssetMap } from '../types/assets.type';
2
2
  import { DataTableParams } from '../types/dataTable.type';
3
3
  import { DialogSelectAssetFilterModels } from '../components/v2/DialogSelectAsset/DialogSelectAsset.vue.d';
4
4
  export type DialogSelectAssetFilterQueryParams = Partial<Record<keyof DialogSelectAssetFilterModels, string>>;
5
- export type GetAllAssetsQueryParams = DataTableParams & DialogSelectAssetFilterQueryParams & {
5
+ export type GetAssetsQueryParams = DataTableParams & DialogSelectAssetFilterQueryParams & {
6
+ _id?: string;
6
7
  status?: string;
7
8
  search?: string;
8
9
  excludeId?: string;
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
- import { GetAllAssetsQueryParams, GetAssetDetailParams, GetAssetMapParams, GetAssetMapResponse, GetAvailableAssetsQueryParams, GetLinkedAssetFamiliesResponse } from '../dto/assets.dto';
2
+ import { GetAssetsQueryParams, GetAssetDetailParams, GetAssetMapParams, GetAssetMapResponse, GetAvailableAssetsQueryParams, GetLinkedAssetFamiliesResponse } from '../dto/assets.dto';
3
3
  import { AssetOptionField } from '../components/v2/DialogSelectAsset/DialogSelectAsset.vue.d';
4
4
  export interface ServiceOptions {
5
5
  headers?: Record<string, unknown>;
@@ -8,11 +8,12 @@ export interface ServiceOptions {
8
8
  }
9
9
  export declare const API: ({ headers, params, usePrefix, }?: ServiceOptions) => AxiosInstance;
10
10
  declare const _default: {
11
- getAllAssets: (params: GetAllAssetsQueryParams) => Promise<AxiosResponse<any, any, {}>>;
12
- postAssetList: (params?: GetAllAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
13
- postAssetOption: (params?: GetAllAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
11
+ getAllAssets: (params: GetAssetsQueryParams) => Promise<AxiosResponse<any, any, {}>>;
12
+ postAssetList: (params?: GetAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
13
+ postAssetOption: (params?: GetAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
14
14
  getAvailableAssets: (params: GetAvailableAssetsQueryParams) => Promise<AxiosResponse<any, any, {}>>;
15
- postAssetAvailableList: (params?: GetAllAssetsQueryParams | GetAvailableAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
15
+ postAssetAvailableList: (params?: GetAssetsQueryParams | GetAvailableAssetsQueryParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
16
+ postAvailableListOptions: (params?: Partial<Record<string, unknown>> | undefined) => Promise<AxiosResponse<any, any, {}>>;
16
17
  getAssetsById: (_id: string, params: GetAvailableAssetsQueryParams) => Promise<AxiosResponse<any, any, {}>>;
17
18
  getAssetDetail: (id: string, params?: GetAssetDetailParams | undefined) => Promise<AxiosResponse<any, any, {}>>;
18
19
  matchAssetWithTag: (id: string, tag?: string | undefined) => Promise<AxiosResponse<any, any, {}>>;
@@ -13438,6 +13438,10 @@ const scanAsset = (tag2) => {
13438
13438
  const getAssetsById = (_id2, params) => {
13439
13439
  return API$h({ params: { _id: _id2, ...params } }).get("/by-id");
13440
13440
  };
13441
+ const postAvailableListOptions = (params) => {
13442
+ const body = buildBodyParams(params);
13443
+ return API$h().post("/available/list/options", body);
13444
+ };
13441
13445
  const getOptions$1 = (endpoint, params) => {
13442
13446
  return API$h({ params }).get(endpoint ? `/${endpoint}/options` : "/options");
13443
13447
  };
@@ -13474,6 +13478,7 @@ const AssetsServices = {
13474
13478
  postAssetOption,
13475
13479
  getAvailableAssets,
13476
13480
  postAssetAvailableList,
13481
+ postAvailableListOptions,
13477
13482
  getAssetsById,
13478
13483
  getAssetDetail,
13479
13484
  matchAssetWithTag,
@@ -71910,7 +71915,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
71910
71915
  const matchTag = async (type, tag2, device2) => {
71911
71916
  var _a;
71912
71917
  try {
71913
- const { data: body } = await AssetsServices.matchAssetWithTag(props.id, tag2);
71918
+ const { data: body } = await AssetsServices.postAssetList({
71919
+ _id: props.id,
71920
+ tag: tag2
71921
+ });
71914
71922
  serialNumber.value = device2;
71915
71923
  if (!((_a = body == null ? void 0 : body.data) == null ? void 0 : _a.totalRecords)) {
71916
71924
  toast2.add({
@@ -73148,7 +73156,9 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
73148
73156
  _id: JSON.stringify(assetId),
73149
73157
  [optionField]: true
73150
73158
  };
73151
- const { data: data30 } = await AssetsServices.getOptions("by-id", params);
73159
+ const { data: data30 } = await AssetsServices.postAssetOption(
73160
+ params
73161
+ );
73152
73162
  filterOptions2.value[optionField] = (_c = data30.data) == null ? void 0 : _c[optionField];
73153
73163
  }
73154
73164
  } catch (error) {
@@ -73391,7 +73401,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
73391
73401
  try {
73392
73402
  setLoading(true);
73393
73403
  const assets = sessionStorage.getItem("assetsDisposalReport") ?? "[]";
73394
- const { data: data30 } = await AssetsServices.getAvailableAssets({ _id: assets });
73404
+ const { data: data30 } = await AssetsServices.postAssetList({
73405
+ _id: assets
73406
+ });
73395
73407
  data30.data.data.forEach((d) => {
73396
73408
  assetNotes.value.set(d._id ?? "", null);
73397
73409
  });