@dative-gpi/foundation-core-services 0.0.190 → 0.0.192

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.
@@ -22,6 +22,7 @@ export * from "./useDeviceOrganisations";
22
22
  export * from "./useDeviceStatuses";
23
23
  export * from "./useFolders";
24
24
  export * from "./useGroups";
25
+ export * from "./useLocations";
25
26
  export * from "./useManufacturers";
26
27
  export * from "./useModels";
27
28
  export * from "./useOrganisations";
@@ -0,0 +1,13 @@
1
+ import { type CreateLocationDTO, LocationDetails, type LocationDetailsDTO, type LocationFilters, LocationInfos, type LocationInfosDTO, type UpdateLocationDTO } from "@dative-gpi/foundation-core-domain/models";
2
+ import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
3
+
4
+ import { LOCATIONS_URL, LOCATION_URL } from "../../config/urls";
5
+
6
+ const LocationServiceFactory = new ServiceFactory<LocationDetailsDTO, LocationDetails>("location", LocationDetails)
7
+ .createComplete<LocationInfos, LocationInfosDTO, CreateLocationDTO, UpdateLocationDTO, LocationFilters>(LOCATIONS_URL, LOCATION_URL, LocationInfos);
8
+
9
+ export const useLocation = ComposableFactory.get(LocationServiceFactory);
10
+ export const useLocations = ComposableFactory.getMany(LocationServiceFactory);
11
+ export const useCreateLocation = ComposableFactory.create(LocationServiceFactory);
12
+ export const useUpdateLocation = ComposableFactory.update(LocationServiceFactory);
13
+ export const useRemoveLocation = ComposableFactory.remove(LocationServiceFactory);
@@ -20,6 +20,7 @@ export * from "./deviceOrganisations";
20
20
  export * from "./deviceStatuses";
21
21
  export * from "./folders";
22
22
  export * from "./groups";
23
+ export * from "./locations";
23
24
  export * from "./manufacturers";
24
25
  export * from "./models";
25
26
  export * from "./organisations";
@@ -0,0 +1,4 @@
1
+ import { CORE_URL } from "./base";
2
+
3
+ export const LOCATIONS_URL = () => `${CORE_URL()}/locations`;
4
+ export const LOCATION_URL = (locationId: string) => `${LOCATIONS_URL()}/${encodeURIComponent(locationId)}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-services",
3
3
  "sideEffects": false,
4
- "version": "0.0.190",
4
+ "version": "0.0.192",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "0.0.190"
13
+ "@dative-gpi/foundation-core-domain": "0.0.192"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -18,5 +18,5 @@
18
18
  "vue": "^3.4.29",
19
19
  "vue-router": "^4.3.0"
20
20
  },
21
- "gitHead": "226125292c2f5ed27334b3bdee88b1877a9d9d6a"
21
+ "gitHead": "e87b84b757a4c7c46fbba96fd3d3620265768a9e"
22
22
  }