@nest-boot/auth 8.0.9-beta.0 → 8.0.9-beta.2

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 (347) hide show
  1. package/README.md +74 -34
  2. package/dist/adapters/mikro-orm/adapter-config.d.ts +5 -0
  3. package/dist/adapters/mikro-orm/adapter-config.js +5 -0
  4. package/dist/adapters/mikro-orm/adapter-config.js.map +1 -1
  5. package/dist/adapters/mikro-orm/create-custom-adapter.d.ts +9 -0
  6. package/dist/adapters/mikro-orm/create-custom-adapter.js +9 -0
  7. package/dist/adapters/mikro-orm/create-custom-adapter.js.map +1 -1
  8. package/dist/adapters/mikro-orm/entity-metadata-resolver.d.ts +7 -0
  9. package/dist/adapters/mikro-orm/entity-metadata-resolver.js +7 -0
  10. package/dist/adapters/mikro-orm/entity-metadata-resolver.js.map +1 -1
  11. package/dist/adapters/mikro-orm/where-compiler.d.ts +7 -0
  12. package/dist/adapters/mikro-orm/where-compiler.js +11 -0
  13. package/dist/adapters/mikro-orm/where-compiler.js.map +1 -1
  14. package/dist/api-key-usage.interceptor.d.ts +10 -2
  15. package/dist/api-key-usage.interceptor.js +10 -2
  16. package/dist/api-key-usage.interceptor.js.map +1 -1
  17. package/dist/auth-handler.middleware.d.ts +14 -3
  18. package/dist/auth-handler.middleware.js +14 -3
  19. package/dist/auth-handler.middleware.js.map +1 -1
  20. package/dist/auth.ability.d.ts +11 -2
  21. package/dist/auth.ability.js +11 -2
  22. package/dist/auth.ability.js.map +1 -1
  23. package/dist/auth.constants.d.ts +4 -1
  24. package/dist/auth.constants.js +4 -1
  25. package/dist/auth.constants.js.map +1 -1
  26. package/dist/auth.guard.d.ts +0 -4
  27. package/dist/auth.guard.js +0 -4
  28. package/dist/auth.guard.js.map +1 -1
  29. package/dist/auth.middleware.d.ts +24 -8
  30. package/dist/auth.middleware.js +41 -25
  31. package/dist/auth.middleware.js.map +1 -1
  32. package/dist/auth.module.d.ts +0 -1
  33. package/dist/auth.module.js +5 -6
  34. package/dist/auth.module.js.map +1 -1
  35. package/dist/connections/index.d.ts +1 -1
  36. package/dist/connections/index.js +1 -1
  37. package/dist/connections/index.js.map +1 -1
  38. package/dist/connections/member-api-key.connection-definition.d.ts +13 -0
  39. package/dist/connections/{workspace-api-key.connection-definition.js → member-api-key.connection-definition.js} +11 -11
  40. package/dist/connections/member-api-key.connection-definition.js.map +1 -0
  41. package/dist/connections/member.connection-definition.js +1 -0
  42. package/dist/connections/member.connection-definition.js.map +1 -1
  43. package/dist/decorators/can.decorator.d.ts +6 -1
  44. package/dist/decorators/can.decorator.js +6 -1
  45. package/dist/decorators/can.decorator.js.map +1 -1
  46. package/dist/decorators/public.decorator.d.ts +5 -1
  47. package/dist/decorators/public.decorator.js +5 -1
  48. package/dist/decorators/public.decorator.js.map +1 -1
  49. package/dist/entities/account.entity.d.ts +4 -1
  50. package/dist/entities/account.entity.js +4 -1
  51. package/dist/entities/account.entity.js.map +1 -1
  52. package/dist/entities/auth-entity-map.d.ts +2 -2
  53. package/dist/entities/auth-entity-map.js +2 -2
  54. package/dist/entities/auth-entity-map.js.map +1 -1
  55. package/dist/entities/index.d.ts +3 -3
  56. package/dist/entities/index.js +3 -3
  57. package/dist/entities/index.js.map +1 -1
  58. package/dist/entities/invitation.entity.d.ts +4 -1
  59. package/dist/entities/invitation.entity.js +4 -1
  60. package/dist/entities/invitation.entity.js.map +1 -1
  61. package/dist/entities/{workspace-api-key.entity.d.ts → member-api-key.entity.d.ts} +14 -6
  62. package/dist/entities/{workspace-api-key.entity.js → member-api-key.entity.js} +44 -29
  63. package/dist/entities/member-api-key.entity.js.map +1 -0
  64. package/dist/entities/member.entity.d.ts +10 -3
  65. package/dist/entities/member.entity.js +19 -3
  66. package/dist/entities/member.entity.js.map +1 -1
  67. package/dist/enums/index.d.ts +2 -1
  68. package/dist/enums/index.js +2 -1
  69. package/dist/enums/index.js.map +1 -1
  70. package/dist/enums/{workspace-api-key-permission.enum.d.ts → member-api-key-permission.enum.d.ts} +2 -2
  71. package/dist/enums/{workspace-api-key-permission.enum.js → member-api-key-permission.enum.js} +4 -4
  72. package/dist/enums/member-api-key-permission.enum.js.map +1 -0
  73. package/dist/enums/member-type.enum.d.ts +7 -0
  74. package/dist/enums/member-type.enum.js +11 -0
  75. package/dist/enums/member-type.enum.js.map +1 -0
  76. package/dist/features/invitations/invitation.resolver.d.ts +43 -8
  77. package/dist/features/invitations/invitation.resolver.js +43 -8
  78. package/dist/features/invitations/invitation.resolver.js.map +1 -1
  79. package/dist/features/invitations/invitation.service.d.ts +75 -12
  80. package/dist/features/invitations/invitation.service.js +75 -12
  81. package/dist/features/invitations/invitation.service.js.map +1 -1
  82. package/dist/index.d.ts +8 -7
  83. package/dist/index.js +8 -7
  84. package/dist/index.js.map +1 -1
  85. package/dist/infrastructure/api-key-authentication.service.d.ts +20 -4
  86. package/dist/infrastructure/api-key-authentication.service.js +45 -12
  87. package/dist/infrastructure/api-key-authentication.service.js.map +1 -1
  88. package/dist/infrastructure/api-key-lifecycle.d.ts +31 -5
  89. package/dist/infrastructure/api-key-lifecycle.js +31 -5
  90. package/dist/infrastructure/api-key-lifecycle.js.map +1 -1
  91. package/dist/infrastructure/auth-ability.factory.d.ts +14 -3
  92. package/dist/infrastructure/auth-ability.factory.js +31 -5
  93. package/dist/infrastructure/auth-ability.factory.js.map +1 -1
  94. package/dist/infrastructure/auth-enum-registry.d.ts +4 -1
  95. package/dist/infrastructure/auth-enum-registry.js +7 -4
  96. package/dist/infrastructure/auth-enum-registry.js.map +1 -1
  97. package/dist/infrastructure/auth-service.providers.d.ts +4 -1
  98. package/dist/infrastructure/auth-service.providers.js +4 -1
  99. package/dist/infrastructure/auth-service.providers.js.map +1 -1
  100. package/dist/infrastructure/better-auth-adapter.d.ts +6 -1
  101. package/dist/infrastructure/better-auth-adapter.js +2 -0
  102. package/dist/infrastructure/better-auth-adapter.js.map +1 -1
  103. package/dist/infrastructure/create-auth-instance.d.ts +20 -2
  104. package/dist/infrastructure/create-auth-instance.js +31 -4
  105. package/dist/infrastructure/create-auth-instance.js.map +1 -1
  106. package/dist/infrastructure/create-contextual-auth-service.d.ts +4 -0
  107. package/dist/infrastructure/create-contextual-auth-service.js +4 -0
  108. package/dist/infrastructure/create-contextual-auth-service.js.map +1 -1
  109. package/dist/infrastructure/request-identity.d.ts +89 -18
  110. package/dist/infrastructure/request-identity.js +113 -28
  111. package/dist/infrastructure/request-identity.js.map +1 -1
  112. package/dist/infrastructure/revoked-authentication.exception.d.ts +4 -1
  113. package/dist/infrastructure/revoked-authentication.exception.js +4 -1
  114. package/dist/infrastructure/revoked-authentication.exception.js.map +1 -1
  115. package/dist/inputs/add-member.input.d.ts +13 -2
  116. package/dist/inputs/add-member.input.js +34 -3
  117. package/dist/inputs/add-member.input.js.map +1 -1
  118. package/dist/inputs/{create-workspace-api-key.input.d.ts → create-member-api-key.input.d.ts} +6 -4
  119. package/dist/inputs/{create-workspace-api-key.input.js → create-member-api-key.input.js} +20 -13
  120. package/dist/inputs/create-member-api-key.input.js.map +1 -0
  121. package/dist/inputs/create-user-api-key.input.d.ts +1 -1
  122. package/dist/inputs/create-user-api-key.input.js +1 -1
  123. package/dist/inputs/create-user-api-key.input.js.map +1 -1
  124. package/dist/inputs/{update-workspace-api-key.input.d.ts → update-member-api-key.input.d.ts} +3 -3
  125. package/dist/inputs/{update-workspace-api-key.input.js → update-member-api-key.input.js} +11 -11
  126. package/dist/inputs/update-member-api-key.input.js.map +1 -0
  127. package/dist/interfaces/ability-context.interface.d.ts +3 -3
  128. package/dist/interfaces/add-member-options.interface.d.ts +1 -1
  129. package/dist/interfaces/auth-module-api-key-options.interface.d.ts +2 -2
  130. package/dist/interfaces/auth-module-api-key-scope-options.interface.d.ts +2 -2
  131. package/dist/interfaces/create-api-key-options.interface.d.ts +1 -1
  132. package/dist/interfaces/create-member-api-key-options.interface.d.ts +7 -0
  133. package/dist/interfaces/create-member-api-key-options.interface.js +2 -0
  134. package/dist/interfaces/create-member-api-key-options.interface.js.map +1 -0
  135. package/dist/interfaces/member-api-key-validation.interface.d.ts +17 -0
  136. package/dist/interfaces/member-api-key-validation.interface.js +2 -0
  137. package/dist/interfaces/member-api-key-validation.interface.js.map +1 -0
  138. package/dist/interfaces/request-identity-patch.interface.d.ts +4 -1
  139. package/dist/interfaces/request-permissions.interface.d.ts +5 -2
  140. package/dist/objects/{create-workspace-api-key-result.object.d.ts → create-member-api-key-result.object.d.ts} +3 -3
  141. package/dist/objects/{create-workspace-api-key-result.object.js → create-member-api-key-result.object.js} +10 -10
  142. package/dist/objects/create-member-api-key-result.object.js.map +1 -0
  143. package/dist/objects/member-api-key-permission-option.object.d.ts +10 -0
  144. package/dist/objects/{workspace-api-key-permission-option.object.js → member-api-key-permission-option.object.js} +12 -12
  145. package/dist/objects/member-api-key-permission-option.object.js.map +1 -0
  146. package/dist/policies/create-scope-policy.d.ts +7 -1
  147. package/dist/policies/create-scope-policy.js +7 -1
  148. package/dist/policies/create-scope-policy.js.map +1 -1
  149. package/dist/policies/user-scope.policy.d.ts +2 -0
  150. package/dist/policies/user-scope.policy.js +2 -0
  151. package/dist/policies/user-scope.policy.js.map +1 -1
  152. package/dist/policies/workspace-scope.policy.d.ts +2 -0
  153. package/dist/policies/workspace-scope.policy.js +2 -0
  154. package/dist/policies/workspace-scope.policy.js.map +1 -1
  155. package/dist/resolvers/auth.resolver.d.ts +85 -18
  156. package/dist/resolvers/auth.resolver.js +90 -18
  157. package/dist/resolvers/auth.resolver.js.map +1 -1
  158. package/dist/resolvers/member-api-key.resolver.d.ts +46 -0
  159. package/dist/resolvers/member-api-key.resolver.js +109 -0
  160. package/dist/resolvers/member-api-key.resolver.js.map +1 -0
  161. package/dist/resolvers/member.resolver.d.ts +26 -11
  162. package/dist/resolvers/member.resolver.js +37 -12
  163. package/dist/resolvers/member.resolver.js.map +1 -1
  164. package/dist/resolvers/session.resolver.d.ts +59 -12
  165. package/dist/resolvers/session.resolver.js +59 -12
  166. package/dist/resolvers/session.resolver.js.map +1 -1
  167. package/dist/resolvers/user-api-key.resolver.d.ts +26 -5
  168. package/dist/resolvers/user-api-key.resolver.js +26 -5
  169. package/dist/resolvers/user-api-key.resolver.js.map +1 -1
  170. package/dist/resolvers/user.resolver.d.ts +114 -19
  171. package/dist/resolvers/user.resolver.js +114 -19
  172. package/dist/resolvers/user.resolver.js.map +1 -1
  173. package/dist/resolvers/workspace.resolver.d.ts +39 -17
  174. package/dist/resolvers/workspace.resolver.js +42 -20
  175. package/dist/resolvers/workspace.resolver.js.map +1 -1
  176. package/dist/services/account.service.d.ts +11 -2
  177. package/dist/services/account.service.js +11 -2
  178. package/dist/services/account.service.js.map +1 -1
  179. package/dist/services/auth.service.d.ts +132 -27
  180. package/dist/services/auth.service.js +132 -27
  181. package/dist/services/auth.service.js.map +1 -1
  182. package/dist/services/member-api-key.service.d.ts +76 -0
  183. package/dist/services/{workspace-api-key.service.js → member-api-key.service.js} +117 -54
  184. package/dist/services/member-api-key.service.js.map +1 -0
  185. package/dist/services/member.service.d.ts +111 -20
  186. package/dist/services/member.service.js +153 -35
  187. package/dist/services/member.service.js.map +1 -1
  188. package/dist/services/session.service.d.ts +37 -10
  189. package/dist/services/session.service.js +69 -10
  190. package/dist/services/session.service.js.map +1 -1
  191. package/dist/services/user-api-key.service.d.ts +40 -7
  192. package/dist/services/user-api-key.service.js +43 -8
  193. package/dist/services/user-api-key.service.js.map +1 -1
  194. package/dist/services/user-deletion.service.d.ts +7 -1
  195. package/dist/services/user-deletion.service.js +7 -1
  196. package/dist/services/user-deletion.service.js.map +1 -1
  197. package/dist/services/user.service.d.ts +109 -20
  198. package/dist/services/user.service.js +109 -20
  199. package/dist/services/user.service.js.map +1 -1
  200. package/dist/services/workspace.service.d.ts +50 -11
  201. package/dist/services/workspace.service.js +51 -20
  202. package/dist/services/workspace.service.js.map +1 -1
  203. package/dist/tsconfig.tsbuildinfo +1 -1
  204. package/dist/types/api-key-validation.type.d.ts +2 -2
  205. package/dist/types/api-key.type.d.ts +3 -3
  206. package/dist/types/lowercase-identifier.type.d.ts +4 -1
  207. package/dist/utils/api-key-credential.util.d.ts +12 -2
  208. package/dist/utils/api-key-credential.util.js +12 -2
  209. package/dist/utils/api-key-credential.util.js.map +1 -1
  210. package/dist/utils/api-key-permissions.util.d.ts +16 -4
  211. package/dist/utils/api-key-permissions.util.js +15 -3
  212. package/dist/utils/api-key-permissions.util.js.map +1 -1
  213. package/dist/utils/append-metadata.util.d.ts +6 -1
  214. package/dist/utils/append-metadata.util.js +6 -1
  215. package/dist/utils/append-metadata.util.js.map +1 -1
  216. package/dist/utils/apply-auth-response-cookies.util.d.ts +4 -1
  217. package/dist/utils/apply-auth-response-cookies.util.js +4 -1
  218. package/dist/utils/apply-auth-response-cookies.util.js.map +1 -1
  219. package/dist/utils/auth-role.util.d.ts +50 -8
  220. package/dist/utils/auth-role.util.js +50 -8
  221. package/dist/utils/auth-role.util.js.map +1 -1
  222. package/dist/utils/authorize.util.d.ts +6 -1
  223. package/dist/utils/authorize.util.js +6 -1
  224. package/dist/utils/authorize.util.js.map +1 -1
  225. package/dist/utils/build-request-ability.util.d.ts +5 -1
  226. package/dist/utils/build-request-ability.util.js +11 -17
  227. package/dist/utils/build-request-ability.util.js.map +1 -1
  228. package/dist/utils/can.util.d.ts +7 -1
  229. package/dist/utils/can.util.js +7 -1
  230. package/dist/utils/can.util.js.map +1 -1
  231. package/dist/utils/create-email-and-password-config.d.ts +8 -0
  232. package/dist/utils/create-email-and-password-config.js +8 -0
  233. package/dist/utils/create-email-and-password-config.js.map +1 -1
  234. package/dist/utils/create-email-verification-config.d.ts +6 -1
  235. package/dist/utils/create-email-verification-config.js +6 -1
  236. package/dist/utils/create-email-verification-config.js.map +1 -1
  237. package/dist/utils/create-generic-oauth-config.d.ts +7 -1
  238. package/dist/utils/create-generic-oauth-config.js +7 -1
  239. package/dist/utils/create-generic-oauth-config.js.map +1 -1
  240. package/dist/utils/create-oidc-config.d.ts +5 -0
  241. package/dist/utils/create-oidc-config.js +5 -0
  242. package/dist/utils/create-oidc-config.js.map +1 -1
  243. package/dist/utils/create-permission-enum.util.d.ts +5 -1
  244. package/dist/utils/create-permission-enum.util.js +5 -1
  245. package/dist/utils/create-permission-enum.util.js.map +1 -1
  246. package/dist/utils/create-social-provider-config.d.ts +7 -0
  247. package/dist/utils/create-social-provider-config.js +7 -0
  248. package/dist/utils/create-social-provider-config.js.map +1 -1
  249. package/dist/utils/create-social-providers-config.d.ts +6 -0
  250. package/dist/utils/create-social-providers-config.js +6 -0
  251. package/dist/utils/create-social-providers-config.js.map +1 -1
  252. package/dist/utils/create-user-config.d.ts +7 -1
  253. package/dist/utils/create-user-config.js +7 -1
  254. package/dist/utils/create-user-config.js.map +1 -1
  255. package/dist/utils/estimate-entropy.d.ts +0 -1
  256. package/dist/utils/estimate-entropy.js +0 -1
  257. package/dist/utils/estimate-entropy.js.map +1 -1
  258. package/dist/utils/extend-ability.util.d.ts +9 -1
  259. package/dist/utils/extend-ability.util.js +24 -1
  260. package/dist/utils/extend-ability.util.js.map +1 -1
  261. package/dist/utils/extract-api-key.util.d.ts +5 -1
  262. package/dist/utils/extract-api-key.util.js +5 -1
  263. package/dist/utils/extract-api-key.util.js.map +1 -1
  264. package/dist/utils/get-auth-ability.util.d.ts +1 -0
  265. package/dist/utils/get-auth-ability.util.js +1 -0
  266. package/dist/utils/get-auth-ability.util.js.map +1 -1
  267. package/dist/utils/get-current-api-key.util.d.ts +5 -1
  268. package/dist/utils/get-current-api-key.util.js +5 -1
  269. package/dist/utils/get-current-api-key.util.js.map +1 -1
  270. package/dist/utils/has-oidc-env-config.d.ts +4 -0
  271. package/dist/utils/has-oidc-env-config.js +4 -0
  272. package/dist/utils/has-oidc-env-config.js.map +1 -1
  273. package/dist/utils/has-social-provider-credential-env-config.d.ts +5 -0
  274. package/dist/utils/has-social-provider-credential-env-config.js +5 -0
  275. package/dist/utils/has-social-provider-credential-env-config.js.map +1 -1
  276. package/dist/utils/has-social-provider-env-config.d.ts +5 -0
  277. package/dist/utils/has-social-provider-env-config.js +5 -0
  278. package/dist/utils/has-social-provider-env-config.js.map +1 -1
  279. package/dist/utils/is-env-true.d.ts +5 -0
  280. package/dist/utils/is-env-true.js +5 -0
  281. package/dist/utils/is-env-true.js.map +1 -1
  282. package/dist/utils/omit-credentials.util.d.ts +7 -1
  283. package/dist/utils/omit-credentials.util.js +7 -1
  284. package/dist/utils/omit-credentials.util.js.map +1 -1
  285. package/dist/utils/permission-grants.util.d.ts +28 -4
  286. package/dist/utils/permission-grants.util.js +30 -4
  287. package/dist/utils/permission-grants.util.js.map +1 -1
  288. package/dist/utils/resolve-auth-catalog.util.d.ts +6 -1
  289. package/dist/utils/resolve-auth-catalog.util.js +6 -1
  290. package/dist/utils/resolve-auth-catalog.util.js.map +1 -1
  291. package/dist/utils/resolve-effective-permissions.util.d.ts +21 -3
  292. package/dist/utils/resolve-effective-permissions.util.js +21 -3
  293. package/dist/utils/resolve-effective-permissions.util.js.map +1 -1
  294. package/dist/utils/resolve-oidc-prompt.d.ts +4 -0
  295. package/dist/utils/resolve-oidc-prompt.js +4 -0
  296. package/dist/utils/resolve-oidc-prompt.js.map +1 -1
  297. package/dist/utils/resolve-oidc-scopes.d.ts +4 -0
  298. package/dist/utils/resolve-oidc-scopes.js +4 -0
  299. package/dist/utils/resolve-oidc-scopes.js.map +1 -1
  300. package/dist/utils/resolve-request-member.util.d.ts +7 -0
  301. package/dist/utils/resolve-request-member.util.js +27 -0
  302. package/dist/utils/resolve-request-member.util.js.map +1 -0
  303. package/dist/utils/resolve-request-permissions.util.d.ts +10 -2
  304. package/dist/utils/resolve-request-permissions.util.js +21 -18
  305. package/dist/utils/resolve-request-permissions.util.js.map +1 -1
  306. package/dist/utils/resolve-required-oidc-env.d.ts +5 -0
  307. package/dist/utils/resolve-required-oidc-env.js +5 -0
  308. package/dist/utils/resolve-required-oidc-env.js.map +1 -1
  309. package/dist/utils/resolve-required-social-provider-env.d.ts +6 -0
  310. package/dist/utils/resolve-required-social-provider-env.js +6 -0
  311. package/dist/utils/resolve-required-social-provider-env.js.map +1 -1
  312. package/dist/utils/resolve-secret.d.ts +5 -0
  313. package/dist/utils/resolve-secret.js +5 -0
  314. package/dist/utils/resolve-secret.js.map +1 -1
  315. package/dist/utils/resolve-social-provider-enabled.d.ts +5 -0
  316. package/dist/utils/resolve-social-provider-enabled.js +5 -0
  317. package/dist/utils/resolve-social-provider-enabled.js.map +1 -1
  318. package/dist/utils/run-auth-query.d.ts +3 -0
  319. package/dist/utils/run-auth-query.js +3 -0
  320. package/dist/utils/run-auth-query.js.map +1 -1
  321. package/dist/utils/serialize-ability-rules.util.d.ts +5 -1
  322. package/dist/utils/serialize-ability-rules.util.js +15 -1
  323. package/dist/utils/serialize-ability-rules.util.js.map +1 -1
  324. package/dist/utils/split-auth-providers.d.ts +5 -1
  325. package/dist/utils/split-auth-providers.js +6 -4
  326. package/dist/utils/split-auth-providers.js.map +1 -1
  327. package/dist/workspace.constants.d.ts +3 -3
  328. package/dist/workspace.constants.js +6 -2
  329. package/dist/workspace.constants.js.map +1 -1
  330. package/package.json +17 -23
  331. package/dist/connections/workspace-api-key.connection-definition.d.ts +0 -13
  332. package/dist/connections/workspace-api-key.connection-definition.js.map +0 -1
  333. package/dist/entities/workspace-api-key.entity.js.map +0 -1
  334. package/dist/enums/workspace-api-key-permission.enum.js.map +0 -1
  335. package/dist/inputs/create-workspace-api-key.input.js.map +0 -1
  336. package/dist/inputs/update-workspace-api-key.input.js.map +0 -1
  337. package/dist/interfaces/workspace-api-key-validation.interface.d.ts +0 -11
  338. package/dist/interfaces/workspace-api-key-validation.interface.js +0 -2
  339. package/dist/interfaces/workspace-api-key-validation.interface.js.map +0 -1
  340. package/dist/objects/create-workspace-api-key-result.object.js.map +0 -1
  341. package/dist/objects/workspace-api-key-permission-option.object.d.ts +0 -10
  342. package/dist/objects/workspace-api-key-permission-option.object.js.map +0 -1
  343. package/dist/resolvers/workspace-api-key.resolver.d.ts +0 -25
  344. package/dist/resolvers/workspace-api-key.resolver.js +0 -84
  345. package/dist/resolvers/workspace-api-key.resolver.js.map +0 -1
  346. package/dist/services/workspace-api-key.service.d.ts +0 -41
  347. package/dist/services/workspace-api-key.service.js.map +0 -1
@@ -1,3 +1,9 @@
1
1
  import type { GenericOAuthProviderConfig } from "./generic-oauth-provider-config.type.js";
2
- /** Combines custom Generic OAuth providers with the environment OIDC provider. */
2
+ /**
3
+ * Combines custom Generic OAuth providers with the environment OIDC provider.
4
+ * @param disableSignUp - Whether provider-based registration is disabled.
5
+ * @param configuredProviders - Providers configured by the application.
6
+ * @param oidcConfig - OIDC provider configuration.
7
+ * @returns Generic OAuth providers with environment defaults and sign-up policy applied.
8
+ */
3
9
  export declare function createGenericOAuthConfig(disableSignUp: boolean, configuredProviders?: readonly GenericOAuthProviderConfig[], oidcConfig?: GenericOAuthProviderConfig): GenericOAuthProviderConfig[];
@@ -1,4 +1,10 @@
1
- /** Combines custom Generic OAuth providers with the environment OIDC provider. */
1
+ /**
2
+ * Combines custom Generic OAuth providers with the environment OIDC provider.
3
+ * @param disableSignUp - Whether provider-based registration is disabled.
4
+ * @param configuredProviders - Providers configured by the application.
5
+ * @param oidcConfig - OIDC provider configuration.
6
+ * @returns Generic OAuth providers with environment defaults and sign-up policy applied.
7
+ */
2
8
  export function createGenericOAuthConfig(disableSignUp, configuredProviders = [], oidcConfig) {
3
9
  const providers = [
4
10
  ...configuredProviders,
@@ -1 +1 @@
1
- {"version":3,"file":"create-generic-oauth-config.js","sourceRoot":"","sources":["../../src/utils/create-generic-oauth-config.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,MAAM,UAAU,wBAAwB,CACtC,aAAsB,EACtB,sBAA6D,EAAE,EAC/D,UAAuC;IAEvC,MAAM,SAAS,GAAG;QAChB,GAAG,mBAAmB;QACtB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACpC,CAAC;IACF,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CAAC,CAAC,QAAQ,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +1,7 @@
1
1
  import { GenericOAuthProviderConfig } from "./generic-oauth-provider-config.type.js";
2
+ /**
3
+ * Returns environment-derived OIDC configuration, or undefined when disabled.
4
+ * @param disableSignUp - Whether provider-based registration is disabled.
5
+ * @returns Environment-derived OIDC configuration, or undefined when disabled.
6
+ */
2
7
  export declare function createOidcConfig(disableSignUp: boolean): GenericOAuthProviderConfig | undefined;
@@ -2,6 +2,11 @@ import { isEnvTrue } from "./is-env-true.js";
2
2
  import { resolveOidcPrompt } from "./resolve-oidc-prompt.js";
3
3
  import { resolveOidcScopes } from "./resolve-oidc-scopes.js";
4
4
  import { resolveRequiredOidcEnv } from "./resolve-required-oidc-env.js";
5
+ /**
6
+ * Returns environment-derived OIDC configuration, or undefined when disabled.
7
+ * @param disableSignUp - Whether provider-based registration is disabled.
8
+ * @returns Environment-derived OIDC configuration, or undefined when disabled.
9
+ */
5
10
  export function createOidcConfig(disableSignUp) {
6
11
  if (!isEnvTrue("AUTH_OIDC_ENABLED")) {
7
12
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"create-oidc-config.js","sourceRoot":"","sources":["../../src/utils/create-oidc-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,MAAM,UAAU,gBAAgB,CAC9B,aAAsB;IAEtB,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;QACvD,YAAY,EAAE,sBAAsB,CAAC,yBAAyB,CAAC;QAC/D,YAAY,EAAE,sBAAsB,CAAC,yBAAyB,CAAC;QAC/D,MAAM,EAAE,iBAAiB,EAAE;QAC3B,MAAM,EAAE,iBAAiB,EAAE;QAC3B,aAAa,EAAE,aAAa,IAAI,SAAS,CAAC,2BAA2B,CAAC;KACvE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"create-oidc-config.js","sourceRoot":"","sources":["../../src/utils/create-oidc-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAAsB;IAEtB,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;QACvD,YAAY,EAAE,sBAAsB,CAAC,yBAAyB,CAAC;QAC/D,YAAY,EAAE,sBAAsB,CAAC,yBAAyB,CAAC;QAC/D,MAAM,EAAE,iBAAiB,EAAE;QAC3B,MAAM,EAAE,iBAAiB,EAAE;QAC3B,aAAa,EAAE,aAAa,IAAI,SAAS,CAAC,2BAA2B,CAAC;KACvE,CAAC;AACJ,CAAC"}
@@ -1,2 +1,6 @@
1
- /** Builds GraphQL names while preserving the original permission values. */
1
+ /**
2
+ * Builds GraphQL names while preserving the original permission values.
3
+ * @param permissions - Permission names to apply.
4
+ * @returns GraphQL enum values mapped to the configured permission names.
5
+ */
2
6
  export declare function createPermissionEnum(permissions: readonly string[]): Record<string, string>;
@@ -1,4 +1,8 @@
1
- /** Builds GraphQL names while preserving the original permission values. */
1
+ /**
2
+ * Builds GraphQL names while preserving the original permission values.
3
+ * @param permissions - Permission names to apply.
4
+ * @returns GraphQL enum values mapped to the configured permission names.
5
+ */
2
6
  export function createPermissionEnum(permissions) {
3
7
  const values = Object.create(null);
4
8
  for (const permission of permissions) {
@@ -1 +1 @@
1
- {"version":3,"file":"create-permission-enum.util.js","sourceRoot":"","sources":["../../src/utils/create-permission-enum.util.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,UAAU,oBAAoB,CAClC,WAA8B;IAE9B,MAAM,MAAM,GAA2B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3D,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,UAAU;aACpB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC;aACrB,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;aACpB,WAAW,EAAE,CAAC;QACjB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CACb,+BAA+B,MAAM,CAAC,IAAI,CAAC,UAAU,UAAU,kBAAkB,IAAI,GAAG,CACzF,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;IAC5B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"create-permission-enum.util.js","sourceRoot":"","sources":["../../src/utils/create-permission-enum.util.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAA8B;IAE9B,MAAM,MAAM,GAA2B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3D,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,UAAU;aACpB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC;aACrB,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;aACpB,WAAW,EAAE,CAAC;QACjB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CACb,+BAA+B,MAAM,CAAC,IAAI,CAAC,UAAU,UAAU,kBAAkB,IAAI,GAAG,CACzF,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;IAC5B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -2,5 +2,12 @@ import type { BetterAuthOptions } from "better-auth";
2
2
  import { SocialProviderId } from "./social-provider.constants.js";
3
3
  type SocialProvidersConfig = NonNullable<BetterAuthOptions["socialProviders"]>;
4
4
  type SocialProviderConfig<T extends SocialProviderId> = NonNullable<SocialProvidersConfig[T]>;
5
+ /**
6
+ * Returns provider options with environment credentials, or undefined when disabled.
7
+ * @param provider - Authentication provider identifier.
8
+ * @param disableSignUp - Whether provider-based registration is disabled.
9
+ * @param options - Configuration for this operation.
10
+ * @returns Provider options with environment credentials, or undefined when disabled.
11
+ */
5
12
  export declare function createSocialProviderConfig<T extends SocialProviderId>(provider: T, disableSignUp: boolean, options?: SocialProviderConfig<T>): SocialProviderConfig<T> | undefined;
6
13
  export {};
@@ -3,6 +3,13 @@ import { isEnvTrue } from "./is-env-true.js";
3
3
  import { resolveRequiredSocialProviderEnv } from "./resolve-required-social-provider-env.js";
4
4
  import { resolveSocialProviderEnabled } from "./resolve-social-provider-enabled.js";
5
5
  import { SOCIAL_PROVIDER_ENV_CONFIGS, } from "./social-provider.constants.js";
6
+ /**
7
+ * Returns provider options with environment credentials, or undefined when disabled.
8
+ * @param provider - Authentication provider identifier.
9
+ * @param disableSignUp - Whether provider-based registration is disabled.
10
+ * @param options - Configuration for this operation.
11
+ * @returns Provider options with environment credentials, or undefined when disabled.
12
+ */
6
13
  export function createSocialProviderConfig(provider, disableSignUp, options) {
7
14
  const providerConfig = SOCIAL_PROVIDER_ENV_CONFIGS[provider];
8
15
  const hasCredentialEnvConfig = hasSocialProviderCredentialEnvConfig(provider);
@@ -1 +1 @@
1
- {"version":3,"file":"create-social-provider-config.js","sourceRoot":"","sources":["../../src/utils/create-social-provider-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAC;AACtG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EACL,2BAA2B,GAE5B,MAAM,gCAAgC,CAAC;AAWxC,MAAM,UAAU,0BAA0B,CACxC,QAAW,EACX,aAAsB,EACtB,OAAiC;IAEjC,MAAM,cAAc,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,sBAAsB,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC;IAC9E,MAAM,mBAAmB,GACvB,aAAa,IAAI,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IAC3D,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;IACxE,MAAM,OAAO,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,sBAAsB,GAAG,OAAO,IAAI,sBAAsB,CAAC;IACjE,MAAM,oBAAoB,GAAG,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC;IAElD,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,IAAI,EAAE;YACjB,MAAM,eAAe,GAAG,CAAC,MAAM,OAAO,EAAE,CAA4B,CAAC;YACrE,OAAO,0BAA0B,CAC/B,QAAQ,EACR,aAAa,EACb,eAAe,CACmB,CAAC;QACvC,CAAC,CAA4B,CAAC;IAChC,CAAC;IAED,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,gCAAgC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC;QAED,OAAO;YACL,GAAG,OAAO;YACV,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,mBAAmB,IAAI,OAAO,EAAE,aAAa,KAAK,IAAI;gBACxD,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE;gBACzB,CAAC,CAAC,EAAE,CAAC;SACmB,CAAC;IAC/B,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE,gCAAgC,CAAC,QAAQ,EAAE,UAAU,CAAC;QAChE,YAAY,EAAE,gCAAgC,CAAC,QAAQ,EAAE,cAAc,CAAC;QACxE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,aAAa,EAAE,mBAAmB,IAAI,OAAO,EAAE,aAAa,KAAK,IAAI;KAC3C,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"create-social-provider-config.js","sourceRoot":"","sources":["../../src/utils/create-social-provider-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oCAAoC,EAAE,MAAM,gDAAgD,CAAC;AACtG,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EACL,2BAA2B,G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AAC,EAAE,aAAa,EAAE,IAAI,EAAE;gBACzB,CAAC,CAAC,EAAE,CAAC;SACmB,CAAC;IAC/B,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE,gCAAgC,CAAC,QAAQ,EAAE,UAAU,CAAC;QAChE,YAAY,EAAE,gCAAgC,CAAC,QAAQ,EAAE,cAAc,CAAC;QACxE,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,aAAa,EAAE,mBAAmB,IAAI,OAAO,EAAE,aAAa,KAAK,IAAI;KACtE,CAAC;AACJ,CAAC"}
@@ -1,4 +1,10 @@
1
1
  import type { BetterAuthOptions } from "better-auth";
2
2
  type SocialProvidersConfig = NonNullable<BetterAuthOptions["socialProviders"]>;
3
+ /**
4
+ * Returns enabled social provider configurations.
5
+ * @param disableSignUp - Whether provider-based registration is disabled.
6
+ * @param options - Configuration for this operation.
7
+ * @returns Enabled social provider configurations.
8
+ */
3
9
  export declare function createSocialProvidersConfig(disableSignUp: boolean, options?: SocialProvidersConfig): SocialProvidersConfig | undefined;
4
10
  export {};
@@ -1,4 +1,10 @@
1
1
  import { createSocialProviderConfig } from "./create-social-provider-config.js";
2
+ /**
3
+ * Returns enabled social provider configurations.
4
+ * @param disableSignUp - Whether provider-based registration is disabled.
5
+ * @param options - Configuration for this operation.
6
+ * @returns Enabled social provider configurations.
7
+ */
2
8
  export function createSocialProvidersConfig(disableSignUp, options) {
3
9
  const githubConfig = createSocialProviderConfig("github", disableSignUp, options?.github);
4
10
  const googleConfig = createSocialProviderConfig("google", disableSignUp, options?.google);
@@ -1 +1 @@
1
- {"version":3,"file":"create-social-providers-config.js","sourceRoot":"","sources":["../../src/utils/create-social-providers-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAIhF,MAAM,UAAU,2BAA2B,CACzC,aAAsB,EACtB,OAA+B;IAE/B,MAAM,YAAY,GAAG,0BAA0B,CAC7C,QAAQ,EACR,aAAa,EACb,OAAO,EAAE,MAAM,CAChB,CAAC;IACF,MAAM,YAAY,GAAG,0BAA0B,CAC7C,QAAQ,EACR,aAAa,EACb,OAAO,EAAE,MAAM,CAChB,CAAC;IAEF,IAAI,CAAC,OAAO,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"create-social-providers-config.js","sourceRoot":"","sources":["../../src/utils/create-social-providers-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAIhF;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,aAAsB,EACtB,OAA+B;IAE/B,MAAM,YAAY,GAAG,0BAA0B,CAC7C,QAAQ,EACR,aAAa,EACb,OAAO,EAAE,MAAM,CAChB,CAAC;IACF,MAAM,YAAY,GAAG,0BAA0B,CAC7C,QAAQ,EACR,aAAa,EACb,OAAO,EAAE,MAAM,CAChB,CAAC;IAEF,IAAI,CAAC,OAAO,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC"}
@@ -3,6 +3,12 @@ import type { BetterAuthOptions } from "better-auth";
3
3
  import type { AuthModuleUserOptions } from "../interfaces/auth-module-user-options.interface.js";
4
4
  type UserConfig = NonNullable<BetterAuthOptions["user"]>;
5
5
  type DeleteUser = (userId: string, beforeDelete?: () => Promise<void>) => Promise<void>;
6
- /** Adds Nest Boot's mailer-backed defaults to Better Auth user options. */
6
+ /**
7
+ * Adds Nest Boot's mailer-backed defaults to Better Auth user options.
8
+ * @param mailer - Mailer used to deliver authentication emails.
9
+ * @param options - Configuration for this operation.
10
+ * @param deleteUser - Callback that removes the user and related records.
11
+ * @returns Better Auth user options with email-change and deletion hooks.
12
+ */
7
13
  export declare function createUserConfig(mailer: Mailer, options?: AuthModuleUserOptions, deleteUser?: DeleteUser): UserConfig | undefined;
8
14
  export {};
@@ -1,4 +1,10 @@
1
- /** Adds Nest Boot's mailer-backed defaults to Better Auth user options. */
1
+ /**
2
+ * Adds Nest Boot's mailer-backed defaults to Better Auth user options.
3
+ * @param mailer - Mailer used to deliver authentication emails.
4
+ * @param options - Configuration for this operation.
5
+ * @param deleteUser - Callback that removes the user and related records.
6
+ * @returns Better Auth user options with email-change and deletion hooks.
7
+ */
2
8
  export function createUserConfig(mailer, options, deleteUser) {
3
9
  if (!options)
4
10
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"create-user-config.js","sourceRoot":"","sources":["../../src/utils/create-user-config.ts"],"names":[],"mappings":"AAWA,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,OAA+B,EAC/B,UAAuB;IAEvB,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAE/B,MAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,W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,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC7D,MAAM,MAAM,CAAC,QAAQ,CAAC;oBACpB,EAAE,EAAE,IAAI,CAAC,KAAK;oBACd,OAAO,EAAE,2BAA2B;oBACpC,IAAI,EAAE;wBACJ,0CAA0C,QAAQ,GAAG;wBACrD,GAAG;qBACJ,CAAC,IAAI,CAAC,MAAM,CAAC;iBACf,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Estimates the entropy of a string in bits.
3
3
  * This is a simple approximation that helps detect low-entropy secrets.
4
- *
5
4
  * @param str - The string to estimate entropy for
6
5
  * @returns The estimated entropy in bits
7
6
  */
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * Estimates the entropy of a string in bits.
3
3
  * This is a simple approximation that helps detect low-entropy secrets.
4
- *
5
4
  * @param str - The string to estimate entropy for
6
5
  * @returns The estimated entropy in bits
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"estimate-entropy.js","sourceRoot":"","sources":["../../src/utils/estimate-entropy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IACjC,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC"}
1
+ {"version":3,"file":"estimate-entropy.js","sourceRoot":"","sources":["../../src/utils/estimate-entropy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IACjC,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC"}
@@ -1,7 +1,15 @@
1
1
  import type { Ability, AbilityBuilder, AbilityTuple, MongoQuery } from "@casl/ability";
2
2
  import type { AbilityContext } from "../interfaces/ability-context.interface.js";
3
3
  import type { AbilityRules } from "../interfaces/ability-rules.interface.js";
4
- /** Runs synchronous extensions without exposing the builder, mutable rules, or a build function. */
4
+ /**
5
+ * Runs synchronous extensions without exposing the builder, mutable rules, or a build function.
6
+ * @param builder - CASL builder that receives authorization rules.
7
+ * @param context - Context used to resolve this operation.
8
+ * @param catalog - User and workspace authorization catalogs.
9
+ * @param catalog.user - Application user roles and permissions.
10
+ * @param catalog.workspace - Workspace roles and permissions.
11
+ * @param configure - Callback that configures the instance before use.
12
+ */
5
13
  export declare function extendAbility(builder: AbilityBuilder<Ability<AbilityTuple, MongoQuery>>, context: AbilityContext, catalog: {
6
14
  user: readonly string[];
7
15
  workspace: readonly string[];
@@ -1,5 +1,13 @@
1
1
  import { entities } from "../entities/index.js";
2
- /** Runs synchronous extensions without exposing the builder, mutable rules, or a build function. */
2
+ /**
3
+ * Runs synchronous extensions without exposing the builder, mutable rules, or a build function.
4
+ * @param builder - CASL builder that receives authorization rules.
5
+ * @param context - Context used to resolve this operation.
6
+ * @param catalog - User and workspace authorization catalogs.
7
+ * @param catalog.user - Application user roles and permissions.
8
+ * @param catalog.workspace - Workspace roles and permissions.
9
+ * @param configure - Callback that configures the instance before use.
10
+ */
3
11
  export function extendAbility(builder, context, catalog, configure) {
4
12
  const restrictions = [];
5
13
  let active = true;
@@ -49,6 +57,16 @@ export function extendAbility(builder, context, catalog, configure) {
49
57
  active = false;
50
58
  }
51
59
  }
60
+ /**
61
+ * Adds an allow or deny rule to the CASL ability builder.
62
+ * @param builder - CASL builder that receives authorization rules.
63
+ * @param rule - CASL rule arguments, including action, subject, fields, and conditions.
64
+ * @param rule."0" - Action or actions matched by the rule.
65
+ * @param rule."1" - Subject or subjects matched by the rule.
66
+ * @param rule."2" - Field selection or conditions for the rule.
67
+ * @param rule."3" - Conditions applied when a field selection is supplied.
68
+ * @param inverted - Whether the rule denies access.
69
+ */
52
70
  function addRule(builder, [action, subject, fieldsOrConditions, conditions], inverted) {
53
71
  const add = inverted ? builder.cannot : builder.can;
54
72
  if (typeof fieldsOrConditions === "string" ||
@@ -59,6 +77,11 @@ function addRule(builder, [action, subject, fieldsOrConditions, conditions], inv
59
77
  add(action, subject, fieldsOrConditions);
60
78
  }
61
79
  }
80
+ /**
81
+ * Returns independent copy of the rule's actions, subjects, fields, and conditions.
82
+ * @param rule - Authorization rule to copy.
83
+ * @returns Independent copy of the rule's actions, subjects, fields, and conditions.
84
+ */
62
85
  function copyRule(rule) {
63
86
  return rule.map((value, index) => index < 2
64
87
  ? Array.isArray(value)
@@ -1 +1 @@
1
- {"version":3,"file":"extend-ability.util.js","sourceRoot":"","sources":["../../src/utils/extend-ability.util.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,oGAAoG;AACpG,MAAM,UAAU,aAAa,CAC3B,OAA0D,EAC1D,OAAuB,EACvB,OAAkE,EAClE,SAA2C;IAE3C,MAAM,YAAY,GAAyC,EAAE,CAAC;IAC9D,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,IAAI,CAAC,MAAM;YACT,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAC1E,CAAC,CAAC;IACF,MAAM,KAAK,GAAiB,MAAM,CAAC,MAAM,CAAC;QACxC,GAAG,CACD,UAA8C,EAC9C,GAAG,IAAwC;YAE3C,YAAY,EAAE,CAAC;YACf,IACE,CAAC,UAAU;gBACX,OAAO,UAAU,KAAK,QAA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3 +1,7 @@
1
1
  import type { Request } from "express";
2
- /** Extracts an API key from a Bearer authorization value. */
2
+ /**
3
+ * Extracts an API key from a Bearer authorization value.
4
+ * @param request - Incoming HTTP request.
5
+ * @returns API key from the request headers, or null if none is present.
6
+ */
3
7
  export declare function extractApiKey(request: null | Request | undefined): null | string;
@@ -1,4 +1,8 @@
1
- /** Extracts an API key from a Bearer authorization value. */
1
+ /**
2
+ * Extracts an API key from a Bearer authorization value.
3
+ * @param request - Incoming HTTP request.
4
+ * @returns API key from the request headers, or null if none is present.
5
+ */
2
6
  export function extractApiKey(request) {
3
7
  if (!request) {
4
8
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"extract-api-key.util.js","sourceRoot":"","sources":["../../src/utils/extract-api-key.util.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,MAAM,UAAU,aAAa,CAC3B,OAAmC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;IAEpD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACtD,IAAI,MAAM,EAAE,WAAW,EAAE,KAAK,QAAQ,IAAI,KAAK,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"extract-api-key.util.js","sourceRoot":"","sources":["../../src/utils/extract-api-key.util.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAmC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC;IAEpD,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACtD,IAAI,MAAM,EAAE,WAAW,EAAE,KAAK,QAAQ,IAAI,KAAK,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -2,5 +2,6 @@ import { AuthAbility } from "../auth.ability.js";
2
2
  /**
3
3
  * Returns the current request's prepared ability or throws ForbiddenException.
4
4
  * Retrieve the instance again after identity changes; do not cache it across requests.
5
+ * @returns Ability stored in the current request context.
5
6
  */
6
7
  export declare function getAuthAbility(): AuthAbility;
@@ -6,6 +6,7 @@ import { getCurrentApiKey } from "./get-current-api-key.util.js";
6
6
  /**
7
7
  * Returns the current request's prepared ability or throws ForbiddenException.
8
8
  * Retrieve the instance again after identity changes; do not cache it across requests.
9
+ * @returns Ability stored in the current request context.
9
10
  */
10
11
  export function getAuthAbility() {
11
12
  if (!RequestContext.isActive() ||
@@ -1 +1 @@
1
- {"version":3,"file":"get-auth-ability.util.js","sourceRoot":"","sources":["../../src/utils/get-auth-ability.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,IACE,CAAC,cAAc,CAAC,QAAQ,EAAE;QAC1B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAElD,MAAM,IAAI,kBAAkB,CAAC,qCAAqC,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,kBAAkB,CAAC,qCAAqC,CAAC,CAAC;IACtE,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"get-auth-ability.util.js","sourceRoot":"","sources":["../../src/utils/get-auth-ability.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,IACE,CAAC,cAAc,CAAC,QAAQ,EAAE;QAC1B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAElD,MAAM,IAAI,kBAAkB,CAAC,qCAAqC,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChD,IAAI,CAAC,OAAO;QACV,MAAM,IAAI,kBAAkB,CAAC,qCAAqC,CAAC,CAAC;IACtE,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,3 +1,7 @@
1
1
  import type { ApiKeyMetadata } from "../types/api-key-metadata.type.js";
2
- /** Returns the current API credential without resolving a database entity. @internal */
2
+ /**
3
+ * Returns the current API credential without resolving a database entity.
4
+ * @returns API key metadata for this request, or null for other authentication methods.
5
+ * @internal
6
+ */
3
7
  export declare function getCurrentApiKey(): ApiKeyMetadata | null;
@@ -1,6 +1,10 @@
1
1
  import { RequestContext } from "@nest-boot/request-context";
2
2
  import { API_KEY } from "../auth.constants.js";
3
- /** Returns the current API credential without resolving a database entity. @internal */
3
+ /**
4
+ * Returns the current API credential without resolving a database entity.
5
+ * @returns API key metadata for this request, or null for other authentication methods.
6
+ * @internal
7
+ */
4
8
  export function getCurrentApiKey() {
5
9
  return RequestContext.isActive()
6
10
  ? (RequestContext.get(API_KEY) ?? null)
@@ -1 +1 @@
1
- {"version":3,"file":"get-current-api-key.util.js","sourceRoot":"","sources":["../../src/utils/get-current-api-key.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,wFAAwF;AACxF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAiB,OAAO,CAAC,IAAI,IAAI,CAAC;QACvD,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"get-current-api-key.util.js","sourceRoot":"","sources":["../../src/utils/get-current-api-key.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAC,QAAQ,EAAE;QAC9B,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAiB,OAAO,CAAC,IAAI,IAAI,CAAC;QACvD,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
@@ -1 +1,5 @@
1
+ /**
2
+ * Returns whether any OIDC environment variable is configured.
3
+ * @returns Whether any OIDC environment variable is configured.
4
+ */
1
5
  export declare function hasOidcEnvConfig(): boolean;
@@ -1,4 +1,8 @@
1
1
  import { OIDC_ENV_NAMES } from "./oidc.constants.js";
2
+ /**
3
+ * Returns whether any OIDC environment variable is configured.
4
+ * @returns Whether any OIDC environment variable is configured.
5
+ */
2
6
  export function hasOidcEnvConfig() {
3
7
  return OIDC_ENV_NAMES.some((name) => process.env[name] !== undefined);
4
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"has-oidc-env-config.js","sourceRoot":"","sources":["../../src/utils/has-oidc-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC;AACxE,CAAC"}
1
+ {"version":3,"file":"has-oidc-env-config.js","sourceRoot":"","sources":["../../src/utils/has-oidc-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC;AACxE,CAAC"}
@@ -1,2 +1,7 @@
1
1
  import { SocialProviderId } from "./social-provider.constants.js";
2
+ /**
3
+ * Returns whether either provider credential is configured in the environment.
4
+ * @param provider - Authentication provider identifier.
5
+ * @returns Whether either provider credential is configured in the environment.
6
+ */
2
7
  export declare function hasSocialProviderCredentialEnvConfig(provider: SocialProviderId): boolean;
@@ -1,4 +1,9 @@
1
1
  import { SOCIAL_PROVIDER_ENV_CONFIGS, } from "./social-provider.constants.js";
2
+ /**
3
+ * Returns whether either provider credential is configured in the environment.
4
+ * @param provider - Authentication provider identifier.
5
+ * @returns Whether either provider credential is configured in the environment.
6
+ */
2
7
  export function hasSocialProviderCredentialEnvConfig(provider) {
3
8
  const config = SOCIAL_PROVIDER_ENV_CONFIGS[provider];
4
9
  return (process.env[config.clientId] !== undefined ||
@@ -1 +1 @@
1
- {"version":3,"file":"has-social-provider-credential-env-config.js","sourceRoot":"","sources":["../../src/utils/has-social-provider-credential-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,GAE5B,MAAM,gCAAgC,CAAC;AAExC,MAAM,UAAU,oCAAoC,CAClD,QAA0B;IAE1B,MAAM,MAAM,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAErD,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS;QAC1C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,SAAS,CAC/C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"has-social-provider-credential-env-config.js","sourceRoot":"","sources":["../../src/utils/has-social-provider-credential-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,GAE5B,MAAM,gCAAgC,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,oCAAoC,CAClD,QAA0B;IAE1B,MAAM,MAAM,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IAErD,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS;QAC1C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,SAAS,CAC/C,CAAC;AACJ,CAAC"}
@@ -1,2 +1,7 @@
1
1
  import { SocialProviderId } from "./social-provider.constants.js";
2
+ /**
3
+ * Returns whether any environment setting exists for the provider.
4
+ * @param provider - Authentication provider identifier.
5
+ * @returns Whether any environment setting exists for the provider.
6
+ */
2
7
  export declare function hasSocialProviderEnvConfig(provider: SocialProviderId): boolean;
@@ -1,4 +1,9 @@
1
1
  import { SOCIAL_PROVIDER_ENV_CONFIGS, } from "./social-provider.constants.js";
2
+ /**
3
+ * Returns whether any environment setting exists for the provider.
4
+ * @param provider - Authentication provider identifier.
5
+ * @returns Whether any environment setting exists for the provider.
6
+ */
2
7
  export function hasSocialProviderEnvConfig(provider) {
3
8
  return SOCIAL_PROVIDER_ENV_CONFIGS[provider].envNames.some((name) => process.env[name] !== undefined);
4
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"has-social-provider-env-config.js","sourceRoot":"","sources":["../../src/utils/has-social-provider-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,GAE5B,MAAM,gCAAgC,CAAC;AAExC,MAAM,UAAU,0BAA0B,CACxC,QAA0B;IAE1B,OAAO,2BAA2B,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,CACxD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAC1C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"has-social-provider-env-config.js","sourceRoot":"","sources":["../../src/utils/has-social-provider-env-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,GAE5B,MAAM,gCAAgC,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAA0B;IAE1B,OAAO,2BAA2B,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,CACxD,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAC1C,CAAC;AACJ,CAAC"}
@@ -1 +1,6 @@
1
+ /**
2
+ * Returns whether the environment variable is exactly the string `true`.
3
+ * @param name - Name used to identify the resource.
4
+ * @returns Whether the environment variable is exactly the string `true`.
5
+ */
1
6
  export declare function isEnvTrue(name: string): boolean;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Returns whether the environment variable is exactly the string `true`.
3
+ * @param name - Name used to identify the resource.
4
+ * @returns Whether the environment variable is exactly the string `true`.
5
+ */
1
6
  export function isEnvTrue(name) {
2
7
  return process.env[name] === "true";
3
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"is-env-true.js","sourceRoot":"","sources":["../../src/utils/is-env-true.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"is-env-true.js","sourceRoot":"","sources":["../../src/utils/is-env-true.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC;AACtC,CAAC"}
@@ -1,2 +1,8 @@
1
- /** Copies public entity fields without credentials or ORM identity-map state. @internal */
1
+ /**
2
+ * Copies public entity fields without credentials or ORM identity-map state.
3
+ * @param entity - Entity being checked by the authorization condition.
4
+ * @param keys - Credential property names to omit.
5
+ * @returns Copy of the entity with the selected credential fields removed.
6
+ * @internal
7
+ */
2
8
  export declare function omitCredentials<Entity extends object, Key extends PropertyKey>(entity: Entity, keys: readonly Key[]): Omit<Entity, Key>;
@@ -1,4 +1,10 @@
1
- /** Copies public entity fields without credentials or ORM identity-map state. @internal */
1
+ /**
2
+ * Copies public entity fields without credentials or ORM identity-map state.
3
+ * @param entity - Entity being checked by the authorization condition.
4
+ * @param keys - Credential property names to omit.
5
+ * @returns Copy of the entity with the selected credential fields removed.
6
+ * @internal
7
+ */
2
8
  export function omitCredentials(entity, keys) {
3
9
  const result = { ...entity };
4
10
  for (const key of keys)
@@ -1 +1 @@
1
- {"version":3,"file":"omit-credentials.util.js","sourceRoot":"","sources":["../../src/utils/omit-credentials.util.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,UAAU,eAAe,CAC7B,MAAc,EACd,IAAoB;IAEpB,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5D,yFAAyF;IACzF,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"omit-credentials.util.js","sourceRoot":"","sources":["../../src/utils/omit-credentials.util.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAc,EACd,IAAoB;IAEpB,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5D,yFAAyF;IACzF,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,9 +1,33 @@
1
1
  import type { AuthModuleOptions } from "../auth-module-options.interface.js";
2
- /** Checks delegation against the shared, credential-limited permission snapshot. @internal */
2
+ /**
3
+ * Checks delegation against the shared, credential-limited permission snapshot.
4
+ * @param options - Authentication module configuration.
5
+ * @param scope - Authorization scope to apply.
6
+ * @param requested - Requested grants to validate.
7
+ * @returns Whether every requested permission falls within the grant ceiling.
8
+ * @internal
9
+ */
3
10
  export declare function canGrantPermissions(options: AuthModuleOptions, scope: "user" | "workspace", requested: readonly string[]): boolean;
4
- /** Rejects delegation outside the caller's effective permission source. @internal */
11
+ /**
12
+ * Rejects delegation outside the caller's effective permission source.
13
+ * @param options - Authentication module configuration.
14
+ * @param scope - Authorization scope to apply.
15
+ * @param requested - Requested grants to validate.
16
+ * @internal
17
+ */
5
18
  export declare function assertCanGrantPermissions(options: AuthModuleOptions, scope: "user" | "workspace", requested: readonly string[]): void;
6
- /** Rejects access to or delegation of keys broader than the authenticating credential. @internal */
19
+ /**
20
+ * Rejects access to or delegation of keys broader than the authenticating credential.
21
+ * @param options - Authentication module configuration.
22
+ * @param requested - Requested grants to validate.
23
+ * @internal
24
+ */
7
25
  export declare function assertApiKeyPermissionCeiling(options: AuthModuleOptions, requested: readonly string[]): void;
8
- /** Shared subset check for configured, owner, and credential permission ceilings. @internal */
26
+ /**
27
+ * Shared subset check for configured, owner, and credential permission ceilings.
28
+ * @param requested - Requested grants to validate.
29
+ * @param allowed - Permissions the caller may grant.
30
+ * @param message - Message to log.
31
+ * @internal
32
+ */
9
33
  export declare function assertPermissionCeiling(requested: readonly string[], allowed: readonly string[], message: string): void;
@@ -1,21 +1,47 @@
1
1
  import { ForbiddenException } from "@nestjs/common";
2
2
  import { resolveRequestPermissions } from "./resolve-request-permissions.util.js";
3
- /** Checks delegation against the shared, credential-limited permission snapshot. @internal */
3
+ /**
4
+ * Checks delegation against the shared, credential-limited permission snapshot.
5
+ * @param options - Authentication module configuration.
6
+ * @param scope - Authorization scope to apply.
7
+ * @param requested - Requested grants to validate.
8
+ * @returns Whether every requested permission falls within the grant ceiling.
9
+ * @internal
10
+ */
4
11
  export function canGrantPermissions(options, scope, requested) {
5
12
  const allowed = new Set(resolveRequestPermissions(options)[scope]);
6
13
  return requested.every((permission) => allowed.has(permission));
7
14
  }
8
- /** Rejects delegation outside the caller's effective permission source. @internal */
15
+ /**
16
+ * Rejects delegation outside the caller's effective permission source.
17
+ * @param options - Authentication module configuration.
18
+ * @param scope - Authorization scope to apply.
19
+ * @param requested - Requested grants to validate.
20
+ * @internal
21
+ */
9
22
  export function assertCanGrantPermissions(options, scope, requested) {
10
23
  assertPermissionCeiling(requested, resolveRequestPermissions(options)[scope], `${scope === "user" ? "User" : "Workspace"} permissions exceed issuer permissions`);
11
24
  }
12
- /** Rejects access to or delegation of keys broader than the authenticating credential. @internal */
25
+ /**
26
+ * Rejects access to or delegation of keys broader than the authenticating credential.
27
+ * @param options - Authentication module configuration.
28
+ * @param requested - Requested grants to validate.
29
+ * @internal
30
+ */
13
31
  export function assertApiKeyPermissionCeiling(options, requested) {
14
32
  const ceiling = resolveRequestPermissions(options).apiKey;
33
+ if (ceiling !== null && !requested.length)
34
+ throw new ForbiddenException("Unrestricted API keys exceed authenticating API key permissions");
15
35
  if (ceiling !== null)
16
36
  assertPermissionCeiling(requested, ceiling, "API key permissions exceed authenticating API key permissions");
17
37
  }
18
- /** Shared subset check for configured, owner, and credential permission ceilings. @internal */
38
+ /**
39
+ * Shared subset check for configured, owner, and credential permission ceilings.
40
+ * @param requested - Requested grants to validate.
41
+ * @param allowed - Permissions the caller may grant.
42
+ * @param message - Message to log.
43
+ * @internal
44
+ */
19
45
  export function assertPermissionCeiling(requested, allowed, message) {
20
46
  const permissions = new Set(allowed);
21
47
  const excessive = requested.filter((permission) => !permissions.has(permission));