@aura-stack/auth 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/@types/index.cjs +1 -0
  2. package/dist/@types/index.d.ts +2 -2
  3. package/dist/@types/index.js +1 -0
  4. package/dist/{assert-hDwQ_SPO.cjs → assert-DaZSf4SH.cjs} +1 -1
  5. package/dist/{assert-_fBNnaOk.js → assert-av6s0a6t.js} +1 -1
  6. package/dist/client/index.cjs +1 -1
  7. package/dist/client/index.d.ts +1 -1
  8. package/dist/client/index.js +1 -1
  9. package/dist/{crypto-D6_SoGMH.cjs → crypto-BF4ETYC9.cjs} +1 -1
  10. package/dist/{crypto-DyrRzBSQ.js → crypto-D6aq4c8x.js} +1 -1
  11. package/dist/identity-n3aahaEr.cjs +1 -0
  12. package/dist/{index-C9U6ICDT.d.ts → index-1ADcIVGC.d.ts} +229 -279
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +1 -1
  16. package/dist/{logger-DjXkgSn5.js → logger-BfUjjtxf.js} +1 -1
  17. package/dist/{logger-G5PinyEc.cjs → logger-CVwkloPj.cjs} +1 -1
  18. package/dist/oauth/atlassian.d.ts +1 -1
  19. package/dist/oauth/bitbucket.d.ts +1 -1
  20. package/dist/oauth/click-up.d.ts +1 -1
  21. package/dist/oauth/discord.d.ts +1 -1
  22. package/dist/oauth/dribbble.d.ts +1 -1
  23. package/dist/oauth/dropbox.d.ts +1 -1
  24. package/dist/oauth/figma.d.ts +1 -1
  25. package/dist/oauth/github.d.ts +1 -1
  26. package/dist/oauth/gitlab.d.ts +1 -1
  27. package/dist/oauth/index.cjs +1 -1
  28. package/dist/oauth/index.d.ts +1 -1
  29. package/dist/oauth/index.js +1 -1
  30. package/dist/oauth/mailchimp.d.ts +1 -1
  31. package/dist/oauth/notion.cjs +1 -1
  32. package/dist/oauth/notion.d.ts +1 -1
  33. package/dist/oauth/notion.js +1 -1
  34. package/dist/oauth/pinterest.d.ts +1 -1
  35. package/dist/oauth/spotify.d.ts +1 -1
  36. package/dist/oauth/strava.d.ts +1 -1
  37. package/dist/oauth/twitch.cjs +1 -1
  38. package/dist/oauth/twitch.d.ts +1 -1
  39. package/dist/oauth/twitch.js +1 -1
  40. package/dist/oauth/x.d.ts +1 -1
  41. package/dist/shared/cookies.cjs +1 -0
  42. package/dist/shared/cookies.d.ts +1 -0
  43. package/dist/shared/cookies.js +1 -0
  44. package/dist/shared/crypto.cjs +1 -1
  45. package/dist/shared/crypto.d.ts +1 -1
  46. package/dist/shared/crypto.js +1 -1
  47. package/dist/shared/identity.cjs +1 -1
  48. package/dist/shared/identity.d.ts +1 -1
  49. package/dist/shared/identity.js +1 -1
  50. package/dist/shared/index.cjs +1 -1
  51. package/dist/shared/index.d.ts +1 -1
  52. package/dist/shared/index.js +1 -1
  53. package/package.json +26 -7
  54. package/dist/identity-b8FCr0Oa.cjs +0 -1
  55. package/dist/oauth-D3_mnBOx.js +0 -1
  56. package/dist/oauth-gPiWxjBd.cjs +0 -1
  57. /package/dist/{env-CJtSi1eX.js → env-BG1x-kSX.js} +0 -0
  58. /package/dist/{env-7as-tgzO.cjs → env-BhQ2k7jj.cjs} +0 -0
@@ -1,2 +1,2 @@
1
- import { Q as InferZodShape, W as EditableShape, X as InferSession, Y as FromShapeToObject, Z as InferUser, _r as UserShape, at as ValibotShapeToObject, br as UserShapeValibot, cr as Identities, dr as IsZod, fr as SchemaTypes, gr as UserIdentityValibot, hr as UserIdentityTypeBox, it as UserFrom, lr as IsArkType, mr as UserIdentityArkType, nt as SessionFrom, pr as UserIdentity, rt as TypeboxShapeToObject, st as ZodShapeToObject, ur as IsValibot, vr as UserShapeArkType, xr as createIdentity, yr as UserShapeTypeBox, z as ArktypeShapeToObject } from "../index-C9U6ICDT.js";
1
+ import { $ as FromShapeToObject, Cr as UserShapeArkType, Er as createIdentity, H as ArktypeShapeToObject, Sr as UserShape, Tr as UserShapeValibot, _r as SchemaTypes, br as UserIdentityTypeBox, ct as TypeboxShapeToObject, et as InferSession, ft as ZodShapeToObject, gr as IsZod, hr as IsValibot, lt as UserFrom, mr as IsArkType, nt as InferZodShape, pr as Identities, q as EditableShape, st as SessionFrom, tt as InferUser, ut as ValibotShapeToObject, vr as UserIdentity, wr as UserShapeTypeBox, xr as UserIdentityValibot, yr as UserIdentityArkType } from "../index-1ADcIVGC.js";
2
2
  export { ArktypeShapeToObject, EditableShape, FromShapeToObject, Identities, InferSession, InferUser, InferZodShape, IsArkType, IsValibot, IsZod, SchemaTypes, SessionFrom, TypeboxShapeToObject, UserFrom, UserIdentity, UserIdentityArkType, UserIdentityTypeBox, UserIdentityValibot, UserShape, UserShapeArkType, UserShapeTypeBox, UserShapeValibot, ValibotShapeToObject, ZodShapeToObject, createIdentity };
@@ -1 +1 @@
1
- import{g as e,h as t,t as n,y as r}from"../assert-_fBNnaOk.js";import{z as i}from"zod/v4";import*as a from"valibot";import{type as o}from"arktype";import{Type as s}from"typebox";const c=i.object({sub:i.string(),name:i.string().nullable().optional(),image:i.string().nullable().optional(),email:i.email().nullable().optional()}),l=a.object({sub:a.string(),name:a.optional(a.nullable(a.string())),image:a.optional(a.nullable(a.string())),email:a.optional(a.nullable(a.pipe(a.string(),a.email())))}),u=o({sub:`string`,name:`string | null?`,image:`string | null?`,email:`string.email | null?`}),d=s.Object({sub:s.String(),name:s.Optional(s.Union([s.String(),s.Null()])),image:s.Optional(s.Union([s.String(),s.Null()])),email:s.Optional(s.Union([s.String({format:`email`}),s.Null()]))}),f=o=>n(o)?o:e(o)?a.object(o):r(o)?i.object(o):t(o)?s.Object(o):i.object(o);export{c as UserIdentity,u as UserIdentityArkType,d as UserIdentityTypeBox,l as UserIdentityValibot,f as createIdentity};
1
+ import{g as e,h as t,t as n,y as r}from"../assert-av6s0a6t.js";import{z as i}from"zod/v4";import{type as a}from"arktype";import{Type as o}from"typebox";import*as s from"valibot";const c=i.object({sub:i.string(),name:i.string().nullable().optional(),image:i.string().nullable().optional(),email:i.email().nullable().optional()}),l=s.object({sub:s.string(),name:s.optional(s.nullable(s.string())),image:s.optional(s.nullable(s.string())),email:s.optional(s.nullable(s.pipe(s.string(),s.email())))}),u=a({sub:`string`,name:`string | null?`,image:`string | null?`,email:`string.email | null?`}),d=o.Object({sub:o.String(),name:o.Optional(o.Union([o.String(),o.Null()])),image:o.Optional(o.Union([o.String(),o.Null()])),email:o.Optional(o.Union([o.String({format:`email`}),o.Null()]))}),f=a=>n(a)?a:e(a)?s.object(a):r(a)?i.object(a):t(a)?o.Object(a):i.object(a);export{c as UserIdentity,u as UserIdentityArkType,d as UserIdentityTypeBox,l as UserIdentityValibot,f as createIdentity};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../assert-hDwQ_SPO.cjs`),t=require(`../logger-G5PinyEc.cjs`);exports.createBasicAuthHeader=e.S,exports.createSyslogMessage=t.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../assert-DaZSf4SH.cjs`),t=require(`../logger-CVwkloPj.cjs`);exports.createBasicAuthHeader=e.S,exports.createSyslogMessage=t.n;
@@ -1,4 +1,4 @@
1
- import { sr as createSyslogMessage } from "../index-C9U6ICDT.js";
1
+ import { fr as createSyslogMessage } from "../index-1ADcIVGC.js";
2
2
  //#region src/shared/utils.d.ts
3
3
  declare const createBasicAuthHeader: (username: string, password: string) => string;
4
4
  //#endregion
@@ -1 +1 @@
1
- import{S as e}from"../assert-_fBNnaOk.js";import{n as t}from"../logger-DjXkgSn5.js";export{e as createBasicAuthHeader,t as createSyslogMessage};
1
+ import{S as e}from"../assert-av6s0a6t.js";import{n as t}from"../logger-BfUjjtxf.js";export{e as createBasicAuthHeader,t as createSyslogMessage};
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@aura-stack/auth",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "private": false,
5
5
  "type": "module",
6
- "description": "Core auth for @aura-stack/auth",
6
+ "description": "Open-source authentication and authorization library for modern TypeScript and JavaScript applications. Framework-agnostic, runtime-agnostic and built on web standards.",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/aura-stack-ts/auth"
@@ -56,12 +56,31 @@
56
56
  "types": "./dist/shared/index.d.ts",
57
57
  "import": "./dist/shared/index.js",
58
58
  "require": "./dist/shared/index.cjs"
59
+ },
60
+ "./cookies": {
61
+ "types": "./dist/shared/cookies.d.ts",
62
+ "import": "./dist/shared/cookies.js",
63
+ "require": "./dist/shared/cookies.cjs"
59
64
  }
60
65
  },
61
66
  "keywords": [
62
67
  "auth",
68
+ "oauth",
69
+ "oauth2",
70
+ "security",
63
71
  "session",
64
- "authentication"
72
+ "authentication",
73
+ "authorization",
74
+ "typescript",
75
+ "javascript",
76
+ "node",
77
+ "bun",
78
+ "deno",
79
+ "edge",
80
+ "aura-stack",
81
+ "aura-stack-ts",
82
+ "aura auth",
83
+ "aura-auth"
65
84
  ],
66
85
  "author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
67
86
  "homepage": "https://aura-stack-auth.vercel.app",
@@ -70,7 +89,7 @@
70
89
  },
71
90
  "license": "MIT",
72
91
  "dependencies": {
73
- "@aura-stack/router": "^0.7.0",
92
+ "@aura-stack/router": "^0.7.2",
74
93
  "arktype": "^2.2.0",
75
94
  "typebox": "^1.1.38",
76
95
  "valibot": "^1.4.0",
@@ -80,8 +99,8 @@
80
99
  "devDependencies": {
81
100
  "typescript": "^5.9.2",
82
101
  "vitest": "4.1.4",
83
- "@aura-stack/tsdown-config": "0.0.0",
84
- "@aura-stack/tsconfig": "0.0.0"
102
+ "@aura-stack/tsconfig": "0.0.0",
103
+ "@aura-stack/tsdown-config": "0.0.0"
85
104
  },
86
105
  "scripts": {
87
106
  "dev": "tsdown --watch",
@@ -95,6 +114,6 @@
95
114
  "format:check": "oxfmt --check",
96
115
  "type-check": "tsc --noEmit",
97
116
  "clean": "rm -rf dist",
98
- "clean:cts": "find dist -type f -name \"*.cts\" -delete"
117
+ "clean:cts": "[ -d dist ] && find dist -type f -name \"*.cts\" -delete || true"
99
118
  }
100
119
  }
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require(`./assert-hDwQ_SPO.cjs`);let l=require(`zod/v4`),u=require(`valibot`);u=s(u,1);let d=require(`arktype`),f=require(`typebox`);const p=l.z.object({sub:l.z.string(),name:l.z.string().nullable().optional(),image:l.z.string().nullable().optional(),email:l.z.email().nullable().optional()}),m=u.object({sub:u.string(),name:u.optional(u.nullable(u.string())),image:u.optional(u.nullable(u.string())),email:u.optional(u.nullable(u.pipe(u.string(),u.email())))}),h=(0,d.type)({sub:`string`,name:`string | null?`,image:`string | null?`,email:`string.email | null?`}),g=f.Type.Object({sub:f.Type.String(),name:f.Type.Optional(f.Type.Union([f.Type.String(),f.Type.Null()])),image:f.Type.Optional(f.Type.Union([f.Type.String(),f.Type.Null()])),email:f.Type.Optional(f.Type.Union([f.Type.String({format:`email`}),f.Type.Null()]))}),_=e=>c.t(e)?e:c.g(e)?u.object(e):c.y(e)?l.z.object(e):c.h(e)?f.Type.Object(e):l.z.object(e);Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
@@ -1 +0,0 @@
1
- import{n as e}from"./errors-Czt_w1t_.js";import{n as t}from"./env-CJtSi1eX.js";import{T as n}from"./assert-_fBNnaOk.js";import{github as r}from"./oauth/github.js";import{bitbucket as i}from"./oauth/bitbucket.js";import{figma as a}from"./oauth/figma.js";import{discord as o}from"./oauth/discord.js";import{gitlab as s}from"./oauth/gitlab.js";import{spotify as c}from"./oauth/spotify.js";import{x as l}from"./oauth/x.js";import{strava as u}from"./oauth/strava.js";import{mailchimp as d}from"./oauth/mailchimp.js";import{pinterest as f}from"./oauth/pinterest.js";import{twitch as p}from"./oauth/twitch.js";import{notion as m}from"./oauth/notion.js";import{dropbox as h}from"./oauth/dropbox.js";import{atlassian as g}from"./oauth/atlassian.js";import{clickUp as _}from"./oauth/click-up.js";import{dribbble as v}from"./oauth/dribbble.js";import{array as y,enum as b,null as x,number as S,object as C,string as w,union as T,z as E}from"zod/v4";const D=E.union([w().url(),C({url:w().url(),params:C({owner:w().optional(),responseType:b([`code`,`token`,`id_token`,`refresh_token`]).optional(),scope:w().optional()})})]),O=E.union([w().url(),C({url:w().url(),headers:E.record(w(),w()).optional()})]),k=E.union([w().url(),C({url:w().url(),headers:E.record(w(),w()).optional(),method:w().optional()})]),A=C({id:w(),name:w(),authorize:D.optional(),authorizeURL:w().url().optional(),accessToken:O,scope:w().optional(),userInfo:k,responseType:b([`code`,`token`,`id_token`,`refresh_token`]).optional(),clientId:w(),clientSecret:w(),profile:E.function().optional()}),j=C({authorize:D.optional(),authorizeURL:w().url().optional(),accessToken:O,scope:w().optional(),userInfo:k,responseType:b([`code`,`token`,`id_token`,`refresh_token`]).optional(),clientId:w(),clientSecret:w()}),M=j.extend({redirectURI:w(),state:w(),codeChallenge:w(),codeChallengeMethod:b([`plain`,`S256`])});C({state:w({message:`Missing state parameter in the OAuth authorization response.`}),code:w({message:`Missing code parameter in the OAuth authorization response.`})});const N=C({error:b([`invalid_request`,`unauthorized_client`,`access_denied`,`unsupported_response_type`,`invalid_scope`,`server_error`,`temporarily_unavailable`]),error_description:w().optional(),error_uri:w().optional(),state:w()});j.extend({redirectURI:w(),code:w(),codeVerifier:w().min(43).max(128)});const P=C({access_token:w(),token_type:w().optional(),expires_in:S().optional(),refresh_token:w().optional(),scope:T([w().optional().or(x()),y(w()).optional()])}),F=C({error:b([`invalid_request`,`invalid_client`,`invalid_grant`,`unauthorized_client`,`unsupported_grant_type`,`invalid_scope`]),error_description:w().optional(),error_uri:w().optional()}),I=C({error:w(),error_description:w().optional()}),L=C({clientId:E.string().min(1,`OAuth Client ID is required in the environment variables.`),clientSecret:E.string().min(1,`OAuth Client Secret is required in the environment variables.`)}),R={github:r,bitbucket:i,figma:a,discord:o,gitlab:s,spotify:c,x:l,strava:u,mailchimp:d,pinterest:f,twitch:p,notion:m,dropbox:h,atlassian:g,clickUp:_,dribbble:v},z=r=>{let i=L.safeParse({clientId:t(`${r.replace(`-`,`_`).toUpperCase()}_CLIENT_ID`),clientSecret:t(`${r.replace(`-`,`_`).toUpperCase()}_CLIENT_SECRET`)});if(!i.success)throw new e(`INVALID_ENVIRONMENT_CONFIGURATION`,JSON.stringify({[r]:n(i.error)},null,2));return i.data},B=t=>{if(typeof t==`string`){let r=z(t),i=R[t](),a=A.safeParse({...i,...r});if(!a.success)throw new e(`INVALID_OAUTH_PROVIDER_CONFIGURATION`,`Invalid configuration for OAuth provider "${t}": ${JSON.stringify({[t]:n(a.error)},null,2)}`);return a.data}let r=t.clientId&&t.clientSecret?{}:z(t.id),i=A.safeParse({...r,...t});if(!i.success){let r=JSON.stringify({[t.id]:n(i.error)},null,2);throw new e(`INVALID_OAUTH_PROVIDER_CONFIGURATION`,`Invalid configuration for OAuth provider "${t.id}": ${r}`)}return i.data},V=(t=[])=>t.reduce((t,n)=>{let r=B(n);if(r.id in t)throw new e(`DUPLICATED_OAUTH_PROVIDER_ID`,`Duplicate OAuth provider id "${r.id}" found. Each provider must have a unique id.`);return{...t,[r.id]:r}},{});export{M as a,P as i,V as n,N as o,F as r,I as s,R as t};
@@ -1 +0,0 @@
1
- require(`./identity-b8FCr0Oa.cjs`);const e=require(`./errors-DcK2ELlk.cjs`),t=require(`./env-7as-tgzO.cjs`),n=require(`./assert-hDwQ_SPO.cjs`),r=require(`./oauth/github.cjs`),i=require(`./oauth/bitbucket.cjs`),a=require(`./oauth/figma.cjs`),o=require(`./oauth/discord.cjs`),s=require(`./oauth/gitlab.cjs`),c=require(`./oauth/spotify.cjs`),l=require(`./oauth/x.cjs`),u=require(`./oauth/strava.cjs`),d=require(`./oauth/mailchimp.cjs`),f=require(`./oauth/pinterest.cjs`),p=require(`./oauth/twitch.cjs`),m=require(`./oauth/notion.cjs`),h=require(`./oauth/dropbox.cjs`),g=require(`./oauth/atlassian.cjs`),_=require(`./oauth/click-up.cjs`),v=require(`./oauth/dribbble.cjs`);let y=require(`zod/v4`);const b=y.z.union([(0,y.string)().url(),(0,y.object)({url:(0,y.string)().url(),params:(0,y.object)({owner:(0,y.string)().optional(),responseType:(0,y.enum)([`code`,`token`,`id_token`,`refresh_token`]).optional(),scope:(0,y.string)().optional()})})]),x=y.z.union([(0,y.string)().url(),(0,y.object)({url:(0,y.string)().url(),headers:y.z.record((0,y.string)(),(0,y.string)()).optional()})]),S=y.z.union([(0,y.string)().url(),(0,y.object)({url:(0,y.string)().url(),headers:y.z.record((0,y.string)(),(0,y.string)()).optional(),method:(0,y.string)().optional()})]),C=(0,y.object)({id:(0,y.string)(),name:(0,y.string)(),authorize:b.optional(),authorizeURL:(0,y.string)().url().optional(),accessToken:x,scope:(0,y.string)().optional(),userInfo:S,responseType:(0,y.enum)([`code`,`token`,`id_token`,`refresh_token`]).optional(),clientId:(0,y.string)(),clientSecret:(0,y.string)(),profile:y.z.function().optional()}),w=(0,y.object)({authorize:b.optional(),authorizeURL:(0,y.string)().url().optional(),accessToken:x,scope:(0,y.string)().optional(),userInfo:S,responseType:(0,y.enum)([`code`,`token`,`id_token`,`refresh_token`]).optional(),clientId:(0,y.string)(),clientSecret:(0,y.string)()}),T=w.extend({redirectURI:(0,y.string)(),state:(0,y.string)(),codeChallenge:(0,y.string)(),codeChallengeMethod:(0,y.enum)([`plain`,`S256`])});(0,y.object)({state:(0,y.string)({message:`Missing state parameter in the OAuth authorization response.`}),code:(0,y.string)({message:`Missing code parameter in the OAuth authorization response.`})});const E=(0,y.object)({error:(0,y.enum)([`invalid_request`,`unauthorized_client`,`access_denied`,`unsupported_response_type`,`invalid_scope`,`server_error`,`temporarily_unavailable`]),error_description:(0,y.string)().optional(),error_uri:(0,y.string)().optional(),state:(0,y.string)()});w.extend({redirectURI:(0,y.string)(),code:(0,y.string)(),codeVerifier:(0,y.string)().min(43).max(128)});const D=(0,y.object)({access_token:(0,y.string)(),token_type:(0,y.string)().optional(),expires_in:(0,y.number)().optional(),refresh_token:(0,y.string)().optional(),scope:(0,y.union)([(0,y.string)().optional().or((0,y.null)()),(0,y.array)((0,y.string)()).optional()])}),O=(0,y.object)({error:(0,y.enum)([`invalid_request`,`invalid_client`,`invalid_grant`,`unauthorized_client`,`unsupported_grant_type`,`invalid_scope`]),error_description:(0,y.string)().optional(),error_uri:(0,y.string)().optional()}),k=(0,y.object)({error:(0,y.string)(),error_description:(0,y.string)().optional()}),A=(0,y.object)({clientId:y.z.string().min(1,`OAuth Client ID is required in the environment variables.`),clientSecret:y.z.string().min(1,`OAuth Client Secret is required in the environment variables.`)}),j={github:r.github,bitbucket:i.bitbucket,figma:a.figma,discord:o.discord,gitlab:s.gitlab,spotify:c.spotify,x:l.x,strava:u.strava,mailchimp:d.mailchimp,pinterest:f.pinterest,twitch:p.twitch,notion:m.notion,dropbox:h.dropbox,atlassian:g.atlassian,clickUp:_.clickUp,dribbble:v.dribbble},M=r=>{let i=A.safeParse({clientId:t.n(`${r.replace(`-`,`_`).toUpperCase()}_CLIENT_ID`),clientSecret:t.n(`${r.replace(`-`,`_`).toUpperCase()}_CLIENT_SECRET`)});if(!i.success)throw new e.n(`INVALID_ENVIRONMENT_CONFIGURATION`,JSON.stringify({[r]:n.T(i.error)},null,2));return i.data},N=t=>{if(typeof t==`string`){let r=M(t),i=j[t](),a=C.safeParse({...i,...r});if(!a.success)throw new e.n(`INVALID_OAUTH_PROVIDER_CONFIGURATION`,`Invalid configuration for OAuth provider "${t}": ${JSON.stringify({[t]:n.T(a.error)},null,2)}`);return a.data}let r=t.clientId&&t.clientSecret?{}:M(t.id),i=C.safeParse({...r,...t});if(!i.success){let r=JSON.stringify({[t.id]:n.T(i.error)},null,2);throw new e.n(`INVALID_OAUTH_PROVIDER_CONFIGURATION`,`Invalid configuration for OAuth provider "${t.id}": ${r}`)}return i.data},P=(t=[])=>t.reduce((t,n)=>{let r=N(n);if(r.id in t)throw new e.n(`DUPLICATED_OAUTH_PROVIDER_ID`,`Duplicate OAuth provider id "${r.id}" found. Each provider must have a unique id.`);return{...t,[r.id]:r}},{});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return j}});
File without changes
File without changes