@bahmni/services 0.0.1-dev.236 → 0.0.1-dev.238

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.
@@ -0,0 +1,6 @@
1
+ import { Module } from '../../moduleService';
2
+ export declare const mockExtensions: Module[];
3
+ export declare const mockOnlineOnlyModule: Module;
4
+ export declare const mockOfflineOnlyModule: Module;
5
+ export declare const mockExtensionsAsRecord: Record<string, Module>;
6
+ //# sourceMappingURL=moduleServiceMocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleServiceMocks.d.ts","sourceRoot":"","sources":["../../../../src/moduleService/__tests__/__mocks__/moduleServiceMocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,MAAM,EAsClC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MASlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MASnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGzD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { fetchModuleExtensions, getExtensionsByPoint, filterByPrivilege, filterByOnlineStatus, sortByOrder, getVisibleModules, type Module, } from './moduleService';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/moduleService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,iBAAiB,EACjB,KAAK,MAAM,GACZ,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface Module {
2
+ id: string;
3
+ extensionPointId: string;
4
+ type: string;
5
+ label: string;
6
+ translationKey?: string;
7
+ url: string;
8
+ order: number;
9
+ icon: string;
10
+ requiredPrivilege?: string;
11
+ exclusiveOnlineModule?: boolean;
12
+ exclusiveOfflineModule?: boolean;
13
+ }
14
+ export declare const fetchModuleExtensions: (appName?: string) => Promise<Module[]>;
15
+ export declare const getExtensionsByPoint: (extensions: Module[], extensionPointId?: string, type?: string) => Module[];
16
+ export declare const filterByPrivilege: (extensions: Module[], userPrivileges?: string[]) => Module[];
17
+ export declare const filterByOnlineStatus: (modules: Module[]) => Module[];
18
+ export declare const sortByOrder: (modules: Module[]) => Module[];
19
+ export declare const getVisibleModules: (extensionPointId?: string, userPrivileges?: string[]) => Promise<Module[]>;
20
+ //# sourceMappingURL=moduleService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleService.d.ts","sourceRoot":"","sources":["../../src/moduleService/moduleService.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD,eAAO,MAAM,qBAAqB,GAChC,UAAS,MAAe,KACvB,OAAO,CAAC,MAAM,EAAE,CAelB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,YAAY,MAAM,EAAE,EACpB,mBAAkB,MAA6B,EAC/C,OAAM,MAAe,KACpB,MAAM,EAMR,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,YAAY,MAAM,EAAE,EACpB,iBAAiB,MAAM,EAAE,KACxB,MAAM,EAaR,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,EAAE,KAAG,MAAM,EAY9D,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,KAAG,MAAM,EAErD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,mBAAkB,MAA6B,EAC/C,iBAAiB,MAAM,EAAE,KACxB,OAAO,CAAC,MAAM,EAAE,CAMlB,CAAC"}
@@ -5,6 +5,7 @@ export declare const SAVE_USER_LOCATION_URL: (userUuid: string) => string;
5
5
  export declare const APP_SETTINGS_URL: (module: string) => string;
6
6
  export declare const DEFAULT_DATE_FORMAT_PROPERTY = "default_dateFormat";
7
7
  export declare const LOGOUT_URL: string;
8
+ export declare const UPDATE_SESSION_LOCATION_URL: string;
8
9
  export declare const LOGOUT_COOKIES: string[];
9
10
  export declare const ERROR_MESSAGES: {
10
11
  LOGOUT_FAILED: string;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/userService/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,WAEa,CAAC;AAChE,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAClE,eAAO,MAAM,uBAAuB,+DAA8D,CAAC;AACnG,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,WACT,CAAC;AAC/C,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,WACW,CAAC;AAC3D,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AACjE,eAAO,MAAM,UAAU,QAAc,CAAC;AACtC,eAAO,MAAM,cAAc,UAG1B,CAAC;AACF,eAAO,MAAM,cAAc;;CAE1B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/userService/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,WAEa,CAAC;AAChE,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAClE,eAAO,MAAM,uBAAuB,+DAA8D,CAAC;AACnG,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,WACT,CAAC;AAC/C,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,WACW,CAAC;AAC3D,eAAO,MAAM,4BAA4B,uBAAuB,CAAC;AACjE,eAAO,MAAM,UAAU,QAAc,CAAC;AACtC,eAAO,MAAM,2BAA2B,QAAc,CAAC;AACvD,eAAO,MAAM,cAAc,UAG1B,CAAC;AACF,eAAO,MAAM,cAAc;;CAE1B,CAAC"}
@@ -1,3 +1,4 @@
1
- export { getCurrentUser, getUserLoginLocation, getAvailableLocations, getDefaultDateFormat, logout, saveUserLocation, } from './userService';
1
+ export { getCurrentUser, getUserLoginLocation, getAvailableLocations, getDefaultDateFormat, logout, saveUserLocation, updateSessionLocation, } from './userService';
2
2
  export { type User, type UserLocation } from './models';
3
+ export { BAHMNI_USER_LOCATION_COOKIE } from './constants';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/userService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,MAAM,EACN,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/userService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,MAAM,EACN,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC"}
@@ -30,4 +30,11 @@ export declare const logout: () => Promise<void>;
30
30
  * @throws Error when the API call fails
31
31
  */
32
32
  export declare const saveUserLocation: (userUuid: string, location: UserLocation) => Promise<void>;
33
+ /**
34
+ * Updates the OpenMRS server-side session with the selected location.
35
+ * This ensures encounters and observations are attributed to the correct location.
36
+ * @param locationUuid - The UUID of the location to set on the session
37
+ * @throws Error when the API call fails
38
+ */
39
+ export declare const updateSessionLocation: (locationUuid: string) => Promise<void>;
33
40
  //# sourceMappingURL=userService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"userService.d.ts","sourceRoot":"","sources":["../../src/userService/userService.ts"],"names":[],"mappings":"AAeA,OAAO,EAEL,IAAI,EACJ,YAAY,EAGb,MAAM,UAAU,CAAC;AAElB,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAuB3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,QAAO,YAWvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,MAAM,GAAG,IAAI,CAMlE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC,YAAY,EAAE,CASpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,IAAI,CAW3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,MAAM,EAChB,UAAU,YAAY,KACrB,OAAO,CAAC,IAAI,CAId,CAAC"}
1
+ {"version":3,"file":"userService.d.ts","sourceRoot":"","sources":["../../src/userService/userService.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,IAAI,EACJ,YAAY,EAGb,MAAM,UAAU,CAAC;AAElB,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAuB3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,QAAO,YAWvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,MAAM,GAAG,IAAI,CAMlE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC,YAAY,EAAE,CAGpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,IAAI,CAW3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,UAAU,MAAM,EAChB,UAAU,YAAY,KACrB,OAAO,CAAC,IAAI,CAId,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,cAAc,MAAM,KACnB,OAAO,CAAC,IAAI,CAEd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/services",
3
- "version": "0.0.1-dev.236",
3
+ "version": "0.0.1-dev.238",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",