@mindignited/continuum-client 2.14.6
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/README.md +10 -0
- package/dist/continuum.cjs +3 -0
- package/dist/continuum.cjs.map +1 -0
- package/dist/continuum.js +1156 -0
- package/dist/continuum.js.map +1 -0
- package/dist/src/api/ConnectionInfo.d.ts +35 -0
- package/dist/src/api/Continuum.d.ts +81 -0
- package/dist/src/api/ContinuumDecorators.d.ts +5 -0
- package/dist/src/api/ILogManager.d.ts +49 -0
- package/dist/src/api/Identifiable.d.ts +7 -0
- package/dist/src/api/LogManager.d.ts +9 -0
- package/dist/src/api/errors/AuthenticationError.d.ts +4 -0
- package/dist/src/api/errors/AuthorizationError.d.ts +4 -0
- package/dist/src/api/errors/ContinuumError.d.ts +6 -0
- package/dist/src/api/security/ConnectedInfo.d.ts +9 -0
- package/dist/src/api/security/IParticipant.d.ts +30 -0
- package/dist/src/api/security/Participant.d.ts +11 -0
- package/dist/src/api/security/ParticipantConstants.d.ts +12 -0
- package/dist/src/core/api/CRI.d.ts +122 -0
- package/dist/src/core/api/ContextInterceptor.d.ts +19 -0
- package/dist/src/core/api/DefaultCRI.d.ts +32 -0
- package/dist/src/core/api/EventBus.d.ts +55 -0
- package/dist/src/core/api/IEventBus.d.ts +204 -0
- package/dist/src/core/api/IServiceRegistry.d.ts +74 -0
- package/dist/src/core/api/ServiceIdentifier.d.ts +20 -0
- package/dist/src/core/api/ServiceRegistry.d.ts +29 -0
- package/dist/src/core/api/StompConnectionManager.d.ts +38 -0
- package/dist/src/core/api/StreamData.d.ts +18 -0
- package/dist/src/core/api/crud/AbstractIterablePage.d.ts +23 -0
- package/dist/src/core/api/crud/CrudServiceProxy.d.ts +19 -0
- package/dist/src/core/api/crud/CrudServiceProxyFactory.d.ts +12 -0
- package/dist/src/core/api/crud/FunctionalIterablePage.d.ts +8 -0
- package/dist/src/core/api/crud/ICrudServiceProxy.d.ts +69 -0
- package/dist/src/core/api/crud/ICrudServiceProxyFactory.d.ts +12 -0
- package/dist/src/core/api/crud/IDataSource.d.ts +67 -0
- package/dist/src/core/api/crud/IterablePage.d.ts +15 -0
- package/dist/src/core/api/crud/Page.d.ts +19 -0
- package/dist/src/core/api/crud/Pageable.d.ts +65 -0
- package/dist/src/core/api/crud/Sort.d.ts +63 -0
- package/dist/src/index.d.ts +35 -0
- package/dist/src/internal/core/api/ArgumentResolver.d.ts +14 -0
- package/dist/src/internal/core/api/EventUtil.d.ts +10 -0
- package/dist/src/internal/core/api/Logger.d.ts +21 -0
- package/dist/src/internal/core/api/ReturnValueConverter.d.ts +13 -0
- package/dist/src/internal/core/api/ServiceInvocationSupervisor.d.ts +39 -0
- package/dist/src/internal/core/api/crud/FindAllIterablePage.d.ts +13 -0
- package/dist/src/internal/core/api/crud/SearchIterablePage.d.ts +14 -0
- package/package.json +66 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IterablePage } from './IterablePage';
|
|
2
|
+
import { Page } from './Page';
|
|
3
|
+
import { Pageable } from './Pageable';
|
|
4
|
+
export declare abstract class AbstractIterablePage<T> implements IterablePage<T> {
|
|
5
|
+
private readonly pageable;
|
|
6
|
+
private currentPage;
|
|
7
|
+
private firstPage;
|
|
8
|
+
protected constructor(pageable: Pageable, page: Page<T>);
|
|
9
|
+
/**
|
|
10
|
+
* Finds the next page of results based on the given pageable
|
|
11
|
+
* @param pageable to use to find the next page
|
|
12
|
+
* @return the next page of results
|
|
13
|
+
*/
|
|
14
|
+
protected abstract findNext(pageable: Pageable): Promise<Page<T>>;
|
|
15
|
+
next(): Promise<IteratorResult<IterablePage<T>>>;
|
|
16
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<IterablePage<T>>;
|
|
17
|
+
hasContent(): boolean;
|
|
18
|
+
isLastPage(): boolean;
|
|
19
|
+
private isOffsetPageable;
|
|
20
|
+
get totalElements(): number | null | undefined;
|
|
21
|
+
get cursor(): string | null | undefined;
|
|
22
|
+
get content(): T[] | null | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICrudServiceProxy } from './ICrudServiceProxy';
|
|
2
|
+
import { IServiceProxy } from '../IServiceRegistry';
|
|
3
|
+
import { Identifiable, IterablePage } from '../../../index';
|
|
4
|
+
import { Page } from './Page';
|
|
5
|
+
import { Pageable } from './Pageable';
|
|
6
|
+
export declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudServiceProxy<T> {
|
|
7
|
+
protected serviceProxy: IServiceProxy;
|
|
8
|
+
constructor(serviceProxy: IServiceProxy);
|
|
9
|
+
count(): Promise<number>;
|
|
10
|
+
create(entity: T): Promise<T>;
|
|
11
|
+
deleteById(id: string): Promise<void>;
|
|
12
|
+
findAll(pageable: Pageable): Promise<IterablePage<T>>;
|
|
13
|
+
findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
|
|
14
|
+
findById(id: string): Promise<T>;
|
|
15
|
+
save(entity: T): Promise<T>;
|
|
16
|
+
findByIdNotIn(ids: string[], page: Pageable): Promise<Page<Identifiable<string>>>;
|
|
17
|
+
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
18
|
+
searchSinglePage(searchText: string, pageable: Pageable): Promise<Page<T>>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICrudServiceProxyFactory } from './ICrudServiceProxyFactory';
|
|
2
|
+
import { ICrudServiceProxy } from './ICrudServiceProxy';
|
|
3
|
+
import { Identifiable } from '../../../index';
|
|
4
|
+
import { IServiceRegistry } from '../IServiceRegistry';
|
|
5
|
+
/**
|
|
6
|
+
* Default implementation of {@link ICrudServiceProxyFactory}
|
|
7
|
+
*/
|
|
8
|
+
export declare class CrudServiceProxyFactory implements ICrudServiceProxyFactory {
|
|
9
|
+
private serviceRegistry;
|
|
10
|
+
constructor(serviceRegistry: IServiceRegistry);
|
|
11
|
+
crudServiceProxy<T extends Identifiable<string>>(serviceIdentifier: string): ICrudServiceProxy<T>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractIterablePage } from './AbstractIterablePage';
|
|
2
|
+
import { Page } from './Page';
|
|
3
|
+
import { Pageable } from './Pageable';
|
|
4
|
+
export declare class FunctionalIterablePage<T> extends AbstractIterablePage<T> {
|
|
5
|
+
private readonly pageFunction;
|
|
6
|
+
constructor(pageable: Pageable, page: Page<T>, pageFunction: (pageable: Pageable) => Promise<Page<T>>);
|
|
7
|
+
protected findNext(pageable: Pageable): Promise<Page<T>>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Identifiable, IterablePage } from '../../../index';
|
|
2
|
+
import { Page } from './Page';
|
|
3
|
+
import { Pageable } from './Pageable';
|
|
4
|
+
import { IEditableDataSource } from './IDataSource';
|
|
5
|
+
/**
|
|
6
|
+
* A {@link ICrudServiceProxy} is a proxy for a remote CRUD service
|
|
7
|
+
*/
|
|
8
|
+
export interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDataSource<T> {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new entity if one does not already exist for the given id
|
|
11
|
+
* @param entity to create if one does not already exist
|
|
12
|
+
* @return a {@link Promise} containing the new entity or an error if an exception occurred
|
|
13
|
+
*/
|
|
14
|
+
create(entity: T): Promise<T>;
|
|
15
|
+
/**
|
|
16
|
+
* Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
|
|
17
|
+
* entity instance completely.
|
|
18
|
+
*
|
|
19
|
+
* @param entity must not be {@literal null}.
|
|
20
|
+
* @return a {@link Promise} emitting the saved entity.
|
|
21
|
+
* @throws Error in case the given {@literal entity} is {@literal null}.
|
|
22
|
+
*/
|
|
23
|
+
save(entity: T): Promise<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves an entity by its id.
|
|
26
|
+
*
|
|
27
|
+
* @param id must not be {@literal null}.
|
|
28
|
+
* @return a {@link Promise} emitting the entity with the given id or {@link Promise#empty()} if none found.
|
|
29
|
+
* @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
|
|
30
|
+
*/
|
|
31
|
+
findById(id: string): Promise<T>;
|
|
32
|
+
/**s
|
|
33
|
+
* Returns the number of entities available.
|
|
34
|
+
*
|
|
35
|
+
* @return a {@link Promise} emitting the number of entities.
|
|
36
|
+
*/
|
|
37
|
+
count(): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* Deletes the entity with the given id.
|
|
40
|
+
*
|
|
41
|
+
* @param id must not be {@literal null}.
|
|
42
|
+
* @return a {@link Promise} signaling when operation has completed.
|
|
43
|
+
* @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
|
|
44
|
+
*/
|
|
45
|
+
deleteById(id: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
|
|
48
|
+
*
|
|
49
|
+
* @param pageable the page settings to be used
|
|
50
|
+
* @return a {@link Promise} emitting the page of entities
|
|
51
|
+
*/
|
|
52
|
+
findAll(pageable: Pageable): Promise<IterablePage<T>>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a {@link Page} of entities not in the ids list and meeting the paging restriction provided in the {@code Pageable} object.
|
|
55
|
+
*
|
|
56
|
+
* @param ids not to be returned in the Page
|
|
57
|
+
* @param pageable the page settings to be used
|
|
58
|
+
* @return a {@link Promise} emitting the page of entities
|
|
59
|
+
*/
|
|
60
|
+
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<Identifiable<string>>>;
|
|
61
|
+
/**
|
|
62
|
+
* Returns a {@link Page} of entities matching the search text and paging restriction provided in the {@code Pageable} object.
|
|
63
|
+
*
|
|
64
|
+
* @param searchText the text to search for entities for
|
|
65
|
+
* @param pageable the page settings to be used
|
|
66
|
+
* @return a {@link Promise} emitting the page of entities
|
|
67
|
+
*/
|
|
68
|
+
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
69
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICrudServiceProxy } from './ICrudServiceProxy';
|
|
2
|
+
import { Identifiable } from '../../../index';
|
|
3
|
+
/**
|
|
4
|
+
* Produces {@link ICrudServiceProxy} Proxies for a known remote CRUD service
|
|
5
|
+
*/
|
|
6
|
+
export interface ICrudServiceProxyFactory {
|
|
7
|
+
/**
|
|
8
|
+
* Produces a {@link ICrudServiceProxy} for the given serviceIdentifier
|
|
9
|
+
* @param serviceIdentifier the service identifier to produce a proxy for
|
|
10
|
+
*/
|
|
11
|
+
crudServiceProxy<T extends Identifiable<string>>(serviceIdentifier: string): ICrudServiceProxy<T>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Pageable } from './Pageable';
|
|
2
|
+
import { Page } from './Page';
|
|
3
|
+
import { Identifiable, IterablePage } from '../../../index';
|
|
4
|
+
/**
|
|
5
|
+
* {@link IDataSource} provides an abstract way to retrieve data from various sources
|
|
6
|
+
*/
|
|
7
|
+
export interface IDataSource<T> {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
|
|
10
|
+
*
|
|
11
|
+
* @param pageable the page settings to be used
|
|
12
|
+
* @return a {@link Promise} emitting the page of entities
|
|
13
|
+
*/
|
|
14
|
+
findAll(pageable: Pageable): Promise<IterablePage<T>>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns a {@link Page} of entities matching the search text and paging restriction provided in the {@code Pageable} object.
|
|
17
|
+
*
|
|
18
|
+
* @param searchText the text to search for entities for
|
|
19
|
+
* @param pageable the page settings to be used
|
|
20
|
+
* @return a {@link Promise} emitting the page of entities
|
|
21
|
+
*/
|
|
22
|
+
search(searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
|
|
23
|
+
}
|
|
24
|
+
export interface IEditableDataSource<T extends Identifiable<string>> extends IDataSource<T> {
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new entity if one does not already exist for the given id
|
|
27
|
+
* @param entity to create if one does not already exist
|
|
28
|
+
* @return a {@link Promise} containing the new entity or an error if an exception occurred
|
|
29
|
+
*/
|
|
30
|
+
create(entity: T): Promise<T>;
|
|
31
|
+
/**
|
|
32
|
+
* Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
|
|
33
|
+
* entity instance completely.
|
|
34
|
+
*
|
|
35
|
+
* @param entity must not be {@literal null}.
|
|
36
|
+
* @return a {@link Promise} emitting the saved entity.
|
|
37
|
+
* @throws Error in case the given {@literal entity} is {@literal null}.
|
|
38
|
+
*/
|
|
39
|
+
save(entity: T): Promise<T>;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves an entity by its id.
|
|
42
|
+
*
|
|
43
|
+
* @param id must not be {@literal null}.
|
|
44
|
+
* @return a {@link Promise} emitting the entity with the given id or {@link Promise#empty()} if none found.
|
|
45
|
+
* @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
|
|
46
|
+
*/
|
|
47
|
+
findById(id: string): Promise<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Deletes the entity with the given id.
|
|
50
|
+
*
|
|
51
|
+
* @param id must not be {@literal null}.
|
|
52
|
+
* @return a {@link Promise} signaling when operation has completed.
|
|
53
|
+
* @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
|
|
54
|
+
*/
|
|
55
|
+
deleteById(id: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns a {@link Page} of entities not in the ids list and meeting the paging restriction provided in the {@code Pageable} object.
|
|
58
|
+
*
|
|
59
|
+
* @param ids not to be returned in the Page
|
|
60
|
+
* @param pageable the page settings to be used
|
|
61
|
+
* @return a {@link Promise} emitting the page of entities
|
|
62
|
+
*/
|
|
63
|
+
findByIdNotIn(ids: string[], pageable: Pageable): Promise<Page<Identifiable<string>>>;
|
|
64
|
+
}
|
|
65
|
+
export declare class DataSourceUtils {
|
|
66
|
+
static instanceOfEditableDataSource(datasource: IDataSource<any> | IEditableDataSource<any>): datasource is IEditableDataSource<any>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Page } from './Page';
|
|
2
|
+
/**
|
|
3
|
+
* Defines a page that is also an async iterator.
|
|
4
|
+
* This allows for easy iteration over all pages of a result set.
|
|
5
|
+
*/
|
|
6
|
+
export interface IterablePage<T> extends Page<T>, AsyncIterableIterator<IterablePage<T>> {
|
|
7
|
+
/**
|
|
8
|
+
* @return true if this is the last page, false otherwise.
|
|
9
|
+
*/
|
|
10
|
+
isLastPage(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @return true if this page has content, false otherwise.
|
|
13
|
+
*/
|
|
14
|
+
hasContent(): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A page is a sublist of a list of objects.
|
|
3
|
+
* @author Navid Mitchell
|
|
4
|
+
*/
|
|
5
|
+
export interface Page<T> {
|
|
6
|
+
/**
|
|
7
|
+
* @return the total amount of elements or null or undefined if not known.
|
|
8
|
+
*/
|
|
9
|
+
readonly totalElements: number | null | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The cursor to be used for subsequent retrieval of data.
|
|
12
|
+
* @return an opaque string representation of the cursor, or null if this is the last page, or undefined if cursor paging is not being used.
|
|
13
|
+
*/
|
|
14
|
+
readonly cursor: string | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* @return the page content as {@link Array} or null or undefined if no data is available.
|
|
17
|
+
*/
|
|
18
|
+
readonly content: T[] | null | undefined;
|
|
19
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Sort } from './Sort';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract interface for pagination information.
|
|
4
|
+
*
|
|
5
|
+
* Adapted from the Spring Data Commons Package
|
|
6
|
+
*
|
|
7
|
+
* @author Oliver Gierke
|
|
8
|
+
* @author Navid Mitchell
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class Pageable {
|
|
11
|
+
/**
|
|
12
|
+
* Returns the sorting parameters (optional).
|
|
13
|
+
*/
|
|
14
|
+
sort?: Sort | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the number of items to be returned.
|
|
17
|
+
*/
|
|
18
|
+
pageSize: number;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a {@link Pageable} that uses Offset based pagination.
|
|
21
|
+
* @param pageNumber zero based page index.
|
|
22
|
+
* @param pageSize the size of the page to be returned.
|
|
23
|
+
* @param sort the sorting parameters (optional).
|
|
24
|
+
*/
|
|
25
|
+
static create(pageNumber: number, pageSize: number, sort?: Sort | null): OffsetPageable;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a {@link Pageable} that uses Cursor based pagination.
|
|
28
|
+
* @param cursor the cursor to be used for subsequent retrieval of data, or null if this is the first page.
|
|
29
|
+
* @param pageSize the size of the page to be returned.
|
|
30
|
+
* @param sort the sorting parameters (optional).
|
|
31
|
+
*/
|
|
32
|
+
static createWithCursor(cursor: string | null, pageSize: number, sort?: Sort | null): CursorPageable;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Implementation of {@link Pageable} that uses Offset based pagination.
|
|
36
|
+
*/
|
|
37
|
+
export declare class OffsetPageable extends Pageable {
|
|
38
|
+
/**
|
|
39
|
+
* Returns the page to be returned.
|
|
40
|
+
*/
|
|
41
|
+
pageNumber: number;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a {@link Pageable} that uses Offset based pagination.
|
|
44
|
+
* @param pageNumber zero based page index.
|
|
45
|
+
* @param pageSize the size of the page to be returned.
|
|
46
|
+
* @param sort the sorting parameters (optional).
|
|
47
|
+
*/
|
|
48
|
+
constructor(pageNumber: number, pageSize: number, sort?: Sort | null);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Implementation of {@link Pageable} that uses Cursor based pagination.
|
|
52
|
+
*/
|
|
53
|
+
export declare class CursorPageable extends Pageable {
|
|
54
|
+
/**
|
|
55
|
+
* The cursor to be used for subsequent retrieval of data, or null if this is the first page.
|
|
56
|
+
*/
|
|
57
|
+
cursor: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a {@link Pageable} that uses Cursor based pagination.
|
|
60
|
+
* @param cursor the cursor to be used for subsequent retrieval of data, or null if this is the first page.
|
|
61
|
+
* @param pageSize the size of the page to be returned.
|
|
62
|
+
* @param sort the sorting parameters (optional).
|
|
63
|
+
*/
|
|
64
|
+
constructor(cursor: string | null, pageSize: number, sort?: Sort | null);
|
|
65
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration for sort directions.
|
|
3
|
+
*
|
|
4
|
+
* Adapted from the Spring Data Commons Package
|
|
5
|
+
*
|
|
6
|
+
* @author Oliver Gierke
|
|
7
|
+
* @author Navid Mitchell
|
|
8
|
+
*/
|
|
9
|
+
export declare enum Direction {
|
|
10
|
+
ASC = "ASC",
|
|
11
|
+
DESC = "DESC"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Enumeration for null handling hints that can be used in {@link Order} expressions.
|
|
15
|
+
*
|
|
16
|
+
* Adapted from the Spring Data Commons Package
|
|
17
|
+
*
|
|
18
|
+
* @author Thomas Darimont
|
|
19
|
+
* @author Navid Mitchell
|
|
20
|
+
* @since 1.8
|
|
21
|
+
*/
|
|
22
|
+
export declare enum NullHandling {
|
|
23
|
+
/**
|
|
24
|
+
* Lets the data store decide what to do with nulls.
|
|
25
|
+
*/
|
|
26
|
+
NATIVE = "NATIVE",
|
|
27
|
+
/**
|
|
28
|
+
* A hint to the used data store to order entries with null values before non-null entries.
|
|
29
|
+
*/
|
|
30
|
+
NULLS_FIRST = "NULLS_FIRST",
|
|
31
|
+
/**
|
|
32
|
+
* A hint to the used data store to order entries with null values after non-null entries.
|
|
33
|
+
*/
|
|
34
|
+
NULLS_LAST = "NULLS_LAST"
|
|
35
|
+
}
|
|
36
|
+
export declare class Order {
|
|
37
|
+
property: string;
|
|
38
|
+
direction: Direction;
|
|
39
|
+
nullHandling: NullHandling;
|
|
40
|
+
constructor(property: string, direction: Direction | null);
|
|
41
|
+
/**
|
|
42
|
+
* Returns whether sorting for this property shall be ascending.
|
|
43
|
+
*/
|
|
44
|
+
isAscending(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether sorting for this property shall be descending.
|
|
47
|
+
*/
|
|
48
|
+
isDescending(): boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Sort option for queries. You have to provide at least a list of properties to sort for that must not include
|
|
52
|
+
* {@literal null} or empty strings. The direction defaults to {@link Sort#DEFAULT_DIRECTION}.
|
|
53
|
+
*
|
|
54
|
+
* Adapted from the Spring Data Commons Package
|
|
55
|
+
*
|
|
56
|
+
* @author Oliver Gierke
|
|
57
|
+
* @author Thomas Darimont
|
|
58
|
+
* @author Mark Paluch
|
|
59
|
+
* @author Navid Mitchell
|
|
60
|
+
*/
|
|
61
|
+
export declare class Sort {
|
|
62
|
+
orders: Order[];
|
|
63
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export all the things
|
|
3
|
+
*/
|
|
4
|
+
export * from './api/ConnectionInfo';
|
|
5
|
+
export * from './api/Continuum';
|
|
6
|
+
export * from './api/ContinuumDecorators';
|
|
7
|
+
export * from './api/Identifiable';
|
|
8
|
+
export * from './api/ILogManager';
|
|
9
|
+
export * from './api/LogManager';
|
|
10
|
+
export * from './api/errors/ContinuumError';
|
|
11
|
+
export * from './api/errors/AuthenticationError';
|
|
12
|
+
export * from './api/errors/AuthorizationError';
|
|
13
|
+
export * from './api/security/ConnectedInfo';
|
|
14
|
+
export * from './api/security/IParticipant';
|
|
15
|
+
export * from './api/security/Participant';
|
|
16
|
+
export * from './api/security/ParticipantConstants';
|
|
17
|
+
export * from './core/api/ContextInterceptor';
|
|
18
|
+
export * from './core/api/CRI';
|
|
19
|
+
export * from './core/api/DefaultCRI';
|
|
20
|
+
export * from './core/api/EventBus';
|
|
21
|
+
export * from './core/api/IEventBus';
|
|
22
|
+
export * from './core/api/IServiceRegistry';
|
|
23
|
+
export * from './core/api/ServiceRegistry';
|
|
24
|
+
export * from './core/api/StreamData';
|
|
25
|
+
export * from './core/api/crud/AbstractIterablePage';
|
|
26
|
+
export * from './core/api/crud/CrudServiceProxy';
|
|
27
|
+
export * from './core/api/crud/CrudServiceProxyFactory';
|
|
28
|
+
export * from './core/api/crud/FunctionalIterablePage';
|
|
29
|
+
export * from './core/api/crud/ICrudServiceProxy';
|
|
30
|
+
export * from './core/api/crud/ICrudServiceProxyFactory';
|
|
31
|
+
export * from './core/api/crud/IDataSource';
|
|
32
|
+
export * from './core/api/crud/IterablePage';
|
|
33
|
+
export * from './core/api/crud/Page';
|
|
34
|
+
export * from './core/api/crud/Pageable';
|
|
35
|
+
export * from './core/api/crud/Sort';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IEvent } from '../../../core/api/IEventBus.js';
|
|
2
|
+
/**
|
|
3
|
+
* Argument resolution utilities for service invocation.
|
|
4
|
+
*
|
|
5
|
+
* @author Navid Mitchell 🤝Grok
|
|
6
|
+
* @since 3/25/2025
|
|
7
|
+
*/
|
|
8
|
+
export interface ArgumentResolver {
|
|
9
|
+
resolveArguments(event: IEvent): any[];
|
|
10
|
+
}
|
|
11
|
+
export declare class JsonArgumentResolver implements ArgumentResolver {
|
|
12
|
+
resolveArguments(event: IEvent): any[];
|
|
13
|
+
protected containsJsonContent(event: IEvent): boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEvent } from '../../../core/api/IEventBus.js';
|
|
2
|
+
/**
|
|
3
|
+
* Utility functions for working with events in the Continuum framework.
|
|
4
|
+
*
|
|
5
|
+
* @author Navid Mitchell 🤝Grok
|
|
6
|
+
* @since 3/25/2025
|
|
7
|
+
*/
|
|
8
|
+
export declare class EventUtil {
|
|
9
|
+
static createReplyEvent(incomingHeaders: Map<string, string>, headers?: Map<string, string>, body?: Uint8Array): IEvent;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logging utilities for the Continuum library.
|
|
3
|
+
*
|
|
4
|
+
* @author Navid Mitchell 🤝Grok
|
|
5
|
+
* @since 3/25/2025
|
|
6
|
+
*/
|
|
7
|
+
export interface Logger {
|
|
8
|
+
trace(message: string, ...args: any[]): void;
|
|
9
|
+
debug(message: string, ...args: any[]): void;
|
|
10
|
+
info(message: string, ...args: any[]): void;
|
|
11
|
+
warn(message: string, ...args: any[]): void;
|
|
12
|
+
error(message: string, ...args: any[]): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class NoOpLogger implements Logger {
|
|
15
|
+
trace(_message: string, ..._args: any[]): void;
|
|
16
|
+
debug(_message: string, ..._args: any[]): void;
|
|
17
|
+
info(_message: string, ..._args: any[]): void;
|
|
18
|
+
warn(_message: string, ..._args: any[]): void;
|
|
19
|
+
error(_message: string, ..._args: any[]): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function createDebugLogger(namespace: string): Logger;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEvent } from '../../../core/api/IEventBus.js';
|
|
2
|
+
/**
|
|
3
|
+
* Return value conversion utilities for service responses.
|
|
4
|
+
*
|
|
5
|
+
* @author Navid Mitchell 🤝Grok
|
|
6
|
+
* @since 3/25/2025
|
|
7
|
+
*/
|
|
8
|
+
export interface ReturnValueConverter {
|
|
9
|
+
convert(incomingMetadata: Map<string, string>, returnValue: any): IEvent;
|
|
10
|
+
}
|
|
11
|
+
export declare class BasicReturnValueConverter implements ReturnValueConverter {
|
|
12
|
+
convert(incomingMetadata: Map<string, string>, returnValue: any): IEvent;
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IEventBus } from '../../../core/api/IEventBus.js';
|
|
2
|
+
import { ServiceIdentifier } from '../../../core/api/ServiceIdentifier.js';
|
|
3
|
+
import { ArgumentResolver } from './ArgumentResolver.js';
|
|
4
|
+
import { ReturnValueConverter } from './ReturnValueConverter.js';
|
|
5
|
+
import { Logger } from './Logger.js';
|
|
6
|
+
import { ContextInterceptor } from '../../../core/api/ContextInterceptor.js';
|
|
7
|
+
/**
|
|
8
|
+
* Handles invoking services registered with Continuum in TypeScript.
|
|
9
|
+
*
|
|
10
|
+
* @author Navid Mitchell 🤝Grok
|
|
11
|
+
* @since 3/25/2025
|
|
12
|
+
*/
|
|
13
|
+
export declare class ServiceInvocationSupervisor {
|
|
14
|
+
private readonly log;
|
|
15
|
+
private active;
|
|
16
|
+
private readonly eventBusService;
|
|
17
|
+
private readonly interceptorProvider;
|
|
18
|
+
private readonly argumentResolver;
|
|
19
|
+
private readonly returnValueConverter;
|
|
20
|
+
private readonly serviceIdentifier;
|
|
21
|
+
private readonly serviceInstance;
|
|
22
|
+
private methodSubscription;
|
|
23
|
+
private readonly methodMap;
|
|
24
|
+
constructor(serviceIdentifier: ServiceIdentifier, serviceInstance: any, eventBusService: IEventBus, interceptorProvider: () => ContextInterceptor<any> | null, options?: {
|
|
25
|
+
logger?: Logger;
|
|
26
|
+
argumentResolver?: ArgumentResolver;
|
|
27
|
+
returnValueConverter?: ReturnValueConverter;
|
|
28
|
+
});
|
|
29
|
+
isActive(): boolean;
|
|
30
|
+
start(): void;
|
|
31
|
+
stop(): void;
|
|
32
|
+
private buildMethodMap;
|
|
33
|
+
private processEvent;
|
|
34
|
+
private processControlPlaneRequest;
|
|
35
|
+
private processInvocationRequest;
|
|
36
|
+
private processMethodInvocationResult;
|
|
37
|
+
private handleException;
|
|
38
|
+
private validateReplyTo;
|
|
39
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Identifiable } from '../../../../api/Identifiable';
|
|
2
|
+
import { AbstractIterablePage } from '../../../../core/api/crud/AbstractIterablePage';
|
|
3
|
+
import { CrudServiceProxy } from '../../../../core/api/crud/CrudServiceProxy';
|
|
4
|
+
import { Page } from '../../../../core/api/crud/Page';
|
|
5
|
+
import { Pageable } from '../../../../core/api/crud/Pageable';
|
|
6
|
+
/**
|
|
7
|
+
* {@link IterablePage} for use when finding all
|
|
8
|
+
*/
|
|
9
|
+
export declare class FindAllIterablePage<T extends Identifiable<string>> extends AbstractIterablePage<T> {
|
|
10
|
+
private readonly crudServiceProxy;
|
|
11
|
+
constructor(pageable: Pageable, page: Page<T>, crudServiceProxy: CrudServiceProxy<T>);
|
|
12
|
+
protected findNext(pageable: Pageable): Promise<Page<T>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Identifiable } from '../../../../api/Identifiable';
|
|
2
|
+
import { AbstractIterablePage } from '../../../../core/api/crud/AbstractIterablePage';
|
|
3
|
+
import { CrudServiceProxy } from '../../../../core/api/crud/CrudServiceProxy';
|
|
4
|
+
import { Page } from '../../../../core/api/crud/Page';
|
|
5
|
+
import { Pageable } from '../../../../core/api/crud/Pageable';
|
|
6
|
+
/**
|
|
7
|
+
* {@link IterablePage} for use when searching
|
|
8
|
+
*/
|
|
9
|
+
export declare class SearchIterablePage<T extends Identifiable<string>> extends AbstractIterablePage<T> {
|
|
10
|
+
private readonly searchText;
|
|
11
|
+
private readonly crudServiceProxy;
|
|
12
|
+
constructor(pageable: Pageable, page: Page<T>, searchText: string, crudServiceProxy: CrudServiceProxy<T>);
|
|
13
|
+
protected findNext(pageable: Pageable): Promise<Page<T>>;
|
|
14
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mindignited/continuum-client",
|
|
3
|
+
"version": "2.14.6",
|
|
4
|
+
"author": "Mind Ignited <develop@mindignited.com>",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/continuum.cjs",
|
|
8
|
+
"module": "./dist/continuum.js",
|
|
9
|
+
"types": "./dist/src/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/src/index.d.ts",
|
|
13
|
+
"import": "./dist/continuum.js",
|
|
14
|
+
"require": "./dist/continuum.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.208.0",
|
|
22
|
+
"@opentelemetry/resources": "^2.2.0",
|
|
23
|
+
"@opentelemetry/sdk-metrics": "^2.2.0",
|
|
24
|
+
"@opentelemetry/sdk-node": "^0.208.0",
|
|
25
|
+
"@opentelemetry/sdk-trace-node": "^2.2.0",
|
|
26
|
+
"@types/node": "^25.0.3",
|
|
27
|
+
"@types/uuid": "^11.0.0",
|
|
28
|
+
"@types/ws": "^8.18.1",
|
|
29
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
30
|
+
"@vitest/runner": "^4.0.16",
|
|
31
|
+
"@vitest/ui": "^4.0.16",
|
|
32
|
+
"allure-vitest": "^3.4.3",
|
|
33
|
+
"properties-file": "^3.6.3",
|
|
34
|
+
"reflect-metadata": "^0.2.2",
|
|
35
|
+
"testcontainers": "^11.11.0",
|
|
36
|
+
"tslib": "^2.8.1",
|
|
37
|
+
"typescript": "^5.9.3",
|
|
38
|
+
"vite": "^7.3.1",
|
|
39
|
+
"vite-plugin-dts": "^4.5.4",
|
|
40
|
+
"vite-plugin-externalize-deps": "^0.10.0",
|
|
41
|
+
"vitest": "^4.0.16",
|
|
42
|
+
"ws": "^8.19.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@opentelemetry/api": "^1.9.0",
|
|
46
|
+
"@opentelemetry/semantic-conventions": "^1.38.0",
|
|
47
|
+
"@stomp/rx-stomp": "^2.3.0",
|
|
48
|
+
"@stomp/stompjs": "^7.2.1",
|
|
49
|
+
"@types/debug": "^4.1.12",
|
|
50
|
+
"debug": "^4.4.3",
|
|
51
|
+
"elliptic": "^6.6.1",
|
|
52
|
+
"p-tap": "^4.0.0",
|
|
53
|
+
"rxjs": "^7.8.2",
|
|
54
|
+
"typescript-optional": "3.0.0-alpha.3",
|
|
55
|
+
"uuid": "^13.0.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"reflect-metadata": "^0.2.2"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsc && vite build",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"coverage": "vitest run --coverage",
|
|
64
|
+
"ui-test": "vitest --ui --coverage.enabled=true --mode development"
|
|
65
|
+
}
|
|
66
|
+
}
|