@uxland/primary-shell 2.1.0 → 2.1.1

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.
Files changed (55) hide show
  1. package/dist/UI/components/patient-header/patient-header.d.ts +9 -0
  2. package/dist/UI/components/patient-header/template.d.ts +3 -0
  3. package/dist/UI/components/professional-header/professional-header.d.ts +9 -0
  4. package/dist/UI/components/professional-header/template.d.ts +3 -0
  5. package/dist/api/api.d.ts +2 -6
  6. package/dist/api/http-client/http-client.d.ts +6 -0
  7. package/dist/features/bootstrapper.d.ts +4 -0
  8. package/dist/features/get-patient-info/backend-adapter.d.ts +9 -0
  9. package/dist/features/get-patient-info/bootstrapper.d.ts +2 -0
  10. package/dist/features/get-patient-info/handler.d.ts +11 -0
  11. package/dist/features/get-patient-info/model.d.ts +7 -0
  12. package/dist/features/get-patient-info/request.d.ts +5 -0
  13. package/dist/features/get-user-info/backend-adapter.d.ts +9 -0
  14. package/dist/features/get-user-info/bootstrapper.d.ts +2 -0
  15. package/dist/features/get-user-info/handler.d.ts +11 -0
  16. package/dist/features/get-user-info/model.d.ts +8 -0
  17. package/dist/features/get-user-info/request.d.ts +5 -0
  18. package/dist/features/utils.d.ts +7 -0
  19. package/dist/index.js +12500 -8992
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.umd.cjs +386 -345
  22. package/dist/index.umd.cjs.map +1 -1
  23. package/dist/infrastructure/ioc/container.d.ts +7 -0
  24. package/dist/infrastructure/ioc/types.d.ts +5 -0
  25. package/package.json +6 -2
  26. package/src/UI/components/index.ts +2 -0
  27. package/src/UI/components/patient-header/patient-header.ts +28 -0
  28. package/src/UI/components/patient-header/styles.scss +25 -0
  29. package/src/UI/components/patient-header/template.ts +18 -0
  30. package/src/UI/components/primaria-shell/template.ts +2 -0
  31. package/src/UI/components/professional-header/professional-header.ts +27 -0
  32. package/src/UI/components/professional-header/styles.scss +25 -0
  33. package/src/UI/components/professional-header/template.ts +18 -0
  34. package/src/UI/shared-components/primaria-interaction/components/notifier-component.ts +2 -2
  35. package/src/api/api.ts +3 -13
  36. package/src/api/broker/factory.test.ts +8 -3
  37. package/src/api/broker/factory.ts +3 -0
  38. package/src/api/global-state/global-state.test.ts +1 -1
  39. package/src/api/global-state/global-state.ts +1 -1
  40. package/src/api/http-client/http-client.ts +14 -0
  41. package/src/features/bootstrapper.ts +16 -0
  42. package/src/features/get-patient-info/backend-adapter.ts +24 -0
  43. package/src/features/get-patient-info/bootstrapper.ts +17 -0
  44. package/src/features/get-patient-info/handler.ts +25 -0
  45. package/src/features/get-patient-info/model.ts +7 -0
  46. package/src/features/get-patient-info/request.ts +4 -0
  47. package/src/features/get-user-info/backend-adapter.ts +24 -0
  48. package/src/features/get-user-info/bootstrapper.ts +17 -0
  49. package/src/features/get-user-info/handler.ts +26 -0
  50. package/src/features/get-user-info/model.ts +8 -0
  51. package/src/features/get-user-info/request.ts +4 -0
  52. package/src/features/utils.ts +20 -0
  53. package/src/infrastructure/ioc/container.ts +14 -0
  54. package/src/infrastructure/ioc/types.ts +5 -0
  55. package/src/initializer.ts +12 -0
@@ -0,0 +1,9 @@
1
+ import { LitElement } from 'lit';
2
+ import { IPatientInfo } from 'primary/shell/src/features/get-patient-info/model';
3
+
4
+ export declare class PatientHeader extends LitElement {
5
+ render(): import('lit').TemplateResult<1>;
6
+ static styles: import('lit').CSSResult;
7
+ patient: IPatientInfo;
8
+ connectedCallback(): void;
9
+ }
@@ -0,0 +1,3 @@
1
+ import { PatientHeader } from './patient-header';
2
+
3
+ export declare const template: (props: PatientHeader) => import('lit').TemplateResult<1>;
@@ -0,0 +1,9 @@
1
+ import { LitElement } from 'lit';
2
+ import { IUserInfo } from 'primary/shell/src/features/get-user-info/model';
3
+
4
+ export declare class ProfessionalHeader extends LitElement {
5
+ render(): import('lit').TemplateResult<1>;
6
+ static styles: import('lit').CSSResult;
7
+ professional: IUserInfo;
8
+ connectedCallback(): void;
9
+ }
@@ -0,0 +1,3 @@
1
+ import { ProfessionalHeader } from './professional-header';
2
+
3
+ export declare const template: (props: ProfessionalHeader) => import('lit').TemplateResult<1>;
package/dist/api/api.d.ts CHANGED
@@ -3,13 +3,10 @@ import { PrimariaRegionManager } from '../region-manager';
3
3
  import { PrimariaInteractionManager } from './interaction-manager/interaction';
4
4
  import { PrimariaGlobalStateManager } from './global-state/global-state';
5
5
  import { PrimariaBroker } from './broker/primaria-broker';
6
+ import { HttpClient } from './http-client/http-client';
6
7
 
7
- interface PrimariaHttpClient {
8
- get(url: string): Promise<any>;
9
- post(url: string, data: any): Promise<any>;
10
- }
11
8
  export interface PrimariaApi extends HarmonixApi {
12
- httpClient: PrimariaHttpClient;
9
+ httpClient: HttpClient;
13
10
  interactionManager: PrimariaInteractionManager;
14
11
  broker: PrimariaBroker;
15
12
  regionManager: PrimariaRegionManager;
@@ -24,4 +21,3 @@ export declare const PrimariaRegionHost: any;
24
21
  */
25
22
  export declare const primariaApiFactory: ApiFactory<PrimariaApi>;
26
23
  export declare const shellApi: PrimariaApi;
27
- export {};
@@ -0,0 +1,6 @@
1
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
+
3
+ export interface HttpClient {
4
+ request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
5
+ }
6
+ export declare const createHttpClient: () => HttpClient;
@@ -0,0 +1,4 @@
1
+ import { PrimariaApi } from '..';
2
+
3
+ export declare const bootstrapFeatures: (api: PrimariaApi) => void;
4
+ export declare const teardownFeatures: () => void;
@@ -0,0 +1,9 @@
1
+ import { IPatientInfo } from './model';
2
+
3
+ export declare abstract class PatientInfoBackendAdapter {
4
+ abstract getPatientInfo(): Promise<IPatientInfo>;
5
+ }
6
+ export declare class GetPatientInfoBackendAdapter implements PatientInfoBackendAdapter {
7
+ token: string;
8
+ getPatientInfo(): Promise<IPatientInfo>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export declare const bootstrapGetPatientInfo: () => void;
2
+ export declare const teardownGetPatientInfo: () => void;
@@ -0,0 +1,11 @@
1
+ import { PrimariaApi } from '../..';
2
+ import { PatientInfoBackendAdapter } from './backend-adapter';
3
+ import { GetPatientInfo } from './request';
4
+ import { IPatientInfo } from './model';
5
+
6
+ export declare class GetPatientInfoHandler {
7
+ private api;
8
+ private backendAdapter;
9
+ constructor(api: PrimariaApi, backendAdapter: PatientInfoBackendAdapter);
10
+ handle(message: GetPatientInfo): Promise<IPatientInfo | undefined>;
11
+ }
@@ -0,0 +1,7 @@
1
+ export interface IPatientInfo {
2
+ patientId: string;
3
+ firstName: string;
4
+ lastName: string;
5
+ gender: string;
6
+ birthdate: string;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { IRequest } from '../..';
2
+ import { IPatientInfo } from './model';
3
+
4
+ export declare class GetPatientInfo implements IRequest<IPatientInfo> {
5
+ }
@@ -0,0 +1,9 @@
1
+ import { IUserInfo } from './model';
2
+
3
+ export declare abstract class UserInfoBackendAdapter {
4
+ abstract getUserInfo(): Promise<IUserInfo>;
5
+ }
6
+ export declare class GetUserInfoBackendAdapter implements UserInfoBackendAdapter {
7
+ token: string;
8
+ getUserInfo(): Promise<IUserInfo>;
9
+ }
@@ -0,0 +1,2 @@
1
+ export declare const bootstrapGetUserInfo: () => void;
2
+ export declare const teardownGetUserInfo: () => void;
@@ -0,0 +1,11 @@
1
+ import { PrimariaApi } from '../..';
2
+ import { GetUserInfo } from './request';
3
+ import { IUserInfo } from './model';
4
+ import { UserInfoBackendAdapter } from './backend-adapter';
5
+
6
+ export declare class GetUserInfoHandler {
7
+ private api;
8
+ private backendAdapter;
9
+ constructor(api: PrimariaApi, backendAdapter: UserInfoBackendAdapter);
10
+ handle(message: GetUserInfo): Promise<IUserInfo | undefined>;
11
+ }
@@ -0,0 +1,8 @@
1
+ export interface IUserInfo {
2
+ userId: string;
3
+ firstName: string;
4
+ lastName: string;
5
+ role: string;
6
+ speciality: string;
7
+ service: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { IRequest } from '../..';
2
+ import { IUserInfo } from './model';
3
+
4
+ export declare class GetUserInfo implements IRequest<IUserInfo> {
5
+ }
@@ -0,0 +1,7 @@
1
+ import { Container, interfaces } from 'inversify';
2
+ import { IRequestClass } from '..';
3
+ import { PrimariaApi } from '../api/api';
4
+
5
+ import Newable = interfaces.Newable;
6
+ export declare const registerRequest: (api: PrimariaApi, container: Container) => (command: IRequestClass<any>, handler: Newable<any>) => void;
7
+ export declare const unregisterRequest: (container: Container) => (handler: Newable<any>) => void;