@friggframework/core 2.0.0--canary.703.12b980b.0 → 2.0.0--canary.707.df80bfd.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 (308) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/CLAUDE.md +28 -0
  3. package/README.md +105 -0
  4. package/application/commands/integration-commands.js +20 -10
  5. package/application/commands/scheduler-commands.js +11 -7
  6. package/application/commands/user-commands.js +17 -5
  7. package/application/index.js +6 -2
  8. package/core/Worker.js +31 -7
  9. package/core/create-handler.js +9 -0
  10. package/credential/repositories/credential-repository-documentdb.js +34 -0
  11. package/credential/repositories/credential-repository-interface.js +15 -0
  12. package/credential/repositories/credential-repository-mongo.js +23 -0
  13. package/credential/repositories/credential-repository-postgres.js +28 -0
  14. package/credential/use-cases/credential-operations-for-user.js +202 -0
  15. package/credential/use-cases/reauthorize-credential-for-user.js +73 -0
  16. package/database/config.js +48 -24
  17. package/database/documentdb-encryption-service.js +9 -22
  18. package/database/documentdb-utils.js +2 -2
  19. package/database/encryption/README.md +78 -14
  20. package/database/encryption/documentdb-encryption-service.md +78 -1
  21. package/database/encryption/encryption-config.js +219 -0
  22. package/database/encryption/encryption-schema-registry.js +121 -24
  23. package/database/encryption/field-encryption-service.js +69 -5
  24. package/database/encryption/integration-mapping-encryption.js +1 -1
  25. package/database/encryption/test-support/fake-ciphertext.js +15 -0
  26. package/database/organization-where.js +18 -0
  27. package/database/prisma.js +15 -38
  28. package/database/unique-violation.js +25 -0
  29. package/database/use-cases/check-encryption-health-use-case.js +43 -52
  30. package/errors/index.js +0 -4
  31. package/extensions/bootstrap-runner.js +43 -0
  32. package/extensions/extension-loader.js +230 -0
  33. package/extensions/index.js +44 -0
  34. package/extensions/initialize-app.js +123 -0
  35. package/extensions/prisma-composer.js +270 -0
  36. package/extensions/route-mounter.js +103 -0
  37. package/extensions/schema-composer.js +188 -0
  38. package/generated/prisma-mongodb/edge.js +33 -42
  39. package/generated/prisma-mongodb/index-browser.js +30 -39
  40. package/generated/prisma-mongodb/index.d.ts +3187 -2005
  41. package/generated/prisma-mongodb/index.js +33 -42
  42. package/generated/prisma-mongodb/package.json +1 -1
  43. package/generated/prisma-mongodb/schema.prisma +86 -59
  44. package/generated/prisma-mongodb/wasm.js +33 -42
  45. package/generated/prisma-postgresql/edge.js +33 -42
  46. package/generated/prisma-postgresql/index-browser.js +30 -39
  47. package/generated/prisma-postgresql/index.d.ts +3380 -2177
  48. package/generated/prisma-postgresql/index.js +33 -42
  49. package/generated/prisma-postgresql/package.json +1 -1
  50. package/generated/prisma-postgresql/schema.prisma +81 -57
  51. package/generated/prisma-postgresql/wasm.js +33 -42
  52. package/handlers/WEBHOOKS.md +0 -29
  53. package/handlers/app-definition-loader.js +128 -19
  54. package/handlers/app-handler-helpers.js +27 -8
  55. package/handlers/backend-utils.js +31 -25
  56. package/handlers/integration-event-dispatcher.js +3 -7
  57. package/handlers/middleware/admin-auth.js +14 -1
  58. package/handlers/routers/auth.js +46 -10
  59. package/handlers/routers/health.js +13 -4
  60. package/handlers/routers/integration-defined-routers.js +144 -92
  61. package/handlers/routers/integration-webhook-routers.js +100 -50
  62. package/handlers/workers/integration-defined-workers.js +5 -2
  63. package/index.js +66 -16
  64. package/infrastructure/scheduler/index.js +19 -6
  65. package/infrastructure/scheduler/netlify-scheduler-adapter.js +216 -0
  66. package/infrastructure/scheduler/scheduled-job-repository.js +118 -0
  67. package/infrastructure/scheduler/scheduler-service-factory.js +55 -7
  68. package/integrations/index.js +1 -14
  69. package/integrations/integration-base.js +2 -163
  70. package/integrations/integration-router.js +132 -102
  71. package/integrations/repositories/integration-mapping-repository-documentdb.js +0 -50
  72. package/integrations/repositories/integration-mapping-repository-interface.js +0 -15
  73. package/integrations/repositories/integration-mapping-repository-mongo.js +0 -29
  74. package/integrations/repositories/integration-mapping-repository-postgres.js +0 -30
  75. package/integrations/repositories/integration-mapping-repository.js +0 -29
  76. package/integrations/repositories/integration-not-found.js +14 -0
  77. package/integrations/repositories/integration-repository-documentdb.js +37 -9
  78. package/integrations/repositories/integration-repository-interface.js +17 -4
  79. package/integrations/repositories/integration-repository-mongo.js +64 -96
  80. package/integrations/repositories/integration-repository-postgres.js +63 -81
  81. package/integrations/repositories/process-repository-mongo.js +1 -1
  82. package/integrations/schedule-config.js +80 -0
  83. package/integrations/tests/doubles/test-integration-repository.js +12 -1
  84. package/integrations/use-cases/create-integration.js +56 -31
  85. package/integrations/use-cases/delete-integration-for-user.js +4 -4
  86. package/integrations/use-cases/dispatch-ongoing-syncs.js +100 -0
  87. package/integrations/use-cases/get-integration-for-user.js +2 -4
  88. package/integrations/use-cases/get-integration-instance.js +4 -4
  89. package/integrations/use-cases/get-integrations-for-user.js +79 -39
  90. package/integrations/use-cases/get-possible-integrations.js +2 -7
  91. package/integrations/use-cases/index.js +7 -1
  92. package/integrations/use-cases/integration-operations-for-user.js +256 -0
  93. package/integrations/use-cases/resolve-integration-ownership.js +177 -0
  94. package/integrations/use-cases/update-integration.js +4 -4
  95. package/integrations/utils/map-integration-dto.js +43 -14
  96. package/management-api/create-management-api-router.js +49 -0
  97. package/management-api/error-response.js +116 -0
  98. package/management-api/management-api-config.js +151 -0
  99. package/management-api/meta-router.js +76 -0
  100. package/management-api/openapi/build-openapi.js +144 -0
  101. package/management-api/openapi/components.js +415 -0
  102. package/management-api/openapi/v1-operations.js +83 -0
  103. package/management-api/openapi/v2-operations.js +264 -0
  104. package/management-api/route-registry.js +411 -0
  105. package/management-api/test-support/http-client.js +39 -0
  106. package/management-api/use-cases/get-management-api-meta.js +57 -0
  107. package/management-api/v1-deprecation.js +120 -0
  108. package/management-api/v2/create-v2-router.js +85 -0
  109. package/management-api/v2/dependencies.js +281 -0
  110. package/management-api/v2/dto.js +143 -0
  111. package/management-api/v2/handlers/authorization.js +94 -0
  112. package/management-api/v2/handlers/credentials.js +33 -0
  113. package/management-api/v2/handlers/entities.js +77 -0
  114. package/management-api/v2/handlers/integrations.js +128 -0
  115. package/management-api/v2/handlers/proxy.js +34 -0
  116. package/management-api/v2/request.js +85 -0
  117. package/management-api/v2/test-support/fake-dependencies.js +103 -0
  118. package/modules/domain/authorization-session.js +144 -0
  119. package/modules/entity-scope.js +15 -0
  120. package/modules/entity-type-registry.js +311 -0
  121. package/modules/index.js +14 -0
  122. package/modules/module-factory.js +12 -0
  123. package/modules/module.js +53 -2
  124. package/modules/proxy/proxy-bases.js +169 -0
  125. package/modules/proxy/proxy-errors.js +31 -0
  126. package/modules/proxy/proxy-path.js +183 -0
  127. package/modules/proxy/proxy-policy.js +277 -0
  128. package/modules/repositories/authorization-session-repository-documentdb.js +112 -0
  129. package/modules/repositories/authorization-session-repository-factory.js +31 -0
  130. package/modules/repositories/authorization-session-repository-interface.js +47 -0
  131. package/modules/repositories/authorization-session-repository-prisma.js +87 -0
  132. package/modules/repositories/entity-not-found.js +18 -0
  133. package/modules/repositories/module-repository-documentdb.js +51 -6
  134. package/modules/repositories/module-repository-interface.js +19 -2
  135. package/modules/repositories/module-repository-mongo.js +67 -74
  136. package/modules/repositories/module-repository-postgres.js +66 -74
  137. package/modules/repositories/module-repository.js +2 -1
  138. package/modules/requester/proxy-request.js +245 -0
  139. package/modules/requester/requester.js +35 -5
  140. package/modules/scope-config.js +192 -0
  141. package/modules/scope-policy.js +112 -0
  142. package/modules/scope-resolution.js +288 -0
  143. package/modules/scope-visibility.js +247 -0
  144. package/modules/tests/doubles/in-memory-authorization-session-repository.js +45 -0
  145. package/modules/tests/doubles/ownership-matching.js +18 -0
  146. package/modules/use-cases/authorize-entity-for-user.js +61 -0
  147. package/modules/use-cases/create-entity-from-credential.js +113 -0
  148. package/modules/use-cases/entity-operations-for-user.js +162 -0
  149. package/modules/use-cases/entity-types.js +139 -0
  150. package/modules/use-cases/execute-entity-proxy-request.js +331 -0
  151. package/modules/use-cases/get-authorization-requirements.js +100 -0
  152. package/modules/use-cases/get-entities-for-user.js +26 -13
  153. package/modules/use-cases/get-entity-module-for-user.js +113 -0
  154. package/modules/use-cases/get-entity-options-by-id.js +10 -4
  155. package/modules/use-cases/get-entity-options-by-type.js +1 -1
  156. package/modules/use-cases/get-module-instance-from-type.js +1 -1
  157. package/modules/use-cases/get-module.js +10 -4
  158. package/modules/use-cases/manage-access.js +21 -0
  159. package/modules/use-cases/multi-step-authorization.js +329 -0
  160. package/modules/use-cases/process-authorization-callback.js +53 -19
  161. package/modules/use-cases/refresh-entity-options.js +10 -4
  162. package/modules/use-cases/test-module-auth.js +10 -4
  163. package/package.json +6 -7
  164. package/prisma-mongodb/schema.prisma +86 -59
  165. package/prisma-postgresql/migrations/20261003000000_add_authorization_session/migration.sql +28 -0
  166. package/prisma-postgresql/migrations/20261015000000_add_organization_membership/migration.sql +26 -0
  167. package/prisma-postgresql/migrations/20261016000000_add_entity_integration_organization/migration.sql +25 -0
  168. package/prisma-postgresql/migrations/20261017000000_add_scheduled_job/migration.sql +28 -0
  169. package/prisma-postgresql/schema.prisma +81 -57
  170. package/providers/index.js +23 -0
  171. package/providers/resolve-provider.js +93 -0
  172. package/providers/runtime-detection.js +124 -0
  173. package/queues/index.js +25 -0
  174. package/queues/providers/index.js +11 -0
  175. package/queues/providers/netlify-background-provider.js +150 -0
  176. package/queues/providers/qstash-queue-provider.js +219 -0
  177. package/queues/providers/sqs-queue-provider.js +70 -0
  178. package/queues/queue-client-interface.js +55 -0
  179. package/queues/queue-message-auth.js +193 -0
  180. package/queues/queue-provider-factory.js +101 -0
  181. package/queues/queue-provider.js +65 -0
  182. package/queues/queuer-util.js +2 -9
  183. package/queues/sqs-queue-client.js +81 -0
  184. package/types/index.d.ts +2 -0
  185. package/types/modules/index.d.ts +214 -0
  186. package/types/user/index.d.ts +134 -0
  187. package/user/adopter-jwt-config.js +177 -0
  188. package/user/adopter-jwt-errors.js +59 -0
  189. package/user/adopter-token-verifier.js +122 -0
  190. package/user/app-user-helpers.js +97 -0
  191. package/user/create-user-authentication.js +64 -0
  192. package/user/membership.js +51 -0
  193. package/user/repositories/organization-membership-record.js +19 -0
  194. package/user/repositories/organization-membership-repository-documentdb.js +106 -0
  195. package/user/repositories/organization-membership-repository-factory.js +42 -0
  196. package/user/repositories/organization-membership-repository-interface.js +57 -0
  197. package/user/repositories/organization-membership-repository-mongo.js +13 -0
  198. package/user/repositories/organization-membership-repository-postgres.js +29 -0
  199. package/user/repositories/organization-membership-repository-prisma.js +81 -0
  200. package/user/repositories/user-repository-documentdb.js +27 -2
  201. package/user/repositories/user-repository-interface.js +18 -0
  202. package/user/repositories/user-repository-mongo.js +24 -0
  203. package/user/repositories/user-repository-postgres.js +18 -0
  204. package/user/tests/doubles/adopter-jwt-fixtures.js +220 -0
  205. package/user/use-cases/authenticate-user.js +7 -1
  206. package/user/use-cases/ensure-organization-membership.js +92 -0
  207. package/user/use-cases/find-individual-users-by-organization.js +54 -0
  208. package/user/use-cases/get-user-from-adopter-jwt.js +95 -124
  209. package/user/use-cases/get-user-from-x-frigg-headers.js +83 -80
  210. package/user/user.js +64 -1
  211. package/errors/mapping-already-exists-error.js +0 -14
  212. package/handlers/workers/integration-triggers.js +0 -25
  213. package/infrastructure/scheduler/recurrence.js +0 -204
  214. package/integrations/define/DESIGN.md +0 -122
  215. package/integrations/define/config.js +0 -98
  216. package/integrations/define/define-app.js +0 -66
  217. package/integrations/define/define-extension.js +0 -154
  218. package/integrations/define/define-integration.js +0 -335
  219. package/integrations/define/examples/deal-alerts.js +0 -140
  220. package/integrations/define/extension-binding.js +0 -174
  221. package/integrations/define/index.js +0 -11
  222. package/integrations/define/json-schema-lite.js +0 -68
  223. package/integrations/define/subscriptions.js +0 -186
  224. package/integrations/define/tests/fixtures/hubspot.js +0 -109
  225. package/integrations/define/tests/fixtures/slack.js +0 -26
  226. package/integrations/define/use.js +0 -39
  227. package/integrations/definitions/README.md +0 -278
  228. package/integrations/definitions/canonical.js +0 -11
  229. package/integrations/definitions/capabilities/AUDIT.md +0 -480
  230. package/integrations/definitions/capabilities/acmeerp.capabilities.json +0 -633
  231. package/integrations/definitions/capabilities/asana.capabilities.json +0 -279
  232. package/integrations/definitions/capabilities/calendly.capabilities.json +0 -385
  233. package/integrations/definitions/capabilities/docusign.capabilities.json +0 -314
  234. package/integrations/definitions/capabilities/fathom.capabilities.json +0 -238
  235. package/integrations/definitions/capabilities/github.capabilities.json +0 -585
  236. package/integrations/definitions/capabilities/hubspot.capabilities.json +0 -822
  237. package/integrations/definitions/capabilities/jira.capabilities.json +0 -391
  238. package/integrations/definitions/capabilities/klaviyo.capabilities.json +0 -503
  239. package/integrations/definitions/capabilities/linear.capabilities.json +0 -378
  240. package/integrations/definitions/capabilities/netsuite.capabilities.json +0 -535
  241. package/integrations/definitions/capabilities/notion.capabilities.json +0 -208
  242. package/integrations/definitions/capabilities/phone.capabilities.json +0 -511
  243. package/integrations/definitions/capabilities/pipedrive.capabilities.json +0 -430
  244. package/integrations/definitions/capabilities/quickbooks.capabilities.json +0 -635
  245. package/integrations/definitions/capabilities/salesforce.capabilities.json +0 -568
  246. package/integrations/definitions/capabilities/shopify.capabilities.json +0 -1128
  247. package/integrations/definitions/capabilities/slack.capabilities.json +0 -373
  248. package/integrations/definitions/capabilities/stripe.capabilities.json +0 -630
  249. package/integrations/definitions/capabilities/webflow.capabilities.json +0 -196
  250. package/integrations/definitions/capabilities/zendesk.capabilities.json +0 -422
  251. package/integrations/definitions/compile.js +0 -80
  252. package/integrations/definitions/config-form.js +0 -137
  253. package/integrations/definitions/examples/acme-erp-quickbooks.definition.json +0 -467
  254. package/integrations/definitions/examples/asana-slack.definition.json +0 -219
  255. package/integrations/definitions/examples/calendly-salesforce.definition.json +0 -459
  256. package/integrations/definitions/examples/docusign-salesforce.definition.json +0 -305
  257. package/integrations/definitions/examples/fathom-hubspot-notion.definition.json +0 -575
  258. package/integrations/definitions/examples/github-linear.definition.json +0 -322
  259. package/integrations/definitions/examples/hubspot-slack.definition.json +0 -427
  260. package/integrations/definitions/examples/klaviyo-hubspot.definition.json +0 -336
  261. package/integrations/definitions/examples/phone-hubspot.definition.json +0 -633
  262. package/integrations/definitions/examples/pipedrive-hubspot.definition.json +0 -136
  263. package/integrations/definitions/examples/pipedrive-phone.definition.json +0 -340
  264. package/integrations/definitions/examples/records/phone-hubspot.definition-version.json +0 -652
  265. package/integrations/definitions/examples/records/phone-hubspot.integration.json +0 -86
  266. package/integrations/definitions/examples/records/phone-hubspot.mappings.json +0 -39
  267. package/integrations/definitions/examples/records/phone-hubspot.workflow-run.json +0 -62
  268. package/integrations/definitions/examples/shopify-klaviyo.definition.json +0 -488
  269. package/integrations/definitions/examples/shopify-netsuite.definition.json +0 -622
  270. package/integrations/definitions/examples/stripe-quickbooks.definition.json +0 -476
  271. package/integrations/definitions/examples/webflow-hubspot-slack.definition.json +0 -262
  272. package/integrations/definitions/examples/zendesk-jira.definition.json +0 -604
  273. package/integrations/definitions/expressions.js +0 -229
  274. package/integrations/definitions/index.js +0 -48
  275. package/integrations/definitions/integration-runtime.js +0 -779
  276. package/integrations/definitions/interpreter.js +0 -104
  277. package/integrations/definitions/manifests.js +0 -177
  278. package/integrations/definitions/renderers/common.js +0 -67
  279. package/integrations/definitions/renderers/html.js +0 -129
  280. package/integrations/definitions/renderers/hubspot.js +0 -59
  281. package/integrations/definitions/renderers/preview.js +0 -154
  282. package/integrations/definitions/renderers/slack.js +0 -146
  283. package/integrations/definitions/repositories/definition-version-repository.js +0 -67
  284. package/integrations/definitions/repositories/workflow-run-repository.js +0 -80
  285. package/integrations/definitions/router.js +0 -170
  286. package/integrations/definitions/runtime.js +0 -268
  287. package/integrations/definitions/schema/capability-manifest.v0.1.schema.json +0 -549
  288. package/integrations/definitions/schema/installation.v0.1.schema.json +0 -130
  289. package/integrations/definitions/schema/integration-definition.v0.1.schema.json +0 -909
  290. package/integrations/definitions/schema/records.md +0 -105
  291. package/integrations/definitions/schema-check.js +0 -58
  292. package/integrations/definitions/scripts/check-manifests.js +0 -220
  293. package/integrations/definitions/scripts/validate.js +0 -66
  294. package/integrations/definitions/steps.js +0 -123
  295. package/integrations/definitions/sync-engine.js +0 -297
  296. package/integrations/definitions/tests/helpers-fake-crm.js +0 -49
  297. package/integrations/definitions/transforms.js +0 -91
  298. package/integrations/definitions/use-cases/definition-use-cases.js +0 -245
  299. package/integrations/definitions/validate.js +0 -436
  300. package/integrations/definitions/versioning.js +0 -176
  301. package/integrations/definitions/webhooks.js +0 -119
  302. package/integrations/integration-types.js +0 -73
  303. package/integrations/triggers.js +0 -244
  304. package/integrations/use-cases/run-trigger-tick.js +0 -155
  305. package/integrations/use-cases/run-trigger.js +0 -77
  306. package/prisma-postgresql/migrations/20261018000000_add_data_defined_integrations/migration.sql +0 -66
  307. package/prisma-postgresql/migrations/20261019000000_workflow_run_waits/migration.sql +0 -7
  308. package/prisma-postgresql/migrations/20261019120000_definition_workspace/migration.sql +0 -5
@@ -1,549 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://friggframework.org/schemas/capability-manifest/v0.1.json",
4
- "title": "Frigg API module capability manifest v0.1",
5
- "description": "What an API module can do, in terms a definition can reference: objects and their fields, events it emits, capabilities (each backed by one Api method) and option lists for settings. Shipped with the module.",
6
- "type": "object",
7
- "required": [
8
- "module",
9
- "package",
10
- "objects",
11
- "capabilities"
12
- ],
13
- "additionalProperties": false,
14
- "properties": {
15
- "$schema": {
16
- "type": "string"
17
- },
18
- "module": {
19
- "type": "string"
20
- },
21
- "label": {
22
- "type": "string"
23
- },
24
- "package": {
25
- "type": "string"
26
- },
27
- "version": {
28
- "type": "string"
29
- },
30
- "auth": {
31
- "enum": [
32
- "oauth2",
33
- "api_key",
34
- "basic"
35
- ]
36
- },
37
- "account": {
38
- "type": "object",
39
- "description": "Values about the connected account the module persists (apiPropertiesToPersist). Definitions read them as $.install.accounts.<module key>.<name>; nothing undeclared is exposed.",
40
- "required": [
41
- "fields"
42
- ],
43
- "properties": {
44
- "description": {
45
- "type": "string"
46
- },
47
- "fields": {
48
- "type": "array",
49
- "items": {
50
- "type": "object",
51
- "required": [
52
- "name",
53
- "type"
54
- ],
55
- "additionalProperties": false,
56
- "properties": {
57
- "name": {
58
- "type": "string",
59
- "pattern": "^[A-Za-z_]\\w*$"
60
- },
61
- "type": {
62
- "type": "string"
63
- },
64
- "description": {
65
- "type": "string"
66
- }
67
- }
68
- }
69
- }
70
- }
71
- },
72
- "objects": {
73
- "type": "object",
74
- "additionalProperties": {
75
- "type": "object",
76
- "properties": {
77
- "label": {
78
- "type": "string"
79
- },
80
- "fields": {
81
- "type": "array",
82
- "items": {
83
- "type": "object",
84
- "required": [
85
- "name",
86
- "type"
87
- ],
88
- "properties": {
89
- "name": {
90
- "type": "string"
91
- },
92
- "type": {
93
- "type": "string"
94
- },
95
- "tag": {
96
- "type": "string"
97
- },
98
- "required": {
99
- "type": "boolean"
100
- },
101
- "readOnly": {
102
- "type": "boolean"
103
- },
104
- "values": {
105
- "description": "enum: the values, or the name of one of this module's option lists when they differ per account.",
106
- "oneOf": [
107
- {
108
- "type": "array"
109
- },
110
- {
111
- "type": "string"
112
- }
113
- ]
114
- }
115
- }
116
- }
117
- },
118
- "sync": {
119
- "type": "object",
120
- "additionalProperties": false,
121
- "description": "How a sync reads and writes this object (sync-engine.js). A write's arguments are the mapped record (wrapped in `body` when the capability takes it in one argument); update and get also pass the record id as `id`.",
122
- "properties": {
123
- "id": {
124
- "type": "string",
125
- "default": "id",
126
- "description": "Path of the record's id."
127
- },
128
- "updatedAt": {
129
- "type": "string",
130
- "description": "Path of the record's last-modified time: poll high-water marks and master: newest."
131
- },
132
- "list": {
133
- "type": "object",
134
- "required": [
135
- "capability"
136
- ],
137
- "additionalProperties": false,
138
- "description": "Pages through every record.",
139
- "properties": {
140
- "capability": {
141
- "type": "string"
142
- },
143
- "cursor": {
144
- "type": "string",
145
- "pattern": "^[A-Za-z_]\\w*$",
146
- "description": "Argument taking the cursor, offset or page number."
147
- },
148
- "limit": {
149
- "type": "string",
150
- "pattern": "^[A-Za-z_]\\w*$",
151
- "description": "Argument taking the page size."
152
- },
153
- "since": {
154
- "type": "string",
155
- "pattern": "^[A-Za-z_]\\w*$",
156
- "description": "Argument taking a modified-since time (polling)."
157
- },
158
- "items": {
159
- "type": "string",
160
- "description": "Path of the records in the response; omit when the response is the array."
161
- },
162
- "next": {
163
- "type": "string",
164
- "description": "cursor paging: path of the next cursor in the response."
165
- },
166
- "paging": {
167
- "enum": [
168
- "cursor",
169
- "offset",
170
- "page"
171
- ],
172
- "default": "cursor"
173
- }
174
- }
175
- },
176
- "get": {
177
- "type": "object",
178
- "required": [
179
- "capability"
180
- ],
181
- "additionalProperties": false,
182
- "description": "Reads one record by id (an event that carries only an id is fetched with it).",
183
- "properties": {
184
- "capability": {
185
- "type": "string"
186
- },
187
- "id": {
188
- "type": "string",
189
- "pattern": "^[A-Za-z_]\\w*$"
190
- }
191
- }
192
- },
193
- "search": {
194
- "type": "object",
195
- "required": [
196
- "capability"
197
- ],
198
- "additionalProperties": false,
199
- "description": "Finds candidates by identity key; its arguments are named after the definition's identity keys.",
200
- "properties": {
201
- "capability": {
202
- "type": "string"
203
- }
204
- }
205
- },
206
- "create": {
207
- "type": "object",
208
- "required": [
209
- "capability"
210
- ],
211
- "additionalProperties": false,
212
- "description": "Creates a record.",
213
- "properties": {
214
- "capability": {
215
- "type": "string"
216
- },
217
- "body": {
218
- "type": "string",
219
- "pattern": "^[A-Za-z_]\\w*$"
220
- }
221
- }
222
- },
223
- "update": {
224
- "type": "object",
225
- "required": [
226
- "capability"
227
- ],
228
- "additionalProperties": false,
229
- "description": "Updates a record.",
230
- "properties": {
231
- "capability": {
232
- "type": "string"
233
- },
234
- "id": {
235
- "type": "string",
236
- "pattern": "^[A-Za-z_]\\w*$"
237
- },
238
- "body": {
239
- "type": "string",
240
- "pattern": "^[A-Za-z_]\\w*$"
241
- }
242
- }
243
- }
244
- }
245
- }
246
- }
247
- }
248
- },
249
- "events": {
250
- "type": "object",
251
- "additionalProperties": {
252
- "type": "object",
253
- "required": [
254
- "delivery"
255
- ],
256
- "properties": {
257
- "delivery": {
258
- "enum": [
259
- "webhook",
260
- "poll"
261
- ]
262
- },
263
- "object": {
264
- "type": "string"
265
- },
266
- "description": {
267
- "type": "string"
268
- },
269
- "payload": {
270
- "type": [
271
- "object",
272
- "array"
273
- ],
274
- "description": "Example delivery body, exactly as the provider sends it (HubSpot sends an array). With the manifest's webhook block it must route to this event; $.event is the event item."
275
- },
276
- "subscribe": {
277
- "type": "string",
278
- "description": "Capability that registers the subscription on install."
279
- },
280
- "record": {
281
- "type": "string",
282
- "description": "Path inside the payload to the record the event is about (exposed as $.record). Omit when the payload is the record."
283
- },
284
- "idPath": {
285
- "type": "string",
286
- "default": "id",
287
- "description": "Path to the provider's event id, used to run each event once."
288
- },
289
- "match": {
290
- "type": "string",
291
- "description": "The provider's topic for this event (default: the event key)."
292
- },
293
- "when": {
294
- "type": "string",
295
- "description": "Condition on $.record / $.event: a phone module reports a missed call as call.completed with status missed."
296
- },
297
- "headers": {
298
- "type": "object",
299
- "description": "Headers of the example delivery, when the topic is in a header."
300
- },
301
- "recordId": {
302
- "type": "string",
303
- "description": "Path in the event to the record id, when the event carries only an id (HubSpot's objectId): a sync fetches the record with the object's sync.get."
304
- }
305
- }
306
- }
307
- },
308
- "webhook": {
309
- "type": "object",
310
- "description": "How a POST from this provider becomes module events (webhooks.js). Templates read body, headers (lower-case), query, item (one event of a batch) and parent (the outer item of a two-level batch).",
311
- "required": [
312
- "scope",
313
- "topic",
314
- "eventId"
315
- ],
316
- "additionalProperties": false,
317
- "properties": {
318
- "scope": {
319
- "enum": [
320
- "installation",
321
- "app"
322
- ],
323
- "description": "installation: a URL per installation. app: one URL for every account, routed by account."
324
- },
325
- "topic": {
326
- "oneOf": [
327
- {
328
- "type": "string"
329
- },
330
- {
331
- "type": "array",
332
- "items": {
333
- "type": "string"
334
- },
335
- "minItems": 1
336
- }
337
- ],
338
- "description": "The provider's event type. A list tries each template until one renders non-empty."
339
- },
340
- "eventId": {
341
- "oneOf": [
342
- {
343
- "type": "string"
344
- },
345
- {
346
- "type": "array",
347
- "items": {
348
- "type": "string"
349
- },
350
- "minItems": 1
351
- }
352
- ],
353
- "description": "The id that makes a redelivery a no-op."
354
- },
355
- "account": {
356
- "oneOf": [
357
- {
358
- "type": "string"
359
- },
360
- {
361
- "type": "array",
362
- "items": {
363
- "type": "string"
364
- },
365
- "minItems": 1
366
- }
367
- ],
368
- "description": "The connected account (entity externalId) an event is about. Required for app scope."
369
- },
370
- "batch": {
371
- "oneOf": [
372
- {
373
- "type": "string"
374
- },
375
- {
376
- "type": "array",
377
- "items": {
378
- "type": "string"
379
- },
380
- "minItems": 1,
381
- "maxItems": 2
382
- }
383
- ],
384
- "description": "Path to the array of events; [outer, inner] for two levels."
385
- },
386
- "verify": {
387
- "type": "string",
388
- "pattern": "^[A-Za-z_$][\\w$]*$",
389
- "description": "Api method that checks the signature: ({ headers, body, query }) -> true."
390
- },
391
- "unwrap": {
392
- "type": "string",
393
- "description": "A form field holding the JSON body (Slack interactivity)."
394
- },
395
- "handshake": {
396
- "type": "object",
397
- "required": [
398
- "when"
399
- ],
400
- "additionalProperties": false,
401
- "properties": {
402
- "when": {
403
- "type": "string"
404
- },
405
- "status": {
406
- "type": "integer"
407
- },
408
- "headers": {
409
- "type": "object"
410
- },
411
- "body": {}
412
- },
413
- "description": "Answered at receipt, before anything is queued (Slack url_verification, Asana X-Hook-Secret)."
414
- },
415
- "status": {
416
- "enum": [
417
- "unimplemented"
418
- ],
419
- "description": "The module's Api has no `verify` method (or none that checks a signature). Every delivery fails verification until it does, so definitions that trigger on this module's events validate with a warning."
420
- },
421
- "note": {
422
- "type": "string"
423
- }
424
- }
425
- },
426
- "capabilities": {
427
- "type": "object",
428
- "additionalProperties": {
429
- "type": "object",
430
- "required": [
431
- "kind",
432
- "method"
433
- ],
434
- "properties": {
435
- "kind": {
436
- "enum": [
437
- "read",
438
- "write",
439
- "delete",
440
- "subscribe",
441
- "search"
442
- ]
443
- },
444
- "method": {
445
- "type": "string",
446
- "description": "Api class method that implements it."
447
- },
448
- "label": {
449
- "type": "string"
450
- },
451
- "input": {
452
- "type": "object",
453
- "description": "Argument names -> {type, required}."
454
- },
455
- "output": {
456
- "type": "string"
457
- },
458
- "args": {
459
- "type": "array",
460
- "description": "How the Api method takes its arguments, when it is not one object holding every input. Each entry is an input name (passed positionally), \"$rest\" (an object of every input not named elsewhere in the list) or {\"value\": x} (a constant, such as the sObject name of a generic Api). Omitted: the method is called with one object of all inputs.",
461
- "items": {
462
- "oneOf": [
463
- {
464
- "type": "string"
465
- },
466
- {
467
- "type": "object",
468
- "required": [
469
- "value"
470
- ],
471
- "additionalProperties": false,
472
- "properties": {
473
- "value": {}
474
- }
475
- }
476
- ]
477
- }
478
- },
479
- "status": {
480
- "enum": [
481
- "unimplemented"
482
- ],
483
- "description": "The module's real Api class has no method that does this (or none shaped so the call can be made). Definitions that use it validate with a warning, never an error."
484
- },
485
- "note": {
486
- "type": "string",
487
- "description": "What the real method does differently, or what is missing upstream."
488
- }
489
- }
490
- }
491
- },
492
- "options": {
493
- "type": "object",
494
- "additionalProperties": {
495
- "type": "object",
496
- "required": [
497
- "capability",
498
- "label",
499
- "value"
500
- ],
501
- "properties": {
502
- "capability": {
503
- "type": "string"
504
- },
505
- "label": {
506
- "type": "string",
507
- "description": "One reference ($.item.name) or a template ({{item.firstName}} {{item.lastName}}); never a $. reference mixed into text."
508
- },
509
- "value": {
510
- "type": "string"
511
- },
512
- "inputs": {
513
- "type": "object",
514
- "description": "Arguments the list capability needs, filled from a setting's options.with.",
515
- "additionalProperties": {
516
- "type": "object",
517
- "required": [
518
- "type"
519
- ],
520
- "properties": {
521
- "type": {
522
- "type": "string"
523
- },
524
- "required": {
525
- "type": "boolean"
526
- }
527
- }
528
- }
529
- }
530
- }
531
- }
532
- },
533
- "ui": {
534
- "type": "object",
535
- "properties": {
536
- "placements": {
537
- "type": "array",
538
- "items": {
539
- "type": "string"
540
- }
541
- },
542
- "renderer": {
543
- "type": "string",
544
- "description": "The generic renderer extension deployed once for this host."
545
- }
546
- }
547
- }
548
- }
549
- }
@@ -1,130 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://friggframework.org/schemas/installation/v0.1.json",
4
- "title": "Installation config v0.1",
5
- "description": "What one customer chose, stored as Integration.config. The definition says what is possible; this says what is on.",
6
- "type": "object",
7
- "required": [
8
- "definition"
9
- ],
10
- "properties": {
11
- "definition": {
12
- "type": "object",
13
- "required": [
14
- "id",
15
- "version"
16
- ],
17
- "properties": {
18
- "id": {
19
- "type": "string"
20
- },
21
- "version": {
22
- "type": "string"
23
- },
24
- "checksum": {
25
- "type": "string"
26
- }
27
- }
28
- },
29
- "settings": {
30
- "type": "object"
31
- },
32
- "syncs": {
33
- "type": "object",
34
- "additionalProperties": {
35
- "type": "object",
36
- "properties": {
37
- "enabled": {
38
- "type": "boolean"
39
- },
40
- "mapping": {
41
- "type": "array",
42
- "description": "Full replacement mapping when the customer overrides the default."
43
- },
44
- "schedule": {
45
- "$ref": "#/$defs/scheduleChoice"
46
- }
47
- }
48
- }
49
- },
50
- "workflows": {
51
- "type": "object",
52
- "additionalProperties": {
53
- "type": "object",
54
- "properties": {
55
- "enabled": {
56
- "type": "boolean"
57
- },
58
- "settings": {
59
- "type": "object"
60
- },
61
- "schedule": {
62
- "$ref": "#/$defs/scheduleChoice"
63
- }
64
- }
65
- }
66
- },
67
- "ui": {
68
- "type": "object",
69
- "additionalProperties": {
70
- "type": "object",
71
- "properties": {
72
- "enabled": {
73
- "type": "boolean"
74
- }
75
- }
76
- }
77
- },
78
- "runtime": {
79
- "type": "object",
80
- "description": "Owned by the runtime, not the customer. installed: each onInstall step's result by step id (webhook subscriptions), read by onUninstall as $.install.runtime.installed.<id>. Sync cursors join it with the sync engine.",
81
- "additionalProperties": false,
82
- "properties": {
83
- "installed": {
84
- "type": "object"
85
- }
86
- }
87
- }
88
- },
89
- "$defs": {
90
- "scheduleChoice": {
91
- "description": "The installation's timing for a schedule trigger or polling sync the definition marks configurable: every, or cron with an optional time zone. Honoured only within the definition's minimum; otherwise the definition's timing runs. The integration's shared trigger tick reads it (ADR-055); nothing is scheduled per installation.",
92
- "type": "object",
93
- "additionalProperties": false,
94
- "properties": {
95
- "every": {
96
- "type": "string",
97
- "pattern": "^\\d+\\s*(m|h|d)$"
98
- },
99
- "cron": {
100
- "type": "string"
101
- },
102
- "timezone": {
103
- "type": "string"
104
- }
105
- },
106
- "oneOf": [
107
- {
108
- "required": [
109
- "every"
110
- ],
111
- "not": {
112
- "required": [
113
- "cron"
114
- ]
115
- }
116
- },
117
- {
118
- "required": [
119
- "cron"
120
- ],
121
- "not": {
122
- "required": [
123
- "every"
124
- ]
125
- }
126
- }
127
- ]
128
- }
129
- }
130
- }