@photonhealth/elements 0.0.91 → 0.0.93

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.
@@ -1,15 +1,12 @@
1
- import { PhotonClient } from '@photonhealth/sdk';
2
- import { Catalog } from '@photonhealth/sdk/dist/types';
3
- import { GraphQLError } from 'graphql';
4
1
  export declare const CatalogStore: {
5
2
  store: {
6
3
  catalogs: {
7
- data: Catalog[];
8
- errors: readonly GraphQLError[];
4
+ data: import("@photonhealth/sdk/dist/types").Catalog[];
5
+ errors: readonly import("graphql").GraphQLError[];
9
6
  isLoading: boolean;
10
7
  };
11
8
  };
12
9
  actions: {
13
- getCatalogs: (client: PhotonClient) => Promise<void>;
10
+ getCatalogs: (client: import("@photonhealth/sdk").PhotonClient) => Promise<void>;
14
11
  };
15
12
  };
@@ -1,18 +1,12 @@
1
- import { PhotonClient } from '@photonhealth/sdk';
2
- import { GraphQLError } from 'graphql';
3
- import { DispenseUnit } from '@photonhealth/sdk/dist/types';
4
- export type StoreDispenseUnit = {
5
- id: string;
6
- } & DispenseUnit;
7
1
  export declare const DispenseUnitStore: {
8
2
  store: {
9
3
  dispenseUnits: {
10
- data: StoreDispenseUnit[];
11
- errors: readonly GraphQLError[];
4
+ data: import("@photonhealth/components/dist/src/stores/dispenseUnit").StoreDispenseUnit[];
5
+ errors: readonly import("graphql").GraphQLError[];
12
6
  isLoading: boolean;
13
7
  };
14
8
  };
15
9
  actions: {
16
- getDispenseUnits: (client: PhotonClient) => Promise<void>;
10
+ getDispenseUnits: (client: import("@photonhealth/sdk").PhotonClient) => Promise<void>;
17
11
  };
18
12
  };
@@ -1,22 +1,2 @@
1
- import { Struct } from 'superstruct';
2
- export declare const createFormStore: (initalValue?: Record<string, any>) => {
3
- store: Record<string, {
4
- value: any;
5
- error?: string | undefined;
6
- } | undefined>;
7
- actions: {
8
- updateFormValue: ({ key, value }: {
9
- key: string;
10
- value: any;
11
- }) => void;
12
- clearKeys: (keys: string[]) => void;
13
- registerValidator: ({ key, validator }: {
14
- key: string;
15
- validator: Struct<any, any>;
16
- }) => void;
17
- unRegisterValidator: (key: string) => void;
18
- validate: (keys?: string[]) => void;
19
- hasErrors: (keys: string[]) => boolean;
20
- reset: () => void;
21
- };
22
- };
1
+ import { createFormStore } from '@photonhealth/components';
2
+ export { createFormStore };
@@ -1,26 +1,23 @@
1
- import { PhotonClient } from '@photonhealth/sdk';
2
- import { Patient } from '@photonhealth/sdk/dist/types';
3
- import { GraphQLError } from 'graphql';
4
1
  export declare const PatientStore: {
5
2
  store: {
6
3
  patients: {
7
- data: Patient[];
8
- errors: readonly GraphQLError[];
4
+ data: import("@photonhealth/sdk/dist/types").Patient[];
5
+ errors: readonly import("graphql").GraphQLError[];
9
6
  isLoading: boolean;
10
7
  finished: boolean;
11
8
  };
12
9
  selectedPatient: {
13
- data?: Patient;
14
- errors: readonly GraphQLError[];
10
+ data?: import("@photonhealth/sdk/dist/types").Patient | undefined;
11
+ errors: readonly import("graphql").GraphQLError[];
15
12
  isLoading: boolean;
16
13
  };
17
14
  };
18
15
  actions: {
19
- getPatients: (client: PhotonClient, args?: {
20
- first?: number;
21
- name?: string;
22
- }) => Promise<(() => Promise<(() => Promise<any | undefined>) | undefined>) | undefined>;
23
- getSelectedPatient: (client: PhotonClient, id: string) => Promise<void>;
16
+ getPatients: (client: import("@photonhealth/sdk").PhotonClient, args?: {
17
+ first?: number | undefined;
18
+ name?: string | undefined;
19
+ } | undefined) => Promise<(() => Promise<(() => Promise<any>) | undefined>) | undefined>;
20
+ getSelectedPatient: (client: import("@photonhealth/sdk").PhotonClient, id: string) => Promise<void>;
24
21
  clearSelectedPatient: () => Promise<void>;
25
22
  reset: () => Promise<void>;
26
23
  };
@@ -1,40 +1,37 @@
1
1
  /// <reference types="@types/google.maps" />
2
- import { PhotonClient } from '@photonhealth/sdk';
3
- import { Pharmacy } from '@photonhealth/sdk/dist/types';
4
- import { GraphQLError } from 'graphql';
5
2
  export declare const PharmacyStore: {
6
3
  store: {
7
4
  pharmacies: {
8
- data: Pharmacy[];
9
- address?: string;
10
- errors: readonly (GraphQLError | Error)[];
5
+ data: import("@photonhealth/sdk/dist/types").Pharmacy[];
6
+ address?: string | undefined;
7
+ errors: readonly (import("graphql").GraphQLError | Error)[];
11
8
  isLoading: boolean;
12
9
  };
13
10
  selectedPharmacy: {
14
- data?: Pharmacy;
15
- errors: readonly GraphQLError[];
11
+ data?: import("@photonhealth/sdk/dist/types").Pharmacy | undefined;
12
+ errors: readonly import("graphql").GraphQLError[];
16
13
  isLoading: boolean;
17
14
  };
18
15
  preferredPharmacies: {
19
- data?: Pharmacy[];
20
- errors: readonly GraphQLError[];
16
+ data?: import("@photonhealth/sdk/dist/types").Pharmacy[] | undefined;
17
+ errors: readonly import("graphql").GraphQLError[];
21
18
  isLoading: boolean;
22
19
  };
23
20
  };
24
21
  actions: {
25
- getPharmacies: (client: PhotonClient, args: {
26
- name?: string;
22
+ getPharmacies: (client: import("@photonhealth/sdk").PhotonClient, args: {
23
+ name?: string | undefined;
27
24
  location: {
28
25
  latitude: number;
29
26
  longitude: number;
30
27
  radius: number;
31
28
  };
32
- first?: number;
29
+ first?: number | undefined;
33
30
  }) => Promise<void>;
34
- getPharmaciesByAddress: (client: PhotonClient, geocoder: google.maps.Geocoder, address: string, name?: string) => Promise<void>;
35
- getPharmacy: (client: PhotonClient, id: string) => Promise<void>;
31
+ getPharmaciesByAddress: (client: import("@photonhealth/sdk").PhotonClient, geocoder: google.maps.Geocoder, address: string, name?: string | undefined) => Promise<void>;
32
+ getPharmacy: (client: import("@photonhealth/sdk").PhotonClient, id: string) => Promise<void>;
36
33
  clearSelectedPharmacy: () => void;
37
- getPreferredPharmacies: (client: PhotonClient, id: string) => Promise<void>;
34
+ getPreferredPharmacies: (client: import("@photonhealth/sdk").PhotonClient, id: string) => Promise<void>;
38
35
  clearPreferredPharmacies: () => void;
39
36
  reset: () => Promise<void>;
40
37
  };
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@photonhealth/elements",
3
- "version": "0.0.91",
3
+ "version": "0.0.93",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
8
  "start": "vite --port 3000",
9
- "build": "rimraf dist && vite build",
9
+ "build": "rimraf dist && NODE_ENV=development vite build",
10
+ "build:prod": "npx nx run elements:build",
10
11
  "build:watch": "rimraf dist && vite build --watch",
11
- "prepublishOnly": "npm run build",
12
+ "prepublishOnly": "npm run build:prod",
12
13
  "upload-s3": "npm run upload-s3:package-json && npm run upload-s3:dist && npm run upload-s3:package-json-latest && npm run upload-s3:dist-latest",
13
14
  "upload-s3:package-json": "s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX",
14
15
  "upload-s3:dist": "s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX/dist",
@@ -66,8 +67,8 @@
66
67
  "graphql-tag": "^2.12.6",
67
68
  "jwt-decode": "^3.1.2",
68
69
  "libphonenumber-js": "^1.10.14",
69
- "solid-element": "^1.5.6",
70
- "solid-js": "^1.5.6",
70
+ "solid-element": "^1.6.4",
71
+ "solid-js": "^1.6.11",
71
72
  "superstruct": "^1.0.3"
72
73
  },
73
74
  "exports": {
package/dist/store.d.ts DELETED
@@ -1,99 +0,0 @@
1
- import { PhotonClient } from '@photonhealth/sdk';
2
- import { Catalog, DispenseUnit, MutationCreatePrescriptionArgs, Patient, Prescription, PrescriptionTemplate, Treatment } from '@photonhealth/sdk/dist/types';
3
- import { GraphQLError } from 'graphql';
4
- import { Permission } from '../types';
5
- export declare class PhotonClientStore {
6
- private sdk;
7
- private setStore;
8
- private store;
9
- authentication: {
10
- state: {
11
- user: any;
12
- isAuthenticated: boolean;
13
- isInOrg: boolean;
14
- permissions: Permission[];
15
- error?: string;
16
- isLoading: boolean;
17
- };
18
- handleRedirect: (url?: string) => Promise<void>;
19
- checkSession: () => Promise<void>;
20
- login: (args?: object) => Promise<void>;
21
- logout: () => void;
22
- };
23
- getSDK: () => PhotonClient;
24
- clinical: {
25
- catalog: {
26
- state: {
27
- isLoading: boolean;
28
- treatments: Treatment[];
29
- templates: PrescriptionTemplate[];
30
- };
31
- getCatalog: (args: {
32
- id: string;
33
- }) => void;
34
- };
35
- catalogs: {
36
- state: {
37
- isLoading: boolean;
38
- catalogs: Catalog[];
39
- };
40
- getCatalogs: () => void;
41
- };
42
- dispenseUnits: {
43
- state: {
44
- isLoading: boolean;
45
- dispenseUnits: Array<DispenseUnit & {
46
- id: string;
47
- }>;
48
- };
49
- getDispenseUnits: () => void;
50
- };
51
- patients: {
52
- state: {
53
- isLoading: boolean;
54
- patients: Patient[];
55
- finished: boolean;
56
- };
57
- getPatients: (args?: {
58
- after?: string;
59
- first?: number;
60
- name?: string;
61
- clear?: boolean;
62
- }) => void;
63
- };
64
- patient: {
65
- state: {
66
- isLoading: boolean;
67
- patient?: Patient;
68
- };
69
- getPatient: (args: {
70
- id: string;
71
- }) => Promise<Patient>;
72
- };
73
- prescription: {
74
- state: {
75
- isLoading: boolean;
76
- data?: Prescription;
77
- errors: GraphQLError[];
78
- error?: any;
79
- };
80
- createPrescription: (args: MutationCreatePrescriptionArgs) => Promise<{
81
- data: {
82
- createPrescription: Prescription;
83
- } | null | undefined;
84
- errors: readonly GraphQLError[] | undefined;
85
- }>;
86
- };
87
- };
88
- constructor(sdk: PhotonClient);
89
- private _getSDK;
90
- private checkSession;
91
- private login;
92
- private logout;
93
- private getPatients;
94
- private getPatient;
95
- private getCatalog;
96
- private getCatalogs;
97
- private getDispenseUnits;
98
- private createPrescription;
99
- }