@zapier/zapier-sdk 0.18.4 → 0.19.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 (372) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +43 -31
  3. package/dist/index.cjs +365 -64
  4. package/dist/index.d.mts +220 -33
  5. package/dist/index.d.ts +2541 -40
  6. package/dist/index.mjs +345 -63
  7. package/package.json +14 -13
  8. package/dist/api/auth.d.ts +0 -19
  9. package/dist/api/auth.d.ts.map +0 -1
  10. package/dist/api/auth.js +0 -70
  11. package/dist/api/auth.test.d.ts +0 -2
  12. package/dist/api/auth.test.d.ts.map +0 -1
  13. package/dist/api/auth.test.js +0 -220
  14. package/dist/api/client.d.ts +0 -9
  15. package/dist/api/client.d.ts.map +0 -1
  16. package/dist/api/client.js +0 -356
  17. package/dist/api/client.test.d.ts +0 -2
  18. package/dist/api/client.test.d.ts.map +0 -1
  19. package/dist/api/client.test.js +0 -96
  20. package/dist/api/debug.d.ts +0 -14
  21. package/dist/api/debug.d.ts.map +0 -1
  22. package/dist/api/debug.js +0 -131
  23. package/dist/api/debug.test.d.ts +0 -2
  24. package/dist/api/debug.test.d.ts.map +0 -1
  25. package/dist/api/debug.test.js +0 -59
  26. package/dist/api/index.d.ts +0 -30
  27. package/dist/api/index.d.ts.map +0 -1
  28. package/dist/api/index.js +0 -43
  29. package/dist/api/polling.d.ts +0 -46
  30. package/dist/api/polling.d.ts.map +0 -1
  31. package/dist/api/polling.js +0 -139
  32. package/dist/api/polling.test.d.ts +0 -2
  33. package/dist/api/polling.test.d.ts.map +0 -1
  34. package/dist/api/polling.test.js +0 -318
  35. package/dist/api/schemas.d.ts +0 -422
  36. package/dist/api/schemas.d.ts.map +0 -1
  37. package/dist/api/schemas.js +0 -322
  38. package/dist/api/types.d.ts +0 -83
  39. package/dist/api/types.d.ts.map +0 -1
  40. package/dist/api/types.js +0 -1
  41. package/dist/auth.d.ts +0 -52
  42. package/dist/auth.d.ts.map +0 -1
  43. package/dist/auth.js +0 -72
  44. package/dist/auth.test.d.ts +0 -2
  45. package/dist/auth.test.d.ts.map +0 -1
  46. package/dist/auth.test.js +0 -102
  47. package/dist/constants.d.ts +0 -14
  48. package/dist/constants.d.ts.map +0 -1
  49. package/dist/constants.js +0 -13
  50. package/dist/index.d.ts.map +0 -1
  51. package/dist/index.js +0 -42
  52. package/dist/plugins/api/index.d.ts +0 -12
  53. package/dist/plugins/api/index.d.ts.map +0 -1
  54. package/dist/plugins/api/index.js +0 -24
  55. package/dist/plugins/apps/index.d.ts +0 -15
  56. package/dist/plugins/apps/index.d.ts.map +0 -1
  57. package/dist/plugins/apps/index.js +0 -112
  58. package/dist/plugins/apps/schemas.d.ts +0 -42
  59. package/dist/plugins/apps/schemas.d.ts.map +0 -1
  60. package/dist/plugins/apps/schemas.js +0 -14
  61. package/dist/plugins/eventEmission/builders.d.ts +0 -14
  62. package/dist/plugins/eventEmission/builders.d.ts.map +0 -1
  63. package/dist/plugins/eventEmission/builders.js +0 -109
  64. package/dist/plugins/eventEmission/index.d.ts +0 -38
  65. package/dist/plugins/eventEmission/index.d.ts.map +0 -1
  66. package/dist/plugins/eventEmission/index.js +0 -336
  67. package/dist/plugins/eventEmission/index.test.d.ts +0 -5
  68. package/dist/plugins/eventEmission/index.test.d.ts.map +0 -1
  69. package/dist/plugins/eventEmission/index.test.js +0 -581
  70. package/dist/plugins/eventEmission/transport.d.ts +0 -27
  71. package/dist/plugins/eventEmission/transport.d.ts.map +0 -1
  72. package/dist/plugins/eventEmission/transport.js +0 -104
  73. package/dist/plugins/eventEmission/transport.test.d.ts +0 -5
  74. package/dist/plugins/eventEmission/transport.test.d.ts.map +0 -1
  75. package/dist/plugins/eventEmission/transport.test.js +0 -164
  76. package/dist/plugins/eventEmission/types.d.ts +0 -63
  77. package/dist/plugins/eventEmission/types.d.ts.map +0 -1
  78. package/dist/plugins/eventEmission/types.js +0 -1
  79. package/dist/plugins/eventEmission/utils.d.ts +0 -45
  80. package/dist/plugins/eventEmission/utils.d.ts.map +0 -1
  81. package/dist/plugins/eventEmission/utils.js +0 -114
  82. package/dist/plugins/fetch/index.d.ts +0 -36
  83. package/dist/plugins/fetch/index.d.ts.map +0 -1
  84. package/dist/plugins/fetch/index.js +0 -62
  85. package/dist/plugins/fetch/schemas.d.ts +0 -19
  86. package/dist/plugins/fetch/schemas.d.ts.map +0 -1
  87. package/dist/plugins/fetch/schemas.js +0 -31
  88. package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
  89. package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
  90. package/dist/plugins/findFirstAuthentication/index.js +0 -36
  91. package/dist/plugins/findFirstAuthentication/index.test.d.ts +0 -2
  92. package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
  93. package/dist/plugins/findFirstAuthentication/index.test.js +0 -177
  94. package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -20
  95. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
  96. package/dist/plugins/findFirstAuthentication/schemas.js +0 -18
  97. package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
  98. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
  99. package/dist/plugins/findUniqueAuthentication/index.js +0 -39
  100. package/dist/plugins/findUniqueAuthentication/index.test.d.ts +0 -2
  101. package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
  102. package/dist/plugins/findUniqueAuthentication/index.test.js +0 -159
  103. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -20
  104. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
  105. package/dist/plugins/findUniqueAuthentication/schemas.js +0 -18
  106. package/dist/plugins/getAction/index.d.ts +0 -25
  107. package/dist/plugins/getAction/index.d.ts.map +0 -1
  108. package/dist/plugins/getAction/index.js +0 -42
  109. package/dist/plugins/getAction/index.test.d.ts +0 -2
  110. package/dist/plugins/getAction/index.test.d.ts.map +0 -1
  111. package/dist/plugins/getAction/index.test.js +0 -211
  112. package/dist/plugins/getAction/schemas.d.ts +0 -30
  113. package/dist/plugins/getAction/schemas.d.ts.map +0 -1
  114. package/dist/plugins/getAction/schemas.js +0 -12
  115. package/dist/plugins/getApp/index.d.ts +0 -21
  116. package/dist/plugins/getApp/index.d.ts.map +0 -1
  117. package/dist/plugins/getApp/index.js +0 -44
  118. package/dist/plugins/getApp/index.test.d.ts +0 -2
  119. package/dist/plugins/getApp/index.test.d.ts.map +0 -1
  120. package/dist/plugins/getApp/index.test.js +0 -157
  121. package/dist/plugins/getApp/schemas.d.ts +0 -16
  122. package/dist/plugins/getApp/schemas.d.ts.map +0 -1
  123. package/dist/plugins/getApp/schemas.js +0 -8
  124. package/dist/plugins/getAuthentication/index.d.ts +0 -21
  125. package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
  126. package/dist/plugins/getAuthentication/index.js +0 -29
  127. package/dist/plugins/getAuthentication/index.test.d.ts +0 -2
  128. package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
  129. package/dist/plugins/getAuthentication/index.test.js +0 -106
  130. package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
  131. package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
  132. package/dist/plugins/getAuthentication/schemas.js +0 -1
  133. package/dist/plugins/getInputFieldsSchema/index.d.ts +0 -23
  134. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
  135. package/dist/plugins/getInputFieldsSchema/index.js +0 -53
  136. package/dist/plugins/getInputFieldsSchema/index.test.d.ts +0 -2
  137. package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +0 -1
  138. package/dist/plugins/getInputFieldsSchema/index.test.js +0 -291
  139. package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -28
  140. package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
  141. package/dist/plugins/getInputFieldsSchema/schemas.js +0 -13
  142. package/dist/plugins/getProfile/index.d.ts +0 -25
  143. package/dist/plugins/getProfile/index.d.ts.map +0 -1
  144. package/dist/plugins/getProfile/index.js +0 -39
  145. package/dist/plugins/getProfile/schemas.d.ts +0 -13
  146. package/dist/plugins/getProfile/schemas.d.ts.map +0 -1
  147. package/dist/plugins/getProfile/schemas.js +0 -6
  148. package/dist/plugins/listActions/index.d.ts +0 -30
  149. package/dist/plugins/listActions/index.d.ts.map +0 -1
  150. package/dist/plugins/listActions/index.js +0 -75
  151. package/dist/plugins/listActions/index.test.d.ts +0 -2
  152. package/dist/plugins/listActions/index.test.d.ts.map +0 -1
  153. package/dist/plugins/listActions/index.test.js +0 -453
  154. package/dist/plugins/listActions/schemas.d.ts +0 -35
  155. package/dist/plugins/listActions/schemas.d.ts.map +0 -1
  156. package/dist/plugins/listActions/schemas.js +0 -22
  157. package/dist/plugins/listApps/index.d.ts +0 -19
  158. package/dist/plugins/listApps/index.d.ts.map +0 -1
  159. package/dist/plugins/listApps/index.js +0 -67
  160. package/dist/plugins/listApps/index.test.d.ts +0 -2
  161. package/dist/plugins/listApps/index.test.d.ts.map +0 -1
  162. package/dist/plugins/listApps/index.test.js +0 -121
  163. package/dist/plugins/listApps/schemas.d.ts +0 -47
  164. package/dist/plugins/listApps/schemas.d.ts.map +0 -1
  165. package/dist/plugins/listApps/schemas.js +0 -49
  166. package/dist/plugins/listAuthentications/index.d.ts +0 -24
  167. package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
  168. package/dist/plugins/listAuthentications/index.js +0 -77
  169. package/dist/plugins/listAuthentications/index.test.d.ts +0 -2
  170. package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
  171. package/dist/plugins/listAuthentications/index.test.js +0 -848
  172. package/dist/plugins/listAuthentications/schemas.d.ts +0 -30
  173. package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
  174. package/dist/plugins/listAuthentications/schemas.js +0 -32
  175. package/dist/plugins/listInputFieldChoices/index.d.ts +0 -33
  176. package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
  177. package/dist/plugins/listInputFieldChoices/index.js +0 -115
  178. package/dist/plugins/listInputFieldChoices/index.test.d.ts +0 -2
  179. package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +0 -1
  180. package/dist/plugins/listInputFieldChoices/index.test.js +0 -717
  181. package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -43
  182. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
  183. package/dist/plugins/listInputFieldChoices/schemas.js +0 -65
  184. package/dist/plugins/listInputFields/index.d.ts +0 -34
  185. package/dist/plugins/listInputFields/index.d.ts.map +0 -1
  186. package/dist/plugins/listInputFields/index.js +0 -204
  187. package/dist/plugins/listInputFields/index.test.d.ts +0 -2
  188. package/dist/plugins/listInputFields/index.test.d.ts.map +0 -1
  189. package/dist/plugins/listInputFields/index.test.js +0 -359
  190. package/dist/plugins/listInputFields/schemas.d.ts +0 -35
  191. package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
  192. package/dist/plugins/listInputFields/schemas.js +0 -23
  193. package/dist/plugins/manifest/index.d.ts +0 -85
  194. package/dist/plugins/manifest/index.d.ts.map +0 -1
  195. package/dist/plugins/manifest/index.js +0 -376
  196. package/dist/plugins/manifest/index.test.d.ts +0 -2
  197. package/dist/plugins/manifest/index.test.d.ts.map +0 -1
  198. package/dist/plugins/manifest/index.test.js +0 -1139
  199. package/dist/plugins/manifest/schemas.d.ts +0 -57
  200. package/dist/plugins/manifest/schemas.d.ts.map +0 -1
  201. package/dist/plugins/manifest/schemas.js +0 -50
  202. package/dist/plugins/registry/index.d.ts +0 -21
  203. package/dist/plugins/registry/index.d.ts.map +0 -1
  204. package/dist/plugins/registry/index.js +0 -117
  205. package/dist/plugins/request/index.d.ts +0 -21
  206. package/dist/plugins/request/index.d.ts.map +0 -1
  207. package/dist/plugins/request/index.js +0 -76
  208. package/dist/plugins/request/index.test.d.ts +0 -2
  209. package/dist/plugins/request/index.test.d.ts.map +0 -1
  210. package/dist/plugins/request/index.test.js +0 -337
  211. package/dist/plugins/request/schemas.d.ts +0 -54
  212. package/dist/plugins/request/schemas.d.ts.map +0 -1
  213. package/dist/plugins/request/schemas.js +0 -41
  214. package/dist/plugins/runAction/index.d.ts +0 -33
  215. package/dist/plugins/runAction/index.d.ts.map +0 -1
  216. package/dist/plugins/runAction/index.js +0 -108
  217. package/dist/plugins/runAction/index.test.d.ts +0 -2
  218. package/dist/plugins/runAction/index.test.d.ts.map +0 -1
  219. package/dist/plugins/runAction/index.test.js +0 -333
  220. package/dist/plugins/runAction/schemas.d.ts +0 -34
  221. package/dist/plugins/runAction/schemas.d.ts.map +0 -1
  222. package/dist/plugins/runAction/schemas.js +0 -23
  223. package/dist/resolvers/actionKey.d.ts +0 -15
  224. package/dist/resolvers/actionKey.d.ts.map +0 -1
  225. package/dist/resolvers/actionKey.js +0 -19
  226. package/dist/resolvers/actionType.d.ts +0 -10
  227. package/dist/resolvers/actionType.d.ts.map +0 -1
  228. package/dist/resolvers/actionType.js +0 -21
  229. package/dist/resolvers/appKey.d.ts +0 -3
  230. package/dist/resolvers/appKey.d.ts.map +0 -1
  231. package/dist/resolvers/appKey.js +0 -5
  232. package/dist/resolvers/authenticationId.d.ts +0 -9
  233. package/dist/resolvers/authenticationId.d.ts.map +0 -1
  234. package/dist/resolvers/authenticationId.js +0 -42
  235. package/dist/resolvers/index.d.ts +0 -8
  236. package/dist/resolvers/index.d.ts.map +0 -1
  237. package/dist/resolvers/index.js +0 -8
  238. package/dist/resolvers/inputFieldKey.d.ts +0 -11
  239. package/dist/resolvers/inputFieldKey.d.ts.map +0 -1
  240. package/dist/resolvers/inputFieldKey.js +0 -47
  241. package/dist/resolvers/inputs.d.ts +0 -17
  242. package/dist/resolvers/inputs.d.ts.map +0 -1
  243. package/dist/resolvers/inputs.js +0 -50
  244. package/dist/schemas/Action.d.ts +0 -24
  245. package/dist/schemas/Action.d.ts.map +0 -1
  246. package/dist/schemas/Action.js +0 -40
  247. package/dist/schemas/App.d.ts +0 -57
  248. package/dist/schemas/App.d.ts.map +0 -1
  249. package/dist/schemas/App.js +0 -26
  250. package/dist/schemas/Auth.d.ts +0 -55
  251. package/dist/schemas/Auth.d.ts.map +0 -1
  252. package/dist/schemas/Auth.js +0 -33
  253. package/dist/schemas/Field.d.ts +0 -61
  254. package/dist/schemas/Field.d.ts.map +0 -1
  255. package/dist/schemas/Field.js +0 -116
  256. package/dist/schemas/Run.d.ts +0 -3
  257. package/dist/schemas/Run.d.ts.map +0 -1
  258. package/dist/schemas/Run.js +0 -31
  259. package/dist/schemas/UserProfile.d.ts +0 -13
  260. package/dist/schemas/UserProfile.d.ts.map +0 -1
  261. package/dist/schemas/UserProfile.js +0 -32
  262. package/dist/sdk.d.ts +0 -146
  263. package/dist/sdk.d.ts.map +0 -1
  264. package/dist/sdk.js +0 -112
  265. package/dist/sdk.test.d.ts +0 -2
  266. package/dist/sdk.test.d.ts.map +0 -1
  267. package/dist/sdk.test.js +0 -258
  268. package/dist/services/implementations.d.ts +0 -63
  269. package/dist/services/implementations.d.ts.map +0 -1
  270. package/dist/services/implementations.js +0 -80
  271. package/dist/types/domain.d.ts +0 -52
  272. package/dist/types/domain.d.ts.map +0 -1
  273. package/dist/types/domain.js +0 -1
  274. package/dist/types/domain.test.d.ts +0 -2
  275. package/dist/types/domain.test.d.ts.map +0 -1
  276. package/dist/types/domain.test.js +0 -39
  277. package/dist/types/errors.d.ts +0 -143
  278. package/dist/types/errors.d.ts.map +0 -1
  279. package/dist/types/errors.js +0 -187
  280. package/dist/types/events.d.ts +0 -38
  281. package/dist/types/events.d.ts.map +0 -1
  282. package/dist/types/events.js +0 -7
  283. package/dist/types/functions.d.ts +0 -27
  284. package/dist/types/functions.d.ts.map +0 -1
  285. package/dist/types/functions.js +0 -1
  286. package/dist/types/plugin.d.ts +0 -75
  287. package/dist/types/plugin.d.ts.map +0 -1
  288. package/dist/types/plugin.js +0 -9
  289. package/dist/types/properties.d.ts +0 -33
  290. package/dist/types/properties.d.ts.map +0 -1
  291. package/dist/types/properties.js +0 -52
  292. package/dist/types/sdk.d.ts +0 -69
  293. package/dist/types/sdk.d.ts.map +0 -1
  294. package/dist/types/sdk.js +0 -4
  295. package/dist/types/telemetry-events.d.ts +0 -105
  296. package/dist/types/telemetry-events.d.ts.map +0 -1
  297. package/dist/types/telemetry-events.js +0 -8
  298. package/dist/utils/array-utils.d.ts +0 -31
  299. package/dist/utils/array-utils.d.ts.map +0 -1
  300. package/dist/utils/array-utils.js +0 -36
  301. package/dist/utils/array-utils.test.d.ts +0 -2
  302. package/dist/utils/array-utils.test.d.ts.map +0 -1
  303. package/dist/utils/array-utils.test.js +0 -107
  304. package/dist/utils/batch-utils.d.ts +0 -72
  305. package/dist/utils/batch-utils.d.ts.map +0 -1
  306. package/dist/utils/batch-utils.js +0 -162
  307. package/dist/utils/batch-utils.test.d.ts +0 -2
  308. package/dist/utils/batch-utils.test.d.ts.map +0 -1
  309. package/dist/utils/batch-utils.test.js +0 -476
  310. package/dist/utils/domain-utils.d.ts +0 -66
  311. package/dist/utils/domain-utils.d.ts.map +0 -1
  312. package/dist/utils/domain-utils.js +0 -164
  313. package/dist/utils/domain-utils.test.d.ts +0 -2
  314. package/dist/utils/domain-utils.test.d.ts.map +0 -1
  315. package/dist/utils/domain-utils.test.js +0 -346
  316. package/dist/utils/file-utils.d.ts +0 -4
  317. package/dist/utils/file-utils.d.ts.map +0 -1
  318. package/dist/utils/file-utils.js +0 -74
  319. package/dist/utils/file-utils.test.d.ts +0 -2
  320. package/dist/utils/file-utils.test.d.ts.map +0 -1
  321. package/dist/utils/file-utils.test.js +0 -51
  322. package/dist/utils/function-utils.d.ts +0 -73
  323. package/dist/utils/function-utils.d.ts.map +0 -1
  324. package/dist/utils/function-utils.js +0 -245
  325. package/dist/utils/function-utils.test.d.ts +0 -2
  326. package/dist/utils/function-utils.test.d.ts.map +0 -1
  327. package/dist/utils/function-utils.test.js +0 -110
  328. package/dist/utils/id-utils.d.ts +0 -13
  329. package/dist/utils/id-utils.d.ts.map +0 -1
  330. package/dist/utils/id-utils.js +0 -22
  331. package/dist/utils/id-utils.test.d.ts +0 -2
  332. package/dist/utils/id-utils.test.d.ts.map +0 -1
  333. package/dist/utils/id-utils.test.js +0 -22
  334. package/dist/utils/pagination-utils.d.ts +0 -37
  335. package/dist/utils/pagination-utils.d.ts.map +0 -1
  336. package/dist/utils/pagination-utils.js +0 -165
  337. package/dist/utils/pagination-utils.test.d.ts +0 -17
  338. package/dist/utils/pagination-utils.test.d.ts.map +0 -1
  339. package/dist/utils/pagination-utils.test.js +0 -461
  340. package/dist/utils/retry-utils.d.ts +0 -45
  341. package/dist/utils/retry-utils.d.ts.map +0 -1
  342. package/dist/utils/retry-utils.js +0 -51
  343. package/dist/utils/retry-utils.test.d.ts +0 -2
  344. package/dist/utils/retry-utils.test.d.ts.map +0 -1
  345. package/dist/utils/retry-utils.test.js +0 -90
  346. package/dist/utils/schema-utils.d.ts +0 -69
  347. package/dist/utils/schema-utils.d.ts.map +0 -1
  348. package/dist/utils/schema-utils.js +0 -72
  349. package/dist/utils/string-utils.d.ts +0 -40
  350. package/dist/utils/string-utils.d.ts.map +0 -1
  351. package/dist/utils/string-utils.js +0 -69
  352. package/dist/utils/string-utils.test.d.ts +0 -2
  353. package/dist/utils/string-utils.test.d.ts.map +0 -1
  354. package/dist/utils/string-utils.test.js +0 -59
  355. package/dist/utils/telemetry-utils.d.ts +0 -44
  356. package/dist/utils/telemetry-utils.d.ts.map +0 -1
  357. package/dist/utils/telemetry-utils.js +0 -55
  358. package/dist/utils/telemetry-utils.test.d.ts +0 -2
  359. package/dist/utils/telemetry-utils.test.d.ts.map +0 -1
  360. package/dist/utils/telemetry-utils.test.js +0 -94
  361. package/dist/utils/url-utils.d.ts +0 -19
  362. package/dist/utils/url-utils.d.ts.map +0 -1
  363. package/dist/utils/url-utils.js +0 -62
  364. package/dist/utils/url-utils.test.d.ts +0 -2
  365. package/dist/utils/url-utils.test.d.ts.map +0 -1
  366. package/dist/utils/url-utils.test.js +0 -103
  367. package/dist/utils/validation.d.ts +0 -4
  368. package/dist/utils/validation.d.ts.map +0 -1
  369. package/dist/utils/validation.js +0 -30
  370. package/dist/utils/validation.test.d.ts +0 -2
  371. package/dist/utils/validation.test.d.ts.map +0 -1
  372. package/dist/utils/validation.test.js +0 -44
@@ -1,75 +0,0 @@
1
- /**
2
- * ------------------------------
3
- * Plugin Type System with Explicit Context Dependencies
4
- * ------------------------------
5
- *
6
- * This system makes context dependencies explicit to restore TypeScript's
7
- * ability to catch missing context at compile time.
8
- */
9
- import type { z } from "zod";
10
- import type { BaseSdkOptions } from "./sdk";
11
- export interface PluginDependencies<TSdk = {}, TContext = {}> {
12
- sdk: TSdk;
13
- context: TContext;
14
- }
15
- export interface PluginProvides extends Record<string, any> {
16
- context?: Record<string, any>;
17
- }
18
- export interface PluginMeta {
19
- categories: string[];
20
- type?: "list" | "item";
21
- itemType?: string;
22
- returnType?: string;
23
- inputSchema: z.ZodSchema;
24
- outputSchema?: z.ZodSchema;
25
- resolvers?: Record<string, any>;
26
- [key: string]: any;
27
- }
28
- export type ExtractSdkProperties<T extends Record<string, any>> = Omit<T, "context">;
29
- export type ExtractContextProperties<T extends PluginProvides> = T["context"];
30
- export type GetSdkType<TPluginProvides extends PluginProvides> = ExtractSdkProperties<TPluginProvides> & {
31
- getContext(): NonNullable<ExtractContextProperties<TPluginProvides>>;
32
- };
33
- export type GetContextType<TPluginProvides extends PluginProvides> = NonNullable<ExtractContextProperties<TPluginProvides>>;
34
- export type PluginOptions<TSdk = {}, TContext = {}> = {
35
- sdk: TSdk;
36
- context: TContext & {
37
- meta: Record<string, any>;
38
- };
39
- };
40
- /**
41
- * Plugin interface — now has 3 type params:
42
- *
43
- * TRequiresContext = what this plugin *needs* in context
44
- * TProvides = what this plugin *returns* (sdk + context)
45
- * TSdk = current sdk shape when plugin runs
46
- */
47
- export interface Plugin<TSdk = {}, TRequiresContext = {}, TProvides extends PluginProvides = PluginProvides> {
48
- (params: {
49
- sdk: TSdk;
50
- context: TRequiresContext & {
51
- meta: Record<string, PluginMeta>;
52
- options: BaseSdkOptions;
53
- };
54
- }): TProvides;
55
- }
56
- type MissingContextKeys<TRequired, TCurrent> = TRequired extends Record<string, any> ? TCurrent extends Record<string, any> ? {
57
- [K in keyof TRequired]: K extends keyof TCurrent ? never : K;
58
- }[keyof TRequired] : keyof TRequired : never;
59
- type ContextError<TRequired, TCurrent> = MissingContextKeys<TRequired, TCurrent> extends never ? never : MissingContextKeys<TRequired, TCurrent> extends infer Missing ? Missing extends string ? `❌ Missing required context: { ${Missing}: any }` : Missing extends number ? `❌ Missing required context: { ${Missing}: any }` : `❌ Missing required context properties. Required: ${keyof TRequired extends string ? keyof TRequired : "unknown"}, Available: ${keyof TCurrent extends string ? keyof TCurrent : "unknown"}` : "❌ Context requirement not satisfied";
60
- /**
61
- * SDK interface — result of createSdk()
62
- *
63
- * addPlugin now enforces that TRequiresContext is assignable to TCurrentContext.
64
- * If not, TypeScript will emit a detailed error showing missing properties.
65
- */
66
- export type Sdk<TCurrentSdk = {}, TCurrentContext = {
67
- meta: Record<string, PluginMeta>;
68
- }> = TCurrentSdk & {
69
- addPlugin<TRequiresContext, TProvides extends PluginProvides>(plugin: Plugin<TCurrentSdk & {
70
- getContext(): TCurrentContext;
71
- }, TRequiresContext, TProvides>, options?: any): TCurrentContext extends TRequiresContext ? Sdk<TCurrentSdk & ExtractSdkProperties<TProvides>, TCurrentContext & NonNullable<ExtractContextProperties<TProvides>>> : ContextError<TRequiresContext, TCurrentContext>;
72
- getContext(): TCurrentContext;
73
- };
74
- export {};
75
- //# sourceMappingURL=plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE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AChM,qCAAqC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,MAAM,GAAG,CACb,WAAW,GAAG,EAAE,EAChB,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAAE,IACpD,WAAW,GAAG;IAChB,SAAS,CAAC,gBAAgB,EAAE,SAAS,SAAS,cAAc,EAC1D,MAAM,EAAE,MAAM,CACZ,WAAW,GAAG;QAAE,UAAU,IAAI,eAAe,CAAA;KAAE,EAC/C,gBAAgB,EAChB,SAAS,CACV,EACD,OAAO,CAAC,EAAE,GAAG,GACZ,eAAe,SAAS,gBAAgB,GACvC,GAAG,CACD,WAAW,GAAG,oBAAoB,CAAC,SAAS,CAAC,EAC7C,eAAe,GAAG,WAAW,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CACnE,GACD,YAAY,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IACpD,UAAU,IAAI,eAAe,CAAC;CAC/B,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * ------------------------------
3
- * Plugin Type System with Explicit Context Dependencies
4
- * ------------------------------
5
- *
6
- * This system makes context dependencies explicit to restore TypeScript's
7
- * ability to catch missing context at compile time.
8
- */
9
- export {};
@@ -1,33 +0,0 @@
1
- import { z } from "zod";
2
- export declare const AppKeyPropertySchema: z.ZodString & {
3
- _def: z.core.$ZodStringDef & import("..").PositionalMetadata;
4
- };
5
- export declare const ActionTypePropertySchema: z.ZodEnum<{
6
- search: "search";
7
- filter: "filter";
8
- read: "read";
9
- read_bulk: "read_bulk";
10
- run: "run";
11
- search_and_write: "search_and_write";
12
- search_or_write: "search_or_write";
13
- write: "write";
14
- }>;
15
- export declare const ActionKeyPropertySchema: z.ZodString;
16
- export declare const AuthenticationIdPropertySchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
17
- export declare const InputsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
18
- export declare const LimitPropertySchema: z.ZodDefault<z.ZodNumber>;
19
- export declare const OffsetPropertySchema: z.ZodDefault<z.ZodNumber>;
20
- export declare const OutputPropertySchema: z.ZodString;
21
- export declare const DebugPropertySchema: z.ZodDefault<z.ZodBoolean>;
22
- export declare const ParamsPropertySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
23
- export type AppKeyProperty = z.infer<typeof AppKeyPropertySchema>;
24
- export type ActionTypeProperty = z.infer<typeof ActionTypePropertySchema>;
25
- export type ActionKeyProperty = z.infer<typeof ActionKeyPropertySchema>;
26
- export type AuthenticationIdProperty = z.infer<typeof AuthenticationIdPropertySchema>;
27
- export type InputsProperty = z.infer<typeof InputsPropertySchema>;
28
- export type LimitProperty = z.infer<typeof LimitPropertySchema>;
29
- export type OffsetProperty = z.infer<typeof OffsetPropertySchema>;
30
- export type OutputProperty = z.infer<typeof OutputPropertySchema>;
31
- export type DebugProperty = z.infer<typeof DebugPropertySchema>;
32
- export type ParamsProperty = z.infer<typeof ParamsPropertySchema>;
33
- //# sourceMappingURL=properties.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/types/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;CAKhC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;EAW4B,CAAC;AAElE,eAAO,MAAM,uBAAuB,aAGA,CAAC;AAErC,eAAO,MAAM,8BAA8B,iDAEY,CAAC;AAExD,eAAO,MAAM,oBAAoB,wCAEa,CAAC;AAE/C,eAAO,MAAM,mBAAmB,2BAMgB,CAAC;AAEjD,eAAO,MAAM,oBAAoB,2BAKoB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,aAA0C,CAAC;AAE5E,eAAO,MAAM,mBAAmB,4BAGG,CAAC;AAEpC,eAAO,MAAM,oBAAoB,wCAEG,CAAC;AAGrC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,52 +0,0 @@
1
- import { z } from "zod";
2
- import { withPositional } from "../utils/schema-utils";
3
- import { MAX_PAGE_LIMIT } from "../constants";
4
- // Shared property definitions for common parameters across functions
5
- // These can be reused in function schemas without duplication
6
- export const AppKeyPropertySchema = withPositional(z
7
- .string()
8
- .min(1)
9
- .describe("App key (e.g., 'SlackCLIAPI' or slug like 'github')"));
10
- export const ActionTypePropertySchema = z
11
- .enum([
12
- "read",
13
- "read_bulk",
14
- "write",
15
- "run",
16
- "search",
17
- "search_or_write",
18
- "search_and_write",
19
- "filter",
20
- ])
21
- .describe("Action type that matches the action's defined type");
22
- export const ActionKeyPropertySchema = z
23
- .string()
24
- .min(1)
25
- .describe("Action key to execute");
26
- export const AuthenticationIdPropertySchema = z
27
- .union([z.string(), z.number().int().positive()])
28
- .describe("Authentication ID to use for this action");
29
- export const InputsPropertySchema = z
30
- .record(z.string(), z.unknown())
31
- .describe("Input parameters for the action");
32
- export const LimitPropertySchema = z
33
- .number()
34
- .int()
35
- .min(1)
36
- .max(MAX_PAGE_LIMIT)
37
- .default(50)
38
- .describe("Maximum number of items to return");
39
- export const OffsetPropertySchema = z
40
- .number()
41
- .int()
42
- .min(0)
43
- .default(0)
44
- .describe("Number of items to skip for pagination");
45
- export const OutputPropertySchema = z.string().describe("Output file path");
46
- export const DebugPropertySchema = z
47
- .boolean()
48
- .default(false)
49
- .describe("Enable debug logging");
50
- export const ParamsPropertySchema = z
51
- .record(z.string(), z.unknown())
52
- .describe("Additional parameters");
@@ -1,69 +0,0 @@
1
- /**
2
- * SDK-related types and interfaces
3
- */
4
- import type { EventCallback } from "./events";
5
- import type { EventEmissionConfig } from "../plugins/eventEmission";
6
- import type { Manifest } from "../plugins/manifest";
7
- export interface BaseSdkOptions {
8
- token?: string;
9
- getToken?: () => Promise<string | undefined>;
10
- onEvent?: EventCallback;
11
- fetch?: typeof fetch;
12
- baseUrl?: string;
13
- authBaseUrl?: string;
14
- authClientId?: string;
15
- trackingBaseUrl?: string;
16
- debug?: boolean;
17
- manifestPath?: string;
18
- manifest?: Manifest;
19
- eventEmission?: EventEmissionConfig;
20
- }
21
- import type { ListInputFieldsSdkFunction } from "../plugins/listInputFields/schemas";
22
- import type { GetAuthenticationSdkFunction } from "../plugins/getAuthentication/schemas";
23
- import type { FindFirstAuthenticationSdkFunction } from "../plugins/findFirstAuthentication/schemas";
24
- import type { FindUniqueAuthenticationSdkFunction } from "../plugins/findUniqueAuthentication/schemas";
25
- import type { RelayRequestSdkFunction } from "../plugins/request/schemas";
26
- import type { z } from "zod";
27
- import type { RegistryPluginProvides } from "../plugins/registry";
28
- import type { GetProfilePluginProvides } from "../plugins/getProfile";
29
- import type { EventEmissionProvides } from "../plugins/eventEmission";
30
- import type { ApiPluginProvides } from "../plugins/api";
31
- import type { AppsPluginProvides, ZapierSdkApps } from "../plugins/apps";
32
- import type { ActionProxy } from "../plugins/apps/schemas";
33
- import type { FetchPluginProvides } from "../plugins/fetch";
34
- import type { ListAppsPluginProvides } from "../plugins/listApps";
35
- import type { GetAppPluginProvides } from "../plugins/getApp";
36
- import type { ListActionsPluginProvides } from "../plugins/listActions";
37
- import type { GetActionPluginProvides } from "../plugins/getAction";
38
- import type { RunActionPluginProvides } from "../plugins/runAction";
39
- import type { ListAuthenticationsPluginProvides } from "../plugins/listAuthentications";
40
- import type { GetAuthenticationPluginProvides } from "../plugins/getAuthentication";
41
- import type { FindFirstAuthenticationPluginProvides } from "../plugins/findFirstAuthentication";
42
- import type { FindUniqueAuthenticationPluginProvides } from "../plugins/findUniqueAuthentication";
43
- import type { ListInputFieldsPluginProvides } from "../plugins/listInputFields";
44
- import type { GetInputFieldsSchemaPluginProvides } from "../plugins/getInputFieldsSchema";
45
- import type { ListInputFieldChoicesPluginProvides } from "../plugins/listInputFieldChoices";
46
- import type { RequestPluginProvides } from "../plugins/request";
47
- import type { GetSdkType } from "./plugin";
48
- import type { ManifestPluginProvides } from "../plugins/manifest";
49
- export interface FunctionRegistryEntry {
50
- name: string;
51
- type?: "list" | "item";
52
- itemType?: string;
53
- returnType?: string;
54
- inputSchema?: z.ZodSchema;
55
- inputParameters?: Array<{
56
- name: string;
57
- schema: z.ZodSchema;
58
- }>;
59
- outputSchema?: z.ZodSchema;
60
- categories: string[];
61
- resolvers?: Record<string, any>;
62
- packages?: string[];
63
- }
64
- export interface ZapierSdkFunctions extends ListInputFieldsSdkFunction, GetAuthenticationSdkFunction, FindFirstAuthenticationSdkFunction, FindUniqueAuthenticationSdkFunction, RelayRequestSdkFunction {
65
- }
66
- export interface ZapierSdk extends GetSdkType<RegistryPluginProvides & FetchPluginProvides & AppsPluginProvides & ListAppsPluginProvides & ManifestPluginProvides & GetAppPluginProvides & ListActionsPluginProvides & GetActionPluginProvides & RunActionPluginProvides & ListAuthenticationsPluginProvides & GetAuthenticationPluginProvides & FindFirstAuthenticationPluginProvides & FindUniqueAuthenticationPluginProvides & ListInputFieldsPluginProvides & GetInputFieldsSchemaPluginProvides & ListInputFieldChoicesPluginProvides & RequestPluginProvides & GetProfilePluginProvides & EventEmissionProvides & ApiPluginProvides> {
67
- apps: ActionProxy & ZapierSdkApps;
68
- }
69
- //# sourceMappingURL=sdk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/types/sdk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAGD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,KAAK,EAAE,kCAAkC,EAAE,MA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xB,qBAAqB,GACrB,iBAAiB,CACpB;IAED,IAAI,EAAE,WAAW,GAAG,aAAa,CAAC;CACnC"}
package/dist/types/sdk.js DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * SDK-related types and interfaces
3
- */
4
- export {};
@@ -1,105 +0,0 @@
1
- /**
2
- * Event emission types matching Avro schemas for SDK telemetry
3
- *
4
- * These interfaces correspond to the Avro schemas:
5
- * - application_lifecycle_event.avsc
6
- * - error_occurred_event.avsc
7
- */
8
- export interface BaseEvent {
9
- event_id: string;
10
- timestamp_ms: number;
11
- release_id: string;
12
- customuser_id?: number | null;
13
- account_id?: number | null;
14
- identity_id?: number | null;
15
- visitor_id?: string | null;
16
- correlation_id?: string | null;
17
- }
18
- export interface ErrorOccurredEvent extends BaseEvent {
19
- zap_id?: number | null;
20
- node_id?: number | null;
21
- selected_api?: string | null;
22
- app_id?: number | null;
23
- app_version_id?: number | null;
24
- error_message: string;
25
- error_type?: string | null;
26
- error_status_code?: number | null;
27
- error_stack_trace?: string | null;
28
- error_source_method?: string | null;
29
- error_source_file?: string | null;
30
- error_line_number?: number | null;
31
- operation_type?: string | null;
32
- operation_key?: string | null;
33
- error_severity?: string | null;
34
- is_user_facing: boolean;
35
- is_recoverable?: boolean | null;
36
- sdk_version?: string | null;
37
- error_metadata?: Record<string, string | null> | null;
38
- parent_error_id?: string | null;
39
- error_occurred_timestamp_ms?: number | null;
40
- error_code?: string | null;
41
- recovery_attempted?: boolean | null;
42
- recovery_action?: string | null;
43
- recovery_successful?: boolean | null;
44
- environment?: string | null;
45
- execution_time_before_error_ms?: number | null;
46
- }
47
- export interface ApplicationLifecycleEvent extends BaseEvent {
48
- lifecycle_event_type: "startup" | "exit" | "signal_termination";
49
- selected_api?: string | null;
50
- app_id?: number | null;
51
- app_version_id?: number | null;
52
- sdk_version?: string | null;
53
- cli_version?: string | null;
54
- exit_code?: number | null;
55
- signal_name?: string | null;
56
- uptime_ms?: number | null;
57
- memory_usage_bytes?: number | null;
58
- peak_memory_usage_bytes?: number | null;
59
- cpu_time_ms?: number | null;
60
- os_platform?: string | null;
61
- os_release?: string | null;
62
- os_architecture?: string | null;
63
- platform_versions?: Record<string, string | null> | null;
64
- environment?: string | null;
65
- is_ci_environment?: boolean | null;
66
- ci_platform?: string | null;
67
- session_id?: string | null;
68
- metadata?: Record<string, string | null> | null;
69
- process_argv?: (string | null)[] | null;
70
- is_graceful_shutdown?: boolean | null;
71
- shutdown_duration_ms?: number | null;
72
- active_requests_count?: number | null;
73
- }
74
- export interface MethodCalledEvent extends BaseEvent {
75
- method_name: string;
76
- method_module: string | null;
77
- execution_duration_ms: number;
78
- success_flag: boolean;
79
- error_message: string | null;
80
- error_type: string | null;
81
- argument_count: number;
82
- is_paginated: boolean;
83
- sdk_version: string;
84
- environment: string | null;
85
- selected_api: string | null;
86
- app_id: number | null;
87
- app_version_id: number | null;
88
- zap_id: number | null;
89
- node_id: number | null;
90
- operation_type: string | null;
91
- operation_key: string | null;
92
- call_context: string | null;
93
- is_retry: boolean;
94
- retry_attempt: number | null;
95
- argument_types: string[] | null;
96
- return_type: string | null;
97
- caller_method: string | null;
98
- call_stack_depth: number | null;
99
- is_synchronous: boolean | null;
100
- cpu_time_ms: number | null;
101
- memory_usage_bytes: number | null;
102
- }
103
- export type TelemetryEvent = ErrorOccurredEvent | ApplicationLifecycleEvent | MethodCalledEvent;
104
- export type TelemetryEventType = "error_occurred" | "application_lifecycle" | "method_called";
105
- //# sourceMappingURL=telemetry-events.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"telemetry-events.d.ts","sourceRoot":"","sources":["../../src/types/telemetry-events.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,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G,IAAI,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAGD,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,yBAAyB,GACzB,iBAAiB,CAAC;AAGtB,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,uBAAuB,GACvB,eAAe,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Event emission types matching Avro schemas for SDK telemetry
3
- *
4
- * These interfaces correspond to the Avro schemas:
5
- * - application_lifecycle_event.avsc
6
- * - error_occurred_event.avsc
7
- */
8
- export {};
@@ -1,31 +0,0 @@
1
- /**
2
- * Array utility functions for working with async iterators and arrays
3
- */
4
- /**
5
- * Creates an array from an async iterable, similar to Array.from() but for async iterables
6
- *
7
- * @param asyncIterable - An async iterable to convert to an array
8
- * @returns Promise that resolves to an array containing all items from the async iterable
9
- *
10
- * @example
11
- * async function* generateNumbers() {
12
- * yield 1;
13
- * yield 2;
14
- * yield 3;
15
- * }
16
- *
17
- * const numbers = await fromAsync(generateNumbers()); // [1, 2, 3]
18
- *
19
- * @example
20
- * // With async generator that fetches data
21
- * async function* fetchUsers() {
22
- * for (let page = 1; page <= 3; page++) {
23
- * const users = await fetchUsersPage(page);
24
- * yield* users;
25
- * }
26
- * }
27
- *
28
- * const allUsers = await fromAsync(fetchUsers());
29
- */
30
- export declare function toArrayFromAsync<T>(asyncIterable: AsyncIterable<T>): Promise<T[]>;
31
- //# sourceMappingURL=array-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-utils.d.ts","sourceRoot":"","sources":["../../src/utils/array-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,CAAC,EAAE,CAAC,CAQd"}
@@ -1,36 +0,0 @@
1
- /**
2
- * Array utility functions for working with async iterators and arrays
3
- */
4
- /**
5
- * Creates an array from an async iterable, similar to Array.from() but for async iterables
6
- *
7
- * @param asyncIterable - An async iterable to convert to an array
8
- * @returns Promise that resolves to an array containing all items from the async iterable
9
- *
10
- * @example
11
- * async function* generateNumbers() {
12
- * yield 1;
13
- * yield 2;
14
- * yield 3;
15
- * }
16
- *
17
- * const numbers = await fromAsync(generateNumbers()); // [1, 2, 3]
18
- *
19
- * @example
20
- * // With async generator that fetches data
21
- * async function* fetchUsers() {
22
- * for (let page = 1; page <= 3; page++) {
23
- * const users = await fetchUsersPage(page);
24
- * yield* users;
25
- * }
26
- * }
27
- *
28
- * const allUsers = await fromAsync(fetchUsers());
29
- */
30
- export async function toArrayFromAsync(asyncIterable) {
31
- const result = [];
32
- for await (const item of asyncIterable) {
33
- result.push(item);
34
- }
35
- return result;
36
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=array-utils.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/array-utils.test.ts"],"names":[],"mappings":""}
@@ -1,107 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { toArrayFromAsync } from "./array-utils";
3
- describe("array-utils", () => {
4
- describe("fromAsync", () => {
5
- it("should convert async generator to array", async () => {
6
- async function* generateNumbers() {
7
- yield 1;
8
- yield 2;
9
- yield 3;
10
- }
11
- const result = await toArrayFromAsync(generateNumbers());
12
- expect(result).toEqual([1, 2, 3]);
13
- });
14
- it("should handle empty async generator", async () => {
15
- async function* generateNothing() {
16
- // yield nothing
17
- }
18
- const result = await toArrayFromAsync(generateNothing());
19
- expect(result).toEqual([]);
20
- });
21
- it("should handle async generator with async operations", async () => {
22
- async function* generateWithDelay() {
23
- for (let i = 1; i <= 3; i++) {
24
- await new Promise((resolve) => setTimeout(resolve, 1)); // Small delay
25
- yield i * 10;
26
- }
27
- }
28
- const result = await toArrayFromAsync(generateWithDelay());
29
- expect(result).toEqual([10, 20, 30]);
30
- });
31
- it("should handle async generator that yields different types", async () => {
32
- async function* generateMixed() {
33
- yield "hello";
34
- yield 42;
35
- yield { name: "test" };
36
- yield [1, 2, 3];
37
- }
38
- const result = await toArrayFromAsync(generateMixed());
39
- expect(result).toEqual(["hello", 42, { name: "test" }, [1, 2, 3]]);
40
- });
41
- it("should handle async generator with error", async () => {
42
- async function* generateWithError() {
43
- yield 1;
44
- yield 2;
45
- throw new Error("Test error");
46
- }
47
- await expect(toArrayFromAsync(generateWithError())).rejects.toThrow("Test error");
48
- });
49
- it("should handle async iterable from array with Symbol.asyncIterator", async () => {
50
- const asyncIterable = {
51
- async *[Symbol.asyncIterator]() {
52
- for (const item of ["a", "b", "c"]) {
53
- yield item;
54
- }
55
- },
56
- };
57
- const result = await toArrayFromAsync(asyncIterable);
58
- expect(result).toEqual(["a", "b", "c"]);
59
- });
60
- it("should handle large async generator efficiently", async () => {
61
- async function* generateLargeSequence() {
62
- for (let i = 0; i < 1000; i++) {
63
- yield i;
64
- }
65
- }
66
- const result = await toArrayFromAsync(generateLargeSequence());
67
- expect(result).toHaveLength(1000);
68
- expect(result[0]).toBe(0);
69
- expect(result[999]).toBe(999);
70
- });
71
- it("should handle async generator that yields promises (promises are auto-awaited)", async () => {
72
- async function* generatePromises() {
73
- yield Promise.resolve("first");
74
- yield Promise.resolve("second");
75
- }
76
- const result = await toArrayFromAsync(generatePromises());
77
- // for await automatically awaits promises, so we get resolved values
78
- expect(result).toEqual(["first", "second"]);
79
- });
80
- it("should handle async generator that yields already resolved values", async () => {
81
- async function* generateResolvedValues() {
82
- yield await Promise.resolve("first");
83
- yield await Promise.resolve("second");
84
- }
85
- const result = await toArrayFromAsync(generateResolvedValues());
86
- // The resolved values are yielded directly
87
- expect(result).toEqual(["first", "second"]);
88
- });
89
- it("should maintain order of async generator items", async () => {
90
- async function* generateInOrder() {
91
- for (let i = 1; i <= 5; i++) {
92
- // Simulate varying delays
93
- await new Promise((resolve) => setTimeout(resolve, Math.random() * 10));
94
- yield `item-${i}`;
95
- }
96
- }
97
- const result = await toArrayFromAsync(generateInOrder());
98
- expect(result).toEqual([
99
- "item-1",
100
- "item-2",
101
- "item-3",
102
- "item-4",
103
- "item-5",
104
- ]);
105
- });
106
- });
107
- });
@@ -1,72 +0,0 @@
1
- /**
2
- * Batch Operation Utilities
3
- *
4
- * This module provides utilities for executing multiple async operations
5
- * with concurrency control and retry logic.
6
- */
7
- /**
8
- * Options for batch execution
9
- */
10
- export interface BatchOptions {
11
- /**
12
- * Maximum number of concurrent operations (default: 10)
13
- * Lower values are more "polite" but slower
14
- * Higher values are faster but risk rate limits
15
- */
16
- concurrency?: number;
17
- /**
18
- * Whether to retry failed operations (default: true)
19
- * When enabled, each operation gets up to MAX_CONSECUTIVE_ERRORS retries
20
- */
21
- retry?: boolean;
22
- /**
23
- * Delay in milliseconds between starting batches (default: 100ms)
24
- * Adds a small delay between concurrent batches to avoid burst patterns
25
- */
26
- batchDelay?: number;
27
- /**
28
- * Overall timeout for the entire batch operation in milliseconds (default: 180000ms / 3 minutes)
29
- * When exceeded, throws ZapierTimeoutError and stops processing remaining tasks
30
- */
31
- timeoutMs?: number;
32
- /**
33
- * Timeout for individual tasks in milliseconds (default: none)
34
- * When set, each task will be cancelled if it exceeds this duration
35
- * Tasks that timeout will be marked as rejected in the results
36
- */
37
- taskTimeoutMs?: number;
38
- }
39
- /**
40
- * Execute multiple async operations with concurrency limiting and retry logic
41
- *
42
- * This prevents overwhelming APIs by:
43
- * 1. Limiting concurrent operations (worker pool pattern)
44
- * 2. Adding small delays between batches to avoid burst detection
45
- * 3. Retrying failed operations with exponential backoff
46
- *
47
- * Problem Solved:
48
- * - Rate limit prevention: Steady stream instead of burst requests
49
- * - Connection pool management: Stays within browser/Node limits (~6-8 per domain)
50
- * - Resilience: Transient failures are retried automatically
51
- * - Observability: Returns detailed success/failure info for each operation
52
- *
53
- * Example Usage:
54
- * ```typescript
55
- * // Instead of Promise.allSettled (fires all at once):
56
- * const results = await Promise.allSettled(
57
- * actions.map(a => sdk.listInputFields(a))
58
- * );
59
- *
60
- * // Use batch (controlled concurrency):
61
- * const results = await batch(
62
- * actions.map(a => () => sdk.listInputFields(a)),
63
- * { concurrency: 10, retry: true }
64
- * );
65
- * ```
66
- *
67
- * @param tasks - Array of functions that return promises (NOT promises themselves!)
68
- * @param options - Configuration for concurrency and retry behavior
69
- * @returns Promise resolving to array of settled results (same as Promise.allSettled)
70
- */
71
- export declare function batch<T>(tasks: (() => Promise<T>)[], options?: BatchOptions): Promise<PromiseSettledResult<T>[]>;
72
- //# sourceMappingURL=batch-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batch-utils.d.ts","sourceRoot":"","sources":["../../src/utils/batch-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwBH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,KAAK,EAAE,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAC3B,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAuIpC"}