api.tsx 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478
  1. import { baseApi } from "./baseApi";
  2. import { FullActionConfigType, StorageType } from "./types";
  3. /**
  4. * Generic api call format
  5. * @param {string} token - Bearer token.
  6. * @param {Object} params - Body params.
  7. * @param {Object} pathParams - Path params.
  8. * @param {(err: Object, res: Object) => void} callback - Callback function.
  9. */
  10. const checkAuth = baseApi("GET", "/api/users/current");
  11. const connectECRRegistry = baseApi<
  12. {
  13. name: string;
  14. aws_integration_id: string;
  15. },
  16. { id: number }
  17. >("POST", (pathParams) => {
  18. return `/api/projects/${pathParams.id}/registries`;
  19. });
  20. const connectGCRRegistry = baseApi<
  21. {
  22. name: string;
  23. gcp_integration_id: string;
  24. url: string;
  25. },
  26. { id: number }
  27. >("POST", (pathParams) => {
  28. return `/api/projects/${pathParams.id}/registries`;
  29. });
  30. const connectDORegistry = baseApi<
  31. {
  32. name: string;
  33. do_integration_id: string;
  34. url: string;
  35. },
  36. { project_id: number }
  37. >("POST", (pathParams) => {
  38. return `/api/projects/${pathParams.project_id}/registries`;
  39. });
  40. const getAWSIntegration = baseApi<{}, { project_id: number }>(
  41. "GET",
  42. ({ project_id }) => `/api/projects/${project_id}/integrations/aws`
  43. );
  44. const getGCPIntegration = baseApi<{}, { project_id: number }>(
  45. "GET",
  46. ({ project_id }) => `/api/projects/${project_id}/integrations/gcp`
  47. );
  48. const createAWSIntegration = baseApi<
  49. {
  50. aws_region: string;
  51. aws_cluster_id?: string;
  52. aws_access_key_id: string;
  53. aws_secret_access_key: string;
  54. },
  55. { id: number }
  56. >("POST", (pathParams) => {
  57. return `/api/projects/${pathParams.id}/integrations/aws`;
  58. });
  59. const overwriteAWSIntegration = baseApi<
  60. {
  61. aws_integration_id: number;
  62. aws_access_key_id: string;
  63. aws_secret_access_key: string;
  64. cluster_id: number;
  65. },
  66. {
  67. project_id: number;
  68. }
  69. >("POST", (pathParams) => {
  70. return `/api/projects/${pathParams.project_id}/integrations/aws/overwrite`;
  71. });
  72. const createDOCR = baseApi<
  73. {
  74. do_integration_id: number;
  75. docr_name: string;
  76. docr_subscription_tier: string;
  77. },
  78. {
  79. project_id: number;
  80. }
  81. >("POST", (pathParams) => {
  82. return `/api/projects/${pathParams.project_id}/provision/docr`;
  83. });
  84. const createDOKS = baseApi<
  85. {
  86. do_integration_id: number;
  87. doks_name: string;
  88. do_region: string;
  89. issuer_email: string;
  90. },
  91. {
  92. project_id: number;
  93. }
  94. >("POST", (pathParams) => {
  95. return `/api/projects/${pathParams.project_id}/provision/doks`;
  96. });
  97. const createEmailVerification = baseApi<{}, {}>("POST", (pathParams) => {
  98. return `/api/email/verify/initiate`;
  99. });
  100. const createEnvironment = baseApi<
  101. {
  102. name: string;
  103. },
  104. {
  105. project_id: number;
  106. cluster_id: number;
  107. git_installation_id: number;
  108. git_repo_owner: string;
  109. git_repo_name: string;
  110. }
  111. >("POST", (pathParams) => {
  112. let {
  113. project_id,
  114. cluster_id,
  115. git_installation_id,
  116. git_repo_owner,
  117. git_repo_name,
  118. } = pathParams;
  119. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/environment`;
  120. });
  121. const deleteEnvironment = baseApi<
  122. {
  123. name: string;
  124. },
  125. {
  126. project_id: number;
  127. cluster_id: number;
  128. git_installation_id: number;
  129. git_repo_owner: string;
  130. git_repo_name: string;
  131. }
  132. >("DELETE", (pathParams) => {
  133. let {
  134. project_id,
  135. cluster_id,
  136. git_installation_id,
  137. git_repo_owner,
  138. git_repo_name,
  139. } = pathParams;
  140. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/environment`;
  141. });
  142. const listEnvironments = baseApi<
  143. {},
  144. {
  145. project_id: number;
  146. cluster_id: number;
  147. }
  148. >("GET", (pathParams) => {
  149. let { project_id, cluster_id } = pathParams;
  150. return `/api/projects/${project_id}/clusters/${cluster_id}/environments`;
  151. });
  152. const createGCPIntegration = baseApi<
  153. {
  154. gcp_key_data: string;
  155. gcp_project_id: string;
  156. },
  157. {
  158. project_id: number;
  159. }
  160. >("POST", (pathParams) => {
  161. return `/api/projects/${pathParams.project_id}/integrations/gcp`;
  162. });
  163. const createGCR = baseApi<
  164. {
  165. gcp_integration_id: number;
  166. },
  167. {
  168. project_id: number;
  169. }
  170. >("POST", (pathParams) => {
  171. return `/api/projects/${pathParams.project_id}/provision/gcr`;
  172. });
  173. const createGKE = baseApi<
  174. {
  175. gcp_region: string;
  176. gcp_integration_id: number;
  177. gke_name: string;
  178. issuer_email: string;
  179. },
  180. {
  181. project_id: number;
  182. }
  183. >("POST", (pathParams) => {
  184. return `/api/projects/${pathParams.project_id}/provision/gke`;
  185. });
  186. const createInvite = baseApi<
  187. {
  188. email: string;
  189. kind: string;
  190. },
  191. {
  192. id: number;
  193. }
  194. >("POST", (pathParams) => {
  195. return `/api/projects/${pathParams.id}/invites`;
  196. });
  197. const createPasswordReset = baseApi<
  198. {
  199. email: string;
  200. },
  201. {}
  202. >("POST", (pathParams) => {
  203. return `/api/password/reset/initiate`;
  204. });
  205. const createPasswordResetVerify = baseApi<
  206. {
  207. email: string;
  208. token: string;
  209. token_id: number;
  210. },
  211. {}
  212. >("POST", (pathParams) => {
  213. return `/api/password/reset/verify`;
  214. });
  215. const createPasswordResetFinalize = baseApi<
  216. {
  217. email: string;
  218. token: string;
  219. token_id: number;
  220. new_password: string;
  221. },
  222. {}
  223. >("POST", (pathParams) => {
  224. return `/api/password/reset/finalize`;
  225. });
  226. const createProject = baseApi<{ name: string }, {}>("POST", (pathParams) => {
  227. return `/api/projects`;
  228. });
  229. const createSubdomain = baseApi<
  230. {},
  231. {
  232. id: number;
  233. release_name: string;
  234. namespace: string;
  235. cluster_id: number;
  236. }
  237. >("POST", (pathParams) => {
  238. let { cluster_id, id, namespace, release_name } = pathParams;
  239. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/subdomain`;
  240. });
  241. const deleteCluster = baseApi<
  242. {},
  243. {
  244. project_id: number;
  245. cluster_id: number;
  246. }
  247. >("DELETE", (pathParams) => {
  248. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  249. });
  250. const deleteInvite = baseApi<{}, { id: number; invId: number }>(
  251. "DELETE",
  252. (pathParams) => {
  253. return `/api/projects/${pathParams.id}/invites/${pathParams.invId}`;
  254. }
  255. );
  256. const deletePod = baseApi<
  257. {},
  258. { name: string; namespace: string; id: number; cluster_id: number }
  259. >("DELETE", (pathParams) => {
  260. let { id, name, cluster_id, namespace } = pathParams;
  261. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`;
  262. });
  263. const getPodEvents = baseApi<
  264. {},
  265. { name: string; namespace: string; id: number; cluster_id: number }
  266. >("GET", (pathParams) => {
  267. let { id, name, cluster_id, namespace } = pathParams;
  268. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}/events`;
  269. });
  270. const deleteProject = baseApi<{}, { id: number }>("DELETE", (pathParams) => {
  271. return `/api/projects/${pathParams.id}`;
  272. });
  273. const deleteRegistryIntegration = baseApi<
  274. {},
  275. {
  276. project_id: number;
  277. registry_id: number;
  278. }
  279. >("DELETE", (pathParams) => {
  280. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}`;
  281. });
  282. const deleteSlackIntegration = baseApi<
  283. {},
  284. {
  285. project_id: number;
  286. slack_integration_id: number;
  287. }
  288. >("DELETE", (pathParams) => {
  289. return `/api/projects/${pathParams.project_id}/slack_integrations/${pathParams.slack_integration_id}`;
  290. });
  291. const updateNotificationConfig = baseApi<
  292. {
  293. payload: any;
  294. },
  295. {
  296. project_id: number;
  297. cluster_id: number;
  298. namespace: string;
  299. name: string;
  300. }
  301. >("POST", (pathParams) => {
  302. let { project_id, cluster_id, namespace, name } = pathParams;
  303. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
  304. });
  305. const getPRDeploymentList = baseApi<
  306. {
  307. status?: string[];
  308. },
  309. {
  310. cluster_id: number;
  311. project_id: number;
  312. }
  313. >("GET", (pathParams) => {
  314. const { cluster_id, project_id } = pathParams;
  315. return `/api/projects/${project_id}/clusters/${cluster_id}/deployments`;
  316. });
  317. const getPRDeploymentByCluster = baseApi<
  318. {
  319. namespace: string;
  320. },
  321. {
  322. cluster_id: number;
  323. project_id: number;
  324. environment_id: number;
  325. }
  326. >("GET", (pathParams) => {
  327. const { cluster_id, project_id, environment_id } = pathParams;
  328. return `/api/projects/${project_id}/clusters/${cluster_id}/${environment_id}/deployment`;
  329. });
  330. const getPRDeployment = baseApi<
  331. {
  332. namespace: string;
  333. },
  334. {
  335. cluster_id: number;
  336. project_id: number;
  337. git_installation_id: number;
  338. git_repo_owner: string;
  339. git_repo_name: string;
  340. }
  341. >("GET", (pathParams) => {
  342. const {
  343. cluster_id,
  344. project_id,
  345. git_installation_id,
  346. git_repo_owner,
  347. git_repo_name,
  348. } = pathParams;
  349. return `/api/projects/${project_id}/gitrepos/${git_installation_id}/${git_repo_owner}/${git_repo_name}/clusters/${cluster_id}/deployment`;
  350. });
  351. const getNotificationConfig = baseApi<
  352. {},
  353. {
  354. project_id: number;
  355. cluster_id: number;
  356. namespace: string;
  357. name: string;
  358. }
  359. >("GET", (pathParams) => {
  360. let { project_id, cluster_id, namespace, name } = pathParams;
  361. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/notifications`;
  362. });
  363. const getGHAWorkflowTemplate = baseApi<
  364. {
  365. release_name: string;
  366. github_action_config: FullActionConfigType;
  367. },
  368. {
  369. cluster_id: number;
  370. project_id: number;
  371. namespace: string;
  372. }
  373. >("POST", (pathParams) => {
  374. const { cluster_id, project_id, namespace } = pathParams;
  375. return `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/gha_template`;
  376. });
  377. const deployTemplate = baseApi<
  378. {
  379. template_name: string;
  380. template_version: string;
  381. image_url?: string;
  382. values?: any;
  383. name: string;
  384. github_action_config?: FullActionConfigType;
  385. build_config?: any;
  386. },
  387. {
  388. id: number;
  389. cluster_id: number;
  390. namespace: string;
  391. repo_url?: string;
  392. }
  393. >("POST", (pathParams) => {
  394. let { cluster_id, id, namespace, repo_url } = pathParams;
  395. if (repo_url) {
  396. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases?repo_url=${repo_url}`;
  397. }
  398. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases`;
  399. });
  400. const deployAddon = baseApi<
  401. {
  402. template_name: string;
  403. template_version: string;
  404. values?: any;
  405. name: string;
  406. },
  407. {
  408. id: number;
  409. cluster_id: number;
  410. namespace: string;
  411. repo_url?: string;
  412. }
  413. >("POST", (pathParams) => {
  414. let { cluster_id, id, namespace, repo_url } = pathParams;
  415. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/addons?repo_url=${repo_url}`;
  416. });
  417. const detectBuildpack = baseApi<
  418. {},
  419. {
  420. project_id: number;
  421. git_repo_id: number;
  422. kind: string;
  423. owner: string;
  424. name: string;
  425. branch: string;
  426. }
  427. >("GET", (pathParams) => {
  428. return `/api/projects/${pathParams.project_id}/gitrepos/${
  429. pathParams.git_repo_id
  430. }/repos/${pathParams.kind}/${pathParams.owner}/${
  431. pathParams.name
  432. }/${encodeURIComponent(pathParams.branch)}/buildpack/detect`;
  433. });
  434. const getBranchContents = baseApi<
  435. {
  436. dir: string;
  437. },
  438. {
  439. project_id: number;
  440. git_repo_id: number;
  441. kind: string;
  442. owner: string;
  443. name: string;
  444. branch: string;
  445. }
  446. >("GET", (pathParams) => {
  447. return `/api/projects/${pathParams.project_id}/gitrepos/${
  448. pathParams.git_repo_id
  449. }/repos/${pathParams.kind}/${pathParams.owner}/${
  450. pathParams.name
  451. }/${encodeURIComponent(pathParams.branch)}/contents`;
  452. });
  453. const getProcfileContents = baseApi<
  454. {
  455. path: string;
  456. },
  457. {
  458. project_id: number;
  459. git_repo_id: number;
  460. kind: string;
  461. owner: string;
  462. name: string;
  463. branch: string;
  464. }
  465. >("GET", (pathParams) => {
  466. return `/api/projects/${pathParams.project_id}/gitrepos/${
  467. pathParams.git_repo_id
  468. }/repos/${pathParams.kind}/${pathParams.owner}/${
  469. pathParams.name
  470. }/${encodeURIComponent(pathParams.branch)}/procfile`;
  471. });
  472. const getBranches = baseApi<
  473. {},
  474. {
  475. project_id: number;
  476. git_repo_id: number;
  477. kind: string;
  478. owner: string;
  479. name: string;
  480. }
  481. >("GET", (pathParams) => {
  482. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos/${pathParams.kind}/${pathParams.owner}/${pathParams.name}/branches`;
  483. });
  484. const getChart = baseApi<
  485. {},
  486. {
  487. id: number;
  488. cluster_id: number;
  489. namespace: string;
  490. name: string;
  491. revision: number;
  492. }
  493. >("GET", (pathParams) => {
  494. let { id, cluster_id, namespace, name, revision } = pathParams;
  495. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}`;
  496. });
  497. const getCharts = baseApi<
  498. {
  499. limit: number;
  500. skip: number;
  501. byDate: boolean;
  502. statusFilter: string[];
  503. },
  504. {
  505. id: number;
  506. cluster_id: number;
  507. namespace: string;
  508. }
  509. >("GET", (pathParams) => {
  510. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/releases`;
  511. });
  512. const getChartComponents = baseApi<
  513. {},
  514. {
  515. id: number;
  516. cluster_id: number;
  517. namespace: string;
  518. name: string;
  519. revision: number;
  520. }
  521. >("GET", (pathParams) => {
  522. let { id, cluster_id, namespace, name, revision } = pathParams;
  523. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/components`;
  524. });
  525. const getChartControllers = baseApi<
  526. {},
  527. {
  528. id: number;
  529. cluster_id: number;
  530. namespace: string;
  531. name: string;
  532. revision: number;
  533. }
  534. >("GET", (pathParams) => {
  535. let { id, cluster_id, namespace, name, revision } = pathParams;
  536. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/${revision}/controllers`;
  537. });
  538. const getClusterIntegrations = baseApi("GET", "/api/integrations/cluster");
  539. const getClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
  540. return `/api/projects/${pathParams.id}/clusters`;
  541. });
  542. const getCluster = baseApi<
  543. {},
  544. {
  545. project_id: number;
  546. cluster_id: number;
  547. }
  548. >("GET", (pathParams) => {
  549. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}`;
  550. });
  551. const getClusterNodes = baseApi<
  552. {},
  553. {
  554. project_id: number;
  555. cluster_id: number;
  556. }
  557. >("GET", (pathParams) => {
  558. return `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes`;
  559. });
  560. const getClusterNode = baseApi<
  561. {},
  562. {
  563. project_id: number;
  564. cluster_id: number;
  565. nodeName: string;
  566. }
  567. >(
  568. "GET",
  569. (pathParams) =>
  570. `/api/projects/${pathParams.project_id}/clusters/${pathParams.cluster_id}/nodes/${pathParams.nodeName}`
  571. );
  572. const getGitRepoList = baseApi<
  573. {},
  574. {
  575. project_id: number;
  576. git_repo_id: number;
  577. }
  578. >("GET", (pathParams) => {
  579. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/repos`;
  580. });
  581. const getGitRepoPermission = baseApi<
  582. {},
  583. {
  584. project_id: number;
  585. git_repo_id: number;
  586. }
  587. >("GET", (pathParams) => {
  588. return `/api/projects/${pathParams.project_id}/gitrepos/${pathParams.git_repo_id}/permissions`;
  589. });
  590. const getGitRepos = baseApi<
  591. {},
  592. {
  593. project_id: number;
  594. }
  595. >("GET", (pathParams) => {
  596. return `/api/projects/${pathParams.project_id}/gitrepos`;
  597. });
  598. const getImageRepos = baseApi<
  599. {},
  600. {
  601. project_id: number;
  602. registry_id: number;
  603. }
  604. >("GET", (pathParams) => {
  605. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories`;
  606. });
  607. const getImageTags = baseApi<
  608. {},
  609. {
  610. project_id: number;
  611. registry_id: number;
  612. repo_name: string;
  613. }
  614. >("GET", (pathParams) => {
  615. return `/api/projects/${pathParams.project_id}/registries/${pathParams.registry_id}/repositories/${pathParams.repo_name}`;
  616. });
  617. const getInfra = baseApi<
  618. {},
  619. {
  620. project_id: number;
  621. }
  622. >("GET", (pathParams) => {
  623. return `/api/projects/${pathParams.project_id}/infra`;
  624. });
  625. const getInfraDesired = baseApi<
  626. {},
  627. {
  628. project_id: number;
  629. infra_id: number;
  630. }
  631. >("GET", (pathParams) => {
  632. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/desired`;
  633. });
  634. const getInfraCurrent = baseApi<
  635. {},
  636. {
  637. project_id: number;
  638. infra_id: number;
  639. }
  640. >("GET", (pathParams) => {
  641. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}/current`;
  642. });
  643. const getIngress = baseApi<
  644. {},
  645. { namespace: string; cluster_id: number; name: string; id: number }
  646. >("GET", (pathParams) => {
  647. let { id, name, cluster_id, namespace } = pathParams;
  648. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/ingresses/${name}`;
  649. });
  650. const getInvites = baseApi<{}, { id: number }>("GET", (pathParams) => {
  651. return `/api/projects/${pathParams.id}/invites`;
  652. });
  653. const getJobs = baseApi<
  654. {},
  655. { namespace: string; cluster_id: number; release_name: string; id: number }
  656. >("GET", (pathParams) => {
  657. let { id, release_name, cluster_id, namespace } = pathParams;
  658. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs`;
  659. });
  660. const getJobStatus = baseApi<
  661. {},
  662. { namespace: string; cluster_id: number; release_name: string; id: number }
  663. >("GET", (pathParams) => {
  664. let { id, release_name, cluster_id, namespace } = pathParams;
  665. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${release_name}/0/jobs/status`;
  666. });
  667. const getJobPods = baseApi<
  668. {},
  669. { name: string; namespace: string; id: number; cluster_id: number }
  670. >("GET", (pathParams) => {
  671. let { id, name, cluster_id, namespace } = pathParams;
  672. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/pods`;
  673. });
  674. const getPodByName = baseApi<
  675. {},
  676. {
  677. project_id: number;
  678. cluster_id: number;
  679. namespace: string;
  680. name: string;
  681. }
  682. >(
  683. "GET",
  684. ({ project_id, cluster_id, namespace, name }) =>
  685. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/pods/${name}`
  686. );
  687. const getMatchingPods = baseApi<
  688. {
  689. namespace: string;
  690. selectors: string[];
  691. },
  692. { id: number; cluster_id: number }
  693. >("GET", (pathParams) => {
  694. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/pods`;
  695. });
  696. const getMetrics = baseApi<
  697. {
  698. metric: string;
  699. shouldsum: boolean;
  700. pods?: string[];
  701. kind?: string; // the controller kind
  702. name?: string;
  703. percentile?: number;
  704. namespace: string;
  705. startrange: number;
  706. endrange: number;
  707. resolution: string;
  708. },
  709. {
  710. id: number;
  711. cluster_id: number;
  712. }
  713. >("GET", (pathParams) => {
  714. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/metrics`;
  715. });
  716. const getNamespaces = baseApi<
  717. {},
  718. {
  719. id: number;
  720. cluster_id: number;
  721. }
  722. >("GET", (pathParams) => {
  723. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces`;
  724. });
  725. const getNGINXIngresses = baseApi<
  726. {},
  727. {
  728. id: number;
  729. cluster_id: number;
  730. }
  731. >("GET", (pathParams) => {
  732. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/ingresses`;
  733. });
  734. const getOAuthIds = baseApi<
  735. {},
  736. {
  737. project_id: number;
  738. }
  739. >("GET", (pathParams) => {
  740. return `/api/projects/${pathParams.project_id}/integrations/oauth`;
  741. });
  742. const getProjectClusters = baseApi<{}, { id: number }>("GET", (pathParams) => {
  743. return `/api/projects/${pathParams.id}/clusters`;
  744. });
  745. const getProjectRegistries = baseApi<{}, { id: number }>(
  746. "GET",
  747. (pathParams) => {
  748. return `/api/projects/${pathParams.id}/registries`;
  749. }
  750. );
  751. const getProjectRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
  752. return `/api/projects/${pathParams.id}/repos`;
  753. });
  754. const getProjects = baseApi("GET", "/api/projects");
  755. const getPrometheusIsInstalled = baseApi<
  756. {},
  757. {
  758. id: number;
  759. cluster_id: number;
  760. }
  761. >("GET", (pathParams) => {
  762. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/prometheus/detect`;
  763. });
  764. const getRegistryIntegrations = baseApi("GET", "/api/integrations/registry");
  765. const getReleaseToken = baseApi<
  766. {},
  767. { name: string; id: number; namespace: string; cluster_id: number }
  768. >("GET", (pathParams) => {
  769. let { id, cluster_id, namespace, name } = pathParams;
  770. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/webhook`;
  771. });
  772. const getReleaseSteps = baseApi<
  773. {},
  774. { name: string; id: number; namespace: string; cluster_id: number }
  775. >("GET", (pathParams) => {
  776. let { id, cluster_id, namespace, name } = pathParams;
  777. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/steps`;
  778. });
  779. const destroyInfra = baseApi<
  780. {
  781. name: string;
  782. },
  783. {
  784. project_id: number;
  785. infra_id: number;
  786. }
  787. >("DELETE", (pathParams) => {
  788. return `/api/projects/${pathParams.project_id}/infras/${pathParams.infra_id}`;
  789. });
  790. const getRepoIntegrations = baseApi("GET", "/api/integrations/repo");
  791. const getRepos = baseApi<{}, { id: number }>("GET", (pathParams) => {
  792. return `/api/projects/${pathParams.id}/repos`;
  793. });
  794. const getSlackIntegrations = baseApi<{}, { id: number }>(
  795. "GET",
  796. (pathParams) => {
  797. return `/api/projects/${pathParams.id}/slack_integrations`;
  798. }
  799. );
  800. const getRevisions = baseApi<
  801. {},
  802. { id: number; cluster_id: number; namespace: string; name: string }
  803. >("GET", (pathParams) => {
  804. let { id, cluster_id, namespace, name } = pathParams;
  805. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/history`;
  806. });
  807. const getTemplateInfo = baseApi<
  808. {
  809. repo_url?: string;
  810. },
  811. { name: string; version: string }
  812. >("GET", (pathParams) => {
  813. return `/api/templates/${pathParams.name}/${pathParams.version}`;
  814. });
  815. const getTemplateUpgradeNotes = baseApi<
  816. {
  817. repo_url?: string;
  818. prev_version: string;
  819. },
  820. { name: string; version: string }
  821. >("GET", (pathParams) => {
  822. return `/api/templates/${pathParams.name}/${pathParams.version}/upgrade_notes`;
  823. });
  824. const getTemplates = baseApi<
  825. {
  826. repo_url?: string;
  827. },
  828. {}
  829. >("GET", "/api/templates");
  830. const getMetadata = baseApi<{}, {}>("GET", () => {
  831. return `/api/metadata`;
  832. });
  833. const postWelcome = baseApi<{
  834. email: string;
  835. isCompany: boolean;
  836. company: string;
  837. role: string;
  838. }>("POST", () => {
  839. return `/api/welcome`;
  840. });
  841. const linkGithubProject = baseApi<
  842. {},
  843. {
  844. project_id: number;
  845. }
  846. >("GET", (pathParams) => {
  847. return `/api/oauth/projects/${pathParams.project_id}/github`;
  848. });
  849. const getGithubAccounts = baseApi<{}, {}>("GET", () => {
  850. return `/api/integrations/github-app/accounts`;
  851. });
  852. const logInUser = baseApi<{
  853. email: string;
  854. password: string;
  855. }>("POST", "/api/login");
  856. const logOutUser = baseApi("POST", "/api/logout");
  857. const provisionECR = baseApi<
  858. {
  859. ecr_name: string;
  860. aws_integration_id: number;
  861. },
  862. { id: number }
  863. >("POST", (pathParams) => {
  864. return `/api/projects/${pathParams.id}/provision/ecr`;
  865. });
  866. const provisionEKS = baseApi<
  867. {
  868. eks_name: string;
  869. aws_integration_id: number;
  870. machine_type: string;
  871. issuer_email: string;
  872. },
  873. { id: number }
  874. >("POST", (pathParams) => {
  875. return `/api/projects/${pathParams.id}/provision/eks`;
  876. });
  877. const registerUser = baseApi<{
  878. email: string;
  879. password: string;
  880. }>("POST", "/api/users");
  881. const rollbackChart = baseApi<
  882. {
  883. revision: number;
  884. },
  885. {
  886. id: number;
  887. name: string;
  888. namespace: string;
  889. cluster_id: number;
  890. }
  891. >("POST", (pathParams) => {
  892. let { id, name, cluster_id, namespace } = pathParams;
  893. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/rollback`;
  894. });
  895. const uninstallTemplate = baseApi<
  896. {},
  897. {
  898. id: number;
  899. name: string;
  900. cluster_id: number;
  901. namespace: string;
  902. }
  903. >("DELETE", (pathParams) => {
  904. let { id, name, cluster_id, namespace } = pathParams;
  905. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0`;
  906. });
  907. const updateUser = baseApi<
  908. {
  909. rawKubeConfig?: string;
  910. allowedContexts?: string[];
  911. },
  912. { id: number }
  913. >("PUT", (pathParams) => {
  914. return `/api/users/${pathParams.id}`;
  915. });
  916. const upgradeChartValues = baseApi<
  917. {
  918. values: string;
  919. version?: string;
  920. },
  921. {
  922. id: number;
  923. name: string;
  924. namespace: string;
  925. cluster_id: number;
  926. }
  927. >("POST", (pathParams) => {
  928. let { id, name, cluster_id, namespace } = pathParams;
  929. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${name}/0/upgrade`;
  930. });
  931. const listConfigMaps = baseApi<
  932. {},
  933. {
  934. id: number;
  935. namespace: string;
  936. cluster_id: number;
  937. }
  938. >("GET", (pathParams) => {
  939. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/list`;
  940. });
  941. const getConfigMap = baseApi<
  942. {
  943. name: string;
  944. },
  945. {
  946. id: number;
  947. namespace: string;
  948. cluster_id: number;
  949. }
  950. >("GET", (pathParams) => {
  951. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap`;
  952. });
  953. const createConfigMap = baseApi<
  954. {
  955. name: string;
  956. variables: Record<string, string>;
  957. secret_variables?: Record<string, string>;
  958. },
  959. {
  960. id: number;
  961. cluster_id: number;
  962. namespace: string;
  963. }
  964. >("POST", (pathParams) => {
  965. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/create`;
  966. });
  967. const updateConfigMap = baseApi<
  968. {
  969. name: string;
  970. variables: Record<string, string>;
  971. secret_variables?: Record<string, string>;
  972. },
  973. {
  974. id: number;
  975. cluster_id: number;
  976. namespace: string;
  977. }
  978. >("POST", (pathParams) => {
  979. let { id, cluster_id } = pathParams;
  980. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/update`;
  981. });
  982. const renameConfigMap = baseApi<
  983. {
  984. name: string;
  985. new_name: string;
  986. },
  987. {
  988. id: number;
  989. cluster_id: number;
  990. namespace: string;
  991. }
  992. >("POST", (pathParams) => {
  993. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/rename`;
  994. });
  995. const deleteConfigMap = baseApi<
  996. {
  997. name: string;
  998. },
  999. {
  1000. id: number;
  1001. namespace: string;
  1002. cluster_id: number;
  1003. }
  1004. >("DELETE", (pathParams) => {
  1005. return `/api/projects/${pathParams.id}/clusters/${pathParams.cluster_id}/namespaces/${pathParams.namespace}/configmap/delete`;
  1006. });
  1007. const createNamespace = baseApi<
  1008. {
  1009. name: string;
  1010. },
  1011. { id: number; cluster_id: number }
  1012. >("POST", (pathParams) => {
  1013. let { id, cluster_id } = pathParams;
  1014. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/create`;
  1015. });
  1016. const deleteNamespace = baseApi<
  1017. {
  1018. name: string;
  1019. },
  1020. {
  1021. id: number;
  1022. cluster_id: number;
  1023. }
  1024. >("DELETE", (pathParams) => {
  1025. let { id, cluster_id } = pathParams;
  1026. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/delete`;
  1027. });
  1028. const deleteJob = baseApi<
  1029. {},
  1030. { name: string; namespace: string; id: number; cluster_id: number }
  1031. >("DELETE", (pathParams) => {
  1032. let { id, name, cluster_id, namespace } = pathParams;
  1033. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}`;
  1034. });
  1035. const stopJob = baseApi<
  1036. {},
  1037. { name: string; namespace: string; id: number; cluster_id: number }
  1038. >("POST", (pathParams) => {
  1039. let { id, name, namespace, cluster_id } = pathParams;
  1040. return `/api/projects/${id}/clusters/${cluster_id}/namespaces/${namespace}/jobs/${name}/stop`;
  1041. });
  1042. const getAvailableRoles = baseApi<{}, { project_id: number }>(
  1043. "GET",
  1044. ({ project_id }) => `/api/projects/${project_id}/roles`
  1045. );
  1046. const updateInvite = baseApi<
  1047. { kind: string },
  1048. { project_id: number; invite_id: number }
  1049. >(
  1050. "POST",
  1051. ({ project_id, invite_id }) =>
  1052. `/api/projects/${project_id}/invites/${invite_id}`
  1053. );
  1054. const getCollaborators = baseApi<{}, { project_id: number }>(
  1055. "GET",
  1056. ({ project_id }) => `/api/projects/${project_id}/collaborators`
  1057. );
  1058. const updateCollaborator = baseApi<
  1059. {
  1060. kind: string;
  1061. user_id: number;
  1062. },
  1063. { project_id: number }
  1064. >("POST", ({ project_id }) => `/api/projects/${project_id}/roles`);
  1065. const removeCollaborator = baseApi<{ user_id: number }, { project_id: number }>(
  1066. "DELETE",
  1067. ({ project_id }) => `/api/projects/${project_id}/roles`
  1068. );
  1069. const getPolicyDocument = baseApi<{}, { project_id: number }>(
  1070. "GET",
  1071. ({ project_id }) => `/api/projects/${project_id}/policy`
  1072. );
  1073. const createWebhookToken = baseApi<
  1074. {},
  1075. {
  1076. project_id: number;
  1077. chart_name: string;
  1078. namespace: string;
  1079. cluster_id: number;
  1080. }
  1081. >(
  1082. "POST",
  1083. ({ project_id, chart_name, namespace, cluster_id }) =>
  1084. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/releases/${chart_name}/0/webhook`
  1085. );
  1086. const getUsage = baseApi<{}, { project_id: number }>(
  1087. "GET",
  1088. ({ project_id }) => `/api/projects/${project_id}/usage`
  1089. );
  1090. // Used for billing purposes
  1091. const getCustomerToken = baseApi<{}, { project_id: number }>(
  1092. "GET",
  1093. ({ project_id }) => `/api/projects/${project_id}/billing/token`
  1094. );
  1095. const getHasBilling = baseApi<{}, { project_id: number }>(
  1096. "GET",
  1097. ({ project_id }) => `/api/projects/${project_id}/billing`
  1098. );
  1099. const getOnboardingState = baseApi<{}, { project_id: number }>(
  1100. "GET",
  1101. ({ project_id }) => `/api/projects/${project_id}/onboarding`
  1102. );
  1103. const saveOnboardingState = baseApi<{}, { project_id: number }>(
  1104. "POST",
  1105. ({ project_id }) => `/api/projects/${project_id}/onboarding`
  1106. );
  1107. const getOnboardingInfra = baseApi<
  1108. {},
  1109. { project_id: number; registry_infra_id: number }
  1110. >(
  1111. "GET",
  1112. ({ project_id, registry_infra_id }) =>
  1113. `/api/projects/${project_id}/infras/${registry_infra_id}`
  1114. );
  1115. const getOnboardingRegistry = baseApi<
  1116. {},
  1117. { project_id: number; registry_connection_id: number }
  1118. >(
  1119. "GET",
  1120. ({ project_id, registry_connection_id }) =>
  1121. `/api/projects/${project_id}/registries/${registry_connection_id}`
  1122. );
  1123. const detectPorterAgent = baseApi<
  1124. {},
  1125. { project_id: number; cluster_id: number }
  1126. >(
  1127. "GET",
  1128. ({ project_id, cluster_id }) =>
  1129. `/api/projects/${project_id}/clusters/${cluster_id}/agent/detect`
  1130. );
  1131. const installPorterAgent = baseApi<
  1132. {},
  1133. { project_id: number; cluster_id: number }
  1134. >(
  1135. "POST",
  1136. ({ cluster_id, project_id }) =>
  1137. `/api/projects/${project_id}/clusters/${cluster_id}/agent/install`
  1138. );
  1139. const getKubeEvents = baseApi<
  1140. {
  1141. skip: number;
  1142. resource_type: string;
  1143. owner_type?: string;
  1144. owner_name?: string;
  1145. namespace?: string;
  1146. },
  1147. { project_id: number; cluster_id: number }
  1148. >("GET", ({ project_id, cluster_id }) => {
  1149. return `/api/projects/${project_id}/clusters/${cluster_id}/kube_events`;
  1150. });
  1151. const getKubeEvent = baseApi<
  1152. {},
  1153. { project_id: number; cluster_id: number; kube_event_id: number }
  1154. >(
  1155. "GET",
  1156. ({ project_id, cluster_id, kube_event_id }) =>
  1157. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}`
  1158. );
  1159. const getLogBuckets = baseApi<
  1160. {},
  1161. { project_id: number; cluster_id: number; kube_event_id: number }
  1162. >(
  1163. "GET",
  1164. ({ project_id, cluster_id, kube_event_id }) =>
  1165. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}/log_buckets`
  1166. );
  1167. const getLogBucketLogs = baseApi<
  1168. { timestamp: number },
  1169. { project_id: number; cluster_id: number; kube_event_id: number }
  1170. >(
  1171. "GET",
  1172. ({ project_id, cluster_id, kube_event_id }) =>
  1173. `/api/projects/${project_id}/clusters/${cluster_id}/kube_events/${kube_event_id}/logs`
  1174. );
  1175. const getCanCreateProject = baseApi<{}, {}>(
  1176. "GET",
  1177. () => "/api/can_create_project"
  1178. );
  1179. const getPreviousLogsForContainer = baseApi<
  1180. {
  1181. container_name: string;
  1182. },
  1183. {
  1184. project_id: number;
  1185. cluster_id: number;
  1186. namespace: string;
  1187. pod_name: string;
  1188. }
  1189. >(
  1190. "GET",
  1191. ({ cluster_id, namespace, pod_name: name, project_id }) =>
  1192. `/api/projects/${project_id}/clusters/${cluster_id}/namespaces/${namespace}/pod/${name}/previous_logs`
  1193. );
  1194. // Bundle export to allow default api import (api.<method> is more readable)
  1195. export default {
  1196. checkAuth,
  1197. connectECRRegistry,
  1198. connectGCRRegistry,
  1199. connectDORegistry,
  1200. getAWSIntegration,
  1201. getGCPIntegration,
  1202. createAWSIntegration,
  1203. overwriteAWSIntegration,
  1204. createDOCR,
  1205. createDOKS,
  1206. createEmailVerification,
  1207. createEnvironment,
  1208. deleteEnvironment,
  1209. listEnvironments,
  1210. createGCPIntegration,
  1211. createGCR,
  1212. createGKE,
  1213. createInvite,
  1214. createNamespace,
  1215. createPasswordReset,
  1216. createPasswordResetVerify,
  1217. createPasswordResetFinalize,
  1218. createProject,
  1219. createConfigMap,
  1220. deleteCluster,
  1221. deleteConfigMap,
  1222. deleteInvite,
  1223. deleteNamespace,
  1224. deletePod,
  1225. deleteProject,
  1226. deleteRegistryIntegration,
  1227. deleteSlackIntegration,
  1228. updateNotificationConfig,
  1229. getNotificationConfig,
  1230. createSubdomain,
  1231. deployTemplate,
  1232. deployAddon,
  1233. destroyInfra,
  1234. detectBuildpack,
  1235. getBranchContents,
  1236. getBranches,
  1237. getMetadata,
  1238. postWelcome,
  1239. getChart,
  1240. getCharts,
  1241. getChartComponents,
  1242. getChartControllers,
  1243. getClusterIntegrations,
  1244. getClusters,
  1245. getCluster,
  1246. getClusterNodes,
  1247. getClusterNode,
  1248. getConfigMap,
  1249. getPRDeploymentList,
  1250. getPRDeploymentByCluster,
  1251. getPRDeployment,
  1252. getGHAWorkflowTemplate,
  1253. getGitRepoList,
  1254. getGitRepoPermission,
  1255. getGitRepos,
  1256. getImageRepos,
  1257. getImageTags,
  1258. getInfra,
  1259. getInfraDesired,
  1260. getInfraCurrent,
  1261. getIngress,
  1262. getInvites,
  1263. getJobs,
  1264. getJobStatus,
  1265. getJobPods,
  1266. getPodByName,
  1267. getMatchingPods,
  1268. getMetrics,
  1269. getNamespaces,
  1270. getNGINXIngresses,
  1271. getOAuthIds,
  1272. getPodEvents,
  1273. getProcfileContents,
  1274. getProjectClusters,
  1275. getProjectRegistries,
  1276. getProjectRepos,
  1277. getProjects,
  1278. getPrometheusIsInstalled,
  1279. getRegistryIntegrations,
  1280. getReleaseToken,
  1281. getReleaseSteps,
  1282. getRepoIntegrations,
  1283. getSlackIntegrations,
  1284. getRepos,
  1285. getRevisions,
  1286. getTemplateInfo,
  1287. getTemplateUpgradeNotes,
  1288. getTemplates,
  1289. linkGithubProject,
  1290. getGithubAccounts,
  1291. listConfigMaps,
  1292. logInUser,
  1293. logOutUser,
  1294. provisionECR,
  1295. provisionEKS,
  1296. registerUser,
  1297. rollbackChart,
  1298. uninstallTemplate,
  1299. updateUser,
  1300. renameConfigMap,
  1301. updateConfigMap,
  1302. upgradeChartValues,
  1303. deleteJob,
  1304. stopJob,
  1305. updateInvite,
  1306. getAvailableRoles,
  1307. getCollaborators,
  1308. updateCollaborator,
  1309. removeCollaborator,
  1310. getPolicyDocument,
  1311. createWebhookToken,
  1312. getUsage,
  1313. getCustomerToken,
  1314. getHasBilling,
  1315. getOnboardingState,
  1316. saveOnboardingState,
  1317. getOnboardingInfra,
  1318. getOnboardingRegistry,
  1319. detectPorterAgent,
  1320. installPorterAgent,
  1321. getKubeEvents,
  1322. getKubeEvent,
  1323. getLogBuckets,
  1324. getLogBucketLogs,
  1325. getCanCreateProject,
  1326. getPreviousLogsForContainer,
  1327. };