@@ -73,6 +73,10 @@ import {
73
73
FireFlyVerifierResolveResponse ,
74
74
FireFlyTokenApprovalRequest ,
75
75
FireFlyNamespaceResponse ,
76
+ FireFlyUpdateIdentityRequest ,
77
+ FireFlyReplaceOptions ,
78
+ FireFlyUpdateOptions ,
79
+ FireFlyDeleteOptions ,
76
80
} from './interfaces' ;
77
81
import { FireFlyWebSocket , FireFlyWebSocketCallback } from './websocket' ;
78
82
import HttpBase , { mapConfig } from './http' ;
@@ -93,10 +97,10 @@ export default class FireFly extends HttpBase {
93
97
}
94
98
95
99
getIdentity (
96
- nameOrId : string ,
100
+ id : string ,
97
101
options ?: FireFlyGetOptions ,
98
102
) : Promise < FireFlyIdentityResponse | undefined > {
99
- return this . getOne < FireFlyIdentityResponse > ( `/identities/${ nameOrId } ` , options ) ;
103
+ return this . getOne < FireFlyIdentityResponse > ( `/identities/${ id } ` , options ) ;
100
104
}
101
105
102
106
createIdentity (
@@ -106,20 +110,42 @@ export default class FireFly extends HttpBase {
106
110
return this . createOne < FireFlyIdentityResponse > ( `/identities` , identity , options ) ;
107
111
}
108
112
113
+ updateIdentity (
114
+ id : string ,
115
+ update : FireFlyUpdateIdentityRequest ,
116
+ options ?: FireFlyUpdateOptions ,
117
+ ) : Promise < FireFlyIdentityResponse > {
118
+ return this . updateOne < FireFlyIdentityResponse > ( `/identities/${ id } ` , update , options ) ;
119
+ }
120
+
109
121
getOrganizations (
110
122
filter ?: FireFlyOrganizationFilter ,
111
123
options ?: FireFlyGetOptions ,
112
124
) : Promise < FireFlyOrganizationResponse [ ] > {
113
125
return this . getMany < FireFlyOrganizationResponse [ ] > ( '/network/organizations' , filter , options ) ;
114
126
}
115
127
128
+ getOrganization (
129
+ nameOrId : string ,
130
+ options ?: FireFlyGetOptions ,
131
+ ) : Promise < FireFlyIdentityResponse | undefined > {
132
+ return this . getOne < FireFlyIdentityResponse > ( `/network/organizations/${ nameOrId } ` , options ) ;
133
+ }
134
+
116
135
getNodes (
117
136
filter ?: FireFlyNodeFilter ,
118
137
options ?: FireFlyGetOptions ,
119
138
) : Promise < FireFlyNodeResponse [ ] > {
120
139
return this . getMany < FireFlyNodeResponse [ ] > ( '/network/nodes' , filter , options ) ;
121
140
}
122
141
142
+ getNode (
143
+ nameOrId : string ,
144
+ options ?: FireFlyGetOptions ,
145
+ ) : Promise < FireFlyIdentityResponse | undefined > {
146
+ return this . getOne < FireFlyIdentityResponse > ( `/network/nodes/${ nameOrId } ` , options ) ;
147
+ }
148
+
123
149
getVerifiers (
124
150
namespace ?: string ,
125
151
filter ?: FireFlyVerifierFilter ,
@@ -175,12 +201,15 @@ export default class FireFly extends HttpBase {
175
201
return this . getMany < FireFlySubscriptionResponse [ ] > ( '/subscriptions' , filter , options ) ;
176
202
}
177
203
178
- replaceSubscription ( sub : FireFlySubscriptionRequest ) : Promise < FireFlySubscriptionResponse > {
179
- return this . replaceOne < FireFlySubscriptionResponse > ( '/subscriptions' , sub ) ;
204
+ replaceSubscription (
205
+ sub : FireFlySubscriptionRequest ,
206
+ options ?: FireFlyReplaceOptions ,
207
+ ) : Promise < FireFlySubscriptionResponse > {
208
+ return this . replaceOne < FireFlySubscriptionResponse > ( '/subscriptions' , sub , options ) ;
180
209
}
181
210
182
- async deleteSubscription ( subId : string ) {
183
- await this . deleteOne ( `/subscriptions/${ subId } ` ) ;
211
+ async deleteSubscription ( subId : string , options ?: FireFlyDeleteOptions ) {
212
+ await this . deleteOne ( `/subscriptions/${ subId } ` , options ) ;
184
213
}
185
214
186
215
getData ( id : string , options ?: FireFlyGetOptions ) : Promise < FireFlyDataResponse | undefined > {
@@ -248,6 +277,10 @@ export default class FireFly extends HttpBase {
248
277
return this . createOne < FireFlyDataResponse > ( `/data/${ id } /blob/publish` , { } , options ) ;
249
278
}
250
279
280
+ async deleteData ( id : string , options ?: FireFlyDeleteOptions ) {
281
+ await this . deleteOne ( `/data/${ id } ` , options ) ;
282
+ }
283
+
251
284
getBatches (
252
285
filter ?: FireFlyBatchFilter ,
253
286
options ?: FireFlyGetOptions ,
0 commit comments