@kinotic-ai/core 1.0.0-beta.0 → 1.0.0-beta.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/README.md +62 -0
- package/dist/index.cjs +189 -280
- package/dist/index.d.cts +446 -517
- package/dist/index.d.ts +446 -517
- package/dist/index.js +189 -280
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1061,14 +1061,10 @@ var require_Reflect = __commonJS(() => {
|
|
|
1061
1061
|
// packages/core/src/index.ts
|
|
1062
1062
|
var exports_src = {};
|
|
1063
1063
|
__export(exports_src, {
|
|
1064
|
-
logManager: () => logManager,
|
|
1065
1064
|
createCRI: () => createCRI,
|
|
1066
1065
|
Version: () => Version,
|
|
1067
1066
|
TextEventFactory: () => TextEventFactory,
|
|
1068
|
-
StreamOperation: () => StreamOperation,
|
|
1069
|
-
StreamData: () => StreamData,
|
|
1070
1067
|
Sort: () => Sort,
|
|
1071
|
-
SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
|
|
1072
1068
|
ServiceRegistry: () => ServiceRegistry,
|
|
1073
1069
|
ServerInfo: () => ServerInfo,
|
|
1074
1070
|
Scope: () => Scope,
|
|
@@ -1079,15 +1075,10 @@ __export(exports_src, {
|
|
|
1079
1075
|
Order: () => Order,
|
|
1080
1076
|
OffsetPageable: () => OffsetPageable,
|
|
1081
1077
|
NullHandling: () => NullHandling,
|
|
1082
|
-
LoggersDescriptor: () => LoggersDescriptor,
|
|
1083
|
-
LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
|
|
1084
|
-
LogManager: () => LogManager,
|
|
1085
|
-
LogLevel: () => LogLevel,
|
|
1086
1078
|
KinoticSingleton: () => KinoticSingleton,
|
|
1087
1079
|
KinoticError: () => KinoticError,
|
|
1088
1080
|
Kinotic: () => Kinotic,
|
|
1089
1081
|
JsonEventFactory: () => JsonEventFactory,
|
|
1090
|
-
GroupLoggerLevelsDescriptor: () => GroupLoggerLevelsDescriptor,
|
|
1091
1082
|
FunctionalIterablePage: () => FunctionalIterablePage,
|
|
1092
1083
|
EventConstants: () => EventConstants,
|
|
1093
1084
|
EventBus: () => EventBus,
|
|
@@ -1124,150 +1115,6 @@ class ConnectionInfo extends ServerInfo {
|
|
|
1124
1115
|
maxConnectionAttempts;
|
|
1125
1116
|
disableStickySession;
|
|
1126
1117
|
}
|
|
1127
|
-
// packages/core/src/core/api/crud/AbstractIterablePage.ts
|
|
1128
|
-
class AbstractIterablePage {
|
|
1129
|
-
pageable;
|
|
1130
|
-
currentPage;
|
|
1131
|
-
firstPage = true;
|
|
1132
|
-
constructor(pageable, page) {
|
|
1133
|
-
this.pageable = pageable;
|
|
1134
|
-
this.currentPage = page;
|
|
1135
|
-
}
|
|
1136
|
-
async next() {
|
|
1137
|
-
let ret;
|
|
1138
|
-
if (this.firstPage) {
|
|
1139
|
-
this.firstPage = false;
|
|
1140
|
-
ret = { done: !this.hasContent(), value: this };
|
|
1141
|
-
} else {
|
|
1142
|
-
if (this.isOffsetPageable()) {
|
|
1143
|
-
const offsetPageable = this.pageable;
|
|
1144
|
-
offsetPageable.pageNumber++;
|
|
1145
|
-
const numPages = Math.ceil(this.totalElements / this.pageable.pageSize);
|
|
1146
|
-
if (offsetPageable.pageNumber < numPages) {
|
|
1147
|
-
this.currentPage = await this.findNext(this.pageable);
|
|
1148
|
-
ret = { done: false, value: this };
|
|
1149
|
-
} else {
|
|
1150
|
-
ret = { done: true, value: this };
|
|
1151
|
-
}
|
|
1152
|
-
} else {
|
|
1153
|
-
const cursorPageable = this.pageable;
|
|
1154
|
-
cursorPageable.cursor = this.currentPage.cursor || null;
|
|
1155
|
-
this.currentPage = await this.findNext(this.pageable);
|
|
1156
|
-
ret = { done: this.isLastPage(), value: this };
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
return ret;
|
|
1160
|
-
}
|
|
1161
|
-
[Symbol.asyncIterator]() {
|
|
1162
|
-
return this;
|
|
1163
|
-
}
|
|
1164
|
-
hasContent() {
|
|
1165
|
-
return this.currentPage.content !== null && this.currentPage.content !== undefined && this.currentPage.content.length > 0;
|
|
1166
|
-
}
|
|
1167
|
-
isLastPage() {
|
|
1168
|
-
let ret;
|
|
1169
|
-
if (this.isOffsetPageable()) {
|
|
1170
|
-
const numPages = Math.ceil(this.totalElements / this.pageable.pageSize);
|
|
1171
|
-
ret = numPages === this.pageable.pageNumber + 1;
|
|
1172
|
-
} else {
|
|
1173
|
-
ret = !this.firstPage && this.currentPage.cursor === null;
|
|
1174
|
-
}
|
|
1175
|
-
return ret;
|
|
1176
|
-
}
|
|
1177
|
-
isOffsetPageable() {
|
|
1178
|
-
return this.pageable.pageNumber !== undefined;
|
|
1179
|
-
}
|
|
1180
|
-
get totalElements() {
|
|
1181
|
-
return this.currentPage.totalElements;
|
|
1182
|
-
}
|
|
1183
|
-
get cursor() {
|
|
1184
|
-
return this.currentPage.cursor;
|
|
1185
|
-
}
|
|
1186
|
-
get content() {
|
|
1187
|
-
return this.currentPage.content;
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
// packages/core/src/internal/core/api/crud/FindAllIterablePage.ts
|
|
1192
|
-
class FindAllIterablePage extends AbstractIterablePage {
|
|
1193
|
-
crudServiceProxy;
|
|
1194
|
-
constructor(pageable, page, crudServiceProxy) {
|
|
1195
|
-
super(pageable, page);
|
|
1196
|
-
this.crudServiceProxy = crudServiceProxy;
|
|
1197
|
-
}
|
|
1198
|
-
findNext(pageable) {
|
|
1199
|
-
return this.crudServiceProxy.findAllSinglePage(pageable);
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
// packages/core/src/internal/core/api/crud/SearchIterablePage.ts
|
|
1204
|
-
class SearchIterablePage extends AbstractIterablePage {
|
|
1205
|
-
searchText;
|
|
1206
|
-
crudServiceProxy;
|
|
1207
|
-
constructor(pageable, page, searchText, crudServiceProxy) {
|
|
1208
|
-
super(pageable, page);
|
|
1209
|
-
this.searchText = searchText;
|
|
1210
|
-
this.crudServiceProxy = crudServiceProxy;
|
|
1211
|
-
}
|
|
1212
|
-
findNext(pageable) {
|
|
1213
|
-
return this.crudServiceProxy.searchSinglePage(this.searchText, pageable);
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
// packages/core/src/core/api/crud/CrudServiceProxy.ts
|
|
1218
|
-
class CrudServiceProxy {
|
|
1219
|
-
serviceProxy;
|
|
1220
|
-
constructor(serviceProxy) {
|
|
1221
|
-
this.serviceProxy = serviceProxy;
|
|
1222
|
-
}
|
|
1223
|
-
count() {
|
|
1224
|
-
return this.serviceProxy.invoke("count");
|
|
1225
|
-
}
|
|
1226
|
-
create(entity) {
|
|
1227
|
-
return this.serviceProxy.invoke("create", [entity]);
|
|
1228
|
-
}
|
|
1229
|
-
deleteById(id) {
|
|
1230
|
-
return this.serviceProxy.invoke("deleteById", [id]);
|
|
1231
|
-
}
|
|
1232
|
-
async findAll(pageable) {
|
|
1233
|
-
const page = await this.findAllSinglePage(pageable);
|
|
1234
|
-
return new FindAllIterablePage(pageable, page, this);
|
|
1235
|
-
}
|
|
1236
|
-
findAllSinglePage(pageable) {
|
|
1237
|
-
return this.serviceProxy.invoke("findAll", [pageable]);
|
|
1238
|
-
}
|
|
1239
|
-
findById(id) {
|
|
1240
|
-
return this.serviceProxy.invoke("findById", [id]);
|
|
1241
|
-
}
|
|
1242
|
-
save(entity) {
|
|
1243
|
-
return this.serviceProxy.invoke("save", [entity]);
|
|
1244
|
-
}
|
|
1245
|
-
findByIdNotIn(ids, page) {
|
|
1246
|
-
return this.serviceProxy.invoke("findByIdNotIn", [ids, page]);
|
|
1247
|
-
}
|
|
1248
|
-
async search(searchText, pageable) {
|
|
1249
|
-
const page = await this.searchSinglePage(searchText, pageable);
|
|
1250
|
-
return new SearchIterablePage(pageable, page, searchText, this);
|
|
1251
|
-
}
|
|
1252
|
-
searchSinglePage(searchText, pageable) {
|
|
1253
|
-
return this.serviceProxy.invoke("search", [searchText, pageable]);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
// packages/core/src/core/api/crud/CrudServiceProxyFactory.ts
|
|
1258
|
-
class CrudServiceProxyFactory {
|
|
1259
|
-
serviceRegistry;
|
|
1260
|
-
constructor(serviceRegistry) {
|
|
1261
|
-
this.serviceRegistry = serviceRegistry;
|
|
1262
|
-
}
|
|
1263
|
-
crudServiceProxy(serviceIdentifier) {
|
|
1264
|
-
if (typeof serviceIdentifier === "undefined" || serviceIdentifier.length === 0) {
|
|
1265
|
-
throw new Error("The serviceIdentifier provided must contain a value");
|
|
1266
|
-
}
|
|
1267
|
-
return new CrudServiceProxy(this.serviceRegistry.serviceProxy(serviceIdentifier));
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
1118
|
// packages/core/src/api/errors/KinoticError.ts
|
|
1272
1119
|
class KinoticError extends Error {
|
|
1273
1120
|
constructor(message) {
|
|
@@ -1276,7 +1123,7 @@ class KinoticError extends Error {
|
|
|
1276
1123
|
}
|
|
1277
1124
|
}
|
|
1278
1125
|
|
|
1279
|
-
// packages/core/src/
|
|
1126
|
+
// packages/core/src/api/event/IEventBus.ts
|
|
1280
1127
|
var EventConstants;
|
|
1281
1128
|
((EventConstants2) => {
|
|
1282
1129
|
EventConstants2["CONTENT_TYPE_HEADER"] = "content-type";
|
|
@@ -1304,7 +1151,7 @@ var EventConstants;
|
|
|
1304
1151
|
EventConstants2["TRACESTATE_HEADER"] = "tracestate";
|
|
1305
1152
|
})(EventConstants ||= {});
|
|
1306
1153
|
|
|
1307
|
-
// packages/core/src/
|
|
1154
|
+
// packages/core/src/internal/api/event/StompConnectionManager.ts
|
|
1308
1155
|
var import_rx_stomp = require("@stomp/rx-stomp");
|
|
1309
1156
|
var import_stompjs = require("@stomp/stompjs");
|
|
1310
1157
|
var import_uuid = require("uuid");
|
|
@@ -1471,7 +1318,7 @@ class StompConnectionManager {
|
|
|
1471
1318
|
}
|
|
1472
1319
|
}
|
|
1473
1320
|
|
|
1474
|
-
// packages/core/src/
|
|
1321
|
+
// packages/core/src/api/event/EventBus.ts
|
|
1475
1322
|
var import_api = require("@opentelemetry/api");
|
|
1476
1323
|
var import_rxjs = require("rxjs");
|
|
1477
1324
|
var import_operators = require("rxjs/operators");
|
|
@@ -1688,10 +1535,10 @@ class EventBus {
|
|
|
1688
1535
|
}
|
|
1689
1536
|
}
|
|
1690
1537
|
|
|
1691
|
-
// packages/core/src/
|
|
1538
|
+
// packages/core/src/api/ServiceRegistry.ts
|
|
1692
1539
|
var import_debug2 = __toESM(require("debug"));
|
|
1693
1540
|
|
|
1694
|
-
// packages/core/src/
|
|
1541
|
+
// packages/core/src/api/event/DefaultCRI.ts
|
|
1695
1542
|
class DefaultCRI {
|
|
1696
1543
|
_scheme;
|
|
1697
1544
|
_scope;
|
|
@@ -1808,7 +1655,7 @@ class DefaultCRI {
|
|
|
1808
1655
|
}
|
|
1809
1656
|
}
|
|
1810
1657
|
|
|
1811
|
-
// packages/core/src/
|
|
1658
|
+
// packages/core/src/api/event/CRI.ts
|
|
1812
1659
|
function createCRI(...args) {
|
|
1813
1660
|
if (args.length === 1)
|
|
1814
1661
|
return new DefaultCRI(args[0]);
|
|
@@ -1821,7 +1668,7 @@ function createCRI(...args) {
|
|
|
1821
1668
|
throw new Error("Invalid arguments for createCRI");
|
|
1822
1669
|
}
|
|
1823
1670
|
|
|
1824
|
-
// packages/core/src/internal/
|
|
1671
|
+
// packages/core/src/internal/api/ArgumentResolver.ts
|
|
1825
1672
|
class JsonArgumentResolver {
|
|
1826
1673
|
resolveArguments(event) {
|
|
1827
1674
|
if (this.containsJsonContent(event)) {
|
|
@@ -1837,7 +1684,7 @@ class JsonArgumentResolver {
|
|
|
1837
1684
|
}
|
|
1838
1685
|
}
|
|
1839
1686
|
|
|
1840
|
-
// packages/core/src/internal/
|
|
1687
|
+
// packages/core/src/internal/api/EventUtil.ts
|
|
1841
1688
|
class EventUtil {
|
|
1842
1689
|
static createReplyEvent(incomingHeaders, headers, body) {
|
|
1843
1690
|
if (!incomingHeaders) {
|
|
@@ -1862,14 +1709,14 @@ class EventUtil {
|
|
|
1862
1709
|
}
|
|
1863
1710
|
}
|
|
1864
1711
|
|
|
1865
|
-
// packages/core/src/internal/
|
|
1712
|
+
// packages/core/src/internal/api/ReturnValueConverter.ts
|
|
1866
1713
|
class BasicReturnValueConverter {
|
|
1867
1714
|
convert(incomingMetadata, returnValue) {
|
|
1868
1715
|
return EventUtil.createReplyEvent(incomingMetadata, new Map([["content-type" /* CONTENT_TYPE_HEADER */, "application/json"]]), new TextEncoder().encode(JSON.stringify(returnValue)));
|
|
1869
1716
|
}
|
|
1870
1717
|
}
|
|
1871
1718
|
|
|
1872
|
-
// packages/core/src/internal/
|
|
1719
|
+
// packages/core/src/internal/api/Logger.ts
|
|
1873
1720
|
function createDebugLogger(namespace) {
|
|
1874
1721
|
let debug2;
|
|
1875
1722
|
try {
|
|
@@ -1889,7 +1736,7 @@ function createDebugLogger(namespace) {
|
|
|
1889
1736
|
// packages/core/src/api/KinoticDecorators.ts
|
|
1890
1737
|
var import_reflect_metadata = __toESM(require_Reflect(), 1);
|
|
1891
1738
|
|
|
1892
|
-
// packages/core/src/
|
|
1739
|
+
// packages/core/src/api/ServiceIdentifier.ts
|
|
1893
1740
|
class ServiceIdentifier {
|
|
1894
1741
|
namespace;
|
|
1895
1742
|
name;
|
|
@@ -1956,7 +1803,7 @@ function Publish(namespace, name) {
|
|
|
1956
1803
|
};
|
|
1957
1804
|
}
|
|
1958
1805
|
|
|
1959
|
-
// packages/core/src/internal/
|
|
1806
|
+
// packages/core/src/internal/api/ServiceInvocationSupervisor.ts
|
|
1960
1807
|
class ServiceInvocationSupervisor {
|
|
1961
1808
|
log;
|
|
1962
1809
|
active = false;
|
|
@@ -2136,7 +1983,7 @@ class ServiceInvocationSupervisor {
|
|
|
2136
1983
|
}
|
|
2137
1984
|
}
|
|
2138
1985
|
|
|
2139
|
-
// packages/core/src/
|
|
1986
|
+
// packages/core/src/api/ServiceRegistry.ts
|
|
2140
1987
|
var import_api2 = __toESM(require("@opentelemetry/api"));
|
|
2141
1988
|
var import_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
2142
1989
|
var import_operators2 = require("rxjs/operators");
|
|
@@ -2144,7 +1991,6 @@ var import_operators2 = require("rxjs/operators");
|
|
|
2144
1991
|
var package_default = {
|
|
2145
1992
|
name: "@kinotic-ai/core",
|
|
2146
1993
|
description: "Kinotic Core",
|
|
2147
|
-
version: "1.0.0-beta.0",
|
|
2148
1994
|
type: "module",
|
|
2149
1995
|
files: [
|
|
2150
1996
|
"dist"
|
|
@@ -2217,7 +2063,7 @@ var package_default = {
|
|
|
2217
2063
|
}
|
|
2218
2064
|
};
|
|
2219
2065
|
|
|
2220
|
-
// packages/core/src/
|
|
2066
|
+
// packages/core/src/api/ServiceRegistry.ts
|
|
2221
2067
|
class JsonEventFactory {
|
|
2222
2068
|
create(cri, args) {
|
|
2223
2069
|
const event = new Event(cri);
|
|
@@ -2366,11 +2212,9 @@ class ServiceProxy {
|
|
|
2366
2212
|
class KinoticSingleton {
|
|
2367
2213
|
_eventBus;
|
|
2368
2214
|
serviceRegistry;
|
|
2369
|
-
crudServiceProxyFactory;
|
|
2370
2215
|
constructor() {
|
|
2371
2216
|
this._eventBus = new EventBus;
|
|
2372
2217
|
this.serviceRegistry = new ServiceRegistry(this._eventBus);
|
|
2373
|
-
this.crudServiceProxyFactory = new CrudServiceProxyFactory(this.serviceRegistry);
|
|
2374
2218
|
}
|
|
2375
2219
|
get eventBus() {
|
|
2376
2220
|
return this._eventBus;
|
|
@@ -2388,131 +2232,154 @@ class KinoticSingleton {
|
|
|
2388
2232
|
serviceProxy(serviceIdentifier) {
|
|
2389
2233
|
return this.serviceRegistry.serviceProxy(serviceIdentifier);
|
|
2390
2234
|
}
|
|
2391
|
-
|
|
2392
|
-
|
|
2235
|
+
use(plugin) {
|
|
2236
|
+
const extension = plugin.install(this);
|
|
2237
|
+
return Object.assign(this, extension);
|
|
2393
2238
|
}
|
|
2394
2239
|
}
|
|
2395
2240
|
var Kinotic = new KinoticSingleton;
|
|
2396
|
-
// packages/core/src/api/
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
}
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
ret =
|
|
2241
|
+
// packages/core/src/api/crud/AbstractIterablePage.ts
|
|
2242
|
+
class AbstractIterablePage {
|
|
2243
|
+
pageable;
|
|
2244
|
+
currentPage;
|
|
2245
|
+
firstPage = true;
|
|
2246
|
+
constructor(pageable, page) {
|
|
2247
|
+
this.pageable = pageable;
|
|
2248
|
+
this.currentPage = page;
|
|
2249
|
+
}
|
|
2250
|
+
async next() {
|
|
2251
|
+
let ret;
|
|
2252
|
+
if (this.firstPage) {
|
|
2253
|
+
this.firstPage = false;
|
|
2254
|
+
ret = { done: !this.hasContent(), value: this };
|
|
2255
|
+
} else {
|
|
2256
|
+
if (this.isOffsetPageable()) {
|
|
2257
|
+
const offsetPageable = this.pageable;
|
|
2258
|
+
offsetPageable.pageNumber++;
|
|
2259
|
+
const numPages = Math.ceil(this.totalElements / this.pageable.pageSize);
|
|
2260
|
+
if (offsetPageable.pageNumber < numPages) {
|
|
2261
|
+
this.currentPage = await this.findNext(this.pageable);
|
|
2262
|
+
ret = { done: false, value: this };
|
|
2263
|
+
} else {
|
|
2264
|
+
ret = { done: true, value: this };
|
|
2265
|
+
}
|
|
2266
|
+
} else {
|
|
2267
|
+
const cursorPageable = this.pageable;
|
|
2268
|
+
cursorPageable.cursor = this.currentPage.cursor || null;
|
|
2269
|
+
this.currentPage = await this.findNext(this.pageable);
|
|
2270
|
+
ret = { done: this.isLastPage(), value: this };
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
return ret;
|
|
2274
|
+
}
|
|
2275
|
+
[Symbol.asyncIterator]() {
|
|
2276
|
+
return this;
|
|
2277
|
+
}
|
|
2278
|
+
hasContent() {
|
|
2279
|
+
return this.currentPage.content !== null && this.currentPage.content !== undefined && this.currentPage.content.length > 0;
|
|
2280
|
+
}
|
|
2281
|
+
isLastPage() {
|
|
2282
|
+
let ret;
|
|
2283
|
+
if (this.isOffsetPageable()) {
|
|
2284
|
+
const numPages = Math.ceil(this.totalElements / this.pageable.pageSize);
|
|
2285
|
+
ret = numPages === this.pageable.pageNumber + 1;
|
|
2441
2286
|
} else {
|
|
2442
|
-
ret =
|
|
2287
|
+
ret = !this.firstPage && this.currentPage.cursor === null;
|
|
2443
2288
|
}
|
|
2444
|
-
Object.assign(ret, data);
|
|
2445
2289
|
return ret;
|
|
2446
2290
|
}
|
|
2447
|
-
|
|
2448
|
-
return this.
|
|
2291
|
+
isOffsetPageable() {
|
|
2292
|
+
return this.pageable.pageNumber !== undefined;
|
|
2449
2293
|
}
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
// packages/core/src/api/errors/AuthenticationError.ts
|
|
2453
|
-
class AuthenticationError extends KinoticError {
|
|
2454
|
-
constructor(message) {
|
|
2455
|
-
super(message);
|
|
2456
|
-
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
2294
|
+
get totalElements() {
|
|
2295
|
+
return this.currentPage.totalElements;
|
|
2457
2296
|
}
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
Object.setPrototypeOf(this, AuthorizationError.prototype);
|
|
2297
|
+
get cursor() {
|
|
2298
|
+
return this.currentPage.cursor;
|
|
2299
|
+
}
|
|
2300
|
+
get content() {
|
|
2301
|
+
return this.currentPage.content;
|
|
2464
2302
|
}
|
|
2465
2303
|
}
|
|
2466
|
-
// packages/core/src/api/
|
|
2467
|
-
class
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
tenantId;
|
|
2476
|
-
metadata;
|
|
2477
|
-
roles;
|
|
2478
|
-
constructor(id, tenantId, metadata, roles) {
|
|
2479
|
-
this.id = id;
|
|
2480
|
-
this.tenantId = tenantId;
|
|
2481
|
-
this.metadata = metadata || new Map;
|
|
2482
|
-
this.roles = roles || [];
|
|
2304
|
+
// packages/core/src/internal/api/crud/FindAllIterablePage.ts
|
|
2305
|
+
class FindAllIterablePage extends AbstractIterablePage {
|
|
2306
|
+
crudServiceProxy;
|
|
2307
|
+
constructor(pageable, page, crudServiceProxy) {
|
|
2308
|
+
super(pageable, page);
|
|
2309
|
+
this.crudServiceProxy = crudServiceProxy;
|
|
2310
|
+
}
|
|
2311
|
+
findNext(pageable) {
|
|
2312
|
+
return this.crudServiceProxy.findAllSinglePage(pageable);
|
|
2483
2313
|
}
|
|
2484
2314
|
}
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2315
|
+
|
|
2316
|
+
// packages/core/src/internal/api/crud/SearchIterablePage.ts
|
|
2317
|
+
class SearchIterablePage extends AbstractIterablePage {
|
|
2318
|
+
searchText;
|
|
2319
|
+
crudServiceProxy;
|
|
2320
|
+
constructor(pageable, page, searchText, crudServiceProxy) {
|
|
2321
|
+
super(pageable, page);
|
|
2322
|
+
this.searchText = searchText;
|
|
2323
|
+
this.crudServiceProxy = crudServiceProxy;
|
|
2324
|
+
}
|
|
2325
|
+
findNext(pageable) {
|
|
2326
|
+
return this.crudServiceProxy.searchSinglePage(this.searchText, pageable);
|
|
2327
|
+
}
|
|
2493
2328
|
}
|
|
2494
|
-
// packages/core/src/core/api/StreamData.ts
|
|
2495
|
-
var StreamOperation;
|
|
2496
|
-
((StreamOperation2) => {
|
|
2497
|
-
StreamOperation2["EXISTING"] = "EXISTING";
|
|
2498
|
-
StreamOperation2["UPDATE"] = "UPDATE";
|
|
2499
|
-
StreamOperation2["REMOVE"] = "REMOVE";
|
|
2500
|
-
})(StreamOperation ||= {});
|
|
2501
2329
|
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
this.
|
|
2330
|
+
// packages/core/src/api/crud/CrudServiceProxy.ts
|
|
2331
|
+
class CrudServiceProxy {
|
|
2332
|
+
serviceProxy;
|
|
2333
|
+
constructor(serviceProxy) {
|
|
2334
|
+
this.serviceProxy = serviceProxy;
|
|
2335
|
+
}
|
|
2336
|
+
count() {
|
|
2337
|
+
return this.serviceProxy.invoke("count");
|
|
2338
|
+
}
|
|
2339
|
+
create(entity) {
|
|
2340
|
+
return this.serviceProxy.invoke("create", [entity]);
|
|
2341
|
+
}
|
|
2342
|
+
deleteById(id) {
|
|
2343
|
+
return this.serviceProxy.invoke("deleteById", [id]);
|
|
2344
|
+
}
|
|
2345
|
+
async findAll(pageable) {
|
|
2346
|
+
const page = await this.findAllSinglePage(pageable);
|
|
2347
|
+
return new FindAllIterablePage(pageable, page, this);
|
|
2348
|
+
}
|
|
2349
|
+
findAllSinglePage(pageable) {
|
|
2350
|
+
return this.serviceProxy.invoke("findAll", [pageable]);
|
|
2351
|
+
}
|
|
2352
|
+
findById(id) {
|
|
2353
|
+
return this.serviceProxy.invoke("findById", [id]);
|
|
2510
2354
|
}
|
|
2511
|
-
|
|
2512
|
-
return this.
|
|
2355
|
+
save(entity) {
|
|
2356
|
+
return this.serviceProxy.invoke("save", [entity]);
|
|
2357
|
+
}
|
|
2358
|
+
findByIdNotIn(ids, page) {
|
|
2359
|
+
return this.serviceProxy.invoke("findByIdNotIn", [ids, page]);
|
|
2360
|
+
}
|
|
2361
|
+
async search(searchText, pageable) {
|
|
2362
|
+
const page = await this.searchSinglePage(searchText, pageable);
|
|
2363
|
+
return new SearchIterablePage(pageable, page, searchText, this);
|
|
2364
|
+
}
|
|
2365
|
+
searchSinglePage(searchText, pageable) {
|
|
2366
|
+
return this.serviceProxy.invoke("search", [searchText, pageable]);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
// packages/core/src/api/crud/CrudServiceProxyFactory.ts
|
|
2370
|
+
class CrudServiceProxyFactory {
|
|
2371
|
+
serviceRegistry;
|
|
2372
|
+
constructor(serviceRegistry) {
|
|
2373
|
+
this.serviceRegistry = serviceRegistry;
|
|
2374
|
+
}
|
|
2375
|
+
crudServiceProxy(serviceIdentifier) {
|
|
2376
|
+
if (typeof serviceIdentifier === "undefined" || serviceIdentifier.length === 0) {
|
|
2377
|
+
throw new Error("The serviceIdentifier provided must contain a value");
|
|
2378
|
+
}
|
|
2379
|
+
return new CrudServiceProxy(this.serviceRegistry.serviceProxy(serviceIdentifier));
|
|
2513
2380
|
}
|
|
2514
2381
|
}
|
|
2515
|
-
// packages/core/src/
|
|
2382
|
+
// packages/core/src/api/crud/FunctionalIterablePage.ts
|
|
2516
2383
|
class FunctionalIterablePage extends AbstractIterablePage {
|
|
2517
2384
|
pageFunction;
|
|
2518
2385
|
constructor(pageable, page, pageFunction) {
|
|
@@ -2523,13 +2390,13 @@ class FunctionalIterablePage extends AbstractIterablePage {
|
|
|
2523
2390
|
return this.pageFunction(pageable);
|
|
2524
2391
|
}
|
|
2525
2392
|
}
|
|
2526
|
-
// packages/core/src/
|
|
2393
|
+
// packages/core/src/api/crud/IDataSource.ts
|
|
2527
2394
|
class DataSourceUtils {
|
|
2528
2395
|
static instanceOfEditableDataSource(datasource) {
|
|
2529
2396
|
return "create" in datasource;
|
|
2530
2397
|
}
|
|
2531
2398
|
}
|
|
2532
|
-
// packages/core/src/
|
|
2399
|
+
// packages/core/src/api/crud/Pageable.ts
|
|
2533
2400
|
class Pageable {
|
|
2534
2401
|
sort = null;
|
|
2535
2402
|
pageSize = 25;
|
|
@@ -2560,7 +2427,7 @@ class CursorPageable extends Pageable {
|
|
|
2560
2427
|
this.sort = sort;
|
|
2561
2428
|
}
|
|
2562
2429
|
}
|
|
2563
|
-
// packages/core/src/
|
|
2430
|
+
// packages/core/src/api/crud/Sort.ts
|
|
2564
2431
|
var Direction;
|
|
2565
2432
|
((Direction2) => {
|
|
2566
2433
|
Direction2["ASC"] = "ASC";
|
|
@@ -2594,3 +2461,45 @@ class Order {
|
|
|
2594
2461
|
class Sort {
|
|
2595
2462
|
orders = [];
|
|
2596
2463
|
}
|
|
2464
|
+
// packages/core/src/api/errors/AuthenticationError.ts
|
|
2465
|
+
class AuthenticationError extends KinoticError {
|
|
2466
|
+
constructor(message) {
|
|
2467
|
+
super(message);
|
|
2468
|
+
Object.setPrototypeOf(this, AuthenticationError.prototype);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
// packages/core/src/api/errors/AuthorizationError.ts
|
|
2472
|
+
class AuthorizationError extends KinoticError {
|
|
2473
|
+
constructor(message) {
|
|
2474
|
+
super(message);
|
|
2475
|
+
Object.setPrototypeOf(this, AuthorizationError.prototype);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
// packages/core/src/api/security/ConnectedInfo.ts
|
|
2479
|
+
class ConnectedInfo {
|
|
2480
|
+
sessionId;
|
|
2481
|
+
replyToId;
|
|
2482
|
+
participant;
|
|
2483
|
+
}
|
|
2484
|
+
// packages/core/src/api/security/Participant.ts
|
|
2485
|
+
class Participant {
|
|
2486
|
+
id;
|
|
2487
|
+
tenantId;
|
|
2488
|
+
metadata;
|
|
2489
|
+
roles;
|
|
2490
|
+
constructor(id, tenantId, metadata, roles) {
|
|
2491
|
+
this.id = id;
|
|
2492
|
+
this.tenantId = tenantId;
|
|
2493
|
+
this.metadata = metadata || new Map;
|
|
2494
|
+
this.roles = roles || [];
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
// packages/core/src/api/security/ParticipantConstants.ts
|
|
2498
|
+
class ParticipantConstants {
|
|
2499
|
+
static PARTICIPANT_TYPE_METADATA_KEY = "type";
|
|
2500
|
+
static PARTICIPANT_TYPE_DEVICE = "device";
|
|
2501
|
+
static PARTICIPANT_TYPE_CLI = "cli";
|
|
2502
|
+
static PARTICIPANT_TYPE_USER = "user";
|
|
2503
|
+
static PARTICIPANT_TYPE_NODE = "node";
|
|
2504
|
+
static CLI_PARTICIPANT_ID = "-42-Kinotic-CLI-42-";
|
|
2505
|
+
}
|