chrono-forge
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -83,2 +83,4 @@ "use strict"; | ||
workflowCoverage.mergeIntoGlobalCoverage(); | ||
await testEnv.cancel(); | ||
jest.clearAllTimers(); | ||
}, 20000); | ||
@@ -85,0 +87,0 @@ async function runActivityWithMessage(messageSent, expectedMessage) { |
export * from './entities'; | ||
export * from './limitRecursion'; | ||
export * from './startChildPayload'; | ||
export * from './getCompositeKey'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -20,2 +20,3 @@ "use strict"; | ||
__exportStar(require("./startChildPayload"), exports); | ||
__exportStar(require("./getCompositeKey"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -10,3 +10,3 @@ import * as workflow from '@temporalio/workflow'; | ||
workflowType?: string; | ||
idAttribute?: string; | ||
idAttribute?: string | string[]; | ||
autoStartChildren?: boolean; | ||
@@ -13,0 +13,0 @@ cancellationType?: workflow.ChildWorkflowCancellationType; |
@@ -49,2 +49,3 @@ "use strict"; | ||
const limitRecursion_1 = require("../utils/limitRecursion"); | ||
const getCompositeKey_1 = require("../utils/getCompositeKey"); | ||
class StatefulWorkflow extends Workflow_1.Workflow { | ||
@@ -371,3 +372,5 @@ schemaManager = SchemaManager_1.SchemaManager.getInstance(); | ||
for (const currentItem of currentItems) { | ||
const itemId = currentItem[config.idAttribute]; | ||
const itemId = Array.isArray(config.idAttribute) | ||
? (0, getCompositeKey_1.getCompositeKey)(currentItem, config.idAttribute) | ||
: currentItem[config.idAttribute]; | ||
if (itemId && (0, dottie_1.get)(differences, `deleted.${config.entityName}.${itemId}`)) { | ||
@@ -380,3 +383,3 @@ await this.processDeletion(itemId, config); | ||
this.log.debug(`[StatefulWorkflow]:${this.constructor.name}:processSingleItem`); | ||
const itemId = item; | ||
const itemId = Array.isArray(config.idAttribute) ? (0, getCompositeKey_1.getCompositeKey)(newState[config.entityName][item], config.idAttribute) : item; | ||
const existingHandle = this.handles[`${config.entityName}-${itemId}`]; | ||
@@ -404,4 +407,5 @@ const previousItem = (0, dottie_1.get)(previousState, `${config.entityName}.${itemId}`, {}); | ||
const entitySchema = SchemaManager_1.SchemaManager.getInstance().getSchema(entityName); | ||
const { [idAttribute]: id } = state; | ||
const workflowId = `${entityName}-${id}`; | ||
const { [idAttribute]: id, ...rest } = state; | ||
const compositeId = Array.isArray(idAttribute) ? (0, getCompositeKey_1.getCompositeKey)(state, idAttribute) : id; | ||
const workflowId = `${entityName}-${compositeId}`; | ||
const rawData = (0, limitRecursion_1.limitRecursion)((0, normalizr_1.denormalize)(state, entitySchema, newState), entitySchema); | ||
@@ -470,3 +474,4 @@ if (this.ancestorWorkflowIds.includes(workflowId)) { | ||
const { [idAttribute]: id } = state; | ||
const workflowId = `${entityName}-${id}`; | ||
const compositeId = Array.isArray(config.idAttribute) ? (0, getCompositeKey_1.getCompositeKey)(state, config.idAttribute) : state[config.idAttribute]; | ||
const workflowId = `${entityName}-${compositeId}`; | ||
const rawData = (0, limitRecursion_1.limitRecursion)((0, normalizr_1.denormalize)(state, entitySchema, newState), entitySchema); | ||
@@ -473,0 +478,0 @@ if (this.ancestorWorkflowIds.includes(workflowId)) { |
{ | ||
"name": "chrono-forge", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "A comprehensive framework for building resilient Temporal workflows, advanced state management, and real-time streaming activities in TypeScript. Designed for a seamless developer experience with powerful abstractions, dynamic orchestration, and full control over distributed systems.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
256514
135
2958