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

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 +806 -661
  2. package/dist/commands/generate/app.d.ts +17 -0
  3. package/dist/commands/generate/app.js +147 -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 +470 -0
  138. package/dist/services/affinidi/iam/iam.api.js +342 -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 +862 -0
  156. package/dist/services/affinidi/vp-adapter/vp-adapter.api.js +550 -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,470 @@
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
+ x?: string;
75
+ y?: string;
76
+ crv?: string;
77
+ alg: string;
78
+ use: string;
79
+ }
80
+ export interface JsonWebKeySetDto {
81
+ /** @minItems 1 */
82
+ keys: JsonWebKeyDto[];
83
+ }
84
+ /**
85
+ * Private Key JWT Authentication of Client with `private_key_jwt` oAuth Method
86
+ * @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"}]} }}"
87
+ */
88
+ export interface TokenPrivateKeyAuthenticationMethodDto {
89
+ type: 'PRIVATE_KEY';
90
+ signingAlgorithm: 'RS256' | 'RS512' | 'ES256' | 'ES512';
91
+ /** Corresponding Public Key Info provided either as a URL or a Hardcoded Object */
92
+ publicKeyInfo: {
93
+ jwks: JsonWebKeySetDto;
94
+ } | {
95
+ /** @format url */
96
+ jwksUri: string;
97
+ };
98
+ }
99
+ /** How the Token will be authenticate against our Authorization Server */
100
+ export type TokenAuthenticationMethodDto = TokenPrivateKeyAuthenticationMethodDto;
101
+ export interface TokenDto {
102
+ /**
103
+ * Token Id
104
+ * @format uuid
105
+ * @example "c5817ea6-8367-4458-9131-54cd2c5b9b48"
106
+ */
107
+ id: string;
108
+ /**
109
+ * Token ARI
110
+ * @example "token/c5817ea6-8367-4458-9131-54cd2c5b9b48"
111
+ */
112
+ ari: string;
113
+ /**
114
+ * The Token owner's ARI
115
+ * @example "ari:iam:::user/2f4b3468-516f-4af3-87db-8816b0d320cc"
116
+ */
117
+ ownerAri: string;
118
+ /**
119
+ * Owner defined Token display name
120
+ * @example "AIV/Concierge API - affinidi-elements-iam-dev"
121
+ */
122
+ name: string;
123
+ /** How the Token will be authenticate against our Authorization Server */
124
+ authenticationMethod: TokenAuthenticationMethodDto;
125
+ /** Scopes that will be assigned to the Token on authentication */
126
+ scopes: string[];
127
+ }
128
+ export interface TokenList {
129
+ tokens: TokenDto[];
130
+ }
131
+ export interface CreateTokenInput {
132
+ /**
133
+ * @pattern .{3,}
134
+ * @example "AIV/Concierge API - affinidi-elements-iam-dev"
135
+ */
136
+ name: string;
137
+ /** How the Token will be authenticate against our Authorization Server */
138
+ authenticationMethod: TokenAuthenticationMethodDto;
139
+ }
140
+ export interface UpdateTokenInput {
141
+ /**
142
+ * @pattern .{3,}
143
+ * @example "AIV/Concierge API - affinidi-elements-iam-dev"
144
+ */
145
+ name: string;
146
+ /** How the Token will be authenticate against our Authorization Server */
147
+ authenticationMethod: TokenAuthenticationMethodDto;
148
+ }
149
+ export interface UnexpectedError {
150
+ name: 'UnexpectedError';
151
+ message: 'Unexpected Error Occurred.';
152
+ httpStatusCode: 500;
153
+ traceId: string;
154
+ details?: {
155
+ issue: string;
156
+ field?: string;
157
+ value?: string;
158
+ location?: string;
159
+ }[];
160
+ }
161
+ export interface InvalidParameterError {
162
+ name: 'InvalidParameterError';
163
+ message: 'Invalid parameter: ${param}.';
164
+ httpStatusCode: 400;
165
+ traceId: string;
166
+ details?: {
167
+ issue: string;
168
+ field?: string;
169
+ value?: string;
170
+ location?: string;
171
+ }[];
172
+ }
173
+ export interface NotFoundError {
174
+ name: 'NotFoundError';
175
+ message: 'Not found: ${param}.';
176
+ httpStatusCode: 404;
177
+ traceId: string;
178
+ details?: {
179
+ issue: string;
180
+ field?: string;
181
+ value?: string;
182
+ location?: string;
183
+ }[];
184
+ }
185
+ export interface PrincipalDoesNotBelongToProjectError {
186
+ name: 'PrincipalDoesNotBelongToProjectError';
187
+ message: 'Principal does not belong to the given project';
188
+ httpStatusCode: 403;
189
+ traceId: string;
190
+ details?: {
191
+ issue: string;
192
+ field?: string;
193
+ value?: string;
194
+ location?: string;
195
+ }[];
196
+ }
197
+ export interface ActionForbiddenError {
198
+ name: 'ActionForbiddenError';
199
+ message: 'Principal can not execute action on given resource';
200
+ httpStatusCode: 403;
201
+ traceId: string;
202
+ details?: {
203
+ issue: string;
204
+ field?: string;
205
+ value?: string;
206
+ location?: string;
207
+ }[];
208
+ }
209
+ export interface ConsumerAuthTokenEndpointInput {
210
+ grant_type: string;
211
+ code?: string;
212
+ refresh_token?: string;
213
+ redirect_uri?: string;
214
+ client_id?: string;
215
+ [key: string]: any;
216
+ }
217
+ export interface ConsumerAuthTokenEndpointOutput {
218
+ /** The access token issued by the authorization server. */
219
+ access_token?: string;
220
+ /**
221
+ * The lifetime in seconds of the access token. For
222
+ * example, the value "3600" denotes that the access token will
223
+ * expire in one hour from the time the response was generated.
224
+ * @format int64
225
+ */
226
+ expires_in?: number;
227
+ /**
228
+ * To retrieve a refresh token request the id_token scope.
229
+ * @format int64
230
+ */
231
+ id_token?: number;
232
+ /**
233
+ * The refresh token, which can be used to obtain new
234
+ * access tokens. To retrieve it add the scope "offline" to your access token request.
235
+ */
236
+ refresh_token?: string;
237
+ /** The scope of the access token */
238
+ scope?: string;
239
+ /** The type of the token issued */
240
+ token_type?: string;
241
+ }
242
+ export interface InvalidJwtTokenError {
243
+ name: 'InvalidJwtTokenError';
244
+ message: 'JWT token is invalid';
245
+ httpStatusCode: 401;
246
+ traceId: string;
247
+ details?: {
248
+ issue: string;
249
+ field?: string;
250
+ value?: string;
251
+ location?: string;
252
+ }[];
253
+ }
254
+ export interface UnauthorizedError {
255
+ name: 'UnauthorizedError';
256
+ message: 'Unauthorized';
257
+ httpStatusCode: 403;
258
+ traceId: string;
259
+ details?: {
260
+ issue: string;
261
+ field?: string;
262
+ value?: string;
263
+ location?: string;
264
+ }[];
265
+ }
266
+ import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';
267
+ export type QueryParamsType = Record<string | number, any>;
268
+ export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
269
+ /** set parameter to `true` for call `securityWorker` for this request */
270
+ secure?: boolean;
271
+ /** request path */
272
+ path: string;
273
+ /** content type of request body */
274
+ type?: ContentType;
275
+ /** query params */
276
+ query?: QueryParamsType;
277
+ /** format of response (i.e. response.json() -> format: "json") */
278
+ format?: ResponseType;
279
+ /** request body */
280
+ body?: unknown;
281
+ }
282
+ export type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
283
+ export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
284
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
285
+ secure?: boolean;
286
+ format?: ResponseType;
287
+ }
288
+ export declare enum ContentType {
289
+ Json = "application/json",
290
+ FormData = "multipart/form-data",
291
+ UrlEncoded = "application/x-www-form-urlencoded",
292
+ Text = "text/plain"
293
+ }
294
+ export declare class HttpClient<SecurityDataType = unknown> {
295
+ instance: AxiosInstance;
296
+ private securityData;
297
+ private securityWorker?;
298
+ private secure?;
299
+ private format?;
300
+ constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
301
+ setSecurityData: (data: SecurityDataType | null) => void;
302
+ protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
303
+ protected stringifyFormItem(formItem: unknown): string;
304
+ protected createFormData(input: Record<string, unknown>): FormData;
305
+ request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<axios.AxiosResponse<T, any>>;
306
+ }
307
+ /**
308
+ * @title Iam
309
+ * @version 1.0.0
310
+ * @baseUrl /
311
+ * @contact nucleus <nucleus.team@affinidi.com>
312
+ *
313
+ * Affinidi IAM
314
+ */
315
+ export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
316
+ wellKnown: {
317
+ /**
318
+ * No description
319
+ *
320
+ * @tags well-known
321
+ * @name GetWellKnownJwks
322
+ * @request GET:/.well-known/jwks.json
323
+ */
324
+ getWellKnownJwks: (params?: RequestParams) => Promise<axios.AxiosResponse<JsonWebKeySetDto, any>>;
325
+ };
326
+ v1: {
327
+ /**
328
+ * No description
329
+ *
330
+ * @tags sts
331
+ * @name CreateProjectScopedToken
332
+ * @request POST:/v1/sts/create-project-scoped-token
333
+ * @secure
334
+ */
335
+ createProjectScopedToken: (data: CreateProjectScopedTokenInput, params?: RequestParams) => Promise<axios.AxiosResponse<CreateProjectScopedTokenOutput, any>>;
336
+ /**
337
+ * No description
338
+ *
339
+ * @tags sts
340
+ * @name Whoami
341
+ * @request GET:/v1/sts/whoami
342
+ * @secure
343
+ */
344
+ whoami: (params?: RequestParams) => Promise<axios.AxiosResponse<WhoamiDto, any>>;
345
+ /**
346
+ * No description
347
+ *
348
+ * @tags projects
349
+ * @name CreateProject
350
+ * @request POST:/v1/projects
351
+ * @secure
352
+ */
353
+ createProject: (data: CreateProjectInput, params?: RequestParams) => Promise<axios.AxiosResponse<ProjectDto, any>>;
354
+ /**
355
+ * No description
356
+ *
357
+ * @tags projects
358
+ * @name ListProject
359
+ * @request GET:/v1/projects
360
+ * @secure
361
+ */
362
+ listProject: (params?: RequestParams) => Promise<axios.AxiosResponse<ProjectList, any>>;
363
+ /**
364
+ * No description
365
+ *
366
+ * @tags projects
367
+ * @name ListPrincipalsOfProject
368
+ * @request GET:/v1/projects/principals
369
+ * @secure
370
+ */
371
+ listPrincipalsOfProject: (params?: RequestParams) => Promise<axios.AxiosResponse<UserList, any>>;
372
+ /**
373
+ * No description
374
+ *
375
+ * @tags projects
376
+ * @name AddPrincipalToProject
377
+ * @request POST:/v1/projects/principals
378
+ * @secure
379
+ */
380
+ addPrincipalToProject: (data: AddUserToProjectInput, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
381
+ /**
382
+ * No description
383
+ *
384
+ * @tags projects
385
+ * @name DeletePrincipalFromProject
386
+ * @request DELETE:/v1/projects/principals/{principalId}
387
+ * @secure
388
+ */
389
+ deletePrincipalFromProject: (principalId: string, query: {
390
+ /** type of principal */
391
+ principalType: 'user' | 'token';
392
+ }, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
393
+ /**
394
+ * No description
395
+ *
396
+ * @tags policies
397
+ * @name GetPolicies
398
+ * @request GET:/v1/policies/principals/{principalId}
399
+ * @secure
400
+ */
401
+ getPolicies: (principalId: string, query: {
402
+ principalType: 'user' | 'token';
403
+ }, params?: RequestParams) => Promise<axios.AxiosResponse<PolicyDto, any>>;
404
+ /**
405
+ * No description
406
+ *
407
+ * @tags policies
408
+ * @name UpdatePolicies
409
+ * @request PUT:/v1/policies/principals/{principalId}
410
+ * @secure
411
+ */
412
+ updatePolicies: (principalId: string, query: {
413
+ principalType: 'user' | 'token';
414
+ }, data: PolicyDto, params?: RequestParams) => Promise<axios.AxiosResponse<PolicyDto, any>>;
415
+ /**
416
+ * No description
417
+ *
418
+ * @tags tokens
419
+ * @name CreateToken
420
+ * @request POST:/v1/tokens
421
+ * @secure
422
+ */
423
+ createToken: (data: CreateTokenInput, params?: RequestParams) => Promise<axios.AxiosResponse<TokenDto, any>>;
424
+ /**
425
+ * No description
426
+ *
427
+ * @tags tokens
428
+ * @name ListToken
429
+ * @request GET:/v1/tokens
430
+ * @secure
431
+ */
432
+ listToken: (params?: RequestParams) => Promise<axios.AxiosResponse<TokenList, any>>;
433
+ /**
434
+ * No description
435
+ *
436
+ * @tags tokens
437
+ * @name GetToken
438
+ * @request GET:/v1/tokens/{tokenId}
439
+ * @secure
440
+ */
441
+ getToken: (tokenId: string, params?: RequestParams) => Promise<axios.AxiosResponse<TokenDto, any>>;
442
+ /**
443
+ * No description
444
+ *
445
+ * @tags tokens
446
+ * @name UpdateToken
447
+ * @request PATCH:/v1/tokens/{tokenId}
448
+ * @secure
449
+ */
450
+ updateToken: (tokenId: string, data: UpdateTokenInput, params?: RequestParams) => Promise<axios.AxiosResponse<TokenDto, any>>;
451
+ /**
452
+ * No description
453
+ *
454
+ * @tags tokens
455
+ * @name DeleteToken
456
+ * @request DELETE:/v1/tokens/{tokenId}
457
+ * @secure
458
+ */
459
+ deleteToken: (tokenId: string, params?: RequestParams) => Promise<axios.AxiosResponse<void, any>>;
460
+ /**
461
+ * @description Use open source libraries to perform OAuth 2.0 and OpenID Connect available for any programming language. You can find a list of libraries here https://oauth.net/code/ The Ory SDK is not yet able to this endpoint properly.
462
+ *
463
+ * @tags consumerAuth
464
+ * @name ConsumerAuthTokenEndpoint
465
+ * @summary The Consumer OAuth 2.0 Token Endpoint
466
+ * @request POST:/v1/consumer/oauth2/token
467
+ */
468
+ consumerAuthTokenEndpoint: (data: ConsumerAuthTokenEndpointInput, params?: RequestParams) => Promise<axios.AxiosResponse<ConsumerAuthTokenEndpointOutput, any>>;
469
+ };
470
+ }