dhti-cli 0.1.1 → 0.3.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.
@@ -0,0 +1,40 @@
1
+ {
2
+ "coreVersion": "5.4.0",
3
+ "frontendModules": {
4
+ "@openmrs/esm-home-app": "5.2.2",
5
+ "@openmrs/esm-patient-attachments-app": "7.0.1",
6
+ "@openmrs/esm-patient-flags-app": "7.0.1",
7
+ "@openmrs/esm-patient-appointments-app": "7.0.1",
8
+ "@openmrs/esm-patient-banner-app": "7.0.1",
9
+ "@openmrs/esm-patient-conditions-app": "7.0.1",
10
+ "@openmrs/esm-patient-immunizations-app": "7.0.1",
11
+ "@openmrs/esm-generic-patient-widgets-app": "7.0.1",
12
+ "@openmrs/esm-patient-chart-app": "7.0.1",
13
+ "@openmrs/esm-patient-forms-app": "7.0.1",
14
+ "@openmrs/esm-patient-labs-app": "7.0.1",
15
+ "@openmrs/esm-patient-programs-app": "7.0.1",
16
+ "@openmrs/esm-patient-orders-app": "7.0.1",
17
+ "@openmrs/esm-patient-list-management-app": "6.0.0",
18
+ "@openmrs/esm-patient-allergies-app": "7.0.1",
19
+ "@openmrs/esm-patient-lists-app": "7.0.1",
20
+ "@openmrs/esm-system-admin-app": "4.0.1",
21
+ "@openmrs/esm-form-entry-app": "7.0.1",
22
+ "@openmrs/esm-service-queues-app": "6.0.0",
23
+ "@openmrs/esm-patient-medications-app": "7.0.1",
24
+ "@openmrs/esm-patient-notes-app": "7.0.1",
25
+ "@openmrs/esm-patient-search-app": "6.0.0",
26
+ "@openmrs/esm-openconceptlab-app": "4.0.1",
27
+ "@openmrs/esm-login-app": "5.4.0",
28
+ "@openmrs/esm-active-visits-app": "6.0.0",
29
+ "@openmrs/esm-devtools-app": "5.4.0",
30
+ "@openmrs/esm-cohort-builder-app": "3.0.1-pre.183",
31
+ "@openmrs/esm-primary-navigation-app": "5.4.0",
32
+ "@openmrs/esm-patient-registration-app": "6.0.0",
33
+ "@openmrs/esm-implementer-tools-app": "5.4.0",
34
+ "@openmrs/esm-patient-vitals-app": "7.0.1",
35
+ "@openmrs/esm-appointments-app": "6.0.0",
36
+ "@openmrs/esm-dispensing-app": "1.3.0",
37
+ "@openmrs/esm-fast-data-entry-app": "1.0.1-pre.128",
38
+ "@openmrs/esm-form-builder-app": "2.3.1-pre.677"
39
+ }
40
+ }
@@ -29,7 +29,7 @@ export type CDSHookCardIndicator = 'hard-stop' | 'info' | 'warning';
29
29
  */
30
30
  export declare class CDSHookCardSource {
31
31
  icon?: string;
32
- label: string;
32
+ label?: string;
33
33
  url?: string;
34
34
  constructor(init?: Partial<CDSHookCardSource>);
35
35
  }
@@ -37,8 +37,8 @@ export declare class CDSHookCardSource {
37
37
  * Link associated with the CDS Hook Card
38
38
  */
39
39
  export declare class CDSHookCardLink {
40
- label: string;
41
- url: string;
40
+ label?: string;
41
+ url?: string;
42
42
  constructor(init?: Partial<CDSHookCardLink>);
43
43
  }
44
44
  /**
@@ -49,7 +49,7 @@ export declare class CDSHookCard {
49
49
  indicator?: CDSHookCardIndicator;
50
50
  links?: CDSHookCardLink[];
51
51
  source?: CDSHookCardSource;
52
- summary: string;
52
+ summary?: string;
53
53
  constructor(init?: Partial<CDSHookCard>);
54
54
  /**
55
55
  * Factory to build a CDSHookCard from a plain object, ensuring nested types are instantiated.
@@ -28,6 +28,8 @@ export class CDSHookCardSource {
28
28
  url;
29
29
  constructor(init) {
30
30
  Object.assign(this, init);
31
+ // Optionally, set a default value for label if desired:
32
+ // if (this.label === undefined) this.label = '';
31
33
  }
32
34
  }
33
35
  /**
@@ -38,6 +40,9 @@ export class CDSHookCardLink {
38
40
  url;
39
41
  constructor(init) {
40
42
  Object.assign(this, init);
43
+ // Optionally, set default values for label and url if desired:
44
+ // if (this.label === undefined) this.label = '';
45
+ // if (this.url === undefined) this.url = '';
41
46
  }
42
47
  }
43
48
  /**
@@ -59,6 +64,8 @@ export class CDSHookCard {
59
64
  if (links)
60
65
  this.links = links.map((l) => new CDSHookCardLink(l));
61
66
  }
67
+ // Optionally, set a default value for summary if desired:
68
+ // if (this.summary === undefined) this.summary = '';
62
69
  }
63
70
  /**
64
71
  * Factory to build a CDSHookCard from a plain object, ensuring nested types are instantiated.
@@ -1,3 +1,3 @@
1
1
  import { CDSHookCard } from './card.js';
2
- declare const cards: (response: any) => CDSHookCard[];
3
- export default cards;
2
+ declare const Cards: (response: any) => CDSHookCard[];
3
+ export default Cards;
@@ -1,5 +1,5 @@
1
1
  import { CDSHookCard } from './card.js';
2
- const cards = (response) => {
2
+ const Cards = (response) => {
3
3
  const _cards = response?.data?.cards;
4
4
  if (Array.isArray(_cards) && _cards.length > 0) {
5
5
  const lastCard = _cards.at(-1);
@@ -8,4 +8,4 @@ const cards = (response) => {
8
8
  }
9
9
  return [new CDSHookCard()];
10
10
  };
11
- export default cards;
11
+ export default Cards;
@@ -1,4 +1,2 @@
1
- export * from './card.js';
2
- export * from './getCard.js';
3
- export * from './request.js';
4
- export * from './useDhti.js';
1
+ export { default as Cards } from './getCard.js';
2
+ export { default as handleBundle } from './useDhti.js';
@@ -1,5 +1,3 @@
1
- export * from './card.js';
2
- export * from './getCard.js';
3
- export * from './request.js';
4
- export * from './useDhti.js';
5
1
  // ...add others as needed
2
+ export { default as Cards } from './getCard.js';
3
+ export { default as handleBundle } from './useDhti.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Sends a CDS Hook Request where the request.context contains the user's input message.
3
3
  */
4
- declare const handleBundle: (newMessage: string) => Promise<import("axios").AxiosResponse<any, any>>;
4
+ declare const handleBundle: (newMessage: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
5
5
  export default handleBundle;
@@ -11,7 +11,7 @@ const handleBundle = (newMessage) => {
11
11
  const _request = {
12
12
  input: request,
13
13
  };
14
- const endpoint = process.env.LANGSERVE_POST_ENDPOINT || '/langserve/dhti_elixir_template/invoke';
14
+ const endpoint = process.env.LANGSERVE_POST_ENDPOINT || '/langserve/dhti_elixir_template/cds-services/dhti-service';
15
15
  return axios.post(endpoint, {
16
16
  config: {},
17
17
  input: _request,
@@ -17,7 +17,7 @@
17
17
  "char": "f",
18
18
  "description": "Full path to the docker compose file to read from. Creates if it does not exist",
19
19
  "name": "file",
20
- "default": "/home/beapen/dhti/docker-compose.yml",
20
+ "default": "/home/runner/dhti/docker-compose.yml",
21
21
  "hasDynamicHelp": false,
22
22
  "multiple": false,
23
23
  "type": "option"
@@ -125,7 +125,7 @@
125
125
  "char": "w",
126
126
  "description": "Working directory to install the conch",
127
127
  "name": "workdir",
128
- "default": "/home/beapen/dhti",
128
+ "default": "/home/runner/dhti",
129
129
  "hasDynamicHelp": false,
130
130
  "multiple": false,
131
131
  "type": "option"
@@ -150,7 +150,7 @@
150
150
  "aliases": [],
151
151
  "args": {
152
152
  "path": {
153
- "default": "/home/beapen/dhti",
153
+ "default": "/home/runner/dhti",
154
154
  "description": "Docker project path to build. Ex: dhti",
155
155
  "name": "path"
156
156
  }
@@ -171,7 +171,7 @@
171
171
  "char": "f",
172
172
  "description": "Full path to the docker compose file to edit or run.",
173
173
  "name": "file",
174
- "default": "/home/beapen/dhti/docker-compose.yml",
174
+ "default": "/home/runner/dhti/docker-compose.yml",
175
175
  "hasDynamicHelp": false,
176
176
  "multiple": false,
177
177
  "type": "option"
@@ -304,7 +304,7 @@
304
304
  "char": "w",
305
305
  "description": "Working directory to install the elixir",
306
306
  "name": "workdir",
307
- "default": "/home/beapen/dhti",
307
+ "default": "/home/runner/dhti",
308
308
  "hasDynamicHelp": false,
309
309
  "multiple": false,
310
310
  "type": "option"
@@ -440,5 +440,5 @@
440
440
  ]
441
441
  }
442
442
  },
443
- "version": "0.1.1"
443
+ "version": "0.3.1"
444
444
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dhti-cli",
3
3
  "description": "DHTI CLI",
4
- "version": "0.1.1",
4
+ "version": "0.3.1",
5
5
  "author": "Bell Eapen",
6
6
  "bin": {
7
7
  "dhti-cli": "bin/run.js"
@@ -38,6 +38,7 @@
38
38
  "shx": "^0.3.3",
39
39
  "sinon": "^21.0.0",
40
40
  "ts-node": "^10",
41
+ "typedoc": "^0.28.13",
41
42
  "typescript": "^5"
42
43
  },
43
44
  "engines": {
@@ -75,14 +76,15 @@
75
76
  "url": "git+https://github.com/dermatologist/dhti.git"
76
77
  },
77
78
  "scripts": {
78
- "build": "shx rm -rf dist && tsc -b",
79
+ "build": "shx rm -rf dist && tsc -b && cp -r src/resources dist/",
79
80
  "lint": "eslint . --ext .ts",
80
81
  "fix": "eslint . --ext .ts --fix",
81
82
  "postpack": "shx rm -f oclif.manifest.json",
82
83
  "posttest": "echo 'npm run lint'",
83
- "prepack": "oclif manifest && oclif readme",
84
+ "prepack": "npx oclif manifest && npx oclif readme --readme-path notes/README.md",
84
85
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
85
- "version": "oclif readme && git add README.md"
86
+ "readme": "npx oclif readme --readme-path notes/README.md && git add notes/README.md",
87
+ "docs": "typedoc --exclude src/tool.ts --html docs src"
86
88
  },
87
89
  "types": "dist/index.d.ts"
88
- }
90
+ }