fastify-hl7 3.3.0 → 4.0.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 (43) hide show
  1. package/CHANGELOG.md +316 -0
  2. package/README.md +535 -60
  3. package/dist/api.d.ts +5 -0
  4. package/{lib/types → dist}/class/hL7Client.d.ts +49 -13
  5. package/{lib/esm → dist}/class/hL7Server.d.ts +2 -2
  6. package/dist/index.cjs +403 -0
  7. package/dist/index.cjs.map +1 -0
  8. package/{lib/types → dist}/index.d.ts +3 -3
  9. package/dist/index.mjs +377 -0
  10. package/dist/index.mjs.map +1 -0
  11. package/{lib/esm → dist}/types.d.ts +26 -20
  12. package/dist/validation.d.ts +6 -0
  13. package/package.json +44 -50
  14. package/lib/cjs/api.js +0 -13
  15. package/lib/cjs/class/hL7Client.js +0 -238
  16. package/lib/cjs/class/hL7Server.js +0 -81
  17. package/lib/cjs/decorate.js +0 -2
  18. package/lib/cjs/errors.js +0 -13
  19. package/lib/cjs/index.js +0 -144
  20. package/lib/cjs/package.json +0 -3
  21. package/lib/cjs/types.js +0 -2
  22. package/lib/cjs/validation.js +0 -15
  23. package/lib/esm/api.d.ts +0 -7
  24. package/lib/esm/api.js +0 -5
  25. package/lib/esm/class/hL7Client.d.ts +0 -99
  26. package/lib/esm/class/hL7Client.js +0 -201
  27. package/lib/esm/class/hL7Server.js +0 -77
  28. package/lib/esm/decorate.js +0 -1
  29. package/lib/esm/errors.js +0 -7
  30. package/lib/esm/index.d.ts +0 -5
  31. package/lib/esm/index.js +0 -125
  32. package/lib/esm/package.json +0 -3
  33. package/lib/esm/types.js +0 -1
  34. package/lib/esm/validation.d.ts +0 -6
  35. package/lib/esm/validation.js +0 -11
  36. package/lib/types/api.d.ts +0 -7
  37. package/lib/types/class/hL7Server.d.ts +0 -38
  38. package/lib/types/decorate.d.ts +0 -38
  39. package/lib/types/errors.d.ts +0 -10
  40. package/lib/types/types.d.ts +0 -69
  41. package/lib/types/validation.d.ts +0 -6
  42. package/{lib/esm → dist}/decorate.d.ts +16 -16
  43. /package/{lib/esm → dist}/errors.d.ts +0 -0
@@ -1,69 +0,0 @@
1
- import Server, { Inbound, InboundHandler, ListenerOptions } from "node-hl7-server";
2
- import Client, { Batch, ClientBuilderFileOptions, ClientBuilderMessageOptions, ClientBuilderOptions, ClientListenerOptions, ClientOptions, Connection, FileBatch, Message, OutboundHandler } from "node-hl7-client";
3
- declare module "fastify" {
4
- interface HL7 {
5
- /** Server Instance
6
- * @since 1.0.0 **/
7
- _serverInstance?: Server;
8
- /** Build HL7 Batch
9
- * @since 1.0.0 */
10
- buildBatch: (props?: ClientBuilderOptions) => Batch;
11
- /** Build Date
12
- * @remarks Build a date string based off HL7 Standards
13
- * @param date
14
- * @param length Options are 8, 12, or 14 (default)
15
- * @since 2.1.0
16
- */
17
- buildDate: (date: Date, length?: string) => string;
18
- /** Build HL7 File Batch
19
- * @since 1.0.0 */
20
- buildFileBatch: (props?: ClientBuilderFileOptions) => FileBatch;
21
- /** Build HL7 Message
22
- * @since 1.0.0 */
23
- buildMessage: (props?: ClientBuilderMessageOptions) => Message;
24
- /** Close a incoming HL7 port.
25
- * @since 1.0.0 */
26
- closeServer: (port: string) => Promise<boolean>;
27
- /** Close all incoming HL7 ports.
28
- * @since 1.0.0 */
29
- closeServerAll: () => Promise<boolean>;
30
- /** Create Client
31
- * @remarks Connecting to a remote server/broker that accepts connections.
32
- * @since 1.0.0 */
33
- createClient: (name: string, props: ClientOptions) => Client;
34
- /** Create an incoming port connection on the server.
35
- * @since 1.0.0 */
36
- createInbound: (name: string, props: ListenerOptions, handler: InboundHandler) => Inbound;
37
- /** Create Outgoing Client Port
38
- * @remarks This is on the established client that we are already a part off.
39
- * @since 1.0.0 */
40
- createConnection: (name: string, props: ClientListenerOptions, handler: OutboundHandler) => Connection;
41
- /** Get Client (Outbound) connection by name.
42
- * @since 1.0.0 */
43
- getClientByName: (name: string) => Client | undefined;
44
- /** Get Client Connection (Outbound) connection by port.
45
- * @since 1.0.0 */
46
- getClientConnectionByPort: (port: string) => Connection | undefined;
47
- /** Get Server (Inbound) connection by port.
48
- * @since 1.0.0 */
49
- getServerByPort: (port: string) => Inbound | undefined;
50
- /** Get Server (Inbound) connection by name.
51
- * @since 1.0.0 */
52
- getServerByName: (name: string) => Inbound | undefined;
53
- /** Process an HL7 string.
54
- * @since 1.0.0 */
55
- processHL7: (text: string) => Message | Batch;
56
- /** Read a file from a path.
57
- * @since 1.0.0 */
58
- readFile: (fullFilePath: string) => FileBatch;
59
- /** Read a buffer that was a file batch.
60
- * @since 1.0.0 */
61
- readFileBuffer: (fileBuffer: Buffer) => FileBatch;
62
- }
63
- interface FastifyInstance {
64
- /** Main Decorator for Fastify
65
- * @remarks hl7 is the decorator that everything hangs off.
66
- * @since 1.0.0 **/
67
- hl7: HL7;
68
- }
69
- }
@@ -1,6 +0,0 @@
1
- import { FastifyHL7Options } from "./decorate.js";
2
- /**
3
- * @since 1.0.0
4
- * @param opts
5
- */
6
- export declare const validateOpts: (opts: FastifyHL7Options) => Promise<FastifyHL7Options>;
@@ -1,5 +1,21 @@
1
1
  import Client, { Connection } from "node-hl7-client";
2
2
  import { Inbound, ServerOptions } from "node-hl7-server";
3
+ /**
4
+ * @since 1.0.0
5
+ */
6
+ export interface AClients {
7
+ client: Client;
8
+ name: string;
9
+ ports: AClientPorts[];
10
+ }
11
+ /**
12
+ * @since 1.0.0
13
+ */
14
+ export interface AServers {
15
+ name: string;
16
+ port: string;
17
+ server: Inbound;
18
+ }
3
19
  /**
4
20
  * @since 1.0.0
5
21
  */
@@ -16,23 +32,7 @@ export interface FastifyHL7Options {
16
32
  * @since 1.0.0
17
33
  */
18
34
  interface AClientPorts {
19
- port: string;
20
35
  connection: Connection;
21
- }
22
- /**
23
- * @since 1.0.0
24
- */
25
- export interface AClients {
26
- name: string;
27
- client: Client;
28
- ports: AClientPorts[];
29
- }
30
- /**
31
- * @since 1.0.0
32
- */
33
- export interface AServers {
34
- name: string;
35
36
  port: string;
36
- server: Inbound;
37
37
  }
38
38
  export {};
File without changes