@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/browser/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");
|
|
@@ -5882,6 +5882,7 @@ var DatabaseController = class _DatabaseController {
|
|
|
5882
5882
|
var import_uuid4 = require("uuid");
|
|
5883
5883
|
|
|
5884
5884
|
// src/graph/controllers/GraphSyncController.ts
|
|
5885
|
+
var import_core4 = require("@cadenza.io/core");
|
|
5885
5886
|
var ACTOR_TASK_METADATA = /* @__PURE__ */ Symbol.for("@cadenza.io/core/actor-task-meta");
|
|
5886
5887
|
function getActorTaskRuntimeMetadata(taskFunction) {
|
|
5887
5888
|
if (typeof taskFunction !== "function") {
|
|
@@ -6019,17 +6020,21 @@ function resolveSyncInsertTask(isCadenzaDBReady, tableName, queryData = {}, opti
|
|
|
6019
6020
|
if (!targetTask) {
|
|
6020
6021
|
return false;
|
|
6021
6022
|
}
|
|
6022
|
-
return targetTask.
|
|
6023
|
-
{
|
|
6023
|
+
return targetTask.execute(
|
|
6024
|
+
new import_core4.GraphContext({
|
|
6024
6025
|
...ctx,
|
|
6025
6026
|
queryData: buildSyncInsertQueryData(
|
|
6026
6027
|
ctx,
|
|
6027
6028
|
queryData
|
|
6028
6029
|
)
|
|
6029
|
-
},
|
|
6030
|
+
}),
|
|
6030
6031
|
emit,
|
|
6031
6032
|
inquire,
|
|
6032
|
-
progressCallback
|
|
6033
|
+
progressCallback,
|
|
6034
|
+
{
|
|
6035
|
+
nodeId: ctx.__previousTaskExecutionId ?? ctx.__metadata?.__previousTaskExecutionId ?? `graph-sync-${tableName}`,
|
|
6036
|
+
routineExecId: ctx.__routineExecId ?? ctx.__metadata?.__routineExecId ?? ctx.__metadata?.__localRoutineExecId ?? "graph-sync"
|
|
6037
|
+
}
|
|
6033
6038
|
);
|
|
6034
6039
|
},
|
|
6035
6040
|
`Routes graph sync inserts for ${tableName} through the local authority task when available.`,
|
|
@@ -7333,12 +7338,12 @@ var CadenzaService = class {
|
|
|
7333
7338
|
static bootstrap() {
|
|
7334
7339
|
if (this.isBootstrapped) return;
|
|
7335
7340
|
this.isBootstrapped = true;
|
|
7336
|
-
|
|
7337
|
-
this.signalBroker =
|
|
7338
|
-
this.inquiryBroker =
|
|
7339
|
-
this.runner =
|
|
7340
|
-
this.metaRunner =
|
|
7341
|
-
this.registry =
|
|
7341
|
+
import_core5.default.bootstrap();
|
|
7342
|
+
this.signalBroker = import_core5.default.signalBroker;
|
|
7343
|
+
this.inquiryBroker = import_core5.default.inquiryBroker;
|
|
7344
|
+
this.runner = import_core5.default.runner;
|
|
7345
|
+
this.metaRunner = import_core5.default.metaRunner;
|
|
7346
|
+
this.registry = import_core5.default.registry;
|
|
7342
7347
|
this.serviceRegistry = ServiceRegistry.instance;
|
|
7343
7348
|
RestController.instance;
|
|
7344
7349
|
SocketController.instance;
|
|
@@ -7372,8 +7377,8 @@ var CadenzaService = class {
|
|
|
7372
7377
|
return;
|
|
7373
7378
|
}
|
|
7374
7379
|
this.frontendSyncScheduled = true;
|
|
7375
|
-
|
|
7376
|
-
|
|
7380
|
+
import_core5.default.interval("meta.sync_requested", { __syncing: false }, 18e4);
|
|
7381
|
+
import_core5.default.schedule("meta.sync_requested", { __syncing: false }, 250);
|
|
7377
7382
|
}
|
|
7378
7383
|
static normalizeDeclaredTransports(transports, serviceId) {
|
|
7379
7384
|
return (transports ?? []).map((transport) => normalizeServiceTransportConfig(transport)).filter(
|
|
@@ -7430,7 +7435,7 @@ var CadenzaService = class {
|
|
|
7430
7435
|
* @return {void} Does not return any value.
|
|
7431
7436
|
*/
|
|
7432
7437
|
static validateName(name) {
|
|
7433
|
-
|
|
7438
|
+
import_core5.default.validateName(name);
|
|
7434
7439
|
}
|
|
7435
7440
|
/**
|
|
7436
7441
|
* Gets the current run strategy from the Cadenza configuration.
|
|
@@ -7438,7 +7443,7 @@ var CadenzaService = class {
|
|
|
7438
7443
|
* @return {Function} The run strategy function defined in the Cadenza configuration.
|
|
7439
7444
|
*/
|
|
7440
7445
|
static get runStrategy() {
|
|
7441
|
-
return
|
|
7446
|
+
return import_core5.default.runStrategy;
|
|
7442
7447
|
}
|
|
7443
7448
|
/**
|
|
7444
7449
|
* Sets the mode for the Cadenza application.
|
|
@@ -7447,7 +7452,7 @@ var CadenzaService = class {
|
|
|
7447
7452
|
* @return {void} This method does not return a value.
|
|
7448
7453
|
*/
|
|
7449
7454
|
static setMode(mode) {
|
|
7450
|
-
|
|
7455
|
+
import_core5.default.setMode(mode);
|
|
7451
7456
|
}
|
|
7452
7457
|
/**
|
|
7453
7458
|
* Emits a signal with the specified data using the associated broker.
|
|
@@ -7465,16 +7470,16 @@ var CadenzaService = class {
|
|
|
7465
7470
|
* ```
|
|
7466
7471
|
*/
|
|
7467
7472
|
static emit(signal, data = {}, options = {}) {
|
|
7468
|
-
|
|
7473
|
+
import_core5.default.emit(signal, data, options);
|
|
7469
7474
|
}
|
|
7470
7475
|
static debounce(signal, context = {}, delayMs = 500) {
|
|
7471
|
-
|
|
7476
|
+
import_core5.default.debounce(signal, context, delayMs);
|
|
7472
7477
|
}
|
|
7473
7478
|
static schedule(signal, context, timeoutMs, exactDateTime) {
|
|
7474
|
-
|
|
7479
|
+
import_core5.default.schedule(signal, context, timeoutMs, exactDateTime);
|
|
7475
7480
|
}
|
|
7476
7481
|
static interval(signal, context, intervalMs, leading = false, startDateTime) {
|
|
7477
|
-
|
|
7482
|
+
import_core5.default.interval(signal, context, intervalMs, leading, startDateTime);
|
|
7478
7483
|
}
|
|
7479
7484
|
static defineIntent(intent) {
|
|
7480
7485
|
this.inquiryBroker?.addIntent(intent);
|
|
@@ -7736,7 +7741,7 @@ var CadenzaService = class {
|
|
|
7736
7741
|
});
|
|
7737
7742
|
}
|
|
7738
7743
|
static get(taskName) {
|
|
7739
|
-
return
|
|
7744
|
+
return import_core5.default.get(taskName);
|
|
7740
7745
|
}
|
|
7741
7746
|
static getLocalCadenzaDBTask(tableName, operation) {
|
|
7742
7747
|
const generatedTaskName = this.buildGeneratedLocalCadenzaDBTaskName(
|
|
@@ -7747,7 +7752,7 @@ var CadenzaService = class {
|
|
|
7747
7752
|
tableName,
|
|
7748
7753
|
operation
|
|
7749
7754
|
);
|
|
7750
|
-
return
|
|
7755
|
+
return import_core5.default.get(generatedTaskName) ?? import_core5.default.get(legacyTaskName);
|
|
7751
7756
|
}
|
|
7752
7757
|
static getLocalCadenzaDBInsertTask(tableName) {
|
|
7753
7758
|
return this.getLocalCadenzaDBTask(tableName, "insert");
|
|
@@ -7756,15 +7761,15 @@ var CadenzaService = class {
|
|
|
7756
7761
|
return this.getLocalCadenzaDBTask(tableName, "query");
|
|
7757
7762
|
}
|
|
7758
7763
|
static getActor(actorName) {
|
|
7759
|
-
const cadenzaWithActors =
|
|
7764
|
+
const cadenzaWithActors = import_core5.default;
|
|
7760
7765
|
return cadenzaWithActors.getActor?.(actorName);
|
|
7761
7766
|
}
|
|
7762
7767
|
static getAllActors() {
|
|
7763
|
-
const cadenzaWithActors =
|
|
7768
|
+
const cadenzaWithActors = import_core5.default;
|
|
7764
7769
|
return cadenzaWithActors.getAllActors?.() ?? [];
|
|
7765
7770
|
}
|
|
7766
7771
|
static getRoutine(routineName) {
|
|
7767
|
-
return
|
|
7772
|
+
return import_core5.default.getRoutine(routineName);
|
|
7768
7773
|
}
|
|
7769
7774
|
/**
|
|
7770
7775
|
* Creates a new DeputyTask instance based on the provided routine name, service name, and options.
|
|
@@ -8292,7 +8297,7 @@ var CadenzaService = class {
|
|
|
8292
8297
|
return true;
|
|
8293
8298
|
}).doOn("meta.service_registry.instance_inserted");
|
|
8294
8299
|
if (!options.cadenzaDB?.connect && isFrontend) {
|
|
8295
|
-
|
|
8300
|
+
import_core5.default.schedule(
|
|
8296
8301
|
"meta.service_registry.instance_registration_requested",
|
|
8297
8302
|
{
|
|
8298
8303
|
data: {
|
|
@@ -8553,11 +8558,11 @@ var CadenzaService = class {
|
|
|
8553
8558
|
}
|
|
8554
8559
|
static createActor(spec, options = {}) {
|
|
8555
8560
|
this.bootstrap();
|
|
8556
|
-
return
|
|
8561
|
+
return import_core5.default.createActor(spec, options);
|
|
8557
8562
|
}
|
|
8558
8563
|
static createActorFromDefinition(definition, options = {}) {
|
|
8559
8564
|
this.bootstrap();
|
|
8560
|
-
return
|
|
8565
|
+
return import_core5.default.createActorFromDefinition(definition, options);
|
|
8561
8566
|
}
|
|
8562
8567
|
/**
|
|
8563
8568
|
* Creates and registers a new task with the provided name, function, and optional details.
|
|
@@ -8631,7 +8636,7 @@ var CadenzaService = class {
|
|
|
8631
8636
|
*/
|
|
8632
8637
|
static createTask(name, func, description, options = {}) {
|
|
8633
8638
|
this.bootstrap();
|
|
8634
|
-
return
|
|
8639
|
+
return import_core5.default.createTask(name, func, description, options);
|
|
8635
8640
|
}
|
|
8636
8641
|
/**
|
|
8637
8642
|
* Creates a meta task with the specified name, functionality, description, and options.
|
|
@@ -8647,7 +8652,7 @@ var CadenzaService = class {
|
|
|
8647
8652
|
*/
|
|
8648
8653
|
static createMetaTask(name, func, description, options = {}) {
|
|
8649
8654
|
this.bootstrap();
|
|
8650
|
-
return
|
|
8655
|
+
return import_core5.default.createMetaTask(name, func, description, options);
|
|
8651
8656
|
}
|
|
8652
8657
|
/**
|
|
8653
8658
|
* Creates a unique task by wrapping the provided task function with a uniqueness constraint.
|
|
@@ -8697,7 +8702,7 @@ var CadenzaService = class {
|
|
|
8697
8702
|
*/
|
|
8698
8703
|
static createUniqueTask(name, func, description, options = {}) {
|
|
8699
8704
|
this.bootstrap();
|
|
8700
|
-
return
|
|
8705
|
+
return import_core5.default.createUniqueTask(name, func, description, options);
|
|
8701
8706
|
}
|
|
8702
8707
|
/**
|
|
8703
8708
|
* Creates a unique meta task with the specified name, function, description, and options.
|
|
@@ -8711,7 +8716,7 @@ var CadenzaService = class {
|
|
|
8711
8716
|
*/
|
|
8712
8717
|
static createUniqueMetaTask(name, func, description, options = {}) {
|
|
8713
8718
|
this.bootstrap();
|
|
8714
|
-
return
|
|
8719
|
+
return import_core5.default.createUniqueMetaTask(name, func, description, options);
|
|
8715
8720
|
}
|
|
8716
8721
|
/**
|
|
8717
8722
|
* 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.
|
|
@@ -8744,7 +8749,7 @@ var CadenzaService = class {
|
|
|
8744
8749
|
*/
|
|
8745
8750
|
static createThrottledTask(name, func, throttledIdGetter = () => "default", description, options = {}) {
|
|
8746
8751
|
this.bootstrap();
|
|
8747
|
-
return
|
|
8752
|
+
return import_core5.default.createThrottledTask(
|
|
8748
8753
|
name,
|
|
8749
8754
|
func,
|
|
8750
8755
|
throttledIdGetter,
|
|
@@ -8765,7 +8770,7 @@ var CadenzaService = class {
|
|
|
8765
8770
|
*/
|
|
8766
8771
|
static createThrottledMetaTask(name, func, throttledIdGetter = () => "default", description, options = {}) {
|
|
8767
8772
|
this.bootstrap();
|
|
8768
|
-
return
|
|
8773
|
+
return import_core5.default.createThrottledMetaTask(
|
|
8769
8774
|
name,
|
|
8770
8775
|
func,
|
|
8771
8776
|
throttledIdGetter,
|
|
@@ -8808,7 +8813,7 @@ var CadenzaService = class {
|
|
|
8808
8813
|
*/
|
|
8809
8814
|
static createDebounceTask(name, func, description, debounceTime = 1e3, options = {}) {
|
|
8810
8815
|
this.bootstrap();
|
|
8811
|
-
return
|
|
8816
|
+
return import_core5.default.createDebounceTask(
|
|
8812
8817
|
name,
|
|
8813
8818
|
func,
|
|
8814
8819
|
description,
|
|
@@ -8829,7 +8834,7 @@ var CadenzaService = class {
|
|
|
8829
8834
|
*/
|
|
8830
8835
|
static createDebounceMetaTask(name, func, description, debounceTime = 1e3, options = {}) {
|
|
8831
8836
|
this.bootstrap();
|
|
8832
|
-
return
|
|
8837
|
+
return import_core5.default.createDebounceMetaTask(
|
|
8833
8838
|
name,
|
|
8834
8839
|
func,
|
|
8835
8840
|
description,
|
|
@@ -8899,7 +8904,7 @@ var CadenzaService = class {
|
|
|
8899
8904
|
*/
|
|
8900
8905
|
static createEphemeralTask(name, func, description, options = {}) {
|
|
8901
8906
|
this.bootstrap();
|
|
8902
|
-
return
|
|
8907
|
+
return import_core5.default.createEphemeralTask(name, func, description, options);
|
|
8903
8908
|
}
|
|
8904
8909
|
/**
|
|
8905
8910
|
* Creates an ephemeral meta-task with the specified name, function, description, and options.
|
|
@@ -8913,7 +8918,7 @@ var CadenzaService = class {
|
|
|
8913
8918
|
*/
|
|
8914
8919
|
static createEphemeralMetaTask(name, func, description, options = {}) {
|
|
8915
8920
|
this.bootstrap();
|
|
8916
|
-
return
|
|
8921
|
+
return import_core5.default.createEphemeralMetaTask(name, func, description, options);
|
|
8917
8922
|
}
|
|
8918
8923
|
/**
|
|
8919
8924
|
* Creates a new routine with the specified name, tasks, and an optional description.
|
|
@@ -8945,7 +8950,7 @@ var CadenzaService = class {
|
|
|
8945
8950
|
*/
|
|
8946
8951
|
static createRoutine(name, tasks, description = "") {
|
|
8947
8952
|
this.bootstrap();
|
|
8948
|
-
return
|
|
8953
|
+
return import_core5.default.createRoutine(name, tasks, description);
|
|
8949
8954
|
}
|
|
8950
8955
|
/**
|
|
8951
8956
|
* Creates a meta routine with a given name, tasks, and optional description.
|
|
@@ -8960,10 +8965,10 @@ var CadenzaService = class {
|
|
|
8960
8965
|
*/
|
|
8961
8966
|
static createMetaRoutine(name, tasks, description = "") {
|
|
8962
8967
|
this.bootstrap();
|
|
8963
|
-
return
|
|
8968
|
+
return import_core5.default.createMetaRoutine(name, tasks, description);
|
|
8964
8969
|
}
|
|
8965
8970
|
static reset() {
|
|
8966
|
-
|
|
8971
|
+
import_core5.default.reset();
|
|
8967
8972
|
this.serviceRegistry?.reset();
|
|
8968
8973
|
this.isBootstrapped = false;
|
|
8969
8974
|
this.serviceCreated = false;
|
|
@@ -8981,7 +8986,7 @@ CadenzaService.hydratedInquiryResults = /* @__PURE__ */ new Map();
|
|
|
8981
8986
|
CadenzaService.frontendSyncScheduled = false;
|
|
8982
8987
|
|
|
8983
8988
|
// src/index.ts
|
|
8984
|
-
var
|
|
8989
|
+
var import_core6 = require("@cadenza.io/core");
|
|
8985
8990
|
|
|
8986
8991
|
// src/ssr/createSSRInquiryBridge.ts
|
|
8987
8992
|
var import_uuid5 = require("uuid");
|