@kinotic-ai/core 1.1.1 → 1.2.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/dist/index.cjs +34 -1031
- package/dist/index.d.cts +37 -62
- package/dist/index.d.ts +37 -62
- package/dist/index.js +34 -1061
- package/package.json +22 -21
package/dist/index.d.cts
CHANGED
|
@@ -59,6 +59,19 @@ interface IParticipant extends Identifiable<string> {
|
|
|
59
59
|
*/
|
|
60
60
|
tenantId?: string | null;
|
|
61
61
|
/**
|
|
62
|
+
* The scope layer this participant authenticated against.
|
|
63
|
+
* Well-known values are "SYSTEM", "ORGANIZATION", and "APPLICATION",
|
|
64
|
+
* but custom values are allowed for extensibility.
|
|
65
|
+
*/
|
|
66
|
+
authScopeType?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The identifier of the specific scope this participant belongs to.
|
|
69
|
+
* For example, "kinotic" for system scope, an organization ID, or an application ID.
|
|
70
|
+
* Together with {@link authScopeType}, uniquely identifies which user pool
|
|
71
|
+
* this participant was authenticated from.
|
|
72
|
+
*/
|
|
73
|
+
authScopeId?: string | null;
|
|
74
|
+
/**
|
|
62
75
|
* Metadata is a map of key value pairs that can be used to store additional information about a participant
|
|
63
76
|
*
|
|
64
77
|
* @return a map of key value pairs
|
|
@@ -77,9 +90,11 @@ interface IParticipant extends Identifiable<string> {
|
|
|
77
90
|
declare class Participant implements IParticipant {
|
|
78
91
|
id: string;
|
|
79
92
|
tenantId?: string | null;
|
|
93
|
+
authScopeType?: string | null;
|
|
94
|
+
authScopeId?: string | null;
|
|
80
95
|
metadata: Map<string, string>;
|
|
81
96
|
roles: string[];
|
|
82
|
-
constructor(id: string, tenantId?: string, metadata?: Map<string, string>, roles?: string[]);
|
|
97
|
+
constructor(id: string, tenantId?: string, authScopeType?: string, authScopeId?: string, metadata?: Map<string, string>, roles?: string[]);
|
|
83
98
|
}
|
|
84
99
|
/**
|
|
85
100
|
* Contains information about the connection that was established
|
|
@@ -641,66 +656,6 @@ declare function Version(version: string): (target: Function) => void;
|
|
|
641
656
|
declare function Context(): (target: any, propertyKey: string, parameterIndex: number) => void;
|
|
642
657
|
declare function Publish(namespace: string, name?: string): (target: Function) => any;
|
|
643
658
|
/**
|
|
644
|
-
* Configuration for a single entities path and its corresponding repository output.
|
|
645
|
-
*/
|
|
646
|
-
type EntitiesPathConfig = {
|
|
647
|
-
/**
|
|
648
|
-
* The path to search for classes decorated with @Entity.
|
|
649
|
-
*/
|
|
650
|
-
path: string;
|
|
651
|
-
/**
|
|
652
|
-
* The path where generated Repository classes will be placed.
|
|
653
|
-
*/
|
|
654
|
-
repositoryPath: string;
|
|
655
|
-
/**
|
|
656
|
-
* If true, the subfolder structure under the entities path will be mirrored under the repository path.
|
|
657
|
-
* For example, if entitiesPath is "src/model" and contains "payments/Payment.ts",
|
|
658
|
-
* the generated repository will be placed in "repositoryPath/payments/".
|
|
659
|
-
* If false, all generated repositories are placed directly in the repositoryPath.
|
|
660
|
-
* Defaults to true.
|
|
661
|
-
*/
|
|
662
|
-
mirrorFolderStructure?: boolean;
|
|
663
|
-
};
|
|
664
|
-
/**
|
|
665
|
-
* The project configuration for a Kinotic project.
|
|
666
|
-
*/
|
|
667
|
-
declare class KinoticProjectConfig {
|
|
668
|
-
/**
|
|
669
|
-
* The name of the project or undefined if a project name is used.
|
|
670
|
-
* i.e. if the project is typescript the package.json name will be used.
|
|
671
|
-
*/
|
|
672
|
-
name?: string;
|
|
673
|
-
/**
|
|
674
|
-
* The description of the project.
|
|
675
|
-
*/
|
|
676
|
-
description?: string;
|
|
677
|
-
/**
|
|
678
|
-
* The Kinotic Application that this project belongs to.
|
|
679
|
-
*/
|
|
680
|
-
application: string;
|
|
681
|
-
/**
|
|
682
|
-
* The paths to search for classes decorated with @Entity that Kinotic will be created for.
|
|
683
|
-
* Each entry can be a string (simple path) or an {@link EntitiesPathConfig} object for full control
|
|
684
|
-
* over where repository classes are generated.
|
|
685
|
-
*
|
|
686
|
-
* When a plain string is provided, the {@link generatedPath} will be used as the repository output path.
|
|
687
|
-
*/
|
|
688
|
-
entitiesPaths: (string | EntitiesPathConfig)[];
|
|
689
|
-
/**
|
|
690
|
-
* The default path to where generated files will be placed when entitiesPaths contains plain strings.
|
|
691
|
-
* Ignored for entitiesPaths entries that use {@link EntitiesPathConfig}.
|
|
692
|
-
*/
|
|
693
|
-
generatedPath?: string;
|
|
694
|
-
/**
|
|
695
|
-
* The file extension to use for imports in generated files.
|
|
696
|
-
*/
|
|
697
|
-
fileExtensionForImports: string;
|
|
698
|
-
/**
|
|
699
|
-
* If true the generated Repository classes will validate all data before sending to the server.
|
|
700
|
-
*/
|
|
701
|
-
validate?: boolean;
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
659
|
* A page is a sublist of a list of objects.
|
|
705
660
|
* @author Navid Mitchell
|
|
706
661
|
*/
|
|
@@ -949,6 +904,15 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
|
|
|
949
904
|
*/
|
|
950
905
|
create(entity: T): Promise<T>;
|
|
951
906
|
/**
|
|
907
|
+
* Creates a new entity if one does not already exist for the given id, and waits for the
|
|
908
|
+
* change to be visible in search results before returning.
|
|
909
|
+
* Use this when you need read-your-write consistency immediately after creation.
|
|
910
|
+
*
|
|
911
|
+
* @param entity to create if one does not already exist
|
|
912
|
+
* @return a {@link Promise} containing the new entity after it is searchable, or an error if an exception occurred
|
|
913
|
+
*/
|
|
914
|
+
createSync(entity: T): Promise<T>;
|
|
915
|
+
/**
|
|
952
916
|
* Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
|
|
953
917
|
* entity instance completely.
|
|
954
918
|
*
|
|
@@ -958,6 +922,15 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
|
|
|
958
922
|
*/
|
|
959
923
|
save(entity: T): Promise<T>;
|
|
960
924
|
/**
|
|
925
|
+
* Saves a given entity and waits for the changes to be visible in search results before returning.
|
|
926
|
+
* Use the returned instance for further operations as the save operation might have changed the entity instance completely.
|
|
927
|
+
*
|
|
928
|
+
* @param entity must not be {@literal null}.
|
|
929
|
+
* @return a {@link Promise} emitting the saved entity.
|
|
930
|
+
* @throws Error in case the given {@literal entity} is {@literal null}.
|
|
931
|
+
*/
|
|
932
|
+
saveSync(entity: T): Promise<T>;
|
|
933
|
+
/**
|
|
961
934
|
* Retrieves an entity by its id.
|
|
962
935
|
*
|
|
963
936
|
* @param id must not be {@literal null}.
|
|
@@ -1008,11 +981,13 @@ declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudS
|
|
|
1008
981
|
constructor(serviceProxy: IServiceProxy);
|
|
1009
982
|
count(): Promise<number>;
|
|
1010
983
|
create(entity: T): Promise<T>;
|
|
984
|
+
createSync(entity: T): Promise<T>;
|
|
1011
985
|
deleteById(id: string): Promise<void>;
|
|
1012
986
|
findAll(pageable: Pageable): Promise<IterablePage<T>>;
|
|
1013
987
|
findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
|
|
1014
988
|
findById(id: string): Promise<T>;
|
|
1015
989
|
save(entity: T): Promise<T>;
|
|
990
|
+
saveSync(entity: T): Promise<T>;
|
|
1016
991
|
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<Identifiable<string>>>;
|
|
1017
992
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
1018
993
|
searchSinglePage(searchText: string, pageable: Pageable): Promise<Page<T>>;
|
|
@@ -1142,4 +1117,4 @@ declare class ParticipantConstants {
|
|
|
1142
1117
|
static readonly PARTICIPANT_TYPE_NODE: string;
|
|
1143
1118
|
static readonly CLI_PARTICIPANT_ID: string;
|
|
1144
1119
|
}
|
|
1145
|
-
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton,
|
|
1120
|
+
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, 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
|
@@ -59,6 +59,19 @@ interface IParticipant extends Identifiable<string> {
|
|
|
59
59
|
*/
|
|
60
60
|
tenantId?: string | null;
|
|
61
61
|
/**
|
|
62
|
+
* The scope layer this participant authenticated against.
|
|
63
|
+
* Well-known values are "SYSTEM", "ORGANIZATION", and "APPLICATION",
|
|
64
|
+
* but custom values are allowed for extensibility.
|
|
65
|
+
*/
|
|
66
|
+
authScopeType?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The identifier of the specific scope this participant belongs to.
|
|
69
|
+
* For example, "kinotic" for system scope, an organization ID, or an application ID.
|
|
70
|
+
* Together with {@link authScopeType}, uniquely identifies which user pool
|
|
71
|
+
* this participant was authenticated from.
|
|
72
|
+
*/
|
|
73
|
+
authScopeId?: string | null;
|
|
74
|
+
/**
|
|
62
75
|
* Metadata is a map of key value pairs that can be used to store additional information about a participant
|
|
63
76
|
*
|
|
64
77
|
* @return a map of key value pairs
|
|
@@ -77,9 +90,11 @@ interface IParticipant extends Identifiable<string> {
|
|
|
77
90
|
declare class Participant implements IParticipant {
|
|
78
91
|
id: string;
|
|
79
92
|
tenantId?: string | null;
|
|
93
|
+
authScopeType?: string | null;
|
|
94
|
+
authScopeId?: string | null;
|
|
80
95
|
metadata: Map<string, string>;
|
|
81
96
|
roles: string[];
|
|
82
|
-
constructor(id: string, tenantId?: string, metadata?: Map<string, string>, roles?: string[]);
|
|
97
|
+
constructor(id: string, tenantId?: string, authScopeType?: string, authScopeId?: string, metadata?: Map<string, string>, roles?: string[]);
|
|
83
98
|
}
|
|
84
99
|
/**
|
|
85
100
|
* Contains information about the connection that was established
|
|
@@ -641,66 +656,6 @@ declare function Version(version: string): (target: Function) => void;
|
|
|
641
656
|
declare function Context(): (target: any, propertyKey: string, parameterIndex: number) => void;
|
|
642
657
|
declare function Publish(namespace: string, name?: string): (target: Function) => any;
|
|
643
658
|
/**
|
|
644
|
-
* Configuration for a single entities path and its corresponding repository output.
|
|
645
|
-
*/
|
|
646
|
-
type EntitiesPathConfig = {
|
|
647
|
-
/**
|
|
648
|
-
* The path to search for classes decorated with @Entity.
|
|
649
|
-
*/
|
|
650
|
-
path: string;
|
|
651
|
-
/**
|
|
652
|
-
* The path where generated Repository classes will be placed.
|
|
653
|
-
*/
|
|
654
|
-
repositoryPath: string;
|
|
655
|
-
/**
|
|
656
|
-
* If true, the subfolder structure under the entities path will be mirrored under the repository path.
|
|
657
|
-
* For example, if entitiesPath is "src/model" and contains "payments/Payment.ts",
|
|
658
|
-
* the generated repository will be placed in "repositoryPath/payments/".
|
|
659
|
-
* If false, all generated repositories are placed directly in the repositoryPath.
|
|
660
|
-
* Defaults to true.
|
|
661
|
-
*/
|
|
662
|
-
mirrorFolderStructure?: boolean;
|
|
663
|
-
};
|
|
664
|
-
/**
|
|
665
|
-
* The project configuration for a Kinotic project.
|
|
666
|
-
*/
|
|
667
|
-
declare class KinoticProjectConfig {
|
|
668
|
-
/**
|
|
669
|
-
* The name of the project or undefined if a project name is used.
|
|
670
|
-
* i.e. if the project is typescript the package.json name will be used.
|
|
671
|
-
*/
|
|
672
|
-
name?: string;
|
|
673
|
-
/**
|
|
674
|
-
* The description of the project.
|
|
675
|
-
*/
|
|
676
|
-
description?: string;
|
|
677
|
-
/**
|
|
678
|
-
* The Kinotic Application that this project belongs to.
|
|
679
|
-
*/
|
|
680
|
-
application: string;
|
|
681
|
-
/**
|
|
682
|
-
* The paths to search for classes decorated with @Entity that Kinotic will be created for.
|
|
683
|
-
* Each entry can be a string (simple path) or an {@link EntitiesPathConfig} object for full control
|
|
684
|
-
* over where repository classes are generated.
|
|
685
|
-
*
|
|
686
|
-
* When a plain string is provided, the {@link generatedPath} will be used as the repository output path.
|
|
687
|
-
*/
|
|
688
|
-
entitiesPaths: (string | EntitiesPathConfig)[];
|
|
689
|
-
/**
|
|
690
|
-
* The default path to where generated files will be placed when entitiesPaths contains plain strings.
|
|
691
|
-
* Ignored for entitiesPaths entries that use {@link EntitiesPathConfig}.
|
|
692
|
-
*/
|
|
693
|
-
generatedPath?: string;
|
|
694
|
-
/**
|
|
695
|
-
* The file extension to use for imports in generated files.
|
|
696
|
-
*/
|
|
697
|
-
fileExtensionForImports: string;
|
|
698
|
-
/**
|
|
699
|
-
* If true the generated Repository classes will validate all data before sending to the server.
|
|
700
|
-
*/
|
|
701
|
-
validate?: boolean;
|
|
702
|
-
}
|
|
703
|
-
/**
|
|
704
659
|
* A page is a sublist of a list of objects.
|
|
705
660
|
* @author Navid Mitchell
|
|
706
661
|
*/
|
|
@@ -949,6 +904,15 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
|
|
|
949
904
|
*/
|
|
950
905
|
create(entity: T): Promise<T>;
|
|
951
906
|
/**
|
|
907
|
+
* Creates a new entity if one does not already exist for the given id, and waits for the
|
|
908
|
+
* change to be visible in search results before returning.
|
|
909
|
+
* Use this when you need read-your-write consistency immediately after creation.
|
|
910
|
+
*
|
|
911
|
+
* @param entity to create if one does not already exist
|
|
912
|
+
* @return a {@link Promise} containing the new entity after it is searchable, or an error if an exception occurred
|
|
913
|
+
*/
|
|
914
|
+
createSync(entity: T): Promise<T>;
|
|
915
|
+
/**
|
|
952
916
|
* Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
|
|
953
917
|
* entity instance completely.
|
|
954
918
|
*
|
|
@@ -958,6 +922,15 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
|
|
|
958
922
|
*/
|
|
959
923
|
save(entity: T): Promise<T>;
|
|
960
924
|
/**
|
|
925
|
+
* Saves a given entity and waits for the changes to be visible in search results before returning.
|
|
926
|
+
* Use the returned instance for further operations as the save operation might have changed the entity instance completely.
|
|
927
|
+
*
|
|
928
|
+
* @param entity must not be {@literal null}.
|
|
929
|
+
* @return a {@link Promise} emitting the saved entity.
|
|
930
|
+
* @throws Error in case the given {@literal entity} is {@literal null}.
|
|
931
|
+
*/
|
|
932
|
+
saveSync(entity: T): Promise<T>;
|
|
933
|
+
/**
|
|
961
934
|
* Retrieves an entity by its id.
|
|
962
935
|
*
|
|
963
936
|
* @param id must not be {@literal null}.
|
|
@@ -1008,11 +981,13 @@ declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudS
|
|
|
1008
981
|
constructor(serviceProxy: IServiceProxy);
|
|
1009
982
|
count(): Promise<number>;
|
|
1010
983
|
create(entity: T): Promise<T>;
|
|
984
|
+
createSync(entity: T): Promise<T>;
|
|
1011
985
|
deleteById(id: string): Promise<void>;
|
|
1012
986
|
findAll(pageable: Pageable): Promise<IterablePage<T>>;
|
|
1013
987
|
findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
|
|
1014
988
|
findById(id: string): Promise<T>;
|
|
1015
989
|
save(entity: T): Promise<T>;
|
|
990
|
+
saveSync(entity: T): Promise<T>;
|
|
1016
991
|
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<Identifiable<string>>>;
|
|
1017
992
|
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
1018
993
|
searchSinglePage(searchText: string, pageable: Pageable): Promise<Page<T>>;
|
|
@@ -1142,4 +1117,4 @@ declare class ParticipantConstants {
|
|
|
1142
1117
|
static readonly PARTICIPANT_TYPE_NODE: string;
|
|
1143
1118
|
static readonly CLI_PARTICIPANT_ID: string;
|
|
1144
1119
|
}
|
|
1145
|
-
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton,
|
|
1120
|
+
export { createCRI, Version, TextEventFactory, Sort, ServiceRegistry, ServiceContext, ServerInfo, Scope, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, 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 };
|