@middag-io/n8n-nodes-middag 0.2.0 → 0.2.2

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.
@@ -2,7 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MiddagHubspot = void 0;
4
4
  exports.requestFor = requestFor;
5
- const n8n_workflow_1 = require("n8n-workflow");
5
+ // Deliberately no runtime import from 'n8n-workflow' here (only `import type` above): this
6
+ // package's manual-install deployment (npm install straight into an n8n instance's
7
+ // ~/.n8n/nodes) can't resolve it at runtime. `NodeConnectionTypes.Main` is the literal 'main'
8
+ // in every n8n-workflow version this targets, and `NodeOperationError` is a small, stable
9
+ // shape (message + node reference) reproduced locally below instead of subclassing n8n's own
10
+ // class, which n8n still displays as a clean node-level error.
11
+ class NodeOperationError extends Error {
12
+ constructor(node, message) {
13
+ super(message);
14
+ this.name = 'NodeOperationError';
15
+ this.node = node;
16
+ }
17
+ }
6
18
  /**
7
19
  * Calls the Worker's HubSpot proxy (`ANY /internal/hubspot/{portalId}/{path}`, docs/05,
8
20
  * "Proxy da API HubSpot") using the Cloudflare Access service token from the credential.
@@ -26,8 +38,8 @@ class MiddagHubspot {
26
38
  subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
27
39
  description: "Calls the MIDDAG Connector Worker's HubSpot proxy (/internal/hubspot/*)",
28
40
  defaults: { name: 'MIDDAG HubSpot' },
29
- inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
30
- outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
41
+ inputs: ['main'],
42
+ outputs: ['main'],
31
43
  credentials: [{ name: 'middagConnectorApi', required: true }],
32
44
  properties: [
33
45
  {
@@ -247,7 +259,7 @@ function requestFor(ctx, resource, operation, i) {
247
259
  return noteRequest(ctx, i);
248
260
  if (resource === 'association')
249
261
  return associationRequest(ctx, i);
250
- throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Unsupported resource: ${resource}`);
262
+ throw new NodeOperationError(ctx.getNode(), `Unsupported resource: ${resource}`);
251
263
  }
252
264
  function contactRequest(ctx, operation, i) {
253
265
  if (operation === 'search') {
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MiddagTrigger = void 0;
4
4
  exports.outputItemFor = outputItemFor;
5
- const n8n_workflow_1 = require("n8n-workflow");
6
5
  const middagSignature_1 = require("../shared/middagSignature");
7
6
  const deliveryDedupe_1 = require("../shared/deliveryDedupe");
8
7
  const DELIVERY_ID_HEADER = 'x-middag-delivery-id';
@@ -33,7 +32,13 @@ class MiddagTrigger {
33
32
  description: 'Starts the workflow on a signed delivery from the MIDDAG Connector Worker',
34
33
  defaults: { name: 'MIDDAG Trigger' },
35
34
  inputs: [],
36
- outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
35
+ // Deliberately the literal 'main' rather than the `NodeConnectionTypes` value export: this
36
+ // package's manual-install deployment (npm install straight into an n8n instance's
37
+ // ~/.n8n/nodes, no host node_modules resolution set up for it) can't resolve any runtime
38
+ // import from 'n8n-workflow' — only `import type` erases cleanly. `NodeConnectionTypes.Main`
39
+ // is 'main' in every n8n-workflow version this targets; see MiddagHubspot.node.ts for the
40
+ // same constraint.
41
+ outputs: ['main'],
37
42
  credentials: [{ name: 'middagConnectorApi', required: true }],
38
43
  webhooks: [
39
44
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middag-io/n8n-nodes-middag",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "n8n community nodes for the MIDDAG Connector for HubSpot: a native trigger for signed deliveries from the Worker and an action node for the HubSpot proxy.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"