@dfns/sdk 0.2.2 → 0.2.3-rc.1

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 (377) hide show
  1. package/baseAuthApi.ts +236 -0
  2. package/codegen/Assets/AssetsClient.ts +137 -0
  3. package/codegen/Assets/DelegatedAssetsClient.ts +201 -0
  4. package/codegen/Assets/index.ts +3 -0
  5. package/codegen/Assets/types.ts +45 -0
  6. package/codegen/Auth/AuthClient.ts +729 -0
  7. package/codegen/Auth/DelegatedAuthClient.ts +1508 -0
  8. package/codegen/Auth/index.ts +3 -0
  9. package/codegen/Auth/types.ts +262 -0
  10. package/codegen/Blockchains/BlockchainsClient.ts +25 -0
  11. package/codegen/Blockchains/DelegatedBlockchainsClient.ts +25 -0
  12. package/codegen/Blockchains/index.ts +3 -0
  13. package/codegen/Blockchains/types.ts +8 -0
  14. package/codegen/Callbacks/CallbacksClient.ts +107 -0
  15. package/codegen/Callbacks/DelegatedCallbacksClient.ts +172 -0
  16. package/codegen/Callbacks/index.ts +3 -0
  17. package/codegen/Callbacks/{types.d.ts → types.ts} +26 -18
  18. package/codegen/Permissions/DelegatedPermissionsClient.ts +468 -0
  19. package/codegen/Permissions/PermissionsClient.ts +223 -0
  20. package/codegen/Permissions/index.ts +3 -0
  21. package/codegen/Permissions/types.ts +82 -0
  22. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.ts +99 -0
  23. package/codegen/PolicyExecution/PolicyExecutionClient.ts +63 -0
  24. package/codegen/PolicyExecution/index.ts +3 -0
  25. package/codegen/PolicyExecution/types.ts +24 -0
  26. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.ts +384 -0
  27. package/codegen/PolicyManagement/PolicyManagementClient.ts +205 -0
  28. package/codegen/PolicyManagement/index.ts +3 -0
  29. package/codegen/PolicyManagement/{types.d.ts → types.ts} +56 -40
  30. package/codegen/PublicKeys/DelegatedPublicKeysClient.ts +299 -0
  31. package/codegen/PublicKeys/PublicKeysClient.ts +179 -0
  32. package/codegen/PublicKeys/index.ts +3 -0
  33. package/codegen/PublicKeys/types.ts +68 -0
  34. package/codegen/Signers/DelegatedSignersClient.ts +22 -0
  35. package/codegen/Signers/SignersClient.ts +22 -0
  36. package/codegen/Signers/index.ts +3 -0
  37. package/codegen/Signers/types.ts +3 -0
  38. package/codegen/Wallets/DelegatedWalletsClient.ts +511 -0
  39. package/codegen/Wallets/WalletsClient.ts +310 -0
  40. package/codegen/Wallets/index.ts +3 -0
  41. package/codegen/Wallets/types.ts +137 -0
  42. package/codegen/datamodel/ApiKeys/errors.ts +9 -0
  43. package/codegen/datamodel/ApiKeys/index.ts +3 -0
  44. package/codegen/datamodel/ApiKeys/responses.ts +68 -0
  45. package/codegen/datamodel/ApiKeys/types.ts +81 -0
  46. package/codegen/datamodel/Assets/errors.ts +24 -0
  47. package/codegen/datamodel/Assets/index.ts +3 -0
  48. package/codegen/datamodel/Assets/responses.ts +146 -0
  49. package/codegen/datamodel/Assets/types.ts +417 -0
  50. package/codegen/datamodel/Auth/index.ts +2 -0
  51. package/codegen/datamodel/Auth/responses.ts +1110 -0
  52. package/codegen/datamodel/Auth/types.ts +1404 -0
  53. package/codegen/datamodel/BlockchainIndexing/index.ts +1 -0
  54. package/codegen/datamodel/BlockchainIndexing/{responses.d.ts → responses.ts} +10 -5
  55. package/codegen/datamodel/Blockchains/index.ts +2 -0
  56. package/codegen/datamodel/Blockchains/responses.ts +41 -0
  57. package/codegen/datamodel/Blockchains/types.ts +695 -0
  58. package/codegen/datamodel/Callbacks/index.ts +2 -0
  59. package/codegen/datamodel/Callbacks/responses.ts +110 -0
  60. package/codegen/datamodel/Callbacks/types.ts +100 -0
  61. package/codegen/datamodel/Foundations/errors.ts +299 -0
  62. package/codegen/datamodel/Foundations/index.ts +2 -0
  63. package/codegen/datamodel/Foundations/types.ts +57921 -0
  64. package/codegen/datamodel/Orgs/index.ts +2 -0
  65. package/codegen/datamodel/Orgs/responses.ts +104 -0
  66. package/codegen/datamodel/Orgs/types.ts +322 -0
  67. package/codegen/datamodel/Permissions/index.ts +2 -0
  68. package/codegen/datamodel/Permissions/responses.ts +258 -0
  69. package/codegen/datamodel/Permissions/types.ts +221 -0
  70. package/codegen/datamodel/PolicyExecution/errors.ts +24 -0
  71. package/codegen/datamodel/PolicyExecution/index.ts +3 -0
  72. package/codegen/datamodel/PolicyExecution/responses.ts +59 -0
  73. package/codegen/datamodel/PolicyExecution/types.ts +122 -0
  74. package/codegen/datamodel/PolicyManagement/index.ts +2 -0
  75. package/codegen/datamodel/PolicyManagement/responses.ts +255 -0
  76. package/codegen/datamodel/PolicyManagement/types.ts +711 -0
  77. package/codegen/datamodel/PublicKeys/index.ts +2 -0
  78. package/codegen/datamodel/PublicKeys/responses.ts +190 -0
  79. package/codegen/datamodel/PublicKeys/types.ts +558 -0
  80. package/codegen/datamodel/Signers/index.ts +2 -0
  81. package/codegen/datamodel/Signers/responses.ts +64 -0
  82. package/codegen/datamodel/Signers/types.ts +31 -0
  83. package/codegen/datamodel/Wallets/errors.ts +0 -0
  84. package/codegen/datamodel/Wallets/index.ts +2 -0
  85. package/codegen/datamodel/Wallets/responses.ts +318 -0
  86. package/codegen/datamodel/Wallets/types.ts +1268 -0
  87. package/dfnsApiClient.ts +76 -0
  88. package/dfnsAuthenticator.ts +59 -0
  89. package/dfnsDelegatedApiClient.ts +75 -0
  90. package/dfnsError.ts +5 -0
  91. package/generated/permissions/client.ts +125 -0
  92. package/generated/permissions/delegatedClient.ts +266 -0
  93. package/generated/permissions/index.ts +3 -0
  94. package/generated/permissions/types.ts +202 -0
  95. package/generated/policies/client.ts +110 -0
  96. package/generated/policies/delegatedClient.ts +223 -0
  97. package/generated/policies/index.ts +3 -0
  98. package/generated/policies/{types.d.ts → types.ts} +29 -17
  99. package/generated/signers/client.ts +22 -0
  100. package/generated/signers/delegatedClient.ts +23 -0
  101. package/generated/signers/index.ts +3 -0
  102. package/generated/signers/{types.d.ts → types.ts} +1 -0
  103. package/generated/wallets/client.ts +282 -0
  104. package/generated/wallets/delegatedClient.ts +507 -0
  105. package/generated/wallets/index.ts +3 -0
  106. package/generated/wallets/{types.d.ts → types.ts} +120 -48
  107. package/generated/webhooks/client.ts +124 -0
  108. package/generated/webhooks/delegatedClient.ts +237 -0
  109. package/generated/webhooks/index.ts +3 -0
  110. package/generated/webhooks/{types.d.ts → types.ts} +34 -16
  111. package/index.ts +7 -0
  112. package/package.json +1 -8
  113. package/project.json +14 -0
  114. package/signer.ts +60 -0
  115. package/store.ts +99 -0
  116. package/tsconfig.json +7 -0
  117. package/typedoc.json +21 -0
  118. package/types/policies.ts +1 -0
  119. package/types/signers.ts +1 -0
  120. package/types/wallets.ts +1 -0
  121. package/types/webhooks.ts +1 -0
  122. package/utils/base64.ts +19 -0
  123. package/utils/fetch.ts +130 -0
  124. package/utils/index.ts +4 -0
  125. package/utils/nonce.ts +12 -0
  126. package/utils/url.ts +19 -0
  127. package/baseAuthApi.d.ts +0 -113
  128. package/baseAuthApi.js +0 -97
  129. package/codegen/Assets/AssetsClient.d.ts +0 -13
  130. package/codegen/Assets/AssetsClient.js +0 -93
  131. package/codegen/Assets/DelegatedAssetsClient.d.ts +0 -16
  132. package/codegen/Assets/DelegatedAssetsClient.js +0 -124
  133. package/codegen/Assets/index.d.ts +0 -3
  134. package/codegen/Assets/index.js +0 -19
  135. package/codegen/Assets/types.d.ts +0 -37
  136. package/codegen/Assets/types.js +0 -2
  137. package/codegen/Auth/AuthClient.d.ts +0 -50
  138. package/codegen/Auth/AuthClient.js +0 -518
  139. package/codegen/Auth/DelegatedAuthClient.d.ts +0 -78
  140. package/codegen/Auth/DelegatedAuthClient.js +0 -936
  141. package/codegen/Auth/index.d.ts +0 -3
  142. package/codegen/Auth/index.js +0 -19
  143. package/codegen/Auth/types.d.ts +0 -177
  144. package/codegen/Auth/types.js +0 -2
  145. package/codegen/Blockchains/BlockchainsClient.d.ts +0 -7
  146. package/codegen/Blockchains/BlockchainsClient.js +0 -23
  147. package/codegen/Blockchains/DelegatedBlockchainsClient.d.ts +0 -7
  148. package/codegen/Blockchains/DelegatedBlockchainsClient.js +0 -23
  149. package/codegen/Blockchains/index.d.ts +0 -3
  150. package/codegen/Blockchains/index.js +0 -19
  151. package/codegen/Blockchains/types.d.ts +0 -6
  152. package/codegen/Blockchains/types.js +0 -2
  153. package/codegen/Callbacks/CallbacksClient.d.ts +0 -12
  154. package/codegen/Callbacks/CallbacksClient.js +0 -78
  155. package/codegen/Callbacks/DelegatedCallbacksClient.d.ts +0 -15
  156. package/codegen/Callbacks/DelegatedCallbacksClient.js +0 -110
  157. package/codegen/Callbacks/index.d.ts +0 -3
  158. package/codegen/Callbacks/index.js +0 -19
  159. package/codegen/Callbacks/types.js +0 -2
  160. package/codegen/Permissions/DelegatedPermissionsClient.d.ts +0 -27
  161. package/codegen/Permissions/DelegatedPermissionsClient.js +0 -284
  162. package/codegen/Permissions/PermissionsClient.d.ts +0 -18
  163. package/codegen/Permissions/PermissionsClient.js +0 -156
  164. package/codegen/Permissions/index.d.ts +0 -3
  165. package/codegen/Permissions/index.js +0 -19
  166. package/codegen/Permissions/types.d.ts +0 -62
  167. package/codegen/Permissions/types.js +0 -2
  168. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.d.ts +0 -11
  169. package/codegen/PolicyExecution/DelegatedPolicyExecutionClient.js +0 -61
  170. package/codegen/PolicyExecution/PolicyExecutionClient.d.ts +0 -9
  171. package/codegen/PolicyExecution/PolicyExecutionClient.js +0 -45
  172. package/codegen/PolicyExecution/index.d.ts +0 -3
  173. package/codegen/PolicyExecution/index.js +0 -19
  174. package/codegen/PolicyExecution/types.d.ts +0 -18
  175. package/codegen/PolicyExecution/types.js +0 -2
  176. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.d.ts +0 -25
  177. package/codegen/PolicyManagement/DelegatedPolicyManagementClient.js +0 -240
  178. package/codegen/PolicyManagement/PolicyManagementClient.d.ts +0 -18
  179. package/codegen/PolicyManagement/PolicyManagementClient.js +0 -146
  180. package/codegen/PolicyManagement/index.d.ts +0 -3
  181. package/codegen/PolicyManagement/index.js +0 -19
  182. package/codegen/PolicyManagement/types.js +0 -2
  183. package/codegen/PublicKeys/DelegatedPublicKeysClient.d.ts +0 -21
  184. package/codegen/PublicKeys/DelegatedPublicKeysClient.js +0 -189
  185. package/codegen/PublicKeys/PublicKeysClient.d.ts +0 -16
  186. package/codegen/PublicKeys/PublicKeysClient.js +0 -128
  187. package/codegen/PublicKeys/index.d.ts +0 -3
  188. package/codegen/PublicKeys/index.js +0 -19
  189. package/codegen/PublicKeys/types.d.ts +0 -51
  190. package/codegen/PublicKeys/types.js +0 -2
  191. package/codegen/Signers/DelegatedSignersClient.d.ts +0 -7
  192. package/codegen/Signers/DelegatedSignersClient.js +0 -22
  193. package/codegen/Signers/SignersClient.d.ts +0 -7
  194. package/codegen/Signers/SignersClient.js +0 -22
  195. package/codegen/Signers/index.d.ts +0 -3
  196. package/codegen/Signers/index.js +0 -19
  197. package/codegen/Signers/types.d.ts +0 -2
  198. package/codegen/Signers/types.js +0 -2
  199. package/codegen/Wallets/DelegatedWalletsClient.d.ts +0 -32
  200. package/codegen/Wallets/DelegatedWalletsClient.js +0 -325
  201. package/codegen/Wallets/WalletsClient.d.ts +0 -24
  202. package/codegen/Wallets/WalletsClient.js +0 -219
  203. package/codegen/Wallets/index.d.ts +0 -3
  204. package/codegen/Wallets/index.js +0 -19
  205. package/codegen/Wallets/types.d.ts +0 -101
  206. package/codegen/Wallets/types.js +0 -2
  207. package/codegen/datamodel/ApiKeys/errors.d.ts +0 -6
  208. package/codegen/datamodel/ApiKeys/errors.js +0 -15
  209. package/codegen/datamodel/ApiKeys/index.d.ts +0 -3
  210. package/codegen/datamodel/ApiKeys/index.js +0 -19
  211. package/codegen/datamodel/ApiKeys/responses.d.ts +0 -25
  212. package/codegen/datamodel/ApiKeys/responses.js +0 -2
  213. package/codegen/datamodel/ApiKeys/types.d.ts +0 -32
  214. package/codegen/datamodel/ApiKeys/types.js +0 -11
  215. package/codegen/datamodel/Assets/errors.d.ts +0 -11
  216. package/codegen/datamodel/Assets/errors.js +0 -17
  217. package/codegen/datamodel/Assets/index.d.ts +0 -3
  218. package/codegen/datamodel/Assets/index.js +0 -19
  219. package/codegen/datamodel/Assets/responses.d.ts +0 -47
  220. package/codegen/datamodel/Assets/responses.js +0 -2
  221. package/codegen/datamodel/Assets/types.d.ts +0 -225
  222. package/codegen/datamodel/Assets/types.js +0 -75
  223. package/codegen/datamodel/Auth/errors.js +0 -1
  224. package/codegen/datamodel/Auth/index.d.ts +0 -2
  225. package/codegen/datamodel/Auth/index.js +0 -18
  226. package/codegen/datamodel/Auth/responses.d.ts +0 -358
  227. package/codegen/datamodel/Auth/responses.js +0 -2
  228. package/codegen/datamodel/Auth/types.d.ts +0 -615
  229. package/codegen/datamodel/Auth/types.js +0 -127
  230. package/codegen/datamodel/BlockchainIndexing/errors.js +0 -1
  231. package/codegen/datamodel/BlockchainIndexing/index.d.ts +0 -1
  232. package/codegen/datamodel/BlockchainIndexing/index.js +0 -17
  233. package/codegen/datamodel/BlockchainIndexing/responses.js +0 -2
  234. package/codegen/datamodel/BlockchainIndexing/types.js +0 -1
  235. package/codegen/datamodel/Blockchains/errors.js +0 -1
  236. package/codegen/datamodel/Blockchains/index.d.ts +0 -2
  237. package/codegen/datamodel/Blockchains/index.js +0 -18
  238. package/codegen/datamodel/Blockchains/responses.d.ts +0 -12
  239. package/codegen/datamodel/Blockchains/responses.js +0 -2
  240. package/codegen/datamodel/Blockchains/types.d.ts +0 -270
  241. package/codegen/datamodel/Blockchains/types.js +0 -53
  242. package/codegen/datamodel/Callbacks/errors.js +0 -1
  243. package/codegen/datamodel/Callbacks/index.d.ts +0 -2
  244. package/codegen/datamodel/Callbacks/index.js +0 -18
  245. package/codegen/datamodel/Callbacks/responses.d.ts +0 -36
  246. package/codegen/datamodel/Callbacks/responses.js +0 -2
  247. package/codegen/datamodel/Callbacks/types.d.ts +0 -43
  248. package/codegen/datamodel/Callbacks/types.js +0 -39
  249. package/codegen/datamodel/Foundations/errors.d.ts +0 -131
  250. package/codegen/datamodel/Foundations/errors.js +0 -182
  251. package/codegen/datamodel/Foundations/index.d.ts +0 -2
  252. package/codegen/datamodel/Foundations/index.js +0 -18
  253. package/codegen/datamodel/Foundations/responses.js +0 -1
  254. package/codegen/datamodel/Foundations/types.d.ts +0 -9759
  255. package/codegen/datamodel/Foundations/types.js +0 -57755
  256. package/codegen/datamodel/Orgs/errors.js +0 -1
  257. package/codegen/datamodel/Orgs/index.d.ts +0 -2
  258. package/codegen/datamodel/Orgs/index.js +0 -18
  259. package/codegen/datamodel/Orgs/responses.d.ts +0 -45
  260. package/codegen/datamodel/Orgs/responses.js +0 -2
  261. package/codegen/datamodel/Orgs/types.d.ts +0 -240
  262. package/codegen/datamodel/Orgs/types.js +0 -39
  263. package/codegen/datamodel/Permissions/errors.js +0 -1
  264. package/codegen/datamodel/Permissions/index.d.ts +0 -2
  265. package/codegen/datamodel/Permissions/index.js +0 -18
  266. package/codegen/datamodel/Permissions/responses.d.ts +0 -75
  267. package/codegen/datamodel/Permissions/responses.js +0 -2
  268. package/codegen/datamodel/Permissions/types.d.ts +0 -93
  269. package/codegen/datamodel/Permissions/types.js +0 -43
  270. package/codegen/datamodel/PolicyExecution/errors.d.ts +0 -11
  271. package/codegen/datamodel/PolicyExecution/errors.js +0 -17
  272. package/codegen/datamodel/PolicyExecution/index.d.ts +0 -3
  273. package/codegen/datamodel/PolicyExecution/index.js +0 -19
  274. package/codegen/datamodel/PolicyExecution/responses.d.ts +0 -19
  275. package/codegen/datamodel/PolicyExecution/responses.js +0 -2
  276. package/codegen/datamodel/PolicyExecution/types.d.ts +0 -60
  277. package/codegen/datamodel/PolicyExecution/types.js +0 -17
  278. package/codegen/datamodel/PolicyManagement/errors.js +0 -1
  279. package/codegen/datamodel/PolicyManagement/index.d.ts +0 -2
  280. package/codegen/datamodel/PolicyManagement/index.js +0 -18
  281. package/codegen/datamodel/PolicyManagement/responses.d.ts +0 -83
  282. package/codegen/datamodel/PolicyManagement/responses.js +0 -2
  283. package/codegen/datamodel/PolicyManagement/types.d.ts +0 -391
  284. package/codegen/datamodel/PolicyManagement/types.js +0 -95
  285. package/codegen/datamodel/PublicKeys/errors.js +0 -1
  286. package/codegen/datamodel/PublicKeys/index.d.ts +0 -2
  287. package/codegen/datamodel/PublicKeys/index.js +0 -18
  288. package/codegen/datamodel/PublicKeys/responses.d.ts +0 -56
  289. package/codegen/datamodel/PublicKeys/responses.js +0 -2
  290. package/codegen/datamodel/PublicKeys/types.d.ts +0 -223
  291. package/codegen/datamodel/PublicKeys/types.js +0 -59
  292. package/codegen/datamodel/Signers/errors.js +0 -1
  293. package/codegen/datamodel/Signers/index.d.ts +0 -2
  294. package/codegen/datamodel/Signers/index.js +0 -18
  295. package/codegen/datamodel/Signers/responses.d.ts +0 -27
  296. package/codegen/datamodel/Signers/responses.js +0 -2
  297. package/codegen/datamodel/Signers/types.d.ts +0 -21
  298. package/codegen/datamodel/Signers/types.js +0 -2
  299. package/codegen/datamodel/Wallets/errors.js +0 -1
  300. package/codegen/datamodel/Wallets/index.d.ts +0 -2
  301. package/codegen/datamodel/Wallets/index.js +0 -18
  302. package/codegen/datamodel/Wallets/responses.d.ts +0 -92
  303. package/codegen/datamodel/Wallets/responses.js +0 -2
  304. package/codegen/datamodel/Wallets/types.d.ts +0 -677
  305. package/codegen/datamodel/Wallets/types.js +0 -251
  306. package/dfnsApiClient.d.ts +0 -39
  307. package/dfnsApiClient.js +0 -63
  308. package/dfnsAuthenticator.d.ts +0 -17
  309. package/dfnsAuthenticator.js +0 -29
  310. package/dfnsDelegatedApiClient.d.ts +0 -38
  311. package/dfnsDelegatedApiClient.js +0 -63
  312. package/dfnsError.d.ts +0 -5
  313. package/dfnsError.js +0 -11
  314. package/generated/policies/client.d.ts +0 -13
  315. package/generated/policies/client.js +0 -92
  316. package/generated/policies/delegatedClient.d.ts +0 -18
  317. package/generated/policies/delegatedClient.js +0 -153
  318. package/generated/policies/index.d.ts +0 -3
  319. package/generated/policies/index.js +0 -19
  320. package/generated/policies/types.js +0 -2
  321. package/generated/signers/client.d.ts +0 -7
  322. package/generated/signers/client.js +0 -22
  323. package/generated/signers/delegatedClient.d.ts +0 -7
  324. package/generated/signers/delegatedClient.js +0 -22
  325. package/generated/signers/index.d.ts +0 -3
  326. package/generated/signers/index.js +0 -19
  327. package/generated/signers/types.js +0 -2
  328. package/generated/wallets/client.d.ts +0 -25
  329. package/generated/wallets/client.js +0 -228
  330. package/generated/wallets/delegatedClient.d.ts +0 -34
  331. package/generated/wallets/delegatedClient.js +0 -349
  332. package/generated/wallets/index.d.ts +0 -3
  333. package/generated/wallets/index.js +0 -19
  334. package/generated/wallets/types.js +0 -2
  335. package/generated/webhooks/client.d.ts +0 -14
  336. package/generated/webhooks/client.js +0 -103
  337. package/generated/webhooks/delegatedClient.d.ts +0 -19
  338. package/generated/webhooks/delegatedClient.js +0 -164
  339. package/generated/webhooks/index.d.ts +0 -3
  340. package/generated/webhooks/index.js +0 -19
  341. package/generated/webhooks/types.js +0 -2
  342. package/index.d.ts +0 -7
  343. package/index.js +0 -23
  344. package/signer.d.ts +0 -52
  345. package/signer.js +0 -2
  346. package/store.d.ts +0 -79
  347. package/store.js +0 -2
  348. package/types/policies.d.ts +0 -1
  349. package/types/policies.js +0 -17
  350. package/types/signers.d.ts +0 -1
  351. package/types/signers.js +0 -17
  352. package/types/wallets.d.ts +0 -1
  353. package/types/wallets.js +0 -17
  354. package/types/webhooks.d.ts +0 -1
  355. package/types/webhooks.js +0 -17
  356. package/utils/base64.d.ts +0 -3
  357. package/utils/base64.js +0 -20
  358. package/utils/fetch.d.ts +0 -12
  359. package/utils/fetch.js +0 -94
  360. package/utils/index.d.ts +0 -4
  361. package/utils/index.js +0 -20
  362. package/utils/nonce.d.ts +0 -1
  363. package/utils/nonce.js +0 -12
  364. package/utils/url.d.ts +0 -4
  365. package/utils/url.js +0 -16
  366. /package/{codegen/datamodel/Auth/errors.d.ts → README.md} +0 -0
  367. /package/codegen/datamodel/{BlockchainIndexing/errors.d.ts → Auth/errors.ts} +0 -0
  368. /package/codegen/datamodel/BlockchainIndexing/{types.d.ts → errors.ts} +0 -0
  369. /package/codegen/datamodel/{Blockchains/errors.d.ts → BlockchainIndexing/types.ts} +0 -0
  370. /package/codegen/datamodel/{Callbacks/errors.d.ts → Blockchains/errors.ts} +0 -0
  371. /package/codegen/datamodel/{Foundations/responses.d.ts → Callbacks/errors.ts} +0 -0
  372. /package/codegen/datamodel/{Orgs/errors.d.ts → Foundations/responses.ts} +0 -0
  373. /package/codegen/datamodel/{Permissions/errors.d.ts → Orgs/errors.ts} +0 -0
  374. /package/codegen/datamodel/{PolicyManagement/errors.d.ts → Permissions/errors.ts} +0 -0
  375. /package/codegen/datamodel/{PublicKeys/errors.d.ts → PolicyManagement/errors.ts} +0 -0
  376. /package/codegen/datamodel/{Signers/errors.d.ts → PublicKeys/errors.ts} +0 -0
  377. /package/codegen/datamodel/{Wallets/errors.d.ts → Signers/errors.ts} +0 -0
@@ -0,0 +1,1508 @@
1
+ import {
2
+ BaseAuthApi,
3
+ SignUserActionChallengeRequest,
4
+ UserActionChallengeResponse,
5
+ } from '../../baseAuthApi'
6
+ import { DfnsDelegatedApiClientOptions } from '../../dfnsDelegatedApiClient'
7
+ import { simpleFetch } from '../../utils/fetch'
8
+ import { buildPathAndQuery } from '../../utils/url'
9
+ import * as T from './types'
10
+
11
+ export class DelegatedAuthClient {
12
+ constructor(private apiOptions: DfnsDelegatedApiClientOptions) {}
13
+
14
+ async createDelegatedUserRegistrationInit(
15
+ request: T.CreateDelegatedUserRegistrationRequest
16
+ ): Promise<UserActionChallengeResponse> {
17
+ const path = buildPathAndQuery('/auth/registration/delegated', {
18
+ path: {},
19
+ query: {},
20
+ })
21
+
22
+ const challenge = await BaseAuthApi.createUserActionChallenge(
23
+ {
24
+ userActionHttpMethod: 'POST',
25
+ userActionHttpPath: path,
26
+ userActionPayload: JSON.stringify(request.body),
27
+ userActionServerKind: 'Api',
28
+ },
29
+ this.apiOptions
30
+ )
31
+
32
+ return challenge
33
+ }
34
+
35
+ async createDelegatedUserRegistrationComplete(
36
+ request: T.CreateDelegatedUserRegistrationRequest,
37
+ signedChallenge: SignUserActionChallengeRequest
38
+ ): Promise<T.CreateDelegatedUserRegistrationResponse> {
39
+ const path = buildPathAndQuery('/auth/registration/delegated', {
40
+ path: {},
41
+ query: {},
42
+ })
43
+
44
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
45
+ signedChallenge,
46
+ this.apiOptions
47
+ )
48
+
49
+ const response = await simpleFetch(path, {
50
+ method: 'POST',
51
+ body: request.body,
52
+ headers: { 'x-dfns-useraction': userAction },
53
+ apiOptions: this.apiOptions,
54
+ })
55
+
56
+ return response.json()
57
+ }
58
+
59
+ async createUserRegistration(
60
+ request: T.CreateUserRegistrationRequest
61
+ ): Promise<T.CreateUserRegistrationResponse> {
62
+ const path = buildPathAndQuery('/auth/registration', {
63
+ path: {},
64
+ query: {},
65
+ })
66
+
67
+ const response = await simpleFetch(path, {
68
+ method: 'POST',
69
+ body: request.body,
70
+ apiOptions: this.apiOptions,
71
+ })
72
+
73
+ return response.json()
74
+ }
75
+
76
+ async createDelegatedUserLoginInit(
77
+ request: T.CreateDelegatedUserLoginRequest
78
+ ): Promise<UserActionChallengeResponse> {
79
+ const path = buildPathAndQuery('/auth/login/delegated', {
80
+ path: {},
81
+ query: {},
82
+ })
83
+
84
+ const challenge = await BaseAuthApi.createUserActionChallenge(
85
+ {
86
+ userActionHttpMethod: 'POST',
87
+ userActionHttpPath: path,
88
+ userActionPayload: JSON.stringify(request.body),
89
+ userActionServerKind: 'Api',
90
+ },
91
+ this.apiOptions
92
+ )
93
+
94
+ return challenge
95
+ }
96
+
97
+ async createDelegatedUserLoginComplete(
98
+ request: T.CreateDelegatedUserLoginRequest,
99
+ signedChallenge: SignUserActionChallengeRequest
100
+ ): Promise<T.CreateDelegatedUserLoginResponse> {
101
+ const path = buildPathAndQuery('/auth/login/delegated', {
102
+ path: {},
103
+ query: {},
104
+ })
105
+
106
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
107
+ signedChallenge,
108
+ this.apiOptions
109
+ )
110
+
111
+ const response = await simpleFetch(path, {
112
+ method: 'POST',
113
+ body: request.body,
114
+ headers: { 'x-dfns-useraction': userAction },
115
+ apiOptions: this.apiOptions,
116
+ })
117
+
118
+ return response.json()
119
+ }
120
+
121
+ async createUserActionSignatureChallenge(
122
+ request: T.CreateUserActionSignatureChallengeRequest
123
+ ): Promise<T.CreateUserActionSignatureChallengeResponse> {
124
+ const path = buildPathAndQuery('/auth/action/init', {
125
+ path: {},
126
+ query: {},
127
+ })
128
+
129
+ const response = await simpleFetch(path, {
130
+ method: 'POST',
131
+ body: request.body,
132
+ apiOptions: this.apiOptions,
133
+ })
134
+
135
+ return response.json()
136
+ }
137
+
138
+ async createUserActionSignature(
139
+ request: T.CreateUserActionSignatureRequest
140
+ ): Promise<T.CreateUserActionSignatureResponse> {
141
+ const path = buildPathAndQuery('/auth/action', {
142
+ path: {},
143
+ query: {},
144
+ })
145
+
146
+ const response = await simpleFetch(path, {
147
+ method: 'POST',
148
+ body: request.body,
149
+ apiOptions: this.apiOptions,
150
+ })
151
+
152
+ return response.json()
153
+ }
154
+
155
+ async createUserCredentialChallenge(
156
+ request: T.CreateUserCredentialChallengeRequest
157
+ ): Promise<T.CreateUserCredentialChallengeResponse> {
158
+ const path = buildPathAndQuery('/auth/credentials/init', {
159
+ path: {},
160
+ query: {},
161
+ })
162
+
163
+ const response = await simpleFetch(path, {
164
+ method: 'POST',
165
+ body: request.body,
166
+ apiOptions: this.apiOptions,
167
+ })
168
+
169
+ return response.json()
170
+ }
171
+
172
+ async createUserCredentialInit(
173
+ request: T.CreateUserCredentialRequest
174
+ ): Promise<UserActionChallengeResponse> {
175
+ const path = buildPathAndQuery('/auth/credentials', {
176
+ path: {},
177
+ query: {},
178
+ })
179
+
180
+ const challenge = await BaseAuthApi.createUserActionChallenge(
181
+ {
182
+ userActionHttpMethod: 'POST',
183
+ userActionHttpPath: path,
184
+ userActionPayload: JSON.stringify(request.body),
185
+ userActionServerKind: 'Api',
186
+ },
187
+ this.apiOptions
188
+ )
189
+
190
+ return challenge
191
+ }
192
+
193
+ async createUserCredentialComplete(
194
+ request: T.CreateUserCredentialRequest,
195
+ signedChallenge: SignUserActionChallengeRequest
196
+ ): Promise<T.CreateUserCredentialResponse> {
197
+ const path = buildPathAndQuery('/auth/credentials', {
198
+ path: {},
199
+ query: {},
200
+ })
201
+
202
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
203
+ signedChallenge,
204
+ this.apiOptions
205
+ )
206
+
207
+ const response = await simpleFetch(path, {
208
+ method: 'POST',
209
+ body: request.body,
210
+ headers: { 'x-dfns-useraction': userAction },
211
+ apiOptions: this.apiOptions,
212
+ })
213
+
214
+ return response.json()
215
+ }
216
+
217
+ async activateCredentialInit(
218
+ request: T.ActivateCredentialRequest
219
+ ): Promise<UserActionChallengeResponse> {
220
+ const path = buildPathAndQuery('/auth/credentials/activate', {
221
+ path: {},
222
+ query: {},
223
+ })
224
+
225
+ const challenge = await BaseAuthApi.createUserActionChallenge(
226
+ {
227
+ userActionHttpMethod: 'PUT',
228
+ userActionHttpPath: path,
229
+ userActionPayload: JSON.stringify(request.body),
230
+ userActionServerKind: 'Api',
231
+ },
232
+ this.apiOptions
233
+ )
234
+
235
+ return challenge
236
+ }
237
+
238
+ async activateCredentialComplete(
239
+ request: T.ActivateCredentialRequest,
240
+ signedChallenge: SignUserActionChallengeRequest
241
+ ): Promise<T.ActivateCredentialResponse> {
242
+ const path = buildPathAndQuery('/auth/credentials/activate', {
243
+ path: {},
244
+ query: {},
245
+ })
246
+
247
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
248
+ signedChallenge,
249
+ this.apiOptions
250
+ )
251
+
252
+ const response = await simpleFetch(path, {
253
+ method: 'PUT',
254
+ body: request.body,
255
+ headers: { 'x-dfns-useraction': userAction },
256
+ apiOptions: this.apiOptions,
257
+ })
258
+
259
+ return response.json()
260
+ }
261
+
262
+ async deactivateCredentialInit(
263
+ request: T.DeactivateCredentialRequest
264
+ ): Promise<UserActionChallengeResponse> {
265
+ const path = buildPathAndQuery('/auth/credentials/deactivate', {
266
+ path: {},
267
+ query: {},
268
+ })
269
+
270
+ const challenge = await BaseAuthApi.createUserActionChallenge(
271
+ {
272
+ userActionHttpMethod: 'PUT',
273
+ userActionHttpPath: path,
274
+ userActionPayload: JSON.stringify(request.body),
275
+ userActionServerKind: 'Api',
276
+ },
277
+ this.apiOptions
278
+ )
279
+
280
+ return challenge
281
+ }
282
+
283
+ async deactivateCredentialComplete(
284
+ request: T.DeactivateCredentialRequest,
285
+ signedChallenge: SignUserActionChallengeRequest
286
+ ): Promise<T.DeactivateCredentialResponse> {
287
+ const path = buildPathAndQuery('/auth/credentials/deactivate', {
288
+ path: {},
289
+ query: {},
290
+ })
291
+
292
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
293
+ signedChallenge,
294
+ this.apiOptions
295
+ )
296
+
297
+ const response = await simpleFetch(path, {
298
+ method: 'PUT',
299
+ body: request.body,
300
+ headers: { 'x-dfns-useraction': userAction },
301
+ apiOptions: this.apiOptions,
302
+ })
303
+
304
+ return response.json()
305
+ }
306
+
307
+ async listUserCredentials(): Promise<T.ListUserCredentialsResponse> {
308
+ const path = buildPathAndQuery('/auth/credentials', {
309
+ path: {},
310
+ query: {},
311
+ })
312
+
313
+ const response = await simpleFetch(path, {
314
+ method: 'GET',
315
+ apiOptions: this.apiOptions,
316
+ })
317
+
318
+ return response.json()
319
+ }
320
+
321
+ async createUserActionSignatureFromCode(
322
+ request: T.CreateUserActionSignatureFromCodeRequest
323
+ ): Promise<T.CreateUserActionSignatureFromCodeResponse> {
324
+ const path = buildPathAndQuery('/auth/action/code/verify', {
325
+ path: {},
326
+ query: {},
327
+ })
328
+
329
+ const response = await simpleFetch(path, {
330
+ method: 'POST',
331
+ body: request.body,
332
+ apiOptions: this.apiOptions,
333
+ })
334
+
335
+ return response.json()
336
+ }
337
+
338
+ async createCodeUserActionSignatureChallenge(
339
+ request: T.CreateCodeUserActionSignatureChallengeRequest
340
+ ): Promise<T.CreateCodeUserActionSignatureChallengeResponse> {
341
+ const path = buildPathAndQuery('/auth/action/code/init', {
342
+ path: {},
343
+ query: {},
344
+ })
345
+
346
+ const response = await simpleFetch(path, {
347
+ method: 'POST',
348
+ body: request.body,
349
+ apiOptions: this.apiOptions,
350
+ })
351
+
352
+ return response.json()
353
+ }
354
+
355
+ async createCodeUserActionSignature(
356
+ request: T.CreateCodeUserActionSignatureRequest
357
+ ): Promise<T.CreateCodeUserActionSignatureResponse> {
358
+ const path = buildPathAndQuery('/auth/action/code', {
359
+ path: {},
360
+ query: {},
361
+ })
362
+
363
+ const response = await simpleFetch(path, {
364
+ method: 'POST',
365
+ body: request.body,
366
+ apiOptions: this.apiOptions,
367
+ })
368
+
369
+ return response.json()
370
+ }
371
+
372
+ async listPersonalAccessTokens(): Promise<T.ListPersonalAccessTokensResponse> {
373
+ const path = buildPathAndQuery('/auth/pats', {
374
+ path: {},
375
+ query: {},
376
+ })
377
+
378
+ const response = await simpleFetch(path, {
379
+ method: 'GET',
380
+ apiOptions: this.apiOptions,
381
+ })
382
+
383
+ return response.json()
384
+ }
385
+
386
+ async createPersonalAccessTokenInit(
387
+ request: T.CreatePersonalAccessTokenRequest
388
+ ): Promise<UserActionChallengeResponse> {
389
+ const path = buildPathAndQuery('/auth/pats', {
390
+ path: {},
391
+ query: {},
392
+ })
393
+
394
+ const challenge = await BaseAuthApi.createUserActionChallenge(
395
+ {
396
+ userActionHttpMethod: 'POST',
397
+ userActionHttpPath: path,
398
+ userActionPayload: JSON.stringify(request.body),
399
+ userActionServerKind: 'Api',
400
+ },
401
+ this.apiOptions
402
+ )
403
+
404
+ return challenge
405
+ }
406
+
407
+ async createPersonalAccessTokenComplete(
408
+ request: T.CreatePersonalAccessTokenRequest,
409
+ signedChallenge: SignUserActionChallengeRequest
410
+ ): Promise<T.CreatePersonalAccessTokenResponse> {
411
+ const path = buildPathAndQuery('/auth/pats', {
412
+ path: {},
413
+ query: {},
414
+ })
415
+
416
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
417
+ signedChallenge,
418
+ this.apiOptions
419
+ )
420
+
421
+ const response = await simpleFetch(path, {
422
+ method: 'POST',
423
+ body: request.body,
424
+ headers: { 'x-dfns-useraction': userAction },
425
+ apiOptions: this.apiOptions,
426
+ })
427
+
428
+ return response.json()
429
+ }
430
+
431
+ async getPersonalAccessTokens(
432
+ request: T.GetPersonalAccessTokensRequest
433
+ ): Promise<T.GetPersonalAccessTokensResponse> {
434
+ const path = buildPathAndQuery('/auth/pats/:tokenId', {
435
+ path: { tokenId: request.tokenId },
436
+ query: {},
437
+ })
438
+
439
+ const response = await simpleFetch(path, {
440
+ method: 'GET',
441
+ apiOptions: this.apiOptions,
442
+ })
443
+
444
+ return response.json()
445
+ }
446
+
447
+ async updatePersonalAccessTokenInit(
448
+ request: T.UpdatePersonalAccessTokenRequest
449
+ ): Promise<UserActionChallengeResponse> {
450
+ const path = buildPathAndQuery('/auth/pats/:tokenId', {
451
+ path: { tokenId: request.tokenId },
452
+ query: {},
453
+ })
454
+
455
+ const challenge = await BaseAuthApi.createUserActionChallenge(
456
+ {
457
+ userActionHttpMethod: 'PUT',
458
+ userActionHttpPath: path,
459
+ userActionPayload: JSON.stringify(request.body),
460
+ userActionServerKind: 'Api',
461
+ },
462
+ this.apiOptions
463
+ )
464
+
465
+ return challenge
466
+ }
467
+
468
+ async updatePersonalAccessTokenComplete(
469
+ request: T.UpdatePersonalAccessTokenRequest,
470
+ signedChallenge: SignUserActionChallengeRequest
471
+ ): Promise<T.UpdatePersonalAccessTokenResponse> {
472
+ const path = buildPathAndQuery('/auth/pats/:tokenId', {
473
+ path: { tokenId: request.tokenId },
474
+ query: {},
475
+ })
476
+
477
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
478
+ signedChallenge,
479
+ this.apiOptions
480
+ )
481
+
482
+ const response = await simpleFetch(path, {
483
+ method: 'PUT',
484
+ body: request.body,
485
+ headers: { 'x-dfns-useraction': userAction },
486
+ apiOptions: this.apiOptions,
487
+ })
488
+
489
+ return response.json()
490
+ }
491
+
492
+ async archivePersonalAccessTokenInit(
493
+ request: T.ArchivePersonalAccessTokenRequest
494
+ ): Promise<UserActionChallengeResponse> {
495
+ const path = buildPathAndQuery('/auth/pats/:tokenId', {
496
+ path: { tokenId: request.tokenId },
497
+ query: {},
498
+ })
499
+
500
+ const challenge = await BaseAuthApi.createUserActionChallenge(
501
+ {
502
+ userActionHttpMethod: 'DELETE',
503
+ userActionHttpPath: path,
504
+ userActionPayload: JSON.stringify({}),
505
+ userActionServerKind: 'Api',
506
+ },
507
+ this.apiOptions
508
+ )
509
+
510
+ return challenge
511
+ }
512
+
513
+ async archivePersonalAccessTokenComplete(
514
+ request: T.ArchivePersonalAccessTokenRequest,
515
+ signedChallenge: SignUserActionChallengeRequest
516
+ ): Promise<T.ArchivePersonalAccessTokenResponse> {
517
+ const path = buildPathAndQuery('/auth/pats/:tokenId', {
518
+ path: { tokenId: request.tokenId },
519
+ query: {},
520
+ })
521
+
522
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
523
+ signedChallenge,
524
+ this.apiOptions
525
+ )
526
+
527
+ const response = await simpleFetch(path, {
528
+ method: 'DELETE',
529
+ body: {},
530
+ headers: { 'x-dfns-useraction': userAction },
531
+ apiOptions: this.apiOptions,
532
+ })
533
+
534
+ return response.json()
535
+ }
536
+
537
+ async activatePersonalAccessTokenInit(
538
+ request: T.ActivatePersonalAccessTokenRequest
539
+ ): Promise<UserActionChallengeResponse> {
540
+ const path = buildPathAndQuery('/auth/pats/:tokenId/activate', {
541
+ path: { tokenId: request.tokenId },
542
+ query: {},
543
+ })
544
+
545
+ const challenge = await BaseAuthApi.createUserActionChallenge(
546
+ {
547
+ userActionHttpMethod: 'PUT',
548
+ userActionHttpPath: path,
549
+ userActionPayload: JSON.stringify({}),
550
+ userActionServerKind: 'Api',
551
+ },
552
+ this.apiOptions
553
+ )
554
+
555
+ return challenge
556
+ }
557
+
558
+ async activatePersonalAccessTokenComplete(
559
+ request: T.ActivatePersonalAccessTokenRequest,
560
+ signedChallenge: SignUserActionChallengeRequest
561
+ ): Promise<T.ActivatePersonalAccessTokenResponse> {
562
+ const path = buildPathAndQuery('/auth/pats/:tokenId/activate', {
563
+ path: { tokenId: request.tokenId },
564
+ query: {},
565
+ })
566
+
567
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
568
+ signedChallenge,
569
+ this.apiOptions
570
+ )
571
+
572
+ const response = await simpleFetch(path, {
573
+ method: 'PUT',
574
+ body: {},
575
+ headers: { 'x-dfns-useraction': userAction },
576
+ apiOptions: this.apiOptions,
577
+ })
578
+
579
+ return response.json()
580
+ }
581
+
582
+ async deactivatePersonalAccessTokenInit(
583
+ request: T.DeactivatePersonalAccessTokenRequest
584
+ ): Promise<UserActionChallengeResponse> {
585
+ const path = buildPathAndQuery('/auth/pats/:tokenId/deactivate', {
586
+ path: { tokenId: request.tokenId },
587
+ query: {},
588
+ })
589
+
590
+ const challenge = await BaseAuthApi.createUserActionChallenge(
591
+ {
592
+ userActionHttpMethod: 'PUT',
593
+ userActionHttpPath: path,
594
+ userActionPayload: JSON.stringify({}),
595
+ userActionServerKind: 'Api',
596
+ },
597
+ this.apiOptions
598
+ )
599
+
600
+ return challenge
601
+ }
602
+
603
+ async deactivatePersonalAccessTokenComplete(
604
+ request: T.DeactivatePersonalAccessTokenRequest,
605
+ signedChallenge: SignUserActionChallengeRequest
606
+ ): Promise<T.DeactivatePersonalAccessTokenResponse> {
607
+ const path = buildPathAndQuery('/auth/pats/:tokenId/deactivate', {
608
+ path: { tokenId: request.tokenId },
609
+ query: {},
610
+ })
611
+
612
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
613
+ signedChallenge,
614
+ this.apiOptions
615
+ )
616
+
617
+ const response = await simpleFetch(path, {
618
+ method: 'PUT',
619
+ body: {},
620
+ headers: { 'x-dfns-useraction': userAction },
621
+ apiOptions: this.apiOptions,
622
+ })
623
+
624
+ return response.json()
625
+ }
626
+
627
+ async listServiceAccounts(): Promise<T.ListServiceAccountsResponse> {
628
+ const path = buildPathAndQuery('/auth/service-accounts', {
629
+ path: {},
630
+ query: {},
631
+ })
632
+
633
+ const response = await simpleFetch(path, {
634
+ method: 'GET',
635
+ apiOptions: this.apiOptions,
636
+ })
637
+
638
+ return response.json()
639
+ }
640
+
641
+ async createServiceAccountInit(
642
+ request: T.CreateServiceAccountRequest
643
+ ): Promise<UserActionChallengeResponse> {
644
+ const path = buildPathAndQuery('/auth/service-accounts', {
645
+ path: {},
646
+ query: {},
647
+ })
648
+
649
+ const challenge = await BaseAuthApi.createUserActionChallenge(
650
+ {
651
+ userActionHttpMethod: 'POST',
652
+ userActionHttpPath: path,
653
+ userActionPayload: JSON.stringify(request.body),
654
+ userActionServerKind: 'Api',
655
+ },
656
+ this.apiOptions
657
+ )
658
+
659
+ return challenge
660
+ }
661
+
662
+ async createServiceAccountComplete(
663
+ request: T.CreateServiceAccountRequest,
664
+ signedChallenge: SignUserActionChallengeRequest
665
+ ): Promise<T.CreateServiceAccountResponse> {
666
+ const path = buildPathAndQuery('/auth/service-accounts', {
667
+ path: {},
668
+ query: {},
669
+ })
670
+
671
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
672
+ signedChallenge,
673
+ this.apiOptions
674
+ )
675
+
676
+ const response = await simpleFetch(path, {
677
+ method: 'POST',
678
+ body: request.body,
679
+ headers: { 'x-dfns-useraction': userAction },
680
+ apiOptions: this.apiOptions,
681
+ })
682
+
683
+ return response.json()
684
+ }
685
+
686
+ async getServiceAccount(
687
+ request: T.GetServiceAccountRequest
688
+ ): Promise<T.GetServiceAccountResponse> {
689
+ const path = buildPathAndQuery('/auth/service-accounts/:serviceAccountId', {
690
+ path: { serviceAccountId: request.serviceAccountId },
691
+ query: {},
692
+ })
693
+
694
+ const response = await simpleFetch(path, {
695
+ method: 'GET',
696
+ apiOptions: this.apiOptions,
697
+ })
698
+
699
+ return response.json()
700
+ }
701
+
702
+ async updateServiceAccountInit(
703
+ request: T.UpdateServiceAccountRequest
704
+ ): Promise<UserActionChallengeResponse> {
705
+ const path = buildPathAndQuery('/auth/service-accounts/:serviceAccountId', {
706
+ path: { serviceAccountId: request.serviceAccountId },
707
+ query: {},
708
+ })
709
+
710
+ const challenge = await BaseAuthApi.createUserActionChallenge(
711
+ {
712
+ userActionHttpMethod: 'PUT',
713
+ userActionHttpPath: path,
714
+ userActionPayload: JSON.stringify(request.body),
715
+ userActionServerKind: 'Api',
716
+ },
717
+ this.apiOptions
718
+ )
719
+
720
+ return challenge
721
+ }
722
+
723
+ async updateServiceAccountComplete(
724
+ request: T.UpdateServiceAccountRequest,
725
+ signedChallenge: SignUserActionChallengeRequest
726
+ ): Promise<T.UpdateServiceAccountResponse> {
727
+ const path = buildPathAndQuery('/auth/service-accounts/:serviceAccountId', {
728
+ path: { serviceAccountId: request.serviceAccountId },
729
+ query: {},
730
+ })
731
+
732
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
733
+ signedChallenge,
734
+ this.apiOptions
735
+ )
736
+
737
+ const response = await simpleFetch(path, {
738
+ method: 'PUT',
739
+ body: request.body,
740
+ headers: { 'x-dfns-useraction': userAction },
741
+ apiOptions: this.apiOptions,
742
+ })
743
+
744
+ return response.json()
745
+ }
746
+
747
+ async archiveServiceAccountInit(
748
+ request: T.ArchiveServiceAccountRequest
749
+ ): Promise<UserActionChallengeResponse> {
750
+ const path = buildPathAndQuery('/auth/service-accounts/:serviceAccountId', {
751
+ path: { serviceAccountId: request.serviceAccountId },
752
+ query: {},
753
+ })
754
+
755
+ const challenge = await BaseAuthApi.createUserActionChallenge(
756
+ {
757
+ userActionHttpMethod: 'DELETE',
758
+ userActionHttpPath: path,
759
+ userActionPayload: JSON.stringify({}),
760
+ userActionServerKind: 'Api',
761
+ },
762
+ this.apiOptions
763
+ )
764
+
765
+ return challenge
766
+ }
767
+
768
+ async archiveServiceAccountComplete(
769
+ request: T.ArchiveServiceAccountRequest,
770
+ signedChallenge: SignUserActionChallengeRequest
771
+ ): Promise<T.ArchiveServiceAccountResponse> {
772
+ const path = buildPathAndQuery('/auth/service-accounts/:serviceAccountId', {
773
+ path: { serviceAccountId: request.serviceAccountId },
774
+ query: {},
775
+ })
776
+
777
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
778
+ signedChallenge,
779
+ this.apiOptions
780
+ )
781
+
782
+ const response = await simpleFetch(path, {
783
+ method: 'DELETE',
784
+ body: {},
785
+ headers: { 'x-dfns-useraction': userAction },
786
+ apiOptions: this.apiOptions,
787
+ })
788
+
789
+ return response.json()
790
+ }
791
+
792
+ async activateServiceAccountInit(
793
+ request: T.ActivateServiceAccountRequest
794
+ ): Promise<UserActionChallengeResponse> {
795
+ const path = buildPathAndQuery(
796
+ '/auth/service-accounts/:serviceAccountId/activate',
797
+ {
798
+ path: { serviceAccountId: request.serviceAccountId },
799
+ query: {},
800
+ }
801
+ )
802
+
803
+ const challenge = await BaseAuthApi.createUserActionChallenge(
804
+ {
805
+ userActionHttpMethod: 'PUT',
806
+ userActionHttpPath: path,
807
+ userActionPayload: JSON.stringify({}),
808
+ userActionServerKind: 'Api',
809
+ },
810
+ this.apiOptions
811
+ )
812
+
813
+ return challenge
814
+ }
815
+
816
+ async activateServiceAccountComplete(
817
+ request: T.ActivateServiceAccountRequest,
818
+ signedChallenge: SignUserActionChallengeRequest
819
+ ): Promise<T.ActivateServiceAccountResponse> {
820
+ const path = buildPathAndQuery(
821
+ '/auth/service-accounts/:serviceAccountId/activate',
822
+ {
823
+ path: { serviceAccountId: request.serviceAccountId },
824
+ query: {},
825
+ }
826
+ )
827
+
828
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
829
+ signedChallenge,
830
+ this.apiOptions
831
+ )
832
+
833
+ const response = await simpleFetch(path, {
834
+ method: 'PUT',
835
+ body: {},
836
+ headers: { 'x-dfns-useraction': userAction },
837
+ apiOptions: this.apiOptions,
838
+ })
839
+
840
+ return response.json()
841
+ }
842
+
843
+ async deactivateServiceAccountInit(
844
+ request: T.DeactivateServiceAccountRequest
845
+ ): Promise<UserActionChallengeResponse> {
846
+ const path = buildPathAndQuery(
847
+ '/auth/service-accounts/:serviceAccountId/deactivate',
848
+ {
849
+ path: { serviceAccountId: request.serviceAccountId },
850
+ query: {},
851
+ }
852
+ )
853
+
854
+ const challenge = await BaseAuthApi.createUserActionChallenge(
855
+ {
856
+ userActionHttpMethod: 'PUT',
857
+ userActionHttpPath: path,
858
+ userActionPayload: JSON.stringify({}),
859
+ userActionServerKind: 'Api',
860
+ },
861
+ this.apiOptions
862
+ )
863
+
864
+ return challenge
865
+ }
866
+
867
+ async deactivateServiceAccountComplete(
868
+ request: T.DeactivateServiceAccountRequest,
869
+ signedChallenge: SignUserActionChallengeRequest
870
+ ): Promise<T.DeactivateServiceAccountResponse> {
871
+ const path = buildPathAndQuery(
872
+ '/auth/service-accounts/:serviceAccountId/deactivate',
873
+ {
874
+ path: { serviceAccountId: request.serviceAccountId },
875
+ query: {},
876
+ }
877
+ )
878
+
879
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
880
+ signedChallenge,
881
+ this.apiOptions
882
+ )
883
+
884
+ const response = await simpleFetch(path, {
885
+ method: 'PUT',
886
+ body: {},
887
+ headers: { 'x-dfns-useraction': userAction },
888
+ apiOptions: this.apiOptions,
889
+ })
890
+
891
+ return response.json()
892
+ }
893
+
894
+ async listUsers(): Promise<T.ListUsersResponse> {
895
+ const path = buildPathAndQuery('/auth/users', {
896
+ path: {},
897
+ query: {},
898
+ })
899
+
900
+ const response = await simpleFetch(path, {
901
+ method: 'GET',
902
+ apiOptions: this.apiOptions,
903
+ })
904
+
905
+ return response.json()
906
+ }
907
+
908
+ async createUserInit(
909
+ request: T.CreateUserRequest
910
+ ): Promise<UserActionChallengeResponse> {
911
+ const path = buildPathAndQuery('/auth/users', {
912
+ path: {},
913
+ query: {},
914
+ })
915
+
916
+ const challenge = await BaseAuthApi.createUserActionChallenge(
917
+ {
918
+ userActionHttpMethod: 'POST',
919
+ userActionHttpPath: path,
920
+ userActionPayload: JSON.stringify(request.body),
921
+ userActionServerKind: 'Api',
922
+ },
923
+ this.apiOptions
924
+ )
925
+
926
+ return challenge
927
+ }
928
+
929
+ async createUserComplete(
930
+ request: T.CreateUserRequest,
931
+ signedChallenge: SignUserActionChallengeRequest
932
+ ): Promise<T.CreateUserResponse> {
933
+ const path = buildPathAndQuery('/auth/users', {
934
+ path: {},
935
+ query: {},
936
+ })
937
+
938
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
939
+ signedChallenge,
940
+ this.apiOptions
941
+ )
942
+
943
+ const response = await simpleFetch(path, {
944
+ method: 'POST',
945
+ body: request.body,
946
+ headers: { 'x-dfns-useraction': userAction },
947
+ apiOptions: this.apiOptions,
948
+ })
949
+
950
+ return response.json()
951
+ }
952
+
953
+ async getUser(request: T.GetUserRequest): Promise<T.GetUserResponse> {
954
+ const path = buildPathAndQuery('/auth/users/:userId', {
955
+ path: { userId: request.userId },
956
+ query: {},
957
+ })
958
+
959
+ const response = await simpleFetch(path, {
960
+ method: 'GET',
961
+ apiOptions: this.apiOptions,
962
+ })
963
+
964
+ return response.json()
965
+ }
966
+
967
+ async updateUserInit(
968
+ request: T.UpdateUserRequest
969
+ ): Promise<UserActionChallengeResponse> {
970
+ const path = buildPathAndQuery('/auth/users/:userId', {
971
+ path: { userId: request.userId },
972
+ query: {},
973
+ })
974
+
975
+ const challenge = await BaseAuthApi.createUserActionChallenge(
976
+ {
977
+ userActionHttpMethod: 'PUT',
978
+ userActionHttpPath: path,
979
+ userActionPayload: JSON.stringify(request.body),
980
+ userActionServerKind: 'Api',
981
+ },
982
+ this.apiOptions
983
+ )
984
+
985
+ return challenge
986
+ }
987
+
988
+ async updateUserComplete(
989
+ request: T.UpdateUserRequest,
990
+ signedChallenge: SignUserActionChallengeRequest
991
+ ): Promise<T.UpdateUserResponse> {
992
+ const path = buildPathAndQuery('/auth/users/:userId', {
993
+ path: { userId: request.userId },
994
+ query: {},
995
+ })
996
+
997
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
998
+ signedChallenge,
999
+ this.apiOptions
1000
+ )
1001
+
1002
+ const response = await simpleFetch(path, {
1003
+ method: 'PUT',
1004
+ body: request.body,
1005
+ headers: { 'x-dfns-useraction': userAction },
1006
+ apiOptions: this.apiOptions,
1007
+ })
1008
+
1009
+ return response.json()
1010
+ }
1011
+
1012
+ async archiveUserInit(
1013
+ request: T.ArchiveUserRequest
1014
+ ): Promise<UserActionChallengeResponse> {
1015
+ const path = buildPathAndQuery('/auth/users/:userId', {
1016
+ path: { userId: request.userId },
1017
+ query: {},
1018
+ })
1019
+
1020
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1021
+ {
1022
+ userActionHttpMethod: 'DELETE',
1023
+ userActionHttpPath: path,
1024
+ userActionPayload: JSON.stringify({}),
1025
+ userActionServerKind: 'Api',
1026
+ },
1027
+ this.apiOptions
1028
+ )
1029
+
1030
+ return challenge
1031
+ }
1032
+
1033
+ async archiveUserComplete(
1034
+ request: T.ArchiveUserRequest,
1035
+ signedChallenge: SignUserActionChallengeRequest
1036
+ ): Promise<T.ArchiveUserResponse> {
1037
+ const path = buildPathAndQuery('/auth/users/:userId', {
1038
+ path: { userId: request.userId },
1039
+ query: {},
1040
+ })
1041
+
1042
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1043
+ signedChallenge,
1044
+ this.apiOptions
1045
+ )
1046
+
1047
+ const response = await simpleFetch(path, {
1048
+ method: 'DELETE',
1049
+ body: {},
1050
+ headers: { 'x-dfns-useraction': userAction },
1051
+ apiOptions: this.apiOptions,
1052
+ })
1053
+
1054
+ return response.json()
1055
+ }
1056
+
1057
+ async activateUserInit(
1058
+ request: T.ActivateUserRequest
1059
+ ): Promise<UserActionChallengeResponse> {
1060
+ const path = buildPathAndQuery('/auth/users/:userId/activate', {
1061
+ path: { userId: request.userId },
1062
+ query: {},
1063
+ })
1064
+
1065
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1066
+ {
1067
+ userActionHttpMethod: 'PUT',
1068
+ userActionHttpPath: path,
1069
+ userActionPayload: JSON.stringify({}),
1070
+ userActionServerKind: 'Api',
1071
+ },
1072
+ this.apiOptions
1073
+ )
1074
+
1075
+ return challenge
1076
+ }
1077
+
1078
+ async activateUserComplete(
1079
+ request: T.ActivateUserRequest,
1080
+ signedChallenge: SignUserActionChallengeRequest
1081
+ ): Promise<T.ActivateUserResponse> {
1082
+ const path = buildPathAndQuery('/auth/users/:userId/activate', {
1083
+ path: { userId: request.userId },
1084
+ query: {},
1085
+ })
1086
+
1087
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1088
+ signedChallenge,
1089
+ this.apiOptions
1090
+ )
1091
+
1092
+ const response = await simpleFetch(path, {
1093
+ method: 'PUT',
1094
+ body: {},
1095
+ headers: { 'x-dfns-useraction': userAction },
1096
+ apiOptions: this.apiOptions,
1097
+ })
1098
+
1099
+ return response.json()
1100
+ }
1101
+
1102
+ async deactivateUserInit(
1103
+ request: T.DeactivateUserRequest
1104
+ ): Promise<UserActionChallengeResponse> {
1105
+ const path = buildPathAndQuery('/auth/users/:userId/deactivate', {
1106
+ path: { userId: request.userId },
1107
+ query: {},
1108
+ })
1109
+
1110
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1111
+ {
1112
+ userActionHttpMethod: 'PUT',
1113
+ userActionHttpPath: path,
1114
+ userActionPayload: JSON.stringify({}),
1115
+ userActionServerKind: 'Api',
1116
+ },
1117
+ this.apiOptions
1118
+ )
1119
+
1120
+ return challenge
1121
+ }
1122
+
1123
+ async deactivateUserComplete(
1124
+ request: T.DeactivateUserRequest,
1125
+ signedChallenge: SignUserActionChallengeRequest
1126
+ ): Promise<T.DeactivateUserResponse> {
1127
+ const path = buildPathAndQuery('/auth/users/:userId/deactivate', {
1128
+ path: { userId: request.userId },
1129
+ query: {},
1130
+ })
1131
+
1132
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1133
+ signedChallenge,
1134
+ this.apiOptions
1135
+ )
1136
+
1137
+ const response = await simpleFetch(path, {
1138
+ method: 'PUT',
1139
+ body: {},
1140
+ headers: { 'x-dfns-useraction': userAction },
1141
+ apiOptions: this.apiOptions,
1142
+ })
1143
+
1144
+ return response.json()
1145
+ }
1146
+
1147
+ async listApplications(): Promise<T.ListApplicationsResponse> {
1148
+ const path = buildPathAndQuery('/auth/apps', {
1149
+ path: {},
1150
+ query: {},
1151
+ })
1152
+
1153
+ const response = await simpleFetch(path, {
1154
+ method: 'GET',
1155
+ apiOptions: this.apiOptions,
1156
+ })
1157
+
1158
+ return response.json()
1159
+ }
1160
+
1161
+ async createApplicationInit(
1162
+ request: T.CreateApplicationRequest
1163
+ ): Promise<UserActionChallengeResponse> {
1164
+ const path = buildPathAndQuery('/auth/apps', {
1165
+ path: {},
1166
+ query: {},
1167
+ })
1168
+
1169
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1170
+ {
1171
+ userActionHttpMethod: 'POST',
1172
+ userActionHttpPath: path,
1173
+ userActionPayload: JSON.stringify(request.body),
1174
+ userActionServerKind: 'Api',
1175
+ },
1176
+ this.apiOptions
1177
+ )
1178
+
1179
+ return challenge
1180
+ }
1181
+
1182
+ async createApplicationComplete(
1183
+ request: T.CreateApplicationRequest,
1184
+ signedChallenge: SignUserActionChallengeRequest
1185
+ ): Promise<T.CreateApplicationResponse> {
1186
+ const path = buildPathAndQuery('/auth/apps', {
1187
+ path: {},
1188
+ query: {},
1189
+ })
1190
+
1191
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1192
+ signedChallenge,
1193
+ this.apiOptions
1194
+ )
1195
+
1196
+ const response = await simpleFetch(path, {
1197
+ method: 'POST',
1198
+ body: request.body,
1199
+ headers: { 'x-dfns-useraction': userAction },
1200
+ apiOptions: this.apiOptions,
1201
+ })
1202
+
1203
+ return response.json()
1204
+ }
1205
+
1206
+ async getApplication(
1207
+ request: T.GetApplicationRequest
1208
+ ): Promise<T.GetApplicationResponse> {
1209
+ const path = buildPathAndQuery('/auth/apps/:appId', {
1210
+ path: { appId: request.appId },
1211
+ query: {},
1212
+ })
1213
+
1214
+ const response = await simpleFetch(path, {
1215
+ method: 'GET',
1216
+ apiOptions: this.apiOptions,
1217
+ })
1218
+
1219
+ return response.json()
1220
+ }
1221
+
1222
+ async updateApplicationInit(
1223
+ request: T.UpdateApplicationRequest
1224
+ ): Promise<UserActionChallengeResponse> {
1225
+ const path = buildPathAndQuery('/auth/apps/:appId', {
1226
+ path: { appId: request.appId },
1227
+ query: {},
1228
+ })
1229
+
1230
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1231
+ {
1232
+ userActionHttpMethod: 'PUT',
1233
+ userActionHttpPath: path,
1234
+ userActionPayload: JSON.stringify(request.body),
1235
+ userActionServerKind: 'Api',
1236
+ },
1237
+ this.apiOptions
1238
+ )
1239
+
1240
+ return challenge
1241
+ }
1242
+
1243
+ async updateApplicationComplete(
1244
+ request: T.UpdateApplicationRequest,
1245
+ signedChallenge: SignUserActionChallengeRequest
1246
+ ): Promise<T.UpdateApplicationResponse> {
1247
+ const path = buildPathAndQuery('/auth/apps/:appId', {
1248
+ path: { appId: request.appId },
1249
+ query: {},
1250
+ })
1251
+
1252
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1253
+ signedChallenge,
1254
+ this.apiOptions
1255
+ )
1256
+
1257
+ const response = await simpleFetch(path, {
1258
+ method: 'PUT',
1259
+ body: request.body,
1260
+ headers: { 'x-dfns-useraction': userAction },
1261
+ apiOptions: this.apiOptions,
1262
+ })
1263
+
1264
+ return response.json()
1265
+ }
1266
+
1267
+ async archiveApplicationInit(
1268
+ request: T.ArchiveApplicationRequest
1269
+ ): Promise<UserActionChallengeResponse> {
1270
+ const path = buildPathAndQuery('/auth/apps/:appId', {
1271
+ path: { appId: request.appId },
1272
+ query: {},
1273
+ })
1274
+
1275
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1276
+ {
1277
+ userActionHttpMethod: 'DELETE',
1278
+ userActionHttpPath: path,
1279
+ userActionPayload: JSON.stringify({}),
1280
+ userActionServerKind: 'Api',
1281
+ },
1282
+ this.apiOptions
1283
+ )
1284
+
1285
+ return challenge
1286
+ }
1287
+
1288
+ async archiveApplicationComplete(
1289
+ request: T.ArchiveApplicationRequest,
1290
+ signedChallenge: SignUserActionChallengeRequest
1291
+ ): Promise<T.ArchiveApplicationResponse> {
1292
+ const path = buildPathAndQuery('/auth/apps/:appId', {
1293
+ path: { appId: request.appId },
1294
+ query: {},
1295
+ })
1296
+
1297
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1298
+ signedChallenge,
1299
+ this.apiOptions
1300
+ )
1301
+
1302
+ const response = await simpleFetch(path, {
1303
+ method: 'DELETE',
1304
+ body: {},
1305
+ headers: { 'x-dfns-useraction': userAction },
1306
+ apiOptions: this.apiOptions,
1307
+ })
1308
+
1309
+ return response.json()
1310
+ }
1311
+
1312
+ async activateApplicationInit(
1313
+ request: T.ActivateApplicationRequest
1314
+ ): Promise<UserActionChallengeResponse> {
1315
+ const path = buildPathAndQuery('/auth/apps/:appId/activate', {
1316
+ path: { appId: request.appId },
1317
+ query: {},
1318
+ })
1319
+
1320
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1321
+ {
1322
+ userActionHttpMethod: 'PUT',
1323
+ userActionHttpPath: path,
1324
+ userActionPayload: JSON.stringify({}),
1325
+ userActionServerKind: 'Api',
1326
+ },
1327
+ this.apiOptions
1328
+ )
1329
+
1330
+ return challenge
1331
+ }
1332
+
1333
+ async activateApplicationComplete(
1334
+ request: T.ActivateApplicationRequest,
1335
+ signedChallenge: SignUserActionChallengeRequest
1336
+ ): Promise<T.ActivateApplicationResponse> {
1337
+ const path = buildPathAndQuery('/auth/apps/:appId/activate', {
1338
+ path: { appId: request.appId },
1339
+ query: {},
1340
+ })
1341
+
1342
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1343
+ signedChallenge,
1344
+ this.apiOptions
1345
+ )
1346
+
1347
+ const response = await simpleFetch(path, {
1348
+ method: 'PUT',
1349
+ body: {},
1350
+ headers: { 'x-dfns-useraction': userAction },
1351
+ apiOptions: this.apiOptions,
1352
+ })
1353
+
1354
+ return response.json()
1355
+ }
1356
+
1357
+ async deactivateApplicationInit(
1358
+ request: T.DeactivateApplicationRequest
1359
+ ): Promise<UserActionChallengeResponse> {
1360
+ const path = buildPathAndQuery('/auth/apps/:appId/deactivate', {
1361
+ path: { appId: request.appId },
1362
+ query: {},
1363
+ })
1364
+
1365
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1366
+ {
1367
+ userActionHttpMethod: 'PUT',
1368
+ userActionHttpPath: path,
1369
+ userActionPayload: JSON.stringify({}),
1370
+ userActionServerKind: 'Api',
1371
+ },
1372
+ this.apiOptions
1373
+ )
1374
+
1375
+ return challenge
1376
+ }
1377
+
1378
+ async deactivateApplicationComplete(
1379
+ request: T.DeactivateApplicationRequest,
1380
+ signedChallenge: SignUserActionChallengeRequest
1381
+ ): Promise<T.DeactivateApplicationResponse> {
1382
+ const path = buildPathAndQuery('/auth/apps/:appId/deactivate', {
1383
+ path: { appId: request.appId },
1384
+ query: {},
1385
+ })
1386
+
1387
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1388
+ signedChallenge,
1389
+ this.apiOptions
1390
+ )
1391
+
1392
+ const response = await simpleFetch(path, {
1393
+ method: 'PUT',
1394
+ body: {},
1395
+ headers: { 'x-dfns-useraction': userAction },
1396
+ apiOptions: this.apiOptions,
1397
+ })
1398
+
1399
+ return response.json()
1400
+ }
1401
+
1402
+ async createUserRecovery(
1403
+ request: T.CreateUserRecoveryRequest
1404
+ ): Promise<T.CreateUserRecoveryResponse> {
1405
+ const path = buildPathAndQuery('/auth/recover/user', {
1406
+ path: {},
1407
+ query: {},
1408
+ })
1409
+
1410
+ const response = await simpleFetch(path, {
1411
+ method: 'POST',
1412
+ body: request.body,
1413
+ apiOptions: this.apiOptions,
1414
+ })
1415
+
1416
+ return response.json()
1417
+ }
1418
+
1419
+ async restartDelegatedUserRegistrationInit(
1420
+ request: T.RestartDelegatedUserRegistrationRequest
1421
+ ): Promise<UserActionChallengeResponse> {
1422
+ const path = buildPathAndQuery('/auth/registration/delegated/restart', {
1423
+ path: {},
1424
+ query: {},
1425
+ })
1426
+
1427
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1428
+ {
1429
+ userActionHttpMethod: 'POST',
1430
+ userActionHttpPath: path,
1431
+ userActionPayload: JSON.stringify(request.body),
1432
+ userActionServerKind: 'Api',
1433
+ },
1434
+ this.apiOptions
1435
+ )
1436
+
1437
+ return challenge
1438
+ }
1439
+
1440
+ async restartDelegatedUserRegistrationComplete(
1441
+ request: T.RestartDelegatedUserRegistrationRequest,
1442
+ signedChallenge: SignUserActionChallengeRequest
1443
+ ): Promise<T.RestartDelegatedUserRegistrationResponse> {
1444
+ const path = buildPathAndQuery('/auth/registration/delegated/restart', {
1445
+ path: {},
1446
+ query: {},
1447
+ })
1448
+
1449
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1450
+ signedChallenge,
1451
+ this.apiOptions
1452
+ )
1453
+
1454
+ const response = await simpleFetch(path, {
1455
+ method: 'POST',
1456
+ body: request.body,
1457
+ headers: { 'x-dfns-useraction': userAction },
1458
+ apiOptions: this.apiOptions,
1459
+ })
1460
+
1461
+ return response.json()
1462
+ }
1463
+
1464
+ async createDelegatedUserRecoveryInit(
1465
+ request: T.CreateDelegatedUserRecoveryRequest
1466
+ ): Promise<UserActionChallengeResponse> {
1467
+ const path = buildPathAndQuery('/auth/recover/user/delegated', {
1468
+ path: {},
1469
+ query: {},
1470
+ })
1471
+
1472
+ const challenge = await BaseAuthApi.createUserActionChallenge(
1473
+ {
1474
+ userActionHttpMethod: 'POST',
1475
+ userActionHttpPath: path,
1476
+ userActionPayload: JSON.stringify(request.body),
1477
+ userActionServerKind: 'Api',
1478
+ },
1479
+ this.apiOptions
1480
+ )
1481
+
1482
+ return challenge
1483
+ }
1484
+
1485
+ async createDelegatedUserRecoveryComplete(
1486
+ request: T.CreateDelegatedUserRecoveryRequest,
1487
+ signedChallenge: SignUserActionChallengeRequest
1488
+ ): Promise<T.CreateDelegatedUserRecoveryResponse> {
1489
+ const path = buildPathAndQuery('/auth/recover/user/delegated', {
1490
+ path: {},
1491
+ query: {},
1492
+ })
1493
+
1494
+ const { userAction } = await BaseAuthApi.signUserActionChallenge(
1495
+ signedChallenge,
1496
+ this.apiOptions
1497
+ )
1498
+
1499
+ const response = await simpleFetch(path, {
1500
+ method: 'POST',
1501
+ body: request.body,
1502
+ headers: { 'x-dfns-useraction': userAction },
1503
+ apiOptions: this.apiOptions,
1504
+ })
1505
+
1506
+ return response.json()
1507
+ }
1508
+ }