fjall 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/bin/.bundled +3 -3
  2. package/bin/.metafile.json +28 -13
  3. package/bin/assets/generators/account/generator.js +133 -2
  4. package/bin/assets/generators/application/generator.js +382 -3
  5. package/bin/assets/generators/cdn/generator.js +436 -3
  6. package/bin/assets/generators/compute/generator.js +439 -1
  7. package/bin/assets/generators/compute/service/generator.js +338 -1
  8. package/bin/assets/generators/database/generator.js +439 -1
  9. package/bin/assets/generators/database/proxy/generator.js +338 -1
  10. package/bin/assets/generators/domain/generator.js +133 -2
  11. package/bin/assets/generators/network/generator.js +338 -1
  12. package/bin/assets/generators/organisation/generator.js +133 -2
  13. package/bin/assets/generators/shared/files/package.json +2 -2
  14. package/bin/assets/generators/storage/s3/generator.js +439 -1
  15. package/bin/assets/generators/tunnel/generator.js +338 -1
  16. package/bin/fjall.bundle.js +304 -304
  17. package/package.json +3 -3
  18. package/bin/assets/generators/account/generator.d.ts +0 -8
  19. package/bin/assets/generators/account/index.d.ts +0 -1
  20. package/bin/assets/generators/account/index.js +0 -1
  21. package/bin/assets/generators/application/generator.d.ts +0 -4
  22. package/bin/assets/generators/application/index.d.ts +0 -1
  23. package/bin/assets/generators/application/index.js +0 -1
  24. package/bin/assets/generators/cdn/generator.d.ts +0 -4
  25. package/bin/assets/generators/cdn/index.d.ts +0 -1
  26. package/bin/assets/generators/cdn/index.js +0 -1
  27. package/bin/assets/generators/compute/computeIntegrationHelpers.d.ts +0 -134
  28. package/bin/assets/generators/compute/computeIntegrationHelpers.js +0 -1
  29. package/bin/assets/generators/compute/generator.d.ts +0 -4
  30. package/bin/assets/generators/compute/index.d.ts +0 -1
  31. package/bin/assets/generators/compute/index.js +0 -1
  32. package/bin/assets/generators/compute/service/generator.d.ts +0 -4
  33. package/bin/assets/generators/compute/service/index.d.ts +0 -1
  34. package/bin/assets/generators/compute/service/index.js +0 -1
  35. package/bin/assets/generators/database/databaseIntegrationTestUtils.d.ts +0 -134
  36. package/bin/assets/generators/database/databaseIntegrationTestUtils.js +0 -1
  37. package/bin/assets/generators/database/generator.d.ts +0 -4
  38. package/bin/assets/generators/database/index.d.ts +0 -1
  39. package/bin/assets/generators/database/index.js +0 -1
  40. package/bin/assets/generators/database/proxy/generator.d.ts +0 -4
  41. package/bin/assets/generators/database/proxy/index.d.ts +0 -1
  42. package/bin/assets/generators/database/proxy/index.js +0 -1
  43. package/bin/assets/generators/domain/generator.d.ts +0 -10
  44. package/bin/assets/generators/domain/index.d.ts +0 -1
  45. package/bin/assets/generators/domain/index.js +0 -1
  46. package/bin/assets/generators/messaging/index.d.ts +0 -1
  47. package/bin/assets/generators/messaging/index.js +0 -0
  48. package/bin/assets/generators/network/generator.d.ts +0 -4
  49. package/bin/assets/generators/network/index.d.ts +0 -1
  50. package/bin/assets/generators/network/index.js +0 -1
  51. package/bin/assets/generators/organisation/generator.d.ts +0 -4
  52. package/bin/assets/generators/organisation/index.d.ts +0 -1
  53. package/bin/assets/generators/organisation/index.js +0 -1
  54. package/bin/assets/generators/storage/index.d.ts +0 -1
  55. package/bin/assets/generators/storage/index.js +0 -1
  56. package/bin/assets/generators/storage/s3/generator.d.ts +0 -4
  57. package/bin/assets/generators/tunnel/generator.d.ts +0 -4
  58. package/bin/assets/generators/tunnel/index.d.ts +0 -1
  59. package/bin/assets/generators/tunnel/index.js +0 -1
  60. package/bin/assets/generators/utils/ast/astCodeModification.d.ts +0 -23
  61. package/bin/assets/generators/utils/ast/astCodeModification.js +0 -1
  62. package/bin/assets/generators/utils/ast/astDomainRewriter.d.ts +0 -65
  63. package/bin/assets/generators/utils/ast/astDomainRewriter.js +0 -1
  64. package/bin/assets/generators/utils/ast/astSurgicalModification.d.ts +0 -2
  65. package/bin/assets/generators/utils/ast/astSurgicalModification.js +0 -1
  66. package/bin/assets/generators/utils/ast/index.d.ts +0 -3
  67. package/bin/assets/generators/utils/ast/index.js +0 -1
  68. package/bin/assets/generators/utils/copySharedFiles.d.ts +0 -10
  69. package/bin/assets/generators/utils/copySharedFiles.js +0 -1
  70. package/bin/assets/generators/utils/index.d.ts +0 -8
  71. package/bin/assets/generators/utils/index.js +0 -1
  72. package/bin/assets/generators/utils/integrationTestUtils.d.ts +0 -138
  73. package/bin/assets/generators/utils/integrationTestUtils.js +0 -4
  74. package/bin/assets/generators/utils/mockTree.d.ts +0 -30
  75. package/bin/assets/generators/utils/mockTree.js +0 -1
  76. package/bin/assets/generators/utils/planning/generatorHelpers.d.ts +0 -35
  77. package/bin/assets/generators/utils/planning/generatorHelpers.js +0 -2
  78. package/bin/assets/generators/utils/planning/index.d.ts +0 -1
  79. package/bin/assets/generators/utils/planning/index.js +0 -1
  80. package/bin/assets/generators/utils/prompts.d.ts +0 -4
  81. package/bin/assets/generators/utils/prompts.js +0 -6
  82. package/bin/assets/generators/utils/renderEjs.d.ts +0 -24
  83. package/bin/assets/generators/utils/renderEjs.js +0 -1
  84. package/bin/assets/generators/utils/resources/connectionHelpers.d.ts +0 -19
  85. package/bin/assets/generators/utils/resources/connectionHelpers.js +0 -1
  86. package/bin/assets/generators/utils/resources/index.d.ts +0 -4
  87. package/bin/assets/generators/utils/resources/index.js +0 -1
  88. package/bin/assets/generators/utils/resources/promptValidation.d.ts +0 -42
  89. package/bin/assets/generators/utils/resources/promptValidation.js +0 -1
  90. package/bin/assets/generators/utils/resources/resourceDetection.d.ts +0 -12
  91. package/bin/assets/generators/utils/resources/resourceDetection.js +0 -1
  92. package/bin/assets/generators/utils/resources/resourceNaming.d.ts +0 -6
  93. package/bin/assets/generators/utils/resources/resourceNaming.js +0 -1
  94. package/bin/assets/generators/utils/tree.d.ts +0 -25
  95. package/bin/assets/generators/utils/tree.js +0 -1
  96. package/bin/assets/src/util/__tests__/fjallApiClientTestHelpers.d.ts +0 -9
  97. package/bin/assets/src/util/__tests__/fjallApiClientTestHelpers.js +0 -1
  98. package/bin/assets/src/util/__tests__/outputTestHelpers.d.ts +0 -9
  99. package/bin/assets/src/util/__tests__/outputTestHelpers.js +0 -1
  100. package/bin/assets/src/util/agent/__tests__/toonTestHelpers.d.ts +0 -91
  101. package/bin/assets/src/util/agent/__tests__/toonTestHelpers.js +0 -1
  102. package/bin/assets/src/util/agent/actionRequired.d.ts +0 -60
  103. package/bin/assets/src/util/agent/actionRequired.js +0 -1
  104. package/bin/assets/src/util/agent/agentCallbacks.d.ts +0 -21
  105. package/bin/assets/src/util/agent/agentCallbacks.js +0 -1
  106. package/bin/assets/src/util/agent/agentInit.d.ts +0 -17
  107. package/bin/assets/src/util/agent/agentInit.js +0 -288
  108. package/bin/assets/src/util/agent/agentOutput.d.ts +0 -61
  109. package/bin/assets/src/util/agent/agentOutput.js +0 -8
  110. package/bin/assets/src/util/agent/budget.d.ts +0 -19
  111. package/bin/assets/src/util/agent/budget.js +0 -4
  112. package/bin/assets/src/util/agent/detectAgent.d.ts +0 -51
  113. package/bin/assets/src/util/agent/detectAgent.js +0 -1
  114. package/bin/assets/src/util/agent/errorCodeMap.d.ts +0 -16
  115. package/bin/assets/src/util/agent/errorCodeMap.js +0 -1
  116. package/bin/assets/src/util/agent/errorCodes.d.ts +0 -48
  117. package/bin/assets/src/util/agent/errorCodes.js +0 -1
  118. package/bin/assets/src/util/agent/fieldSelection.d.ts +0 -22
  119. package/bin/assets/src/util/agent/fieldSelection.js +0 -1
  120. package/bin/assets/src/util/agent/getSurface.d.ts +0 -27
  121. package/bin/assets/src/util/agent/getSurface.js +0 -1
  122. package/bin/assets/src/util/agent/index.d.ts +0 -27
  123. package/bin/assets/src/util/agent/index.js +0 -1
  124. package/bin/assets/src/util/agent/mcpProtocolEmit.d.ts +0 -31
  125. package/bin/assets/src/util/agent/mcpProtocolEmit.js +0 -2
  126. package/bin/assets/src/util/agent/schemas/appsSchemas.d.ts +0 -18
  127. package/bin/assets/src/util/agent/schemas/appsSchemas.js +0 -1
  128. package/bin/assets/src/util/agent/schemas/assetSchemas.d.ts +0 -13
  129. package/bin/assets/src/util/agent/schemas/assetSchemas.js +0 -1
  130. package/bin/assets/src/util/agent/schemas/awsSchemas.d.ts +0 -5
  131. package/bin/assets/src/util/agent/schemas/awsSchemas.js +0 -1
  132. package/bin/assets/src/util/agent/schemas/deploySchemas.d.ts +0 -8
  133. package/bin/assets/src/util/agent/schemas/deploySchemas.js +0 -1
  134. package/bin/assets/src/util/agent/schemas/index.d.ts +0 -10
  135. package/bin/assets/src/util/agent/schemas/index.js +0 -1
  136. package/bin/assets/src/util/agent/schemas/infraSchemas.d.ts +0 -45
  137. package/bin/assets/src/util/agent/schemas/infraSchemas.js +0 -1
  138. package/bin/assets/src/util/agent/schemas/secretsSchemas.d.ts +0 -13
  139. package/bin/assets/src/util/agent/schemas/secretsSchemas.js +0 -1
  140. package/bin/assets/src/util/agent/schemas/types.d.ts +0 -98
  141. package/bin/assets/src/util/agent/schemas/types.js +0 -0
  142. package/bin/assets/src/util/agent/schemas/userSchemas.d.ts +0 -21
  143. package/bin/assets/src/util/agent/schemas/userSchemas.js +0 -1
  144. package/bin/assets/src/util/agent/sessionHooks.d.ts +0 -47
  145. package/bin/assets/src/util/agent/sessionHooks.js +0 -6
  146. package/bin/assets/src/util/agent/streaming.d.ts +0 -51
  147. package/bin/assets/src/util/agent/streaming.js +0 -1
  148. package/bin/assets/src/util/agent/suggestionEntries/coreEntries.d.ts +0 -2
  149. package/bin/assets/src/util/agent/suggestionEntries/coreEntries.js +0 -1
  150. package/bin/assets/src/util/agent/suggestionEntries/identityEntries.d.ts +0 -2
  151. package/bin/assets/src/util/agent/suggestionEntries/identityEntries.js +0 -1
  152. package/bin/assets/src/util/agent/suggestionEntries/index.d.ts +0 -3
  153. package/bin/assets/src/util/agent/suggestionEntries/index.js +0 -1
  154. package/bin/assets/src/util/agent/suggestionEntries/infraEntries.d.ts +0 -2
  155. package/bin/assets/src/util/agent/suggestionEntries/infraEntries.js +0 -1
  156. package/bin/assets/src/util/agent/suggestionEntries/observabilityEntries.d.ts +0 -2
  157. package/bin/assets/src/util/agent/suggestionEntries/observabilityEntries.js +0 -1
  158. package/bin/assets/src/util/agent/suggestionEntries/secretsEntries.d.ts +0 -2
  159. package/bin/assets/src/util/agent/suggestionEntries/secretsEntries.js +0 -1
  160. package/bin/assets/src/util/agent/suggestionEntries/types.d.ts +0 -17
  161. package/bin/assets/src/util/agent/suggestionEntries/types.js +0 -1
  162. package/bin/assets/src/util/agent/suggestions.d.ts +0 -30
  163. package/bin/assets/src/util/agent/suggestions.js +0 -1
  164. package/bin/assets/src/util/agent/tokenScopes.d.ts +0 -24
  165. package/bin/assets/src/util/agent/tokenScopes.js +0 -1
  166. package/bin/assets/src/util/agent/toonFormatter.d.ts +0 -55
  167. package/bin/assets/src/util/agent/toonFormatter.js +0 -14
  168. package/bin/assets/src/util/api/Credentials.d.ts +0 -13
  169. package/bin/assets/src/util/api/Credentials.js +0 -1
  170. package/bin/assets/src/util/api/FjallApiClient.d.ts +0 -33
  171. package/bin/assets/src/util/api/FjallApiClient.js +0 -1
  172. package/bin/assets/src/util/api/FjallApiClient.types.d.ts +0 -375
  173. package/bin/assets/src/util/api/FjallApiClient.types.js +0 -1
  174. package/bin/assets/src/util/api/FjallApiClientBase.d.ts +0 -13
  175. package/bin/assets/src/util/api/FjallApiClientBase.js +0 -1
  176. package/bin/assets/src/util/api/FjallApiClientDeviceCode.d.ts +0 -13
  177. package/bin/assets/src/util/api/FjallApiClientDeviceCode.js +0 -1
  178. package/bin/assets/src/util/api/FjallApiClientErrors.d.ts +0 -5
  179. package/bin/assets/src/util/api/FjallApiClientErrors.js +0 -1
  180. package/bin/assets/src/util/api/FjallApiClientResources.d.ts +0 -45
  181. package/bin/assets/src/util/api/FjallApiClientResources.js +0 -1
  182. package/bin/assets/src/util/api/index.d.ts +0 -7
  183. package/bin/assets/src/util/api/index.js +0 -1
  184. package/bin/assets/src/util/api/resolveApiKey.d.ts +0 -1
  185. package/bin/assets/src/util/api/resolveApiKey.js +0 -1
  186. package/bin/assets/src/util/api/scaffoldNotification.d.ts +0 -2
  187. package/bin/assets/src/util/api/scaffoldNotification.js +0 -1
  188. package/bin/assets/src/util/awsCleanup.d.ts +0 -9
  189. package/bin/assets/src/util/awsCleanup.js +0 -1
  190. package/bin/assets/src/util/awsTags.d.ts +0 -19
  191. package/bin/assets/src/util/awsTags.js +0 -1
  192. package/bin/assets/src/util/buildxEventAdapter.d.ts +0 -20
  193. package/bin/assets/src/util/buildxEventAdapter.js +0 -1
  194. package/bin/assets/src/util/caseConversion.d.ts +0 -1
  195. package/bin/assets/src/util/caseConversion.js +0 -1
  196. package/bin/assets/src/util/codemod/emitCliTelemetry.d.ts +0 -32
  197. package/bin/assets/src/util/codemod/emitCliTelemetry.js +0 -1
  198. package/bin/assets/src/util/codemod/exitCodes.d.ts +0 -11
  199. package/bin/assets/src/util/codemod/exitCodes.js +0 -1
  200. package/bin/assets/src/util/codemod/index.d.ts +0 -3
  201. package/bin/assets/src/util/codemod/index.js +0 -1
  202. package/bin/assets/src/util/codemod/renderCodemod.d.ts +0 -5
  203. package/bin/assets/src/util/codemod/renderCodemod.js +0 -1
  204. package/bin/assets/src/util/codemod/stepLabels.d.ts +0 -11
  205. package/bin/assets/src/util/codemod/stepLabels.js +0 -1
  206. package/bin/assets/src/util/colourUtils.d.ts +0 -21
  207. package/bin/assets/src/util/colourUtils.js +0 -1
  208. package/bin/assets/src/util/commandErrorHandler.d.ts +0 -16
  209. package/bin/assets/src/util/commandErrorHandler.js +0 -1
  210. package/bin/assets/src/util/commandResult.d.ts +0 -63
  211. package/bin/assets/src/util/commandResult.js +0 -1
  212. package/bin/assets/src/util/concurrency.d.ts +0 -35
  213. package/bin/assets/src/util/concurrency.js +0 -1
  214. package/bin/assets/src/util/deploymentEvents.d.ts +0 -155
  215. package/bin/assets/src/util/deploymentEvents.js +0 -1
  216. package/bin/assets/src/util/diagnostics/cdkTmpdirCleanup.d.ts +0 -19
  217. package/bin/assets/src/util/diagnostics/cdkTmpdirCleanup.js +0 -1
  218. package/bin/assets/src/util/errorDisplay.d.ts +0 -4
  219. package/bin/assets/src/util/errorDisplay.js +0 -2
  220. package/bin/assets/src/util/errorUtils.d.ts +0 -1
  221. package/bin/assets/src/util/errorUtils.js +0 -1
  222. package/bin/assets/src/util/executionMode.d.ts +0 -18
  223. package/bin/assets/src/util/executionMode.js +0 -1
  224. package/bin/assets/src/util/formatDeltaValue.d.ts +0 -1
  225. package/bin/assets/src/util/formatDeltaValue.js +0 -1
  226. package/bin/assets/src/util/formatDuration.d.ts +0 -1
  227. package/bin/assets/src/util/formatDuration.js +0 -1
  228. package/bin/assets/src/util/formatRelativeTime.d.ts +0 -1
  229. package/bin/assets/src/util/formatRelativeTime.js +0 -1
  230. package/bin/assets/src/util/fuzzyMatch.d.ts +0 -38
  231. package/bin/assets/src/util/fuzzyMatch.js +0 -1
  232. package/bin/assets/src/util/gitDetection.d.ts +0 -8
  233. package/bin/assets/src/util/gitDetection.js +0 -1
  234. package/bin/assets/src/util/index.d.ts +0 -50
  235. package/bin/assets/src/util/index.js +0 -1
  236. package/bin/assets/src/util/log.d.ts +0 -29
  237. package/bin/assets/src/util/log.js +0 -4
  238. package/bin/assets/src/util/logger/CorrelatedLogger.d.ts +0 -15
  239. package/bin/assets/src/util/logger/CorrelatedLogger.js +0 -1
  240. package/bin/assets/src/util/logger/DeploymentLogger.d.ts +0 -33
  241. package/bin/assets/src/util/logger/DeploymentLogger.js +0 -2
  242. package/bin/assets/src/util/logger/FileRotator.d.ts +0 -17
  243. package/bin/assets/src/util/logger/FileRotator.js +0 -1
  244. package/bin/assets/src/util/logger/LogFileWriter.d.ts +0 -54
  245. package/bin/assets/src/util/logger/LogFileWriter.js +0 -4
  246. package/bin/assets/src/util/logger/Logger.d.ts +0 -43
  247. package/bin/assets/src/util/logger/Logger.js +0 -1
  248. package/bin/assets/src/util/logger/index.d.ts +0 -15
  249. package/bin/assets/src/util/logger/index.js +0 -2
  250. package/bin/assets/src/util/logger/logDir.d.ts +0 -5
  251. package/bin/assets/src/util/logger/logDir.js +0 -1
  252. package/bin/assets/src/util/logger/types.d.ts +0 -48
  253. package/bin/assets/src/util/logger/types.js +0 -1
  254. package/bin/assets/src/util/nonInteractive/index.d.ts +0 -3
  255. package/bin/assets/src/util/nonInteractive/index.js +0 -1
  256. package/bin/assets/src/util/nonInteractive/nonInteractiveCallbacks.d.ts +0 -18
  257. package/bin/assets/src/util/nonInteractive/nonInteractiveCallbacks.js +0 -1
  258. package/bin/assets/src/util/nonInteractive/nonInteractiveCascadeOutput.d.ts +0 -51
  259. package/bin/assets/src/util/nonInteractive/nonInteractiveCascadeOutput.js +0 -1
  260. package/bin/assets/src/util/nonInteractive/nonInteractiveLabels.d.ts +0 -23
  261. package/bin/assets/src/util/nonInteractive/nonInteractiveLabels.js +0 -1
  262. package/bin/assets/src/util/nonInteractive/nonInteractiveOutput.d.ts +0 -128
  263. package/bin/assets/src/util/nonInteractive/nonInteractiveOutput.js +0 -4
  264. package/bin/assets/src/util/nonInteractive/nonInteractiveSummaryOutput.d.ts +0 -29
  265. package/bin/assets/src/util/nonInteractive/nonInteractiveSummaryOutput.js +0 -3
  266. package/bin/assets/src/util/organisationStructure.d.ts +0 -9
  267. package/bin/assets/src/util/organisationStructure.js +0 -1
  268. package/bin/assets/src/util/parseTakeOption.d.ts +0 -1
  269. package/bin/assets/src/util/parseTakeOption.js +0 -1
  270. package/bin/assets/src/util/passwordValidation.d.ts +0 -22
  271. package/bin/assets/src/util/passwordValidation.js +0 -1
  272. package/bin/assets/src/util/pathHelpers.d.ts +0 -19
  273. package/bin/assets/src/util/pathHelpers.js +0 -1
  274. package/bin/assets/src/util/patternDetection.d.ts +0 -7
  275. package/bin/assets/src/util/patternDetection.js +0 -1
  276. package/bin/assets/src/util/promptYesNo.d.ts +0 -5
  277. package/bin/assets/src/util/promptYesNo.js +0 -1
  278. package/bin/assets/src/util/readStdin.d.ts +0 -9
  279. package/bin/assets/src/util/readStdin.js +0 -1
  280. package/bin/assets/src/util/secretsUtils.d.ts +0 -155
  281. package/bin/assets/src/util/secretsUtils.js +0 -3
  282. package/bin/assets/src/util/signalCleanup.d.ts +0 -13
  283. package/bin/assets/src/util/signalCleanup.js +0 -4
  284. package/bin/assets/src/util/stripAnsi.d.ts +0 -2
  285. package/bin/assets/src/util/stripAnsi.js +0 -1
  286. package/bin/assets/src/util/synchronizedOutput.d.ts +0 -26
  287. package/bin/assets/src/util/synchronizedOutput.js +0 -1
  288. package/bin/assets/src/util/targetDetection.d.ts +0 -27
  289. package/bin/assets/src/util/targetDetection.js +0 -1
  290. package/bin/assets/src/util/targetHelpers.d.ts +0 -20
  291. package/bin/assets/src/util/targetHelpers.js +0 -1
  292. package/bin/assets/src/util/terminalCapabilities.d.ts +0 -21
  293. package/bin/assets/src/util/terminalCapabilities.js +0 -1
  294. package/bin/assets/src/util/terminalEscapes.d.ts +0 -29
  295. package/bin/assets/src/util/terminalEscapes.js +0 -1
  296. package/bin/assets/src/util/terminalFocus.d.ts +0 -33
  297. package/bin/assets/src/util/terminalFocus.js +0 -1
  298. package/bin/assets/src/util/theme.d.ts +0 -80
  299. package/bin/assets/src/util/theme.js +0 -1
  300. package/bin/assets/src/util/truncateMiddle.d.ts +0 -9
  301. package/bin/assets/src/util/truncateMiddle.js +0 -1
  302. package/bin/assets/src/util/typeGuards.d.ts +0 -5
  303. package/bin/assets/src/util/typeGuards.js +0 -1
  304. package/bin/assets/src/util/uiRouter.d.ts +0 -13
  305. package/bin/assets/src/util/uiRouter.js +0 -1
  306. package/bin/assets/src/util/urlHelpers.d.ts +0 -4
  307. package/bin/assets/src/util/urlHelpers.js +0 -1
  308. package/bin/assets/src/util/versionDisplay.d.ts +0 -5
  309. package/bin/assets/src/util/versionDisplay.js +0 -1
@@ -1,30 +0,0 @@
1
- /**
2
- * Contextual suggestion resolver for AXI agent output. Generates `help[]`
3
- * lines that appear after every command output, guiding agents to their
4
- * next action.
5
- *
6
- * Entry tables are grouped by domain in `./suggestionEntries/`.
7
- */
8
- import type { SuggestionContext } from "./suggestionEntries/types.js";
9
- export type { SuggestionContext } from "./suggestionEntries/types.js";
10
- /**
11
- * Shell-escape a value for embedding in suggestion text.
12
- *
13
- * Suggestions are intended to be safe for an agent to copy-paste into a
14
- * POSIX shell. Any value containing shell-active characters is wrapped in
15
- * single quotes with embedded single quotes safely terminated.
16
- */
17
- declare function shellEscape(value: string): string;
18
- /**
19
- * Resolves contextual suggestions for agent output. Matches the current
20
- * command and context against the suggestion table, interpolates
21
- * placeholders, and preserves flags from the original invocation.
22
- */
23
- export declare class SuggestionResolver {
24
- private readonly command;
25
- private readonly flags;
26
- constructor(command: string, flags: Readonly<Record<string, string>>);
27
- resolve(context: SuggestionContext): string[];
28
- private interpolate;
29
- }
30
- export { shellEscape as _shellEscapeForTesting };
@@ -1 +0,0 @@
1
- import{SUGGESTION_TABLE as i}from"./suggestionEntries/index.js";const l=["app","environment","region","profile","target"];function a(s){return/[^\w@%+=:,./-]/.test(s)?`'${s.replace(/'/g,"'\\''")}'`:s}class f{command;flags;constructor(t,n){this.command=t,this.flags=n}resolve(t){const n=i.find(e=>(e.command===this.command||e.command==="*")&&e.match(t));return n===void 0?[]:n.templates.map(e=>this.interpolate(e,t))}interpolate(t,n){let e=t.replace(/<(\w+)>/g,(o,r)=>n[r]??`<${r}>`);for(const o of l){const r=this.flags[o];r!==void 0&&!e.includes(`--${o}`)&&(e+=` --${o} ${a(r)}`)}return e}}export{f as SuggestionResolver,a as _shellEscapeForTesting};
@@ -1,24 +0,0 @@
1
- /**
2
- * Maps each CLI command surface to the scoped-token scope(s) required to
3
- * execute it. Used by the agent output layer to emit a structured
4
- * `scope_required` error when a token lacks permissions, rather than a
5
- * generic 403.
6
- *
7
- * `TokenScope` / `SCOPE_VALUES` are imported from `@fjall/util` so the
8
- * webapp's `/api/tokens` schemas and the CLI's command-scope lookup
9
- * share a single source of truth (closes 2026-04-28 review H5).
10
- */
11
- import { type TokenScope } from "@fjall/util";
12
- export { type TokenScope };
13
- /**
14
- * Command surface → minimum required scope(s). The first scope in the
15
- * array is the primary; additional entries are alternatives that also
16
- * grant access (e.g. `secrets:write` implies `secrets:read` at the
17
- * middleware level, but we list the exact scope the command needs).
18
- */
19
- export declare const COMMAND_SCOPES: Readonly<Record<string, readonly TokenScope[]>>;
20
- /**
21
- * Look up the required scope(s) for a command. Returns `undefined` for
22
- * commands not in the map (e.g. future commands not yet wired).
23
- */
24
- export declare function getRequiredScopes(command: string): readonly TokenScope[] | undefined;
@@ -1 +0,0 @@
1
- const r={"apps list":["read"],"apps describe":["read"],"apps create":["write"],status:["read"],deploy:["deploy"],destroy:["destroy"],build:["deploy"],"secrets list":["secrets:read"],"secrets get":["secrets:read"],"secrets set":["secrets:write"],"secrets delete":["secrets:write"],"secrets import":["secrets:write"],"secrets export":["secrets:read"],"secrets exec":["secrets:read"],connect:["write"],login:["read"],list:["read"],add:["write"],remove:["write"],modify:["write"],undo:["write"],validate:["read"],history:["read"],tunnel:["read"],"target list":["read"],"target get":["read"],"target set":["write"],"domain list":["read"],"domain verify":["read"],"domain export":["read"],"domain import":["write"],"create domain":["write"],"create account":["write"],"create org":["write"],restore:["write"],import:["write"],sync:["write"],"user list":["read"],"user create":["admin"],"user destroy":["admin"],"user associate":["admin"],"user dissociate":["admin"],"token create":["admin"],"token list":["read"],"token revoke":["admin"],"costs show":["read"],"metrics show":["read"],"compliance fix":["read"],"deploy diff":["read"],"deploy logs":["read"],"aws exec":["read"]};function t(e){return r[e]}export{r as COMMAND_SCOPES,t as getRequiredScopes};
@@ -1,55 +0,0 @@
1
- /**
2
- * Centralised TOON rendering wrapper for AXI agent output. This is the ONLY
3
- * file in the codebase that imports from `@toon-format/toon`. All TOON
4
- * rendering is funnelled here so the library can be swapped without touching
5
- * callers.
6
- *
7
- * Masking is NOT this file's responsibility — the AgentOutputWriter masks
8
- * before calling the formatter. The formatter renders whatever it receives.
9
- */
10
- import type { AgentError, ActionRequired, StreamEvent, TabularSchema } from "./schemas/types.js";
11
- export declare const BLOCK_SEPARATOR = "---";
12
- /**
13
- * Render a single object as TOON key-value pairs.
14
- * Empty objects produce an empty string.
15
- */
16
- export declare function renderObject(obj: unknown): string;
17
- /**
18
- * Render a tabular array with header row and optional aggregates.
19
- *
20
- * Each item is projected through `schema.project()` to guarantee uniform
21
- * flat rows, which triggers TOON's tabular encoding path.
22
- */
23
- export declare function renderList<T>(items: readonly T[], schema: TabularSchema<T>, meta?: {
24
- entity: string;
25
- aggregates?: Record<string, number | string>;
26
- }): string;
27
- /**
28
- * Render a structured error block. Uses manual rendering (not `encode()`)
29
- * because AXI format has `error:` as a top-level key, not wrapped in an
30
- * object.
31
- */
32
- export declare function renderError(error: AgentError): string;
33
- /**
34
- * Render an action-required block. Manual rendering like error, plus
35
- * optional `choices[N]:` and details.
36
- */
37
- export declare function renderActionRequired(action: ActionRequired): string;
38
- /**
39
- * Render help lines manually. TOON would inline scalar arrays as
40
- * `help[3]: a,b,c` on one line, but AXI requires each help line on its
41
- * own indented row.
42
- */
43
- export declare function renderHelp(lines: readonly string[]): string;
44
- /**
45
- * Render a single streaming event.
46
- *
47
- * - Primitive value: `<operation>.<field>: <value>`
48
- * - Object/array value: delegate to `encode()`
49
- */
50
- export declare function renderEvent(event: StreamEvent): string;
51
- /**
52
- * Join multiple rendered blocks with the block separator.
53
- * Empty strings are filtered out. Result ends with exactly one newline.
54
- */
55
- export declare function joinBlocks(blocks: readonly string[]): string;
@@ -1,14 +0,0 @@
1
- import{encode as o}from"@toon-format/toon";const p="---";function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length>0}function c(e){return o(e)}function $(e){return f(e)?o(e):""}function m(e,n,t){const i=t?.entity??"items",r=e.map(u=>n.project(u)),d={[i]:r,...t?.aggregates??{}};return o(d)}function y(e){const n=[];if(n.push(`error: ${s(e.message)}`),n.push(`code: ${e.code}`),e.userActionRequired!==void 0&&n.push(`userActionRequired: ${e.userActionRequired}`),e.details!==void 0&&Object.keys(e.details).length>0){const i=c(e.details).split(`
2
- `).map(r=>` ${r}`).join(`
3
- `);n.push("details:"),n.push(i)}return n.join(`
4
- `)}function j(e){const n=[];if(n.push(`action: ${s(e.action)}`),n.push(`message: ${s(e.message)}`),n.push(`userActionRequired: ${e.userActionRequired}`),e.choices!==void 0&&e.choices.length>0){n.push(`choices[${e.choices.length}]:`);for(const t of e.choices)n.push(` ${t}`)}if(e.details!==void 0&&Object.keys(e.details).length>0){const i=c(e.details).split(`
5
- `).map(r=>` ${r}`).join(`
6
- `);n.push("details:"),n.push(i)}return n.join(`
7
- `)}function a(e){const n=`help[${e.length}]:`;if(e.length===0)return n;const t=e.map(i=>` ${i}`);return[n,...t].join(`
8
- `)}function A(e){const n=`${e.operation}.${e.field}`;return h(e.value)?`${n}: ${l(e.value)}
9
- `:o({[n]:e.value})+`
10
- `}function R(e){const n=e.filter(i=>i.length>0);if(n.length===0)return"";const t=n.join(`
11
- ${p}
12
- `);return t.endsWith(`
13
- `)?t:t+`
14
- `}function h(e){return e===null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function l(e){return e===null?"null":typeof e=="string"?s(e):String(e)}function s(e){return e.includes(":")||e.includes(",")||e.includes('"')?`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:e}export{p as BLOCK_SEPARATOR,R as joinBlocks,j as renderActionRequired,y as renderError,A as renderEvent,a as renderHelp,m as renderList,$ as renderObject};
@@ -1,13 +0,0 @@
1
- export default class Credentials {
2
- apiKey: string | null;
3
- constructor(apiKey?: string);
4
- setApiKey(value: string): void;
5
- toObject(): {
6
- apiKey: string | null;
7
- };
8
- saveCredentials(): void;
9
- static directoryPath(): string;
10
- static filePath(): string;
11
- static loadCredentials(): Credentials | null;
12
- private static loadCredentialFile;
13
- }
@@ -1 +0,0 @@
1
- import*as r from"fs";import{homedir as p}from"os";import{join as a}from"path";import{getErrorMessage as s}from"../errorUtils.js";import{logger as c}from"../logger/index.js";import{maskSensitiveOutput as l}from"@fjall/util";function u(n){return typeof n=="object"&&n!==null&&"apiKey"in n&&typeof n.apiKey=="string"}class e{apiKey;constructor(t){this.apiKey=t||null}setApiKey(t){this.apiKey=t}toObject(){return{apiKey:this.apiKey}}saveCredentials(){const t=e.directoryPath();r.mkdirSync(t,{recursive:!0,mode:448});const i=e.filePath(),o=`${i}.tmp`,d=JSON.stringify(this.toObject(),null,2);r.writeFileSync(o,d,{mode:384}),r.renameSync(o,i)}static directoryPath(){return a(p(),".fjall")}static filePath(){return a(e.directoryPath(),"auth.json")}static loadCredentials(){try{const t=e.loadCredentialFile();if(!t)return null;const i=JSON.parse(t),o=u(i)?i.apiKey:void 0;return new e(o)}catch(t){return c.warn("Credentials","Unable to parse credential file",{error:l(s(t))}),null}}static loadCredentialFile(){try{return r.accessSync(e.filePath(),r.constants.R_OK|r.constants.W_OK),r.readFileSync(e.filePath(),{encoding:"utf8"})}catch(t){return c.debug("Credentials","Could not read credentials file",{error:l(s(t))}),null}}}export{e as default};
@@ -1,33 +0,0 @@
1
- import { type Result } from "../../types/Result.js";
2
- import type { ApiError } from "../../types/errors/ApiError.js";
3
- import { FjallApiClientResources } from "./FjallApiClientResources.js";
4
- import { type Entitlements, type OrganisationConfigResponse, type OrganisationConfigPayload, type MessageResponse, type GetIdentityResponse, type ConnectionStatusResponse, type RegisterQuickCreateResponse, type VerifyAwsAccountPayload, type VerifyAwsAccountResponse, type RegisterRepositoryPayload, type RegisterRepositoryResponse, type UpdateOrganisationMetadataPayload } from "./FjallApiClient.types.js";
5
- import type { ConnectionInfo } from "../../services/connect/types.js";
6
- export type { Entitlements } from "./FjallApiClient.types.js";
7
- export declare class FjallApiClient extends FjallApiClientResources {
8
- /** In-memory cache for entitlements (per-client; CLI commands typically use a single client per invocation) */
9
- private cachedEntitlements;
10
- validateApiKey(verbose?: boolean): Promise<Result<boolean, ApiError>>;
11
- getOrganisationConfig(): Promise<Result<OrganisationConfigResponse, ApiError>>;
12
- putOrganisationConfig(payload: OrganisationConfigPayload): Promise<Result<{
13
- success: boolean;
14
- message: string;
15
- }, ApiError>>;
16
- markScaffolded(): Promise<Result<{
17
- success: boolean;
18
- }, ApiError>>;
19
- updateOrganisationMetadata(organisationId: string, metadata: UpdateOrganisationMetadataPayload): Promise<Result<MessageResponse, ApiError>>;
20
- getIdentity(): Promise<Result<GetIdentityResponse, ApiError>>;
21
- getEntitlements(): Promise<Result<Entitlements, ApiError>>;
22
- getOidcToken(accountId?: string, environment?: string): Promise<Result<{
23
- token: string;
24
- }, ApiError>>;
25
- getConnectionStatus(externalId: string): Promise<Result<ConnectionStatusResponse, ApiError>>;
26
- getConnectedAccounts(): Promise<Result<{
27
- accounts: ConnectionInfo[];
28
- }, ApiError>>;
29
- registerQuickCreate(region?: string, environment?: string): Promise<Result<RegisterQuickCreateResponse, ApiError>>;
30
- verifyAwsAccount(payload: VerifyAwsAccountPayload): Promise<Result<VerifyAwsAccountResponse, ApiError>>;
31
- registerRepository(payload: RegisterRepositoryPayload): Promise<Result<RegisterRepositoryResponse, ApiError>>;
32
- static fromCredentials(baseUrl?: string): FjallApiClient | null;
33
- }
@@ -1 +0,0 @@
1
- import{resolveApiKey as a}from"./resolveApiKey.js";import{success as n,failure as o}from"../../types/Result.js";import{logger as i}from"../logger/index.js";import{FjallApiClientResources as u}from"./FjallApiClientResources.js";class r extends u{cachedEntitlements=null;async validateApiKey(e=!1){const t="/api/applications";e&&(i.debug("API",`Making GET request to: ${this.baseUrl}${t}`),i.debug("API","Authorization header: Bearer ****"));const s=await this.apiRequest("get",t,void 0,{timeout:1e4});return e&&(s.success?i.debug("API","Response status: 200"):i.debug("API","Error occurred during API validation",{errorType:s.error.errorType,statusCode:s.error.statusCode,message:s.error.message})),s.success?n(!0):o(s.error)}async getOrganisationConfig(){return this.apiRequest("get","/api/organisation-config")}async putOrganisationConfig(e){return this.apiRequest("put","/api/organisation-config",e)}async markScaffolded(){return this.apiRequest("post","/api/organisations/mark-scaffolded")}async updateOrganisationMetadata(e,t){return this.apiRequest("put",`/api/organisations/${encodeURIComponent(e)}`,t)}async getIdentity(){return this.apiRequest("get","/api/identity")}async getEntitlements(){if(this.cachedEntitlements)return n(this.cachedEntitlements);const e=await this.apiRequest("get","/api/entitlements");return e.success&&(this.cachedEntitlements=e.data),e}async getOidcToken(e,t){return this.apiRequest("post","/api/oidc/token",{...e!==void 0&&{accountId:e},...t!==void 0&&{environment:t}})}async getConnectionStatus(e){return this.apiRequest("get",`/api/connections/status?externalId=${encodeURIComponent(e)}`)}async getConnectedAccounts(){return this.apiRequest("get","/api/connections/list")}async registerQuickCreate(e,t){return this.apiRequest("post","/api/connections/quick-create",{...e!==void 0&&{region:e},...t!==void 0&&{environment:t}})}async verifyAwsAccount(e){return this.apiRequest("post","/api/aws-accounts/verify",e)}async registerRepository(e){return this.apiRequest("post","/api/repositories/register",e)}static fromCredentials(e){const t=a();return t?new r(t,e):null}}export{r as FjallApiClient};
@@ -1,375 +0,0 @@
1
- import type { ProviderAccount } from "@fjall/deploy-core";
2
- export declare const USER_AGENT: string;
3
- export declare const DEFAULT_TIMEOUT_MS = 30000;
4
- export declare const DEFAULT_BASE_URL: string;
5
- export interface DeviceCodeResponse {
6
- deviceCode: string;
7
- userCode: string;
8
- verificationUri: string;
9
- expiresIn: number;
10
- interval: number;
11
- }
12
- export interface DeviceTokenResponse {
13
- status: "pending" | "complete";
14
- apiKey?: string;
15
- organisationId?: string;
16
- organisationName?: string;
17
- email?: string;
18
- }
19
- export interface CreateApplicationPayload {
20
- name: string;
21
- description?: string;
22
- template?: Array<{
23
- path: string;
24
- contents: string;
25
- }>;
26
- }
27
- export interface CreateApplicationResponse {
28
- application: {
29
- id: string;
30
- name: string;
31
- description?: string;
32
- organisationId: string;
33
- createdAt: string;
34
- updatedAt: string;
35
- };
36
- activity: {
37
- id: string;
38
- applicationId: string;
39
- type: string;
40
- data: Record<string, unknown>;
41
- createdAt: string;
42
- };
43
- }
44
- export interface CreateActivityPayload {
45
- type: string;
46
- data?: Record<string, unknown>;
47
- }
48
- export interface CreateActivityResponse {
49
- activity: {
50
- id: string;
51
- applicationId: string;
52
- type: string;
53
- data: Record<string, unknown>;
54
- createdAt: string;
55
- };
56
- }
57
- export interface OrganisationConfigResponse {
58
- primaryRegion: string | null;
59
- secondaryRegions: string[];
60
- disasterRecoveryRegion: string | null;
61
- providerAccounts: ProviderAccount[];
62
- ssoSessions: Record<string, {
63
- ssoRegion: string;
64
- ssoStartUrl: string;
65
- }>;
66
- rootOidcRoleArn: string | null;
67
- allowCodemodLlmFallback: boolean;
68
- }
69
- export interface OrganisationConfigPayload {
70
- primaryRegion?: string;
71
- secondaryRegions?: string[];
72
- disasterRecoveryRegion?: string;
73
- providerAccounts?: ProviderAccount[];
74
- ssoSessions?: Record<string, {
75
- ssoRegion: string;
76
- ssoStartUrl: string;
77
- }>;
78
- rootOidcRoleArn?: string;
79
- }
80
- export interface MessageResponse {
81
- message: string;
82
- }
83
- /**
84
- * Minimal application summary returned by `GET /api/applications`.
85
- *
86
- * Cross-repo shared contract — the webapp route
87
- * `app/routes/api/applications/index.ts` returns this shape (plus extra
88
- * Prisma fields we do not consume). If either surface drifts, the
89
- * structural assertion in `__tests__/FjallApiClient.listApps.test.ts`
90
- * fails at typecheck.
91
- */
92
- export interface AppSummary {
93
- id: string;
94
- name: string;
95
- vpcCidr: string | null;
96
- connectedAwsAccountId: string | null;
97
- }
98
- export interface ListAppsResponse {
99
- applications: AppSummary[];
100
- nextCursor?: string;
101
- }
102
- export type { Entitlements } from "@fjall/deploy-core";
103
- export interface CreateTokenPayload {
104
- name: string;
105
- scopes: string[];
106
- resourceConstraints?: {
107
- applicationIds?: string[];
108
- environmentNames?: string[];
109
- accountIds?: string[];
110
- };
111
- expiresAt: string;
112
- sourceTag?: string;
113
- }
114
- export interface CreateTokenResponse {
115
- id: string;
116
- token: string;
117
- tokenPrefix: string;
118
- name: string;
119
- scopes: string[];
120
- resourceConstraints: Record<string, unknown>;
121
- sourceTag: string | null;
122
- expiresAt: string;
123
- organisationId: string;
124
- }
125
- export interface TokenSummary {
126
- id: string;
127
- name: string;
128
- tokenPrefix: string;
129
- scopes: string[];
130
- resourceConstraints: Record<string, unknown>;
131
- sourceTag: string | null;
132
- expiresAt: string;
133
- createdAt: string;
134
- revokedAt: string | null;
135
- revokedReason: string | null;
136
- lastUsedAt: string | null;
137
- usageCount: number;
138
- deniedCount: number;
139
- createdById: string;
140
- createdBy: string | null;
141
- }
142
- export interface TokenListResponse {
143
- tokens: TokenSummary[];
144
- }
145
- export interface TokenSelfResponse {
146
- id: string;
147
- kind: "scoped" | "legacy";
148
- name?: string;
149
- tokenPrefix?: string;
150
- scopes: string[];
151
- resourceConstraints?: Record<string, unknown>;
152
- sourceTag?: string | null;
153
- expiresAt?: string;
154
- organisationId: string;
155
- }
156
- export interface TokenRevokeResponse {
157
- ok: boolean;
158
- message: string;
159
- }
160
- export interface AssetSummary {
161
- id: string;
162
- organizationId: string;
163
- assetIdentifier: string;
164
- name: string;
165
- provider: string;
166
- type: string;
167
- region: string | null;
168
- status: string;
169
- iacStatus: string | null;
170
- accountId: string | null;
171
- applicationId: string | null;
172
- estimatedMonthlyCost: string | null;
173
- lastSeenAt: string | null;
174
- _count?: {
175
- complianceIssues: number;
176
- };
177
- }
178
- export interface AssetDetail extends AssetSummary {
179
- environment: string | null;
180
- tags: Record<string, unknown> | null;
181
- iacInfo: Record<string, unknown> | null;
182
- assetCreatedAt: string | null;
183
- assetModifiedAt: string | null;
184
- createdAt: string;
185
- updatedAt: string;
186
- }
187
- export interface ComplianceIssueSummary {
188
- id: string;
189
- ruleId: string;
190
- title: string;
191
- severity: string;
192
- status: string;
193
- detectedAt: string;
194
- lastSeenAt: string;
195
- }
196
- export interface AssetListResponse {
197
- assets: AssetSummary[];
198
- nextCursor?: string;
199
- }
200
- export interface AssetDetailResponse {
201
- asset: AssetDetail;
202
- }
203
- export interface AssetComplianceResponse {
204
- issues: ComplianceIssueSummary[];
205
- }
206
- /**
207
- * Costs response. Shape varies by mode (summary | forecast | breakdown | app).
208
- * Consumers should serialise the full payload rather than access specific
209
- * fields — the API is the source of truth for structure.
210
- */
211
- export interface CostsResponse {
212
- mode?: "summary" | "forecast" | "breakdown" | "app";
213
- amount_usd?: number;
214
- applicationId?: string;
215
- days?: number;
216
- forecastDays?: number;
217
- breakdown?: Array<Record<string, unknown>>;
218
- forecast?: Array<Record<string, unknown>>;
219
- [key: string]: unknown;
220
- }
221
- export interface GetCostsQuery {
222
- mode?: string;
223
- applicationId?: string;
224
- days?: number;
225
- forecastDays?: number;
226
- }
227
- /**
228
- * App metrics response. Rows-shaped array for most modes, object for
229
- * summary. Extra fields are preserved for forward compatibility.
230
- */
231
- export type AppMetricsResponse = Array<Record<string, unknown>> | {
232
- mode?: "summary" | "requests" | "errors" | "latency";
233
- rows?: Array<Record<string, unknown>>;
234
- [key: string]: unknown;
235
- };
236
- export interface GetAppMetricsQuery {
237
- mode?: string;
238
- applicationId?: string;
239
- hours?: number;
240
- limit?: number;
241
- }
242
- export interface DeploymentSummary {
243
- id: string;
244
- status?: string;
245
- startedAt?: string;
246
- finishedAt?: string;
247
- durationMs?: number;
248
- commitSha?: string;
249
- [key: string]: unknown;
250
- }
251
- export interface DeploymentCompareResponse {
252
- deploymentA: DeploymentSummary;
253
- deploymentB: DeploymentSummary;
254
- metricDeltas?: Record<string, unknown> | null;
255
- [key: string]: unknown;
256
- }
257
- export interface DeploymentAnalysisResponse {
258
- deploymentId?: string;
259
- summary?: string;
260
- errors?: Array<Record<string, unknown>>;
261
- warnings?: Array<Record<string, unknown>>;
262
- [key: string]: unknown;
263
- }
264
- export interface ComplianceSuggestion {
265
- ruleId?: string;
266
- title?: string;
267
- severity?: string;
268
- suggestion?: string;
269
- [key: string]: unknown;
270
- }
271
- export interface ComplianceSuggestionsResponse {
272
- domain?: string;
273
- suggestions?: ComplianceSuggestion[];
274
- [key: string]: unknown;
275
- }
276
- export interface GetComplianceSuggestionsQuery {
277
- domain: string;
278
- applicationId?: string;
279
- issueId?: string;
280
- }
281
- export interface CreateDeploymentPayload {
282
- target: string;
283
- deploymentType: string;
284
- applicationId?: string;
285
- connectedAwsAccountId?: string;
286
- awsAccountId?: string;
287
- source?: string;
288
- commitSha?: string;
289
- branch?: string;
290
- operation?: "deploy" | "destroy";
291
- }
292
- export interface CreateDeploymentResponse {
293
- deployment: {
294
- id: string;
295
- status: string;
296
- };
297
- }
298
- export interface UpdateDeploymentStatusPayload {
299
- status: string;
300
- errorMessage?: string;
301
- }
302
- export interface ApplicationMetadataResource {
303
- name: string;
304
- arn: string;
305
- type: "Compute" | "Database" | "Storage" | "Pattern";
306
- metadata: Record<string, unknown>;
307
- }
308
- export interface UpdateApplicationMetadataPayload {
309
- awsAccountId: string;
310
- awsRegion: string;
311
- monitoringRoleArn: string;
312
- resources: ApplicationMetadataResource[];
313
- }
314
- export interface UpdateApplicationTemplateResource {
315
- resource_type: string;
316
- name: string;
317
- stack_name: string;
318
- }
319
- export interface UpdateOrganisationMetadataPayload {
320
- monitoringRoleArn?: string;
321
- monitoringRoleExternalId?: string;
322
- awsAccountId?: string;
323
- }
324
- export interface GetIdentityResponse {
325
- organisationId: string;
326
- organisationName: string;
327
- }
328
- export interface ConnectionStatusResponse {
329
- status: "pending" | "active" | "scanning" | "error";
330
- roleArn?: string;
331
- accountId?: string;
332
- }
333
- export interface RegisterQuickCreateResponse {
334
- quickCreateUrl: string;
335
- externalId: string;
336
- }
337
- export interface VerifyAwsAccountPayload {
338
- awsAccountId: string;
339
- accountName: string;
340
- }
341
- export interface VerifyAwsAccountResponse {
342
- success: boolean;
343
- message: string;
344
- account?: Record<string, unknown>;
345
- }
346
- export interface RegisterRepositoryPayload {
347
- remoteUrl: string;
348
- branch?: string;
349
- }
350
- export interface RegisterRepositoryResponse {
351
- registered: boolean;
352
- repository?: {
353
- id: string;
354
- fullName: string;
355
- provider: string;
356
- purpose: string;
357
- };
358
- }
359
- export interface PatchApplicationConfigPathResponse {
360
- application: {
361
- id: string;
362
- configPath: string;
363
- };
364
- }
365
- export interface LinkApplicationRepositoryResponse {
366
- application: {
367
- id: string;
368
- repositoryId: string;
369
- configPath: string | null;
370
- repository: {
371
- fullName: string;
372
- provider: string;
373
- };
374
- };
375
- }
@@ -1 +0,0 @@
1
- import{platform as e,arch as n}from"os";import r from"../../../package.json"with{type:"json"};const p=`fjall-cli/${r.version} node/${process.versions.node} ${e()}/${n()}`,i=3e4,o=process.env.FJALL_API_URL,c=o!==void 0&&o!==""?o:"https://fjall.io";export{c as DEFAULT_BASE_URL,i as DEFAULT_TIMEOUT_MS,p as USER_AGENT};
@@ -1,13 +0,0 @@
1
- import { type AxiosRequestConfig } from "axios";
2
- import { type Result } from "../../types/Result.js";
3
- import { ApiError } from "../../types/errors/ApiError.js";
4
- export declare class FjallApiClientBase {
5
- protected baseUrl: string;
6
- protected apiKey: string;
7
- constructor(apiKey: string, baseUrl?: string);
8
- getBaseUrl(): string;
9
- private getHeaders;
10
- private extractResponseError;
11
- private handleError;
12
- protected apiRequest<T>(method: "get" | "post" | "put" | "patch" | "delete", endpoint: string, data?: unknown, config?: AxiosRequestConfig): Promise<Result<T, ApiError>>;
13
- }
@@ -1 +0,0 @@
1
- import a,{AxiosError as p}from"axios";import{maskSensitiveOutput as d}from"@fjall/util";import{success as f,failure as l}from"../../types/Result.js";import{ApiError as u}from"../../types/errors/ApiError.js";import{buildApiError as m}from"./FjallApiClientErrors.js";import{USER_AGENT as h,DEFAULT_TIMEOUT_MS as E,DEFAULT_BASE_URL as g}from"./FjallApiClient.types.js";class x{baseUrl;apiKey;constructor(t,r=g){this.apiKey=t,this.baseUrl=r}getBaseUrl(){return this.baseUrl}getHeaders(){return{"Content-Type":"application/json","User-Agent":h,Authorization:`Bearer ${this.apiKey}`}}extractResponseError(t){const r=t.response?.data;if(typeof r!="object"||r===null||!("error"in r))return;const e=r.error;if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string")return e.message;if("message"in r&&typeof r.message=="string")return r.message}handleError(t,r){if(t instanceof p){if(t.response?.status===401){const e=this.extractResponseError(t),s=e!==void 0?d(e):void 0;return new u(s??"Invalid API key or unauthorised","not_authenticated",r,401,t)}if(t.response?.status===403){const e=this.extractResponseError(t),s=e!==void 0?d(e):void 0;return new u(s??"Permission denied","permission_denied",r,403,t)}if(t.response?.status===404){const e=this.extractResponseError(t),s=e!==void 0?d(e):void 0,n=t.config?.method?.toUpperCase()??"UNKNOWN",o=t.config?.url?new URL(t.config.url,"http://localhost").pathname:"unknown";return new u(`Resource not found: ${n} ${o}${s?` - ${s}`:""}`,"not_found",r,404,t)}if(t.response?.status===409){const e=this.extractResponseError(t),s=e!==void 0?d(e):void 0;return new u(s??"Resource already exists","conflict",r,409,t)}if(t.response?.status===429){const e=t.response.headers?.["retry-after"],s=e!=null?parseInt(String(e),10):NaN,n=Number.isFinite(s)&&s>=0?s:void 0;return new u(`Rate limited. Please try again${n!==void 0?` in ${n}s`:" later"}.`,"rate_limited",r,429,t,!0,n)}}return m(t,r,this.baseUrl)}async apiRequest(t,r,e,s){try{const n=`${this.baseUrl}${r}`,o={...s,timeout:s?.timeout??E,headers:{...this.getHeaders(),...s?.headers}};let i;switch(t){case"get":i=await a.get(n,o);break;case"post":i=await a.post(n,e,o);break;case"put":i=await a.put(n,e,o);break;case"patch":i=await a.patch(n,e,o);break;case"delete":i=await a.delete(n,{...o,...e!==void 0&&{data:e}});break;default:{const c=t;throw new Error(`Unsupported HTTP method: ${c}`)}}return f(i.data)}catch(n){return l(this.handleError(n,r))}}}export{x as FjallApiClientBase};
@@ -1,13 +0,0 @@
1
- import { type Result } from "../../types/Result.js";
2
- import type { ApiError } from "../../types/errors/ApiError.js";
3
- import { type DeviceCodeResponse, type DeviceTokenResponse } from "./FjallApiClient.types.js";
4
- /**
5
- * Initiate a device-code authentication flow.
6
- * Standalone because no API key exists yet at this point.
7
- */
8
- export declare function initiateDeviceCode(baseUrl?: string): Promise<Result<DeviceCodeResponse, ApiError>>;
9
- /**
10
- * Poll for device-code token completion.
11
- * Standalone because no API key exists yet at this point.
12
- */
13
- export declare function pollDeviceToken(deviceCode: string, baseUrl?: string): Promise<Result<DeviceTokenResponse, ApiError>>;
@@ -1 +0,0 @@
1
- import i from"axios";import{success as s,failure as a}from"../../types/Result.js";import{USER_AGENT as c,DEFAULT_TIMEOUT_MS as p,DEFAULT_BASE_URL as d}from"./FjallApiClient.types.js";import{buildApiError as u}from"./FjallApiClientErrors.js";async function f(r){const o=r??d,t="/api/device/code";try{const e=await i.post(`${o}${t}`,{},{timeout:p,headers:{"Content-Type":"application/json","User-Agent":c}});return s(e.data)}catch(e){return a(u(e,t,o))}}async function A(r,o){const t=o??d,e="/api/device/token";try{const n=await i.post(`${t}${e}`,{deviceCode:r},{timeout:p,headers:{"Content-Type":"application/json","User-Agent":c}});return s(n.data)}catch(n){return a(u(n,e,t))}}export{f as initiateDeviceCode,A as pollDeviceToken};
@@ -1,5 +0,0 @@
1
- import { ApiError } from "../../types/errors/ApiError.js";
2
- /**
3
- * Shared error handling for both authenticated and unauthenticated API requests.
4
- */
5
- export declare function buildApiError(err: unknown, endpoint: string, baseUrl: string): ApiError;
@@ -1 +0,0 @@
1
- import{AxiosError as u}from"axios";import{ApiError as o}from"../../types/errors/ApiError.js";import{getErrorMessage as A}from"../errorUtils.js";import{maskSensitiveOutput as a}from"@fjall/util";const E=2e3;function c(e){const s=a(JSON.stringify(e));return s.length>E?s.slice(0,E)+"\u2026":s}function m(e,s,n){if(e instanceof u){const r=a(e.message);if(e.response?.status&&e.response.status>=500)return new o(`Server error: ${r}${e.response?.data?` - ${c(e.response.data)}`:""}`,"server_error",s,e.response.status,e);const i=["ECONNREFUSED","ETIMEDOUT","ECONNABORTED","ENETUNREACH","EHOSTUNREACH"];if(e.code&&i.includes(e.code)){let t;switch(e.code){case"ECONNREFUSED":t=`Cannot connect to API server at ${n}. Is the server running?`;break;case"ETIMEDOUT":case"ECONNABORTED":t=`Connection timeout to ${n}. Please check your network connection.`;break;case"ENETUNREACH":case"EHOSTUNREACH":t=`Network unreachable. Cannot connect to ${n}.`;break;default:t=`Network error: Cannot connect to API server at ${n}`}return new o(t,"network_error",s,void 0,e,!0)}return e.response?.data?new o(`API request failed: ${r} - ${c(e.response.data)}`,"api_error",s,e.response?.status,e):new o(`API request failed: ${r}`,"api_error",s,e.response?.status,e)}return new o(`Unexpected error: ${a(A(e))}`,"unknown",s)}export{m as buildApiError};