@bonsae/node-red-salesforce 0.2.0 → 0.4.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.
package/index.mjs CHANGED
@@ -1,40 +1,40 @@
1
- var P = Object.defineProperty;
2
- var B = (a, o, n) => o in a ? P(a, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[o] = n;
3
- var f = (a, o) => P(a, "name", { value: o, configurable: !0 });
4
- var i = (a, o, n) => B(a, typeof o != "symbol" ? o + "" : o, n);
5
- import { fileURLToPath as q } from "url";
1
+ var z = Object.defineProperty;
2
+ var q = (a, o, n) => o in a ? z(a, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[o] = n;
3
+ var f = (a, o) => z(a, "name", { value: o, configurable: !0 });
4
+ var i = (a, o, n) => q(a, typeof o != "symbol" ? o + "" : o, n);
5
+ import { fileURLToPath as B } from "url";
6
6
  import { dirname as J } from "path";
7
7
  import { registerTypes as G } from "@bonsae/nrg/server";
8
- import { defineSchema as h, SchemaType as t, ConfigNode as Q, IONode as A, defineModule as Y } from "@bonsae/nrg/server";
8
+ import { defineSchema as h, SchemaType as e, ConfigNode as Q, IONode as k, defineModule as Y } from "@bonsae/nrg/server";
9
9
  import K from "jsforce";
10
10
  import M from "node:crypto";
11
- var V = q(import.meta.url), Lt = J(V);
11
+ var V = B(import.meta.url), ke = J(V);
12
12
  const W = h(
13
13
  {
14
- name: t.String({ default: "" }),
15
- loginUrl: t.String({
14
+ name: e.String({ default: "" }),
15
+ loginUrl: e.String({
16
16
  default: "https://login.salesforce.com",
17
17
  "x-nrg-form": { icon: "globe" }
18
18
  }),
19
- clientId: t.String({
19
+ clientId: e.String({
20
20
  default: "",
21
21
  "x-nrg-form": { icon: "key" }
22
22
  }),
23
- apiVersion: t.Union(
23
+ apiVersion: e.Union(
24
24
  [
25
- t.Literal("62.0"),
26
- t.Literal("61.0"),
27
- t.Literal("60.0"),
28
- t.Literal("59.0"),
29
- t.Literal("58.0"),
30
- t.Literal("57.0"),
31
- t.Literal("56.0"),
32
- t.Literal("55.0")
25
+ e.Literal("62.0"),
26
+ e.Literal("61.0"),
27
+ e.Literal("60.0"),
28
+ e.Literal("59.0"),
29
+ e.Literal("58.0"),
30
+ e.Literal("57.0"),
31
+ e.Literal("56.0"),
32
+ e.Literal("55.0")
33
33
  ],
34
34
  { default: "62.0", "x-nrg-form": { icon: "code-fork" } }
35
35
  ),
36
- callbackUrl: t.Optional(
37
- t.String({
36
+ callbackUrl: e.Optional(
37
+ e.String({
38
38
  default: "",
39
39
  "x-nrg-form": { icon: "exchange" }
40
40
  })
@@ -43,12 +43,12 @@ const W = h(
43
43
  { $id: "salesforce-connection:config" }
44
44
  ), X = h(
45
45
  {
46
- accessToken: t.String({ default: "", format: "password" }),
47
- refreshToken: t.String({ default: "", format: "password" }),
48
- instanceUrl: t.String({ default: "" })
46
+ accessToken: e.String({ default: "", format: "password" }),
47
+ refreshToken: e.String({ default: "", format: "password" }),
48
+ instanceUrl: e.String({ default: "" })
49
49
  },
50
50
  { $id: "salesforce-connection:credentials" }
51
- ), H = 600 * 1e3, k = /* @__PURE__ */ new Map();
51
+ ), H = 600 * 1e3, E = /* @__PURE__ */ new Map();
52
52
  function Z() {
53
53
  return M.randomBytes(32).toString("base64url");
54
54
  }
@@ -58,8 +58,8 @@ function D(a) {
58
58
  }
59
59
  f(D, "generateCodeChallenge");
60
60
  function _(a) {
61
- const o = M.randomUUID(), n = Z(), e = D(n);
62
- k.set(o, {
61
+ const o = M.randomUUID(), n = Z(), t = D(n);
62
+ E.set(o, {
63
63
  codeVerifier: n,
64
64
  nodeId: a.nodeId,
65
65
  clientId: a.clientId,
@@ -67,46 +67,46 @@ function _(a) {
67
67
  callbackUrl: a.callbackUrl,
68
68
  timestamp: Date.now()
69
69
  });
70
- for (const [s, r] of k)
71
- Date.now() - r.timestamp > H && k.delete(s);
72
- return { state: o, codeChallenge: e };
70
+ for (const [r, s] of E)
71
+ Date.now() - s.timestamp > H && E.delete(r);
72
+ return { state: o, codeChallenge: t };
73
73
  }
74
74
  f(_, "createAuthState");
75
- function tt(a) {
76
- const o = k.get(a);
77
- return !o || (k.delete(a), Date.now() - o.timestamp > H) ? null : o;
75
+ function ee(a) {
76
+ const o = E.get(a);
77
+ return !o || (E.delete(a), Date.now() - o.timestamp > H) ? null : o;
78
78
  }
79
- f(tt, "consumeAuthState");
80
- function et(a) {
79
+ f(ee, "consumeAuthState");
80
+ function te(a) {
81
81
  return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
82
82
  }
83
- f(et, "escapeHtml");
84
- function F(a, o = !0) {
83
+ f(te, "escapeHtml");
84
+ function A(a, o = !0) {
85
85
  const n = o ? "<script>setTimeout(function(){window.close()},3000)</script>" : "";
86
- return `<html><body><h2>Authorization Failed</h2><p>${et(a)}</p>${n}</body></html>`;
86
+ return `<html><body><h2>Authorization Failed</h2><p>${te(a)}</p>${n}</body></html>`;
87
87
  }
88
- f(F, "errorPage");
89
- function nt(a) {
88
+ f(A, "errorPage");
89
+ function ne(a) {
90
90
  const o = (a.settings.httpAdminRoot || "").replace(
91
91
  /\/$/,
92
92
  ""
93
93
  );
94
- a.httpAdmin.post("/salesforce/auth/start", (n, e) => {
94
+ a.httpAdmin.post("/salesforce/auth/start", (n, t) => {
95
95
  try {
96
96
  const {
97
- nodeId: s,
98
- loginUrl: r,
97
+ nodeId: r,
98
+ loginUrl: s,
99
99
  clientId: l,
100
100
  callbackUrl: d
101
101
  } = n.body;
102
- if (!s || !r || !l) {
103
- e.status(400).json({ error: "nodeId, loginUrl, and clientId are required" });
102
+ if (!r || !s || !l) {
103
+ t.status(400).json({ error: "nodeId, loginUrl, and clientId are required" });
104
104
  return;
105
105
  }
106
106
  const c = d || `${n.protocol}://${n.get("host")}${o}/salesforce/auth/callback`, { state: g, codeChallenge: u } = _({
107
- nodeId: s,
107
+ nodeId: r,
108
108
  clientId: l,
109
- loginUrl: r,
109
+ loginUrl: s,
110
110
  callbackUrl: c
111
111
  }), m = new URLSearchParams({
112
112
  response_type: "code",
@@ -116,31 +116,31 @@ function nt(a) {
116
116
  code_challenge: u,
117
117
  code_challenge_method: "S256"
118
118
  });
119
- e.json({
120
- authorizationUrl: `${r}/services/oauth2/authorize?${m.toString()}`
119
+ t.json({
120
+ authorizationUrl: `${s}/services/oauth2/authorize?${m.toString()}`
121
121
  });
122
- } catch (s) {
122
+ } catch (r) {
123
123
  a.log.error(
124
- `salesforce-connection: auth/start error: ${s instanceof Error ? s.message : String(s)}`
125
- ), e.status(500).json({ error: "Failed to start authorization" });
124
+ `salesforce-connection: auth/start error: ${r instanceof Error ? r.message : String(r)}`
125
+ ), t.status(500).json({ error: "Failed to start authorization" });
126
126
  }
127
- }), a.httpAdmin.get("/salesforce/auth/callback", async (n, e) => {
127
+ }), a.httpAdmin.get("/salesforce/auth/callback", async (n, t) => {
128
128
  try {
129
- const { code: s, state: r, error: l, error_description: d } = n.query;
129
+ const { code: r, state: s, error: l, error_description: d } = n.query;
130
130
  if (l) {
131
131
  a.log.error(
132
132
  `salesforce-connection: OAuth error: ${l} - ${d}`
133
- ), e.status(400).send(F(String(d || l)));
133
+ ), t.status(400).send(A(String(d || l)));
134
134
  return;
135
135
  }
136
- if (!s || !r) {
137
- e.status(400).send(F("Missing code or state parameter"));
136
+ if (!r || !s) {
137
+ t.status(400).send(A("Missing code or state parameter"));
138
138
  return;
139
139
  }
140
- const c = tt(r);
140
+ const c = ee(s);
141
141
  if (!c) {
142
- e.status(400).send(
143
- F(
142
+ t.status(400).send(
143
+ A(
144
144
  "Invalid or expired authorization state. Please try again."
145
145
  )
146
146
  );
@@ -153,7 +153,7 @@ function nt(a) {
153
153
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
154
154
  body: new URLSearchParams({
155
155
  grant_type: "authorization_code",
156
- code: s,
156
+ code: r,
157
157
  client_id: c.clientId,
158
158
  redirect_uri: c.callbackUrl,
159
159
  code_verifier: c.codeVerifier
@@ -164,8 +164,8 @@ function nt(a) {
164
164
  const p = await g.text();
165
165
  a.log.error(
166
166
  `salesforce-connection: Token exchange failed: ${p}`
167
- ), e.status(500).send(
168
- F(
167
+ ), t.status(500).send(
168
+ A(
169
169
  "Token exchange failed. Check the Node-RED logs for details."
170
170
  )
171
171
  );
@@ -186,7 +186,7 @@ function nt(a) {
186
186
  refreshToken: u.refresh_token,
187
187
  instanceUrl: u.instance_url
188
188
  });
189
- e.send(`<!DOCTYPE html>
189
+ t.send(`<!DOCTYPE html>
190
190
  <html>
191
191
  <body>
192
192
  <h2>Authorization Successful</h2>
@@ -199,35 +199,35 @@ function nt(a) {
199
199
  </script>
200
200
  </body>
201
201
  </html>`);
202
- } catch (s) {
202
+ } catch (r) {
203
203
  a.log.error(
204
- `salesforce-connection: auth/callback error: ${s instanceof Error ? s.message : String(s)}`
205
- ), e.status(500).send(F("An unexpected error occurred."));
204
+ `salesforce-connection: auth/callback error: ${r instanceof Error ? r.message : String(r)}`
205
+ ), t.status(500).send(A("An unexpected error occurred."));
206
206
  }
207
- }), a.httpAdmin.get("/salesforce/auth/status/:nodeId", (n, e) => {
207
+ }), a.httpAdmin.get("/salesforce/auth/status/:nodeId", (n, t) => {
208
208
  try {
209
- const s = a.nodes.getCredentials(n.params.nodeId), r = !!(s != null && s.accessToken && (s != null && s.instanceUrl));
210
- e.json({
211
- authenticated: r,
212
- instanceUrl: r ? s.instanceUrl : void 0
209
+ const r = a.nodes.getCredentials(n.params.nodeId), s = !!(r != null && r.accessToken && (r != null && r.instanceUrl));
210
+ t.json({
211
+ authenticated: s,
212
+ instanceUrl: s ? r.instanceUrl : void 0
213
213
  });
214
214
  } catch {
215
- e.json({ authenticated: !1 });
215
+ t.json({ authenticated: !1 });
216
216
  }
217
217
  });
218
218
  }
219
- f(nt, "initAuthRoutes");
220
- function ot(a) {
221
- nt(a);
219
+ f(ne, "initAuthRoutes");
220
+ function oe(a) {
221
+ ne(a);
222
222
  }
223
- f(ot, "initRoutes");
224
- const C = class C extends Q {
223
+ f(oe, "initRoutes");
224
+ const L = class L extends Q {
225
225
  constructor() {
226
226
  super(...arguments);
227
227
  i(this, "conn", null);
228
228
  }
229
229
  static async registered(n) {
230
- ot(n);
230
+ oe(n);
231
231
  }
232
232
  async getConnection() {
233
233
  if (this.conn) return this.conn;
@@ -245,10 +245,10 @@ const C = class C extends Q {
245
245
  accessToken: n.accessToken,
246
246
  refreshToken: n.refreshToken,
247
247
  version: this.config.apiVersion
248
- }), this.conn.on("refresh", (e) => {
248
+ }), this.conn.on("refresh", (t) => {
249
249
  this.RED.nodes.addCredentials(this.id, {
250
250
  ...this.credentials,
251
- accessToken: e
251
+ accessToken: t
252
252
  });
253
253
  }), this.conn;
254
254
  }
@@ -264,15 +264,15 @@ const C = class C extends Q {
264
264
  this.conn = null;
265
265
  }
266
266
  };
267
- f(C, "SalesforceConnection"), i(C, "type", "salesforce-connection"), i(C, "configSchema", W), i(C, "credentialsSchema", X);
268
- let w = C;
269
- const it = h(
267
+ f(L, "SalesforceConnection"), i(L, "type", "salesforce-connection"), i(L, "configSchema", W), i(L, "credentialsSchema", X);
268
+ let $ = L;
269
+ const ie = h(
270
270
  {
271
- name: t.String({ default: "", "x-nrg-form": { icon: "tag" } }),
272
- connection: t.NodeRef(w, {
271
+ name: e.String({ default: "", "x-nrg-form": { icon: "tag" } }),
272
+ connection: e.NodeRef($, {
273
273
  "x-nrg-form": { icon: "cloud" }
274
274
  }),
275
- query: t.TypedInput({
275
+ query: e.TypedInput({
276
276
  "x-nrg-form": {
277
277
  icon: "search",
278
278
  typedInputTypes: ["str", "msg", "flow", "global"]
@@ -280,19 +280,19 @@ const it = h(
280
280
  })
281
281
  },
282
282
  { $id: "salesforce-soql:config" }
283
- ), st = h(
283
+ ), re = h(
284
284
  {
285
- payload: t.Any()
285
+ payload: e.Any()
286
286
  },
287
287
  { $id: "salesforce-soql:input" }
288
- ), rt = h(
288
+ ), se = h(
289
289
  {
290
- payload: t.Array(t.Any()),
291
- totalSize: t.Number(),
292
- done: t.Boolean()
290
+ payload: e.Array(e.Any()),
291
+ totalSize: e.Number(),
292
+ done: e.Boolean()
293
293
  },
294
294
  { $id: "salesforce-soql:output" }
295
- ), y = class y extends A {
295
+ ), y = class y extends k {
296
296
  async input(o) {
297
297
  const n = this.config.connection;
298
298
  if (!n) {
@@ -301,76 +301,76 @@ const it = h(
301
301
  }
302
302
  try {
303
303
  this.status({ fill: "green", shape: "dot", text: "querying..." });
304
- const e = await n.getConnection(), s = await this.config.query.resolve(o), r = await e.query(s);
304
+ const t = await n.getConnection(), r = await this.config.query.resolve(o), s = await t.query(r);
305
305
  this.status({
306
306
  fill: "green",
307
307
  shape: "dot",
308
- text: `${r.totalSize} records`
308
+ text: `${s.totalSize} records`
309
309
  }), this.send({
310
310
  ...o,
311
- payload: r.records,
312
- totalSize: r.totalSize,
313
- done: r.done
311
+ payload: s.records,
312
+ totalSize: s.totalSize,
313
+ done: s.done
314
314
  });
315
- } catch (e) {
315
+ } catch (t) {
316
316
  this.status({
317
317
  fill: "red",
318
318
  shape: "dot",
319
- text: e instanceof Error ? e.message : String(e)
319
+ text: t instanceof Error ? t.message : String(t)
320
320
  }), this.error(
321
- `SOQL query failed: ${e instanceof Error ? e.message : String(e)}`,
321
+ `SOQL query failed: ${t instanceof Error ? t.message : String(t)}`,
322
322
  o
323
323
  );
324
324
  }
325
325
  }
326
326
  };
327
- f(y, "SalesforceSoql"), i(y, "type", "salesforce-soql"), i(y, "category", "salesforce"), i(y, "color", "#FFFFFF"), i(y, "inputs", 1), i(y, "outputs", 1), i(y, "configSchema", it), i(y, "inputSchema", st), i(y, "outputsSchema", rt);
328
- let R = y;
329
- const at = h(
327
+ f(y, "SalesforceSoql"), i(y, "type", "salesforce-soql"), i(y, "category", "salesforce"), i(y, "color", "#FFFFFF"), i(y, "configSchema", ie), i(y, "inputSchema", re), i(y, "outputsSchema", se);
328
+ let C = y;
329
+ const ae = h(
330
330
  {
331
- name: t.String({ default: "", "x-nrg-form": { icon: "tag" } }),
332
- connection: t.NodeRef(w, {
331
+ name: e.String({ default: "", "x-nrg-form": { icon: "tag" } }),
332
+ connection: e.NodeRef($, {
333
333
  "x-nrg-form": { icon: "cloud" }
334
334
  }),
335
- operation: t.Union(
335
+ operation: e.Union(
336
336
  [
337
- t.Literal("create"),
338
- t.Literal("read"),
339
- t.Literal("update"),
340
- t.Literal("delete"),
341
- t.Literal("upsert")
337
+ e.Literal("create"),
338
+ e.Literal("read"),
339
+ e.Literal("update"),
340
+ e.Literal("delete"),
341
+ e.Literal("upsert")
342
342
  ],
343
343
  { default: "create", "x-nrg-form": { icon: "pencil" } }
344
344
  ),
345
- sObjectType: t.TypedInput({
345
+ sObjectType: e.TypedInput({
346
346
  "x-nrg-form": {
347
347
  icon: "cube",
348
348
  typedInputTypes: ["str", "msg"]
349
349
  }
350
350
  }),
351
- record: t.TypedInput({
351
+ record: e.TypedInput({
352
352
  "x-nrg-form": {
353
353
  icon: "file-code-o",
354
354
  typedInputTypes: ["json", "msg"]
355
355
  }
356
356
  }),
357
- externalIdField: t.Optional(
358
- t.String({
357
+ externalIdField: e.Optional(
358
+ e.String({
359
359
  default: "",
360
360
  "x-nrg-form": { icon: "key" }
361
361
  })
362
362
  ),
363
- emitError: t.Boolean({ default: !1 }),
364
- emitComplete: t.Boolean({ default: !1 }),
365
- emitStatus: t.Boolean({ default: !1 })
363
+ emitError: e.Boolean({ default: !1 }),
364
+ emitComplete: e.Boolean({ default: !1 }),
365
+ emitStatus: e.Boolean({ default: !1 })
366
366
  },
367
367
  {
368
368
  $id: "salesforce-dml:config",
369
- if: t.Object({
370
- operation: t.Literal("upsert")
369
+ if: e.Object({
370
+ operation: e.Literal("upsert")
371
371
  }),
372
- then: t.Object({
373
- externalIdField: t.String({ minLength: 1 })
372
+ then: e.Object({
373
+ externalIdField: e.String({ minLength: 1 })
374
374
  }),
375
375
  errorMessage: {
376
376
  properties: {
@@ -378,17 +378,17 @@ const at = h(
378
378
  }
379
379
  }
380
380
  }
381
- ), ct = h(
381
+ ), ce = h(
382
382
  {
383
- payload: t.Any()
383
+ payload: e.Any()
384
384
  },
385
385
  { $id: "salesforce-dml:input" }
386
- ), lt = h(
386
+ ), le = h(
387
387
  {
388
- payload: t.Any()
388
+ payload: e.Any()
389
389
  },
390
390
  { $id: "salesforce-dml:output" }
391
- ), x = class x extends A {
391
+ ), x = class x extends k {
392
392
  async input(o) {
393
393
  const n = this.config.connection;
394
394
  if (!n) {
@@ -396,11 +396,11 @@ const at = h(
396
396
  return;
397
397
  }
398
398
  try {
399
- const e = this.config.operation;
400
- this.status({ fill: "green", shape: "dot", text: `${e}...` });
401
- const s = await n.getConnection(), r = await this.config.sObjectType.resolve(o), l = s.sobject(r), d = await this.config.record.resolve(o) ?? o.payload;
399
+ const t = this.config.operation;
400
+ this.status({ fill: "green", shape: "dot", text: `${t}...` });
401
+ const r = await n.getConnection(), s = await this.config.sObjectType.resolve(o), l = r.sobject(s), d = await this.config.record.resolve(o) ?? o.payload;
402
402
  let c;
403
- switch (e) {
403
+ switch (t) {
404
404
  case "create":
405
405
  c = await l.create(d);
406
406
  break;
@@ -417,98 +417,93 @@ const at = h(
417
417
  c = await l.upsert(d, this.config.externalIdField);
418
418
  break;
419
419
  default:
420
- throw new Error(`Unknown operation: ${e}`);
420
+ throw new Error(`Unknown operation: ${t}`);
421
421
  }
422
- this.status({ fill: "green", shape: "dot", text: `${e} done` }), this.send({ ...o, payload: c });
423
- } catch (e) {
422
+ this.status({ fill: "green", shape: "dot", text: `${t} done` }), this.send({ ...o, payload: c });
423
+ } catch (t) {
424
424
  this.status({
425
425
  fill: "red",
426
426
  shape: "dot",
427
- text: e instanceof Error ? e.message : String(e)
427
+ text: t instanceof Error ? t.message : String(t)
428
428
  }), this.error(
429
- `DML ${this.config.operation} failed: ${e instanceof Error ? e.message : String(e)}`,
429
+ `DML ${this.config.operation} failed: ${t instanceof Error ? t.message : String(t)}`,
430
430
  o
431
431
  );
432
432
  }
433
433
  }
434
434
  };
435
- f(x, "SalesforceDml"), i(x, "type", "salesforce-dml"), i(x, "category", "salesforce"), i(x, "color", "#FFFFFF"), i(x, "inputs", 1), i(x, "outputs", 1), i(x, "configSchema", at), i(x, "inputSchema", ct), i(x, "outputsSchema", lt);
436
- let S = x;
437
- const dt = h(
435
+ f(x, "SalesforceDml"), i(x, "type", "salesforce-dml"), i(x, "category", "salesforce"), i(x, "color", "#FFFFFF"), i(x, "configSchema", ae), i(x, "inputSchema", ce), i(x, "outputsSchema", le);
436
+ let R = x;
437
+ const de = h(
438
438
  {
439
- name: t.String({ default: "", "x-nrg-form": { icon: "tag" } }),
440
- connection: t.NodeRef(w, {
439
+ name: e.String({ default: "", "x-nrg-form": { icon: "tag" } }),
440
+ connection: e.NodeRef($, {
441
441
  "x-nrg-form": { icon: "cloud" }
442
442
  }),
443
- operation: t.Union(
443
+ operation: e.Union(
444
444
  [
445
- t.Literal("insert"),
446
- t.Literal("update"),
447
- t.Literal("upsert"),
448
- t.Literal("delete"),
449
- t.Literal("query")
445
+ e.Literal("insert"),
446
+ e.Literal("update"),
447
+ e.Literal("upsert"),
448
+ e.Literal("delete"),
449
+ e.Literal("query")
450
450
  ],
451
451
  { default: "insert", "x-nrg-form": { icon: "database" } }
452
452
  ),
453
- sObjectType: t.TypedInput({
453
+ sObjectType: e.TypedInput({
454
454
  "x-nrg-form": {
455
455
  icon: "cube",
456
456
  typedInputTypes: ["str", "msg"]
457
457
  }
458
458
  }),
459
- externalIdField: t.Optional(
460
- t.String({
459
+ externalIdField: e.Optional(
460
+ e.String({
461
461
  default: "",
462
462
  "x-nrg-form": { icon: "key" }
463
463
  })
464
464
  ),
465
- assignmentRuleId: t.Optional(
466
- t.String({
465
+ assignmentRuleId: e.Optional(
466
+ e.String({
467
467
  default: "",
468
468
  "x-nrg-form": { icon: "gavel" }
469
469
  })
470
470
  ),
471
- columnDelimiter: t.Union(
471
+ columnDelimiter: e.Union(
472
472
  [
473
- t.Literal("COMMA"),
474
- t.Literal("TAB"),
475
- t.Literal("PIPE"),
476
- t.Literal("SEMICOLON"),
477
- t.Literal("CARET"),
478
- t.Literal("BACKQUOTE")
473
+ e.Literal("COMMA"),
474
+ e.Literal("TAB"),
475
+ e.Literal("PIPE"),
476
+ e.Literal("SEMICOLON"),
477
+ e.Literal("CARET"),
478
+ e.Literal("BACKQUOTE")
479
479
  ],
480
480
  { default: "COMMA", "x-nrg-form": { icon: "columns" } }
481
481
  ),
482
- lineEnding: t.Union(
483
- [t.Literal("LF"), t.Literal("CRLF")],
482
+ lineEnding: e.Union(
483
+ [e.Literal("LF"), e.Literal("CRLF")],
484
484
  { default: "LF", "x-nrg-form": { icon: "level-down" } }
485
485
  ),
486
- pollInterval: t.Number({
486
+ pollInterval: e.Number({
487
487
  default: 5e3,
488
488
  minimum: 1e3,
489
489
  "x-nrg-form": { icon: "clock-o" }
490
490
  }),
491
- pollTimeout: t.Number({
491
+ pollTimeout: e.Number({
492
492
  default: 6e4,
493
493
  minimum: 5e3,
494
494
  "x-nrg-form": { icon: "hourglass" }
495
495
  }),
496
- emitJobCreated: t.Boolean({
497
- default: !1,
498
- "x-nrg-form": { icon: "flag", toggle: !0 }
499
- }),
500
- outputs: t.Number({ default: 2 }),
501
- emitError: t.Boolean({ default: !1 }),
502
- emitComplete: t.Boolean({ default: !1 }),
503
- emitStatus: t.Boolean({ default: !1 })
496
+ emitError: e.Boolean({ default: !1 }),
497
+ emitComplete: e.Boolean({ default: !0 }),
498
+ emitStatus: e.Boolean({ default: !1 })
504
499
  },
505
500
  {
506
501
  $id: "salesforce-bulk:config",
507
- if: t.Object({
508
- operation: t.Literal("upsert")
502
+ if: e.Object({
503
+ operation: e.Literal("upsert")
509
504
  }),
510
- then: t.Object({
511
- externalIdField: t.String({ minLength: 1 })
505
+ then: e.Object({
506
+ externalIdField: e.String({ minLength: 1 })
512
507
  }),
513
508
  errorMessage: {
514
509
  properties: {
@@ -516,29 +511,30 @@ const dt = h(
516
511
  }
517
512
  }
518
513
  }
519
- ), ut = h(
514
+ ), ue = h(
520
515
  {
521
- payload: t.Any()
516
+ payload: e.Any()
522
517
  },
523
518
  { $id: "salesforce-bulk:input" }
524
519
  );
525
520
  h(
526
521
  {
527
- payload: t.Array(t.Any())
522
+ payload: e.Array(e.Any())
528
523
  },
529
524
  { $id: "salesforce-bulk:output" }
530
525
  );
531
- const I = class I extends A {
526
+ const he = h(
527
+ {},
528
+ { $id: "salesforce-bulk:record-output" }
529
+ ), pe = h(
530
+ {},
531
+ { $id: "salesforce-bulk:job-created-output" }
532
+ ), b = class b extends k {
532
533
  sendRecord(o, n) {
533
- const e = this.config.emitJobCreated ? 3 : 2, s = Array(e).fill(null);
534
- s[0] = { ...o, payload: n }, this.send(s);
534
+ this.sendToPort(0, { ...o, payload: n });
535
535
  }
536
536
  sendJobCreated(o, n) {
537
- this.config.emitJobCreated && this.send([null, null, { ...o, payload: n }]);
538
- }
539
- sendComplete(o, n) {
540
- const e = this.config.emitJobCreated ? 3 : 2, s = Array(e).fill(null);
541
- s[1] = { ...o, payload: n }, this.send(s);
537
+ this.sendToPort(1, { ...o, payload: n });
542
538
  }
543
539
  async input(o) {
544
540
  const n = this.config.connection;
@@ -547,16 +543,16 @@ const I = class I extends A {
547
543
  return;
548
544
  }
549
545
  try {
550
- const e = this.config.operation;
546
+ const t = this.config.operation;
551
547
  this.status({
552
548
  fill: "green",
553
549
  shape: "dot",
554
- text: `bulk ${e}...`
550
+ text: `bulk ${t}...`
555
551
  });
556
- const s = await n.getConnection(), r = await this.config.sObjectType.resolve(o);
552
+ const r = await n.getConnection(), s = await this.config.sObjectType.resolve(o);
557
553
  let l = 0;
558
- if (e === "query") {
559
- const d = await s.bulk2.query(o.payload, {
554
+ if (t === "query") {
555
+ const d = await r.bulk2.query(o.payload, {
560
556
  pollTimeout: this.config.pollTimeout,
561
557
  pollInterval: this.config.pollInterval,
562
558
  columnDelimiter: this.config.columnDelimiter,
@@ -569,21 +565,24 @@ const I = class I extends A {
569
565
  }), this.status({
570
566
  fill: "green",
571
567
  shape: "dot",
572
- text: `bulk ${e}: ${l} records`
573
- }), this.sendComplete(o, { operation: e, sObjectType: r, totalRecords: l });
568
+ text: `bulk ${t}: ${l} records`
569
+ }), this.sendToPort("complete", {
570
+ ...o,
571
+ payload: { operation: t, sObjectType: s, totalRecords: l }
572
+ });
574
573
  } else {
575
- const d = o.payload, c = s.bulk2.createJob({
576
- operation: e,
577
- object: r,
574
+ const d = o.payload, c = r.bulk2.createJob({
575
+ operation: t,
576
+ object: s,
578
577
  columnDelimiter: this.config.columnDelimiter,
579
578
  lineEnding: this.config.lineEnding,
580
- ...e === "upsert" && this.config.externalIdField ? { externalIdFieldName: this.config.externalIdField } : {},
579
+ ...t === "upsert" && this.config.externalIdField ? { externalIdFieldName: this.config.externalIdField } : {},
581
580
  ...this.config.assignmentRuleId ? { assignmentRuleId: this.config.assignmentRuleId } : {}
582
581
  });
583
582
  await c.open(), this.sendJobCreated(o, {
584
583
  jobId: c.id,
585
- operation: e,
586
- sObjectType: r,
584
+ operation: t,
585
+ sObjectType: s,
587
586
  state: "Open"
588
587
  }), await c.uploadData(d), await c.close(), await c.poll(this.config.pollInterval, this.config.pollTimeout);
589
588
  const g = await c.getAllResults(), u = g.successfulResults ?? [], m = g.failedResults ?? [], p = g.unprocessedRecords ?? [];
@@ -592,62 +591,68 @@ const I = class I extends A {
592
591
  this.sendRecord(o, U);
593
592
  for (const U of m)
594
593
  this.sendRecord(o, U);
595
- const L = u.length, z = m.length;
594
+ const S = u.length, P = m.length;
596
595
  this.status({
597
- fill: z > 0 ? "red" : "green",
596
+ fill: P > 0 ? "red" : "green",
598
597
  shape: "dot",
599
- text: `bulk ${e}: ${l} records`
600
- }), this.sendComplete(o, {
601
- jobId: c.id,
602
- operation: e,
603
- sObjectType: r,
604
- totalRecords: l,
605
- successCount: L,
606
- failureCount: z,
607
- unprocessedCount: p.length
598
+ text: `bulk ${t}: ${l} records`
599
+ }), this.sendToPort("complete", {
600
+ ...o,
601
+ payload: {
602
+ jobId: c.id,
603
+ operation: t,
604
+ sObjectType: s,
605
+ totalRecords: l,
606
+ successCount: S,
607
+ failureCount: P,
608
+ unprocessedCount: p.length
609
+ }
608
610
  });
609
611
  }
610
- } catch (e) {
611
- const s = e instanceof Error ? e.message : String(e);
612
- this.status({ fill: "red", shape: "dot", text: s }), this.error(`Bulk ${this.config.operation} failed: ${s}`, o);
612
+ } catch (t) {
613
+ const r = t instanceof Error ? t.message : String(t);
614
+ this.status({ fill: "red", shape: "dot", text: r }), this.error(`Bulk ${this.config.operation} failed: ${r}`, o);
613
615
  }
614
616
  }
615
617
  };
616
- f(I, "SalesforceBulk"), i(I, "type", "salesforce-bulk"), i(I, "category", "salesforce"), i(I, "color", "#FFFFFF"), i(I, "inputs", 1), i(I, "outputs", 2), i(I, "configSchema", dt), i(I, "inputSchema", ut);
617
- let O = I;
618
- const ht = h(
618
+ f(b, "SalesforceBulk"), i(b, "type", "salesforce-bulk"), i(b, "category", "salesforce"), i(b, "color", "#FFFFFF"), i(b, "configSchema", de), i(b, "inputSchema", ue), i(b, "outputsSchema", [
619
+ he,
620
+ pe
621
+ ]);
622
+ let O = b;
623
+ const fe = h(
619
624
  {
620
- name: t.String({ default: "", "x-nrg-form": { icon: "tag" } }),
621
- connection: t.NodeRef(w, {
625
+ name: e.String({ default: "", "x-nrg-form": { icon: "tag" } }),
626
+ connection: e.NodeRef($, {
622
627
  "x-nrg-form": { icon: "cloud" }
623
628
  }),
624
- sObjectType: t.TypedInput({
629
+ sObjectType: e.TypedInput({
625
630
  "x-nrg-form": {
626
631
  icon: "cube",
627
632
  typedInputTypes: ["str", "msg"]
628
633
  }
629
634
  }),
630
- emitError: t.Boolean({ default: !1 }),
631
- emitComplete: t.Boolean({ default: !1 }),
632
- emitStatus: t.Boolean({ default: !1 })
635
+ emitError: e.Boolean({ default: !1 }),
636
+ emitComplete: e.Boolean({ default: !1 }),
637
+ emitStatus: e.Boolean({ default: !1 })
633
638
  },
634
639
  { $id: "salesforce-describe:config" }
635
- ), pt = h(
640
+ ), ge = h(
636
641
  {
637
- payload: t.Any()
642
+ payload: e.Any()
638
643
  },
639
644
  { $id: "salesforce-describe:input" }
640
- ), ft = h(
645
+ ), me = h(
641
646
  {
642
- payload: t.Object({
643
- name: t.String(),
644
- fields: t.Array(t.Any()),
645
- childRelationships: t.Array(t.Any()),
646
- recordTypeInfos: t.Array(t.Any())
647
+ payload: e.Object({
648
+ name: e.String(),
649
+ fields: e.Array(e.Any()),
650
+ childRelationships: e.Array(e.Any()),
651
+ recordTypeInfos: e.Array(e.Any())
647
652
  })
648
653
  },
649
654
  { $id: "salesforce-describe:output" }
650
- ), b = class b extends A {
655
+ ), T = class T extends k {
651
656
  async input(o) {
652
657
  const n = this.config.connection;
653
658
  if (!n) {
@@ -656,74 +661,74 @@ const ht = h(
656
661
  }
657
662
  try {
658
663
  this.status({ fill: "green", shape: "dot", text: "describing..." });
659
- const e = await n.getConnection(), s = await this.config.sObjectType.resolve(o), r = await e.sobject(s).describe();
664
+ const t = await n.getConnection(), r = await this.config.sObjectType.resolve(o), s = await t.sobject(r).describe();
660
665
  this.status({
661
666
  fill: "green",
662
667
  shape: "dot",
663
- text: `${r.name}: ${r.fields.length} fields`
668
+ text: `${s.name}: ${s.fields.length} fields`
664
669
  }), this.send({
665
670
  ...o,
666
671
  payload: {
667
- name: r.name,
668
- fields: r.fields,
669
- childRelationships: r.childRelationships,
670
- recordTypeInfos: r.recordTypeInfos
672
+ name: s.name,
673
+ fields: s.fields,
674
+ childRelationships: s.childRelationships,
675
+ recordTypeInfos: s.recordTypeInfos
671
676
  }
672
677
  });
673
- } catch (e) {
678
+ } catch (t) {
674
679
  this.status({
675
680
  fill: "red",
676
681
  shape: "dot",
677
- text: e instanceof Error ? e.message : String(e)
682
+ text: t instanceof Error ? t.message : String(t)
678
683
  }), this.error(
679
- `Describe failed: ${e instanceof Error ? e.message : String(e)}`,
684
+ `Describe failed: ${t instanceof Error ? t.message : String(t)}`,
680
685
  o
681
686
  );
682
687
  }
683
688
  }
684
689
  };
685
- f(b, "SalesforceDescribe"), i(b, "type", "salesforce-describe"), i(b, "category", "salesforce"), i(b, "color", "#FFFFFF"), i(b, "inputs", 1), i(b, "outputs", 1), i(b, "configSchema", ht), i(b, "inputSchema", pt), i(b, "outputsSchema", ft);
686
- let j = b;
687
- const gt = h(
690
+ f(T, "SalesforceDescribe"), i(T, "type", "salesforce-describe"), i(T, "category", "salesforce"), i(T, "color", "#FFFFFF"), i(T, "configSchema", fe), i(T, "inputSchema", ge), i(T, "outputsSchema", me);
691
+ let j = T;
692
+ const ye = h(
688
693
  {
689
- name: t.String({ default: "", "x-nrg-form": { icon: "tag" } }),
690
- connection: t.NodeRef(w, {
694
+ name: e.String({ default: "", "x-nrg-form": { icon: "tag" } }),
695
+ connection: e.NodeRef($, {
691
696
  "x-nrg-form": { icon: "cloud" }
692
697
  }),
693
- channelName: t.String({
698
+ channelName: e.String({
694
699
  default: "",
695
700
  "x-nrg-form": { icon: "rss" }
696
701
  }),
697
- subscribeType: t.Union(
702
+ subscribeType: e.Union(
698
703
  [
699
- t.Literal("LATEST"),
700
- t.Literal("EARLIEST"),
701
- t.Literal("CUSTOM")
704
+ e.Literal("LATEST"),
705
+ e.Literal("EARLIEST"),
706
+ e.Literal("CUSTOM")
702
707
  ],
703
708
  { default: "LATEST", "x-nrg-form": { icon: "history" } }
704
709
  ),
705
- replayId: t.Optional(
706
- t.String({
710
+ replayId: e.Optional(
711
+ e.String({
707
712
  default: "",
708
713
  "x-nrg-form": { icon: "bookmark" }
709
714
  })
710
715
  ),
711
- numRequested: t.Number({
716
+ numRequested: e.Number({
712
717
  default: 100,
713
718
  minimum: 1,
714
719
  maximum: 100,
715
720
  "x-nrg-form": { icon: "sort-numeric-asc" }
716
721
  }),
717
- emitError: t.Boolean({ default: !1 }),
718
- emitStatus: t.Boolean({ default: !1 })
722
+ emitError: e.Boolean({ default: !1 }),
723
+ emitStatus: e.Boolean({ default: !1 })
719
724
  },
720
725
  {
721
726
  $id: "salesforce-streaming:config",
722
- if: t.Object({
723
- subscribeType: t.Literal("CUSTOM")
727
+ if: e.Object({
728
+ subscribeType: e.Literal("CUSTOM")
724
729
  }),
725
- then: t.Object({
726
- replayId: t.String({ minLength: 1 })
730
+ then: e.Object({
731
+ replayId: e.String({ minLength: 1 })
727
732
  }),
728
733
  errorMessage: {
729
734
  properties: {
@@ -731,15 +736,15 @@ const gt = h(
731
736
  }
732
737
  }
733
738
  }
734
- ), mt = h(
739
+ ), xe = h(
735
740
  {
736
- payload: t.Any(),
737
- replayId: t.Any(),
738
- channel: t.String(),
739
- topic: t.String()
741
+ payload: e.Any(),
742
+ replayId: e.Any(),
743
+ channel: e.String(),
744
+ topic: e.String()
740
745
  },
741
746
  { $id: "salesforce-streaming:output" }
742
- ), $ = class $ extends A {
747
+ ), w = class w extends k {
743
748
  constructor() {
744
749
  super(...arguments);
745
750
  i(this, "client", null);
@@ -761,23 +766,23 @@ const gt = h(
761
766
  if (!this.stopped)
762
767
  try {
763
768
  this.status({ fill: "green", shape: "dot", text: "connecting..." });
764
- let e;
769
+ let t;
765
770
  try {
766
- e = await n.getConnection(), await e.identity();
771
+ t = await n.getConnection(), await t.identity();
767
772
  } catch {
768
773
  this.status({ fill: "red", shape: "dot", text: "auth expired" }), this.error("Salesforce token expired. Re-authorize the connection.");
769
774
  return;
770
775
  }
771
- const s = n.getAccessToken(), r = n.getInstanceUrl();
772
- if (!s || !r) {
776
+ const r = n.getAccessToken(), s = n.getInstanceUrl();
777
+ if (!r || !s) {
773
778
  this.status({ fill: "red", shape: "dot", text: "not authorized" }), this.error("Salesforce connection not authorized");
774
779
  return;
775
780
  }
776
781
  const l = (await import("salesforce-pubsub-api-client")).default;
777
782
  this.client = new l({
778
783
  authType: "user-supplied",
779
- accessToken: s,
780
- instanceUrl: r
784
+ accessToken: r,
785
+ instanceUrl: s
781
786
  }), await this.client.connect();
782
787
  const d = this.config.numRequested || null, c = this.config.channelName, g = /* @__PURE__ */ f((u, m, p) => {
783
788
  if (m === "event" || m === "lastevent")
@@ -788,8 +793,8 @@ const gt = h(
788
793
  topic: c
789
794
  });
790
795
  else if (m === "error") {
791
- const L = p instanceof Error ? p.message : String(p ?? "stream error");
792
- if (this.warn(`Streaming error: ${L}`), L.includes("UNAUTHENTICATED") || L.includes("authentication")) {
796
+ const S = p instanceof Error ? p.message : String(p ?? "stream error");
797
+ if (this.warn(`Streaming error: ${S}`), S.includes("UNAUTHENTICATED") || S.includes("authentication")) {
793
798
  this.stopped = !0, this.status({
794
799
  fill: "red",
795
800
  shape: "dot",
@@ -799,7 +804,7 @@ const gt = h(
799
804
  ), this.cleanup();
800
805
  return;
801
806
  }
802
- this.status({ fill: "red", shape: "dot", text: L }), this.scheduleReconnect(n);
807
+ this.status({ fill: "red", shape: "dot", text: S }), this.scheduleReconnect(n);
803
808
  } else if (m === "end") {
804
809
  if (this.stopped) return;
805
810
  this.log("Streaming subscription ended"), this.status({ fill: "red", shape: "dot", text: "disconnected" }), this.scheduleReconnect(n);
@@ -833,13 +838,13 @@ const gt = h(
833
838
  shape: "dot",
834
839
  text: `subscribed: ${c}`
835
840
  }), this.reconnectAttempt = 0;
836
- } catch (e) {
841
+ } catch (t) {
837
842
  this.status({
838
843
  fill: "red",
839
844
  shape: "dot",
840
- text: e instanceof Error ? e.message : String(e)
845
+ text: t instanceof Error ? t.message : String(t)
841
846
  }), this.error(
842
- `Streaming subscription failed: ${e instanceof Error ? e.message : String(e)}`
847
+ `Streaming subscription failed: ${t instanceof Error ? t.message : String(t)}`
843
848
  ), this.scheduleReconnect(n);
844
849
  }
845
850
  }
@@ -855,73 +860,71 @@ const gt = h(
855
860
  });
856
861
  return;
857
862
  }
858
- const e = Math.min(
863
+ const t = Math.min(
859
864
  1e3 * Math.pow(2, this.reconnectAttempt),
860
865
  this.maxReconnectDelay
861
866
  );
862
867
  this.log(
863
- `Scheduling reconnect in ${e}ms (attempt ${this.reconnectAttempt}/${this.maxReconnectAttempts})`
868
+ `Scheduling reconnect in ${t}ms (attempt ${this.reconnectAttempt}/${this.maxReconnectAttempts})`
864
869
  ), this.status({
865
870
  fill: "green",
866
871
  shape: "dot",
867
- text: `reconnecting in ${Math.round(e / 1e3)}s`
872
+ text: `reconnecting in ${Math.round(t / 1e3)}s`
868
873
  }), this.setTimeout(async () => {
869
874
  await this.cleanup(), await this.subscribe(n);
870
- }, e);
875
+ }, t);
871
876
  }
872
877
  async cleanup() {
873
- var n, e;
878
+ var n, t;
874
879
  try {
875
- this.grpcErrorHandler && (process.removeListener("uncaughtException", this.grpcErrorHandler), this.grpcErrorHandler = null), this.client && (await ((e = (n = this.client).close) == null ? void 0 : e.call(n)), this.client = null);
880
+ this.grpcErrorHandler && (process.removeListener("uncaughtException", this.grpcErrorHandler), this.grpcErrorHandler = null), this.client && (await ((t = (n = this.client).close) == null ? void 0 : t.call(n)), this.client = null);
876
881
  } catch {
877
882
  }
878
883
  }
879
- async input() {
880
- }
881
884
  async closed() {
882
885
  await this.cleanup();
883
886
  }
884
887
  };
885
- f($, "SalesforceStreaming"), i($, "type", "salesforce-streaming"), i($, "category", "salesforce"), i($, "color", "#FFFFFF"), i($, "inputs", 0), i($, "outputs", 1), i($, "configSchema", gt), i($, "outputsSchema", mt);
886
- let v = $;
887
- const yt = h(
888
+ f(w, "SalesforceStreaming"), i(w, "type", "salesforce-streaming"), i(w, "category", "salesforce"), i(w, "color", "#FFFFFF"), i(w, "configSchema", ye), i(w, "outputsSchema", xe);
889
+ let v = w;
890
+ const be = h(
888
891
  {
889
- name: t.String({ default: "", "x-nrg-form": { icon: "tag" } }),
890
- connection: t.NodeRef(w, {
892
+ name: e.String({ default: "", "x-nrg-form": { icon: "tag" } }),
893
+ connection: e.NodeRef($, {
891
894
  "x-nrg-form": { icon: "cloud" }
892
895
  }),
893
- method: t.Union(
896
+ method: e.Union(
894
897
  [
895
- t.Literal("GET"),
896
- t.Literal("POST"),
897
- t.Literal("PUT"),
898
- t.Literal("PATCH"),
899
- t.Literal("DELETE")
898
+ e.Literal("GET"),
899
+ e.Literal("POST"),
900
+ e.Literal("PUT"),
901
+ e.Literal("PATCH"),
902
+ e.Literal("DELETE")
900
903
  ],
901
904
  { default: "POST", "x-nrg-form": { icon: "random" } }
902
905
  ),
903
- path: t.TypedInput({
906
+ path: e.TypedInput({
904
907
  "x-nrg-form": {
905
908
  icon: "link",
906
909
  typedInputTypes: ["str", "msg"]
907
910
  }
908
911
  }),
909
- emitError: t.Boolean({ default: !1 }),
910
- emitComplete: t.Boolean({ default: !1 }),
911
- emitStatus: t.Boolean({ default: !1 })
912
+ emitError: e.Boolean({ default: !1 }),
913
+ emitComplete: e.Boolean({ default: !1 }),
914
+ emitStatus: e.Boolean({ default: !1 })
912
915
  },
913
916
  { $id: "salesforce-apex:config" }
914
- ), xt = h(
917
+ ), Te = h(
915
918
  {
916
- payload: t.Any()
919
+ payload: e.Any()
917
920
  },
918
921
  { $id: "salesforce-apex:input" }
919
- ), bt = h(
922
+ ), Ie = h(
920
923
  {
921
- payload: t.Any()
924
+ payload: e.Any()
922
925
  },
923
926
  { $id: "salesforce-apex:output" }
924
- ), T = class T extends A {
927
+ ), I = class I extends k {
925
928
  async input(o) {
926
929
  const n = this.config.connection;
927
930
  if (!n) {
@@ -929,40 +932,40 @@ const yt = h(
929
932
  return;
930
933
  }
931
934
  try {
932
- const e = this.config.method;
933
- this.status({ fill: "green", shape: "dot", text: `${e}...` });
934
- const s = await n.getConnection(), r = await this.config.path.resolve(o);
935
+ const t = this.config.method;
936
+ this.status({ fill: "green", shape: "dot", text: `${t}...` });
937
+ const r = await n.getConnection(), s = await this.config.path.resolve(o);
935
938
  let l;
936
- const d = e.toLowerCase();
937
- d === "get" || d === "delete" ? l = await s.apex[d](r) : l = await s.apex[d](r, o.payload), this.status({ fill: "green", shape: "dot", text: `${e} done` }), this.send({ ...o, payload: l });
938
- } catch (e) {
939
+ const d = t.toLowerCase();
940
+ d === "get" || d === "delete" ? l = await r.apex[d](s) : l = await r.apex[d](s, o.payload), this.status({ fill: "green", shape: "dot", text: `${t} done` }), this.send({ ...o, payload: l });
941
+ } catch (t) {
939
942
  this.status({
940
943
  fill: "red",
941
944
  shape: "dot",
942
- text: e instanceof Error ? e.message : String(e)
945
+ text: t instanceof Error ? t.message : String(t)
943
946
  }), this.error(
944
- `Apex ${this.config.method} failed: ${e instanceof Error ? e.message : String(e)}`,
947
+ `Apex ${this.config.method} failed: ${t instanceof Error ? t.message : String(t)}`,
945
948
  o
946
949
  );
947
950
  }
948
951
  }
949
952
  };
950
- f(T, "SalesforceApex"), i(T, "type", "salesforce-apex"), i(T, "category", "salesforce"), i(T, "color", "#FFFFFF"), i(T, "inputs", 1), i(T, "outputs", 1), i(T, "configSchema", yt), i(T, "inputSchema", xt), i(T, "outputsSchema", bt);
951
- let N = T;
952
- const Tt = Y({
953
+ f(I, "SalesforceApex"), i(I, "type", "salesforce-apex"), i(I, "category", "salesforce"), i(I, "color", "#FFFFFF"), i(I, "configSchema", be), i(I, "inputSchema", Te), i(I, "outputsSchema", Ie);
954
+ let N = I;
955
+ const $e = Y({
953
956
  nodes: [
954
- w,
957
+ $,
958
+ C,
955
959
  R,
956
- S,
957
960
  O,
958
961
  j,
959
962
  v,
960
963
  N
961
964
  ]
962
965
  });
963
- var E = Tt;
964
- E && typeof E == "object" && Array.isArray(E.nodes) && (E = G(E.nodes));
966
+ var F = $e;
967
+ F && typeof F == "object" && Array.isArray(F.nodes) && (F = G(F.nodes));
965
968
  export {
966
- E as default
969
+ F as default
967
970
  };
968
971
  //# sourceMappingURL=index.mjs.map