runline 0.33.0 → 0.34.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 (515) hide show
  1. package/dist/auth/oauth2.d.ts +7 -1
  2. package/dist/auth/oauth2.js +10 -0
  3. package/dist/auth/token.d.ts +1 -0
  4. package/dist/auth/token.js +19 -1
  5. package/dist/auth/types.d.ts +22 -1
  6. package/dist/core/engine.d.ts +7 -0
  7. package/dist/core/engine.js +9 -0
  8. package/dist/credentials/policy.d.ts +53 -1
  9. package/dist/credentials/policy.js +146 -6
  10. package/dist/credentials/registry.d.ts +9 -0
  11. package/dist/credentials/registry.js +179 -22
  12. package/dist/credentials/transport.d.ts +48 -2
  13. package/dist/credentials/transport.js +248 -70
  14. package/dist/credentials/types.d.ts +167 -10
  15. package/dist/index.d.ts +5 -5
  16. package/dist/index.js +2 -2
  17. package/dist/plugin/api.d.ts +7 -0
  18. package/dist/plugin/api.js +7 -0
  19. package/dist/plugin/types.d.ts +12 -0
  20. package/dist/plugins/_shared/credentialAdapter.js +79 -15
  21. package/dist/plugins/_shared/credentials.js +389 -0
  22. package/dist/plugins/_shared/googleAuth.js +9 -40
  23. package/dist/plugins/_shared/googleCredentials.js +28 -7
  24. package/dist/plugins/_shared/microsoftAuth.js +13 -44
  25. package/dist/plugins/_shared/microsoftCredentials.js +30 -8
  26. package/dist/plugins/_shared/provider.js +2 -14
  27. package/dist/plugins/_shared/shiftCloud.js +19 -55
  28. package/dist/plugins/_shared/shiftCredentials.js +83 -0
  29. package/dist/plugins/actionNetwork/src/credentials.js +14 -0
  30. package/dist/plugins/actionNetwork/src/index.js +39 -50
  31. package/dist/plugins/activeCampaign/src/credentials.js +22 -0
  32. package/dist/plugins/activeCampaign/src/index.js +61 -132
  33. package/dist/plugins/adalo/src/credentials.js +16 -0
  34. package/dist/plugins/adalo/src/index.js +19 -43
  35. package/dist/plugins/affinity/src/credentials.js +19 -0
  36. package/dist/plugins/affinity/src/index.js +29 -54
  37. package/dist/plugins/agileCrm/src/credentials.js +16 -0
  38. package/dist/plugins/agileCrm/src/index.js +46 -112
  39. package/dist/plugins/airtable/src/credentials.js +19 -0
  40. package/dist/plugins/airtable/src/index.js +37 -50
  41. package/dist/plugins/airtop/src/credentials.js +20 -0
  42. package/dist/plugins/airtop/src/index.js +51 -75
  43. package/dist/plugins/apiTemplateIo/src/credentials.js +19 -0
  44. package/dist/plugins/apiTemplateIo/src/index.js +14 -31
  45. package/dist/plugins/asana/src/credentials.js +19 -0
  46. package/dist/plugins/asana/src/index.js +51 -72
  47. package/dist/plugins/autopilot/src/credentials.js +19 -0
  48. package/dist/plugins/autopilot/src/index.js +38 -45
  49. package/dist/plugins/bambooHr/src/credentials.js +16 -0
  50. package/dist/plugins/bambooHr/src/index.js +41 -67
  51. package/dist/plugins/bannerbear/src/credentials.js +19 -0
  52. package/dist/plugins/bannerbear/src/index.js +15 -27
  53. package/dist/plugins/baserow/src/credentials.js +17 -0
  54. package/dist/plugins/baserow/src/index.js +23 -49
  55. package/dist/plugins/beeminder/src/credentials.js +19 -0
  56. package/dist/plugins/beeminder/src/index.js +32 -54
  57. package/dist/plugins/bitly/src/credentials.js +19 -0
  58. package/dist/plugins/bitly/src/index.js +12 -26
  59. package/dist/plugins/bitwarden/src/credentials.js +62 -0
  60. package/dist/plugins/bitwarden/src/index.js +34 -80
  61. package/dist/plugins/box/src/credentials.js +19 -0
  62. package/dist/plugins/box/src/index.js +24 -49
  63. package/dist/plugins/brandfetch/src/credentials.js +13 -0
  64. package/dist/plugins/brandfetch/src/index.js +12 -17
  65. package/dist/plugins/brevo/src/credentials.js +19 -0
  66. package/dist/plugins/brevo/src/index.js +30 -51
  67. package/dist/plugins/bubble/src/credentials.js +28 -0
  68. package/dist/plugins/bubble/src/index.js +29 -65
  69. package/dist/plugins/chargebee/src/credentials.js +16 -0
  70. package/dist/plugins/chargebee/src/index.js +15 -45
  71. package/dist/plugins/circleci/src/credentials.js +19 -0
  72. package/dist/plugins/circleci/src/index.js +19 -39
  73. package/dist/plugins/ciscoWebex/src/credentials.js +19 -0
  74. package/dist/plugins/ciscoWebex/src/index.js +43 -61
  75. package/dist/plugins/clearbit/src/credentials.js +22 -0
  76. package/dist/plugins/clearbit/src/index.js +11 -21
  77. package/dist/plugins/clickup/src/credentials.js +19 -0
  78. package/dist/plugins/clickup/src/index.js +85 -117
  79. package/dist/plugins/clockify/src/credentials.js +19 -0
  80. package/dist/plugins/clockify/src/index.js +46 -61
  81. package/dist/plugins/cloudflare/src/credentials.js +19 -0
  82. package/dist/plugins/cloudflare/src/index.js +19 -34
  83. package/dist/plugins/cockpit/src/credentials.js +17 -0
  84. package/dist/plugins/cockpit/src/index.js +18 -31
  85. package/dist/plugins/coda/src/credentials.js +19 -0
  86. package/dist/plugins/coda/src/index.js +33 -50
  87. package/dist/plugins/coingecko/src/credentials.js +20 -0
  88. package/dist/plugins/coingecko/src/index.js +24 -34
  89. package/dist/plugins/contentful/src/credentials.js +26 -0
  90. package/dist/plugins/contentful/src/index.js +19 -40
  91. package/dist/plugins/convertkit/src/credentials.js +26 -0
  92. package/dist/plugins/convertkit/src/index.js +27 -45
  93. package/dist/plugins/copper/src/credentials.js +17 -0
  94. package/dist/plugins/copper/src/index.js +25 -47
  95. package/dist/plugins/cortex/src/credentials.js +28 -0
  96. package/dist/plugins/cortex/src/index.js +26 -49
  97. package/dist/plugins/currents/src/credentials.js +19 -0
  98. package/dist/plugins/currents/src/index.js +46 -59
  99. package/dist/plugins/customerIo/src/credentials.js +52 -0
  100. package/dist/plugins/customerIo/src/index.js +30 -58
  101. package/dist/plugins/databricks/src/credentials.js +13 -0
  102. package/dist/plugins/databricks/src/index.js +51 -103
  103. package/dist/plugins/deepl/src/credentials.js +19 -0
  104. package/dist/plugins/deepl/src/index.js +13 -39
  105. package/dist/plugins/demio/src/credentials.js +26 -0
  106. package/dist/plugins/demio/src/index.js +17 -41
  107. package/dist/plugins/dhl/src/credentials.js +13 -0
  108. package/dist/plugins/dhl/src/index.js +8 -19
  109. package/dist/plugins/discord/src/credentials.js +19 -0
  110. package/dist/plugins/discord/src/index.js +30 -58
  111. package/dist/plugins/discourse/src/credentials.js +18 -0
  112. package/dist/plugins/discourse/src/index.js +36 -53
  113. package/dist/plugins/disqus/src/credentials.js +13 -0
  114. package/dist/plugins/disqus/src/index.js +14 -32
  115. package/dist/plugins/drift/src/credentials.js +13 -0
  116. package/dist/plugins/drift/src/index.js +16 -26
  117. package/dist/plugins/dropbox/src/credentials.js +13 -0
  118. package/dist/plugins/dropbox/src/index.js +23 -30
  119. package/dist/plugins/dropcontact/src/credentials.js +13 -0
  120. package/dist/plugins/dropcontact/src/index.js +13 -18
  121. package/dist/plugins/egoi/src/credentials.js +19 -0
  122. package/dist/plugins/egoi/src/index.js +23 -38
  123. package/dist/plugins/elasticsearch/src/credentials.js +18 -0
  124. package/dist/plugins/elasticsearch/src/index.js +27 -48
  125. package/dist/plugins/elevenlabs/src/credentials.js +30 -0
  126. package/dist/plugins/elevenlabs/src/index.js +4 -1
  127. package/dist/plugins/elevenlabs/src/schemas.js +2 -1
  128. package/dist/plugins/elevenlabs/src/shared.js +74 -35
  129. package/dist/plugins/elevenlabs/src/workflows.js +2 -2
  130. package/dist/plugins/emelia/src/credentials.js +14 -0
  131. package/dist/plugins/emelia/src/index.js +19 -23
  132. package/dist/plugins/erpnext/src/credentials.js +27 -0
  133. package/dist/plugins/erpnext/src/index.js +21 -42
  134. package/dist/plugins/facebookGraph/src/credentials.js +20 -0
  135. package/dist/plugins/facebookGraph/src/index.js +39 -37
  136. package/dist/plugins/fal/src/credentials.js +14 -0
  137. package/dist/plugins/fal/src/index.js +4 -2
  138. package/dist/plugins/fal/src/shared.js +58 -63
  139. package/dist/plugins/freshdesk/src/credentials.js +20 -0
  140. package/dist/plugins/freshdesk/src/index.js +25 -46
  141. package/dist/plugins/freshservice/src/credentials.js +16 -0
  142. package/dist/plugins/freshservice/src/index.js +37 -58
  143. package/dist/plugins/freshworksCrm/src/credentials.js +16 -0
  144. package/dist/plugins/freshworksCrm/src/index.js +20 -39
  145. package/dist/plugins/getresponse/src/credentials.js +22 -0
  146. package/dist/plugins/getresponse/src/index.js +20 -32
  147. package/dist/plugins/gett/src/credentials.js +64 -0
  148. package/dist/plugins/gett/src/index.js +11 -6
  149. package/dist/plugins/gett/src/login.js +24 -0
  150. package/dist/plugins/gett/src/session.js +15 -38
  151. package/dist/plugins/gett/src/shared.js +41 -84
  152. package/dist/plugins/ghost/src/credentials.js +36 -0
  153. package/dist/plugins/ghost/src/index.js +18 -59
  154. package/dist/plugins/github/src/credentials.js +18 -0
  155. package/dist/plugins/github/src/index.js +55 -78
  156. package/dist/plugins/gitlab/src/credentials.js +24 -0
  157. package/dist/plugins/gitlab/src/index.js +29 -48
  158. package/dist/plugins/gmail/src/index.js +26 -24
  159. package/dist/plugins/gong/src/credentials.js +16 -0
  160. package/dist/plugins/gong/src/index.js +16 -32
  161. package/dist/plugins/googleAppsScript/src/index.js +108 -42
  162. package/dist/plugins/googleCalendar/src/index.js +15 -13
  163. package/dist/plugins/googleContacts/src/index.js +12 -9
  164. package/dist/plugins/googleDocs/src/index.js +2 -0
  165. package/dist/plugins/googleDocs/src/shared.js +2 -1
  166. package/dist/plugins/googleDrive/src/index.js +50 -53
  167. package/dist/plugins/googleImage/src/credentials.js +14 -0
  168. package/dist/plugins/googleImage/src/index.js +14 -25
  169. package/dist/plugins/googleSheets/src/index.js +26 -27
  170. package/dist/plugins/googleSlides/src/index.js +6 -4
  171. package/dist/plugins/googleTasks/src/index.js +13 -11
  172. package/dist/plugins/gotify/src/credentials.js +32 -0
  173. package/dist/plugins/gotify/src/index.js +14 -36
  174. package/dist/plugins/gotowebinar/src/credentials.js +13 -0
  175. package/dist/plugins/gotowebinar/src/index.js +52 -69
  176. package/dist/plugins/grafana/src/credentials.js +16 -0
  177. package/dist/plugins/grafana/src/index.js +34 -53
  178. package/dist/plugins/graphql/src/credentials.js +42 -0
  179. package/dist/plugins/graphql/src/index.js +21 -46
  180. package/dist/plugins/grist/src/credentials.js +30 -0
  181. package/dist/plugins/grist/src/index.js +14 -43
  182. package/dist/plugins/halopsa/src/credentials.js +56 -0
  183. package/dist/plugins/halopsa/src/index.js +20 -47
  184. package/dist/plugins/harvest/src/credentials.js +20 -0
  185. package/dist/plugins/harvest/src/index.js +24 -43
  186. package/dist/plugins/helpscout/src/credentials.js +13 -0
  187. package/dist/plugins/helpscout/src/index.js +26 -38
  188. package/dist/plugins/highlevel/src/credentials.js +19 -0
  189. package/dist/plugins/highlevel/src/index.js +34 -63
  190. package/dist/plugins/homeAssistant/src/credentials.js +27 -0
  191. package/dist/plugins/homeAssistant/src/index.js +34 -52
  192. package/dist/plugins/hubspot/src/credentials.js +16 -0
  193. package/dist/plugins/hubspot/src/index.js +29 -41
  194. package/dist/plugins/humanticAi/src/credentials.js +13 -0
  195. package/dist/plugins/humanticAi/src/index.js +15 -22
  196. package/dist/plugins/hunter/src/credentials.js +13 -0
  197. package/dist/plugins/hunter/src/index.js +18 -17
  198. package/dist/plugins/intercom/src/credentials.js +19 -0
  199. package/dist/plugins/intercom/src/index.js +25 -38
  200. package/dist/plugins/iterable/src/credentials.js +17 -0
  201. package/dist/plugins/iterable/src/index.js +26 -40
  202. package/dist/plugins/jenkins/src/credentials.js +16 -0
  203. package/dist/plugins/jenkins/src/index.js +22 -36
  204. package/dist/plugins/jira/src/credentials.js +16 -0
  205. package/dist/plugins/jira/src/index.js +35 -61
  206. package/dist/plugins/keap/src/credentials.js +19 -0
  207. package/dist/plugins/keap/src/index.js +43 -71
  208. package/dist/plugins/kobotoolbox/src/credentials.js +13 -0
  209. package/dist/plugins/kobotoolbox/src/index.js +46 -84
  210. package/dist/plugins/lemlist/src/credentials.js +19 -0
  211. package/dist/plugins/lemlist/src/index.js +35 -47
  212. package/dist/plugins/linear/src/attachments.js +7 -7
  213. package/dist/plugins/linear/src/comments.js +7 -7
  214. package/dist/plugins/linear/src/credentials.js +17 -0
  215. package/dist/plugins/linear/src/cycles.js +5 -5
  216. package/dist/plugins/linear/src/index.js +2 -0
  217. package/dist/plugins/linear/src/initiatives.js +6 -6
  218. package/dist/plugins/linear/src/issues.js +14 -14
  219. package/dist/plugins/linear/src/labels.js +6 -6
  220. package/dist/plugins/linear/src/organization.js +2 -2
  221. package/dist/plugins/linear/src/projects.js +12 -12
  222. package/dist/plugins/linear/src/shared.js +34 -32
  223. package/dist/plugins/linear/src/states.js +3 -3
  224. package/dist/plugins/linear/src/teams.js +4 -4
  225. package/dist/plugins/linear/src/users.js +3 -3
  226. package/dist/plugins/linear/src/views.js +5 -5
  227. package/dist/plugins/linear/src/webhooks.js +5 -5
  228. package/dist/plugins/lingvanex/src/credentials.js +13 -0
  229. package/dist/plugins/lingvanex/src/index.js +7 -9
  230. package/dist/plugins/linkedin/src/credentials.js +17 -0
  231. package/dist/plugins/linkedin/src/index.js +13 -17
  232. package/dist/plugins/lonescale/src/credentials.js +13 -0
  233. package/dist/plugins/lonescale/src/index.js +16 -26
  234. package/dist/plugins/magento/src/credentials.js +16 -0
  235. package/dist/plugins/magento/src/index.js +67 -84
  236. package/dist/plugins/mailcheck/src/credentials.js +17 -0
  237. package/dist/plugins/mailcheck/src/index.js +7 -9
  238. package/dist/plugins/mailchimp/src/credentials.js +32 -0
  239. package/dist/plugins/mailchimp/src/index.js +36 -44
  240. package/dist/plugins/mailerlite/src/credentials.js +13 -0
  241. package/dist/plugins/mailerlite/src/index.js +19 -32
  242. package/dist/plugins/mailgun/src/credentials.js +21 -0
  243. package/dist/plugins/mailgun/src/index.js +15 -21
  244. package/dist/plugins/mailjet/src/credentials.js +38 -0
  245. package/dist/plugins/mailjet/src/index.js +60 -115
  246. package/dist/plugins/mandrill/src/credentials.js +17 -0
  247. package/dist/plugins/mandrill/src/index.js +11 -12
  248. package/dist/plugins/marketstack/src/credentials.js +16 -0
  249. package/dist/plugins/marketstack/src/index.js +18 -28
  250. package/dist/plugins/matrix/src/credentials.js +19 -0
  251. package/dist/plugins/matrix/src/index.js +23 -52
  252. package/dist/plugins/mattermost/src/credentials.js +19 -0
  253. package/dist/plugins/mattermost/src/index.js +41 -73
  254. package/dist/plugins/mautic/src/credentials.js +16 -0
  255. package/dist/plugins/mautic/src/index.js +46 -62
  256. package/dist/plugins/medium/src/credentials.js +20 -0
  257. package/dist/plugins/medium/src/index.js +18 -23
  258. package/dist/plugins/messagebird/src/credentials.js +22 -0
  259. package/dist/plugins/messagebird/src/index.js +13 -18
  260. package/dist/plugins/metabase/src/credentials.js +19 -0
  261. package/dist/plugins/metabase/src/index.js +24 -40
  262. package/dist/plugins/microsoftCalendar/src/index.js +48 -12
  263. package/dist/plugins/microsoftFiles/src/index.js +90 -25
  264. package/dist/plugins/microsoftMail/src/index.js +62 -15
  265. package/dist/plugins/misp/src/credentials.js +16 -0
  266. package/dist/plugins/misp/src/index.js +60 -71
  267. package/dist/plugins/mocean/src/credentials.js +17 -0
  268. package/dist/plugins/mocean/src/index.js +11 -23
  269. package/dist/plugins/monday/src/credentials.js +14 -0
  270. package/dist/plugins/monday/src/index.js +31 -44
  271. package/dist/plugins/monicaCrm/src/credentials.js +19 -0
  272. package/dist/plugins/monicaCrm/src/index.js +25 -42
  273. package/dist/plugins/msg91/src/credentials.js +10 -0
  274. package/dist/plugins/msg91/src/index.js +15 -11
  275. package/dist/plugins/nasa/src/credentials.js +22 -0
  276. package/dist/plugins/nasa/src/index.js +24 -28
  277. package/dist/plugins/netlify/src/credentials.js +19 -0
  278. package/dist/plugins/netlify/src/index.js +27 -51
  279. package/dist/plugins/netscalerAdc/src/credentials.js +18 -0
  280. package/dist/plugins/netscalerAdc/src/index.js +16 -31
  281. package/dist/plugins/nextcloud/src/credentials.js +27 -0
  282. package/dist/plugins/nextcloud/src/index.js +55 -109
  283. package/dist/plugins/nocodb/src/credentials.js +16 -0
  284. package/dist/plugins/nocodb/src/index.js +19 -37
  285. package/dist/plugins/notion/src/credentials.js +21 -0
  286. package/dist/plugins/notion/src/index.js +25 -38
  287. package/dist/plugins/npm/src/credentials.js +19 -0
  288. package/dist/plugins/npm/src/index.js +22 -32
  289. package/dist/plugins/odoo/src/credentials.js +21 -0
  290. package/dist/plugins/odoo/src/index.js +53 -69
  291. package/dist/plugins/okta/src/credentials.js +23 -0
  292. package/dist/plugins/okta/src/index.js +30 -35
  293. package/dist/plugins/oneSimpleApi/src/credentials.js +16 -0
  294. package/dist/plugins/oneSimpleApi/src/index.js +19 -24
  295. package/dist/plugins/onfleet/src/credentials.js +23 -0
  296. package/dist/plugins/onfleet/src/index.js +42 -53
  297. package/dist/plugins/openai/src/credentials.js +13 -0
  298. package/dist/plugins/openai/src/index.js +15 -23
  299. package/dist/plugins/openweathermap/src/credentials.js +16 -0
  300. package/dist/plugins/openweathermap/src/index.js +22 -22
  301. package/dist/plugins/oura/src/credentials.js +19 -0
  302. package/dist/plugins/oura/src/index.js +13 -18
  303. package/dist/plugins/paddle/src/credentials.js +27 -0
  304. package/dist/plugins/paddle/src/index.js +20 -36
  305. package/dist/plugins/pagerduty/src/credentials.js +24 -0
  306. package/dist/plugins/pagerduty/src/index.js +30 -39
  307. package/dist/plugins/parallel/src/credentials.js +18 -0
  308. package/dist/plugins/parallel/src/index.js +16 -22
  309. package/dist/plugins/paypal/src/credentials.js +44 -0
  310. package/dist/plugins/paypal/src/index.js +14 -40
  311. package/dist/plugins/peekalink/src/credentials.js +16 -0
  312. package/dist/plugins/peekalink/src/index.js +10 -11
  313. package/dist/plugins/phantombuster/src/credentials.js +19 -0
  314. package/dist/plugins/phantombuster/src/index.js +19 -32
  315. package/dist/plugins/philipsHue/src/credentials.js +17 -0
  316. package/dist/plugins/philipsHue/src/index.js +15 -27
  317. package/dist/plugins/pipedrive/src/credentials.js +26 -0
  318. package/dist/plugins/pipedrive/src/index.js +43 -73
  319. package/dist/plugins/plaud/src/index.js +2 -1
  320. package/dist/plugins/plaud/src/shared.js +23 -19
  321. package/dist/plugins/plivo/src/credentials.js +20 -0
  322. package/dist/plugins/plivo/src/index.js +13 -19
  323. package/dist/plugins/posthog/src/credentials.js +18 -0
  324. package/dist/plugins/posthog/src/index.js +14 -20
  325. package/dist/plugins/profitwell/src/credentials.js +22 -0
  326. package/dist/plugins/profitwell/src/index.js +10 -17
  327. package/dist/plugins/pushbullet/src/credentials.js +19 -0
  328. package/dist/plugins/pushbullet/src/index.js +19 -27
  329. package/dist/plugins/pushcut/src/credentials.js +19 -0
  330. package/dist/plugins/pushcut/src/index.js +7 -8
  331. package/dist/plugins/pushover/src/credentials.js +14 -0
  332. package/dist/plugins/pushover/src/index.js +7 -12
  333. package/dist/plugins/quickbase/src/credentials.js +15 -0
  334. package/dist/plugins/quickbase/src/index.js +24 -34
  335. package/dist/plugins/quickbooks/src/credentials.js +22 -0
  336. package/dist/plugins/quickbooks/src/index.js +17 -46
  337. package/dist/plugins/raindrop/src/credentials.js +19 -0
  338. package/dist/plugins/raindrop/src/index.js +30 -32
  339. package/dist/plugins/recraft/src/credentials.js +13 -0
  340. package/dist/plugins/recraft/src/index.js +38 -27
  341. package/dist/plugins/reddit/src/credentials.js +26 -0
  342. package/dist/plugins/reddit/src/index.js +30 -34
  343. package/dist/plugins/replicate/src/credentials.js +23 -0
  344. package/dist/plugins/replicate/src/index.js +17 -27
  345. package/dist/plugins/rocketchat/src/credentials.js +17 -0
  346. package/dist/plugins/rocketchat/src/index.js +8 -19
  347. package/dist/plugins/rundeck/src/credentials.js +16 -0
  348. package/dist/plugins/rundeck/src/index.js +12 -28
  349. package/dist/plugins/salesforce/src/credentials.js +73 -0
  350. package/dist/plugins/salesforce/src/index.js +6 -0
  351. package/dist/plugins/salesforce/src/metadata.js +3 -16
  352. package/dist/plugins/salesforce/src/shared.js +25 -100
  353. package/dist/plugins/salesforce/src/sobjects.js +10 -9
  354. package/dist/plugins/salesmate/src/credentials.js +17 -0
  355. package/dist/plugins/salesmate/src/index.js +20 -37
  356. package/dist/plugins/securityScorecard/src/credentials.js +22 -0
  357. package/dist/plugins/securityScorecard/src/index.js +24 -37
  358. package/dist/plugins/segment/src/credentials.js +16 -0
  359. package/dist/plugins/segment/src/index.js +12 -16
  360. package/dist/plugins/sendgrid/src/credentials.js +13 -0
  361. package/dist/plugins/sendgrid/src/index.js +31 -35
  362. package/dist/plugins/sendy/src/credentials.js +18 -0
  363. package/dist/plugins/sendy/src/index.js +18 -24
  364. package/dist/plugins/sentry/src/credentials.js +16 -0
  365. package/dist/plugins/sentry/src/index.js +30 -98
  366. package/dist/plugins/servicenow/src/credentials.js +13 -0
  367. package/dist/plugins/servicenow/src/index.js +22 -41
  368. package/dist/plugins/shiftAtlas/src/graph.js +2 -2
  369. package/dist/plugins/shiftAtlas/src/index.js +2 -0
  370. package/dist/plugins/shiftAtlas/src/shared.js +3 -1
  371. package/dist/plugins/shiftBwm/src/index.js +4 -2
  372. package/dist/plugins/shiftBwm/src/shared.js +41 -16
  373. package/dist/plugins/shiftCrm/src/access.js +2 -2
  374. package/dist/plugins/shiftCrm/src/accounts.js +3 -3
  375. package/dist/plugins/shiftCrm/src/activities.js +3 -3
  376. package/dist/plugins/shiftCrm/src/credentials.js +6 -0
  377. package/dist/plugins/shiftCrm/src/index.js +2 -0
  378. package/dist/plugins/shiftCrm/src/opportunities.js +3 -3
  379. package/dist/plugins/shiftCrm/src/people.js +3 -3
  380. package/dist/plugins/shiftCrm/src/records.js +2 -2
  381. package/dist/plugins/shiftCrm/src/shared.js +2 -1
  382. package/dist/plugins/shiftCrm/src/tasks.js +3 -3
  383. package/dist/plugins/shiftObjects/src/credentials.js +2 -0
  384. package/dist/plugins/shiftObjects/src/index.js +2 -0
  385. package/dist/plugins/shiftObjects/src/objects.js +3 -2
  386. package/dist/plugins/shiftOcr/src/credentials.js +8 -0
  387. package/dist/plugins/shiftOcr/src/index.js +6 -5
  388. package/dist/plugins/shiftPages/src/index.js +2 -0
  389. package/dist/plugins/shiftPages/src/pages.js +5 -3
  390. package/dist/plugins/shiftPages/src/shared.js +3 -1
  391. package/dist/plugins/shiftTranscription/src/index.js +2 -0
  392. package/dist/plugins/shiftTranscription/src/shared.js +11 -1
  393. package/dist/plugins/shiftTranscription/src/transcription.js +4 -4
  394. package/dist/plugins/shiftWork/src/index.js +2 -0
  395. package/dist/plugins/shiftWork/src/issue-views.js +5 -5
  396. package/dist/plugins/shiftWork/src/issues.js +11 -7
  397. package/dist/plugins/shiftWork/src/projects.js +3 -3
  398. package/dist/plugins/shiftWork/src/shared.js +3 -1
  399. package/dist/plugins/shopify/src/credentials.js +16 -0
  400. package/dist/plugins/shopify/src/index.js +32 -59
  401. package/dist/plugins/signl4/src/credentials.js +17 -0
  402. package/dist/plugins/signl4/src/index.js +28 -29
  403. package/dist/plugins/slack/src/credentials.js +19 -0
  404. package/dist/plugins/slack/src/index.js +51 -60
  405. package/dist/plugins/sms77/src/credentials.js +17 -0
  406. package/dist/plugins/sms77/src/index.js +11 -16
  407. package/dist/plugins/splunk/src/credentials.js +19 -0
  408. package/dist/plugins/splunk/src/index.js +32 -74
  409. package/dist/plugins/spotify/src/credentials.js +19 -0
  410. package/dist/plugins/spotify/src/index.js +40 -55
  411. package/dist/plugins/stackby/src/credentials.js +13 -0
  412. package/dist/plugins/stackby/src/index.js +14 -23
  413. package/dist/plugins/steel/src/auth.js +27 -0
  414. package/dist/plugins/steel/src/browser.js +4 -3
  415. package/dist/plugins/steel/src/captchas.js +4 -3
  416. package/dist/plugins/steel/src/extensions.js +3 -2
  417. package/dist/plugins/steel/src/files.js +9 -10
  418. package/dist/plugins/steel/src/index.js +2 -0
  419. package/dist/plugins/steel/src/page/tools.js +3 -3
  420. package/dist/plugins/steel/src/profiles.js +4 -3
  421. package/dist/plugins/steel/src/sessions.js +13 -13
  422. package/dist/plugins/steel/src/shared.js +21 -51
  423. package/dist/plugins/storyblok/src/credentials.js +37 -0
  424. package/dist/plugins/storyblok/src/index.js +22 -66
  425. package/dist/plugins/strapi/src/credentials.js +71 -0
  426. package/dist/plugins/strapi/src/index.js +36 -70
  427. package/dist/plugins/strava/src/credentials.js +19 -0
  428. package/dist/plugins/strava/src/index.js +16 -33
  429. package/dist/plugins/stripe/src/credentials.js +19 -0
  430. package/dist/plugins/stripe/src/index.js +44 -58
  431. package/dist/plugins/supabase/src/credentials.js +30 -0
  432. package/dist/plugins/supabase/src/index.js +18 -40
  433. package/dist/plugins/syncromsp/src/credentials.js +16 -0
  434. package/dist/plugins/syncromsp/src/index.js +37 -70
  435. package/dist/plugins/tapfiliate/src/credentials.js +13 -0
  436. package/dist/plugins/tapfiliate/src/index.js +21 -31
  437. package/dist/plugins/telegram/src/credentials.js +20 -0
  438. package/dist/plugins/telegram/src/index.js +31 -39
  439. package/dist/plugins/thehive/src/credentials.js +14 -0
  440. package/dist/plugins/thehive/src/index.js +33 -50
  441. package/dist/plugins/thehiveProject/src/credentials.js +16 -0
  442. package/dist/plugins/thehiveProject/src/index.js +53 -122
  443. package/dist/plugins/todoist/src/credentials.js +26 -0
  444. package/dist/plugins/todoist/src/index.js +49 -79
  445. package/dist/plugins/together/src/credentials.js +16 -0
  446. package/dist/plugins/together/src/index.js +30 -32
  447. package/dist/plugins/travisci/src/credentials.js +24 -0
  448. package/dist/plugins/travisci/src/index.js +16 -30
  449. package/dist/plugins/trello/src/credentials.js +29 -0
  450. package/dist/plugins/trello/src/index.js +49 -64
  451. package/dist/plugins/twake/src/credentials.js +16 -0
  452. package/dist/plugins/twake/src/index.js +8 -10
  453. package/dist/plugins/twilio/src/credentials.js +23 -0
  454. package/dist/plugins/twilio/src/index.js +12 -26
  455. package/dist/plugins/twist/src/credentials.js +13 -0
  456. package/dist/plugins/twist/src/index.js +32 -44
  457. package/dist/plugins/twitter/src/credentials.js +16 -0
  458. package/dist/plugins/twitter/src/index.js +25 -37
  459. package/dist/plugins/typesafe/src/credentials.js +28 -0
  460. package/dist/plugins/typesafe/src/index.js +3 -1
  461. package/dist/plugins/typesafe/src/shared.js +23 -35
  462. package/dist/plugins/unleashedSoftware/src/credentials.js +21 -0
  463. package/dist/plugins/unleashedSoftware/src/index.js +13 -37
  464. package/dist/plugins/uplead/src/credentials.js +16 -0
  465. package/dist/plugins/uplead/src/index.js +11 -16
  466. package/dist/plugins/uproc/src/credentials.js +14 -0
  467. package/dist/plugins/uproc/src/index.js +7 -10
  468. package/dist/plugins/uptimerobot/src/credentials.js +14 -0
  469. package/dist/plugins/uptimerobot/src/index.js +28 -39
  470. package/dist/plugins/urlscanio/src/credentials.js +13 -0
  471. package/dist/plugins/urlscanio/src/index.js +13 -22
  472. package/dist/plugins/vercel/src/credentials.js +19 -0
  473. package/dist/plugins/vercel/src/deployments.js +27 -11
  474. package/dist/plugins/vercel/src/env.js +31 -12
  475. package/dist/plugins/vercel/src/index.js +2 -0
  476. package/dist/plugins/vercel/src/projects.js +6 -3
  477. package/dist/plugins/vercel/src/shared.js +32 -37
  478. package/dist/plugins/vero/src/credentials.js +17 -0
  479. package/dist/plugins/vero/src/index.js +18 -21
  480. package/dist/plugins/vonage/src/credentials.js +17 -0
  481. package/dist/plugins/vonage/src/index.js +14 -18
  482. package/dist/plugins/wekan/src/credentials.js +16 -0
  483. package/dist/plugins/wekan/src/index.js +33 -46
  484. package/dist/plugins/wolt/src/account.js +6 -0
  485. package/dist/plugins/wolt/src/catalog.js +2 -2
  486. package/dist/plugins/wolt/src/credentials.js +64 -0
  487. package/dist/plugins/wolt/src/index.js +8 -3
  488. package/dist/plugins/wolt/src/orders.js +2 -2
  489. package/dist/plugins/wolt/src/public.js +91 -0
  490. package/dist/plugins/wolt/src/shared.js +49 -158
  491. package/dist/plugins/woocommerce/src/credentials.js +16 -0
  492. package/dist/plugins/woocommerce/src/index.js +19 -37
  493. package/dist/plugins/wordpress/src/credentials.js +16 -0
  494. package/dist/plugins/wordpress/src/index.js +23 -42
  495. package/dist/plugins/xai/src/credentials.js +13 -0
  496. package/dist/plugins/xai/src/index.js +31 -30
  497. package/dist/plugins/xero/src/credentials.js +17 -0
  498. package/dist/plugins/xero/src/index.js +19 -36
  499. package/dist/plugins/yourls/src/credentials.js +17 -0
  500. package/dist/plugins/yourls/src/index.js +13 -23
  501. package/dist/plugins/zammad/src/credentials.js +15 -0
  502. package/dist/plugins/zammad/src/index.js +27 -47
  503. package/dist/plugins/zendesk/src/credentials.js +26 -0
  504. package/dist/plugins/zendesk/src/index.js +29 -48
  505. package/dist/plugins/zoho/src/credentials.js +17 -0
  506. package/dist/plugins/zoho/src/index.js +18 -38
  507. package/dist/plugins/zoom/src/credentials.js +19 -0
  508. package/dist/plugins/zoom/src/index.js +15 -30
  509. package/dist/plugins/zulip/src/credentials.js +16 -0
  510. package/dist/plugins/zulip/src/index.js +36 -42
  511. package/dist/sdk.d.ts +8 -0
  512. package/dist/sdk.js +3 -0
  513. package/package.json +1 -1
  514. package/dist/plugins/_shared/authedFetch.js +0 -33
  515. package/dist/plugins/_shared/tokenRefresh.js +0 -41
@@ -1,28 +1,19 @@
1
- function getConn(ctx) {
2
- const c = ctx.connection.config;
3
- return {
4
- url: c.url.replace(/\/$/, ""),
5
- apiKey: c.apiKey,
6
- };
7
- }
8
- async function apiRequest(conn, endpoint, body) {
9
- body.api_key = conn.apiKey;
10
- body.boolean = true;
11
- const formBody = Object.entries(body)
12
- .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
13
- .join("&");
14
- const res = await fetch(`${conn.url}${endpoint}`, {
1
+ import { credentialOk } from "../../_shared/credentials.js";
2
+ import { sendyCredential } from "./credentials.js";
3
+ /** A Sendy form call; Sendy answers in plain text, `boolean` asking for 1 on success. */
4
+ async function apiRequest(ctx, endpoint, body) {
5
+ const res = await credentialOk(ctx, sendyCredential, "sendy", {
6
+ target: "api",
7
+ path: endpoint,
15
8
  method: "POST",
16
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
17
- body: formBody,
9
+ form: { ...body, boolean: true },
18
10
  });
19
- if (!res.ok)
20
- throw new Error(`Sendy error ${res.status}: ${await res.text()}`);
21
11
  return res.text();
22
12
  }
23
13
  export default function sendy(rl) {
24
14
  rl.setName("sendy");
25
15
  rl.setVersion("0.1.0");
16
+ rl.setCredential(sendyCredential);
26
17
  rl.setConnectionSchema({
27
18
  url: {
28
19
  type: "string",
@@ -91,7 +82,7 @@ export default function sendy(rl) {
91
82
  body.track_opens = p.trackOpens ? 1 : 0;
92
83
  if (p.trackClicks !== undefined)
93
84
  body.track_clicks = p.trackClicks ? 1 : 0;
94
- const resp = await apiRequest(getConn(ctx), "/api/campaigns/create.php", body);
85
+ const resp = await apiRequest(ctx, "api/campaigns/create.php", body);
95
86
  if (resp.includes("Campaign created"))
96
87
  return { message: resp };
97
88
  throw new Error(`Sendy campaign error: ${resp}`);
@@ -110,7 +101,7 @@ export default function sendy(rl) {
110
101
  const body = { email: p.email, list: p.listId };
111
102
  if (p.name)
112
103
  body.name = p.name;
113
- const resp = await apiRequest(getConn(ctx), "/subscribe", body);
104
+ const resp = await apiRequest(ctx, "subscribe", body);
114
105
  if (resp === "1")
115
106
  return { success: true };
116
107
  throw new Error(`Sendy subscribe error: ${resp}`);
@@ -122,7 +113,7 @@ export default function sendy(rl) {
122
113
  inputSchema: { listId: { type: "string", required: true } },
123
114
  async execute(input, ctx) {
124
115
  const { listId } = input;
125
- const resp = await apiRequest(getConn(ctx), "/api/subscribers/active-subscriber-count.php", { list_id: listId });
116
+ const resp = await apiRequest(ctx, "api/subscribers/active-subscriber-count.php", { list_id: listId });
126
117
  if (/^\d+$/.test(resp))
127
118
  return { count: parseInt(resp, 10) };
128
119
  throw new Error(`Sendy count error: ${resp}`);
@@ -137,7 +128,10 @@ export default function sendy(rl) {
137
128
  },
138
129
  async execute(input, ctx) {
139
130
  const { email, listId } = input;
140
- const resp = await apiRequest(getConn(ctx), "/api/subscribers/delete.php", { email, list_id: listId });
131
+ const resp = await apiRequest(ctx, "api/subscribers/delete.php", {
132
+ email,
133
+ list_id: listId,
134
+ });
141
135
  if (resp === "1")
142
136
  return { success: true };
143
137
  throw new Error(`Sendy delete error: ${resp}`);
@@ -152,7 +146,7 @@ export default function sendy(rl) {
152
146
  },
153
147
  async execute(input, ctx) {
154
148
  const { email, listId } = input;
155
- const resp = await apiRequest(getConn(ctx), "/unsubscribe", {
149
+ const resp = await apiRequest(ctx, "unsubscribe", {
156
150
  email,
157
151
  list: listId,
158
152
  });
@@ -170,7 +164,7 @@ export default function sendy(rl) {
170
164
  },
171
165
  async execute(input, ctx) {
172
166
  const { email, listId } = input;
173
- const resp = await apiRequest(getConn(ctx), "/api/subscribers/subscription-status.php", { email, list_id: listId });
167
+ const resp = await apiRequest(ctx, "api/subscribers/subscription-status.php", { email, list_id: listId });
174
168
  const valid = [
175
169
  "Subscribed",
176
170
  "Unsubscribed",
@@ -0,0 +1,16 @@
1
+ import { httpsBase, staticCredential } from "../../_shared/credentials.js";
2
+ /**
3
+ * An auth token, sent as a bearer beneath /api/0/ of sentry.io or the
4
+ * connection's own self-hosted instance.
5
+ */
6
+ export const sentryCredential = staticCredential({
7
+ id: "sentry",
8
+ auth: { kind: "bearer" },
9
+ local: { secret: "token" },
10
+ targets: (config) => ({
11
+ api: {
12
+ baseUrl: httpsBase(config.url ?? "https://sentry.io", "api/0/"),
13
+ methods: ["GET", "POST", "PUT", "DELETE"],
14
+ },
15
+ }),
16
+ });
@@ -1,86 +1,18 @@
1
- function getConn(ctx) {
2
- const c = ctx.connection.config;
3
- const base = (c.url ?? "https://sentry.io").replace(/\/$/, "");
4
- return { base, token: c.token };
5
- }
6
- async function apiRequest(conn, method, endpoint, body, qs) {
7
- const url = new URL(`${conn.base}${endpoint}`);
8
- if (qs) {
9
- for (const [k, v] of Object.entries(qs)) {
10
- if (v !== undefined && v !== null)
11
- url.searchParams.set(k, String(v));
12
- }
13
- }
14
- const init = {
1
+ import { credentialJson, pathSegment } from "../../_shared/credentials.js";
2
+ import { sentryCredential } from "./credentials.js";
3
+ async function apiRequest(ctx, method, path, body, qs) {
4
+ return credentialJson(ctx, sentryCredential, "sentry", {
5
+ target: "api",
6
+ path,
15
7
  method,
16
- headers: {
17
- Authorization: `Bearer ${conn.token}`,
18
- "Content-Type": "application/json",
19
- },
20
- };
21
- if (body && Object.keys(body).length > 0)
22
- init.body = JSON.stringify(body);
23
- const res = await fetch(url.toString(), init);
24
- if (!res.ok)
25
- throw new Error(`Sentry error ${res.status}: ${await res.text()}`);
26
- const text = await res.text();
27
- return text ? JSON.parse(text) : {};
28
- }
29
- function registerCrud(rl, resource, basePath, idField, extraCreateFields) {
30
- rl.registerAction(`${resource}.get`, {
31
- access: "read",
32
- description: `Get a ${resource} by ${idField}`,
33
- inputSchema: {
34
- [idField]: { type: "string", required: true },
35
- org: { type: "string", required: true, description: "Organization slug" },
36
- },
37
- async execute(input, ctx) {
38
- const p = input;
39
- return apiRequest(getConn(ctx), "GET", `${basePath(p)}${p[idField]}/`);
40
- },
41
- });
42
- rl.registerAction(`${resource}.list`, {
43
- access: "read",
44
- description: `List ${resource}s`,
45
- inputSchema: {
46
- org: { type: "string", required: true },
47
- limit: { type: "number", required: false },
48
- ...(resource === "event" || resource === "issue"
49
- ? {
50
- project: {
51
- type: "string",
52
- required: true,
53
- description: "Project slug",
54
- },
55
- }
56
- : {}),
57
- },
58
- async execute(input, ctx) {
59
- const p = (input ?? {});
60
- const qs = {};
61
- if (p.limit)
62
- qs.limit = p.limit;
63
- const data = (await apiRequest(getConn(ctx), "GET", basePath(p), undefined, qs));
64
- return data;
65
- },
66
- });
67
- rl.registerAction(`${resource}.delete`, {
68
- access: "write",
69
- description: `Delete a ${resource}`,
70
- inputSchema: {
71
- [idField]: { type: "string", required: true },
72
- org: { type: "string", required: true },
73
- },
74
- async execute(input, ctx) {
75
- const p = input;
76
- await apiRequest(getConn(ctx), "DELETE", `${basePath(p)}${p[idField]}/`);
77
- return { success: true };
78
- },
8
+ query: qs,
9
+ ...(body && Object.keys(body).length > 0 ? { json: body } : {}),
79
10
  });
80
11
  }
81
12
  export default function sentry(rl) {
82
13
  rl.setName("sentry");
83
14
  rl.setVersion("0.1.0");
15
+ rl.setCredential(sentryCredential);
84
16
  rl.setConnectionSchema({
85
17
  token: {
86
18
  type: "string",
@@ -106,7 +38,7 @@ export default function sentry(rl) {
106
38
  },
107
39
  async execute(input, ctx) {
108
40
  const p = input;
109
- return apiRequest(getConn(ctx), "GET", `/api/0/projects/${p.org}/${p.project}/events/${p.eventId}/`);
41
+ return apiRequest(ctx, "GET", `projects/${pathSegment(p.org)}/${pathSegment(p.project)}/events/${pathSegment(p.eventId)}/`);
110
42
  },
111
43
  });
112
44
  rl.registerAction("event.list", {
@@ -125,7 +57,7 @@ export default function sentry(rl) {
125
57
  qs.full = "true";
126
58
  if (p.limit)
127
59
  qs.limit = p.limit;
128
- return apiRequest(getConn(ctx), "GET", `/api/0/projects/${p.org}/${p.project}/events/`, undefined, qs);
60
+ return apiRequest(ctx, "GET", `projects/${pathSegment(p.org)}/${pathSegment(p.project)}/events/`, undefined, qs);
129
61
  },
130
62
  });
131
63
  // ── Issue ───────────────────────────────────────────
@@ -134,7 +66,7 @@ export default function sentry(rl) {
134
66
  description: "Get an issue by ID",
135
67
  inputSchema: { issueId: { type: "string", required: true } },
136
68
  async execute(input, ctx) {
137
- return apiRequest(getConn(ctx), "GET", `/api/0/issues/${input.issueId}/`);
69
+ return apiRequest(ctx, "GET", `issues/${pathSegment(input.issueId)}/`);
138
70
  },
139
71
  });
140
72
  rl.registerAction("issue.list", {
@@ -153,7 +85,7 @@ export default function sentry(rl) {
153
85
  qs.query = p.query;
154
86
  if (p.limit)
155
87
  qs.limit = p.limit;
156
- return apiRequest(getConn(ctx), "GET", `/api/0/projects/${p.org}/${p.project}/issues/`, undefined, qs);
88
+ return apiRequest(ctx, "GET", `projects/${pathSegment(p.org)}/${pathSegment(p.project)}/issues/`, undefined, qs);
157
89
  },
158
90
  });
159
91
  rl.registerAction("issue.update", {
@@ -168,7 +100,7 @@ export default function sentry(rl) {
168
100
  },
169
101
  async execute(input, ctx) {
170
102
  const { issueId, ...fields } = input;
171
- return apiRequest(getConn(ctx), "PUT", `/api/0/issues/${issueId}/`, fields);
103
+ return apiRequest(ctx, "PUT", `issues/${pathSegment(issueId)}/`, fields);
172
104
  },
173
105
  });
174
106
  rl.registerAction("issue.delete", {
@@ -176,7 +108,7 @@ export default function sentry(rl) {
176
108
  description: "Delete an issue",
177
109
  inputSchema: { issueId: { type: "string", required: true } },
178
110
  async execute(input, ctx) {
179
- await apiRequest(getConn(ctx), "DELETE", `/api/0/issues/${input.issueId}/`);
111
+ await apiRequest(ctx, "DELETE", `issues/${pathSegment(input.issueId)}/`);
180
112
  return { success: true };
181
113
  },
182
114
  });
@@ -186,7 +118,7 @@ export default function sentry(rl) {
186
118
  description: "Get an organization",
187
119
  inputSchema: { org: { type: "string", required: true } },
188
120
  async execute(input, ctx) {
189
- return apiRequest(getConn(ctx), "GET", `/api/0/organizations/${input.org}/`);
121
+ return apiRequest(ctx, "GET", `organizations/${pathSegment(input.org)}/`);
190
122
  },
191
123
  });
192
124
  rl.registerAction("organization.list", {
@@ -197,7 +129,7 @@ export default function sentry(rl) {
197
129
  const qs = {};
198
130
  if (input?.limit)
199
131
  qs.limit = input.limit;
200
- return apiRequest(getConn(ctx), "GET", "/api/0/organizations/", undefined, qs);
132
+ return apiRequest(ctx, "GET", "organizations/", undefined, qs);
201
133
  },
202
134
  });
203
135
  rl.registerAction("organization.create", {
@@ -209,7 +141,7 @@ export default function sentry(rl) {
209
141
  },
210
142
  async execute(input, ctx) {
211
143
  const p = input;
212
- return apiRequest(getConn(ctx), "POST", "/api/0/organizations/", {
144
+ return apiRequest(ctx, "POST", "organizations/", {
213
145
  name: p.name,
214
146
  agreeTerms: true,
215
147
  slug: p.slug,
@@ -226,7 +158,7 @@ export default function sentry(rl) {
226
158
  },
227
159
  async execute(input, ctx) {
228
160
  const p = input;
229
- return apiRequest(getConn(ctx), "GET", `/api/0/projects/${p.org}/${p.project}/`);
161
+ return apiRequest(ctx, "GET", `projects/${pathSegment(p.org)}/${pathSegment(p.project)}/`);
230
162
  },
231
163
  });
232
164
  rl.registerAction("project.list", {
@@ -234,7 +166,7 @@ export default function sentry(rl) {
234
166
  description: "List all projects",
235
167
  inputSchema: { limit: { type: "number", required: false } },
236
168
  async execute(input, ctx) {
237
- return apiRequest(getConn(ctx), "GET", "/api/0/projects/", undefined, input?.limit
169
+ return apiRequest(ctx, "GET", "projects/", undefined, input?.limit
238
170
  ? { limit: input.limit }
239
171
  : undefined);
240
172
  },
@@ -256,7 +188,7 @@ export default function sentry(rl) {
256
188
  body.slug = p.slug;
257
189
  if (p.platform)
258
190
  body.platform = p.platform;
259
- return apiRequest(getConn(ctx), "POST", `/api/0/teams/${p.org}/${p.team}/projects/`, body);
191
+ return apiRequest(ctx, "POST", `teams/${pathSegment(p.org)}/${pathSegment(p.team)}/projects/`, body);
260
192
  },
261
193
  });
262
194
  rl.registerAction("project.delete", {
@@ -268,7 +200,7 @@ export default function sentry(rl) {
268
200
  },
269
201
  async execute(input, ctx) {
270
202
  const p = input;
271
- await apiRequest(getConn(ctx), "DELETE", `/api/0/projects/${p.org}/${p.project}/`);
203
+ await apiRequest(ctx, "DELETE", `projects/${pathSegment(p.org)}/${pathSegment(p.project)}/`);
272
204
  return { success: true };
273
205
  },
274
206
  });
@@ -282,7 +214,7 @@ export default function sentry(rl) {
282
214
  },
283
215
  async execute(input, ctx) {
284
216
  const p = input;
285
- return apiRequest(getConn(ctx), "GET", `/api/0/organizations/${p.org}/releases/${encodeURIComponent(p.version)}/`);
217
+ return apiRequest(ctx, "GET", `organizations/${pathSegment(p.org)}/releases/${pathSegment(p.version)}/`);
286
218
  },
287
219
  });
288
220
  rl.registerAction("release.list", {
@@ -300,7 +232,7 @@ export default function sentry(rl) {
300
232
  qs.query = p.query;
301
233
  if (p.limit)
302
234
  qs.limit = p.limit;
303
- return apiRequest(getConn(ctx), "GET", `/api/0/organizations/${p.org}/releases/`, undefined, qs);
235
+ return apiRequest(ctx, "GET", `organizations/${pathSegment(p.org)}/releases/`, undefined, qs);
304
236
  },
305
237
  });
306
238
  rl.registerAction("release.create", {
@@ -324,7 +256,7 @@ export default function sentry(rl) {
324
256
  };
325
257
  if (p.url)
326
258
  body.url = p.url;
327
- return apiRequest(getConn(ctx), "POST", `/api/0/organizations/${p.org}/releases/`, body);
259
+ return apiRequest(ctx, "POST", `organizations/${pathSegment(p.org)}/releases/`, body);
328
260
  },
329
261
  });
330
262
  rl.registerAction("release.delete", {
@@ -336,7 +268,7 @@ export default function sentry(rl) {
336
268
  },
337
269
  async execute(input, ctx) {
338
270
  const p = input;
339
- await apiRequest(getConn(ctx), "DELETE", `/api/0/organizations/${p.org}/releases/${encodeURIComponent(p.version)}/`);
271
+ await apiRequest(ctx, "DELETE", `organizations/${pathSegment(p.org)}/releases/${pathSegment(p.version)}/`);
340
272
  return { success: true };
341
273
  },
342
274
  });
@@ -350,7 +282,7 @@ export default function sentry(rl) {
350
282
  },
351
283
  async execute(input, ctx) {
352
284
  const p = input;
353
- return apiRequest(getConn(ctx), "GET", `/api/0/teams/${p.org}/${p.team}/`);
285
+ return apiRequest(ctx, "GET", `teams/${pathSegment(p.org)}/${pathSegment(p.team)}/`);
354
286
  },
355
287
  });
356
288
  rl.registerAction("team.list", {
@@ -362,7 +294,7 @@ export default function sentry(rl) {
362
294
  },
363
295
  async execute(input, ctx) {
364
296
  const p = (input ?? {});
365
- return apiRequest(getConn(ctx), "GET", `/api/0/organizations/${p.org}/teams/`, undefined, p.limit ? { limit: p.limit } : undefined);
297
+ return apiRequest(ctx, "GET", `organizations/${pathSegment(p.org)}/teams/`, undefined, p.limit ? { limit: p.limit } : undefined);
366
298
  },
367
299
  });
368
300
  rl.registerAction("team.create", {
@@ -378,7 +310,7 @@ export default function sentry(rl) {
378
310
  const body = { name: p.name };
379
311
  if (p.slug)
380
312
  body.slug = p.slug;
381
- return apiRequest(getConn(ctx), "POST", `/api/0/organizations/${p.org}/teams/`, body);
313
+ return apiRequest(ctx, "POST", `organizations/${pathSegment(p.org)}/teams/`, body);
382
314
  },
383
315
  });
384
316
  rl.registerAction("team.delete", {
@@ -390,7 +322,7 @@ export default function sentry(rl) {
390
322
  },
391
323
  async execute(input, ctx) {
392
324
  const p = input;
393
- await apiRequest(getConn(ctx), "DELETE", `/api/0/teams/${p.org}/${p.team}/`);
325
+ await apiRequest(ctx, "DELETE", `teams/${pathSegment(p.org)}/${pathSegment(p.team)}/`);
394
326
  return { success: true };
395
327
  },
396
328
  });
@@ -0,0 +1,13 @@
1
+ import { hostLabel, staticCredential } from "../../_shared/credentials.js";
2
+ /** A username-password pair, sent as HTTP Basic to the instance subdomain. */
3
+ export const servicenowCredential = staticCredential({
4
+ id: "servicenow",
5
+ auth: { kind: "basic" },
6
+ local: { username: "username", password: "password" },
7
+ targets: (config) => ({
8
+ api: {
9
+ baseUrl: `https://${hostLabel(config.subdomain)}.service-now.com/api/`,
10
+ methods: ["GET", "POST", "PATCH", "DELETE"],
11
+ },
12
+ }),
13
+ });
@@ -1,33 +1,13 @@
1
- function getConn(ctx) {
2
- const c = ctx.connection.config;
3
- return {
4
- subdomain: c.subdomain,
5
- username: c.username,
6
- password: c.password,
7
- };
8
- }
9
- async function api(conn, method, endpoint, body, qs) {
10
- const url = new URL(`https://${conn.subdomain}.service-now.com/api${endpoint}`);
11
- if (qs) {
12
- for (const [k, v] of Object.entries(qs)) {
13
- if (v !== undefined && v !== null)
14
- url.searchParams.set(k, String(v));
15
- }
16
- }
17
- const init = {
1
+ import { credentialJson, pathSegment } from "../../_shared/credentials.js";
2
+ import { servicenowCredential } from "./credentials.js";
3
+ function api(ctx, method, path, body, query) {
4
+ return credentialJson(ctx, servicenowCredential, "servicenow", {
5
+ target: "api",
6
+ path,
18
7
  method,
19
- headers: {
20
- Authorization: `Basic ${btoa(`${conn.username}:${conn.password}`)}`,
21
- "Content-Type": "application/json",
22
- Accept: "application/json",
23
- },
24
- };
25
- if (body && Object.keys(body).length > 0)
26
- init.body = JSON.stringify(body);
27
- const res = await fetch(url.toString(), init);
28
- if (!res.ok)
29
- throw new Error(`ServiceNow error ${res.status}: ${await res.text()}`);
30
- return res.json();
8
+ query,
9
+ ...(body && Object.keys(body).length > 0 ? { json: body } : {}),
10
+ });
31
11
  }
32
12
  const TABLES = {
33
13
  incident: "incident",
@@ -38,13 +18,13 @@ const TABLES = {
38
18
  configurationItem: "cmdb_ci",
39
19
  department: "cmn_department",
40
20
  };
41
- function registerTableResource(rl, resource, table, conn) {
21
+ function registerTableResource(rl, resource, table) {
42
22
  rl.registerAction(`${resource}.create`, {
43
23
  access: "write",
44
24
  description: `Create a ${resource}`,
45
25
  inputSchema: { data: { type: "object", required: true } },
46
26
  async execute(input, ctx) {
47
- const data = (await api(conn(ctx), "POST", `/now/table/${table}`, input.data));
27
+ const data = (await api(ctx, "POST", `now/table/${pathSegment(table)}`, input.data));
48
28
  return data.result;
49
29
  },
50
30
  });
@@ -53,7 +33,7 @@ function registerTableResource(rl, resource, table, conn) {
53
33
  description: `Get a ${resource} by sys_id`,
54
34
  inputSchema: { sysId: { type: "string", required: true } },
55
35
  async execute(input, ctx) {
56
- const data = (await api(conn(ctx), "GET", `/now/table/${table}/${input.sysId}`));
36
+ const data = (await api(ctx, "GET", `now/table/${pathSegment(table)}/${pathSegment(input.sysId)}`));
57
37
  return data.result;
58
38
  },
59
39
  });
@@ -82,7 +62,7 @@ function registerTableResource(rl, resource, table, conn) {
82
62
  qs.sysparm_query = p.query;
83
63
  if (p.fields)
84
64
  qs.sysparm_fields = p.fields;
85
- const data = (await api(conn(ctx), "GET", `/now/table/${table}`, undefined, qs));
65
+ const data = (await api(ctx, "GET", `now/table/${pathSegment(table)}`, undefined, qs));
86
66
  return data.result;
87
67
  },
88
68
  });
@@ -95,7 +75,7 @@ function registerTableResource(rl, resource, table, conn) {
95
75
  },
96
76
  async execute(input, ctx) {
97
77
  const p = input;
98
- const data = (await api(conn(ctx), "PATCH", `/now/table/${table}/${p.sysId}`, p.data));
78
+ const data = (await api(ctx, "PATCH", `now/table/${pathSegment(table)}/${pathSegment(p.sysId)}`, p.data));
99
79
  return data.result;
100
80
  },
101
81
  });
@@ -104,7 +84,7 @@ function registerTableResource(rl, resource, table, conn) {
104
84
  description: `Delete a ${resource}`,
105
85
  inputSchema: { sysId: { type: "string", required: true } },
106
86
  async execute(input, ctx) {
107
- await api(conn(ctx), "DELETE", `/now/table/${table}/${input.sysId}`);
87
+ await api(ctx, "DELETE", `now/table/${pathSegment(table)}/${pathSegment(input.sysId)}`);
108
88
  return { success: true };
109
89
  },
110
90
  });
@@ -112,6 +92,7 @@ function registerTableResource(rl, resource, table, conn) {
112
92
  export default function servicenow(rl) {
113
93
  rl.setName("servicenow");
114
94
  rl.setVersion("0.1.0");
95
+ rl.setCredential(servicenowCredential);
115
96
  rl.setConnectionSchema({
116
97
  subdomain: {
117
98
  type: "string",
@@ -133,7 +114,7 @@ export default function servicenow(rl) {
133
114
  },
134
115
  });
135
116
  for (const [resource, table] of Object.entries(TABLES)) {
136
- registerTableResource(rl, resource, table, getConn);
117
+ registerTableResource(rl, resource, table);
137
118
  }
138
119
  // ── Generic Table Record ────────────────────────────
139
120
  rl.registerAction("tableRecord.create", {
@@ -145,7 +126,7 @@ export default function servicenow(rl) {
145
126
  },
146
127
  async execute(input, ctx) {
147
128
  const p = input;
148
- const data = (await api(getConn(ctx), "POST", `/now/table/${p.tableName}`, p.data));
129
+ const data = (await api(ctx, "POST", `now/table/${pathSegment(p.tableName)}`, p.data));
149
130
  return data.result;
150
131
  },
151
132
  });
@@ -158,7 +139,7 @@ export default function servicenow(rl) {
158
139
  },
159
140
  async execute(input, ctx) {
160
141
  const p = input;
161
- const data = (await api(getConn(ctx), "GET", `/now/table/${p.tableName}/${p.sysId}`));
142
+ const data = (await api(ctx, "GET", `now/table/${pathSegment(p.tableName)}/${pathSegment(p.sysId)}`));
162
143
  return data.result;
163
144
  },
164
145
  });
@@ -177,7 +158,7 @@ export default function servicenow(rl) {
177
158
  qs.sysparm_limit = p.limit;
178
159
  if (p.query)
179
160
  qs.sysparm_query = p.query;
180
- const data = (await api(getConn(ctx), "GET", `/now/table/${p.tableName}`, undefined, qs));
161
+ const data = (await api(ctx, "GET", `now/table/${pathSegment(p.tableName)}`, undefined, qs));
181
162
  return data.result;
182
163
  },
183
164
  });
@@ -191,7 +172,7 @@ export default function servicenow(rl) {
191
172
  },
192
173
  async execute(input, ctx) {
193
174
  const p = input;
194
- const data = (await api(getConn(ctx), "PATCH", `/now/table/${p.tableName}/${p.sysId}`, p.data));
175
+ const data = (await api(ctx, "PATCH", `now/table/${pathSegment(p.tableName)}/${pathSegment(p.sysId)}`, p.data));
195
176
  return data.result;
196
177
  },
197
178
  });
@@ -204,7 +185,7 @@ export default function servicenow(rl) {
204
185
  },
205
186
  async execute(input, ctx) {
206
187
  const p = input;
207
- await api(getConn(ctx), "DELETE", `/now/table/${p.tableName}/${p.sysId}`);
188
+ await api(ctx, "DELETE", `now/table/${pathSegment(p.tableName)}/${pathSegment(p.sysId)}`);
208
189
  return { success: true };
209
190
  },
210
191
  });
@@ -1,5 +1,5 @@
1
1
  import * as t from "typebox";
2
- import { ATLAS_BASE, cursorSchema, enumSchema, GRAPH_ACTOR_KIND, GRAPH_ASSIGNMENT_ROLE, GRAPH_BINDING_EXECUTOR, GRAPH_BINDING_STATUS, GRAPH_CHANGE_ENTITY_TYPE, GRAPH_EVIDENCE_KIND, GRAPH_JOURNEY_STATUS, GRAPH_RELATION_KIND, GRAPH_TASK_MODE, idSchema, listParams, pathSegment, request, STRICT_OBJECT, STRICT_UPDATE_OBJECT, withQuery, } from "./shared.js";
2
+ import { ATLAS_BASE, cursorSchema, enumSchema, GRAPH_ACTOR_KIND, GRAPH_ASSIGNMENT_ROLE, GRAPH_BINDING_EXECUTOR, GRAPH_BINDING_STATUS, GRAPH_CHANGE_ENTITY_TYPE, GRAPH_EVIDENCE_KIND, GRAPH_JOURNEY_STATUS, GRAPH_RELATION_KIND, GRAPH_TASK_MODE, idSchema, pathSegment, request, STRICT_OBJECT, STRICT_UPDATE_OBJECT, } from "./shared.js";
3
3
  /**
4
4
  * The operational graph behind the Atlas view: a business spec of how
5
5
  * a company operates, in its own language. Four fixed levels — line →
@@ -121,7 +121,7 @@ export function registerGraphActions(rl) {
121
121
  limit: t.Optional(t.Integer({ minimum: 1, maximum: 200 })),
122
122
  }, STRICT_OBJECT),
123
123
  async execute(input, ctx) {
124
- return request(ctx, withQuery(`${ATLAS_BASE}/changes`, listParams(input)));
124
+ return request(ctx, `${ATLAS_BASE}/changes`, { query: input });
125
125
  },
126
126
  });
127
127
  /* -------------------------------------------------------------- */
@@ -1,5 +1,6 @@
1
1
  import * as t from "typebox";
2
2
  import { registerGraphActions } from "./graph.js";
3
+ import { shiftAtlasCredential } from "./shared.js";
3
4
  /**
4
5
  * Shift Atlas — the operational graph of a Shift cloud organization:
5
6
  * the map of how the business runs. Independent of the shiftLabs
@@ -10,6 +11,7 @@ import { registerGraphActions } from "./graph.js";
10
11
  export default function shiftAtlas(rl) {
11
12
  rl.setName("shiftAtlas");
12
13
  rl.setVersion("0.1.0");
14
+ rl.setCredential(shiftAtlasCredential);
13
15
  rl.setConnectionSchema(t.Object({
14
16
  // Same Shift Labs API key family as the shiftLabs plugin; needs
15
17
  // the service:operational-graph:use scope.
@@ -1,4 +1,6 @@
1
- export { cursorSchema, enumSchema, idSchema, listParams, pathSegment, request, STRICT_OBJECT, STRICT_UPDATE_OBJECT, withQuery, } from "../../_shared/shiftCloud.js";
1
+ import { shiftClient } from "../../_shared/shiftCredentials.js";
2
+ export { cursorSchema, enumSchema, idSchema, pathSegment, STRICT_OBJECT, STRICT_UPDATE_OBJECT, } from "../../_shared/shiftCloud.js";
3
+ export const { credential: shiftAtlasCredential, request } = shiftClient("shiftAtlas");
2
4
  /** Base path of the operational graph service in the Shift cloud API. */
3
5
  export const ATLAS_BASE = "/v1/services/operational-graph";
4
6
  export const GRAPH_ACTOR_KIND = ["agent", "human_role"];
@@ -1,6 +1,7 @@
1
1
  import * as t from "typebox";
2
2
  import { registerFileActions, registerGroupActions, registerMemberActions, registerSavedListActions, } from "./collections.js";
3
3
  import { registerRecordActions, registerSchemaActions } from "./records.js";
4
+ import { shiftBwmCredential } from "./shared.js";
4
5
  /**
5
6
  * Shift Business World Model — an organization's graph of accounts,
6
7
  * contacts, opportunities, activities, tasks, notes, and custom object
@@ -12,12 +13,13 @@ import { registerRecordActions, registerSchemaActions } from "./records.js";
12
13
  * per object type and must be read before writing.
13
14
  *
14
15
  * Requests go through the cloud repo's own BusinessWorldModelClient,
15
- * vendored under src/vendor (see the SYNCED_FROM headers there), over the
16
- * shared Shift transport.
16
+ * vendored under src/vendor (see the SYNCED_FROM headers there), signed
17
+ * through the Shift family's declared credential.
17
18
  */
18
19
  export default function shiftBwm(rl) {
19
20
  rl.setName("shiftBwm");
20
21
  rl.setVersion("0.1.0");
22
+ rl.setCredential(shiftBwmCredential);
21
23
  rl.setConnectionSchema(t.Object({
22
24
  apiKey: t.String({
23
25
  description: "Shift Labs API key. A personal token (subject: user) acts as its human and inherits that person's record visibility; an organization key (subject: service) is its own principal, named on records and added to groups like a member. Needs service:business-world-model:read for reads, :write for record writes, :configure for groups.",