@friggframework/core 2.0.0--canary.700.80ec1cc.0 → 2.0.0--canary.702.047d3c4.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.
Files changed (130) hide show
  1. package/database/documentdb-utils.js +1 -6
  2. package/errors/index.js +0 -4
  3. package/generated/prisma-mongodb/edge.js +4 -52
  4. package/generated/prisma-mongodb/index-browser.js +1 -49
  5. package/generated/prisma-mongodb/index.d.ts +60 -3506
  6. package/generated/prisma-mongodb/index.js +4 -52
  7. package/generated/prisma-mongodb/package.json +1 -1
  8. package/generated/prisma-mongodb/schema.prisma +0 -65
  9. package/generated/prisma-mongodb/wasm.js +4 -52
  10. package/generated/prisma-postgresql/edge.js +4 -52
  11. package/generated/prisma-postgresql/index-browser.js +1 -49
  12. package/generated/prisma-postgresql/index.d.ts +94 -3824
  13. package/generated/prisma-postgresql/index.js +4 -52
  14. package/generated/prisma-postgresql/package.json +1 -1
  15. package/generated/prisma-postgresql/schema.prisma +0 -63
  16. package/generated/prisma-postgresql/wasm.js +4 -52
  17. package/handlers/WEBHOOKS.md +0 -29
  18. package/handlers/app-definition-loader.js +9 -2
  19. package/handlers/app-handler-helpers.js +2 -5
  20. package/handlers/integration-event-dispatcher.js +3 -7
  21. package/handlers/routers/integration-webhook-routers.js +38 -26
  22. package/index.js +0 -2
  23. package/integrations/integration-base.js +1 -162
  24. package/integrations/integration-router.js +1 -6
  25. package/integrations/repositories/integration-mapping-repository-documentdb.js +0 -50
  26. package/integrations/repositories/integration-mapping-repository-interface.js +0 -15
  27. package/integrations/repositories/integration-mapping-repository-mongo.js +0 -29
  28. package/integrations/repositories/integration-mapping-repository-postgres.js +0 -30
  29. package/integrations/repositories/integration-mapping-repository.js +0 -29
  30. package/integrations/repositories/integration-repository-documentdb.js +2 -6
  31. package/integrations/repositories/integration-repository-interface.js +0 -3
  32. package/integrations/repositories/integration-repository-mongo.js +5 -20
  33. package/integrations/repositories/integration-repository-postgres.js +1 -5
  34. package/integrations/repositories/process-repository-mongo.js +1 -1
  35. package/integrations/use-cases/create-integration.js +4 -14
  36. package/integrations/use-cases/delete-integration-for-user.js +4 -4
  37. package/integrations/use-cases/get-integration-for-user.js +2 -4
  38. package/integrations/use-cases/get-integration-instance.js +4 -4
  39. package/integrations/use-cases/get-integrations-for-user.js +4 -4
  40. package/integrations/use-cases/get-possible-integrations.js +2 -7
  41. package/integrations/use-cases/update-integration.js +4 -4
  42. package/package.json +6 -6
  43. package/prisma-mongodb/schema.prisma +0 -65
  44. package/prisma-postgresql/schema.prisma +0 -63
  45. package/queues/queuer-util.js +2 -9
  46. package/errors/mapping-already-exists-error.js +0 -14
  47. package/handlers/workers/integration-triggers.js +0 -25
  48. package/infrastructure/scheduler/recurrence.js +0 -204
  49. package/integrations/definitions/README.md +0 -278
  50. package/integrations/definitions/canonical.js +0 -11
  51. package/integrations/definitions/capabilities/AUDIT.md +0 -480
  52. package/integrations/definitions/capabilities/acmeerp.capabilities.json +0 -633
  53. package/integrations/definitions/capabilities/asana.capabilities.json +0 -279
  54. package/integrations/definitions/capabilities/calendly.capabilities.json +0 -385
  55. package/integrations/definitions/capabilities/docusign.capabilities.json +0 -314
  56. package/integrations/definitions/capabilities/fathom.capabilities.json +0 -238
  57. package/integrations/definitions/capabilities/github.capabilities.json +0 -585
  58. package/integrations/definitions/capabilities/hubspot.capabilities.json +0 -822
  59. package/integrations/definitions/capabilities/jira.capabilities.json +0 -391
  60. package/integrations/definitions/capabilities/klaviyo.capabilities.json +0 -503
  61. package/integrations/definitions/capabilities/linear.capabilities.json +0 -378
  62. package/integrations/definitions/capabilities/netsuite.capabilities.json +0 -535
  63. package/integrations/definitions/capabilities/notion.capabilities.json +0 -208
  64. package/integrations/definitions/capabilities/phone.capabilities.json +0 -511
  65. package/integrations/definitions/capabilities/pipedrive.capabilities.json +0 -430
  66. package/integrations/definitions/capabilities/quickbooks.capabilities.json +0 -635
  67. package/integrations/definitions/capabilities/salesforce.capabilities.json +0 -568
  68. package/integrations/definitions/capabilities/shopify.capabilities.json +0 -1128
  69. package/integrations/definitions/capabilities/slack.capabilities.json +0 -373
  70. package/integrations/definitions/capabilities/stripe.capabilities.json +0 -630
  71. package/integrations/definitions/capabilities/webflow.capabilities.json +0 -196
  72. package/integrations/definitions/capabilities/zendesk.capabilities.json +0 -422
  73. package/integrations/definitions/compile.js +0 -80
  74. package/integrations/definitions/config-form.js +0 -137
  75. package/integrations/definitions/examples/acme-erp-quickbooks.definition.json +0 -467
  76. package/integrations/definitions/examples/asana-slack.definition.json +0 -219
  77. package/integrations/definitions/examples/calendly-salesforce.definition.json +0 -459
  78. package/integrations/definitions/examples/docusign-salesforce.definition.json +0 -305
  79. package/integrations/definitions/examples/fathom-hubspot-notion.definition.json +0 -575
  80. package/integrations/definitions/examples/github-linear.definition.json +0 -322
  81. package/integrations/definitions/examples/hubspot-slack.definition.json +0 -427
  82. package/integrations/definitions/examples/klaviyo-hubspot.definition.json +0 -336
  83. package/integrations/definitions/examples/phone-hubspot.definition.json +0 -633
  84. package/integrations/definitions/examples/pipedrive-hubspot.definition.json +0 -136
  85. package/integrations/definitions/examples/pipedrive-phone.definition.json +0 -340
  86. package/integrations/definitions/examples/records/phone-hubspot.definition-version.json +0 -652
  87. package/integrations/definitions/examples/records/phone-hubspot.integration.json +0 -86
  88. package/integrations/definitions/examples/records/phone-hubspot.mappings.json +0 -39
  89. package/integrations/definitions/examples/records/phone-hubspot.workflow-run.json +0 -62
  90. package/integrations/definitions/examples/shopify-klaviyo.definition.json +0 -488
  91. package/integrations/definitions/examples/shopify-netsuite.definition.json +0 -622
  92. package/integrations/definitions/examples/stripe-quickbooks.definition.json +0 -476
  93. package/integrations/definitions/examples/webflow-hubspot-slack.definition.json +0 -262
  94. package/integrations/definitions/examples/zendesk-jira.definition.json +0 -604
  95. package/integrations/definitions/expressions.js +0 -229
  96. package/integrations/definitions/index.js +0 -45
  97. package/integrations/definitions/integration-runtime.js +0 -763
  98. package/integrations/definitions/interpreter.js +0 -104
  99. package/integrations/definitions/manifests.js +0 -177
  100. package/integrations/definitions/renderers/common.js +0 -67
  101. package/integrations/definitions/renderers/html.js +0 -129
  102. package/integrations/definitions/renderers/hubspot.js +0 -59
  103. package/integrations/definitions/renderers/preview.js +0 -154
  104. package/integrations/definitions/renderers/slack.js +0 -146
  105. package/integrations/definitions/repositories/definition-version-repository.js +0 -67
  106. package/integrations/definitions/repositories/workflow-run-repository.js +0 -80
  107. package/integrations/definitions/router.js +0 -170
  108. package/integrations/definitions/runtime.js +0 -268
  109. package/integrations/definitions/schema/capability-manifest.v0.1.schema.json +0 -549
  110. package/integrations/definitions/schema/installation.v0.1.schema.json +0 -130
  111. package/integrations/definitions/schema/integration-definition.v0.1.schema.json +0 -909
  112. package/integrations/definitions/schema/records.md +0 -105
  113. package/integrations/definitions/schema-check.js +0 -58
  114. package/integrations/definitions/scripts/check-manifests.js +0 -220
  115. package/integrations/definitions/scripts/validate.js +0 -66
  116. package/integrations/definitions/steps.js +0 -123
  117. package/integrations/definitions/sync-engine.js +0 -297
  118. package/integrations/definitions/tests/helpers-fake-crm.js +0 -49
  119. package/integrations/definitions/transforms.js +0 -91
  120. package/integrations/definitions/use-cases/definition-use-cases.js +0 -245
  121. package/integrations/definitions/validate.js +0 -436
  122. package/integrations/definitions/versioning.js +0 -176
  123. package/integrations/definitions/webhooks.js +0 -119
  124. package/integrations/integration-types.js +0 -64
  125. package/integrations/triggers.js +0 -244
  126. package/integrations/use-cases/run-trigger-tick.js +0 -155
  127. package/integrations/use-cases/run-trigger.js +0 -77
  128. package/prisma-postgresql/migrations/20261018000000_add_data_defined_integrations/migration.sql +0 -66
  129. package/prisma-postgresql/migrations/20261019000000_workflow_run_waits/migration.sql +0 -7
  130. package/prisma-postgresql/migrations/20261019120000_definition_workspace/migration.sql +0 -5
@@ -1,427 +0,0 @@
1
- {
2
- "$schema": "https://friggframework.org/schemas/integration-definition/v0.1.json",
3
- "schemaVersion": "0.1",
4
- "id": "hubspot-slack",
5
- "version": "1.2.0",
6
- "display": {
7
- "label": "HubSpot \u2192 Slack alerts",
8
- "description": "Deal-won and big-deal alerts, a Monday pipeline digest, and task reminders in DM that can be marked done from Slack.",
9
- "category": "Notifications",
10
- "tags": [
11
- "slack",
12
- "crm",
13
- "alerts",
14
- "sales"
15
- ]
16
- },
17
- "modules": {
18
- "hubspot": {
19
- "module": "hubspot",
20
- "version": "^1.4"
21
- },
22
- "slack": {
23
- "module": "slack",
24
- "version": "^2.0"
25
- }
26
- },
27
- "workflows": [
28
- {
29
- "id": "deal-won",
30
- "label": "Celebrate closed-won deals",
31
- "purpose": "notify",
32
- "default": "on",
33
- "settings": {
34
- "channel": {
35
- "type": "option",
36
- "options": "slack.channel",
37
- "label": "Post to",
38
- "required": true
39
- }
40
- },
41
- "trigger": {
42
- "type": "webhook",
43
- "module": "hubspot",
44
- "topic": "deal.propertyChange",
45
- "filter": "$.record.propertyName == 'dealstage' && $.record.propertyValue == 'closedwon'"
46
- },
47
- "steps": [
48
- {
49
- "id": "deal",
50
- "use": "hubspot.deal.get",
51
- "with": {
52
- "id": "$.record.objectId"
53
- }
54
- },
55
- {
56
- "id": "owner",
57
- "use": "hubspot.owner.get",
58
- "with": {
59
- "id": "$.steps.deal.properties.hubspot_owner_id"
60
- },
61
- "onError": "continue"
62
- },
63
- {
64
- "id": "text",
65
- "use": "template",
66
- "with": {
67
- "id": "deal-won"
68
- }
69
- },
70
- {
71
- "use": "slack.message.post",
72
- "with": {
73
- "channel": "$.settings.channel",
74
- "text": "$.steps.text"
75
- }
76
- }
77
- ]
78
- },
79
- {
80
- "id": "high-value-deal",
81
- "label": "Flag new high-value deals",
82
- "purpose": "notify",
83
- "default": "on",
84
- "settings": {
85
- "threshold": {
86
- "type": "number",
87
- "label": "Minimum amount",
88
- "default": 25000
89
- },
90
- "channel": {
91
- "type": "option",
92
- "options": "slack.channel",
93
- "label": "Post to",
94
- "required": true
95
- }
96
- },
97
- "trigger": {
98
- "type": "webhook",
99
- "module": "hubspot",
100
- "topic": "deal.created"
101
- },
102
- "steps": [
103
- {
104
- "id": "deal",
105
- "use": "hubspot.deal.get",
106
- "with": {
107
- "id": "$.record.objectId"
108
- }
109
- },
110
- {
111
- "use": "stop",
112
- "when": "!($.steps.deal.properties.amount exists) || $.steps.deal.properties.amount < $.settings.threshold",
113
- "with": {
114
- "reason": "Below the threshold"
115
- }
116
- },
117
- {
118
- "id": "text",
119
- "use": "template",
120
- "with": {
121
- "id": "high-value"
122
- }
123
- },
124
- {
125
- "use": "slack.message.post",
126
- "with": {
127
- "channel": "$.settings.channel",
128
- "text": "$.steps.text"
129
- }
130
- }
131
- ]
132
- },
133
- {
134
- "id": "weekly-digest",
135
- "label": "Monday pipeline digest",
136
- "description": "Every open deal closing in the next 7 days, one line each, in a single message.",
137
- "purpose": "notify",
138
- "default": "off",
139
- "settings": {
140
- "channel": {
141
- "type": "option",
142
- "options": "slack.channel",
143
- "label": "Post to",
144
- "required": true
145
- },
146
- "minAmount": {
147
- "type": "number",
148
- "label": "Only deals of at least",
149
- "default": 0
150
- }
151
- },
152
- "trigger": {
153
- "type": "schedule",
154
- "cron": "45 7 * * 1",
155
- "timezone": "America/New_York"
156
- },
157
- "steps": [
158
- {
159
- "id": "deals",
160
- "use": "hubspot.deal.search",
161
- "with": {
162
- "filterGroups": [
163
- {
164
- "filters": [
165
- {
166
- "propertyName": "hs_is_closed",
167
- "operator": "EQ",
168
- "value": "false"
169
- },
170
- {
171
- "propertyName": "closedate",
172
- "operator": "LT",
173
- "value": "{{now | to_unix | plus: 604800 | times: 1000}}"
174
- },
175
- {
176
- "propertyName": "amount",
177
- "operator": "GTE",
178
- "value": "$.settings.minAmount"
179
- }
180
- ]
181
- }
182
- ],
183
- "limit": 50
184
- }
185
- },
186
- {
187
- "use": "stop",
188
- "when": "$.steps.deals.results[0] == null",
189
- "with": {
190
- "reason": "Nothing closes this week"
191
- }
192
- },
193
- {
194
- "id": "build",
195
- "use": "foreach",
196
- "with": {
197
- "over": "$.steps.deals.results",
198
- "max": 50,
199
- "collect": "$.steps.line"
200
- },
201
- "do": [
202
- {
203
- "id": "line",
204
- "use": "template",
205
- "with": {
206
- "id": "digest-line"
207
- }
208
- }
209
- ]
210
- },
211
- {
212
- "id": "text",
213
- "use": "template",
214
- "with": {
215
- "id": "digest"
216
- }
217
- },
218
- {
219
- "use": "slack.message.post",
220
- "with": {
221
- "channel": "$.settings.channel",
222
- "text": "$.steps.text",
223
- "unfurl_links": false
224
- }
225
- }
226
- ]
227
- },
228
- {
229
- "id": "task-reminders",
230
- "label": "DM owners their tasks due today",
231
- "purpose": "notify",
232
- "default": "on",
233
- "trigger": {
234
- "type": "schedule",
235
- "cron": "55 8 * * 1-5",
236
- "timezone": "America/New_York"
237
- },
238
- "steps": [
239
- {
240
- "id": "tasks",
241
- "use": "hubspot.task.search",
242
- "with": {
243
- "dueBefore": "+1d",
244
- "status": "NOT_STARTED",
245
- "limit": 100
246
- }
247
- },
248
- {
249
- "id": "remind",
250
- "use": "foreach",
251
- "with": {
252
- "over": "$.steps.tasks.results",
253
- "max": 100
254
- },
255
- "do": [
256
- {
257
- "id": "owner",
258
- "use": "hubspot.owner.get",
259
- "when": "$.item.properties.hubspot_owner_id exists",
260
- "with": {
261
- "id": "$.item.properties.hubspot_owner_id"
262
- },
263
- "onError": "continue"
264
- },
265
- {
266
- "id": "slackUser",
267
- "use": "slack.user.lookupByEmail",
268
- "when": "$.steps.owner.email exists",
269
- "with": {
270
- "email": "$.steps.owner.email"
271
- },
272
- "onError": "continue"
273
- },
274
- {
275
- "use": "slack.message.post",
276
- "when": "$.steps.slackUser.id exists",
277
- "with": {
278
- "channel": "$.steps.slackUser.id",
279
- "text": "Due today: {{item.properties.hs_task_subject | mrkdwn}}",
280
- "metadata": {
281
- "event_type": "hubspot_task",
282
- "event_payload": {
283
- "taskId": "$.item.id"
284
- }
285
- }
286
- }
287
- }
288
- ]
289
- }
290
- ]
291
- },
292
- {
293
- "id": "mark-task-done",
294
- "label": "Mark a HubSpot task done from Slack",
295
- "purpose": "respond",
296
- "default": "on",
297
- "trigger": {
298
- "type": "userAction",
299
- "label": "Mark done",
300
- "from": "task-actions"
301
- },
302
- "steps": [
303
- {
304
- "use": "hubspot.task.update",
305
- "with": {
306
- "id": "$.record.metadata.event_payload.taskId",
307
- "properties": {
308
- "hs_task_status": "COMPLETED"
309
- }
310
- }
311
- },
312
- {
313
- "use": "slack.message.update",
314
- "with": {
315
- "channel": "$.record.channel",
316
- "ts": "$.record.ts",
317
- "text": ":white_check_mark: Done: {{record.text}}"
318
- }
319
- }
320
- ]
321
- }
322
- ],
323
- "queries": [
324
- {
325
- "id": "task-detail",
326
- "description": "The HubSpot task a reminder message points at (via its Slack message metadata).",
327
- "steps": [
328
- {
329
- "use": "stop",
330
- "when": "$.record.metadata.event_type != 'hubspot_task'",
331
- "with": {
332
- "reason": "Not a task reminder"
333
- }
334
- },
335
- {
336
- "id": "task",
337
- "use": "hubspot.task.get",
338
- "with": {
339
- "id": "$.record.metadata.event_payload.taskId",
340
- "properties": [
341
- "hs_task_subject",
342
- "hs_task_status",
343
- "hs_task_priority",
344
- "hs_timestamp"
345
- ]
346
- }
347
- }
348
- ],
349
- "returns": {
350
- "task": "$.steps.task",
351
- "portalId": "$.install.portalId"
352
- }
353
- }
354
- ],
355
- "ui": [
356
- {
357
- "id": "task-actions",
358
- "label": "HubSpot task",
359
- "host": "slack",
360
- "placement": "message.actions",
361
- "data": {
362
- "query": "task-detail"
363
- },
364
- "view": {
365
- "component": "Stack",
366
- "children": [
367
- {
368
- "component": "Heading",
369
- "props": {
370
- "text": "{{data.task.properties.hs_task_subject}}"
371
- }
372
- },
373
- {
374
- "component": "KeyValue",
375
- "props": {
376
- "items": [
377
- {
378
- "label": "Priority",
379
- "value": "{{data.task.properties.hs_task_priority | default: 'NONE'}}"
380
- },
381
- {
382
- "label": "Due",
383
- "value": "{{data.task.properties.hs_timestamp | date}}"
384
- }
385
- ]
386
- }
387
- },
388
- {
389
- "component": "Badge",
390
- "props": {
391
- "text": "{{data.task.properties.hs_task_status}}",
392
- "tone": "neutral"
393
- }
394
- },
395
- {
396
- "component": "Button",
397
- "when": "$.data.task.properties.hs_task_status != 'COMPLETED'",
398
- "props": {
399
- "label": "Mark done",
400
- "style": "primary",
401
- "action": {
402
- "type": "userAction",
403
- "workflow": "mark-task-done"
404
- }
405
- }
406
- },
407
- {
408
- "component": "Button",
409
- "props": {
410
- "label": "Open in HubSpot",
411
- "action": {
412
- "type": "open_url",
413
- "url": "https://app.hubspot.com/tasks/{{data.portalId}}/view/all/task/{{data.task.id}}"
414
- }
415
- }
416
- }
417
- ]
418
- }
419
- }
420
- ],
421
- "templates": {
422
- "deal-won": ":tada: *{{steps.deal.properties.dealname | mrkdwn}}* closed won for ${{steps.deal.properties.amount | default: '?'}}. Nice work {{steps.owner.firstName | default: 'team' | mrkdwn}}! <https://app.hubspot.com/contacts/{{install.portalId}}/record/0-3/{{steps.deal.id}}|Open deal>",
423
- "high-value": ":moneybag: New deal over ${{settings.threshold}}: *{{steps.deal.properties.dealname | mrkdwn}}* (${{steps.deal.properties.amount}}), closing {{steps.deal.properties.closedate | date}}. <https://app.hubspot.com/contacts/{{install.portalId}}/record/0-3/{{steps.deal.id}}|Open deal>",
424
- "digest-line": "\u2022 <https://app.hubspot.com/contacts/{{install.portalId}}/record/0-3/{{item.id}}|{{item.properties.dealname | mrkdwn}}>: ${{item.properties.amount | default: 0}}, closes {{item.properties.closedate | date}}",
425
- "digest": ":calendar: *Closing in the next 7 days* ({{steps.deals.results | size}} deals)\n{{steps.build | join: '\\n'}}"
426
- }
427
- }