@cadenza.io/service 1.9.44 → 1.9.45

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 CHANGED
@@ -1019,27 +1019,11 @@ var RestController = class _RestController {
1019
1019
  }
1020
1020
  CadenzaService.createEphemeralMetaTask(
1021
1021
  "Resolve delegation",
1022
- (endCtx) => res.json({
1023
- __status: "success",
1024
- __result: endCtx.__result
1025
- }),
1022
+ (endCtx) => res.json(__spreadProps(__spreadValues({}, endCtx), {
1023
+ __status: "success"
1024
+ })),
1026
1025
  "Resolves a delegation request"
1027
- ).doOn(`meta.node.ended_routine_execution:${routineExecId}`).emits(`meta.rest.delegation_resolved:${routineExecId}`);
1028
- CadenzaService.createEphemeralMetaTask(
1029
- "Delegation progress update",
1030
- (progressCtx) => {
1031
- if (progressCtx.__progress !== void 0) {
1032
- }
1033
- },
1034
- "Updates delegation progress (polling-based for REST)",
1035
- {
1036
- once: false,
1037
- destroyCondition: (progressCtx) => progressCtx.__progress === 1 || progressCtx.__graphComplete
1038
- }
1039
- ).doOn(
1040
- `meta.node.routine_execution_progress:${routineExecId}`,
1041
- `meta.node.ended_routine_execution:${routineExecId}`
1042
- );
1026
+ ).doOn(`meta.node.graph_completed:${routineExecId}`).emits(`meta.rest.delegation_resolved:${routineExecId}`);
1043
1027
  CadenzaService.broker.emit("meta.rest.delegation_requested", __spreadProps(__spreadValues({}, ctx2), {
1044
1028
  __name: ctx2.__remoteRoutineName
1045
1029
  }));
@@ -1395,10 +1379,6 @@ var SocketController = class _SocketController {
1395
1379
  (ctx) => {
1396
1380
  const server = ctx.__socketServer;
1397
1381
  server.on("connection", (ws) => {
1398
- ws.on(
1399
- "handshake",
1400
- (ctx2) => CadenzaService.broker.emit("meta.socket.handshake", ctx2)
1401
- );
1402
1382
  ws.on(
1403
1383
  "delegation",
1404
1384
  (ctx2, callback) => {
@@ -1406,9 +1386,7 @@ var SocketController = class _SocketController {
1406
1386
  "Resolve delegation",
1407
1387
  callback,
1408
1388
  "Resolves a delegation request using the provided callback from the client (.emitWithAck())"
1409
- ).doOn(
1410
- `meta.node.ended_routine_execution:${ctx2.__routineExecId}`
1411
- ).emits(
1389
+ ).doOn(`meta.node.graph_completed:${ctx2.__routineExecId}`).emits(
1412
1390
  `meta.socket.delegation_resolved:${ctx2.__routineExecId}`
1413
1391
  );
1414
1392
  CadenzaService.createEphemeralMetaTask(
@@ -1420,11 +1398,14 @@ var SocketController = class _SocketController {
1420
1398
  "Updates delegation progress",
1421
1399
  {
1422
1400
  once: false,
1423
- destroyCondition: (ctx3) => ctx3.data.progress === 1
1401
+ destroyCondition: (ctx3) => {
1402
+ var _a2;
1403
+ return ctx3.data.progress === 1 || ((_a2 = ctx3.data) == null ? void 0 : _a2.progress) === void 0;
1404
+ }
1424
1405
  }
1425
1406
  ).doOn(
1426
1407
  `meta.node.routine_execution_progress:${ctx2.__routineExecId}`,
1427
- `meta.node.ended_routine_execution:${ctx2.__routineExecId}`
1408
+ `meta.node.graph_completed:${ctx2.__routineExecId}`
1428
1409
  ).emitsOnFail(
1429
1410
  `meta.socket.progress_failed:${ctx2.__routineExecId}`
1430
1411
  );
@@ -1823,7 +1804,7 @@ var GraphMetadataController = class _GraphMetadataController {
1823
1804
  context: ctx.data.context.context,
1824
1805
  is_meta: ctx.data.isMeta
1825
1806
  },
1826
- return: "id"
1807
+ return: "uuid"
1827
1808
  }
1828
1809
  })
1829
1810
  };
@@ -1845,7 +1826,7 @@ var GraphMetadataController = class _GraphMetadataController {
1845
1826
  context: context.context,
1846
1827
  is_meta: ctx.data.isMeta
1847
1828
  },
1848
- return: "id"
1829
+ return: "uuid"
1849
1830
  }
1850
1831
  })
1851
1832
  };
@@ -1870,7 +1851,7 @@ var GraphMetadataController = class _GraphMetadataController {
1870
1851
  context: context.context,
1871
1852
  is_meta: ctx.data.isMeta
1872
1853
  },
1873
- return: "id"
1854
+ return: "uuid"
1874
1855
  }
1875
1856
  })
1876
1857
  };
@@ -3198,7 +3179,7 @@ var DatabaseController = class _DatabaseController {
3198
3179
  createDatabaseTask(op, tableName, table, queryFunction, options) {
3199
3180
  var _a2, _b2, _c2, _d2;
3200
3181
  const tableNameFormatted = tableName.split("_").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
3201
- const task = CadenzaService.createThrottledTask(
3182
+ CadenzaService.createThrottledTask(
3202
3183
  `db${op.charAt(0).toUpperCase() + op.slice(1)}${tableNameFormatted}`,
3203
3184
  (context, emit) => __async(null, null, function* () {
3204
3185
  var _a3, _b3, _c3, _d3, _e, _f, _g, _h;
@@ -3224,7 +3205,7 @@ var DatabaseController = class _DatabaseController {
3224
3205
  }
3225
3206
  console.log(
3226
3207
  "EXECUTED",
3227
- `db${op.charAt(0).toUpperCase() + op.slice(1)}${tableName.charAt(0).toUpperCase() + tableName.slice(1)}`,
3208
+ `db${op.charAt(0).toUpperCase() + op.slice(1)}${tableNameFormatted}`,
3228
3209
  JSON.stringify(context).slice(0, 100),
3229
3210
  context.__error
3230
3211
  );
@@ -3262,12 +3243,6 @@ var DatabaseController = class _DatabaseController {
3262
3243
  return typeof signal === "string" ? signal : signal.signal;
3263
3244
  })) != null ? _d2 : []
3264
3245
  );
3265
- console.log("Created database task", op, tableName, {
3266
- taskName: task.name,
3267
- retries: task.retryCount,
3268
- retryDelay: task.retryDelay,
3269
- throttled: task.throttled
3270
- });
3271
3246
  }
3272
3247
  };
3273
3248