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.
- package/LICENSE +21 -0
- package/README.md +523 -0
- package/dist/aparavi-client-typescript-1.0.0.tgz +0 -0
- package/dist/aparavi-client-typescript-1.0.1.tgz +0 -0
- package/dist/cjs/client.js +1002 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants.js +37 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/core/DAPBase.js +313 -0
- package/dist/cjs/core/DAPBase.js.map +1 -0
- package/dist/cjs/core/DAPClient.js +173 -0
- package/dist/cjs/core/DAPClient.js.map +1 -0
- package/dist/cjs/core/TransportBase.js +131 -0
- package/dist/cjs/core/TransportBase.js.map +1 -0
- package/dist/cjs/core/TransportWebSocket.js +492 -0
- package/dist/cjs/core/TransportWebSocket.js.map +1 -0
- package/dist/cjs/exceptions/index.js +109 -0
- package/dist/cjs/exceptions/index.js.map +1 -0
- package/dist/cjs/index.js +56 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/schema/Doc.js +79 -0
- package/dist/cjs/schema/Doc.js.map +1 -0
- package/dist/cjs/schema/DocFilter.js +133 -0
- package/dist/cjs/schema/DocFilter.js.map +1 -0
- package/dist/cjs/schema/DocGroup.js +235 -0
- package/dist/cjs/schema/DocGroup.js.map +1 -0
- package/dist/cjs/schema/DocMetadata.js +57 -0
- package/dist/cjs/schema/DocMetadata.js.map +1 -0
- package/dist/cjs/schema/Question.js +414 -0
- package/dist/cjs/schema/Question.js.map +1 -0
- package/dist/cjs/schema/index.js +50 -0
- package/dist/cjs/schema/index.js.map +1 -0
- package/dist/cjs/types/client.js +26 -0
- package/dist/cjs/types/client.js.map +1 -0
- package/dist/cjs/types/data.js +26 -0
- package/dist/cjs/types/data.js.map +1 -0
- package/dist/cjs/types/events.js +119 -0
- package/dist/cjs/types/events.js.map +1 -0
- package/dist/cjs/types/index.js +50 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/pipeline.js +26 -0
- package/dist/cjs/types/pipeline.js.map +1 -0
- package/dist/cjs/types/task.js +115 -0
- package/dist/cjs/types/task.js.map +1 -0
- package/dist/cli/cli/aparavi.js +1401 -0
- package/dist/cli/cli/aparavi.js.map +1 -0
- package/dist/cli/src/client.js +1002 -0
- package/dist/cli/src/client.js.map +1 -0
- package/dist/cli/src/constants.js +37 -0
- package/dist/cli/src/constants.js.map +1 -0
- package/dist/cli/src/core/DAPBase.js +313 -0
- package/dist/cli/src/core/DAPBase.js.map +1 -0
- package/dist/cli/src/core/DAPClient.js +173 -0
- package/dist/cli/src/core/DAPClient.js.map +1 -0
- package/dist/cli/src/core/TransportBase.js +131 -0
- package/dist/cli/src/core/TransportBase.js.map +1 -0
- package/dist/cli/src/core/TransportWebSocket.js +492 -0
- package/dist/cli/src/core/TransportWebSocket.js.map +1 -0
- package/dist/cli/src/exceptions/index.js +109 -0
- package/dist/cli/src/exceptions/index.js.map +1 -0
- package/dist/cli/src/index.js +56 -0
- package/dist/cli/src/index.js.map +1 -0
- package/dist/cli/src/schema/Doc.js +79 -0
- package/dist/cli/src/schema/Doc.js.map +1 -0
- package/dist/cli/src/schema/DocFilter.js +133 -0
- package/dist/cli/src/schema/DocFilter.js.map +1 -0
- package/dist/cli/src/schema/DocGroup.js +235 -0
- package/dist/cli/src/schema/DocGroup.js.map +1 -0
- package/dist/cli/src/schema/DocMetadata.js +57 -0
- package/dist/cli/src/schema/DocMetadata.js.map +1 -0
- package/dist/cli/src/schema/Question.js +414 -0
- package/dist/cli/src/schema/Question.js.map +1 -0
- package/dist/cli/src/schema/index.js +50 -0
- package/dist/cli/src/schema/index.js.map +1 -0
- package/dist/cli/src/types/client.js +26 -0
- package/dist/cli/src/types/client.js.map +1 -0
- package/dist/cli/src/types/data.js +26 -0
- package/dist/cli/src/types/data.js.map +1 -0
- package/dist/cli/src/types/events.js +119 -0
- package/dist/cli/src/types/events.js.map +1 -0
- package/dist/cli/src/types/index.js +50 -0
- package/dist/cli/src/types/index.js.map +1 -0
- package/dist/cli/src/types/pipeline.js +26 -0
- package/dist/cli/src/types/pipeline.js.map +1 -0
- package/dist/cli/src/types/task.js +115 -0
- package/dist/cli/src/types/task.js.map +1 -0
- package/dist/esm/client.js +997 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants.js +34 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/core/DAPBase.js +309 -0
- package/dist/esm/core/DAPBase.js.map +1 -0
- package/dist/esm/core/DAPClient.js +169 -0
- package/dist/esm/core/DAPClient.js.map +1 -0
- package/dist/esm/core/TransportBase.js +127 -0
- package/dist/esm/core/TransportBase.js.map +1 -0
- package/dist/esm/core/TransportWebSocket.js +488 -0
- package/dist/esm/core/TransportWebSocket.js.map +1 -0
- package/dist/esm/exceptions/index.js +100 -0
- package/dist/esm/exceptions/index.js.map +1 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/schema/Doc.js +75 -0
- package/dist/esm/schema/Doc.js.map +1 -0
- package/dist/esm/schema/DocFilter.js +129 -0
- package/dist/esm/schema/DocFilter.js.map +1 -0
- package/dist/esm/schema/DocGroup.js +231 -0
- package/dist/esm/schema/DocGroup.js.map +1 -0
- package/dist/esm/schema/DocMetadata.js +53 -0
- package/dist/esm/schema/DocMetadata.js.map +1 -0
- package/dist/esm/schema/Question.js +409 -0
- package/dist/esm/schema/Question.js.map +1 -0
- package/dist/esm/schema/index.js +34 -0
- package/dist/esm/schema/index.js.map +1 -0
- package/dist/esm/types/client.js +25 -0
- package/dist/esm/types/client.js.map +1 -0
- package/dist/esm/types/data.js +25 -0
- package/dist/esm/types/data.js.map +1 -0
- package/dist/esm/types/events.js +116 -0
- package/dist/esm/types/events.js.map +1 -0
- package/dist/esm/types/index.js +34 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/pipeline.js +25 -0
- package/dist/esm/types/pipeline.js.map +1 -0
- package/dist/esm/types/task.js +112 -0
- package/dist/esm/types/task.js.map +1 -0
- package/dist/types/client.d.ts +395 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/constants.d.ts +34 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/core/DAPBase.d.ts +140 -0
- package/dist/types/core/DAPBase.d.ts.map +1 -0
- package/dist/types/core/DAPClient.d.ts +83 -0
- package/dist/types/core/DAPClient.d.ts.map +1 -0
- package/dist/types/core/TransportBase.d.ts +94 -0
- package/dist/types/core/TransportBase.d.ts.map +1 -0
- package/dist/types/core/TransportWebSocket.d.ts +78 -0
- package/dist/types/core/TransportWebSocket.d.ts.map +1 -0
- package/dist/types/exceptions/index.d.ts +81 -0
- package/dist/types/exceptions/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/schema/Doc.d.ts +69 -0
- package/dist/types/schema/Doc.d.ts.map +1 -0
- package/dist/types/schema/DocFilter.d.ts +101 -0
- package/dist/types/schema/DocFilter.d.ts.map +1 -0
- package/dist/types/schema/DocGroup.d.ts +113 -0
- package/dist/types/schema/DocGroup.d.ts.map +1 -0
- package/dist/types/schema/DocMetadata.d.ts +61 -0
- package/dist/types/schema/DocMetadata.d.ts.map +1 -0
- package/dist/types/schema/Question.d.ts +163 -0
- package/dist/types/schema/Question.d.ts.map +1 -0
- package/dist/types/schema/index.d.ts +34 -0
- package/dist/types/schema/index.d.ts.map +1 -0
- package/dist/types/types/client.d.ts +140 -0
- package/dist/types/types/client.d.ts.map +1 -0
- package/dist/types/types/data.d.ts +95 -0
- package/dist/types/types/data.d.ts.map +1 -0
- package/dist/types/types/events.d.ts +246 -0
- package/dist/types/types/events.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +34 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/pipeline.d.ts +61 -0
- package/dist/types/types/pipeline.d.ts.map +1 -0
- package/dist/types/types/task.d.ts +265 -0
- package/dist/types/types/task.d.ts.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
* Response structures from Aparavi pipeline data processing operations.
|
|
26
|
+
*
|
|
27
|
+
* These interfaces represent the different types of responses returned when data
|
|
28
|
+
* is sent through pipelines, depending on the processing method and MIME type handling.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Pipeline response structure with optional processing information.
|
|
32
|
+
*
|
|
33
|
+
* This is returned from all pipeline operations. When data is sent without
|
|
34
|
+
* MIME type specification, only basic fields are present. When MIME type
|
|
35
|
+
* is specified and processing occurs, additional result_types and dynamic
|
|
36
|
+
* fields are included.
|
|
37
|
+
*/
|
|
38
|
+
export interface PIPELINE_RESULT {
|
|
39
|
+
/** Unique identifier for this processing result (UUID format) */
|
|
40
|
+
name: string;
|
|
41
|
+
/** File path context (typically empty for direct data sends) */
|
|
42
|
+
path: string;
|
|
43
|
+
/** Unique object identifier for tracking processed items (UUID format) */
|
|
44
|
+
objectId: string;
|
|
45
|
+
/**
|
|
46
|
+
* Map of field names to their data type identifiers.
|
|
47
|
+
*
|
|
48
|
+
* The key is the name of a field that exists in this response object.
|
|
49
|
+
* The value indicates what type of data that field contains.
|
|
50
|
+
*
|
|
51
|
+
* Examples:
|
|
52
|
+
* - { "text": "text" } → look for response.text containing string array
|
|
53
|
+
* - { "my_text": "text", "my_answers": "answers" } → look for response.my_text and response.my_answers
|
|
54
|
+
* - { "answers": "answers" } → look for response.answers containing AI-generated responses
|
|
55
|
+
*/
|
|
56
|
+
result_types?: Record<string, string>;
|
|
57
|
+
/**
|
|
58
|
+
* Dynamic fields containing processed data based on result_types mapping.
|
|
59
|
+
*
|
|
60
|
+
* Field names and types are determined by the result_types object:
|
|
61
|
+
* - Fields with type "text": string[] (array of text segments)
|
|
62
|
+
* - Fields with type "answers": string[] (AI-generated chat responses)
|
|
63
|
+
* - Other types: depends on pipeline configuration
|
|
64
|
+
*
|
|
65
|
+
* Common field names: "text", "output", "content", "data", "result", "answers"
|
|
66
|
+
*/
|
|
67
|
+
[key: string]: any;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* File upload result structure with processing outcome and metadata.
|
|
71
|
+
*
|
|
72
|
+
* This represents the complete result of a file upload operation, including
|
|
73
|
+
* upload statistics, processing results, and any error information.
|
|
74
|
+
*/
|
|
75
|
+
export interface UPLOAD_RESULT {
|
|
76
|
+
/** Upload completion status - 'complete' indicates successful upload and processing */
|
|
77
|
+
action: 'open' | 'write' | 'close' | 'complete' | 'error';
|
|
78
|
+
/** Original filename as provided during upload */
|
|
79
|
+
filepath: string;
|
|
80
|
+
/** Number of bytes successfully transmitted to the server */
|
|
81
|
+
bytes_sent: number;
|
|
82
|
+
/** Total size of the uploaded file in bytes */
|
|
83
|
+
file_size: number;
|
|
84
|
+
/** Time taken for the upload operation in seconds */
|
|
85
|
+
upload_time: number;
|
|
86
|
+
/**
|
|
87
|
+
* Processing result from the pipeline after successful upload.
|
|
88
|
+
* Contains the same structure as PIPELINE_RESULT with processed content.
|
|
89
|
+
* Only present when action is 'complete' and processing succeeded.
|
|
90
|
+
*/
|
|
91
|
+
result?: PIPELINE_RESULT;
|
|
92
|
+
/** Error message if upload or processing failed (when action is 'error') */
|
|
93
|
+
error?: string;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/types/data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;GAKG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IAEb,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IAEb,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC;;;;;;;;;OASG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,uFAAuF;IACvF,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IAE1D,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IAEjB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IAEnB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAElB,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,246 @@
|
|
|
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 { TASK_STATUS } from './task';
|
|
25
|
+
/**
|
|
26
|
+
* Event type enumeration for sophisticated client subscription and event routing.
|
|
27
|
+
*
|
|
28
|
+
* This enumeration defines event categories used for intelligent event filtering
|
|
29
|
+
* and routing in multi-client environments. It enables clients to subscribe
|
|
30
|
+
* to specific types of events based on their needs and capabilities, reducing
|
|
31
|
+
* network traffic and improving system performance.
|
|
32
|
+
*
|
|
33
|
+
* Event Categories:
|
|
34
|
+
* ----------------
|
|
35
|
+
* NONE: Unsubscribe from all events (cleanup and disconnection)
|
|
36
|
+
* ALL: Subscribe to all events regardless of category (comprehensive monitoring)
|
|
37
|
+
* DEBUGGER: Debug-specific events for debugging protocol communication
|
|
38
|
+
* DETAIL: Real-time processing events requiring immediate client attention
|
|
39
|
+
* SUMMARY: Periodic status summaries suitable for dashboard monitoring
|
|
40
|
+
* OUTPUT: Standard output and logging messages
|
|
41
|
+
* FLOW: Pipeline flow events - component execution tracking
|
|
42
|
+
* TASK: Task lifecycle events - start, stop, state changes
|
|
43
|
+
*
|
|
44
|
+
* Subscription Strategies:
|
|
45
|
+
* -----------------------
|
|
46
|
+
* NONE: Used during client disconnection to stop all event delivery
|
|
47
|
+
* and perform cleanup of monitoring subscriptions.
|
|
48
|
+
*
|
|
49
|
+
* ALL: Comprehensive monitoring for administrative clients that need
|
|
50
|
+
* complete visibility into task execution and debugging activities.
|
|
51
|
+
*
|
|
52
|
+
* DEBUGGER: Debug protocol events including breakpoint hits, variable
|
|
53
|
+
* changes, stack traces, and debugging session management.
|
|
54
|
+
*
|
|
55
|
+
* DETAIL: Real-time processing events including object processing updates,
|
|
56
|
+
* error/warning messages, metrics updates, and immediate status
|
|
57
|
+
* changes requiring client response or display updates.
|
|
58
|
+
*
|
|
59
|
+
* SUMMARY: Periodic status summaries sent at CONST_STATUS_UPDATE_FREQ
|
|
60
|
+
* intervals containing complete task status, suitable for
|
|
61
|
+
* monitoring dashboards and periodic client updates.
|
|
62
|
+
*
|
|
63
|
+
* OUTPUT: Standard output and logging messages from task execution.
|
|
64
|
+
*
|
|
65
|
+
* FLOW: Pipeline flow events tracking component execution, data flow
|
|
66
|
+
* between pipeline stages, and processing pipeline status.
|
|
67
|
+
*
|
|
68
|
+
* TASK: Task lifecycle events including task start, stop, pause, resume,
|
|
69
|
+
* and state changes for task management interfaces.
|
|
70
|
+
*
|
|
71
|
+
* Network Optimization:
|
|
72
|
+
* --------------------
|
|
73
|
+
* Event filtering reduces network traffic by sending only relevant events
|
|
74
|
+
* to interested clients. SUMMARY subscriptions receive consolidated status
|
|
75
|
+
* updates rather than individual processing events, significantly reducing
|
|
76
|
+
* bandwidth usage for monitoring applications.
|
|
77
|
+
*
|
|
78
|
+
* Multi-Client Support:
|
|
79
|
+
* --------------------
|
|
80
|
+
* Different clients can subscribe to different event types simultaneously:
|
|
81
|
+
* - Debugging clients: DEBUGGER + DETAIL for comprehensive debugging
|
|
82
|
+
* - Monitoring dashboards: SUMMARY for efficient status tracking
|
|
83
|
+
* - Administrative tools: ALL for complete system visibility
|
|
84
|
+
* - Log viewers: OUTPUT for message monitoring
|
|
85
|
+
* - Pipeline managers: FLOW + TASK for execution tracking
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* // Subscribe to debugging and detail events
|
|
90
|
+
* const subscription = EVENT_TYPE.DEBUGGER | EVENT_TYPE.DETAIL;
|
|
91
|
+
*
|
|
92
|
+
* // Check if client wants specific events
|
|
93
|
+
* if (clientSubscription & EVENT_TYPE.SUMMARY) {
|
|
94
|
+
* sendSummaryUpdate(client, taskStatus);
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare enum EVENT_TYPE {
|
|
99
|
+
/** No events - unsubscribe from all event types */
|
|
100
|
+
NONE = 0,
|
|
101
|
+
/** Debug protocol events - DAP and debugging-specific events like breakpoints, stack traces */
|
|
102
|
+
DEBUGGER = 1,// Binary: 000001
|
|
103
|
+
/** Real-time processing events - immediate updates for live monitoring */
|
|
104
|
+
DETAIL = 2,// Binary: 000010
|
|
105
|
+
/** Periodic status summaries - dashboard monitoring with reduced frequency */
|
|
106
|
+
SUMMARY = 4,// Binary: 000100
|
|
107
|
+
/** Standard output and logging messages from task execution */
|
|
108
|
+
OUTPUT = 8,// Binary: 001000
|
|
109
|
+
/** Pipeline flow events - component execution tracking and data flow visualization */
|
|
110
|
+
FLOW = 16,// Binary: 010000
|
|
111
|
+
/** Task lifecycle events - start, stop, state changes, and task management */
|
|
112
|
+
TASK = 32,// Binary: 100000
|
|
113
|
+
/** Convenience combination - ALL events except NONE for comprehensive monitoring */
|
|
114
|
+
ALL = 63
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* DAP event for task status updates with comprehensive processing statistics.
|
|
118
|
+
*
|
|
119
|
+
* This event is sent whenever a task's status changes, providing real-time
|
|
120
|
+
* visibility into task execution progress, error conditions, and performance
|
|
121
|
+
* metrics. It contains the complete TASK_STATUS structure with all processing
|
|
122
|
+
* statistics, error tracking, and operational state information.
|
|
123
|
+
*
|
|
124
|
+
* Event Triggers:
|
|
125
|
+
* - Task state changes (NONE → STARTING → RUNNING → COMPLETED, etc.)
|
|
126
|
+
* - Processing progress updates (item counts, byte counts, rates)
|
|
127
|
+
* - Error and warning conditions
|
|
128
|
+
* - Service health status changes
|
|
129
|
+
* - Pipeline component execution flow changes
|
|
130
|
+
*
|
|
131
|
+
* Client Subscriptions:
|
|
132
|
+
* - DETAIL: Real-time updates for immediate display
|
|
133
|
+
* - SUMMARY: Periodic consolidated updates for dashboards
|
|
134
|
+
* - ALL: Comprehensive monitoring for administrative tools
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* function handleStatusUpdate(event: EVENT_STATUS_UPDATE): void {
|
|
139
|
+
* const status = event.body;
|
|
140
|
+
* console.log(`Task ${status.name} is ${status.state === 3 ? 'running' : 'idle'}`);
|
|
141
|
+
* console.log(`Progress: ${status.completedCount}/${status.totalCount} items`);
|
|
142
|
+
* }
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export interface EVENT_STATUS_UPDATE {
|
|
146
|
+
/** DAP message type - always "event" for events */
|
|
147
|
+
type: 'event';
|
|
148
|
+
/** Event type identifier for status update events */
|
|
149
|
+
event: 'apaevt_status_update';
|
|
150
|
+
/** Complete task status information with processing statistics and metrics */
|
|
151
|
+
body: TASK_STATUS;
|
|
152
|
+
/** Additional DAP fields may be present but should be ignored by status handlers */
|
|
153
|
+
[key: string]: any;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* DAP event for task lifecycle management with discriminated union for type safety.
|
|
157
|
+
*
|
|
158
|
+
* This event handles three distinct task lifecycle scenarios using TypeScript's
|
|
159
|
+
* discriminated unions to provide strict type safety and prevent invalid field
|
|
160
|
+
* combinations. Each action type has its own required fields and structure.
|
|
161
|
+
*
|
|
162
|
+
* Action Types:
|
|
163
|
+
* - 'running': Lists all currently running tasks for the client's API key
|
|
164
|
+
* - 'begin': Notifies that a new task has started execution
|
|
165
|
+
* - 'end': Notifies that a task has completed or terminated
|
|
166
|
+
*
|
|
167
|
+
* Event Flow:
|
|
168
|
+
* 1. Client subscribes to EVENT_TYPE.TASK
|
|
169
|
+
* 2. Server immediately sends 'running' action with current task list
|
|
170
|
+
* 3. As tasks start/stop, server sends 'begin'/'end' actions
|
|
171
|
+
*
|
|
172
|
+
* Network Optimization:
|
|
173
|
+
* - 'running' action sent only once per subscription to provide initial state
|
|
174
|
+
* - 'begin'/'end' actions sent as lightweight notifications
|
|
175
|
+
* - Only tasks belonging to client's API key are included
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```typescript
|
|
179
|
+
* function handleTaskEvent(event: EVENT_TASK): void {
|
|
180
|
+
* if (event.body.action === 'running') {
|
|
181
|
+
* // TypeScript ensures tasks array exists
|
|
182
|
+
* console.log(`Found ${event.body.tasks.length} running tasks`);
|
|
183
|
+
* event.body.tasks.forEach(task => {
|
|
184
|
+
* console.log(`Task ${task.id} in project ${task.projectId}`);
|
|
185
|
+
* });
|
|
186
|
+
* } else {
|
|
187
|
+
* // TypeScript ensures id and body fields exist
|
|
188
|
+
* console.log(`Task ${event.id} has ${event.body.action}`);
|
|
189
|
+
* console.log(`Project: ${event.body.projectId}, Source: ${event.body.source}`);
|
|
190
|
+
* }
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
export type EVENT_TASK = {
|
|
195
|
+
/** DAP message type - always "event" for events */
|
|
196
|
+
type: 'event';
|
|
197
|
+
/** Event type identifier for task lifecycle events */
|
|
198
|
+
event: 'apaevt_task';
|
|
199
|
+
/** Event body for 'running' action - provides current task inventory */
|
|
200
|
+
body: {
|
|
201
|
+
/** Action identifier - 'running' provides snapshot of active tasks */
|
|
202
|
+
action: 'running';
|
|
203
|
+
/**
|
|
204
|
+
* Array of currently running tasks belonging to client's API key.
|
|
205
|
+
* Sent when client first subscribes to TASK events to provide
|
|
206
|
+
* initial state without requiring separate query.
|
|
207
|
+
*/
|
|
208
|
+
tasks: Array<{
|
|
209
|
+
/** Unique task identifier for tracking and management */
|
|
210
|
+
id: string;
|
|
211
|
+
/** Project identifier for organization and permissions */
|
|
212
|
+
projectId: string;
|
|
213
|
+
/** Source component that serves as pipeline entry point */
|
|
214
|
+
source: string;
|
|
215
|
+
}>;
|
|
216
|
+
};
|
|
217
|
+
/** Additional DAP fields may be present but should be ignored */
|
|
218
|
+
[key: string]: any;
|
|
219
|
+
} | {
|
|
220
|
+
/** DAP message type - always "event" for events */
|
|
221
|
+
type: 'event';
|
|
222
|
+
/** Event type identifier for task lifecycle events */
|
|
223
|
+
event: 'apaevt_task';
|
|
224
|
+
/** Event body for 'begin'/'end' actions - task lifecycle notifications */
|
|
225
|
+
body: {
|
|
226
|
+
/**
|
|
227
|
+
* Action identifier for task lifecycle events:
|
|
228
|
+
* - 'begin': Task has started execution and is initializing
|
|
229
|
+
* - 'end': Task has completed execution or been terminated
|
|
230
|
+
*/
|
|
231
|
+
action: 'begin' | 'end';
|
|
232
|
+
/** Project identifier for organization and permissions tracking */
|
|
233
|
+
projectId: string;
|
|
234
|
+
/** Source component identifier that serves as pipeline entry point */
|
|
235
|
+
source: string;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Task identifier for lifecycle tracking.
|
|
239
|
+
* Required for begin/end actions to enable client-side task correlation
|
|
240
|
+
* and status tracking across multiple related events.
|
|
241
|
+
*/
|
|
242
|
+
id: string;
|
|
243
|
+
/** Additional DAP fields may be present but should be ignored */
|
|
244
|
+
[key: string]: any;
|
|
245
|
+
};
|
|
246
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,oBAAY,UAAU;IACrB,mDAAmD;IACnD,IAAI,IAAI;IAER,+FAA+F;IAC/F,QAAQ,IAAS,CAAE,iBAAiB;IAEpC,0EAA0E;IAC1E,MAAM,IAAS,CAAE,iBAAiB;IAElC,8EAA8E;IAC9E,OAAO,IAAS,CAAE,iBAAiB;IAEnC,+DAA+D;IAC/D,MAAM,IAAS,CAAE,iBAAiB;IAElC,sFAAsF;IACtF,IAAI,KAAS,CAAE,iBAAiB;IAEhC,8EAA8E;IAC9E,IAAI,KAAS,CAAE,iBAAiB;IAEhC,oFAAoF;IACpF,GAAG,KAAqD;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,mBAAmB;IACnC,mDAAmD;IACnD,IAAI,EAAE,OAAO,CAAC;IAEd,qDAAqD;IACrD,KAAK,EAAE,sBAAsB,CAAC;IAE9B,8EAA8E;IAC9E,IAAI,EAAE,WAAW,CAAC;IAElB,oFAAoF;IACpF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,MAAM,UAAU,GACnB;IACD,mDAAmD;IACnD,IAAI,EAAE,OAAO,CAAC;IAEd,sDAAsD;IACtD,KAAK,EAAE,aAAa,CAAC;IAErB,wEAAwE;IACxE,IAAI,EAAE;QACL,sEAAsE;QACtE,MAAM,EAAE,SAAS,CAAC;QAElB;;;;WAIG;QACH,KAAK,EAAE,KAAK,CAAC;YACZ,yDAAyD;YACzD,EAAE,EAAE,MAAM,CAAC;YAEX,0DAA0D;YAC1D,SAAS,EAAE,MAAM,CAAC;YAElB,2DAA2D;YAC3D,MAAM,EAAE,MAAM,CAAC;SACf,CAAC,CAAC;KACH,CAAC;IAEF,iEAAiE;IACjE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,GACC;IACD,mDAAmD;IACnD,IAAI,EAAE,OAAO,CAAC;IAEd,sDAAsD;IACtD,KAAK,EAAE,aAAa,CAAC;IAErB,0EAA0E;IAC1E,IAAI,EAAE;QACL;;;;WAIG;QACH,MAAM,EAAE,OAAO,GAAG,KAAK,CAAC;QAExB,mEAAmE;QACnE,SAAS,EAAE,MAAM,CAAC;QAElB,sEAAsE;QACtE,MAAM,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,iEAAiE;IACjE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
* Type definitions for the Aparavi TypeScript SDK.
|
|
26
|
+
*
|
|
27
|
+
* Re-exports all type definitions from individual modules for convenient imports.
|
|
28
|
+
*/
|
|
29
|
+
export * from './client';
|
|
30
|
+
export * from './data';
|
|
31
|
+
export * from './events';
|
|
32
|
+
export * from './pipeline';
|
|
33
|
+
export * from './task';
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;GAIG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
* Pipeline configuration for Aparavi data processing workflows.
|
|
26
|
+
*
|
|
27
|
+
* Defines a complete pipeline with components, data flow connections,
|
|
28
|
+
* and execution parameters. Pipelines process data through a series
|
|
29
|
+
* of connected components that transform, analyze, or route information.
|
|
30
|
+
*/
|
|
31
|
+
export interface PipelineConfig {
|
|
32
|
+
pipeline: {
|
|
33
|
+
/** Array of pipeline components that process data */
|
|
34
|
+
components: Array<{
|
|
35
|
+
/** Unique identifier for this component within the pipeline */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Component type/provider (e.g., 'webhook', 'response', 'ai_chat') */
|
|
38
|
+
provider: string;
|
|
39
|
+
/** Human-readable component name */
|
|
40
|
+
name?: string;
|
|
41
|
+
/** Component description for documentation */
|
|
42
|
+
description?: string;
|
|
43
|
+
/** Component-specific configuration parameters */
|
|
44
|
+
config: Record<string, any>;
|
|
45
|
+
/** UI-specific configuration for visual editors */
|
|
46
|
+
ui?: Record<string, any>;
|
|
47
|
+
/** Input connections from other components */
|
|
48
|
+
input?: Array<{
|
|
49
|
+
/** Data lane/channel name (e.g., 'text', 'data', 'image') */
|
|
50
|
+
lane: string;
|
|
51
|
+
/** Source component ID providing the data */
|
|
52
|
+
from: string;
|
|
53
|
+
}>;
|
|
54
|
+
}>;
|
|
55
|
+
/** ID of the component that serves as the pipeline entry point */
|
|
56
|
+
source?: string;
|
|
57
|
+
/** Project identifier for organization and permissions */
|
|
58
|
+
project_id: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../aparavi-client/src/types/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE;QACT,qDAAqD;QACrD,UAAU,EAAE,KAAK,CAAC;YACjB,+DAA+D;YAC/D,EAAE,EAAE,MAAM,CAAC;YAEX,uEAAuE;YACvE,QAAQ,EAAE,MAAM,CAAC;YAEjB,oCAAoC;YACpC,IAAI,CAAC,EAAE,MAAM,CAAC;YAEd,8CAA8C;YAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;YAErB,kDAAkD;YAClD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAE5B,mDAAmD;YACnD,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAEzB,8CAA8C;YAC9C,KAAK,CAAC,EAAE,KAAK,CAAC;gBACb,6DAA6D;gBAC7D,IAAI,EAAE,MAAM,CAAC;gBAEb,6CAA6C;gBAC7C,IAAI,EAAE,MAAM,CAAC;aACb,CAAC,CAAC;SACH,CAAC,CAAC;QAEH,kEAAkE;QAClE,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,0DAA0D;QAC1D,UAAU,EAAE,MAAM,CAAC;KACnB,CAAA;CACD"}
|