@affinidi/cli 2.0.0-beta.1 → 2.0.0-beta.10

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 (355) hide show
  1. package/README.md +810 -661
  2. package/dist/commands/generate/app.d.ts +17 -0
  3. package/dist/commands/generate/app.js +149 -0
  4. package/dist/commands/generate/app.js.map +1 -0
  5. package/dist/commands/iam/add-principal.d.ts +11 -0
  6. package/dist/commands/iam/add-principal.js +63 -0
  7. package/dist/commands/iam/add-principal.js.map +1 -0
  8. package/dist/commands/iam/get-policies.d.ts +12 -0
  9. package/dist/commands/iam/get-policies.js +64 -0
  10. package/dist/commands/iam/get-policies.js.map +1 -0
  11. package/dist/commands/iam/list-principals.d.ts +8 -0
  12. package/dist/commands/iam/list-principals.js +23 -0
  13. package/dist/commands/iam/list-principals.js.map +1 -0
  14. package/dist/commands/iam/remove-principal.d.ts +14 -0
  15. package/dist/commands/iam/remove-principal.js +63 -0
  16. package/dist/commands/iam/remove-principal.js.map +1 -0
  17. package/dist/commands/iam/update-policies.d.ts +13 -0
  18. package/dist/commands/iam/update-policies.js +127 -0
  19. package/dist/commands/iam/update-policies.js.map +1 -0
  20. package/dist/commands/login/add-user-to-group.d.ts +11 -0
  21. package/dist/commands/login/add-user-to-group.js +39 -0
  22. package/dist/commands/login/add-user-to-group.js.map +1 -0
  23. package/dist/commands/login/create-config.d.ts +17 -0
  24. package/dist/commands/login/create-config.js +142 -0
  25. package/dist/commands/login/create-config.js.map +1 -0
  26. package/dist/commands/login/create-group.d.ts +10 -0
  27. package/dist/commands/login/create-group.js +40 -0
  28. package/dist/commands/login/create-group.js.map +1 -0
  29. package/dist/commands/login/delete-config.d.ts +11 -0
  30. package/dist/commands/login/delete-config.js +39 -0
  31. package/dist/commands/login/delete-config.js.map +1 -0
  32. package/dist/commands/login/delete-group.d.ts +11 -0
  33. package/dist/commands/login/delete-group.js +39 -0
  34. package/dist/commands/login/delete-group.js.map +1 -0
  35. package/dist/commands/login/get-config.d.ts +10 -0
  36. package/dist/commands/login/get-config.js +39 -0
  37. package/dist/commands/login/get-config.js.map +1 -0
  38. package/dist/commands/login/get-group.d.ts +10 -0
  39. package/dist/commands/login/get-group.js +39 -0
  40. package/dist/commands/login/get-group.js.map +1 -0
  41. package/dist/commands/login/list-configs.d.ts +7 -0
  42. package/dist/commands/login/list-configs.js +20 -0
  43. package/dist/commands/login/list-configs.js.map +1 -0
  44. package/dist/commands/login/list-groups.d.ts +7 -0
  45. package/dist/commands/login/list-groups.js +20 -0
  46. package/dist/commands/login/list-groups.js.map +1 -0
  47. package/dist/commands/login/list-users-in-group.d.ts +10 -0
  48. package/dist/commands/login/list-users-in-group.js +35 -0
  49. package/dist/commands/login/list-users-in-group.js.map +1 -0
  50. package/dist/commands/login/remove-user-from-group.d.ts +13 -0
  51. package/dist/commands/login/remove-user-from-group.js +40 -0
  52. package/dist/commands/login/remove-user-from-group.js.map +1 -0
  53. package/dist/commands/login/update-config.d.ts +17 -0
  54. package/dist/commands/login/update-config.js +123 -0
  55. package/dist/commands/login/update-config.js.map +1 -0
  56. package/dist/commands/project/create-project.d.ts +11 -0
  57. package/dist/commands/project/create-project.js +47 -0
  58. package/dist/commands/project/create-project.js.map +1 -0
  59. package/dist/commands/project/get-active-project.d.ts +7 -0
  60. package/dist/commands/project/get-active-project.js +20 -0
  61. package/dist/commands/project/get-active-project.js.map +1 -0
  62. package/dist/commands/project/list-projects.d.ts +7 -0
  63. package/dist/commands/project/list-projects.js +20 -0
  64. package/dist/commands/project/list-projects.js.map +1 -0
  65. package/dist/commands/project/select-project.d.ts +10 -0
  66. package/dist/commands/project/select-project.js +69 -0
  67. package/dist/commands/project/select-project.js.map +1 -0
  68. package/dist/commands/start.d.ts +3 -36
  69. package/dist/commands/start.js +19 -412
  70. package/dist/commands/start.js.map +1 -1
  71. package/dist/commands/stop.d.ts +6 -0
  72. package/dist/commands/stop.js +34 -0
  73. package/dist/commands/stop.js.map +1 -0
  74. package/dist/commands/token/create-token.d.ts +13 -0
  75. package/dist/commands/token/create-token.js +78 -0
  76. package/dist/commands/token/create-token.js.map +1 -0
  77. package/dist/commands/token/delete-token.d.ts +11 -0
  78. package/dist/commands/token/delete-token.js +36 -0
  79. package/dist/commands/token/delete-token.js.map +1 -0
  80. package/dist/commands/token/get-token.d.ts +10 -0
  81. package/dist/commands/token/get-token.js +36 -0
  82. package/dist/commands/token/get-token.js.map +1 -0
  83. package/dist/commands/token/list-tokens.d.ts +7 -0
  84. package/dist/commands/token/list-tokens.js +20 -0
  85. package/dist/commands/token/list-tokens.js.map +1 -0
  86. package/dist/commands/token/update-token.d.ts +14 -0
  87. package/dist/commands/token/update-token.js +83 -0
  88. package/dist/commands/token/update-token.js.map +1 -0
  89. package/dist/commands/whoami.d.ts +6 -0
  90. package/dist/commands/whoami.js +20 -0
  91. package/dist/commands/whoami.js.map +1 -0
  92. package/dist/common/base-command.d.ts +29 -0
  93. package/dist/common/base-command.js +65 -0
  94. package/dist/common/base-command.js.map +1 -0
  95. package/dist/common/constants.d.ts +27 -0
  96. package/dist/common/constants.js +31 -0
  97. package/dist/common/constants.js.map +1 -0
  98. package/dist/common/error-messages.d.ts +1 -0
  99. package/dist/common/error-messages.js +8 -0
  100. package/dist/common/error-messages.js.map +1 -0
  101. package/dist/common/index.d.ts +2 -0
  102. package/dist/common/index.js +8 -0
  103. package/dist/common/index.js.map +1 -0
  104. package/dist/common/prompts.d.ts +1 -0
  105. package/dist/common/prompts.js +21 -0
  106. package/dist/common/prompts.js.map +1 -0
  107. package/dist/common/validators.d.ts +4 -0
  108. package/dist/common/validators.js +15 -0
  109. package/dist/common/validators.js.map +1 -0
  110. package/dist/helpers/app.d.ts +11 -0
  111. package/dist/helpers/app.js +92 -0
  112. package/dist/helpers/app.js.map +1 -0
  113. package/dist/helpers/degit.d.ts +1 -0
  114. package/dist/helpers/degit.js +26 -0
  115. package/dist/helpers/degit.js.map +1 -0
  116. package/dist/helpers/jwk.d.ts +4 -0
  117. package/dist/helpers/jwk.js +29 -0
  118. package/dist/helpers/jwk.js.map +1 -0
  119. package/dist/index.d.ts +0 -1
  120. package/dist/index.js +1 -3
  121. package/dist/index.js.map +1 -1
  122. package/dist/services/affinidi/auth/auth-result-page.d.ts +1 -0
  123. package/dist/services/affinidi/auth/auth-result-page.js +110 -0
  124. package/dist/services/affinidi/auth/auth-result-page.js.map +1 -0
  125. package/dist/services/affinidi/auth/bff-auth-provider.d.ts +26 -0
  126. package/dist/services/affinidi/auth/bff-auth-provider.js +124 -0
  127. package/dist/services/affinidi/auth/bff-auth-provider.js.map +1 -0
  128. package/dist/services/affinidi/auth/types.d.ts +7 -0
  129. package/dist/services/affinidi/auth/types.js +3 -0
  130. package/dist/services/affinidi/auth/types.js.map +1 -0
  131. package/dist/services/affinidi/bff-service.d.ts +20 -0
  132. package/dist/services/affinidi/bff-service.js +88 -0
  133. package/dist/services/affinidi/bff-service.js.map +1 -0
  134. package/dist/services/affinidi/errors.d.ts +3 -0
  135. package/dist/services/affinidi/errors.js +75 -0
  136. package/dist/services/affinidi/errors.js.map +1 -0
  137. package/dist/services/affinidi/iam/iam.api.d.ts +455 -0
  138. package/dist/services/affinidi/iam/iam.api.js +421 -0
  139. package/dist/services/affinidi/iam/iam.api.js.map +1 -0
  140. package/dist/services/affinidi/iam/index.d.ts +21 -0
  141. package/dist/services/affinidi/iam/index.js +148 -0
  142. package/dist/services/affinidi/iam/index.js.map +1 -0
  143. package/dist/services/affinidi/logger/console-logger-adapter.d.ts +12 -0
  144. package/dist/services/affinidi/logger/console-logger-adapter.js +56 -0
  145. package/dist/services/affinidi/logger/console-logger-adapter.js.map +1 -0
  146. package/dist/services/affinidi/logger/index.d.ts +2 -0
  147. package/dist/services/affinidi/logger/index.js +6 -0
  148. package/dist/services/affinidi/logger/index.js.map +1 -0
  149. package/dist/services/affinidi/logger/logger-adapter.d.ts +10 -0
  150. package/dist/services/affinidi/logger/logger-adapter.js +3 -0
  151. package/dist/services/affinidi/logger/logger-adapter.js.map +1 -0
  152. package/dist/services/affinidi/vp-adapter/index.d.ts +20 -0
  153. package/dist/services/affinidi/vp-adapter/index.js +145 -0
  154. package/dist/services/affinidi/vp-adapter/index.js.map +1 -0
  155. package/dist/services/affinidi/vp-adapter/vp-adapter.api.d.ts +602 -0
  156. package/dist/services/affinidi/vp-adapter/vp-adapter.api.js +484 -0
  157. package/dist/services/affinidi/vp-adapter/vp-adapter.api.js.map +1 -0
  158. package/dist/services/credentials-vault.d.ts +19 -0
  159. package/dist/services/credentials-vault.js +33 -0
  160. package/dist/services/credentials-vault.js.map +1 -0
  161. package/dist/services/env-config.d.ts +35 -0
  162. package/dist/services/env-config.js +39 -0
  163. package/dist/services/env-config.js.map +1 -0
  164. package/dist/services/generator/auth0.d.ts +6 -0
  165. package/dist/services/generator/auth0.js +79 -0
  166. package/dist/services/generator/auth0.js.map +1 -0
  167. package/dist/services/generator/env-configurer.d.ts +1 -0
  168. package/dist/services/generator/env-configurer.js +22 -0
  169. package/dist/services/generator/env-configurer.js.map +1 -0
  170. package/package.json +64 -77
  171. package/bin/inject-secrets.js +0 -16
  172. package/bin/postinstall.js +0 -31
  173. package/dist/commands/analytics.d.ts +0 -21
  174. package/dist/commands/analytics.js +0 -74
  175. package/dist/commands/analytics.js.map +0 -1
  176. package/dist/commands/config/index.d.ts +0 -15
  177. package/dist/commands/config/index.js +0 -71
  178. package/dist/commands/config/index.js.map +0 -1
  179. package/dist/commands/config/username.d.ts +0 -17
  180. package/dist/commands/config/username.js +0 -87
  181. package/dist/commands/config/username.js.map +0 -1
  182. package/dist/commands/config/view.d.ts +0 -16
  183. package/dist/commands/config/view.js +0 -59
  184. package/dist/commands/config/view.js.map +0 -1
  185. package/dist/commands/create/project.d.ts +0 -16
  186. package/dist/commands/create/project.js +0 -82
  187. package/dist/commands/create/project.js.map +0 -1
  188. package/dist/commands/create/schema.d.ts +0 -18
  189. package/dist/commands/create/schema.js +0 -149
  190. package/dist/commands/create/schema.js.map +0 -1
  191. package/dist/commands/generate-application/index.d.ts +0 -28
  192. package/dist/commands/generate-application/index.js +0 -94
  193. package/dist/commands/generate-application/index.js.map +0 -1
  194. package/dist/commands/issue-vc.d.ts +0 -21
  195. package/dist/commands/issue-vc.js +0 -159
  196. package/dist/commands/issue-vc.js.map +0 -1
  197. package/dist/commands/list/projects.d.ts +0 -17
  198. package/dist/commands/list/projects.js +0 -110
  199. package/dist/commands/list/projects.js.map +0 -1
  200. package/dist/commands/list/schemas.d.ts +0 -26
  201. package/dist/commands/list/schemas.js +0 -164
  202. package/dist/commands/list/schemas.js.map +0 -1
  203. package/dist/commands/login/index.d.ts +0 -17
  204. package/dist/commands/login/index.js +0 -142
  205. package/dist/commands/login/index.js.map +0 -1
  206. package/dist/commands/logout/index.d.ts +0 -13
  207. package/dist/commands/logout/index.js +0 -72
  208. package/dist/commands/logout/index.js.map +0 -1
  209. package/dist/commands/rename/project.d.ts +0 -17
  210. package/dist/commands/rename/project.js +0 -100
  211. package/dist/commands/rename/project.js.map +0 -1
  212. package/dist/commands/show/project.d.ts +0 -16
  213. package/dist/commands/show/project.js +0 -121
  214. package/dist/commands/show/project.js.map +0 -1
  215. package/dist/commands/show/schema.d.ts +0 -17
  216. package/dist/commands/show/schema.js +0 -111
  217. package/dist/commands/show/schema.js.map +0 -1
  218. package/dist/commands/show/user.d.ts +0 -14
  219. package/dist/commands/show/user.js +0 -61
  220. package/dist/commands/show/user.js.map +0 -1
  221. package/dist/commands/sign-up/index.d.ts +0 -13
  222. package/dist/commands/sign-up/index.js +0 -83
  223. package/dist/commands/sign-up/index.js.map +0 -1
  224. package/dist/commands/use/project.d.ts +0 -15
  225. package/dist/commands/use/project.js +0 -103
  226. package/dist/commands/use/project.js.map +0 -1
  227. package/dist/commands/verify-vc.d.ts +0 -15
  228. package/dist/commands/verify-vc.js +0 -88
  229. package/dist/commands/verify-vc.js.map +0 -1
  230. package/dist/constants.d.ts +0 -44
  231. package/dist/constants.js +0 -78
  232. package/dist/constants.js.map +0 -1
  233. package/dist/customFlags/outputFlag.d.ts +0 -2
  234. package/dist/customFlags/outputFlag.js +0 -10
  235. package/dist/customFlags/outputFlag.js.map +0 -1
  236. package/dist/errors/index.d.ts +0 -37
  237. package/dist/errors/index.js +0 -118
  238. package/dist/errors/index.js.map +0 -1
  239. package/dist/exposedFunctions/genApp.d.ts +0 -27
  240. package/dist/exposedFunctions/genApp.js +0 -186
  241. package/dist/exposedFunctions/genApp.js.map +0 -1
  242. package/dist/fixtures/mock-projects.d.ts +0 -8
  243. package/dist/fixtures/mock-projects.js +0 -65
  244. package/dist/fixtures/mock-projects.js.map +0 -1
  245. package/dist/fixtures/mock-schemas.d.ts +0 -5
  246. package/dist/fixtures/mock-schemas.js +0 -47
  247. package/dist/fixtures/mock-schemas.js.map +0 -1
  248. package/dist/fixtures/mock-status.d.ts +0 -7
  249. package/dist/fixtures/mock-status.js +0 -88
  250. package/dist/fixtures/mock-status.js.map +0 -1
  251. package/dist/hooks/check/checkVersion.d.ts +0 -16
  252. package/dist/hooks/check/checkVersion.js +0 -23
  253. package/dist/hooks/check/checkVersion.js.map +0 -1
  254. package/dist/middleware/authentication.d.ts +0 -2
  255. package/dist/middleware/authentication.js +0 -24
  256. package/dist/middleware/authentication.js.map +0 -1
  257. package/dist/middleware/display.d.ts +0 -7
  258. package/dist/middleware/display.js +0 -72
  259. package/dist/middleware/display.js.map +0 -1
  260. package/dist/render/functions.d.ts +0 -30
  261. package/dist/render/functions.js +0 -138
  262. package/dist/render/functions.js.map +0 -1
  263. package/dist/render/texts.d.ts +0 -19
  264. package/dist/render/texts.js +0 -102
  265. package/dist/render/texts.js.map +0 -1
  266. package/dist/services/analytics/analytics.api.d.ts +0 -79
  267. package/dist/services/analytics/analytics.api.js +0 -134
  268. package/dist/services/analytics/analytics.api.js.map +0 -1
  269. package/dist/services/analytics/index.d.ts +0 -21
  270. package/dist/services/analytics/index.js +0 -80
  271. package/dist/services/analytics/index.js.map +0 -1
  272. package/dist/services/config/index.d.ts +0 -56
  273. package/dist/services/config/index.js +0 -294
  274. package/dist/services/config/index.js.map +0 -1
  275. package/dist/services/git/index.d.ts +0 -5
  276. package/dist/services/git/index.js +0 -32
  277. package/dist/services/git/index.js.map +0 -1
  278. package/dist/services/iam/iam.api.d.ts +0 -158
  279. package/dist/services/iam/iam.api.js +0 -219
  280. package/dist/services/iam/iam.api.js.map +0 -1
  281. package/dist/services/iam/index.d.ts +0 -12
  282. package/dist/services/iam/index.js +0 -77
  283. package/dist/services/iam/index.js.map +0 -1
  284. package/dist/services/index.d.ts +0 -7
  285. package/dist/services/index.js +0 -19
  286. package/dist/services/index.js.map +0 -1
  287. package/dist/services/issuance/bulkIssuance.api.d.ts +0 -23
  288. package/dist/services/issuance/bulkIssuance.api.js +0 -43
  289. package/dist/services/issuance/bulkIssuance.api.js.map +0 -1
  290. package/dist/services/issuance/index.d.ts +0 -14
  291. package/dist/services/issuance/index.js +0 -63
  292. package/dist/services/issuance/index.js.map +0 -1
  293. package/dist/services/issuance/issuance.api.d.ts +0 -226
  294. package/dist/services/issuance/issuance.api.js +0 -247
  295. package/dist/services/issuance/issuance.api.js.map +0 -1
  296. package/dist/services/issuance/parse.schema.url.d.ts +0 -5
  297. package/dist/services/issuance/parse.schema.url.js +0 -73
  298. package/dist/services/issuance/parse.schema.url.js.map +0 -1
  299. package/dist/services/schema-manager/generator/context-generator.d.ts +0 -2
  300. package/dist/services/schema-manager/generator/context-generator.js +0 -42
  301. package/dist/services/schema-manager/generator/context-generator.js.map +0 -1
  302. package/dist/services/schema-manager/generator/helpers.d.ts +0 -22
  303. package/dist/services/schema-manager/generator/helpers.js +0 -29
  304. package/dist/services/schema-manager/generator/helpers.js.map +0 -1
  305. package/dist/services/schema-manager/generator/mapping.d.ts +0 -6
  306. package/dist/services/schema-manager/generator/mapping.js +0 -22
  307. package/dist/services/schema-manager/generator/mapping.js.map +0 -1
  308. package/dist/services/schema-manager/generator/schema-generator.d.ts +0 -2
  309. package/dist/services/schema-manager/generator/schema-generator.js +0 -103
  310. package/dist/services/schema-manager/generator/schema-generator.js.map +0 -1
  311. package/dist/services/schema-manager/generator/types.d.ts +0 -87
  312. package/dist/services/schema-manager/generator/types.js +0 -15
  313. package/dist/services/schema-manager/generator/types.js.map +0 -1
  314. package/dist/services/schema-manager/index.d.ts +0 -29
  315. package/dist/services/schema-manager/index.js +0 -68
  316. package/dist/services/schema-manager/index.js.map +0 -1
  317. package/dist/services/schema-manager/schema-manager.api.d.ts +0 -279
  318. package/dist/services/schema-manager/schema-manager.api.js +0 -171
  319. package/dist/services/schema-manager/schema-manager.api.js.map +0 -1
  320. package/dist/services/schema-manager/schemaParser/schema-parser.d.ts +0 -5
  321. package/dist/services/schema-manager/schemaParser/schema-parser.js +0 -35
  322. package/dist/services/schema-manager/schemaParser/schema-parser.js.map +0 -1
  323. package/dist/services/user-management/index.d.ts +0 -38
  324. package/dist/services/user-management/index.js +0 -126
  325. package/dist/services/user-management/index.js.map +0 -1
  326. package/dist/services/user-management/user-management.api.d.ts +0 -110
  327. package/dist/services/user-management/user-management.api.js +0 -185
  328. package/dist/services/user-management/user-management.api.js.map +0 -1
  329. package/dist/services/vault/index.d.ts +0 -23
  330. package/dist/services/vault/index.js +0 -69
  331. package/dist/services/vault/index.js.map +0 -1
  332. package/dist/services/vault/typedVaultService.d.ts +0 -54
  333. package/dist/services/vault/typedVaultService.js +0 -136
  334. package/dist/services/vault/typedVaultService.js.map +0 -1
  335. package/dist/services/verification/index.d.ts +0 -9
  336. package/dist/services/verification/index.js +0 -32
  337. package/dist/services/verification/index.js.map +0 -1
  338. package/dist/services/verification/verifier.api.d.ts +0 -202
  339. package/dist/services/verification/verifier.api.js +0 -187
  340. package/dist/services/verification/verifier.api.js.map +0 -1
  341. package/dist/services/writer/index.d.ts +0 -3
  342. package/dist/services/writer/index.js +0 -17
  343. package/dist/services/writer/index.js.map +0 -1
  344. package/dist/user-actions/index.d.ts +0 -2
  345. package/dist/user-actions/index.js +0 -27
  346. package/dist/user-actions/index.js.map +0 -1
  347. package/dist/user-actions/inquirer.d.ts +0 -9
  348. package/dist/user-actions/inquirer.js +0 -131
  349. package/dist/user-actions/inquirer.js.map +0 -1
  350. package/dist/user-actions/prompts.d.ts +0 -20
  351. package/dist/user-actions/prompts.js +0 -94
  352. package/dist/user-actions/prompts.js.map +0 -1
  353. package/dist/wizard/helpers.d.ts +0 -8
  354. package/dist/wizard/helpers.js +0 -59
  355. package/dist/wizard/helpers.js.map +0 -1
@@ -0,0 +1,455 @@
1
+ export interface ServiceErrorResponse {
2
+ /**
3
+ * unique id for correlating this specific error to logs
4
+ * @format uuid
5
+ */
6
+ debugId: string;
7
+ /** name of the error */
8
+ name: string;
9
+ /** backwards compatible Affinidi error code */
10
+ code: string;
11
+ details?: {
12
+ issue: string;
13
+ field?: string;
14
+ value?: string;
15
+ location?: string;
16
+ }[];
17
+ }
18
+ export interface UserDto {
19
+ principalId: string;
20
+ }
21
+ export interface TypedPricipalId {
22
+ principalId: string;
23
+ }
24
+ export interface AddUserToProjectInput {
25
+ principalId: string;
26
+ principalType: string;
27
+ }
28
+ export interface CreateProjectScopedTokenInput {
29
+ projectId: string;
30
+ }
31
+ export interface CreateProjectScopedTokenOutput {
32
+ accessToken: string;
33
+ expiresIn: number;
34
+ scope: string;
35
+ }
36
+ export interface ProjectDto {
37
+ id: string;
38
+ name: string;
39
+ description?: string;
40
+ /** creation date and time in ISO-8601 format, e.g. 2023-09-20T07:12:13 */
41
+ createdAt?: string;
42
+ }
43
+ export interface CreateProjectInput {
44
+ name: string;
45
+ description?: string;
46
+ }
47
+ export interface ProjectList {
48
+ projects: ProjectDto[];
49
+ }
50
+ export interface UserList {
51
+ records: UserDto[];
52
+ }
53
+ export interface PolicyStatementDto {
54
+ action: string[];
55
+ effect: string;
56
+ principal: string[];
57
+ resource: string[];
58
+ }
59
+ export interface WhoamiDto {
60
+ principalId: string;
61
+ principalType: string;
62
+ }
63
+ export interface PolicyDto {
64
+ principalId?: string;
65
+ projectId?: string;
66
+ version: string;
67
+ statement: PolicyStatementDto[];
68
+ }
69
+ export interface JsonWebKeyDto {
70
+ kid: string;
71
+ kty: string;
72
+ n?: string;
73
+ e?: string;
74
+ alg: string;
75
+ use: string;
76
+ }
77
+ export interface JsonWebKeySetDto {
78
+ /** @minItems 1 */
79
+ keys: JsonWebKeyDto[];
80
+ }
81
+ /**
82
+ * Private Key JWT Authentication of Client with `private_key_jwt` oAuth Method
83
+ * @example "{"type": "PRIVATE_KEY", "signingAlgorithm": "RS256", "publicKeyInfo": { "jwks": {"keys":[{"use":"sig","kty":"RSA","kid":"some-kid","alg":"RS256","n":"some-n-value","e":"some-e-value"}]} }}"
84
+ */
85
+ export interface MachineUserPrivateKeyAuthenticationMethodDto {
86
+ type: 'PRIVATE_KEY';
87
+ signingAlgorithm: 'RS256' | 'RS512' | 'ES256' | 'ES512';
88
+ /** Corresponding Public Key Info provided either as a URL or a Hardcoded Object */
89
+ publicKeyInfo: {
90
+ jwks: JsonWebKeySetDto;
91
+ } | {
92
+ /** @format url */
93
+ jwksUri: string;
94
+ };
95
+ }
96
+ /** How the Machine User will be authenticate against our Authorization Server */
97
+ export type MachineUserAuthenticationMethodDto = MachineUserPrivateKeyAuthenticationMethodDto;
98
+ export interface MachineUserDto {
99
+ /**
100
+ * MachineUser Id
101
+ * @format uuid
102
+ * @example "c5817ea6-8367-4458-9131-54cd2c5b9b48"
103
+ */
104
+ id: string;
105
+ /**
106
+ * MachineUser ARI
107
+ * @example "machine/c5817ea6-8367-4458-9131-54cd2c5b9b48"
108
+ */
109
+ ari: string;
110
+ /**
111
+ * The MachineUser owner's ARI
112
+ * @example "ari:iam:::user/2f4b3468-516f-4af3-87db-8816b0d320cc"
113
+ */
114
+ ownerAri: string;
115
+ /**
116
+ * Owner defined MachineUser display name
117
+ * @example "AIV/Concierge API - affinidi-elements-iam-dev"
118
+ */
119
+ name: string;
120
+ /** How the Machine User will be authenticate against our Authorization Server */
121
+ authenticationMethod: MachineUserAuthenticationMethodDto;
122
+ /** Scopes that will be assigned to the MachineUser on authentication */
123
+ scopes: string[];
124
+ }
125
+ export interface MachineUserList {
126
+ machineUsers: MachineUserDto[];
127
+ }
128
+ export interface CreateMachineUserInput {
129
+ /** @example "AIV/Concierge API - affinidi-elements-iam-dev" */
130
+ name: string;
131
+ /** How the Machine User will be authenticate against our Authorization Server */
132
+ authenticationMethod: MachineUserAuthenticationMethodDto;
133
+ }
134
+ export interface UpdateMachineUserInput {
135
+ /** @example "AIV/Concierge API - affinidi-elements-iam-dev" */
136
+ name: string;
137
+ /** How the Machine User will be authenticate against our Authorization Server */
138
+ authenticationMethod: MachineUserAuthenticationMethodDto;
139
+ }
140
+ export interface UnexpectedError {
141
+ name: 'UnexpectedError';
142
+ message: 'Unexpected Error Occurred.';
143
+ httpStatusCode: 500;
144
+ traceId: string;
145
+ details?: {
146
+ issue: string;
147
+ field?: string;
148
+ value?: string;
149
+ location?: string;
150
+ }[];
151
+ }
152
+ export interface InvalidParameterError {
153
+ name: 'InvalidParameterError';
154
+ message: 'Invalid parameter: ${param}.';
155
+ httpStatusCode: 400;
156
+ traceId: string;
157
+ details?: {
158
+ issue: string;
159
+ field?: string;
160
+ value?: string;
161
+ location?: string;
162
+ }[];
163
+ }
164
+ export interface NotFoundError {
165
+ name: 'NotFoundError';
166
+ message: 'Not found: ${param}.';
167
+ httpStatusCode: 404;
168
+ traceId: string;
169
+ details?: {
170
+ issue: string;
171
+ field?: string;
172
+ value?: string;
173
+ location?: string;
174
+ }[];
175
+ }
176
+ export interface PrincipalDoesNotBelongToProjectError {
177
+ name: 'PrincipalDoesNotBelongToProjectError';
178
+ message: 'Principal does not belong to the given project';
179
+ httpStatusCode: 403;
180
+ traceId: string;
181
+ details?: {
182
+ issue: string;
183
+ field?: string;
184
+ value?: string;
185
+ location?: string;
186
+ }[];
187
+ }
188
+ export interface ActionForbiddenError {
189
+ name: 'ActionForbiddenError';
190
+ message: 'Principal can not execute action on given resource';
191
+ httpStatusCode: 403;
192
+ traceId: string;
193
+ details?: {
194
+ issue: string;
195
+ field?: string;
196
+ value?: string;
197
+ location?: string;
198
+ }[];
199
+ }
200
+ import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';
201
+ export type QueryParamsType = Record<string | number, any>;
202
+ export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
203
+ /** set parameter to `true` for call `securityWorker` for this request */
204
+ secure?: boolean;
205
+ /** request path */
206
+ path: string;
207
+ /** content type of request body */
208
+ type?: ContentType;
209
+ /** query params */
210
+ query?: QueryParamsType;
211
+ /** format of response (i.e. response.json() -> format: "json") */
212
+ format?: ResponseType;
213
+ /** request body */
214
+ body?: unknown;
215
+ }
216
+ export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
217
+ export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
218
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
219
+ secure?: boolean;
220
+ format?: ResponseType;
221
+ }
222
+ export declare enum ContentType {
223
+ Json = "application/json",
224
+ FormData = "multipart/form-data",
225
+ UrlEncoded = "application/x-www-form-urlencoded",
226
+ Text = "text/plain"
227
+ }
228
+ export declare class HttpClient<SecurityDataType = unknown> {
229
+ instance: AxiosInstance;
230
+ private securityData;
231
+ private securityWorker?;
232
+ private secure?;
233
+ private format?;
234
+ constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
235
+ setSecurityData: (data: SecurityDataType | null) => void;
236
+ protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
237
+ protected stringifyFormItem(formItem: unknown): string;
238
+ protected createFormData(input: Record<string, unknown>): FormData;
239
+ request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<axios.AxiosResponse<T, any>>;
240
+ }
241
+ /**
242
+ * @title Iam
243
+ * @version 1.0.0
244
+ * @baseUrl /
245
+ * @contact nucleus <nucleus.team@affinidi.com>
246
+ *
247
+ * Affinidi IAM
248
+ */
249
+ export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
250
+ wellKnown: {
251
+ /**
252
+ * No description
253
+ *
254
+ * @tags well-known
255
+ * @name GetWellKnownJwks
256
+ * @request GET:/.well-known/jwks.json
257
+ */
258
+ getWellKnownJwks: (params?: RequestParams) => Promise<axios.AxiosResponse<JsonWebKeySetDto, any>>;
259
+ };
260
+ v1: {
261
+ /**
262
+ * @description This is deprecated endpoint, please use /v1/sts/create-project-scoped-token
263
+ *
264
+ * @tags sts
265
+ * @name DeprecatedCreateProjectScopedToken
266
+ * @request POST:/v1/create-project-scoped-token
267
+ * @deprecated
268
+ * @secure
269
+ */
270
+ deprecatedCreateProjectScopedToken: (data: CreateProjectScopedTokenInput, params?: RequestParams) => Promise<axios.AxiosResponse<CreateProjectScopedTokenOutput, any>>;
271
+ /**
272
+ * No description
273
+ *
274
+ * @tags sts
275
+ * @name CreateProjectScopedToken
276
+ * @request POST:/v1/sts/create-project-scoped-token
277
+ * @secure
278
+ */
279
+ createProjectScopedToken: (data: CreateProjectScopedTokenInput, params?: RequestParams) => Promise<axios.AxiosResponse<CreateProjectScopedTokenOutput, any>>;
280
+ /**
281
+ * No description
282
+ *
283
+ * @tags sts
284
+ * @name Whoami
285
+ * @request GET:/v1/sts/whoami
286
+ * @secure
287
+ */
288
+ whoami: (params?: RequestParams) => Promise<axios.AxiosResponse<WhoamiDto, any>>;
289
+ /**
290
+ * No description
291
+ *
292
+ * @tags projects
293
+ * @name CreateProject
294
+ * @request POST:/v1/projects
295
+ * @secure
296
+ */
297
+ createProject: (data: CreateProjectInput, params?: RequestParams) => Promise<axios.AxiosResponse<ProjectDto, any>>;
298
+ /**
299
+ * No description
300
+ *
301
+ * @tags projects
302
+ * @name ListProject
303
+ * @request GET:/v1/projects
304
+ * @secure
305
+ */
306
+ listProject: (params?: RequestParams) => Promise<axios.AxiosResponse<ProjectList, any>>;
307
+ /**
308
+ * No description
309
+ *
310
+ * @tags projects
311
+ * @name AddUserToProject
312
+ * @request POST:/v1/projects/users
313
+ * @deprecated
314
+ * @secure
315
+ */
316
+ addUserToProject: (data: AddUserToProjectInput, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
317
+ /**
318
+ * No description
319
+ *
320
+ * @tags projects
321
+ * @name ListUsersOfProject
322
+ * @request GET:/v1/projects/users
323
+ * @deprecated
324
+ * @secure
325
+ */
326
+ listUsersOfProject: (params?: RequestParams) => Promise<axios.AxiosResponse<UserList, any>>;
327
+ /**
328
+ * No description
329
+ *
330
+ * @tags projects
331
+ * @name DeleteUserFromProject
332
+ * @request DELETE:/v1/projects/users/{userId}
333
+ * @deprecated
334
+ * @secure
335
+ */
336
+ deleteUserFromProject: (userId: string, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
337
+ /**
338
+ * No description
339
+ *
340
+ * @tags projects
341
+ * @name ListPrincipalsOfProject
342
+ * @request GET:/v1/projects/principals
343
+ * @secure
344
+ */
345
+ listPrincipalsOfProject: (params?: RequestParams) => Promise<axios.AxiosResponse<UserList, any>>;
346
+ /**
347
+ * No description
348
+ *
349
+ * @tags projects
350
+ * @name AddPrincipalToProject
351
+ * @request POST:/v1/projects/principals
352
+ * @secure
353
+ */
354
+ addPrincipalToProject: (data: AddUserToProjectInput, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
355
+ /**
356
+ * No description
357
+ *
358
+ * @tags projects
359
+ * @name DeletePrincipalFromProject
360
+ * @request DELETE:/v1/projects/principals/{principalId}
361
+ * @secure
362
+ */
363
+ deletePrincipalFromProject: (principalId: string, query: {
364
+ /** type of principal */
365
+ principalType: 'user' | 'machine_user';
366
+ }, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
367
+ /**
368
+ * No description
369
+ *
370
+ * @tags policies
371
+ * @name DeprecatedGetPolicies
372
+ * @request GET:/v1/policies/users/{userId}
373
+ * @deprecated
374
+ * @secure
375
+ */
376
+ deprecatedGetPolicies: (userId: string, params?: RequestParams) => Promise<axios.AxiosResponse<PolicyDto, any>>;
377
+ /**
378
+ * No description
379
+ *
380
+ * @tags policies
381
+ * @name DeprecatedUpdatePolicies
382
+ * @request PUT:/v1/policies/users/{userId}
383
+ * @deprecated
384
+ * @secure
385
+ */
386
+ deprecatedUpdatePolicies: (userId: string, data: PolicyDto, params?: RequestParams) => Promise<axios.AxiosResponse<PolicyDto, any>>;
387
+ /**
388
+ * No description
389
+ *
390
+ * @tags policies
391
+ * @name GetPolicies
392
+ * @request GET:/v1/policies/principals/{principalId}
393
+ * @secure
394
+ */
395
+ getPolicies: (principalId: string, query: {
396
+ principalType: 'user' | 'machine_user';
397
+ }, params?: RequestParams) => Promise<axios.AxiosResponse<PolicyDto, any>>;
398
+ /**
399
+ * No description
400
+ *
401
+ * @tags policies
402
+ * @name UpdatePolicies
403
+ * @request PUT:/v1/policies/principals/{principalId}
404
+ * @secure
405
+ */
406
+ updatePolicies: (principalId: string, query: {
407
+ principalType: 'user' | 'machine_user';
408
+ }, data: PolicyDto, params?: RequestParams) => Promise<axios.AxiosResponse<PolicyDto, any>>;
409
+ /**
410
+ * No description
411
+ *
412
+ * @tags machine-users
413
+ * @name CreateMachineUser
414
+ * @request POST:/v1/machine-users
415
+ * @secure
416
+ */
417
+ createMachineUser: (data: CreateMachineUserInput, params?: RequestParams) => Promise<axios.AxiosResponse<MachineUserDto, any>>;
418
+ /**
419
+ * No description
420
+ *
421
+ * @tags machine-users
422
+ * @name ListMachineUser
423
+ * @request GET:/v1/machine-users
424
+ * @secure
425
+ */
426
+ listMachineUser: (params?: RequestParams) => Promise<axios.AxiosResponse<MachineUserList, any>>;
427
+ /**
428
+ * No description
429
+ *
430
+ * @tags machine-users
431
+ * @name GetMachineUser
432
+ * @request GET:/v1/machine-users/{machineUserId}
433
+ * @secure
434
+ */
435
+ getMachineUser: (machineUserId: string, params?: RequestParams) => Promise<axios.AxiosResponse<MachineUserDto, any>>;
436
+ /**
437
+ * No description
438
+ *
439
+ * @tags machine-users
440
+ * @name UpdateMachineUser
441
+ * @request PATCH:/v1/machine-users/{machineUserId}
442
+ * @secure
443
+ */
444
+ updateMachineUser: (machineUserId: string, data: UpdateMachineUserInput, params?: RequestParams) => Promise<axios.AxiosResponse<MachineUserDto, any>>;
445
+ /**
446
+ * No description
447
+ *
448
+ * @tags machine-users
449
+ * @name DeleteMachineUser
450
+ * @request DELETE:/v1/machine-users/{machineUserId}
451
+ * @secure
452
+ */
453
+ deleteMachineUser: (machineUserId: string, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
454
+ };
455
+ }