@kinotic-ai/core 5.0.0-beta.4 → 5.0.0-beta.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/dist/index.d.cts CHANGED
@@ -76,7 +76,7 @@ declare enum SessionKeepAliveMode {
76
76
  * Options for {@link IKinotic#connect}. Every field is optional: absent {@link server}
77
77
  * fields resolve from the environment (the {@code KINOTIC_SERVER_HOST} /
78
78
  * {@code KINOTIC_SERVER_PORT} / {@code KINOTIC_SERVER_USE_SSL} variables, the browser's own
79
- * location, then {@code https://api.kinotic.com}), and absent {@link credentials} resolve
79
+ * location, then {@code https://api.kinotic.ai}), and absent {@link credentials} resolve
80
80
  * through the default {@link ChainedCredentialsResolver} (environment variables, then the
81
81
  * browser session).
82
82
  *
@@ -124,7 +124,7 @@ interface Identifiable<T> {
124
124
  *
125
125
  * This is the base shape every participant shares, regardless of scope, and is what RPC-only
126
126
  * 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/os-api}.
127
+ * of it — see the participant types in {@code @kinotic-ai/management-api}.
128
128
  *
129
129
  * Mirrors the server {@code org.kinotic.core.api.security.Participant}.
130
130
  *
@@ -146,7 +146,7 @@ interface IParticipant extends Identifiable<string> {
146
146
  }
147
147
  /**
148
148
  * A logged-in participant on the RPC layer. Alias of {@link IParticipant}; the Kinotic OS contract
149
- * ({@code @kinotic-ai/os-api}) narrows this to scope-typed participants.
149
+ * ({@code @kinotic-ai/management-api}) narrows this to scope-typed participants.
150
150
  *
151
151
  * Created by Navid Mitchell on 6/2/20
152
152
  */
@@ -159,7 +159,7 @@ declare class ConnectedInfo {
159
159
  participant: Participant;
160
160
  }
161
161
  /**
162
- * Part of the low level portion of kinoitc representing data to be processed
162
+ * Part of the low level portion of kinotic representing data to be processed
163
163
  *
164
164
  * This is similar to a Stomp Frame but with more required information and no control plane semantics.
165
165
  *
@@ -215,7 +215,7 @@ interface IEvent {
215
215
  setHeader(key: string, value: string): void;
216
216
  }
217
217
  /**
218
- * Part of the low level portion of kinoitc representing a connection to a kinoitc server
218
+ * Part of the low level portion of kinotic representing a connection to a kinotic server
219
219
  * This is similar to a Stomp Client but with more required information and no control plane semantics.
220
220
  *
221
221
  * Created by Navid Mitchell on 2019-01-04.
@@ -249,7 +249,7 @@ interface IEventBus {
249
249
  disconnect(force?: boolean): Promise<void>;
250
250
  /**
251
251
  * Determines if the connection is connected.
252
- * This means that there is an open connection to the Kinoitc server
252
+ * This means that there is an open connection to the Kinotic server
253
253
  * @return true if the connection is active false if not
254
254
  */
255
255
  isConnected(): boolean;
@@ -381,9 +381,9 @@ interface ContextInterceptor<T extends ServiceContext> {
381
381
  intercept(event: IEvent, context: T): Promise<T> | T;
382
382
  }
383
383
  /**
384
- * `CRI` is a Kinoitc Resource Identifier used by Kinoitc to route requests appropriately.
384
+ * `CRI` is a Kinotic Resource Identifier used by Kinotic to route requests appropriately.
385
385
  *
386
- * The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinoitc.
386
+ * The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinotic.
387
387
  *
388
388
  * Will be in a format as follows where anything surrounded with `[]` is optional:
389
389
  *
@@ -540,6 +540,12 @@ declare class ServiceIdentifier {
540
540
  * @return the cri for this {@link ServiceIdentifier}
541
541
  */
542
542
  cri(): CRI;
543
+ /**
544
+ * The {@link CRI} of this service's shared, unscoped address. Every instance of a scoped
545
+ * service may listen here for the methods any instance can answer.
546
+ * @return the cri without the scope part
547
+ */
548
+ unscopedCri(): CRI;
543
549
  }
544
550
  import { Observable as Observable2 } from "rxjs";
545
551
  /**
@@ -740,6 +746,19 @@ declare const Kinotic: KinoticSingleton;
740
746
  */
741
747
  declare function Scope(value: Function, _context: ClassGetterDecoratorContext | ClassMethodDecoratorContext): void;
742
748
  /**
749
+ * Marks a method of a scoped published service that any instance may answer, because its
750
+ * result does not depend on which instance executes it - typically a read of shared state
751
+ * rather than of the instance's own.
752
+ *
753
+ * A scoped service normally listens only at its scoped address, so every invocation must name
754
+ * an instance. When at least one method carries ScopeOptional, each instance also listens on
755
+ * the service's shared unscoped address, where only the annotated methods may be invoked: an
756
+ * unscoped invocation of any other method is rejected, since it would execute on whichever
757
+ * instance happened to receive it.
758
+ */
759
+ declare function ScopeOptional(value: Function, _context: ClassMethodDecoratorContext): void;
760
+ declare function scopeOptionalMethodNames(instance: object): Set<string>;
761
+ /**
743
762
  * Sets the semantic version a service registers under.
744
763
  * @param version the version in X.Y.Z[-optional] format
745
764
  */
@@ -1093,6 +1112,16 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
1093
1112
  */
1094
1113
  deleteById(id: string): Promise<void>;
1095
1114
  /**
1115
+ * Deletes the entity with the given id and waits for the deletion to be visible in search
1116
+ * results before returning.
1117
+ * Use this when you need read-your-write consistency immediately after deletion.
1118
+ *
1119
+ * @param id must not be {@literal null}.
1120
+ * @return a {@link Promise} signaling when the deletion is visible to search.
1121
+ * @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
1122
+ */
1123
+ deleteByIdSync(id: string): Promise<void>;
1124
+ /**
1096
1125
  * Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
1097
1126
  *
1098
1127
  * @param pageable the page settings to be used
@@ -1123,6 +1152,7 @@ declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudS
1123
1152
  create(entity: T): Promise<T>;
1124
1153
  createSync(entity: T): Promise<T>;
1125
1154
  deleteById(id: string): Promise<void>;
1155
+ deleteByIdSync(id: string): Promise<void>;
1126
1156
  findAll(pageable: Pageable): Promise<IterablePage<T>>;
1127
1157
  findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
1128
1158
  findById(id: string): Promise<T>;
@@ -1327,4 +1357,4 @@ declare class ParticipantConstants {
1327
1357
  /** The clientId TestSecurityService (clienttest profile) maps to the ANONYMOUS role in core package tests. */
1328
1358
  static readonly CLI_PARTICIPANT_ID: string;
1329
1359
  }
1330
- export { validateZone, validateLabel, receivesContext, isAdvertised, createCRI, buildServerUrl, buildBrokerUrl, Zone, WebSocketFactory, Version, TextEventFactory, Sort, SessionKeepAliveMode, SessionCredentialsResolver, ServiceRegistry, ServiceContext, ServerInfo, Scope, ResolvedCredentials, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticPlugin, Kinotic, JsonEventFactory, IterablePage, Identifiable, IWebSocket, IServiceRegistry, IServiceProxy, IParticipant, IKinotic, IEventFactory, IEventBus, IEvent, IEditableDataSource, IDataSource, ICrudServiceProxyFactory, ICrudServiceProxy, FunctionalIterablePage, EventConstants, EventBus, Event, EnvCredentialsResolver, Direction, DefaultCRI, DataSourceUtils, CursorPageable, CrudServiceProxyFactory, CrudServiceProxy, CredentialsResolver, ContextInterceptor, Context, ConnectedInfo, ConnectOptions, ChainedCredentialsResolver, CRI, BearerCredentialsResolver, BasicCredentialsResolver, AbstractIterablePage };
1360
+ export { validateZone, validateLabel, scopeOptionalMethodNames, receivesContext, isAdvertised, createCRI, buildServerUrl, buildBrokerUrl, Zone, WebSocketFactory, Version, TextEventFactory, Sort, SessionKeepAliveMode, SessionCredentialsResolver, ServiceRegistry, ServiceContext, ServerInfo, ScopeOptional, Scope, ResolvedCredentials, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticPlugin, Kinotic, JsonEventFactory, IterablePage, Identifiable, IWebSocket, IServiceRegistry, IServiceProxy, IParticipant, IKinotic, IEventFactory, IEventBus, IEvent, IEditableDataSource, IDataSource, ICrudServiceProxyFactory, ICrudServiceProxy, FunctionalIterablePage, EventConstants, EventBus, Event, EnvCredentialsResolver, Direction, DefaultCRI, DataSourceUtils, CursorPageable, CrudServiceProxyFactory, CrudServiceProxy, CredentialsResolver, ContextInterceptor, Context, ConnectedInfo, ConnectOptions, ChainedCredentialsResolver, CRI, BearerCredentialsResolver, BasicCredentialsResolver, AbstractIterablePage };
package/dist/index.d.ts CHANGED
@@ -76,7 +76,7 @@ declare enum SessionKeepAliveMode {
76
76
  * Options for {@link IKinotic#connect}. Every field is optional: absent {@link server}
77
77
  * fields resolve from the environment (the {@code KINOTIC_SERVER_HOST} /
78
78
  * {@code KINOTIC_SERVER_PORT} / {@code KINOTIC_SERVER_USE_SSL} variables, the browser's own
79
- * location, then {@code https://api.kinotic.com}), and absent {@link credentials} resolve
79
+ * location, then {@code https://api.kinotic.ai}), and absent {@link credentials} resolve
80
80
  * through the default {@link ChainedCredentialsResolver} (environment variables, then the
81
81
  * browser session).
82
82
  *
@@ -124,7 +124,7 @@ interface Identifiable<T> {
124
124
  *
125
125
  * This is the base shape every participant shares, regardless of scope, and is what RPC-only
126
126
  * 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/os-api}.
127
+ * of it — see the participant types in {@code @kinotic-ai/management-api}.
128
128
  *
129
129
  * Mirrors the server {@code org.kinotic.core.api.security.Participant}.
130
130
  *
@@ -146,7 +146,7 @@ interface IParticipant extends Identifiable<string> {
146
146
  }
147
147
  /**
148
148
  * A logged-in participant on the RPC layer. Alias of {@link IParticipant}; the Kinotic OS contract
149
- * ({@code @kinotic-ai/os-api}) narrows this to scope-typed participants.
149
+ * ({@code @kinotic-ai/management-api}) narrows this to scope-typed participants.
150
150
  *
151
151
  * Created by Navid Mitchell on 6/2/20
152
152
  */
@@ -159,7 +159,7 @@ declare class ConnectedInfo {
159
159
  participant: Participant;
160
160
  }
161
161
  /**
162
- * Part of the low level portion of kinoitc representing data to be processed
162
+ * Part of the low level portion of kinotic representing data to be processed
163
163
  *
164
164
  * This is similar to a Stomp Frame but with more required information and no control plane semantics.
165
165
  *
@@ -215,7 +215,7 @@ interface IEvent {
215
215
  setHeader(key: string, value: string): void;
216
216
  }
217
217
  /**
218
- * Part of the low level portion of kinoitc representing a connection to a kinoitc server
218
+ * Part of the low level portion of kinotic representing a connection to a kinotic server
219
219
  * This is similar to a Stomp Client but with more required information and no control plane semantics.
220
220
  *
221
221
  * Created by Navid Mitchell on 2019-01-04.
@@ -249,7 +249,7 @@ interface IEventBus {
249
249
  disconnect(force?: boolean): Promise<void>;
250
250
  /**
251
251
  * Determines if the connection is connected.
252
- * This means that there is an open connection to the Kinoitc server
252
+ * This means that there is an open connection to the Kinotic server
253
253
  * @return true if the connection is active false if not
254
254
  */
255
255
  isConnected(): boolean;
@@ -381,9 +381,9 @@ interface ContextInterceptor<T extends ServiceContext> {
381
381
  intercept(event: IEvent, context: T): Promise<T> | T;
382
382
  }
383
383
  /**
384
- * `CRI` is a Kinoitc Resource Identifier used by Kinoitc to route requests appropriately.
384
+ * `CRI` is a Kinotic Resource Identifier used by Kinotic to route requests appropriately.
385
385
  *
386
- * The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinoitc.
386
+ * The `CRI` is a URI where the parts are named differently for clarity as to their purpose within Kinotic.
387
387
  *
388
388
  * Will be in a format as follows where anything surrounded with `[]` is optional:
389
389
  *
@@ -540,6 +540,12 @@ declare class ServiceIdentifier {
540
540
  * @return the cri for this {@link ServiceIdentifier}
541
541
  */
542
542
  cri(): CRI;
543
+ /**
544
+ * The {@link CRI} of this service's shared, unscoped address. Every instance of a scoped
545
+ * service may listen here for the methods any instance can answer.
546
+ * @return the cri without the scope part
547
+ */
548
+ unscopedCri(): CRI;
543
549
  }
544
550
  import { Observable as Observable2 } from "rxjs";
545
551
  /**
@@ -740,6 +746,19 @@ declare const Kinotic: KinoticSingleton;
740
746
  */
741
747
  declare function Scope(value: Function, _context: ClassGetterDecoratorContext | ClassMethodDecoratorContext): void;
742
748
  /**
749
+ * Marks a method of a scoped published service that any instance may answer, because its
750
+ * result does not depend on which instance executes it - typically a read of shared state
751
+ * rather than of the instance's own.
752
+ *
753
+ * A scoped service normally listens only at its scoped address, so every invocation must name
754
+ * an instance. When at least one method carries ScopeOptional, each instance also listens on
755
+ * the service's shared unscoped address, where only the annotated methods may be invoked: an
756
+ * unscoped invocation of any other method is rejected, since it would execute on whichever
757
+ * instance happened to receive it.
758
+ */
759
+ declare function ScopeOptional(value: Function, _context: ClassMethodDecoratorContext): void;
760
+ declare function scopeOptionalMethodNames(instance: object): Set<string>;
761
+ /**
743
762
  * Sets the semantic version a service registers under.
744
763
  * @param version the version in X.Y.Z[-optional] format
745
764
  */
@@ -1093,6 +1112,16 @@ interface ICrudServiceProxy<T extends Identifiable<string>> extends IEditableDat
1093
1112
  */
1094
1113
  deleteById(id: string): Promise<void>;
1095
1114
  /**
1115
+ * Deletes the entity with the given id and waits for the deletion to be visible in search
1116
+ * results before returning.
1117
+ * Use this when you need read-your-write consistency immediately after deletion.
1118
+ *
1119
+ * @param id must not be {@literal null}.
1120
+ * @return a {@link Promise} signaling when the deletion is visible to search.
1121
+ * @throws IllegalArgumentException in case the given {@literal identity} is {@literal null}.
1122
+ */
1123
+ deleteByIdSync(id: string): Promise<void>;
1124
+ /**
1096
1125
  * Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
1097
1126
  *
1098
1127
  * @param pageable the page settings to be used
@@ -1123,6 +1152,7 @@ declare class CrudServiceProxy<T extends Identifiable<string>> implements ICrudS
1123
1152
  create(entity: T): Promise<T>;
1124
1153
  createSync(entity: T): Promise<T>;
1125
1154
  deleteById(id: string): Promise<void>;
1155
+ deleteByIdSync(id: string): Promise<void>;
1126
1156
  findAll(pageable: Pageable): Promise<IterablePage<T>>;
1127
1157
  findAllSinglePage(pageable: Pageable): Promise<Page<T>>;
1128
1158
  findById(id: string): Promise<T>;
@@ -1327,4 +1357,4 @@ declare class ParticipantConstants {
1327
1357
  /** The clientId TestSecurityService (clienttest profile) maps to the ANONYMOUS role in core package tests. */
1328
1358
  static readonly CLI_PARTICIPANT_ID: string;
1329
1359
  }
1330
- export { validateZone, validateLabel, receivesContext, isAdvertised, createCRI, buildServerUrl, buildBrokerUrl, Zone, WebSocketFactory, Version, TextEventFactory, Sort, SessionKeepAliveMode, SessionCredentialsResolver, ServiceRegistry, ServiceContext, ServerInfo, Scope, ResolvedCredentials, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticPlugin, Kinotic, JsonEventFactory, IterablePage, Identifiable, IWebSocket, IServiceRegistry, IServiceProxy, IParticipant, IKinotic, IEventFactory, IEventBus, IEvent, IEditableDataSource, IDataSource, ICrudServiceProxyFactory, ICrudServiceProxy, FunctionalIterablePage, EventConstants, EventBus, Event, EnvCredentialsResolver, Direction, DefaultCRI, DataSourceUtils, CursorPageable, CrudServiceProxyFactory, CrudServiceProxy, CredentialsResolver, ContextInterceptor, Context, ConnectedInfo, ConnectOptions, ChainedCredentialsResolver, CRI, BearerCredentialsResolver, BasicCredentialsResolver, AbstractIterablePage };
1360
+ export { validateZone, validateLabel, scopeOptionalMethodNames, receivesContext, isAdvertised, createCRI, buildServerUrl, buildBrokerUrl, Zone, WebSocketFactory, Version, TextEventFactory, Sort, SessionKeepAliveMode, SessionCredentialsResolver, ServiceRegistry, ServiceContext, ServerInfo, ScopeOptional, Scope, ResolvedCredentials, Publish, ParticipantConstants, Participant, Pageable, Page, Order, OffsetPageable, NullHandling, KinoticSingleton, KinoticPlugin, Kinotic, JsonEventFactory, IterablePage, Identifiable, IWebSocket, IServiceRegistry, IServiceProxy, IParticipant, IKinotic, IEventFactory, IEventBus, IEvent, IEditableDataSource, IDataSource, ICrudServiceProxyFactory, ICrudServiceProxy, FunctionalIterablePage, EventConstants, EventBus, Event, EnvCredentialsResolver, Direction, DefaultCRI, DataSourceUtils, CursorPageable, CrudServiceProxyFactory, CrudServiceProxy, CredentialsResolver, ContextInterceptor, Context, ConnectedInfo, ConnectOptions, ChainedCredentialsResolver, CRI, BearerCredentialsResolver, BasicCredentialsResolver, AbstractIterablePage };