better-auth 1.2.4-beta.1 → 1.2.4-beta.12

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 (216) hide show
  1. package/dist/adapters/drizzle-adapter/index.cjs +6 -0
  2. package/dist/adapters/drizzle-adapter/index.d.cts +1 -1
  3. package/dist/adapters/drizzle-adapter/index.d.mts +1 -1
  4. package/dist/adapters/drizzle-adapter/index.d.ts +1 -1
  5. package/dist/adapters/drizzle-adapter/index.mjs +7 -1
  6. package/dist/adapters/kysely-adapter/index.d.cts +1 -1
  7. package/dist/adapters/kysely-adapter/index.d.mts +1 -1
  8. package/dist/adapters/kysely-adapter/index.d.ts +1 -1
  9. package/dist/adapters/memory-adapter/index.d.cts +1 -1
  10. package/dist/adapters/memory-adapter/index.d.mts +1 -1
  11. package/dist/adapters/memory-adapter/index.d.ts +1 -1
  12. package/dist/adapters/mongodb-adapter/index.d.cts +1 -1
  13. package/dist/adapters/mongodb-adapter/index.d.mts +1 -1
  14. package/dist/adapters/mongodb-adapter/index.d.ts +1 -1
  15. package/dist/adapters/prisma-adapter/index.d.cts +1 -1
  16. package/dist/adapters/prisma-adapter/index.d.mts +1 -1
  17. package/dist/adapters/prisma-adapter/index.d.ts +1 -1
  18. package/dist/adapters/test.d.cts +1 -1
  19. package/dist/adapters/test.d.mts +1 -1
  20. package/dist/adapters/test.d.ts +1 -1
  21. package/dist/api/index.cjs +3 -3
  22. package/dist/api/index.d.cts +1 -1
  23. package/dist/api/index.d.mts +1 -1
  24. package/dist/api/index.d.ts +1 -1
  25. package/dist/api/index.mjs +4 -4
  26. package/dist/client/index.cjs +2 -2
  27. package/dist/client/index.d.cts +2 -2
  28. package/dist/client/index.d.mts +2 -2
  29. package/dist/client/index.d.ts +2 -2
  30. package/dist/client/index.mjs +2 -2
  31. package/dist/client/plugins/index.cjs +91 -101
  32. package/dist/client/plugins/index.d.cts +15 -236
  33. package/dist/client/plugins/index.d.mts +15 -236
  34. package/dist/client/plugins/index.d.ts +15 -236
  35. package/dist/client/plugins/index.mjs +92 -102
  36. package/dist/client/react/index.cjs +17 -13
  37. package/dist/client/react/index.d.cts +25 -2
  38. package/dist/client/react/index.d.mts +25 -2
  39. package/dist/client/react/index.d.ts +25 -2
  40. package/dist/client/react/index.mjs +17 -13
  41. package/dist/client/solid/index.cjs +2 -2
  42. package/dist/client/solid/index.d.cts +1 -1
  43. package/dist/client/solid/index.d.mts +1 -1
  44. package/dist/client/solid/index.d.ts +1 -1
  45. package/dist/client/solid/index.mjs +2 -2
  46. package/dist/client/svelte/index.cjs +2 -2
  47. package/dist/client/svelte/index.d.cts +1 -1
  48. package/dist/client/svelte/index.d.mts +1 -1
  49. package/dist/client/svelte/index.d.ts +1 -1
  50. package/dist/client/svelte/index.mjs +2 -2
  51. package/dist/client/vue/index.cjs +2 -2
  52. package/dist/client/vue/index.d.cts +1 -1
  53. package/dist/client/vue/index.d.mts +1 -1
  54. package/dist/client/vue/index.d.ts +1 -1
  55. package/dist/client/vue/index.mjs +2 -2
  56. package/dist/cookies/index.cjs +6 -2
  57. package/dist/cookies/index.d.cts +1 -1
  58. package/dist/cookies/index.d.mts +1 -1
  59. package/dist/cookies/index.d.ts +1 -1
  60. package/dist/cookies/index.mjs +6 -2
  61. package/dist/db/index.cjs +1 -1
  62. package/dist/db/index.d.cts +2 -2
  63. package/dist/db/index.d.mts +2 -2
  64. package/dist/db/index.d.ts +2 -2
  65. package/dist/db/index.mjs +1 -1
  66. package/dist/index.cjs +15 -11
  67. package/dist/index.d.cts +2 -2
  68. package/dist/index.d.mts +2 -2
  69. package/dist/index.d.ts +2 -2
  70. package/dist/index.mjs +16 -12
  71. package/dist/integrations/next-js.cjs +5 -5
  72. package/dist/integrations/next-js.d.cts +1 -1
  73. package/dist/integrations/next-js.d.mts +1 -1
  74. package/dist/integrations/next-js.d.ts +1 -1
  75. package/dist/integrations/next-js.mjs +5 -5
  76. package/dist/integrations/node.d.cts +1 -1
  77. package/dist/integrations/node.d.mts +1 -1
  78. package/dist/integrations/node.d.ts +1 -1
  79. package/dist/integrations/svelte-kit.d.cts +1 -1
  80. package/dist/integrations/svelte-kit.d.mts +1 -1
  81. package/dist/integrations/svelte-kit.d.ts +1 -1
  82. package/dist/oauth2/index.cjs +1 -1
  83. package/dist/oauth2/index.d.cts +2 -2
  84. package/dist/oauth2/index.d.mts +2 -2
  85. package/dist/oauth2/index.d.ts +2 -2
  86. package/dist/oauth2/index.mjs +1 -1
  87. package/dist/plugins/admin/index.cjs +4 -4
  88. package/dist/plugins/admin/index.d.cts +1 -1
  89. package/dist/plugins/admin/index.d.mts +1 -1
  90. package/dist/plugins/admin/index.d.ts +1 -1
  91. package/dist/plugins/admin/index.mjs +4 -4
  92. package/dist/plugins/anonymous/index.cjs +3 -3
  93. package/dist/plugins/anonymous/index.d.cts +1 -1
  94. package/dist/plugins/anonymous/index.d.mts +1 -1
  95. package/dist/plugins/anonymous/index.d.ts +1 -1
  96. package/dist/plugins/anonymous/index.mjs +3 -3
  97. package/dist/plugins/bearer/index.cjs +3 -3
  98. package/dist/plugins/bearer/index.d.cts +1 -1
  99. package/dist/plugins/bearer/index.d.mts +1 -1
  100. package/dist/plugins/bearer/index.d.ts +1 -1
  101. package/dist/plugins/bearer/index.mjs +3 -3
  102. package/dist/plugins/custom-session/index.cjs +3 -3
  103. package/dist/plugins/custom-session/index.d.cts +1 -1
  104. package/dist/plugins/custom-session/index.d.mts +1 -1
  105. package/dist/plugins/custom-session/index.d.ts +1 -1
  106. package/dist/plugins/custom-session/index.mjs +3 -3
  107. package/dist/plugins/email-otp/index.cjs +3 -3
  108. package/dist/plugins/email-otp/index.d.cts +1 -1
  109. package/dist/plugins/email-otp/index.d.mts +1 -1
  110. package/dist/plugins/email-otp/index.d.ts +1 -1
  111. package/dist/plugins/email-otp/index.mjs +3 -3
  112. package/dist/plugins/generic-oauth/index.cjs +3 -3
  113. package/dist/plugins/generic-oauth/index.d.cts +1 -1
  114. package/dist/plugins/generic-oauth/index.d.mts +1 -1
  115. package/dist/plugins/generic-oauth/index.d.ts +1 -1
  116. package/dist/plugins/generic-oauth/index.mjs +3 -3
  117. package/dist/plugins/index.cjs +15 -17
  118. package/dist/plugins/index.d.cts +3 -3
  119. package/dist/plugins/index.d.mts +3 -3
  120. package/dist/plugins/index.d.ts +3 -3
  121. package/dist/plugins/index.mjs +15 -17
  122. package/dist/plugins/jwt/index.cjs +8 -4
  123. package/dist/plugins/jwt/index.d.cts +1 -1
  124. package/dist/plugins/jwt/index.d.mts +1 -1
  125. package/dist/plugins/jwt/index.d.ts +1 -1
  126. package/dist/plugins/jwt/index.mjs +8 -4
  127. package/dist/plugins/magic-link/index.cjs +3 -3
  128. package/dist/plugins/magic-link/index.mjs +3 -3
  129. package/dist/plugins/multi-session/index.cjs +14 -5
  130. package/dist/plugins/multi-session/index.d.cts +1 -1
  131. package/dist/plugins/multi-session/index.d.mts +1 -1
  132. package/dist/plugins/multi-session/index.d.ts +1 -1
  133. package/dist/plugins/multi-session/index.mjs +14 -5
  134. package/dist/plugins/oauth-proxy/index.cjs +3 -3
  135. package/dist/plugins/oauth-proxy/index.d.cts +1 -1
  136. package/dist/plugins/oauth-proxy/index.d.mts +1 -1
  137. package/dist/plugins/oauth-proxy/index.d.ts +1 -1
  138. package/dist/plugins/oauth-proxy/index.mjs +3 -3
  139. package/dist/plugins/oidc-provider/index.cjs +89 -17
  140. package/dist/plugins/oidc-provider/index.d.cts +110 -14
  141. package/dist/plugins/oidc-provider/index.d.mts +110 -14
  142. package/dist/plugins/oidc-provider/index.d.ts +110 -14
  143. package/dist/plugins/oidc-provider/index.mjs +89 -17
  144. package/dist/plugins/one-tap/index.cjs +3 -3
  145. package/dist/plugins/one-tap/index.mjs +3 -3
  146. package/dist/plugins/open-api/index.cjs +3 -3
  147. package/dist/plugins/open-api/index.d.cts +1 -1
  148. package/dist/plugins/open-api/index.d.mts +1 -1
  149. package/dist/plugins/open-api/index.d.ts +1 -1
  150. package/dist/plugins/open-api/index.mjs +3 -3
  151. package/dist/plugins/organization/index.cjs +5 -5
  152. package/dist/plugins/organization/index.d.cts +2 -2
  153. package/dist/plugins/organization/index.d.mts +2 -2
  154. package/dist/plugins/organization/index.d.ts +2 -2
  155. package/dist/plugins/organization/index.mjs +5 -5
  156. package/dist/plugins/passkey/index.cjs +3 -3
  157. package/dist/plugins/passkey/index.d.cts +1 -1
  158. package/dist/plugins/passkey/index.d.mts +1 -1
  159. package/dist/plugins/passkey/index.d.ts +1 -1
  160. package/dist/plugins/passkey/index.mjs +3 -3
  161. package/dist/plugins/phone-number/index.cjs +19 -11
  162. package/dist/plugins/phone-number/index.d.cts +4 -3
  163. package/dist/plugins/phone-number/index.d.mts +4 -3
  164. package/dist/plugins/phone-number/index.d.ts +4 -3
  165. package/dist/plugins/phone-number/index.mjs +19 -11
  166. package/dist/plugins/sso/index.cjs +3 -3
  167. package/dist/plugins/sso/index.d.cts +1 -1
  168. package/dist/plugins/sso/index.d.mts +1 -1
  169. package/dist/plugins/sso/index.d.ts +1 -1
  170. package/dist/plugins/sso/index.mjs +3 -3
  171. package/dist/plugins/two-factor/index.cjs +7 -7
  172. package/dist/plugins/two-factor/index.d.cts +1 -1
  173. package/dist/plugins/two-factor/index.d.mts +1 -1
  174. package/dist/plugins/two-factor/index.d.ts +1 -1
  175. package/dist/plugins/two-factor/index.mjs +7 -7
  176. package/dist/plugins/username/index.cjs +3 -3
  177. package/dist/plugins/username/index.d.cts +1 -1
  178. package/dist/plugins/username/index.d.mts +1 -1
  179. package/dist/plugins/username/index.d.ts +1 -1
  180. package/dist/plugins/username/index.mjs +3 -3
  181. package/dist/shared/{better-auth.B5NYxGA3.mjs → better-auth.67eSHmUo.mjs} +3 -7
  182. package/dist/shared/{better-auth.CMz4USTt.cjs → better-auth.B6Xcg5N5.cjs} +1 -1
  183. package/dist/shared/{better-auth.K251u4eV.mjs → better-auth.BH6IWaNB.mjs} +3 -3
  184. package/dist/shared/{better-auth.DNb3Aogp.cjs → better-auth.BN2jUYPL.cjs} +1 -1
  185. package/dist/shared/{better-auth.F2VsZ04W.d.ts → better-auth.BVojg4kv.d.ts} +1 -1
  186. package/dist/shared/{better-auth.BA2kubRc.d.cts → better-auth.BdjFNTuQ.d.cts} +1 -1
  187. package/dist/shared/{better-auth.D4ignKqt.d.mts → better-auth.BfPbu6oh.d.mts} +1 -1
  188. package/dist/shared/{better-auth.DhfiEsxl.cjs → better-auth.C-R0J0n1.cjs} +15 -1
  189. package/dist/shared/{better-auth.Bd1H94Nk.mjs → better-auth.CABkkSP8.mjs} +1 -1
  190. package/dist/shared/{better-auth.npe3WWSD.mjs → better-auth.CFZLHBFT.mjs} +23 -24
  191. package/dist/shared/{better-auth.GgQnT00n.cjs → better-auth.CHHC_PJT.cjs} +1 -0
  192. package/dist/shared/{better-auth.BI_ldOv7.mjs → better-auth.CHsl8t-G.mjs} +2 -7
  193. package/dist/shared/{better-auth.BAR_8WbD.d.cts → better-auth.CPKTEzG-.d.cts} +3 -2
  194. package/dist/shared/{better-auth.DXbPkpEx.cjs → better-auth.CR_ASYNx.cjs} +3 -3
  195. package/dist/shared/{better-auth.YSKz0i4l.mjs → better-auth.CSVqSIae.mjs} +1 -1
  196. package/dist/shared/{better-auth.Cx-TsLBb.d.mts → better-auth.CVOWGLfd.d.mts} +1 -1
  197. package/dist/shared/{better-auth.CoMXyQ1y.mjs → better-auth.CbXAPXob.mjs} +1 -0
  198. package/dist/shared/{better-auth.imLEY-xr.d.mts → better-auth.Ck0xlDsK.d.mts} +3 -2
  199. package/dist/shared/{better-auth.BS4hQYkx.d.cts → better-auth.Ckf_tP8g.d.mts} +1 -1
  200. package/dist/shared/{better-auth.CqfKuHli.mjs → better-auth.CmplT_y7.mjs} +11 -18
  201. package/dist/shared/{better-auth.BvJDkY_b.cjs → better-auth.Cr6NZZDX.cjs} +11 -18
  202. package/dist/shared/{better-auth.BLtLzuLI.d.cts → better-auth.DIRcdXVm.d.cts} +1 -1
  203. package/dist/shared/{better-auth.DayxQ0AW.d.ts → better-auth.DaeQzncE.d.ts} +1 -1
  204. package/dist/shared/{better-auth.CKg1f8vU.cjs → better-auth.DcpLarbN.cjs} +3 -7
  205. package/dist/shared/{better-auth.purQujiV.d.ts → better-auth.DiHCWsNg.d.ts} +3 -2
  206. package/dist/shared/{better-auth.CwDUoRLB.cjs → better-auth.Dxrp37xO.cjs} +2 -7
  207. package/dist/shared/{better-auth.BzKRBwSF.cjs → better-auth.GVCiTzec.cjs} +23 -24
  208. package/dist/shared/{better-auth.NcLhHEks.mjs → better-auth.VTXNLFMT.mjs} +15 -1
  209. package/dist/shared/{better-auth.BxdddeEs.d.mts → better-auth.Vci2tT86.d.cts} +1 -1
  210. package/dist/shared/{better-auth.977UjO4P.d.ts → better-auth.jVBEmAqh.d.ts} +1 -1
  211. package/dist/social-providers/index.cjs +3 -1
  212. package/dist/social-providers/index.mjs +3 -1
  213. package/dist/types/index.d.cts +4 -3
  214. package/dist/types/index.d.mts +4 -3
  215. package/dist/types/index.d.ts +4 -3
  216. package/package.json +3 -3
@@ -3,7 +3,7 @@
3
3
  const jose = require('jose');
4
4
  const zod = require('zod');
5
5
  const betterCall = require('better-call');
6
- const account = require('../../shared/better-auth.BzKRBwSF.cjs');
6
+ const account = require('../../shared/better-auth.GVCiTzec.cjs');
7
7
  require('../../shared/better-auth.DiSjtgs9.cjs');
8
8
  const base64 = require('@better-auth/utils/base64');
9
9
  require('@better-auth/utils/hmac');
@@ -26,10 +26,10 @@ require('../../shared/better-auth.DdjqxOIu.cjs');
26
26
  require('../../shared/better-auth.C1hdVENX.cjs');
27
27
  require('../../shared/better-auth.ANpbi45u.cjs');
28
28
  require('@better-auth/utils/random');
29
- require('../../shared/better-auth.GgQnT00n.cjs');
29
+ require('../../shared/better-auth.CHHC_PJT.cjs');
30
30
  require('../../shared/better-auth.Bg6iw3ig.cjs');
31
31
  require('../../shared/better-auth.BMYo0QR-.cjs');
32
- require('../../shared/better-auth.DhfiEsxl.cjs');
32
+ require('../../shared/better-auth.C-R0J0n1.cjs');
33
33
  require('jose/errors');
34
34
  require('../../shared/better-auth.D3mtHEZg.cjs');
35
35
  require('@better-auth/utils/binary');
@@ -965,10 +965,33 @@ const oidcProvider = (options) => {
965
965
  {
966
966
  method: "POST",
967
967
  body: zod.z.object({
968
- name: zod.z.string(),
969
- icon: zod.z.string().optional(),
968
+ redirect_uris: zod.z.array(zod.z.string()),
969
+ token_endpoint_auth_method: zod.z.enum(["none", "client_secret_basic", "client_secret_post"]).default("client_secret_basic").optional(),
970
+ grant_types: zod.z.array(
971
+ zod.z.enum([
972
+ "authorization_code",
973
+ "implicit",
974
+ "password",
975
+ "client_credentials",
976
+ "refresh_token",
977
+ "urn:ietf:params:oauth:grant-type:jwt-bearer",
978
+ "urn:ietf:params:oauth:grant-type:saml2-bearer"
979
+ ])
980
+ ).default(["authorization_code"]).optional(),
981
+ response_types: zod.z.array(zod.z.enum(["code", "token"])).default(["code"]).optional(),
982
+ client_name: zod.z.string().optional(),
983
+ client_uri: zod.z.string().optional(),
984
+ logo_uri: zod.z.string().optional(),
985
+ scope: zod.z.string().optional(),
986
+ contacts: zod.z.array(zod.z.string()).optional(),
987
+ tos_uri: zod.z.string().optional(),
988
+ policy_uri: zod.z.string().optional(),
989
+ jwks_uri: zod.z.string().optional(),
990
+ jwks: zod.z.record(zod.z.any()).optional(),
970
991
  metadata: zod.z.record(zod.z.any()).optional(),
971
- redirectURLs: zod.z.array(zod.z.string())
992
+ software_id: zod.z.string().optional(),
993
+ software_version: zod.z.string().optional(),
994
+ software_statement: zod.z.string().optional()
972
995
  })
973
996
  },
974
997
  async (ctx) => {
@@ -976,33 +999,82 @@ const oidcProvider = (options) => {
976
999
  const session = await account.getSessionFromCtx(ctx);
977
1000
  if (!session && !options.allowDynamicClientRegistration) {
978
1001
  throw new betterCall.APIError("UNAUTHORIZED", {
979
- message: "Unauthorized"
1002
+ error: "invalid_token",
1003
+ error_description: "Authentication required for client registration"
980
1004
  });
981
1005
  }
1006
+ if ((!body.grant_types || body.grant_types.includes("authorization_code") || body.grant_types.includes("implicit")) && (!body.redirect_uris || body.redirect_uris.length === 0)) {
1007
+ throw new betterCall.APIError("BAD_REQUEST", {
1008
+ error: "invalid_redirect_uri",
1009
+ error_description: "Redirect URIs are required for authorization_code and implicit grant types"
1010
+ });
1011
+ }
1012
+ if (body.grant_types && body.response_types) {
1013
+ if (body.grant_types.includes("authorization_code") && !body.response_types.includes("code")) {
1014
+ throw new betterCall.APIError("BAD_REQUEST", {
1015
+ error: "invalid_client_metadata",
1016
+ error_description: "When 'authorization_code' grant type is used, 'code' response type must be included"
1017
+ });
1018
+ }
1019
+ if (body.grant_types.includes("implicit") && !body.response_types.includes("token")) {
1020
+ throw new betterCall.APIError("BAD_REQUEST", {
1021
+ error: "invalid_client_metadata",
1022
+ error_description: "When 'implicit' grant type is used, 'token' response type must be included"
1023
+ });
1024
+ }
1025
+ }
982
1026
  const clientId = options.generateClientId?.() || random.generateRandomString(32, "a-z", "A-Z");
983
1027
  const clientSecret = options.generateClientSecret?.() || random.generateRandomString(32, "a-z", "A-Z");
984
- const client = await ctx.context.adapter.create({
1028
+ await ctx.context.adapter.create({
985
1029
  model: modelName.oauthClient,
986
1030
  data: {
987
- name: body.name,
988
- icon: body.icon,
1031
+ name: body.client_name,
1032
+ icon: body.logo_uri,
989
1033
  metadata: body.metadata ? JSON.stringify(body.metadata) : null,
990
1034
  clientId,
991
1035
  clientSecret,
992
- redirectURLs: body.redirectURLs.join(","),
1036
+ redirectURLs: body.redirect_uris.join(","),
993
1037
  type: "web",
994
- authenticationScheme: "client_secret",
1038
+ authenticationScheme: body.token_endpoint_auth_method || "client_secret_basic",
995
1039
  disabled: false,
996
1040
  userId: session?.session.userId,
997
1041
  createdAt: /* @__PURE__ */ new Date(),
998
1042
  updatedAt: /* @__PURE__ */ new Date()
999
1043
  }
1000
1044
  });
1001
- return ctx.json({
1002
- ...client,
1003
- redirectURLs: client.redirectURLs.split(","),
1004
- metadata: client.metadata ? JSON.parse(client.metadata) : null
1005
- });
1045
+ return ctx.json(
1046
+ {
1047
+ client_id: clientId,
1048
+ client_secret: clientSecret,
1049
+ client_id_issued_at: Math.floor(Date.now() / 1e3),
1050
+ client_secret_expires_at: 0,
1051
+ // 0 means it doesn't expire
1052
+ redirect_uris: body.redirect_uris,
1053
+ token_endpoint_auth_method: body.token_endpoint_auth_method || "client_secret_basic",
1054
+ grant_types: body.grant_types || ["authorization_code"],
1055
+ response_types: body.response_types || ["code"],
1056
+ client_name: body.client_name,
1057
+ client_uri: body.client_uri,
1058
+ logo_uri: body.logo_uri,
1059
+ scope: body.scope,
1060
+ contacts: body.contacts,
1061
+ tos_uri: body.tos_uri,
1062
+ policy_uri: body.policy_uri,
1063
+ jwks_uri: body.jwks_uri,
1064
+ jwks: body.jwks,
1065
+ software_id: body.software_id,
1066
+ software_version: body.software_version,
1067
+ software_statement: body.software_statement,
1068
+ metadata: body.metadata
1069
+ },
1070
+ {
1071
+ status: 201,
1072
+ headers: {
1073
+ "Cache-Control": "no-store",
1074
+ Pragma: "no-cache"
1075
+ }
1076
+ }
1077
+ );
1006
1078
  }
1007
1079
  ),
1008
1080
  getOAuthClient: account.createAuthEndpoint(
@@ -757,10 +757,23 @@ declare const oidcProvider: (options: OIDCOptions) => {
757
757
  registerOAuthApplication: {
758
758
  <C extends [{
759
759
  body: {
760
- name: string;
761
- redirectURLs: string[];
760
+ redirect_uris: string[];
762
761
  metadata?: Record<string, any> | undefined;
763
- icon?: string | undefined;
762
+ scope?: string | undefined;
763
+ jwks?: Record<string, any> | undefined;
764
+ jwks_uri?: string | undefined;
765
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
766
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
767
+ response_types?: ("code" | "token")[] | undefined;
768
+ client_name?: string | undefined;
769
+ client_uri?: string | undefined;
770
+ logo_uri?: string | undefined;
771
+ contacts?: string[] | undefined;
772
+ tos_uri?: string | undefined;
773
+ policy_uri?: string | undefined;
774
+ software_id?: string | undefined;
775
+ software_version?: string | undefined;
776
+ software_statement?: string | undefined;
764
777
  };
765
778
  method?: "POST" | undefined;
766
779
  query?: Record<string, any> | undefined;
@@ -777,25 +790,108 @@ declare const oidcProvider: (options: OIDCOptions) => {
777
790
  returnHeaders: true;
778
791
  }] ? {
779
792
  headers: Headers;
780
- response: Client;
781
- } : Client>;
793
+ response: {
794
+ client_id: string;
795
+ client_secret: string;
796
+ client_id_issued_at: number;
797
+ client_secret_expires_at: number;
798
+ redirect_uris: string[];
799
+ token_endpoint_auth_method: "none" | "client_secret_basic" | "client_secret_post";
800
+ grant_types: string[];
801
+ response_types: string[];
802
+ client_name: string | undefined;
803
+ client_uri: string | undefined;
804
+ logo_uri: string | undefined;
805
+ scope: string | undefined;
806
+ contacts: string[] | undefined;
807
+ tos_uri: string | undefined;
808
+ policy_uri: string | undefined;
809
+ jwks_uri: string | undefined;
810
+ jwks: Record<string, any> | undefined;
811
+ software_id: string | undefined;
812
+ software_version: string | undefined;
813
+ software_statement: string | undefined;
814
+ metadata: Record<string, any> | undefined;
815
+ };
816
+ } : {
817
+ client_id: string;
818
+ client_secret: string;
819
+ client_id_issued_at: number;
820
+ client_secret_expires_at: number;
821
+ redirect_uris: string[];
822
+ token_endpoint_auth_method: "none" | "client_secret_basic" | "client_secret_post";
823
+ grant_types: string[];
824
+ response_types: string[];
825
+ client_name: string | undefined;
826
+ client_uri: string | undefined;
827
+ logo_uri: string | undefined;
828
+ scope: string | undefined;
829
+ contacts: string[] | undefined;
830
+ tos_uri: string | undefined;
831
+ policy_uri: string | undefined;
832
+ jwks_uri: string | undefined;
833
+ jwks: Record<string, any> | undefined;
834
+ software_id: string | undefined;
835
+ software_version: string | undefined;
836
+ software_statement: string | undefined;
837
+ metadata: Record<string, any> | undefined;
838
+ }>;
782
839
  options: {
783
840
  method: "POST";
784
841
  body: z.ZodObject<{
785
- name: z.ZodString;
786
- icon: z.ZodOptional<z.ZodString>;
842
+ redirect_uris: z.ZodArray<z.ZodString, "many">;
843
+ token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>>;
844
+ grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["authorization_code", "implicit", "password", "client_credentials", "refresh_token", "urn:ietf:params:oauth:grant-type:jwt-bearer", "urn:ietf:params:oauth:grant-type:saml2-bearer"]>, "many">>>;
845
+ response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["code", "token"]>, "many">>>;
846
+ client_name: z.ZodOptional<z.ZodString>;
847
+ client_uri: z.ZodOptional<z.ZodString>;
848
+ logo_uri: z.ZodOptional<z.ZodString>;
849
+ scope: z.ZodOptional<z.ZodString>;
850
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
851
+ tos_uri: z.ZodOptional<z.ZodString>;
852
+ policy_uri: z.ZodOptional<z.ZodString>;
853
+ jwks_uri: z.ZodOptional<z.ZodString>;
854
+ jwks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
787
855
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
788
- redirectURLs: z.ZodArray<z.ZodString, "many">;
856
+ software_id: z.ZodOptional<z.ZodString>;
857
+ software_version: z.ZodOptional<z.ZodString>;
858
+ software_statement: z.ZodOptional<z.ZodString>;
789
859
  }, "strip", z.ZodTypeAny, {
790
- name: string;
791
- redirectURLs: string[];
860
+ redirect_uris: string[];
792
861
  metadata?: Record<string, any> | undefined;
793
- icon?: string | undefined;
862
+ scope?: string | undefined;
863
+ jwks?: Record<string, any> | undefined;
864
+ jwks_uri?: string | undefined;
865
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
866
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
867
+ response_types?: ("code" | "token")[] | undefined;
868
+ client_name?: string | undefined;
869
+ client_uri?: string | undefined;
870
+ logo_uri?: string | undefined;
871
+ contacts?: string[] | undefined;
872
+ tos_uri?: string | undefined;
873
+ policy_uri?: string | undefined;
874
+ software_id?: string | undefined;
875
+ software_version?: string | undefined;
876
+ software_statement?: string | undefined;
794
877
  }, {
795
- name: string;
796
- redirectURLs: string[];
878
+ redirect_uris: string[];
797
879
  metadata?: Record<string, any> | undefined;
798
- icon?: string | undefined;
880
+ scope?: string | undefined;
881
+ jwks?: Record<string, any> | undefined;
882
+ jwks_uri?: string | undefined;
883
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
884
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
885
+ response_types?: ("code" | "token")[] | undefined;
886
+ client_name?: string | undefined;
887
+ client_uri?: string | undefined;
888
+ logo_uri?: string | undefined;
889
+ contacts?: string[] | undefined;
890
+ tos_uri?: string | undefined;
891
+ policy_uri?: string | undefined;
892
+ software_id?: string | undefined;
893
+ software_version?: string | undefined;
894
+ software_statement?: string | undefined;
799
895
  }>;
800
896
  } & {
801
897
  use: any[];
@@ -757,10 +757,23 @@ declare const oidcProvider: (options: OIDCOptions) => {
757
757
  registerOAuthApplication: {
758
758
  <C extends [{
759
759
  body: {
760
- name: string;
761
- redirectURLs: string[];
760
+ redirect_uris: string[];
762
761
  metadata?: Record<string, any> | undefined;
763
- icon?: string | undefined;
762
+ scope?: string | undefined;
763
+ jwks?: Record<string, any> | undefined;
764
+ jwks_uri?: string | undefined;
765
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
766
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
767
+ response_types?: ("code" | "token")[] | undefined;
768
+ client_name?: string | undefined;
769
+ client_uri?: string | undefined;
770
+ logo_uri?: string | undefined;
771
+ contacts?: string[] | undefined;
772
+ tos_uri?: string | undefined;
773
+ policy_uri?: string | undefined;
774
+ software_id?: string | undefined;
775
+ software_version?: string | undefined;
776
+ software_statement?: string | undefined;
764
777
  };
765
778
  method?: "POST" | undefined;
766
779
  query?: Record<string, any> | undefined;
@@ -777,25 +790,108 @@ declare const oidcProvider: (options: OIDCOptions) => {
777
790
  returnHeaders: true;
778
791
  }] ? {
779
792
  headers: Headers;
780
- response: Client;
781
- } : Client>;
793
+ response: {
794
+ client_id: string;
795
+ client_secret: string;
796
+ client_id_issued_at: number;
797
+ client_secret_expires_at: number;
798
+ redirect_uris: string[];
799
+ token_endpoint_auth_method: "none" | "client_secret_basic" | "client_secret_post";
800
+ grant_types: string[];
801
+ response_types: string[];
802
+ client_name: string | undefined;
803
+ client_uri: string | undefined;
804
+ logo_uri: string | undefined;
805
+ scope: string | undefined;
806
+ contacts: string[] | undefined;
807
+ tos_uri: string | undefined;
808
+ policy_uri: string | undefined;
809
+ jwks_uri: string | undefined;
810
+ jwks: Record<string, any> | undefined;
811
+ software_id: string | undefined;
812
+ software_version: string | undefined;
813
+ software_statement: string | undefined;
814
+ metadata: Record<string, any> | undefined;
815
+ };
816
+ } : {
817
+ client_id: string;
818
+ client_secret: string;
819
+ client_id_issued_at: number;
820
+ client_secret_expires_at: number;
821
+ redirect_uris: string[];
822
+ token_endpoint_auth_method: "none" | "client_secret_basic" | "client_secret_post";
823
+ grant_types: string[];
824
+ response_types: string[];
825
+ client_name: string | undefined;
826
+ client_uri: string | undefined;
827
+ logo_uri: string | undefined;
828
+ scope: string | undefined;
829
+ contacts: string[] | undefined;
830
+ tos_uri: string | undefined;
831
+ policy_uri: string | undefined;
832
+ jwks_uri: string | undefined;
833
+ jwks: Record<string, any> | undefined;
834
+ software_id: string | undefined;
835
+ software_version: string | undefined;
836
+ software_statement: string | undefined;
837
+ metadata: Record<string, any> | undefined;
838
+ }>;
782
839
  options: {
783
840
  method: "POST";
784
841
  body: z.ZodObject<{
785
- name: z.ZodString;
786
- icon: z.ZodOptional<z.ZodString>;
842
+ redirect_uris: z.ZodArray<z.ZodString, "many">;
843
+ token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>>;
844
+ grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["authorization_code", "implicit", "password", "client_credentials", "refresh_token", "urn:ietf:params:oauth:grant-type:jwt-bearer", "urn:ietf:params:oauth:grant-type:saml2-bearer"]>, "many">>>;
845
+ response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["code", "token"]>, "many">>>;
846
+ client_name: z.ZodOptional<z.ZodString>;
847
+ client_uri: z.ZodOptional<z.ZodString>;
848
+ logo_uri: z.ZodOptional<z.ZodString>;
849
+ scope: z.ZodOptional<z.ZodString>;
850
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
851
+ tos_uri: z.ZodOptional<z.ZodString>;
852
+ policy_uri: z.ZodOptional<z.ZodString>;
853
+ jwks_uri: z.ZodOptional<z.ZodString>;
854
+ jwks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
787
855
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
788
- redirectURLs: z.ZodArray<z.ZodString, "many">;
856
+ software_id: z.ZodOptional<z.ZodString>;
857
+ software_version: z.ZodOptional<z.ZodString>;
858
+ software_statement: z.ZodOptional<z.ZodString>;
789
859
  }, "strip", z.ZodTypeAny, {
790
- name: string;
791
- redirectURLs: string[];
860
+ redirect_uris: string[];
792
861
  metadata?: Record<string, any> | undefined;
793
- icon?: string | undefined;
862
+ scope?: string | undefined;
863
+ jwks?: Record<string, any> | undefined;
864
+ jwks_uri?: string | undefined;
865
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
866
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
867
+ response_types?: ("code" | "token")[] | undefined;
868
+ client_name?: string | undefined;
869
+ client_uri?: string | undefined;
870
+ logo_uri?: string | undefined;
871
+ contacts?: string[] | undefined;
872
+ tos_uri?: string | undefined;
873
+ policy_uri?: string | undefined;
874
+ software_id?: string | undefined;
875
+ software_version?: string | undefined;
876
+ software_statement?: string | undefined;
794
877
  }, {
795
- name: string;
796
- redirectURLs: string[];
878
+ redirect_uris: string[];
797
879
  metadata?: Record<string, any> | undefined;
798
- icon?: string | undefined;
880
+ scope?: string | undefined;
881
+ jwks?: Record<string, any> | undefined;
882
+ jwks_uri?: string | undefined;
883
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
884
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
885
+ response_types?: ("code" | "token")[] | undefined;
886
+ client_name?: string | undefined;
887
+ client_uri?: string | undefined;
888
+ logo_uri?: string | undefined;
889
+ contacts?: string[] | undefined;
890
+ tos_uri?: string | undefined;
891
+ policy_uri?: string | undefined;
892
+ software_id?: string | undefined;
893
+ software_version?: string | undefined;
894
+ software_statement?: string | undefined;
799
895
  }>;
800
896
  } & {
801
897
  use: any[];
@@ -757,10 +757,23 @@ declare const oidcProvider: (options: OIDCOptions) => {
757
757
  registerOAuthApplication: {
758
758
  <C extends [{
759
759
  body: {
760
- name: string;
761
- redirectURLs: string[];
760
+ redirect_uris: string[];
762
761
  metadata?: Record<string, any> | undefined;
763
- icon?: string | undefined;
762
+ scope?: string | undefined;
763
+ jwks?: Record<string, any> | undefined;
764
+ jwks_uri?: string | undefined;
765
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
766
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
767
+ response_types?: ("code" | "token")[] | undefined;
768
+ client_name?: string | undefined;
769
+ client_uri?: string | undefined;
770
+ logo_uri?: string | undefined;
771
+ contacts?: string[] | undefined;
772
+ tos_uri?: string | undefined;
773
+ policy_uri?: string | undefined;
774
+ software_id?: string | undefined;
775
+ software_version?: string | undefined;
776
+ software_statement?: string | undefined;
764
777
  };
765
778
  method?: "POST" | undefined;
766
779
  query?: Record<string, any> | undefined;
@@ -777,25 +790,108 @@ declare const oidcProvider: (options: OIDCOptions) => {
777
790
  returnHeaders: true;
778
791
  }] ? {
779
792
  headers: Headers;
780
- response: Client;
781
- } : Client>;
793
+ response: {
794
+ client_id: string;
795
+ client_secret: string;
796
+ client_id_issued_at: number;
797
+ client_secret_expires_at: number;
798
+ redirect_uris: string[];
799
+ token_endpoint_auth_method: "none" | "client_secret_basic" | "client_secret_post";
800
+ grant_types: string[];
801
+ response_types: string[];
802
+ client_name: string | undefined;
803
+ client_uri: string | undefined;
804
+ logo_uri: string | undefined;
805
+ scope: string | undefined;
806
+ contacts: string[] | undefined;
807
+ tos_uri: string | undefined;
808
+ policy_uri: string | undefined;
809
+ jwks_uri: string | undefined;
810
+ jwks: Record<string, any> | undefined;
811
+ software_id: string | undefined;
812
+ software_version: string | undefined;
813
+ software_statement: string | undefined;
814
+ metadata: Record<string, any> | undefined;
815
+ };
816
+ } : {
817
+ client_id: string;
818
+ client_secret: string;
819
+ client_id_issued_at: number;
820
+ client_secret_expires_at: number;
821
+ redirect_uris: string[];
822
+ token_endpoint_auth_method: "none" | "client_secret_basic" | "client_secret_post";
823
+ grant_types: string[];
824
+ response_types: string[];
825
+ client_name: string | undefined;
826
+ client_uri: string | undefined;
827
+ logo_uri: string | undefined;
828
+ scope: string | undefined;
829
+ contacts: string[] | undefined;
830
+ tos_uri: string | undefined;
831
+ policy_uri: string | undefined;
832
+ jwks_uri: string | undefined;
833
+ jwks: Record<string, any> | undefined;
834
+ software_id: string | undefined;
835
+ software_version: string | undefined;
836
+ software_statement: string | undefined;
837
+ metadata: Record<string, any> | undefined;
838
+ }>;
782
839
  options: {
783
840
  method: "POST";
784
841
  body: z.ZodObject<{
785
- name: z.ZodString;
786
- icon: z.ZodOptional<z.ZodString>;
842
+ redirect_uris: z.ZodArray<z.ZodString, "many">;
843
+ token_endpoint_auth_method: z.ZodOptional<z.ZodDefault<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>>;
844
+ grant_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["authorization_code", "implicit", "password", "client_credentials", "refresh_token", "urn:ietf:params:oauth:grant-type:jwt-bearer", "urn:ietf:params:oauth:grant-type:saml2-bearer"]>, "many">>>;
845
+ response_types: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<["code", "token"]>, "many">>>;
846
+ client_name: z.ZodOptional<z.ZodString>;
847
+ client_uri: z.ZodOptional<z.ZodString>;
848
+ logo_uri: z.ZodOptional<z.ZodString>;
849
+ scope: z.ZodOptional<z.ZodString>;
850
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
851
+ tos_uri: z.ZodOptional<z.ZodString>;
852
+ policy_uri: z.ZodOptional<z.ZodString>;
853
+ jwks_uri: z.ZodOptional<z.ZodString>;
854
+ jwks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
787
855
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
788
- redirectURLs: z.ZodArray<z.ZodString, "many">;
856
+ software_id: z.ZodOptional<z.ZodString>;
857
+ software_version: z.ZodOptional<z.ZodString>;
858
+ software_statement: z.ZodOptional<z.ZodString>;
789
859
  }, "strip", z.ZodTypeAny, {
790
- name: string;
791
- redirectURLs: string[];
860
+ redirect_uris: string[];
792
861
  metadata?: Record<string, any> | undefined;
793
- icon?: string | undefined;
862
+ scope?: string | undefined;
863
+ jwks?: Record<string, any> | undefined;
864
+ jwks_uri?: string | undefined;
865
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
866
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
867
+ response_types?: ("code" | "token")[] | undefined;
868
+ client_name?: string | undefined;
869
+ client_uri?: string | undefined;
870
+ logo_uri?: string | undefined;
871
+ contacts?: string[] | undefined;
872
+ tos_uri?: string | undefined;
873
+ policy_uri?: string | undefined;
874
+ software_id?: string | undefined;
875
+ software_version?: string | undefined;
876
+ software_statement?: string | undefined;
794
877
  }, {
795
- name: string;
796
- redirectURLs: string[];
878
+ redirect_uris: string[];
797
879
  metadata?: Record<string, any> | undefined;
798
- icon?: string | undefined;
880
+ scope?: string | undefined;
881
+ jwks?: Record<string, any> | undefined;
882
+ jwks_uri?: string | undefined;
883
+ token_endpoint_auth_method?: "none" | "client_secret_basic" | "client_secret_post" | undefined;
884
+ grant_types?: ("password" | "refresh_token" | "authorization_code" | "implicit" | "client_credentials" | "urn:ietf:params:oauth:grant-type:jwt-bearer" | "urn:ietf:params:oauth:grant-type:saml2-bearer")[] | undefined;
885
+ response_types?: ("code" | "token")[] | undefined;
886
+ client_name?: string | undefined;
887
+ client_uri?: string | undefined;
888
+ logo_uri?: string | undefined;
889
+ contacts?: string[] | undefined;
890
+ tos_uri?: string | undefined;
891
+ policy_uri?: string | undefined;
892
+ software_id?: string | undefined;
893
+ software_version?: string | undefined;
894
+ software_statement?: string | undefined;
799
895
  }>;
800
896
  } & {
801
897
  use: any[];