@cadenza.io/service 1.20.4 → 1.20.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.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3117,8 +3117,9 @@ var DatabaseController = class _DatabaseController {
|
|
|
3117
3117
|
const opAction = op === "query" ? "queried" : op === "insert" ? "inserted" : op === "update" ? "updated" : op === "delete" ? "deleted" : "";
|
|
3118
3118
|
const defaultSignal = `${options.isMeta ? "meta." : ""}${tableName}.${opAction}`;
|
|
3119
3119
|
const tableNameFormatted = tableName.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
3120
|
+
const taskName = `db${op.charAt(0).toUpperCase() + op.slice(1)}${tableNameFormatted}`;
|
|
3120
3121
|
CadenzaService.createThrottledTask(
|
|
3121
|
-
|
|
3122
|
+
taskName,
|
|
3122
3123
|
async (context, emit) => {
|
|
3123
3124
|
const triggerConditions = table.customSignals?.triggers?.query?.filter(
|
|
3124
3125
|
(trigger) => trigger.condition
|
|
@@ -3142,8 +3143,17 @@ var DatabaseController = class _DatabaseController {
|
|
|
3142
3143
|
}
|
|
3143
3144
|
console.log(
|
|
3144
3145
|
"EXECUTED",
|
|
3145
|
-
|
|
3146
|
-
context.errored ? JSON.stringify(
|
|
3146
|
+
taskName,
|
|
3147
|
+
context.errored ? JSON.stringify({
|
|
3148
|
+
data: context.data,
|
|
3149
|
+
queryData: context.queryData,
|
|
3150
|
+
filter: context.filter,
|
|
3151
|
+
fields: context.fields,
|
|
3152
|
+
joins: context.joins,
|
|
3153
|
+
sort: context.sort,
|
|
3154
|
+
limit: context.limit,
|
|
3155
|
+
offset: context.offset
|
|
3156
|
+
}) : JSON.stringify(context).slice(0, 140),
|
|
3147
3157
|
context.__error
|
|
3148
3158
|
);
|
|
3149
3159
|
delete context.queryData;
|
|
@@ -3205,6 +3215,8 @@ var GraphSyncController = class _GraphSyncController {
|
|
|
3205
3215
|
const { __routines } = ctx;
|
|
3206
3216
|
if (!__routines) return;
|
|
3207
3217
|
for (const routine of __routines) {
|
|
3218
|
+
if (routine.registered) continue;
|
|
3219
|
+
routine.registered = true;
|
|
3208
3220
|
emit("meta.sync_controller.routine_added", {
|
|
3209
3221
|
data: {
|
|
3210
3222
|
name: routine.name,
|
|
@@ -3215,7 +3227,6 @@ var GraphSyncController = class _GraphSyncController {
|
|
|
3215
3227
|
}
|
|
3216
3228
|
});
|
|
3217
3229
|
for (const task of routine.tasks) {
|
|
3218
|
-
if (task.registered) continue;
|
|
3219
3230
|
const tasks = task.getIterator();
|
|
3220
3231
|
while (tasks.hasNext()) {
|
|
3221
3232
|
const nextTask = tasks.next();
|