@membranehq/sdk 0.1.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 (319) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/dist/bundle.d.ts +2543 -0
  4. package/dist/bundle.js +26089 -0
  5. package/dist/bundle.js.map +1 -0
  6. package/dist/dts/__mocks__/axios.d.ts +4 -0
  7. package/dist/dts/_helper.d.ts +7 -0
  8. package/dist/dts/_helper.test.d.ts +1 -0
  9. package/dist/dts/accessors.d.ts +85 -0
  10. package/dist/dts/accessors.test.d.ts +1 -0
  11. package/dist/dts/actions/accessors.d.ts +49 -0
  12. package/dist/dts/actions/action-types.d.ts +26 -0
  13. package/dist/dts/actions/index.d.ts +3 -0
  14. package/dist/dts/actions/types.d.ts +95 -0
  15. package/dist/dts/alerts/index.d.ts +1 -0
  16. package/dist/dts/alerts/types.d.ts +24 -0
  17. package/dist/dts/api-client.d.ts +32 -0
  18. package/dist/dts/api-client.test.d.ts +1 -0
  19. package/dist/dts/app-data-schemas/accessors.d.ts +18 -0
  20. package/dist/dts/app-data-schemas/api.d.ts +33 -0
  21. package/dist/dts/app-data-schemas/index.d.ts +23 -0
  22. package/dist/dts/app-events/accessors.d.ts +20 -0
  23. package/dist/dts/app-events/api.d.ts +44 -0
  24. package/dist/dts/app-events/index.d.ts +42 -0
  25. package/dist/dts/apps/index.d.ts +1 -0
  26. package/dist/dts/apps/types.d.ts +18 -0
  27. package/dist/dts/auth/accessors.d.ts +10 -0
  28. package/dist/dts/auth/index.d.ts +7 -0
  29. package/dist/dts/client.d.ts +70 -0
  30. package/dist/dts/connections/accessors.d.ts +88 -0
  31. package/dist/dts/connections/api.d.ts +27 -0
  32. package/dist/dts/connections/create-or-update-connection.d.ts +14 -0
  33. package/dist/dts/connections/index.d.ts +3 -0
  34. package/dist/dts/connections/types.d.ts +52 -0
  35. package/dist/dts/connector-copilot/index.d.ts +1 -0
  36. package/dist/dts/connector-copilot/types.d.ts +160 -0
  37. package/dist/dts/connectors/auth.d.ts +171 -0
  38. package/dist/dts/connectors/constants.d.ts +5 -0
  39. package/dist/dts/connectors/data-locations/base.d.ts +10 -0
  40. package/dist/dts/connectors/data-locations/collections/events/implementation-types/connector-event.d.ts +14 -0
  41. package/dist/dts/connectors/data-locations/collections/events/implementation-types/custom-pull.d.ts +14 -0
  42. package/dist/dts/connectors/data-locations/collections/events/implementation-types/full-scan.d.ts +7 -0
  43. package/dist/dts/connectors/data-locations/collections/events/implementation-types/pull-latest-records.d.ts +17 -0
  44. package/dist/dts/connectors/data-locations/collections/events/implementation-types/webhook.d.ts +18 -0
  45. package/dist/dts/connectors/data-locations/collections/events/index.d.ts +50 -0
  46. package/dist/dts/connectors/data-locations/collections/events/methods.d.ts +15 -0
  47. package/dist/dts/connectors/data-locations/collections/index.d.ts +70 -0
  48. package/dist/dts/connectors/data-locations/collections/methods/base.d.ts +24 -0
  49. package/dist/dts/connectors/data-locations/collections/methods/create.d.ts +7 -0
  50. package/dist/dts/connectors/data-locations/collections/methods/delete.d.ts +2 -0
  51. package/dist/dts/connectors/data-locations/collections/methods/find-by-id.d.ts +2 -0
  52. package/dist/dts/connectors/data-locations/collections/methods/find.d.ts +6 -0
  53. package/dist/dts/connectors/data-locations/collections/methods/list.d.ts +5 -0
  54. package/dist/dts/connectors/data-locations/collections/methods/match.d.ts +5 -0
  55. package/dist/dts/connectors/data-locations/collections/methods/search.d.ts +2 -0
  56. package/dist/dts/connectors/data-locations/collections/methods/update.d.ts +6 -0
  57. package/dist/dts/connectors/data-locations/directories/index.d.ts +17 -0
  58. package/dist/dts/connectors/data-locations/directories/methods/base.d.ts +18 -0
  59. package/dist/dts/connectors/data-locations/directories/methods/list.d.ts +2 -0
  60. package/dist/dts/connectors/data-locations/index.d.ts +6 -0
  61. package/dist/dts/connectors/data-locations/methods.d.ts +6 -0
  62. package/dist/dts/connectors/data-locations/types.d.ts +258 -0
  63. package/dist/dts/connectors/data-locations/utils.d.ts +17 -0
  64. package/dist/dts/connectors/data-locations/utils.test.d.ts +1 -0
  65. package/dist/dts/connectors/data-records.d.ts +7 -0
  66. package/dist/dts/connectors/events/index.d.ts +1 -0
  67. package/dist/dts/connectors/events/types.d.ts +36 -0
  68. package/dist/dts/connectors/global-webhooks/index.d.ts +1 -0
  69. package/dist/dts/connectors/global-webhooks/types.d.ts +33 -0
  70. package/dist/dts/connectors/graphql-api.d.ts +17 -0
  71. package/dist/dts/connectors/index.d.ts +13 -0
  72. package/dist/dts/connectors/methods.d.ts +44 -0
  73. package/dist/dts/connectors/openapi.d.ts +11 -0
  74. package/dist/dts/connectors/operations/handlers.d.ts +9 -0
  75. package/dist/dts/connectors/operations/index.d.ts +2 -0
  76. package/dist/dts/connectors/operations/types.d.ts +26 -0
  77. package/dist/dts/connectors/rest-api.d.ts +67 -0
  78. package/dist/dts/connectors/types.d.ts +75 -0
  79. package/dist/dts/connectors/udm.d.ts +14 -0
  80. package/dist/dts/data-builder/formula-processors.d.ts +13 -0
  81. package/dist/dts/data-builder/formula-processors.test.d.ts +1 -0
  82. package/dist/dts/data-builder/formula-types.d.ts +4 -0
  83. package/dist/dts/data-builder/formulas/and.d.ts +9 -0
  84. package/dist/dts/data-builder/formulas/and.test.d.ts +1 -0
  85. package/dist/dts/data-builder/formulas/base.d.ts +47 -0
  86. package/dist/dts/data-builder/formulas/case.d.ts +18 -0
  87. package/dist/dts/data-builder/formulas/case.test.d.ts +1 -0
  88. package/dist/dts/data-builder/formulas/concat.d.ts +19 -0
  89. package/dist/dts/data-builder/formulas/concat.test.d.ts +1 -0
  90. package/dist/dts/data-builder/formulas/copy.d.ts +10 -0
  91. package/dist/dts/data-builder/formulas/copy.test.d.ts +1 -0
  92. package/dist/dts/data-builder/formulas/dataSchemaRef.d.ts +22 -0
  93. package/dist/dts/data-builder/formulas/dataSchemaRef.test.d.ts +1 -0
  94. package/dist/dts/data-builder/formulas/domainFromEmail.d.ts +10 -0
  95. package/dist/dts/data-builder/formulas/domainFromEmail.test.d.ts +1 -0
  96. package/dist/dts/data-builder/formulas/eval.d.ts +28 -0
  97. package/dist/dts/data-builder/formulas/eval.test.d.ts +1 -0
  98. package/dist/dts/data-builder/formulas/extractDate.d.ts +11 -0
  99. package/dist/dts/data-builder/formulas/extractDate.test.d.ts +1 -0
  100. package/dist/dts/data-builder/formulas/extractTime.d.ts +11 -0
  101. package/dist/dts/data-builder/formulas/extractTime.test.d.ts +1 -0
  102. package/dist/dts/data-builder/formulas/findAppRecordId.d.ts +17 -0
  103. package/dist/dts/data-builder/formulas/findAppRecordId.test.d.ts +1 -0
  104. package/dist/dts/data-builder/formulas/findExternalRecordId.d.ts +17 -0
  105. package/dist/dts/data-builder/formulas/findExternalRecordId.test.d.ts +1 -0
  106. package/dist/dts/data-builder/formulas/first-name.d.ts +10 -0
  107. package/dist/dts/data-builder/formulas/first-name.test.d.ts +1 -0
  108. package/dist/dts/data-builder/formulas/firstNotEmpty.d.ts +7 -0
  109. package/dist/dts/data-builder/formulas/firstNotEmpty.test.d.ts +1 -0
  110. package/dist/dts/data-builder/formulas/formula.d.ts +8 -0
  111. package/dist/dts/data-builder/formulas/formula.test.d.ts +1 -0
  112. package/dist/dts/data-builder/formulas/index.d.ts +26 -0
  113. package/dist/dts/data-builder/formulas/index.test.d.ts +1 -0
  114. package/dist/dts/data-builder/formulas/iterate.d.ts +19 -0
  115. package/dist/dts/data-builder/formulas/iterate.test.d.ts +1 -0
  116. package/dist/dts/data-builder/formulas/jsonata.d.ts +8 -0
  117. package/dist/dts/data-builder/formulas/jsonata.test.d.ts +1 -0
  118. package/dist/dts/data-builder/formulas/last-name.d.ts +11 -0
  119. package/dist/dts/data-builder/formulas/last-name.test.d.ts +1 -0
  120. package/dist/dts/data-builder/formulas/lookup.d.ts +12 -0
  121. package/dist/dts/data-builder/formulas/lookup.test.d.ts +1 -0
  122. package/dist/dts/data-builder/formulas/map.d.ts +17 -0
  123. package/dist/dts/data-builder/formulas/map.test.d.ts +1 -0
  124. package/dist/dts/data-builder/formulas/mergeObjects.d.ts +12 -0
  125. package/dist/dts/data-builder/formulas/mergeObjects.test.d.ts +1 -0
  126. package/dist/dts/data-builder/formulas/or.d.ts +9 -0
  127. package/dist/dts/data-builder/formulas/or.test.d.ts +1 -0
  128. package/dist/dts/data-builder/formulas/plain.d.ts +8 -0
  129. package/dist/dts/data-builder/formulas/plain.test.d.ts +1 -0
  130. package/dist/dts/data-builder/formulas/record.d.ts +11 -0
  131. package/dist/dts/data-builder/formulas/record.test.d.ts +1 -0
  132. package/dist/dts/data-builder/formulas/tpl.d.ts +15 -0
  133. package/dist/dts/data-builder/formulas/tpl.test.d.ts +1 -0
  134. package/dist/dts/data-builder/formulas/types.d.ts +27 -0
  135. package/dist/dts/data-builder/formulas/var.d.ts +11 -0
  136. package/dist/dts/data-builder/formulas/var.test.d.ts +1 -0
  137. package/dist/dts/data-builder/index.d.ts +9 -0
  138. package/dist/dts/data-builder/index.test.d.ts +1 -0
  139. package/dist/dts/data-builder/locators.d.ts +44 -0
  140. package/dist/dts/data-builder/locators.test.d.ts +1 -0
  141. package/dist/dts/data-collections/index.d.ts +1 -0
  142. package/dist/dts/data-collections/types.d.ts +24 -0
  143. package/dist/dts/data-filter/index.d.ts +13 -0
  144. package/dist/dts/data-filter/index.test.d.ts +1 -0
  145. package/dist/dts/data-filter/operators.d.ts +13 -0
  146. package/dist/dts/data-filter/operators.test.d.ts +1 -0
  147. package/dist/dts/data-form/data-field.d.ts +7 -0
  148. package/dist/dts/data-form/index.d.ts +21 -0
  149. package/dist/dts/data-links/accessors.d.ts +20 -0
  150. package/dist/dts/data-links/api.d.ts +56 -0
  151. package/dist/dts/data-links/index.d.ts +36 -0
  152. package/dist/dts/data-schema/create.d.ts +2 -0
  153. package/dist/dts/data-schema/create.test.d.ts +1 -0
  154. package/dist/dts/data-schema/data-field.d.ts +14 -0
  155. package/dist/dts/data-schema/index.d.ts +5 -0
  156. package/dist/dts/data-schema/merge.d.ts +10 -0
  157. package/dist/dts/data-schema/merge.test.d.ts +1 -0
  158. package/dist/dts/data-schema/types.d.ts +35 -0
  159. package/dist/dts/data-schema/utils.d.ts +47 -0
  160. package/dist/dts/data-schema/utils.test.d.ts +1 -0
  161. package/dist/dts/data-sources/accessors.d.ts +64 -0
  162. package/dist/dts/data-sources/api.d.ts +90 -0
  163. package/dist/dts/data-sources/constants.d.ts +4 -0
  164. package/dist/dts/data-sources/index.d.ts +4 -0
  165. package/dist/dts/data-sources/types.d.ts +63 -0
  166. package/dist/dts/date-time/index.d.ts +1 -0
  167. package/dist/dts/date-time/parse.d.ts +1 -0
  168. package/dist/dts/date-time/parse.test.d.ts +1 -0
  169. package/dist/dts/datetime.d.ts +1 -0
  170. package/dist/dts/entity-repository.d.ts +24 -0
  171. package/dist/dts/errors/error-doc-enum.d.ts +7 -0
  172. package/dist/dts/errors/index.d.ts +105 -0
  173. package/dist/dts/external-events/accessors.d.ts +19 -0
  174. package/dist/dts/external-events/api.d.ts +22 -0
  175. package/dist/dts/external-events/index.d.ts +8 -0
  176. package/dist/dts/external-events/types.d.ts +157 -0
  177. package/dist/dts/field-mappings/accessors.d.ts +54 -0
  178. package/dist/dts/field-mappings/api.d.ts +58 -0
  179. package/dist/dts/field-mappings/index.d.ts +66 -0
  180. package/dist/dts/field-mappings/merge/is-object.test.d.ts +1 -0
  181. package/dist/dts/field-mappings/merge/merge-with-formulas.d.ts +2 -0
  182. package/dist/dts/field-mappings/merge/merge-with-formulas.test.d.ts +1 -0
  183. package/dist/dts/field-mappings/types.d.ts +12 -0
  184. package/dist/dts/flow-runs/accessors.d.ts +33 -0
  185. package/dist/dts/flow-runs/flow-node-runs.d.ts +42 -0
  186. package/dist/dts/flow-runs/index.d.ts +78 -0
  187. package/dist/dts/flows/accessors.d.ts +75 -0
  188. package/dist/dts/flows/api.d.ts +54 -0
  189. package/dist/dts/flows/index.d.ts +6 -0
  190. package/dist/dts/flows/nodes/api-request-to-external-app.d.ts +3 -0
  191. package/dist/dts/flows/nodes/api-request-to-your-app.d.ts +3 -0
  192. package/dist/dts/flows/nodes/api-trigger.d.ts +3 -0
  193. package/dist/dts/flows/nodes/app-event-trigger.d.ts +3 -0
  194. package/dist/dts/flows/nodes/base.d.ts +17 -0
  195. package/dist/dts/flows/nodes/connector-event-trigger.d.ts +3 -0
  196. package/dist/dts/flows/nodes/create-data-link.d.ts +3 -0
  197. package/dist/dts/flows/nodes/create-data-record.d.ts +3 -0
  198. package/dist/dts/flows/nodes/custom-http-request.d.ts +3 -0
  199. package/dist/dts/flows/nodes/data-record-created-trigger.d.ts +3 -0
  200. package/dist/dts/flows/nodes/data-record-deleted-trigger.d.ts +3 -0
  201. package/dist/dts/flows/nodes/data-record-updated-trigger.d.ts +3 -0
  202. package/dist/dts/flows/nodes/delete-data-link.d.ts +3 -0
  203. package/dist/dts/flows/nodes/delete-data-record.d.ts +3 -0
  204. package/dist/dts/flows/nodes/filter.d.ts +3 -0
  205. package/dist/dts/flows/nodes/find-data-link.d.ts +3 -0
  206. package/dist/dts/flows/nodes/find-data-record-by-id.d.ts +3 -0
  207. package/dist/dts/flows/nodes/find-data-records.d.ts +3 -0
  208. package/dist/dts/flows/nodes/find-or-create-data-record.d.ts +3 -0
  209. package/dist/dts/flows/nodes/for-each-v2.d.ts +3 -0
  210. package/dist/dts/flows/nodes/for-each.d.ts +3 -0
  211. package/dist/dts/flows/nodes/index.d.ts +37 -0
  212. package/dist/dts/flows/nodes/integration-specific-operation.d.ts +3 -0
  213. package/dist/dts/flows/nodes/list-data-records.d.ts +3 -0
  214. package/dist/dts/flows/nodes/lookup-data-record.d.ts +3 -0
  215. package/dist/dts/flows/nodes/run-action.d.ts +3 -0
  216. package/dist/dts/flows/nodes/run-javascript.d.ts +3 -0
  217. package/dist/dts/flows/nodes/schedule-trigger.d.ts +3 -0
  218. package/dist/dts/flows/nodes/search-data-records.d.ts +3 -0
  219. package/dist/dts/flows/nodes/transform-data.d.ts +3 -0
  220. package/dist/dts/flows/nodes/update-data-record.d.ts +3 -0
  221. package/dist/dts/flows/schemas.d.ts +240 -0
  222. package/dist/dts/flows/types.d.ts +77 -0
  223. package/dist/dts/flows/utils.d.ts +16 -0
  224. package/dist/dts/flows/utils.test.d.ts +1 -0
  225. package/dist/dts/http-requests.d.ts +37 -0
  226. package/dist/dts/iframe.d.ts +11 -0
  227. package/dist/dts/index.d.ts +41 -0
  228. package/dist/dts/index.umd.d.ts +2 -0
  229. package/dist/dts/integration-elements/common.d.ts +3 -0
  230. package/dist/dts/integration-elements/connection-level-element.accessor.d.ts +29 -0
  231. package/dist/dts/integration-elements/index.d.ts +74 -0
  232. package/dist/dts/integration-elements/integration-level-element.accessor.d.ts +25 -0
  233. package/dist/dts/integrations/accessors.d.ts +58 -0
  234. package/dist/dts/integrations/api.d.ts +23 -0
  235. package/dist/dts/integrations/index.d.ts +3 -0
  236. package/dist/dts/integrations/types.d.ts +38 -0
  237. package/dist/dts/jwt.d.ts +1 -0
  238. package/dist/dts/jwt.test.d.ts +1 -0
  239. package/dist/dts/logging/index.d.ts +8 -0
  240. package/dist/dts/logging/index.test.d.ts +1 -0
  241. package/dist/dts/logging/types.d.ts +13 -0
  242. package/dist/dts/orgs/index.d.ts +1 -0
  243. package/dist/dts/orgs/types.d.ts +59 -0
  244. package/dist/dts/scenarios/accessors.d.ts +9 -0
  245. package/dist/dts/scenarios/index.d.ts +2 -0
  246. package/dist/dts/scenarios/types.d.ts +145 -0
  247. package/dist/dts/screens/accessors.d.ts +9 -0
  248. package/dist/dts/screens/index.d.ts +2 -0
  249. package/dist/dts/screens/types.d.ts +37 -0
  250. package/dist/dts/udm/activities.d.ts +143 -0
  251. package/dist/dts/udm/activities.test.d.ts +1 -0
  252. package/dist/dts/udm/base.d.ts +62 -0
  253. package/dist/dts/udm/bills.d.ts +3 -0
  254. package/dist/dts/udm/campaign-members.d.ts +3 -0
  255. package/dist/dts/udm/campaigns.d.ts +3 -0
  256. package/dist/dts/udm/companies.d.ts +3 -0
  257. package/dist/dts/udm/contact-lists.d.ts +3 -0
  258. package/dist/dts/udm/contacts.d.ts +3 -0
  259. package/dist/dts/udm/credit-notes.d.ts +3 -0
  260. package/dist/dts/udm/customers.d.ts +3 -0
  261. package/dist/dts/udm/deal-products.d.ts +3 -0
  262. package/dist/dts/udm/deal-stages.d.ts +3 -0
  263. package/dist/dts/udm/deals.d.ts +3 -0
  264. package/dist/dts/udm/documents.d.ts +59 -0
  265. package/dist/dts/udm/drive-items.d.ts +78 -0
  266. package/dist/dts/udm/drives.d.ts +46 -0
  267. package/dist/dts/udm/eeocs.d.ts +3 -0
  268. package/dist/dts/udm/emails.d.ts +115 -0
  269. package/dist/dts/udm/employees.d.ts +3 -0
  270. package/dist/dts/udm/files.d.ts +73 -0
  271. package/dist/dts/udm/folders.d.ts +66 -0
  272. package/dist/dts/udm/index.d.ts +53 -0
  273. package/dist/dts/udm/invoices.d.ts +3 -0
  274. package/dist/dts/udm/job-applications.d.ts +3 -0
  275. package/dist/dts/udm/job-candidates.d.ts +3 -0
  276. package/dist/dts/udm/job-interviews.d.ts +3 -0
  277. package/dist/dts/udm/job-offers.d.ts +3 -0
  278. package/dist/dts/udm/jobs.d.ts +3 -0
  279. package/dist/dts/udm/journal-entries.d.ts +3 -0
  280. package/dist/dts/udm/leads.d.ts +3 -0
  281. package/dist/dts/udm/ledger-accounts.d.ts +3 -0
  282. package/dist/dts/udm/meetings.d.ts +98 -0
  283. package/dist/dts/udm/messages.d.ts +51 -0
  284. package/dist/dts/udm/notes.d.ts +61 -0
  285. package/dist/dts/udm/orders.d.ts +3 -0
  286. package/dist/dts/udm/payments.d.ts +3 -0
  287. package/dist/dts/udm/payrolls.d.ts +3 -0
  288. package/dist/dts/udm/products.d.ts +3 -0
  289. package/dist/dts/udm/projects.d.ts +3 -0
  290. package/dist/dts/udm/suppliers.d.ts +3 -0
  291. package/dist/dts/udm/tasks.d.ts +104 -0
  292. package/dist/dts/udm/tax-rates.d.ts +3 -0
  293. package/dist/dts/udm/timeoff-balances.d.ts +3 -0
  294. package/dist/dts/udm/timeoff-requests.d.ts +3 -0
  295. package/dist/dts/udm/users.d.ts +3 -0
  296. package/dist/dts/usage/index.d.ts +1 -0
  297. package/dist/dts/usage/types.d.ts +33 -0
  298. package/dist/dts/users/accessors.d.ts +10 -0
  299. package/dist/dts/users/api.d.ts +23 -0
  300. package/dist/dts/users/index.d.ts +13 -0
  301. package/dist/dts/variables.d.ts +27 -0
  302. package/dist/dts/webhooks/index.d.ts +1 -0
  303. package/dist/dts/webhooks/types.d.ts +11 -0
  304. package/dist/dts/workspace-elements/index.d.ts +1 -0
  305. package/dist/dts/workspace-elements/types.d.ts +77 -0
  306. package/dist/dts/workspace-elements-catalog/index.d.ts +27 -0
  307. package/dist/dts/workspace-updates/index.d.ts +1 -0
  308. package/dist/dts/workspace-updates/types.d.ts +6 -0
  309. package/dist/dts/workspaces/api.d.ts +5 -0
  310. package/dist/dts/workspaces/constants.d.ts +4 -0
  311. package/dist/dts/workspaces/index.d.ts +3 -0
  312. package/dist/dts/workspaces/types.d.ts +175 -0
  313. package/dist/index.d.ts +5022 -0
  314. package/dist/index.js +11815 -0
  315. package/dist/index.js.map +1 -0
  316. package/dist/index.module.d.mts +5022 -0
  317. package/dist/index.module.mjs +11551 -0
  318. package/dist/index.module.mjs.map +1 -0
  319. package/package.json +96 -0
@@ -0,0 +1,2543 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { z } from 'zod';
3
+
4
+ interface IntegrationAppClientOptions {
5
+ token?: string;
6
+ fetchToken?: () => Promise<string>;
7
+ credentials?: any;
8
+ fetchCredentials?: () => Promise<any>;
9
+ apiUri?: string;
10
+ uiUri?: string;
11
+ accessToken?: string;
12
+ }
13
+ declare class IntegrationAppApiClient {
14
+ apiUri: string;
15
+ uiUri: string;
16
+ token?: string;
17
+ protected fetchToken?: () => Promise<string>;
18
+ constructor({ uiUri, apiUri, accessToken, token, fetchToken, fetchCredentials, credentials, }?: IntegrationAppClientOptions);
19
+ setCredentials(credentials: any): Promise<any>;
20
+ getToken(): Promise<string>;
21
+ get(uri: string, queryParams?: Record<string, any>, options?: AxiosRequestConfig): Promise<any>;
22
+ post(uri: string, data?: any, options?: AxiosRequestConfig): Promise<any>;
23
+ put(uri: string, data?: any, options?: AxiosRequestConfig): Promise<any>;
24
+ patch(uri: string, data?: any, options?: AxiosRequestConfig): Promise<any>;
25
+ delete(uri: string, data?: any, options?: AxiosRequestConfig): Promise<any>;
26
+ getEmbedUri(page: string, pageParams?: Record<string, any>, options?: {
27
+ embedMode: 'isolated-embed' | 'popup-embed';
28
+ }): Promise<string>;
29
+ private makeApiRequest;
30
+ private handleRequestError;
31
+ }
32
+
33
+ type CommonListElementsQuery = SearchQuery & PaginationQuery & IncludeArchivedQuery;
34
+ type CommonInstancesListQuery = CommonListElementsQuery & {
35
+ userId?: string;
36
+ instanceKey?: string;
37
+ };
38
+ type CommonIntegrationOrConnectionQuery = {
39
+ connectionId?: string;
40
+ integrationId?: string;
41
+ integrationKey?: string;
42
+ };
43
+ type IncludeArchivedQuery = {
44
+ includeArchived?: boolean;
45
+ };
46
+ type SearchQuery = {
47
+ search?: string;
48
+ };
49
+ type PaginationQuery = {
50
+ limit?: number;
51
+ cursor?: string;
52
+ };
53
+ declare class PaginationResponse<T> {
54
+ items: T[];
55
+ cursor?: string;
56
+ }
57
+
58
+ declare enum ErrorDoc {
59
+ AuthenticationTokenErrors = "authentication-token-errors",
60
+ DataSourceNoCollectionSelected = "data-source-no-collection-selected",
61
+ FlowInstanceSetupFailed = "flow-instance-setup-failed",
62
+ FlowInstanceSetupTimeout = "flow-instance-setup-timeout",
63
+ WebhookCannotFindUser = "webhook-cannot-find-user"
64
+ }
65
+
66
+ declare enum ErrorType {
67
+ BAD_REQUEST = "bad_request",
68
+ CONNECTION = "connection",
69
+ CONFIGURATION = "configuration",
70
+ DEPENDENCY_ERROR = "dependency_error",
71
+ FLOW_RUN = "flow_run",
72
+ FLOW_INSTANCE_SETUP = "flow_instance_setup",
73
+ CONCURRENCY = "concurrency",
74
+ INTERNAL = "internal",
75
+ ACTION_RUN = "action_run",
76
+ ACTION_INSTANCE_SETUP = "action_instance_setup",
77
+ UNIT_RUN = "unit_run",
78
+ CUSTOM_CODE = "custom_code"
79
+ }
80
+ interface ErrorDataFields {
81
+ type?: ErrorType;
82
+ key?: string;
83
+ message: string;
84
+ data?: any;
85
+ doc?: ErrorDoc;
86
+ stack?: any;
87
+ causedByError?: ErrorData;
88
+ logs?: any[];
89
+ }
90
+ type ErrorConstructorArg = string | ErrorDataFields | Error;
91
+ declare class ErrorData implements ErrorDataFields {
92
+ constructor(arg: ErrorConstructorArg);
93
+ }
94
+ interface ErrorData extends ErrorDataFields {
95
+ }
96
+
97
+ declare enum WorkspaceElementType {
98
+ Customer = "customer",
99
+ Connector = "connector",
100
+ Integration = "integration",
101
+ Flow = "flow",
102
+ FlowInstance = "flow-instance",
103
+ FlowRun = "flow-run",
104
+ Action = "action",
105
+ Scenario = "scenario",
106
+ ActionInstance = "action-instance",
107
+ Connection = "connection",
108
+ FieldMapping = "field-mapping",
109
+ FieldMappingInstance = "field-mapping-instance",
110
+ DataSource = "data-source",
111
+ DataSourceInstance = "data-source-instance",
112
+ DataLinkTable = "data-link-table",
113
+ DataLinkTableInstance = "data-link-table-instance",
114
+ AppEventType = "app-event-type",
115
+ AppEventSubscription = "app-event-subscription",
116
+ AppDataSchema = "app-data-schema",
117
+ AppDataSchemaInstance = "app-data-schema-instance",
118
+ ExternalEventSubscription = "external-event-subscription",
119
+ ExternalEventLogRecord = "external-event-log-record",
120
+ ExternalEventPull = "external-event-pull",
121
+ DataCollection = "data-collection",
122
+ Screen = "screen",
123
+ ActionRunLogRecord = "action-run-log-record"
124
+ }
125
+ declare enum WorkspaceElementState {
126
+ CONFIGURATION_ERROR = "CONFIGURATION_ERROR",
127
+ SETUP_FAILED = "SETUP_FAILED",
128
+ READY = "READY"
129
+ }
130
+ declare enum WorkspaceElementDependencyType {
131
+ Configuration = "CONFIGURATION",
132
+ Parent = "PARENT"
133
+ }
134
+ interface WorkspaceElement {
135
+ id: string;
136
+ name: string;
137
+ key: string;
138
+ state?: WorkspaceElementState;
139
+ errors?: ErrorData[];
140
+ }
141
+ interface WorkspaceElementReference {
142
+ type: WorkspaceElementType;
143
+ id: string;
144
+ }
145
+ interface WorkspaceElementDependency extends WorkspaceElementReference {
146
+ dependencyType: WorkspaceElementDependencyType;
147
+ data?: unknown;
148
+ }
149
+
150
+ interface BaseElementInstance {
151
+ id: string;
152
+ }
153
+ interface ElementInstanceSelector {
154
+ id?: string;
155
+ autoCreate?: boolean;
156
+ instanceKey?: string;
157
+ userId?: string;
158
+ parentKey?: string;
159
+ parentId?: string;
160
+ }
161
+ interface IntegrationSpecificElementSelector {
162
+ id?: string;
163
+ key?: string;
164
+ integrationId?: string;
165
+ integrationKey?: string;
166
+ }
167
+ type SelectorType = {
168
+ id?: string;
169
+ } | string;
170
+ declare class ElementAccessor<Element, UpdateRequest, Selector extends SelectorType = string> {
171
+ protected options: {
172
+ client: IntegrationAppApiClient;
173
+ path: string;
174
+ selector: string | Selector;
175
+ };
176
+ constructor(options: {
177
+ client: IntegrationAppApiClient;
178
+ path: string;
179
+ selector: string | Selector;
180
+ });
181
+ getUniqueIdentifier(): string;
182
+ get(): Promise<Element>;
183
+ put(data: UpdateRequest): Promise<Element>;
184
+ patch(data: Partial<UpdateRequest>): Promise<Element>;
185
+ archive(): Promise<void>;
186
+ restore(): Promise<Element>;
187
+ getPath(operation?: string): string;
188
+ }
189
+ declare class ElementListAccessor<Element, FindQuery, CreateRequest> {
190
+ private client;
191
+ private path;
192
+ constructor(client: IntegrationAppApiClient, path: string);
193
+ find(query?: FindQuery): Promise<PaginationResponse<Element>>;
194
+ findAll(query?: Omit<FindQuery, 'limit'>): Promise<Element[]>;
195
+ create(data: CreateRequest): Promise<Element>;
196
+ }
197
+ declare class ElementInstanceListAccessor<ElementInstance extends BaseElementInstance, FindQuery> {
198
+ protected client: IntegrationAppApiClient;
199
+ private path;
200
+ constructor(client: IntegrationAppApiClient, path: string);
201
+ find(query?: FindQuery): Promise<PaginationResponse<ElementInstance>>;
202
+ }
203
+ declare class ElementInstanceAccessor<ElementInstance extends BaseElementInstance, Selector extends {
204
+ id?: string;
205
+ }, CreateRequest, UpdateRequest> {
206
+ protected options: {
207
+ client: IntegrationAppApiClient;
208
+ instancePath: string;
209
+ selector: string | Selector;
210
+ type?: WorkspaceElementType;
211
+ };
212
+ private id;
213
+ constructor(options: {
214
+ client: IntegrationAppApiClient;
215
+ instancePath: string;
216
+ selector: string | Selector;
217
+ type?: WorkspaceElementType;
218
+ });
219
+ getUniqueIdentifier(): string;
220
+ get(): Promise<ElementInstance>;
221
+ getId(): Promise<string>;
222
+ create(data?: CreateRequest): Promise<ElementInstance>;
223
+ put(data: CreateRequest): Promise<ElementInstance>;
224
+ patch(data: UpdateRequest): Promise<ElementInstance>;
225
+ archive(): Promise<void>;
226
+ delete(): Promise<void>;
227
+ restore(): Promise<ElementInstance>;
228
+ protected getPath(operation?: string): string;
229
+ private getSelector;
230
+ }
231
+
232
+ interface FindConnectionsQuery extends PaginationQuery {
233
+ userId?: string;
234
+ isTest?: boolean;
235
+ integrationKey?: string;
236
+ integrationId?: string;
237
+ includeArchived?: boolean;
238
+ }
239
+ declare class CreateConnectionRequest {
240
+ name: string;
241
+ integrationId: string;
242
+ credentials?: string;
243
+ }
244
+ declare class UpdateConnectionRequest {
245
+ name?: string;
246
+ credentials?: string;
247
+ accessToken?: string;
248
+ }
249
+ interface ConnectionSelector {
250
+ id?: string;
251
+ integrationKey?: string;
252
+ integrationId?: string;
253
+ connectionId?: string;
254
+ }
255
+
256
+ interface DataRecord {
257
+ id: string;
258
+ name?: string;
259
+ uri?: string;
260
+ iconUri?: string;
261
+ fields?: Record<string, any>;
262
+ udm?: string;
263
+ unifiedFields?: Record<string, any>;
264
+ rawFields?: Record<string, any>;
265
+ createdTime?: string;
266
+ updatedTime?: string;
267
+ deletedTime?: string;
268
+ createdById?: string;
269
+ updatedById?: string;
270
+ }
271
+ declare enum DataCollectionEventType {
272
+ CREATED = "created",
273
+ UPDATED = "updated",
274
+ DELETED = "deleted"
275
+ }
276
+
277
+ interface DataSchema {
278
+ title?: string;
279
+ description?: string;
280
+ type?: string | string[];
281
+ format?: string;
282
+ properties?: {
283
+ [key: string]: DataSchema;
284
+ };
285
+ items?: DataSchema;
286
+ additionalProperties?: boolean | DataSchema;
287
+ enum?: string[];
288
+ referenceRecords?: DataRecord[];
289
+ referenceCollection?: {
290
+ key: any;
291
+ parameters?: Record<string, any>;
292
+ };
293
+ referenceUdm?: string;
294
+ default?: any;
295
+ allowCustom?: boolean;
296
+ $ref?: string;
297
+ required?: string[];
298
+ minLength?: number;
299
+ maxLength?: number;
300
+ minimum?: number;
301
+ maximum?: number;
302
+ maxItems?: number;
303
+ readOnly?: boolean;
304
+ writeOnly?: boolean;
305
+ examples?: any[];
306
+ anyOf?: DataSchema[];
307
+ isImplied?: boolean;
308
+ referenceCollectionPath?: string;
309
+ referenceCollectionUri?: string;
310
+ }
311
+
312
+ declare enum HttpRequestMethod {
313
+ GET = "GET",
314
+ POST = "POST",
315
+ PATCH = "PATCH",
316
+ PUT = "PUT",
317
+ DELETE = "DELETE"
318
+ }
319
+ interface HttpRequestSpec {
320
+ method?: HttpRequestMethod;
321
+ uri: any;
322
+ headers?: Record<string, any>;
323
+ query?: Record<string, any>;
324
+ body?: any;
325
+ }
326
+
327
+ interface GraphQLApiMapping {
328
+ path: string;
329
+ operationType: 'query' | 'mutation';
330
+ requestMapping: GraphQLFieldMapping[];
331
+ responseMapping?: any;
332
+ }
333
+ interface GraphQLFieldMapping {
334
+ field: string;
335
+ args?: Record<string, any>;
336
+ subFields?: GraphQLFieldMapping[];
337
+ }
338
+
339
+ interface OperationBase {
340
+ key: string;
341
+ name: string;
342
+ isReadOnly?: boolean;
343
+ description?: string;
344
+ tags?: string[];
345
+ }
346
+ interface OperationListItem extends OperationBase {
347
+ }
348
+ interface OperationSpec extends OperationBase {
349
+ inputSchema?: any;
350
+ outputSchema?: any;
351
+ isReadOnly?: boolean;
352
+ }
353
+ interface OperationRunRequest {
354
+ input: any;
355
+ }
356
+ interface OperationRunResponse {
357
+ output?: any;
358
+ }
359
+ interface OperationMapping {
360
+ operationKey: string;
361
+ inputMapping?: any;
362
+ outputMapping?: any;
363
+ }
364
+
365
+ type ConnectorOperationMethod<ImplementationFields extends ConnectorMethodImplementation | ConnectorMethodImplementationBase = ConnectorMethodImplementationBase> = {
366
+ isIncomplete?: boolean;
367
+ } & ImplementationFields;
368
+ interface ConnectorOperationHandler extends OperationSpec {
369
+ methods?: Record<'run', ConnectorOperationMethod>;
370
+ }
371
+
372
+ interface RestApiMapping {
373
+ path: string;
374
+ method: string;
375
+ requestMapping: {
376
+ pathParameters?: any;
377
+ query?: any;
378
+ data?: any;
379
+ headers?: any;
380
+ };
381
+ responseMapping?: any;
382
+ }
383
+
384
+ declare enum ConnectorMethodImplementationType {
385
+ mapping = "mapping",
386
+ operationMapping = "operation-mapping",
387
+ restApiMapping = "rest-api-mapping",
388
+ graphqlApiMapping = "graphql-api-mapping",
389
+ javascript = "javascript",
390
+ notSupported = "not-supported"
391
+ }
392
+ type ConnectorMethodImplementation = ConnectorMethodImplementationBase | ConnectorMethodImplementationMapping | ConnectorMethodImplementationOperationMapping | ConnectorMethodImplementationRestApiMapping | ConnectorMethodImplementationGraphqlApiMapping | ConnectorMethodImplementationJavascript | ConnectorMethodImplementationNotSupported;
393
+ interface ConnectorMethodImplementationBase {
394
+ implementationType?: ConnectorMethodImplementationType;
395
+ filePath?: string;
396
+ inheritedFromPath?: string[];
397
+ isIncomplete?: boolean;
398
+ parametersSchema?: DataSchema;
399
+ }
400
+ interface ConnectorMethodImplementationMapping extends ConnectorMethodImplementationBase {
401
+ implementationType: ConnectorMethodImplementationType.mapping;
402
+ mapping: any;
403
+ }
404
+ interface ConnectorMethodImplementationOperationMapping extends ConnectorMethodImplementationBase {
405
+ implementationType: ConnectorMethodImplementationType.operationMapping;
406
+ mapping: OperationMapping;
407
+ }
408
+ interface ConnectorMethodImplementationRestApiMapping extends ConnectorMethodImplementationBase {
409
+ implementationType: ConnectorMethodImplementationType.restApiMapping;
410
+ mapping: RestApiMapping;
411
+ }
412
+ interface ConnectorMethodImplementationGraphqlApiMapping extends ConnectorMethodImplementationBase {
413
+ implementationType: ConnectorMethodImplementationType.graphqlApiMapping;
414
+ mapping: GraphQLApiMapping;
415
+ }
416
+ interface ConnectorMethodImplementationJavascript extends ConnectorMethodImplementationBase {
417
+ implementationType: ConnectorMethodImplementationType.javascript;
418
+ code: string;
419
+ }
420
+ interface ConnectorMethodImplementationNotSupported extends ConnectorMethodImplementationBase {
421
+ implementationType: ConnectorMethodImplementationType.notSupported;
422
+ }
423
+
424
+ type DataLocationSpec = DataCollectionSpec | DataDirectorySpec;
425
+ declare enum DataLocationType {
426
+ directory = "directory",
427
+ collection = "collection"
428
+ }
429
+ interface DataLocationListItem {
430
+ key: string;
431
+ name: string;
432
+ type: DataLocationType;
433
+ isHidden?: boolean;
434
+ }
435
+ interface DataLocationPointer {
436
+ key: string;
437
+ parameters?: Record<string, any>;
438
+ type?: DataLocationType;
439
+ }
440
+ interface DataLocation {
441
+ key?: string;
442
+ parameters?: any;
443
+ path?: string;
444
+ name?: string;
445
+ type?: DataLocationType;
446
+ isDefault?: boolean;
447
+ read?: boolean;
448
+ write?: boolean;
449
+ }
450
+ interface DataLocationSpecBase {
451
+ type: DataLocationType;
452
+ key?: string;
453
+ name: string;
454
+ parametersSchema?: DataSchema;
455
+ }
456
+ interface DataCollectionSpec extends DataLocationSpecBase {
457
+ fieldsSchema?: DataSchema;
458
+ list?: DataCollectionListSpec;
459
+ search?: DataCollectionSearchSpec;
460
+ match?: DataCollectionMatchSpec;
461
+ findById?: DataCollectionFindByIdSpec;
462
+ create?: DataCollectionCreateSpec;
463
+ update?: DataCollectionUpdateSpec;
464
+ delete?: DataCollectionDeleteSpec;
465
+ events?: DataCollectionEventsSpec;
466
+ customFields?: boolean;
467
+ udm?: DataCollectionUdmsSpec;
468
+ find?: DataCollectionFindSpec;
469
+ }
470
+ interface ApiRequestSpec {
471
+ path: any;
472
+ method: any;
473
+ }
474
+ interface DataDirectorySpec extends DataLocationSpecBase {
475
+ locations?: DataLocation[];
476
+ }
477
+ interface DataCollectionMethodSpec {
478
+ apiRequests?: ApiRequestSpec[];
479
+ }
480
+ interface DataCollectionFindSpec extends DataCollectionMethodSpec {
481
+ queryFields?: string[];
482
+ }
483
+ interface DataCollectionMatchSpec extends DataCollectionMethodSpec {
484
+ fields?: string[];
485
+ }
486
+ interface DataCollectionListSpec extends DataCollectionMethodSpec {
487
+ filterFields?: string[];
488
+ }
489
+ interface DataCollectionSearchSpec extends DataCollectionMethodSpec {
490
+ }
491
+ interface DataCollectionFindByIdSpec extends DataCollectionMethodSpec {
492
+ }
493
+ interface DataCollectionCreateSpec extends DataCollectionMethodSpec {
494
+ fields?: string[];
495
+ requiredFields?: string[];
496
+ excludedFields?: string[];
497
+ }
498
+ interface DataCollectionUpdateSpec extends DataCollectionMethodSpec {
499
+ fields?: string[];
500
+ excludedFields?: string[];
501
+ }
502
+ interface DataCollectionDeleteSpec extends DataCollectionMethodSpec {
503
+ }
504
+ type DataCollectionUdmSpec = {
505
+ fields?: string[];
506
+ extract?: Record<string, any>;
507
+ parse?: Record<string, any>;
508
+ };
509
+ type DataCollectionUdmsSpec = Record<string, DataCollectionUdmSpec>;
510
+ type DataCollectionEventTypeSpec = {
511
+ type: 'push' | 'pull';
512
+ isFullScan?: boolean;
513
+ isIdOnly?: boolean;
514
+ };
515
+ type DataCollectionEventsSpec = {
516
+ [value in DataCollectionEventType]: DataCollectionEventTypeSpec;
517
+ } & {
518
+ all?: DataCollectionEventTypeSpec;
519
+ };
520
+ interface DataCollectionMethodRequest {
521
+ parameters?: Record<string, any>;
522
+ }
523
+ interface DataCollectionFindRequest {
524
+ query?: any;
525
+ cursor?: string;
526
+ }
527
+ interface DataCollectionFindResponse {
528
+ records: DataRecord[];
529
+ cursor?: string;
530
+ }
531
+ interface DataCollectionListRequest extends DataCollectionMethodRequest {
532
+ filter?: any;
533
+ unifiedFilter?: any;
534
+ cursor?: string;
535
+ }
536
+ interface DataCollectionListResponseDrilldown {
537
+ parameters?: Record<string, any>;
538
+ filter?: Record<string, any>;
539
+ }
540
+ interface DataCollectionListResponse {
541
+ records: DataRecord[];
542
+ drilldowns?: Array<DataCollectionListResponseDrilldown>;
543
+ cursor?: string;
544
+ }
545
+ interface DataCollectionSearchRequest extends DataCollectionMethodRequest {
546
+ query: string;
547
+ cursor?: string;
548
+ }
549
+ interface DataCollectionSearchResponse {
550
+ records: DataRecord[];
551
+ cursor?: string;
552
+ }
553
+ interface DataCollectionFindByIdRequest extends DataCollectionMethodRequest {
554
+ id: string;
555
+ udm?: string;
556
+ }
557
+ interface DataCollectionFindByIdResponse {
558
+ record: DataRecord;
559
+ }
560
+ interface DataCollectionMatchRequest extends DataCollectionMethodRequest {
561
+ query: Record<string, any>;
562
+ }
563
+ interface DataCollectionMatchResponse {
564
+ record?: DataRecord;
565
+ }
566
+ interface DataCollectionCreateRequest extends DataCollectionMethodRequest {
567
+ fields: Record<string, any>;
568
+ }
569
+ interface DataCollectionCreateResponse {
570
+ id: string;
571
+ }
572
+ interface DataCollectionUpdateRequest extends DataCollectionMethodRequest {
573
+ id: string;
574
+ fields: Record<string, any>;
575
+ }
576
+ interface DataCollectionUpdateResponse {
577
+ id: string;
578
+ }
579
+ interface DataCollectionDeleteRequest extends DataCollectionMethodRequest {
580
+ id: string;
581
+ }
582
+ interface DataCollectionDeleteResponse {
583
+ }
584
+ interface DataDirectoryListRequest {
585
+ cursor?: string;
586
+ }
587
+ interface DataDirectoryListResponse {
588
+ locations: DataLocation[];
589
+ cursor?: string;
590
+ }
591
+
592
+ declare enum UDM {
593
+ ACTIVITIES = "activities",
594
+ BILLS = "bills",
595
+ CAMPAIGN_MEMBERS = "campaign-members",
596
+ CAMPAIGNS = "campaigns",
597
+ COMPANIES = "companies",
598
+ CONTACTS = "contacts",
599
+ CONTACT_LISTS = "contact-lists",
600
+ CREDIT_NOTES = "credit-notes",
601
+ CUSTOMERS = "customers",
602
+ DEAL_PRODUCTS = "deal-products",
603
+ DEALS = "deals",
604
+ DEAL_STAGES = "deal-stages",
605
+ DOCUMENTS = "documents",
606
+ DRIVES = "drives",
607
+ DRIVE_ITEMS = "drive-items",
608
+ EEOCS = "eeocs",
609
+ EMAILS = "emails",
610
+ EMPLOYEES = "employees",
611
+ FILES = "files",
612
+ FOLDERS = "folders",
613
+ INVOICES = "invoices",
614
+ JOB_APPLICATIONS = "job-applications",
615
+ JOB_CANDIDATES = "job-candidates",
616
+ JOB_INTERVIEWS = "job-interviews",
617
+ JOB_OFFERS = "job-offers",
618
+ JOBS = "jobs",
619
+ JOURNAL_ENTRIES = "journal-entries",
620
+ LEADS = "leads",
621
+ LEDGER_ACCOUNTS = "ledger-accounts",
622
+ MEETINGS = "meetings",
623
+ MESSAGES = "messages",
624
+ NOTES = "notes",
625
+ ORDERS = "orders",
626
+ PAYMENTS = "payments",
627
+ PAYROLLS = "payrolls",
628
+ PRODUCTS = "products",
629
+ PROJECTS = "projects",
630
+ SUPPLIERS = "suppliers",
631
+ TASKS = "tasks",
632
+ TAX_RATES = "tax-rates",
633
+ USERS = "users",
634
+ TIMEOFF_BALANCES = "timeoff-balances",
635
+ TIMEOFF_REQUESTS = "timeoff-requests"
636
+ }
637
+
638
+ interface ConnectorUdmSpec {
639
+ defaultCollection?: DataLocationPointer;
640
+ rootDirectory?: DataLocationPointer;
641
+ collectionMappings: ConnectorUdmCollectionMapping[];
642
+ }
643
+ interface ConnectorUdmCollectionMapping extends DataLocationPointer {
644
+ fieldsToCollection?: any;
645
+ fieldsFromCollection?: any;
646
+ }
647
+
648
+ interface ConnectorUiSpec {
649
+ schema?: DataSchema;
650
+ description?: string;
651
+ helpUri?: string;
652
+ test?: boolean;
653
+ }
654
+ type ConnectorDataUdmSpec = {
655
+ rootLocation: DataLocation;
656
+ };
657
+ type ConnectorDataSpec = {
658
+ rootLocation?: DataLocation;
659
+ locations?: DataLocationSpec[];
660
+ udm?: Partial<Record<UDM, ConnectorDataUdmSpec>>;
661
+ root?: DataLocation;
662
+ } & Partial<Record<UDM, DataLocation>>;
663
+ type ConnectorApiType = 'openapi' | 'graphql';
664
+ interface ConnectorSpec {
665
+ key?: string;
666
+ name?: string;
667
+ appUri?: string;
668
+ logoUri?: string;
669
+ apiDocsUri?: string;
670
+ api?: {
671
+ type: ConnectorApiType;
672
+ };
673
+ ui?: ConnectorUiSpec;
674
+ auth?: ConnectorAuth;
675
+ parametersSchema?: DataSchema;
676
+ data?: ConnectorDataSpec;
677
+ udms?: string[];
678
+ udm?: Record<string, ConnectorUdmSpec>;
679
+ operations?: ConnectorOperationHandler[];
680
+ test?: ConnectorMethodImplementation;
681
+ hasReadme?: boolean;
682
+ appUuid?: string;
683
+ knowledgeBaseUuid?: string;
684
+ workspaceId?: string;
685
+ }
686
+ type MinimalConnector = {
687
+ id: string;
688
+ key: string;
689
+ name: string;
690
+ logoUri: string;
691
+ };
692
+
693
+ declare const CONNECTOR_AUTH_TYPES: readonly ["integration-app-token", "oauth2", "oauth1", "client-credentials", "proxy"];
694
+ type ConnectorAuthType = (typeof CONNECTOR_AUTH_TYPES)[number];
695
+ type ConnectorAuthSpec = {
696
+ title?: string;
697
+ description?: string;
698
+ type: ConnectorAuthType;
699
+ ui?: {
700
+ schema?: DataSchema;
701
+ helpUri?: string;
702
+ };
703
+ };
704
+ interface ConnectorAuthHandlerBase extends ConnectorAuthSpec {
705
+ title?: string;
706
+ type: ConnectorAuthType;
707
+ credentialsSchema?: DataSchema;
708
+ customCredentialsSchema?: DataSchema;
709
+ makeApiClient?: ConnectorMethodImplementationBase;
710
+ refreshCredentials?: ConnectorMethodImplementationBase;
711
+ test?: ConnectorMethodImplementationBase;
712
+ enabled?: any;
713
+ }
714
+ interface ConnectorAuthOAuth2 extends ConnectorAuthHandlerBase {
715
+ type: 'oauth2';
716
+ getOAuthConfig?: ConnectorMethodImplementation;
717
+ getTokenData?: ConnectorMethodImplementation;
718
+ getCredentialsFromAccessTokenResponse?: ConnectorMethodImplementation;
719
+ getCredentialsFromRefreshTokenResponse?: ConnectorMethodImplementation;
720
+ oAuthConfig?: ConnectorMethodImplementation;
721
+ }
722
+ interface ConnectorAuthOAuth1 extends ConnectorAuthHandlerBase {
723
+ type: 'oauth1';
724
+ getOAuthConfig?: ConnectorMethodImplementation;
725
+ }
726
+ interface ConnectorAuthClientCredentials extends ConnectorAuthHandlerBase {
727
+ type: 'client-credentials';
728
+ getCredentialsFromConnectionParameters?: ConnectorMethodImplementationBase;
729
+ }
730
+ interface ConnectorAuthProxy extends ConnectorAuthHandlerBase {
731
+ type: 'proxy';
732
+ proxyKey: string;
733
+ }
734
+ interface ConnectorAuthIntegrationAppToken extends ConnectorAuthHandlerBase {
735
+ type: 'integration-app-token';
736
+ }
737
+ type ConnectorAuth = (ConnectorAuthOAuth2 | ConnectorAuthOAuth1 | ConnectorAuthClientCredentials | ConnectorAuthIntegrationAppToken | ConnectorAuthProxy) & {
738
+ options?: {
739
+ [key: string]: ConnectorAuthOAuth2 | ConnectorAuthOAuth1 | ConnectorAuthClientCredentials | ConnectorAuthIntegrationAppToken | ConnectorAuthProxy;
740
+ };
741
+ };
742
+
743
+ interface OpenConfigurationOptions {
744
+ onClose?: () => void;
745
+ showPoweredBy?: boolean;
746
+ }
747
+
748
+ interface Integration extends WorkspaceElement {
749
+ state?: WorkspaceElementState;
750
+ errors?: ErrorData[];
751
+ logoUri: string;
752
+ connectorId?: string;
753
+ connectorVersion?: string;
754
+ authOptions?: IntegrationAuthOption[];
755
+ oAuthCallbackUri?: string;
756
+ parametersSchema?: DataSchema;
757
+ parameters?: any;
758
+ baseUri: string;
759
+ connection?: Connection;
760
+ archivedAt?: string;
761
+ spec?: ConnectorSpec;
762
+ hasMissingParameters?: boolean;
763
+ hasDocumentation?: boolean;
764
+ hasOperations?: boolean;
765
+ hasData?: boolean;
766
+ hasEvents?: boolean;
767
+ hasGlobalWebhooks?: boolean;
768
+ hasUdm?: boolean;
769
+ isTest?: boolean;
770
+ appUuid?: string;
771
+ isDeactivated?: boolean;
772
+ authType?: ConnectorAuthType;
773
+ }
774
+ type IntegrationAuthOption = ConnectorAuthSpec & {
775
+ key: string;
776
+ };
777
+ type AppliedToIntegrations<Element> = {
778
+ element: Element;
779
+ integration: Integration;
780
+ }[];
781
+
782
+ interface CreateIntegrationRequest {
783
+ name?: string;
784
+ key: string;
785
+ baseUri: string;
786
+ logoUri: string;
787
+ }
788
+ interface UpdateIntegrationRequest {
789
+ name?: string;
790
+ key?: string;
791
+ baseUri?: string;
792
+ logoUri?: string;
793
+ }
794
+ interface FindIntegrationsQuery extends PaginationQuery, SearchQuery {
795
+ }
796
+ interface OpenNewConnectionOptions extends OpenConfigurationOptions {
797
+ allowMultipleConnections?: boolean;
798
+ name?: string;
799
+ }
800
+
801
+ type CreateCustomerRequest = {
802
+ name?: string;
803
+ internalId: string;
804
+ fields?: any;
805
+ credentials?: any;
806
+ };
807
+ type UpdateCustomerRequest = {
808
+ name?: string;
809
+ internalId?: string;
810
+ fields?: any;
811
+ credentials?: any;
812
+ };
813
+ type FindCustomersQuery = PaginationQuery & SearchQuery & {
814
+ isTest?: boolean;
815
+ };
816
+ type CustomerSelector = {
817
+ id: string;
818
+ };
819
+
820
+ declare class CustomersAccessor extends ElementListAccessor<Customer, FindCustomersQuery, CreateCustomerRequest> {
821
+ constructor(client: IntegrationAppApiClient);
822
+ }
823
+ declare class CustomerAccessor extends ElementAccessor<Customer, UpdateCustomerRequest, CustomerSelector> {
824
+ constructor(client: IntegrationAppApiClient, selector: CustomerSelector | string);
825
+ }
826
+
827
+ type Customer = {
828
+ id: string;
829
+ name: string;
830
+ internalId: string;
831
+ fields?: Record<string, any>;
832
+ credentials?: any;
833
+ lastActiveAt?: string;
834
+ isTest?: boolean;
835
+ isBillable?: boolean;
836
+ };
837
+ type User = Customer;
838
+
839
+ interface ListFlowsForIntegrationQuery extends CommonListElementsQuery {
840
+ universalFlowId?: string | 'null';
841
+ }
842
+ interface FindFlowsQuery extends ListFlowsForIntegrationQuery {
843
+ integrationId?: string | 'null';
844
+ }
845
+ interface CreateFlowNodeRequest {
846
+ type: string;
847
+ config?: any;
848
+ ui?: any;
849
+ links?: FlowNodeLink[];
850
+ }
851
+ interface CreateFlowRequest {
852
+ key: string;
853
+ name: string;
854
+ integrationId?: string;
855
+ nodes?: Record<string, CreateFlowNodeRequest>;
856
+ parametersSchema?: DataSchema;
857
+ autoCreateInstances?: boolean;
858
+ }
859
+ interface UpdateFlowRequest extends CreateFlowRequest {
860
+ archivedAt?: string;
861
+ }
862
+ interface FlowSelector extends IntegrationSpecificElementSelector {
863
+ autoCreate?: boolean;
864
+ }
865
+ type ListFlowInstancesForConnectionQuery = CommonInstancesListQuery & {
866
+ flowId?: string;
867
+ flowKey?: string;
868
+ enabled?: boolean;
869
+ };
870
+ type FindFlowInstancesQuery = ListFlowInstancesForConnectionQuery & CommonIntegrationOrConnectionQuery;
871
+ interface FlowInstanceSelector extends ConnectionSelector, ElementInstanceSelector {
872
+ flowId?: string;
873
+ flowKey?: string;
874
+ instanceKey?: string;
875
+ autoUpdate?: boolean;
876
+ }
877
+ interface ResetFlowInstanceOptions {
878
+ name?: boolean;
879
+ nodes?: Record<string, boolean>;
880
+ allNodes?: boolean;
881
+ }
882
+ interface RunFlowOptions {
883
+ nodeKey?: string;
884
+ input?: any;
885
+ returnImmediately?: boolean;
886
+ onUpdate?: (...args: any) => void;
887
+ }
888
+
889
+ interface ListFieldMappingsForIntegrationQuery extends CommonListElementsQuery {
890
+ universalFieldMappingId?: string | 'null';
891
+ }
892
+ interface FindFieldMappingsQuery extends ListFieldMappingsForIntegrationQuery {
893
+ integrationId?: string | 'null';
894
+ }
895
+ type ListFieldMappingInstancesForConnectionQuery = CommonInstancesListQuery & {
896
+ fieldMappingId?: string;
897
+ universalFieldMappingId?: string;
898
+ dataSourceInstanceId?: string;
899
+ };
900
+ type FindFieldMappingInstancesQuery = ListFieldMappingInstancesForConnectionQuery & CommonIntegrationOrConnectionQuery;
901
+ interface UpdateFieldMappingRequest {
902
+ key?: string;
903
+ name?: string;
904
+ dataSourceKey?: string;
905
+ dataSourceId?: string;
906
+ appSchema?: DataSchema;
907
+ direction?: FieldMappingDirection;
908
+ defaultImportValue?: any;
909
+ exportValue?: any;
910
+ importValue?: any;
911
+ defaultExportValue?: any;
912
+ frozenImportFields?: any;
913
+ frozenExportFields?: any;
914
+ frozenUnifiedExportFields?: any;
915
+ archivedAt?: string;
916
+ }
917
+ interface CreateFieldMappingRequest extends UpdateFieldMappingRequest {
918
+ key: string;
919
+ name: string;
920
+ integrationId?: string;
921
+ }
922
+ interface CreateFieldMappingInstanceRequest {
923
+ connectionId: string;
924
+ fieldMappingId?: string;
925
+ instanceKey?: string;
926
+ importValue?: any;
927
+ exportValue?: any;
928
+ }
929
+ interface UpdateFieldMappingInstanceRequest {
930
+ importValue?: any;
931
+ exportValue?: any;
932
+ }
933
+ interface FieldMappingInstanceSelector extends ConnectionSelector, FlowInstanceSelector, ElementInstanceSelector {
934
+ fieldMappingKey?: string;
935
+ fieldMappingId?: string;
936
+ instanceKey?: string;
937
+ nodeKey?: string;
938
+ }
939
+ interface FieldMappingSelector extends IntegrationSpecificElementSelector {
940
+ }
941
+
942
+ type InstanceKeyQuery = {
943
+ instanceKey?: string;
944
+ };
945
+
946
+ declare class ConnectionLevelElementAccessor<Element, UpdateElement> {
947
+ protected client: IntegrationAppApiClient;
948
+ protected connectionSelector: string;
949
+ protected selector: string;
950
+ protected elementKey: string;
951
+ protected query: Record<string, any>;
952
+ protected endpoint: string;
953
+ constructor(client: IntegrationAppApiClient, connectionSelector: string, selector: string, elementKey: string, query: Record<string, any>);
954
+ protected uri(path?: string, query?: {}): string;
955
+ getUniqueIdentifier(): string;
956
+ get(query?: {
957
+ autoCreate?: boolean;
958
+ }): Promise<Element>;
959
+ create(): Promise<Element>;
960
+ patch(data: Partial<UpdateElement>): Promise<Element>;
961
+ put(data: UpdateElement): Promise<Element>;
962
+ archive(): Promise<void>;
963
+ reset(): Promise<Element>;
964
+ setup(): Promise<Element>;
965
+ }
966
+ declare class ConnectionLevelElementsListAccessor<Element, Query> {
967
+ protected client: IntegrationAppApiClient;
968
+ protected connectionSelector: string;
969
+ protected elementKey: string;
970
+ constructor(client: IntegrationAppApiClient, connectionSelector: string, elementKey: string);
971
+ list(query?: Query): Promise<PaginationResponse<Element[]>>;
972
+ }
973
+
974
+ declare class IntegrationLevelElementAccessor<Element, UpdateElementData> {
975
+ protected client: IntegrationAppApiClient;
976
+ protected integrationSelector: string;
977
+ protected elementSelector: string;
978
+ protected elementKey: string;
979
+ protected endpoint: string;
980
+ constructor(client: IntegrationAppApiClient, integrationSelector: string, elementSelector: string, elementKey: string);
981
+ getUniqueIdentifier(): string;
982
+ get(): Promise<Element>;
983
+ patch(data: Partial<UpdateElementData>): Promise<Element>;
984
+ put(data: UpdateElementData): Promise<Element>;
985
+ archive(): Promise<void>;
986
+ reset(): Promise<Element>;
987
+ }
988
+ declare class IntegrationLevelElementsListAccessor<Element, Query, CreateElementData> {
989
+ protected client: IntegrationAppApiClient;
990
+ protected integrationSelector: string;
991
+ protected elementKey: string;
992
+ protected endpoint: string;
993
+ constructor(client: IntegrationAppApiClient, integrationSelector: string, elementKey: string);
994
+ list(query?: Query): Promise<PaginationResponse<Element>>;
995
+ create(data: CreateElementData): Promise<Element>;
996
+ }
997
+
998
+ interface OpenFieldMappingInstanceConfigurationOptions extends OpenConfigurationOptions {
999
+ }
1000
+ declare class FieldMappingsAccessor extends ElementListAccessor<FieldMapping, FindFieldMappingsQuery, CreateFieldMappingRequest> {
1001
+ constructor(client: IntegrationAppApiClient);
1002
+ }
1003
+ declare class FieldMappingAccessor extends ElementAccessor<FieldMapping, UpdateFieldMappingRequest, FieldMappingSelector> {
1004
+ constructor(client: IntegrationAppApiClient, selector: string | FieldMappingSelector);
1005
+ getAppSchema(): Promise<any>;
1006
+ apply(integrationKeys: string[]): Promise<FieldMapping[]>;
1007
+ setup(): Promise<any>;
1008
+ reset(): Promise<any>;
1009
+ }
1010
+ declare class FieldMappingInstancesAccessor extends ElementInstanceListAccessor<FieldMappingInstance, FindFieldMappingInstancesQuery> {
1011
+ constructor(client: IntegrationAppApiClient);
1012
+ }
1013
+ declare class FieldMappingInstanceAccessor extends ElementInstanceAccessor<FieldMappingInstance, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, UpdateFieldMappingInstanceRequest> {
1014
+ private client;
1015
+ constructor(client: IntegrationAppApiClient, selector: string | FieldMappingInstanceSelector);
1016
+ setup(): Promise<void>;
1017
+ reset(): Promise<void>;
1018
+ openConfiguration({ onClose }?: OpenFieldMappingInstanceConfigurationOptions): Promise<void>;
1019
+ }
1020
+ declare class IntegrationLevelFieldMappingAccessor extends IntegrationLevelElementAccessor<FieldMapping, UpdateFieldMappingRequest> {
1021
+ client: IntegrationAppApiClient;
1022
+ integrationSelector: string;
1023
+ fieldMappingSelector: string;
1024
+ constructor(client: IntegrationAppApiClient, integrationSelector: string, fieldMappingSelector: string);
1025
+ }
1026
+ declare class IntegrationLevelFieldMappingsListAccessor extends IntegrationLevelElementsListAccessor<FieldMapping, ListFieldMappingsForIntegrationQuery, Omit<CreateFieldMappingRequest, 'integrationId'>> {
1027
+ client: IntegrationAppApiClient;
1028
+ integrationSelector: string;
1029
+ constructor(client: IntegrationAppApiClient, integrationSelector: string);
1030
+ }
1031
+ declare class ConnectionLevelFieldMappingAccessor extends ConnectionLevelElementAccessor<FieldMappingInstance, UpdateFieldMappingInstanceRequest> {
1032
+ client: IntegrationAppApiClient;
1033
+ connectionSelector: string;
1034
+ fieldMappingSelector: string;
1035
+ query: InstanceKeyQuery;
1036
+ constructor(client: IntegrationAppApiClient, connectionSelector: string, fieldMappingSelector: string, query: InstanceKeyQuery);
1037
+ openConfiguration({ onClose }?: OpenFieldMappingInstanceConfigurationOptions): Promise<void>;
1038
+ }
1039
+ declare class ConnectionLevelFieldMappingsAccessor extends ConnectionLevelElementsListAccessor<FieldMapping, ListFieldMappingInstancesForConnectionQuery> {
1040
+ client: IntegrationAppApiClient;
1041
+ connectionSelector: string;
1042
+ constructor(client: IntegrationAppApiClient, connectionSelector: string);
1043
+ }
1044
+
1045
+ declare enum FieldMappingDirection {
1046
+ IMPORT = "import",
1047
+ EXPORT = "export",
1048
+ BOTH = "both"
1049
+ }
1050
+ interface FieldMapping extends WorkspaceElement {
1051
+ revision: string;
1052
+ publishedRevision?: string;
1053
+ universalFieldMappingId?: string;
1054
+ universalFieldMappingRevision?: string;
1055
+ integrationId?: string;
1056
+ integration?: Integration;
1057
+ dataSourceId: string;
1058
+ dataSourceKey: string;
1059
+ appSchema: DataSchema;
1060
+ direction: FieldMappingDirection;
1061
+ defaultImportValue?: any;
1062
+ defaultExportValue?: any;
1063
+ importValue?: any;
1064
+ exportValue?: any;
1065
+ frozenImportFields?: any;
1066
+ frozenExportFields?: any;
1067
+ frozenUnifiedExportFields?: any;
1068
+ archivedAt?: string;
1069
+ customized?: boolean;
1070
+ appliedToIntegrations?: AppliedToIntegrations<FieldMapping>;
1071
+ }
1072
+ interface FieldMappingInstance extends WorkspaceElement {
1073
+ userId: string;
1074
+ revision: string;
1075
+ user?: User;
1076
+ connectionId: string;
1077
+ connection?: Connection;
1078
+ integrationId: string;
1079
+ integration?: Integration;
1080
+ fieldMappingRevision?: string;
1081
+ fieldMappingId?: string;
1082
+ fieldMapping?: FieldMapping;
1083
+ instanceKey?: string;
1084
+ dataSourceInstanceId?: string;
1085
+ dataSourceInstance?: DataSourceInstance;
1086
+ dataSourceSchema?: DataSchema;
1087
+ direction?: FieldMappingDirection;
1088
+ appSchema?: DataSchema;
1089
+ importValue?: any;
1090
+ exportValue?: any;
1091
+ isCustomized?: boolean;
1092
+ unifiedExportValue?: any;
1093
+ unifiedImportValue?: any;
1094
+ frozenImportFields?: string[];
1095
+ frozenExportFields?: string[];
1096
+ state?: WorkspaceElementState;
1097
+ error?: ErrorData;
1098
+ externalSchema?: any;
1099
+ }
1100
+
1101
+ interface OpenIntegrationUIIntegrationConfigurationOptions extends OpenConfigurationOptions {
1102
+ }
1103
+ declare class IntegrationsAccessor extends ElementListAccessor<Integration, FindIntegrationsQuery, CreateIntegrationRequest> {
1104
+ constructor(client: IntegrationAppApiClient);
1105
+ }
1106
+ declare class IntegrationAccessor extends ElementAccessor<Integration, UpdateIntegrationRequest> {
1107
+ private client;
1108
+ private integrationSelector;
1109
+ baseUri: string;
1110
+ constructor(client: IntegrationAppApiClient, integrationSelector: string);
1111
+ get actions(): IntegrationLevelActionsListAccessor;
1112
+ action(actionSelector: string): IntegrationLevelActionAccessor;
1113
+ get flows(): IntegrationLevelFlowsListAccessor;
1114
+ flow(flowSelector: string): IntegrationLevelFlowAccessor;
1115
+ get dataSources(): IntegrationLevelDataSourcesListAccessor;
1116
+ dataSource(dataSourceSelector: string): IntegrationLevelDataSourceAccessor;
1117
+ get fieldMappings(): IntegrationLevelFieldMappingsListAccessor;
1118
+ fieldMapping(fieldMappingSelector: string): IntegrationLevelFieldMappingAccessor;
1119
+ setup(): Promise<Integration>;
1120
+ getConnectorSpec(): Promise<ConnectionSpec>;
1121
+ open({ onClose }?: OpenIntegrationUIIntegrationConfigurationOptions): Promise<void>;
1122
+ openNewConnection({ allowMultipleConnections, name }?: OpenNewConnectionOptions): Promise<Connection>;
1123
+ connect({ name, parameters, authOptionKey, allowMultipleConnections, redirectUri, sameWindow, }?: {
1124
+ name?: string;
1125
+ parameters?: any;
1126
+ authOptionKey?: string;
1127
+ allowMultipleConnections?: boolean;
1128
+ } & ({
1129
+ sameWindow: true;
1130
+ redirectUri: string;
1131
+ } | {
1132
+ sameWindow?: false;
1133
+ redirectUri?: never;
1134
+ })): Promise<Connection | undefined>;
1135
+ createConnection({ parameters, name }: {
1136
+ parameters?: any;
1137
+ name?: string;
1138
+ }): Promise<Connection | undefined>;
1139
+ disconnect(): Promise<void>;
1140
+ getOperations(): Promise<OperationListItem[]>;
1141
+ getOperation(key: string): Promise<OperationSpec>;
1142
+ getDataCollections(): Promise<DataLocationListItem[]>;
1143
+ getDataCollection(key: string): Promise<DataLocationSpec>;
1144
+ getDataLocations(): Promise<DataLocationListItem[]>;
1145
+ getDataLocation(key: string): Promise<DataLocationSpec>;
1146
+ }
1147
+
1148
+ interface OpenFlowRunEditorOptions extends OpenConfigurationOptions {
1149
+ }
1150
+ declare class FlowRunsAccessor {
1151
+ private readonly client;
1152
+ constructor(client: IntegrationAppApiClient);
1153
+ find(query: FindFlowRunsQuery): Promise<FindFlowRunsResponse>;
1154
+ create(request: CreateFlowRunRequest): Promise<FlowRun>;
1155
+ }
1156
+ declare class FlowRunAccessor {
1157
+ private readonly client;
1158
+ id: string;
1159
+ private baseUri;
1160
+ constructor(client: IntegrationAppApiClient, id: string);
1161
+ get(): Promise<FlowRun>;
1162
+ stop(): Promise<void>;
1163
+ getOutput(): Promise<any>;
1164
+ getNodeRuns(nodeKey: string, parameters?: {
1165
+ cursor?: string;
1166
+ }): Promise<any>;
1167
+ getNodeRun(nodeKey: string, runId: string): Promise<any>;
1168
+ getNodeOutputs(nodeKey: string, parameters?: {
1169
+ cursor?: string;
1170
+ }): Promise<any>;
1171
+ getNodeOutput(nodeKey: string, outputId: string): Promise<any>;
1172
+ repeat(): Promise<FlowRun>;
1173
+ openEditor({ onClose }?: OpenFlowRunEditorOptions): Promise<void>;
1174
+ embedEditor({ mountTargetSelector, onClose, }?: {
1175
+ mountTargetSelector?: string;
1176
+ } & OpenFlowRunEditorOptions): Promise<void>;
1177
+ }
1178
+
1179
+ declare enum FlowRunState {
1180
+ QUEUED = "queued",
1181
+ RUNNING = "running",
1182
+ COMPLETED = "completed",
1183
+ STOPPED = "stopped",
1184
+ FAILED = "failed"
1185
+ }
1186
+ declare enum FlowRunNodeState {
1187
+ RUNNING = "running",
1188
+ COMPLETED = "completed",
1189
+ STOPPED = "stopped",
1190
+ FAILED = "failed"
1191
+ }
1192
+ declare enum FlowRunLaunchedByTrigger {
1193
+ ApiTrigger = "api-trigger",
1194
+ ScheduleTrigger = "schedule-trigger",
1195
+ AppEventTrigger = "app-event-trigger",
1196
+ DataSourceTrigger = "data-source-trigger",
1197
+ ExternalEvent = "external-event"
1198
+ }
1199
+ interface FlowRun {
1200
+ id: string;
1201
+ name?: string;
1202
+ flowInstanceId: string;
1203
+ flowInstance?: FlowInstance;
1204
+ universalFlowId?: string;
1205
+ connectionId?: string;
1206
+ connection?: Connection;
1207
+ integrationId?: string;
1208
+ integration?: Integration;
1209
+ startNodeKey: string;
1210
+ userId: string;
1211
+ user?: Customer;
1212
+ input?: any;
1213
+ state: FlowRunState;
1214
+ startTime: string;
1215
+ endTime?: string;
1216
+ errors?: ErrorData[];
1217
+ nodes?: Record<string, FlowRunNode>;
1218
+ launchedBy?: FlowRunLaunchedBy;
1219
+ }
1220
+ interface FlowRunNode {
1221
+ state: FlowRunNodeState;
1222
+ runs?: number;
1223
+ erroredRuns?: number;
1224
+ outputs?: number;
1225
+ }
1226
+ interface FlowRunLaunchedBy {
1227
+ type: FlowRunLaunchedByTrigger;
1228
+ ids?: string[];
1229
+ }
1230
+ interface CreateFlowRunRequest {
1231
+ flowInstanceId: string;
1232
+ nodeKey?: string;
1233
+ input?: any;
1234
+ }
1235
+ interface FindFlowRunsQuery extends PaginationQuery {
1236
+ id?: string;
1237
+ flowInstanceId?: string;
1238
+ startNodeKey?: string;
1239
+ flowId?: string;
1240
+ universalFlowId?: string;
1241
+ userId?: string;
1242
+ state?: FlowRunState;
1243
+ integrationId?: string;
1244
+ connectionId?: string;
1245
+ startedAfter?: string;
1246
+ }
1247
+ interface FindFlowRunsResponse extends PaginationResponse<FlowRun> {
1248
+ }
1249
+
1250
+ declare const createFlowInstanceSchema: z.ZodObject<{
1251
+ name: z.ZodOptional<z.ZodString>;
1252
+ userId: z.ZodOptional<z.ZodString>;
1253
+ flowId: z.ZodOptional<z.ZodString>;
1254
+ connectionId: z.ZodOptional<z.ZodString>;
1255
+ integrationId: z.ZodOptional<z.ZodString>;
1256
+ instanceKey: z.ZodOptional<z.ZodString>;
1257
+ parameters: z.ZodOptional<z.ZodAny>;
1258
+ nodes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1259
+ name: z.ZodOptional<z.ZodString>;
1260
+ type: z.ZodOptional<z.ZodString>;
1261
+ userConfig: z.ZodOptional<z.ZodAny>;
1262
+ config: z.ZodOptional<z.ZodAny>;
1263
+ onError: z.ZodOptional<z.ZodEnum<["stop", "continue"]>>;
1264
+ concurrency: z.ZodOptional<z.ZodNumber>;
1265
+ ui: z.ZodOptional<z.ZodAny>;
1266
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1267
+ key: z.ZodOptional<z.ZodString>;
1268
+ filter: z.ZodOptional<z.ZodAny>;
1269
+ name: z.ZodOptional<z.ZodString>;
1270
+ }, "strip", z.ZodTypeAny, {
1271
+ key?: string | undefined;
1272
+ name?: string | undefined;
1273
+ filter?: any;
1274
+ }, {
1275
+ key?: string | undefined;
1276
+ name?: string | undefined;
1277
+ filter?: any;
1278
+ }>, "many">>;
1279
+ isCustomized: z.ZodOptional<z.ZodBoolean>;
1280
+ }, "strip", z.ZodTypeAny, {
1281
+ concurrency?: number | undefined;
1282
+ type?: string | undefined;
1283
+ name?: string | undefined;
1284
+ userConfig?: any;
1285
+ config?: any;
1286
+ onError?: "stop" | "continue" | undefined;
1287
+ ui?: any;
1288
+ links?: {
1289
+ key?: string | undefined;
1290
+ name?: string | undefined;
1291
+ filter?: any;
1292
+ }[] | undefined;
1293
+ isCustomized?: boolean | undefined;
1294
+ }, {
1295
+ concurrency?: number | undefined;
1296
+ type?: string | undefined;
1297
+ name?: string | undefined;
1298
+ userConfig?: any;
1299
+ config?: any;
1300
+ onError?: "stop" | "continue" | undefined;
1301
+ ui?: any;
1302
+ links?: {
1303
+ key?: string | undefined;
1304
+ name?: string | undefined;
1305
+ filter?: any;
1306
+ }[] | undefined;
1307
+ isCustomized?: boolean | undefined;
1308
+ }>>>;
1309
+ enabled: z.ZodOptional<z.ZodBoolean>;
1310
+ customized: z.ZodOptional<z.ZodObject<{
1311
+ name: z.ZodOptional<z.ZodBoolean>;
1312
+ nodes: z.ZodOptional<z.ZodBoolean>;
1313
+ }, "strip", z.ZodTypeAny, {
1314
+ name?: boolean | undefined;
1315
+ nodes?: boolean | undefined;
1316
+ }, {
1317
+ name?: boolean | undefined;
1318
+ nodes?: boolean | undefined;
1319
+ }>>;
1320
+ }, "strip", z.ZodTypeAny, {
1321
+ name?: string | undefined;
1322
+ userId?: string | undefined;
1323
+ integrationId?: string | undefined;
1324
+ connectionId?: string | undefined;
1325
+ parameters?: any;
1326
+ flowId?: string | undefined;
1327
+ instanceKey?: string | undefined;
1328
+ nodes?: Record<string, {
1329
+ concurrency?: number | undefined;
1330
+ type?: string | undefined;
1331
+ name?: string | undefined;
1332
+ userConfig?: any;
1333
+ config?: any;
1334
+ onError?: "stop" | "continue" | undefined;
1335
+ ui?: any;
1336
+ links?: {
1337
+ key?: string | undefined;
1338
+ name?: string | undefined;
1339
+ filter?: any;
1340
+ }[] | undefined;
1341
+ isCustomized?: boolean | undefined;
1342
+ }> | undefined;
1343
+ enabled?: boolean | undefined;
1344
+ customized?: {
1345
+ name?: boolean | undefined;
1346
+ nodes?: boolean | undefined;
1347
+ } | undefined;
1348
+ }, {
1349
+ name?: string | undefined;
1350
+ userId?: string | undefined;
1351
+ integrationId?: string | undefined;
1352
+ connectionId?: string | undefined;
1353
+ parameters?: any;
1354
+ flowId?: string | undefined;
1355
+ instanceKey?: string | undefined;
1356
+ nodes?: Record<string, {
1357
+ concurrency?: number | undefined;
1358
+ type?: string | undefined;
1359
+ name?: string | undefined;
1360
+ userConfig?: any;
1361
+ config?: any;
1362
+ onError?: "stop" | "continue" | undefined;
1363
+ ui?: any;
1364
+ links?: {
1365
+ key?: string | undefined;
1366
+ name?: string | undefined;
1367
+ filter?: any;
1368
+ }[] | undefined;
1369
+ isCustomized?: boolean | undefined;
1370
+ }> | undefined;
1371
+ enabled?: boolean | undefined;
1372
+ customized?: {
1373
+ name?: boolean | undefined;
1374
+ nodes?: boolean | undefined;
1375
+ } | undefined;
1376
+ }>;
1377
+ declare const updateFlowInstanceSchema: z.ZodObject<{
1378
+ name: z.ZodOptional<z.ZodString>;
1379
+ enabled: z.ZodOptional<z.ZodBoolean>;
1380
+ parameters: z.ZodOptional<z.ZodAny>;
1381
+ nodes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1382
+ name: z.ZodOptional<z.ZodString>;
1383
+ type: z.ZodOptional<z.ZodString>;
1384
+ userConfig: z.ZodOptional<z.ZodAny>;
1385
+ config: z.ZodOptional<z.ZodAny>;
1386
+ onError: z.ZodOptional<z.ZodEnum<["stop", "continue"]>>;
1387
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1388
+ key: z.ZodOptional<z.ZodString>;
1389
+ filter: z.ZodOptional<z.ZodAny>;
1390
+ name: z.ZodOptional<z.ZodString>;
1391
+ }, "strip", z.ZodTypeAny, {
1392
+ key?: string | undefined;
1393
+ name?: string | undefined;
1394
+ filter?: any;
1395
+ }, {
1396
+ key?: string | undefined;
1397
+ name?: string | undefined;
1398
+ filter?: any;
1399
+ }>, "many">>;
1400
+ concurrency: z.ZodOptional<z.ZodNumber>;
1401
+ isCustomized: z.ZodOptional<z.ZodBoolean>;
1402
+ }, "strip", z.ZodTypeAny, {
1403
+ concurrency?: number | undefined;
1404
+ type?: string | undefined;
1405
+ name?: string | undefined;
1406
+ userConfig?: any;
1407
+ config?: any;
1408
+ onError?: "stop" | "continue" | undefined;
1409
+ links?: {
1410
+ key?: string | undefined;
1411
+ name?: string | undefined;
1412
+ filter?: any;
1413
+ }[] | undefined;
1414
+ isCustomized?: boolean | undefined;
1415
+ }, {
1416
+ concurrency?: number | undefined;
1417
+ type?: string | undefined;
1418
+ name?: string | undefined;
1419
+ userConfig?: any;
1420
+ config?: any;
1421
+ onError?: "stop" | "continue" | undefined;
1422
+ links?: {
1423
+ key?: string | undefined;
1424
+ name?: string | undefined;
1425
+ filter?: any;
1426
+ }[] | undefined;
1427
+ isCustomized?: boolean | undefined;
1428
+ }>>>;
1429
+ archivedAt: z.ZodOptional<z.ZodString>;
1430
+ customized: z.ZodOptional<z.ZodObject<{
1431
+ name: z.ZodOptional<z.ZodBoolean>;
1432
+ nodes: z.ZodOptional<z.ZodBoolean>;
1433
+ }, "strip", z.ZodTypeAny, {
1434
+ name?: boolean | undefined;
1435
+ nodes?: boolean | undefined;
1436
+ }, {
1437
+ name?: boolean | undefined;
1438
+ nodes?: boolean | undefined;
1439
+ }>>;
1440
+ }, "strip", z.ZodTypeAny, {
1441
+ name?: string | undefined;
1442
+ parameters?: any;
1443
+ nodes?: Record<string, {
1444
+ concurrency?: number | undefined;
1445
+ type?: string | undefined;
1446
+ name?: string | undefined;
1447
+ userConfig?: any;
1448
+ config?: any;
1449
+ onError?: "stop" | "continue" | undefined;
1450
+ links?: {
1451
+ key?: string | undefined;
1452
+ name?: string | undefined;
1453
+ filter?: any;
1454
+ }[] | undefined;
1455
+ isCustomized?: boolean | undefined;
1456
+ }> | undefined;
1457
+ enabled?: boolean | undefined;
1458
+ customized?: {
1459
+ name?: boolean | undefined;
1460
+ nodes?: boolean | undefined;
1461
+ } | undefined;
1462
+ archivedAt?: string | undefined;
1463
+ }, {
1464
+ name?: string | undefined;
1465
+ parameters?: any;
1466
+ nodes?: Record<string, {
1467
+ concurrency?: number | undefined;
1468
+ type?: string | undefined;
1469
+ name?: string | undefined;
1470
+ userConfig?: any;
1471
+ config?: any;
1472
+ onError?: "stop" | "continue" | undefined;
1473
+ links?: {
1474
+ key?: string | undefined;
1475
+ name?: string | undefined;
1476
+ filter?: any;
1477
+ }[] | undefined;
1478
+ isCustomized?: boolean | undefined;
1479
+ }> | undefined;
1480
+ enabled?: boolean | undefined;
1481
+ customized?: {
1482
+ name?: boolean | undefined;
1483
+ nodes?: boolean | undefined;
1484
+ } | undefined;
1485
+ archivedAt?: string | undefined;
1486
+ }>;
1487
+ type CreateFlowInstanceRequest = z.infer<typeof createFlowInstanceSchema>;
1488
+ type UpdateFlowInstanceRequest = z.infer<typeof updateFlowInstanceSchema>;
1489
+
1490
+ declare enum IntegrationElementType {
1491
+ APP_DATA_SCHEMA = "app-data-schema",
1492
+ APP_EVENT_TYPE = "app-event-type",
1493
+ DATA_SOURCE = "data-source",
1494
+ SCHEMA = "schema",
1495
+ FIELD_MAPPING = "field-mapping",
1496
+ FLOW = "flow",
1497
+ INTEGRATION = "integration",
1498
+ ACTION = "action",
1499
+ DATA_LINK_TABLE = "data-link-table",
1500
+ EXTERNAL_EVENT = "external-event"
1501
+ }
1502
+ interface ElementTemplateFields {
1503
+ id: string;
1504
+ key: string;
1505
+ name: string;
1506
+ revision: string;
1507
+ integrationId?: string;
1508
+ integration?: Integration;
1509
+ parentId?: string;
1510
+ parentRevision?: string;
1511
+ isCustomized?: boolean;
1512
+ createdAt?: string;
1513
+ updatedAt?: string;
1514
+ archivedAt?: string;
1515
+ }
1516
+ interface ElementInstanceFields {
1517
+ id: string;
1518
+ name: string;
1519
+ revision: string;
1520
+ parentId?: string;
1521
+ parentRevision?: string;
1522
+ universalParentId?: string;
1523
+ userId: string;
1524
+ user?: Customer;
1525
+ instanceKey?: string;
1526
+ isCustomized?: boolean;
1527
+ connectionId: string;
1528
+ connection?: Connection;
1529
+ integrationId?: string;
1530
+ integration?: Integration;
1531
+ dependencies?: IntegrationElementInstance[];
1532
+ errors?: ErrorData[];
1533
+ createdAt?: string;
1534
+ updatedAt?: string;
1535
+ archivedAt?: string;
1536
+ }
1537
+ interface IntegrationElementInstance {
1538
+ type: IntegrationElementType;
1539
+ instanceId?: string;
1540
+ data?: any;
1541
+ }
1542
+
1543
+ interface FlowNode {
1544
+ type?: string;
1545
+ version?: number;
1546
+ name?: string;
1547
+ description?: string;
1548
+ config?: any;
1549
+ concurrency?: number;
1550
+ onError?: 'stop' | 'continue';
1551
+ ui?: any;
1552
+ inputSchema?: any;
1553
+ outputSchema?: any;
1554
+ outputExample?: any;
1555
+ links?: FlowNodeLink[];
1556
+ isCustomized?: boolean;
1557
+ }
1558
+ interface Flow extends WorkspaceElement {
1559
+ integrationId?: string;
1560
+ integration?: Integration;
1561
+ universalFlowId?: string;
1562
+ universalFlowRevision?: string;
1563
+ parametersSchema?: DataSchema;
1564
+ nodes?: Record<string, FlowNode>;
1565
+ autoCreateInstances?: boolean;
1566
+ archivedAt?: string;
1567
+ revision: string;
1568
+ customized?: boolean;
1569
+ appliedToIntegrations?: AppliedToIntegrations<Flow>;
1570
+ isDeployed?: boolean;
1571
+ }
1572
+ interface FlowInstance extends WorkspaceElement {
1573
+ userId: string;
1574
+ user?: User;
1575
+ connectionId?: string;
1576
+ connection?: Connection;
1577
+ flow?: Flow;
1578
+ flowId?: string;
1579
+ universalFlowId?: string;
1580
+ integrationId: string;
1581
+ integration?: Integration;
1582
+ instanceKey?: string;
1583
+ parameters?: any;
1584
+ parametersSchema?: DataSchema;
1585
+ nodes?: Record<string, FlowInstanceNode>;
1586
+ enabled: boolean;
1587
+ createdAt: string;
1588
+ updatedAt: string;
1589
+ state?: WorkspaceElementState;
1590
+ outdated?: boolean;
1591
+ customized?: {
1592
+ name?: boolean;
1593
+ nodes?: boolean;
1594
+ };
1595
+ dependencies?: IntegrationElementInstance[];
1596
+ }
1597
+ declare enum FlowInstanceNodeState {
1598
+ SETUP_FAILED = "SETUP_FAILED",
1599
+ READY = "READY"
1600
+ }
1601
+ interface FlowInstanceNode extends FlowNode {
1602
+ state?: FlowInstanceNodeState;
1603
+ errors?: ErrorData[];
1604
+ userConfig?: any;
1605
+ testInput?: any;
1606
+ dependencies?: IntegrationElementInstance[];
1607
+ }
1608
+ interface FlowNodeLink {
1609
+ key?: string;
1610
+ filter?: any;
1611
+ name?: string;
1612
+ }
1613
+
1614
+ interface OpenFlowInstanceConfigurationOptions extends OpenConfigurationOptions {
1615
+ nodeKey?: string;
1616
+ }
1617
+ interface OpenFlowInstanceEditorOptions extends OpenConfigurationOptions {
1618
+ }
1619
+ declare class FlowsAccessor extends ElementListAccessor<Flow, FindFlowsQuery, CreateFlowRequest> {
1620
+ constructor(client: IntegrationAppApiClient);
1621
+ }
1622
+ declare class FlowAccessor extends ElementAccessor<Flow, UpdateFlowRequest, FlowSelector> {
1623
+ constructor(client: IntegrationAppApiClient, selector: FlowSelector | string);
1624
+ apply(integrationKeys: string[]): Promise<Flow[]>;
1625
+ reset(): Promise<Flow>;
1626
+ }
1627
+ declare class FlowInstancesAccessor extends ElementInstanceListAccessor<FlowInstance, FindFlowInstancesQuery> {
1628
+ constructor(client: IntegrationAppApiClient);
1629
+ create(data: CreateFlowInstanceRequest): Promise<FlowInstance>;
1630
+ }
1631
+ declare class FlowInstanceAccessor extends ElementInstanceAccessor<FlowInstance, FlowInstanceSelector, CreateFlowInstanceRequest, UpdateFlowInstanceRequest> {
1632
+ protected client: IntegrationAppApiClient;
1633
+ protected selector: FlowInstanceSelector | string;
1634
+ constructor(client: IntegrationAppApiClient, selector: FlowInstanceSelector | string);
1635
+ enable(): Promise<FlowInstance>;
1636
+ disable(): Promise<FlowInstance>;
1637
+ updateToLatestFlow(): Promise<FlowInstance>;
1638
+ setup(): Promise<FlowInstance>;
1639
+ reset(options?: ResetFlowInstanceOptions): Promise<FlowInstance>;
1640
+ openConfiguration({ nodeKey, onClose }?: OpenFlowInstanceConfigurationOptions): Promise<void>;
1641
+ openEditor({ onClose }?: OpenFlowInstanceEditorOptions): Promise<void>;
1642
+ embedEditor({ mountTargetSelector, onClose, }?: {
1643
+ mountTargetSelector?: string;
1644
+ } & OpenFlowInstanceEditorOptions): Promise<void>;
1645
+ startRun(options?: RunFlowOptions): Promise<FlowRun>;
1646
+ run(options?: RunFlowOptions): Promise<FlowRun>;
1647
+ }
1648
+ declare class IntegrationLevelFlowAccessor extends IntegrationLevelElementAccessor<Flow, UpdateFlowRequest> {
1649
+ client: IntegrationAppApiClient;
1650
+ integrationSelector: string;
1651
+ flowSelector: string;
1652
+ constructor(client: IntegrationAppApiClient, integrationSelector: string, flowSelector: string);
1653
+ }
1654
+ declare class IntegrationLevelFlowsListAccessor extends IntegrationLevelElementsListAccessor<Flow, ListFlowsForIntegrationQuery, Omit<CreateFlowRequest, 'integrationId'>> {
1655
+ client: IntegrationAppApiClient;
1656
+ integrationSelector: string;
1657
+ constructor(client: IntegrationAppApiClient, integrationSelector: string);
1658
+ }
1659
+ declare class ConnectionLevelFlowAccessor extends ConnectionLevelElementAccessor<FlowInstance, UpdateFlowInstanceRequest> {
1660
+ client: IntegrationAppApiClient;
1661
+ connectionSelector: string;
1662
+ flowSelector: string;
1663
+ query: InstanceKeyQuery;
1664
+ constructor(client: IntegrationAppApiClient, connectionSelector: string, flowSelector: string, query: InstanceKeyQuery);
1665
+ enable(): Promise<FlowInstance>;
1666
+ disable(): Promise<FlowInstance>;
1667
+ run(options: {
1668
+ nodeKey?: string;
1669
+ input?: any;
1670
+ }): Promise<FlowRun>;
1671
+ openConfiguration(options?: OpenFlowInstanceConfigurationOptions): Promise<void>;
1672
+ openEditor(options?: OpenFlowInstanceEditorOptions): Promise<void>;
1673
+ }
1674
+ declare class ConnectionLevelFlowsAccessor extends ConnectionLevelElementsListAccessor<Flow, ListFlowInstancesForConnectionQuery> {
1675
+ client: IntegrationAppApiClient;
1676
+ connectionSelector: string;
1677
+ constructor(client: IntegrationAppApiClient, connectionSelector: string);
1678
+ }
1679
+
1680
+ interface ListDataSourcesForIntegrationQuery extends PaginationQuery {
1681
+ universalDataSourceId?: string | 'null';
1682
+ }
1683
+ interface FindDataSourcesQuery extends ListDataSourcesForIntegrationQuery {
1684
+ integrationId?: string | 'null';
1685
+ }
1686
+ type CreateDataSourceRequest = {
1687
+ key: string;
1688
+ name: string;
1689
+ integrationId?: string;
1690
+ udm?: string;
1691
+ pullUpdatesIntervalSeconds?: number;
1692
+ fullSyncIntervalSeconds?: number;
1693
+ rootPath?: string;
1694
+ defaultPath?: string;
1695
+ collectionKey?: string;
1696
+ collectionParameters?: any;
1697
+ };
1698
+ type UpdateDataSourceRequest = {
1699
+ key?: string;
1700
+ name?: string;
1701
+ archivedAt?: string;
1702
+ udm?: string;
1703
+ pullUpdatesIntervalSeconds?: number;
1704
+ fullSyncIntervalSeconds?: number;
1705
+ rootPath?: string;
1706
+ defaultPath?: string;
1707
+ };
1708
+ interface DataSourceInstanceSelector extends ConnectionSelector, FlowInstanceSelector, ElementInstanceSelector {
1709
+ dataSourceKey?: string;
1710
+ dataSourceId?: string;
1711
+ instanceKey?: string;
1712
+ nodeKey?: string;
1713
+ udm?: string;
1714
+ }
1715
+ interface FindDataSourceInstancesQuery extends PaginationQuery {
1716
+ userId?: string;
1717
+ dataSourceId?: string;
1718
+ universalDataSourceId?: string;
1719
+ connectionId?: string;
1720
+ integrationKey?: string;
1721
+ integrationId?: string;
1722
+ }
1723
+ interface CreateDataSourceInstanceRequest {
1724
+ dataSourceId: string;
1725
+ connectionId: string;
1726
+ path?: string;
1727
+ }
1728
+ interface UpdateDataSourceInstanceRequest {
1729
+ path?: string;
1730
+ collectionKey?: string;
1731
+ collectionParameters?: any;
1732
+ pullUpdatesIntervalSeconds?: number;
1733
+ fullSyncIntervalSeconds?: number;
1734
+ subscribedTo?: {
1735
+ created?: boolean;
1736
+ updated?: boolean;
1737
+ deleted?: boolean;
1738
+ };
1739
+ }
1740
+ type ListDataSourceInstancesForConnectionQuery = PaginationQuery & {
1741
+ dataSourceId?: string;
1742
+ };
1743
+
1744
+ interface OpenDataSourceConfigurationOptions extends OpenConfigurationOptions {
1745
+ }
1746
+ declare class DataSourcesAccessor extends ElementListAccessor<DataSource, FindDataSourcesQuery, CreateDataSourceRequest> {
1747
+ constructor(client: IntegrationAppApiClient);
1748
+ }
1749
+ declare class DataSourceAccessor extends ElementAccessor<DataSource, UpdateDataSourceRequest, DataSourceSelector> {
1750
+ constructor(client: IntegrationAppApiClient, selector: DataSourceSelector | string);
1751
+ apply(integrationKeys: string[]): Promise<DataSource[]>;
1752
+ setup(): Promise<void>;
1753
+ reset(): Promise<any>;
1754
+ }
1755
+ declare class DataSourceInstancesAccessor extends ElementInstanceListAccessor<DataSourceInstance, FindDataSourceInstancesQuery> {
1756
+ constructor(client: IntegrationAppApiClient);
1757
+ }
1758
+ declare class DataSourceInstanceAccessor extends ElementInstanceAccessor<DataSourceInstance, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, UpdateDataSourceInstanceRequest> {
1759
+ client: IntegrationAppApiClient;
1760
+ constructor(client: IntegrationAppApiClient, selector: string | DataSourceInstanceSelector);
1761
+ setup(): Promise<void>;
1762
+ reset(): Promise<void>;
1763
+ openConfiguration({ onClose }?: OpenDataSourceConfigurationOptions): Promise<void>;
1764
+ unifiedFieldsToNative(unifiedFields: any): Promise<any>;
1765
+ getCollection(): Promise<DataCollectionSpec>;
1766
+ listRecords(request?: DataCollectionListRequest): Promise<DataCollectionListResponse>;
1767
+ matchRecord(request: DataCollectionMatchRequest): Promise<DataCollectionMatchResponse>;
1768
+ searchRecords(request: DataCollectionSearchRequest): Promise<DataCollectionSearchResponse>;
1769
+ findRecordById(request: string | DataCollectionFindByIdRequest): Promise<DataCollectionFindByIdResponse>;
1770
+ createRecord(request: DataCollectionCreateRequest): Promise<DataCollectionCreateResponse>;
1771
+ updateRecord(request: DataCollectionUpdateRequest): Promise<DataCollectionUpdateResponse>;
1772
+ deleteRecord(request: string | DataCollectionFindByIdRequest): Promise<DataCollectionDeleteResponse>;
1773
+ findRecords(request?: DataCollectionFindRequest): Promise<DataCollectionFindResponse>;
1774
+ }
1775
+ declare class IntegrationLevelDataSourceAccessor extends IntegrationLevelElementAccessor<DataSource, UpdateDataSourceRequest> {
1776
+ client: IntegrationAppApiClient;
1777
+ integrationSelector: string;
1778
+ dataSourceSelector: string;
1779
+ constructor(client: IntegrationAppApiClient, integrationSelector: string, dataSourceSelector: string);
1780
+ }
1781
+ declare class IntegrationLevelDataSourcesListAccessor extends IntegrationLevelElementsListAccessor<DataSource, ListDataSourcesForIntegrationQuery, Omit<CreateDataSourceRequest, 'integrationId'>> {
1782
+ client: IntegrationAppApiClient;
1783
+ integrationSelector: string;
1784
+ constructor(client: IntegrationAppApiClient, integrationSelector: string);
1785
+ }
1786
+ declare class ConnectionLevelDataSourceAccessor extends ConnectionLevelElementAccessor<DataSourceInstance, UpdateDataSourceInstanceRequest> {
1787
+ client: IntegrationAppApiClient;
1788
+ connectionSelector: string;
1789
+ dataSourceSelector: string;
1790
+ query: InstanceKeyQuery;
1791
+ constructor(client: IntegrationAppApiClient, connectionSelector: string, dataSourceSelector: string, query: InstanceKeyQuery);
1792
+ openConfiguration(options?: OpenDataSourceConfigurationOptions): Promise<void>;
1793
+ }
1794
+ declare class ConnectionLevelDataSourcesAccessor extends ConnectionLevelElementsListAccessor<DataSource, ListDataSourceInstancesForConnectionQuery> {
1795
+ client: IntegrationAppApiClient;
1796
+ connectionSelector: string;
1797
+ constructor(client: IntegrationAppApiClient, connectionSelector: string);
1798
+ }
1799
+
1800
+ interface DataSourceUnitConfig {
1801
+ key?: string;
1802
+ collectionKey?: any;
1803
+ collectionParameters?: any;
1804
+ udm?: any;
1805
+ path?: string;
1806
+ pullUpdatesIntervalSeconds?: number;
1807
+ fullSyncIntervalSeconds?: number;
1808
+ }
1809
+ interface DataSource extends WorkspaceElement {
1810
+ revision: string;
1811
+ publishedRevision?: string;
1812
+ integrationId?: string;
1813
+ integration?: Integration;
1814
+ universalDataSourceId?: string;
1815
+ universalDataSourceRevision?: string;
1816
+ udm?: string;
1817
+ pullUpdatesIntervalSeconds?: number;
1818
+ fullSyncIntervalSeconds?: number;
1819
+ collectionKey?: string;
1820
+ collectionParameters?: any;
1821
+ archivedAt?: string;
1822
+ createdAt?: string;
1823
+ updatedAt?: string;
1824
+ customized?: boolean;
1825
+ appliedToIntegrations?: AppliedToIntegrations<DataSource>;
1826
+ defaultPath?: string;
1827
+ }
1828
+ interface DataSourceInstance extends WorkspaceElement {
1829
+ userId: string;
1830
+ revision: string;
1831
+ user?: User;
1832
+ dataSourceRevision?: string;
1833
+ dataSourceId?: string;
1834
+ universalDataSourceId?: string;
1835
+ dataSource?: DataSource;
1836
+ udm?: string;
1837
+ connectionId: string;
1838
+ connection?: Connection;
1839
+ integrationId: string;
1840
+ integration?: Integration;
1841
+ instanceKey?: string;
1842
+ collectionKey?: string;
1843
+ collectionParameters?: any;
1844
+ defaultCollectionKey?: string;
1845
+ defaultCollectionParameters?: any;
1846
+ collectionSpec?: DataCollectionSpec;
1847
+ isCustomized?: boolean;
1848
+ errors?: ErrorData[];
1849
+ pullUpdatesIntervalSeconds?: number;
1850
+ fullSyncIntervalSeconds?: number;
1851
+ path?: string;
1852
+ defaultPath?: string;
1853
+ }
1854
+ interface DataSourceSelector extends IntegrationSpecificElementSelector {
1855
+ }
1856
+
1857
+ declare class ConnectionsAccessor extends ElementInstanceListAccessor<Connection, FindConnectionsQuery> {
1858
+ constructor(client: IntegrationAppApiClient);
1859
+ create(data: CreateConnectionRequest): Promise<Connection>;
1860
+ }
1861
+ declare class ConnectionAccessor {
1862
+ client: IntegrationAppApiClient;
1863
+ connectionSelector: string;
1864
+ constructor(client: IntegrationAppApiClient, connectionSelector: string);
1865
+ get actions(): ConnectionLevelActionsAccessor;
1866
+ action(actionSelector: string, query?: InstanceKeyQuery): ConnectionLevelActionAccessor;
1867
+ get flows(): ConnectionLevelFlowsAccessor;
1868
+ flow(flowSelector: string, query?: InstanceKeyQuery): ConnectionLevelFlowAccessor;
1869
+ get dataSources(): ConnectionLevelDataSourcesAccessor;
1870
+ dataSource(dataSourceSelector: string, query?: InstanceKeyQuery): ConnectionLevelDataSourceAccessor;
1871
+ get fieldMappings(): ConnectionLevelFieldMappingsAccessor;
1872
+ fieldMapping(fieldMappingSelector: string, query?: InstanceKeyQuery): ConnectionLevelFieldMappingAccessor;
1873
+ get(query?: {
1874
+ includeSecrets?: boolean;
1875
+ }): Promise<Connection>;
1876
+ patch(data: UpdateConnectionRequest): Promise<Connection>;
1877
+ put(data: UpdateConnectionRequest): Promise<Connection>;
1878
+ archive(): Promise<void>;
1879
+ request(path: string, data?: any): Promise<any>;
1880
+ get proxy(): ConnectionProxy;
1881
+ operation(key: string): ConnectionOperationAccessor;
1882
+ dataCollection(key: string, parameters?: Record<string, any>): ConnectionDataCollectionAccessor;
1883
+ dataDirectory(key: string, parameters?: Record<string, any>): ConnectionDataDirectoryAccessor;
1884
+ reconnect({ parameters, authOptionKey, }?: {
1885
+ parameters?: any;
1886
+ authOptionKey?: string;
1887
+ }): Promise<Connection | undefined>;
1888
+ openReconnectUI({}?: OpenConfigurationOptions): Promise<void>;
1889
+ refreshCredentials(): Promise<void>;
1890
+ getPath(subpath?: string, query?: Record<string, any>): string;
1891
+ }
1892
+ declare class ConnectionOperationAccessor {
1893
+ client: IntegrationAppApiClient;
1894
+ connectionAccessor: ConnectionAccessor;
1895
+ key: string;
1896
+ constructor(client: IntegrationAppApiClient, connectionAccessor: ConnectionAccessor, key: string);
1897
+ get(): Promise<OperationSpec>;
1898
+ run(request?: OperationRunRequest): Promise<OperationRunResponse>;
1899
+ }
1900
+ declare class ConnectionDataDirectoryAccessor {
1901
+ client: IntegrationAppApiClient;
1902
+ connectionAccessor: ConnectionAccessor;
1903
+ key: string;
1904
+ parameters: Record<string, any>;
1905
+ constructor(client: IntegrationAppApiClient, connectionAccessor: ConnectionAccessor, key: string, parameters: Record<string, any>);
1906
+ list(request?: DataDirectoryListRequest): Promise<DataDirectoryListResponse>;
1907
+ }
1908
+ declare class ConnectionDataCollectionAccessor {
1909
+ client: IntegrationAppApiClient;
1910
+ connectionAccessor: ConnectionAccessor;
1911
+ key: string;
1912
+ parameters: Record<string, any>;
1913
+ constructor(client: IntegrationAppApiClient, connectionAccessor: ConnectionAccessor, key: string, parameters: Record<string, any>);
1914
+ get(): Promise<DataCollectionSpec>;
1915
+ findById(request?: DataCollectionFindByIdRequest): Promise<DataCollectionFindByIdResponse>;
1916
+ list(request?: DataCollectionListRequest): Promise<DataCollectionListResponse>;
1917
+ search(request?: DataCollectionSearchRequest): Promise<DataCollectionSearchResponse>;
1918
+ match(request?: DataCollectionMatchRequest): Promise<DataCollectionMatchResponse>;
1919
+ create(request?: DataCollectionCreateRequest): Promise<DataCollectionCreateResponse>;
1920
+ update(request?: DataCollectionUpdateRequest): Promise<DataCollectionUpdateResponse>;
1921
+ delete(request?: DataCollectionDeleteRequest): Promise<DataCollectionDeleteResponse>;
1922
+ }
1923
+ declare class ConnectionProxy {
1924
+ private connection;
1925
+ constructor(connection: ConnectionAccessor);
1926
+ get(path: string): Promise<any>;
1927
+ post(path: string, data?: any): Promise<any>;
1928
+ put(path: string, data?: any): Promise<any>;
1929
+ patch(path: string, data?: any): Promise<any>;
1930
+ delete(path: string): Promise<any>;
1931
+ private getProxyPath;
1932
+ }
1933
+
1934
+ declare class Connection {
1935
+ id: string;
1936
+ name: string;
1937
+ userId: string;
1938
+ user?: User;
1939
+ disconnected?: boolean;
1940
+ error?: ErrorData;
1941
+ integrationId: string;
1942
+ integration?: Integration;
1943
+ credentials?: unknown;
1944
+ parameters?: unknown;
1945
+ connectorParameters?: unknown;
1946
+ accessToken?: string;
1947
+ refreshToken?: string;
1948
+ createdAt: string;
1949
+ updatedAt: string;
1950
+ archivedAt?: string;
1951
+ }
1952
+ interface ConnectionSpec extends ConnectorSpec {
1953
+ }
1954
+ declare class ConnectionSpec {
1955
+ constructor(opts: ConnectionSpec);
1956
+ }
1957
+
1958
+ declare enum ActionType {
1959
+ ListDataRecords = "list-data-records",
1960
+ FindDataRecordById = "find-data-record-by-id",
1961
+ MatchDataRecord = "match-data-record",
1962
+ CreateDataRecord = "create-data-record",
1963
+ FindOrCreateDataRecord = "find-or-create-data-record",
1964
+ UpdateDataRecord = "update-data-record",
1965
+ DeleteDataRecord = "delete-data-record",
1966
+ SearchDataRecords = "search-data-record",
1967
+ ConnectorOperation = "connector-operation",
1968
+ ApiRequestToExternalApp = "api-request-to-external-app",
1969
+ ApiRequestToYourApp = "api-request-to-your-app",
1970
+ HttpRequest = "http-request",
1971
+ RunJavascript = "run-javascript",
1972
+ ApiRequest = "api-request"
1973
+ }
1974
+
1975
+ interface Action extends ElementTemplateFields {
1976
+ type: ActionType;
1977
+ inputSchema?: DataSchema;
1978
+ config?: any;
1979
+ outputMapping?: any;
1980
+ customOutputSchema?: DataSchema;
1981
+ defaultOutputSchema?: DataSchema;
1982
+ transformedOutputSchema?: DataSchema;
1983
+ outputSchema?: DataSchema;
1984
+ appliedToIntegrations?: AppliedToIntegrations<Action>;
1985
+ dependencies?: WorkspaceElementDependency[];
1986
+ isDeployed?: boolean;
1987
+ }
1988
+ interface ActionInstance extends ElementInstanceFields {
1989
+ type: ActionType;
1990
+ parent?: Action;
1991
+ instanceKey?: string;
1992
+ inputSchema?: any;
1993
+ config?: any;
1994
+ outputSchema?: any;
1995
+ isOutdated?: boolean;
1996
+ state: WorkspaceElementState;
1997
+ }
1998
+ interface ListActionsForIntegrationQuery extends PaginationQuery {
1999
+ parentId?: string | 'null';
2000
+ }
2001
+ interface FindActionsQuery extends ListActionsForIntegrationQuery {
2002
+ integrationId?: string | 'null';
2003
+ }
2004
+ type CreateActionRequest = {
2005
+ key: string;
2006
+ name: string;
2007
+ type?: ActionType;
2008
+ inputSchema?: any;
2009
+ config?: any;
2010
+ integrationId?: string;
2011
+ };
2012
+ type UpdateActionRequest = {
2013
+ key?: string;
2014
+ type?: ActionType;
2015
+ name?: string;
2016
+ inputSchema?: any;
2017
+ config?: any;
2018
+ archivedAt?: string;
2019
+ };
2020
+ interface ActionSelector extends IntegrationSpecificElementSelector {
2021
+ }
2022
+ interface ActionInstanceSelector extends ConnectionSelector, ElementInstanceSelector {
2023
+ }
2024
+ type ListActionInstancesForConnectionQuery = PaginationQuery & {
2025
+ parentId?: string;
2026
+ universalParentId?: string;
2027
+ };
2028
+ interface FindActionInstancesQuery extends ListActionInstancesForConnectionQuery {
2029
+ integrationKey?: string;
2030
+ integrationId?: string;
2031
+ userId?: string;
2032
+ connectionId?: string;
2033
+ }
2034
+ interface CreateActionInstanceRequest {
2035
+ parentId: string;
2036
+ connectionId: string;
2037
+ config?: any;
2038
+ }
2039
+ interface UpdateActionInstanceRequest {
2040
+ config?: any;
2041
+ }
2042
+ interface OpenActionConfigurationOptions extends OpenConfigurationOptions {
2043
+ }
2044
+ interface ActionRunResponse {
2045
+ output?: any;
2046
+ logs?: any[];
2047
+ }
2048
+
2049
+ declare class ActionsAccessor extends ElementListAccessor<Action, FindActionsQuery, CreateActionRequest> {
2050
+ constructor(client: IntegrationAppApiClient);
2051
+ }
2052
+ declare class ActionAccessor extends ElementAccessor<Action, UpdateActionRequest, ActionSelector> {
2053
+ constructor(client: IntegrationAppApiClient, selector: ActionSelector | string);
2054
+ apply(integrationKeys: string[]): Promise<Action[]>;
2055
+ reset(): Promise<any>;
2056
+ }
2057
+ declare class ActionInstancesAccessor extends ElementInstanceListAccessor<ActionInstance, FindActionInstancesQuery> {
2058
+ constructor(client: IntegrationAppApiClient);
2059
+ }
2060
+ declare class ActionInstanceAccessor extends ElementInstanceAccessor<ActionInstance, ActionInstanceSelector, CreateActionInstanceRequest, UpdateActionInstanceRequest> {
2061
+ client: IntegrationAppApiClient;
2062
+ constructor(client: IntegrationAppApiClient, selector: string | ActionInstanceSelector);
2063
+ setup(): Promise<void>;
2064
+ reset(): Promise<void>;
2065
+ run(input?: any): Promise<ActionRunResponse>;
2066
+ open({ onClose }?: OpenActionConfigurationOptions): Promise<void>;
2067
+ }
2068
+ declare class IntegrationLevelActionAccessor extends IntegrationLevelElementAccessor<Action, UpdateActionRequest> {
2069
+ client: IntegrationAppApiClient;
2070
+ integrationSelector: string;
2071
+ actionSelector: string;
2072
+ constructor(client: IntegrationAppApiClient, integrationSelector: string, actionSelector: string);
2073
+ }
2074
+ declare class IntegrationLevelActionsListAccessor extends IntegrationLevelElementsListAccessor<Action, ListActionsForIntegrationQuery, Omit<CreateActionRequest, 'integrationId'>> {
2075
+ client: IntegrationAppApiClient;
2076
+ integrationSelector: string;
2077
+ constructor(client: IntegrationAppApiClient, integrationSelector: string);
2078
+ }
2079
+ declare class ConnectionLevelActionAccessor extends ConnectionLevelElementAccessor<ActionInstance, UpdateActionInstanceRequest> {
2080
+ client: IntegrationAppApiClient;
2081
+ connectionSelector: string;
2082
+ actionSelector: string;
2083
+ query: InstanceKeyQuery;
2084
+ constructor(client: IntegrationAppApiClient, connectionSelector: string, actionSelector: string, query: InstanceKeyQuery);
2085
+ run(input?: any): Promise<ActionRunResponse>;
2086
+ }
2087
+ declare class ConnectionLevelActionsAccessor extends ConnectionLevelElementsListAccessor<Action, ListActionInstancesForConnectionQuery> {
2088
+ client: IntegrationAppApiClient;
2089
+ connectionSelector: string;
2090
+ constructor(client: IntegrationAppApiClient, connectionSelector: string);
2091
+ }
2092
+
2093
+ type CreateAppDataSchemaRequest = {
2094
+ key: string;
2095
+ name: string;
2096
+ schema?: any;
2097
+ code?: string;
2098
+ };
2099
+ type UpdateAppDataSchemaRequest = {
2100
+ key?: string;
2101
+ name?: string;
2102
+ schema?: any;
2103
+ code?: string;
2104
+ archivedAt?: string;
2105
+ };
2106
+ interface FindAppDataSchemasQuery extends PaginationQuery {
2107
+ }
2108
+ interface AppDataSchemaInstanceSelector {
2109
+ id?: string;
2110
+ appDataSchemaKey?: string;
2111
+ appDataSchemaId?: string;
2112
+ instanceKey?: string;
2113
+ autoCreate?: boolean;
2114
+ }
2115
+ interface UpdateAppDataSchemaInstanceRequest {
2116
+ }
2117
+ interface CreateAppDataSchemaInstanceRequest {
2118
+ }
2119
+ interface FindAppDataSchemaInstancesQuery extends PaginationQuery {
2120
+ id?: string;
2121
+ userId?: string;
2122
+ appDataSchemaId?: string;
2123
+ instanceKey?: string;
2124
+ }
2125
+
2126
+ declare class AppDataSchemasAccessor extends ElementListAccessor<AppDataSchema, FindAppDataSchemasQuery, CreateAppDataSchemaRequest> {
2127
+ constructor(client: IntegrationAppApiClient);
2128
+ }
2129
+ declare class AppDataSchemaAccessor extends ElementAccessor<AppDataSchema, UpdateAppDataSchemaRequest> {
2130
+ constructor(client: IntegrationAppApiClient, idOrKey: string);
2131
+ }
2132
+ declare class AppDataSchemaInstancesAccessor extends ElementInstanceListAccessor<AppDataSchemaInstance, FindAppDataSchemaInstancesQuery> {
2133
+ constructor(client: IntegrationAppApiClient);
2134
+ }
2135
+ declare class AppDataSchemaInstanceAccessor extends ElementInstanceAccessor<AppDataSchemaInstance, AppDataSchemaInstanceSelector, UpdateAppDataSchemaInstanceRequest, CreateAppDataSchemaInstanceRequest> {
2136
+ private client;
2137
+ constructor(client: IntegrationAppApiClient, selector: string | AppDataSchemaInstanceSelector);
2138
+ setup(): Promise<void>;
2139
+ }
2140
+
2141
+ interface AppDataSchema extends WorkspaceElement {
2142
+ schema: any;
2143
+ code?: string;
2144
+ archivedAt?: string;
2145
+ revision?: string;
2146
+ }
2147
+ interface AppDataSchemaInstance extends WorkspaceElement {
2148
+ appId: string;
2149
+ userId: string;
2150
+ user?: User;
2151
+ appDataSchemaId: string;
2152
+ appDataSchemaRevision: string;
2153
+ appDataSchema?: AppDataSchema;
2154
+ instanceKey?: string;
2155
+ schema?: any;
2156
+ error?: ErrorData;
2157
+ archivedAt?: string;
2158
+ }
2159
+
2160
+ interface UpdateAppEventTypeRequest {
2161
+ key?: string;
2162
+ name?: string;
2163
+ subscribeRequest?: HttpRequestSpec;
2164
+ example?: any;
2165
+ schema?: DataSchema;
2166
+ userIdFormula?: any;
2167
+ }
2168
+ interface CreateAppEventTypeRequest extends UpdateAppEventTypeRequest {
2169
+ key: string;
2170
+ name: string;
2171
+ }
2172
+ interface AppEventSubscriptionSelector extends Omit<ElementInstanceSelector, 'parentKey' | 'parentId'> {
2173
+ appEventTypeKey?: string;
2174
+ appEventTypeId?: string;
2175
+ instanceKey?: string;
2176
+ }
2177
+ interface AppEventSubscriptionUpdateRequest {
2178
+ }
2179
+ interface FindAppEventTypesQuery extends PaginationQuery {
2180
+ includeArchived?: boolean;
2181
+ }
2182
+ interface FindAppEventSubscriptionsQuery extends PaginationQuery {
2183
+ id?: string;
2184
+ userId?: string;
2185
+ instanceKey?: string;
2186
+ appEventTypeId?: string;
2187
+ isSubscribed?: boolean;
2188
+ }
2189
+ interface FindAppEventsQuery extends PaginationQuery {
2190
+ id?: string;
2191
+ userId?: string;
2192
+ instanceKey?: string;
2193
+ appEventTypeId?: string;
2194
+ appEventSubscriptionId?: string;
2195
+ startDatetime?: string;
2196
+ endDatetime?: string;
2197
+ }
2198
+
2199
+ declare class AppEventTypesAccessor extends ElementListAccessor<AppEventType, FindAppEventTypesQuery, CreateAppEventTypeRequest> {
2200
+ constructor(client: IntegrationAppApiClient);
2201
+ }
2202
+ declare class AppEventTypeAccessor extends ElementAccessor<AppEventType, UpdateAppEventTypeRequest> {
2203
+ constructor(client: IntegrationAppApiClient, idOrKey: string);
2204
+ }
2205
+ declare class AppEventSubscriptionsAccessor extends ElementInstanceListAccessor<AppEventSubscription, FindAppEventSubscriptionsQuery> {
2206
+ constructor(client: IntegrationAppApiClient);
2207
+ }
2208
+ declare class AppEventSubscriptionAccessor extends ElementInstanceAccessor<AppEventSubscription, AppEventSubscriptionSelector, AppEventSubscriptionUpdateRequest, AppEventSubscriptionUpdateRequest> {
2209
+ constructor(client: IntegrationAppApiClient, selector: string | AppEventSubscriptionSelector);
2210
+ subscribe(): Promise<void>;
2211
+ }
2212
+ declare class AppEventsAccessor extends ElementInstanceListAccessor<AppEvent, FindAppEventsQuery> {
2213
+ constructor(client: IntegrationAppApiClient);
2214
+ }
2215
+
2216
+ interface AppEventType extends WorkspaceElement {
2217
+ revision: string;
2218
+ archivedAt?: string;
2219
+ subscribeRequest?: HttpRequestSpec;
2220
+ example?: any;
2221
+ schema?: DataSchema;
2222
+ globalWebhookUri: string;
2223
+ userIdFormula?: any;
2224
+ }
2225
+ interface AppEventSubscription extends WorkspaceElement {
2226
+ revision: string;
2227
+ appEventTypeId: string;
2228
+ appEventType?: AppEventType;
2229
+ userId: string;
2230
+ user?: User;
2231
+ instanceKey?: string;
2232
+ isSubscribed: boolean;
2233
+ schema?: DataSchema;
2234
+ webhookUri: string;
2235
+ subscriptionRequest: HttpRequestSpec;
2236
+ subscriptionResponse?: any;
2237
+ archivedAt?: string;
2238
+ }
2239
+ interface AppEvent {
2240
+ id: string;
2241
+ name?: string;
2242
+ userId: string;
2243
+ user?: User;
2244
+ appEventTypeId: string;
2245
+ appEventType?: AppEventType;
2246
+ appEventSubscriptionId: string;
2247
+ appEventSubscription?: AppEventSubscription;
2248
+ event: any;
2249
+ datetime: string;
2250
+ launchedFlowRunIds: string[];
2251
+ }
2252
+
2253
+ declare class SelfAccessor {
2254
+ private client;
2255
+ constructor(client: IntegrationAppApiClient);
2256
+ get(): Promise<Customer>;
2257
+ patch(data: Partial<{
2258
+ credentials: any;
2259
+ }>): Promise<Customer>;
2260
+ }
2261
+
2262
+ type CreateDataLinkTableRequest = Omit<DataLinkTable, 'id' | 'userId'>;
2263
+ type UpdateDataLinkTableRequest = CreateDataLinkTableRequest;
2264
+ interface FindDataLinkTablesQuery extends PaginationQuery {
2265
+ }
2266
+ interface FindDataLinkTableInstancesQuery extends PaginationQuery {
2267
+ connectionId?: string;
2268
+ integrationId?: string;
2269
+ dataLinkTableId?: string;
2270
+ }
2271
+ interface DataLinkTableInstanceSelector extends ConnectionSelector, ElementInstanceSelector {
2272
+ dataLinkTableId?: string;
2273
+ dataLinkTableKey?: string;
2274
+ instanceKey?: string;
2275
+ }
2276
+ interface UpdateDataLinkTableInstanceRequest {
2277
+ }
2278
+ interface FindDataLinksInTableQuery extends PaginationQuery {
2279
+ direction?: DataLinkDirection;
2280
+ appRecordId?: string;
2281
+ externalRecordId?: string;
2282
+ }
2283
+ interface CreateDataLinkRequest {
2284
+ direction?: DataLinkDirection;
2285
+ appRecordId: string;
2286
+ externalRecordId: string;
2287
+ }
2288
+ interface DeleteDataLinkRequest {
2289
+ direction?: DataLinkDirection;
2290
+ appRecordId: string;
2291
+ externalRecordId: string;
2292
+ }
2293
+ interface FindDataLinksResponse extends PaginationResponse<DataLink> {
2294
+ }
2295
+
2296
+ declare class DataLinkTablesAccessor extends ElementListAccessor<DataLinkTable, FindDataLinkTablesQuery, CreateDataLinkTableRequest> {
2297
+ constructor(client: IntegrationAppApiClient);
2298
+ }
2299
+ declare class DataLinkTableAccessor extends ElementAccessor<DataLinkTable, UpdateDataLinkTableRequest> {
2300
+ constructor(client: IntegrationAppApiClient, idOrKey: string);
2301
+ }
2302
+ declare class DataLinkTableInstancesAccessor extends ElementInstanceListAccessor<DataLinkTableInstance, FindDataLinkTableInstancesQuery> {
2303
+ constructor(client: IntegrationAppApiClient);
2304
+ }
2305
+ declare class DataLinkTableInstanceAccessor extends ElementInstanceAccessor<DataLinkTableInstance, DataLinkTableInstanceSelector, UpdateDataLinkTableInstanceRequest, UpdateDataLinkTableInstanceRequest> {
2306
+ private client;
2307
+ constructor(client: IntegrationAppApiClient, selector: string | DataLinkTableInstanceSelector);
2308
+ findLinks(query?: FindDataLinksInTableQuery): Promise<FindDataLinksResponse>;
2309
+ createLink(data: CreateDataLinkRequest): Promise<void>;
2310
+ deleteLink(data: DeleteDataLinkRequest): Promise<void>;
2311
+ }
2312
+
2313
+ declare enum DataLinkDirection {
2314
+ IMPORT = "import",
2315
+ EXPORT = "export",
2316
+ BOTH = "both"
2317
+ }
2318
+ interface DataLinkTable extends WorkspaceElement {
2319
+ archivedAt?: string;
2320
+ }
2321
+ interface DataLinkTableInstance extends WorkspaceElement {
2322
+ dataLinkTableId?: string;
2323
+ dataLinkTable?: DataLinkTable;
2324
+ connectionId?: string;
2325
+ connection?: Connection;
2326
+ integrationId: string;
2327
+ integration?: Integration;
2328
+ instanceKey?: string;
2329
+ userId: string;
2330
+ user?: User;
2331
+ archivedAt?: string;
2332
+ }
2333
+ interface DataLink {
2334
+ id: string;
2335
+ dataLinkTableInstanceId: string;
2336
+ externalRecordId: string;
2337
+ appRecordId: string;
2338
+ direction: DataLinkDirection;
2339
+ }
2340
+
2341
+ declare enum ExternalEventSubscriptionStatus {
2342
+ Subscribed = "subscribed",
2343
+ Unsubscribed = "unsubscribed",
2344
+ Error = "error"
2345
+ }
2346
+ declare enum ExternalEventSubscriptionType {
2347
+ DataRecordCreated = "data-record-created",
2348
+ DataRecordUpdated = "data-record-updated",
2349
+ DataRecordDeleted = "data-record-deleted",
2350
+ ConnectorEvent = "connector-event"
2351
+ }
2352
+ interface ExternalEventSubscriptionConfig {
2353
+ type: ExternalEventSubscriptionType;
2354
+ dataSource?: DataSourceUnitConfig;
2355
+ eventKey?: string;
2356
+ eventParameters?: any;
2357
+ }
2358
+ interface ExternalEventSubscription {
2359
+ id: string;
2360
+ name?: string;
2361
+ userId: string;
2362
+ user?: Customer;
2363
+ connectionId: string;
2364
+ connection?: Connection;
2365
+ integrationId: string;
2366
+ integration?: Integration;
2367
+ uuid: string;
2368
+ config?: ExternalEventSubscriptionConfig;
2369
+ status?: ExternalEventSubscriptionStatus;
2370
+ error?: ErrorData;
2371
+ isRealTime?: boolean;
2372
+ requiresPull?: boolean;
2373
+ requiresFullSync?: boolean;
2374
+ createdAt?: string;
2375
+ archivedAt?: string;
2376
+ stateData?: any;
2377
+ nextPullEventsTimestamp?: number;
2378
+ pullUpdatesIntervalSeconds?: number;
2379
+ fullSyncIntervalSeconds?: number;
2380
+ nextRefreshTimestamp?: number;
2381
+ globalWebhookKey?: string;
2382
+ globalWebhookEventSelector?: string;
2383
+ }
2384
+
2385
+ interface FindExternalEventSubscriptionsQuery extends PaginationQuery {
2386
+ userId?: string;
2387
+ connectionId?: string;
2388
+ integrationId?: string;
2389
+ }
2390
+
2391
+ declare class ExternalEventSubscriptionsAccessor extends ElementInstanceListAccessor<ExternalEventSubscription, FindExternalEventSubscriptionsQuery> {
2392
+ constructor(client: IntegrationAppApiClient);
2393
+ }
2394
+ declare class ExternalEventSubscriptionAccessor {
2395
+ private client;
2396
+ private id;
2397
+ constructor(client: IntegrationAppApiClient, id: string);
2398
+ get(): Promise<ExternalEventSubscription>;
2399
+ setup(): Promise<void>;
2400
+ subscribe(): Promise<void>;
2401
+ unsubscribe(): Promise<void>;
2402
+ resubscribe(): Promise<void>;
2403
+ pullEvents(): Promise<void>;
2404
+ private getPath;
2405
+ }
2406
+
2407
+ interface Scenario extends WorkspaceElement {
2408
+ appId: string;
2409
+ scenarioTemplateId?: string;
2410
+ elements?: ScenarioElement[];
2411
+ connectors?: MinimalConnector[];
2412
+ todos?: ScenarioToDo[];
2413
+ appliedToIntegrations?: Integration[];
2414
+ archivedAt?: string;
2415
+ }
2416
+ type ScenarioToDo = {
2417
+ name: string;
2418
+ description: string;
2419
+ isComplete: boolean;
2420
+ };
2421
+ type ScenarioElement = {
2422
+ id: string;
2423
+ type: IntegrationElementType;
2424
+ element?: any;
2425
+ };
2426
+ interface FindScenariosQuery extends SearchQuery, PaginationQuery {
2427
+ }
2428
+ interface CreateScenarioRequest {
2429
+ name: string;
2430
+ key: string;
2431
+ elements?: ScenarioElement[];
2432
+ todos?: ScenarioToDo[];
2433
+ }
2434
+ interface UpdateScenarioRequest {
2435
+ name?: string;
2436
+ key?: string;
2437
+ elements?: ScenarioElement[];
2438
+ todos?: ScenarioToDo[];
2439
+ }
2440
+
2441
+ declare class ScenariosAccessor extends ElementListAccessor<Scenario, FindScenariosQuery, CreateScenarioRequest> {
2442
+ constructor(client: IntegrationAppApiClient);
2443
+ }
2444
+ declare class ScenarioAccessor extends ElementAccessor<Scenario, UpdateScenarioRequest> {
2445
+ constructor(client: IntegrationAppApiClient, selector: string);
2446
+ }
2447
+
2448
+ declare enum ScreenType {
2449
+ Integration = "integration"
2450
+ }
2451
+ declare enum ScreenBlockType {
2452
+ Flow = "flow",
2453
+ FieldMapping = "field-mapping",
2454
+ DataSource = "data-source",
2455
+ Action = "action"
2456
+ }
2457
+ interface ScreenBlock {
2458
+ type: ScreenBlockType;
2459
+ [key: string]: any;
2460
+ }
2461
+ interface ScreenSelector {
2462
+ id?: string;
2463
+ type?: ScreenType;
2464
+ key?: string;
2465
+ autoCreate?: boolean;
2466
+ connectionId?: string;
2467
+ }
2468
+ interface UpdateScreenRequest {
2469
+ blocks?: ScreenBlock[];
2470
+ key?: string;
2471
+ }
2472
+ interface CreateScreenRequest extends UpdateScreenRequest {
2473
+ type: ScreenType;
2474
+ }
2475
+ interface FindScreensQuery extends PaginationQuery {
2476
+ type?: ScreenType;
2477
+ }
2478
+ interface Screen extends Omit<WorkspaceElement, 'key'> {
2479
+ type: ScreenType;
2480
+ key?: string;
2481
+ blocks: ScreenBlock[];
2482
+ }
2483
+
2484
+ declare class ScreensAccessor extends ElementListAccessor<Screen, FindScreensQuery, CreateScreenRequest> {
2485
+ constructor(client: IntegrationAppApiClient);
2486
+ }
2487
+ declare class ScreenAccessor extends ElementAccessor<Screen, UpdateScreenRequest, ScreenSelector> {
2488
+ constructor(client: IntegrationAppApiClient, selector: ScreenSelector | string);
2489
+ }
2490
+
2491
+ interface OpenIntegrationAppConfigurationOptions extends OpenConfigurationOptions {
2492
+ }
2493
+ declare class IntegrationAppClient extends IntegrationAppApiClient {
2494
+ constructor(options: IntegrationAppClientOptions);
2495
+ get self(): SelfAccessor;
2496
+ get flows(): FlowsAccessor;
2497
+ open({ onClose }?: OpenIntegrationAppConfigurationOptions): Promise<void>;
2498
+ action(selector: string | ActionSelector): ActionAccessor;
2499
+ get actions(): ActionsAccessor;
2500
+ screen(selector: string | ScreenSelector): ScreenAccessor;
2501
+ get screens(): ScreensAccessor;
2502
+ actionInstance(selector: string | ActionInstanceSelector): ActionInstanceAccessor;
2503
+ get actionInstances(): ActionInstancesAccessor;
2504
+ flow(selector: string | FlowSelector): FlowAccessor;
2505
+ get flowInstances(): FlowInstancesAccessor;
2506
+ flowInstance(selector: string | FlowInstanceSelector): FlowInstanceAccessor;
2507
+ get dataSourceInstances(): DataSourceInstancesAccessor;
2508
+ get dataSources(): DataSourcesAccessor;
2509
+ dataSource(selector: string | DataSourceSelector): DataSourceAccessor;
2510
+ dataSourceInstance(selector: string | DataSourceInstanceSelector): DataSourceInstanceAccessor;
2511
+ get fieldMappings(): FieldMappingsAccessor;
2512
+ fieldMapping(selector: string | FieldMappingSelector): FieldMappingAccessor;
2513
+ get fieldMappingInstances(): FieldMappingInstancesAccessor;
2514
+ fieldMappingInstance(selector: string | FieldMappingInstanceSelector): FieldMappingInstanceAccessor;
2515
+ get dataLinkTables(): DataLinkTablesAccessor;
2516
+ dataLinkTable(idOrKey: string): DataLinkTableAccessor;
2517
+ get dataLinkTableInstances(): DataLinkTableInstancesAccessor;
2518
+ dataLinkTableInstance(selector: string | DataLinkTableInstanceSelector): DataLinkTableInstanceAccessor;
2519
+ get integrations(): IntegrationsAccessor;
2520
+ externalEventSubscriptions(): ExternalEventSubscriptionsAccessor;
2521
+ externalEventSubscription(id: string): ExternalEventSubscriptionAccessor;
2522
+ integration(identifier: string): IntegrationAccessor;
2523
+ get connections(): ConnectionsAccessor;
2524
+ connection(connectionSelector: string): ConnectionAccessor;
2525
+ get appEventTypes(): AppEventTypesAccessor;
2526
+ appEventType(id: string): AppEventTypeAccessor;
2527
+ get appEventSubscriptions(): AppEventSubscriptionsAccessor;
2528
+ appEventSubscription(selector: string | AppEventSubscriptionSelector): AppEventSubscriptionAccessor;
2529
+ get appEvents(): AppEventsAccessor;
2530
+ get flowRuns(): FlowRunsAccessor;
2531
+ flowRun(id: string): FlowRunAccessor;
2532
+ get appDataSchemas(): AppDataSchemasAccessor;
2533
+ appDataSchema(id: string): AppDataSchemaAccessor;
2534
+ get appDataSchemaInstances(): AppDataSchemaInstancesAccessor;
2535
+ appDataSchemaInstance(selector: string | AppDataSchemaInstanceSelector): AppDataSchemaInstanceAccessor;
2536
+ customer(selector: string | CustomerSelector): CustomerAccessor;
2537
+ get customers(): CustomersAccessor;
2538
+ scenario(selector: string): ScenarioAccessor;
2539
+ get scenarios(): ScenariosAccessor;
2540
+ connectionRequest(connectionId: string, uri: string, data?: any): Promise<any>;
2541
+ }
2542
+
2543
+ export { IntegrationAppClient as default };