@dynamatix/gb-schemas 2.3.256 → 2.3.257
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.middleware.d.ts","sourceRoot":"","sources":["../../shared/workflow.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EACH,oBAAoB,EAEpB,yBAAyB,EAC5B,MAAM,4BAA4B,CAAC;AAIpC,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,OAAO,CAA4B;gBAE/B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAYxD;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAS/B;;;OAGG;IACH,UAAU;;;IAMV;;;;OAIG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM;yBAGK,GAAG,OAAO,GAAG,QAAQ,QAAQ;2BAiB3B,GAAG,OAAO,GAAG,QAAQ,QAAQ;;IAkBvE;;;;OAIG;IACG,WAAW,CAAC,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B5E;;;;;OAKG;YACW,cAAc;
|
|
1
|
+
{"version":3,"file":"workflow.middleware.d.ts","sourceRoot":"","sources":["../../shared/workflow.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EACH,oBAAoB,EAEpB,yBAAyB,EAC5B,MAAM,4BAA4B,CAAC;AAIpC,qBAAa,kBAAkB;IAC3B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,OAAO,CAA4B;gBAE/B,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;IAYxD;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAS/B;;;OAGG;IACH,UAAU;;;IAMV;;;;OAIG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM;yBAGK,GAAG,OAAO,GAAG,QAAQ,QAAQ;2BAiB3B,GAAG,OAAO,GAAG,QAAQ,QAAQ;;IAkBvE;;;;OAIG;IACG,WAAW,CAAC,KAAK,EAAE,oBAAoB,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B5E;;;;;OAKG;YACW,cAAc;IAqD5B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAYvB;;;;;OAKG;IACG,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAS5F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC;;;EAGxG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,QAShI"}
|
|
@@ -124,16 +124,23 @@ export class WorkflowMiddleware {
|
|
|
124
124
|
}
|
|
125
125
|
// Extract variables from document
|
|
126
126
|
console.log('Extracting variables from document');
|
|
127
|
+
console.log(` Required variables: ${JSON.stringify(trigger.requiredVariables)}`);
|
|
128
|
+
console.log(` Optional variables: ${JSON.stringify(trigger.optionalVariables || [])}`);
|
|
127
129
|
const variables = this.workflowService.extractVariables(trigger.requiredVariables, trigger.optionalVariables || [], document);
|
|
130
|
+
console.log(` Extracted variables: ${JSON.stringify(variables, null, 2)}`);
|
|
128
131
|
// Validate required variables
|
|
129
132
|
if (!this.workflowService.validateRequiredVariables(trigger.requiredVariables, variables)) {
|
|
130
|
-
console.warn(
|
|
133
|
+
console.warn(`❌ Required variables missing for trigger ${trigger.triggerKey}`);
|
|
134
|
+
console.warn(` Required: ${JSON.stringify(trigger.requiredVariables)}`);
|
|
135
|
+
console.warn(` Got: ${JSON.stringify(variables)}`);
|
|
131
136
|
return;
|
|
132
137
|
}
|
|
133
138
|
// Add metadata
|
|
139
|
+
const metadata = this.extractMetadata(document, event);
|
|
140
|
+
console.log(` Metadata: ${JSON.stringify(metadata, null, 2)}`);
|
|
134
141
|
const enrichedVariables = {
|
|
135
142
|
...variables,
|
|
136
|
-
...
|
|
143
|
+
...metadata
|
|
137
144
|
};
|
|
138
145
|
// Create workflow payload
|
|
139
146
|
const payload = {
|
|
@@ -141,7 +148,7 @@ export class WorkflowMiddleware {
|
|
|
141
148
|
version: 1, // Default version, could be made configurable
|
|
142
149
|
variables: enrichedVariables
|
|
143
150
|
};
|
|
144
|
-
console.log('
|
|
151
|
+
console.log('📦 Workflow payload:', JSON.stringify(payload, null, 2));
|
|
145
152
|
// Trigger workflow in background
|
|
146
153
|
await this.workflowService.triggerWorkflow(payload);
|
|
147
154
|
console.log(`Workflow ${trigger.workflowKey} triggered for ${event.triggerKey}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.service.d.ts","sourceRoot":"","sources":["../../shared/workflow.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAExF,qBAAa,eAAe;IACxB,OAAO,CAAC,OAAO,CAA4B;gBAE/B,OAAO,EAAE,yBAAyB;IAS9C;;;;OAIG;IACG,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjE;;;OAGG;YACW,mBAAmB;
|
|
1
|
+
{"version":3,"file":"workflow.service.d.ts","sourceRoot":"","sources":["../../shared/workflow.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAExF,qBAAa,eAAe;IACxB,OAAO,CAAC,OAAO,CAA4B;gBAE/B,OAAO,EAAE,yBAAyB;IAS9C;;;;OAIG;IACG,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjE;;;OAGG;YACW,mBAAmB;IA6DjC;;;;;OAKG;IACH,yBAAyB,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO;IAO1F;;;;;;OAMG;IACH,gBAAgB,CACZ,iBAAiB,EAAE,MAAM,EAAE,EAC3B,iBAAiB,EAAE,MAAM,EAAE,EAC3B,QAAQ,EAAE,GAAG,GACd,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAmBtB;;;;;OAKG;IACH,OAAO,CAAC,cAAc;CAKzB"}
|
|
@@ -47,10 +47,23 @@ export class WorkflowService {
|
|
|
47
47
|
let lastError = null;
|
|
48
48
|
for (let attempt = 1; attempt <= this.options.retryAttempts; attempt++) {
|
|
49
49
|
try {
|
|
50
|
-
console.log(
|
|
50
|
+
console.log(`🚀 Workflow API call attempt ${attempt}:`);
|
|
51
|
+
console.log(` URL: ${this.options.workflowApiUrl}`);
|
|
52
|
+
console.log(` Payload: ${JSON.stringify(payload, null, 2)}`);
|
|
51
53
|
const response = await fetch(this.options.workflowApiUrl, requestOptions);
|
|
52
54
|
if (!response.ok) {
|
|
53
|
-
|
|
55
|
+
// Try to get error details from response body
|
|
56
|
+
let errorDetails = response.statusText;
|
|
57
|
+
try {
|
|
58
|
+
const errorBody = await response.text();
|
|
59
|
+
if (errorBody) {
|
|
60
|
+
errorDetails = errorBody;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
// Ignore if we can't read the body
|
|
65
|
+
}
|
|
66
|
+
throw new Error(`HTTP ${response.status}: ${errorDetails}`);
|
|
54
67
|
}
|
|
55
68
|
const result = await response.json();
|
|
56
69
|
console.log(`Workflow ${payload.workflowKey} triggered successfully:`, result);
|