@kinotic-ai/core 1.0.8 → 1.1.0
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/dist/index.cjs +1 -1
- package/dist/index.d.cts +46 -49
- package/dist/index.d.ts +46 -49
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -33,26 +33,15 @@ declare class ConnectionInfo extends ServerInfo {
|
|
|
33
33
|
*/
|
|
34
34
|
disableStickySession?: boolean | null;
|
|
35
35
|
}
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
* Interface for the service context, extendable by users for type-safe context data.
|
|
39
|
-
*
|
|
40
|
-
* @author Navid Mitchell 🤝Grok
|
|
41
|
-
* @since 3/25/2025
|
|
42
|
-
*/
|
|
43
|
-
interface ServiceContext {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
}
|
|
36
|
+
import { Optional } from "typescript-optional";
|
|
37
|
+
import { Observable } from "rxjs";
|
|
46
38
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @author Navid Mitchell 🤝Grok
|
|
50
|
-
* @since 3/25/2025
|
|
39
|
+
* Instances of this interface have a unique id (identity) and are therefore "Identifiable"
|
|
40
|
+
* Created by navid on 2/3/20
|
|
51
41
|
*/
|
|
52
|
-
interface
|
|
53
|
-
|
|
42
|
+
interface Identifiable<T> {
|
|
43
|
+
id: T | null;
|
|
54
44
|
}
|
|
55
|
-
import { Identifiable } from "@/api/Identifiable";
|
|
56
45
|
/**
|
|
57
46
|
* Created by Navíd Mitchell 🤪on 6/16/23.
|
|
58
47
|
*/
|
|
@@ -100,8 +89,6 @@ declare class ConnectedInfo {
|
|
|
100
89
|
replyToId: string;
|
|
101
90
|
participant: Participant;
|
|
102
91
|
}
|
|
103
|
-
import { Optional } from "typescript-optional";
|
|
104
|
-
import { Observable } from "rxjs";
|
|
105
92
|
/**
|
|
106
93
|
* Base error class for all Kinoitc errors
|
|
107
94
|
*/
|
|
@@ -116,7 +103,7 @@ declare class KinoticError extends Error {
|
|
|
116
103
|
*
|
|
117
104
|
* Created by Navid Mitchell on 2019-01-04.
|
|
118
105
|
*/
|
|
119
|
-
interface
|
|
106
|
+
interface IEvent {
|
|
120
107
|
/**
|
|
121
108
|
* The cri that specifies where the event should be routed
|
|
122
109
|
*/
|
|
@@ -219,14 +206,14 @@ interface IEventBus {
|
|
|
219
206
|
* Creates a subscription for all {@link IEvent}'s for the given destination
|
|
220
207
|
* @param cri to subscribe to
|
|
221
208
|
*/
|
|
222
|
-
observe(cri: string): Observable<
|
|
209
|
+
observe(cri: string): Observable<IEvent>;
|
|
223
210
|
/**
|
|
224
211
|
* Sends an {@link IEvent} expecting a response
|
|
225
212
|
* All response correlation will be handled internally
|
|
226
213
|
* @param event to send as the request
|
|
227
214
|
* @return a Promise that will resolve when the response is received
|
|
228
215
|
*/
|
|
229
|
-
request(event:
|
|
216
|
+
request(event: IEvent): Promise<IEvent>;
|
|
230
217
|
/**
|
|
231
218
|
* Sends an {@link IEvent} expecting multiple responses
|
|
232
219
|
* All response correlation will be handled internally
|
|
@@ -235,12 +222,12 @@ interface IEventBus {
|
|
|
235
222
|
* @return an {@link Observable<IEvent} that will provide the response stream
|
|
236
223
|
* NOTE: the naming here is similar to RSocket https://www.baeldung.com/rsocket#3-requeststream
|
|
237
224
|
*/
|
|
238
|
-
requestStream(event:
|
|
225
|
+
requestStream(event: IEvent, sendControlEvents: boolean): Observable<IEvent>;
|
|
239
226
|
/**
|
|
240
227
|
* Send a single {@link IEvent} to the connected server
|
|
241
228
|
* @param event to send
|
|
242
229
|
*/
|
|
243
|
-
send(event:
|
|
230
|
+
send(event: IEvent): void;
|
|
244
231
|
}
|
|
245
232
|
/**
|
|
246
233
|
* Constants used within {@link IEvent}'s to control the flow of events
|
|
@@ -314,6 +301,24 @@ declare enum EventConstants {
|
|
|
314
301
|
TRACESTATE_HEADER = "tracestate"
|
|
315
302
|
}
|
|
316
303
|
/**
|
|
304
|
+
* Interface for the service context, extendable by users for type-safe context data.
|
|
305
|
+
*
|
|
306
|
+
* @author Navid Mitchell 🤝Grok
|
|
307
|
+
* @since 3/25/2025
|
|
308
|
+
*/
|
|
309
|
+
interface ServiceContext {
|
|
310
|
+
[key: string]: any;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Interface for interceptors that create or modify the ServiceContext before service method invocation.
|
|
314
|
+
*
|
|
315
|
+
* @author Navid Mitchell 🤝Grok
|
|
316
|
+
* @since 3/25/2025
|
|
317
|
+
*/
|
|
318
|
+
interface ContextInterceptor<T extends ServiceContext> {
|
|
319
|
+
intercept(event: IEvent, context: T): Promise<T> | T;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
317
322
|
* `CRI` is a Kinoitc Resource Identifier used by Kinoitc to route requests appropriately.
|
|
318
323
|
*
|
|
319
324
|
* The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinoitc.
|
|
@@ -455,12 +460,11 @@ declare class ServiceIdentifier {
|
|
|
455
460
|
cri(): CRI;
|
|
456
461
|
}
|
|
457
462
|
import { Observable as Observable2 } from "rxjs";
|
|
458
|
-
import { IEvent as IEvent3 } from "./IEventBus";
|
|
459
463
|
/**
|
|
460
464
|
* Provides an interface to allow the {@link IServiceProxy} creator the ability to have fine grain control of the outgoing {@link IEvent}
|
|
461
465
|
*/
|
|
462
466
|
interface IEventFactory {
|
|
463
|
-
create(cri: string, args: any[] | null | undefined):
|
|
467
|
+
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
464
468
|
}
|
|
465
469
|
/**
|
|
466
470
|
* {@link IServiceProxy} provides the ability to access a remote service
|
|
@@ -530,13 +534,13 @@ interface IServiceRegistry {
|
|
|
530
534
|
* An implementation of a {@link IEventFactory} which uses JSON content
|
|
531
535
|
*/
|
|
532
536
|
declare class JsonEventFactory implements IEventFactory {
|
|
533
|
-
create(cri: string, args: any[] | null | undefined):
|
|
537
|
+
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
534
538
|
}
|
|
535
539
|
/**
|
|
536
540
|
* An implementation of a {@link IEventFactory} which uses text content
|
|
537
541
|
*/
|
|
538
542
|
declare class TextEventFactory implements IEventFactory {
|
|
539
|
-
create(cri: string, args: any[] | null | undefined):
|
|
543
|
+
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
540
544
|
}
|
|
541
545
|
/**
|
|
542
546
|
* The default implementation of {@link IServiceRegistry}
|
|
@@ -864,7 +868,7 @@ interface IDataSource<T> {
|
|
|
864
868
|
*/
|
|
865
869
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
866
870
|
}
|
|
867
|
-
interface IEditableDataSource<T extends
|
|
871
|
+
interface IEditableDataSource<T extends Identifiable<string>> extends IDataSource<T> {
|
|
868
872
|
/**
|
|
869
873
|
* Creates a new entity if one does not already exist for the given id
|
|
870
874
|
* @param entity to create if one does not already exist
|
|
@@ -903,7 +907,7 @@ interface IEditableDataSource<T extends Identifiable2<string>> extends IDataSour
|
|
|
903
907
|
* @param pageable the page settings to be used
|
|
904
908
|
* @return a {@link Promise} emitting the page of entities
|
|
905
909
|
*/
|
|
906
|
-
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<
|
|
910
|
+
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<Identifiable<string>>>;
|
|
907
911
|
}
|
|
908
912
|
declare class DataSourceUtils {
|
|
909
913
|
static instanceOfEditableDataSource(datasource: IDataSource<any> | IEditableDataSource<any>): datasource is IEditableDataSource<any>;
|
|
@@ -911,7 +915,7 @@ declare class DataSourceUtils {
|
|
|
911
915
|
/**
|
|
912
916
|
* A {@link ICrudServiceProxy} is a proxy for a remote CRUD service
|
|
913
917
|
*/
|
|
914
|
-
interface ICrudServiceProxy<T extends
|
|
918
|
+
interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDataSource<T> {
|
|
915
919
|
/**
|
|
916
920
|
* Creates a new entity if one does not already exist for the given id
|
|
917
921
|
* @param entity to create if one does not already exist
|
|
@@ -963,7 +967,7 @@ interface ICrudServiceProxy<T extends Identifiable2<string>> extends IEditableDa
|
|
|
963
967
|
* @param pageable the page settings to be used
|
|
964
968
|
* @return a {@link Promise} emitting the page of entities
|
|
965
969
|
*/
|
|
966
|
-
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<
|
|
970
|
+
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<Identifiable<string>>>;
|
|
967
971
|
/**
|
|
968
972
|
* Returns a {@link Page} of entities matching the search text and paging restriction provided in the {@code Pageable} object.
|
|
969
973
|
*
|
|
@@ -973,7 +977,7 @@ interface ICrudServiceProxy<T extends Identifiable2<string>> extends IEditableDa
|
|
|
973
977
|
*/
|
|
974
978
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
975
979
|
}
|
|
976
|
-
declare class CrudServiceProxy<T extends
|
|
980
|
+
declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudServiceProxy<T> {
|
|
977
981
|
protected serviceProxy: IServiceProxy;
|
|
978
982
|
constructor(serviceProxy: IServiceProxy);
|
|
979
983
|
count(): Promise<number>;
|
|
@@ -983,18 +987,11 @@ declare class CrudServiceProxy<T extends Identifiable2<string>> implements ICrud
|
|
|
983
987
|
findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
|
|
984
988
|
findById(id: string): Promise<T>;
|
|
985
989
|
save(entity: T): Promise<T>;
|
|
986
|
-
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<
|
|
990
|
+
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<Identifiable<string>>>;
|
|
987
991
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
988
992
|
searchSinglePage(searchText: string, pageable: Pageable): Promise<Page<T>>;
|
|
989
993
|
}
|
|
990
994
|
/**
|
|
991
|
-
* Instances of this interface have a unique id (identity) and are therefore "Identifiable"
|
|
992
|
-
* Created by navid on 2/3/20
|
|
993
|
-
*/
|
|
994
|
-
interface Identifiable2<T> {
|
|
995
|
-
id: T | null;
|
|
996
|
-
}
|
|
997
|
-
/**
|
|
998
995
|
* Produces {@link ICrudServiceProxy} Proxies for a known remote CRUD service
|
|
999
996
|
*/
|
|
1000
997
|
interface ICrudServiceProxyFactory {
|
|
@@ -1002,7 +999,7 @@ interface ICrudServiceProxyFactory {
|
|
|
1002
999
|
* Produces a {@link ICrudServiceProxy} for the given serviceIdentifier
|
|
1003
1000
|
* @param serviceIdentifier the service identifier to produce a proxy for
|
|
1004
1001
|
*/
|
|
1005
|
-
crudServiceProxy<T extends
|
|
1002
|
+
crudServiceProxy<T extends Identifiable<string>>(serviceIdentifier: string): ICrudServiceProxy<T>;
|
|
1006
1003
|
}
|
|
1007
1004
|
/**
|
|
1008
1005
|
* Default implementation of {@link ICrudServiceProxyFactory}
|
|
@@ -1010,7 +1007,7 @@ interface ICrudServiceProxyFactory {
|
|
|
1010
1007
|
declare class CrudServiceProxyFactory implements ICrudServiceProxyFactory {
|
|
1011
1008
|
private serviceRegistry;
|
|
1012
1009
|
constructor(serviceRegistry: IServiceRegistry);
|
|
1013
|
-
crudServiceProxy<T extends
|
|
1010
|
+
crudServiceProxy<T extends Identifiable<string>>(serviceIdentifier: string): ICrudServiceProxy<T>;
|
|
1014
1011
|
}
|
|
1015
1012
|
declare class FunctionalIterablePage<T> extends AbstractIterablePage<T> {
|
|
1016
1013
|
private readonly pageFunction;
|
|
@@ -1059,7 +1056,7 @@ import { Optional as Optional2 } from "typescript-optional";
|
|
|
1059
1056
|
/**
|
|
1060
1057
|
* Default IEvent implementation
|
|
1061
1058
|
*/
|
|
1062
|
-
declare class Event implements
|
|
1059
|
+
declare class Event implements IEvent {
|
|
1063
1060
|
cri: string;
|
|
1064
1061
|
headers: Map<string, string>;
|
|
1065
1062
|
data: Optional2<Uint8Array>;
|
|
@@ -1089,11 +1086,11 @@ declare class EventBus implements IEventBus {
|
|
|
1089
1086
|
isConnected(): boolean;
|
|
1090
1087
|
connect(connectionInfo: ConnectionInfo): Promise<ConnectedInfo>;
|
|
1091
1088
|
disconnect(force?: boolean): Promise<void>;
|
|
1092
|
-
send(event:
|
|
1093
|
-
request(event:
|
|
1094
|
-
requestStream(event:
|
|
1089
|
+
send(event: IEvent): void;
|
|
1090
|
+
request(event: IEvent): Promise<IEvent>;
|
|
1091
|
+
requestStream(event: IEvent, sendControlEvents?: boolean): Observable3<IEvent>;
|
|
1095
1092
|
listen(_serverInfo: ServerInfo): Promise<void>;
|
|
1096
|
-
observe(cri: string): Observable3<
|
|
1093
|
+
observe(cri: string): Observable3<IEvent>;
|
|
1097
1094
|
private cleanup;
|
|
1098
1095
|
/**
|
|
1099
1096
|
* Creates the proper error to return if this.stompConnectionManager?.rxStomp is not available on a send request
|
|
@@ -1119,4 +1116,4 @@ declare class ParticipantConstants {
|
|
|
1119
1116
|
static readonly PARTICIPANT_TYPE_NODE: string;
|
|
1120
1117
|
static readonly CLI_PARTICIPANT_ID: string;
|
|
1121
1118
|
}
|
|
1122
|
-
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticProjectConfig, KinoticPlugin, KinoticError, Kinotic, JsonEventFactory, IterablePage,
|
|
1119
|
+
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticProjectConfig, KinoticPlugin, KinoticError, Kinotic, JsonEventFactory, IterablePage, Identifiable, IServiceRegistry, IServiceProxy, IParticipant, IKinotic, IEventFactory, IEventBus, IEvent, IEditableDataSource, IDataSource, ICrudServiceProxyFactory, ICrudServiceProxy, FunctionalIterablePage, EventConstants, EventBus, Event, Direction, DefaultCRI, DataSourceUtils, CursorPageable, CrudServiceProxyFactory, CrudServiceProxy, ContextInterceptor, Context, ConnectionInfo, ConnectedInfo, ConnectHeaders, CRI, CONTEXT_METADATA_KEY, AuthorizationError, AuthenticationError, AbstractIterablePage };
|
package/dist/index.d.ts
CHANGED
|
@@ -33,26 +33,15 @@ declare class ConnectionInfo extends ServerInfo {
|
|
|
33
33
|
*/
|
|
34
34
|
disableStickySession?: boolean | null;
|
|
35
35
|
}
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
* Interface for the service context, extendable by users for type-safe context data.
|
|
39
|
-
*
|
|
40
|
-
* @author Navid Mitchell 🤝Grok
|
|
41
|
-
* @since 3/25/2025
|
|
42
|
-
*/
|
|
43
|
-
interface ServiceContext {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
}
|
|
36
|
+
import { Optional } from "typescript-optional";
|
|
37
|
+
import { Observable } from "rxjs";
|
|
46
38
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @author Navid Mitchell 🤝Grok
|
|
50
|
-
* @since 3/25/2025
|
|
39
|
+
* Instances of this interface have a unique id (identity) and are therefore "Identifiable"
|
|
40
|
+
* Created by navid on 2/3/20
|
|
51
41
|
*/
|
|
52
|
-
interface
|
|
53
|
-
|
|
42
|
+
interface Identifiable<T> {
|
|
43
|
+
id: T | null;
|
|
54
44
|
}
|
|
55
|
-
import { Identifiable } from "@/api/Identifiable";
|
|
56
45
|
/**
|
|
57
46
|
* Created by Navíd Mitchell 🤪on 6/16/23.
|
|
58
47
|
*/
|
|
@@ -100,8 +89,6 @@ declare class ConnectedInfo {
|
|
|
100
89
|
replyToId: string;
|
|
101
90
|
participant: Participant;
|
|
102
91
|
}
|
|
103
|
-
import { Optional } from "typescript-optional";
|
|
104
|
-
import { Observable } from "rxjs";
|
|
105
92
|
/**
|
|
106
93
|
* Base error class for all Kinoitc errors
|
|
107
94
|
*/
|
|
@@ -116,7 +103,7 @@ declare class KinoticError extends Error {
|
|
|
116
103
|
*
|
|
117
104
|
* Created by Navid Mitchell on 2019-01-04.
|
|
118
105
|
*/
|
|
119
|
-
interface
|
|
106
|
+
interface IEvent {
|
|
120
107
|
/**
|
|
121
108
|
* The cri that specifies where the event should be routed
|
|
122
109
|
*/
|
|
@@ -219,14 +206,14 @@ interface IEventBus {
|
|
|
219
206
|
* Creates a subscription for all {@link IEvent}'s for the given destination
|
|
220
207
|
* @param cri to subscribe to
|
|
221
208
|
*/
|
|
222
|
-
observe(cri: string): Observable<
|
|
209
|
+
observe(cri: string): Observable<IEvent>;
|
|
223
210
|
/**
|
|
224
211
|
* Sends an {@link IEvent} expecting a response
|
|
225
212
|
* All response correlation will be handled internally
|
|
226
213
|
* @param event to send as the request
|
|
227
214
|
* @return a Promise that will resolve when the response is received
|
|
228
215
|
*/
|
|
229
|
-
request(event:
|
|
216
|
+
request(event: IEvent): Promise<IEvent>;
|
|
230
217
|
/**
|
|
231
218
|
* Sends an {@link IEvent} expecting multiple responses
|
|
232
219
|
* All response correlation will be handled internally
|
|
@@ -235,12 +222,12 @@ interface IEventBus {
|
|
|
235
222
|
* @return an {@link Observable<IEvent} that will provide the response stream
|
|
236
223
|
* NOTE: the naming here is similar to RSocket https://www.baeldung.com/rsocket#3-requeststream
|
|
237
224
|
*/
|
|
238
|
-
requestStream(event:
|
|
225
|
+
requestStream(event: IEvent, sendControlEvents: boolean): Observable<IEvent>;
|
|
239
226
|
/**
|
|
240
227
|
* Send a single {@link IEvent} to the connected server
|
|
241
228
|
* @param event to send
|
|
242
229
|
*/
|
|
243
|
-
send(event:
|
|
230
|
+
send(event: IEvent): void;
|
|
244
231
|
}
|
|
245
232
|
/**
|
|
246
233
|
* Constants used within {@link IEvent}'s to control the flow of events
|
|
@@ -314,6 +301,24 @@ declare enum EventConstants {
|
|
|
314
301
|
TRACESTATE_HEADER = "tracestate"
|
|
315
302
|
}
|
|
316
303
|
/**
|
|
304
|
+
* Interface for the service context, extendable by users for type-safe context data.
|
|
305
|
+
*
|
|
306
|
+
* @author Navid Mitchell 🤝Grok
|
|
307
|
+
* @since 3/25/2025
|
|
308
|
+
*/
|
|
309
|
+
interface ServiceContext {
|
|
310
|
+
[key: string]: any;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Interface for interceptors that create or modify the ServiceContext before service method invocation.
|
|
314
|
+
*
|
|
315
|
+
* @author Navid Mitchell 🤝Grok
|
|
316
|
+
* @since 3/25/2025
|
|
317
|
+
*/
|
|
318
|
+
interface ContextInterceptor<T extends ServiceContext> {
|
|
319
|
+
intercept(event: IEvent, context: T): Promise<T> | T;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
317
322
|
* `CRI` is a Kinoitc Resource Identifier used by Kinoitc to route requests appropriately.
|
|
318
323
|
*
|
|
319
324
|
* The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinoitc.
|
|
@@ -455,12 +460,11 @@ declare class ServiceIdentifier {
|
|
|
455
460
|
cri(): CRI;
|
|
456
461
|
}
|
|
457
462
|
import { Observable as Observable2 } from "rxjs";
|
|
458
|
-
import { IEvent as IEvent3 } from "./IEventBus";
|
|
459
463
|
/**
|
|
460
464
|
* Provides an interface to allow the {@link IServiceProxy} creator the ability to have fine grain control of the outgoing {@link IEvent}
|
|
461
465
|
*/
|
|
462
466
|
interface IEventFactory {
|
|
463
|
-
create(cri: string, args: any[] | null | undefined):
|
|
467
|
+
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
464
468
|
}
|
|
465
469
|
/**
|
|
466
470
|
* {@link IServiceProxy} provides the ability to access a remote service
|
|
@@ -530,13 +534,13 @@ interface IServiceRegistry {
|
|
|
530
534
|
* An implementation of a {@link IEventFactory} which uses JSON content
|
|
531
535
|
*/
|
|
532
536
|
declare class JsonEventFactory implements IEventFactory {
|
|
533
|
-
create(cri: string, args: any[] | null | undefined):
|
|
537
|
+
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
534
538
|
}
|
|
535
539
|
/**
|
|
536
540
|
* An implementation of a {@link IEventFactory} which uses text content
|
|
537
541
|
*/
|
|
538
542
|
declare class TextEventFactory implements IEventFactory {
|
|
539
|
-
create(cri: string, args: any[] | null | undefined):
|
|
543
|
+
create(cri: string, args: any[] | null | undefined): IEvent;
|
|
540
544
|
}
|
|
541
545
|
/**
|
|
542
546
|
* The default implementation of {@link IServiceRegistry}
|
|
@@ -864,7 +868,7 @@ interface IDataSource<T> {
|
|
|
864
868
|
*/
|
|
865
869
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
866
870
|
}
|
|
867
|
-
interface IEditableDataSource<T extends
|
|
871
|
+
interface IEditableDataSource<T extends Identifiable<string>> extends IDataSource<T> {
|
|
868
872
|
/**
|
|
869
873
|
* Creates a new entity if one does not already exist for the given id
|
|
870
874
|
* @param entity to create if one does not already exist
|
|
@@ -903,7 +907,7 @@ interface IEditableDataSource<T extends Identifiable2<string>> extends IDataSour
|
|
|
903
907
|
* @param pageable the page settings to be used
|
|
904
908
|
* @return a {@link Promise} emitting the page of entities
|
|
905
909
|
*/
|
|
906
|
-
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<
|
|
910
|
+
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<Identifiable<string>>>;
|
|
907
911
|
}
|
|
908
912
|
declare class DataSourceUtils {
|
|
909
913
|
static instanceOfEditableDataSource(datasource: IDataSource<any> | IEditableDataSource<any>): datasource is IEditableDataSource<any>;
|
|
@@ -911,7 +915,7 @@ declare class DataSourceUtils {
|
|
|
911
915
|
/**
|
|
912
916
|
* A {@link ICrudServiceProxy} is a proxy for a remote CRUD service
|
|
913
917
|
*/
|
|
914
|
-
interface ICrudServiceProxy<T extends
|
|
918
|
+
interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDataSource<T> {
|
|
915
919
|
/**
|
|
916
920
|
* Creates a new entity if one does not already exist for the given id
|
|
917
921
|
* @param entity to create if one does not already exist
|
|
@@ -963,7 +967,7 @@ interface ICrudServiceProxy<T extends Identifiable2<string>> extends IEditableDa
|
|
|
963
967
|
* @param pageable the page settings to be used
|
|
964
968
|
* @return a {@link Promise} emitting the page of entities
|
|
965
969
|
*/
|
|
966
|
-
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<
|
|
970
|
+
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<Identifiable<string>>>;
|
|
967
971
|
/**
|
|
968
972
|
* Returns a {@link Page} of entities matching the search text and paging restriction provided in the {@code Pageable} object.
|
|
969
973
|
*
|
|
@@ -973,7 +977,7 @@ interface ICrudServiceProxy<T extends Identifiable2<string>> extends IEditableDa
|
|
|
973
977
|
*/
|
|
974
978
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
975
979
|
}
|
|
976
|
-
declare class CrudServiceProxy<T extends
|
|
980
|
+
declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudServiceProxy<T> {
|
|
977
981
|
protected serviceProxy: IServiceProxy;
|
|
978
982
|
constructor(serviceProxy: IServiceProxy);
|
|
979
983
|
count(): Promise<number>;
|
|
@@ -983,18 +987,11 @@ declare class CrudServiceProxy<T extends Identifiable2<string>> implements ICrud
|
|
|
983
987
|
findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
|
|
984
988
|
findById(id: string): Promise<T>;
|
|
985
989
|
save(entity: T): Promise<T>;
|
|
986
|
-
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<
|
|
990
|
+
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<Identifiable<string>>>;
|
|
987
991
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
988
992
|
searchSinglePage(searchText: string, pageable: Pageable): Promise<Page<T>>;
|
|
989
993
|
}
|
|
990
994
|
/**
|
|
991
|
-
* Instances of this interface have a unique id (identity) and are therefore "Identifiable"
|
|
992
|
-
* Created by navid on 2/3/20
|
|
993
|
-
*/
|
|
994
|
-
interface Identifiable2<T> {
|
|
995
|
-
id: T | null;
|
|
996
|
-
}
|
|
997
|
-
/**
|
|
998
995
|
* Produces {@link ICrudServiceProxy} Proxies for a known remote CRUD service
|
|
999
996
|
*/
|
|
1000
997
|
interface ICrudServiceProxyFactory {
|
|
@@ -1002,7 +999,7 @@ interface ICrudServiceProxyFactory {
|
|
|
1002
999
|
* Produces a {@link ICrudServiceProxy} for the given serviceIdentifier
|
|
1003
1000
|
* @param serviceIdentifier the service identifier to produce a proxy for
|
|
1004
1001
|
*/
|
|
1005
|
-
crudServiceProxy<T extends
|
|
1002
|
+
crudServiceProxy<T extends Identifiable<string>>(serviceIdentifier: string): ICrudServiceProxy<T>;
|
|
1006
1003
|
}
|
|
1007
1004
|
/**
|
|
1008
1005
|
* Default implementation of {@link ICrudServiceProxyFactory}
|
|
@@ -1010,7 +1007,7 @@ interface ICrudServiceProxyFactory {
|
|
|
1010
1007
|
declare class CrudServiceProxyFactory implements ICrudServiceProxyFactory {
|
|
1011
1008
|
private serviceRegistry;
|
|
1012
1009
|
constructor(serviceRegistry: IServiceRegistry);
|
|
1013
|
-
crudServiceProxy<T extends
|
|
1010
|
+
crudServiceProxy<T extends Identifiable<string>>(serviceIdentifier: string): ICrudServiceProxy<T>;
|
|
1014
1011
|
}
|
|
1015
1012
|
declare class FunctionalIterablePage<T> extends AbstractIterablePage<T> {
|
|
1016
1013
|
private readonly pageFunction;
|
|
@@ -1059,7 +1056,7 @@ import { Optional as Optional2 } from "typescript-optional";
|
|
|
1059
1056
|
/**
|
|
1060
1057
|
* Default IEvent implementation
|
|
1061
1058
|
*/
|
|
1062
|
-
declare class Event implements
|
|
1059
|
+
declare class Event implements IEvent {
|
|
1063
1060
|
cri: string;
|
|
1064
1061
|
headers: Map<string, string>;
|
|
1065
1062
|
data: Optional2<Uint8Array>;
|
|
@@ -1089,11 +1086,11 @@ declare class EventBus implements IEventBus {
|
|
|
1089
1086
|
isConnected(): boolean;
|
|
1090
1087
|
connect(connectionInfo: ConnectionInfo): Promise<ConnectedInfo>;
|
|
1091
1088
|
disconnect(force?: boolean): Promise<void>;
|
|
1092
|
-
send(event:
|
|
1093
|
-
request(event:
|
|
1094
|
-
requestStream(event:
|
|
1089
|
+
send(event: IEvent): void;
|
|
1090
|
+
request(event: IEvent): Promise<IEvent>;
|
|
1091
|
+
requestStream(event: IEvent, sendControlEvents?: boolean): Observable3<IEvent>;
|
|
1095
1092
|
listen(_serverInfo: ServerInfo): Promise<void>;
|
|
1096
|
-
observe(cri: string): Observable3<
|
|
1093
|
+
observe(cri: string): Observable3<IEvent>;
|
|
1097
1094
|
private cleanup;
|
|
1098
1095
|
/**
|
|
1099
1096
|
* Creates the proper error to return if this.stompConnectionManager?.rxStomp is not available on a send request
|
|
@@ -1119,4 +1116,4 @@ declare class ParticipantConstants {
|
|
|
1119
1116
|
static readonly PARTICIPANT_TYPE_NODE: string;
|
|
1120
1117
|
static readonly CLI_PARTICIPANT_ID: string;
|
|
1121
1118
|
}
|
|
1122
|
-
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticProjectConfig, KinoticPlugin, KinoticError, Kinotic, JsonEventFactory, IterablePage,
|
|
1119
|
+
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticProjectConfig, KinoticPlugin, KinoticError, Kinotic, JsonEventFactory, IterablePage, Identifiable, IServiceRegistry, IServiceProxy, IParticipant, IKinotic, IEventFactory, IEventBus, IEvent, IEditableDataSource, IDataSource, ICrudServiceProxyFactory, ICrudServiceProxy, FunctionalIterablePage, EventConstants, EventBus, Event, Direction, DefaultCRI, DataSourceUtils, CursorPageable, CrudServiceProxyFactory, CrudServiceProxy, ContextInterceptor, Context, ConnectionInfo, ConnectedInfo, ConnectHeaders, CRI, CONTEXT_METADATA_KEY, AuthorizationError, AuthenticationError, AbstractIterablePage };
|
package/dist/index.js
CHANGED