@natch-the-storage/heathershaw-platform-types 1.3.2 → 1.3.4

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.
package/README.md CHANGED
@@ -10,26 +10,67 @@ npm install @natch-the-storage/heathershaw-platform-types
10
10
 
11
11
  ## Usage
12
12
 
13
- ### TypeScript types
13
+ ### Interfaces
14
+
15
+ Each domain object has a base interface (with `id`) and a `Create` variant (base minus `id`):
14
16
 
15
17
  ```ts
16
- import type { CreateOrderBody, Address, ScriptSelect } from "@natch-the-storage/heathershaw-platform-types";
18
+ import type {
19
+ // Domain objects
20
+ DirectUserProfile, DirectUserProfileCreate,
21
+ Order, OrderCreate,
22
+ PaperScriptReminder, PaperScriptReminderCreate,
23
+ PartnerPharmacyProfile, PartnerPharmacyProfileCreate,
24
+ PatientRecord, PatientRecordCreate,
25
+ Prescriber, PrescriberCreate,
26
+ PriceMatch, PriceMatchCreate,
27
+ Product, ProductCreate,
28
+ Quote, QuoteCreate,
29
+ RepeatReminder, RepeatReminderCreate,
30
+ Script, ScriptCreate,
31
+
32
+ // Shared sub-types
33
+ Address, HealthInfo, PrescriberSelect, ScriptSelect, OrderSelect,
34
+
35
+ // Query / utility types
36
+ GetById, GetAll, GetPatientRecordsQuery, DevEmail, Sms,
37
+ } from "@natch-the-storage/heathershaw-platform-types";
17
38
  ```
18
39
 
19
40
  ### Enum value arrays
20
41
 
21
- The raw value arrays are exported for use in UI components (e.g. populating a select):
42
+ Raw arrays for populating selects and similar UI components:
22
43
 
23
44
  ```ts
24
- import { shippingTypeValues } from "@natch-the-storage/heathershaw-platform-types";
25
- // ["STANDARD", "COLD_CHAIN"]
45
+ import {
46
+ paperScriptReminderStatusValues,
47
+ quoteStatusValues,
48
+ paymentModeAtOrderValues,
49
+ paymentStatusValues,
50
+ productCategoryValues,
51
+ repeatStorageValues,
52
+ scriptTypeValues,
53
+ shippingTypeValues,
54
+ hazardTagsValues,
55
+ } from "@natch-the-storage/heathershaw-platform-types";
26
56
  ```
27
57
 
28
- Each array also has a matching union type:
58
+ ### Enum union types
59
+
60
+ Each array has a matching union type:
29
61
 
30
62
  ```ts
31
- import type { ShippingType } from "@natch-the-storage/heathershaw-platform-types";
32
- // "STANDARD" | "COLD_CHAIN"
63
+ import type {
64
+ PaperScriptReminderStatus,
65
+ QuoteStatus,
66
+ PaymentModeAtOrder,
67
+ PaymentStatus,
68
+ ProductCategory,
69
+ RepeatStorage,
70
+ ScriptType,
71
+ ShippingType,
72
+ HazardTag,
73
+ } from "@natch-the-storage/heathershaw-platform-types";
33
74
  ```
34
75
 
35
76
  ## Notes
@@ -39,13 +80,9 @@ import type { ShippingType } from "@natch-the-storage/heathershaw-platform-types
39
80
  ## Publishing to npm
40
81
 
41
82
  1. Bump the version in `package.json`
42
- 2. Build the output:
43
- ```bash
44
- npm run build
45
- ```
46
- 3. Publish:
83
+ 2. Build and publish:
47
84
  ```bash
48
- npm publish --access public
85
+ npm run publish
49
86
  ```
50
87
 
51
88
  > You must be logged in (`npm login`) and have publish access to the `@natch-the-storage` scope.
@@ -233,8 +233,8 @@ export declare const apiRoutes: {
233
233
  delete: (id: number) => string;
234
234
  };
235
235
  patientRecords: {
236
- list: string;
237
- get: (id: number) => string;
236
+ list: (type?: "partner" | "direct") => string;
237
+ get: (id?: number, type?: "partner" | "direct") => string;
238
238
  getByUser: (userId: string) => string;
239
239
  create: string;
240
240
  update: string;
@@ -19,100 +19,104 @@ export const repeatStorageValues = [
19
19
  ];
20
20
  export const scriptTypeValues = ["eRx", "PAPER"];
21
21
  export const shippingTypeValues = ["STANDARD", "COLD_CHAIN"];
22
- export const hazardTagsValues = ["Hazardous", "Cytotoxic", "High-Risk"];
22
+ export const hazardTagsValues = [
23
+ "Hazardous",
24
+ "Cytotoxic",
25
+ "High-Risk",
26
+ ];
23
27
  export const apiRoutes = {
24
28
  orders: {
25
- list: '/api/orders',
29
+ list: "/api/orders",
26
30
  get: (id) => `/api/orders/${id}`,
27
- create: '/api/orders',
28
- update: '/api/orders',
31
+ create: "/api/orders",
32
+ update: "/api/orders",
29
33
  delete: (id) => `/api/orders/${id}`,
30
34
  },
31
35
  patientRecords: {
32
- list: '/api/patient-records',
33
- get: (id) => `/api/patient-records/${id}`,
36
+ list: (type) => type ? `/api/patient-records/${type}` : "/api/patient-records",
37
+ get: (id, type) => `/api/patient-records${type ? "?" + type + "=" + id : ""}`,
34
38
  getByUser: (userId) => `/api/patient-records/user/${userId}`,
35
- create: '/api/patient-records',
36
- update: '/api/patient-records',
39
+ create: "/api/patient-records",
40
+ update: "/api/patient-records",
37
41
  delete: (id) => `/api/patient-records/${id}`,
38
42
  },
39
43
  prescribers: {
40
- list: '/api/prescribers',
44
+ list: "/api/prescribers",
41
45
  get: (id) => `/api/prescribers/${id}`,
42
- create: '/api/prescribers',
43
- update: '/api/prescribers',
46
+ create: "/api/prescribers",
47
+ update: "/api/prescribers",
44
48
  delete: (id) => `/api/prescribers/${id}`,
45
49
  },
46
50
  scripts: {
47
- list: '/api/scripts',
51
+ list: "/api/scripts",
48
52
  get: (id) => `/api/scripts/${id}`,
49
- create: '/api/scripts',
50
- update: '/api/scripts',
53
+ create: "/api/scripts",
54
+ update: "/api/scripts",
51
55
  delete: (id) => `/api/scripts/${id}`,
52
56
  },
53
57
  products: {
54
- list: '/api/products',
58
+ list: "/api/products",
55
59
  get: (id) => `/api/products/${id}`,
56
- create: '/api/products',
57
- update: '/api/products',
60
+ create: "/api/products",
61
+ update: "/api/products",
58
62
  delete: (id) => `/api/products/${id}`,
59
63
  },
60
64
  quotes: {
61
- list: '/api/quotes',
65
+ list: "/api/quotes",
62
66
  get: (id) => `/api/quotes/${id}`,
63
- create: '/api/quotes',
64
- update: '/api/quotes',
67
+ create: "/api/quotes",
68
+ update: "/api/quotes",
65
69
  delete: (id) => `/api/quotes/${id}`,
66
70
  },
67
71
  paperScriptReminders: {
68
- list: '/api/paper-script-reminders',
72
+ list: "/api/paper-script-reminders",
69
73
  get: (id) => `/api/paper-script-reminders/${id}`,
70
- create: '/api/paper-script-reminders',
71
- update: '/api/paper-script-reminders',
74
+ create: "/api/paper-script-reminders",
75
+ update: "/api/paper-script-reminders",
72
76
  delete: (id) => `/api/paper-script-reminders/${id}`,
73
77
  },
74
78
  repeatReminders: {
75
- list: '/api/reminders/repeats',
79
+ list: "/api/reminders/repeats",
76
80
  get: (id) => `/api/reminders/repeats/${id}`,
77
81
  history: (id) => `/api/reminders/repeats/${id}/history`,
78
- create: '/api/reminders/repeats',
79
- update: '/api/reminders/repeats',
82
+ create: "/api/reminders/repeats",
83
+ update: "/api/reminders/repeats",
80
84
  delete: (id) => `/api/reminders/repeats/${id}`,
81
85
  },
82
86
  priceMatches: {
83
- list: '/api/price-matches',
87
+ list: "/api/price-matches",
84
88
  get: (id) => `/api/price-matches/${id}`,
85
- create: '/api/price-matches',
86
- update: '/api/price-matches',
89
+ create: "/api/price-matches",
90
+ update: "/api/price-matches",
87
91
  delete: (id) => `/api/price-matches/${id}`,
88
92
  },
89
93
  directUserProfiles: {
90
- list: '/api/profiles/direct-users',
94
+ list: "/api/profiles/direct-users",
91
95
  get: (id) => `/api/profiles/direct-users/${id}`,
92
96
  getByUser: (userId) => `/api/profiles/direct-users/user/${userId}`,
93
- create: '/api/profiles/direct-users',
97
+ create: "/api/profiles/direct-users",
94
98
  onboard: (userId) => `/api/profiles/direct-users/${userId}`,
95
- update: '/api/profiles/direct-users',
99
+ update: "/api/profiles/direct-users",
96
100
  delete: (id) => `/api/profiles/direct-users/${id}`,
97
101
  },
98
102
  partnerPharmacyProfiles: {
99
- list: '/api/profiles/partner-pharmacies',
103
+ list: "/api/profiles/partner-pharmacies",
100
104
  get: (id) => `/api/profiles/partner-pharmacies/${id}`,
101
105
  getByUser: (userId) => `/api/profiles/partner-pharmacies/user/${userId}`,
102
- create: '/api/profiles/partner-pharmacies',
103
- update: '/api/profiles/partner-pharmacies',
106
+ create: "/api/profiles/partner-pharmacies",
107
+ update: "/api/profiles/partner-pharmacies",
104
108
  delete: (id) => `/api/profiles/partner-pharmacies/${id}`,
105
109
  },
106
110
  users: {
107
111
  data: (userId) => `/api/users/data/${userId}`,
108
112
  },
109
113
  uploads: {
110
- presign: '/api/uploads/presign',
111
- delete: '/api/uploads',
114
+ presign: "/api/uploads/presign",
115
+ delete: "/api/uploads",
112
116
  },
113
117
  sms: {
114
- twilioStatus: '/api/webhooks/twilio/status',
115
- send: '/api/reminders/sms',
118
+ twilioStatus: "/api/webhooks/twilio/status",
119
+ send: "/api/reminders/sms",
116
120
  },
117
121
  email: {},
118
122
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natch-the-storage/heathershaw-platform-types",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Interfaces and routes to use on the client",
5
5
  "license": "ISC",
6
6
  "author": "Natch Surana",