@kinotic-ai/core 5.0.0-beta.3 → 5.0.0-beta.30
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 +202 -0
- package/README.md +2 -2
- package/dist/index.cjs +909 -444
- package/dist/index.d.cts +185 -25
- package/dist/index.d.ts +185 -25
- package/dist/index.js +897 -434
- package/dist/node/index.cjs +9 -7
- package/package.json +18 -19
package/dist/index.d.cts
CHANGED
|
@@ -54,6 +54,11 @@ type WebSocketFactory = () => IWebSocket | Promise<IWebSocket>;
|
|
|
54
54
|
declare class ServerInfo {
|
|
55
55
|
host: string;
|
|
56
56
|
port?: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the server is reached over TLS. Absent, {@code KINOTIC_SERVER_USE_SSL} decides,
|
|
59
|
+
* then the page's own protocol for a host taken from the browser's location, and otherwise
|
|
60
|
+
* TLS for every host but a loopback one ({@code localhost}, {@code 127.0.0.1}, {@code ::1}).
|
|
61
|
+
*/
|
|
57
62
|
useSSL?: boolean | null;
|
|
58
63
|
}
|
|
59
64
|
/**
|
|
@@ -76,7 +81,7 @@ declare enum SessionKeepAliveMode {
|
|
|
76
81
|
* Options for {@link IKinotic#connect}. Every field is optional: absent {@link server}
|
|
77
82
|
* fields resolve from the environment (the {@code KINOTIC_SERVER_HOST} /
|
|
78
83
|
* {@code KINOTIC_SERVER_PORT} / {@code KINOTIC_SERVER_USE_SSL} variables, the browser's own
|
|
79
|
-
* location, then {@code https://api.kinotic.
|
|
84
|
+
* location, then {@code https://api.kinotic.ai}), and absent {@link credentials} resolve
|
|
80
85
|
* through the default {@link ChainedCredentialsResolver} (environment variables, then the
|
|
81
86
|
* browser session).
|
|
82
87
|
*
|
|
@@ -124,7 +129,7 @@ interface Identifiable<T> {
|
|
|
124
129
|
*
|
|
125
130
|
* This is the base shape every participant shares, regardless of scope, and is what RPC-only
|
|
126
131
|
* consumers work with directly. The Kinotic OS contract layers scope-typed participants on top
|
|
127
|
-
* of it — see the participant types in {@code @kinotic-ai/
|
|
132
|
+
* of it — see the participant types in {@code @kinotic-ai/management-api}.
|
|
128
133
|
*
|
|
129
134
|
* Mirrors the server {@code org.kinotic.core.api.security.Participant}.
|
|
130
135
|
*
|
|
@@ -146,7 +151,7 @@ interface IParticipant extends Identifiable<string> {
|
|
|
146
151
|
}
|
|
147
152
|
/**
|
|
148
153
|
* A logged-in participant on the RPC layer. Alias of {@link IParticipant}; the Kinotic OS contract
|
|
149
|
-
* ({@code @kinotic-ai/
|
|
154
|
+
* ({@code @kinotic-ai/management-api}) narrows this to scope-typed participants.
|
|
150
155
|
*
|
|
151
156
|
* Created by Navid Mitchell on 6/2/20
|
|
152
157
|
*/
|
|
@@ -159,7 +164,7 @@ declare class ConnectedInfo {
|
|
|
159
164
|
participant: Participant;
|
|
160
165
|
}
|
|
161
166
|
/**
|
|
162
|
-
* Part of the low level portion of
|
|
167
|
+
* Part of the low level portion of kinotic representing data to be processed
|
|
163
168
|
*
|
|
164
169
|
* This is similar to a Stomp Frame but with more required information and no control plane semantics.
|
|
165
170
|
*
|
|
@@ -215,17 +220,35 @@ interface IEvent {
|
|
|
215
220
|
setHeader(key: string, value: string): void;
|
|
216
221
|
}
|
|
217
222
|
/**
|
|
218
|
-
* Part of the low level portion of
|
|
223
|
+
* Part of the low level portion of kinotic representing a connection to a kinotic server
|
|
219
224
|
* This is similar to a Stomp Client but with more required information and no control plane semantics.
|
|
220
225
|
*
|
|
221
226
|
* Created by Navid Mitchell on 2019-01-04.
|
|
222
227
|
*/
|
|
223
228
|
interface IEventBus {
|
|
224
229
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
230
|
+
* Emits when the connection ends: an established connection drops before any reconnect, a failure
|
|
231
|
+
* closes it, or {@link disconnect} is called. It carries the failure that ended the connection, or
|
|
232
|
+
* null when nothing failed. The server releases everything it held for the connection at that moment:
|
|
233
|
+
* every request made on it is failed to its caller, and every invocation it was serving is failed to
|
|
234
|
+
* its requester. An end the client reconnects from leaves {@link IEventBus#isConnectionActive} true;
|
|
235
|
+
* one that needs a fresh {@link IEventBus#connect} leaves it false.
|
|
236
|
+
*/
|
|
237
|
+
connectionEnded: Observable<Error | null>;
|
|
238
|
+
/**
|
|
239
|
+
* Emits each time a connection is established: the first {@link connect}, and every reconnect the
|
|
240
|
+
* client makes after one ends. It carries the {@link ConnectedInfo} the server issued for that
|
|
241
|
+
* connection, which names the session the requests made on it belong to.
|
|
227
242
|
*/
|
|
228
|
-
|
|
243
|
+
connectionEstablished: Observable<ConnectedInfo>;
|
|
244
|
+
/**
|
|
245
|
+
* Emits each time an attempt to connect fails before the server accepts the connection and the client
|
|
246
|
+
* will try again: the server could not be reached, it closed the socket before answering, or it had not
|
|
247
|
+
* answered within 10 seconds of the socket being opened. This
|
|
248
|
+
* covers the attempts of a pending {@link connect} as well as the reconnects after a connection ends.
|
|
249
|
+
* An attempt that ends the connection for good is reported by {@link connectionEnded} instead.
|
|
250
|
+
*/
|
|
251
|
+
connectionAttemptFailed: Observable<void>;
|
|
229
252
|
/**
|
|
230
253
|
* The {@link ServerInfo} used when connecting, if connected or null
|
|
231
254
|
*/
|
|
@@ -249,14 +272,15 @@ interface IEventBus {
|
|
|
249
272
|
disconnect(force?: boolean): Promise<void>;
|
|
250
273
|
/**
|
|
251
274
|
* Determines if the connection is connected.
|
|
252
|
-
* This means that there is an open connection to the
|
|
275
|
+
* This means that there is an open connection to the Kinotic server
|
|
253
276
|
* @return true if the connection is active false if not
|
|
254
277
|
*/
|
|
255
278
|
isConnected(): boolean;
|
|
256
279
|
/**
|
|
257
280
|
* Determines if the connection is active.
|
|
258
281
|
* This means {@link IEventBus#connect()} was called and was successful. The underlying connection may not be established yet.
|
|
259
|
-
*
|
|
282
|
+
* Subscriptions made while active are established once the connection comes up; sends require
|
|
283
|
+
* {@link IEventBus#isConnected}
|
|
260
284
|
* @return true if the connection is active false if not
|
|
261
285
|
*/
|
|
262
286
|
isConnectionActive(): boolean;
|
|
@@ -288,8 +312,11 @@ interface IEventBus {
|
|
|
288
312
|
*/
|
|
289
313
|
requestStream(event: IEvent, sendControlEvents: boolean): Observable<IEvent>;
|
|
290
314
|
/**
|
|
291
|
-
* Send a single {@link IEvent} to the connected server
|
|
315
|
+
* Send a single {@link IEvent} to the connected server. Events are never held for a later
|
|
316
|
+
* connection, so the caller decides what an event it could not send means — see
|
|
317
|
+
* {@link isConnected}.
|
|
292
318
|
* @param event to send
|
|
319
|
+
* @throws if the connection is not established
|
|
293
320
|
*/
|
|
294
321
|
send(event: IEvent): void;
|
|
295
322
|
}
|
|
@@ -302,6 +329,12 @@ declare enum EventConstants {
|
|
|
302
329
|
CONTENT_LENGTH_HEADER = "content-length",
|
|
303
330
|
REPLY_TO_HEADER = "reply-to",
|
|
304
331
|
/**
|
|
332
|
+
* The participant that sent the event, as JSON. The gateway writes it on every event it delivers to a
|
|
333
|
+
* client, from the participant authenticated on the connection the event came from, and drops any a
|
|
334
|
+
* client supplies; an event that originated inside the platform with no participant bound carries none.
|
|
335
|
+
*/
|
|
336
|
+
SENDER_HEADER = "sender",
|
|
337
|
+
/**
|
|
305
338
|
* Header provided by the server on connection to provide the {@link ConnectedInfo} as a JSON string
|
|
306
339
|
*/
|
|
307
340
|
CONNECTED_INFO_HEADER = "connected-info",
|
|
@@ -363,16 +396,25 @@ declare enum EventConstants {
|
|
|
363
396
|
TRACESTATE_HEADER = "tracestate"
|
|
364
397
|
}
|
|
365
398
|
/**
|
|
366
|
-
*
|
|
399
|
+
* The request context a {@link Context} method receives as its final parameter: the calling participant,
|
|
400
|
+
* plus whatever the registered {@link ContextInterceptor} adds. Extend it for type-safe context data.
|
|
367
401
|
*
|
|
368
402
|
* @author Navid Mitchell 🤝Grok
|
|
369
403
|
* @since 3/25/2025
|
|
370
404
|
*/
|
|
371
405
|
interface ServiceContext {
|
|
406
|
+
/**
|
|
407
|
+
* The participant that invoked the service method, as authenticated by the gateway on the calling
|
|
408
|
+
* connection. Absent when the invocation originated inside the platform with no participant bound,
|
|
409
|
+
* such as a scheduled job.
|
|
410
|
+
*/
|
|
411
|
+
participant?: Participant;
|
|
372
412
|
[key: string]: any;
|
|
373
413
|
}
|
|
374
414
|
/**
|
|
375
415
|
* Interface for interceptors that create or modify the ServiceContext before service method invocation.
|
|
416
|
+
* The context handed in already carries the calling participant; the context returned is the one the
|
|
417
|
+
* method receives.
|
|
376
418
|
*
|
|
377
419
|
* @author Navid Mitchell 🤝Grok
|
|
378
420
|
* @since 3/25/2025
|
|
@@ -381,9 +423,9 @@ interface ContextInterceptor<T extends ServiceContext> {
|
|
|
381
423
|
intercept(event: IEvent, context: T): Promise<T> | T;
|
|
382
424
|
}
|
|
383
425
|
/**
|
|
384
|
-
* `CRI` is a
|
|
426
|
+
* `CRI` is a Kinotic Resource Identifier used by Kinotic to route requests appropriately.
|
|
385
427
|
*
|
|
386
|
-
* The `CRI` is a URI where the parts are named differently for clarity as to their purpose within
|
|
428
|
+
* The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinotic.
|
|
387
429
|
*
|
|
388
430
|
* Will be in a format as follows where anything surrounded with `[]` is optional:
|
|
389
431
|
*
|
|
@@ -421,7 +463,7 @@ interface CRI {
|
|
|
421
463
|
* The zone this `CRI` is addressed in, or `null` if un-zoned.
|
|
422
464
|
*
|
|
423
465
|
* The zone is the isolation boundary routing is validated against, such as
|
|
424
|
-
* `app.acme-org.orders-app` or `
|
|
466
|
+
* `app.acme-org.orders-app` or `management-api`.
|
|
425
467
|
*
|
|
426
468
|
* For the following CRI, `zone` would be the portion specified by `zone`:
|
|
427
469
|
*
|
|
@@ -540,6 +582,12 @@ declare class ServiceIdentifier {
|
|
|
540
582
|
* @return the cri for this {@link ServiceIdentifier}
|
|
541
583
|
*/
|
|
542
584
|
cri(): CRI;
|
|
585
|
+
/**
|
|
586
|
+
* The {@link CRI} of this service's shared, unscoped address. Every instance of a scoped
|
|
587
|
+
* service may listen here for the methods any instance can answer.
|
|
588
|
+
* @return the cri without the scope part
|
|
589
|
+
*/
|
|
590
|
+
unscopedCri(): CRI;
|
|
543
591
|
}
|
|
544
592
|
import { Observable as Observable2 } from "rxjs";
|
|
545
593
|
/**
|
|
@@ -612,6 +660,7 @@ interface IServiceRegistry {
|
|
|
612
660
|
*/
|
|
613
661
|
registerContextInterceptor<T extends ServiceContext>(interceptor: ContextInterceptor<T> | null): void;
|
|
614
662
|
}
|
|
663
|
+
import { ServiceDefinition } from "@kinotic-ai/idl";
|
|
615
664
|
/**
|
|
616
665
|
* An implementation of a {@link IEventFactory} which uses JSON content
|
|
617
666
|
*/
|
|
@@ -625,11 +674,20 @@ declare class TextEventFactory implements IEventFactory {
|
|
|
625
674
|
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
626
675
|
}
|
|
627
676
|
/**
|
|
677
|
+
* Declares the definitions of the project's published services, as `kinotic sync` generates them into the
|
|
678
|
+
* project's ServiceDefinitions module, so every registry registers each service in the platform's service
|
|
679
|
+
* directory with its definition when the service comes online. A definition declared again for a qualified
|
|
680
|
+
* name replaces the one held.
|
|
681
|
+
* @param definitions the generated definitions
|
|
682
|
+
*/
|
|
683
|
+
declare function declareServiceDefinitions(definitions: ServiceDefinition[]): void;
|
|
684
|
+
/**
|
|
628
685
|
* The default implementation of {@link IServiceRegistry}
|
|
629
686
|
*/
|
|
630
687
|
declare class ServiceRegistry implements IServiceRegistry {
|
|
631
688
|
private _eventBus;
|
|
632
689
|
private supervisors;
|
|
690
|
+
private entries;
|
|
633
691
|
private contextInterceptor;
|
|
634
692
|
private debugLogger;
|
|
635
693
|
constructor(eventBus: IEventBus);
|
|
@@ -638,6 +696,14 @@ declare class ServiceRegistry implements IServiceRegistry {
|
|
|
638
696
|
serviceProxy(serviceIdentifier: string): IServiceProxy;
|
|
639
697
|
register(serviceIdentifier: ServiceIdentifier, service: any): void;
|
|
640
698
|
unRegister(serviceIdentifier: ServiceIdentifier): void;
|
|
699
|
+
/**
|
|
700
|
+
* Registers every application service registered so far in the platform's service directory, with the
|
|
701
|
+
* definition the project declared for it, so the directory lists the service and the platform checks
|
|
702
|
+
* requests to it; a service the platform refuses fails the registration. A service registered later is
|
|
703
|
+
* registered in the directory as it registers here.
|
|
704
|
+
*/
|
|
705
|
+
registerEntries(): Promise<void>;
|
|
706
|
+
private registerEntry;
|
|
641
707
|
registerContextInterceptor<T extends ServiceContext>(interceptor: ContextInterceptor<T> | null): void;
|
|
642
708
|
}
|
|
643
709
|
/**
|
|
@@ -651,7 +717,7 @@ interface IKinotic {
|
|
|
651
717
|
eventBus: IEventBus;
|
|
652
718
|
/**
|
|
653
719
|
* The zone prefix every service published by this client registers under, such as
|
|
654
|
-
* `app.<organizationId>.<applicationId>` for an application or `system` for a
|
|
720
|
+
* `app.<organizationId>.<applicationId>` for an application or `system` for a system
|
|
655
721
|
* workload. Must be set from static configuration before service classes are instantiated.
|
|
656
722
|
* When null, services register at un-zoned legacy addresses.
|
|
657
723
|
*/
|
|
@@ -705,8 +771,9 @@ declare class KinoticSingleton implements IKinotic {
|
|
|
705
771
|
get eventBus(): IEventBus;
|
|
706
772
|
set eventBus(eventBus: IEventBus);
|
|
707
773
|
/**
|
|
708
|
-
* Connects to a Kinotic server
|
|
709
|
-
*
|
|
774
|
+
* Connects to a Kinotic server and registers the application services registered so far in the platform's
|
|
775
|
+
* service directory. Every option is optional: absent server fields and credentials resolve from the
|
|
776
|
+
* environment — see {@link ConnectOptions}.
|
|
710
777
|
* @param options overrides for the resolved connection, or nothing to resolve everything
|
|
711
778
|
* @return Promise containing the result of the initial connection attempt
|
|
712
779
|
*/
|
|
@@ -740,6 +807,19 @@ declare const Kinotic: KinoticSingleton;
|
|
|
740
807
|
*/
|
|
741
808
|
declare function Scope(value: Function, _context: ClassGetterDecoratorContext | ClassMethodDecoratorContext): void;
|
|
742
809
|
/**
|
|
810
|
+
* Marks a method of a scoped published service that any instance may answer, because its
|
|
811
|
+
* result does not depend on which instance executes it - typically a read of shared state
|
|
812
|
+
* rather than of the instance's own.
|
|
813
|
+
*
|
|
814
|
+
* A scoped service normally listens only at its scoped address, so every invocation must name
|
|
815
|
+
* an instance. When at least one method carries ScopeOptional, each instance also listens on
|
|
816
|
+
* the service's shared unscoped address, where only the annotated methods may be invoked: an
|
|
817
|
+
* unscoped invocation of any other method is rejected, since it would execute on whichever
|
|
818
|
+
* instance happened to receive it.
|
|
819
|
+
*/
|
|
820
|
+
declare function ScopeOptional(value: Function, _context: ClassMethodDecoratorContext): void;
|
|
821
|
+
declare function scopeOptionalMethodNames(instance: object): Set<string>;
|
|
822
|
+
/**
|
|
743
823
|
* Sets the semantic version a service registers under.
|
|
744
824
|
* @param version the version in X.Y.Z[-optional] format
|
|
745
825
|
*/
|
|
@@ -781,6 +861,34 @@ declare function receivesContext(serviceInstance: object, methodName: string): b
|
|
|
781
861
|
* so it appears in directory listings
|
|
782
862
|
*/
|
|
783
863
|
declare function Publish(namespace?: string | null, name?: string, advertise?: boolean): <T extends new (...args: any[]) => object>(value: T, _context: ClassDecoratorContext<any>) => T;
|
|
864
|
+
import { ServiceDefinition as ServiceDefinition2 } from "@kinotic-ai/idl";
|
|
865
|
+
/**
|
|
866
|
+
* A service of an application as its runtime registers it in the platform's service directory: the application
|
|
867
|
+
* it belongs to, where it is addressed, whether it is advertised, and its definition. The platform owns
|
|
868
|
+
* everything else about the directory's entry, such as the service's liveness.
|
|
869
|
+
*/
|
|
870
|
+
interface ServiceDirectoryEntry {
|
|
871
|
+
/**
|
|
872
|
+
* The application the service belongs to, which its zone names.
|
|
873
|
+
*/
|
|
874
|
+
applicationId: string;
|
|
875
|
+
/**
|
|
876
|
+
* The zone the service is addressed in, the application's or a label under it.
|
|
877
|
+
*/
|
|
878
|
+
zone: string;
|
|
879
|
+
/**
|
|
880
|
+
* The version the service registers under, or null for none.
|
|
881
|
+
*/
|
|
882
|
+
version: string | null;
|
|
883
|
+
/**
|
|
884
|
+
* True when the service advertised itself with `@Publish(advertise = true)` and appears in directory listings.
|
|
885
|
+
*/
|
|
886
|
+
advertised: boolean;
|
|
887
|
+
/**
|
|
888
|
+
* The service's definition: its functions, with the parameters a request carries and what each returns.
|
|
889
|
+
*/
|
|
890
|
+
serviceDefinition: ServiceDefinition2;
|
|
891
|
+
}
|
|
784
892
|
/**
|
|
785
893
|
* Validates that the given zone satisfies the zone grammar
|
|
786
894
|
* @param zone the zone to validate
|
|
@@ -1093,6 +1201,16 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
|
|
|
1093
1201
|
*/
|
|
1094
1202
|
deleteById(id: string): Promise<void>;
|
|
1095
1203
|
/**
|
|
1204
|
+
* Deletes the entity with the given id and waits for the deletion to be visible in search
|
|
1205
|
+
* results before returning.
|
|
1206
|
+
* Use this when you need read-your-write consistency immediately after deletion.
|
|
1207
|
+
*
|
|
1208
|
+
* @param id must not be {@literal null}.
|
|
1209
|
+
* @return a {@link Promise} signaling when the deletion is visible to search.
|
|
1210
|
+
* @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
|
|
1211
|
+
*/
|
|
1212
|
+
deleteByIdSync(id: string): Promise<void>;
|
|
1213
|
+
/**
|
|
1096
1214
|
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
|
|
1097
1215
|
*
|
|
1098
1216
|
* @param pageable the page settings to be used
|
|
@@ -1123,6 +1241,7 @@ declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudS
|
|
|
1123
1241
|
create(entity: T): Promise<T>;
|
|
1124
1242
|
createSync(entity: T): Promise<T>;
|
|
1125
1243
|
deleteById(id: string): Promise<void>;
|
|
1244
|
+
deleteByIdSync(id: string): Promise<void>;
|
|
1126
1245
|
findAll(pageable: Pageable): Promise<IterablePage<T>>;
|
|
1127
1246
|
findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
|
|
1128
1247
|
findById(id: string): Promise<T>;
|
|
@@ -1212,17 +1331,21 @@ declare class Event implements IEvent {
|
|
|
1212
1331
|
*/
|
|
1213
1332
|
declare class EventBus implements IEventBus {
|
|
1214
1333
|
serverInfo: ServerInfo | null;
|
|
1334
|
+
private readonly log;
|
|
1215
1335
|
private stompConnectionManager;
|
|
1216
1336
|
private connectionLifecycle;
|
|
1217
|
-
private
|
|
1337
|
+
private disconnectRequests;
|
|
1218
1338
|
private requestRepliesObservable;
|
|
1219
1339
|
private requestRepliesSubject;
|
|
1220
1340
|
private requestRepliesSubscription;
|
|
1221
1341
|
private readonly activeCorrelationIds;
|
|
1222
1342
|
private readonly recentlyReaped;
|
|
1343
|
+
private readonly connectionEndedSubject;
|
|
1223
1344
|
private static readonly REAP_DEBOUNCE_MS;
|
|
1224
1345
|
constructor();
|
|
1225
|
-
get
|
|
1346
|
+
get connectionEnded(): Observable3<Error | null>;
|
|
1347
|
+
get connectionEstablished(): Observable3<ConnectedInfo>;
|
|
1348
|
+
get connectionAttemptFailed(): Observable3<void>;
|
|
1226
1349
|
isConnectionActive(): boolean;
|
|
1227
1350
|
isConnected(): boolean;
|
|
1228
1351
|
connect(options: ConnectOptions): Promise<ConnectedInfo>;
|
|
@@ -1234,7 +1357,6 @@ declare class EventBus implements IEventBus {
|
|
|
1234
1357
|
requestStream(event: IEvent, sendControlEvents?: boolean): Observable3<IEvent>;
|
|
1235
1358
|
listen(_serverInfo: ServerInfo): Promise<void>;
|
|
1236
1359
|
observe(cri: string): Observable3<IEvent>;
|
|
1237
|
-
private cleanup;
|
|
1238
1360
|
/**
|
|
1239
1361
|
* Cancels a server stream whose reply arrived for a correlationId we no longer track. The server can't
|
|
1240
1362
|
* detect this itself since all requests share one reply destination, so the cancel is sent to the
|
|
@@ -1242,8 +1364,14 @@ declare class EventBus implements IEventBus {
|
|
|
1242
1364
|
*/
|
|
1243
1365
|
private cancelIfUnexpected;
|
|
1244
1366
|
/**
|
|
1367
|
+
* Sends the control event that stops the server stream identified by the correlationId.
|
|
1368
|
+
* @param cri the service the stream originates from
|
|
1369
|
+
* @param correlationId the correlationId of the stream to cancel
|
|
1370
|
+
*/
|
|
1371
|
+
private sendCancel;
|
|
1372
|
+
/**
|
|
1245
1373
|
* Tears down the shared request-replies stream so the next request rebuilds it against the
|
|
1246
|
-
*
|
|
1374
|
+
* connection's reply destination. Any in-flight requests are failed with the given reason since
|
|
1247
1375
|
* their replies can no longer be delivered.
|
|
1248
1376
|
*/
|
|
1249
1377
|
private resetRequestReplies;
|
|
@@ -1260,6 +1388,38 @@ declare class EventBus implements IEventBus {
|
|
|
1260
1388
|
private _observe;
|
|
1261
1389
|
}
|
|
1262
1390
|
/**
|
|
1391
|
+
* The error a service call fails with when the server answered it with an error reply. The reply body
|
|
1392
|
+
* describes the exception the server caught, so a caller can branch on which exception it was rather than
|
|
1393
|
+
* on a message written for people: a call that failed because the node serving it left the cluster carries
|
|
1394
|
+
* `RpcServiceUnavailableException`, one rejected because nothing served its address
|
|
1395
|
+
* `RpcMissingServiceException`.
|
|
1396
|
+
*/
|
|
1397
|
+
declare class RpcError extends Error {
|
|
1398
|
+
/**
|
|
1399
|
+
* The simple name of the exception the server caught, such as `RpcServiceUnavailableException`.
|
|
1400
|
+
*/
|
|
1401
|
+
readonly exceptionName: string;
|
|
1402
|
+
/**
|
|
1403
|
+
* The fully qualified class name of the exception the server caught.
|
|
1404
|
+
*/
|
|
1405
|
+
readonly exceptionClass: string;
|
|
1406
|
+
constructor(message: string, exceptionName: string, exceptionClass: string);
|
|
1407
|
+
/**
|
|
1408
|
+
* Builds the error an error reply carries. The body is the server's description of the exception when
|
|
1409
|
+
* it is JSON; otherwise the error header alone names the failure.
|
|
1410
|
+
* @param reply the error reply, which carries the error header
|
|
1411
|
+
*/
|
|
1412
|
+
static fromEvent(reply: IEvent): RpcError;
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Thrown when the calling participant is not permitted to do what it asked. A service that throws it
|
|
1416
|
+
* fails the invocation with an error reply named {@code AuthorizationException}, the name a Java
|
|
1417
|
+
* service's refusal carries, so a caller reads both the same way.
|
|
1418
|
+
*/
|
|
1419
|
+
declare class AuthorizationException extends Error {
|
|
1420
|
+
constructor(message?: string);
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1263
1423
|
* Kinotic client credentials: a clientId/clientSecret pair presented as upgrade headers —
|
|
1264
1424
|
* a user's email and password, or a machine identity's id and provisioned secret. Scope is
|
|
1265
1425
|
* structural, determined by which ids are given: neither → SYSTEM, organizationId only →
|
|
@@ -1322,9 +1482,9 @@ declare class ParticipantConstants {
|
|
|
1322
1482
|
static readonly PARTICIPANT_TYPE_USER: string;
|
|
1323
1483
|
/** A client (CLI, MCP host) acting on behalf of a user that authorized it. */
|
|
1324
1484
|
static readonly PARTICIPANT_TYPE_DELEGATE: string;
|
|
1325
|
-
/** A non-human caller with its own credential — a
|
|
1485
|
+
/** A non-human caller with its own credential — a system daemon or an external API client. */
|
|
1326
1486
|
static readonly PARTICIPANT_TYPE_MACHINE: string;
|
|
1327
|
-
/** The clientId
|
|
1487
|
+
/** The clientId the test server's TestSecurityService maps to the ANONYMOUS role in core package tests. */
|
|
1328
1488
|
static readonly CLI_PARTICIPANT_ID: string;
|
|
1329
1489
|
}
|
|
1330
|
-
export {
|
|
1490
|
+
export { AbstractIterablePage, AuthorizationException, BasicCredentialsResolver, BearerCredentialsResolver, CRI, ChainedCredentialsResolver, ConnectOptions, ConnectedInfo, Context, ContextInterceptor, CredentialsResolver, CrudServiceProxy, CrudServiceProxyFactory, CursorPageable, DataSourceUtils, DefaultCRI, Direction, EnvCredentialsResolver, Event, EventBus, EventConstants, FunctionalIterablePage, ICrudServiceProxy, ICrudServiceProxyFactory, IDataSource, IEditableDataSource, IEvent, IEventBus, IEventFactory, IKinotic, IParticipant, IServiceProxy, IServiceRegistry, IWebSocket, Identifiable, IterablePage, JsonEventFactory, Kinotic, KinoticPlugin, KinoticSingleton, NullHandling, OffsetPageable, Order, Page, Pageable, Participant, ParticipantConstants, Publish, ResolvedCredentials, RpcError, Scope, ScopeOptional, ServerInfo, ServiceContext, ServiceDirectoryEntry, ServiceIdentifier, ServiceRegistry, SessionCredentialsResolver, SessionKeepAliveMode, Sort, TextEventFactory, Version, WebSocketFactory, Zone, buildBrokerUrl, buildServerUrl, createCRI, declareServiceDefinitions, isAdvertised, receivesContext, scopeOptionalMethodNames, validateLabel, validateZone };
|