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