@tagsamurai/fats-api-services 1.0.0-alpha.260 → 1.0.0-alpha.262

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.
@@ -1271,6 +1271,9 @@ const GroupCategoryServices = {
1271
1271
  getGroupCategory: (type, params) => {
1272
1272
  return API$q.get(`/${getEndpoint(type)}/tree`, { params });
1273
1273
  },
1274
+ getCategoryTree: () => {
1275
+ return API$q.get("/category/tree");
1276
+ },
1274
1277
  // Doesn't exist in company plan other than "Basic"
1275
1278
  getGroupCategoryList: (type, groupId, params) => {
1276
1279
  return API$q.get(`/${getEndpoint(type)}/${groupId}`, { params });
@@ -1278,6 +1278,9 @@ System.register(["axios"], function(exports, module) {
1278
1278
  getGroupCategory: (type, params) => {
1279
1279
  return API$q.get(`/${getEndpoint(type)}/tree`, { params });
1280
1280
  },
1281
+ getCategoryTree: () => {
1282
+ return API$q.get("/category/tree");
1283
+ },
1281
1284
  // Doesn't exist in company plan other than "Basic"
1282
1285
  getGroupCategoryList: (type, groupId, params) => {
1283
1286
  return API$q.get(`/${getEndpoint(type)}/${groupId}`, { params });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.260",
3
+ "version": "1.0.0-alpha.262",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -22,3 +22,30 @@ export interface DeleteGroupCategoryBody {
22
22
  includeSubCategory?: boolean;
23
23
  includeSubGroup?: boolean;
24
24
  }
25
+ interface CategoryTreeChildren {
26
+ _id: string;
27
+ name: string;
28
+ parent: string;
29
+ key: number;
30
+ level: number;
31
+ code: string;
32
+ children: CategoryTreeChildren[];
33
+ }
34
+ export interface CategoryTree {
35
+ _id: string;
36
+ name: string;
37
+ parent: string | null;
38
+ createdAt: Date | string;
39
+ children: {
40
+ _id: string;
41
+ name: string;
42
+ parent: string;
43
+ key: number;
44
+ level: number;
45
+ code?: string;
46
+ children: CategoryTreeChildren[];
47
+ }[];
48
+ key: number;
49
+ code?: string;
50
+ }
51
+ export {};
@@ -45,7 +45,7 @@ export interface GetUnpairedAssetNameListQueryParams extends BaseFilterQueryPara
45
45
  }
46
46
  export type GetUnpairedAssetNameListOptionsQueryParams = GetAssetNameListOptionsQueryParams;
47
47
  export type GetAssetNameBrandsQueryParams = {
48
- viewBy: 'models' | 'brands';
48
+ viewBy?: 'models' | 'brands';
49
49
  };
50
50
  export type GetAssetNameAssetsQueryParams = GetAssetNameListQueryParams;
51
51
  export type GetAssetNameAssetsOptionsQueryParams = GetAssetNameListOptionsQueryParams;
@@ -1,8 +1,9 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { CreateGroupCategoryBody, DeleteGroupCategoryBody, EditBulkDisposableGroupBody, EditGroupCategoryBody, GetGroupTreeParams, GroupCategoryResponse, GroupCategoryTableResponse, MoveGroupBody } from '../dto/groupCategoryService.dto';
3
- import { FetchDetailResponse, QueryParams } from '../types/fetchResponse.type';
2
+ import { CategoryTree, CreateGroupCategoryBody, DeleteGroupCategoryBody, EditBulkDisposableGroupBody, EditGroupCategoryBody, GetGroupTreeParams, GroupCategoryResponse, GroupCategoryTableResponse, MoveGroupBody } from '../dto/groupCategoryService.dto';
3
+ import { FetchDetailResponse, QueryParams, ShortFetchListResponse } from '../types/fetchResponse.type';
4
4
  declare const GroupCategoryServices: {
5
5
  getGroupCategory: (type: "group" | "category", params?: GetGroupTreeParams) => Promise<AxiosResponse<GroupCategoryResponse>>;
6
+ getCategoryTree: () => Promise<AxiosResponse<ShortFetchListResponse<CategoryTree>>>;
6
7
  getGroupCategoryList: (type: "group" | "category", groupId: string, params?: QueryParams) => Promise<AxiosResponse<GroupCategoryTableResponse>>;
7
8
  getNames: (type: "group" | "category") => Promise<AxiosResponse<FetchDetailResponse<string[]>>>;
8
9
  getCodes: (type: "group" | "category") => Promise<AxiosResponse<FetchDetailResponse<string[]>>>;
@@ -1,5 +1,5 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { CreateAssetNameBody, DeleteAssetNameBody, GetAssetNameAssetsOptionsQueryParams, GetAssetNameAssetsQueryParams, GetAssetNameBrands, GetAssetNameBrandsOptionsQueryParams, GetAssetNameDropdownQueryParams, GetAssetNameListOptionsQueryParams, GetAssetNameListQueryParams, GetUnpairedAssetNameListOptionsQueryParams, GetUnpairedAssetNameListQueryParams, SetTagTypeBody, UpdateAssetNameBody, UpdateDepreciationSettingBody } from '../dto/settingsAssetName.dto';
2
+ import { CreateAssetNameBody, DeleteAssetNameBody, GetAssetNameAssetsOptionsQueryParams, GetAssetNameAssetsQueryParams, GetAssetNameBrandsQueryParams, GetAssetNameBrandsOptionsQueryParams, GetAssetNameDropdownQueryParams, GetAssetNameListOptionsQueryParams, GetAssetNameListQueryParams, GetUnpairedAssetNameListOptionsQueryParams, GetUnpairedAssetNameListQueryParams, SetTagTypeBody, UpdateAssetNameBody, UpdateDepreciationSettingBody } from '../dto/settingsAssetName.dto';
3
3
  import { FetchDetailResponse, FetchListResponse, FetchResponse, ShortFetchListResponse } from '../types/fetchResponse.type';
4
4
  import { AssetNameAssets, AssetNameAssetsOptions, AssetNameBrands, AssetNameBrandsOptions, AssetNameDetail, AssetNameDropdown, AssetNameList, AssetNameListOptions, UnpairedAssetNameList, UnpairedAssetNameListOptions } from '../types/settingsAssetName.type';
5
5
  declare const SettingAssetNameServiceGo: {
@@ -9,7 +9,7 @@ declare const SettingAssetNameServiceGo: {
9
9
  getAssetUnpairedNameList: (params?: GetUnpairedAssetNameListQueryParams) => Promise<AxiosResponse<FetchListResponse<UnpairedAssetNameList>>>;
10
10
  getAssetUnpairedNameListOptions: (params?: GetUnpairedAssetNameListOptionsQueryParams) => Promise<AxiosResponse<FetchDetailResponse<UnpairedAssetNameListOptions>>>;
11
11
  getAssetNameDetail: (id: string) => Promise<AxiosResponse<FetchDetailResponse<AssetNameDetail>>>;
12
- getAssetNameBrands: (id: string, params?: GetAssetNameBrands) => Promise<AxiosResponse<FetchListResponse<AssetNameBrands>>>;
12
+ getAssetNameBrands: (id: string, params?: GetAssetNameBrandsQueryParams) => Promise<AxiosResponse<FetchListResponse<AssetNameBrands>>>;
13
13
  getAssetNameAssets: (id: string, params?: GetAssetNameAssetsQueryParams) => Promise<AxiosResponse<FetchListResponse<AssetNameAssets>>>;
14
14
  getAssetNameAssetsOptions: (params?: GetAssetNameAssetsOptionsQueryParams) => Promise<AxiosResponse<FetchDetailResponse<AssetNameAssetsOptions>>>;
15
15
  getAssetNameBrandsOptions: (params?: GetAssetNameBrandsOptionsQueryParams) => Promise<AxiosResponse<FetchDetailResponse<AssetNameBrandsOptions>>>;