@friggframework/core 2.0.0--canary.460.8b85ecb.0 → 2.0.0--canary.460.ef50528.0

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.
@@ -132,15 +132,25 @@ const createQueueWorker = (integrationClass) => {
132
132
  class QueueWorker extends Worker {
133
133
  async _run(params, context) {
134
134
  try {
135
- const integrationInstance =
136
- params.event === 'ON_WEBHOOK' && params.data?.integrationId
137
- ? await loadIntegrationForWebhook(
138
- params.data.integrationId
139
- )
140
- : await loadIntegrationForProcess(
141
- params.data?.processId,
142
- integrationClass
143
- );
135
+ if (params.event === 'ON_WEBHOOK') {
136
+ if (!params.data?.integrationId) {
137
+ throw new Error(
138
+ 'integrationId is required in data for ON_WEBHOOK event'
139
+ );
140
+ }
141
+
142
+ integrationInstance = await loadIntegrationForWebhook(
143
+ params.data.integrationId
144
+ );
145
+ } else if (params.data?.processId) {
146
+ integrationInstance = await loadIntegrationForProcess(
147
+ params.data.processId,
148
+ integrationClass
149
+ );
150
+ } else {
151
+ // Instantiates a DRY integration class without database records
152
+ integrationInstance = new integrationClass();
153
+ }
144
154
 
145
155
  const dispatcher = new IntegrationEventDispatcher(
146
156
  integrationInstance
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.460.8b85ecb.0",
4
+ "version": "2.0.0--canary.460.ef50528.0",
5
5
  "dependencies": {
6
6
  "@hapi/boom": "^10.0.1",
7
7
  "@prisma/client": "^6.16.3",
@@ -23,9 +23,9 @@
23
23
  "uuid": "^9.0.1"
24
24
  },
25
25
  "devDependencies": {
26
- "@friggframework/eslint-config": "2.0.0--canary.460.8b85ecb.0",
27
- "@friggframework/prettier-config": "2.0.0--canary.460.8b85ecb.0",
28
- "@friggframework/test": "2.0.0--canary.460.8b85ecb.0",
26
+ "@friggframework/eslint-config": "2.0.0--canary.460.ef50528.0",
27
+ "@friggframework/prettier-config": "2.0.0--canary.460.ef50528.0",
28
+ "@friggframework/test": "2.0.0--canary.460.ef50528.0",
29
29
  "@types/lodash": "4.17.15",
30
30
  "@typescript-eslint/eslint-plugin": "^8.0.0",
31
31
  "chai": "^4.3.6",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "8b85ecb96fcb4cdedca9eb6659fe4bd9bda7e841"
67
+ "gitHead": "ef50528e85534659a61cdc909e77babffc6ae0f7"
68
68
  }