@cadenza.io/service 2.17.28 → 2.17.29
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/browser/index.js +52 -47
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +11 -6
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.js +52 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,27 +30,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
Actor: () =>
|
|
33
|
+
Actor: () => import_core6.Actor,
|
|
34
34
|
DatabaseController: () => DatabaseController,
|
|
35
35
|
DatabaseTask: () => DatabaseTask,
|
|
36
|
-
DebounceTask: () =>
|
|
36
|
+
DebounceTask: () => import_core6.DebounceTask,
|
|
37
37
|
DeputyTask: () => DeputyTask,
|
|
38
|
-
EphemeralTask: () =>
|
|
38
|
+
EphemeralTask: () => import_core6.EphemeralTask,
|
|
39
39
|
GraphMetadataController: () => GraphMetadataController,
|
|
40
|
-
GraphRoutine: () =>
|
|
40
|
+
GraphRoutine: () => import_core6.GraphRoutine,
|
|
41
41
|
RestController: () => RestController,
|
|
42
42
|
ServiceRegistry: () => ServiceRegistry,
|
|
43
43
|
SignalController: () => SignalController,
|
|
44
44
|
SignalTransmissionTask: () => SignalTransmissionTask,
|
|
45
45
|
SocketController: () => SocketController,
|
|
46
|
-
Task: () =>
|
|
46
|
+
Task: () => import_core6.Task,
|
|
47
47
|
createSSRInquiryBridge: () => createSSRInquiryBridge,
|
|
48
48
|
default: () => index_default
|
|
49
49
|
});
|
|
50
50
|
module.exports = __toCommonJS(index_exports);
|
|
51
51
|
|
|
52
52
|
// src/Cadenza.ts
|
|
53
|
-
var
|
|
53
|
+
var import_core5 = __toESM(require("@cadenza.io/core"));
|
|
54
54
|
|
|
55
55
|
// src/graph/definition/DeputyTask.ts
|
|
56
56
|
var import_uuid = require("uuid");
|
|
@@ -8340,6 +8340,7 @@ function tableFieldTypeToSchemaType(type) {
|
|
|
8340
8340
|
var import_uuid5 = require("uuid");
|
|
8341
8341
|
|
|
8342
8342
|
// src/graph/controllers/GraphSyncController.ts
|
|
8343
|
+
var import_core4 = require("@cadenza.io/core");
|
|
8343
8344
|
var ACTOR_TASK_METADATA = /* @__PURE__ */ Symbol.for("@cadenza.io/core/actor-task-meta");
|
|
8344
8345
|
function getActorTaskRuntimeMetadata(taskFunction) {
|
|
8345
8346
|
if (typeof taskFunction !== "function") {
|
|
@@ -8477,17 +8478,21 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
|
|
|
8477
8478
|
if (!targetTask) {
|
|
8478
8479
|
return false;
|
|
8479
8480
|
}
|
|
8480
|
-
return targetTask.
|
|
8481
|
-
{
|
|
8481
|
+
return targetTask.execute(
|
|
8482
|
+
new import_core4.GraphContext({
|
|
8482
8483
|
...ctx,
|
|
8483
8484
|
queryData: buildSyncInsertQueryData(
|
|
8484
8485
|
ctx,
|
|
8485
8486
|
queryData
|
|
8486
8487
|
)
|
|
8487
|
-
},
|
|
8488
|
+
}),
|
|
8488
8489
|
emit,
|
|
8489
8490
|
inquire,
|
|
8490
|
-
progressCallback
|
|
8491
|
+
progressCallback,
|
|
8492
|
+
{
|
|
8493
|
+
nodeId: ctx.__previousTaskExecutionId ?? ctx.__metadata?.__previousTaskExecutionId ?? `graph-sync-${tableName}`,
|
|
8494
|
+
routineExecId: ctx.__routineExecId ?? ctx.__metadata?.__routineExecId ?? ctx.__metadata?.__localRoutineExecId ?? "graph-sync"
|
|
8495
|
+
}
|
|
8491
8496
|
);
|
|
8492
8497
|
},
|
|
8493
8498
|
`Routes graph sync inserts for ${tableName} through the local authority task when available.`,
|
|
@@ -9791,12 +9796,12 @@ var CadenzaService = class {
|
|
|
9791
9796
|
static bootstrap() {
|
|
9792
9797
|
if (this.isBootstrapped) return;
|
|
9793
9798
|
this.isBootstrapped = true;
|
|
9794
|
-
|
|
9795
|
-
this.signalBroker =
|
|
9796
|
-
this.inquiryBroker =
|
|
9797
|
-
this.runner =
|
|
9798
|
-
this.metaRunner =
|
|
9799
|
-
this.registry =
|
|
9799
|
+
import_core5.default.bootstrap();
|
|
9800
|
+
this.signalBroker = import_core5.default.signalBroker;
|
|
9801
|
+
this.inquiryBroker = import_core5.default.inquiryBroker;
|
|
9802
|
+
this.runner = import_core5.default.runner;
|
|
9803
|
+
this.metaRunner = import_core5.default.metaRunner;
|
|
9804
|
+
this.registry = import_core5.default.registry;
|
|
9800
9805
|
this.serviceRegistry = ServiceRegistry.instance;
|
|
9801
9806
|
RestController.instance;
|
|
9802
9807
|
SocketController.instance;
|
|
@@ -9830,8 +9835,8 @@ var CadenzaService = class {
|
|
|
9830
9835
|
return;
|
|
9831
9836
|
}
|
|
9832
9837
|
this.frontendSyncScheduled = true;
|
|
9833
|
-
|
|
9834
|
-
|
|
9838
|
+
import_core5.default.interval("meta.sync_requested", { __syncing: false }, 18e4);
|
|
9839
|
+
import_core5.default.schedule("meta.sync_requested", { __syncing: false }, 250);
|
|
9835
9840
|
}
|
|
9836
9841
|
static normalizeDeclaredTransports(transports, serviceId) {
|
|
9837
9842
|
return (transports ?? []).map((transport) => normalizeServiceTransportConfig(transport)).filter(
|
|
@@ -9888,7 +9893,7 @@ var CadenzaService = class {
|
|
|
9888
9893
|
* @return {void} Does not return any value.
|
|
9889
9894
|
*/
|
|
9890
9895
|
static validateName(name) {
|
|
9891
|
-
|
|
9896
|
+
import_core5.default.validateName(name);
|
|
9892
9897
|
}
|
|
9893
9898
|
/**
|
|
9894
9899
|
* Gets the current run strategy from the Cadenza configuration.
|
|
@@ -9896,7 +9901,7 @@ var CadenzaService = class {
|
|
|
9896
9901
|
* @return {Function} The run strategy function defined in the Cadenza configuration.
|
|
9897
9902
|
*/
|
|
9898
9903
|
static get runStrategy() {
|
|
9899
|
-
return
|
|
9904
|
+
return import_core5.default.runStrategy;
|
|
9900
9905
|
}
|
|
9901
9906
|
/**
|
|
9902
9907
|
* Sets the mode for the Cadenza application.
|
|
@@ -9905,7 +9910,7 @@ var CadenzaService = class {
|
|
|
9905
9910
|
* @return {void} This method does not return a value.
|
|
9906
9911
|
*/
|
|
9907
9912
|
static setMode(mode) {
|
|
9908
|
-
|
|
9913
|
+
import_core5.default.setMode(mode);
|
|
9909
9914
|
}
|
|
9910
9915
|
/**
|
|
9911
9916
|
* Emits a signal with the specified data using the associated broker.
|
|
@@ -9923,16 +9928,16 @@ var CadenzaService = class {
|
|
|
9923
9928
|
* ```
|
|
9924
9929
|
*/
|
|
9925
9930
|
static emit(signal, data = {}, options = {}) {
|
|
9926
|
-
|
|
9931
|
+
import_core5.default.emit(signal, data, options);
|
|
9927
9932
|
}
|
|
9928
9933
|
static debounce(signal, context = {}, delayMs = 500) {
|
|
9929
|
-
|
|
9934
|
+
import_core5.default.debounce(signal, context, delayMs);
|
|
9930
9935
|
}
|
|
9931
9936
|
static schedule(signal, context, timeoutMs, exactDateTime) {
|
|
9932
|
-
|
|
9937
|
+
import_core5.default.schedule(signal, context, timeoutMs, exactDateTime);
|
|
9933
9938
|
}
|
|
9934
9939
|
static interval(signal, context, intervalMs, leading = false, startDateTime) {
|
|
9935
|
-
|
|
9940
|
+
import_core5.default.interval(signal, context, intervalMs, leading, startDateTime);
|
|
9936
9941
|
}
|
|
9937
9942
|
static defineIntent(intent) {
|
|
9938
9943
|
this.inquiryBroker?.addIntent(intent);
|
|
@@ -10194,7 +10199,7 @@ var CadenzaService = class {
|
|
|
10194
10199
|
});
|
|
10195
10200
|
}
|
|
10196
10201
|
static get(taskName) {
|
|
10197
|
-
return
|
|
10202
|
+
return import_core5.default.get(taskName);
|
|
10198
10203
|
}
|
|
10199
10204
|
static getLocalCadenzaDBTask(tableName, operation) {
|
|
10200
10205
|
const generatedTaskName = this.buildGeneratedLocalCadenzaDBTaskName(
|
|
@@ -10205,7 +10210,7 @@ var CadenzaService = class {
|
|
|
10205
10210
|
tableName,
|
|
10206
10211
|
operation
|
|
10207
10212
|
);
|
|
10208
|
-
return
|
|
10213
|
+
return import_core5.default.get(generatedTaskName) ?? import_core5.default.get(legacyTaskName);
|
|
10209
10214
|
}
|
|
10210
10215
|
static getLocalCadenzaDBInsertTask(tableName) {
|
|
10211
10216
|
return this.getLocalCadenzaDBTask(tableName, "insert");
|
|
@@ -10214,15 +10219,15 @@ var CadenzaService = class {
|
|
|
10214
10219
|
return this.getLocalCadenzaDBTask(tableName, "query");
|
|
10215
10220
|
}
|
|
10216
10221
|
static getActor(actorName) {
|
|
10217
|
-
const cadenzaWithActors =
|
|
10222
|
+
const cadenzaWithActors = import_core5.default;
|
|
10218
10223
|
return cadenzaWithActors.getActor?.(actorName);
|
|
10219
10224
|
}
|
|
10220
10225
|
static getAllActors() {
|
|
10221
|
-
const cadenzaWithActors =
|
|
10226
|
+
const cadenzaWithActors = import_core5.default;
|
|
10222
10227
|
return cadenzaWithActors.getAllActors?.() ?? [];
|
|
10223
10228
|
}
|
|
10224
10229
|
static getRoutine(routineName) {
|
|
10225
|
-
return
|
|
10230
|
+
return import_core5.default.getRoutine(routineName);
|
|
10226
10231
|
}
|
|
10227
10232
|
/**
|
|
10228
10233
|
* Creates a new DeputyTask instance based on the provided routine name, service name, and options.
|
|
@@ -10750,7 +10755,7 @@ var CadenzaService = class {
|
|
|
10750
10755
|
return true;
|
|
10751
10756
|
}).doOn("meta.service_registry.instance_inserted");
|
|
10752
10757
|
if (!options.cadenzaDB?.connect && isFrontend) {
|
|
10753
|
-
|
|
10758
|
+
import_core5.default.schedule(
|
|
10754
10759
|
"meta.service_registry.instance_registration_requested",
|
|
10755
10760
|
{
|
|
10756
10761
|
data: {
|
|
@@ -11011,11 +11016,11 @@ var CadenzaService = class {
|
|
|
11011
11016
|
}
|
|
11012
11017
|
static createActor(spec, options = {}) {
|
|
11013
11018
|
this.bootstrap();
|
|
11014
|
-
return
|
|
11019
|
+
return import_core5.default.createActor(spec, options);
|
|
11015
11020
|
}
|
|
11016
11021
|
static createActorFromDefinition(definition, options = {}) {
|
|
11017
11022
|
this.bootstrap();
|
|
11018
|
-
return
|
|
11023
|
+
return import_core5.default.createActorFromDefinition(definition, options);
|
|
11019
11024
|
}
|
|
11020
11025
|
/**
|
|
11021
11026
|
* Creates and registers a new task with the provided name, function, and optional details.
|
|
@@ -11089,7 +11094,7 @@ var CadenzaService = class {
|
|
|
11089
11094
|
*/
|
|
11090
11095
|
static createTask(name, func, description, options = {}) {
|
|
11091
11096
|
this.bootstrap();
|
|
11092
|
-
return
|
|
11097
|
+
return import_core5.default.createTask(name, func, description, options);
|
|
11093
11098
|
}
|
|
11094
11099
|
/**
|
|
11095
11100
|
* Creates a meta task with the specified name, functionality, description, and options.
|
|
@@ -11105,7 +11110,7 @@ var CadenzaService = class {
|
|
|
11105
11110
|
*/
|
|
11106
11111
|
static createMetaTask(name, func, description, options = {}) {
|
|
11107
11112
|
this.bootstrap();
|
|
11108
|
-
return
|
|
11113
|
+
return import_core5.default.createMetaTask(name, func, description, options);
|
|
11109
11114
|
}
|
|
11110
11115
|
/**
|
|
11111
11116
|
* Creates a unique task by wrapping the provided task function with a uniqueness constraint.
|
|
@@ -11155,7 +11160,7 @@ var CadenzaService = class {
|
|
|
11155
11160
|
*/
|
|
11156
11161
|
static createUniqueTask(name, func, description, options = {}) {
|
|
11157
11162
|
this.bootstrap();
|
|
11158
|
-
return
|
|
11163
|
+
return import_core5.default.createUniqueTask(name, func, description, options);
|
|
11159
11164
|
}
|
|
11160
11165
|
/**
|
|
11161
11166
|
* Creates a unique meta task with the specified name, function, description, and options.
|
|
@@ -11169,7 +11174,7 @@ var CadenzaService = class {
|
|
|
11169
11174
|
*/
|
|
11170
11175
|
static createUniqueMetaTask(name, func, description, options = {}) {
|
|
11171
11176
|
this.bootstrap();
|
|
11172
|
-
return
|
|
11177
|
+
return import_core5.default.createUniqueMetaTask(name, func, description, options);
|
|
11173
11178
|
}
|
|
11174
11179
|
/**
|
|
11175
11180
|
* Creates a throttled task with a concurrency limit of 1, ensuring that only one instance of the task can run at a time for a specific throttle tag.
|
|
@@ -11202,7 +11207,7 @@ var CadenzaService = class {
|
|
|
11202
11207
|
*/
|
|
11203
11208
|
static createThrottledTask(name, func, throttledIdGetter = () => "default", description, options = {}) {
|
|
11204
11209
|
this.bootstrap();
|
|
11205
|
-
return
|
|
11210
|
+
return import_core5.default.createThrottledTask(
|
|
11206
11211
|
name,
|
|
11207
11212
|
func,
|
|
11208
11213
|
throttledIdGetter,
|
|
@@ -11223,7 +11228,7 @@ var CadenzaService = class {
|
|
|
11223
11228
|
*/
|
|
11224
11229
|
static createThrottledMetaTask(name, func, throttledIdGetter = () => "default", description, options = {}) {
|
|
11225
11230
|
this.bootstrap();
|
|
11226
|
-
return
|
|
11231
|
+
return import_core5.default.createThrottledMetaTask(
|
|
11227
11232
|
name,
|
|
11228
11233
|
func,
|
|
11229
11234
|
throttledIdGetter,
|
|
@@ -11266,7 +11271,7 @@ var CadenzaService = class {
|
|
|
11266
11271
|
*/
|
|
11267
11272
|
static createDebounceTask(name, func, description, debounceTime = 1e3, options = {}) {
|
|
11268
11273
|
this.bootstrap();
|
|
11269
|
-
return
|
|
11274
|
+
return import_core5.default.createDebounceTask(
|
|
11270
11275
|
name,
|
|
11271
11276
|
func,
|
|
11272
11277
|
description,
|
|
@@ -11287,7 +11292,7 @@ var CadenzaService = class {
|
|
|
11287
11292
|
*/
|
|
11288
11293
|
static createDebounceMetaTask(name, func, description, debounceTime = 1e3, options = {}) {
|
|
11289
11294
|
this.bootstrap();
|
|
11290
|
-
return
|
|
11295
|
+
return import_core5.default.createDebounceMetaTask(
|
|
11291
11296
|
name,
|
|
11292
11297
|
func,
|
|
11293
11298
|
description,
|
|
@@ -11357,7 +11362,7 @@ var CadenzaService = class {
|
|
|
11357
11362
|
*/
|
|
11358
11363
|
static createEphemeralTask(name, func, description, options = {}) {
|
|
11359
11364
|
this.bootstrap();
|
|
11360
|
-
return
|
|
11365
|
+
return import_core5.default.createEphemeralTask(name, func, description, options);
|
|
11361
11366
|
}
|
|
11362
11367
|
/**
|
|
11363
11368
|
* Creates an ephemeral meta-task with the specified name, function, description, and options.
|
|
@@ -11371,7 +11376,7 @@ var CadenzaService = class {
|
|
|
11371
11376
|
*/
|
|
11372
11377
|
static createEphemeralMetaTask(name, func, description, options = {}) {
|
|
11373
11378
|
this.bootstrap();
|
|
11374
|
-
return
|
|
11379
|
+
return import_core5.default.createEphemeralMetaTask(name, func, description, options);
|
|
11375
11380
|
}
|
|
11376
11381
|
/**
|
|
11377
11382
|
* Creates a new routine with the specified name, tasks, and an optional description.
|
|
@@ -11403,7 +11408,7 @@ var CadenzaService = class {
|
|
|
11403
11408
|
*/
|
|
11404
11409
|
static createRoutine(name, tasks, description = "") {
|
|
11405
11410
|
this.bootstrap();
|
|
11406
|
-
return
|
|
11411
|
+
return import_core5.default.createRoutine(name, tasks, description);
|
|
11407
11412
|
}
|
|
11408
11413
|
/**
|
|
11409
11414
|
* Creates a meta routine with a given name, tasks, and optional description.
|
|
@@ -11418,10 +11423,10 @@ var CadenzaService = class {
|
|
|
11418
11423
|
*/
|
|
11419
11424
|
static createMetaRoutine(name, tasks, description = "") {
|
|
11420
11425
|
this.bootstrap();
|
|
11421
|
-
return
|
|
11426
|
+
return import_core5.default.createMetaRoutine(name, tasks, description);
|
|
11422
11427
|
}
|
|
11423
11428
|
static reset() {
|
|
11424
|
-
|
|
11429
|
+
import_core5.default.reset();
|
|
11425
11430
|
this.serviceRegistry?.reset();
|
|
11426
11431
|
this.isBootstrapped = false;
|
|
11427
11432
|
this.serviceCreated = false;
|
|
@@ -11439,7 +11444,7 @@ CadenzaService.hydratedInquiryResults = /* @__PURE__ */ new Map();
|
|
|
11439
11444
|
CadenzaService.frontendSyncScheduled = false;
|
|
11440
11445
|
|
|
11441
11446
|
// src/index.ts
|
|
11442
|
-
var
|
|
11447
|
+
var import_core6 = require("@cadenza.io/core");
|
|
11443
11448
|
|
|
11444
11449
|
// src/ssr/createSSRInquiryBridge.ts
|
|
11445
11450
|
var import_uuid6 = require("uuid");
|