@taktoria/sdk 0.2.5 → 0.4.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 (378) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +41 -36
  4. package/dist/cjs/api/resources/geist/client/Client.d.ts +389 -0
  5. package/dist/cjs/api/resources/geist/client/Client.js +1779 -0
  6. package/dist/cjs/api/resources/geist/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/geist/client/index.js +17 -0
  8. package/dist/cjs/api/resources/geist/client/requests/DeleteSurveyRequest.d.ts +7 -0
  9. package/dist/cjs/api/resources/geist/client/requests/DeleteSurveyRequest.js +3 -0
  10. package/dist/cjs/api/resources/geist/client/requests/ListSurveyTemplatesRequest.d.ts +7 -0
  11. package/dist/cjs/api/resources/geist/client/requests/ListSurveyTemplatesRequest.js +3 -0
  12. package/dist/cjs/api/resources/geist/client/requests/ListSurveysRequest.d.ts +15 -0
  13. package/dist/cjs/api/resources/geist/client/requests/ListSurveysRequest.js +3 -0
  14. package/dist/cjs/api/resources/geist/client/requests/index.d.ts +3 -0
  15. package/dist/cjs/api/resources/geist/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/geist/exports.d.ts +2 -0
  17. package/dist/cjs/api/resources/geist/exports.js +21 -0
  18. package/dist/cjs/api/resources/geist/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/geist/index.js +18 -0
  20. package/dist/cjs/api/resources/geist/types/CreateSurveyRequest.d.ts +11 -0
  21. package/dist/cjs/api/resources/geist/types/CreateSurveyRequest.js +3 -0
  22. package/dist/cjs/api/resources/geist/types/SetQuestionsRequest.d.ts +4 -0
  23. package/dist/cjs/api/resources/geist/types/SetQuestionsRequest.js +3 -0
  24. package/dist/cjs/api/resources/geist/types/Survey.d.ts +13 -0
  25. package/dist/cjs/api/resources/geist/types/Survey.js +3 -0
  26. package/dist/cjs/api/resources/geist/types/SurveyAudience.d.ts +18 -0
  27. package/dist/cjs/api/resources/geist/types/SurveyAudience.js +21 -0
  28. package/dist/cjs/api/resources/geist/types/SurveyDimensionResult.d.ts +10 -0
  29. package/dist/cjs/api/resources/geist/types/SurveyDimensionResult.js +3 -0
  30. package/dist/cjs/api/resources/geist/types/SurveyInstrument.d.ts +15 -0
  31. package/dist/cjs/api/resources/geist/types/SurveyInstrument.js +3 -0
  32. package/dist/cjs/api/resources/geist/types/SurveyInstrumentDimension.d.ts +6 -0
  33. package/dist/cjs/api/resources/geist/types/SurveyInstrumentDimension.js +3 -0
  34. package/dist/cjs/api/resources/geist/types/SurveyInstrumentList.d.ts +4 -0
  35. package/dist/cjs/api/resources/geist/types/SurveyInstrumentList.js +3 -0
  36. package/dist/cjs/api/resources/geist/types/SurveyPage.d.ts +7 -0
  37. package/dist/cjs/api/resources/geist/types/SurveyPage.js +3 -0
  38. package/dist/cjs/api/resources/geist/types/SurveyPerson.d.ts +6 -0
  39. package/dist/cjs/api/resources/geist/types/SurveyPerson.js +3 -0
  40. package/dist/cjs/api/resources/geist/types/SurveyQuestion.d.ts +12 -0
  41. package/dist/cjs/api/resources/geist/types/SurveyQuestion.js +3 -0
  42. package/dist/cjs/api/resources/geist/types/SurveyQuestionInput.d.ts +16 -0
  43. package/dist/cjs/api/resources/geist/types/SurveyQuestionInput.js +3 -0
  44. package/dist/cjs/api/resources/geist/types/SurveyQuestionKind.d.ts +13 -0
  45. package/dist/cjs/api/resources/geist/types/SurveyQuestionKind.js +16 -0
  46. package/dist/cjs/api/resources/geist/types/SurveyQuestionResult.d.ts +19 -0
  47. package/dist/cjs/api/resources/geist/types/SurveyQuestionResult.js +3 -0
  48. package/dist/cjs/api/resources/geist/types/SurveyRecurrence.d.ts +9 -0
  49. package/dist/cjs/api/resources/geist/types/SurveyRecurrence.js +12 -0
  50. package/dist/cjs/api/resources/geist/types/SurveyRespondent.d.ts +5 -0
  51. package/dist/cjs/api/resources/geist/types/SurveyRespondent.js +3 -0
  52. package/dist/cjs/api/resources/geist/types/SurveyResults.d.ts +23 -0
  53. package/dist/cjs/api/resources/geist/types/SurveyResults.js +3 -0
  54. package/dist/cjs/api/resources/geist/types/SurveyResultsAccess.d.ts +9 -0
  55. package/dist/cjs/api/resources/geist/types/SurveyResultsAccess.js +12 -0
  56. package/dist/cjs/api/resources/geist/types/SurveyResultsSurvey.d.ts +14 -0
  57. package/dist/cjs/api/resources/geist/types/SurveyResultsSurvey.js +3 -0
  58. package/dist/cjs/api/resources/geist/types/SurveyRoundResult.d.ts +9 -0
  59. package/dist/cjs/api/resources/geist/types/SurveyRoundResult.js +3 -0
  60. package/dist/cjs/api/resources/geist/types/SurveyScaleKey.d.ts +23 -0
  61. package/dist/cjs/api/resources/geist/types/SurveyScaleKey.js +26 -0
  62. package/dist/cjs/api/resources/geist/types/SurveyStatus.d.ts +11 -0
  63. package/dist/cjs/api/resources/geist/types/SurveyStatus.js +14 -0
  64. package/dist/cjs/api/resources/geist/types/SurveySummary.d.ts +42 -0
  65. package/dist/cjs/api/resources/geist/types/SurveySummary.js +3 -0
  66. package/dist/cjs/api/resources/geist/types/SurveyTeam.d.ts +4 -0
  67. package/dist/cjs/api/resources/geist/types/SurveyTeam.js +3 -0
  68. package/dist/cjs/api/resources/geist/types/SurveyTeamResult.d.ts +10 -0
  69. package/dist/cjs/api/resources/geist/types/SurveyTeamResult.js +3 -0
  70. package/dist/cjs/api/resources/geist/types/SurveyTemplate.d.ts +13 -0
  71. package/dist/cjs/api/resources/geist/types/SurveyTemplate.js +3 -0
  72. package/dist/cjs/api/resources/geist/types/SurveyTemplateList.d.ts +4 -0
  73. package/dist/cjs/api/resources/geist/types/SurveyTemplateList.js +3 -0
  74. package/dist/cjs/api/resources/geist/types/SurveyTemplateRequest.d.ts +8 -0
  75. package/dist/cjs/api/resources/geist/types/SurveyTemplateRequest.js +3 -0
  76. package/dist/cjs/api/resources/geist/types/UpdateSurveyRequest.d.ts +28 -0
  77. package/dist/cjs/api/resources/geist/types/UpdateSurveyRequest.js +3 -0
  78. package/dist/cjs/api/resources/geist/types/index.d.ts +29 -0
  79. package/dist/cjs/api/resources/geist/types/index.js +45 -0
  80. package/dist/cjs/api/resources/index.d.ts +3 -0
  81. package/dist/cjs/api/resources/index.js +4 -1
  82. package/dist/cjs/api/resources/mcpConnections/client/Client.d.ts +2 -2
  83. package/dist/cjs/api/resources/mcpConnections/client/Client.js +2 -2
  84. package/dist/cjs/api/resources/mcpConnections/types/McpConnectionSettings.d.ts +3 -0
  85. package/dist/cjs/api/resources/mcpConnections/types/McpServer.d.ts +19 -0
  86. package/dist/cjs/api/resources/mcpConnections/types/McpServer.js +3 -0
  87. package/dist/cjs/api/resources/mcpConnections/types/index.d.ts +1 -0
  88. package/dist/cjs/api/resources/mcpConnections/types/index.js +1 -0
  89. package/dist/cjs/api/resources/platform/types/AppRoles.d.ts +2 -1
  90. package/dist/cjs/api/resources/platform/types/NotificationPreferences.d.ts +12 -0
  91. package/dist/cjs/api/resources/platform/types/UpdateNotificationPreferencesRequest.d.ts +3 -0
  92. package/dist/cjs/api/resources/search/types/SearchApp.d.ts +1 -0
  93. package/dist/cjs/api/resources/search/types/SearchApp.js +1 -0
  94. package/dist/cjs/api/resources/search/types/SearchGroupType.d.ts +2 -1
  95. package/dist/cjs/api/resources/search/types/SearchGroupType.js +2 -1
  96. package/dist/cjs/api/resources/search/types/SearchResult.d.ts +4 -1
  97. package/dist/cjs/api/resources/search/types/SearchSurvey.d.ts +11 -0
  98. package/dist/cjs/api/resources/search/types/SearchSurvey.js +3 -0
  99. package/dist/cjs/api/resources/search/types/index.d.ts +1 -0
  100. package/dist/cjs/api/resources/search/types/index.js +1 -0
  101. package/dist/cjs/serialization/resources/geist/index.d.ts +1 -0
  102. package/dist/cjs/serialization/resources/geist/index.js +17 -0
  103. package/dist/cjs/serialization/resources/geist/types/CreateSurveyRequest.d.ts +14 -0
  104. package/dist/cjs/serialization/resources/geist/types/CreateSurveyRequest.js +46 -0
  105. package/dist/cjs/serialization/resources/geist/types/SetQuestionsRequest.d.ts +10 -0
  106. package/dist/cjs/serialization/resources/geist/types/SetQuestionsRequest.js +42 -0
  107. package/dist/cjs/serialization/resources/geist/types/Survey.d.ts +18 -0
  108. package/dist/cjs/serialization/resources/geist/types/Survey.js +52 -0
  109. package/dist/cjs/serialization/resources/geist/types/SurveyAudience.d.ts +7 -0
  110. package/dist/cjs/serialization/resources/geist/types/SurveyAudience.js +39 -0
  111. package/dist/cjs/serialization/resources/geist/types/SurveyDimensionResult.d.ts +13 -0
  112. package/dist/cjs/serialization/resources/geist/types/SurveyDimensionResult.js +45 -0
  113. package/dist/cjs/serialization/resources/geist/types/SurveyInstrument.d.ts +17 -0
  114. package/dist/cjs/serialization/resources/geist/types/SurveyInstrument.js +49 -0
  115. package/dist/cjs/serialization/resources/geist/types/SurveyInstrumentDimension.d.ts +11 -0
  116. package/dist/cjs/serialization/resources/geist/types/SurveyInstrumentDimension.js +43 -0
  117. package/dist/cjs/serialization/resources/geist/types/SurveyInstrumentList.d.ts +10 -0
  118. package/dist/cjs/serialization/resources/geist/types/SurveyInstrumentList.js +42 -0
  119. package/dist/cjs/serialization/resources/geist/types/SurveyPage.d.ts +13 -0
  120. package/dist/cjs/serialization/resources/geist/types/SurveyPage.js +45 -0
  121. package/dist/cjs/serialization/resources/geist/types/SurveyPerson.d.ts +12 -0
  122. package/dist/cjs/serialization/resources/geist/types/SurveyPerson.js +44 -0
  123. package/dist/cjs/serialization/resources/geist/types/SurveyQuestion.d.ts +18 -0
  124. package/dist/cjs/serialization/resources/geist/types/SurveyQuestion.js +50 -0
  125. package/dist/cjs/serialization/resources/geist/types/SurveyQuestionInput.d.ts +17 -0
  126. package/dist/cjs/serialization/resources/geist/types/SurveyQuestionInput.js +49 -0
  127. package/dist/cjs/serialization/resources/geist/types/SurveyQuestionKind.d.ts +7 -0
  128. package/dist/cjs/serialization/resources/geist/types/SurveyQuestionKind.js +39 -0
  129. package/dist/cjs/serialization/resources/geist/types/SurveyQuestionResult.d.ts +21 -0
  130. package/dist/cjs/serialization/resources/geist/types/SurveyQuestionResult.js +53 -0
  131. package/dist/cjs/serialization/resources/geist/types/SurveyRecurrence.d.ts +7 -0
  132. package/dist/cjs/serialization/resources/geist/types/SurveyRecurrence.js +39 -0
  133. package/dist/cjs/serialization/resources/geist/types/SurveyRespondent.d.ts +11 -0
  134. package/dist/cjs/serialization/resources/geist/types/SurveyRespondent.js +43 -0
  135. package/dist/cjs/serialization/resources/geist/types/SurveyResults.d.ts +25 -0
  136. package/dist/cjs/serialization/resources/geist/types/SurveyResults.js +57 -0
  137. package/dist/cjs/serialization/resources/geist/types/SurveyResultsAccess.d.ts +7 -0
  138. package/dist/cjs/serialization/resources/geist/types/SurveyResultsAccess.js +39 -0
  139. package/dist/cjs/serialization/resources/geist/types/SurveyResultsSurvey.d.ts +20 -0
  140. package/dist/cjs/serialization/resources/geist/types/SurveyResultsSurvey.js +52 -0
  141. package/dist/cjs/serialization/resources/geist/types/SurveyRoundResult.d.ts +15 -0
  142. package/dist/cjs/serialization/resources/geist/types/SurveyRoundResult.js +47 -0
  143. package/dist/cjs/serialization/resources/geist/types/SurveyScaleKey.d.ts +7 -0
  144. package/dist/cjs/serialization/resources/geist/types/SurveyScaleKey.js +54 -0
  145. package/dist/cjs/serialization/resources/geist/types/SurveyStatus.d.ts +7 -0
  146. package/dist/cjs/serialization/resources/geist/types/SurveyStatus.js +39 -0
  147. package/dist/cjs/serialization/resources/geist/types/SurveySummary.d.ts +39 -0
  148. package/dist/cjs/serialization/resources/geist/types/SurveySummary.js +71 -0
  149. package/dist/cjs/serialization/resources/geist/types/SurveyTeam.d.ts +10 -0
  150. package/dist/cjs/serialization/resources/geist/types/SurveyTeam.js +42 -0
  151. package/dist/cjs/serialization/resources/geist/types/SurveyTeamResult.d.ts +15 -0
  152. package/dist/cjs/serialization/resources/geist/types/SurveyTeamResult.js +47 -0
  153. package/dist/cjs/serialization/resources/geist/types/SurveyTemplate.d.ts +19 -0
  154. package/dist/cjs/serialization/resources/geist/types/SurveyTemplate.js +51 -0
  155. package/dist/cjs/serialization/resources/geist/types/SurveyTemplateList.d.ts +10 -0
  156. package/dist/cjs/serialization/resources/geist/types/SurveyTemplateList.js +42 -0
  157. package/dist/cjs/serialization/resources/geist/types/SurveyTemplateRequest.d.ts +14 -0
  158. package/dist/cjs/serialization/resources/geist/types/SurveyTemplateRequest.js +46 -0
  159. package/dist/cjs/serialization/resources/geist/types/UpdateSurveyRequest.d.ts +27 -0
  160. package/dist/cjs/serialization/resources/geist/types/UpdateSurveyRequest.js +59 -0
  161. package/dist/cjs/serialization/resources/geist/types/index.d.ts +29 -0
  162. package/dist/cjs/serialization/resources/geist/types/index.js +45 -0
  163. package/dist/cjs/serialization/resources/index.d.ts +2 -0
  164. package/dist/cjs/serialization/resources/index.js +3 -1
  165. package/dist/cjs/serialization/resources/mcpConnections/types/McpConnectionSettings.d.ts +2 -0
  166. package/dist/cjs/serialization/resources/mcpConnections/types/McpConnectionSettings.js +2 -0
  167. package/dist/cjs/serialization/resources/mcpConnections/types/McpServer.d.ts +12 -0
  168. package/dist/cjs/serialization/resources/mcpConnections/types/McpServer.js +44 -0
  169. package/dist/cjs/serialization/resources/mcpConnections/types/index.d.ts +1 -0
  170. package/dist/cjs/serialization/resources/mcpConnections/types/index.js +1 -0
  171. package/dist/cjs/serialization/resources/platform/types/AppRoles.d.ts +1 -0
  172. package/dist/cjs/serialization/resources/platform/types/AppRoles.js +1 -0
  173. package/dist/cjs/serialization/resources/platform/types/NotificationPreferences.d.ts +3 -0
  174. package/dist/cjs/serialization/resources/platform/types/NotificationPreferences.js +3 -0
  175. package/dist/cjs/serialization/resources/platform/types/UpdateNotificationPreferencesRequest.d.ts +3 -0
  176. package/dist/cjs/serialization/resources/platform/types/UpdateNotificationPreferencesRequest.js +3 -0
  177. package/dist/cjs/serialization/resources/search/types/SearchApp.d.ts +1 -1
  178. package/dist/cjs/serialization/resources/search/types/SearchApp.js +1 -1
  179. package/dist/cjs/serialization/resources/search/types/SearchGroupType.d.ts +1 -1
  180. package/dist/cjs/serialization/resources/search/types/SearchGroupType.js +1 -0
  181. package/dist/cjs/serialization/resources/search/types/SearchResult.d.ts +5 -1
  182. package/dist/cjs/serialization/resources/search/types/SearchResult.js +2 -0
  183. package/dist/cjs/serialization/resources/search/types/SearchSurvey.d.ts +14 -0
  184. package/dist/cjs/serialization/resources/search/types/SearchSurvey.js +46 -0
  185. package/dist/cjs/serialization/resources/search/types/index.d.ts +1 -0
  186. package/dist/cjs/serialization/resources/search/types/index.js +1 -0
  187. package/dist/cjs/version.d.ts +1 -1
  188. package/dist/cjs/version.js +1 -1
  189. package/dist/esm/BaseClient.mjs +2 -2
  190. package/dist/esm/Client.d.mts +3 -0
  191. package/dist/esm/Client.mjs +5 -0
  192. package/dist/esm/api/resources/geist/client/Client.d.mts +389 -0
  193. package/dist/esm/api/resources/geist/client/Client.mjs +1742 -0
  194. package/dist/esm/api/resources/geist/client/index.d.mts +1 -0
  195. package/dist/esm/api/resources/geist/client/index.mjs +1 -0
  196. package/dist/esm/api/resources/geist/client/requests/DeleteSurveyRequest.d.mts +7 -0
  197. package/dist/esm/api/resources/geist/client/requests/DeleteSurveyRequest.mjs +2 -0
  198. package/dist/esm/api/resources/geist/client/requests/ListSurveyTemplatesRequest.d.mts +7 -0
  199. package/dist/esm/api/resources/geist/client/requests/ListSurveyTemplatesRequest.mjs +2 -0
  200. package/dist/esm/api/resources/geist/client/requests/ListSurveysRequest.d.mts +15 -0
  201. package/dist/esm/api/resources/geist/client/requests/ListSurveysRequest.mjs +2 -0
  202. package/dist/esm/api/resources/geist/client/requests/index.d.mts +3 -0
  203. package/dist/esm/api/resources/geist/client/requests/index.mjs +1 -0
  204. package/dist/esm/api/resources/geist/exports.d.mts +2 -0
  205. package/dist/esm/api/resources/geist/exports.mjs +3 -0
  206. package/dist/esm/api/resources/geist/index.d.mts +2 -0
  207. package/dist/esm/api/resources/geist/index.mjs +2 -0
  208. package/dist/esm/api/resources/geist/types/CreateSurveyRequest.d.mts +11 -0
  209. package/dist/esm/api/resources/geist/types/CreateSurveyRequest.mjs +2 -0
  210. package/dist/esm/api/resources/geist/types/SetQuestionsRequest.d.mts +4 -0
  211. package/dist/esm/api/resources/geist/types/SetQuestionsRequest.mjs +2 -0
  212. package/dist/esm/api/resources/geist/types/Survey.d.mts +13 -0
  213. package/dist/esm/api/resources/geist/types/Survey.mjs +2 -0
  214. package/dist/esm/api/resources/geist/types/SurveyAudience.d.mts +18 -0
  215. package/dist/esm/api/resources/geist/types/SurveyAudience.mjs +18 -0
  216. package/dist/esm/api/resources/geist/types/SurveyDimensionResult.d.mts +10 -0
  217. package/dist/esm/api/resources/geist/types/SurveyDimensionResult.mjs +2 -0
  218. package/dist/esm/api/resources/geist/types/SurveyInstrument.d.mts +15 -0
  219. package/dist/esm/api/resources/geist/types/SurveyInstrument.mjs +2 -0
  220. package/dist/esm/api/resources/geist/types/SurveyInstrumentDimension.d.mts +6 -0
  221. package/dist/esm/api/resources/geist/types/SurveyInstrumentDimension.mjs +2 -0
  222. package/dist/esm/api/resources/geist/types/SurveyInstrumentList.d.mts +4 -0
  223. package/dist/esm/api/resources/geist/types/SurveyInstrumentList.mjs +2 -0
  224. package/dist/esm/api/resources/geist/types/SurveyPage.d.mts +7 -0
  225. package/dist/esm/api/resources/geist/types/SurveyPage.mjs +2 -0
  226. package/dist/esm/api/resources/geist/types/SurveyPerson.d.mts +6 -0
  227. package/dist/esm/api/resources/geist/types/SurveyPerson.mjs +2 -0
  228. package/dist/esm/api/resources/geist/types/SurveyQuestion.d.mts +12 -0
  229. package/dist/esm/api/resources/geist/types/SurveyQuestion.mjs +2 -0
  230. package/dist/esm/api/resources/geist/types/SurveyQuestionInput.d.mts +16 -0
  231. package/dist/esm/api/resources/geist/types/SurveyQuestionInput.mjs +2 -0
  232. package/dist/esm/api/resources/geist/types/SurveyQuestionKind.d.mts +13 -0
  233. package/dist/esm/api/resources/geist/types/SurveyQuestionKind.mjs +13 -0
  234. package/dist/esm/api/resources/geist/types/SurveyQuestionResult.d.mts +19 -0
  235. package/dist/esm/api/resources/geist/types/SurveyQuestionResult.mjs +2 -0
  236. package/dist/esm/api/resources/geist/types/SurveyRecurrence.d.mts +9 -0
  237. package/dist/esm/api/resources/geist/types/SurveyRecurrence.mjs +9 -0
  238. package/dist/esm/api/resources/geist/types/SurveyRespondent.d.mts +5 -0
  239. package/dist/esm/api/resources/geist/types/SurveyRespondent.mjs +2 -0
  240. package/dist/esm/api/resources/geist/types/SurveyResults.d.mts +23 -0
  241. package/dist/esm/api/resources/geist/types/SurveyResults.mjs +2 -0
  242. package/dist/esm/api/resources/geist/types/SurveyResultsAccess.d.mts +9 -0
  243. package/dist/esm/api/resources/geist/types/SurveyResultsAccess.mjs +9 -0
  244. package/dist/esm/api/resources/geist/types/SurveyResultsSurvey.d.mts +14 -0
  245. package/dist/esm/api/resources/geist/types/SurveyResultsSurvey.mjs +2 -0
  246. package/dist/esm/api/resources/geist/types/SurveyRoundResult.d.mts +9 -0
  247. package/dist/esm/api/resources/geist/types/SurveyRoundResult.mjs +2 -0
  248. package/dist/esm/api/resources/geist/types/SurveyScaleKey.d.mts +23 -0
  249. package/dist/esm/api/resources/geist/types/SurveyScaleKey.mjs +23 -0
  250. package/dist/esm/api/resources/geist/types/SurveyStatus.d.mts +11 -0
  251. package/dist/esm/api/resources/geist/types/SurveyStatus.mjs +11 -0
  252. package/dist/esm/api/resources/geist/types/SurveySummary.d.mts +42 -0
  253. package/dist/esm/api/resources/geist/types/SurveySummary.mjs +2 -0
  254. package/dist/esm/api/resources/geist/types/SurveyTeam.d.mts +4 -0
  255. package/dist/esm/api/resources/geist/types/SurveyTeam.mjs +2 -0
  256. package/dist/esm/api/resources/geist/types/SurveyTeamResult.d.mts +10 -0
  257. package/dist/esm/api/resources/geist/types/SurveyTeamResult.mjs +2 -0
  258. package/dist/esm/api/resources/geist/types/SurveyTemplate.d.mts +13 -0
  259. package/dist/esm/api/resources/geist/types/SurveyTemplate.mjs +2 -0
  260. package/dist/esm/api/resources/geist/types/SurveyTemplateList.d.mts +4 -0
  261. package/dist/esm/api/resources/geist/types/SurveyTemplateList.mjs +2 -0
  262. package/dist/esm/api/resources/geist/types/SurveyTemplateRequest.d.mts +8 -0
  263. package/dist/esm/api/resources/geist/types/SurveyTemplateRequest.mjs +2 -0
  264. package/dist/esm/api/resources/geist/types/UpdateSurveyRequest.d.mts +28 -0
  265. package/dist/esm/api/resources/geist/types/UpdateSurveyRequest.mjs +2 -0
  266. package/dist/esm/api/resources/geist/types/index.d.mts +29 -0
  267. package/dist/esm/api/resources/geist/types/index.mjs +29 -0
  268. package/dist/esm/api/resources/index.d.mts +3 -0
  269. package/dist/esm/api/resources/index.mjs +3 -0
  270. package/dist/esm/api/resources/mcpConnections/client/Client.d.mts +2 -2
  271. package/dist/esm/api/resources/mcpConnections/client/Client.mjs +2 -2
  272. package/dist/esm/api/resources/mcpConnections/types/McpConnectionSettings.d.mts +3 -0
  273. package/dist/esm/api/resources/mcpConnections/types/McpServer.d.mts +19 -0
  274. package/dist/esm/api/resources/mcpConnections/types/McpServer.mjs +2 -0
  275. package/dist/esm/api/resources/mcpConnections/types/index.d.mts +1 -0
  276. package/dist/esm/api/resources/mcpConnections/types/index.mjs +1 -0
  277. package/dist/esm/api/resources/platform/types/AppRoles.d.mts +2 -1
  278. package/dist/esm/api/resources/platform/types/NotificationPreferences.d.mts +12 -0
  279. package/dist/esm/api/resources/platform/types/UpdateNotificationPreferencesRequest.d.mts +3 -0
  280. package/dist/esm/api/resources/search/types/SearchApp.d.mts +1 -0
  281. package/dist/esm/api/resources/search/types/SearchApp.mjs +1 -0
  282. package/dist/esm/api/resources/search/types/SearchGroupType.d.mts +2 -1
  283. package/dist/esm/api/resources/search/types/SearchGroupType.mjs +2 -1
  284. package/dist/esm/api/resources/search/types/SearchResult.d.mts +4 -1
  285. package/dist/esm/api/resources/search/types/SearchSurvey.d.mts +11 -0
  286. package/dist/esm/api/resources/search/types/SearchSurvey.mjs +2 -0
  287. package/dist/esm/api/resources/search/types/index.d.mts +1 -0
  288. package/dist/esm/api/resources/search/types/index.mjs +1 -0
  289. package/dist/esm/serialization/resources/geist/index.d.mts +1 -0
  290. package/dist/esm/serialization/resources/geist/index.mjs +1 -0
  291. package/dist/esm/serialization/resources/geist/types/CreateSurveyRequest.d.mts +14 -0
  292. package/dist/esm/serialization/resources/geist/types/CreateSurveyRequest.mjs +10 -0
  293. package/dist/esm/serialization/resources/geist/types/SetQuestionsRequest.d.mts +10 -0
  294. package/dist/esm/serialization/resources/geist/types/SetQuestionsRequest.mjs +6 -0
  295. package/dist/esm/serialization/resources/geist/types/Survey.d.mts +18 -0
  296. package/dist/esm/serialization/resources/geist/types/Survey.mjs +16 -0
  297. package/dist/esm/serialization/resources/geist/types/SurveyAudience.d.mts +7 -0
  298. package/dist/esm/serialization/resources/geist/types/SurveyAudience.mjs +3 -0
  299. package/dist/esm/serialization/resources/geist/types/SurveyDimensionResult.d.mts +13 -0
  300. package/dist/esm/serialization/resources/geist/types/SurveyDimensionResult.mjs +9 -0
  301. package/dist/esm/serialization/resources/geist/types/SurveyInstrument.d.mts +17 -0
  302. package/dist/esm/serialization/resources/geist/types/SurveyInstrument.mjs +13 -0
  303. package/dist/esm/serialization/resources/geist/types/SurveyInstrumentDimension.d.mts +11 -0
  304. package/dist/esm/serialization/resources/geist/types/SurveyInstrumentDimension.mjs +7 -0
  305. package/dist/esm/serialization/resources/geist/types/SurveyInstrumentList.d.mts +10 -0
  306. package/dist/esm/serialization/resources/geist/types/SurveyInstrumentList.mjs +6 -0
  307. package/dist/esm/serialization/resources/geist/types/SurveyPage.d.mts +13 -0
  308. package/dist/esm/serialization/resources/geist/types/SurveyPage.mjs +9 -0
  309. package/dist/esm/serialization/resources/geist/types/SurveyPerson.d.mts +12 -0
  310. package/dist/esm/serialization/resources/geist/types/SurveyPerson.mjs +8 -0
  311. package/dist/esm/serialization/resources/geist/types/SurveyQuestion.d.mts +18 -0
  312. package/dist/esm/serialization/resources/geist/types/SurveyQuestion.mjs +14 -0
  313. package/dist/esm/serialization/resources/geist/types/SurveyQuestionInput.d.mts +17 -0
  314. package/dist/esm/serialization/resources/geist/types/SurveyQuestionInput.mjs +13 -0
  315. package/dist/esm/serialization/resources/geist/types/SurveyQuestionKind.d.mts +7 -0
  316. package/dist/esm/serialization/resources/geist/types/SurveyQuestionKind.mjs +3 -0
  317. package/dist/esm/serialization/resources/geist/types/SurveyQuestionResult.d.mts +21 -0
  318. package/dist/esm/serialization/resources/geist/types/SurveyQuestionResult.mjs +17 -0
  319. package/dist/esm/serialization/resources/geist/types/SurveyRecurrence.d.mts +7 -0
  320. package/dist/esm/serialization/resources/geist/types/SurveyRecurrence.mjs +3 -0
  321. package/dist/esm/serialization/resources/geist/types/SurveyRespondent.d.mts +11 -0
  322. package/dist/esm/serialization/resources/geist/types/SurveyRespondent.mjs +7 -0
  323. package/dist/esm/serialization/resources/geist/types/SurveyResults.d.mts +25 -0
  324. package/dist/esm/serialization/resources/geist/types/SurveyResults.mjs +21 -0
  325. package/dist/esm/serialization/resources/geist/types/SurveyResultsAccess.d.mts +7 -0
  326. package/dist/esm/serialization/resources/geist/types/SurveyResultsAccess.mjs +3 -0
  327. package/dist/esm/serialization/resources/geist/types/SurveyResultsSurvey.d.mts +20 -0
  328. package/dist/esm/serialization/resources/geist/types/SurveyResultsSurvey.mjs +16 -0
  329. package/dist/esm/serialization/resources/geist/types/SurveyRoundResult.d.mts +15 -0
  330. package/dist/esm/serialization/resources/geist/types/SurveyRoundResult.mjs +11 -0
  331. package/dist/esm/serialization/resources/geist/types/SurveyScaleKey.d.mts +7 -0
  332. package/dist/esm/serialization/resources/geist/types/SurveyScaleKey.mjs +18 -0
  333. package/dist/esm/serialization/resources/geist/types/SurveyStatus.d.mts +7 -0
  334. package/dist/esm/serialization/resources/geist/types/SurveyStatus.mjs +3 -0
  335. package/dist/esm/serialization/resources/geist/types/SurveySummary.d.mts +39 -0
  336. package/dist/esm/serialization/resources/geist/types/SurveySummary.mjs +35 -0
  337. package/dist/esm/serialization/resources/geist/types/SurveyTeam.d.mts +10 -0
  338. package/dist/esm/serialization/resources/geist/types/SurveyTeam.mjs +6 -0
  339. package/dist/esm/serialization/resources/geist/types/SurveyTeamResult.d.mts +15 -0
  340. package/dist/esm/serialization/resources/geist/types/SurveyTeamResult.mjs +11 -0
  341. package/dist/esm/serialization/resources/geist/types/SurveyTemplate.d.mts +19 -0
  342. package/dist/esm/serialization/resources/geist/types/SurveyTemplate.mjs +15 -0
  343. package/dist/esm/serialization/resources/geist/types/SurveyTemplateList.d.mts +10 -0
  344. package/dist/esm/serialization/resources/geist/types/SurveyTemplateList.mjs +6 -0
  345. package/dist/esm/serialization/resources/geist/types/SurveyTemplateRequest.d.mts +14 -0
  346. package/dist/esm/serialization/resources/geist/types/SurveyTemplateRequest.mjs +10 -0
  347. package/dist/esm/serialization/resources/geist/types/UpdateSurveyRequest.d.mts +27 -0
  348. package/dist/esm/serialization/resources/geist/types/UpdateSurveyRequest.mjs +23 -0
  349. package/dist/esm/serialization/resources/geist/types/index.d.mts +29 -0
  350. package/dist/esm/serialization/resources/geist/types/index.mjs +29 -0
  351. package/dist/esm/serialization/resources/index.d.mts +2 -0
  352. package/dist/esm/serialization/resources/index.mjs +2 -0
  353. package/dist/esm/serialization/resources/mcpConnections/types/McpConnectionSettings.d.mts +2 -0
  354. package/dist/esm/serialization/resources/mcpConnections/types/McpConnectionSettings.mjs +2 -0
  355. package/dist/esm/serialization/resources/mcpConnections/types/McpServer.d.mts +12 -0
  356. package/dist/esm/serialization/resources/mcpConnections/types/McpServer.mjs +8 -0
  357. package/dist/esm/serialization/resources/mcpConnections/types/index.d.mts +1 -0
  358. package/dist/esm/serialization/resources/mcpConnections/types/index.mjs +1 -0
  359. package/dist/esm/serialization/resources/platform/types/AppRoles.d.mts +1 -0
  360. package/dist/esm/serialization/resources/platform/types/AppRoles.mjs +1 -0
  361. package/dist/esm/serialization/resources/platform/types/NotificationPreferences.d.mts +3 -0
  362. package/dist/esm/serialization/resources/platform/types/NotificationPreferences.mjs +3 -0
  363. package/dist/esm/serialization/resources/platform/types/UpdateNotificationPreferencesRequest.d.mts +3 -0
  364. package/dist/esm/serialization/resources/platform/types/UpdateNotificationPreferencesRequest.mjs +3 -0
  365. package/dist/esm/serialization/resources/search/types/SearchApp.d.mts +1 -1
  366. package/dist/esm/serialization/resources/search/types/SearchApp.mjs +1 -1
  367. package/dist/esm/serialization/resources/search/types/SearchGroupType.d.mts +1 -1
  368. package/dist/esm/serialization/resources/search/types/SearchGroupType.mjs +1 -0
  369. package/dist/esm/serialization/resources/search/types/SearchResult.d.mts +5 -1
  370. package/dist/esm/serialization/resources/search/types/SearchResult.mjs +2 -0
  371. package/dist/esm/serialization/resources/search/types/SearchSurvey.d.mts +14 -0
  372. package/dist/esm/serialization/resources/search/types/SearchSurvey.mjs +10 -0
  373. package/dist/esm/serialization/resources/search/types/index.d.mts +1 -0
  374. package/dist/esm/serialization/resources/search/types/index.mjs +1 -0
  375. package/dist/esm/version.d.mts +1 -1
  376. package/dist/esm/version.mjs +1 -1
  377. package/package.json +14 -1
  378. package/reference.md +1278 -2
@@ -0,0 +1,1779 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.GeistClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const requestBody_js_1 = require("../../../../core/requestBody.js");
51
+ const environments = __importStar(require("../../../../environments.js"));
52
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
53
+ const errors = __importStar(require("../../../../errors/index.js"));
54
+ const serializers = __importStar(require("../../../../serialization/index.js"));
55
+ const Taktoria = __importStar(require("../../../index.js"));
56
+ class GeistClient {
57
+ constructor(options) {
58
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
59
+ }
60
+ /**
61
+ * The surveys the caller runs: signed in, those they made or are an
62
+ * owner of (every one, for Geist's admins); a key sees all. Archived
63
+ * ones only with `archived=true`. Paged with an opaque `cursor`.
64
+ * Answering a survey is not in the API: a key is not a person, and
65
+ * answering is a person's own act, in the app.
66
+ *
67
+ * @param {Taktoria.ListSurveysRequest} request
68
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
69
+ *
70
+ * @throws {@link Taktoria.SubscriptionRequiredError}
71
+ * @throws {@link Taktoria.ForbiddenError}
72
+ * @throws {@link Taktoria.ValidationError}
73
+ * @throws {@link Taktoria.TooManyRequestsError}
74
+ * @throws {@link errors.TaktoriaError}
75
+ * @throws {@link errors.TaktoriaTimeoutError}
76
+ *
77
+ * @example
78
+ * await client.geist.listSurveys()
79
+ */
80
+ listSurveys(request = {}, requestOptions) {
81
+ return core.HttpResponsePromise.fromPromise(this.__listSurveys(request, requestOptions));
82
+ }
83
+ __listSurveys() {
84
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
85
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
86
+ const { q, status, mine, archived, limit, cursor } = request;
87
+ const _queryParams = {
88
+ q,
89
+ status: status != null
90
+ ? serializers.SurveyStatus.jsonOrThrow(status, {
91
+ unrecognizedObjectKeys: "strip",
92
+ omitUndefined: true,
93
+ })
94
+ : undefined,
95
+ mine,
96
+ archived,
97
+ limit,
98
+ cursor,
99
+ };
100
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
101
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
102
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
103
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, "/geist/surveys"),
104
+ method: "GET",
105
+ headers: _headers,
106
+ queryString: core.url
107
+ .queryBuilder()
108
+ .addMany(_queryParams)
109
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
110
+ .build(),
111
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
112
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
113
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
114
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
115
+ logging: this._options.logging,
116
+ });
117
+ if (_response.ok) {
118
+ return {
119
+ data: serializers.SurveyPage.parseOrThrow(_response.body, {
120
+ unrecognizedObjectKeys: "passthrough",
121
+ allowUnrecognizedUnionMembers: true,
122
+ allowUnrecognizedEnumValues: true,
123
+ skipValidation: true,
124
+ breadcrumbsPrefix: ["response"],
125
+ }),
126
+ rawResponse: _response.rawResponse,
127
+ };
128
+ }
129
+ if (_response.error.reason === "status-code") {
130
+ switch (_response.error.statusCode) {
131
+ case 402:
132
+ throw new Taktoria.SubscriptionRequiredError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
133
+ unrecognizedObjectKeys: "passthrough",
134
+ allowUnrecognizedUnionMembers: true,
135
+ allowUnrecognizedEnumValues: true,
136
+ skipValidation: true,
137
+ breadcrumbsPrefix: ["response"],
138
+ }), _response.rawResponse);
139
+ case 403:
140
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
141
+ unrecognizedObjectKeys: "passthrough",
142
+ allowUnrecognizedUnionMembers: true,
143
+ allowUnrecognizedEnumValues: true,
144
+ skipValidation: true,
145
+ breadcrumbsPrefix: ["response"],
146
+ }), _response.rawResponse);
147
+ case 422:
148
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
149
+ unrecognizedObjectKeys: "passthrough",
150
+ allowUnrecognizedUnionMembers: true,
151
+ allowUnrecognizedEnumValues: true,
152
+ skipValidation: true,
153
+ breadcrumbsPrefix: ["response"],
154
+ }), _response.rawResponse);
155
+ case 429:
156
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
157
+ unrecognizedObjectKeys: "passthrough",
158
+ allowUnrecognizedUnionMembers: true,
159
+ allowUnrecognizedEnumValues: true,
160
+ skipValidation: true,
161
+ breadcrumbsPrefix: ["response"],
162
+ }), _response.rawResponse);
163
+ default:
164
+ throw new errors.TaktoriaError({
165
+ statusCode: _response.error.statusCode,
166
+ body: _response.error.body,
167
+ rawResponse: _response.rawResponse,
168
+ });
169
+ }
170
+ }
171
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/surveys");
172
+ });
173
+ }
174
+ /**
175
+ * A new draft, from a built-in instrument (`builtin`), a workspace
176
+ * template (`templateId`), the `questions` given, or none yet. Nobody
177
+ * is asked until it is published.
178
+ *
179
+ * @param {Taktoria.CreateSurveyRequest} request
180
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
181
+ *
182
+ * @throws {@link Taktoria.SubscriptionRequiredError}
183
+ * @throws {@link Taktoria.ForbiddenError}
184
+ * @throws {@link Taktoria.NotFoundError}
185
+ * @throws {@link Taktoria.ValidationError}
186
+ * @throws {@link Taktoria.TooManyRequestsError}
187
+ * @throws {@link errors.TaktoriaError}
188
+ * @throws {@link errors.TaktoriaTimeoutError}
189
+ *
190
+ * @example
191
+ * await client.geist.createSurvey({
192
+ * title: "Burnout check",
193
+ * builtin: "burnout"
194
+ * })
195
+ */
196
+ createSurvey(request, requestOptions) {
197
+ return core.HttpResponsePromise.fromPromise(this.__createSurvey(request, requestOptions));
198
+ }
199
+ __createSurvey(request, requestOptions) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
202
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
203
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
204
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
205
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, "/geist/surveys"),
206
+ method: "POST",
207
+ headers: _headers,
208
+ contentType: "application/json",
209
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
210
+ requestType: "json",
211
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.CreateSurveyRequest.jsonOrThrow(request, {
212
+ unrecognizedObjectKeys: "strip",
213
+ omitUndefined: true,
214
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
215
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
216
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
217
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
219
+ logging: this._options.logging,
220
+ });
221
+ if (_response.ok) {
222
+ return {
223
+ data: serializers.Survey.parseOrThrow(_response.body, {
224
+ unrecognizedObjectKeys: "passthrough",
225
+ allowUnrecognizedUnionMembers: true,
226
+ allowUnrecognizedEnumValues: true,
227
+ skipValidation: true,
228
+ breadcrumbsPrefix: ["response"],
229
+ }),
230
+ rawResponse: _response.rawResponse,
231
+ };
232
+ }
233
+ if (_response.error.reason === "status-code") {
234
+ switch (_response.error.statusCode) {
235
+ case 402:
236
+ throw new Taktoria.SubscriptionRequiredError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
237
+ unrecognizedObjectKeys: "passthrough",
238
+ allowUnrecognizedUnionMembers: true,
239
+ allowUnrecognizedEnumValues: true,
240
+ skipValidation: true,
241
+ breadcrumbsPrefix: ["response"],
242
+ }), _response.rawResponse);
243
+ case 403:
244
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
245
+ unrecognizedObjectKeys: "passthrough",
246
+ allowUnrecognizedUnionMembers: true,
247
+ allowUnrecognizedEnumValues: true,
248
+ skipValidation: true,
249
+ breadcrumbsPrefix: ["response"],
250
+ }), _response.rawResponse);
251
+ case 404:
252
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
253
+ unrecognizedObjectKeys: "passthrough",
254
+ allowUnrecognizedUnionMembers: true,
255
+ allowUnrecognizedEnumValues: true,
256
+ skipValidation: true,
257
+ breadcrumbsPrefix: ["response"],
258
+ }), _response.rawResponse);
259
+ case 422:
260
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
261
+ unrecognizedObjectKeys: "passthrough",
262
+ allowUnrecognizedUnionMembers: true,
263
+ allowUnrecognizedEnumValues: true,
264
+ skipValidation: true,
265
+ breadcrumbsPrefix: ["response"],
266
+ }), _response.rawResponse);
267
+ case 429:
268
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
269
+ unrecognizedObjectKeys: "passthrough",
270
+ allowUnrecognizedUnionMembers: true,
271
+ allowUnrecognizedEnumValues: true,
272
+ skipValidation: true,
273
+ breadcrumbsPrefix: ["response"],
274
+ }), _response.rawResponse);
275
+ default:
276
+ throw new errors.TaktoriaError({
277
+ statusCode: _response.error.statusCode,
278
+ body: _response.error.body,
279
+ rawResponse: _response.rawResponse,
280
+ });
281
+ }
282
+ }
283
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/surveys");
284
+ });
285
+ }
286
+ /**
287
+ * @param {string} surveyId
288
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
289
+ *
290
+ * @throws {@link Taktoria.NotFoundError}
291
+ * @throws {@link Taktoria.TooManyRequestsError}
292
+ * @throws {@link errors.TaktoriaError}
293
+ * @throws {@link errors.TaktoriaTimeoutError}
294
+ *
295
+ * @example
296
+ * await client.geist.getSurvey("surveyId")
297
+ */
298
+ getSurvey(surveyId, requestOptions) {
299
+ return core.HttpResponsePromise.fromPromise(this.__getSurvey(surveyId, requestOptions));
300
+ }
301
+ __getSurvey(surveyId, requestOptions) {
302
+ return __awaiter(this, void 0, void 0, function* () {
303
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
304
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
305
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
306
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
307
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}`),
308
+ method: "GET",
309
+ headers: _headers,
310
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
311
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
312
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
313
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
314
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
315
+ logging: this._options.logging,
316
+ });
317
+ if (_response.ok) {
318
+ return {
319
+ data: serializers.Survey.parseOrThrow(_response.body, {
320
+ unrecognizedObjectKeys: "passthrough",
321
+ allowUnrecognizedUnionMembers: true,
322
+ allowUnrecognizedEnumValues: true,
323
+ skipValidation: true,
324
+ breadcrumbsPrefix: ["response"],
325
+ }),
326
+ rawResponse: _response.rawResponse,
327
+ };
328
+ }
329
+ if (_response.error.reason === "status-code") {
330
+ switch (_response.error.statusCode) {
331
+ case 404:
332
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
333
+ unrecognizedObjectKeys: "passthrough",
334
+ allowUnrecognizedUnionMembers: true,
335
+ allowUnrecognizedEnumValues: true,
336
+ skipValidation: true,
337
+ breadcrumbsPrefix: ["response"],
338
+ }), _response.rawResponse);
339
+ case 429:
340
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
341
+ unrecognizedObjectKeys: "passthrough",
342
+ allowUnrecognizedUnionMembers: true,
343
+ allowUnrecognizedEnumValues: true,
344
+ skipValidation: true,
345
+ breadcrumbsPrefix: ["response"],
346
+ }), _response.rawResponse);
347
+ default:
348
+ throw new errors.TaktoriaError({
349
+ statusCode: _response.error.statusCode,
350
+ body: _response.error.body,
351
+ rawResponse: _response.rawResponse,
352
+ });
353
+ }
354
+ }
355
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/surveys/{surveyId}");
356
+ });
357
+ }
358
+ /**
359
+ * @param {string} surveyId
360
+ * @param {Taktoria.UpdateSurveyRequest} request
361
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
362
+ *
363
+ * @throws {@link Taktoria.NotFoundError}
364
+ * @throws {@link Taktoria.ForbiddenError}
365
+ * @throws {@link Taktoria.ConflictError}
366
+ * @throws {@link Taktoria.ValidationError}
367
+ * @throws {@link Taktoria.TooManyRequestsError}
368
+ * @throws {@link errors.TaktoriaError}
369
+ * @throws {@link errors.TaktoriaTimeoutError}
370
+ *
371
+ * @example
372
+ * await client.geist.updateSurvey("surveyId", {})
373
+ */
374
+ updateSurvey(surveyId, request, requestOptions) {
375
+ return core.HttpResponsePromise.fromPromise(this.__updateSurvey(surveyId, request, requestOptions));
376
+ }
377
+ __updateSurvey(surveyId, request, requestOptions) {
378
+ return __awaiter(this, void 0, void 0, function* () {
379
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
380
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
381
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
382
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
383
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}`),
384
+ method: "PATCH",
385
+ headers: _headers,
386
+ contentType: "application/json",
387
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
388
+ requestType: "json",
389
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.UpdateSurveyRequest.jsonOrThrow(request, {
390
+ unrecognizedObjectKeys: "strip",
391
+ omitUndefined: true,
392
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
393
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
394
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
395
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
396
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
397
+ logging: this._options.logging,
398
+ });
399
+ if (_response.ok) {
400
+ return {
401
+ data: serializers.Survey.parseOrThrow(_response.body, {
402
+ unrecognizedObjectKeys: "passthrough",
403
+ allowUnrecognizedUnionMembers: true,
404
+ allowUnrecognizedEnumValues: true,
405
+ skipValidation: true,
406
+ breadcrumbsPrefix: ["response"],
407
+ }),
408
+ rawResponse: _response.rawResponse,
409
+ };
410
+ }
411
+ if (_response.error.reason === "status-code") {
412
+ switch (_response.error.statusCode) {
413
+ case 404:
414
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
415
+ unrecognizedObjectKeys: "passthrough",
416
+ allowUnrecognizedUnionMembers: true,
417
+ allowUnrecognizedEnumValues: true,
418
+ skipValidation: true,
419
+ breadcrumbsPrefix: ["response"],
420
+ }), _response.rawResponse);
421
+ case 403:
422
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
423
+ unrecognizedObjectKeys: "passthrough",
424
+ allowUnrecognizedUnionMembers: true,
425
+ allowUnrecognizedEnumValues: true,
426
+ skipValidation: true,
427
+ breadcrumbsPrefix: ["response"],
428
+ }), _response.rawResponse);
429
+ case 409:
430
+ throw new Taktoria.ConflictError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
431
+ unrecognizedObjectKeys: "passthrough",
432
+ allowUnrecognizedUnionMembers: true,
433
+ allowUnrecognizedEnumValues: true,
434
+ skipValidation: true,
435
+ breadcrumbsPrefix: ["response"],
436
+ }), _response.rawResponse);
437
+ case 422:
438
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
439
+ unrecognizedObjectKeys: "passthrough",
440
+ allowUnrecognizedUnionMembers: true,
441
+ allowUnrecognizedEnumValues: true,
442
+ skipValidation: true,
443
+ breadcrumbsPrefix: ["response"],
444
+ }), _response.rawResponse);
445
+ case 429:
446
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
447
+ unrecognizedObjectKeys: "passthrough",
448
+ allowUnrecognizedUnionMembers: true,
449
+ allowUnrecognizedEnumValues: true,
450
+ skipValidation: true,
451
+ breadcrumbsPrefix: ["response"],
452
+ }), _response.rawResponse);
453
+ default:
454
+ throw new errors.TaktoriaError({
455
+ statusCode: _response.error.statusCode,
456
+ body: _response.error.body,
457
+ rawResponse: _response.rawResponse,
458
+ });
459
+ }
460
+ }
461
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/geist/surveys/{surveyId}");
462
+ });
463
+ }
464
+ /**
465
+ * Archive it, or with `permanent=true` delete it with every answer. A
466
+ * survey that has opened is only Geist's admins' (or a key's) to delete.
467
+ *
468
+ * @param {string} surveyId
469
+ * @param {Taktoria.DeleteSurveyRequest} request
470
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
471
+ *
472
+ * @throws {@link Taktoria.NotFoundError}
473
+ * @throws {@link Taktoria.ForbiddenError}
474
+ * @throws {@link Taktoria.TooManyRequestsError}
475
+ * @throws {@link errors.TaktoriaError}
476
+ * @throws {@link errors.TaktoriaTimeoutError}
477
+ *
478
+ * @example
479
+ * await client.geist.deleteSurvey("surveyId")
480
+ */
481
+ deleteSurvey(surveyId, request = {}, requestOptions) {
482
+ return core.HttpResponsePromise.fromPromise(this.__deleteSurvey(surveyId, request, requestOptions));
483
+ }
484
+ __deleteSurvey(surveyId_1) {
485
+ return __awaiter(this, arguments, void 0, function* (surveyId, request = {}, requestOptions) {
486
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
487
+ const { permanent } = request;
488
+ const _queryParams = {
489
+ permanent,
490
+ };
491
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
492
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
493
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
494
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}`),
495
+ method: "DELETE",
496
+ headers: _headers,
497
+ queryString: core.url
498
+ .queryBuilder()
499
+ .addMany(_queryParams)
500
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
501
+ .build(),
502
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
503
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
504
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
505
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
506
+ logging: this._options.logging,
507
+ });
508
+ if (_response.ok) {
509
+ return { data: undefined, rawResponse: _response.rawResponse };
510
+ }
511
+ if (_response.error.reason === "status-code") {
512
+ switch (_response.error.statusCode) {
513
+ case 404:
514
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
515
+ unrecognizedObjectKeys: "passthrough",
516
+ allowUnrecognizedUnionMembers: true,
517
+ allowUnrecognizedEnumValues: true,
518
+ skipValidation: true,
519
+ breadcrumbsPrefix: ["response"],
520
+ }), _response.rawResponse);
521
+ case 403:
522
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
523
+ unrecognizedObjectKeys: "passthrough",
524
+ allowUnrecognizedUnionMembers: true,
525
+ allowUnrecognizedEnumValues: true,
526
+ skipValidation: true,
527
+ breadcrumbsPrefix: ["response"],
528
+ }), _response.rawResponse);
529
+ case 429:
530
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
531
+ unrecognizedObjectKeys: "passthrough",
532
+ allowUnrecognizedUnionMembers: true,
533
+ allowUnrecognizedEnumValues: true,
534
+ skipValidation: true,
535
+ breadcrumbsPrefix: ["response"],
536
+ }), _response.rawResponse);
537
+ default:
538
+ throw new errors.TaktoriaError({
539
+ statusCode: _response.error.statusCode,
540
+ body: _response.error.body,
541
+ rawResponse: _response.rawResponse,
542
+ });
543
+ }
544
+ }
545
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/geist/surveys/{surveyId}");
546
+ });
547
+ }
548
+ /**
549
+ * Replace a draft's (or a scheduled survey's) questions, in order. `409` once it has opened.
550
+ *
551
+ * @param {string} surveyId
552
+ * @param {Taktoria.SetQuestionsRequest} request
553
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
554
+ *
555
+ * @throws {@link Taktoria.NotFoundError}
556
+ * @throws {@link Taktoria.ConflictError}
557
+ * @throws {@link Taktoria.ValidationError}
558
+ * @throws {@link Taktoria.TooManyRequestsError}
559
+ * @throws {@link errors.TaktoriaError}
560
+ * @throws {@link errors.TaktoriaTimeoutError}
561
+ *
562
+ * @example
563
+ * await client.geist.setSurveyQuestions("surveyId", {
564
+ * questions: [{
565
+ * kind: "SCALE",
566
+ * prompt: "prompt"
567
+ * }, {
568
+ * kind: "SCALE",
569
+ * prompt: "prompt"
570
+ * }]
571
+ * })
572
+ */
573
+ setSurveyQuestions(surveyId, request, requestOptions) {
574
+ return core.HttpResponsePromise.fromPromise(this.__setSurveyQuestions(surveyId, request, requestOptions));
575
+ }
576
+ __setSurveyQuestions(surveyId, request, requestOptions) {
577
+ return __awaiter(this, void 0, void 0, function* () {
578
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
579
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
580
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
581
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
582
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/questions`),
583
+ method: "PUT",
584
+ headers: _headers,
585
+ contentType: "application/json",
586
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
587
+ requestType: "json",
588
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.SetQuestionsRequest.jsonOrThrow(request, {
589
+ unrecognizedObjectKeys: "strip",
590
+ omitUndefined: true,
591
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
592
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
593
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
594
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
595
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
596
+ logging: this._options.logging,
597
+ });
598
+ if (_response.ok) {
599
+ return {
600
+ data: serializers.Survey.parseOrThrow(_response.body, {
601
+ unrecognizedObjectKeys: "passthrough",
602
+ allowUnrecognizedUnionMembers: true,
603
+ allowUnrecognizedEnumValues: true,
604
+ skipValidation: true,
605
+ breadcrumbsPrefix: ["response"],
606
+ }),
607
+ rawResponse: _response.rawResponse,
608
+ };
609
+ }
610
+ if (_response.error.reason === "status-code") {
611
+ switch (_response.error.statusCode) {
612
+ case 404:
613
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
614
+ unrecognizedObjectKeys: "passthrough",
615
+ allowUnrecognizedUnionMembers: true,
616
+ allowUnrecognizedEnumValues: true,
617
+ skipValidation: true,
618
+ breadcrumbsPrefix: ["response"],
619
+ }), _response.rawResponse);
620
+ case 409:
621
+ throw new Taktoria.ConflictError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
622
+ unrecognizedObjectKeys: "passthrough",
623
+ allowUnrecognizedUnionMembers: true,
624
+ allowUnrecognizedEnumValues: true,
625
+ skipValidation: true,
626
+ breadcrumbsPrefix: ["response"],
627
+ }), _response.rawResponse);
628
+ case 422:
629
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
630
+ unrecognizedObjectKeys: "passthrough",
631
+ allowUnrecognizedUnionMembers: true,
632
+ allowUnrecognizedEnumValues: true,
633
+ skipValidation: true,
634
+ breadcrumbsPrefix: ["response"],
635
+ }), _response.rawResponse);
636
+ case 429:
637
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
638
+ unrecognizedObjectKeys: "passthrough",
639
+ allowUnrecognizedUnionMembers: true,
640
+ allowUnrecognizedEnumValues: true,
641
+ skipValidation: true,
642
+ breadcrumbsPrefix: ["response"],
643
+ }), _response.rawResponse);
644
+ default:
645
+ throw new errors.TaktoriaError({
646
+ statusCode: _response.error.statusCode,
647
+ body: _response.error.body,
648
+ rawResponse: _response.rawResponse,
649
+ });
650
+ }
651
+ }
652
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/geist/surveys/{surveyId}/questions");
653
+ });
654
+ }
655
+ /**
656
+ * Send a draft: it opens now, everyone it goes to asked by email,
657
+ * Slack, Teams and in the app, or with an `opensAt` ahead it is
658
+ * scheduled. Opening happens a moment later, in the background.
659
+ *
660
+ * @param {string} surveyId
661
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
662
+ *
663
+ * @throws {@link Taktoria.NotFoundError}
664
+ * @throws {@link Taktoria.ConflictError}
665
+ * @throws {@link Taktoria.ValidationError}
666
+ * @throws {@link Taktoria.TooManyRequestsError}
667
+ * @throws {@link errors.TaktoriaError}
668
+ * @throws {@link errors.TaktoriaTimeoutError}
669
+ *
670
+ * @example
671
+ * await client.geist.publishSurvey("surveyId")
672
+ */
673
+ publishSurvey(surveyId, requestOptions) {
674
+ return core.HttpResponsePromise.fromPromise(this.__publishSurvey(surveyId, requestOptions));
675
+ }
676
+ __publishSurvey(surveyId, requestOptions) {
677
+ return __awaiter(this, void 0, void 0, function* () {
678
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
679
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
680
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
681
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
682
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/publish`),
683
+ method: "POST",
684
+ headers: _headers,
685
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
686
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
687
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
688
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
689
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
690
+ logging: this._options.logging,
691
+ });
692
+ if (_response.ok) {
693
+ return {
694
+ data: serializers.Survey.parseOrThrow(_response.body, {
695
+ unrecognizedObjectKeys: "passthrough",
696
+ allowUnrecognizedUnionMembers: true,
697
+ allowUnrecognizedEnumValues: true,
698
+ skipValidation: true,
699
+ breadcrumbsPrefix: ["response"],
700
+ }),
701
+ rawResponse: _response.rawResponse,
702
+ };
703
+ }
704
+ if (_response.error.reason === "status-code") {
705
+ switch (_response.error.statusCode) {
706
+ case 404:
707
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
708
+ unrecognizedObjectKeys: "passthrough",
709
+ allowUnrecognizedUnionMembers: true,
710
+ allowUnrecognizedEnumValues: true,
711
+ skipValidation: true,
712
+ breadcrumbsPrefix: ["response"],
713
+ }), _response.rawResponse);
714
+ case 409:
715
+ throw new Taktoria.ConflictError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
716
+ unrecognizedObjectKeys: "passthrough",
717
+ allowUnrecognizedUnionMembers: true,
718
+ allowUnrecognizedEnumValues: true,
719
+ skipValidation: true,
720
+ breadcrumbsPrefix: ["response"],
721
+ }), _response.rawResponse);
722
+ case 422:
723
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
724
+ unrecognizedObjectKeys: "passthrough",
725
+ allowUnrecognizedUnionMembers: true,
726
+ allowUnrecognizedEnumValues: true,
727
+ skipValidation: true,
728
+ breadcrumbsPrefix: ["response"],
729
+ }), _response.rawResponse);
730
+ case 429:
731
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
732
+ unrecognizedObjectKeys: "passthrough",
733
+ allowUnrecognizedUnionMembers: true,
734
+ allowUnrecognizedEnumValues: true,
735
+ skipValidation: true,
736
+ breadcrumbsPrefix: ["response"],
737
+ }), _response.rawResponse);
738
+ default:
739
+ throw new errors.TaktoriaError({
740
+ statusCode: _response.error.statusCode,
741
+ body: _response.error.body,
742
+ rawResponse: _response.rawResponse,
743
+ });
744
+ }
745
+ }
746
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/surveys/{surveyId}/publish");
747
+ });
748
+ }
749
+ /**
750
+ * Close an open survey now. Nobody else can answer.
751
+ *
752
+ * @param {string} surveyId
753
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
754
+ *
755
+ * @throws {@link Taktoria.NotFoundError}
756
+ * @throws {@link Taktoria.ConflictError}
757
+ * @throws {@link Taktoria.TooManyRequestsError}
758
+ * @throws {@link errors.TaktoriaError}
759
+ * @throws {@link errors.TaktoriaTimeoutError}
760
+ *
761
+ * @example
762
+ * await client.geist.closeSurvey("surveyId")
763
+ */
764
+ closeSurvey(surveyId, requestOptions) {
765
+ return core.HttpResponsePromise.fromPromise(this.__closeSurvey(surveyId, requestOptions));
766
+ }
767
+ __closeSurvey(surveyId, requestOptions) {
768
+ return __awaiter(this, void 0, void 0, function* () {
769
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
770
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
771
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
772
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
773
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/close`),
774
+ method: "POST",
775
+ headers: _headers,
776
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
777
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
778
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
779
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
780
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
781
+ logging: this._options.logging,
782
+ });
783
+ if (_response.ok) {
784
+ return {
785
+ data: serializers.Survey.parseOrThrow(_response.body, {
786
+ unrecognizedObjectKeys: "passthrough",
787
+ allowUnrecognizedUnionMembers: true,
788
+ allowUnrecognizedEnumValues: true,
789
+ skipValidation: true,
790
+ breadcrumbsPrefix: ["response"],
791
+ }),
792
+ rawResponse: _response.rawResponse,
793
+ };
794
+ }
795
+ if (_response.error.reason === "status-code") {
796
+ switch (_response.error.statusCode) {
797
+ case 404:
798
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
799
+ unrecognizedObjectKeys: "passthrough",
800
+ allowUnrecognizedUnionMembers: true,
801
+ allowUnrecognizedEnumValues: true,
802
+ skipValidation: true,
803
+ breadcrumbsPrefix: ["response"],
804
+ }), _response.rawResponse);
805
+ case 409:
806
+ throw new Taktoria.ConflictError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
807
+ unrecognizedObjectKeys: "passthrough",
808
+ allowUnrecognizedUnionMembers: true,
809
+ allowUnrecognizedEnumValues: true,
810
+ skipValidation: true,
811
+ breadcrumbsPrefix: ["response"],
812
+ }), _response.rawResponse);
813
+ case 429:
814
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
815
+ unrecognizedObjectKeys: "passthrough",
816
+ allowUnrecognizedUnionMembers: true,
817
+ allowUnrecognizedEnumValues: true,
818
+ skipValidation: true,
819
+ breadcrumbsPrefix: ["response"],
820
+ }), _response.rawResponse);
821
+ default:
822
+ throw new errors.TaktoriaError({
823
+ statusCode: _response.error.statusCode,
824
+ body: _response.error.body,
825
+ rawResponse: _response.rawResponse,
826
+ });
827
+ }
828
+ }
829
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/surveys/{surveyId}/close");
830
+ });
831
+ }
832
+ /**
833
+ * A scheduled survey back to a draft, before it opens.
834
+ *
835
+ * @param {string} surveyId
836
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
837
+ *
838
+ * @throws {@link Taktoria.NotFoundError}
839
+ * @throws {@link Taktoria.ConflictError}
840
+ * @throws {@link Taktoria.TooManyRequestsError}
841
+ * @throws {@link errors.TaktoriaError}
842
+ * @throws {@link errors.TaktoriaTimeoutError}
843
+ *
844
+ * @example
845
+ * await client.geist.unscheduleSurvey("surveyId")
846
+ */
847
+ unscheduleSurvey(surveyId, requestOptions) {
848
+ return core.HttpResponsePromise.fromPromise(this.__unscheduleSurvey(surveyId, requestOptions));
849
+ }
850
+ __unscheduleSurvey(surveyId, requestOptions) {
851
+ return __awaiter(this, void 0, void 0, function* () {
852
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
853
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
854
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
855
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
856
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/unschedule`),
857
+ method: "POST",
858
+ headers: _headers,
859
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
860
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
861
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
862
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
863
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
864
+ logging: this._options.logging,
865
+ });
866
+ if (_response.ok) {
867
+ return {
868
+ data: serializers.Survey.parseOrThrow(_response.body, {
869
+ unrecognizedObjectKeys: "passthrough",
870
+ allowUnrecognizedUnionMembers: true,
871
+ allowUnrecognizedEnumValues: true,
872
+ skipValidation: true,
873
+ breadcrumbsPrefix: ["response"],
874
+ }),
875
+ rawResponse: _response.rawResponse,
876
+ };
877
+ }
878
+ if (_response.error.reason === "status-code") {
879
+ switch (_response.error.statusCode) {
880
+ case 404:
881
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
882
+ unrecognizedObjectKeys: "passthrough",
883
+ allowUnrecognizedUnionMembers: true,
884
+ allowUnrecognizedEnumValues: true,
885
+ skipValidation: true,
886
+ breadcrumbsPrefix: ["response"],
887
+ }), _response.rawResponse);
888
+ case 409:
889
+ throw new Taktoria.ConflictError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
890
+ unrecognizedObjectKeys: "passthrough",
891
+ allowUnrecognizedUnionMembers: true,
892
+ allowUnrecognizedEnumValues: true,
893
+ skipValidation: true,
894
+ breadcrumbsPrefix: ["response"],
895
+ }), _response.rawResponse);
896
+ case 429:
897
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
898
+ unrecognizedObjectKeys: "passthrough",
899
+ allowUnrecognizedUnionMembers: true,
900
+ allowUnrecognizedEnumValues: true,
901
+ skipValidation: true,
902
+ breadcrumbsPrefix: ["response"],
903
+ }), _response.rawResponse);
904
+ default:
905
+ throw new errors.TaktoriaError({
906
+ statusCode: _response.error.statusCode,
907
+ body: _response.error.body,
908
+ rawResponse: _response.rawResponse,
909
+ });
910
+ }
911
+ }
912
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/surveys/{surveyId}/unschedule");
913
+ });
914
+ }
915
+ /**
916
+ * A new draft with the same questions and settings.
917
+ *
918
+ * @param {string} surveyId
919
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
920
+ *
921
+ * @throws {@link Taktoria.NotFoundError}
922
+ * @throws {@link Taktoria.TooManyRequestsError}
923
+ * @throws {@link errors.TaktoriaError}
924
+ * @throws {@link errors.TaktoriaTimeoutError}
925
+ *
926
+ * @example
927
+ * await client.geist.duplicateSurvey("surveyId")
928
+ */
929
+ duplicateSurvey(surveyId, requestOptions) {
930
+ return core.HttpResponsePromise.fromPromise(this.__duplicateSurvey(surveyId, requestOptions));
931
+ }
932
+ __duplicateSurvey(surveyId, requestOptions) {
933
+ return __awaiter(this, void 0, void 0, function* () {
934
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
935
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
936
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
937
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
938
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/duplicate`),
939
+ method: "POST",
940
+ headers: _headers,
941
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
942
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
943
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
944
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
945
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
946
+ logging: this._options.logging,
947
+ });
948
+ if (_response.ok) {
949
+ return {
950
+ data: serializers.Survey.parseOrThrow(_response.body, {
951
+ unrecognizedObjectKeys: "passthrough",
952
+ allowUnrecognizedUnionMembers: true,
953
+ allowUnrecognizedEnumValues: true,
954
+ skipValidation: true,
955
+ breadcrumbsPrefix: ["response"],
956
+ }),
957
+ rawResponse: _response.rawResponse,
958
+ };
959
+ }
960
+ if (_response.error.reason === "status-code") {
961
+ switch (_response.error.statusCode) {
962
+ case 404:
963
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
964
+ unrecognizedObjectKeys: "passthrough",
965
+ allowUnrecognizedUnionMembers: true,
966
+ allowUnrecognizedEnumValues: true,
967
+ skipValidation: true,
968
+ breadcrumbsPrefix: ["response"],
969
+ }), _response.rawResponse);
970
+ case 429:
971
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
972
+ unrecognizedObjectKeys: "passthrough",
973
+ allowUnrecognizedUnionMembers: true,
974
+ allowUnrecognizedEnumValues: true,
975
+ skipValidation: true,
976
+ breadcrumbsPrefix: ["response"],
977
+ }), _response.rawResponse);
978
+ default:
979
+ throw new errors.TaktoriaError({
980
+ statusCode: _response.error.statusCode,
981
+ body: _response.error.body,
982
+ rawResponse: _response.rawResponse,
983
+ });
984
+ }
985
+ }
986
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/surveys/{surveyId}/duplicate");
987
+ });
988
+ }
989
+ /**
990
+ * Bring an archived survey back.
991
+ *
992
+ * @param {string} surveyId
993
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
994
+ *
995
+ * @throws {@link Taktoria.NotFoundError}
996
+ * @throws {@link Taktoria.TooManyRequestsError}
997
+ * @throws {@link errors.TaktoriaError}
998
+ * @throws {@link errors.TaktoriaTimeoutError}
999
+ *
1000
+ * @example
1001
+ * await client.geist.restoreSurvey("surveyId")
1002
+ */
1003
+ restoreSurvey(surveyId, requestOptions) {
1004
+ return core.HttpResponsePromise.fromPromise(this.__restoreSurvey(surveyId, requestOptions));
1005
+ }
1006
+ __restoreSurvey(surveyId, requestOptions) {
1007
+ return __awaiter(this, void 0, void 0, function* () {
1008
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1009
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1010
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1011
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1012
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/restore`),
1013
+ method: "POST",
1014
+ headers: _headers,
1015
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1016
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1017
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1018
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1019
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1020
+ logging: this._options.logging,
1021
+ });
1022
+ if (_response.ok) {
1023
+ return {
1024
+ data: serializers.Survey.parseOrThrow(_response.body, {
1025
+ unrecognizedObjectKeys: "passthrough",
1026
+ allowUnrecognizedUnionMembers: true,
1027
+ allowUnrecognizedEnumValues: true,
1028
+ skipValidation: true,
1029
+ breadcrumbsPrefix: ["response"],
1030
+ }),
1031
+ rawResponse: _response.rawResponse,
1032
+ };
1033
+ }
1034
+ if (_response.error.reason === "status-code") {
1035
+ switch (_response.error.statusCode) {
1036
+ case 404:
1037
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1038
+ unrecognizedObjectKeys: "passthrough",
1039
+ allowUnrecognizedUnionMembers: true,
1040
+ allowUnrecognizedEnumValues: true,
1041
+ skipValidation: true,
1042
+ breadcrumbsPrefix: ["response"],
1043
+ }), _response.rawResponse);
1044
+ case 429:
1045
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1046
+ unrecognizedObjectKeys: "passthrough",
1047
+ allowUnrecognizedUnionMembers: true,
1048
+ allowUnrecognizedEnumValues: true,
1049
+ skipValidation: true,
1050
+ breadcrumbsPrefix: ["response"],
1051
+ }), _response.rawResponse);
1052
+ default:
1053
+ throw new errors.TaktoriaError({
1054
+ statusCode: _response.error.statusCode,
1055
+ body: _response.error.body,
1056
+ rawResponse: _response.rawResponse,
1057
+ });
1058
+ }
1059
+ }
1060
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/surveys/{surveyId}/restore");
1061
+ });
1062
+ }
1063
+ /**
1064
+ * A survey's results, as its results page shows them. Aggregates only;
1065
+ * nothing but the counts below its `minGroupSize`. For those who run it,
1066
+ * and (signed in) for people a closed survey's results were shared with.
1067
+ * Has a rate limit of its own.
1068
+ *
1069
+ * @param {string} surveyId
1070
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1071
+ *
1072
+ * @throws {@link Taktoria.NotFoundError}
1073
+ * @throws {@link Taktoria.TooManyRequestsError}
1074
+ * @throws {@link Taktoria.TooManyRequestsError}
1075
+ * @throws {@link errors.TaktoriaError}
1076
+ * @throws {@link errors.TaktoriaTimeoutError}
1077
+ *
1078
+ * @example
1079
+ * await client.geist.getSurveyResults("surveyId")
1080
+ */
1081
+ getSurveyResults(surveyId, requestOptions) {
1082
+ return core.HttpResponsePromise.fromPromise(this.__getSurveyResults(surveyId, requestOptions));
1083
+ }
1084
+ __getSurveyResults(surveyId, requestOptions) {
1085
+ return __awaiter(this, void 0, void 0, function* () {
1086
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1087
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1088
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1089
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1090
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/results`),
1091
+ method: "GET",
1092
+ headers: _headers,
1093
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1094
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1095
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1096
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1097
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1098
+ logging: this._options.logging,
1099
+ });
1100
+ if (_response.ok) {
1101
+ return {
1102
+ data: serializers.SurveyResults.parseOrThrow(_response.body, {
1103
+ unrecognizedObjectKeys: "passthrough",
1104
+ allowUnrecognizedUnionMembers: true,
1105
+ allowUnrecognizedEnumValues: true,
1106
+ skipValidation: true,
1107
+ breadcrumbsPrefix: ["response"],
1108
+ }),
1109
+ rawResponse: _response.rawResponse,
1110
+ };
1111
+ }
1112
+ if (_response.error.reason === "status-code") {
1113
+ switch (_response.error.statusCode) {
1114
+ case 404:
1115
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1116
+ unrecognizedObjectKeys: "passthrough",
1117
+ allowUnrecognizedUnionMembers: true,
1118
+ allowUnrecognizedEnumValues: true,
1119
+ skipValidation: true,
1120
+ breadcrumbsPrefix: ["response"],
1121
+ }), _response.rawResponse);
1122
+ case 429:
1123
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1124
+ unrecognizedObjectKeys: "passthrough",
1125
+ allowUnrecognizedUnionMembers: true,
1126
+ allowUnrecognizedEnumValues: true,
1127
+ skipValidation: true,
1128
+ breadcrumbsPrefix: ["response"],
1129
+ }), _response.rawResponse);
1130
+ default:
1131
+ throw new errors.TaktoriaError({
1132
+ statusCode: _response.error.statusCode,
1133
+ body: _response.error.body,
1134
+ rawResponse: _response.rawResponse,
1135
+ });
1136
+ }
1137
+ }
1138
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/surveys/{surveyId}/results");
1139
+ });
1140
+ }
1141
+ /**
1142
+ * The same results as CSV, in English: one row per answer of every
1143
+ * question, with its count and share, then each dimension's score.
1144
+ * Never a row per person. Has a rate limit of its own.
1145
+ *
1146
+ * @throws {@link Taktoria.NotFoundError}
1147
+ * @throws {@link Taktoria.TooManyRequestsError}
1148
+ * @throws {@link Taktoria.TooManyRequestsError}
1149
+ * @throws {@link errors.TaktoriaError}
1150
+ * @throws {@link errors.TaktoriaTimeoutError}
1151
+ */
1152
+ exportSurveyResults(surveyId, requestOptions) {
1153
+ return core.HttpResponsePromise.fromPromise(this.__exportSurveyResults(surveyId, requestOptions));
1154
+ }
1155
+ __exportSurveyResults(surveyId, requestOptions) {
1156
+ return __awaiter(this, void 0, void 0, function* () {
1157
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1158
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1159
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1160
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1161
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/surveys/${core.url.encodePathParam(surveyId, errors.TaktoriaError)}/results/export`),
1162
+ method: "GET",
1163
+ headers: _headers,
1164
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1165
+ responseType: "binary-response",
1166
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1167
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1169
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1170
+ logging: this._options.logging,
1171
+ });
1172
+ if (_response.ok) {
1173
+ return { data: _response.body, rawResponse: _response.rawResponse };
1174
+ }
1175
+ if (_response.error.reason === "status-code") {
1176
+ switch (_response.error.statusCode) {
1177
+ case 404:
1178
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1179
+ unrecognizedObjectKeys: "passthrough",
1180
+ allowUnrecognizedUnionMembers: true,
1181
+ allowUnrecognizedEnumValues: true,
1182
+ skipValidation: true,
1183
+ breadcrumbsPrefix: ["response"],
1184
+ }), _response.rawResponse);
1185
+ case 429:
1186
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1187
+ unrecognizedObjectKeys: "passthrough",
1188
+ allowUnrecognizedUnionMembers: true,
1189
+ allowUnrecognizedEnumValues: true,
1190
+ skipValidation: true,
1191
+ breadcrumbsPrefix: ["response"],
1192
+ }), _response.rawResponse);
1193
+ default:
1194
+ throw new errors.TaktoriaError({
1195
+ statusCode: _response.error.statusCode,
1196
+ body: _response.error.body,
1197
+ rawResponse: _response.rawResponse,
1198
+ });
1199
+ }
1200
+ }
1201
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/surveys/{surveyId}/results/export");
1202
+ });
1203
+ }
1204
+ /**
1205
+ * The built-in surveys: validated instruments free for commercial use
1206
+ * (HSE Management Standards, Copenhagen Burnout Inventory, NIOSH
1207
+ * WellBQ's public-domain items, US federal workforce surveys) and
1208
+ * Taktoria's own, marked `validated: false`, each with the credit its
1209
+ * sources require.
1210
+ *
1211
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1212
+ *
1213
+ * @throws {@link Taktoria.TooManyRequestsError}
1214
+ * @throws {@link errors.TaktoriaError}
1215
+ * @throws {@link errors.TaktoriaTimeoutError}
1216
+ *
1217
+ * @example
1218
+ * await client.geist.listInstruments()
1219
+ */
1220
+ listInstruments(requestOptions) {
1221
+ return core.HttpResponsePromise.fromPromise(this.__listInstruments(requestOptions));
1222
+ }
1223
+ __listInstruments(requestOptions) {
1224
+ return __awaiter(this, void 0, void 0, function* () {
1225
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1226
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1227
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1228
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1229
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, "/geist/instruments"),
1230
+ method: "GET",
1231
+ headers: _headers,
1232
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1233
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1234
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1235
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1236
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1237
+ logging: this._options.logging,
1238
+ });
1239
+ if (_response.ok) {
1240
+ return {
1241
+ data: serializers.SurveyInstrumentList.parseOrThrow(_response.body, {
1242
+ unrecognizedObjectKeys: "passthrough",
1243
+ allowUnrecognizedUnionMembers: true,
1244
+ allowUnrecognizedEnumValues: true,
1245
+ skipValidation: true,
1246
+ breadcrumbsPrefix: ["response"],
1247
+ }),
1248
+ rawResponse: _response.rawResponse,
1249
+ };
1250
+ }
1251
+ if (_response.error.reason === "status-code") {
1252
+ switch (_response.error.statusCode) {
1253
+ case 429:
1254
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1255
+ unrecognizedObjectKeys: "passthrough",
1256
+ allowUnrecognizedUnionMembers: true,
1257
+ allowUnrecognizedEnumValues: true,
1258
+ skipValidation: true,
1259
+ breadcrumbsPrefix: ["response"],
1260
+ }), _response.rawResponse);
1261
+ default:
1262
+ throw new errors.TaktoriaError({
1263
+ statusCode: _response.error.statusCode,
1264
+ body: _response.error.body,
1265
+ rawResponse: _response.rawResponse,
1266
+ });
1267
+ }
1268
+ }
1269
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/instruments");
1270
+ });
1271
+ }
1272
+ /**
1273
+ * The workspace's own survey templates; archived ones too with `archived=true`.
1274
+ *
1275
+ * @param {Taktoria.ListSurveyTemplatesRequest} request
1276
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1277
+ *
1278
+ * @throws {@link Taktoria.TooManyRequestsError}
1279
+ * @throws {@link errors.TaktoriaError}
1280
+ * @throws {@link errors.TaktoriaTimeoutError}
1281
+ *
1282
+ * @example
1283
+ * await client.geist.listSurveyTemplates()
1284
+ */
1285
+ listSurveyTemplates(request = {}, requestOptions) {
1286
+ return core.HttpResponsePromise.fromPromise(this.__listSurveyTemplates(request, requestOptions));
1287
+ }
1288
+ __listSurveyTemplates() {
1289
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
1290
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1291
+ const { archived } = request;
1292
+ const _queryParams = {
1293
+ archived,
1294
+ };
1295
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1296
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1297
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1298
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, "/geist/templates"),
1299
+ method: "GET",
1300
+ headers: _headers,
1301
+ queryString: core.url
1302
+ .queryBuilder()
1303
+ .addMany(_queryParams)
1304
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
1305
+ .build(),
1306
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1307
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1308
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1309
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1310
+ logging: this._options.logging,
1311
+ });
1312
+ if (_response.ok) {
1313
+ return {
1314
+ data: serializers.SurveyTemplateList.parseOrThrow(_response.body, {
1315
+ unrecognizedObjectKeys: "passthrough",
1316
+ allowUnrecognizedUnionMembers: true,
1317
+ allowUnrecognizedEnumValues: true,
1318
+ skipValidation: true,
1319
+ breadcrumbsPrefix: ["response"],
1320
+ }),
1321
+ rawResponse: _response.rawResponse,
1322
+ };
1323
+ }
1324
+ if (_response.error.reason === "status-code") {
1325
+ switch (_response.error.statusCode) {
1326
+ case 429:
1327
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1328
+ unrecognizedObjectKeys: "passthrough",
1329
+ allowUnrecognizedUnionMembers: true,
1330
+ allowUnrecognizedEnumValues: true,
1331
+ skipValidation: true,
1332
+ breadcrumbsPrefix: ["response"],
1333
+ }), _response.rawResponse);
1334
+ default:
1335
+ throw new errors.TaktoriaError({
1336
+ statusCode: _response.error.statusCode,
1337
+ body: _response.error.body,
1338
+ rawResponse: _response.rawResponse,
1339
+ });
1340
+ }
1341
+ }
1342
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/templates");
1343
+ });
1344
+ }
1345
+ /**
1346
+ * A template for everyone to start from. Geist's admins (and keys) only.
1347
+ *
1348
+ * @param {Taktoria.SurveyTemplateRequest} request
1349
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1350
+ *
1351
+ * @throws {@link Taktoria.ForbiddenError}
1352
+ * @throws {@link Taktoria.ValidationError}
1353
+ * @throws {@link Taktoria.TooManyRequestsError}
1354
+ * @throws {@link errors.TaktoriaError}
1355
+ * @throws {@link errors.TaktoriaTimeoutError}
1356
+ *
1357
+ * @example
1358
+ * await client.geist.createSurveyTemplate({
1359
+ * name: "name",
1360
+ * questions: [{
1361
+ * kind: "SCALE",
1362
+ * prompt: "prompt"
1363
+ * }, {
1364
+ * kind: "SCALE",
1365
+ * prompt: "prompt"
1366
+ * }]
1367
+ * })
1368
+ */
1369
+ createSurveyTemplate(request, requestOptions) {
1370
+ return core.HttpResponsePromise.fromPromise(this.__createSurveyTemplate(request, requestOptions));
1371
+ }
1372
+ __createSurveyTemplate(request, requestOptions) {
1373
+ return __awaiter(this, void 0, void 0, function* () {
1374
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1375
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1376
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1377
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1378
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, "/geist/templates"),
1379
+ method: "POST",
1380
+ headers: _headers,
1381
+ contentType: "application/json",
1382
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1383
+ requestType: "json",
1384
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.SurveyTemplateRequest.jsonOrThrow(request, {
1385
+ unrecognizedObjectKeys: "strip",
1386
+ omitUndefined: true,
1387
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
1388
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1389
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1390
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1391
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1392
+ logging: this._options.logging,
1393
+ });
1394
+ if (_response.ok) {
1395
+ return {
1396
+ data: serializers.SurveyTemplate.parseOrThrow(_response.body, {
1397
+ unrecognizedObjectKeys: "passthrough",
1398
+ allowUnrecognizedUnionMembers: true,
1399
+ allowUnrecognizedEnumValues: true,
1400
+ skipValidation: true,
1401
+ breadcrumbsPrefix: ["response"],
1402
+ }),
1403
+ rawResponse: _response.rawResponse,
1404
+ };
1405
+ }
1406
+ if (_response.error.reason === "status-code") {
1407
+ switch (_response.error.statusCode) {
1408
+ case 403:
1409
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1410
+ unrecognizedObjectKeys: "passthrough",
1411
+ allowUnrecognizedUnionMembers: true,
1412
+ allowUnrecognizedEnumValues: true,
1413
+ skipValidation: true,
1414
+ breadcrumbsPrefix: ["response"],
1415
+ }), _response.rawResponse);
1416
+ case 422:
1417
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1418
+ unrecognizedObjectKeys: "passthrough",
1419
+ allowUnrecognizedUnionMembers: true,
1420
+ allowUnrecognizedEnumValues: true,
1421
+ skipValidation: true,
1422
+ breadcrumbsPrefix: ["response"],
1423
+ }), _response.rawResponse);
1424
+ case 429:
1425
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1426
+ unrecognizedObjectKeys: "passthrough",
1427
+ allowUnrecognizedUnionMembers: true,
1428
+ allowUnrecognizedEnumValues: true,
1429
+ skipValidation: true,
1430
+ breadcrumbsPrefix: ["response"],
1431
+ }), _response.rawResponse);
1432
+ default:
1433
+ throw new errors.TaktoriaError({
1434
+ statusCode: _response.error.statusCode,
1435
+ body: _response.error.body,
1436
+ rawResponse: _response.rawResponse,
1437
+ });
1438
+ }
1439
+ }
1440
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/templates");
1441
+ });
1442
+ }
1443
+ /**
1444
+ * @param {string} templateId
1445
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1446
+ *
1447
+ * @throws {@link Taktoria.NotFoundError}
1448
+ * @throws {@link Taktoria.TooManyRequestsError}
1449
+ * @throws {@link errors.TaktoriaError}
1450
+ * @throws {@link errors.TaktoriaTimeoutError}
1451
+ *
1452
+ * @example
1453
+ * await client.geist.getSurveyTemplate("templateId")
1454
+ */
1455
+ getSurveyTemplate(templateId, requestOptions) {
1456
+ return core.HttpResponsePromise.fromPromise(this.__getSurveyTemplate(templateId, requestOptions));
1457
+ }
1458
+ __getSurveyTemplate(templateId, requestOptions) {
1459
+ return __awaiter(this, void 0, void 0, function* () {
1460
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1461
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1462
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1463
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1464
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/templates/${core.url.encodePathParam(templateId, errors.TaktoriaError)}`),
1465
+ method: "GET",
1466
+ headers: _headers,
1467
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1468
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1469
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1470
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1471
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1472
+ logging: this._options.logging,
1473
+ });
1474
+ if (_response.ok) {
1475
+ return {
1476
+ data: serializers.SurveyTemplate.parseOrThrow(_response.body, {
1477
+ unrecognizedObjectKeys: "passthrough",
1478
+ allowUnrecognizedUnionMembers: true,
1479
+ allowUnrecognizedEnumValues: true,
1480
+ skipValidation: true,
1481
+ breadcrumbsPrefix: ["response"],
1482
+ }),
1483
+ rawResponse: _response.rawResponse,
1484
+ };
1485
+ }
1486
+ if (_response.error.reason === "status-code") {
1487
+ switch (_response.error.statusCode) {
1488
+ case 404:
1489
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1490
+ unrecognizedObjectKeys: "passthrough",
1491
+ allowUnrecognizedUnionMembers: true,
1492
+ allowUnrecognizedEnumValues: true,
1493
+ skipValidation: true,
1494
+ breadcrumbsPrefix: ["response"],
1495
+ }), _response.rawResponse);
1496
+ case 429:
1497
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1498
+ unrecognizedObjectKeys: "passthrough",
1499
+ allowUnrecognizedUnionMembers: true,
1500
+ allowUnrecognizedEnumValues: true,
1501
+ skipValidation: true,
1502
+ breadcrumbsPrefix: ["response"],
1503
+ }), _response.rawResponse);
1504
+ default:
1505
+ throw new errors.TaktoriaError({
1506
+ statusCode: _response.error.statusCode,
1507
+ body: _response.error.body,
1508
+ rawResponse: _response.rawResponse,
1509
+ });
1510
+ }
1511
+ }
1512
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/geist/templates/{templateId}");
1513
+ });
1514
+ }
1515
+ /**
1516
+ * Replace it whole. Surveys already made from it keep their questions.
1517
+ *
1518
+ * @param {string} templateId
1519
+ * @param {Taktoria.SurveyTemplateRequest} request
1520
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1521
+ *
1522
+ * @throws {@link Taktoria.NotFoundError}
1523
+ * @throws {@link Taktoria.ForbiddenError}
1524
+ * @throws {@link Taktoria.ValidationError}
1525
+ * @throws {@link Taktoria.TooManyRequestsError}
1526
+ * @throws {@link errors.TaktoriaError}
1527
+ * @throws {@link errors.TaktoriaTimeoutError}
1528
+ *
1529
+ * @example
1530
+ * await client.geist.updateSurveyTemplate("templateId", {
1531
+ * name: "name",
1532
+ * questions: [{
1533
+ * kind: "SCALE",
1534
+ * prompt: "prompt"
1535
+ * }, {
1536
+ * kind: "SCALE",
1537
+ * prompt: "prompt"
1538
+ * }]
1539
+ * })
1540
+ */
1541
+ updateSurveyTemplate(templateId, request, requestOptions) {
1542
+ return core.HttpResponsePromise.fromPromise(this.__updateSurveyTemplate(templateId, request, requestOptions));
1543
+ }
1544
+ __updateSurveyTemplate(templateId, request, requestOptions) {
1545
+ return __awaiter(this, void 0, void 0, function* () {
1546
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1547
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1548
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1549
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1550
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/templates/${core.url.encodePathParam(templateId, errors.TaktoriaError)}`),
1551
+ method: "PUT",
1552
+ headers: _headers,
1553
+ contentType: "application/json",
1554
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1555
+ requestType: "json",
1556
+ body: (0, requestBody_js_1.mergeAdditionalBodyParameters)(serializers.SurveyTemplateRequest.jsonOrThrow(request, {
1557
+ unrecognizedObjectKeys: "strip",
1558
+ omitUndefined: true,
1559
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
1560
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1561
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1562
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1563
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1564
+ logging: this._options.logging,
1565
+ });
1566
+ if (_response.ok) {
1567
+ return {
1568
+ data: serializers.SurveyTemplate.parseOrThrow(_response.body, {
1569
+ unrecognizedObjectKeys: "passthrough",
1570
+ allowUnrecognizedUnionMembers: true,
1571
+ allowUnrecognizedEnumValues: true,
1572
+ skipValidation: true,
1573
+ breadcrumbsPrefix: ["response"],
1574
+ }),
1575
+ rawResponse: _response.rawResponse,
1576
+ };
1577
+ }
1578
+ if (_response.error.reason === "status-code") {
1579
+ switch (_response.error.statusCode) {
1580
+ case 404:
1581
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1582
+ unrecognizedObjectKeys: "passthrough",
1583
+ allowUnrecognizedUnionMembers: true,
1584
+ allowUnrecognizedEnumValues: true,
1585
+ skipValidation: true,
1586
+ breadcrumbsPrefix: ["response"],
1587
+ }), _response.rawResponse);
1588
+ case 403:
1589
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1590
+ unrecognizedObjectKeys: "passthrough",
1591
+ allowUnrecognizedUnionMembers: true,
1592
+ allowUnrecognizedEnumValues: true,
1593
+ skipValidation: true,
1594
+ breadcrumbsPrefix: ["response"],
1595
+ }), _response.rawResponse);
1596
+ case 422:
1597
+ throw new Taktoria.ValidationError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1598
+ unrecognizedObjectKeys: "passthrough",
1599
+ allowUnrecognizedUnionMembers: true,
1600
+ allowUnrecognizedEnumValues: true,
1601
+ skipValidation: true,
1602
+ breadcrumbsPrefix: ["response"],
1603
+ }), _response.rawResponse);
1604
+ case 429:
1605
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1606
+ unrecognizedObjectKeys: "passthrough",
1607
+ allowUnrecognizedUnionMembers: true,
1608
+ allowUnrecognizedEnumValues: true,
1609
+ skipValidation: true,
1610
+ breadcrumbsPrefix: ["response"],
1611
+ }), _response.rawResponse);
1612
+ default:
1613
+ throw new errors.TaktoriaError({
1614
+ statusCode: _response.error.statusCode,
1615
+ body: _response.error.body,
1616
+ rawResponse: _response.rawResponse,
1617
+ });
1618
+ }
1619
+ }
1620
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PUT", "/geist/templates/{templateId}");
1621
+ });
1622
+ }
1623
+ /**
1624
+ * Archive it. `POST …/restore` brings it back.
1625
+ *
1626
+ * @param {string} templateId
1627
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1628
+ *
1629
+ * @throws {@link Taktoria.NotFoundError}
1630
+ * @throws {@link Taktoria.ForbiddenError}
1631
+ * @throws {@link Taktoria.TooManyRequestsError}
1632
+ * @throws {@link errors.TaktoriaError}
1633
+ * @throws {@link errors.TaktoriaTimeoutError}
1634
+ *
1635
+ * @example
1636
+ * await client.geist.archiveSurveyTemplate("templateId")
1637
+ */
1638
+ archiveSurveyTemplate(templateId, requestOptions) {
1639
+ return core.HttpResponsePromise.fromPromise(this.__archiveSurveyTemplate(templateId, requestOptions));
1640
+ }
1641
+ __archiveSurveyTemplate(templateId, requestOptions) {
1642
+ return __awaiter(this, void 0, void 0, function* () {
1643
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1644
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1645
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1646
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1647
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/templates/${core.url.encodePathParam(templateId, errors.TaktoriaError)}`),
1648
+ method: "DELETE",
1649
+ headers: _headers,
1650
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1651
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1652
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1653
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1654
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1655
+ logging: this._options.logging,
1656
+ });
1657
+ if (_response.ok) {
1658
+ return { data: undefined, rawResponse: _response.rawResponse };
1659
+ }
1660
+ if (_response.error.reason === "status-code") {
1661
+ switch (_response.error.statusCode) {
1662
+ case 404:
1663
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1664
+ unrecognizedObjectKeys: "passthrough",
1665
+ allowUnrecognizedUnionMembers: true,
1666
+ allowUnrecognizedEnumValues: true,
1667
+ skipValidation: true,
1668
+ breadcrumbsPrefix: ["response"],
1669
+ }), _response.rawResponse);
1670
+ case 403:
1671
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1672
+ unrecognizedObjectKeys: "passthrough",
1673
+ allowUnrecognizedUnionMembers: true,
1674
+ allowUnrecognizedEnumValues: true,
1675
+ skipValidation: true,
1676
+ breadcrumbsPrefix: ["response"],
1677
+ }), _response.rawResponse);
1678
+ case 429:
1679
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1680
+ unrecognizedObjectKeys: "passthrough",
1681
+ allowUnrecognizedUnionMembers: true,
1682
+ allowUnrecognizedEnumValues: true,
1683
+ skipValidation: true,
1684
+ breadcrumbsPrefix: ["response"],
1685
+ }), _response.rawResponse);
1686
+ default:
1687
+ throw new errors.TaktoriaError({
1688
+ statusCode: _response.error.statusCode,
1689
+ body: _response.error.body,
1690
+ rawResponse: _response.rawResponse,
1691
+ });
1692
+ }
1693
+ }
1694
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/geist/templates/{templateId}");
1695
+ });
1696
+ }
1697
+ /**
1698
+ * @param {string} templateId
1699
+ * @param {GeistClient.RequestOptions} requestOptions - Request-specific configuration.
1700
+ *
1701
+ * @throws {@link Taktoria.NotFoundError}
1702
+ * @throws {@link Taktoria.ForbiddenError}
1703
+ * @throws {@link Taktoria.TooManyRequestsError}
1704
+ * @throws {@link errors.TaktoriaError}
1705
+ * @throws {@link errors.TaktoriaTimeoutError}
1706
+ *
1707
+ * @example
1708
+ * await client.geist.restoreSurveyTemplate("templateId")
1709
+ */
1710
+ restoreSurveyTemplate(templateId, requestOptions) {
1711
+ return core.HttpResponsePromise.fromPromise(this.__restoreSurveyTemplate(templateId, requestOptions));
1712
+ }
1713
+ __restoreSurveyTemplate(templateId, requestOptions) {
1714
+ return __awaiter(this, void 0, void 0, function* () {
1715
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1716
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1717
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1718
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1719
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.TaktoriaEnvironment.Production, `/geist/templates/${core.url.encodePathParam(templateId, errors.TaktoriaError)}/restore`),
1720
+ method: "POST",
1721
+ headers: _headers,
1722
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
1723
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1724
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1725
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1726
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1727
+ logging: this._options.logging,
1728
+ });
1729
+ if (_response.ok) {
1730
+ return {
1731
+ data: serializers.SurveyTemplate.parseOrThrow(_response.body, {
1732
+ unrecognizedObjectKeys: "passthrough",
1733
+ allowUnrecognizedUnionMembers: true,
1734
+ allowUnrecognizedEnumValues: true,
1735
+ skipValidation: true,
1736
+ breadcrumbsPrefix: ["response"],
1737
+ }),
1738
+ rawResponse: _response.rawResponse,
1739
+ };
1740
+ }
1741
+ if (_response.error.reason === "status-code") {
1742
+ switch (_response.error.statusCode) {
1743
+ case 404:
1744
+ throw new Taktoria.NotFoundError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1745
+ unrecognizedObjectKeys: "passthrough",
1746
+ allowUnrecognizedUnionMembers: true,
1747
+ allowUnrecognizedEnumValues: true,
1748
+ skipValidation: true,
1749
+ breadcrumbsPrefix: ["response"],
1750
+ }), _response.rawResponse);
1751
+ case 403:
1752
+ throw new Taktoria.ForbiddenError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1753
+ unrecognizedObjectKeys: "passthrough",
1754
+ allowUnrecognizedUnionMembers: true,
1755
+ allowUnrecognizedEnumValues: true,
1756
+ skipValidation: true,
1757
+ breadcrumbsPrefix: ["response"],
1758
+ }), _response.rawResponse);
1759
+ case 429:
1760
+ throw new Taktoria.TooManyRequestsError(serializers.ErrorBody.parseOrThrow(_response.error.body, {
1761
+ unrecognizedObjectKeys: "passthrough",
1762
+ allowUnrecognizedUnionMembers: true,
1763
+ allowUnrecognizedEnumValues: true,
1764
+ skipValidation: true,
1765
+ breadcrumbsPrefix: ["response"],
1766
+ }), _response.rawResponse);
1767
+ default:
1768
+ throw new errors.TaktoriaError({
1769
+ statusCode: _response.error.statusCode,
1770
+ body: _response.error.body,
1771
+ rawResponse: _response.rawResponse,
1772
+ });
1773
+ }
1774
+ }
1775
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/geist/templates/{templateId}/restore");
1776
+ });
1777
+ }
1778
+ }
1779
+ exports.GeistClient = GeistClient;