@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
@@ -13,7 +13,7 @@ interface DimensionCache<Type extends object> {
13
13
  clear(): void;
14
14
  }
15
15
 
16
- // eslint-disable-next-line @typescript-eslint/no-namespace
16
+ // oxlint-disable-next-line @typescript-eslint/no-namespace
17
17
  export namespace Dimension {
18
18
  let enableCaching = false;
19
19
  let cache: DimensionCache<Dimension<DimensionModes>>;
@@ -7,7 +7,7 @@ export type Padding = {
7
7
  bottom?: Dimension<'px'>; // Default: { value: 0, mode: 'px' }
8
8
  };
9
9
 
10
- // eslint-disable-next-line @typescript-eslint/no-namespace
10
+ // oxlint-disable-next-line @typescript-eslint/no-namespace
11
11
  export namespace Padding {
12
12
  export const y = (padding?: Padding): Dimension<'px'> => {
13
13
  if (padding === undefined) {
@@ -1,4 +1,5 @@
1
- import { isArray, isPlainObject } from 'lodash-es';
1
+ import isArray from 'lodash-es/isArray.js';
2
+ import isPlainObject from 'lodash-es/isPlainObject.js';
2
3
 
3
4
  import type { ApplicationScope } from '../../types/application/index.js';
4
5
  import type { NotificationPosition } from './notification.js';
@@ -1,12 +1,13 @@
1
1
  import type { TreeCursor } from '@lezer/common';
2
2
  import type { LRParser } from '@lezer/lr';
3
- import type { Token, TokenizeOptions } from 'esprima';
4
3
  import type { SourceLocation } from 'estree';
5
- import { get, isFunction, isPlainObject } from 'lodash-es';
4
+ import get from 'lodash-es/get.js';
5
+ import isFunction from 'lodash-es/isFunction.js';
6
+ import isPlainObject from 'lodash-es/isPlainObject.js';
6
7
 
7
8
  export type EvaluationPair = {
8
9
  binding: string;
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
10
11
  value: any;
11
12
  range: {
12
13
  start: number;
@@ -18,7 +19,13 @@ export type EvaluationPair = {
18
19
 
19
20
  export type PythonParser = LRParser;
20
21
 
21
- type TokenWithRangeAndLoc = Token & {
22
+ /**
23
+ * A JavaScript token in the shape esprima's `tokenize` returns: `type` is a name like
24
+ * 'Identifier', 'Punctuator', 'Numeric', 'String' or 'Template', and `value` is the exact source text.
25
+ */
26
+ export type JsToken = {
27
+ type: string;
28
+ value: string;
22
29
  range?: [number, number];
23
30
  loc?: SourceLocation;
24
31
  };
@@ -26,12 +33,12 @@ type TokenWithRangeAndLoc = Token & {
26
33
  export const extractJsEvaluationPairsWithTokenizer = (
27
34
  jsSnippet: string,
28
35
  entitiesToExtract: Set<string>,
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
30
37
  dataTree: Record<string, any>,
31
- tokenize: (input: string, config?: TokenizeOptions) => TokenWithRangeAndLoc[],
38
+ tokenize: (input: string, config: { range: true; loc: true }) => JsToken[],
32
39
  namespacedEntitiesToExtract: Record<string, Set<string>> = {}
33
40
  ): EvaluationPair[] => {
34
- let tokens: TokenWithRangeAndLoc[] = [];
41
+ let tokens: JsToken[] = [];
35
42
  const ret: EvaluationPair[] = [];
36
43
  try {
37
44
  tokens = tokenize(jsSnippet, { range: true, loc: true });
@@ -104,14 +111,14 @@ export const extractJsEvaluationPairsWithTokenizer = (
104
111
  // TODO: Move test for this into shared.
105
112
  export const extractEntity = (
106
113
  indexToStart: number,
107
- tokens: Array<TokenWithRangeAndLoc>,
108
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
+ tokens: Array<JsToken>,
115
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
109
116
  dataTree: Record<string, any>
110
117
  ): EvaluationPair => {
111
118
  const currentPropertyPath: string[] = [];
112
- let previousToken: TokenWithRangeAndLoc | null = null;
119
+ let previousToken: JsToken | null = null;
113
120
  let done = false; // cant do break out of switch without state variable
114
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
121
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
115
122
  let entity: any;
116
123
  const removeTrailingPunctuation = () => {
117
124
  if (currentPropertyPath[currentPropertyPath.length - 1] === '.' || currentPropertyPath[currentPropertyPath.length - 1] === '[') {
@@ -236,7 +243,7 @@ export const extractEntity = (
236
243
  export const extractPythonEvaluationPairsWithParser = (
237
244
  code: string,
238
245
  entities: Set<string>,
239
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
246
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
240
247
  dataTree: Record<string, any>,
241
248
  parser: PythonParser,
242
249
  namespacedEntitiesToExtract: Record<string, Set<string>> = {}
@@ -248,7 +255,7 @@ export const extractPythonEvaluationPairsWithParser = (
248
255
  let isCapturing = false;
249
256
  const bindingPairs: EvaluationPair[] = [];
250
257
  let currentEntityPath: string[] = [];
251
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
258
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
252
259
  let entity: any;
253
260
  let bindingStart = 0;
254
261
  let bindingEnd = 0;
@@ -144,7 +144,7 @@ export interface BaseFormItem {
144
144
  doNotClearOnDependenciesChange?: boolean;
145
145
  initialValue?: InitialValue;
146
146
  secondaryInitialValue?: InitialValue;
147
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
147
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
148
148
  rules?: any[];
149
149
  style?: FormItemStyle;
150
150
  disabled?: boolean;
@@ -0,0 +1,139 @@
1
+ import { expect, it } from 'vitest';
2
+
3
+ import { tokenizeJs } from './js-tokenizer.js';
4
+
5
+ // Each token is written as `Type:value` to keep the tables readable.
6
+ function tokenStream(code: string): string[] {
7
+ return tokenizeJs(code).map((token) => `${token.type}:${token.value}`);
8
+ }
9
+
10
+ const templateCases: [string, string, string[]][] = [
11
+ ['a template with no substitutions is one token', '`a`', ['Template:`a`']],
12
+ ['a template with a substitution is split into head, expression and tail', '`a${x}b`', ['Template:`a${', 'Identifier:x', 'Template:}b`']],
13
+ [
14
+ 'a nested template is joined chunk by chunk',
15
+ '`a${`b${c}`}d`',
16
+ ['Template:`a${', 'Template:`b${', 'Identifier:c', 'Template:}`', 'Template:}d`']
17
+ ],
18
+ ['back-to-back templates stay separate', '`a``b`', ['Template:`a`', 'Template:`b`']],
19
+ ['a tagged template keeps the tag as an identifier', 'tag`a${x}`', ['Identifier:tag', 'Template:`a${', 'Identifier:x', 'Template:}`']],
20
+ [
21
+ 'two substitutions in a row share the middle chunk',
22
+ '`${a}${b}`',
23
+ ['Template:`${', 'Identifier:a', 'Template:}${', 'Identifier:b', 'Template:}`']
24
+ ],
25
+ [
26
+ 'braces inside a substitution are not mistaken for the template tail',
27
+ '`a${ {b:1}.b }c`',
28
+ [
29
+ 'Template:`a${',
30
+ 'Punctuator:{',
31
+ 'Identifier:b',
32
+ 'Punctuator::',
33
+ 'Numeric:1',
34
+ 'Punctuator:}',
35
+ 'Punctuator:.',
36
+ 'Identifier:b',
37
+ 'Template:}c`'
38
+ ]
39
+ ]
40
+ ];
41
+
42
+ it.each(templateCases)('%s', (_name, code, expected) => {
43
+ expect(tokenStream(code)).toEqual(expected);
44
+ });
45
+
46
+ // Esprima 4 does not know these operators, so it reads each as smaller ones. The extractors rely on
47
+ // the `.` in `a?.b` to avoid treating `b` as a top-level name.
48
+ const operatorCases: [string, string[]][] = [
49
+ ['a?.b', ['Identifier:a', 'Punctuator:?', 'Punctuator:.', 'Identifier:b']],
50
+ ['a?.[0]', ['Identifier:a', 'Punctuator:?', 'Punctuator:.', 'Punctuator:[', 'Numeric:0', 'Punctuator:]']],
51
+ ['f?.()', ['Identifier:f', 'Punctuator:?', 'Punctuator:.', 'Punctuator:(', 'Punctuator:)']],
52
+ ['a ?? b', ['Identifier:a', 'Punctuator:?', 'Punctuator:?', 'Identifier:b']],
53
+ ['a ??= b', ['Identifier:a', 'Punctuator:?', 'Punctuator:?', 'Punctuator:=', 'Identifier:b']],
54
+ ['a ||= b', ['Identifier:a', 'Punctuator:||', 'Punctuator:=', 'Identifier:b']],
55
+ ['a &&= b', ['Identifier:a', 'Punctuator:&&', 'Punctuator:=', 'Identifier:b']]
56
+ ];
57
+
58
+ it.each(operatorCases)('splits the operators in %j the way esprima did', (code, expected) => {
59
+ expect(tokenStream(code)).toEqual(expected);
60
+ });
61
+
62
+ it('reports let, yield and enum as keywords, like esprima', () => {
63
+ expect(tokenStream('let yield enum')).toEqual(['Keyword:let', 'Keyword:yield', 'Keyword:enum']);
64
+ });
65
+
66
+ const newSyntaxCases: [string, string, string[]][] = [
67
+ [
68
+ 'a private field declaration',
69
+ 'class A { #x = 1 }',
70
+ ['Keyword:class', 'Identifier:A', 'Punctuator:{', 'PrivateIdentifier:#x', 'Punctuator:=', 'Numeric:1', 'Punctuator:}']
71
+ ],
72
+ ['a private field brand check', '#x in o', ['PrivateIdentifier:#x', 'Keyword:in', 'Identifier:o']],
73
+ ['a numeric separator', '1_000', ['Numeric:1_000']],
74
+ ['a BigInt', '10n', ['Numeric:10n']],
75
+ ['a BigInt with separators', '0x1_0n', ['Numeric:0x1_0n']]
76
+ ];
77
+
78
+ it.each(newSyntaxCases)('reads %s, which esprima 4 throws on', (_name, code, expected) => {
79
+ expect(tokenStream(code)).toEqual(expected);
80
+ });
81
+
82
+ // Acorn decides between a regex and a division from the syntax around the `/`. Esprima guessed from
83
+ // the previous token and got these wrong, so the streams differ from esprima 4 on purpose.
84
+ const regexCases: [string, string, string[]][] = [
85
+ [
86
+ 'a regex on the line after a block is one token (esprima read /, foo, /)',
87
+ '{}\n/foo/.test(x)',
88
+ [
89
+ 'Punctuator:{',
90
+ 'Punctuator:}',
91
+ 'RegularExpression:/foo/',
92
+ 'Punctuator:.',
93
+ 'Identifier:test',
94
+ 'Punctuator:(',
95
+ 'Identifier:x',
96
+ 'Punctuator:)'
97
+ ]
98
+ ],
99
+ [
100
+ 'a regex on the line after an arrow function body is one token (esprima read /, re, /, g)',
101
+ 'a=>{}\n/re/g',
102
+ ['Identifier:a', 'Punctuator:=>', 'Punctuator:{', 'Punctuator:}', 'RegularExpression:/re/g']
103
+ ],
104
+ [
105
+ 'slashes after a property named return are divisions (esprima read a regex)',
106
+ 'x.return /2/ y',
107
+ ['Identifier:x', 'Punctuator:.', 'Keyword:return', 'Punctuator:/', 'Numeric:2', 'Punctuator:/', 'Identifier:y']
108
+ ],
109
+ [
110
+ 'a division between names stays a division',
111
+ 'a / b / c',
112
+ ['Identifier:a', 'Punctuator:/', 'Identifier:b', 'Punctuator:/', 'Identifier:c']
113
+ ],
114
+ ['a regex after an assignment is one token', 'x = /a+/gi', ['Identifier:x', 'Punctuator:=', 'RegularExpression:/a+/gi']]
115
+ ];
116
+
117
+ it.each(regexCases)('%s', (_name, code, expected) => {
118
+ expect(tokenStream(code)).toEqual(expected);
119
+ });
120
+
121
+ it('gives range and loc for every token on multi-line input, including split operators and joined templates', () => {
122
+ const code = 'a ??= 1;\n`x${\n y}`';
123
+
124
+ expect(tokenizeJs(code)).toEqual([
125
+ { type: 'Identifier', value: 'a', range: [0, 1], loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } } },
126
+ { type: 'Punctuator', value: '?', range: [2, 3], loc: { start: { line: 1, column: 2 }, end: { line: 1, column: 3 } } },
127
+ { type: 'Punctuator', value: '?', range: [3, 4], loc: { start: { line: 1, column: 3 }, end: { line: 1, column: 4 } } },
128
+ { type: 'Punctuator', value: '=', range: [4, 5], loc: { start: { line: 1, column: 4 }, end: { line: 1, column: 5 } } },
129
+ { type: 'Numeric', value: '1', range: [6, 7], loc: { start: { line: 1, column: 6 }, end: { line: 1, column: 7 } } },
130
+ { type: 'Punctuator', value: ';', range: [7, 8], loc: { start: { line: 1, column: 7 }, end: { line: 1, column: 8 } } },
131
+ { type: 'Template', value: '`x${', range: [9, 13], loc: { start: { line: 2, column: 0 }, end: { line: 2, column: 4 } } },
132
+ { type: 'Identifier', value: 'y', range: [16, 17], loc: { start: { line: 3, column: 2 }, end: { line: 3, column: 3 } } },
133
+ { type: 'Template', value: '}`', range: [17, 19], loc: { start: { line: 3, column: 3 }, end: { line: 3, column: 5 } } }
134
+ ]);
135
+ });
136
+
137
+ it('throws on code that is not JavaScript', () => {
138
+ expect(() => tokenizeJs('const = ;;"')).toThrow();
139
+ });
@@ -0,0 +1,98 @@
1
+ import { type Token as AcornToken, tokenizer, tokTypes } from 'acorn';
2
+
3
+ import type { JsToken } from './evaluation.js';
4
+
5
+ // Published as `@superblocksteam/shared/js-tokenizer` and left out of the package index on purpose.
6
+ // The browser apps import the index and bundle every module it reaches, so exporting this from
7
+ // there would ship acorn to every browser.
8
+
9
+ // Words esprima reports as keywords but acorn reports as plain names.
10
+ const ESPRIMA_ONLY_KEYWORDS = new Set(['let', 'yield', 'enum']);
11
+
12
+ function jsTokenType(token: AcornToken, value: string): string {
13
+ const { type } = token;
14
+ if (type === tokTypes.name) return ESPRIMA_ONLY_KEYWORDS.has(value) ? 'Keyword' : 'Identifier';
15
+ if (type === tokTypes._null) return 'Null';
16
+ if (type === tokTypes._true || type === tokTypes._false) return 'Boolean';
17
+ if (type.keyword) return 'Keyword';
18
+ if (type === tokTypes.num) return 'Numeric';
19
+ if (type === tokTypes.string) return 'String';
20
+ if (type === tokTypes.regexp) return 'RegularExpression';
21
+ if (type === tokTypes.privateId) return 'PrivateIdentifier';
22
+ return 'Punctuator';
23
+ }
24
+
25
+ function isTemplateChunk(token: AcornToken | undefined): boolean {
26
+ return token?.type === tokTypes.template || token?.type === tokTypes.invalidTemplate;
27
+ }
28
+
29
+ // Operators added after esprima 4. Esprima reads each as smaller operators, for example `a?.b` as
30
+ // `a`, `?`, `.`, `b`. The extractors rely on that: the `.` stops `b` from being read as a top-level name.
31
+ const ESPRIMA_OPERATOR_PARTS = new Map([
32
+ ['?.', ['?', '.']],
33
+ ['??', ['?', '?']],
34
+ ['??=', ['?', '?', '=']],
35
+ ['||=', ['||', '=']],
36
+ ['&&=', ['&&', '=']]
37
+ ]);
38
+
39
+ /**
40
+ * Tokenizes JavaScript with acorn, which also reads syntax esprima 4 rejects, such as numeric
41
+ * separators, BigInt and private class fields. For code esprima could read, the tokens match
42
+ * esprima's `tokenize(code, { range: true, loc: true })`, so the extractors in evaluation.ts
43
+ * behave as before. The exception is where esprima guessed wrong between a regex and a division:
44
+ * after a block or arrow body followed by a newline (`{}\n/foo/.test(x)`) acorn returns one regex
45
+ * token where esprima returned `/`, `foo`, `/`, and for `x.return /2/ y` it is the other way round.
46
+ * Acorn is right in both. So the extractors no longer see a name written inside the first kind of
47
+ * regex, and they now see the text between the slashes in the second.
48
+ * Throws on code acorn cannot read.
49
+ */
50
+ export function tokenizeJs(code: string): JsToken[] {
51
+ const acornTokens = [...tokenizer(code, { ecmaVersion: 'latest', locations: true })];
52
+ const tokens: JsToken[] = [];
53
+ const push = (type: string, first: AcornToken, last: AcornToken) => {
54
+ tokens.push({
55
+ type,
56
+ value: code.slice(first.start, last.end),
57
+ range: [first.start, last.end],
58
+ loc:
59
+ first.loc && last.loc
60
+ ? {
61
+ start: { line: first.loc.start.line, column: first.loc.start.column },
62
+ end: { line: last.loc.end.line, column: last.loc.end.column }
63
+ }
64
+ : undefined
65
+ });
66
+ };
67
+
68
+ for (let i = 0; i < acornTokens.length; i++) {
69
+ const token = acornTokens[i];
70
+ const value = code.slice(token.start, token.end);
71
+ // Acorn splits a template literal into backquote, text and `${` tokens, where esprima returns
72
+ // one 'Template' token per run of text, such as "`a${" or "}b`". Join them the same way.
73
+ if (token.type === tokTypes.backQuote || (token.type === tokTypes.braceR && isTemplateChunk(acornTokens[i + 1]))) {
74
+ i += 2;
75
+ push('Template', token, acornTokens[i]);
76
+ continue;
77
+ }
78
+ const parts = ESPRIMA_OPERATOR_PARTS.get(value);
79
+ if (!parts) {
80
+ push(jsTokenType(token, value), token, token);
81
+ continue;
82
+ }
83
+ let start = token.start;
84
+ for (const part of parts) {
85
+ const end = start + part.length;
86
+ const line = token.loc?.start.line ?? 0;
87
+ const column = (token.loc?.start.column ?? 0) + (start - token.start);
88
+ tokens.push({
89
+ type: 'Punctuator',
90
+ value: part,
91
+ range: [start, end],
92
+ loc: token.loc ? { start: { line, column }, end: { line, column: column + part.length } } : undefined
93
+ });
94
+ start = end;
95
+ }
96
+ }
97
+ return tokens;
98
+ }
@@ -139,6 +139,7 @@ export enum ResourceTypeEnum {
139
139
  LOGS = 'logs',
140
140
  LOGS_STREAMS = 'logs.streams',
141
141
  APP_DATABASES = 'app_databases',
142
+ MCP_CLIENTS = 'mcp_clients',
142
143
  NPM_REGISTRY = 'npm_registry',
143
144
  ORGANIZATION = 'org',
144
145
  // ORGANIZATION_REQUESTS = 'org.requests',
@@ -283,6 +284,9 @@ export const ActionTypeByResourceType = {
283
284
  MANAGE: ActionTypeEnum.MANAGE,
284
285
  USE: ActionTypeEnum.USE
285
286
  },
287
+ MCP_CLIENTS: {
288
+ MANAGE: ActionTypeEnum.MANAGE
289
+ },
286
290
  NPM_REGISTRY: {
287
291
  MANAGE: ActionTypeEnum.MANAGE
288
292
  },
@@ -42,7 +42,7 @@ describe('sanitizeV2RequestBody', () => {
42
42
  };
43
43
 
44
44
  const sanitizedApiBody = cloneDeep(apiBody);
45
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
46
46
  (sanitizedApiBody as any).blocks[1].conditional.if.blocks[0].step.openai.transcribeAudioToTextTranslateToEnglish = true;
47
47
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
48
48
  });
@@ -399,7 +399,7 @@ describe('sanitizeV2RequestBody', () => {
399
399
  }
400
400
  };
401
401
  const sanitizedApiBody = cloneDeep(apiBody);
402
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
402
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
403
403
  (sanitizedApiBody as any).blocks[0].step.mariadb.newValues = '';
404
404
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
405
405
  });
@@ -479,7 +479,7 @@ describe('sanitizeV2RequestBody', () => {
479
479
  }
480
480
  };
481
481
  const sanitizedApiBody = cloneDeep(apiBody);
482
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
482
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
483
483
  (sanitizedApiBody as any).blocks[0].step.mysql.newValues = '';
484
484
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
485
485
  });
@@ -585,9 +585,9 @@ describe('sanitizeV2RequestBody', () => {
585
585
  }
586
586
  };
587
587
  const sanitizedApiBody = cloneDeep(apiBody);
588
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
588
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
589
589
  (sanitizedApiBody as any).blocks[0].step.openai.generateTextNewTextMaxTokens = '1';
590
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
590
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
591
591
  (sanitizedApiBody as any).blocks[0].step.openai.transcribeAudioToTextTranslateToEnglish = false;
592
592
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
593
593
  });
@@ -631,7 +631,7 @@ describe('sanitizeV2RequestBody', () => {
631
631
  }
632
632
  };
633
633
  const sanitizedApiBody = cloneDeep(apiBody);
634
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
634
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
635
635
  (sanitizedApiBody as any).blocks[0].step.gsheets.rowNumber = '0';
636
636
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
637
637
  });
@@ -675,7 +675,7 @@ describe('sanitizeV2RequestBody', () => {
675
675
  }
676
676
  };
677
677
  const sanitizedApiBody = cloneDeep(apiBody);
678
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
678
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
679
679
  (sanitizedApiBody as any).blocks[0].step.gsheets.rowNumber = '100';
680
680
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
681
681
  });
@@ -787,7 +787,7 @@ describe('sanitizeV2RequestBody', () => {
787
787
  }
788
788
  };
789
789
  const sanitizedApiBody = cloneDeep(apiBody);
790
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
790
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
791
791
  (sanitizedApiBody as any).trigger.workflow.parameters.query[''] = { values: [''] };
792
792
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
793
793
  });
@@ -833,9 +833,9 @@ describe('sanitizeV2RequestBody', () => {
833
833
  }
834
834
  };
835
835
  const sanitizedApiBody = cloneDeep(apiBody);
836
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
836
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
837
837
  (sanitizedApiBody as any).blocks[0].variables.items[0].value = '{{Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}}';
838
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
838
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
839
839
  (sanitizedApiBody as any).blocks[0].variables.items[1].value = '{{2020,2021,2022,2023}}';
840
840
  expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
841
841
  });
@@ -11,7 +11,7 @@ export const transcribeAudioToTextTranslateToEnglishTruthyValues = ['checked', '
11
11
  export const transcribeAudioToTextTranslateToEnglishFalsyValues = [null, undefined, 'false', false];
12
12
 
13
13
  export const sanitizeV2RequestBody = (apiBody: Record<string, unknown>): Record<string, unknown> => {
14
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
15
15
  const traverseJSON = (obj: any) => {
16
16
  for (const key in obj) {
17
17
  if (key === 'step') {
@@ -1,3 +1,5 @@
1
+ import { PlatformMcpServerRequest } from './platform-mcp-server-routes.js';
2
+
1
3
  const OFFICE_MIME_SUBSTRINGS = [
2
4
  'application/msword',
3
5
  'application/vnd.ms-excel',
@@ -691,7 +693,8 @@ export async function uploadAttachmentToServerApi(params: {
691
693
  ...(commitId != null && { commitId })
692
694
  });
693
695
 
694
- const uploadUrl = new URL('/api/v1/files/upload', baseUrl);
696
+ // One of the routes the Platform MCP may call, which uploads through here.
697
+ const uploadUrl = new URL(PlatformMcpServerRequest.to('POST /api/v1/files/upload').path, baseUrl);
695
698
  uploadUrl.searchParams.set('scopeType', scopeType);
696
699
  uploadUrl.searchParams.set('purpose', purpose);
697
700
  if (applicationId != null && applicationId.trim() !== '') {
@@ -1,4 +1,4 @@
1
- import { PDFDocument, PDFPageLeaf, PDFPageTree } from 'pdf-lib';
1
+ import type { PDFDocument, PDFPageLeaf, PDFPageTree } from 'pdf-lib';
2
2
 
3
3
  import { detectAttachmentArchiveType, isDumpAttachment } from './attachment-delivery.js';
4
4
  import { getTextAttachmentType, isOfficeXml, isXlsxAttachmentFile } from './attachment-upload.js';
@@ -253,7 +253,9 @@ function validateText(bytes: Uint8Array): void {
253
253
  }
254
254
  }
255
255
 
256
- function countPdfPages(document: PDFDocument): number {
256
+ type PdfLib = typeof import('pdf-lib');
257
+
258
+ function countPdfPages(document: PDFDocument, { PDFPageLeaf, PDFPageTree }: PdfLib): number {
257
259
  const pending: (PDFPageLeaf | PDFPageTree)[] = [document.catalog.Pages()];
258
260
  const visited = new Set<PDFPageTree>();
259
261
  let pages = 0;
@@ -287,9 +289,11 @@ async function validatePdf(bytes: Uint8Array): Promise<number> {
287
289
  if (!new TextDecoder('latin1').decode(bytes.subarray(0, 1028)).includes('%PDF-')) {
288
290
  throw new AttachmentValidationError('invalid_content');
289
291
  }
292
+ // pdf-lib is large, so load it only when a PDF is actually validated instead of on every import of this package.
293
+ const pdfLib = await import('pdf-lib');
290
294
  try {
291
- const document = await PDFDocument.load(bytes, { throwOnInvalidObject: true, updateMetadata: false });
292
- return countPdfPages(document);
295
+ const document = await pdfLib.PDFDocument.load(bytes, { throwOnInvalidObject: true, updateMetadata: false });
296
+ return countPdfPages(document, pdfLib);
293
297
  } catch (error) {
294
298
  if (error instanceof AttachmentValidationError) throw error;
295
299
  throw new AttachmentValidationError('invalid_content');
@@ -0,0 +1,31 @@
1
+ import { expect, test } from 'vitest';
2
+
3
+ import { decodeBytestrings } from './bytestring.js';
4
+
5
+ test('decodes nested serialized buffers to Uint8Array and leaves other values alone', () => {
6
+ const decoded = decodeBytestrings(
7
+ {
8
+ file: { type: 'Buffer', data: [104, 105] },
9
+ rows: [{ type: 'Buffer', data: [1] }, null, 'text'],
10
+ notBytes: { type: 'Buffer', data: ['a'] }
11
+ },
12
+ false
13
+ );
14
+
15
+ expect(decoded).toEqual({
16
+ file: new Uint8Array([104, 105]),
17
+ rows: [new Uint8Array([1]), null, 'text'],
18
+ notBytes: { type: 'Buffer', data: ['a'] }
19
+ });
20
+ });
21
+
22
+ test('decodes a top level serialized buffer to a node.js Buffer', () => {
23
+ expect(decodeBytestrings({ type: 'Buffer', data: [104, 105] }, true)).toEqual(Buffer.from('hi'));
24
+ });
25
+
26
+ test('decodes buffers inside a top level array and keeps it an array', () => {
27
+ const decoded = decodeBytestrings([{ type: 'Buffer', data: [1] }, 2], false);
28
+
29
+ expect(Array.isArray(decoded)).toBe(true);
30
+ expect(decoded).toEqual([new Uint8Array([1]), 2]);
31
+ });
@@ -1,5 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { isNumber, isObject } from 'lodash-es';
1
+ /* oxlint-disable @typescript-eslint/no-explicit-any */
3
2
 
4
3
  /**
5
4
  * Convert all objects that represent a bytestring to a node.js Buffer or a Uint8Array.
@@ -16,8 +15,12 @@ import { isNumber, isObject } from 'lodash-es';
16
15
  *
17
16
  */
18
17
  export function decodeBytestrings<T>(value: T, useNodeJSBuffer: boolean): T {
19
- if (isObject(value)) {
20
- if ((value as any).type === 'Buffer' && Array.isArray((value as any).data) && (value as any).data.every((x: unknown) => isNumber(x))) {
18
+ if (typeof value === 'object' && value !== null) {
19
+ if (
20
+ (value as any).type === 'Buffer' &&
21
+ Array.isArray((value as any).data) &&
22
+ (value as any).data.every((x: unknown) => typeof x === 'number')
23
+ ) {
21
24
  if (useNodeJSBuffer) {
22
25
  return Buffer.from(value as any) as unknown as T;
23
26
  } else {
@@ -1,4 +1,6 @@
1
- import { find, get, set } from 'lodash-es';
1
+ import find from 'lodash-es/find.js';
2
+ import get from 'lodash-es/get.js';
3
+ import set from 'lodash-es/set.js';
2
4
 
3
5
  import {
4
6
  type FieldListFormItem,
package/src/utils/env.ts CHANGED
@@ -2,17 +2,17 @@ import { InvalidConfigurationError } from '../errors/configuration-error.js';
2
2
 
3
3
  export type Env = {
4
4
  name: string;
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
6
6
  defaultValue?: any;
7
7
  regex?: string;
8
8
  };
9
9
 
10
10
  export class EnvStore {
11
11
  private vars: Record<string, Env>;
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
13
13
  private values: Record<string, any>;
14
14
 
15
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
16
16
  constructor(values: Record<string, any>) {
17
17
  this.vars = {};
18
18
  this.values = values;
@@ -34,14 +34,14 @@ export class EnvStore {
34
34
  }
35
35
  }
36
36
 
37
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
38
38
  get(name: string): any {
39
39
  const env = this.vars[name];
40
40
  if (env === undefined) {
41
41
  throw new InvalidConfigurationError(`Env variable ${name} is missing, use addEnv to add it first`);
42
42
  }
43
43
  if (env.regex) {
44
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ // oxlint-disable-next-line @typescript-eslint/no-explicit-any
45
45
  const matchedKeys: Record<string, any> = {};
46
46
  Object.entries(this.values).forEach(([key, value]) => {
47
47
  if (key.match(env.regex ?? '')) {
@@ -12,7 +12,9 @@ export * from './launchDarkly.js';
12
12
  export * from './maskCredential.js';
13
13
  export * from './normalize.js';
14
14
  export * from './normalizeRoleName.js';
15
+ export * from './openApiSpecRef.js';
15
16
  export * from './page.js';
17
+ export * from './platform-mcp-server-routes.js';
16
18
  export * from './string.js';
17
19
  export * from './time.js';
18
20
  export * from './truncate.js';
@@ -20,3 +22,4 @@ export * from './url.js';
20
22
 
21
23
  import gridV4 from './pageFixtures/v4/grid.js';
22
24
  export { gridV4 };
25
+ export * from './localNativeBuilderFlags.js';