@flowrunner/cli 0.1.18 → 0.1.19-dev.2

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 (318) hide show
  1. package/ai-docs/instructions/service-code-format/01-service-structure.md +1 -1
  2. package/ai-docs/instructions/service-code-format/02-zod-types.md +115 -7
  3. package/ai-docs/instructions/service-code-format/05-dictionaries.md +1 -1
  4. package/ai-docs/instructions/service-code-format/11-output-model.md +5 -5
  5. package/ai-docs/instructions/service-code-format/13-runtime-contracts.md +2 -3
  6. package/ai-docs/instructions/service-code-format/16-gotchas.md +30 -6
  7. package/ai-docs/instructions/service-code-format/README.md +2 -2
  8. package/dist/cli.js +944 -958
  9. package/dist/cli.js.map +4 -4
  10. package/dist/index.js +977 -988
  11. package/dist/index.js.map +4 -4
  12. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/context/execution-context.d.ts +10 -2
  13. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/extension.d.ts +3 -3
  14. package/dist/types/flow-extension-runner/src/global.d.ts +6 -18
  15. package/dist/types/flow-extension-runner/src/index.d.ts +39 -13
  16. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/model/field-mapper.d.ts +1 -1
  17. package/dist/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
  18. package/dist/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
  19. package/dist/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
  20. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/index.d.ts +2 -0
  21. package/dist/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +2 -0
  22. package/dist/types/flow-extension-runner/src/params/schema/date-format.d.ts +80 -0
  23. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/defaults.d.ts +3 -2
  24. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/field-plan.d.ts +9 -2
  25. package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +8 -0
  26. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
  27. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
  28. package/dist/types/flow-extension-runner/src/params/schema/notices.d.ts +15 -0
  29. package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
  30. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/types.d.ts +1 -1
  31. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/zod.d.ts +21 -0
  32. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/registry.d.ts +2 -0
  33. package/dist/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
  34. package/dist/types/packages/cli/src/operations/deploy/discover-services.d.ts +2 -4
  35. package/dist/types/shared/src/constants/activity-log.d.ts +248 -2
  36. package/dist/types/shared/src/constants/error-codes.d.ts +6 -0
  37. package/dist/types/shared/src/constants/index.d.ts +1 -0
  38. package/dist/types/shared/src/constants/notification-types.d.ts +309 -0
  39. package/dist/types/shared/src/constants/panic-mode.d.ts +17 -0
  40. package/dist/types/shared/src/constants/shared-extensions.d.ts +10 -0
  41. package/dist/types/shared/src/errors/index.d.ts +1 -0
  42. package/dist/types/shared/src/errors/secrets.d.ts +16 -0
  43. package/dist/types/shared/src/scheme/access-keys/dto.d.ts +35 -13
  44. package/dist/types/shared/src/scheme/api-keys/dto.d.ts +29 -4
  45. package/dist/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -16
  46. package/dist/types/shared/src/scheme/flowrunner/index.d.ts +1 -0
  47. package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +26 -0
  48. package/dist/types/shared/src/scheme/flowrunner/workspace-dashboard.dto.d.ts +207 -0
  49. package/dist/types/shared/src/scheme/integration-connection/dto.d.ts +22 -0
  50. package/dist/types/shared/src/scheme/notifications/dto.d.ts +10 -0
  51. package/dist/types/shared/src/scheme/notifications/rest.d.ts +20 -0
  52. package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +153 -29
  53. package/dist/types/shared/src/scheme/shared-extensions/base.d.ts +0 -4
  54. package/dist/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -24
  55. package/dist/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -18
  56. package/dist/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -3
  57. package/dist/types/shared/src/scheme/shared-extensions/index.d.ts +1 -0
  58. package/dist/types/shared/src/scheme/shared-extensions/list.d.ts +0 -28
  59. package/dist/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -1
  60. package/dist/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -12
  61. package/dist/types/shared/src/scheme/shared-extensions/search.d.ts +0 -8
  62. package/dist/types/shared/src/scheme/shared-extensions/usage-stats.d.ts +189 -0
  63. package/package.json +1 -4
  64. package/project-files/sandbox/files-mock.js +3 -5
  65. package/project-files/sandbox/service.js +10 -11
  66. package/runtime/index.js +794 -896
  67. package/runtime/index.js.map +4 -4
  68. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/context/execution-context.d.ts +10 -2
  69. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/extension.d.ts +3 -3
  70. package/runtime/types/flow-extension-runner/src/global.d.ts +6 -18
  71. package/runtime/types/flow-extension-runner/src/index.d.ts +39 -13
  72. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/model/field-mapper.d.ts +1 -1
  73. package/runtime/types/flow-extension-runner/src/{v2/model → model}/model-types.d.ts +11 -1
  74. package/runtime/types/flow-extension-runner/src/{v2/model → model}/params-model.d.ts +1 -1
  75. package/runtime/types/flow-extension-runner/src/{v2/params → params}/config-params.d.ts +1 -1
  76. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/index.d.ts +2 -0
  77. package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/types.d.ts +2 -0
  78. package/runtime/types/flow-extension-runner/src/params/schema/date-format.d.ts +80 -0
  79. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/defaults.d.ts +3 -2
  80. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/field-plan.d.ts +9 -2
  81. package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/introspect.d.ts +8 -0
  82. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/messages.d.ts +1 -1
  83. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/schema/normalize.d.ts +1 -1
  84. package/runtime/types/flow-extension-runner/src/params/schema/notices.d.ts +15 -0
  85. package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/parse.d.ts +1 -1
  86. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/types.d.ts +1 -1
  87. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/zod.d.ts +21 -0
  88. package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/registry.d.ts +2 -0
  89. package/runtime/types/flow-extension-runner/src/{v2/types.d.ts → types.d.ts} +1 -1
  90. package/runtime/types/packages/cli/src/runtime/index.d.ts +6 -5
  91. package/dist/types/flow-extension-runner/src/common/config.d.ts +0 -12
  92. package/dist/types/flow-extension-runner/src/common/context.d.ts +0 -6
  93. package/dist/types/flow-extension-runner/src/common/types.d.ts +0 -11
  94. package/dist/types/flow-extension-runner/src/v1/config.d.ts +0 -3
  95. package/dist/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
  96. package/dist/types/flow-extension-runner/src/v1/index.d.ts +0 -11
  97. package/dist/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
  98. package/dist/types/flow-extension-runner/src/v1/service.d.ts +0 -29
  99. package/dist/types/flow-extension-runner/src/v1/types.d.ts +0 -13
  100. package/dist/types/flow-extension-runner/src/v2/index.d.ts +0 -39
  101. package/dist/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
  102. package/dist/types/jsdoc-parser/src/index.d.ts +0 -2
  103. package/dist/types/jsdoc-parser/src/lib.d.ts +0 -42
  104. package/dist/types/jsdoc-parser/src/types.d.ts +0 -2
  105. package/runtime/types/flow-extension-runner/src/common/config.d.ts +0 -12
  106. package/runtime/types/flow-extension-runner/src/common/context.d.ts +0 -6
  107. package/runtime/types/flow-extension-runner/src/common/types.d.ts +0 -11
  108. package/runtime/types/flow-extension-runner/src/v1/config.d.ts +0 -3
  109. package/runtime/types/flow-extension-runner/src/v1/constants.d.ts +0 -4
  110. package/runtime/types/flow-extension-runner/src/v1/index.d.ts +0 -11
  111. package/runtime/types/flow-extension-runner/src/v1/namespace.d.ts +0 -9
  112. package/runtime/types/flow-extension-runner/src/v1/service.d.ts +0 -29
  113. package/runtime/types/flow-extension-runner/src/v1/types.d.ts +0 -13
  114. package/runtime/types/flow-extension-runner/src/v2/index.d.ts +0 -39
  115. package/runtime/types/jsdoc-parser/src/custom-type-defs/files.d.ts +0 -2
  116. package/runtime/types/jsdoc-parser/src/index.d.ts +0 -2
  117. package/runtime/types/jsdoc-parser/src/lib.d.ts +0 -42
  118. package/runtime/types/jsdoc-parser/src/types.d.ts +0 -2
  119. package/runtime/types/shared/src/constants/activity-log.d.ts +0 -1573
  120. package/runtime/types/shared/src/constants/ai-agent-tools.d.ts +0 -20
  121. package/runtime/types/shared/src/constants/ai.d.ts +0 -11
  122. package/runtime/types/shared/src/constants/api-keys.d.ts +0 -1
  123. package/runtime/types/shared/src/constants/app.d.ts +0 -57
  124. package/runtime/types/shared/src/constants/billing.d.ts +0 -16
  125. package/runtime/types/shared/src/constants/compliances.d.ts +0 -3
  126. package/runtime/types/shared/src/constants/data-types.d.ts +0 -26
  127. package/runtime/types/shared/src/constants/docs.d.ts +0 -6
  128. package/runtime/types/shared/src/constants/error-codes.d.ts +0 -20
  129. package/runtime/types/shared/src/constants/flow.d.ts +0 -12
  130. package/runtime/types/shared/src/constants/index.d.ts +0 -18
  131. package/runtime/types/shared/src/constants/knowledge-base.d.ts +0 -15
  132. package/runtime/types/shared/src/constants/notification-types.d.ts +0 -1234
  133. package/runtime/types/shared/src/constants/notifications.d.ts +0 -10
  134. package/runtime/types/shared/src/constants/oauth-connection-error.d.ts +0 -3
  135. package/runtime/types/shared/src/constants/patterns.d.ts +0 -28
  136. package/runtime/types/shared/src/constants/retry-policy.d.ts +0 -30
  137. package/runtime/types/shared/src/constants/severity.d.ts +0 -9
  138. package/runtime/types/shared/src/constants/shared-extensions-search.d.ts +0 -6
  139. package/runtime/types/shared/src/constants/shared-extensions.d.ts +0 -56
  140. package/runtime/types/shared/src/constants/zod.d.ts +0 -2
  141. package/runtime/types/shared/src/errors/api.d.ts +0 -15
  142. package/runtime/types/shared/src/errors/base.d.ts +0 -38
  143. package/runtime/types/shared/src/errors/common.d.ts +0 -39
  144. package/runtime/types/shared/src/errors/index.d.ts +0 -14
  145. package/runtime/types/shared/src/errors/k8s.d.ts +0 -14
  146. package/runtime/types/shared/src/errors/message.d.ts +0 -48
  147. package/runtime/types/shared/src/errors/oauth-connection.d.ts +0 -4
  148. package/runtime/types/shared/src/errors/open-search.d.ts +0 -4
  149. package/runtime/types/shared/src/errors/s3.d.ts +0 -11
  150. package/runtime/types/shared/src/extensions/zod.d.ts +0 -25
  151. package/runtime/types/shared/src/scheme/access-keys/dto.d.ts +0 -101
  152. package/runtime/types/shared/src/scheme/access-keys/index.d.ts +0 -2
  153. package/runtime/types/shared/src/scheme/account/dto.d.ts +0 -63
  154. package/runtime/types/shared/src/scheme/account/index.d.ts +0 -1
  155. package/runtime/types/shared/src/scheme/activity-log-base.d.ts +0 -35
  156. package/runtime/types/shared/src/scheme/ai-agent-tools/dto.d.ts +0 -69
  157. package/runtime/types/shared/src/scheme/ai-agent-tools/index.d.ts +0 -2
  158. package/runtime/types/shared/src/scheme/ai-agent-tools/parameters.d.ts +0 -7
  159. package/runtime/types/shared/src/scheme/ai-router/dto.d.ts +0 -23
  160. package/runtime/types/shared/src/scheme/ai-router/index.d.ts +0 -2
  161. package/runtime/types/shared/src/scheme/api-keys/dto.d.ts +0 -28
  162. package/runtime/types/shared/src/scheme/api-keys/index.d.ts +0 -2
  163. package/runtime/types/shared/src/scheme/app/index.d.ts +0 -1
  164. package/runtime/types/shared/src/scheme/app/java.dto.d.ts +0 -6
  165. package/runtime/types/shared/src/scheme/billing/index.d.ts +0 -1
  166. package/runtime/types/shared/src/scheme/billing/java.dto.d.ts +0 -181
  167. package/runtime/types/shared/src/scheme/crm/billing.d.ts +0 -149
  168. package/runtime/types/shared/src/scheme/crm/dto.d.ts +0 -218
  169. package/runtime/types/shared/src/scheme/crm/index.d.ts +0 -3
  170. package/runtime/types/shared/src/scheme/data-types/index.d.ts +0 -1
  171. package/runtime/types/shared/src/scheme/data-types/java.dto.d.ts +0 -22
  172. package/runtime/types/shared/src/scheme/dynamic-forms/dto.d.ts +0 -30
  173. package/runtime/types/shared/src/scheme/dynamic-forms/index.d.ts +0 -2
  174. package/runtime/types/shared/src/scheme/extensions/index.d.ts +0 -1
  175. package/runtime/types/shared/src/scheme/extensions/params-to-zod.d.ts +0 -14
  176. package/runtime/types/shared/src/scheme/flowrunner/custom-elements.d.ts +0 -383
  177. package/runtime/types/shared/src/scheme/flowrunner/index.d.ts +0 -3
  178. package/runtime/types/shared/src/scheme/flowrunner/java.dto.d.ts +0 -655
  179. package/runtime/types/shared/src/scheme/index.d.ts +0 -21
  180. package/runtime/types/shared/src/scheme/integration-connection/dto.d.ts +0 -135
  181. package/runtime/types/shared/src/scheme/integration-connection/index.d.ts +0 -2
  182. package/runtime/types/shared/src/scheme/knowledge-base/dto.d.ts +0 -776
  183. package/runtime/types/shared/src/scheme/knowledge-base/index.d.ts +0 -2
  184. package/runtime/types/shared/src/scheme/mcp-oauth/dto.d.ts +0 -9
  185. package/runtime/types/shared/src/scheme/mcp-oauth/index.d.ts +0 -2
  186. package/runtime/types/shared/src/scheme/notifications/dto.d.ts +0 -118
  187. package/runtime/types/shared/src/scheme/notifications/index.d.ts +0 -3
  188. package/runtime/types/shared/src/scheme/notifications/rest.d.ts +0 -162
  189. package/runtime/types/shared/src/scheme/onboarding/dto.d.ts +0 -29
  190. package/runtime/types/shared/src/scheme/onboarding/index.d.ts +0 -1
  191. package/runtime/types/shared/src/scheme/properties/account.d.ts +0 -3
  192. package/runtime/types/shared/src/scheme/properties/app.d.ts +0 -5
  193. package/runtime/types/shared/src/scheme/properties/billing.d.ts +0 -12
  194. package/runtime/types/shared/src/scheme/properties/common.d.ts +0 -2
  195. package/runtime/types/shared/src/scheme/properties/db.d.ts +0 -8
  196. package/runtime/types/shared/src/scheme/properties/flow-extensions.d.ts +0 -7
  197. package/runtime/types/shared/src/scheme/properties/index.d.ts +0 -7
  198. package/runtime/types/shared/src/scheme/remote-mcp-server/dto.d.ts +0 -278
  199. package/runtime/types/shared/src/scheme/remote-mcp-server/index.d.ts +0 -2
  200. package/runtime/types/shared/src/scheme/shared-extensions/base.d.ts +0 -62
  201. package/runtime/types/shared/src/scheme/shared-extensions/config.d.ts +0 -96
  202. package/runtime/types/shared/src/scheme/shared-extensions/custom-extensions.d.ts +0 -631
  203. package/runtime/types/shared/src/scheme/shared-extensions/extension.d.ts +0 -411
  204. package/runtime/types/shared/src/scheme/shared-extensions/flow-extensions.d.ts +0 -64
  205. package/runtime/types/shared/src/scheme/shared-extensions/index.d.ts +0 -17
  206. package/runtime/types/shared/src/scheme/shared-extensions/light.d.ts +0 -38
  207. package/runtime/types/shared/src/scheme/shared-extensions/list.d.ts +0 -250
  208. package/runtime/types/shared/src/scheme/shared-extensions/logs.d.ts +0 -21
  209. package/runtime/types/shared/src/scheme/shared-extensions/methods.d.ts +0 -112
  210. package/runtime/types/shared/src/scheme/shared-extensions/params-schema.d.ts +0 -48
  211. package/runtime/types/shared/src/scheme/shared-extensions/popular-pool.d.ts +0 -11
  212. package/runtime/types/shared/src/scheme/shared-extensions/resolve.d.ts +0 -373
  213. package/runtime/types/shared/src/scheme/shared-extensions/rest.d.ts +0 -9
  214. package/runtime/types/shared/src/scheme/shared-extensions/search.d.ts +0 -189
  215. package/runtime/types/shared/src/scheme/shared-extensions/service-identity.d.ts +0 -10
  216. package/runtime/types/shared/src/scheme/shared-extensions/service-info.d.ts +0 -16
  217. package/runtime/types/shared/src/scheme/shared-extensions/workspace-stack.d.ts +0 -44
  218. package/runtime/types/shared/src/scheme/workspace/dto.d.ts +0 -40
  219. package/runtime/types/shared/src/scheme/workspace/index.d.ts +0 -1
  220. package/runtime/types/shared/src/utils/object.d.ts +0 -8
  221. package/runtime/types/shared/src/utils/uuid.d.ts +0 -5
  222. package/runtime/types/shared/src/utils/versions.d.ts +0 -4
  223. package/dist/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
  224. package/dist/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
  225. package/dist/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
  226. package/dist/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
  227. package/dist/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
  228. package/dist/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
  229. package/dist/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
  230. package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
  231. package/dist/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
  232. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
  233. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
  234. package/dist/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
  235. package/dist/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
  236. package/dist/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
  237. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
  238. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
  239. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
  240. package/dist/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
  241. package/dist/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
  242. package/{runtime/types/flow-extension-runner/src/v2 → dist/types/flow-extension-runner/src}/params/files-options.d.ts +4 -4
  243. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
  244. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
  245. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
  246. /package/dist/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
  247. /package/dist/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
  248. /package/dist/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
  249. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
  250. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
  251. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
  252. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
  253. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
  254. /package/dist/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
  255. /package/dist/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
  256. /package/dist/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
  257. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
  258. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
  259. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
  260. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
  261. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
  262. /package/dist/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
  263. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
  264. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
  265. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
  266. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
  267. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
  268. /package/dist/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
  269. /package/dist/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
  270. /package/dist/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
  271. /package/runtime/types/flow-extension-runner/src/{v2/actions → actions}/action-method.d.ts +0 -0
  272. /package/runtime/types/flow-extension-runner/src/{common/context-files.d.ts → context/files.d.ts} +0 -0
  273. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/logger.d.ts +0 -0
  274. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/method-input.d.ts +0 -0
  275. /package/runtime/types/flow-extension-runner/src/{v2/context → context}/proxies.d.ts +0 -0
  276. /package/runtime/types/flow-extension-runner/src/{v2/create-extension.d.ts → create-extension.d.ts} +0 -0
  277. /package/runtime/types/flow-extension-runner/src/{v2/crypto.d.ts → crypto.d.ts} +0 -0
  278. /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/dictionary-method.d.ts +0 -0
  279. /package/runtime/types/flow-extension-runner/src/{v2/dictionaries → dictionaries}/payload-schema.d.ts +0 -0
  280. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-method.d.ts +0 -0
  281. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/loader-owner.d.ts +0 -0
  282. /package/runtime/types/flow-extension-runner/src/{v2/loaders → loaders}/payload-schema.d.ts +0 -0
  283. /package/runtime/types/flow-extension-runner/src/{v2/method.d.ts → method.d.ts} +0 -0
  284. /package/runtime/types/flow-extension-runner/src/{v2/model → model}/method-model.d.ts +0 -0
  285. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/method-names.d.ts +0 -0
  286. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/oauth2.d.ts +0 -0
  287. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/system-params.d.ts +0 -0
  288. /package/runtime/types/flow-extension-runner/src/{v2/oauth → oauth}/types.d.ts +0 -0
  289. /package/runtime/types/flow-extension-runner/src/{common/constants.d.ts → params/config-types.d.ts} +0 -0
  290. /package/{dist/types/flow-extension-runner/src/v2 → runtime/types/flow-extension-runner/src}/params/files-options.d.ts +0 -0
  291. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/checks.d.ts +0 -0
  292. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/decode.d.ts +0 -0
  293. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/encode.d.ts +0 -0
  294. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/json/values.d.ts +0 -0
  295. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/method-params.d.ts +0 -0
  296. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/params.d.ts +0 -0
  297. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-object-schema.d.ts +0 -0
  298. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/assert-supported-schema.d.ts +0 -0
  299. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/coerce.d.ts +0 -0
  300. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dates.d.ts +0 -0
  301. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/dictionary-binding.d.ts +0 -0
  302. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/schema/labels.d.ts +0 -0
  303. /package/runtime/types/flow-extension-runner/src/{v2/params → params}/widget-types.d.ts +0 -0
  304. /package/runtime/types/flow-extension-runner/src/{v2/path.d.ts → path.d.ts} +0 -0
  305. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/mechanisms.d.ts +0 -0
  306. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/method-names.d.ts +0 -0
  307. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/polling-triggers.d.ts +0 -0
  308. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/system-params.d.ts +0 -0
  309. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/trigger-method.d.ts +0 -0
  310. /package/runtime/types/flow-extension-runner/src/{v2/polling-triggers → polling-triggers}/types.d.ts +0 -0
  311. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/method-names.d.ts +0 -0
  312. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/realtime-setup.d.ts +0 -0
  313. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/system-params.d.ts +0 -0
  314. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/trigger-method.d.ts +0 -0
  315. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/types.d.ts +0 -0
  316. /package/runtime/types/flow-extension-runner/src/{v2/realtime-triggers → realtime-triggers}/verify.d.ts +0 -0
  317. /package/runtime/types/flow-extension-runner/src/{v2/result.d.ts → result.d.ts} +0 -0
  318. /package/runtime/types/flow-extension-runner/src/{v2/system-method.d.ts → system-method.d.ts} +0 -0
package/runtime/index.js CHANGED
@@ -8881,11 +8881,11 @@ var require_mime_types = __commonJS({
8881
8881
  }
8882
8882
  return exts[0];
8883
8883
  }
8884
- function lookup(path2) {
8885
- if (!path2 || typeof path2 !== "string") {
8884
+ function lookup(path) {
8885
+ if (!path || typeof path !== "string") {
8886
8886
  return false;
8887
8887
  }
8888
- var extension2 = extname("x." + path2).toLowerCase().substr(1);
8888
+ var extension2 = extname("x." + path).toLowerCase().substr(1);
8889
8889
  if (!extension2) {
8890
8890
  return false;
8891
8891
  }
@@ -10048,11 +10048,11 @@ var require_form_data = __commonJS({
10048
10048
  "use strict";
10049
10049
  var CombinedStream = require_combined_stream();
10050
10050
  var util = require("util");
10051
- var path2 = require("path");
10051
+ var path = require("path");
10052
10052
  var http = require("http");
10053
10053
  var https = require("https");
10054
10054
  var parseUrl = require("url").parse;
10055
- var fs2 = require("fs");
10055
+ var fs = require("fs");
10056
10056
  var crypto3 = require("crypto");
10057
10057
  var mime = require_mime_types();
10058
10058
  var asynckit = require_asynckit();
@@ -10122,7 +10122,7 @@ var require_form_data = __commonJS({
10122
10122
  if (value.end != null && value.end !== Infinity && value.start != null) {
10123
10123
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10124
10124
  } else {
10125
- fs2.stat(value.path, function(err, stat) {
10125
+ fs.stat(value.path, function(err, stat) {
10126
10126
  var fileSize;
10127
10127
  if (err) {
10128
10128
  callback(err);
@@ -10180,11 +10180,11 @@ var require_form_data = __commonJS({
10180
10180
  FormData2.prototype._getContentDisposition = function(value, options) {
10181
10181
  var filename, contentDisposition;
10182
10182
  if (typeof options.filepath === "string") {
10183
- filename = path2.normalize(options.filepath).replace(/\\/g, "/");
10183
+ filename = path.normalize(options.filepath).replace(/\\/g, "/");
10184
10184
  } else if (options.filename || value && (value.name || value.path)) {
10185
- filename = path2.basename(options.filename || value && (value.name || value.path));
10185
+ filename = path.basename(options.filename || value && (value.name || value.path));
10186
10186
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10187
- filename = path2.basename(value.client._httpMessage.path || "");
10187
+ filename = path.basename(value.client._httpMessage.path || "");
10188
10188
  }
10189
10189
  if (filename) {
10190
10190
  contentDisposition = 'filename="' + escapeHeaderParam(filename) + '"';
@@ -10435,15 +10435,15 @@ var require_utils = __commonJS({
10435
10435
  }
10436
10436
  return uriComponent;
10437
10437
  }
10438
- function encodePath(path2) {
10439
- return path2.split("/").map(ensureComponentEncoding).join("/");
10438
+ function encodePath(path) {
10439
+ return path.split("/").map(ensureComponentEncoding).join("/");
10440
10440
  }
10441
- function ensureEncoding(path2) {
10441
+ function ensureEncoding(path) {
10442
10442
  try {
10443
- var url = new URL(path2);
10444
- return url.origin + encodePath(normalizeTrailingSlashInPath(path2, url)) + url.search;
10443
+ var url = new URL(path);
10444
+ return url.origin + encodePath(normalizeTrailingSlashInPath(path, url)) + url.search;
10445
10445
  } catch (_unused) {
10446
- return encodePath(path2);
10446
+ return encodePath(path);
10447
10447
  }
10448
10448
  }
10449
10449
  function normalizeTrailingSlashInPath(originPath, _ref) {
@@ -10798,15 +10798,15 @@ var require_client_node = __commonJS({
10798
10798
  exports2.sendNodeAPIRequest = sendNodeAPIRequest;
10799
10799
  var _utils = require_utils();
10800
10800
  var _error = require_error();
10801
- function sendNodeAPIRequest(path2, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10801
+ function sendNodeAPIRequest(path, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10802
10802
  return new Promise(function(resolve, reject) {
10803
- var u = require("url").parse(path2);
10803
+ var u = require("url").parse(path);
10804
10804
  var form = (0, _utils.isFormData)(body) && body;
10805
10805
  var https = u.protocol === "https:";
10806
10806
  var options = {
10807
10807
  host: u.hostname,
10808
10808
  port: u.port || (https ? 443 : 80),
10809
- path: (0, _utils.normalizeTrailingSlashInPath)(path2, u) + (u.search || ""),
10809
+ path: (0, _utils.normalizeTrailingSlashInPath)(path, u) + (u.search || ""),
10810
10810
  method,
10811
10811
  headers,
10812
10812
  timeout
@@ -11214,12 +11214,12 @@ var require_request = __commonJS({
11214
11214
  var Request = exports2.Request = /* @__PURE__ */ (function(_EventEmitter) {
11215
11215
  _inherits(Request2, _EventEmitter);
11216
11216
  var _super = _createSuper(Request2);
11217
- function Request2(path2, method, body) {
11217
+ function Request2(path, method, body) {
11218
11218
  var _this;
11219
11219
  _classCallCheck(this, Request2);
11220
11220
  _this = _super.call(this);
11221
11221
  _this.method = method;
11222
- _this.path = (0, _utils.ensureEncoding)(path2);
11222
+ _this.path = (0, _utils.ensureEncoding)(path);
11223
11223
  _this.body = body;
11224
11224
  _this.unwrap = true;
11225
11225
  _this.raw = false;
@@ -11448,10 +11448,10 @@ var require_request = __commonJS({
11448
11448
  value: function send(body) {
11449
11449
  var _this2 = this;
11450
11450
  this.emit(REQUEST_EVENT, this);
11451
- var path2 = this.path;
11451
+ var path = this.path;
11452
11452
  var queryString = qs.stringify(this.queryParams);
11453
11453
  if (queryString) {
11454
- path2 += "?" + queryString;
11454
+ path += "?" + queryString;
11455
11455
  }
11456
11456
  if (!(0, _utils.isFormData)(body) && (0, _utils.isWebFormData)(body)) {
11457
11457
  body = toRequestFormData(body);
@@ -11468,11 +11468,11 @@ var require_request = __commonJS({
11468
11468
  return _this2.unwrap ? res.body : res;
11469
11469
  };
11470
11470
  if (Request2.verbose) {
11471
- console.log(this.method.toUpperCase(), decodeURIComponent(path2), body, this.headers);
11471
+ console.log(this.method.toUpperCase(), decodeURIComponent(path), body, this.headers);
11472
11472
  }
11473
11473
  var withCredentials = typeof this.withCredentials === "boolean" ? this.withCredentials : Request2.withCredentials;
11474
11474
  var syncError = new Error();
11475
- var request = Request2.send(path2, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11475
+ var request = Request2.send(path, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11476
11476
  return parseBody(res, _this2.raw);
11477
11477
  }).then(function(res) {
11478
11478
  return ensureRawBody(res, _this2.raw);
@@ -11581,14 +11581,14 @@ var require_client_browser = __commonJS({
11581
11581
  });
11582
11582
  exports2.sendXmlHttpRequest = sendXmlHttpRequest;
11583
11583
  var _request2 = require_request();
11584
- function sendXmlHttpRequest(path2, method, headers, body, encoding, timeout, withCredentials) {
11584
+ function sendXmlHttpRequest(path, method, headers, body, encoding, timeout, withCredentials) {
11585
11585
  return new Promise(function sendRequest(resolve, reject) {
11586
11586
  var request = new _request2.Request.XMLHttpRequest();
11587
11587
  request.timeout = timeout;
11588
11588
  if (!encoding) {
11589
11589
  request.responseType = "arraybuffer";
11590
11590
  }
11591
- request.open(method.toUpperCase(), path2, true);
11591
+ request.open(method.toUpperCase(), path, true);
11592
11592
  if (typeof withCredentials === "boolean") {
11593
11593
  request.withCredentials = withCredentials;
11594
11594
  }
@@ -11661,16 +11661,16 @@ var require_lib = __commonJS({
11661
11661
  }
11662
11662
  });
11663
11663
  _request.Request.XMLHttpRequest = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : void 0;
11664
- _request.Request.send = function(path2, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11664
+ _request.Request.send = function(path, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11665
11665
  var sender = typeof _request.Request.XMLHttpRequest !== "undefined" ? _clientBrowser.sendXmlHttpRequest : _clientNode.sendNodeAPIRequest;
11666
- return sender(path2, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11666
+ return sender(path, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11667
11667
  };
11668
11668
  _request.Request.verbose = false;
11669
11669
  _request.Request.withCredentials = false;
11670
11670
  _request.Request.methods = ["get", "post", "put", "patch", "delete", "head", "options"];
11671
11671
  _request.Request.methods.forEach(function(method) {
11672
- _request.Request[method] = function(path2, body) {
11673
- return new _request.Request(path2, method, body);
11672
+ _request.Request[method] = function(path, body) {
11673
+ return new _request.Request(path, method, body);
11674
11674
  };
11675
11675
  });
11676
11676
  exports2 = module2.exports = _request.Request;
@@ -11681,12 +11681,11 @@ var require_lib = __commonJS({
11681
11681
  // src/runtime/index.ts
11682
11682
  var index_exports = {};
11683
11683
  __export(index_exports, {
11684
- buildServiceDefinition: () => buildServiceDefinition2,
11684
+ buildServiceDefinition: () => buildServiceDefinition,
11685
11685
  detectVersion: () => detectVersion,
11686
- getServiceConfigs: () => getServiceConfigs3,
11687
- parseJsDocToServiceJson: () => parseJsDocToServiceJson,
11686
+ getServiceConfigs: () => getServiceConfigs,
11688
11687
  resetRegistry: () => resetRegistry,
11689
- runServiceMethod: () => runServiceMethod3
11688
+ runServiceMethod: () => runServiceMethod
11690
11689
  });
11691
11690
  module.exports = __toCommonJS(index_exports);
11692
11691
 
@@ -11733,9 +11732,9 @@ var FlowExtensionErrorCodes = {
11733
11732
  DUPLICATE_ITEM_ID: "FR_EXT_DUPLICATE_ITEM_ID",
11734
11733
  // No v2 extension registered for the given serviceId after requiring the module.
11735
11734
  EXTENSION_NOT_REGISTERED: "FR_EXT_NOT_REGISTERED",
11736
- // A declared config value is missing or the wrong shape (see v2/schema/normalize).
11735
+ // A declared config value is missing or the wrong shape (see params/schema/normalize).
11737
11736
  INVALID_CONFIG: "FR_EXT_INVALID_CONFIG",
11738
- // A schema slot that must be a z.object was declared as something else (see v2/schema/assert-object-schema).
11737
+ // A schema slot that must be a z.object was declared as something else (see params/schema/assert-object-schema).
11739
11738
  INVALID_SCHEMA: "FR_EXT_INVALID_SCHEMA",
11740
11739
  // A polling trigger declared zero or multiple mechanisms, or is missing its fetch.
11741
11740
  INVALID_TRIGGER_CONFIG: "FR_EXT_INVALID_TRIGGER_CONFIG",
@@ -11830,7 +11829,7 @@ var InvalidConfigError = class extends FlowExtensionError {
11830
11829
  };
11831
11830
  var InvalidSchemaError = class extends FlowExtensionError {
11832
11831
  // `message` is composed by the guard, which knows how to describe what was received and what to do
11833
- // about it (see v2/schema/assert-object-schema.ts).
11832
+ // about it (see params/schema/assert-object-schema.ts).
11834
11833
  constructor(message, details) {
11835
11834
  super(FlowExtensionErrorCodes.INVALID_SCHEMA, 400, message, details);
11836
11835
  }
@@ -11882,12 +11881,12 @@ var InvalidDictionaryOutputScheme = class extends FlowExtensionError {
11882
11881
  }
11883
11882
  };
11884
11883
 
11885
- // ../../flow-extension-runner/src/v2/loaders/loader-owner.ts
11884
+ // ../../flow-extension-runner/src/loaders/loader-owner.ts
11886
11885
  var sampleResultLoaderName = (ownerId) => `${ownerId}_SampleResultLoader`;
11887
11886
  var dynamicParamsLoaderName = (ownerId) => `${ownerId}_DynamicParams`;
11888
11887
  var dynamicPropsLoaderName = (ownerId, field) => `${ownerId}_${field}_DynamicProps`;
11889
11888
 
11890
- // ../../flow-extension-runner/src/v2/params/schema/assert-object-schema.ts
11889
+ // ../../flow-extension-runner/src/params/schema/assert-object-schema.ts
11891
11890
  var WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish", "default", "prefault"]);
11892
11891
  var typeOf = (value) => value?._zod?.def?.type;
11893
11892
  function describe(value) {
@@ -11936,40 +11935,7 @@ function assertObjectSchema(scheme, source) {
11936
11935
  );
11937
11936
  }
11938
11937
 
11939
- // ../../flow-extension-runner/src/v2/params/schema/dictionary-binding.ts
11940
- var DictionaryScope = class _DictionaryScope {
11941
- constructor(top, visible) {
11942
- this.top = top;
11943
- this.visible = visible;
11944
- }
11945
- static {
11946
- this.ROOT = new _DictionaryScope(null, /* @__PURE__ */ new Set());
11947
- }
11948
- enter(names) {
11949
- if (!this.top) {
11950
- const top = new Set(names);
11951
- return new _DictionaryScope(top, top);
11952
- }
11953
- return new _DictionaryScope(this.top, /* @__PURE__ */ new Set([...this.top, ...names]));
11954
- }
11955
- };
11956
- function resolveDependsOn(binding, scope2) {
11957
- const aliases = binding.criteriaAliases ?? {};
11958
- let clash;
11959
- const dependsOn = binding.dependsOn.map((key) => {
11960
- const visible = [key, ...aliases[key] ?? []].filter((name) => scope2.visible.has(name));
11961
- if (visible.length > 1 && !clash) {
11962
- clash = { key, names: visible };
11963
- }
11964
- return visible[0] ?? key;
11965
- });
11966
- return clash ? { dependsOn, clash } : { dependsOn };
11967
- }
11968
- function publishedBinding(binding, scope2) {
11969
- return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
11970
- }
11971
-
11972
- // ../../flow-extension-runner/src/v2/params/widget-types.ts
11938
+ // ../../flow-extension-runner/src/params/widget-types.ts
11973
11939
  var FlowExtensionParamGroupTypes = {
11974
11940
  FILE_UPLOAD_OPTIONS: "FILE_UPLOAD_OPTIONS",
11975
11941
  FILE_LIST_OPTIONS: "FILE_LIST_OPTIONS",
@@ -11987,14 +11953,16 @@ var FlowExtensionParamWidgetTypes = {
11987
11953
  ...FlowExtensionParamGroupTypes,
11988
11954
  // legacy — no zod declaration produces these. They reach the console only from a legacy JSDoc-format
11989
11955
  // service, which writes `uiComponent` by hand. Kept because the console still renders them for an
11990
- // already-installed extension.
11956
+ // already-installed extension. `DATE_TIME_PICKER` / `TIME_PICKER` are also published, with
11957
+ // `valueKind: 'string'` and `format`, by `z.iso.datetime({ local: true })` / `z.iso.time()` (FR-3920) —
11958
+ // without `valueKind` they are the legacy tokens, storing epoch millis.
11991
11959
  NUMERIC: "NUMERIC",
11992
11960
  CHECKBOX: "CHECKBOX",
11993
11961
  DATE_TIME_PICKER: "DATE_TIME_PICKER",
11994
11962
  TIME_PICKER: "TIME_PICKER"
11995
11963
  };
11996
11964
 
11997
- // ../../flow-extension-runner/src/v2/params/schema/introspect.ts
11965
+ // ../../flow-extension-runner/src/params/schema/introspect.ts
11998
11966
  var OPTIONAL_WRAPPERS = /* @__PURE__ */ new Set(["optional", "nullable", "nullish"]);
11999
11967
  var DEFAULT_WRAPPERS = /* @__PURE__ */ new Set(["default", "prefault"]);
12000
11968
  var TRANSPARENT_WRAPPERS = /* @__PURE__ */ new Set(["readonly", "pipe", "lazy"]);
@@ -12080,6 +12048,12 @@ function literalType(core) {
12080
12048
  const [kind] = [...kinds];
12081
12049
  return kinds.size === 1 && LITERAL_KINDS.has(kind) ? kind : void 0;
12082
12050
  }
12051
+ function hasBlankBranch(ins) {
12052
+ return !!ins.branches?.some((branch) => {
12053
+ const { core, coreType } = inspect(branch);
12054
+ return coreType === "literal" && (core._zod?.def?.values ?? []).includes("");
12055
+ });
12056
+ }
12083
12057
  function deriveWidget(ins) {
12084
12058
  const { coreType, core, meta } = ins;
12085
12059
  switch (coreType) {
@@ -12087,7 +12061,7 @@ function deriveWidget(ins) {
12087
12061
  if (meta.frWidget === FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT) {
12088
12062
  return { paramType: "STRING", uiComponent: { type: FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT } };
12089
12063
  }
12090
- return { paramType: "STRING" };
12064
+ return dateStringWidget(ins) ?? { paramType: "STRING" };
12091
12065
  case "number":
12092
12066
  case "bigint":
12093
12067
  return { paramType: "NUMBER", uiComponent: { type: FlowExtensionParamWidgetTypes.NUMERIC_STEPPER } };
@@ -12130,12 +12104,400 @@ function deriveWidget(ins) {
12130
12104
  return { paramType: "STRING" };
12131
12105
  }
12132
12106
  }
12107
+ var DATE_STRING_WIDGETS = {
12108
+ date: FlowExtensionParamWidgetTypes.DATE_PICKER,
12109
+ datetime: FlowExtensionParamWidgetTypes.DATE_TIME_PICKER,
12110
+ time: FlowExtensionParamWidgetTypes.TIME_PICKER
12111
+ };
12112
+ function dateStringWidget(ins) {
12113
+ const kind = dateStringKind(ins);
12114
+ return kind ? { paramType: "STRING", uiComponent: { type: DATE_STRING_WIDGETS[kind], valueKind: "string", format: patternOf(ins, kind) } } : void 0;
12115
+ }
12133
12116
  function shapeEntries(schema) {
12134
12117
  const shape = schema?.shape;
12135
12118
  return shape && typeof shape === "object" ? Object.entries(shape) : [];
12136
12119
  }
12137
12120
 
12138
- // ../../flow-extension-runner/src/v2/params/schema/assert-supported-schema.ts
12121
+ // ../../flow-extension-runner/src/params/schema/date-format.ts
12122
+ var ISO_PATTERNS = {
12123
+ date: "yyyy-MM-dd",
12124
+ datetime: "yyyy-MM-dd'T'HH:mm",
12125
+ time: "HH:mm"
12126
+ };
12127
+ var DATE_STRINGS_ACCEPT_TIMESTAMPS = true;
12128
+ function dateStringKind(ins) {
12129
+ if (ins.coreType !== "string") {
12130
+ return void 0;
12131
+ }
12132
+ const def = ins.core?._zod?.def;
12133
+ if (def?.format === "date" || def?.format === "time") {
12134
+ return def.format;
12135
+ }
12136
+ return def?.format === "datetime" && def.local ? "datetime" : void 0;
12137
+ }
12138
+ var patternOf = (ins, kind) => ins.meta.frDateFormat ?? ISO_PATTERNS[kind];
12139
+ var TOKENS = ["yyyy", "yy", "MM", "M", "dd", "d", "HH", "H", "hh", "h", "mm", "ss", "a"];
12140
+ var SPEC = {
12141
+ yyyy: { part: "year", width: 4 },
12142
+ yy: { part: "year", width: 2 },
12143
+ MM: { part: "month", width: 2 },
12144
+ M: { part: "month" },
12145
+ dd: { part: "day", width: 2 },
12146
+ d: { part: "day" },
12147
+ HH: { part: "hour", width: 2 },
12148
+ H: { part: "hour" },
12149
+ hh: { part: "hour", width: 2 },
12150
+ h: { part: "hour" },
12151
+ mm: { part: "minute", width: 2 },
12152
+ ss: { part: "second", width: 2 },
12153
+ a: { part: "meridiem" }
12154
+ };
12155
+ var DATE_PARTS = /* @__PURE__ */ new Set(["year", "month", "day"]);
12156
+ var TIME_PARTS = /* @__PURE__ */ new Set(["hour", "minute", "second", "meridiem"]);
12157
+ var DateFormatError = class extends Error {
12158
+ };
12159
+ var LOOK_ALIKES = {
12160
+ YYYY: "yyyy",
12161
+ YY: "yy",
12162
+ DD: "dd",
12163
+ D: "d",
12164
+ S: "ss",
12165
+ A: "a"
12166
+ };
12167
+ function tokenize(pattern, kind) {
12168
+ const tokens = [];
12169
+ let index = 0;
12170
+ while (index < pattern.length) {
12171
+ const char = pattern[index];
12172
+ if (char === "'") {
12173
+ const end = pattern.indexOf("'", index + 1);
12174
+ if (end < 0) {
12175
+ throw new DateFormatError("has an unclosed quote \u2014 literal text is written between two single quotes");
12176
+ }
12177
+ tokens.push({ literal: end === index + 1 ? "'" : pattern.slice(index + 1, end) });
12178
+ index = end + 1;
12179
+ continue;
12180
+ }
12181
+ if (!/[A-Za-z]/.test(char)) {
12182
+ tokens.push({ literal: char });
12183
+ index++;
12184
+ continue;
12185
+ }
12186
+ const run = /^([A-Za-z])\1*/.exec(pattern.slice(index))?.[0];
12187
+ const known = TOKENS.find((token) => run.startsWith(token) && token.length === run.length);
12188
+ if (!known) {
12189
+ const hint2 = LOOK_ALIKES[run] ? ` (did you mean \`${suggest(pattern, kind)}\`?)` : "";
12190
+ throw new DateFormatError(
12191
+ `uses \`${run}\`, which is not a supported token${hint2}. Supported: yyyy yy MM M dd d HH H hh h mm ss a, and literal text in single quotes`
12192
+ );
12193
+ }
12194
+ tokens.push({ token: known });
12195
+ index += run.length;
12196
+ }
12197
+ return tokens;
12198
+ }
12199
+ function suggest(pattern, kind) {
12200
+ let fixed = pattern;
12201
+ for (const [wrong, right] of Object.entries(LOOK_ALIKES)) {
12202
+ fixed = fixed.replace(new RegExp(`(?<![A-Za-z])${wrong}(?![A-Za-z])`, "g"), right);
12203
+ }
12204
+ if (kind === "date") {
12205
+ fixed = fixed.replace(/mm/g, "MM");
12206
+ }
12207
+ return fixed;
12208
+ }
12209
+ var parsedPatterns = /* @__PURE__ */ new Map();
12210
+ function compilePattern(pattern, kind) {
12211
+ const key = `${kind}|${pattern}`;
12212
+ const cached = parsedPatterns.get(key);
12213
+ if (cached) {
12214
+ return cached;
12215
+ }
12216
+ if (typeof pattern !== "string" || !pattern.trim()) {
12217
+ throw new DateFormatError("needs a pattern, e.g. `dd/MM/yyyy`");
12218
+ }
12219
+ const tokens = tokenize(pattern, kind);
12220
+ const names = tokens.flatMap((token) => "token" in token ? [token.token] : []);
12221
+ const parts = names.map((name) => SPEC[name].part);
12222
+ const has = (part) => parts.includes(part);
12223
+ const repeated = parts.find((part, index) => parts.indexOf(part) !== index);
12224
+ if (repeated) {
12225
+ throw new DateFormatError(`names the ${repeated === "meridiem" ? "AM/PM" : repeated} twice`);
12226
+ }
12227
+ if (kind === "date" && names.includes("mm") && !has("hour")) {
12228
+ throw new DateFormatError(`uses \`mm\`, which is minutes \u2014 did you mean \`${suggest(pattern, kind)}\`?`);
12229
+ }
12230
+ if (kind === "date" && parts.some((part) => TIME_PARTS.has(part))) {
12231
+ throw new DateFormatError("has a time of day, which a date has not \u2014 declare `z.iso.datetime({ local: true })`");
12232
+ }
12233
+ if (kind === "time" && parts.some((part) => DATE_PARTS.has(part))) {
12234
+ throw new DateFormatError("has a date, which a time has not \u2014 declare `z.iso.datetime({ local: true })`");
12235
+ }
12236
+ const missing = [
12237
+ ...kind !== "time" ? [["year", "yyyy"], ["month", "MM"], ["day", "dd"]] : [],
12238
+ ...kind !== "date" ? [["hour", "HH"], ["minute", "mm"]] : []
12239
+ ].filter(([part]) => !has(part)).map(([, token]) => `\`${token}\``);
12240
+ if (missing.length) {
12241
+ throw new DateFormatError(`is missing ${missing.join(", ")} \u2014 every part of a ${describeKind(kind)} must be in it`);
12242
+ }
12243
+ if ((names.includes("HH") || names.includes("H")) && names.includes("a")) {
12244
+ throw new DateFormatError(
12245
+ "uses a 24-hour clock (`HH` / `H`) with `a` \u2014 13:45 would be written `13:45 PM`, which cannot be read back. Use `hh` / `h` with `a`, or `HH` without it"
12246
+ );
12247
+ }
12248
+ if ((names.includes("hh") || names.includes("h")) && !names.includes("a")) {
12249
+ throw new DateFormatError(
12250
+ "uses a 12-hour clock (`hh` / `h`) without `a` \u2014 without AM/PM the value cannot be read back. Add `a`, or use `HH` for a 24-hour clock"
12251
+ );
12252
+ }
12253
+ parsedPatterns.set(key, tokens);
12254
+ return tokens;
12255
+ }
12256
+ var describeKind = (kind) => kind === "date" ? "date" : kind === "time" ? "time" : "date and time";
12257
+ var pad = (value, width) => String(value).padStart(width, "0");
12258
+ function formatParts(parts, pattern, kind) {
12259
+ return compilePattern(pattern, kind).map((token) => {
12260
+ if ("literal" in token) {
12261
+ return token.literal;
12262
+ }
12263
+ const hour = parts.hour ?? 0;
12264
+ switch (token.token) {
12265
+ case "yyyy":
12266
+ return pad(parts.year ?? 0, 4);
12267
+ case "yy":
12268
+ return pad((parts.year ?? 0) % 100, 2);
12269
+ case "MM":
12270
+ return pad(parts.month ?? 0, 2);
12271
+ case "M":
12272
+ return String(parts.month ?? 0);
12273
+ case "dd":
12274
+ return pad(parts.day ?? 0, 2);
12275
+ case "d":
12276
+ return String(parts.day ?? 0);
12277
+ case "HH":
12278
+ return pad(hour, 2);
12279
+ case "H":
12280
+ return String(hour);
12281
+ case "hh":
12282
+ return pad(hour % 12 || 12, 2);
12283
+ case "h":
12284
+ return String(hour % 12 || 12);
12285
+ case "mm":
12286
+ return pad(parts.minute ?? 0, 2);
12287
+ case "ss":
12288
+ return pad(parts.second ?? 0, 2);
12289
+ case "a":
12290
+ return hour < 12 ? "AM" : "PM";
12291
+ }
12292
+ }).join("");
12293
+ }
12294
+ var escapeRegex = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12295
+ function parseInPattern(text2, pattern, kind) {
12296
+ const tokens = compilePattern(pattern, kind);
12297
+ const order = [];
12298
+ const source = tokens.map((token) => {
12299
+ if ("literal" in token) {
12300
+ return escapeRegex(token.literal);
12301
+ }
12302
+ order.push(token.token);
12303
+ if (token.token === "a") {
12304
+ return "(AM|PM)";
12305
+ }
12306
+ const { width } = SPEC[token.token];
12307
+ return width ? `(\\d{${width}})` : "(\\d{1,2})";
12308
+ }).join("");
12309
+ const match = new RegExp(`^${source}$`).exec(text2);
12310
+ if (!match) {
12311
+ return void 0;
12312
+ }
12313
+ const parts = {};
12314
+ let meridiem;
12315
+ order.forEach((name, index) => {
12316
+ const raw = match[index + 1];
12317
+ if (name === "a") {
12318
+ meridiem = raw;
12319
+ return;
12320
+ }
12321
+ const value = Number(raw);
12322
+ switch (name) {
12323
+ // date-fns' two-digit year rule against its reference year 2000: 00–49 → 20xx, 50–99 → 19xx.
12324
+ case "yy":
12325
+ parts.year = value < 50 ? 2e3 + value : 1900 + value;
12326
+ break;
12327
+ case "hh":
12328
+ case "h":
12329
+ parts.hour = value;
12330
+ break;
12331
+ default:
12332
+ parts[SPEC[name].part] = value;
12333
+ }
12334
+ });
12335
+ if (meridiem) {
12336
+ if (parts.hour === void 0 || parts.hour < 1 || parts.hour > 12) {
12337
+ return void 0;
12338
+ }
12339
+ parts.hour = parts.hour % 12 + (meridiem === "PM" ? 12 : 0);
12340
+ }
12341
+ const complete = completeParts(parts, kind);
12342
+ return complete && formatParts(complete, pattern, kind) === text2 ? complete : void 0;
12343
+ }
12344
+ function completeParts(parts, kind) {
12345
+ const { year, month, day, hour, minute, second } = parts;
12346
+ if (kind !== "time" && !isRealDate(year, month, day)) {
12347
+ return void 0;
12348
+ }
12349
+ if (kind !== "date" && !isRealTime(hour, minute, second)) {
12350
+ return void 0;
12351
+ }
12352
+ return kind === "date" ? { year, month, day } : kind === "time" ? { hour, minute, ...second !== void 0 ? { second } : {} } : { year, month, day, hour, minute, ...second !== void 0 ? { second } : {} };
12353
+ }
12354
+ function isRealDate(year, month, day) {
12355
+ if (year === void 0 || month === void 0 || day === void 0 || month < 1 || month > 12 || day < 1) {
12356
+ return false;
12357
+ }
12358
+ const leap = year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
12359
+ const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
12360
+ return day <= days;
12361
+ }
12362
+ var isRealTime = (hour, minute, second) => hour !== void 0 && minute !== void 0 && hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59 && (second === void 0 || second >= 0 && second <= 59);
12363
+ var ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
12364
+ var ISO_DATE_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?$/i;
12365
+ var ISO_TIME = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?$/i;
12366
+ function parseIso(text2, kind) {
12367
+ const dateTime = ISO_DATE_TIME.exec(text2);
12368
+ if (dateTime) {
12369
+ const [, year, month, day, hour, minute, second] = dateTime.map(Number);
12370
+ return completeParts({ year, month, day, hour, minute, ...dateTime[6] ? { second } : {} }, kind);
12371
+ }
12372
+ const date = ISO_DATE.exec(text2);
12373
+ if (date) {
12374
+ return kind === "date" ? completeParts({ year: +date[1], month: +date[2], day: +date[3] }, kind) : void 0;
12375
+ }
12376
+ const time = ISO_TIME.exec(text2);
12377
+ if (time && kind === "time") {
12378
+ return completeParts({ hour: +time[1], minute: +time[2], ...time[3] ? { second: +time[3] } : {} }, kind);
12379
+ }
12380
+ return void 0;
12381
+ }
12382
+ function toCanonical(parts, kind) {
12383
+ const seconds = parts.second !== void 0 ? `:${pad(parts.second, 2)}` : "";
12384
+ const date = `${pad(parts.year ?? 0, 4)}-${pad(parts.month ?? 0, 2)}-${pad(parts.day ?? 0, 2)}`;
12385
+ const time = `${pad(parts.hour ?? 0, 2)}:${pad(parts.minute ?? 0, 2)}${seconds}`;
12386
+ return kind === "date" ? date : kind === "time" ? time : `${date}T${time}`;
12387
+ }
12388
+ function canonicalToPattern(canonical, ins, kind) {
12389
+ const pattern = ins.meta.frDateFormat;
12390
+ if (!pattern) {
12391
+ return canonical;
12392
+ }
12393
+ const parts = parseIso(canonical, kind);
12394
+ return parts ? formatParts(parts, pattern, kind) : canonical;
12395
+ }
12396
+ var MIN_TIMESTAMP_DIGITS = 13;
12397
+ function digitOnlyLength(pattern, kind) {
12398
+ const example = formatParts(EXAMPLE, pattern, kind);
12399
+ return /^\d+$/.test(example) ? example.length : void 0;
12400
+ }
12401
+ function isTimestamp(value, pattern, kind) {
12402
+ if (typeof value === "number") {
12403
+ return Number.isFinite(value);
12404
+ }
12405
+ if (typeof value !== "string") {
12406
+ return false;
12407
+ }
12408
+ const text2 = value.trim();
12409
+ return new RegExp(`^\\d{${MIN_TIMESTAMP_DIGITS},}$`).test(text2) && digitOnlyLength(pattern, kind) !== text2.length;
12410
+ }
12411
+ function timestampParts(value, kind) {
12412
+ const date = new Date(Number(value));
12413
+ if (Number.isNaN(date.getTime())) {
12414
+ return void 0;
12415
+ }
12416
+ const second = date.getSeconds();
12417
+ return completeParts({
12418
+ year: date.getFullYear(),
12419
+ month: date.getMonth() + 1,
12420
+ day: date.getDate(),
12421
+ hour: date.getHours(),
12422
+ minute: date.getMinutes(),
12423
+ ...second ? { second } : {}
12424
+ }, kind);
12425
+ }
12426
+ function toDateString(value, ins, kind) {
12427
+ const pattern = ins.meta.frDateFormat;
12428
+ const text2 = typeof value === "string" ? value.trim() : typeof value === "number" && Number.isInteger(value) && value >= 0 ? String(value) : void 0;
12429
+ if (text2 !== void 0) {
12430
+ const parts = (pattern ? parseInPattern(text2, pattern, kind) : void 0) ?? (typeof value === "string" ? parseIso(text2, kind) : void 0);
12431
+ if (parts) {
12432
+ return { canonical: toCanonical(parts, kind) };
12433
+ }
12434
+ }
12435
+ if (DATE_STRINGS_ACCEPT_TIMESTAMPS && isTimestamp(value, patternOf(ins, kind), kind)) {
12436
+ const parts = timestampParts(value, kind);
12437
+ return parts ? { canonical: toCanonical(parts, kind), fromTimestamp: true } : {};
12438
+ }
12439
+ return {};
12440
+ }
12441
+ var EXAMPLE = { year: 2024, month: 1, day: 31, hour: 13, minute: 45, second: 30 };
12442
+ function expectedDateString(ins, kind) {
12443
+ const pattern = patternOf(ins, kind);
12444
+ const shown = ins.meta.frDateFormat ? pattern : pattern.replace(/'T'/, "T");
12445
+ const example = formatParts(EXAMPLE, pattern, kind);
12446
+ return `${kind === "date" ? "a date" : kind === "time" ? "a time" : "a date and time"} in ${shown}, e.g. ${example}`;
12447
+ }
12448
+ function hasDateFormat(schema, seen = /* @__PURE__ */ new Set()) {
12449
+ if (!schema || seen.has(schema)) {
12450
+ return false;
12451
+ }
12452
+ seen.add(schema);
12453
+ const ins = inspect(schema);
12454
+ if (ins.meta.frDateFormat && dateStringKind(ins)) {
12455
+ return true;
12456
+ }
12457
+ const def = ins.core?._zod?.def ?? {};
12458
+ const children = [
12459
+ ...shapeEntries(ins.core).map(([, child]) => child),
12460
+ ...def.element ? [def.element] : [],
12461
+ ...def.valueType ? [def.valueType] : [],
12462
+ ...ins.branches ?? []
12463
+ ];
12464
+ return children.some((child) => hasDateFormat(child, seen));
12465
+ }
12466
+
12467
+ // ../../flow-extension-runner/src/params/schema/dictionary-binding.ts
12468
+ var DictionaryScope = class _DictionaryScope {
12469
+ constructor(top, visible) {
12470
+ this.top = top;
12471
+ this.visible = visible;
12472
+ }
12473
+ static {
12474
+ this.ROOT = new _DictionaryScope(null, /* @__PURE__ */ new Set());
12475
+ }
12476
+ enter(names) {
12477
+ if (!this.top) {
12478
+ const top = new Set(names);
12479
+ return new _DictionaryScope(top, top);
12480
+ }
12481
+ return new _DictionaryScope(this.top, /* @__PURE__ */ new Set([...this.top, ...names]));
12482
+ }
12483
+ };
12484
+ function resolveDependsOn(binding, scope2) {
12485
+ const aliases = binding.criteriaAliases ?? {};
12486
+ let clash;
12487
+ const dependsOn = binding.dependsOn.map((key) => {
12488
+ const visible = [key, ...aliases[key] ?? []].filter((name) => scope2.visible.has(name));
12489
+ if (visible.length > 1 && !clash) {
12490
+ clash = { key, names: visible };
12491
+ }
12492
+ return visible[0] ?? key;
12493
+ });
12494
+ return clash ? { dependsOn, clash } : { dependsOn };
12495
+ }
12496
+ function publishedBinding(binding, scope2) {
12497
+ return { id: binding.id, dependsOn: resolveDependsOn(binding, scope2).dependsOn };
12498
+ }
12499
+
12500
+ // ../../flow-extension-runner/src/params/schema/assert-supported-schema.ts
12139
12501
  var GUARDED_KINDS = /* @__PURE__ */ new Set(["action", "dictionary", "polling trigger", "realtime trigger", "extension"]);
12140
12502
  var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
12141
12503
  "string",
@@ -12156,31 +12518,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
12156
12518
  ]);
12157
12519
  var SUPPORTED_SPELLING = "z.string(), z.number(), z.bigint(), z.boolean(), z.date(), z.enum([\u2026]), z.literal(\u2026), z.object({ \u2026 }), z.array(\u2026), z.record(\u2026), z.union([\u2026]), z.null(), z.any(), z.unknown()";
12158
12520
  var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
12159
- function subjectOf(source, path2) {
12521
+ function subjectOf(source, path) {
12160
12522
  const kind = source.kind ?? "extension";
12161
12523
  const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
12162
- return `${subject}\`${path2}\``;
12524
+ return `${subject}\`${path}\``;
12163
12525
  }
12164
- function refuse(message, source, path2, received) {
12526
+ function refuse(message, source, path, received) {
12165
12527
  throw new InvalidSchemaError(
12166
12528
  `[flow-extension:${source.serviceId}] ${message}`,
12167
- { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path2, received }
12529
+ { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path, received }
12168
12530
  );
12169
12531
  }
12170
- function refuseCatch(source, path2) {
12532
+ function refuseCatch(source, path) {
12171
12533
  refuse(
12172
- `${subjectOf(source, path2)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
12534
+ `${subjectOf(source, path)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
12173
12535
  source,
12174
- path2,
12536
+ path,
12175
12537
  "catch"
12176
12538
  );
12177
12539
  }
12178
- function refuseType(source, path2, type) {
12540
+ function refuseType(source, path, type) {
12179
12541
  const received = type ? `z.${type}()` : "a value that is not a zod schema";
12180
12542
  refuse(
12181
- `${subjectOf(source, path2)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
12543
+ `${subjectOf(source, path)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
12182
12544
  source,
12183
- path2,
12545
+ path,
12184
12546
  type ?? "unknown"
12185
12547
  );
12186
12548
  }
@@ -12196,7 +12558,7 @@ function isLooseObject(schema) {
12196
12558
  function isDynamicPropsSlot(source, topLevel) {
12197
12559
  return topLevel && source.kind === "action" && source.slot === "params";
12198
12560
  }
12199
- function assertDynamicProps(schema, name, siblings, source, path2) {
12561
+ function assertDynamicProps(schema, name, siblings, source, path) {
12200
12562
  const ins = inspect(schema);
12201
12563
  const spec = ins.meta.frDynamicProps;
12202
12564
  if (!spec) {
@@ -12207,49 +12569,49 @@ function assertDynamicProps(schema, name, siblings, source, path2) {
12207
12569
  }
12208
12570
  if (typeof spec.execute !== "function") {
12209
12571
  refuse(
12210
- `${subjectOf(source, path2)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
12572
+ `${subjectOf(source, path)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
12211
12573
  source,
12212
- path2,
12574
+ path,
12213
12575
  typeof spec.execute
12214
12576
  );
12215
12577
  }
12216
12578
  if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
12217
12579
  refuse(
12218
- `${subjectOf(source, path2)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
12580
+ `${subjectOf(source, path)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
12219
12581
  source,
12220
- path2,
12582
+ path,
12221
12583
  "dependsOn"
12222
12584
  );
12223
12585
  }
12224
12586
  for (const dependency of spec.dependsOn ?? []) {
12225
12587
  if (dependency === name || !siblings.includes(dependency)) {
12226
12588
  refuse(
12227
- `${subjectOf(source, path2)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
12589
+ `${subjectOf(source, path)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
12228
12590
  source,
12229
- path2,
12591
+ path,
12230
12592
  dependency
12231
12593
  );
12232
12594
  }
12233
12595
  }
12234
12596
  if (ins.meta.frDictionary) {
12235
12597
  refuse(
12236
- `${subjectOf(source, path2)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
12598
+ `${subjectOf(source, path)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
12237
12599
  source,
12238
- path2,
12600
+ path,
12239
12601
  "dictionary"
12240
12602
  );
12241
12603
  }
12242
12604
  const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
12243
12605
  if (!isLooseObject(schema) && !isLooseObject(element)) {
12244
12606
  refuse(
12245
- `${subjectOf(source, path2)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
12607
+ `${subjectOf(source, path)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
12246
12608
  source,
12247
- path2,
12609
+ path,
12248
12610
  ins.resolvedType ?? "unknown"
12249
12611
  );
12250
12612
  }
12251
12613
  }
12252
- function assertDictionaryBinding(schema, source, path2, scope2) {
12614
+ function assertDictionaryBinding(schema, source, path, scope2) {
12253
12615
  const binding = inspect(schema).meta.frDictionary;
12254
12616
  if (!binding) {
12255
12617
  return;
@@ -12257,14 +12619,56 @@ function assertDictionaryBinding(schema, source, path2, scope2) {
12257
12619
  const { clash } = resolveDependsOn(binding, scope2);
12258
12620
  if (clash) {
12259
12621
  refuse(
12260
- `${subjectOf(source, path2)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
12622
+ `${subjectOf(source, path)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
12261
12623
  source,
12262
- path2,
12624
+ path,
12263
12625
  clash.names.join(", ")
12264
12626
  );
12265
12627
  }
12266
12628
  }
12267
- function assertField(schema, source, path2, seen, scope2, topLevel = false) {
12629
+ function assertDateString(schema, source, path) {
12630
+ const ins = inspect(schema);
12631
+ const pattern = ins.meta.frDateFormat;
12632
+ const kind = dateStringKind(ins);
12633
+ if (pattern !== void 0 && !kind) {
12634
+ const format = ins.core?._zod?.def?.format;
12635
+ const zoned = ins.coreType === "string" && format === "datetime";
12636
+ refuse(
12637
+ `${subjectOf(source, path)} uses \`.dateFormat()\` on ${zoned ? "z.iso.datetime() with a zone \u2014 an instant, not a wall clock" : "a type that is not a date string"}. Only z.iso.date(), z.iso.datetime({ local: true }) and z.iso.time() take a format.`,
12638
+ source,
12639
+ path,
12640
+ zoned ? "datetime" : ins.resolvedType ?? "unknown"
12641
+ );
12642
+ }
12643
+ if (!kind) {
12644
+ return;
12645
+ }
12646
+ if (pattern !== void 0) {
12647
+ try {
12648
+ compilePattern(pattern, kind);
12649
+ } catch (error) {
12650
+ if (error instanceof DateFormatError) {
12651
+ refuse(`${subjectOf(source, path)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path, pattern);
12652
+ }
12653
+ throw error;
12654
+ }
12655
+ }
12656
+ const fallback = ins.defaultValue;
12657
+ if (fallback === void 0 || fallback === null) {
12658
+ return;
12659
+ }
12660
+ const written = patternOf(ins, kind);
12661
+ const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
12662
+ if (!fits) {
12663
+ refuse(
12664
+ `${subjectOf(source, path)} has the default ${JSON.stringify(fallback)}, which is not written in ${written.replace(/'T'/, "T")} \u2014 a default is handed to \`execute\` as written, so write it in the field's own format.`,
12665
+ source,
12666
+ path,
12667
+ String(fallback)
12668
+ );
12669
+ }
12670
+ }
12671
+ function assertField(schema, source, path, seen, scope2, topLevel = false) {
12268
12672
  if (!schema || seen.has(schema)) {
12269
12673
  return;
12270
12674
  }
@@ -12272,34 +12676,35 @@ function assertField(schema, source, path2, seen, scope2, topLevel = false) {
12272
12676
  const ins = inspect(schema);
12273
12677
  if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
12274
12678
  refuse(
12275
- `${subjectOf(source, path2)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
12679
+ `${subjectOf(source, path)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
12276
12680
  source,
12277
- path2,
12681
+ path,
12278
12682
  "dynamicProps"
12279
12683
  );
12280
12684
  }
12281
12685
  if (ins.resolvedType === "catch") {
12282
- refuseCatch(source, path2);
12686
+ refuseCatch(source, path);
12283
12687
  }
12284
- assertDictionaryBinding(schema, source, path2, scope2);
12688
+ assertDictionaryBinding(schema, source, path, scope2);
12689
+ assertDateString(schema, source, path);
12285
12690
  if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
12286
- refuseType(source, path2, ins.resolvedType);
12691
+ refuseType(source, path, ins.resolvedType);
12287
12692
  }
12288
12693
  if (ins.branches) {
12289
- ins.branches.forEach((branch, index) => assertField(branch, source, `${path2}|branch ${index + 1}`, seen, scope2));
12694
+ ins.branches.forEach((branch, index) => assertField(branch, source, `${path}|branch ${index + 1}`, seen, scope2));
12290
12695
  }
12291
12696
  const def = ins.core._zod?.def ?? {};
12292
12697
  if (ins.resolvedType === "array") {
12293
- assertField(def.element, source, `${path2}[]`, seen, scope2);
12698
+ assertField(def.element, source, `${path}[]`, seen, scope2);
12294
12699
  }
12295
12700
  if (ins.resolvedType === "record") {
12296
- assertField(def.valueType, source, `${path2}{}`, seen, scope2);
12701
+ assertField(def.valueType, source, `${path}{}`, seen, scope2);
12297
12702
  }
12298
12703
  if (ins.resolvedType === "object") {
12299
12704
  const properties = shapeEntries(ins.core);
12300
12705
  const inner = scope2.enter(properties.map(([name]) => name));
12301
12706
  for (const [name, property] of properties) {
12302
- assertField(property, source, `${path2}.${name}`, seen, inner);
12707
+ assertField(property, source, `${path}.${name}`, seen, inner);
12303
12708
  }
12304
12709
  }
12305
12710
  }
@@ -12320,7 +12725,7 @@ function assertSupportedSchema(scheme, source) {
12320
12725
  }
12321
12726
  }
12322
12727
 
12323
- // ../../flow-extension-runner/src/v2/params/schema/dates.ts
12728
+ // ../../flow-extension-runner/src/params/schema/dates.ts
12324
12729
  var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
12325
12730
  var HAS_TIME = /^(\d{4}-\d{2}-\d{2})[T ](.+)$/;
12326
12731
  var ZONE = /(Z|[+-]\d{2}:?\d{2})$/;
@@ -12399,7 +12804,7 @@ function hasPassThroughDate(schema, inspectSchema, entriesOf) {
12399
12804
  return children.some((child) => hasPassThroughDate(child, inspectSchema, entriesOf));
12400
12805
  }
12401
12806
 
12402
- // ../../flow-extension-runner/src/v2/params/schema/labels.ts
12807
+ // ../../flow-extension-runner/src/params/schema/labels.ts
12403
12808
  var ACRONYMS = /* @__PURE__ */ new Set([
12404
12809
  "id",
12405
12810
  "url",
@@ -12433,7 +12838,7 @@ function humanizeKey(name) {
12433
12838
  }
12434
12839
  var labelOf = (name, schema) => inspect(schema).meta.title || humanizeKey(name) || name;
12435
12840
 
12436
- // ../../flow-extension-runner/src/v2/params/schema/field-plan.ts
12841
+ // ../../flow-extension-runner/src/params/schema/field-plan.ts
12437
12842
  function declaredAbsence(schema) {
12438
12843
  let current = schema;
12439
12844
  let acceptsUndefined = false;
@@ -12532,16 +12937,46 @@ function planField(name, schema) {
12532
12937
  label: labelOf(name, schema),
12533
12938
  coreType: ins.coreType,
12534
12939
  isUnion: !!ins.branches,
12940
+ blankBranch: hasBlankBranch(ins),
12535
12941
  absence,
12536
12942
  absorbsBlank,
12537
12943
  keepsEmpty,
12538
12944
  blankIsValue,
12539
12945
  passThroughDate: passesDateThrough(ins),
12540
- restoresDates: hasPassThroughDate(schema, inspect, shapeEntries)
12946
+ restoresDates: hasPassThroughDate(schema, inspect, shapeEntries),
12947
+ dateString: dateStringKind(ins),
12948
+ formatsDates: hasDateFormat(schema)
12541
12949
  };
12542
12950
  }
12543
12951
 
12544
- // ../../flow-extension-runner/src/v2/params/schema/coerce.ts
12952
+ // ../../flow-extension-runner/src/params/schema/notices.ts
12953
+ var sink;
12954
+ var currentField;
12955
+ function collectNotices(fn) {
12956
+ const outer = sink;
12957
+ const notices = [];
12958
+ sink = notices;
12959
+ try {
12960
+ return { result: fn(), notices };
12961
+ } finally {
12962
+ sink = outer;
12963
+ outer?.push(...notices);
12964
+ }
12965
+ }
12966
+ function withinField(field, fn) {
12967
+ const outer = currentField;
12968
+ currentField = field;
12969
+ try {
12970
+ return fn();
12971
+ } finally {
12972
+ currentField = outer;
12973
+ }
12974
+ }
12975
+ function notice(entry) {
12976
+ sink?.push({ field: currentField, ...entry });
12977
+ }
12978
+
12979
+ // ../../flow-extension-runner/src/params/schema/coerce.ts
12545
12980
  var ok = (value) => ({ ok: true, value });
12546
12981
  var fail = (expected) => ({ ok: false, expected });
12547
12982
  var TRUE = /* @__PURE__ */ new Set(["true", "1", "yes", "y", "t", "on", "checked", "enabled", "enable", "active"]);
@@ -12712,6 +13147,21 @@ function coerceLeaf(value, ins) {
12712
13147
  if (ins.branches) {
12713
13148
  return ok(coerceUnion(value, ins.branches));
12714
13149
  }
13150
+ const kind = dateStringKind(ins);
13151
+ if (kind) {
13152
+ const { canonical, fromTimestamp } = toDateString(value, ins, kind);
13153
+ if (canonical === void 0) {
13154
+ return fail(expectedDateString(ins, kind));
13155
+ }
13156
+ if (fromTimestamp) {
13157
+ notice({
13158
+ message: "a timestamp was converted to a date string in the server time zone (FR-3920 lenient period)",
13159
+ value,
13160
+ converted: canonical
13161
+ });
13162
+ }
13163
+ return ok(canonical);
13164
+ }
12715
13165
  const format = formatOf(ins);
12716
13166
  if (ins.coreType === "string" && isConvertibleIso(format)) {
12717
13167
  const iso = toIso(value, format);
@@ -12740,12 +13190,12 @@ function isBlank(value, ins, schema) {
12740
13190
  return false;
12741
13191
  }
12742
13192
  if (ins.branches) {
12743
- return true;
13193
+ return !hasBlankBranch(ins) || absenceOf(schema).absorbsBlank;
12744
13194
  }
12745
13195
  if (absenceOf(schema).blankIsValue) {
12746
13196
  return absenceOf(schema).absorbsBlank;
12747
13197
  }
12748
- return ins.coreType !== "string" || absenceOf(schema).absorbsBlank;
13198
+ return ins.coreType !== "string" || !!dateStringKind(ins) || absenceOf(schema).absorbsBlank;
12749
13199
  }
12750
13200
  function absentAs(schema, value) {
12751
13201
  const { absence } = absenceOf(schema);
@@ -12758,7 +13208,7 @@ function absentAs(schema, value) {
12758
13208
  return absence === "null" ? null : void 0;
12759
13209
  }
12760
13210
 
12761
- // ../../flow-extension-runner/src/v2/params/schema/defaults.ts
13211
+ // ../../flow-extension-runner/src/params/schema/defaults.ts
12762
13212
  var WIDGET_DESCRIPTIONS = {
12763
13213
  [FlowExtensionParamWidgetTypes.MULTI_LINE_TEXT]: "Expects text; line breaks are allowed"
12764
13214
  };
@@ -12795,7 +13245,7 @@ var FORMAT_DESCRIPTIONS = {
12795
13245
  cidrv6: "Expects an IPv6 range, e.g. 2001:db8::/32"
12796
13246
  };
12797
13247
 
12798
- // ../../flow-extension-runner/src/v2/params/schema/messages.ts
13248
+ // ../../flow-extension-runner/src/params/schema/messages.ts
12799
13249
  var EXPECTED = {
12800
13250
  string: "a string",
12801
13251
  number: "a number",
@@ -12809,6 +13259,72 @@ var EXPECTED = {
12809
13259
  record: "an object"
12810
13260
  };
12811
13261
  var requiredMessage = (plan) => `\xAB${plan.label}\xBB is required`;
13262
+ var oneOf = (values) => `one of: ${values.map(String).join(", ")}`;
13263
+ var formatPhrase = (format) => {
13264
+ const described = FORMAT_DESCRIPTIONS[format ?? ""];
13265
+ return described?.replace(/^Expects (.*?), e\.g\. (.*)$/, "$1 (e.g. $2)").replace(/^Expects /, "");
13266
+ };
13267
+ var distinct = (phrases) => [...new Set(phrases.filter((phrase) => !!phrase))];
13268
+ function unionPhrases(union, value) {
13269
+ return distinct((inspect(union).branches ?? []).map((branch) => {
13270
+ try {
13271
+ const result = branch.safeParse(value);
13272
+ return branchPhrase(branch, result.error?.issues[0]);
13273
+ } catch {
13274
+ return void 0;
13275
+ }
13276
+ }));
13277
+ }
13278
+ function remainingIssue(branch, value) {
13279
+ if (!branch) {
13280
+ return void 0;
13281
+ }
13282
+ try {
13283
+ const result = branch.safeParse(coerceDeep(value, branch));
13284
+ return result.success ? void 0 : result.error?.issues[0];
13285
+ } catch {
13286
+ return void 0;
13287
+ }
13288
+ }
13289
+ function branchPhrase(branch, issue) {
13290
+ if (!branch || !issue) {
13291
+ return void 0;
13292
+ }
13293
+ const ins = inspect(branch);
13294
+ const values = ins.core._zod?.def?.values ?? [];
13295
+ if (ins.coreType === "literal" && values.length === 1 && values[0] === "") {
13296
+ return void 0;
13297
+ }
13298
+ const dateKind = dateStringKind(ins);
13299
+ if (dateKind) {
13300
+ return expectedDateString(ins, dateKind);
13301
+ }
13302
+ switch (issue.code) {
13303
+ case "invalid_type":
13304
+ return EXPECTED[issue.expected ?? ""] ?? issue.expected;
13305
+ case "invalid_value":
13306
+ return oneOf(issue.values ?? values);
13307
+ case "invalid_format":
13308
+ return formatPhrase(issue.format);
13309
+ // A bound has no short phrase ("a number of at least 10"); the branch still names its type.
13310
+ case "too_small":
13311
+ case "too_big":
13312
+ return EXPECTED[ins.coreType === "literal" ? literalType(ins.core) ?? "" : ins.coreType];
13313
+ default:
13314
+ return void 0;
13315
+ }
13316
+ }
13317
+ function unionIssue(plan, issue, union, unionValue, fieldValue) {
13318
+ const branches = union ? inspect(union).branches : void 0;
13319
+ const errors = issue.errors ?? [];
13320
+ const deepIndex = errors.findIndex((branchIssues) => branchIssues.some((branchIssue) => (branchIssue.path ?? []).length));
13321
+ if (deepIndex >= 0) {
13322
+ const deep = remainingIssue(branches?.[deepIndex], unionValue) ?? errors[deepIndex].find((branchIssue) => (branchIssue.path ?? []).length);
13323
+ return toFieldIssue(plan, { ...deep, path: [...issue.path ?? [], ...deep.path ?? []] }, fieldValue);
13324
+ }
13325
+ const phrases = distinct(errors.map((branchIssues, index) => branchPhrase(branches?.[index], branchIssues[0])));
13326
+ return phrases.length ? { path: "", code: "invalid_union", message: `must be ${phrases.join(", or ")}` } : void 0;
13327
+ }
12812
13328
  var invalidTypeMessage = (plan, expected) => `\xAB${plan.label}\xBB must be ${EXPECTED[expected] ?? expected}`;
12813
13329
  var isIndex = (segment) => /^\d+$/.test(segment);
12814
13330
  function resolveTarget(plan, segments, fieldValue) {
@@ -12817,6 +13333,8 @@ function resolveTarget(plan, segments, fieldValue) {
12817
13333
  let label = plan.label;
12818
13334
  let found = true;
12819
13335
  for (const segment of segments) {
13336
+ const branch = schema && inspect(schema).branches?.find((candidate) => isIndex(segment) ? inspect(candidate).coreType === "array" : shapeEntries(inspect(candidate).core).some(([name]) => name === segment));
13337
+ schema = branch ?? schema;
12820
13338
  const core = schema ? inspect(schema).core : void 0;
12821
13339
  const coreType = core ? inspect(schema).coreType : void 0;
12822
13340
  value = value == null ? void 0 : value[segment];
@@ -12833,7 +13351,7 @@ function resolveTarget(plan, segments, fieldValue) {
12833
13351
  schema = nested[1];
12834
13352
  label = labelOf(segment, schema);
12835
13353
  }
12836
- return { label, value, found };
13354
+ return { label, value, found, schema: found ? schema : void 0 };
12837
13355
  }
12838
13356
  function bound(value, plan) {
12839
13357
  if (plan.coreType !== "date" || typeof value !== "number") {
@@ -12848,36 +13366,55 @@ function isAuthored(issue) {
12848
13366
  }
12849
13367
  function toFieldIssue(plan, issue, fieldValue) {
12850
13368
  const segments = (issue.path ?? []).map(String).filter(Boolean);
12851
- const path2 = segments.length ? `${plan.name}.${segments.join(".")}` : plan.name;
13369
+ const path = segments.length ? `${plan.name}.${segments.join(".")}` : plan.name;
12852
13370
  const code = issue.code ?? "custom";
12853
13371
  const target = resolveTarget(plan, segments, fieldValue);
12854
13372
  const named = { ...plan, label: target.label };
12855
13373
  if (isAuthored(issue)) {
12856
- return { path: path2, code, message: issue.message };
13374
+ return { path, code, message: issue.message };
13375
+ }
13376
+ if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
13377
+ const combined = unionPhrases(target.schema, target.value);
13378
+ if (combined.length > 1) {
13379
+ return { path, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
13380
+ }
13381
+ }
13382
+ const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
13383
+ const dateMissing = target.value == null || target.value === "";
13384
+ if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
13385
+ return dateMissing ? { path, code, message: requiredMessage(named) } : { path, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
12857
13386
  }
12858
13387
  if (code === "invalid_type") {
12859
13388
  const received = issue.received;
12860
13389
  const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
12861
- return absent ? { path: path2, code, message: requiredMessage(named) } : { path: path2, code, message: invalidTypeMessage(named, issue.expected ?? "") };
13390
+ return absent ? { path, code, message: requiredMessage(named) } : { path, code, message: invalidTypeMessage(named, issue.expected ?? "") };
12862
13391
  }
12863
13392
  if (code === "too_small") {
12864
- return { path: path2, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan)}` };
13393
+ return { path, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan)}` };
12865
13394
  }
12866
13395
  if (code === "too_big") {
12867
- return { path: path2, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan)}` };
13396
+ return { path, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan)}` };
12868
13397
  }
12869
13398
  if (code === "invalid_value") {
12870
- const values = (issue.values ?? []).map(String);
12871
- return { path: path2, code, message: `\xAB${target.label}\xBB must be one of: ${values.join(", ")}` };
13399
+ return { path, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
12872
13400
  }
12873
13401
  if (code === "invalid_format") {
12874
13402
  const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
12875
- return described ? { path: path2, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path2, code, message: `\xAB${target.label}\xBB has an invalid format` };
13403
+ return described ? { path, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path, code, message: `\xAB${target.label}\xBB has an invalid format` };
13404
+ }
13405
+ if (code === "invalid_union") {
13406
+ if (segments.length && target.found && target.value == null) {
13407
+ return { path, code, message: requiredMessage(named) };
13408
+ }
13409
+ const combined = unionIssue(plan, issue, target.schema, target.value, fieldValue);
13410
+ if (combined) {
13411
+ return combined.path ? combined : { path, code, message: `\xAB${target.label}\xBB ${combined.message}` };
13412
+ }
12876
13413
  }
12877
- return { path: path2, code, message: `\xAB${target.label}\xBB is invalid` };
13414
+ return { path, code, message: `\xAB${target.label}\xBB is invalid` };
12878
13415
  }
12879
13416
 
12880
- // ../../flow-extension-runner/src/v2/params/schema/normalize.ts
13417
+ // ../../flow-extension-runner/src/params/schema/normalize.ts
12881
13418
  var resolved = (value) => ({ value, present: true, issues: [] });
12882
13419
  var rejected = (issues) => ({ present: false, issues });
12883
13420
  function isAbsent(value, plan) {
@@ -12894,12 +13431,12 @@ function isAbsent(value, plan) {
12894
13431
  return false;
12895
13432
  }
12896
13433
  if (plan.isUnion) {
12897
- return true;
13434
+ return !plan.blankBranch || plan.absorbsBlank;
12898
13435
  }
12899
13436
  if (plan.blankIsValue) {
12900
13437
  return plan.absorbsBlank;
12901
13438
  }
12902
- return plan.coreType !== "string" || plan.absorbsBlank;
13439
+ return plan.coreType !== "string" || !!plan.dateString || plan.absorbsBlank;
12903
13440
  }
12904
13441
  function normalizeAbsence(value, plan) {
12905
13442
  if (plan.absence === "required") {
@@ -12938,7 +13475,7 @@ function normalizeField(value, plan) {
12938
13475
  return restore(validate(coerced.value, plan), value, plan);
12939
13476
  }
12940
13477
  function restore(result, original, plan) {
12941
- if (!plan.restoresDates || !result.present || result.issues.length) {
13478
+ if (!(plan.restoresDates || plan.formatsDates) || !result.present || result.issues.length) {
12942
13479
  return result;
12943
13480
  }
12944
13481
  if (plan.passThroughDate) {
@@ -12958,6 +13495,10 @@ function restoreDeep(output, original, schema) {
12958
13495
  const branch = ins.branches.find((option) => accepts(option, output));
12959
13496
  return branch ? restoreDeep(output, original, branch) : output;
12960
13497
  }
13498
+ const kind = dateStringKind(ins);
13499
+ if (kind) {
13500
+ return typeof output === "string" && original !== "" ? canonicalToPattern(output, ins, kind) : output;
13501
+ }
12961
13502
  const element = ins.core?._zod?.def?.element;
12962
13503
  if (ins.coreType === "array" && element && Array.isArray(output) && Array.isArray(original)) {
12963
13504
  return output.map((item, index) => restoreDeep(item, original[index], element));
@@ -12981,7 +13522,7 @@ function restoreDeep(output, original, schema) {
12981
13522
  }
12982
13523
  var isPlain = (value) => !!value && typeof value === "object" && !Array.isArray(value);
12983
13524
 
12984
- // ../../flow-extension-runner/src/v2/params/schema/parse.ts
13525
+ // ../../flow-extension-runner/src/params/schema/parse.ts
12985
13526
  var EXPECTED2 = {
12986
13527
  string: "a string",
12987
13528
  number: "a number",
@@ -12991,10 +13532,10 @@ var EXPECTED2 = {
12991
13532
  };
12992
13533
  function toIssues(error, param) {
12993
13534
  return (error?.issues ?? []).map((issue) => {
12994
- const path2 = (issue.path ?? []).map(String).join(".");
13535
+ const path = (issue.path ?? []).map(String).join(".");
12995
13536
  const expected = issue.expected;
12996
- const restated = param && !path2 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
12997
- return { path: path2, message: restated ?? issue.message ?? "invalid value", code: issue.code };
13537
+ const restated = param && !path && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
13538
+ return { path, message: restated ?? issue.message ?? "invalid value", code: issue.code };
12998
13539
  });
12999
13540
  }
13000
13541
  function parseSchema(schema, value, fail2, param) {
@@ -13008,7 +13549,7 @@ function parseSchema(schema, value, fail2, param) {
13008
13549
  return result.data;
13009
13550
  }
13010
13551
 
13011
- // ../../flow-extension-runner/src/v2/params/params.ts
13552
+ // ../../flow-extension-runner/src/params/params.ts
13012
13553
  var Params = class {
13013
13554
  constructor(scheme, source = {}) {
13014
13555
  this.source = source;
@@ -13047,7 +13588,7 @@ var Params = class {
13047
13588
  const values = {};
13048
13589
  const issues = [];
13049
13590
  for (const plan of this.plans()) {
13050
- const result = normalizeField(source[plan.name], plan);
13591
+ const result = withinField(plan.name, () => normalizeField(source[plan.name], plan));
13051
13592
  if (result.issues.length) {
13052
13593
  issues.push(...result.issues);
13053
13594
  } else if (result.present) {
@@ -13063,7 +13604,7 @@ var Params = class {
13063
13604
  }
13064
13605
  };
13065
13606
 
13066
- // ../../flow-extension-runner/src/v2/params/config-params.ts
13607
+ // ../../flow-extension-runner/src/params/config-params.ts
13067
13608
  var ConfigParams = class _ConfigParams extends Params {
13068
13609
  static of(scheme, source = {}) {
13069
13610
  return new _ConfigParams(scheme, source);
@@ -13086,7 +13627,7 @@ var ConfigParams = class _ConfigParams extends Params {
13086
13627
  }
13087
13628
  };
13088
13629
 
13089
- // ../../flow-extension-runner/src/v2/params/method-params.ts
13630
+ // ../../flow-extension-runner/src/params/method-params.ts
13090
13631
  var MethodParams = class _MethodParams extends Params {
13091
13632
  static of(scheme, source = {}) {
13092
13633
  return new _MethodParams(scheme, source);
@@ -13112,10 +13653,10 @@ var MethodParams = class _MethodParams extends Params {
13112
13653
  }
13113
13654
  };
13114
13655
 
13115
- // ../../flow-extension-runner/src/v2/params/zod.ts
13656
+ // ../../flow-extension-runner/src/params/zod.ts
13116
13657
  var import_zod2 = require("zod");
13117
13658
 
13118
- // ../../flow-extension-runner/src/v2/params/files-options.ts
13659
+ // ../../flow-extension-runner/src/params/files-options.ts
13119
13660
  var import_zod = require("zod");
13120
13661
  var SCOPE_VALUES = ["WORKSPACE", "FLOW", "EXECUTION"];
13121
13662
  var scope = () => import_zod.z.enum(SCOPE_VALUES).label("Scope").describe("Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)").default("FLOW");
@@ -13171,7 +13712,7 @@ function filesDeleteOptions(include) {
13171
13712
  return group("filesDeleteOptions", FlowExtensionParamWidgetTypes.FILE_DELETE_OPTIONS, DELETE_FIELDS, include);
13172
13713
  }
13173
13714
 
13174
- // ../../flow-extension-runner/src/v2/params/zod.ts
13715
+ // ../../flow-extension-runner/src/params/zod.ts
13175
13716
  var extended = false;
13176
13717
  function extendPrototype() {
13177
13718
  if (extended) {
@@ -13202,6 +13743,9 @@ function extendPrototype() {
13202
13743
  }
13203
13744
  return this.meta({ frDictionary: binding });
13204
13745
  };
13746
+ proto.dateFormat = function dateFormat(pattern) {
13747
+ return this.meta({ frDateFormat: pattern });
13748
+ };
13205
13749
  proto.labels = function labels(byValue) {
13206
13750
  return this.meta({ frLabels: byValue });
13207
13751
  };
@@ -13239,7 +13783,7 @@ Object.defineProperties(namespace, {
13239
13783
  });
13240
13784
  var z = namespace;
13241
13785
 
13242
- // ../../flow-extension-runner/src/v2/params/json/values.ts
13786
+ // ../../flow-extension-runner/src/params/json/values.ts
13243
13787
  function toJsonValue(value) {
13244
13788
  if (typeof value === "bigint") {
13245
13789
  return { $bigint: value.toString() };
@@ -13256,7 +13800,7 @@ function toJsonValue(value) {
13256
13800
  return value;
13257
13801
  }
13258
13802
 
13259
- // ../../flow-extension-runner/src/v2/params/json/checks.ts
13803
+ // ../../flow-extension-runner/src/params/json/checks.ts
13260
13804
  var defOf = (check) => check?._zod?.def ?? {};
13261
13805
  function messageOf(source) {
13262
13806
  const { error } = source;
@@ -13335,10 +13879,10 @@ function encodeChecks(core) {
13335
13879
  return { checks, unsupported };
13336
13880
  }
13337
13881
 
13338
- // ../../flow-extension-runner/src/v2/params/json/types.ts
13882
+ // ../../flow-extension-runner/src/params/json/types.ts
13339
13883
  var SCHEMA_JSON_VERSION = 1;
13340
13884
 
13341
- // ../../flow-extension-runner/src/v2/params/json/decode.ts
13885
+ // ../../flow-extension-runner/src/params/json/decode.ts
13342
13886
  var FORMAT_FACTORIES = {
13343
13887
  url: z.url,
13344
13888
  email: z.email,
@@ -13368,7 +13912,7 @@ var FORMAT_FACTORIES = {
13368
13912
  duration: z.iso?.duration
13369
13913
  };
13370
13914
 
13371
- // ../../flow-extension-runner/src/v2/params/json/encode.ts
13915
+ // ../../flow-extension-runner/src/params/json/encode.ts
13372
13916
  var FIELD_TYPES = /* @__PURE__ */ new Set([
13373
13917
  "string",
13374
13918
  "number",
@@ -13500,6 +14044,7 @@ function encodeField(name, schema, seen = /* @__PURE__ */ new Set(), loaderId, s
13500
14044
  name,
13501
14045
  type,
13502
14046
  ...format ? { format } : {},
14047
+ ...format === "datetime" && core?._zod?.def?.local ? { local: true } : {},
13503
14048
  ...optional ? { optional: true } : {},
13504
14049
  ...nullable ? { nullable: true } : {},
13505
14050
  ...hasDefault ? { default: toJsonValue(defaultValue) } : {},
@@ -13535,7 +14080,7 @@ function encodeParams(scheme, options = {}) {
13535
14080
  };
13536
14081
  }
13537
14082
 
13538
- // ../../flow-extension-runner/src/v2/context/method-input.ts
14083
+ // ../../flow-extension-runner/src/context/method-input.ts
13539
14084
  var MethodInput = class {
13540
14085
  constructor(serviceId, methodName, data = {}) {
13541
14086
  this.serviceId = serviceId;
@@ -13593,7 +14138,7 @@ var MethodInput = class {
13593
14138
  }
13594
14139
  };
13595
14140
 
13596
- // ../../flow-extension-runner/src/v2/method.ts
14141
+ // ../../flow-extension-runner/src/method.ts
13597
14142
  var ExtensionMethod = class {
13598
14143
  constructor(extension) {
13599
14144
  this.extension = extension;
@@ -13622,7 +14167,7 @@ var ExtensionMethod = class {
13622
14167
  }
13623
14168
  };
13624
14169
 
13625
- // ../../flow-extension-runner/src/common/constants.ts
14170
+ // ../../flow-extension-runner/src/params/config-types.ts
13626
14171
  var ServiceConfigItemTypes = {
13627
14172
  STRING: "string",
13628
14173
  BOOL: "bool",
@@ -13631,7 +14176,7 @@ var ServiceConfigItemTypes = {
13631
14176
  TEXT: "text"
13632
14177
  };
13633
14178
 
13634
- // ../../flow-extension-runner/src/v2/model/field-mapper.ts
14179
+ // ../../flow-extension-runner/src/model/field-mapper.ts
13635
14180
  var descriptionOf = (schema) => inspect(schema).meta.description || "";
13636
14181
  var isRequired = (schema) => absenceOf(schema).absence === "required";
13637
14182
  var isParamGroup = (ins) => ins.coreType === "object" && !!ins.meta.frWidget;
@@ -13738,7 +14283,7 @@ function fieldToConfigItem(name, schema) {
13738
14283
  };
13739
14284
  }
13740
14285
 
13741
- // ../../flow-extension-runner/src/v2/model/method-model.ts
14286
+ // ../../flow-extension-runner/src/model/method-model.ts
13742
14287
  function opaqueParam(name, type = "OBJECT") {
13743
14288
  return { name, required: false, description: "", type };
13744
14289
  }
@@ -13760,7 +14305,7 @@ function argsFromParams(params) {
13760
14305
  return args;
13761
14306
  }
13762
14307
 
13763
- // ../../flow-extension-runner/src/v2/model/params-model.ts
14308
+ // ../../flow-extension-runner/src/model/params-model.ts
13764
14309
  function toBodyParams(params) {
13765
14310
  const scope2 = DictionaryScope.ROOT.enter(params.keys());
13766
14311
  return params.fields().map(([name, schema]) => fieldToParam(name, schema, { scope: scope2 }));
@@ -13779,7 +14324,7 @@ function toConfigItems(config) {
13779
14324
  return config.fields().map(([name, schema]) => fieldToConfigItem(name, schema));
13780
14325
  }
13781
14326
 
13782
- // ../../flow-extension-runner/src/v2/result.ts
14327
+ // ../../flow-extension-runner/src/result.ts
13783
14328
  function inferReturnType(value) {
13784
14329
  if (Array.isArray(value)) {
13785
14330
  return "LIST";
@@ -13847,7 +14392,7 @@ var ResultSpec = class _ResultSpec {
13847
14392
  }
13848
14393
  };
13849
14394
 
13850
- // ../../flow-extension-runner/src/v2/actions/action-method.ts
14395
+ // ../../flow-extension-runner/src/actions/action-method.ts
13851
14396
  var ActionMethod = class extends ExtensionMethod {
13852
14397
  constructor(extension, props) {
13853
14398
  super(extension);
@@ -13973,7 +14518,7 @@ var ActionMethod = class extends ExtensionMethod {
13973
14518
  }
13974
14519
  };
13975
14520
 
13976
- // ../../flow-extension-runner/src/common/context-files.ts
14521
+ // ../../flow-extension-runner/src/context/files.ts
13977
14522
  var import_backendless_request = __toESM(require_lib());
13978
14523
  var FileScope = {
13979
14524
  WORKSPACE: "WORKSPACE",
@@ -14106,7 +14651,7 @@ var FlowrunnerContextFiles = class {
14106
14651
  }
14107
14652
  };
14108
14653
 
14109
- // ../../flow-extension-runner/src/v2/context/logger.ts
14654
+ // ../../flow-extension-runner/src/context/logger.ts
14110
14655
  var defaultLogger = {
14111
14656
  debug: () => {
14112
14657
  },
@@ -14116,7 +14661,7 @@ var defaultLogger = {
14116
14661
  error: (...args) => console.error(...args)
14117
14662
  };
14118
14663
 
14119
- // ../../flow-extension-runner/src/v2/context/proxies.ts
14664
+ // ../../flow-extension-runner/src/context/proxies.ts
14120
14665
  function createThrowingProxy(feature, hint2) {
14121
14666
  const fail2 = () => {
14122
14667
  throw new FeatureNotEnabledError(feature, hint2);
@@ -14136,7 +14681,7 @@ function createThrowingProxy(feature, hint2) {
14136
14681
  );
14137
14682
  }
14138
14683
 
14139
- // ../../flow-extension-runner/src/v2/context/execution-context.ts
14684
+ // ../../flow-extension-runner/src/context/execution-context.ts
14140
14685
  var ExecutionContext = class _ExecutionContext {
14141
14686
  #extension;
14142
14687
  #options;
@@ -14152,8 +14697,23 @@ var ExecutionContext = class _ExecutionContext {
14152
14697
  get logger() {
14153
14698
  return this.#options.logger ?? defaultLogger;
14154
14699
  }
14700
+ get invocation() {
14701
+ return this.#options.invocation ?? {};
14702
+ }
14155
14703
  get config() {
14156
- this.#config ??= this.#extension.config.resolve(this.#options.configs);
14704
+ if (!this.#config) {
14705
+ const { result, notices } = collectNotices(() => this.#extension.config.resolve(this.#options.configs));
14706
+ for (const { message, field, value, converted } of notices) {
14707
+ this.logger.warn(`[flow-extension:${this.#extension.id}] config item "${field ?? "?"}": ${message}`, {
14708
+ serviceId: this.#extension.id,
14709
+ configItem: field,
14710
+ value,
14711
+ converted,
14712
+ ...this.invocation
14713
+ });
14714
+ }
14715
+ this.#config = result;
14716
+ }
14157
14717
  return this.#config;
14158
14718
  }
14159
14719
  // The header access token plus its deserialized composite payload — or a throwing proxy when the
@@ -14223,14 +14783,14 @@ var ExecutionContext = class _ExecutionContext {
14223
14783
  }
14224
14784
  };
14225
14785
 
14226
- // ../../flow-extension-runner/src/v2/dictionaries/payload-schema.ts
14786
+ // ../../flow-extension-runner/src/dictionaries/payload-schema.ts
14227
14787
  var DictionaryPayloadSchema = z.looseObject({
14228
14788
  search: z.string().optional(),
14229
14789
  cursor: z.union([z.string(), z.number()]).nullish(),
14230
14790
  criteria: z.record(z.string(), z.unknown()).optional()
14231
14791
  });
14232
14792
 
14233
- // ../../flow-extension-runner/src/v2/dictionaries/dictionary-method.ts
14793
+ // ../../flow-extension-runner/src/dictionaries/dictionary-method.ts
14234
14794
  var isBlank2 = (value) => value === void 0 || value === null || value === "";
14235
14795
  var DictionaryMethod = class extends ExtensionMethod {
14236
14796
  constructor(extension, props) {
@@ -14375,7 +14935,7 @@ var DictionaryMethod = class extends ExtensionMethod {
14375
14935
  };
14376
14936
  }
14377
14937
  // Describe the full payload shape so the method advertises a complete, labelled input scheme (nested
14378
- // props inline their own labels — mirroring the v1 jsdoc-parser layout).
14938
+ // props inline their own labels — mirroring the layout the v1 JSDoc parser established).
14379
14939
  #payloadParam() {
14380
14940
  const properties = [
14381
14941
  { name: "search", required: false, description: "Optional search string to filter results.", type: "STRING", label: "Search" },
@@ -14401,12 +14961,12 @@ var DictionaryMethod = class extends ExtensionMethod {
14401
14961
  }
14402
14962
  };
14403
14963
 
14404
- // ../../flow-extension-runner/src/v2/loaders/payload-schema.ts
14964
+ // ../../flow-extension-runner/src/loaders/payload-schema.ts
14405
14965
  var LoaderPayloadSchema = z.looseObject({
14406
14966
  criteria: z.record(z.string(), z.unknown()).optional()
14407
14967
  });
14408
14968
 
14409
- // ../../flow-extension-runner/src/v2/loaders/loader-method.ts
14969
+ // ../../flow-extension-runner/src/loaders/loader-method.ts
14410
14970
  var LoaderMethod = class extends ExtensionMethod {
14411
14971
  constructor(extension, owner) {
14412
14972
  super(extension);
@@ -14560,17 +15120,17 @@ var DynamicPropsLoaderMethod = class extends ParamsLoaderMethod {
14560
15120
  }
14561
15121
  };
14562
15122
 
14563
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
15123
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
14564
15124
  var import_crypto = __toESM(require("crypto"));
14565
15125
 
14566
- // ../../flow-extension-runner/src/v2/oauth/method-names.ts
15126
+ // ../../flow-extension-runner/src/oauth/method-names.ts
14567
15127
  var OAUTH_SYSTEM_METHODS = {
14568
15128
  CONNECTION_URL: "getOAuth2ConnectionURL",
14569
15129
  EXECUTE_CALLBACK: "executeCallback",
14570
15130
  REFRESH_TOKEN: "refreshToken"
14571
15131
  };
14572
15132
 
14573
- // ../../flow-extension-runner/src/v2/oauth/system-params.ts
15133
+ // ../../flow-extension-runner/src/oauth/system-params.ts
14574
15134
  var OAuthCallbackObjectSchema = z.looseObject({
14575
15135
  code: z.string().optional(),
14576
15136
  redirectURI: z.string().optional(),
@@ -14579,7 +15139,7 @@ var OAuthCallbackObjectSchema = z.looseObject({
14579
15139
  });
14580
15140
  var RefreshTokenSchema = z.string().min(1);
14581
15141
 
14582
- // ../../flow-extension-runner/src/v2/oauth/oauth2.ts
15142
+ // ../../flow-extension-runner/src/oauth/oauth2.ts
14583
15143
  var OAuth2 = class {
14584
15144
  constructor(extension, props) {
14585
15145
  this.extension = extension;
@@ -14724,10 +15284,10 @@ function userDataOf(token) {
14724
15284
  return token && typeof token === "object" ? token.userData : void 0;
14725
15285
  }
14726
15286
 
14727
- // ../../flow-extension-runner/src/v2/polling-triggers/method-names.ts
15287
+ // ../../flow-extension-runner/src/polling-triggers/method-names.ts
14728
15288
  var POLLING_SYSTEM_METHOD = "handleTriggerPollingForEvent";
14729
15289
 
14730
- // ../../flow-extension-runner/src/v2/polling-triggers/system-params.ts
15290
+ // ../../flow-extension-runner/src/polling-triggers/system-params.ts
14731
15291
  var PollingInvocationSchema = z.looseObject({
14732
15292
  eventName: z.string().min(1),
14733
15293
  // The trigger instance's configured params — validated against the trigger's own schema separately.
@@ -14737,7 +15297,7 @@ var PollingInvocationSchema = z.looseObject({
14737
15297
  connectionId: z.string().nullish()
14738
15298
  });
14739
15299
 
14740
- // ../../flow-extension-runner/src/v2/polling-triggers/polling-triggers.ts
15300
+ // ../../flow-extension-runner/src/polling-triggers/polling-triggers.ts
14741
15301
  var PollingTriggers = class {
14742
15302
  constructor(extension) {
14743
15303
  this.extension = extension;
@@ -14776,15 +15336,15 @@ var PollingTriggers = class {
14776
15336
  }
14777
15337
  };
14778
15338
 
14779
- // ../../flow-extension-runner/src/v2/path.ts
14780
- function getPath(source, path2) {
14781
- return path2.split(".").reduce(
15339
+ // ../../flow-extension-runner/src/path.ts
15340
+ function getPath(source, path) {
15341
+ return path.split(".").reduce(
14782
15342
  (acc, key) => acc == null ? acc : acc[key],
14783
15343
  source
14784
15344
  );
14785
15345
  }
14786
15346
 
14787
- // ../../flow-extension-runner/src/v2/polling-triggers/mechanisms.ts
15347
+ // ../../flow-extension-runner/src/polling-triggers/mechanisms.ts
14788
15348
  var PollingMechanism = class {
14789
15349
  /**
14790
15350
  * Pick the strategy an author declared, rejecting the combinations that cannot work. Runs at REGISTRATION
@@ -14918,7 +15478,7 @@ var WatermarkMechanism = class extends FetchingMechanism {
14918
15478
  }
14919
15479
  };
14920
15480
 
14921
- // ../../flow-extension-runner/src/v2/polling-triggers/trigger-method.ts
15481
+ // ../../flow-extension-runner/src/polling-triggers/trigger-method.ts
14922
15482
  var PollingTriggerMethod = class extends ExtensionMethod {
14923
15483
  constructor(extension, props) {
14924
15484
  super(extension);
@@ -14988,7 +15548,7 @@ var PollingTriggerMethod = class extends ExtensionMethod {
14988
15548
  }
14989
15549
  };
14990
15550
 
14991
- // ../../flow-extension-runner/src/v2/realtime-triggers/method-names.ts
15551
+ // ../../flow-extension-runner/src/realtime-triggers/method-names.ts
14992
15552
  var REALTIME_SYSTEM_METHODS = {
14993
15553
  UPSERT: "handleTriggerUpsertWebhook",
14994
15554
  RESOLVE: "handleTriggerResolveEvents",
@@ -14997,7 +15557,7 @@ var REALTIME_SYSTEM_METHODS = {
14997
15557
  REFRESH: "handleTriggerRefreshWebhook"
14998
15558
  };
14999
15559
 
15000
- // ../../flow-extension-runner/src/v2/realtime-triggers/system-params.ts
15560
+ // ../../flow-extension-runner/src/realtime-triggers/system-params.ts
15001
15561
  var anyRecord = () => z.record(z.string(), z.unknown());
15002
15562
  var SubscriptionEventSchema = z.looseObject({
15003
15563
  name: z.string().min(1),
@@ -15033,7 +15593,7 @@ var RealtimeSelectInvocationSchema = z.looseObject({
15033
15593
  })).default([])
15034
15594
  });
15035
15595
 
15036
- // ../../flow-extension-runner/src/v2/realtime-triggers/verify.ts
15596
+ // ../../flow-extension-runner/src/realtime-triggers/verify.ts
15037
15597
  function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
15038
15598
  const secret = verify.secret(config, { webhookData });
15039
15599
  if (!secret) {
@@ -15056,7 +15616,7 @@ function verifyDeclarative(verify, rawBody, headers, config, webhookData) {
15056
15616
  return true;
15057
15617
  }
15058
15618
 
15059
- // ../../flow-extension-runner/src/v2/realtime-triggers/realtime-setup.ts
15619
+ // ../../flow-extension-runner/src/realtime-triggers/realtime-setup.ts
15060
15620
  function readExtract(extract, body) {
15061
15621
  if (typeof extract === "function") {
15062
15622
  return extract({ requestBody: body });
@@ -15352,7 +15912,7 @@ var RealtimeSetup = class {
15352
15912
  }
15353
15913
  };
15354
15914
 
15355
- // ../../flow-extension-runner/src/v2/realtime-triggers/trigger-method.ts
15915
+ // ../../flow-extension-runner/src/realtime-triggers/trigger-method.ts
15356
15916
  function isFilled(value) {
15357
15917
  return value != null && value !== "";
15358
15918
  }
@@ -15448,12 +16008,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
15448
16008
  if (typeof match === "function") {
15449
16009
  return !!await match({ params, providerEventData, webhookData });
15450
16010
  }
15451
- for (const [paramKey, path2] of Object.entries(match)) {
16011
+ for (const [paramKey, path] of Object.entries(match)) {
15452
16012
  const paramValue = params[paramKey];
15453
16013
  if (!isFilled(paramValue)) {
15454
16014
  continue;
15455
16015
  }
15456
- if (`${paramValue}` !== `${getPath(providerEventData, path2)}`) {
16016
+ if (`${paramValue}` !== `${getPath(providerEventData, path)}`) {
15457
16017
  return false;
15458
16018
  }
15459
16019
  }
@@ -15489,7 +16049,7 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
15489
16049
  }
15490
16050
  };
15491
16051
 
15492
- // ../../flow-extension-runner/src/v2/system-method.ts
16052
+ // ../../flow-extension-runner/src/system-method.ts
15493
16053
  var SystemMethod = class extends ExtensionMethod {
15494
16054
  constructor(extension, spec) {
15495
16055
  super(extension);
@@ -15546,7 +16106,7 @@ var SystemMethod = class extends ExtensionMethod {
15546
16106
  }
15547
16107
  };
15548
16108
 
15549
- // ../../flow-extension-runner/src/v2/extension.ts
16109
+ // ../../flow-extension-runner/src/extension.ts
15550
16110
  var Extension = class {
15551
16111
  #props;
15552
16112
  #config;
@@ -15667,7 +16227,23 @@ var Extension = class {
15667
16227
  // generated loader, SYSTEM seam — arrives here through the same three steps.
15668
16228
  async run(methodName, methodData, ctx) {
15669
16229
  const method = this.getMethod(methodName);
15670
- return method.execute(method.validate(methodData ?? {}), ctx);
16230
+ const { result: input, notices } = collectNotices(() => method.validate(methodData ?? {}));
16231
+ this.#reportNotices(notices, methodName, ctx);
16232
+ return method.execute(input, ctx);
16233
+ }
16234
+ // One warning per value the pipeline accepted only under a temporary rule — today a timestamp converted for
16235
+ // a date-string field (FR-3920 lenient period). Named well enough to find the flow still holding one.
16236
+ #reportNotices(notices, methodName, ctx) {
16237
+ for (const { message, field, value, converted } of notices) {
16238
+ ctx.logger.warn(`[flow-extension:${this.id}] ${methodName}: param "${field ?? "?"}": ${message}`, {
16239
+ serviceId: this.id,
16240
+ method: methodName,
16241
+ param: field,
16242
+ value,
16243
+ converted,
16244
+ ...ctx.invocation
16245
+ });
16246
+ }
15671
16247
  }
15672
16248
  // ── output model ────────────────────────────────────────────────────────────
15673
16249
  toConfigItems() {
@@ -15686,8 +16262,8 @@ var Extension = class {
15686
16262
  };
15687
16263
  }
15688
16264
  /**
15689
- * The published model — the v2 analogue of jsdoc-parser's `parseJsDocToServiceJson`, and the same
15690
- * `{ serviceInfo, methodsMap }` shape the console consumes for a v1 service.
16265
+ * The published model — the `{ serviceInfo, methodsMap }` shape the console consumes, the same one the
16266
+ * removed v1 JSDoc parser produced.
15691
16267
  *
15692
16268
  * Every method describes itself, so this is one pass with no per-kind branches: what a service publishes
15693
16269
  * is exactly what it registered.
@@ -15700,8 +16276,6 @@ var Extension = class {
15700
16276
  }
15701
16277
  }
15702
16278
  return {
15703
- runnerVersion: "v2",
15704
- //TODO: temp
15705
16279
  serviceInfo: this.toServiceInfo(),
15706
16280
  methodsMap,
15707
16281
  configSchema: encodeParams(this.config.scheme)
@@ -15741,7 +16315,7 @@ var Extension = class {
15741
16315
  }
15742
16316
  };
15743
16317
 
15744
- // ../../flow-extension-runner/src/v2/registry.ts
16318
+ // ../../flow-extension-runner/src/registry.ts
15745
16319
  var ExtensionRegistry = class {
15746
16320
  #extensions = /* @__PURE__ */ new Map();
15747
16321
  register(extension) {
@@ -15761,15 +16335,19 @@ var ExtensionRegistry = class {
15761
16335
  * which imports it.
15762
16336
  */
15763
16337
  load(id, entryPointPath) {
15764
- if (!this.get(id)) {
15765
- require(entryPointPath);
15766
- }
15767
- const extension = this.get(id);
16338
+ const extension = this.tryLoad(id, entryPointPath);
15768
16339
  if (!extension) {
15769
16340
  throw new ExtensionNotRegisteredError(id, entryPointPath);
15770
16341
  }
15771
16342
  return extension;
15772
16343
  }
16344
+ /** As `load`, but `undefined` instead of throwing when the module registers no extension under `id`. */
16345
+ tryLoad(id, entryPointPath) {
16346
+ if (!this.get(id)) {
16347
+ require(entryPointPath);
16348
+ }
16349
+ return this.get(id);
16350
+ }
15773
16351
  // Test-only: clear the registry between isolated cases.
15774
16352
  reset() {
15775
16353
  this.#extensions.clear();
@@ -15783,7 +16361,7 @@ function resetRegistry() {
15783
16361
  registry.reset();
15784
16362
  }
15785
16363
 
15786
- // ../../flow-extension-runner/src/v2/create-extension.ts
16364
+ // ../../flow-extension-runner/src/create-extension.ts
15787
16365
  function createExtension(props) {
15788
16366
  const extension = new Extension(props);
15789
16367
  const api = {
@@ -15811,7 +16389,7 @@ function createExtension(props) {
15811
16389
  return api;
15812
16390
  }
15813
16391
 
15814
- // ../../flow-extension-runner/src/v2/crypto.ts
16392
+ // ../../flow-extension-runner/src/crypto.ts
15815
16393
  var import_crypto2 = __toESM(require("crypto"));
15816
16394
  var crypto2 = {
15817
16395
  hmac(algo, key, data, encoding = "hex") {
@@ -15847,179 +16425,19 @@ var flowrunnerRuntime = {
15847
16425
  z,
15848
16426
  crypto: crypto2,
15849
16427
  createExtension,
15850
- getExtension,
15851
- ServerCode: null
16428
+ getExtension
15852
16429
  };
15853
16430
  global.Flowrunner = flowrunnerRuntime;
15854
16431
 
15855
- // ../../flow-extension-runner/src/common/config.ts
15856
- var ConfigValueAdapters = {
15857
- [ServiceConfigItemTypes.BOOL]: {
15858
- deserialize: (value) => typeof value === "string" ? value === "true" : !!value,
15859
- isEmpty: (value) => typeof value !== "boolean"
15860
- },
15861
- default: {
15862
- deserialize: (value) => value,
15863
- isEmpty: (value) => !value
15864
- }
15865
- };
15866
- function prepareServiceConfig(configItems, configs = {}) {
15867
- const targetConfig = {};
15868
- for (const configItem of configItems) {
15869
- const configName = configItem.name;
15870
- const configType = configItem.type;
15871
- const adapter = ConfigValueAdapters[configType] || ConfigValueAdapters.default;
15872
- targetConfig[configName] = adapter.deserialize(configs[configName]);
15873
- if (!adapter.isEmpty(targetConfig[configName])) {
15874
- continue;
15875
- }
15876
- const defaultConfig = adapter.deserialize(configItem.defaultValue);
15877
- if (!adapter.isEmpty(defaultConfig)) {
15878
- targetConfig[configName] = defaultConfig;
15879
- }
15880
- }
15881
- return targetConfig;
15882
- }
15883
-
15884
- // ../../flow-extension-runner/src/common/context.ts
15885
- var FlowrunnerContext = class {
15886
- constructor(options) {
15887
- this.Files = new FlowrunnerContextFiles(options);
15888
- }
15889
- };
15890
-
15891
- // ../../flow-extension-runner/src/v1/config.ts
15892
- function normalizeConfigItems(sourceConfigItems) {
15893
- return sourceConfigItems?.map((item) => ({
15894
- name: item.name,
15895
- type: item.type || ServiceConfigItemTypes.STRING,
15896
- shared: !!item.shared,
15897
- required: !!item.required,
15898
- description: item.description || item.hint || "",
15899
- label: item.label || item.displayName || item.name,
15900
- defaultValue: item.defaultValue,
15901
- options: item.options || []
15902
- })) || [];
15903
- }
15904
-
15905
- // ../../flow-extension-runner/src/v1/constants.ts
15906
- var OAUTH_ACCESS_TOKEN_HEADER = "oauth-access-token";
15907
-
15908
- // ../../flow-extension-runner/src/v1/namespace.ts
15909
- var services = /* @__PURE__ */ new Map();
15910
- function createFlowrunnerSandboxV1(serviceId, cb) {
15911
- global.Flowrunner.ServerCode = {
15912
- addService(ServiceClass, sourceConfigItems) {
15913
- services.set(serviceId, {
15914
- ServiceClass,
15915
- configItems: normalizeConfigItems(sourceConfigItems)
15916
- });
15917
- },
15918
- ConfigItems: {
15919
- TYPES: ServiceConfigItemTypes
15920
- }
15921
- };
15922
- try {
15923
- cb();
15924
- } finally {
15925
- global.Flowrunner.ServerCode = null;
15926
- }
15927
- return services.get(serviceId);
15928
- }
15929
-
15930
- // ../../flow-extension-runner/src/v1/service.ts
15931
- function requireService(serviceId, serviceEntryPointPath) {
15932
- const registered = createFlowrunnerSandboxV1(serviceId, () => {
15933
- require(serviceEntryPointPath);
15934
- });
15935
- if (!registered?.ServiceClass) {
15936
- throw new Error(`There is no registered ServiceClass serviceEntryPointPath="${serviceEntryPointPath}"`);
15937
- }
15938
- return registered;
15939
- }
15940
- function createRuntimeContext(data) {
15941
- const { serverURL, appId, apiKey, runtimeKey, flowId, executionId, accessToken, retrieveNewS3Token } = data;
15942
- const filesOptions = {
15943
- serverURL,
15944
- appId,
15945
- apiKey,
15946
- //
15947
- runtimeKey,
15948
- //
15949
- flowId,
15950
- executionId,
15951
- //
15952
- retrieveNewS3Token
15953
- };
15954
- const flowrunnerContext = data.createFiles ? { Files: data.createFiles(filesOptions) } : new FlowrunnerContext(filesOptions);
15955
- const httpHeaders = {};
15956
- if (accessToken) {
15957
- httpHeaders[OAUTH_ACCESS_TOKEN_HEADER] = accessToken;
15958
- }
15959
- return {
15960
- httpHeaders,
15961
- flowrunner: flowrunnerContext
15962
- };
15963
- }
15964
- function initServiceInstance(serviceId, serviceEntryPointPath, configs, context) {
15965
- const { ServiceClass, configItems } = requireService(serviceId, serviceEntryPointPath);
15966
- const config = prepareServiceConfig(configItems, configs);
15967
- const service = new ServiceClass(config, context);
15968
- Object.assign(service, {
15969
- config,
15970
- flowrunner: context.flowrunner,
15971
- request: {
15972
- context,
15973
- headers: context.httpHeaders
15974
- }
15975
- });
15976
- return service;
15977
- }
16432
+ // ../../flow-extension-runner/src/index.ts
15978
16433
  function getServiceConfigs(serviceId, serviceEntryPointPath) {
15979
- const { configItems } = requireService(serviceId, serviceEntryPointPath);
15980
- return configItems;
15981
- }
15982
- async function runServiceMethod(data) {
15983
- const {
15984
- serviceId,
15985
- serviceEntryPointPath,
15986
- configs,
15987
- methodName,
15988
- methodArgs,
15989
- retrieveNewS3Token,
15990
- createFiles
15991
- } = data;
15992
- const { accessToken, runtimeKey, appId, apiKey, serverURL, flowId, executionId } = data.executionContext;
15993
- const context = createRuntimeContext({
15994
- serverURL,
15995
- appId,
15996
- apiKey,
15997
- //
15998
- runtimeKey,
15999
- //
16000
- flowId,
16001
- executionId,
16002
- //
16003
- accessToken,
16004
- //
16005
- retrieveNewS3Token,
16006
- //
16007
- createFiles
16008
- });
16009
- const serviceInstance = initServiceInstance(serviceId, serviceEntryPointPath, configs, context);
16010
- const invoke = serviceInstance[methodName];
16011
- return invoke.apply(serviceInstance, methodArgs || []);
16012
- }
16013
-
16014
- // ../../flow-extension-runner/src/v2/index.ts
16015
- function getServiceConfigs2(serviceId, serviceEntryPointPath) {
16016
16434
  return registry.load(serviceId, serviceEntryPointPath).toConfigItems();
16017
16435
  }
16018
16436
  function buildServiceDefinition(serviceId, serviceEntryPointPath) {
16019
- return registry.load(serviceId, serviceEntryPointPath).toDefinition();
16437
+ return registry.tryLoad(serviceId, serviceEntryPointPath)?.toDefinition() ?? null;
16020
16438
  }
16021
- var defaultCreateFiles = (options) => new FlowrunnerContext(options).Files;
16022
- async function runServiceMethod2(data) {
16439
+ var defaultCreateFiles = (options) => new FlowrunnerContextFiles(options);
16440
+ async function runServiceMethod(data) {
16023
16441
  const { serviceId, serviceEntryPointPath, executionContext, retrieveNewS3Token, methodName } = data;
16024
16442
  const methodData = data.methodData || {};
16025
16443
  const { serverURL, appId, apiKey, runtimeKey, flowId, executionId, accessToken } = executionContext;
@@ -16034,545 +16452,25 @@ async function runServiceMethod2(data) {
16034
16452
  retrieveNewS3Token
16035
16453
  };
16036
16454
  const files = extension.props.usesFileStorage ? (data.createFiles ?? defaultCreateFiles)(filesOptions) : void 0;
16037
- const ctx = extension.createContext({ configs: data.configs, accessToken, logger: data.logger, files });
16038
- return extension.run(methodName, methodData, ctx);
16039
- }
16040
-
16041
- // ../../flow-extension-runner/src/index.ts
16042
- function detectVersion(serviceId, serviceEntryPointPath) {
16043
- createFlowrunnerSandboxV1(serviceId, () => {
16044
- require(serviceEntryPointPath);
16455
+ const ctx = extension.createContext({
16456
+ configs: data.configs,
16457
+ accessToken,
16458
+ logger: data.logger,
16459
+ files,
16460
+ invocation: { flowId, executionId }
16045
16461
  });
16046
- return getExtension(serviceId) ? "v2" : "v1";
16047
- }
16048
- function getServiceConfigs3(serviceId, serviceEntryPointPath) {
16049
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? getServiceConfigs2(serviceId, serviceEntryPointPath) : getServiceConfigs(serviceId, serviceEntryPointPath);
16050
- }
16051
- async function runServiceMethod3(data) {
16052
- const frameworkVersion = detectVersion(data.serviceId, data.serviceEntryPointPath);
16053
- const result = frameworkVersion === "v2" ? await runServiceMethod2(data) : await runServiceMethod(data);
16054
- return result;
16055
- }
16056
- function buildServiceDefinition2(serviceId, serviceEntryPointPath) {
16057
- return detectVersion(serviceId, serviceEntryPointPath) === "v2" ? buildServiceDefinition(serviceId, serviceEntryPointPath) : null;
16058
- }
16059
-
16060
- // ../../jsdoc-parser/src/custom-type-defs/files.ts
16061
- var SCOPE_FIELD = {
16062
- name: "scope",
16063
- type: "String",
16064
- required: false,
16065
- label: "Scope",
16066
- description: "Storage scope: WORKSPACE (shared across flows), FLOW (this flow only), EXECUTION (this run only)",
16067
- uiComponent: { type: "DROPDOWN", options: { values: ["WORKSPACE", "FLOW", "EXECUTION"] } },
16068
- defaultValue: "FLOW"
16069
- };
16070
- var filesTypeDefs = {
16071
- FilesUploadOptions: [
16072
- SCOPE_FIELD,
16073
- {
16074
- name: "filename",
16075
- type: "String",
16076
- required: false,
16077
- label: "Filename",
16078
- description: "Custom filename (defaults to the original name if omitted)",
16079
- uiComponent: { type: "SINGLE_LINE_TEXT" }
16080
- },
16081
- {
16082
- name: "ttl",
16083
- type: "Number",
16084
- required: false,
16085
- label: "URL TTL (seconds)",
16086
- description: "How long the download URL remains valid",
16087
- uiComponent: { type: "NUMERIC" }
16088
- },
16089
- {
16090
- name: "objectTtl",
16091
- type: "Number",
16092
- required: false,
16093
- label: "File TTL (seconds)",
16094
- description: "How long the file is kept in storage (omit for permanent storage)",
16095
- uiComponent: { type: "NUMERIC" }
16096
- },
16097
- {
16098
- name: "overwrite",
16099
- type: "Boolean",
16100
- required: false,
16101
- label: "Overwrite existing",
16102
- description: "Replace the file if one with the same name already exists",
16103
- uiComponent: { type: "TOGGLE" }
16104
- },
16105
- {
16106
- name: "generateUrl",
16107
- type: "Boolean",
16108
- required: false,
16109
- label: "Generate download URL",
16110
- description: "Include a pre-signed download URL in the response",
16111
- uiComponent: { type: "TOGGLE" },
16112
- defaultValue: true
16113
- }
16114
- ],
16115
- FilesListOptions: [
16116
- SCOPE_FIELD,
16117
- {
16118
- name: "limit",
16119
- type: "Number",
16120
- required: false,
16121
- label: "Limit",
16122
- description: "Maximum number of files to return",
16123
- uiComponent: { type: "NUMERIC" }
16124
- },
16125
- {
16126
- name: "ttl",
16127
- type: "Number",
16128
- required: false,
16129
- label: "URL TTL (seconds)",
16130
- description: "How long the download URLs remain valid",
16131
- uiComponent: { type: "NUMERIC" }
16132
- },
16133
- {
16134
- name: "generateUrl",
16135
- type: "Boolean",
16136
- required: false,
16137
- label: "Generate download URLs",
16138
- description: "Include pre-signed download URLs in the response",
16139
- uiComponent: { type: "TOGGLE" },
16140
- defaultValue: true
16141
- },
16142
- {
16143
- name: "cursor",
16144
- type: "String",
16145
- required: false,
16146
- label: "Cursor",
16147
- description: "Pagination cursor from a previous response",
16148
- uiComponent: { type: "SINGLE_LINE_TEXT" }
16149
- }
16150
- ],
16151
- FilesGetOptions: [
16152
- SCOPE_FIELD,
16153
- {
16154
- name: "ttl",
16155
- type: "Number",
16156
- required: false,
16157
- label: "URL TTL (seconds)",
16158
- description: "How long the download URL remains valid",
16159
- uiComponent: { type: "NUMERIC" }
16160
- },
16161
- {
16162
- name: "generateUrl",
16163
- type: "Boolean",
16164
- required: false,
16165
- label: "Generate download URL",
16166
- description: "Include a pre-signed download URL in the response",
16167
- uiComponent: { type: "TOGGLE" },
16168
- defaultValue: true
16169
- }
16170
- ],
16171
- FilesDeleteOptions: [
16172
- SCOPE_FIELD
16173
- ]
16174
- };
16175
-
16176
- // ../../jsdoc-parser/src/lib.ts
16177
- var import_fs = __toESM(require("fs"));
16178
- var import_path4 = __toESM(require("path"));
16179
- function resolveJSDocPath() {
16180
- const jsDocHolders = require.resolve.paths("jsdoc/lib") || [];
16181
- const jsDocPaths = jsDocHolders.map((p) => import_path4.default.join(p, "jsdoc/lib"));
16182
- for (let i = 0; i < jsDocPaths.length; i++) {
16183
- if (import_fs.default.existsSync(jsDocPaths[i])) {
16184
- return jsDocPaths[i];
16185
- }
16186
- }
16187
- throw new Error("Can not resolve path to JSDoc module.");
16188
- }
16189
- var jsdocPath = resolveJSDocPath();
16190
- var jsdocModulePath = (mod) => import_path4.default.join(jsdocPath, ...mod.split("/"));
16191
- var _jsdocRequire;
16192
- var jsdocRequire = (modulePath) => {
16193
- if (!_jsdocRequire) {
16194
- _jsdocRequire = require("requizzle")({
16195
- infect: true,
16196
- requirePaths: { before: [jsdocPath] }
16197
- });
16198
- const Config = _jsdocRequire(jsdocModulePath("jsdoc/config"));
16199
- const env = _jsdocRequire(jsdocModulePath("jsdoc/env"));
16200
- env.conf = new Config().get();
16201
- }
16202
- return _jsdocRequire(jsdocModulePath(modulePath));
16203
- };
16204
- function parseJSDoc(filePath) {
16205
- const parser = jsdocRequire("jsdoc/src/parser").createParser();
16206
- const handlers = jsdocRequire("jsdoc/src/handlers");
16207
- handlers.attachTo(parser);
16208
- return parser.parse([filePath]);
16462
+ return extension.run(methodName, methodData, ctx);
16209
16463
  }
16210
16464
 
16211
- // ../../jsdoc-parser/src/index.ts
16212
- var customTypeDef = {
16213
- FilesUploadOptions: filesTypeDefs.FilesUploadOptions,
16214
- FilesListOptions: filesTypeDefs.FilesListOptions,
16215
- FilesGetOptions: filesTypeDefs.FilesGetOptions,
16216
- FilesDeleteOptions: filesTypeDefs.FilesDeleteOptions
16217
- };
16218
- function findServiceClassName(doclets) {
16219
- const withIntegration = doclets.find((d) => {
16220
- if (d.kind === "class" && d.tags) {
16221
- return d.tags.find((t) => t.originalTitle === "integrationName");
16222
- }
16223
- });
16224
- if (withIntegration) {
16225
- return withIntegration.name;
16226
- }
16227
- return null;
16228
- }
16229
- function parseJSDocs(filePath) {
16230
- const doclets = parseJSDoc(filePath);
16231
- const className = findServiceClassName(doclets);
16232
- let serviceInfo = null;
16233
- const methods = [];
16234
- const typedefsMap = {};
16235
- doclets.forEach((d) => {
16236
- if (d.kind === "class" && d.name === className) {
16237
- serviceInfo = composeServiceInfo(d);
16238
- } else if (d.kind === "function" && d.memberof === className && d.scope === "instance") {
16239
- methods.push(composeMethod(d));
16240
- } else if (d.kind === "typedef") {
16241
- const typedefParams = collectTypedef(d);
16242
- if (typedefParams) {
16243
- typedefsMap[d.name] = typedefParams;
16244
- }
16245
- }
16246
- });
16247
- return {
16248
- serviceInfo,
16249
- methods,
16250
- // Extension-defined typedefs override built-ins so authors can customise if needed
16251
- typedefsMap: { ...customTypeDef, ...typedefsMap }
16252
- };
16253
- }
16254
- var ServiceInfoTagsProcessors = {
16255
- integrationName: (serviceInfo, tagValue) => {
16256
- serviceInfo.integrationName = tagValue || void 0;
16257
- },
16258
- integrationIcon: (serviceInfo, tagValue) => {
16259
- serviceInfo.integrationIcon = tagValue || null;
16260
- },
16261
- requireOAuth: (serviceInfo) => {
16262
- serviceInfo.requireOAuth = true;
16263
- },
16264
- integrationTriggersScope: (serviceInfo, tagValue) => {
16265
- serviceInfo.integrationTriggersScope = tagValue || null;
16266
- }
16267
- };
16268
- function composeServiceInfo(d) {
16269
- const serviceInfo = {
16270
- serviceClassName: d.name,
16271
- integrationName: d.name,
16272
- integrationIcon: null,
16273
- requireOAuth: void 0,
16274
- integrationTriggersScope: null
16275
- };
16276
- iterateTags(d.tags, (tagName, tagValue) => {
16277
- if (ServiceInfoTagsProcessors[tagName]) {
16278
- ServiceInfoTagsProcessors[tagName](serviceInfo, tagValue);
16279
- }
16280
- });
16281
- return serviceInfo;
16282
- }
16283
- function iterateTags(tags, cb) {
16284
- if (tags) {
16285
- tags.forEach((tag) => {
16286
- const title = tag.originalTitle;
16287
- const value = tag.value || tag.text || "";
16288
- cb(title, value, tag);
16289
- });
16290
- }
16291
- }
16292
- var MethodTagsProcessors = {
16293
- paramDef: (methodInfo, tagValue) => {
16294
- if (tagValue) {
16295
- const parsedValue = parseJSON(tagValue);
16296
- if (parsedValue) {
16297
- methodInfo.paramDefs.push(parsedValue);
16298
- }
16299
- }
16300
- },
16301
- route: (methodInfo, tagValue) => {
16302
- if (tagValue) {
16303
- methodInfo.route = tagValue;
16304
- }
16305
- },
16306
- registerAs: (methodInfo, tagValue) => {
16307
- if (tagValue) {
16308
- methodInfo.registerAs = tagValue;
16309
- }
16310
- },
16311
- operationName: (methodInfo, tagValue) => {
16312
- if (tagValue) {
16313
- methodInfo.operationName = tagValue;
16314
- }
16315
- },
16316
- customIcon: (methodInfo, tagValue) => {
16317
- if (tagValue) {
16318
- methodInfo.customIcon = tagValue;
16319
- }
16320
- },
16321
- category: (methodInfo, tagValue) => {
16322
- if (tagValue) {
16323
- methodInfo.category = tagValue;
16324
- }
16325
- },
16326
- description: (methodInfo, tagValue) => {
16327
- if (tagValue) {
16328
- methodInfo.description = tagValue;
16329
- }
16330
- },
16331
- appearanceColor: (methodInfo, tagValue) => {
16332
- if (tagValue) {
16333
- const colors = extractColors(tagValue);
16334
- methodInfo.colorStart = colors.colorStart;
16335
- methodInfo.colorEnd = colors.colorEnd;
16336
- }
16337
- },
16338
- private: (methodInfo) => {
16339
- methodInfo.private = true;
16340
- },
16341
- sampleResult: (methodInfo, tagValue) => {
16342
- if (tagValue) {
16343
- methodInfo.sampleResult = parseJSON(tagValue);
16344
- }
16345
- },
16346
- sampleResultLoader: (methodInfo, tagValue) => {
16347
- if (tagValue) {
16348
- methodInfo.sampleResultLoader = parseJSON(tagValue);
16349
- }
16350
- }
16351
- };
16352
- function composeMethod(m) {
16353
- const methodInfo = {
16354
- name: m.name,
16355
- description: m.description || "",
16356
- returnType: mapReturnType(m.returns?.[0].type?.names?.[0]),
16357
- registerAs: "",
16358
- colorStart: "",
16359
- colorEnd: "",
16360
- private: m.access === "private",
16361
- operationName: m.name,
16362
- customIcon: "",
16363
- category: "",
16364
- sampleResult: null,
16365
- sampleResultLoader: null,
16366
- routeStr: "",
16367
- paramDefs: []
16368
- };
16369
- if (m.params) {
16370
- m.params.forEach((p) => {
16371
- methodInfo.paramDefs.push({
16372
- name: p.name,
16373
- type: p.type?.names?.[0] || "String",
16374
- required: !p.optional
16375
- });
16376
- });
16377
- }
16378
- iterateTags(m.tags, (tagName, tagValue) => {
16379
- if (MethodTagsProcessors[tagName]) {
16380
- MethodTagsProcessors[tagName](methodInfo, tagValue);
16381
- }
16382
- });
16383
- return methodInfo;
16384
- }
16385
- var PRIMITIVES = ["String", "Object", "Boolean", "Number"];
16386
- var ParamTypesMap = {
16387
- String: "STRING",
16388
- Object: "OBJECT",
16389
- Boolean: "BOOLEAN",
16390
- Number: "NUMBER"
16391
- };
16392
- function mapParamType(type) {
16393
- if (!type) {
16394
- return "STRING";
16395
- }
16396
- if (type.startsWith("Array")) {
16397
- return "LIST";
16398
- }
16399
- return ParamTypesMap[type] || "STRING";
16400
- }
16401
- function mapReturnType(type) {
16402
- if (type) {
16403
- if (type === "Array" || type.startsWith("Array.") || type.startsWith("Array<")) return "LIST";
16404
- if (type === "Object") return "OBJECT";
16405
- if (type === "String") return "STRING";
16406
- }
16407
- return "VOID";
16408
- }
16409
- function collectTypedef(d) {
16410
- const defs = [];
16411
- iterateTags(d.tags, (title, value) => {
16412
- if (title === "paramDef") {
16413
- const parsedValue = parseJSON(value);
16414
- if (parsedValue) {
16415
- defs.push(parsedValue);
16416
- }
16417
- }
16418
- });
16419
- if (d.properties) {
16420
- d.properties.forEach((property) => {
16421
- const type = property?.type?.names?.[0];
16422
- defs.push({
16423
- name: property.name,
16424
- required: !property.optional,
16425
- description: property.description,
16426
- type
16427
- });
16428
- });
16429
- }
16430
- if (defs.length > 0) {
16431
- return defs;
16432
- }
16433
- }
16434
- function buildParam(paramDef, typedefsMap, nested = false) {
16435
- const isCustomType = !nested && paramDef.type && !PRIMITIVES.includes(paramDef.type) && !paramDef.type.startsWith("Array");
16436
- let properties;
16437
- if (isCustomType && typedefsMap[paramDef.type]) {
16438
- let subDefs = typedefsMap[paramDef.type];
16439
- if (paramDef.include?.length) {
16440
- const includeSet = new Set(paramDef.include);
16441
- subDefs = subDefs.filter((sd) => includeSet.has(sd.name));
16442
- }
16443
- if (subDefs.length > 0) {
16444
- properties = subDefs.map((sp) => buildParam(sp, typedefsMap, true));
16445
- }
16446
- }
16447
- const param = {
16448
- name: paramDef.name,
16449
- required: paramDef.required || false,
16450
- description: paramDef.description || "",
16451
- type: isCustomType ? "OBJECT" : mapParamType(paramDef.type)
16452
- };
16453
- if (nested) {
16454
- if (paramDef.label !== void 0) {
16455
- param.label = paramDef.label;
16456
- }
16457
- if (paramDef.uiComponent !== void 0) {
16458
- param.uiComponent = paramDef.uiComponent;
16459
- }
16460
- if (paramDef.dependsOn !== void 0) {
16461
- param.dependsOn = paramDef.dependsOn;
16462
- }
16463
- if (paramDef.dictionary !== void 0) {
16464
- param.dictionary = paramDef.dictionary;
16465
- }
16466
- if (paramDef.defaultValue !== void 0) {
16467
- param.defaultValue = paramDef.defaultValue;
16468
- }
16469
- }
16470
- if (properties && properties.length > 0) {
16471
- param.properties = properties;
16472
- }
16473
- if (param.type === "LIST") {
16474
- param.items = { type: "OBJECT" };
16475
- }
16476
- return param;
16477
- }
16478
- function buildMetaInfoArgs(paramDefs, typedefsMap) {
16479
- const args = {};
16480
- for (const pd of paramDefs) {
16481
- const isCustomType = pd.type && !PRIMITIVES.includes(pd.type) && !pd.type.startsWith("Array");
16482
- if (isCustomType && typedefsMap[pd.type]) {
16483
- const entry2 = {};
16484
- if (pd.label) entry2.label = pd.label;
16485
- args[pd.name] = entry2;
16486
- continue;
16487
- }
16488
- const entry = {};
16489
- if (pd.label) entry.label = pd.label;
16490
- if (pd.dictionary) entry.dictionary = pd.dictionary;
16491
- if (pd.dependsOn && pd.dependsOn.length > 0) entry.dependsOn = pd.dependsOn;
16492
- if (pd.uiComponent) entry.uiComponent = pd.uiComponent;
16493
- args[pd.name] = entry;
16494
- }
16495
- return args;
16496
- }
16497
- function extractColors(colorStr) {
16498
- if (!colorStr) {
16499
- return { colorStart: "", colorEnd: "" };
16500
- }
16501
- const colors = colorStr.split(/[,\s]+/).map((c) => c.trim()).filter(Boolean);
16502
- return {
16503
- colorStart: colors[0] || "",
16504
- colorEnd: colors[1] || colors[0] || ""
16505
- };
16506
- }
16507
- function parseJSON(str) {
16508
- try {
16509
- return JSON.parse(str);
16510
- } catch {
16511
- return null;
16512
- }
16513
- }
16514
- function parseJsDocToServiceJson(entryPoint) {
16515
- const { serviceInfo, methods, typedefsMap } = parseJSDocs(entryPoint);
16516
- const methodsMap = {};
16517
- for (const method of methods) {
16518
- if (method.private) {
16519
- continue;
16520
- }
16521
- const {
16522
- name,
16523
- route,
16524
- registerAs,
16525
- colorStart,
16526
- colorEnd,
16527
- operationName,
16528
- customIcon,
16529
- category,
16530
- description,
16531
- sampleResult,
16532
- sampleResultLoader,
16533
- paramDefs,
16534
- returnType
16535
- } = method;
16536
- const isSystem = registerAs === "SYSTEM";
16537
- const httpMethod = route ? route.split(/\s+/)[0].toUpperCase() : name.startsWith("get") ? "GET" : "POST";
16538
- const isQueryPlacement = httpMethod === "GET";
16539
- const params = paramDefs.map((pd) => buildParam(pd, typedefsMap));
16540
- const queryParams = isQueryPlacement ? params : [];
16541
- const bodyParams = isQueryPlacement ? [] : params;
16542
- const metaInfoArgs = paramDefs.length > 0 ? buildMetaInfoArgs(paramDefs, typedefsMap) : {};
16543
- methodsMap[name] = {
16544
- colorStart,
16545
- colorEnd,
16546
- queryParams,
16547
- // todo remove me
16548
- bodyParams,
16549
- customIcon: isSystem ? void 0 : customIcon,
16550
- registerAs,
16551
- category,
16552
- metaInfo: {
16553
- args: metaInfoArgs,
16554
- sampleResult: isSystem ? void 0 : sampleResult,
16555
- sampleResultLoader: isSystem ? void 0 : sampleResultLoader
16556
- },
16557
- returnType,
16558
- description,
16559
- operationName,
16560
- name
16561
- };
16562
- }
16563
- return {
16564
- runnerVersion: "v1",
16565
- //TODO: temp
16566
- methodsMap,
16567
- serviceInfo
16568
- };
16465
+ // src/runtime/index.ts
16466
+ function detectVersion(_serviceId, _serviceEntryPointPath) {
16467
+ return "v2";
16569
16468
  }
16570
16469
  // Annotate the CommonJS export names for ESM import in node:
16571
16470
  0 && (module.exports = {
16572
16471
  buildServiceDefinition,
16573
16472
  detectVersion,
16574
16473
  getServiceConfigs,
16575
- parseJsDocToServiceJson,
16576
16474
  resetRegistry,
16577
16475
  runServiceMethod
16578
16476
  });