@particle-academy/slack-js 0.1.2 → 0.2.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/dist/flow.cjs CHANGED
@@ -21,10 +21,73 @@ function fakeMessagePost({ config, fake }) {
21
21
  }
22
22
  };
23
23
  }
24
+ function fakeMessageUpdate({ config, fake }) {
25
+ return {
26
+ "ok": true,
27
+ "channel": "C123ABC456",
28
+ "ts": "1787719200.000100",
29
+ "text": "Ticket #42 assigned to Rosa."
30
+ };
31
+ }
32
+ function fakeUserLookupByEmail({ config, fake }) {
33
+ return {
34
+ "ok": true,
35
+ "user": {
36
+ "id": "U2CERLKJA",
37
+ "team_id": "T1DC2JH3J",
38
+ "name": "rosa",
39
+ "real_name": "Rosa Diaz",
40
+ "deleted": false,
41
+ "is_bot": false
42
+ }
43
+ };
44
+ }
45
+ function fakeBlockActions({ config, fake }) {
46
+ return {
47
+ "type": "block_actions",
48
+ "team": {
49
+ "id": "T1DC2JH3J",
50
+ "domain": "testteamnow"
51
+ },
52
+ "enterprise": null,
53
+ "user": {
54
+ "id": "U2CERLKJA",
55
+ "username": "roadrunner",
56
+ "team_id": "T1DC2JH3J"
57
+ },
58
+ "channel": {
59
+ "id": "C0123ABCD",
60
+ "name": "support"
61
+ },
62
+ "message": {
63
+ "type": "message",
64
+ "ts": "1730070000.000100",
65
+ "text": "Ticket #42: Printer on fire"
66
+ },
67
+ "trigger_id": "398738663015.47445629121.803a0bc887a14d10d2c447fce8b6703c",
68
+ "response_url": "https://hooks.slack.com/actions/T1DC2JH3J/397700885554/96rGlfmibIGlgcZRskXaIFfN",
69
+ "actions": [
70
+ {
71
+ "action_id": "ticket_assign_me",
72
+ "block_id": "ticket_42",
73
+ "type": "button",
74
+ "value": "42",
75
+ "selected_option": null,
76
+ "action_ts": "1730070012.345678"
77
+ }
78
+ ]
79
+ };
80
+ }
24
81
  var slackFaker = (operation, request) => {
25
82
  switch (operation) {
26
83
  case "message_post":
27
84
  return fakeMessagePost(request);
85
+ case "message_update":
86
+ return fakeMessageUpdate(request);
87
+ case "user_lookup_by_email":
88
+ return fakeUserLookupByEmail(request);
89
+ case "block_actions":
90
+ return fakeBlockActions(request);
28
91
  default:
29
92
  throw new Error(
30
93
  `slack: no fake response is defined for "${operation}". Add a fixture under provider/fixtures/ and regenerate \u2014 a connector without a faker cannot be developed against, tested, or demonstrated.`
@@ -64,6 +127,13 @@ async function slackMessagePost(options) {
64
127
  if (config.text === void 0 || config.text === null || config.text === "") {
65
128
  throw new Error(`message_post: "text" is required (Message).`);
66
129
  }
130
+ if (typeof config.blocks === "string" && config.blocks !== "") {
131
+ try {
132
+ JSON.parse(config.blocks);
133
+ } catch (error) {
134
+ throw new Error(`message_post: "blocks" must be JSON: ${error.message}`);
135
+ }
136
+ }
67
137
  const result = await fancyConnectorCore.callConnector(SLACK, {
68
138
  operation: MESSAGE_POST_OPERATION,
69
139
  config,
@@ -78,7 +148,8 @@ async function slackMessagePost(options) {
78
148
  path: "/api/chat.postMessage",
79
149
  json: {
80
150
  "channel": String(config.channel),
81
- "text": String(config.text)
151
+ "text": String(config.text),
152
+ ...config.blocks !== void 0 && config.blocks !== null && config.blocks !== "" ? { "blocks": typeof config.blocks === "string" ? JSON.parse(config.blocks) : config.blocks } : {}
82
153
  }
83
154
  }
84
155
  });
@@ -90,6 +161,113 @@ async function slackMessagePost(options) {
90
161
  }
91
162
  return result;
92
163
  }
164
+ var MESSAGE_UPDATE_OPERATION = "message_update";
165
+ async function slackMessageUpdate(options) {
166
+ const config = options.config ?? {};
167
+ if (config.channel === void 0 || config.channel === null || config.channel === "") {
168
+ throw new Error(`message_update: "channel" is required (Channel).`);
169
+ }
170
+ if (config.ts === void 0 || config.ts === null || config.ts === "") {
171
+ throw new Error(`message_update: "ts" is required (Message ts).`);
172
+ }
173
+ if (config.text === void 0 || config.text === null || config.text === "") {
174
+ throw new Error(`message_update: "text" is required (Message).`);
175
+ }
176
+ if (typeof config.blocks === "string" && config.blocks !== "") {
177
+ try {
178
+ JSON.parse(config.blocks);
179
+ } catch (error) {
180
+ throw new Error(`message_update: "blocks" must be JSON: ${error.message}`);
181
+ }
182
+ }
183
+ const result = await fancyConnectorCore.callConnector(SLACK, {
184
+ operation: MESSAGE_UPDATE_OPERATION,
185
+ config,
186
+ input: options.input,
187
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
188
+ ...options.mode === void 0 ? {} : { mode: options.mode },
189
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
190
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
191
+ ...options.transport === void 0 ? {} : { transport: options.transport },
192
+ request: {
193
+ method: "POST",
194
+ path: "/api/chat.update",
195
+ json: {
196
+ "channel": String(config.channel),
197
+ "ts": String(config.ts),
198
+ "text": String(config.text),
199
+ ...config.blocks !== void 0 && config.blocks !== null && config.blocks !== "" ? { "blocks": typeof config.blocks === "string" ? JSON.parse(config.blocks) : config.blocks } : {}
200
+ }
201
+ }
202
+ });
203
+ const data = result.data;
204
+ if (data?.ok === false) {
205
+ throw new Error(
206
+ `message_update: Slack rejected chat.update \u2014 ` + String(data.error ?? "no reason given")
207
+ );
208
+ }
209
+ return result;
210
+ }
211
+ var USER_LOOKUP_BY_EMAIL_OPERATION = "user_lookup_by_email";
212
+ async function slackUserLookupByEmail(options) {
213
+ const config = options.config ?? {};
214
+ if (config.email === void 0 || config.email === null || config.email === "") {
215
+ throw new Error(`user_lookup_by_email: "email" is required (Email).`);
216
+ }
217
+ const result = await fancyConnectorCore.callConnector(SLACK, {
218
+ operation: USER_LOOKUP_BY_EMAIL_OPERATION,
219
+ config,
220
+ input: options.input,
221
+ ...options.credentials === void 0 ? {} : { credentials: options.credentials },
222
+ ...options.mode === void 0 ? {} : { mode: options.mode },
223
+ ...options.connectionId === void 0 ? {} : { connectionId: options.connectionId },
224
+ ...options.attempts === void 0 ? {} : { attempts: options.attempts },
225
+ ...options.transport === void 0 ? {} : { transport: options.transport },
226
+ request: {
227
+ method: "GET",
228
+ path: "/api/users.lookupByEmail",
229
+ query: {
230
+ "email": String(config.email).trim()
231
+ }
232
+ }
233
+ });
234
+ const data = result.data;
235
+ if (data?.ok === false) {
236
+ throw new Error(
237
+ `user_lookup_by_email: Slack rejected users.lookupByEmail \u2014 ` + String(data.error ?? "no reason given")
238
+ );
239
+ }
240
+ return result;
241
+ }
242
+ var SLACK_BLOCK_ACTIONS_SIGNATURE_HEADER = "X-Slack-Signature";
243
+ var SLACK_BLOCK_ACTIONS_TOLERANCE = 300;
244
+ var SLACK_BLOCK_ACTIONS_SCHEME = {
245
+ algorithm: "SHA-256",
246
+ payload: (raw, timestamp) => `v0:${timestamp}:${raw}`,
247
+ tolerance: SLACK_BLOCK_ACTIONS_TOLERANCE,
248
+ encoding: "hex"
249
+ };
250
+ function parseSlackSignature(raw) {
251
+ return { signature: raw.startsWith("v0=") ? raw.slice(3) : raw };
252
+ }
253
+ var SLACK_BLOCK_ACTIONS_DECODE = {
254
+ kind: "form-field-json",
255
+ field: "payload"
256
+ };
257
+ var SLACK_BLOCK_ACTIONS = {
258
+ service: "slack",
259
+ operation: "block_actions",
260
+ delivery: "webhook",
261
+ setup: "In the Slack app's Interactivity & Shortcuts settings, turn interactivity on and set the Request URL to the route your host mounts for this trigger, then put the app's signing secret (Basic Information) on the connection as `signingSecret`. Slack shows the user an error unless the request is answered with a 200 within 3 seconds, so the host must acknowledge FIRST and run the graph after.",
262
+ verification: {
263
+ signatureHeader: SLACK_BLOCK_ACTIONS_SIGNATURE_HEADER,
264
+ scheme: SLACK_BLOCK_ACTIONS_SCHEME,
265
+ timestampHeader: "X-Slack-Request-Timestamp",
266
+ parse: parseSlackSignature
267
+ },
268
+ decode: SLACK_BLOCK_ACTIONS_DECODE,
269
+ faker: slackFaker
270
+ };
93
271
 
94
272
  // src/flow.ts
95
273
  var slackMessageExecutor = async (ctx) => {
@@ -106,11 +284,59 @@ var slackMessageExecutor = async (ctx) => {
106
284
  });
107
285
  return { __port: "out", value: result };
108
286
  };
287
+ var slackMessageUpdateExecutor = async (ctx) => {
288
+ const config = ctx.node.data?.config ?? {};
289
+ const result = await slackMessageUpdate({
290
+ config,
291
+ input: ctx.inputs?.in
292
+ });
293
+ ctx.emit({
294
+ type: "log",
295
+ level: "info",
296
+ nodeId: ctx.node.id,
297
+ message: `slack message_update ${result.data?.id} (${result.mode})`
298
+ });
299
+ return { __port: "out", value: result };
300
+ };
301
+ var slackUserLookupByEmailExecutor = async (ctx) => {
302
+ const config = ctx.node.data?.config ?? {};
303
+ const result = await slackUserLookupByEmail({
304
+ config,
305
+ input: ctx.inputs?.in
306
+ });
307
+ ctx.emit({
308
+ type: "log",
309
+ level: "info",
310
+ nodeId: ctx.node.id,
311
+ message: `slack user_lookup_by_email ${result.data?.id} (${result.mode})`
312
+ });
313
+ return { __port: "out", value: result };
314
+ };
315
+ var slackBlockActionsExecutor = async (ctx) => {
316
+ const config = ctx.node.data?.config ?? {};
317
+ const connection = fancyConnectorCore.resolveConnection({
318
+ service: SLACK.service,
319
+ operation: "block_actions",
320
+ sandbox: SLACK.sandbox,
321
+ baseUrls: SLACK.baseUrls,
322
+ requires: SLACK.requires,
323
+ connectionId: typeof config.connection === "string" ? config.connection : null,
324
+ requested: typeof config.mode === "string" ? config.mode : null
325
+ });
326
+ const event = fancyConnectorCore.triggerEvent(SLACK_BLOCK_ACTIONS, connection, ctx.inputs?.in, config);
327
+ return { __port: "out", value: event };
328
+ };
109
329
  var SLACK_RUNNABLE_KINDS = [
110
- { ...slackUi.slackMessageKind, executor: slackMessageExecutor }
330
+ { ...slackUi.slackMessageKind, executor: slackMessageExecutor },
331
+ { ...slackUi.slackMessageUpdateKind, executor: slackMessageUpdateExecutor },
332
+ { ...slackUi.slackUserLookupByEmailKind, executor: slackUserLookupByEmailExecutor },
333
+ { ...slackUi.slackBlockActionsKind, executor: slackBlockActionsExecutor }
111
334
  ];
112
335
 
113
336
  exports.SLACK_RUNNABLE_KINDS = SLACK_RUNNABLE_KINDS;
337
+ exports.slackBlockActionsExecutor = slackBlockActionsExecutor;
114
338
  exports.slackMessageExecutor = slackMessageExecutor;
339
+ exports.slackMessageUpdateExecutor = slackMessageUpdateExecutor;
340
+ exports.slackUserLookupByEmailExecutor = slackUserLookupByEmailExecutor;
115
341
  //# sourceMappingURL=flow.cjs.map
116
342
  //# sourceMappingURL=flow.cjs.map
package/dist/flow.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/message-post.ts","../src/flow.ts"],"names":["callConnector","slackMessageKind"],"mappings":";;;;;;;;AAyBA,SAAS,eAAA,CAAgB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC/D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,SAAA,EAAW,YAAA;AAAA,IACX,IAAA,EAAM,mBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,MAAA,EAAQ,YAAA;AAAA,MACR,MAAA,EAAQ,SAAA;AAAA,MACR,IAAA,EAAM,mBAAA;AAAA,MACN,MAAA,EAAQ,mCAAA;AAAA,MACR,QAAA,EAAU,YAAA;AAAA,MACV,QAAA,EAAU;AAAA;AACZ,GACF;AACF;AAEO,IAAM,UAAA,GAA6B,CAAC,SAAA,EAAW,OAAA,KAAY;AAChE,EAAA,QAAQ,SAAA;AAAW,IACjB,KAAK,cAAA;AACH,MAAA,OAAO,gBAAgB,OAAO,CAAA;AAAA,IAEhC;AAIE,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,2CAA2C,SAAS,CAAA,iJAAA;AAAA,OAGtD;AAAA;AAEN,CAAA;;;ACjBO,IAAM,eAAA,GAAkB;AAAA,EAC7B,MAAA,EAAQ,mBAAA;AAAA,EACR,SAAA,EAAW;AACb,CAAA;AAGO,IAAM,cAAA,GAAiB;AAAA,EAC5B,aAAA;AAAA,EACA,cAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA;AAWO,SAAS,cA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,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,mBAAA,EAAuB,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACpF,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,oBAAA,GAA6C;AAAA,EACxD,EAAE,GAAGC,wBAAA,EAAkB,QAAA,EAAU,oBAAA;AACnC","file":"flow.cjs","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/fixtures/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/fixtures/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * The Slack faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Slack actually publishes, so an author can wire {{ $json.data.id }}\n * against a fake and have it keep working against the real thing.\n *\n * Deterministic — same inputs, same output. A faker returning a fresh uuid\n * every call cannot be asserted on, so its fixtures degrade to \"it did not\n * throw\", which is the assertion that catches nothing.\n */\n\nimport type { ConnectorFaker, FakeRequest } from \"@particle-academy/fancy-connector-core\";\n\nfunction fakeMessagePost({ config, fake }: FakeRequest): unknown {\n return {\n \"ok\": true,\n \"channel\": \"C123ABC456\",\n \"ts\": \"1787719200.000100\",\n \"message\": {\n \"user\": \"U012AB3CDE\",\n \"type\": \"message\",\n \"ts\": \"1787719200.000100\",\n \"text\": \"Deployment finished successfully.\",\n \"app_id\": \"A012BC3DEF\",\n \"bot_id\": \"B012AB3CD\",\n },\n };\n}\n\nexport const slackFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"message_post\":\n return fakeMessagePost(request);\n\n default:\n // A faker asked for an operation it has no shape for must SAY so. Making\n // something up would produce a green run whose output silently has none\n // of the fields the author is about to reference.\n throw new Error(\n `slack: no fake response is defined for \"${operation}\". ` +\n \"Add a fixture under provider/fixtures/ and regenerate — a connector without a faker \" +\n \"cannot be developed against, tested, or demonstrated.\",\n );\n }\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack, as one service descriptor shared by every Slack operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Slack: its base URL, its auth\n * scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * Install the app into a dedicated development workspace or Slack developer\n * sandbox. Messages are real inside that workspace, but its users and data are\n * separate from production. Developer sandboxes expire by default and have\n * feature and integration limits.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { slackFaker } from \"./faker.js\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported. An imported constant lets an upgrade rewrite the\n * very claim it exists to detect, after which the copy agrees with itself\n * forever.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\nexport const SLACK_BASE_URLS = {\n \"live\": \"https://slack.com\",\n \"sandbox\": \"https://slack.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const SLACK_REQUIRES = [\n \"accessToken\",\n \"refreshToken\",\n \"clientId\",\n \"clientSecret\"\n] as const;\n\n/**\n * Apply Slack's auth scheme to an outgoing request.\n *\n *\n *\n * The mode is passed in because for some providers auth and estate are the\n * same decision expressed in the URL; here it is unused, and saying so is\n * cheaper than wondering later whether it was forgotten.\n */\nexport function slackAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers.Authorization = `Bearer ${credentials.accessToken ?? \"\"}`;\n}\n\n/** The Slack service, for the TypeScript runtime. */\nexport const SLACK: ServiceDescriptor = {\n service: \"slack\",\n title: \"Slack\",\n sandbox: \"separate-account\",\n baseUrls: { ...SLACK_BASE_URLS },\n requires: [...SLACK_REQUIRES],\n authorize: slackAuthorize,\n faker: slackFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-post.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/message-post.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Post a text message to a Slack channel or conversation.\n *\n * POST /api/chat.postMessage —\n * https://docs.slack.dev/reference/methods/chat.postMessage\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Slack or calls the faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"../service.js\";\n\nexport const MESSAGE_POST_OPERATION = \"message_post\";\n\nexport type MessagePostOptions = {\n /** The node's resolved config. Keys: channel, text. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function slackMessagePost(options: MessagePostOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channel === undefined || config.channel === null || config.channel === \"\") {\n throw new Error(`message_post: \"channel\" is required (Channel).`);\n }\n\n if (config.text === undefined || config.text === null || config.text === \"\") {\n throw new Error(`message_post: \"text\" is required (Message).`);\n }\n\n const result = await callConnector(SLACK, {\n operation: MESSAGE_POST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/api/chat.postMessage\",\n json: {\n \"channel\": String(config.channel),\n \"text\": String(config.text),\n },\n },\n });\n\n // Slack answers HTTP 200 with `{ok: false}` for an application-level\n // failure. A status check alone reads that as success, so the call is\n // reported as having worked and the next node receives a body that says\n // otherwise.\n const data = result.data as Record<string, unknown> | undefined;\n\n if (data?.ok === false) {\n throw new Error(\n `message_post: Slack rejected chat.postMessage — ` +\n String(data.error ?? \"no reason given\"),\n );\n }\n\n return result;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack's node kinds with their TypeScript executors attached — for hosts that\n * EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/slack-ui carries no executor: the\n * editor is React on every host, so a PHP or Python project installs the ui\n * package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"./service.js\";\n\nimport {\n slackMessageKind,\n} from \"@particle-academy/slack-ui\";\n\nimport { slackMessagePost } from \"./actions/message-post.js\";\n\nexport const slackMessageExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackMessagePost({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack message_post ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const SLACK_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...slackMessageKind, executor: slackMessageExecutor },\n];\n"]}
1
+ {"version":3,"sources":["../src/faker.ts","../src/service.ts","../src/actions/message-post.ts","../src/actions/message-update.ts","../src/actions/user-lookup-by-email.ts","../src/triggers/block-actions.ts","../src/flow.ts"],"names":["callConnector","resolveConnection","triggerEvent","slackMessageKind","slackMessageUpdateKind","slackUserLookupByEmailKind","slackBlockActionsKind"],"mappings":";;;;;;;;AAyBA,SAAS,eAAA,CAAgB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AAC/D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,SAAA,EAAW,YAAA;AAAA,IACX,IAAA,EAAM,mBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,MAAA,EAAQ,YAAA;AAAA,MACR,MAAA,EAAQ,SAAA;AAAA,MACR,IAAA,EAAM,mBAAA;AAAA,MACN,MAAA,EAAQ,mCAAA;AAAA,MACR,QAAA,EAAU,YAAA;AAAA,MACV,QAAA,EAAU;AAAA;AACZ,GACF;AACF;AAEA,SAAS,iBAAA,CAAkB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,SAAA,EAAW,YAAA;AAAA,IACX,IAAA,EAAM,mBAAA;AAAA,IACN,MAAA,EAAQ;AAAA,GACV;AACF;AAEA,SAAS,qBAAA,CAAsB,EAAE,MAAA,EAAQ,IAAA,EAAK,EAAyB;AACrE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,WAAA;AAAA,MACN,SAAA,EAAW,WAAA;AAAA,MACX,MAAA,EAAQ,MAAA;AAAA,MACR,WAAA,EAAa,WAAA;AAAA,MACb,SAAA,EAAW,KAAA;AAAA,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SAAS,KAAA,CAAM,OAAA;AAAA,IACf,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,cAAc,OAAO,MAAA,CAAO,UAAA,KAAe,QAAA,GAAW,OAAO,UAAA,GAAa,IAAA;AAAA,IAC1E,WAAW,OAAO,MAAA,CAAO,IAAA,KAAS,QAAA,GAAY,OAAO,IAAA,GAAyB;AAAA,GAC/E,CAAA;AAED,EAAA,MAAM,QAAQC,+BAAA,CAAa,mBAAA,EAAqB,YAAY,GAAA,CAAI,MAAA,EAAQ,IAAI,MAAM,CAAA;AAElF,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM;AACvC;AAGO,IAAM,oBAAA,GAA6C;AAAA,EACxD,EAAE,GAAGC,wBAAA,EAAkB,QAAA,EAAU,oBAAA,EAAqB;AAAA,EACtD,EAAE,GAAGC,8BAAA,EAAwB,QAAA,EAAU,0BAAA,EAA2B;AAAA,EAClE,EAAE,GAAGC,kCAAA,EAA4B,QAAA,EAAU,8BAAA,EAA+B;AAAA,EAC1E,EAAE,GAAGC,6BAAA,EAAuB,QAAA,EAAU,yBAAA;AACxC","file":"flow.cjs","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/fixtures/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/fixtures/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * The Slack faker.\n *\n * Shapes, not behaviour: the goal is that a downstream node sees the field\n * NAMES Slack actually publishes, so an author can wire {{ $json.data.id }}\n * against a fake and have it keep working against the real thing.\n *\n * Deterministic — same inputs, same output. A faker returning a fresh uuid\n * every call cannot be asserted on, so its fixtures degrade to \"it did not\n * throw\", which is the assertion that catches nothing.\n */\n\nimport type { ConnectorFaker, FakeRequest } from \"@particle-academy/fancy-connector-core\";\n\nfunction fakeMessagePost({ config, fake }: FakeRequest): unknown {\n return {\n \"ok\": true,\n \"channel\": \"C123ABC456\",\n \"ts\": \"1787719200.000100\",\n \"message\": {\n \"user\": \"U012AB3CDE\",\n \"type\": \"message\",\n \"ts\": \"1787719200.000100\",\n \"text\": \"Deployment finished successfully.\",\n \"app_id\": \"A012BC3DEF\",\n \"bot_id\": \"B012AB3CD\",\n },\n };\n}\n\nfunction fakeMessageUpdate({ config, fake }: FakeRequest): unknown {\n return {\n \"ok\": true,\n \"channel\": \"C123ABC456\",\n \"ts\": \"1787719200.000100\",\n \"text\": \"Ticket #42 assigned to Rosa.\",\n };\n}\n\nfunction fakeUserLookupByEmail({ config, fake }: FakeRequest): unknown {\n return {\n \"ok\": true,\n \"user\": {\n \"id\": \"U2CERLKJA\",\n \"team_id\": \"T1DC2JH3J\",\n \"name\": \"rosa\",\n \"real_name\": \"Rosa Diaz\",\n \"deleted\": false,\n \"is_bot\": false,\n },\n };\n}\n\nfunction fakeBlockActions({ config, fake }: FakeRequest): unknown {\n return {\n \"type\": \"block_actions\",\n \"team\": {\n \"id\": \"T1DC2JH3J\",\n \"domain\": \"testteamnow\",\n },\n \"enterprise\": null,\n \"user\": {\n \"id\": \"U2CERLKJA\",\n \"username\": \"roadrunner\",\n \"team_id\": \"T1DC2JH3J\",\n },\n \"channel\": {\n \"id\": \"C0123ABCD\",\n \"name\": \"support\",\n },\n \"message\": {\n \"type\": \"message\",\n \"ts\": \"1730070000.000100\",\n \"text\": \"Ticket #42: Printer on fire\",\n },\n \"trigger_id\": \"398738663015.47445629121.803a0bc887a14d10d2c447fce8b6703c\",\n \"response_url\": \"https://hooks.slack.com/actions/T1DC2JH3J/397700885554/96rGlfmibIGlgcZRskXaIFfN\",\n \"actions\": [\n {\n \"action_id\": \"ticket_assign_me\",\n \"block_id\": \"ticket_42\",\n \"type\": \"button\",\n \"value\": \"42\",\n \"selected_option\": null,\n \"action_ts\": \"1730070012.345678\",\n },\n ],\n };\n}\n\nexport const slackFaker: ConnectorFaker = (operation, request) => {\n switch (operation) {\n case \"message_post\":\n return fakeMessagePost(request);\n\n case \"message_update\":\n return fakeMessageUpdate(request);\n\n case \"user_lookup_by_email\":\n return fakeUserLookupByEmail(request);\n\n case \"block_actions\":\n return fakeBlockActions(request);\n\n default:\n // A faker asked for an operation it has no shape for must SAY so. Making\n // something up would produce a green run whose output silently has none\n // of the fields the author is about to reference.\n throw new Error(\n `slack: no fake response is defined for \"${operation}\". ` +\n \"Add a fixture under provider/fixtures/ and regenerate — a connector without a faker \" +\n \"cannot be developed against, tested, or demonstrated.\",\n );\n }\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/manifest.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/manifest.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack, as one service descriptor shared by every Slack operation.\n *\n * @particle-academy/fancy-connector-core carries what is true of ALL\n * connectors. This carries what is true of Slack: its base URL, its auth\n * scheme, its idempotency header, and its faker.\n *\n * ## The sandbox trap, written down where it is used\n *\n * Install the app into a dedicated development workspace or Slack developer\n * sandbox. Messages are real inside that workspace, but its users and data are\n * separate from production. Developer sandboxes expire by default and have\n * feature and integration limits.\n */\n\nimport type { ConnectorMode, PreparedRequest, ServiceDescriptor } from \"@particle-academy/fancy-connector-core\";\n\nimport { slackFaker } from \"./faker.js\";\n\n/**\n * The connector API version this package was GENERATED against.\n *\n * A literal, never imported. An imported constant lets an upgrade rewrite the\n * very claim it exists to detect, after which the copy agrees with itself\n * forever.\n */\nexport const CONNECTOR_API_VERSION = 1;\n\nexport const SLACK_BASE_URLS = {\n \"live\": \"https://slack.com\",\n \"sandbox\": \"https://slack.com\"\n} as const;\n\n/** Credential keys a remote call cannot proceed without. */\nexport const SLACK_REQUIRES = [\n \"accessToken\",\n \"refreshToken\",\n \"clientId\",\n \"clientSecret\"\n] as const;\n\n/**\n * Apply Slack's auth scheme to an outgoing request.\n *\n *\n *\n * The mode is passed in because for some providers auth and estate are the\n * same decision expressed in the URL; here it is unused, and saying so is\n * cheaper than wondering later whether it was forgotten.\n */\nexport function slackAuthorize(\n credentials: Record<string, string | undefined>,\n request: PreparedRequest,\n _mode: ConnectorMode,\n): void {\n request.headers.Authorization = `Bearer ${credentials.accessToken ?? \"\"}`;\n}\n\n/** The Slack service, for the TypeScript runtime. */\nexport const SLACK: ServiceDescriptor = {\n service: \"slack\",\n title: \"Slack\",\n sandbox: \"separate-account\",\n baseUrls: { ...SLACK_BASE_URLS },\n requires: [...SLACK_REQUIRES],\n authorize: slackAuthorize,\n faker: slackFaker,\n};\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-post.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/message-post.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Post a text message to a Slack channel or conversation.\n *\n * POST /api/chat.postMessage —\n * https://docs.slack.dev/reference/methods/chat.postMessage\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Slack or calls the faker.\n *\n * sideEffects: unsafe-to-replay.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"../service.js\";\n\nexport const MESSAGE_POST_OPERATION = \"message_post\";\n\nexport type MessagePostOptions = {\n /** The node's resolved config. Keys: channel, text, blocks. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function slackMessagePost(options: MessagePostOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channel === undefined || config.channel === null || config.channel === \"\") {\n throw new Error(`message_post: \"channel\" is required (Channel).`);\n }\n\n if (config.text === undefined || config.text === null || config.text === \"\") {\n throw new Error(`message_post: \"text\" is required (Message).`);\n }\n\n if (typeof config.blocks === \"string\" && config.blocks !== \"\") {\n try {\n JSON.parse(config.blocks);\n } catch (error) {\n throw new Error(`message_post: \"blocks\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n const result = await callConnector(SLACK, {\n operation: MESSAGE_POST_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/api/chat.postMessage\",\n json: {\n \"channel\": String(config.channel),\n \"text\": String(config.text),\n ...(config.blocks !== undefined && config.blocks !== null && config.blocks !== \"\" ? { \"blocks\": typeof config.blocks === \"string\" ? JSON.parse(config.blocks) : config.blocks } : {}),\n },\n },\n });\n\n // Slack answers HTTP 200 with `{ok: false}` for an application-level\n // failure. A status check alone reads that as success, so the call is\n // reported as having worked and the next node receives a body that says\n // otherwise.\n const data = result.data as Record<string, unknown> | undefined;\n\n if (data?.ok === false) {\n throw new Error(\n `message_post: Slack rejected chat.postMessage — ` +\n String(data.error ?? \"no reason given\"),\n );\n }\n\n return result;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/message-update.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/message-update.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Replace the text and blocks of a Slack message the app posted.\n *\n * POST /api/chat.update — https://docs.slack.dev/reference/methods/chat.update\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Slack or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"../service.js\";\n\nexport const MESSAGE_UPDATE_OPERATION = \"message_update\";\n\nexport type MessageUpdateOptions = {\n /** The node's resolved config. Keys: channel, ts, text, blocks. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function slackMessageUpdate(options: MessageUpdateOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.channel === undefined || config.channel === null || config.channel === \"\") {\n throw new Error(`message_update: \"channel\" is required (Channel).`);\n }\n\n if (config.ts === undefined || config.ts === null || config.ts === \"\") {\n throw new Error(`message_update: \"ts\" is required (Message ts).`);\n }\n\n if (config.text === undefined || config.text === null || config.text === \"\") {\n throw new Error(`message_update: \"text\" is required (Message).`);\n }\n\n if (typeof config.blocks === \"string\" && config.blocks !== \"\") {\n try {\n JSON.parse(config.blocks);\n } catch (error) {\n throw new Error(`message_update: \"blocks\" must be JSON: ${(error as Error).message}`);\n }\n }\n\n const result = await callConnector(SLACK, {\n operation: MESSAGE_UPDATE_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"POST\",\n path: \"/api/chat.update\",\n json: {\n \"channel\": String(config.channel),\n \"ts\": String(config.ts),\n \"text\": String(config.text),\n ...(config.blocks !== undefined && config.blocks !== null && config.blocks !== \"\" ? { \"blocks\": typeof config.blocks === \"string\" ? JSON.parse(config.blocks) : config.blocks } : {}),\n },\n },\n });\n\n // Slack answers HTTP 200 with `{ok: false}` for an application-level\n // failure. A status check alone reads that as success, so the call is\n // reported as having worked and the next node receives a body that says\n // otherwise.\n const data = result.data as Record<string, unknown> | undefined;\n\n if (data?.ok === false) {\n throw new Error(\n `message_update: Slack rejected chat.update — ` +\n String(data.error ?? \"no reason given\"),\n );\n }\n\n return result;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/user-lookup-by-email.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/user-lookup-by-email.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Find the Slack user in this workspace who has a given email address.\n *\n * GET /api/users.lookupByEmail —\n * https://docs.slack.dev/reference/methods/users.lookupByEmail\n *\n * Notice what is NOT here: no key, no base URL, no mode check, no retry loop,\n * no fake/real branch. This describes the request; callConnector resolves the\n * connection, picks the estate, and either calls Slack or calls the faker.\n */\n\nimport {\n callConnector,\n type ConnectorResult,\n type RequestedMode,\n type Transport,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"../service.js\";\n\nexport const USER_LOOKUP_BY_EMAIL_OPERATION = \"user_lookup_by_email\";\n\nexport type UserLookupByEmailOptions = {\n /** The node's resolved config. Keys: email. */\n config: Record<string, unknown>;\n credentials?: Record<string, string | undefined>;\n mode?: RequestedMode;\n connectionId?: string | null;\n input?: unknown;\n attempts?: number;\n /** Override the transport. The only way to exercise this without a network. */\n transport?: Transport;\n};\n\nexport async function slackUserLookupByEmail(options: UserLookupByEmailOptions): Promise<ConnectorResult> {\n const config = options.config ?? {};\n\n if (config.email === undefined || config.email === null || config.email === \"\") {\n throw new Error(`user_lookup_by_email: \"email\" is required (Email).`);\n }\n\n const result = await callConnector(SLACK, {\n operation: USER_LOOKUP_BY_EMAIL_OPERATION,\n config,\n input: options.input,\n ...(options.credentials === undefined ? {} : { credentials: options.credentials }),\n ...(options.mode === undefined ? {} : { mode: options.mode }),\n ...(options.connectionId === undefined ? {} : { connectionId: options.connectionId }),\n ...(options.attempts === undefined ? {} : { attempts: options.attempts }),\n ...(options.transport === undefined ? {} : { transport: options.transport }),\n request: {\n method: \"GET\",\n path: \"/api/users.lookupByEmail\",\n query: {\n \"email\": String(config.email).trim(),\n },\n },\n });\n\n // Slack answers HTTP 200 with `{ok: false}` for an application-level\n // failure. A status check alone reads that as success, so the call is\n // reported as having worked and the next node receives a body that says\n // otherwise.\n const data = result.data as Record<string, unknown> | undefined;\n\n if (data?.ok === false) {\n throw new Error(\n `user_lookup_by_email: Slack rejected users.lookupByEmail — ` +\n String(data.error ?? \"no reason given\"),\n );\n }\n\n return result;\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/triggers/block-actions.json by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/triggers/block-actions.json (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack's webhook trigger — the delivery contract.\n *\n * Kept beside the service descriptor rather than inside a node, because a\n * signature scheme is a fact about SLACK. Two Slack triggers must not be able\n * to disagree about how a delivery is verified.\n */\n\nimport { decodeDelivery, verifyDelivery, type DeliveryDecode, type HmacScheme, type InboundDelivery, type TriggerDescriptor, type WebhookVerification } from \"@particle-academy/fancy-connector-core\";\nimport { slackFaker } from \"../faker.js\";\n\nexport const SLACK_BLOCK_ACTIONS_SIGNATURE_HEADER = \"X-Slack-Signature\";\n/** The provider's documented replay window, in seconds. */\nexport const SLACK_BLOCK_ACTIONS_TOLERANCE = 300;\n\nexport const SLACK_BLOCK_ACTIONS_SCHEME: HmacScheme = {\n algorithm: \"SHA-256\",\n payload: (raw, timestamp) => `v0:${timestamp}:${raw}`,\n tolerance: SLACK_BLOCK_ACTIONS_TOLERANCE,\n encoding: \"hex\",\n};\n\n/** Strip the `v0=` prefix the provider sends. */\nexport function parseSlackSignature(raw: string): { signature?: string } {\n return { signature: raw.startsWith(\"v0=\") ? raw.slice(3) : raw };\n}\n\nexport const SLACK_BLOCK_ACTIONS_DECODE: DeliveryDecode = {\n kind: \"form-field-json\",\n field: \"payload\",\n};\n\nexport const SLACK_BLOCK_ACTIONS: TriggerDescriptor = {\n service: \"slack\",\n operation: \"block_actions\",\n delivery: \"webhook\",\n setup:\n \"In the Slack app's Interactivity & Shortcuts settings, turn interactivity on and set the Request URL to the route your host mounts for this trigger, then put the app's signing secret (Basic Information) on the connection as `signingSecret`. Slack shows the user an error unless the request is answered with a 200 within 3 seconds, so the host must acknowledge FIRST and run the graph after.\",\n verification: {\n signatureHeader: SLACK_BLOCK_ACTIONS_SIGNATURE_HEADER,\n scheme: SLACK_BLOCK_ACTIONS_SCHEME,\n timestampHeader: \"X-Slack-Request-Timestamp\",\n parse: parseSlackSignature,\n },\n decode: SLACK_BLOCK_ACTIONS_DECODE,\n faker: slackFaker,\n};\n\n/**\n * Verify one inbound Slack delivery.\n *\n * The host calls this BEFORE starting a run, with the body exactly as\n * received. Re-serialised JSON changes key order and whitespace, and produces\n * a mismatch that looks precisely like a wrong secret — hours of debugging the\n * wrong thing.\n *\n * The secret is the connection's `signingSecret`.\n */\nexport function verifySlackDelivery(\n delivery: InboundDelivery,\n signingSecret: string | undefined,\n now?: number,\n): Promise<WebhookVerification> {\n return verifyDelivery(SLACK_BLOCK_ACTIONS, delivery, signingSecret, now);\n}\n\n/**\n * Read one VERIFIED Slack delivery.\n *\n * The body is not plain JSON: it is form-field-json, with the payload in the\n * `payload` field. The host calls this AFTER `verifySlackDelivery` has\n * accepted the delivery, with the SAME raw bytes, and starts the run with what\n * it returns. A body that cannot be read is refused by name, never passed on.\n */\nexport function decodeSlackDelivery(raw: Uint8Array | string): unknown {\n return decodeDelivery(SLACK_BLOCK_ACTIONS_DECODE, raw);\n}\n","/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack's node kinds with their TypeScript executors attached — for hosts that\n * EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/slack-ui carries no executor: the\n * editor is React on every host, so a PHP or Python project installs the ui\n * package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"./service.js\";\n\nimport {\n slackMessageKind,\n slackMessageUpdateKind,\n slackUserLookupByEmailKind,\n slackBlockActionsKind,\n} from \"@particle-academy/slack-ui\";\n\nimport { slackMessagePost } from \"./actions/message-post.js\";\nimport { slackMessageUpdate } from \"./actions/message-update.js\";\nimport { slackUserLookupByEmail } from \"./actions/user-lookup-by-email.js\";\nimport { SLACK_BLOCK_ACTIONS } from \"./triggers/block-actions.js\";\n\nexport const slackMessageExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackMessagePost({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack message_post ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const slackMessageUpdateExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackMessageUpdate({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack message_update ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const slackUserLookupByEmailExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackUserLookupByEmail({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack user_lookup_by_email ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const slackBlockActionsExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n const connection = resolveConnection({\n service: SLACK.service,\n operation: \"block_actions\",\n sandbox: SLACK.sandbox,\n baseUrls: SLACK.baseUrls,\n requires: SLACK.requires,\n connectionId: typeof config.connection === \"string\" ? config.connection : null,\n requested: typeof config.mode === \"string\" ? (config.mode as RequestedMode) : null,\n });\n\n const event = triggerEvent(SLACK_BLOCK_ACTIONS, connection, ctx.inputs?.in, config);\n\n return { __port: \"out\", value: event };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const SLACK_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...slackMessageKind, executor: slackMessageExecutor },\n { ...slackMessageUpdateKind, executor: slackMessageUpdateExecutor },\n { ...slackUserLookupByEmailKind, executor: slackUserLookupByEmailExecutor },\n { ...slackBlockActionsKind, executor: slackBlockActionsExecutor },\n];\n"]}
package/dist/flow.d.cts CHANGED
@@ -20,7 +20,10 @@ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/e
20
20
  */
21
21
 
22
22
  declare const slackMessageExecutor: NodeExecutor;
23
+ declare const slackMessageUpdateExecutor: NodeExecutor;
24
+ declare const slackUserLookupByEmailExecutor: NodeExecutor;
25
+ declare const slackBlockActionsExecutor: NodeExecutor;
23
26
  /** The kinds a TypeScript host registers. */
24
27
  declare const SLACK_RUNNABLE_KINDS: NodeKindDefinition[];
25
28
 
26
- export { SLACK_RUNNABLE_KINDS, slackMessageExecutor };
29
+ export { SLACK_RUNNABLE_KINDS, slackBlockActionsExecutor, slackMessageExecutor, slackMessageUpdateExecutor, slackUserLookupByEmailExecutor };
package/dist/flow.d.ts CHANGED
@@ -20,7 +20,10 @@ import { NodeKindDefinition, NodeExecutor } from '@particle-academy/fancy-flow/e
20
20
  */
21
21
 
22
22
  declare const slackMessageExecutor: NodeExecutor;
23
+ declare const slackMessageUpdateExecutor: NodeExecutor;
24
+ declare const slackUserLookupByEmailExecutor: NodeExecutor;
25
+ declare const slackBlockActionsExecutor: NodeExecutor;
23
26
  /** The kinds a TypeScript host registers. */
24
27
  declare const SLACK_RUNNABLE_KINDS: NodeKindDefinition[];
25
28
 
26
- export { SLACK_RUNNABLE_KINDS, slackMessageExecutor };
29
+ export { SLACK_RUNNABLE_KINDS, slackBlockActionsExecutor, slackMessageExecutor, slackMessageUpdateExecutor, slackUserLookupByEmailExecutor };
package/dist/flow.js CHANGED
@@ -1,6 +1,6 @@
1
- import { slackMessagePost } from './chunk-SWUB2VUX.js';
2
- import '@particle-academy/fancy-connector-core';
3
- import { slackMessageKind } from '@particle-academy/slack-ui';
1
+ import { slackMessagePost, slackMessageUpdate, slackUserLookupByEmail, SLACK, SLACK_BLOCK_ACTIONS } from './chunk-LV6WHV7F.js';
2
+ import { resolveConnection, triggerEvent } from '@particle-academy/fancy-connector-core';
3
+ import { slackMessageKind, slackMessageUpdateKind, slackUserLookupByEmailKind, slackBlockActionsKind } from '@particle-academy/slack-ui';
4
4
 
5
5
  var slackMessageExecutor = async (ctx) => {
6
6
  const config = ctx.node.data?.config ?? {};
@@ -16,10 +16,55 @@ var slackMessageExecutor = async (ctx) => {
16
16
  });
17
17
  return { __port: "out", value: result };
18
18
  };
19
+ var slackMessageUpdateExecutor = async (ctx) => {
20
+ const config = ctx.node.data?.config ?? {};
21
+ const result = await slackMessageUpdate({
22
+ config,
23
+ input: ctx.inputs?.in
24
+ });
25
+ ctx.emit({
26
+ type: "log",
27
+ level: "info",
28
+ nodeId: ctx.node.id,
29
+ message: `slack message_update ${result.data?.id} (${result.mode})`
30
+ });
31
+ return { __port: "out", value: result };
32
+ };
33
+ var slackUserLookupByEmailExecutor = async (ctx) => {
34
+ const config = ctx.node.data?.config ?? {};
35
+ const result = await slackUserLookupByEmail({
36
+ config,
37
+ input: ctx.inputs?.in
38
+ });
39
+ ctx.emit({
40
+ type: "log",
41
+ level: "info",
42
+ nodeId: ctx.node.id,
43
+ message: `slack user_lookup_by_email ${result.data?.id} (${result.mode})`
44
+ });
45
+ return { __port: "out", value: result };
46
+ };
47
+ var slackBlockActionsExecutor = async (ctx) => {
48
+ const config = ctx.node.data?.config ?? {};
49
+ const connection = resolveConnection({
50
+ service: SLACK.service,
51
+ operation: "block_actions",
52
+ sandbox: SLACK.sandbox,
53
+ baseUrls: SLACK.baseUrls,
54
+ requires: SLACK.requires,
55
+ connectionId: typeof config.connection === "string" ? config.connection : null,
56
+ requested: typeof config.mode === "string" ? config.mode : null
57
+ });
58
+ const event = triggerEvent(SLACK_BLOCK_ACTIONS, connection, ctx.inputs?.in, config);
59
+ return { __port: "out", value: event };
60
+ };
19
61
  var SLACK_RUNNABLE_KINDS = [
20
- { ...slackMessageKind, executor: slackMessageExecutor }
62
+ { ...slackMessageKind, executor: slackMessageExecutor },
63
+ { ...slackMessageUpdateKind, executor: slackMessageUpdateExecutor },
64
+ { ...slackUserLookupByEmailKind, executor: slackUserLookupByEmailExecutor },
65
+ { ...slackBlockActionsKind, executor: slackBlockActionsExecutor }
21
66
  ];
22
67
 
23
- export { SLACK_RUNNABLE_KINDS, slackMessageExecutor };
68
+ export { SLACK_RUNNABLE_KINDS, slackBlockActionsExecutor, slackMessageExecutor, slackMessageUpdateExecutor, slackUserLookupByEmailExecutor };
24
69
  //# sourceMappingURL=flow.js.map
25
70
  //# sourceMappingURL=flow.js.map
package/dist/flow.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;;AAoCO,IAAM,oBAAA,GAAqC,OAAO,GAAA,KAAQ;AAC/D,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,gBAAA,CAAiB;AAAA,IACpC,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ;AAAA,GACpB,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,mBAAA,EAAuB,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACpF,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAGO,IAAM,oBAAA,GAA6C;AAAA,EACxD,EAAE,GAAG,gBAAA,EAAkB,QAAA,EAAU,oBAAA;AACnC","file":"flow.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack's node kinds with their TypeScript executors attached — for hosts that\n * EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/slack-ui carries no executor: the\n * editor is React on every host, so a PHP or Python project installs the ui\n * package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"./service.js\";\n\nimport {\n slackMessageKind,\n} from \"@particle-academy/slack-ui\";\n\nimport { slackMessagePost } from \"./actions/message-post.js\";\n\nexport const slackMessageExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackMessagePost({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack message_post ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const SLACK_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...slackMessageKind, executor: slackMessageExecutor },\n];\n"]}
1
+ {"version":3,"sources":["../src/flow.ts"],"names":[],"mappings":";;;;AA0CO,IAAM,oBAAA,GAAqC,OAAO,GAAA,KAAQ;AAC/D,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,gBAAA,CAAiB;AAAA,IACpC,MAAA;AAAA,IACA,KAAA,EAAO,IAAI,MAAA,EAAQ;AAAA,GACpB,CAAA;AAED,EAAA,GAAA,CAAI,IAAA,CAAK;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,IAAI,IAAA,CAAK,EAAA;AAAA,IACjB,SAAS,CAAA,mBAAA,EAAuB,MAAA,CAAO,MAA0B,EAAE,CAAA,EAAA,EAAK,OAAO,IAAI,CAAA,CAAA;AAAA,GACpF,CAAA;AAED,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AACxC;AAEO,IAAM,0BAAA,GAA2C,OAAO,GAAA,KAAQ;AACrE,EAAA,MAAM,MAAA,GAAW,GAAA,CAAI,IAAA,CAAK,IAAA,EAA+C,UAAU,EAAC;AAEpF,EAAA,MAAM,MAAA,GAAS,MAAM,kBAAA,CAAmB;AAAA,IACtC,MAAA;AAAA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,IACX,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,cAAc,OAAO,MAAA,CAAO,UAAA,KAAe,QAAA,GAAW,OAAO,UAAA,GAAa,IAAA;AAAA,IAC1E,WAAW,OAAO,MAAA,CAAO,IAAA,KAAS,QAAA,GAAY,OAAO,IAAA,GAAyB;AAAA,GAC/E,CAAA;AAED,EAAA,MAAM,QAAQ,YAAA,CAAa,mBAAA,EAAqB,YAAY,GAAA,CAAI,MAAA,EAAQ,IAAI,MAAM,CAAA;AAElF,EAAA,OAAO,EAAE,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM;AACvC;AAGO,IAAM,oBAAA,GAA6C;AAAA,EACxD,EAAE,GAAG,gBAAA,EAAkB,QAAA,EAAU,oBAAA,EAAqB;AAAA,EACtD,EAAE,GAAG,sBAAA,EAAwB,QAAA,EAAU,0BAAA,EAA2B;AAAA,EAClE,EAAE,GAAG,0BAAA,EAA4B,QAAA,EAAU,8BAAA,EAA+B;AAAA,EAC1E,EAAE,GAAG,qBAAA,EAAuB,QAAA,EAAU,yBAAA;AACxC","file":"flow.js","sourcesContent":["/**\n * GENERATED FILE — do not edit.\n *\n * Emitted from provider/actions/ + triggers/ by weaver's generator.\n * A hand-edit here is destroyed by the next protocol sync, which is worse than\n * being rejected, because it works until it silently does not. Fix\n * provider/actions/ + triggers/ (or weaver's template/) and regenerate:\n *\n * npm run provider -- slack\n */\n\n/**\n * Slack's node kinds with their TypeScript executors attached — for hosts that\n * EXECUTE on TS.\n *\n * The authoring surface in @particle-academy/slack-ui carries no executor: the\n * editor is React on every host, so a PHP or Python project installs the ui\n * package and never this one.\n */\n\nimport type { NodeExecutor, NodeKindDefinition } from \"@particle-academy/fancy-flow/engine\";\nimport {\n idempotencyKeyFor,\n NO_IDEMPOTENCY_KEY_WARNING,\n resolveConnection,\n triggerEvent,\n type RequestedMode,\n} from \"@particle-academy/fancy-connector-core\";\nimport { SLACK } from \"./service.js\";\n\nimport {\n slackMessageKind,\n slackMessageUpdateKind,\n slackUserLookupByEmailKind,\n slackBlockActionsKind,\n} from \"@particle-academy/slack-ui\";\n\nimport { slackMessagePost } from \"./actions/message-post.js\";\nimport { slackMessageUpdate } from \"./actions/message-update.js\";\nimport { slackUserLookupByEmail } from \"./actions/user-lookup-by-email.js\";\nimport { SLACK_BLOCK_ACTIONS } from \"./triggers/block-actions.js\";\n\nexport const slackMessageExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackMessagePost({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack message_post ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const slackMessageUpdateExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackMessageUpdate({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack message_update ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const slackUserLookupByEmailExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n\n const result = await slackUserLookupByEmail({\n config,\n input: ctx.inputs?.in,\n });\n\n ctx.emit({\n type: \"log\",\n level: \"info\",\n nodeId: ctx.node.id,\n message: `slack user_lookup_by_email ${(result.data as { id?: string })?.id} (${result.mode})`,\n });\n\n return { __port: \"out\", value: result };\n};\n\nexport const slackBlockActionsExecutor: NodeExecutor = async (ctx) => {\n const config = ((ctx.node.data as { config?: Record<string, unknown> })?.config ?? {});\n const connection = resolveConnection({\n service: SLACK.service,\n operation: \"block_actions\",\n sandbox: SLACK.sandbox,\n baseUrls: SLACK.baseUrls,\n requires: SLACK.requires,\n connectionId: typeof config.connection === \"string\" ? config.connection : null,\n requested: typeof config.mode === \"string\" ? (config.mode as RequestedMode) : null,\n });\n\n const event = triggerEvent(SLACK_BLOCK_ACTIONS, connection, ctx.inputs?.in, config);\n\n return { __port: \"out\", value: event };\n};\n\n/** The kinds a TypeScript host registers. */\nexport const SLACK_RUNNABLE_KINDS: NodeKindDefinition[] = [\n { ...slackMessageKind, executor: slackMessageExecutor },\n { ...slackMessageUpdateKind, executor: slackMessageUpdateExecutor },\n { ...slackUserLookupByEmailKind, executor: slackUserLookupByEmailExecutor },\n { ...slackBlockActionsKind, executor: slackBlockActionsExecutor },\n];\n"]}