@adminide-stack/yantra-mobile 12.0.195 → 12.0.196-alpha.1

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 (382) hide show
  1. package/lib/components/CustomDrawer.js +17 -1
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/compute.js +57 -1
  4. package/lib/compute.js.map +1 -1
  5. package/lib/config/env-config.js +11 -1
  6. package/lib/config/env-config.js.map +1 -1
  7. package/lib/features/agent-chat/NativeAgentChat.js +7 -0
  8. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  9. package/lib/features/canvas/extendVideo.js +5 -1
  10. package/lib/features/canvas/extendVideo.js.map +1 -1
  11. package/lib/features/canvas/workflow/StepSheet.js +18 -1
  12. package/lib/features/canvas/workflow/StepSheet.js.map +1 -1
  13. package/lib/features/canvas/workflow/workflowSteps.js +102 -31
  14. package/lib/features/canvas/workflow/workflowSteps.js.map +1 -1
  15. package/lib/features/chat/ComposerMicSend.js +35 -0
  16. package/lib/features/chat/ComposerMicSend.js.map +1 -0
  17. package/lib/features/chat/ComposerModeSwitch.js +64 -1
  18. package/lib/features/chat/ComposerModeSwitch.js.map +1 -1
  19. package/lib/features/chat/askUser.js +6 -1
  20. package/lib/features/chat/askUser.js.map +1 -1
  21. package/lib/features/connectors/ConnectorSheet.js +443 -0
  22. package/lib/features/connectors/ConnectorSheet.js.map +1 -0
  23. package/lib/features/connectors/ConnectorsPage.js +320 -0
  24. package/lib/features/connectors/ConnectorsPage.js.map +1 -0
  25. package/lib/features/connectors/connectConnector.js +278 -0
  26. package/lib/features/connectors/connectConnector.js.map +1 -0
  27. package/lib/features/connectors/connectorCatalog.js +222 -0
  28. package/lib/features/connectors/connectorCatalog.js.map +1 -0
  29. package/lib/features/connectors/useConnectorCatalog.js +153 -0
  30. package/lib/features/connectors/useConnectorCatalog.js.map +1 -0
  31. package/lib/features/home/needsYou/HomeNeedsYou.js +618 -0
  32. package/lib/features/home/needsYou/HomeNeedsYou.js.map +1 -0
  33. package/lib/features/home/needsYou/chatFollowUps.js +333 -0
  34. package/lib/features/home/needsYou/chatFollowUps.js.map +1 -0
  35. package/lib/features/home/needsYou/format.js +47 -0
  36. package/lib/features/home/needsYou/format.js.map +1 -0
  37. package/lib/features/home/needsYou/historyText.js +40 -0
  38. package/lib/features/home/needsYou/historyText.js.map +1 -0
  39. package/lib/features/home/needsYou/inboxHighlights.js +152 -0
  40. package/lib/features/home/needsYou/inboxHighlights.js.map +1 -0
  41. package/lib/features/home/needsYou/panelsSettings.js +71 -0
  42. package/lib/features/home/needsYou/panelsSettings.js.map +1 -0
  43. package/lib/features/home/needsYou/ported/commandConfirmProtocol.js +13 -0
  44. package/lib/features/home/needsYou/ported/commandConfirmProtocol.js.map +1 -0
  45. package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js +91 -0
  46. package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js.map +1 -0
  47. package/lib/features/home/needsYou/ported/resultCardModels.js +659 -0
  48. package/lib/features/home/needsYou/ported/resultCardModels.js.map +1 -0
  49. package/lib/features/home/needsYou/types.js +1 -0
  50. package/lib/features/home/needsYou/types.js.map +1 -0
  51. package/lib/features/home/needsYou/useChatFollowUps.js +149 -0
  52. package/lib/features/home/needsYou/useChatFollowUps.js.map +1 -0
  53. package/lib/features/home/needsYou/useHomeBriefing.js +68 -0
  54. package/lib/features/home/needsYou/useHomeBriefing.js.map +1 -0
  55. package/lib/features/home/needsYou/useInboxHighlights.js +173 -0
  56. package/lib/features/home/needsYou/useInboxHighlights.js.map +1 -0
  57. package/lib/features/home/needsYou/usePanelsSettings.js +105 -0
  58. package/lib/features/home/needsYou/usePanelsSettings.js.map +1 -0
  59. package/lib/features/shopping/DealCard.js +8 -1
  60. package/lib/features/shopping/DealCard.js.map +1 -1
  61. package/lib/features/shopping/DealRails.js +24 -7
  62. package/lib/features/shopping/DealRails.js.map +1 -1
  63. package/lib/features/shopping/DealsPanel.js +1 -1
  64. package/lib/features/shopping/DealsPanel.js.map +1 -1
  65. package/lib/features/shopping/HolidayDealsPanel.js +529 -0
  66. package/lib/features/shopping/HolidayDealsPanel.js.map +1 -0
  67. package/lib/features/shopping/HolidayDealsParts.js +954 -0
  68. package/lib/features/shopping/HolidayDealsParts.js.map +1 -0
  69. package/lib/features/shopping/HolidayOffers.js +351 -0
  70. package/lib/features/shopping/HolidayOffers.js.map +1 -0
  71. package/lib/features/shopping/ProductCard.js +80 -14
  72. package/lib/features/shopping/ProductCard.js.map +1 -1
  73. package/lib/features/shopping/ProductDetailSheet.js +22 -3
  74. package/lib/features/shopping/ProductDetailSheet.js.map +1 -1
  75. package/lib/features/shopping/SavedPanel.js +341 -5
  76. package/lib/features/shopping/SavedPanel.js.map +1 -1
  77. package/lib/features/shopping/SearchResults.js +8 -2
  78. package/lib/features/shopping/SearchResults.js.map +1 -1
  79. package/lib/features/shopping/ShoppingAgentChatPane.js +12 -0
  80. package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
  81. package/lib/features/shopping/ShoppingExperience.js +56 -19
  82. package/lib/features/shopping/ShoppingExperience.js.map +1 -1
  83. package/lib/features/shopping/TrendingSections.js +13 -4
  84. package/lib/features/shopping/TrendingSections.js.map +1 -1
  85. package/lib/features/shopping/WatchlistPanel.js +61 -5
  86. package/lib/features/shopping/WatchlistPanel.js.map +1 -1
  87. package/lib/features/shopping/catalog.js +41 -2
  88. package/lib/features/shopping/catalog.js.map +1 -1
  89. package/lib/features/shopping/chat/brainRouter.js +14 -0
  90. package/lib/features/shopping/chat/brainRouter.js.map +1 -1
  91. package/lib/features/shopping/chat/shoppingTurn.js +88 -16
  92. package/lib/features/shopping/chat/shoppingTurn.js.map +1 -1
  93. package/lib/features/shopping/hooks/useHolidayDeals.js +388 -0
  94. package/lib/features/shopping/hooks/useHolidayDeals.js.map +1 -0
  95. package/lib/features/shopping/hooks/useProductMedia.js +33 -6
  96. package/lib/features/shopping/hooks/useProductMedia.js.map +1 -1
  97. package/lib/features/shopping/hooks/useShoppingHistorySync.js +8 -4
  98. package/lib/features/shopping/hooks/useShoppingHistorySync.js.map +1 -1
  99. package/lib/features/shopping/hooks/useTrendingProducts.js +11 -3
  100. package/lib/features/shopping/hooks/useTrendingProducts.js.map +1 -1
  101. package/lib/features/shopping/savedProducts.js +76 -6
  102. package/lib/features/shopping/savedProducts.js.map +1 -1
  103. package/lib/features/shopping/services/aiRelevance.js +212 -0
  104. package/lib/features/shopping/services/aiRelevance.js.map +1 -0
  105. package/lib/features/shopping/services/blackFriday.js +301 -0
  106. package/lib/features/shopping/services/blackFriday.js.map +1 -0
  107. package/lib/features/shopping/services/blackFridayBrowserSites.js +137 -0
  108. package/lib/features/shopping/services/blackFridayBrowserSites.js.map +1 -0
  109. package/lib/features/shopping/services/catalogProductSearch.js +21 -3
  110. package/lib/features/shopping/services/catalogProductSearch.js.map +1 -1
  111. package/lib/features/shopping/services/holidayDeals.js +143 -0
  112. package/lib/features/shopping/services/holidayDeals.js.map +1 -0
  113. package/lib/features/shopping/services/mediaShape.js +7 -0
  114. package/lib/features/shopping/services/mediaShape.js.map +1 -0
  115. package/lib/features/shopping/services/modelStep.js +95 -0
  116. package/lib/features/shopping/services/modelStep.js.map +1 -0
  117. package/lib/features/shopping/services/modelWords.js +14 -0
  118. package/lib/features/shopping/services/modelWords.js.map +1 -0
  119. package/lib/features/shopping/services/productAvailability.js +5 -1
  120. package/lib/features/shopping/services/productAvailability.js.map +1 -1
  121. package/lib/features/shopping/services/productFilters.js +2 -2
  122. package/lib/features/shopping/services/productFilters.js.map +1 -1
  123. package/lib/features/shopping/services/productMedia.js +103 -18
  124. package/lib/features/shopping/services/productMedia.js.map +1 -1
  125. package/lib/features/shopping/services/retailerUrl.js +11 -8
  126. package/lib/features/shopping/services/retailerUrl.js.map +1 -1
  127. package/lib/features/shopping/services/salesDealsStore.js +3 -2
  128. package/lib/features/shopping/services/salesDealsStore.js.map +1 -1
  129. package/lib/features/shopping/services/savedReads.js +82 -0
  130. package/lib/features/shopping/services/savedReads.js.map +1 -0
  131. package/lib/features/shopping/services/searchCardFields.js +2 -0
  132. package/lib/features/shopping/services/searchCardFields.js.map +1 -1
  133. package/lib/features/shopping/services/searchRelevance.js +154 -24
  134. package/lib/features/shopping/services/searchRelevance.js.map +1 -1
  135. package/lib/features/shopping/services/secondHand.js +12 -0
  136. package/lib/features/shopping/services/secondHand.js.map +1 -0
  137. package/lib/features/shopping/services/shoppingProductSearch.js +82 -10
  138. package/lib/features/shopping/services/shoppingProductSearch.js.map +1 -1
  139. package/lib/features/shopping/services/shoppingSearchConnectorClient.js +14 -1
  140. package/lib/features/shopping/services/shoppingSearchConnectorClient.js.map +1 -1
  141. package/lib/features/shopping/services/shoppingSubgraph.js +2 -1
  142. package/lib/features/shopping/services/shoppingSubgraph.js.map +1 -1
  143. package/lib/features/shopping/services/storedGalleries.js +130 -0
  144. package/lib/features/shopping/services/storedGalleries.js.map +1 -0
  145. package/lib/features/shopping/services/usedSites.js +263 -0
  146. package/lib/features/shopping/services/usedSites.js.map +1 -0
  147. package/lib/features/shopping/services/verifyProducts.js +3 -3
  148. package/lib/features/shopping/services/verifyProducts.js.map +1 -1
  149. package/lib/features/shopping/services/watchDeal.js +61 -0
  150. package/lib/features/shopping/services/watchDeal.js.map +1 -0
  151. package/lib/features/shopping/shoppingRuntime.js +7 -2
  152. package/lib/features/shopping/shoppingRuntime.js.map +1 -1
  153. package/lib/features/shopping/state/accountCaches.js +20 -0
  154. package/lib/features/shopping/state/accountCaches.js.map +1 -0
  155. package/lib/features/shopping/state/holidayDealsRequest.js +22 -0
  156. package/lib/features/shopping/state/holidayDealsRequest.js.map +1 -0
  157. package/lib/features/shopping/tutorials/ShoppingTutorialDock.js +1 -1
  158. package/lib/features/shopping/tutorials/ShoppingTutorialDock.js.map +1 -1
  159. package/lib/features/shopping/tutorials/shoppingTutorials.js +2 -0
  160. package/lib/features/shopping/tutorials/shoppingTutorials.js.map +1 -1
  161. package/lib/features/shopping/useShoppingSearch.js +74 -18
  162. package/lib/features/shopping/useShoppingSearch.js.map +1 -1
  163. package/lib/features/team-chat/TeamChatExperience.js +474 -0
  164. package/lib/features/team-chat/TeamChatExperience.js.map +1 -0
  165. package/lib/features/team-chat/api/client.js +198 -0
  166. package/lib/features/team-chat/api/client.js.map +1 -0
  167. package/lib/features/team-chat/api/live.js +160 -0
  168. package/lib/features/team-chat/api/live.js.map +1 -0
  169. package/lib/features/team-chat/api/ops.js +241 -0
  170. package/lib/features/team-chat/api/ops.js.map +1 -0
  171. package/lib/features/team-chat/app.js +12 -0
  172. package/lib/features/team-chat/app.js.map +1 -0
  173. package/lib/features/team-chat/components/Avatar.js +107 -0
  174. package/lib/features/team-chat/components/Avatar.js.map +1 -0
  175. package/lib/features/team-chat/components/Composer.js +641 -0
  176. package/lib/features/team-chat/components/Composer.js.map +1 -0
  177. package/lib/features/team-chat/components/Dialogs.js +598 -0
  178. package/lib/features/team-chat/components/Dialogs.js.map +1 -0
  179. package/lib/features/team-chat/components/EmojiPicker.js +165 -0
  180. package/lib/features/team-chat/components/EmojiPicker.js.map +1 -0
  181. package/lib/features/team-chat/components/MessageItem.js +658 -0
  182. package/lib/features/team-chat/components/MessageItem.js.map +1 -0
  183. package/lib/features/team-chat/components/MessageList.js +248 -0
  184. package/lib/features/team-chat/components/MessageList.js.map +1 -0
  185. package/lib/features/team-chat/components/Mrkdwn.js +228 -0
  186. package/lib/features/team-chat/components/Mrkdwn.js.map +1 -0
  187. package/lib/features/team-chat/components/QuickSwitcher.js +215 -0
  188. package/lib/features/team-chat/components/QuickSwitcher.js.map +1 -0
  189. package/lib/features/team-chat/components/ui.js +662 -0
  190. package/lib/features/team-chat/components/ui.js.map +1 -0
  191. package/lib/features/team-chat/nativeTeamChatRegistry.js +15 -0
  192. package/lib/features/team-chat/nativeTeamChatRegistry.js.map +1 -0
  193. package/lib/features/team-chat/state/fetched.js +39 -0
  194. package/lib/features/team-chat/state/fetched.js.map +1 -0
  195. package/lib/features/team-chat/state/lists.js +230 -0
  196. package/lib/features/team-chat/state/lists.js.map +1 -0
  197. package/lib/features/team-chat/state/store.js +1108 -0
  198. package/lib/features/team-chat/state/store.js.map +1 -0
  199. package/lib/features/team-chat/state/useChannelDirectory.js +21 -0
  200. package/lib/features/team-chat/state/useChannelDirectory.js.map +1 -0
  201. package/lib/features/team-chat/theme.js +77 -0
  202. package/lib/features/team-chat/theme.js.map +1 -0
  203. package/lib/features/team-chat/utils/composeText.js +72 -0
  204. package/lib/features/team-chat/utils/composeText.js.map +1 -0
  205. package/lib/features/team-chat/utils/emoji.js +369 -0
  206. package/lib/features/team-chat/utils/emoji.js.map +1 -0
  207. package/lib/features/team-chat/utils/format.js +109 -0
  208. package/lib/features/team-chat/utils/format.js.map +1 -0
  209. package/lib/features/team-chat/utils/messageRows.js +24 -0
  210. package/lib/features/team-chat/utils/messageRows.js.map +1 -0
  211. package/lib/features/team-chat/utils/mrkdwn.js +222 -0
  212. package/lib/features/team-chat/utils/mrkdwn.js.map +1 -0
  213. package/lib/features/team-chat/utils/notify.js +47 -0
  214. package/lib/features/team-chat/utils/notify.js.map +1 -0
  215. package/lib/features/team-chat/utils/pickFiles.js +81 -0
  216. package/lib/features/team-chat/utils/pickFiles.js.map +1 -0
  217. package/lib/features/team-chat/views/ActivityView.js +235 -0
  218. package/lib/features/team-chat/views/ActivityView.js.map +1 -0
  219. package/lib/features/team-chat/views/BrowseView.js +179 -0
  220. package/lib/features/team-chat/views/BrowseView.js.map +1 -0
  221. package/lib/features/team-chat/views/ChannelView.js +475 -0
  222. package/lib/features/team-chat/views/ChannelView.js.map +1 -0
  223. package/lib/features/team-chat/views/DetailsPane.js +816 -0
  224. package/lib/features/team-chat/views/DetailsPane.js.map +1 -0
  225. package/lib/features/team-chat/views/DraftsView.js +212 -0
  226. package/lib/features/team-chat/views/DraftsView.js.map +1 -0
  227. package/lib/features/team-chat/views/FilesView.js +152 -0
  228. package/lib/features/team-chat/views/FilesView.js.map +1 -0
  229. package/lib/features/team-chat/views/NewMessageView.js +286 -0
  230. package/lib/features/team-chat/views/NewMessageView.js.map +1 -0
  231. package/lib/features/team-chat/views/PeopleView.js +118 -0
  232. package/lib/features/team-chat/views/PeopleView.js.map +1 -0
  233. package/lib/features/team-chat/views/ProfilePane.js +220 -0
  234. package/lib/features/team-chat/views/ProfilePane.js.map +1 -0
  235. package/lib/features/team-chat/views/SavedView.js +113 -0
  236. package/lib/features/team-chat/views/SavedView.js.map +1 -0
  237. package/lib/features/team-chat/views/SearchView.js +307 -0
  238. package/lib/features/team-chat/views/SearchView.js.map +1 -0
  239. package/lib/features/team-chat/views/Sidebar.js +368 -0
  240. package/lib/features/team-chat/views/Sidebar.js.map +1 -0
  241. package/lib/features/team-chat/views/ThreadPane.js +139 -0
  242. package/lib/features/team-chat/views/ThreadPane.js.map +1 -0
  243. package/lib/features/team-chat/views/ThreadsView.js +157 -0
  244. package/lib/features/team-chat/views/ThreadsView.js.map +1 -0
  245. package/lib/features/webbuilder/WebBuilderExperience.js +276 -42
  246. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  247. package/lib/features/webbuilder/buildFragments.js +10 -4
  248. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  249. package/lib/features/webbuilder/components/AssetChips.js +61 -0
  250. package/lib/features/webbuilder/components/AssetChips.js.map +1 -0
  251. package/lib/features/webbuilder/components/AssetSiteChooser.js +100 -0
  252. package/lib/features/webbuilder/components/AssetSiteChooser.js.map +1 -0
  253. package/lib/features/webbuilder/components/CommentsLayer.js +485 -0
  254. package/lib/features/webbuilder/components/CommentsLayer.js.map +1 -0
  255. package/lib/features/webbuilder/components/Composer.js +16 -2
  256. package/lib/features/webbuilder/components/Composer.js.map +1 -1
  257. package/lib/features/webbuilder/components/ComposerModeSwitch.js +71 -0
  258. package/lib/features/webbuilder/components/ComposerModeSwitch.js.map +1 -0
  259. package/lib/features/webbuilder/components/MyAssetsPicker.js +500 -0
  260. package/lib/features/webbuilder/components/MyAssetsPicker.js.map +1 -0
  261. package/lib/features/webbuilder/components/PlanDocument.js +165 -0
  262. package/lib/features/webbuilder/components/PlanDocument.js.map +1 -0
  263. package/lib/features/webbuilder/components/PlanDraftCard.js +205 -0
  264. package/lib/features/webbuilder/components/PlanDraftCard.js.map +1 -0
  265. package/lib/features/webbuilder/components/PlanView.js +788 -0
  266. package/lib/features/webbuilder/components/PlanView.js.map +1 -0
  267. package/lib/features/webbuilder/components/PreviewConsoleSheet.js +334 -0
  268. package/lib/features/webbuilder/components/PreviewConsoleSheet.js.map +1 -0
  269. package/lib/features/webbuilder/components/PreviewFrame.js +45 -3
  270. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  271. package/lib/features/webbuilder/components/PreviewScreen.js +94 -10
  272. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  273. package/lib/features/webbuilder/components/ProjectChat.js +84 -14
  274. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  275. package/lib/features/webbuilder/components/StudioHome.js +69 -6
  276. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  277. package/lib/features/webbuilder/components/StyleDirectionsSheet.js +291 -0
  278. package/lib/features/webbuilder/components/StyleDirectionsSheet.js.map +1 -0
  279. package/lib/features/webbuilder/components/VersionChangesView.js +574 -0
  280. package/lib/features/webbuilder/components/VersionChangesView.js.map +1 -0
  281. package/lib/features/webbuilder/components/VersionPreviewView.js +186 -0
  282. package/lib/features/webbuilder/components/VersionPreviewView.js.map +1 -0
  283. package/lib/features/webbuilder/components/VersionsSheet.js +673 -16
  284. package/lib/features/webbuilder/components/VersionsSheet.js.map +1 -1
  285. package/lib/features/webbuilder/connectorTemplates.js +6 -1
  286. package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
  287. package/lib/features/webbuilder/myAssets.js +101 -0
  288. package/lib/features/webbuilder/myAssets.js.map +1 -0
  289. package/lib/features/webbuilder/planChat.js +146 -0
  290. package/lib/features/webbuilder/planChat.js.map +1 -0
  291. package/lib/features/webbuilder/planDocument.js +89 -0
  292. package/lib/features/webbuilder/planDocument.js.map +1 -0
  293. package/lib/features/webbuilder/planStore.js +55 -0
  294. package/lib/features/webbuilder/planStore.js.map +1 -0
  295. package/lib/features/webbuilder/previewCommentsScript.js +218 -0
  296. package/lib/features/webbuilder/previewCommentsScript.js.map +1 -0
  297. package/lib/features/webbuilder/previewConsoleScript.js +39 -0
  298. package/lib/features/webbuilder/previewConsoleScript.js.map +1 -0
  299. package/lib/features/webbuilder/styleDirections.js +85 -0
  300. package/lib/features/webbuilder/styleDirections.js.map +1 -0
  301. package/lib/features/webbuilder/useCanvasComments.js +335 -0
  302. package/lib/features/webbuilder/useCanvasComments.js.map +1 -0
  303. package/lib/features/webbuilder/useCatalogTemplates.js +37 -0
  304. package/lib/features/webbuilder/useCatalogTemplates.js.map +1 -0
  305. package/lib/features/webbuilder/usePlanMode.js +145 -0
  306. package/lib/features/webbuilder/usePlanMode.js.map +1 -0
  307. package/lib/features/webbuilder/useStyleDirections.js +112 -0
  308. package/lib/features/webbuilder/useStyleDirections.js.map +1 -0
  309. package/lib/features/webbuilder/web/assets/assetsApi.js +174 -0
  310. package/lib/features/webbuilder/web/assets/assetsApi.js.map +1 -0
  311. package/lib/features/webbuilder/web/assets/assetsApi.ts +173 -0
  312. package/lib/features/webbuilder/web/assets/myAssets.js +341 -0
  313. package/lib/features/webbuilder/web/assets/myAssets.js.map +1 -0
  314. package/lib/features/webbuilder/web/assets/myAssets.ts +396 -0
  315. package/lib/features/webbuilder/web/canvas/elementName.js +46 -0
  316. package/lib/features/webbuilder/web/canvas/elementName.js.map +1 -0
  317. package/lib/features/webbuilder/web/canvas/visualEditorBridge.js +95 -0
  318. package/lib/features/webbuilder/web/canvas/visualEditorBridge.js.map +1 -0
  319. package/lib/features/webbuilder/web/chat/agentTurn.js +24 -0
  320. package/lib/features/webbuilder/web/chat/agentTurn.js.map +1 -0
  321. package/lib/features/webbuilder/web/chat/planMode.js +164 -0
  322. package/lib/features/webbuilder/web/chat/planMode.js.map +1 -0
  323. package/lib/features/webbuilder/web/chat/realPlans.js +66 -0
  324. package/lib/features/webbuilder/web/chat/realPlans.js.map +1 -0
  325. package/lib/features/webbuilder/web/comments/comments.js +336 -0
  326. package/lib/features/webbuilder/web/comments/comments.js.map +1 -0
  327. package/lib/features/webbuilder/web/comments/commentsApi.js +59 -0
  328. package/lib/features/webbuilder/web/comments/commentsApi.js.map +1 -0
  329. package/lib/features/webbuilder/web/components/planView.js +21 -0
  330. package/lib/features/webbuilder/web/components/planView.js.map +1 -0
  331. package/lib/features/webbuilder/web/console/consolePanel.js +43 -0
  332. package/lib/features/webbuilder/web/console/consolePanel.js.map +1 -0
  333. package/lib/features/webbuilder/web/console/previewConsole.js +256 -0
  334. package/lib/features/webbuilder/web/console/previewConsole.js.map +1 -0
  335. package/lib/features/webbuilder/web/console/usePreviewConsole.js +147 -0
  336. package/lib/features/webbuilder/web/console/usePreviewConsole.js.map +1 -0
  337. package/lib/features/webbuilder/web/design/directions.js +419 -1
  338. package/lib/features/webbuilder/web/design/directions.js.map +1 -1
  339. package/lib/features/webbuilder/web/history/diffActions.js +222 -0
  340. package/lib/features/webbuilder/web/history/diffActions.js.map +1 -0
  341. package/lib/features/webbuilder/web/history/diffHighlight.js +18 -0
  342. package/lib/features/webbuilder/web/history/diffHighlight.js.map +1 -0
  343. package/lib/features/webbuilder/web/history/versionActions.js +272 -0
  344. package/lib/features/webbuilder/web/history/versionActions.js.map +1 -0
  345. package/lib/features/webbuilder/web/history/versionDiff.js +338 -0
  346. package/lib/features/webbuilder/web/history/versionDiff.js.map +1 -0
  347. package/lib/features/webbuilder/web/history/versionPreview.js +83 -0
  348. package/lib/features/webbuilder/web/history/versionPreview.js.map +1 -0
  349. package/lib/features/webbuilder/web/history/versionPreviewMachine.js +150 -0
  350. package/lib/features/webbuilder/web/history/versionPreviewMachine.js.map +1 -0
  351. package/lib/features/webbuilder/web/history/versions.js +326 -1
  352. package/lib/features/webbuilder/web/history/versions.js.map +1 -1
  353. package/lib/features/webbuilder/web/hosted/hostedTurn.js +36 -0
  354. package/lib/features/webbuilder/web/hosted/hostedTurn.js.map +1 -0
  355. package/lib/features/webbuilder/web/studio/brandKit.js +25 -0
  356. package/lib/features/webbuilder/web/studio/brandKit.js.map +1 -0
  357. package/lib/features/webbuilder/web/utils/promptSafe.js +15 -0
  358. package/lib/features/webbuilder/web/utils/promptSafe.js.map +1 -0
  359. package/lib/features/webbuilder/web/webServices.js +3 -1
  360. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  361. package/lib/index.js +1 -1
  362. package/lib/index.js.map +1 -1
  363. package/lib/routes.json +55 -0
  364. package/lib/screens/Account/index.js +13 -5
  365. package/lib/screens/Account/index.js.map +1 -1
  366. package/lib/screens/Chat/index.js +16 -0
  367. package/lib/screens/Chat/index.js.map +1 -1
  368. package/lib/screens/Home/HomeScreen.js +202 -39
  369. package/lib/screens/Home/HomeScreen.js.map +1 -1
  370. package/lib/screens/Home/components/HomeHero.js +52 -38
  371. package/lib/screens/Home/components/HomeHero.js.map +1 -1
  372. package/lib/screens/Home/components/homeCatalog.js +8 -1
  373. package/lib/screens/Home/components/homeCatalog.js.map +1 -1
  374. package/lib/screens/TeamChat/index.js +41 -0
  375. package/lib/screens/TeamChat/index.js.map +1 -0
  376. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +9 -2
  377. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
  378. package/lib/screens/WebBuilderNative/index.js +13 -3
  379. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  380. package/lib/screens/WebBuilderNative/useConnectorTemplates.js +2 -2
  381. package/lib/screens/WebBuilderNative/useConnectorTemplates.js.map +1 -1
  382. package/package.json +4 -4
@@ -0,0 +1,278 @@
1
+ import*as WebBrowser from'expo-web-browser';import {CONNECTOR_CONNECT_APP_RETURN_URL}from'common';import {DeleteFormBuilderCredentialDocument,CreateFormBuilderCredentialDocument,EnsureFormBuilderCredentialOAuthAccountConfigDocument,ConnectConnectorOAuthDocument,CancelConnectorOAuthDocument,CompleteFormBuilderCredentialOAuthConnectionDocument,ConnectorOAuthOutcomeDocument}from'common/graphql';import {oauthTemplateConfigKey,listOf,apiKeySecretKey}from'./connectorCatalog.js';const OUTCOME_POLL_MS = 2e3;
2
+ const SETTLE_AFTER_CLOSE_MS = 6e3;
3
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
4
+ function errorText(error, fallback) {
5
+ const message = error instanceof Error ? error.message : typeof error === "string" ? error : "";
6
+ return message.replace(/^GraphQL error:\s*/i, "").trim() || fallback;
7
+ }
8
+ function providerOf(template) {
9
+ return String(template.connectorProviderId || template.key).trim();
10
+ }
11
+ function credentialMetadata(template, connectorType) {
12
+ return {
13
+ provider: providerOf(template),
14
+ connectorType,
15
+ formId: template.formId,
16
+ formExtensionId: template.formExtensionId,
17
+ formFunctionId: template.formExtensionId,
18
+ formIcon: template.formIcon || null
19
+ };
20
+ }
21
+ async function deleteQuietly(client, id) {
22
+ try {
23
+ await client.mutate({
24
+ mutation: DeleteFormBuilderCredentialDocument,
25
+ variables: {
26
+ id
27
+ }
28
+ });
29
+ } catch (error) {
30
+ console.warn("[connectors] could not remove an unfinished connector", id, error);
31
+ }
32
+ }
33
+ async function readOutcome(client, state) {
34
+ var _a, _b;
35
+ try {
36
+ const result = await client.query({
37
+ query: ConnectorOAuthOutcomeDocument,
38
+ variables: {
39
+ state
40
+ },
41
+ fetchPolicy: "no-cache"
42
+ });
43
+ return (_b = (_a = result.data) == null ? void 0 : _a.connectorOAuthOutcome) != null ? _b : null;
44
+ } catch (e) {
45
+ return null;
46
+ }
47
+ }
48
+ async function connectWithOAuth(client, template, name, scope) {
49
+ var _a, _b, _c, _d, _e, _f, _g, _h;
50
+ const provider = providerOf(template);
51
+ const connectorType = String(template.connectorType || "app");
52
+ const templateConfigKey = oauthTemplateConfigKey(template);
53
+ const usePKCE = template.connectorUsePKCE !== false;
54
+ const clientAuthMethod = template.connectorClientAuthMethod === "client_secret_basic" ? "client_secret_basic" : "client_secret_post";
55
+ let credentialId;
56
+ try {
57
+ const created = await client.mutate({
58
+ mutation: CreateFormBuilderCredentialDocument,
59
+ variables: {
60
+ input: {
61
+ name,
62
+ description: `${connectorType} connector: ${provider}`,
63
+ project: scope.projectId,
64
+ environmentTag: scope.environmentTag,
65
+ formData: {
66
+ provider,
67
+ providerId: provider,
68
+ providerUrl: template.connectorProviderUrl || "",
69
+ useCustomOAuthEndpoints: Boolean(template.connectorUseCustomOAuth),
70
+ usePKCE,
71
+ clientAuthMethod,
72
+ authorizationUrl: template.connectorAuthorizationUrl || "",
73
+ tokenUrl: template.connectorTokenUrl || "",
74
+ revocationUrl: template.connectorRevocationUrl || "",
75
+ scopes: listOf(template.connectorScopes),
76
+ authMethod: "oauth",
77
+ connectorType,
78
+ configKey: templateConfigKey,
79
+ oauthTemplateConfigKey: templateConfigKey
80
+ },
81
+ metadata: credentialMetadata(template, connectorType),
82
+ isAuth: true,
83
+ status: "connecting"
84
+ }
85
+ }
86
+ });
87
+ const id = (_b = (_a = created.data) == null ? void 0 : _a.createFormBuilderCredential) == null ? void 0 : _b.id;
88
+ if (!id) return {
89
+ status: "failed",
90
+ error: "Could not prepare the connection. Try again."
91
+ };
92
+ credentialId = id;
93
+ } catch (error) {
94
+ return {
95
+ status: "failed",
96
+ error: errorText(error, "Could not prepare the connection. Try again.")
97
+ };
98
+ }
99
+ let state = null;
100
+ try {
101
+ await client.mutate({
102
+ mutation: EnsureFormBuilderCredentialOAuthAccountConfigDocument,
103
+ variables: {
104
+ id: credentialId
105
+ }
106
+ }).catch(() => void 0);
107
+ const started = await client.mutate({
108
+ mutation: ConnectConnectorOAuthDocument,
109
+ variables: {
110
+ input: {
111
+ connectorId: provider,
112
+ providerId: provider,
113
+ projectId: scope.projectId,
114
+ environmentTag: scope.environmentTag,
115
+ configKey: templateConfigKey,
116
+ usePKCE,
117
+ clientAuthMethod,
118
+ urlTemplateKeyValues: JSON.stringify({
119
+ __formBuilderCredentialId: credentialId
120
+ }),
121
+ orgName: scope.orgName,
122
+ credentialId
123
+ }
124
+ }
125
+ });
126
+ const payload = (_c = started.data) == null ? void 0 : _c.connectConnectorOAuth;
127
+ if (!(payload == null ? void 0 : payload.authorizationUrl)) throw new Error("The sign-in could not start.");
128
+ state = (_d = payload.state) != null ? _d : null;
129
+ let outcome = null;
130
+ let browserOpen = true;
131
+ const watch = (async () => {
132
+ while (browserOpen && state) {
133
+ await wait(OUTCOME_POLL_MS);
134
+ if (!browserOpen) break;
135
+ const read = await readOutcome(client, state);
136
+ if (read && read.status !== "pending") {
137
+ outcome = read;
138
+ WebBrowser.dismissAuthSession();
139
+ break;
140
+ }
141
+ }
142
+ })();
143
+ await WebBrowser.openAuthSessionAsync(payload.authorizationUrl, CONNECTOR_CONNECT_APP_RETURN_URL);
144
+ browserOpen = false;
145
+ await watch;
146
+ const deadline = Date.now() + SETTLE_AFTER_CLOSE_MS;
147
+ while (!outcome && state && Date.now() < deadline) {
148
+ const read = await readOutcome(client, state);
149
+ if (read && read.status !== "pending") outcome = read;
150
+ else await wait(1e3);
151
+ }
152
+ if (!outcome && state) {
153
+ const cancelled = await client.mutate({
154
+ mutation: CancelConnectorOAuthDocument,
155
+ variables: {
156
+ state
157
+ }
158
+ }).catch(() => null);
159
+ outcome = (_f = (_e = cancelled == null ? void 0 : cancelled.data) == null ? void 0 : _e.cancelConnectorOAuth) != null ? _f : {
160
+ status: "cancelled"
161
+ };
162
+ }
163
+ const finished = outcome;
164
+ if ((finished == null ? void 0 : finished.status) !== "succeeded") {
165
+ await deleteQuietly(client, credentialId);
166
+ if ((finished == null ? void 0 : finished.status) === "failed") {
167
+ return {
168
+ status: "failed",
169
+ error: finished.error || "The sign-in was not accepted. Try again."
170
+ };
171
+ }
172
+ if ((finished == null ? void 0 : finished.status) === "expired") {
173
+ return {
174
+ status: "failed",
175
+ error: "The sign-in did not finish. Tap Connect to try again."
176
+ };
177
+ }
178
+ return {
179
+ status: "cancelled"
180
+ };
181
+ }
182
+ let lastError = null;
183
+ for (let attempt = 0; attempt < 2; attempt += 1) {
184
+ try {
185
+ const completed = await client.mutate({
186
+ mutation: CompleteFormBuilderCredentialOAuthConnectionDocument,
187
+ variables: {
188
+ id: credentialId
189
+ }
190
+ });
191
+ const id = (_h = (_g = completed.data) == null ? void 0 : _g.completeFormBuilderCredentialOAuthConnection) == null ? void 0 : _h.id;
192
+ if (id) return {
193
+ status: "connected",
194
+ credentialId
195
+ };
196
+ lastError = new Error("The connection was not saved.");
197
+ } catch (error) {
198
+ lastError = error;
199
+ }
200
+ await wait(1500);
201
+ }
202
+ return {
203
+ status: "failed",
204
+ error: errorText(lastError, "Signed in, but the connection was not saved. Try again.")
205
+ };
206
+ } catch (error) {
207
+ if (state) await client.mutate({
208
+ mutation: CancelConnectorOAuthDocument,
209
+ variables: {
210
+ state
211
+ }
212
+ }).catch(() => null);
213
+ await deleteQuietly(client, credentialId);
214
+ return {
215
+ status: "failed",
216
+ error: errorText(error, "Could not connect. Try again.")
217
+ };
218
+ }
219
+ }
220
+ async function connectWithApiKey(client, template, name, apiKey, scope) {
221
+ var _a, _b;
222
+ const provider = providerOf(template);
223
+ const connectorType = String(template.connectorType || "app");
224
+ try {
225
+ const created = await client.mutate({
226
+ mutation: CreateFormBuilderCredentialDocument,
227
+ variables: {
228
+ input: {
229
+ name,
230
+ description: `${connectorType} connector: ${provider}`,
231
+ project: scope.projectId,
232
+ environmentTag: scope.environmentTag,
233
+ formData: {
234
+ provider,
235
+ providerId: provider,
236
+ authMethod: "api_key",
237
+ connectorType
238
+ },
239
+ metadata: credentialMetadata(template, connectorType),
240
+ vaultSecretRefs: [{
241
+ fieldName: "api_key",
242
+ secretKey: apiKeySecretKey(provider),
243
+ secretValue: apiKey.trim(),
244
+ secretType: "API_KEY"
245
+ }],
246
+ isAuth: false,
247
+ status: "active"
248
+ }
249
+ }
250
+ });
251
+ const id = (_b = (_a = created.data) == null ? void 0 : _a.createFormBuilderCredential) == null ? void 0 : _b.id;
252
+ return id ? {
253
+ status: "connected",
254
+ credentialId: id
255
+ } : {
256
+ status: "failed",
257
+ error: "The key was not saved. Try again."
258
+ };
259
+ } catch (error) {
260
+ return {
261
+ status: "failed",
262
+ error: errorText(error, "The key was not saved. Try again.")
263
+ };
264
+ }
265
+ }
266
+ async function removeConnector(client, id) {
267
+ try {
268
+ await client.mutate({
269
+ mutation: DeleteFormBuilderCredentialDocument,
270
+ variables: {
271
+ id
272
+ }
273
+ });
274
+ return true;
275
+ } catch (e) {
276
+ return false;
277
+ }
278
+ }export{connectWithApiKey,connectWithOAuth,removeConnector};//# sourceMappingURL=connectConnector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectConnector.js","sources":["../../../src/features/connectors/connectConnector.ts"],"sourcesContent":["/**\n * Connecting a catalogue connector from the phone, with the calls the web's AuthConnectorWidget makes\n * (form-builder-browser) - no web page in between.\n *\n * Sign in (OAuth):\n * 1. a `connecting` credential, so tokens land on its own account path (createFormBuilderCredential);\n * 2. that path prepared (ensureFormBuilderCredentialOAuthAccountConfig);\n * 3. connectConnectorOAuth -> the provider's own authorize URL and an opaque `state`;\n * 4. the provider's page in an in-app sign-in session, while the server's outcome for `state` is read\n * every two seconds (connectorOAuthOutcome) - the provider returns to the server's callback, never\n * to the app, so the outcome is what says it worked, and closes the session;\n * 5. completeFormBuilderCredentialOAuthConnection, which stores the tokens and marks it active.\n * A sign-in that does not finish is cancelled on the server (a late callback cannot connect it) and the\n * placeholder credential is deleted, so a half-made connector never lists.\n *\n * API key: one credential, active at once, the key in the vault as `<PROVIDER>_API_KEY` (the web's\n * generic `api_key` field).\n */\nimport * as WebBrowser from 'expo-web-browser';\nimport type { ApolloClient } from '@apollo/client';\nimport { CONNECTOR_CONNECT_APP_RETURN_URL } from 'common';\nimport {\n CancelConnectorOAuthDocument,\n CompleteFormBuilderCredentialOAuthConnectionDocument,\n ConnectConnectorOAuthDocument,\n ConnectorOAuthOutcomeDocument,\n CreateFormBuilderCredentialDocument,\n DeleteFormBuilderCredentialDocument,\n EnsureFormBuilderCredentialOAuthAccountConfigDocument,\n} from 'common/graphql';\nimport { apiKeySecretKey, listOf, oauthTemplateConfigKey, type CredentialTemplateEntry } from './connectorCatalog';\n\nexport interface ConnectScope {\n orgName: string;\n projectId: string;\n /** The environment tag credentials are saved in (usePrerequisiteIds tagId). */\n environmentTag: string;\n}\n\nexport type ConnectResult =\n | { status: 'connected'; credentialId: string }\n | { status: 'cancelled' }\n | { status: 'failed'; error: string };\n\ntype Client = ApolloClient<unknown>;\n\nconst OUTCOME_POLL_MS = 2000;\n/** After the session closes, how long the server may still take to record a callback that just ran. */\nconst SETTLE_AFTER_CLOSE_MS = 6000;\n\nconst wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nfunction errorText(error: unknown, fallback: string): string {\n const message = error instanceof Error ? error.message : typeof error === 'string' ? error : '';\n return message.replace(/^GraphQL error:\\s*/i, '').trim() || fallback;\n}\n\nfunction providerOf(template: CredentialTemplateEntry): string {\n return String(template.connectorProviderId || template.key).trim();\n}\n\nfunction credentialMetadata(template: CredentialTemplateEntry, connectorType: string) {\n return {\n provider: providerOf(template),\n connectorType,\n formId: template.formId,\n formExtensionId: template.formExtensionId,\n formFunctionId: template.formExtensionId,\n formIcon: template.formIcon || null,\n };\n}\n\nasync function deleteQuietly(client: Client, id: string): Promise<void> {\n try {\n await client.mutate({ mutation: DeleteFormBuilderCredentialDocument, variables: { id } });\n } catch (error) {\n console.warn('[connectors] could not remove an unfinished connector', id, error);\n }\n}\n\nasync function readOutcome(client: Client, state: string): Promise<{ status: string; error?: string | null } | null> {\n try {\n const result = await client.query({\n query: ConnectorOAuthOutcomeDocument,\n variables: { state },\n fetchPolicy: 'no-cache',\n });\n return (\n (result.data as { connectorOAuthOutcome?: { status: string; error?: string | null } } | undefined)\n ?.connectorOAuthOutcome ?? null\n );\n } catch {\n return null;\n }\n}\n\n/** Sign in with the provider and save the connection. */\nexport async function connectWithOAuth(\n client: Client,\n template: CredentialTemplateEntry,\n name: string,\n scope: ConnectScope,\n): Promise<ConnectResult> {\n const provider = providerOf(template);\n const connectorType = String(template.connectorType || 'app');\n const templateConfigKey = oauthTemplateConfigKey(template);\n const usePKCE = template.connectorUsePKCE !== false;\n const clientAuthMethod =\n template.connectorClientAuthMethod === 'client_secret_basic' ? 'client_secret_basic' : 'client_secret_post';\n\n let credentialId: string;\n try {\n const created = await client.mutate({\n mutation: CreateFormBuilderCredentialDocument,\n variables: {\n input: {\n name,\n description: `${connectorType} connector: ${provider}`,\n project: scope.projectId,\n environmentTag: scope.environmentTag,\n formData: {\n provider,\n providerId: provider,\n providerUrl: template.connectorProviderUrl || '',\n useCustomOAuthEndpoints: Boolean(template.connectorUseCustomOAuth),\n usePKCE,\n clientAuthMethod,\n authorizationUrl: template.connectorAuthorizationUrl || '',\n tokenUrl: template.connectorTokenUrl || '',\n revocationUrl: template.connectorRevocationUrl || '',\n scopes: listOf(template.connectorScopes),\n authMethod: 'oauth',\n connectorType,\n configKey: templateConfigKey,\n oauthTemplateConfigKey: templateConfigKey,\n },\n metadata: credentialMetadata(template, connectorType),\n isAuth: true,\n status: 'connecting',\n },\n } as never,\n });\n const id = (created.data as { createFormBuilderCredential?: { id?: string } } | undefined)\n ?.createFormBuilderCredential?.id;\n if (!id) return { status: 'failed', error: 'Could not prepare the connection. Try again.' };\n credentialId = id;\n } catch (error) {\n return { status: 'failed', error: errorText(error, 'Could not prepare the connection. Try again.') };\n }\n\n let state: string | null = null;\n try {\n await client\n .mutate({\n mutation: EnsureFormBuilderCredentialOAuthAccountConfigDocument,\n variables: { id: credentialId },\n })\n .catch(() => undefined);\n const started = await client.mutate({\n mutation: ConnectConnectorOAuthDocument,\n variables: {\n input: {\n connectorId: provider,\n providerId: provider,\n projectId: scope.projectId,\n environmentTag: scope.environmentTag,\n configKey: templateConfigKey,\n usePKCE,\n clientAuthMethod,\n urlTemplateKeyValues: JSON.stringify({ __formBuilderCredentialId: credentialId }),\n orgName: scope.orgName,\n credentialId,\n },\n } as never,\n });\n const payload = (\n started.data as { connectConnectorOAuth?: { authorizationUrl?: string; state?: string } } | undefined\n )?.connectConnectorOAuth;\n if (!payload?.authorizationUrl) throw new Error('The sign-in could not start.');\n state = payload.state ?? null;\n\n // The provider's page; the server's outcome closes it.\n let outcome: { status: string; error?: string | null } | null = null;\n let browserOpen = true;\n const watch = (async () => {\n while (browserOpen && state) {\n await wait(OUTCOME_POLL_MS);\n if (!browserOpen) break;\n const read = await readOutcome(client, state);\n if (read && read.status !== 'pending') {\n outcome = read;\n WebBrowser.dismissAuthSession();\n break;\n }\n }\n })();\n await WebBrowser.openAuthSessionAsync(payload.authorizationUrl, CONNECTOR_CONNECT_APP_RETURN_URL);\n browserOpen = false;\n await watch;\n\n // Closed by hand: the callback may have just run. Read a little longer, then let the server decide.\n const deadline = Date.now() + SETTLE_AFTER_CLOSE_MS;\n while (!outcome && state && Date.now() < deadline) {\n const read = await readOutcome(client, state);\n if (read && read.status !== 'pending') outcome = read;\n else await wait(1000);\n }\n if (!outcome && state) {\n const cancelled = await client\n .mutate({ mutation: CancelConnectorOAuthDocument, variables: { state } })\n .catch(() => null);\n outcome = (\n cancelled?.data as { cancelConnectorOAuth?: { status: string; error?: string | null } } | undefined\n )?.cancelConnectorOAuth ?? { status: 'cancelled' };\n }\n\n const finished = outcome as { status: string; error?: string | null } | null;\n if (finished?.status !== 'succeeded') {\n await deleteQuietly(client, credentialId);\n if (finished?.status === 'failed') {\n return { status: 'failed', error: finished.error || 'The sign-in was not accepted. Try again.' };\n }\n if (finished?.status === 'expired') {\n return { status: 'failed', error: 'The sign-in did not finish. Tap Connect to try again.' };\n }\n return { status: 'cancelled' };\n }\n\n // Signed in: store the tokens and mark it connected, once more on a dropped reply.\n let lastError: unknown = null;\n for (let attempt = 0; attempt < 2; attempt += 1) {\n try {\n const completed = await client.mutate({\n mutation: CompleteFormBuilderCredentialOAuthConnectionDocument,\n variables: { id: credentialId },\n });\n const id = (\n completed.data as { completeFormBuilderCredentialOAuthConnection?: { id?: string } } | undefined\n )?.completeFormBuilderCredentialOAuthConnection?.id;\n if (id) return { status: 'connected', credentialId };\n lastError = new Error('The connection was not saved.');\n } catch (error) {\n lastError = error;\n }\n await wait(1500);\n }\n return {\n status: 'failed',\n error: errorText(lastError, 'Signed in, but the connection was not saved. Try again.'),\n };\n } catch (error) {\n if (state)\n await client.mutate({ mutation: CancelConnectorOAuthDocument, variables: { state } }).catch(() => null);\n await deleteQuietly(client, credentialId);\n return { status: 'failed', error: errorText(error, 'Could not connect. Try again.') };\n }\n}\n\n/** Save an API key as a connected connector. */\nexport async function connectWithApiKey(\n client: Client,\n template: CredentialTemplateEntry,\n name: string,\n apiKey: string,\n scope: ConnectScope,\n): Promise<ConnectResult> {\n const provider = providerOf(template);\n const connectorType = String(template.connectorType || 'app');\n try {\n const created = await client.mutate({\n mutation: CreateFormBuilderCredentialDocument,\n variables: {\n input: {\n name,\n description: `${connectorType} connector: ${provider}`,\n project: scope.projectId,\n environmentTag: scope.environmentTag,\n formData: { provider, providerId: provider, authMethod: 'api_key', connectorType },\n metadata: credentialMetadata(template, connectorType),\n vaultSecretRefs: [\n {\n fieldName: 'api_key',\n secretKey: apiKeySecretKey(provider),\n secretValue: apiKey.trim(),\n secretType: 'API_KEY',\n },\n ],\n isAuth: false,\n status: 'active',\n },\n } as never,\n });\n const id = (created.data as { createFormBuilderCredential?: { id?: string } } | undefined)\n ?.createFormBuilderCredential?.id;\n return id\n ? { status: 'connected', credentialId: id }\n : { status: 'failed', error: 'The key was not saved. Try again.' };\n } catch (error) {\n return { status: 'failed', error: errorText(error, 'The key was not saved. Try again.') };\n }\n}\n\n/** Remove a saved connector. */\nexport async function removeConnector(client: Client, id: string): Promise<boolean> {\n try {\n await client.mutate({ mutation: DeleteFormBuilderCredentialDocument, variables: { id } });\n return true;\n } catch {\n return false;\n }\n}\n"],"names":[],"mappings":"6dAuCA,MAAM,eAAkB,GAAA,GAAA;AAExB,MAAM,qB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
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ const CREDENTIAL_TEMPLATE_SUMMARY_FIELDS = ["templateName", "name", "title", "apiKeyEnabled", "oAuthEnabled", "enabled", "formIcon", "formId"];
21
+ function settingsOf(payload) {
22
+ if (!payload || typeof payload !== "object") return void 0;
23
+ const inner = payload.settings;
24
+ if (inner && typeof inner === "object") return inner;
25
+ return payload;
26
+ }
27
+ function flattenCredentialTemplates(configurations) {
28
+ if (!configurations || typeof configurations !== "object") return [];
29
+ const result = [];
30
+ for (const [groupName, groupData] of Object.entries(configurations)) {
31
+ if (!groupData || typeof groupData !== "object") continue;
32
+ for (const [credKey, credData] of Object.entries(groupData)) {
33
+ if (!credData || typeof credData !== "object") continue;
34
+ const template = credData;
35
+ const hasAuthFlags = typeof template.apiKeyEnabled === "boolean" || typeof template.oAuthEnabled === "boolean";
36
+ const enabled = hasAuthFlags ? Boolean(template.apiKeyEnabled || template.oAuthEnabled) : Boolean(template.enabled);
37
+ if (!enabled) continue;
38
+ result.push(__spreadProps(__spreadValues({}, template), {
39
+ key: credKey,
40
+ group: groupName
41
+ }));
42
+ }
43
+ }
44
+ return result;
45
+ }
46
+ const norm = (s) => (typeof s === "string" ? s : "").toLowerCase().replace(/[^a-z0-9]/g, "");
47
+ function matchCredentialTemplate(templates, templateKey, aliases = []) {
48
+ var _a, _b, _c;
49
+ const target = norm(templateKey);
50
+ if (!target) return null;
51
+ const fields = (entry) => [entry.key, entry.templateName, entry.name, entry.title].map(norm).filter(Boolean);
52
+ const normAliases = aliases.map(norm).filter(Boolean);
53
+ return (_c = (_b = (_a = templates.find((entry) => fields(entry).some((f) => f === target))) != null ? _a : templates.find((entry) => fields(entry).some((f) => f.includes(target)))) != null ? _b : normAliases.length ? templates.find((entry) => fields(entry).some((f) => normAliases.some((a) => f.includes(a)))) : void 0) != null ? _c : null;
54
+ }
55
+ function connectorDisplayName(template) {
56
+ const raw = String(template.templateName || template.title || template.name || template.key || "").trim();
57
+ return raw.replace(/\s*\((app|mcp|api|oauth)\)\s*$/i, "").trim() || raw;
58
+ }
59
+ const CONNECTOR_CDN_BASE = "https://cdn.yantra.app";
60
+ function connectorLogoUrl(path) {
61
+ if (!path) return void 0;
62
+ if (/^(https?:|data:)/.test(path)) return path;
63
+ return `${CONNECTOR_CDN_BASE}/${path.replace(/^\/+/, "")}`;
64
+ }
65
+ function listOf(value) {
66
+ if (Array.isArray(value)) return value.map(String);
67
+ if (value && typeof value === "object") return Object.values(value).map(String);
68
+ if (typeof value === "string" && value.trim()) {
69
+ try {
70
+ const parsed = JSON.parse(value);
71
+ return Array.isArray(parsed) ? parsed.map(String) : [value];
72
+ } catch (e) {
73
+ return value.split(",").map((v) => v.trim());
74
+ }
75
+ }
76
+ return [];
77
+ }
78
+ function oauthTemplateConfigKey(template) {
79
+ return `integrationSettings.settings.oauth.${template.formId || template.key}.oauthConnector`;
80
+ }
81
+ function apiKeySecretKey(provider) {
82
+ return `${provider.trim().replace(/[^a-zA-Z0-9]/g, "_").toUpperCase()}_API_KEY`;
83
+ }
84
+ const connectorProviderKey = (providerId) => (providerId || "").trim().replace(/[^a-zA-Z0-9]/g, "_").toUpperCase();
85
+ function resolveConnectOptions(template, ownApps) {
86
+ var _a;
87
+ const methods = listOf(template.connectorAuthMethods);
88
+ if (methods.length === 0) return void 0;
89
+ const supportsOAuth = methods.includes("oauth2");
90
+ const apiKey = methods.includes("api_key") && template.apiKeyEnabled !== false;
91
+ let oauth = "unsupported";
92
+ if (supportsOAuth) {
93
+ const providerKey = connectorProviderKey(template.connectorProviderId);
94
+ const own = providerKey ? (_a = ownApps == null ? void 0 : ownApps.providers) == null ? void 0 : _a.find((p) => (p == null ? void 0 : p.providerKey) === providerKey) : void 0;
95
+ const ownSource = ((own == null ? void 0 : own.source) || "").toLowerCase();
96
+ const platformReady = typeof template.oAuthEnabled === "boolean" ? template.oAuthEnabled : typeof template.enabled === "boolean" ? template.enabled : true;
97
+ oauth = ownSource && ownSource !== "platform" || platformReady ? "ready" : "needs_app";
98
+ }
99
+ return {
100
+ oauth,
101
+ apiKey,
102
+ recommended: oauth === "ready" || !apiKey ? "oauth" : "api_key"
103
+ };
104
+ }
105
+ const GOOGLE = "https://www.googleapis.com/auth/";
106
+ const KNOWN_SCOPES = {
107
+ instagram_business_basic: "See your profile and posts",
108
+ instagram_basic: "See your profile and posts",
109
+ instagram_business_content_publish: "Publish posts, reels and carousels",
110
+ instagram_content_publish: "Publish posts, reels and carousels",
111
+ instagram_business_manage_comments: "Read and reply to comments",
112
+ instagram_manage_comments: "Read and reply to comments",
113
+ instagram_business_manage_insights: "See insights on your account and posts",
114
+ instagram_manage_insights: "See insights on your account and posts",
115
+ instagram_business_manage_messages: "Read and send direct messages",
116
+ instagram_manage_messages: "Read and send direct messages",
117
+ pages_show_list: "See the Pages you manage",
118
+ pages_read_engagement: "Read your Pages' posts and engagement",
119
+ pages_manage_posts: "Publish and manage posts on your Pages",
120
+ pages_manage_engagement: "Reply to comments on your Pages",
121
+ pages_messaging: "Send messages as your Pages",
122
+ business_management: "Manage your business assets",
123
+ ads_management: "Create and manage ads",
124
+ ads_read: "See your ads and their results",
125
+ [`${GOOGLE}gmail.send`]: "Send email as you",
126
+ [`${GOOGLE}gmail.readonly`]: "Read your email",
127
+ [`${GOOGLE}gmail.modify`]: "Read, organize and change your email",
128
+ [`${GOOGLE}gmail.compose`]: "Write and send email drafts",
129
+ [`${GOOGLE}calendar`]: "See and change your calendars",
130
+ [`${GOOGLE}calendar.readonly`]: "See your calendars",
131
+ [`${GOOGLE}calendar.events`]: "See and change your calendar events",
132
+ [`${GOOGLE}drive`]: "See and change all your Drive files",
133
+ [`${GOOGLE}drive.readonly`]: "See your Drive files",
134
+ [`${GOOGLE}drive.file`]: "Use the Drive files this app opens or creates",
135
+ [`${GOOGLE}drive.metadata.readonly`]: "See the names and details of your Drive files",
136
+ [`${GOOGLE}userinfo.email`]: "See your email address",
137
+ [`${GOOGLE}userinfo.profile`]: "See your name and profile picture",
138
+ "https://mail.google.com/": "Read, send, organize and permanently delete your email",
139
+ [`${GOOGLE}contacts.readonly`]: "See your contacts",
140
+ [`${GOOGLE}contacts.other.readonly`]: "See the people you have emailed but not saved as contacts",
141
+ [`${GOOGLE}user.emails.read`]: "See your email addresses",
142
+ [`${GOOGLE}profile.emails.read`]: "See your email addresses",
143
+ [`${GOOGLE}user.phonenumbers.read`]: "See your phone numbers",
144
+ [`${GOOGLE}user.addresses.read`]: "See your street addresses",
145
+ [`${GOOGLE}user.birthday.read`]: "See your birthday",
146
+ [`${GOOGLE}profile.language.read`]: "See your language preferences",
147
+ [`${GOOGLE}documents`]: "See and change your Google Docs",
148
+ [`${GOOGLE}spreadsheets`]: "See and change your Google Sheets",
149
+ [`${GOOGLE}presentations`]: "See and change your Google Slides",
150
+ [`${GOOGLE}tasks`]: "See and change your tasks",
151
+ [`${GOOGLE}meetings.space.created`]: "Create Meet calls and manage the ones this app created",
152
+ [`${GOOGLE}meetings.space.settings`]: "Change the settings of your Meet calls",
153
+ [`${GOOGLE}classroom.courses`]: "See and manage your classes",
154
+ [`${GOOGLE}classroom.announcements`]: "See and manage class announcements",
155
+ [`${GOOGLE}classroom.coursework.students`]: "See and manage your students' coursework and grades",
156
+ [`${GOOGLE}classroom.coursework.me`]: "See and manage your own coursework",
157
+ [`${GOOGLE}classroom.courseworkmaterials`]: "See and manage class materials",
158
+ [`${GOOGLE}classroom.topics`]: "See and manage class topics",
159
+ [`${GOOGLE}classroom.rosters`]: "See and manage who is in your classes",
160
+ [`${GOOGLE}classroom.profile.emails`]: "See the email addresses of people in your classes",
161
+ [`${GOOGLE}classroom.guardianlinks.students.readonly`]: "See your students' guardians",
162
+ [`${GOOGLE}admin.directory.user.readonly`]: "See the users in your organization",
163
+ [`${GOOGLE}analytics`]: "See and manage your Google Analytics data",
164
+ [`${GOOGLE}analytics.readonly`]: "See your Google Analytics data",
165
+ [`${GOOGLE}webmasters.readonly`]: "See your Search Console data",
166
+ [`${GOOGLE}photoslibrary.appendonly`]: "Add photos and albums to your Google Photos",
167
+ [`${GOOGLE}photoslibrary.edit.appcreateddata`]: "Change the photos and albums this app added",
168
+ [`${GOOGLE}photoslibrary.readonly.appcreateddata`]: "See the photos and albums this app added",
169
+ [`${GOOGLE}youtube`]: "Manage your YouTube account",
170
+ [`${GOOGLE}youtube.force-ssl`]: "See, edit and delete your YouTube videos, ratings and comments",
171
+ [`${GOOGLE}youtube.readonly`]: "See your YouTube account",
172
+ [`${GOOGLE}youtube.upload`]: "Upload videos to YouTube",
173
+ [`${GOOGLE}youtube.channel-memberships.creator`]: "See your channel's members and membership levels",
174
+ [`${GOOGLE}adwords`]: "See and manage your Google Ads accounts",
175
+ openid: "Sign you in",
176
+ email: "See your email address",
177
+ profile: "See your name and profile picture"
178
+ };
179
+ const UPPER_SNAKE_SCOPE = /^([A-Z][A-Z0-9_]*?)_(READ|WRITE)$/;
180
+ const PREFIXED_SCOPE = /^(read|write)_([a-z][a-z0-9_]*)$/;
181
+ function summarizeScopes(scopes) {
182
+ const groups = /* @__PURE__ */ new Map();
183
+ const known = /* @__PURE__ */ new Set();
184
+ const out = [];
185
+ for (const scope of scopes) {
186
+ const sentence = KNOWN_SCOPES[scope];
187
+ if (sentence) {
188
+ if (!known.has(sentence)) {
189
+ known.add(sentence);
190
+ out.push(sentence);
191
+ }
192
+ continue;
193
+ }
194
+ const upper = UPPER_SNAKE_SCOPE.exec(scope);
195
+ const prefixed = upper ? null : PREFIXED_SCOPE.exec(scope);
196
+ if (!upper && !prefixed) {
197
+ out.push(scope);
198
+ continue;
199
+ }
200
+ const resource = (upper ? upper[1] : prefixed[2]).toLowerCase().replace(/_/g, " ");
201
+ const access = (upper ? upper[2] : prefixed[1]).toLowerCase();
202
+ const existing = groups.get(resource);
203
+ if (existing) {
204
+ existing.access.add(access);
205
+ continue;
206
+ }
207
+ groups.set(resource, {
208
+ access: /* @__PURE__ */ new Set([access])
209
+ });
210
+ out.push({
211
+ resource
212
+ });
213
+ }
214
+ return out.map((entry) => {
215
+ if (typeof entry === "string") return entry;
216
+ const {
217
+ access
218
+ } = groups.get(entry.resource);
219
+ const label = access.has("read") && access.has("write") ? "Read and write" : access.has("write") ? "Write" : "Read";
220
+ return `${label} ${entry.resource}`;
221
+ });
222
+ }export{CONNECTOR_CDN_BASE,CREDENTIAL_TEMPLATE_SUMMARY_FIELDS,apiKeySecretKey,connectorDisplayName,connectorLogoUrl,connectorProviderKey,flattenCredentialTemplates,listOf,matchCredentialTemplate,oauthTemplateConfigKey,resolveConnectOptions,settingsOf,summarizeScopes};//# sourceMappingURL=connectorCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectorCatalog.js","sources":["../../../src/features/connectors/connectorCatalog.ts"],"sourcesContent":["/**\n * The connector catalogue as the web reads it, without the web's form.\n *\n * The web's \"Add Gmail\" dialog is form-builder's AuthConnectorWidget fed by one template from the\n * org's `credential.templates` settings. Every value that dialog shows or sends is in that template\n * (flat keys: `connectorProviderId`, `connectorScopes`, `connectorUsePKCE`, `connectorAuthMethods`,\n * `description`, `formIcon`, `formId`…), so the phone reads the same template and makes the same\n * calls. Pure: ported from account-browser hooks/useCredentialTemplateByKey and form-builder-browser\n * (utils/connectOptions, AuthConnectorSections summarizeScopes, form-builder-core iurl) - keep in step.\n */\n\n/** What the catalogue index asks for of each template (web CREDENTIAL_TEMPLATE_SUMMARY_FIELDS). */\nexport const CREDENTIAL_TEMPLATE_SUMMARY_FIELDS = [\n 'templateName',\n 'name',\n 'title',\n 'apiKeyEnabled',\n 'oAuthEnabled',\n 'enabled',\n 'formIcon',\n 'formId',\n];\n\nexport interface CredentialTemplateEntry {\n key: string;\n group: string;\n templateName?: string;\n name?: string;\n title?: string;\n formId?: string;\n formExtensionId?: string;\n formIcon?: string;\n apiKeyEnabled?: boolean;\n oAuthEnabled?: boolean;\n enabled?: boolean;\n description?: string;\n connectorProviderId?: string;\n connectorProviderUrl?: string;\n connectorAuthMethods?: unknown;\n connectorScopes?: unknown;\n connectorUsePKCE?: boolean;\n connectorClientAuthMethod?: string;\n connectorAuthorizationUrl?: string;\n connectorTokenUrl?: string;\n connectorRevocationUrl?: string;\n connectorUseCustomOAuth?: boolean;\n connectorType?: string;\n connectorMcpUrl?: string;\n [key: string]: unknown;\n}\n\n/** `{ settings, … }` from a loader, or the settings themselves. */\nexport function settingsOf(payload: unknown): Record<string, unknown> | undefined {\n if (!payload || typeof payload !== 'object') return undefined;\n const inner = (payload as { settings?: unknown }).settings;\n if (inner && typeof inner === 'object') return inner as Record<string, unknown>;\n return payload as Record<string, unknown>;\n}\n\n/** The enabled templates, one entry per `<group>.<key>` (web flattenCredentialTemplates). */\nexport function flattenCredentialTemplates(\n configurations: Record<string, unknown> | undefined,\n): CredentialTemplateEntry[] {\n if (!configurations || typeof configurations !== 'object') return [];\n const result: CredentialTemplateEntry[] = [];\n for (const [groupName, groupData] of Object.entries(configurations)) {\n if (!groupData || typeof groupData !== 'object') continue;\n for (const [credKey, credData] of Object.entries(groupData as Record<string, unknown>)) {\n if (!credData || typeof credData !== 'object') continue;\n const template = credData as Record<string, unknown>;\n const hasAuthFlags =\n typeof template.apiKeyEnabled === 'boolean' || typeof template.oAuthEnabled === 'boolean';\n const enabled = hasAuthFlags\n ? Boolean(template.apiKeyEnabled || template.oAuthEnabled)\n : Boolean(template.enabled);\n if (!enabled) continue;\n // The catalogue's own key and group are the template's address; a field of the same name never wins.\n result.push({ ...template, key: credKey, group: groupName } as CredentialTemplateEntry);\n }\n }\n return result;\n}\n\nconst norm = (s: unknown) => (typeof s === 'string' ? s : '').toLowerCase().replace(/[^a-z0-9]/g, '');\n\n/** By key, then template name, then aliases (web matchCredentialTemplate). */\nexport function matchCredentialTemplate(\n templates: readonly CredentialTemplateEntry[],\n templateKey: string | undefined,\n aliases: readonly string[] = [],\n): CredentialTemplateEntry | null {\n const target = norm(templateKey);\n if (!target) return null;\n const fields = (entry: CredentialTemplateEntry) =>\n [entry.key, entry.templateName, entry.name, entry.title].map(norm).filter(Boolean);\n const normAliases = aliases.map(norm).filter(Boolean);\n return (\n templates.find((entry) => fields(entry).some((f) => f === target)) ??\n templates.find((entry) => fields(entry).some((f) => f.includes(target))) ??\n (normAliases.length\n ? templates.find((entry) => fields(entry).some((f) => normAliases.some((a) => f.includes(a))))\n : undefined) ??\n null\n );\n}\n\n/** \"Gmail (APP)\" -> \"Gmail\": the name a person reads, without the catalogue's kind tag. */\nexport function connectorDisplayName(\n template: Pick<CredentialTemplateEntry, 'templateName' | 'name' | 'title' | 'key'>,\n): string {\n const raw = String(template.templateName || template.title || template.name || template.key || '').trim();\n return raw.replace(/\\s*\\((app|mcp|api|oauth)\\)\\s*$/i, '').trim() || raw;\n}\n\n/** Connector artwork lives on the extensions CDN; the template stores the path (form-builder-core iurl). */\nexport const CONNECTOR_CDN_BASE = 'https://cdn.yantra.app';\nexport function connectorLogoUrl(path: string | undefined | null): string | undefined {\n if (!path) return undefined;\n if (/^(https?:|data:)/.test(path)) return path;\n return `${CONNECTOR_CDN_BASE}/${path.replace(/^\\/+/, '')}`;\n}\n\n/** Settings persist arrays as objects keyed by index; a string may be JSON or comma separated. */\nexport function listOf(value: unknown): string[] {\n if (Array.isArray(value)) return value.map(String);\n if (value && typeof value === 'object') return Object.values(value).map(String);\n if (typeof value === 'string' && value.trim()) {\n try {\n const parsed = JSON.parse(value);\n return Array.isArray(parsed) ? parsed.map(String) : [value];\n } catch {\n return value.split(',').map((v) => v.trim());\n }\n }\n return [];\n}\n\n/**\n * The registry path the connector's OAuth app (client id, redirect, scopes) resolves under: the\n * dotted path of the form's `oauthConnector` field, `integrationSettings.settings.oauth.<formId>`.\n */\nexport function oauthTemplateConfigKey(template: Pick<CredentialTemplateEntry, 'formId' | 'key'>): string {\n return `integrationSettings.settings.oauth.${template.formId || template.key}.oauthConnector`;\n}\n\n/** The vault key an API key is saved under (@cdm1/credential deriveSecretKey for `api_key`): `GOOGLE_GMAIL_API_KEY`. */\nexport function apiKeySecretKey(provider: string): string {\n return `${provider\n .trim()\n .replace(/[^a-zA-Z0-9]/g, '_')\n .toUpperCase()}_API_KEY`;\n}\n\n// ── How it can be connected (form-builder-browser utils/connectOptions) ────────────────────────────\n\nexport interface OwnOAuthApps {\n canManageOrganizationApp?: boolean | null;\n canManageProjectApp?: boolean | null;\n providers?: ReadonlyArray<{ providerKey?: string | null; source?: string | null } | null> | null;\n}\n\nexport interface ConnectOptions {\n /** `ready`: Sign in works here; `needs_app`: an admin must set up the OAuth app first. */\n oauth: 'ready' | 'needs_app' | 'unsupported';\n apiKey: boolean;\n recommended: 'oauth' | 'api_key';\n}\n\nexport const connectorProviderKey = (providerId: string | undefined) =>\n (providerId || '')\n .trim()\n .replace(/[^a-zA-Z0-9]/g, '_')\n .toUpperCase();\n\n/** Undefined when the template names no auth methods (a custom form): the web page handles those. */\nexport function resolveConnectOptions(\n template: CredentialTemplateEntry,\n ownApps?: OwnOAuthApps | null,\n): ConnectOptions | undefined {\n const methods = listOf(template.connectorAuthMethods);\n if (methods.length === 0) return undefined;\n const supportsOAuth = methods.includes('oauth2');\n const apiKey = methods.includes('api_key') && template.apiKeyEnabled !== false;\n let oauth: ConnectOptions['oauth'] = 'unsupported';\n if (supportsOAuth) {\n const providerKey = connectorProviderKey(template.connectorProviderId);\n const own = providerKey ? ownApps?.providers?.find((p) => p?.providerKey === providerKey) : undefined;\n const ownSource = (own?.source || '').toLowerCase();\n const platformReady =\n typeof template.oAuthEnabled === 'boolean'\n ? template.oAuthEnabled\n : typeof template.enabled === 'boolean'\n ? template.enabled\n : true;\n oauth = (ownSource && ownSource !== 'platform') || platformReady ? 'ready' : 'needs_app';\n }\n return { oauth, apiKey, recommended: oauth === 'ready' || !apiKey ? 'oauth' : 'api_key' };\n}\n\n// ── What a person agrees to (form-builder-browser AuthConnectorSections summarizeScopes) ─────────────\n\nconst GOOGLE = 'https://www.googleapis.com/auth/';\nconst KNOWN_SCOPES: Record<string, string> = {\n instagram_business_basic: 'See your profile and posts',\n instagram_basic: 'See your profile and posts',\n instagram_business_content_publish: 'Publish posts, reels and carousels',\n instagram_content_publish: 'Publish posts, reels and carousels',\n instagram_business_manage_comments: 'Read and reply to comments',\n instagram_manage_comments: 'Read and reply to comments',\n instagram_business_manage_insights: 'See insights on your account and posts',\n instagram_manage_insights: 'See insights on your account and posts',\n instagram_business_manage_messages: 'Read and send direct messages',\n instagram_manage_messages: 'Read and send direct messages',\n pages_show_list: 'See the Pages you manage',\n pages_read_engagement: \"Read your Pages' posts and engagement\",\n pages_manage_posts: 'Publish and manage posts on your Pages',\n pages_manage_engagement: 'Reply to comments on your Pages',\n pages_messaging: 'Send messages as your Pages',\n business_management: 'Manage your business assets',\n ads_management: 'Create and manage ads',\n ads_read: 'See your ads and their results',\n [`${GOOGLE}gmail.send`]: 'Send email as you',\n [`${GOOGLE}gmail.readonly`]: 'Read your email',\n [`${GOOGLE}gmail.modify`]: 'Read, organize and change your email',\n [`${GOOGLE}gmail.compose`]: 'Write and send email drafts',\n [`${GOOGLE}calendar`]: 'See and change your calendars',\n [`${GOOGLE}calendar.readonly`]: 'See your calendars',\n [`${GOOGLE}calendar.events`]: 'See and change your calendar events',\n [`${GOOGLE}drive`]: 'See and change all your Drive files',\n [`${GOOGLE}drive.readonly`]: 'See your Drive files',\n [`${GOOGLE}drive.file`]: 'Use the Drive files this app opens or creates',\n [`${GOOGLE}drive.metadata.readonly`]: 'See the names and details of your Drive files',\n [`${GOOGLE}userinfo.email`]: 'See your email address',\n [`${GOOGLE}userinfo.profile`]: 'See your name and profile picture',\n 'https://mail.google.com/': 'Read, send, organize and permanently delete your email',\n [`${GOOGLE}contacts.readonly`]: 'See your contacts',\n [`${GOOGLE}contacts.other.readonly`]: 'See the people you have emailed but not saved as contacts',\n [`${GOOGLE}user.emails.read`]: 'See your email addresses',\n [`${GOOGLE}profile.emails.read`]: 'See your email addresses',\n [`${GOOGLE}user.phonenumbers.read`]: 'See your phone numbers',\n [`${GOOGLE}user.addresses.read`]: 'See your street addresses',\n [`${GOOGLE}user.birthday.read`]: 'See your birthday',\n [`${GOOGLE}profile.language.read`]: 'See your language preferences',\n [`${GOOGLE}documents`]: 'See and change your Google Docs',\n [`${GOOGLE}spreadsheets`]: 'See and change your Google Sheets',\n [`${GOOGLE}presentations`]: 'See and change your Google Slides',\n [`${GOOGLE}tasks`]: 'See and change your tasks',\n [`${GOOGLE}meetings.space.created`]: 'Create Meet calls and manage the ones this app created',\n [`${GOOGLE}meetings.space.settings`]: 'Change the settings of your Meet calls',\n [`${GOOGLE}classroom.courses`]: 'See and manage your classes',\n [`${GOOGLE}classroom.announcements`]: 'See and manage class announcements',\n [`${GOOGLE}classroom.coursework.students`]: \"See and manage your students' coursework and grades\",\n [`${GOOGLE}classroom.coursework.me`]: 'See and manage your own coursework',\n [`${GOOGLE}classroom.courseworkmaterials`]: 'See and manage class materials',\n [`${GOOGLE}classroom.topics`]: 'See and manage class topics',\n [`${GOOGLE}classroom.rosters`]: 'See and manage who is in your classes',\n [`${GOOGLE}classroom.profile.emails`]: 'See the email addresses of people in your classes',\n [`${GOOGLE}classroom.guardianlinks.students.readonly`]: \"See your students' guardians\",\n [`${GOOGLE}admin.directory.user.readonly`]: 'See the users in your organization',\n [`${GOOGLE}analytics`]: 'See and manage your Google Analytics data',\n [`${GOOGLE}analytics.readonly`]: 'See your Google Analytics data',\n [`${GOOGLE}webmasters.readonly`]: 'See your Search Console data',\n [`${GOOGLE}photoslibrary.appendonly`]: 'Add photos and albums to your Google Photos',\n [`${GOOGLE}photoslibrary.edit.appcreateddata`]: 'Change the photos and albums this app added',\n [`${GOOGLE}photoslibrary.readonly.appcreateddata`]: 'See the photos and albums this app added',\n [`${GOOGLE}youtube`]: 'Manage your YouTube account',\n [`${GOOGLE}youtube.force-ssl`]: 'See, edit and delete your YouTube videos, ratings and comments',\n [`${GOOGLE}youtube.readonly`]: 'See your YouTube account',\n [`${GOOGLE}youtube.upload`]: 'Upload videos to YouTube',\n [`${GOOGLE}youtube.channel-memberships.creator`]: \"See your channel's members and membership levels\",\n [`${GOOGLE}adwords`]: 'See and manage your Google Ads accounts',\n openid: 'Sign you in',\n email: 'See your email address',\n profile: 'See your name and profile picture',\n};\n\nconst UPPER_SNAKE_SCOPE = /^([A-Z][A-Z0-9_]*?)_(READ|WRITE)$/;\nconst PREFIXED_SCOPE = /^(read|write)_([a-z][a-z0-9_]*)$/;\n\n/** Scope codes as what a person is agreeing to; codes with one meaning show once. */\nexport function summarizeScopes(scopes: readonly string[]): string[] {\n const groups = new Map<string, { access: Set<string> }>();\n const known = new Set<string>();\n const out: Array<string | { resource: string }> = [];\n for (const scope of scopes) {\n const sentence = KNOWN_SCOPES[scope];\n if (sentence) {\n if (!known.has(sentence)) {\n known.add(sentence);\n out.push(sentence);\n }\n continue;\n }\n const upper = UPPER_SNAKE_SCOPE.exec(scope);\n const prefixed = upper ? null : PREFIXED_SCOPE.exec(scope);\n if (!upper && !prefixed) {\n out.push(scope);\n continue;\n }\n const resource = (upper ? upper[1] : prefixed![2]).toLowerCase().replace(/_/g, ' ');\n const access = (upper ? upper[2] : prefixed![1]).toLowerCase();\n const existing = groups.get(resource);\n if (existing) {\n existing.access.add(access);\n continue;\n }\n groups.set(resource, { access: new Set([access]) });\n out.push({ resource });\n }\n return out.map((entry) => {\n if (typeof entry === 'string') return entry;\n const { access } = groups.get(entry.resource)!;\n const label =\n access.has('read') && access.has('write') ? 'Read and write' : access.has('write') ? 'Write' : 'Read';\n return `${label} ${entry.resource}`;\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYa,MAAA,kCAAA,GAAqC,CAAC,cAAgB,EAAA,MAAA,EAAQ,SAAS,eAAiB,EAAA,cAAA,EAAgB,SAAW,EAAA,UAAA,EAAY,QAAQ;AA8B7I,SAAS,WAAW,OAAuD,EAAA;AAChF,EAAA,IAAI,CAAC,OAAA,IAAW,OAAO,OAAA,KAAY,UAAiB,OAAA,MAAA;AACpD,EAAA,MAAM,QAAS,OAEZ,CAAA,QAAA;AACH,EAAA,IAAI,KAAS,IAAA,OAAO,KAAU,KAAA,QAAA,EAAiB,OAAA,KAAA;AAC/C,EAAO,OAAA,OAAA;AACT;AAGO,SAAS,2BAA2B,cAAgF,EAAA;AACzH,EAAA,IAAI,CAAC,cAAkB,IAAA,OAAO,cAAmB,KAAA,QAAA,SAAiB,EAAC;AACnE,EAAA,MAAM,SAAoC,EAAC;AAC3C,EAAA,KAAA,MAAW,CAAC,SAAW,EAAA,SAAS,KAAK,MAAO,CAAA,OAAA,CAAQ,cAAc,CAAG,EAAA;AACnE,IAAA,IAAI,CAAC,SAAA,IAAa,OAAO,SAAA,KAAc,QAAU,EAAA;AACjD,IAAA,KAAA,MAAW,CAAC,OAAS,EAAA,QAAQ,KAAK,MAAO,CAAA,OAAA,CAAQ,SAAoC,CAAG,EAAA;AACtF,MAAA,IAAI,CAAC,QAAA,IAAY,OAAO,QAAA,KAAa,QAAU,EAAA;AAC/C,MAAA,MAAM,QAAW,GAAA,QAAA;AACjB,MAAA,MAAM,eAAe,OAAO,QAAA,CAAS,kBAAkB,SAAa,IAAA,OAAO,SAAS,YAAiB,KAAA,SAAA;AACrG,MAAM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