1
1
public protocol API {
2
-
3
2
/// Closes the current authentication session.
4
3
///
5
4
/// https://project-haystack.org/doc/docHaystack/Ops#close
6
- func close( ) async throws -> Void
7
-
5
+ func close( ) async throws
6
+
8
7
/// Queries basic information about the server
9
8
///
10
9
/// https://project-haystack.org/doc/docHaystack/Ops#about
11
10
func about( ) async throws -> Grid
12
-
11
+
13
12
/// Queries def dicts from the current namespace
14
13
///
15
14
/// https://project-haystack.org/doc/docHaystack/Ops#defs
@@ -19,7 +18,7 @@ public protocol API {
19
18
/// - limit: The maximum number of defs to return in response
20
19
/// - Returns: A grid with the dict representation of each def
21
20
func defs( filter: String ? , limit: Number ? ) async throws -> Grid
22
-
21
+
23
22
/// Queries lib defs from current namspace
24
23
///
25
24
/// https://project-haystack.org/doc/docHaystack/Ops#libs
@@ -29,7 +28,7 @@ public protocol API {
29
28
/// - limit: The maximum number of defs to return in response
30
29
/// - Returns: A grid with the dict representation of each def
31
30
func libs( filter: String ? , limit: Number ? ) async throws -> Grid
32
-
31
+
33
32
/// Queries op defs from current namspace
34
33
///
35
34
/// https://project-haystack.org/doc/docHaystack/Ops#ops
@@ -39,7 +38,7 @@ public protocol API {
39
38
/// - limit: The maximum number of defs to return in response
40
39
/// - Returns: A grid with the dict representation of each def
41
40
func ops( filter: String ? , limit: Number ? ) async throws -> Grid
42
-
41
+
43
42
/// Queries filetype defs from current namspace
44
43
///
45
44
/// https://project-haystack.org/doc/docHaystack/Ops#filetypes
@@ -49,15 +48,15 @@ public protocol API {
49
48
/// - limit: The maximum number of defs to return in response
50
49
/// - Returns: A grid with the dict representation of each def
51
50
func filetypes( filter: String ? , limit: Number ? ) async throws -> Grid
52
-
51
+
53
52
/// Read a set of entity records by their unique identifier
54
53
///
55
54
/// https://project-haystack.org/doc/docHaystack/Ops#read
56
55
///
57
56
/// - Parameter ids: Ref identifiers
58
57
/// - Returns: A grid with a row for each entity read
59
58
func read( ids: [ Ref ] ) async throws -> Grid
60
-
59
+
61
60
/// Read a set of entity records using a filter
62
61
///
63
62
/// https://project-haystack.org/doc/docHaystack/Ops#read
@@ -67,15 +66,15 @@ public protocol API {
67
66
/// - limit: The maximum number of entities to return in response
68
67
/// - Returns: A grid with a row for each entity read
69
68
func read( filter: String , limit: Number ? ) async throws -> Grid
70
-
69
+
71
70
/// Navigate a project for learning and discovery
72
71
///
73
72
/// https://project-haystack.org/doc/docHaystack/Ops#nav
74
73
///
75
74
/// - Parameter navId: The ID of the entity to navigate from. If null, the navigation root is used.
76
75
/// - Returns: A grid of navigation children for the navId specified by the request
77
76
func nav( navId: Ref ? ) async throws -> Grid
78
-
77
+
79
78
/// Reads time-series data from historized point
80
79
///
81
80
/// https://project-haystack.org/doc/docHaystack/Ops#hisRead
@@ -85,7 +84,7 @@ public protocol API {
85
84
/// - range: A date-time range
86
85
/// - Returns: A grid whose rows represent timetamp/value pairs with a DateTime ts column and a val column for each scalar value
87
86
func hisRead( id: Ref , range: HisReadRange ) async throws -> Grid
88
-
87
+
89
88
/// Posts new time-series data to a historized point
90
89
///
91
90
/// https://project-haystack.org/doc/docHaystack/Ops#hisWrite
@@ -95,7 +94,7 @@ public protocol API {
95
94
/// - items: New timestamp/value samples to write
96
95
/// - Returns: An empty grid
97
96
func hisWrite( id: Ref , items: [ HisItem ] ) async throws -> Grid
98
-
97
+
99
98
/// Write to a given level of a writable point's priority array
100
99
///
101
100
/// https://project-haystack.org/doc/docHaystack/Ops#pointWrite
@@ -108,15 +107,15 @@ public protocol API {
108
107
/// - duration: Number with duration unit if setting level 8
109
108
/// - Returns: An empty grid
110
109
func pointWrite( id: Ref , level: Number , val: any Val , who: String ? , duration: Number ? ) async throws -> Grid
111
-
110
+
112
111
/// Read the current status of a writable point's priority array
113
112
///
114
113
/// https://project-haystack.org/doc/docHaystack/Ops#pointWrite
115
114
///
116
115
/// - Parameter id: Identifier of writable point
117
116
/// - Returns: A grid with current priority array state
118
117
func pointWriteStatus( id: Ref ) async throws -> Grid
119
-
118
+
120
119
/// Used to create new watches.
121
120
///
122
121
/// https://project-haystack.org/doc/docHaystack/Ops#watchSub
@@ -128,7 +127,7 @@ public protocol API {
128
127
/// - Returns: A grid where rows correspond to the current entity state of the requested identifiers. Grid metadata contains
129
128
/// `watchId` and `lease`.
130
129
func watchSubCreate( watchDis: String , lease: Number ? , ids: [ Ref ] ) async throws -> Grid
131
-
130
+
132
131
/// Used to add entities to an existing watch.
133
132
///
134
133
/// https://project-haystack.org/doc/docHaystack/Ops#watchSub
@@ -140,7 +139,7 @@ public protocol API {
140
139
/// - Returns: A grid where rows correspond to the current entity state of the requested identifiers. Grid metadata contains
141
140
/// `watchId` and `lease`.
142
141
func watchSubAdd( watchId: String , lease: Number ? , ids: [ Ref ] ) async throws -> Grid
143
-
142
+
144
143
/// Used remove entities from a watch
145
144
///
146
145
/// https://project-haystack.org/doc/docHaystack/Ops#watchUnsub
@@ -150,7 +149,7 @@ public protocol API {
150
149
/// - ids: Ref values for each entity to unsubscribe. If empty the entire watch is closed.
151
150
/// - Returns: An empty grid
152
151
func watchUnsubRemove( watchId: String , ids: [ Ref ] ) async throws -> Grid
153
-
152
+
154
153
/// Used to close a watch entirely
155
154
///
156
155
/// https://project-haystack.org/doc/docHaystack/Ops#watchUnsub
@@ -159,7 +158,7 @@ public protocol API {
159
158
/// - watchId: Watch identifier
160
159
/// - Returns: An empty grid
161
160
func watchUnsubDelete( watchId: String ) async throws -> Grid
162
-
161
+
163
162
/// Used to poll a watch for changes to the subscribed entity records
164
163
///
165
164
/// https://project-haystack.org/doc/docHaystack/Ops#watchPoll
@@ -169,15 +168,15 @@ public protocol API {
169
168
/// - refresh: Whether a full refresh should occur
170
169
/// - Returns: A grid where each row correspondes to a watched entity
171
170
func watchPoll( watchId: String , refresh: Bool ) async throws -> Grid
172
-
171
+
173
172
/// https://project-haystack.org/doc/docHaystack/Ops#invokeAction
174
173
/// - Parameters:
175
174
/// - id: Identifier of target rec
176
175
/// - action: The name of the action func
177
176
/// - args: The arguments to the action
178
177
/// - Returns: A grid of undefined shape
179
178
func invokeAction( id: Ref , action: String , args: [ String : any Val ] ) async throws -> Grid
180
-
179
+
181
180
/// Evaluate an Axon expression
182
181
///
183
182
/// https://haxall.io/doc/lib-hx/op~eval
0 commit comments