aparavi-client 1.0.2

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 (169) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +523 -0
  3. package/dist/aparavi-client-typescript-1.0.0.tgz +0 -0
  4. package/dist/aparavi-client-typescript-1.0.1.tgz +0 -0
  5. package/dist/cjs/client.js +1002 -0
  6. package/dist/cjs/client.js.map +1 -0
  7. package/dist/cjs/constants.js +37 -0
  8. package/dist/cjs/constants.js.map +1 -0
  9. package/dist/cjs/core/DAPBase.js +313 -0
  10. package/dist/cjs/core/DAPBase.js.map +1 -0
  11. package/dist/cjs/core/DAPClient.js +173 -0
  12. package/dist/cjs/core/DAPClient.js.map +1 -0
  13. package/dist/cjs/core/TransportBase.js +131 -0
  14. package/dist/cjs/core/TransportBase.js.map +1 -0
  15. package/dist/cjs/core/TransportWebSocket.js +492 -0
  16. package/dist/cjs/core/TransportWebSocket.js.map +1 -0
  17. package/dist/cjs/exceptions/index.js +109 -0
  18. package/dist/cjs/exceptions/index.js.map +1 -0
  19. package/dist/cjs/index.js +56 -0
  20. package/dist/cjs/index.js.map +1 -0
  21. package/dist/cjs/package.json +3 -0
  22. package/dist/cjs/schema/Doc.js +79 -0
  23. package/dist/cjs/schema/Doc.js.map +1 -0
  24. package/dist/cjs/schema/DocFilter.js +133 -0
  25. package/dist/cjs/schema/DocFilter.js.map +1 -0
  26. package/dist/cjs/schema/DocGroup.js +235 -0
  27. package/dist/cjs/schema/DocGroup.js.map +1 -0
  28. package/dist/cjs/schema/DocMetadata.js +57 -0
  29. package/dist/cjs/schema/DocMetadata.js.map +1 -0
  30. package/dist/cjs/schema/Question.js +414 -0
  31. package/dist/cjs/schema/Question.js.map +1 -0
  32. package/dist/cjs/schema/index.js +50 -0
  33. package/dist/cjs/schema/index.js.map +1 -0
  34. package/dist/cjs/types/client.js +26 -0
  35. package/dist/cjs/types/client.js.map +1 -0
  36. package/dist/cjs/types/data.js +26 -0
  37. package/dist/cjs/types/data.js.map +1 -0
  38. package/dist/cjs/types/events.js +119 -0
  39. package/dist/cjs/types/events.js.map +1 -0
  40. package/dist/cjs/types/index.js +50 -0
  41. package/dist/cjs/types/index.js.map +1 -0
  42. package/dist/cjs/types/pipeline.js +26 -0
  43. package/dist/cjs/types/pipeline.js.map +1 -0
  44. package/dist/cjs/types/task.js +115 -0
  45. package/dist/cjs/types/task.js.map +1 -0
  46. package/dist/cli/cli/aparavi.js +1401 -0
  47. package/dist/cli/cli/aparavi.js.map +1 -0
  48. package/dist/cli/src/client.js +1002 -0
  49. package/dist/cli/src/client.js.map +1 -0
  50. package/dist/cli/src/constants.js +37 -0
  51. package/dist/cli/src/constants.js.map +1 -0
  52. package/dist/cli/src/core/DAPBase.js +313 -0
  53. package/dist/cli/src/core/DAPBase.js.map +1 -0
  54. package/dist/cli/src/core/DAPClient.js +173 -0
  55. package/dist/cli/src/core/DAPClient.js.map +1 -0
  56. package/dist/cli/src/core/TransportBase.js +131 -0
  57. package/dist/cli/src/core/TransportBase.js.map +1 -0
  58. package/dist/cli/src/core/TransportWebSocket.js +492 -0
  59. package/dist/cli/src/core/TransportWebSocket.js.map +1 -0
  60. package/dist/cli/src/exceptions/index.js +109 -0
  61. package/dist/cli/src/exceptions/index.js.map +1 -0
  62. package/dist/cli/src/index.js +56 -0
  63. package/dist/cli/src/index.js.map +1 -0
  64. package/dist/cli/src/schema/Doc.js +79 -0
  65. package/dist/cli/src/schema/Doc.js.map +1 -0
  66. package/dist/cli/src/schema/DocFilter.js +133 -0
  67. package/dist/cli/src/schema/DocFilter.js.map +1 -0
  68. package/dist/cli/src/schema/DocGroup.js +235 -0
  69. package/dist/cli/src/schema/DocGroup.js.map +1 -0
  70. package/dist/cli/src/schema/DocMetadata.js +57 -0
  71. package/dist/cli/src/schema/DocMetadata.js.map +1 -0
  72. package/dist/cli/src/schema/Question.js +414 -0
  73. package/dist/cli/src/schema/Question.js.map +1 -0
  74. package/dist/cli/src/schema/index.js +50 -0
  75. package/dist/cli/src/schema/index.js.map +1 -0
  76. package/dist/cli/src/types/client.js +26 -0
  77. package/dist/cli/src/types/client.js.map +1 -0
  78. package/dist/cli/src/types/data.js +26 -0
  79. package/dist/cli/src/types/data.js.map +1 -0
  80. package/dist/cli/src/types/events.js +119 -0
  81. package/dist/cli/src/types/events.js.map +1 -0
  82. package/dist/cli/src/types/index.js +50 -0
  83. package/dist/cli/src/types/index.js.map +1 -0
  84. package/dist/cli/src/types/pipeline.js +26 -0
  85. package/dist/cli/src/types/pipeline.js.map +1 -0
  86. package/dist/cli/src/types/task.js +115 -0
  87. package/dist/cli/src/types/task.js.map +1 -0
  88. package/dist/esm/client.js +997 -0
  89. package/dist/esm/client.js.map +1 -0
  90. package/dist/esm/constants.js +34 -0
  91. package/dist/esm/constants.js.map +1 -0
  92. package/dist/esm/core/DAPBase.js +309 -0
  93. package/dist/esm/core/DAPBase.js.map +1 -0
  94. package/dist/esm/core/DAPClient.js +169 -0
  95. package/dist/esm/core/DAPClient.js.map +1 -0
  96. package/dist/esm/core/TransportBase.js +127 -0
  97. package/dist/esm/core/TransportBase.js.map +1 -0
  98. package/dist/esm/core/TransportWebSocket.js +488 -0
  99. package/dist/esm/core/TransportWebSocket.js.map +1 -0
  100. package/dist/esm/exceptions/index.js +100 -0
  101. package/dist/esm/exceptions/index.js.map +1 -0
  102. package/dist/esm/index.js +40 -0
  103. package/dist/esm/index.js.map +1 -0
  104. package/dist/esm/package.json +3 -0
  105. package/dist/esm/schema/Doc.js +75 -0
  106. package/dist/esm/schema/Doc.js.map +1 -0
  107. package/dist/esm/schema/DocFilter.js +129 -0
  108. package/dist/esm/schema/DocFilter.js.map +1 -0
  109. package/dist/esm/schema/DocGroup.js +231 -0
  110. package/dist/esm/schema/DocGroup.js.map +1 -0
  111. package/dist/esm/schema/DocMetadata.js +53 -0
  112. package/dist/esm/schema/DocMetadata.js.map +1 -0
  113. package/dist/esm/schema/Question.js +409 -0
  114. package/dist/esm/schema/Question.js.map +1 -0
  115. package/dist/esm/schema/index.js +34 -0
  116. package/dist/esm/schema/index.js.map +1 -0
  117. package/dist/esm/types/client.js +25 -0
  118. package/dist/esm/types/client.js.map +1 -0
  119. package/dist/esm/types/data.js +25 -0
  120. package/dist/esm/types/data.js.map +1 -0
  121. package/dist/esm/types/events.js +116 -0
  122. package/dist/esm/types/events.js.map +1 -0
  123. package/dist/esm/types/index.js +34 -0
  124. package/dist/esm/types/index.js.map +1 -0
  125. package/dist/esm/types/pipeline.js +25 -0
  126. package/dist/esm/types/pipeline.js.map +1 -0
  127. package/dist/esm/types/task.js +112 -0
  128. package/dist/esm/types/task.js.map +1 -0
  129. package/dist/types/client.d.ts +395 -0
  130. package/dist/types/client.d.ts.map +1 -0
  131. package/dist/types/constants.d.ts +34 -0
  132. package/dist/types/constants.d.ts.map +1 -0
  133. package/dist/types/core/DAPBase.d.ts +140 -0
  134. package/dist/types/core/DAPBase.d.ts.map +1 -0
  135. package/dist/types/core/DAPClient.d.ts +83 -0
  136. package/dist/types/core/DAPClient.d.ts.map +1 -0
  137. package/dist/types/core/TransportBase.d.ts +94 -0
  138. package/dist/types/core/TransportBase.d.ts.map +1 -0
  139. package/dist/types/core/TransportWebSocket.d.ts +78 -0
  140. package/dist/types/core/TransportWebSocket.d.ts.map +1 -0
  141. package/dist/types/exceptions/index.d.ts +81 -0
  142. package/dist/types/exceptions/index.d.ts.map +1 -0
  143. package/dist/types/index.d.ts +36 -0
  144. package/dist/types/index.d.ts.map +1 -0
  145. package/dist/types/schema/Doc.d.ts +69 -0
  146. package/dist/types/schema/Doc.d.ts.map +1 -0
  147. package/dist/types/schema/DocFilter.d.ts +101 -0
  148. package/dist/types/schema/DocFilter.d.ts.map +1 -0
  149. package/dist/types/schema/DocGroup.d.ts +113 -0
  150. package/dist/types/schema/DocGroup.d.ts.map +1 -0
  151. package/dist/types/schema/DocMetadata.d.ts +61 -0
  152. package/dist/types/schema/DocMetadata.d.ts.map +1 -0
  153. package/dist/types/schema/Question.d.ts +163 -0
  154. package/dist/types/schema/Question.d.ts.map +1 -0
  155. package/dist/types/schema/index.d.ts +34 -0
  156. package/dist/types/schema/index.d.ts.map +1 -0
  157. package/dist/types/types/client.d.ts +140 -0
  158. package/dist/types/types/client.d.ts.map +1 -0
  159. package/dist/types/types/data.d.ts +95 -0
  160. package/dist/types/types/data.d.ts.map +1 -0
  161. package/dist/types/types/events.d.ts +246 -0
  162. package/dist/types/types/events.d.ts.map +1 -0
  163. package/dist/types/types/index.d.ts +34 -0
  164. package/dist/types/types/index.d.ts.map +1 -0
  165. package/dist/types/types/pipeline.d.ts +61 -0
  166. package/dist/types/types/pipeline.d.ts.map +1 -0
  167. package/dist/types/types/task.d.ts +265 -0
  168. package/dist/types/types/task.d.ts.map +1 -0
  169. package/package.json +75 -0
@@ -0,0 +1,140 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { DAPMessage, AparaviClientConfig } from '../types';
25
+ import { TransportBase } from './TransportBase';
26
+ /**
27
+ * Base class for DAP (Debug Adapter Protocol) components.
28
+ *
29
+ * Provides standardized logging, error handling, message building, and debugging
30
+ * capabilities for all DAP-based components. This class handles the low-level
31
+ * details of the protocol including message sequencing, request/response correlation,
32
+ * and transport binding.
33
+ *
34
+ * Key responsibilities:
35
+ * - Message sequence number generation
36
+ * - Transport layer binding and lifecycle management
37
+ * - Debug logging and protocol tracing
38
+ * - Error handling and exception building
39
+ * - Request/Response message construction
40
+ *
41
+ * @abstract This class is meant to be extended by specific DAP implementations
42
+ */
43
+ export declare class DAPBase {
44
+ protected _msgType: string;
45
+ protected _seqCounter: number;
46
+ protected _transport?: TransportBase;
47
+ protected _callDebugMessage?: (message: string) => void;
48
+ protected _callDebugProtocol?: (message: string) => void;
49
+ protected _logger?: any;
50
+ /**
51
+ * Creates a new DAPBase instance.
52
+ *
53
+ * @param module - Name of the module for message type identification
54
+ * @param transport - Transport layer for communication
55
+ * @param config - Client configuration including debug callbacks
56
+ */
57
+ constructor(module: string, transport: TransportBase, config: AparaviClientConfig);
58
+ /**
59
+ * Attempt to call a specific method, falling back to a default method.
60
+ *
61
+ * This is a utility method for dynamic method dispatch based on message commands.
62
+ * It first tries to call a specific handler method, then falls back to a default
63
+ * handler if the specific one doesn't exist.
64
+ *
65
+ * @param message - The DAP message to be handled
66
+ * @param methodName - Name of the specific handler method to try
67
+ * @param defaultName - Name of the default fallback method
68
+ * @returns Tuple of [handled: boolean, result: any]
69
+ * @protected
70
+ */
71
+ protected _callMethod(message: DAPMessage, methodName?: string, defaultName?: string): Promise<[boolean, any]>;
72
+ /**
73
+ * Generate the next sequence number for DAP message correlation.
74
+ */
75
+ protected _nextSeq(): number;
76
+ /**
77
+ * Log an error message and throw the provided exception.
78
+ */
79
+ raiseException(exception: Error): never;
80
+ /**
81
+ * Output a general operational message with the instance's message type prefix.
82
+ */
83
+ debugMessage(msg: string): void;
84
+ /**
85
+ * Output a protocol-level debug message for detailed DAP communication tracing.
86
+ */
87
+ debugProtocol(packet: string): void;
88
+ /**
89
+ * Handle incoming DAP events from the transport layer.
90
+ */
91
+ onEvent(event: DAPMessage): Promise<void>;
92
+ /**
93
+ * Handle transport connection establishment.
94
+ */
95
+ onConnected(connectionInfo?: string): Promise<void>;
96
+ /**
97
+ * Handle transport disconnection and cleanup.
98
+ */
99
+ onDisconnected(reason?: string, hasError?: boolean): Promise<void>;
100
+ /**
101
+ * Handle received messages from the transport layer.
102
+ */
103
+ onReceive(message: DAPMessage): Promise<void>;
104
+ /**
105
+ * Check if a DAP request indicates failure based on its response fields.
106
+ */
107
+ didFail(request: DAPMessage): boolean;
108
+ /**
109
+ * Extract the web error details from a DAP request message.
110
+ */
111
+ getWebResponse(message: DAPMessage): Record<string, any>;
112
+ /**
113
+ * Build a DAP request message following the protocol specification.
114
+ */
115
+ buildRequest(command: string, options?: {
116
+ token?: string;
117
+ arguments?: Record<string, any>;
118
+ data?: Uint8Array | string;
119
+ }): DAPMessage;
120
+ /**
121
+ * Build a successful DAP response message for a given request.
122
+ */
123
+ buildResponse(request: DAPMessage, body?: Record<string, any>): DAPMessage;
124
+ /**
125
+ * Build a DAP event message to notify clients of state changes.
126
+ */
127
+ buildEvent(event: string, options?: {
128
+ id?: string;
129
+ body?: Record<string, any>;
130
+ }): DAPMessage;
131
+ /**
132
+ * Build a DAP error response.
133
+ */
134
+ buildError(request: DAPMessage, message: string): DAPMessage;
135
+ /**
136
+ * Build a DAP exception response with debugging information.
137
+ */
138
+ buildException(request: DAPMessage, error: Error): DAPMessage;
139
+ }
140
+ //# sourceMappingURL=DAPBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DAPBase.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/core/DAPBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,OAAO;IACnB,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,WAAW,SAAK;IAC1B,SAAS,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACrC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,SAAS,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IAExB;;;;;;OAMG;gBACS,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB;IAoBjF;;;;;;;;;;;;OAYG;cACa,WAAW,CAC1B,OAAO,EAAE,UAAU,EACnB,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAyB1B;;OAEG;IACH,SAAS,CAAC,QAAQ,IAAI,MAAM;IAK5B;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK;IAKvC;;OAEG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAM/B;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMnC;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C;;OAEG;IACG,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACG,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO;IAIrC;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAqBxD;;OAEG;IACH,YAAY,CACX,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;KACtB,GACJ,UAAU;IA0Bb;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU;IAgB1E;;OAEG;IACH,UAAU,CACT,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACtB,GACJ,UAAU;IAqBb;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU;IAiC5D;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,UAAU;CA0B7D"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { DAPBase } from './DAPBase';
25
+ import { DAPMessage, AparaviClientConfig } from '../types';
26
+ import { TransportBase } from './TransportBase';
27
+ /**
28
+ * DAP (Debug Adapter Protocol) client for communicating with Aparavi servers.
29
+ *
30
+ * This class implements the client side of the DAP communication protocol,
31
+ * managing request/response correlation, pending request tracking, and message
32
+ * sequencing. It extends DAPBase to inherit common protocol functionality.
33
+ *
34
+ * Key responsibilities:
35
+ * - Request/response correlation via sequence numbers
36
+ * - Pending request management with promises
37
+ * - Connection lifecycle management
38
+ * - Message routing and handling
39
+ *
40
+ * @extends DAPBase
41
+ */
42
+ export declare class DAPClient extends DAPBase {
43
+ private _pendingRequests;
44
+ private _sequenceNumber;
45
+ constructor(module: string, transport: TransportBase, config?: AparaviClientConfig);
46
+ /**
47
+ * Generate the next sequence number for outgoing requests.
48
+ */
49
+ private getNextSeq;
50
+ /**
51
+ * Send a message to the DAP server through the transport layer.
52
+ */
53
+ protected _send(message: DAPMessage): Promise<void>;
54
+ /**
55
+ * Handle connection established event.
56
+ */
57
+ onConnected(connectionInfo?: string): Promise<void>;
58
+ /**
59
+ * Handle disconnection event and clean up pending requests.
60
+ */
61
+ onDisconnected(reason?: string, hasError?: boolean): Promise<void>;
62
+ /**
63
+ * Handle received messages from the transport layer.
64
+ */
65
+ onReceive(message: DAPMessage): Promise<void>;
66
+ /**
67
+ * Send a request and wait for the corresponding response.
68
+ */
69
+ request(message: DAPMessage): Promise<DAPMessage>;
70
+ /**
71
+ * Establish connection to the DAP server.
72
+ */
73
+ connect(): Promise<void>;
74
+ /**
75
+ * Close connection to the DAP server and clean up resources.
76
+ */
77
+ disconnect(): Promise<void>;
78
+ /**
79
+ * Check if connected to server.
80
+ */
81
+ isConnected(): boolean;
82
+ }
83
+ //# sourceMappingURL=DAPClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DAPClient.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/core/DAPClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,SAAU,SAAQ,OAAO;IACrC,OAAO,CAAC,gBAAgB,CAGnB;IACL,OAAO,CAAC,eAAe,CAAK;gBAEhB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,GAAE,mBAAwB;IAItF;;OAEG;IACH,OAAO,CAAC,UAAU;IAIlB;;OAEG;cACa,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzD;;OAEG;IACG,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACG,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAetE;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBnD;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAuCvD;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAW9B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;OAEG;IACH,WAAW,IAAI,OAAO;CAGtB"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { DAPMessage, TransportCallbacks } from '../types';
25
+ /**
26
+ * Abstract base class for DAP transport implementations.
27
+ *
28
+ * This class defines the standard interface that all transport implementations
29
+ * must follow for DAP communication. It provides common functionality for
30
+ * callback management, connection state tracking, and debug message routing.
31
+ *
32
+ * Concrete implementations must provide:
33
+ * - connect(): Establish the transport connection
34
+ * - disconnect(): Close the transport connection
35
+ * - send(): Transmit a DAP message
36
+ *
37
+ * @abstract This class must be extended by concrete transport implementations
38
+ */
39
+ export declare abstract class TransportBase {
40
+ protected _connected: boolean;
41
+ protected _onCallerDebugMessage?: (message: string) => void;
42
+ protected _onCallerDebugProtocol?: (message: string) => void;
43
+ protected _onCallerReceive?: (message: DAPMessage) => Promise<void>;
44
+ protected _onCallerConnected?: (connectionInfo?: string) => Promise<void>;
45
+ protected _onCallerDisconnected?: (reason?: string, hasError?: boolean) => Promise<void>;
46
+ /**
47
+ * Send debug message to callback if available.
48
+ */
49
+ protected _debugMessage(message: string): void;
50
+ /**
51
+ * Send protocol debug message to callback if available.
52
+ */
53
+ protected _debugProtocol(message: string): void;
54
+ /**
55
+ * Forward received message to callback if available.
56
+ */
57
+ protected _transportReceive(message: DAPMessage): Promise<void>;
58
+ /**
59
+ * Notify about connection establishment.
60
+ */
61
+ protected _transportConnected(connectionInfo?: string): Promise<void>;
62
+ /**
63
+ * Notify about connection closure.
64
+ */
65
+ protected _transportDisconnected(reason?: string, hasError?: boolean): Promise<void>;
66
+ /**
67
+ * Bind callback functions to the transport.
68
+ *
69
+ * This must be called before using the transport for communication.
70
+ * The callbacks handle debugging, connection events, and message processing.
71
+ */
72
+ bind(callbacks: TransportCallbacks): void;
73
+ /**
74
+ * Check if the transport is currently connected.
75
+ */
76
+ isConnected(): boolean;
77
+ /**
78
+ * Establish connection to remote endpoint (client-side).
79
+ */
80
+ connect(): Promise<void>;
81
+ /**
82
+ * Accept incoming connection (server-side).
83
+ */
84
+ accept(connectionInfo: any): Promise<void>;
85
+ /**
86
+ * Close connection and cleanup resources.
87
+ */
88
+ abstract disconnect(): Promise<void>;
89
+ /**
90
+ * Send a message over the transport.
91
+ */
92
+ abstract send(message: DAPMessage): Promise<void>;
93
+ }
94
+ //# sourceMappingURL=TransportBase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransportBase.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/core/TransportBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,8BAAsB,aAAa;IAClC,SAAS,CAAC,UAAU,UAAS;IAC7B,SAAS,CAAC,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,SAAS,CAAC,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,SAAS,CAAC,qBAAqB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzF;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM9C;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM/C;;OAEG;cACa,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAOrE;;OAEG;cACa,mBAAmB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO3E;;OAEG;cACa,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxF;;;;;OAKG;IACH,IAAI,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAkBzC;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B;;OAEG;IACG,MAAM,CAAC,cAAc,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD;;OAEG;IACH,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CACjD"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { TransportBase } from './TransportBase';
25
+ import { DAPMessage } from '../types';
26
+ /**
27
+ * WebSocket transport implementation for DAP protocol communication.
28
+ *
29
+ * Provides WebSocket-based communication between Aparavi clients and servers
30
+ * with support for both text (JSON) and binary (CBOR) message formats. Handles
31
+ * connection lifecycle management, message serialization/deserialization, automatic
32
+ * heartbeat/ping messages, and connection timeout detection.
33
+ *
34
+ * Features:
35
+ * - Cross-platform: Works in both browser (native WebSocket) and Node.js (ws library)
36
+ * - Automatic message encoding/decoding (JSON and CBOR)
37
+ * - Connection timeout handling
38
+ * - Authentication via headers
39
+ * - Message queuing during connection
40
+ *
41
+ * @extends TransportBase
42
+ */
43
+ export declare class TransportWebSocket extends TransportBase {
44
+ private _websocket?;
45
+ private _uri;
46
+ private _auth?;
47
+ private _messageTasks;
48
+ private _connectionTimeout?;
49
+ constructor(uri?: string, auth?: string);
50
+ /**
51
+ * Process raw WebSocket data into structured messages.
52
+ *
53
+ * Handles both JSON text messages and DAP binary format messages.
54
+ * Binary messages use format: JSON header + newline + binary payload.
55
+ */
56
+ private _receiveData;
57
+ /**
58
+ * Connect to WebSocket server and start receiving messages.
59
+ * Works in both browser and Node.js environments.
60
+ */
61
+ connect(): Promise<void>;
62
+ /**
63
+ * Disconnect and close the WebSocket connection gracefully.
64
+ * Works in both browser and Node.js environments.
65
+ */
66
+ disconnect(): Promise<void>;
67
+ /**
68
+ * Send a DAP message with automatic format selection.
69
+ *
70
+ * Handles both standard JSON messages and DAP binary messages with
71
+ * data payloads. Automatically chooses appropriate WebSocket message
72
+ * format based on message content.
73
+ *
74
+ * Works in both browser and Node.js environments.
75
+ */
76
+ send(message: DAPMessage): Promise<void>;
77
+ }
78
+ //# sourceMappingURL=TransportWebSocket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TransportWebSocket.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/core/TransportWebSocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiBtC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;IACpD,OAAO,CAAC,UAAU,CAAC,CAAqB;IACxC,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAC,CAAS;IACvB,OAAO,CAAC,aAAa,CAA2B;IAChD,OAAO,CAAC,kBAAkB,CAAC,CAAM;gBAErB,GAAG,SAAwB,EAAE,IAAI,CAAC,EAAE,MAAM;IAMtD;;;;;OAKG;YACW,YAAY;IA6C1B;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAyN9B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IA8HjC;;;;;;;;OAQG;IACG,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAoE9C"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ /**
25
+ * Base exception class for Debug Adapter Protocol (DAP) errors.
26
+ *
27
+ * This exception wraps DAP error responses to provide structured access to
28
+ * error information including file locations, line numbers, and other
29
+ * contextual data returned by Aparavi servers.
30
+ */
31
+ export declare class DAPException extends Error {
32
+ readonly dapResult: Record<string, any>;
33
+ constructor(dapResult: Record<string, any>);
34
+ }
35
+ /**
36
+ * Base exception for all Aparavi operations.
37
+ *
38
+ * This is the root exception class for all Aparavi-specific errors.
39
+ * Catch this exception type to handle any error that originates from
40
+ * Aparavi operations while still having access to detailed error context.
41
+ */
42
+ export declare class AparaviException extends DAPException {
43
+ constructor(dapResult: Record<string, any>);
44
+ }
45
+ /**
46
+ * Exception raised for connection-related issues.
47
+ *
48
+ * Raised when there are problems connecting to Aparavi servers,
49
+ * maintaining connections, or when connections are lost unexpectedly.
50
+ */
51
+ export declare class ConnectionException extends AparaviException {
52
+ constructor(dapResult: Record<string, any>);
53
+ }
54
+ /**
55
+ * Exception raised for data pipe operations.
56
+ *
57
+ * Raised when there are problems with data pipes used for sending
58
+ * data to pipelines, uploading files, or streaming operations.
59
+ */
60
+ export declare class PipeException extends AparaviException {
61
+ constructor(dapResult: Record<string, any>);
62
+ }
63
+ /**
64
+ * Exception raised for pipeline execution issues.
65
+ *
66
+ * Raised when there are problems starting, running, or managing
67
+ * Aparavi pipelines and processing tasks.
68
+ */
69
+ export declare class ExecutionException extends AparaviException {
70
+ constructor(dapResult: Record<string, any>);
71
+ }
72
+ /**
73
+ * Exception raised for input validation failures.
74
+ *
75
+ * Raised when input data, configurations, or parameters don't meet
76
+ * the requirements for Aparavi operations.
77
+ */
78
+ export declare class ValidationException extends AparaviException {
79
+ constructor(dapResult: Record<string, any>);
80
+ }
81
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/exceptions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,SAAgB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAEnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAM1C;AAED;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;gBACrC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAI1C;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,gBAAgB;gBAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAI1C;AAED;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;gBACtC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAI1C;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,gBAAgB;gBAC3C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAI1C;AAED;;;;;GAKG;AACH,qBAAa,mBAAoB,SAAQ,gBAAgB;gBAC5C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAI1C"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ /**
25
+ * Aparavi Client TypeScript SDK
26
+ *
27
+ * Main entry point for the Aparavi TypeScript client library.
28
+ * Exports all public APIs, types, exceptions, and schema definitions.
29
+ *
30
+ * @packageDocumentation
31
+ */
32
+ export * from './exceptions';
33
+ export * from './schema';
34
+ export * from './types';
35
+ export * from './client';
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../aparavi-client/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;GAOG;AAGH,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2024 Aparavi Development Team
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import { DocMetadata } from './DocMetadata';
25
+ /**
26
+ * Represents a document returned from Aparavi operations like search, AI chat, or data processing.
27
+ *
28
+ * Documents contain the actual content text, relevance scoring, embeddings for semantic search,
29
+ * and metadata about the source file and location.
30
+ */
31
+ export interface Doc {
32
+ /** Type identifier of the document. */
33
+ type?: string;
34
+ /** The main text content of this document chunk. */
35
+ page_content?: string;
36
+ /** The AI model used to generate embeddings for this document. */
37
+ embedding_model?: string;
38
+ /** Vector representation for semantic search (usually hidden from end users). */
39
+ embedding?: number[];
40
+ /** Relevance score - higher numbers mean more relevant to your query. */
41
+ score?: number;
42
+ /** Additional score for highlighted or featured content. */
43
+ highlight_score?: number;
44
+ /** Additional contextual information related to this document. */
45
+ context?: string[];
46
+ /** Number of tokens in this document (important for AI processing limits). */
47
+ tokens?: number;
48
+ /** Information about the source file, location, permissions, and chunk details. */
49
+ metadata?: DocMetadata;
50
+ }
51
+ export declare class DocHelper {
52
+ /**
53
+ * Create a readable string representation showing the key identifiers and relevance score.
54
+ */
55
+ static toString(doc: Doc): string;
56
+ /**
57
+ * Convert this document to a dictionary for serialization or storage.
58
+ */
59
+ static toDict(doc: Doc): Record<string, any>;
60
+ /**
61
+ * Create a Document from a dictionary (reverse of toDict).
62
+ */
63
+ static fromDict(data: Record<string, any>): Doc;
64
+ /**
65
+ * Create a new document with default values.
66
+ */
67
+ static create(content: string, metadata?: Partial<DocMetadata>): Doc;
68
+ }
69
+ //# sourceMappingURL=Doc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Doc.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/schema/Doc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,GAAG;IACnB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,qBAAa,SAAS;IACrB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;IAIjC;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAY5C;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG;IAc/C;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,GAAG;CAYpE"}