@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,66 +0,0 @@
1
- /**
2
- * Domain utility functions for working with app identifiers and data normalization
3
- */
4
- import type { Action, ImplementationMeta } from "../api/types";
5
- import type { ActionItem, AppItem } from "../types/domain";
6
- /**
7
- * Splits a versioned key to extract the base key and version
8
- *
9
- * @param versionedKey - Versioned key in format "KeyName@version" (e.g., "SlackCLIAPI@1.21.1")
10
- * @returns Tuple of [baseKey, version] or [versionedKey, undefined] if no @ symbol
11
- *
12
- * @example
13
- * splitVersionedKey("SlackCLIAPI@1.21.1") // ["SlackCLIAPI", "1.21.1"]
14
- * splitVersionedKey("SomeAPI") // ["SomeAPI", undefined]
15
- */
16
- export declare function splitVersionedKey(versionedKey: string): [string, string | undefined];
17
- /**
18
- * Converts a lightweight ImplementationMeta to a slimmed AppItem
19
- *
20
- * @param implementationMeta - Raw ImplementationMeta from API
21
- * @returns Normalized AppItem with essential fields only
22
- */
23
- export declare function normalizeImplementationMetaToAppItem(implementationMeta: ImplementationMeta): AppItem;
24
- export declare function normalizeActionItem(action: Action): ActionItem;
25
- /**
26
- * Groups app keys by their type based on format patterns
27
- *
28
- * @param appKeys Array of app key strings to categorize
29
- * @returns Object with arrays of keys grouped by type: selectedApi (CLI APIs), slug (everything else)
30
- *
31
- * @example
32
- * groupVersionedAppKeysByType([
33
- * 'FormatterCLIAPI@1.0.0',
34
- * 'slack',
35
- * 'AnotherAPI'
36
- * ])
37
- * // Returns: {
38
- * // selectedApi: ['FormatterCLIAPI@1.0.0', 'AnotherAPI'],
39
- * // slug: ['slack']
40
- * // }
41
- */
42
- export declare function groupVersionedAppKeysByType(appKeys: string[]): {
43
- selectedApi: string[];
44
- slug: string[];
45
- };
46
- export declare function groupAppKeysByType(appKeys: string[]): {
47
- selectedApi: string[];
48
- slug: string[];
49
- };
50
- export declare function isSlug(slug: string): boolean;
51
- export declare function isSnakeCasedSlug(slug: string): boolean;
52
- export declare function dashifySnakeCasedSlug(slug: string): string;
53
- export interface AppLocator {
54
- lookupAppKey: string;
55
- slug?: string;
56
- implementationName?: string;
57
- version?: string;
58
- }
59
- export interface ResolvedAppLocator extends AppLocator {
60
- implementationName: string;
61
- }
62
- export declare function isUuid(appKey: string): boolean;
63
- export declare function toAppLocator(appKey: string): AppLocator;
64
- export declare function isResolvedAppLocator(appLocator: AppLocator): appLocator is ResolvedAppLocator;
65
- export declare function toImplementationId(appLocator: ResolvedAppLocator): string;
66
- //# sourceMappingURL=domain-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain-utils.d.ts","sourceRoot":"","sources":["../../src/utils/domain-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,GACnB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAQ9B;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAYT;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAsB9D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IAC9D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAgCA;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IACrD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAUA;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOtD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY1D;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,kBAAmB,SAAQ,UAAU;IACpD,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAI9C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAkBvD;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,GACrB,UAAU,IAAI,kBAAkB,CAElC;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,CAEzE"}
@@ -1,164 +0,0 @@
1
- /**
2
- * Domain utility functions for working with app identifiers and data normalization
3
- */
4
- /**
5
- * Splits a versioned key to extract the base key and version
6
- *
7
- * @param versionedKey - Versioned key in format "KeyName@version" (e.g., "SlackCLIAPI@1.21.1")
8
- * @returns Tuple of [baseKey, version] or [versionedKey, undefined] if no @ symbol
9
- *
10
- * @example
11
- * splitVersionedKey("SlackCLIAPI@1.21.1") // ["SlackCLIAPI", "1.21.1"]
12
- * splitVersionedKey("SomeAPI") // ["SomeAPI", undefined]
13
- */
14
- export function splitVersionedKey(versionedKey) {
15
- const parts = versionedKey.split("@");
16
- if (parts.length >= 2) {
17
- const baseKey = parts[0];
18
- const version = parts.slice(1).join("@"); // Handle edge case of multiple @ symbols
19
- return [baseKey, version];
20
- }
21
- return [versionedKey, undefined];
22
- }
23
- /**
24
- * Converts a lightweight ImplementationMeta to a slimmed AppItem
25
- *
26
- * @param implementationMeta - Raw ImplementationMeta from API
27
- * @returns Normalized AppItem with essential fields only
28
- */
29
- export function normalizeImplementationMetaToAppItem(implementationMeta) {
30
- const [selectedApi, appVersion] = splitVersionedKey(implementationMeta.id);
31
- const { id, name, ...restOfImplementationMeta } = implementationMeta;
32
- return {
33
- ...restOfImplementationMeta,
34
- title: name,
35
- key: selectedApi,
36
- implementation_id: id,
37
- version: appVersion,
38
- };
39
- }
40
- export function normalizeActionItem(action) {
41
- const { name, type, selected_api: selectedApi } = action;
42
- // Split version from selected_api
43
- const [appKey, appVersion] = selectedApi
44
- ? splitVersionedKey(selectedApi)
45
- : ["", undefined];
46
- return {
47
- // Only include the fields we want - explicitly list them
48
- id: action.id,
49
- key: action.key,
50
- description: action.description,
51
- is_important: action.is_important,
52
- is_hidden: action.is_hidden,
53
- // Transformed fields
54
- app_key: appKey,
55
- app_version: appVersion,
56
- action_type: type,
57
- title: name, // Map name to title
58
- type: "action",
59
- };
60
- }
61
- /**
62
- * Groups app keys by their type based on format patterns
63
- *
64
- * @param appKeys Array of app key strings to categorize
65
- * @returns Object with arrays of keys grouped by type: selectedApi (CLI APIs), slug (everything else)
66
- *
67
- * @example
68
- * groupVersionedAppKeysByType([
69
- * 'FormatterCLIAPI@1.0.0',
70
- * 'slack',
71
- * 'AnotherAPI'
72
- * ])
73
- * // Returns: {
74
- * // selectedApi: ['FormatterCLIAPI@1.0.0', 'AnotherAPI'],
75
- * // slug: ['slack']
76
- * // }
77
- */
78
- export function groupVersionedAppKeysByType(appKeys) {
79
- const result = {
80
- selectedApi: [],
81
- slug: [],
82
- };
83
- // Use Sets to track seen keys for deduplication
84
- const seenSelectedApi = new Set();
85
- const seenSlugs = new Set();
86
- for (const key of appKeys) {
87
- const appLocator = toAppLocator(key);
88
- if (appLocator.slug) {
89
- // For slugs, we need to reconstruct the versioned slug
90
- const versionedSlug = appLocator.version
91
- ? `${appLocator.slug}@${appLocator.version}`
92
- : appLocator.slug;
93
- if (!seenSlugs.has(versionedSlug)) {
94
- seenSlugs.add(versionedSlug);
95
- result.slug.push(versionedSlug);
96
- }
97
- }
98
- else {
99
- // For implementation names (selectedApi)
100
- if (!seenSelectedApi.has(key)) {
101
- seenSelectedApi.add(key);
102
- result.selectedApi.push(key);
103
- }
104
- }
105
- }
106
- return result;
107
- }
108
- export function groupAppKeysByType(appKeys) {
109
- const grouped = groupVersionedAppKeysByType(appKeys);
110
- // Extract base keys and dedupe by using Set
111
- return {
112
- selectedApi: [
113
- ...new Set(grouped.selectedApi.map((key) => key.split("@")[0])),
114
- ],
115
- slug: [...new Set(grouped.slug.map((key) => key.split("@")[0]))],
116
- };
117
- }
118
- export function isSlug(slug) {
119
- return !!slug.match(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
120
- }
121
- export function isSnakeCasedSlug(slug) {
122
- // Allow leading underscore for slugs starting with a number.
123
- if (slug.match(/^_[0-9]/)) {
124
- slug = slug.slice(1);
125
- }
126
- return !!slug.match(/^[a-z0-9]+(?:_[a-z0-9]+)*$/);
127
- }
128
- export function dashifySnakeCasedSlug(slug) {
129
- // Only dashify if it's a valid snake_cased slug.
130
- if (!isSnakeCasedSlug(slug)) {
131
- return slug;
132
- }
133
- // Allow one leading underscore for slugs starting with a number.
134
- if (slug.startsWith("_")) {
135
- slug = slug.slice(1);
136
- }
137
- return slug.replace(/_/g, "-");
138
- }
139
- export function isUuid(appKey) {
140
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(appKey);
141
- }
142
- export function toAppLocator(appKey) {
143
- const [appKeyWithoutVersion, version] = splitVersionedKey(appKey);
144
- if (isUuid(appKeyWithoutVersion)) {
145
- throw new Error(`UUID app keys are not supported. Use app slug or implementation ID instead of: ${appKey}`);
146
- }
147
- const slug = isSlug(appKeyWithoutVersion)
148
- ? appKeyWithoutVersion
149
- : isSnakeCasedSlug(appKeyWithoutVersion)
150
- ? dashifySnakeCasedSlug(appKeyWithoutVersion)
151
- : undefined;
152
- return {
153
- lookupAppKey: appKeyWithoutVersion,
154
- slug,
155
- implementationName: slug ? undefined : appKeyWithoutVersion,
156
- version,
157
- };
158
- }
159
- export function isResolvedAppLocator(appLocator) {
160
- return !!appLocator.implementationName;
161
- }
162
- export function toImplementationId(appLocator) {
163
- return `${appLocator.implementationName}@${appLocator.version || "latest"}`;
164
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=domain-utils.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"domain-utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/domain-utils.test.ts"],"names":[],"mappings":""}
@@ -1,346 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { groupVersionedAppKeysByType, groupAppKeysByType, toAppLocator, } from "./domain-utils";
3
- describe("domain-utils", () => {
4
- describe("groupVersionedAppKeysByType", () => {
5
- it("should reject UUID app keys", () => {
6
- expect(() => {
7
- groupVersionedAppKeysByType(["61e47557-af91-4b0c-a3e0-c28606357664"]);
8
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: 61e47557-af91-4b0c-a3e0-c28606357664");
9
- });
10
- it("should categorize *API as selectedApi", () => {
11
- const result = groupVersionedAppKeysByType(["FormatterCLIAPI"]);
12
- expect(result).toEqual({
13
- selectedApi: ["FormatterCLIAPI"],
14
- slug: [],
15
- });
16
- });
17
- it("should categorize various API types as selectedApi", () => {
18
- const result = groupVersionedAppKeysByType([
19
- "FormatterCLIAPI",
20
- "SlackAPI",
21
- "GmailRESTAPI",
22
- "WebhookAPI",
23
- "AnythingWithUppercase",
24
- ]);
25
- expect(result).toEqual({
26
- selectedApi: [
27
- "FormatterCLIAPI",
28
- "SlackAPI",
29
- "GmailRESTAPI",
30
- "WebhookAPI",
31
- "AnythingWithUppercase",
32
- ],
33
- slug: [],
34
- });
35
- });
36
- it("should categorize lower-case strings as slugs, converting underscores to dashes", () => {
37
- const result = groupVersionedAppKeysByType([
38
- "slack",
39
- "google-sheets",
40
- "_100hires_ats",
41
- "amazon_redshift",
42
- ]);
43
- expect(result).toEqual({
44
- selectedApi: [],
45
- slug: ["slack", "google-sheets", "100hires-ats", "amazon-redshift"],
46
- });
47
- });
48
- it("should preserve version from API implementations", () => {
49
- const result = groupVersionedAppKeysByType(["FormatterCLIAPI@1.0.0"]);
50
- expect(result).toEqual({
51
- selectedApi: ["FormatterCLIAPI@1.0.0"],
52
- slug: [],
53
- });
54
- });
55
- it("should preserve version from slugs", () => {
56
- const result = groupVersionedAppKeysByType(["slack@2.1.0"]);
57
- expect(result).toEqual({
58
- selectedApi: [],
59
- slug: ["slack@2.1.0"],
60
- });
61
- });
62
- it("should handle mixed types correctly", () => {
63
- const result = groupVersionedAppKeysByType([
64
- "FormatterCLIAPI@1.0.0",
65
- "slack",
66
- "AnotherAPI",
67
- "gmail@3.0.1",
68
- ]);
69
- expect(result).toEqual({
70
- selectedApi: ["FormatterCLIAPI@1.0.0", "AnotherAPI"],
71
- slug: ["slack", "gmail@3.0.1"],
72
- });
73
- });
74
- it("should handle empty array", () => {
75
- const result = groupVersionedAppKeysByType([]);
76
- expect(result).toEqual({
77
- selectedApi: [],
78
- slug: [],
79
- });
80
- });
81
- it("should reject uppercase and lowercase UUIDs", () => {
82
- expect(() => {
83
- groupVersionedAppKeysByType(["61E47557-AF91-4B0C-A3E0-C28606357664"]);
84
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: 61E47557-AF91-4B0C-A3E0-C28606357664");
85
- expect(() => {
86
- groupVersionedAppKeysByType(["f47ac10b-58cc-4372-a567-0e02b2c3d479"]);
87
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: f47ac10b-58cc-4372-a567-0e02b2c3d479");
88
- });
89
- it("should categorize partial UUIDs as slugs", () => {
90
- const result = groupVersionedAppKeysByType([
91
- "61e47557-af91-4b0c-a3e0", // too short
92
- "61e47557-af91-4b0c-a3e0-c28606357664-extra", // too long
93
- ]);
94
- expect(result).toEqual({
95
- selectedApi: [],
96
- slug: [
97
- "61e47557-af91-4b0c-a3e0",
98
- "61e47557-af91-4b0c-a3e0-c28606357664-extra",
99
- ],
100
- });
101
- });
102
- it("should dedupe exact duplicate versioned keys", () => {
103
- const result = groupVersionedAppKeysByType([
104
- "slack@2.1.0",
105
- "FormatterCLIAPI@1.0.0",
106
- "slack@2.1.0", // exact duplicate
107
- "FormatterCLIAPI@1.0.0", // exact duplicate
108
- "slack@2.1.1",
109
- "FormatterCLIAPI@1.0.1",
110
- ]);
111
- expect(result).toEqual({
112
- selectedApi: ["FormatterCLIAPI@1.0.0", "FormatterCLIAPI@1.0.1"],
113
- slug: ["slack@2.1.0", "slack@2.1.1"],
114
- });
115
- });
116
- });
117
- describe("groupAppKeysByType", () => {
118
- it("should strip versions from API implementations", () => {
119
- const result = groupAppKeysByType(["FormatterCLIAPI@1.0.0"]);
120
- expect(result).toEqual({
121
- selectedApi: ["FormatterCLIAPI"],
122
- slug: [],
123
- });
124
- });
125
- it("should strip versions from slugs", () => {
126
- const result = groupAppKeysByType(["slack@2.1.0"]);
127
- expect(result).toEqual({
128
- selectedApi: [],
129
- slug: ["slack"],
130
- });
131
- });
132
- it("should handle mixed types and strip versions", () => {
133
- const result = groupAppKeysByType([
134
- "FormatterCLIAPI@1.0.0",
135
- "slack",
136
- "AnotherAPI@2.3.4",
137
- "gmail@3.0.1",
138
- ]);
139
- expect(result).toEqual({
140
- selectedApi: ["FormatterCLIAPI", "AnotherAPI"],
141
- slug: ["slack", "gmail"],
142
- });
143
- });
144
- it("should handle keys without versions", () => {
145
- const result = groupAppKeysByType([
146
- "FormatterCLIAPI",
147
- "slack",
148
- "AnotherAPI",
149
- ]);
150
- expect(result).toEqual({
151
- selectedApi: ["FormatterCLIAPI", "AnotherAPI"],
152
- slug: ["slack"],
153
- });
154
- });
155
- it("should reject UUID app keys (delegated to versioned function)", () => {
156
- expect(() => {
157
- groupAppKeysByType(["61e47557-af91-4b0c-a3e0-c28606357664"]);
158
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: 61e47557-af91-4b0c-a3e0-c28606357664");
159
- });
160
- it("should handle empty array", () => {
161
- const result = groupAppKeysByType([]);
162
- expect(result).toEqual({
163
- selectedApi: [],
164
- slug: [],
165
- });
166
- });
167
- it("should dedupe multiple versions of same base key", () => {
168
- const result = groupAppKeysByType([
169
- "slack@1.0.0",
170
- "FormatterCLIAPI@2.1.0",
171
- "slack@1.2.3", // different version of slack
172
- "FormatterCLIAPI@1.0.0", // different version of FormatterCLIAPI
173
- "gmail",
174
- ]);
175
- expect(result).toEqual({
176
- selectedApi: ["FormatterCLIAPI"], // only one instance despite multiple versions
177
- slug: ["slack", "gmail"], // only one slack despite multiple versions
178
- });
179
- });
180
- it("should dedupe exact duplicates after version stripping", () => {
181
- const result = groupAppKeysByType([
182
- "slack@1.0.0",
183
- "slack", // no version
184
- "slack@2.0.0", // different version
185
- "FormatterCLIAPI",
186
- "FormatterCLIAPI@1.5.0",
187
- ]);
188
- expect(result).toEqual({
189
- selectedApi: ["FormatterCLIAPI"],
190
- slug: ["slack"],
191
- });
192
- });
193
- });
194
- describe("toAppLocator", () => {
195
- it("should reject UUID app keys", () => {
196
- expect(() => {
197
- toAppLocator("61e47557-af91-4b0c-a3e0-c28606357664");
198
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: 61e47557-af91-4b0c-a3e0-c28606357664");
199
- });
200
- it("should reject UUID app keys with versions", () => {
201
- expect(() => {
202
- toAppLocator("61e47557-af91-4b0c-a3e0-c28606357664@1.0.0");
203
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: 61e47557-af91-4b0c-a3e0-c28606357664@1.0.0");
204
- });
205
- it("should reject uppercase UUID app keys", () => {
206
- expect(() => {
207
- toAppLocator("61E47557-AF91-4B0C-A3E0-C28606357664");
208
- }).toThrow("UUID app keys are not supported. Use app slug or implementation ID instead of: 61E47557-AF91-4B0C-A3E0-C28606357664");
209
- });
210
- it("should handle simple slug without version", () => {
211
- const result = toAppLocator("slack");
212
- expect(result).toEqual({
213
- lookupAppKey: "slack",
214
- slug: "slack",
215
- implementationName: undefined,
216
- version: undefined,
217
- });
218
- });
219
- it("should handle slug with version", () => {
220
- const result = toAppLocator("slack@1.0.0");
221
- expect(result).toEqual({
222
- lookupAppKey: "slack",
223
- slug: "slack",
224
- implementationName: undefined,
225
- version: "1.0.0",
226
- });
227
- });
228
- it("should handle dashified slug", () => {
229
- const result = toAppLocator("google-sheets");
230
- expect(result).toEqual({
231
- lookupAppKey: "google-sheets",
232
- slug: "google-sheets",
233
- implementationName: undefined,
234
- version: undefined,
235
- });
236
- });
237
- it("should handle dashified slug with version", () => {
238
- const result = toAppLocator("google-sheets@2.1.3");
239
- expect(result).toEqual({
240
- lookupAppKey: "google-sheets",
241
- slug: "google-sheets",
242
- implementationName: undefined,
243
- version: "2.1.3",
244
- });
245
- });
246
- it("should handle snake_cased slug and convert to dash", () => {
247
- const result = toAppLocator("google_sheets");
248
- expect(result).toEqual({
249
- lookupAppKey: "google_sheets",
250
- slug: "google-sheets",
251
- implementationName: undefined,
252
- version: undefined,
253
- });
254
- });
255
- it("should handle snake_cased slug with version and convert to dash", () => {
256
- const result = toAppLocator("google_sheets@2.1.3");
257
- expect(result).toEqual({
258
- lookupAppKey: "google_sheets",
259
- slug: "google-sheets",
260
- implementationName: undefined,
261
- version: "2.1.3",
262
- });
263
- });
264
- it("should handle leading underscore snake_cased slug", () => {
265
- const result = toAppLocator("_100hires_ats");
266
- expect(result).toEqual({
267
- lookupAppKey: "_100hires_ats",
268
- slug: "100hires-ats",
269
- implementationName: undefined,
270
- version: undefined,
271
- });
272
- });
273
- it("should handle leading underscore snake_cased slug with version", () => {
274
- const result = toAppLocator("_100hires_ats@3.0.0");
275
- expect(result).toEqual({
276
- lookupAppKey: "_100hires_ats",
277
- slug: "100hires-ats",
278
- implementationName: undefined,
279
- version: "3.0.0",
280
- });
281
- });
282
- it("should handle implementation name without version", () => {
283
- const result = toAppLocator("SlackCLIAPI");
284
- expect(result).toEqual({
285
- lookupAppKey: "SlackCLIAPI",
286
- slug: undefined,
287
- implementationName: "SlackCLIAPI",
288
- version: undefined,
289
- });
290
- });
291
- it("should handle implementation name with version", () => {
292
- const result = toAppLocator("SlackCLIAPI@1.29.0");
293
- expect(result).toEqual({
294
- lookupAppKey: "SlackCLIAPI",
295
- slug: undefined,
296
- implementationName: "SlackCLIAPI",
297
- version: "1.29.0",
298
- });
299
- });
300
- it("should handle edge cases with complex version numbers", () => {
301
- const result = toAppLocator("slack@1.2.3-beta.4+build.5");
302
- expect(result).toEqual({
303
- lookupAppKey: "slack",
304
- slug: "slack",
305
- implementationName: undefined,
306
- version: "1.2.3-beta.4+build.5",
307
- });
308
- });
309
- it("should handle single character app keys", () => {
310
- const result = toAppLocator("a");
311
- expect(result).toEqual({
312
- lookupAppKey: "a",
313
- slug: "a",
314
- implementationName: undefined,
315
- version: undefined,
316
- });
317
- });
318
- it("should handle app keys with numbers", () => {
319
- const result = toAppLocator("app123");
320
- expect(result).toEqual({
321
- lookupAppKey: "app123",
322
- slug: "app123",
323
- implementationName: undefined,
324
- version: undefined,
325
- });
326
- });
327
- it("should handle mixed case app keys that aren't implementation names", () => {
328
- const result = toAppLocator("SlackBot");
329
- expect(result).toEqual({
330
- lookupAppKey: "SlackBot",
331
- slug: undefined,
332
- implementationName: "SlackBot",
333
- version: undefined,
334
- });
335
- });
336
- it("should handle empty version (app key ending with @)", () => {
337
- const result = toAppLocator("slack@");
338
- expect(result).toEqual({
339
- lookupAppKey: "slack",
340
- slug: "slack",
341
- implementationName: undefined,
342
- version: "",
343
- });
344
- });
345
- });
346
- });
@@ -1,4 +0,0 @@
1
- export declare function resolve(path: string, basePath?: string): Promise<string>;
2
- export declare function writeFile(filePath: string, content: string): Promise<void>;
3
- export declare function readFile(filePath: string): Promise<string>;
4
- //# sourceMappingURL=file-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-utils.d.ts","sourceRoot":"","sources":["../../src/utils/file-utils.ts"],"names":[],"mappings":"AA6BA,wBAAsB,OAAO,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,MAAY,GACrB,OAAO,CAAC,MAAM,CAAC,CA8BjB;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAchE"}
@@ -1,74 +0,0 @@
1
- // In-memory filesystem fallback for browser environments
2
- const inMemoryFiles = {};
3
- // Lazy-loaded modules
4
- let fsPromises = null;
5
- let pathModule = null;
6
- async function loadFsPromises() {
7
- if (fsPromises)
8
- return fsPromises;
9
- try {
10
- fsPromises = await import("fs/promises");
11
- return fsPromises;
12
- }
13
- catch {
14
- return null;
15
- }
16
- }
17
- async function loadPathModule() {
18
- if (pathModule)
19
- return pathModule;
20
- try {
21
- pathModule = await import("path");
22
- return pathModule;
23
- }
24
- catch {
25
- return null;
26
- }
27
- }
28
- export async function resolve(path, basePath = "/") {
29
- const pathModule = await loadPathModule();
30
- if (pathModule) {
31
- return pathModule.resolve(path);
32
- }
33
- // Simple fallback path resolution assuming root "/" location
34
- if (path.startsWith("/")) {
35
- return path;
36
- }
37
- if (path.startsWith("./")) {
38
- // Remove ./ prefix and join to base
39
- const cleanPath = path.slice(2);
40
- return basePath.endsWith("/")
41
- ? basePath + cleanPath
42
- : basePath + "/" + cleanPath;
43
- }
44
- if (path.startsWith("../")) {
45
- // Remove ../ prefix since we're already at root
46
- const cleanPath = path.replace(/^(\.\.\/)+/, "");
47
- return basePath.endsWith("/")
48
- ? basePath + cleanPath
49
- : basePath + "/" + cleanPath;
50
- }
51
- // No slash prefix, join to base
52
- return basePath.endsWith("/") ? basePath + path : basePath + "/" + path;
53
- }
54
- export async function writeFile(filePath, content) {
55
- const fs = await loadFsPromises();
56
- if (fs) {
57
- await fs.writeFile(filePath, content, "utf8");
58
- return;
59
- }
60
- // Fallback to in-memory filesystem
61
- inMemoryFiles[filePath] = content;
62
- }
63
- export async function readFile(filePath) {
64
- const fs = await loadFsPromises();
65
- if (fs) {
66
- return await fs.readFile(filePath, "utf8");
67
- }
68
- // Fallback to in-memory filesystem
69
- const content = inMemoryFiles[filePath];
70
- if (content !== undefined) {
71
- return content;
72
- }
73
- throw new Error(`File not found: ${filePath}`);
74
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=file-utils.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/file-utils.test.ts"],"names":[],"mappings":""}