@superblocksteam/shared 0.9619.10 → 0.9620.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 (444) hide show
  1. package/dist/bindings/utils.d.ts.map +1 -1
  2. package/dist/bindings/utils.js +1 -1
  3. package/dist/bindings/utils.js.map +1 -1
  4. package/dist/constants.d.ts +10 -8
  5. package/dist/constants.d.ts.map +1 -1
  6. package/dist/constants.js +12 -12
  7. package/dist/constants.js.map +1 -1
  8. package/dist/database-lifecycle/appDatabaseCompatibility.d.ts +2 -2
  9. package/dist/database-lifecycle/appDatabaseCompatibility.d.ts.map +1 -1
  10. package/dist/database-lifecycle/appDatabaseImport.d.ts +18 -2
  11. package/dist/database-lifecycle/appDatabaseImport.d.ts.map +1 -1
  12. package/dist/database-lifecycle/appDatabaseImport.js.map +1 -1
  13. package/dist/database-lifecycle/appDatabaseStatus.d.ts +12 -2
  14. package/dist/database-lifecycle/appDatabaseStatus.d.ts.map +1 -1
  15. package/dist/database-lifecycle/appDatabaseStatus.js +8 -2
  16. package/dist/database-lifecycle/appDatabaseStatus.js.map +1 -1
  17. package/dist/database-lifecycle/appDatabaseStatus.test.js +2 -0
  18. package/dist/database-lifecycle/appDatabaseStatus.test.js.map +1 -1
  19. package/dist/database-lifecycle/capacityPolicy.d.ts +2 -2
  20. package/dist/database-lifecycle/capacityPolicy.d.ts.map +1 -1
  21. package/dist/database-lifecycle/capacityPolicy.js.map +1 -1
  22. package/dist/database-lifecycle/dataImport.d.ts +7 -4
  23. package/dist/database-lifecycle/dataImport.d.ts.map +1 -1
  24. package/dist/database-lifecycle/dataImport.js.map +1 -1
  25. package/dist/database-lifecycle/destructiveMigrations.d.ts +3 -3
  26. package/dist/database-lifecycle/destructiveMigrations.js.map +1 -1
  27. package/dist/database-lifecycle/importCompatibility.d.ts +15 -2
  28. package/dist/database-lifecycle/importCompatibility.d.ts.map +1 -1
  29. package/dist/database-lifecycle/importCompatibility.js +33 -0
  30. package/dist/database-lifecycle/importCompatibility.js.map +1 -1
  31. package/dist/database-lifecycle/importCompatibility.test.js +47 -1
  32. package/dist/database-lifecycle/importCompatibility.test.js.map +1 -1
  33. package/dist/database-lifecycle/index.d.ts +18 -14
  34. package/dist/database-lifecycle/index.d.ts.map +1 -1
  35. package/dist/database-lifecycle/index.js +4 -0
  36. package/dist/database-lifecycle/index.js.map +1 -1
  37. package/dist/database-lifecycle/physicalPoolIdentity.d.ts.map +1 -1
  38. package/dist/database-lifecycle/physicalPoolIdentity.js.map +1 -1
  39. package/dist/errors/git.d.ts.map +1 -1
  40. package/dist/errors/http.d.ts.map +1 -1
  41. package/dist/errors/integration.d.ts.map +1 -1
  42. package/dist/errors/integration.js +1 -1
  43. package/dist/errors/integration.js.map +1 -1
  44. package/dist/headers.d.ts +9 -0
  45. package/dist/headers.d.ts.map +1 -0
  46. package/dist/headers.js +12 -0
  47. package/dist/headers.js.map +1 -0
  48. package/dist/jwt/verifier.d.ts.map +1 -1
  49. package/dist/jwt/verifier.js +1 -1
  50. package/dist/jwt/verifier.js.map +1 -1
  51. package/dist/observability/index.d.ts +1 -0
  52. package/dist/observability/index.d.ts.map +1 -1
  53. package/dist/observability/index.js +1 -0
  54. package/dist/observability/index.js.map +1 -1
  55. package/dist/org-features/index.d.ts +2 -2
  56. package/dist/org-features/index.d.ts.map +1 -1
  57. package/dist/package.json +1 -1
  58. package/dist/pageMigrations/migrations/v4to5.d.ts.map +1 -1
  59. package/dist/pageMigrations/migrations/v5to6.d.ts.map +1 -1
  60. package/dist/pageMigrations/migrations/v5to6.js +6 -1
  61. package/dist/pageMigrations/migrations/v5to6.js.map +1 -1
  62. package/dist/pageMigrations/migrations/v5to6.test.js +1 -1
  63. package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.d.ts.map +1 -1
  64. package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.js +1 -1
  65. package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.js.map +1 -1
  66. package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.test.js +1 -1
  67. package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.d.ts.map +1 -1
  68. package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.js +1 -1
  69. package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.js.map +1 -1
  70. package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.test.js +2 -2
  71. package/dist/pageMigrations/migrations/v6to7/migrateToSections.d.ts.map +1 -1
  72. package/dist/pageMigrations/migrations/v6to7/v6to7.d.ts.map +1 -1
  73. package/dist/pageMigrations/migrations/v7to8.d.ts.map +1 -1
  74. package/dist/pageMigrations/migrations/v7to8.js +2 -1
  75. package/dist/pageMigrations/migrations/v7to8.js.map +1 -1
  76. package/dist/pageMigrations/migrations/v7to8.test.js +1 -1
  77. package/dist/pages/pageV6.d.ts.map +1 -1
  78. package/dist/pages/pageV7.d.ts.map +1 -1
  79. package/dist/pages/pageV8.d.ts.map +1 -1
  80. package/dist/pages/pageV8.js +1 -1
  81. package/dist/pages/pageV8.js.map +1 -1
  82. package/dist/plugins/index.d.ts +1 -0
  83. package/dist/plugins/index.d.ts.map +1 -1
  84. package/dist/plugins/index.js +1 -0
  85. package/dist/plugins/index.js.map +1 -1
  86. package/dist/plugins/registry.d.ts.map +1 -1
  87. package/dist/plugins/templates/constants.d.ts +1 -1
  88. package/dist/plugins/templates/constants.d.ts.map +1 -1
  89. package/dist/plugins/templates/graphql.d.ts.map +1 -1
  90. package/dist/plugins/templates/gsheets.d.ts.map +1 -1
  91. package/dist/plugins/templates/lakebase.d.ts.map +1 -1
  92. package/dist/plugins/templates/mcp.d.ts.map +1 -1
  93. package/dist/plugins/templates/mcp.test.js +13 -0
  94. package/dist/plugins/templates/mcp.test.js.map +1 -1
  95. package/dist/plugins/templates/salesforce.d.ts.map +1 -1
  96. package/dist/plugins/templates/shared/auth.d.ts.map +1 -1
  97. package/dist/plugins/templates/shared/auth.js +16 -0
  98. package/dist/plugins/templates/shared/auth.js.map +1 -1
  99. package/dist/plugins/templates/shared/aws.d.ts.map +1 -1
  100. package/dist/plugins/templates/shared/db.d.ts.map +1 -1
  101. package/dist/plugins/templates/shared/openapi.d.ts.map +1 -1
  102. package/dist/plugins/templates/shared/openapi.js +1 -1
  103. package/dist/plugins/templates/shared/openapi.js.map +1 -1
  104. package/dist/plugins/templates/shared/restapiintegration.d.ts.map +1 -1
  105. package/dist/plugins/templates/shared/sql.d.ts.map +1 -1
  106. package/dist/plugins/templates/shared/sshtunnel.d.ts.map +1 -1
  107. package/dist/plugins/templates/snowflakepostgres.d.ts.map +1 -1
  108. package/dist/plugins/unsupported-integration-types.d.ts +10 -0
  109. package/dist/plugins/unsupported-integration-types.d.ts.map +1 -0
  110. package/dist/plugins/unsupported-integration-types.js +29 -0
  111. package/dist/plugins/unsupported-integration-types.js.map +1 -0
  112. package/dist/refactoring/application.d.ts.map +1 -1
  113. package/dist/refactoring/application.js +2 -1
  114. package/dist/refactoring/application.js.map +1 -1
  115. package/dist/refactoring/refactor.d.ts.map +1 -1
  116. package/dist/refactoring/refactor.js +4 -1
  117. package/dist/refactoring/refactor.js.map +1 -1
  118. package/dist/refactoring/refactor.test.js +274 -260
  119. package/dist/refactoring/refactor.test.js.map +1 -1
  120. package/dist/refactoring/rename.js +1 -1
  121. package/dist/refactoring/rename.js.map +1 -1
  122. package/dist/refactoring/updates.d.ts.map +1 -1
  123. package/dist/refactoring/updates.js +3 -1
  124. package/dist/refactoring/updates.js.map +1 -1
  125. package/dist/relay/builder.d.ts.map +1 -1
  126. package/dist/signing/JSON/portable.js +2 -2
  127. package/dist/signing/index.js +1 -1
  128. package/dist/signing/index.js.map +1 -1
  129. package/dist/socket/dist-entry.test.js +10 -2
  130. package/dist/socket/dist-entry.test.js.map +1 -1
  131. package/dist/socket/heartbeat.d.ts.map +1 -1
  132. package/dist/socket/heartbeat.js.map +1 -1
  133. package/dist/socket/heartbeat.test.js.map +1 -1
  134. package/dist/socket/protocol.d.ts +26 -0
  135. package/dist/socket/protocol.d.ts.map +1 -1
  136. package/dist/socket/socket.d.ts +1 -1
  137. package/dist/socket/socket.d.ts.map +1 -1
  138. package/dist/socket/socket.js +2 -2
  139. package/dist/socket/socketWithClientAuth.d.ts.map +1 -1
  140. package/dist/socket/tracedSocket.d.ts.map +1 -1
  141. package/dist/socket/types.d.ts.map +1 -1
  142. package/dist/socket/util.js.map +1 -1
  143. package/dist/tracing/methodTracing.js +1 -1
  144. package/dist/types/ai/builder-caller.d.ts +16 -0
  145. package/dist/types/ai/builder-caller.d.ts.map +1 -0
  146. package/dist/types/ai/builder-caller.js +64 -0
  147. package/dist/types/ai/builder-caller.js.map +1 -0
  148. package/dist/types/ai/builder-caller.test.d.ts +2 -0
  149. package/dist/types/ai/builder-caller.test.d.ts.map +1 -0
  150. package/dist/types/ai/builder-caller.test.js +40 -0
  151. package/dist/types/ai/builder-caller.test.js.map +1 -0
  152. package/dist/types/ai/index.d.ts +25 -3
  153. package/dist/types/ai/index.d.ts.map +1 -1
  154. package/dist/types/ai/index.js +3 -0
  155. package/dist/types/ai/index.js.map +1 -1
  156. package/dist/types/ai/native-builder-model.d.ts +21 -0
  157. package/dist/types/ai/native-builder-model.d.ts.map +1 -0
  158. package/dist/types/ai/native-builder-model.js +26 -0
  159. package/dist/types/ai/native-builder-model.js.map +1 -0
  160. package/dist/types/ai/native-builder-model.test.d.ts +2 -0
  161. package/dist/types/ai/native-builder-model.test.d.ts.map +1 -0
  162. package/dist/types/ai/native-builder-model.test.js +30 -0
  163. package/dist/types/ai/native-builder-model.test.js.map +1 -0
  164. package/dist/types/ai/provider-credential.d.ts +1 -1
  165. package/dist/types/ai/provider-credential.d.ts.map +1 -1
  166. package/dist/types/ai/quota-paywall.d.ts.map +1 -1
  167. package/dist/types/ai/safety-classification.d.ts +1 -1
  168. package/dist/types/ai/safety-classification.d.ts.map +1 -1
  169. package/dist/types/api/control-flow.d.ts +12 -12
  170. package/dist/types/api/control-flow.d.ts.map +1 -1
  171. package/dist/types/api/control-flow.js.map +1 -1
  172. package/dist/types/api/execution.d.ts.map +1 -1
  173. package/dist/types/api/execution.js +4 -1
  174. package/dist/types/api/execution.js.map +1 -1
  175. package/dist/types/api/global.d.ts.map +1 -1
  176. package/dist/types/api/global.js +2 -3
  177. package/dist/types/api/global.js.map +1 -1
  178. package/dist/types/api/index.d.ts +1 -1
  179. package/dist/types/api/index.d.ts.map +1 -1
  180. package/dist/types/api/schedule.d.ts.map +1 -1
  181. package/dist/types/application/index.d.ts +3 -0
  182. package/dist/types/application/index.d.ts.map +1 -1
  183. package/dist/types/application/index.js.map +1 -1
  184. package/dist/types/application/index.test.js.map +1 -1
  185. package/dist/types/audit/ocsf.d.ts.map +1 -1
  186. package/dist/types/audit/ocsf.js +1 -0
  187. package/dist/types/audit/ocsf.js.map +1 -1
  188. package/dist/types/branch/index.d.ts +107 -0
  189. package/dist/types/branch/index.d.ts.map +1 -1
  190. package/dist/types/codeSecurity/index.d.ts +3 -3
  191. package/dist/types/codeSecurity/index.d.ts.map +1 -1
  192. package/dist/types/common/env.d.ts.map +1 -1
  193. package/dist/types/common/response.d.ts +3 -0
  194. package/dist/types/common/response.d.ts.map +1 -1
  195. package/dist/types/common/response.js +2 -0
  196. package/dist/types/common/response.js.map +1 -1
  197. package/dist/types/credentials/index.d.ts +3 -3
  198. package/dist/types/credentials/index.d.ts.map +1 -1
  199. package/dist/types/customAgents.d.ts +2 -3
  200. package/dist/types/customAgents.d.ts.map +1 -1
  201. package/dist/types/datasource/auth.d.ts.map +1 -1
  202. package/dist/types/datasource/auth.js +1 -1
  203. package/dist/types/datasource/auth.js.map +1 -1
  204. package/dist/types/datasource/index.d.ts.map +1 -1
  205. package/dist/types/datasource/metadata/database.d.ts.map +1 -1
  206. package/dist/types/event/index.d.ts +4 -3
  207. package/dist/types/event/index.d.ts.map +1 -1
  208. package/dist/types/event/index.js +1 -0
  209. package/dist/types/event/index.js.map +1 -1
  210. package/dist/types/group/index.d.ts.map +1 -1
  211. package/dist/types/integration/index.d.ts.map +1 -1
  212. package/dist/types/integration/index.js +2 -2
  213. package/dist/types/metadata/index.d.ts.map +1 -1
  214. package/dist/types/organization/agent.d.ts.map +1 -1
  215. package/dist/types/organization/token.d.ts.map +1 -1
  216. package/dist/types/page/Dimension.d.ts +7 -7
  217. package/dist/types/page/Dimension.d.ts.map +1 -1
  218. package/dist/types/page/Dimension.js +1 -1
  219. package/dist/types/page/Dimension.js.map +1 -1
  220. package/dist/types/page/Dimension.test.js +1 -1
  221. package/dist/types/page/Padding.d.ts +2 -2
  222. package/dist/types/page/Padding.d.ts.map +1 -1
  223. package/dist/types/page/Padding.js +1 -1
  224. package/dist/types/page/event.d.ts.map +1 -1
  225. package/dist/types/page/event.js +2 -1
  226. package/dist/types/page/event.js.map +1 -1
  227. package/dist/types/plugin/evaluation.d.ts +12 -5
  228. package/dist/types/plugin/evaluation.d.ts.map +1 -1
  229. package/dist/types/plugin/evaluation.js +8 -6
  230. package/dist/types/plugin/evaluation.js.map +1 -1
  231. package/dist/types/plugin/form.d.ts +1 -1
  232. package/dist/types/plugin/form.d.ts.map +1 -1
  233. package/dist/types/plugin/index.d.ts.map +1 -1
  234. package/dist/types/plugin/integration.d.ts.map +1 -1
  235. package/dist/types/plugin/js-tokenizer.d.ts +14 -0
  236. package/dist/types/plugin/js-tokenizer.d.ts.map +1 -0
  237. package/dist/types/plugin/js-tokenizer.js +97 -0
  238. package/dist/types/plugin/js-tokenizer.js.map +1 -0
  239. package/dist/types/plugin/js-tokenizer.test.d.ts +2 -0
  240. package/dist/types/plugin/js-tokenizer.test.d.ts.map +1 -0
  241. package/dist/types/plugin/js-tokenizer.test.js +126 -0
  242. package/dist/types/plugin/js-tokenizer.test.js.map +1 -0
  243. package/dist/types/policyGate/errors.d.ts +23 -23
  244. package/dist/types/policyGate/errors.d.ts.map +1 -1
  245. package/dist/types/profile/index.d.ts.map +1 -1
  246. package/dist/types/publishPipeline/index.d.ts +6 -6
  247. package/dist/types/publishPipeline/index.d.ts.map +1 -1
  248. package/dist/types/publishPipeline/policyStatus.js.map +1 -1
  249. package/dist/types/rbac/index.d.ts +4 -0
  250. package/dist/types/rbac/index.d.ts.map +1 -1
  251. package/dist/types/rbac/index.js +4 -0
  252. package/dist/types/rbac/index.js.map +1 -1
  253. package/dist/types/repository/index.d.ts.map +1 -1
  254. package/dist/types/repository/index.js.map +1 -1
  255. package/dist/types/reviewPolicy/index.d.ts +24 -24
  256. package/dist/types/reviewPolicy/index.d.ts.map +1 -1
  257. package/dist/types/user/analytics.d.ts +1 -1
  258. package/dist/types/user/analytics.d.ts.map +1 -1
  259. package/dist/utils/apiv2.d.ts.map +1 -1
  260. package/dist/utils/apiv2.js +1 -1
  261. package/dist/utils/apiv2.test.js +10 -10
  262. package/dist/utils/appDSL.d.ts.map +1 -1
  263. package/dist/utils/attachment-upload.d.ts +1 -1
  264. package/dist/utils/attachment-upload.d.ts.map +1 -1
  265. package/dist/utils/attachment-upload.js +3 -1
  266. package/dist/utils/attachment-upload.js.map +1 -1
  267. package/dist/utils/attachment-validation.d.ts +6 -6
  268. package/dist/utils/attachment-validation.d.ts.map +1 -1
  269. package/dist/utils/attachment-validation.js +5 -4
  270. package/dist/utils/attachment-validation.js.map +1 -1
  271. package/dist/utils/azure-devops-workflow.js.map +1 -1
  272. package/dist/utils/bitbucket-workflow.js.map +1 -1
  273. package/dist/utils/bytestring.d.ts.map +1 -1
  274. package/dist/utils/bytestring.js +5 -4
  275. package/dist/utils/bytestring.js.map +1 -1
  276. package/dist/utils/bytestring.test.d.ts +2 -0
  277. package/dist/utils/bytestring.test.d.ts.map +1 -0
  278. package/dist/utils/bytestring.test.js +23 -0
  279. package/dist/utils/bytestring.test.js.map +1 -0
  280. package/dist/utils/configuration.d.ts.map +1 -1
  281. package/dist/utils/configuration.js +3 -1
  282. package/dist/utils/configuration.js.map +1 -1
  283. package/dist/utils/env.d.ts.map +1 -1
  284. package/dist/utils/env.js +4 -4
  285. package/dist/utils/github-workflow.js.map +1 -1
  286. package/dist/utils/gitlab-workflow.js.map +1 -1
  287. package/dist/utils/index.d.ts +3 -0
  288. package/dist/utils/index.d.ts.map +1 -1
  289. package/dist/utils/index.js +3 -0
  290. package/dist/utils/index.js.map +1 -1
  291. package/dist/utils/localNativeBuilderFlags.d.ts +9 -0
  292. package/dist/utils/localNativeBuilderFlags.d.ts.map +1 -0
  293. package/dist/utils/localNativeBuilderFlags.js +26 -0
  294. package/dist/utils/localNativeBuilderFlags.js.map +1 -0
  295. package/dist/utils/localNativeBuilderFlags.test.d.ts +2 -0
  296. package/dist/utils/localNativeBuilderFlags.test.d.ts.map +1 -0
  297. package/dist/utils/localNativeBuilderFlags.test.js +35 -0
  298. package/dist/utils/localNativeBuilderFlags.test.js.map +1 -0
  299. package/dist/utils/maskCredential.d.ts.map +1 -1
  300. package/dist/utils/openApiSpecRef.d.ts +3 -0
  301. package/dist/utils/openApiSpecRef.d.ts.map +1 -0
  302. package/dist/utils/openApiSpecRef.js +27 -0
  303. package/dist/utils/openApiSpecRef.js.map +1 -0
  304. package/dist/utils/openApiSpecRef.test.d.ts +2 -0
  305. package/dist/utils/openApiSpecRef.test.d.ts.map +1 -0
  306. package/dist/utils/openApiSpecRef.test.js +16 -0
  307. package/dist/utils/openApiSpecRef.test.js.map +1 -0
  308. package/dist/utils/page.js +1 -1
  309. package/dist/utils/page.js.map +1 -1
  310. package/dist/utils/pageFixtures/v4/container.d.ts +346 -346
  311. package/dist/utils/pageFixtures/v4/container.d.ts.map +1 -1
  312. package/dist/utils/pageFixtures/v4/empty.d.ts.map +1 -1
  313. package/dist/utils/pageFixtures/v4/form.d.ts +11 -11
  314. package/dist/utils/pageFixtures/v4/form.d.ts.map +1 -1
  315. package/dist/utils/pageFixtures/v4/grid.d.ts +9 -9
  316. package/dist/utils/pageFixtures/v4/grid.d.ts.map +1 -1
  317. package/dist/utils/pageFixtures/v4/slideout.d.ts.map +1 -1
  318. package/dist/utils/pageFixtures/v4/tabs.d.ts.map +1 -1
  319. package/dist/utils/pageFixtures/v5/codeTrigger.d.ts.map +1 -1
  320. package/dist/utils/pageFixtures/v5/complexTriggers.d.ts.map +1 -1
  321. package/dist/utils/pageFixtures/v5/duplicateTriggers.d.ts.map +1 -1
  322. package/dist/utils/pageFixtures/v5/missingTriggers.d.ts.map +1 -1
  323. package/dist/utils/pageFixtures/v6/initial_app.d.ts.map +1 -1
  324. package/dist/utils/pageFixtures/v6/nested_modal.d.ts +32 -32
  325. package/dist/utils/pageFixtures/v6/nested_modal.d.ts.map +1 -1
  326. package/dist/utils/pageFixtures/v6/slideout_without_child.d.ts.map +1 -1
  327. package/dist/utils/pageFixtures/v6/with_2_modals.d.ts +30 -30
  328. package/dist/utils/pageFixtures/v6/with_2_modals.d.ts.map +1 -1
  329. package/dist/utils/pageFixtures/v6/with_main_canvas_children.d.ts +97 -97
  330. package/dist/utils/pageFixtures/v6/with_main_canvas_children.d.ts.map +1 -1
  331. package/dist/utils/pageFixtures/v6/with_slideouts.d.ts +42 -42
  332. package/dist/utils/pageFixtures/v6/with_slideouts.d.ts.map +1 -1
  333. package/dist/utils/pageFixtures/v6/with_widgets_named_page.d.ts.map +1 -1
  334. package/dist/utils/pageFixtures/v7/canvases.d.ts +29 -29
  335. package/dist/utils/pageFixtures/v7/canvases.d.ts.map +1 -1
  336. package/dist/utils/pageFixtures/v7/grids_and_forms.d.ts +56 -56
  337. package/dist/utils/pageFixtures/v7/grids_and_forms.d.ts.map +1 -1
  338. package/dist/utils/pageFixtures/v7/images.d.ts.map +1 -1
  339. package/dist/utils/pageFixtures/v7/initial_app.d.ts.map +1 -1
  340. package/dist/utils/pageFixtures/v7/nested_containers.d.ts +2 -2
  341. package/dist/utils/pageFixtures/v7/nested_containers.d.ts.map +1 -1
  342. package/dist/utils/platform-mcp-server-routes.d.ts +23 -0
  343. package/dist/utils/platform-mcp-server-routes.d.ts.map +1 -0
  344. package/dist/utils/platform-mcp-server-routes.js +59 -0
  345. package/dist/utils/platform-mcp-server-routes.js.map +1 -0
  346. package/dist/utils/platform-mcp-server-routes.test.d.ts +2 -0
  347. package/dist/utils/platform-mcp-server-routes.test.d.ts.map +1 -0
  348. package/dist/utils/platform-mcp-server-routes.test.js +21 -0
  349. package/dist/utils/platform-mcp-server-routes.test.js.map +1 -0
  350. package/dist/utils/string.d.ts.map +1 -1
  351. package/dist/utils/string.js +1 -1
  352. package/dist/utils/tracedEventEmitter.d.ts.map +1 -1
  353. package/dist/utils/tracedEventEmitter.js +3 -3
  354. package/dist/utils/truncate.d.ts.map +1 -1
  355. package/dist/utils/truncate.test.js +1 -1
  356. package/dist/utils/url.d.ts.map +1 -1
  357. package/dist/utils/url.js +1 -1
  358. package/dist/utils/url.js.map +1 -1
  359. package/package.json +25 -19
  360. package/src/bindings/utils.ts +1 -1
  361. package/src/constants.ts +15 -12
  362. package/src/database-lifecycle/appDatabaseImport.ts +34 -0
  363. package/src/database-lifecycle/appDatabaseStatus.test.ts +2 -0
  364. package/src/database-lifecycle/appDatabaseStatus.ts +19 -3
  365. package/src/database-lifecycle/dataImport.ts +6 -0
  366. package/src/database-lifecycle/importCompatibility.test.ts +60 -1
  367. package/src/database-lifecycle/importCompatibility.ts +52 -0
  368. package/src/database-lifecycle/index.ts +6 -0
  369. package/src/errors/integration.ts +1 -1
  370. package/src/headers.ts +11 -0
  371. package/src/jwt/verifier.ts +1 -1
  372. package/src/observability/index.ts +1 -0
  373. package/src/pageMigrations/migrations/v4to5.ts +1 -1
  374. package/src/pageMigrations/migrations/v5to6.test.ts +1 -1
  375. package/src/pageMigrations/migrations/v5to6.ts +6 -1
  376. package/src/pageMigrations/migrations/v6to7/adjustModalCanvases.test.ts +1 -1
  377. package/src/pageMigrations/migrations/v6to7/adjustModalCanvases.ts +1 -1
  378. package/src/pageMigrations/migrations/v6to7/migrateToDimensions.test.ts +2 -2
  379. package/src/pageMigrations/migrations/v6to7/migrateToDimensions.ts +1 -1
  380. package/src/pageMigrations/migrations/v7to8.test.ts +1 -1
  381. package/src/pageMigrations/migrations/v7to8.ts +2 -1
  382. package/src/pages/pageV8.ts +1 -1
  383. package/src/plugins/index.ts +1 -0
  384. package/src/plugins/templates/mcp.test.ts +17 -0
  385. package/src/plugins/templates/shared/auth.ts +16 -0
  386. package/src/plugins/templates/shared/openapi.ts +1 -1
  387. package/src/plugins/unsupported-integration-types.ts +30 -0
  388. package/src/refactoring/application.ts +2 -1
  389. package/src/refactoring/refactor.test.ts +306 -287
  390. package/src/refactoring/refactor.ts +4 -1
  391. package/src/refactoring/rename.ts +1 -1
  392. package/src/refactoring/updates.ts +3 -1
  393. package/src/signing/JSON/portable.ts +2 -2
  394. package/src/signing/index.ts +1 -1
  395. package/src/socket/dist-entry.test.ts +14 -2
  396. package/src/socket/protocol.ts +17 -0
  397. package/src/socket/socket.ts +2 -2
  398. package/src/socket/types.ts +1 -1
  399. package/src/tracing/methodTracing.ts +1 -1
  400. package/src/types/ai/builder-caller.test.ts +45 -0
  401. package/src/types/ai/builder-caller.ts +63 -0
  402. package/src/types/ai/index.ts +24 -0
  403. package/src/types/ai/native-builder-model.test.ts +33 -0
  404. package/src/types/ai/native-builder-model.ts +28 -0
  405. package/src/types/api/execution.ts +4 -1
  406. package/src/types/api/global.ts +2 -4
  407. package/src/types/application/index.ts +3 -0
  408. package/src/types/audit/ocsf.ts +1 -0
  409. package/src/types/branch/index.ts +101 -0
  410. package/src/types/common/response.ts +3 -0
  411. package/src/types/customAgents.ts +2 -3
  412. package/src/types/datasource/auth.ts +1 -1
  413. package/src/types/datasource/metadata/index.ts +4 -4
  414. package/src/types/event/index.ts +2 -1
  415. package/src/types/integration/index.ts +3 -3
  416. package/src/types/page/Dimension.test.ts +1 -1
  417. package/src/types/page/Dimension.ts +1 -1
  418. package/src/types/page/Padding.ts +1 -1
  419. package/src/types/page/event.ts +2 -1
  420. package/src/types/plugin/evaluation.ts +20 -13
  421. package/src/types/plugin/form.ts +1 -1
  422. package/src/types/plugin/js-tokenizer.test.ts +139 -0
  423. package/src/types/plugin/js-tokenizer.ts +98 -0
  424. package/src/types/rbac/index.ts +4 -0
  425. package/src/utils/apiv2.test.ts +10 -10
  426. package/src/utils/apiv2.ts +1 -1
  427. package/src/utils/attachment-upload.ts +4 -1
  428. package/src/utils/attachment-validation.ts +8 -4
  429. package/src/utils/bytestring.test.ts +31 -0
  430. package/src/utils/bytestring.ts +7 -4
  431. package/src/utils/configuration.ts +3 -1
  432. package/src/utils/env.ts +5 -5
  433. package/src/utils/index.ts +3 -0
  434. package/src/utils/localNativeBuilderFlags.test.ts +39 -0
  435. package/src/utils/localNativeBuilderFlags.ts +27 -0
  436. package/src/utils/openApiSpecRef.test.ts +20 -0
  437. package/src/utils/openApiSpecRef.ts +30 -0
  438. package/src/utils/page.ts +2 -2
  439. package/src/utils/platform-mcp-server-routes.test.ts +27 -0
  440. package/src/utils/platform-mcp-server-routes.ts +65 -0
  441. package/src/utils/string.ts +1 -1
  442. package/src/utils/tracedEventEmitter.ts +5 -5
  443. package/src/utils/truncate.test.ts +1 -1
  444. package/src/utils/url.ts +1 -1
@@ -1645,6 +1645,22 @@ export const authSections = ({
1645
1645
  %>`,
1646
1646
  type: 'success',
1647
1647
  showIcon: true
1648
+ },
1649
+ {
1650
+ label: '',
1651
+ name: 'oauth-per-user-connect-hint',
1652
+ startVersion: startVersion,
1653
+ componentType: FormComponentType.ALERT,
1654
+ messageTemplate: `Each user connects their own ${pluginName} account when they first run this integration in an app, so Connect is off here. To connect one account for all users, check "Share access token across all users".`,
1655
+ type: 'info',
1656
+ showIcon: true,
1657
+ display: {
1658
+ show: {
1659
+ authType: [IntegrationAuthType.OAUTH2_CODE],
1660
+ // Same check that disables Connect in loadButtonSaga, so the hint and the button agree.
1661
+ 'authConfig.tokenScope': [TokenScope.USER]
1662
+ }
1663
+ }
1648
1664
  }
1649
1665
  ],
1650
1666
  fieldNamesToHide
@@ -1,4 +1,4 @@
1
- import { isEmpty } from 'lodash-es';
1
+ import isEmpty from 'lodash-es/isEmpty.js';
2
2
 
3
3
  import {
4
4
  ActionResponseType,
@@ -0,0 +1,30 @@
1
+ import { EmailPlugin } from './templates/email.js';
2
+ import { GOOGLE_SHEETS_PLUGIN_ID } from './templates/gsheets.js';
3
+ import { ConfluentPlugin, KafkaPlugin, RedpandaPlugin } from './templates/kafka.js';
4
+ import { KinesisPlugin } from './templates/kinesis.js';
5
+ import { OpenAiPlugin } from './templates/openai.js';
6
+ import { RedisPlugin } from './templates/redis.js';
7
+ import { SuperblocksOcrPlugin } from './templates/superblocks-ocr.js';
8
+ import { WorkflowPlugin } from './templates/workflow.js';
9
+
10
+ /**
11
+ * Plugin ids current apps cannot set up. Older apps still create them through the server API.
12
+ */
13
+ export const UNSUPPORTED_INTEGRATION_TYPES: Set<string> = new Set([
14
+ ConfluentPlugin.id,
15
+ EmailPlugin.id,
16
+ GOOGLE_SHEETS_PLUGIN_ID,
17
+ KafkaPlugin.id,
18
+ KinesisPlugin.id,
19
+ OpenAiPlugin.id,
20
+ RedisPlugin.id,
21
+ RedpandaPlugin.id,
22
+ SuperblocksOcrPlugin.id,
23
+ WorkflowPlugin.id
24
+ ]);
25
+
26
+ /**
27
+ * Unsupported plugins whose service is an HTTP API, so a REST integration is a real substitute.
28
+ * Protocol plugins such as Redis and Kafka are absent: a REST connection cannot speak those protocols.
29
+ */
30
+ export const HTTP_API_UNSUPPORTED_PLUGIN_IDS: Set<string> = new Set([GOOGLE_SHEETS_PLUGIN_ID, OpenAiPlugin.id]);
@@ -1,4 +1,5 @@
1
- import { cloneDeep, set } from 'lodash-es';
1
+ import cloneDeep from 'lodash-es/cloneDeep.js';
2
+ import set from 'lodash-es/set.js';
2
3
 
3
4
  import type { ApplicationConfiguration } from '../types/index.js';
4
5
  import type { ScopedDataTree } from './refactor.js';
@@ -1,298 +1,317 @@
1
- import { tokenize } from 'esprima';
2
- import { describe, it, expect } from 'vitest';
1
+ import { it, expect } from 'vitest';
3
2
 
4
3
  import { type EvaluationPair, extractJsEvaluationPairsWithTokenizer, LanguagePluginID } from '../types/index.js';
4
+ import { tokenizeJs } from '../types/plugin/js-tokenizer.js';
5
5
  import { refactorNameInCode, refactorNameInString, refactorNameInValue, refactorNameInStep } from './refactor.js';
6
6
 
7
- describe('Refactoring', () => {
8
- describe('Page Scope', () => {
9
- describe('refactorNameInCode', () => {
10
- it('should refactor the old name to the new name in the code', async () => {
11
- const value = 'return oldName;';
12
- const oldName = 'oldName';
13
- const newName = 'newName';
14
- const dataTree = {
15
- oldName: {}
16
- };
17
-
18
- const result = await refactorNameInCode({
19
- value,
20
- oldName,
21
- newName,
22
- dataTree,
23
- extractPairs: extractJsEvaluationPairs
24
- });
25
-
26
- expect(result).toEqual('return newName;');
27
- });
28
- });
29
-
30
- describe('refactorNameInString', () => {
31
- it('should refactor the old name to the new name in the string', async () => {
32
- const value = 'Hello, {{oldName}}!';
33
- const oldName = 'oldName';
34
- const newName = 'newName';
35
- const dataTree = {
36
- oldName: {}
37
- };
38
-
39
- const result = await refactorNameInString({
40
- value,
41
- oldName,
42
- newName,
43
- dataTree,
44
- extractPairs: extractJsEvaluationPairs
45
- });
46
-
47
- expect(result).toEqual('Hello, {{newName}}!');
48
- });
49
- });
50
-
51
- describe('refactorNameInValue', () => {
52
- it('in object', async () => {
53
- const oldValue = {
54
- name: '{{oldName}}',
55
- age: 30
56
- };
57
- const oldName = 'oldName';
58
- const newName = 'newName';
59
- const dataTree = {
60
- oldName: {}
61
- };
62
-
63
- const result = await refactorNameInValue({
64
- oldValue,
65
- oldName,
66
- newName,
67
- dataTree,
68
- extractPairs: extractJsEvaluationPairs
69
- });
70
-
71
- expect(result).toEqual({
72
- name: '{{newName}}',
73
- age: 30
74
- });
75
- });
76
- });
77
-
78
- it('in array', async () => {
79
- const oldValue = ['{{oldName}}', 30];
80
- const oldName = 'oldName';
81
- const newName = 'newName';
82
- const dataTree = {
83
- oldName: {}
84
- };
85
-
86
- const result = await refactorNameInValue({
87
- oldValue,
88
- oldName,
89
- newName,
90
- dataTree,
91
- extractPairs: extractJsEvaluationPairs
92
- });
93
-
94
- expect(result).toEqual(['{{newName}}', 30]);
95
- });
96
- it('in string', async () => {
97
- const oldValue = '{{oldName}}';
98
- const oldName = 'oldName';
99
- const newName = 'newName';
100
- const dataTree = {
101
- oldName: {}
102
- };
103
-
104
- const result = await refactorNameInValue({
105
- oldValue,
106
- oldName,
107
- newName,
108
- dataTree,
109
- extractPairs: extractJsEvaluationPairs
110
- });
111
-
112
- expect(result).toEqual('{{newName}}');
113
- });
7
+ it('Page Scope refactorNameInCode should refactor the old name to the new name in the code', async () => {
8
+ const value = 'return oldName;';
9
+ const oldName = 'oldName';
10
+ const newName = 'newName';
11
+ const dataTree = {
12
+ oldName: {}
13
+ };
14
+
15
+ const result = await refactorNameInCode({
16
+ value,
17
+ oldName,
18
+ newName,
19
+ dataTree,
20
+ extractPairs: extractJsEvaluationPairs
114
21
  });
115
22
 
116
- describe('App Scope', () => {
117
- describe('refactorNameInCode', () => {
118
- it('should refactor the old name to the new name in the code', async () => {
119
- const value = 'return App.oldName;';
120
- const oldName = 'oldName';
121
- const newName = 'newName';
122
- const dataTree = {
123
- oldName: {}
124
- };
125
-
126
- const result = await refactorNameInCode({
127
- value,
128
- oldName,
129
- newName,
130
- dataTree,
131
- namespace: 'App',
132
- extractPairs: extractJsEvaluationPairs
133
- });
134
-
135
- expect(result).toEqual('return App.newName;');
136
- });
137
- });
138
-
139
- describe('refactorNameInString', () => {
140
- it('should refactor the old name to the new name in the string', async () => {
141
- const value = 'Hello, {{App.oldName}}!';
142
- const oldName = 'oldName';
143
- const newName = 'newName';
144
- const dataTree = {
145
- oldName: {}
146
- };
147
-
148
- const result = await refactorNameInString({
149
- value,
150
- oldName,
151
- newName,
152
- dataTree,
153
- namespace: 'App',
154
- extractPairs: extractJsEvaluationPairs
155
- });
156
-
157
- expect(result).toEqual('Hello, {{App.newName}}!');
158
- });
159
- });
160
-
161
- describe('refactorNameInValue', () => {
162
- it('in object', async () => {
163
- const oldValue = {
164
- name: '{{App.oldName}}',
165
- age: 30
166
- };
167
- const oldName = 'oldName';
168
- const newName = 'newName';
169
- const dataTree = {
170
- oldName: {}
171
- };
172
-
173
- const result = await refactorNameInValue({
174
- oldValue,
175
- oldName,
176
- newName,
177
- dataTree,
178
- namespace: 'App',
179
- extractPairs: extractJsEvaluationPairs
180
- });
181
-
182
- expect(result).toEqual({
183
- name: '{{App.newName}}',
184
- age: 30
185
- });
186
- });
187
- });
188
-
189
- it('in array', async () => {
190
- const oldValue = ['{{App.oldName}}', 30];
191
- const oldName = 'oldName';
192
- const newName = 'newName';
193
- const dataTree = {
194
- oldName: {}
195
- };
196
-
197
- const result = await refactorNameInValue({
198
- oldValue,
199
- oldName,
200
- newName,
201
- dataTree,
202
- namespace: 'App',
203
- extractPairs: extractJsEvaluationPairs
204
- });
205
-
206
- expect(result).toEqual(['{{App.newName}}', 30]);
207
- });
208
- it('in string', async () => {
209
- const oldValue = '{{App.oldName}}';
210
- const oldName = 'oldName';
211
- const newName = 'newName';
212
- const dataTree = {
213
- oldName: {}
214
- };
215
-
216
- const result = await refactorNameInValue({
217
- oldValue,
218
- oldName,
219
- newName,
220
- dataTree,
221
- namespace: 'App',
222
- extractPairs: extractJsEvaluationPairs
223
- });
224
-
225
- expect(result).toEqual('{{App.newName}}');
226
- });
23
+ expect(result).toEqual('return newName;');
24
+ });
25
+
26
+ it('Page Scope refactorNameInString should refactor the old name to the new name in the string', async () => {
27
+ const value = 'Hello, {{oldName}}!';
28
+ const oldName = 'oldName';
29
+ const newName = 'newName';
30
+ const dataTree = {
31
+ oldName: {}
32
+ };
33
+
34
+ const result = await refactorNameInString({
35
+ value,
36
+ oldName,
37
+ newName,
38
+ dataTree,
39
+ extractPairs: extractJsEvaluationPairs
227
40
  });
228
41
 
229
- describe('refactorNameInStep', () => {
230
- it('should refactor names in JS steps', async () => {
231
- const oldName = 'oldName';
232
- const newName = 'newName';
233
- const dataTree = {
234
- oldName: {}
235
- };
236
- const configuration = {
237
- body: 'return {{oldName}};'
238
- };
239
- await refactorNameInStep({
240
- configuration,
241
- oldName,
242
- newName,
243
- dataTree,
244
- namespace: undefined,
245
- pluginId: LanguagePluginID.JavaScript,
246
- extractor: extractJsEvaluationPairs
247
- });
248
- expect(configuration.body).toEqual('return {{newName}};');
249
- });
250
-
251
- it('should refactor names in steps with nested configurations, i.e. Databricks, Kinesis, etc', async () => {
252
- const oldName = 'oldName';
253
- const newName = 'newName';
254
- const dataTree = {
255
- oldName: {}
256
- };
257
- const configuration = {
258
- get: {
259
- limit: 10,
260
- pollingCooldownMs: 1000,
261
- shardIteratorType: 'SHARD_ITERATOR_TYPE_LATEST',
262
- streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
263
- },
264
- put: {
265
- data: '"test": {{oldName.text}}',
266
- streamName: '{{oldName.text}}',
267
- streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
268
- },
269
- operationType: 'OPERATION_TYPE_PUT'
270
- };
271
- await refactorNameInStep({
272
- configuration,
273
- oldName,
274
- newName,
275
- dataTree,
276
- namespace: undefined,
277
- pluginId: '12345',
278
- extractor: extractJsEvaluationPairs
279
- });
280
- expect(configuration).toEqual({
281
- get: {
282
- limit: 10,
283
- pollingCooldownMs: 1000,
284
- shardIteratorType: 'SHARD_ITERATOR_TYPE_LATEST',
285
- streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
286
- },
287
- put: {
288
- data: '"test": {{newName.text}}',
289
- streamName: '{{newName.text}}',
290
- streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
291
- },
292
- operationType: 'OPERATION_TYPE_PUT'
293
- });
294
- });
42
+ expect(result).toEqual('Hello, {{newName}}!');
43
+ });
44
+
45
+ it('Page Scope refactorNameInValue in object', async () => {
46
+ const oldValue = {
47
+ name: '{{oldName}}',
48
+ age: 30
49
+ };
50
+ const oldName = 'oldName';
51
+ const newName = 'newName';
52
+ const dataTree = {
53
+ oldName: {}
54
+ };
55
+
56
+ const result = await refactorNameInValue({
57
+ oldValue,
58
+ oldName,
59
+ newName,
60
+ dataTree,
61
+ extractPairs: extractJsEvaluationPairs
62
+ });
63
+
64
+ expect(result).toEqual({
65
+ name: '{{newName}}',
66
+ age: 30
67
+ });
68
+ });
69
+
70
+ it('Page Scope refactorNameInValue in array', async () => {
71
+ const oldValue = ['{{oldName}}', 30];
72
+ const oldName = 'oldName';
73
+ const newName = 'newName';
74
+ const dataTree = {
75
+ oldName: {}
76
+ };
77
+
78
+ const result = await refactorNameInValue({
79
+ oldValue,
80
+ oldName,
81
+ newName,
82
+ dataTree,
83
+ extractPairs: extractJsEvaluationPairs
84
+ });
85
+
86
+ expect(result).toEqual(['{{newName}}', 30]);
87
+ });
88
+ it('Page Scope refactorNameInValue in string', async () => {
89
+ const oldValue = '{{oldName}}';
90
+ const oldName = 'oldName';
91
+ const newName = 'newName';
92
+ const dataTree = {
93
+ oldName: {}
94
+ };
95
+
96
+ const result = await refactorNameInValue({
97
+ oldValue,
98
+ oldName,
99
+ newName,
100
+ dataTree,
101
+ extractPairs: extractJsEvaluationPairs
102
+ });
103
+
104
+ expect(result).toEqual('{{newName}}');
105
+ });
106
+
107
+ it('App Scope refactorNameInCode should refactor the old name to the new name in the code', async () => {
108
+ const value = 'return App.oldName;';
109
+ const oldName = 'oldName';
110
+ const newName = 'newName';
111
+ const dataTree = {
112
+ oldName: {}
113
+ };
114
+
115
+ const result = await refactorNameInCode({
116
+ value,
117
+ oldName,
118
+ newName,
119
+ dataTree,
120
+ namespace: 'App',
121
+ extractPairs: extractJsEvaluationPairs
122
+ });
123
+
124
+ expect(result).toEqual('return App.newName;');
125
+ });
126
+
127
+ it('refactorNameInCode leaves a name inside a regex on the line after a block alone', async () => {
128
+ const value = '{}\n/App.oldName/.test(x)';
129
+
130
+ const result = await refactorNameInCode({
131
+ value,
132
+ oldName: 'oldName',
133
+ newName: 'newName',
134
+ dataTree: { oldName: {} },
135
+ namespace: 'App',
136
+ extractPairs: extractJsEvaluationPairs
137
+ });
138
+
139
+ expect(result).toEqual(value);
140
+ });
141
+
142
+ it('App Scope refactorNameInString should refactor the old name to the new name in the string', async () => {
143
+ const value = 'Hello, {{App.oldName}}!';
144
+ const oldName = 'oldName';
145
+ const newName = 'newName';
146
+ const dataTree = {
147
+ oldName: {}
148
+ };
149
+
150
+ const result = await refactorNameInString({
151
+ value,
152
+ oldName,
153
+ newName,
154
+ dataTree,
155
+ namespace: 'App',
156
+ extractPairs: extractJsEvaluationPairs
295
157
  });
158
+
159
+ expect(result).toEqual('Hello, {{App.newName}}!');
160
+ });
161
+
162
+ it('App Scope refactorNameInValue in object', async () => {
163
+ const oldValue = {
164
+ name: '{{App.oldName}}',
165
+ age: 30
166
+ };
167
+ const oldName = 'oldName';
168
+ const newName = 'newName';
169
+ const dataTree = {
170
+ oldName: {}
171
+ };
172
+
173
+ const result = await refactorNameInValue({
174
+ oldValue,
175
+ oldName,
176
+ newName,
177
+ dataTree,
178
+ namespace: 'App',
179
+ extractPairs: extractJsEvaluationPairs
180
+ });
181
+
182
+ expect(result).toEqual({
183
+ name: '{{App.newName}}',
184
+ age: 30
185
+ });
186
+ });
187
+
188
+ it('App Scope refactorNameInValue in array', async () => {
189
+ const oldValue = ['{{App.oldName}}', 30];
190
+ const oldName = 'oldName';
191
+ const newName = 'newName';
192
+ const dataTree = {
193
+ oldName: {}
194
+ };
195
+
196
+ const result = await refactorNameInValue({
197
+ oldValue,
198
+ oldName,
199
+ newName,
200
+ dataTree,
201
+ namespace: 'App',
202
+ extractPairs: extractJsEvaluationPairs
203
+ });
204
+
205
+ expect(result).toEqual(['{{App.newName}}', 30]);
206
+ });
207
+ it('App Scope refactorNameInValue in string', async () => {
208
+ const oldValue = '{{App.oldName}}';
209
+ const oldName = 'oldName';
210
+ const newName = 'newName';
211
+ const dataTree = {
212
+ oldName: {}
213
+ };
214
+
215
+ const result = await refactorNameInValue({
216
+ oldValue,
217
+ oldName,
218
+ newName,
219
+ dataTree,
220
+ namespace: 'App',
221
+ extractPairs: extractJsEvaluationPairs
222
+ });
223
+
224
+ expect(result).toEqual('{{App.newName}}');
225
+ });
226
+
227
+ it('refactorNameInStep should refactor names in JS steps', async () => {
228
+ const oldName = 'oldName';
229
+ const newName = 'newName';
230
+ const dataTree = {
231
+ oldName: {}
232
+ };
233
+ const configuration = {
234
+ body: 'return {{oldName}};'
235
+ };
236
+ await refactorNameInStep({
237
+ configuration,
238
+ oldName,
239
+ newName,
240
+ dataTree,
241
+ namespace: undefined,
242
+ pluginId: LanguagePluginID.JavaScript,
243
+ extractor: extractJsEvaluationPairs
244
+ });
245
+ expect(configuration.body).toEqual('return {{newName}};');
246
+ });
247
+
248
+ it('refactorNameInStep should refactor names in steps with nested configurations, i.e. Databricks, Kinesis, etc', async () => {
249
+ const oldName = 'oldName';
250
+ const newName = 'newName';
251
+ const dataTree = {
252
+ oldName: {}
253
+ };
254
+ const configuration = {
255
+ get: {
256
+ limit: 10,
257
+ pollingCooldownMs: 1000,
258
+ shardIteratorType: 'SHARD_ITERATOR_TYPE_LATEST',
259
+ streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
260
+ },
261
+ put: {
262
+ data: '"test": {{oldName.text}}',
263
+ streamName: '{{oldName.text}}',
264
+ streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
265
+ },
266
+ operationType: 'OPERATION_TYPE_PUT'
267
+ };
268
+ await refactorNameInStep({
269
+ configuration,
270
+ oldName,
271
+ newName,
272
+ dataTree,
273
+ namespace: undefined,
274
+ pluginId: '12345',
275
+ extractor: extractJsEvaluationPairs
276
+ });
277
+ expect(configuration).toEqual({
278
+ get: {
279
+ limit: 10,
280
+ pollingCooldownMs: 1000,
281
+ shardIteratorType: 'SHARD_ITERATOR_TYPE_LATEST',
282
+ streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
283
+ },
284
+ put: {
285
+ data: '"test": {{newName.text}}',
286
+ streamName: '{{newName.text}}',
287
+ streamIdentifierType: 'STREAM_IDENTIFIER_STREAM_NAME'
288
+ },
289
+ operationType: 'OPERATION_TYPE_PUT'
290
+ });
291
+ });
292
+
293
+ it.each([
294
+ // Syntax the old tokenizer also read: results must not change.
295
+ ['return oldName?.value ?? fallback;', 'return newName?.value ?? fallback;'],
296
+ ['return other?.oldName;', 'return other?.oldName;'],
297
+ ['x ??= oldName.value; y ||= oldName; z &&= oldName;', 'x ??= newName.value; y ||= newName; z &&= newName;'],
298
+ ['class Counter { count = oldName.value; static label = "n"; }', 'class Counter { count = newName.value; static label = "n"; }'],
299
+ ['return `${oldName.value}-${other}`;', 'return `${newName.value}-${other}`;'],
300
+ ['return oldName.value / 2 + /old/.test(oldName.text);', 'return newName.value / 2 + /old/.test(newName.text);'],
301
+ // Syntax the old tokenizer rejected, which left the code unrenamed.
302
+ ['return 1_000 + oldName.value;', 'return 1_000 + newName.value;'],
303
+ ['return BigInt(oldName.value) * 10n;', 'return BigInt(newName.value) * 10n;'],
304
+ ['class Counter { #count = oldName.value; }', 'class Counter { #count = newName.value; }']
305
+ ])('refactorNameInCode renames page scope references in %s', async (value, expected) => {
306
+ const result = await refactorNameInCode({
307
+ value,
308
+ oldName: 'oldName',
309
+ newName: 'newName',
310
+ dataTree: { oldName: {} },
311
+ extractPairs: extractJsEvaluationPairs
312
+ });
313
+
314
+ expect(result).toEqual(expected);
296
315
  });
297
316
 
298
317
  async function extractJsEvaluationPairs(
@@ -301,5 +320,5 @@ async function extractJsEvaluationPairs(
301
320
  dataTree: Record<Exclude<string, 'API' | 'WIDGETS'>, unknown>,
302
321
  namespacedEntitiesToExtract?: Record<string, Set<string>>
303
322
  ): Promise<EvaluationPair[]> {
304
- return extractJsEvaluationPairsWithTokenizer(jsSnippet, entitiesToExtract, dataTree, tokenize, namespacedEntitiesToExtract);
323
+ return extractJsEvaluationPairsWithTokenizer(jsSnippet, entitiesToExtract, dataTree, tokenizeJs, namespacedEntitiesToExtract);
305
324
  }
@@ -1,4 +1,7 @@
1
- import { isArray, isEqual, isObject, isString } from 'lodash-es';
1
+ import isArray from 'lodash-es/isArray.js';
2
+ import isEqual from 'lodash-es/isEqual.js';
3
+ import isObject from 'lodash-es/isObject.js';
4
+ import isString from 'lodash-es/isString.js';
2
5
 
3
6
  import { type StringSegment, getDynamicStringSegments, isExactBinding, joinStringWithBindings } from '../bindings/index.js';
4
7
  import { LanguagePluginID } from '../types/plugin/language.js';