fastify-hl7 3.2.0 → 4.0.0

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 +57 -0
  2. package/README.md +388 -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 +30 -21
  12. package/dist/validation.d.ts +6 -0
  13. package/package.json +43 -48
  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 -66
  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,66 +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
- /** BBuild Date
12
- * @since 2.1.0
13
- */
14
- buildDate: (date: Date, length?: string) => string;
15
- /** Build HL7 File Batch
16
- * @since 1.0.0 */
17
- buildFileBatch: (props?: ClientBuilderFileOptions) => FileBatch;
18
- /** Build HL7 Message
19
- * @since 1.0.0 */
20
- buildMessage: (props?: ClientBuilderMessageOptions) => Message;
21
- /** Close a incoming HL7 port.
22
- * @since 1.0.0 */
23
- closeServer: (port: string) => Promise<boolean>;
24
- /** Close all incoming HL7 ports.
25
- * @since 1.0.0 */
26
- closeServerAll: () => Promise<boolean>;
27
- /** Create Client
28
- * @remarks Connecting to a remote server/broker that accepts connections.
29
- * @since 1.0.0 */
30
- createClient: (name: string, props: ClientOptions) => Client;
31
- /** Create an incoming port connection on the server.
32
- * @since 1.0.0 */
33
- createInbound: (name: string, props: ListenerOptions, handler: InboundHandler) => Inbound;
34
- /** Create Outgoing Client Port
35
- * @remarks This is on the established client that we are already a part off.
36
- * @since 1.0.0 */
37
- createConnection: (name: string, props: ClientListenerOptions, handler: OutboundHandler) => Connection;
38
- /** Get Client (Outbound) connection by name.
39
- * @since 1.0.0 */
40
- getClientByName: (name: string) => Client | undefined;
41
- /** Get Client Connection (Outbound) connection by port.
42
- * @since 1.0.0 */
43
- getClientConnectionByPort: (port: string) => Connection | undefined;
44
- /** Get Server (Inbound) connection by port.
45
- * @since 1.0.0 */
46
- getServerByPort: (port: string) => Inbound | undefined;
47
- /** Get Server (Inbound) connection by name.
48
- * @since 1.0.0 */
49
- getServerByName: (name: string) => Inbound | undefined;
50
- /** Process an HL7 string.
51
- * @since 1.0.0 */
52
- processHL7: (text: string) => Message | Batch;
53
- /** Read a file from a path.
54
- * @since 1.0.0 */
55
- readFile: (fullFilePath: string) => FileBatch;
56
- /** Read a buffer that was a file batch.
57
- * @since 1.0.0 */
58
- readFileBuffer: (fileBuffer: Buffer) => FileBatch;
59
- }
60
- interface FastifyInstance {
61
- /** Main Decorator for Fastify
62
- * @remarks hl7 is the decorator that everything hangs off.
63
- * @since 1.0.0 **/
64
- hl7: HL7;
65
- }
66
- }
@@ -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