@auditauth/next 0.2.0-beta.2 → 0.2.0-beta.3

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.
package/README.md CHANGED
@@ -12,6 +12,17 @@ Install the package in your Next.js application.
12
12
  npm install @auditauth/next
13
13
  ```
14
14
 
15
+ ## TypeScript import compatibility
16
+
17
+ `@auditauth/next` ships dual module output (ESM + CJS) with declaration files.
18
+ You can import it in TypeScript projects with standard syntax:
19
+
20
+ ```ts
21
+ import { createAuditAuthNext } from '@auditauth/next'
22
+ ```
23
+
24
+ You do not need to append `.js` in consumer imports.
25
+
15
26
  ## Create the AuditAuth provider
16
27
 
17
28
  Create one shared instance with `createAuditAuthNext()`.
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var createAuditAuth_exports = {};
20
+ __export(createAuditAuth_exports, {
21
+ createAuditAuthNext: () => createAuditAuthNext
22
+ });
23
+ module.exports = __toCommonJS(createAuditAuth_exports);
24
+ var import_headers = require("next/headers.js");
25
+ var import_sdk = require("../sdk.js");
26
+ var import_settings = require("../settings.js");
27
+ function createAuditAuthNext(config) {
28
+ const base = new URL(config.baseUrl);
29
+ async function createInstance() {
30
+ const store = await (0, import_headers.cookies)();
31
+ return new import_sdk.AuditAuthNext(config, {
32
+ get: (name) => store.get(name)?.value,
33
+ set: (name, value, options) => store.set(name, value, options),
34
+ remove: (name) => store.delete(name)
35
+ });
36
+ }
37
+ return {
38
+ handlers: {
39
+ GET: async (req, ctx) => {
40
+ const instance = await createInstance();
41
+ return instance.getHandlers().GET(req, ctx);
42
+ },
43
+ POST: async (req, ctx) => {
44
+ const instance = await createInstance();
45
+ return instance.getHandlers().POST(req, ctx);
46
+ }
47
+ },
48
+ middleware: async (req) => {
49
+ const instance = await createInstance();
50
+ return instance.middleware(req);
51
+ },
52
+ getSession: async () => {
53
+ const instance = await createInstance();
54
+ return instance.getSession();
55
+ },
56
+ hasSession: async () => {
57
+ const instance = await createInstance();
58
+ return instance.hasSession();
59
+ },
60
+ fetch: async (url, init) => {
61
+ const instance = await createInstance();
62
+ return instance.fetch(url, init);
63
+ },
64
+ withAuthRequest: (handler) => {
65
+ return async (req, ctx) => {
66
+ const instance = await createInstance();
67
+ return instance.withAuthRequest(handler)(req, ctx);
68
+ };
69
+ },
70
+ getLoginUrl: () => new URL(import_settings.SETTINGS.bff.paths.login, base),
71
+ getLogoutUrl: () => new URL(import_settings.SETTINGS.bff.paths.logout, base),
72
+ getPortalUrl: () => new URL(import_settings.SETTINGS.bff.paths.portal, base)
73
+ };
74
+ }
75
+ // Annotate the CommonJS export names for ESM import in node:
76
+ 0 && (module.exports = {
77
+ createAuditAuthNext
78
+ });
@@ -0,0 +1,29 @@
1
+ import { NextRequest, NextResponse } from 'next/server.js';
2
+ import { SessionUser, AuditAuthConfig } from '@auditauth/core';
3
+ import { AuditAuthTokenPayload } from '@auditauth/node';
4
+
5
+ type AuditAuthNextFacade = {
6
+ handlers: {
7
+ GET: (req: NextRequest, ctx: {
8
+ params: Promise<{
9
+ auditauth: string[];
10
+ }>;
11
+ }) => Promise<Response>;
12
+ POST: (req: NextRequest, ctx: {
13
+ params: Promise<{
14
+ auditauth: string[];
15
+ }>;
16
+ }) => Promise<Response>;
17
+ };
18
+ middleware: (req: NextRequest) => Promise<NextResponse>;
19
+ getSession: () => Promise<SessionUser | null>;
20
+ hasSession: () => Promise<boolean>;
21
+ fetch: (url: string, init?: RequestInit) => Promise<Response>;
22
+ getLoginUrl: () => URL;
23
+ getLogoutUrl: () => URL;
24
+ getPortalUrl: () => URL;
25
+ withAuthRequest: <C>(handler: (req: NextRequest, ctx: C, session: AuditAuthTokenPayload) => Promise<Response>) => (req: NextRequest, ctx: C) => Promise<Response>;
26
+ };
27
+ declare function createAuditAuthNext(config: AuditAuthConfig): AuditAuthNextFacade;
28
+
29
+ export { type AuditAuthNextFacade, createAuditAuthNext };
@@ -1,7 +1,7 @@
1
- import type { NextRequest } from 'next/server.js';
2
- import { NextResponse } from 'next/server.js';
3
- import type { AuditAuthConfig, SessionUser } from '@auditauth/core';
4
- import type { AuditAuthTokenPayload } from '@auditauth/node';
1
+ import { NextRequest, NextResponse } from 'next/server.js';
2
+ import { SessionUser, AuditAuthConfig } from '@auditauth/core';
3
+ import { AuditAuthTokenPayload } from '@auditauth/node';
4
+
5
5
  type AuditAuthNextFacade = {
6
6
  handlers: {
7
7
  GET: (req: NextRequest, ctx: {
@@ -25,5 +25,5 @@ type AuditAuthNextFacade = {
25
25
  withAuthRequest: <C>(handler: (req: NextRequest, ctx: C, session: AuditAuthTokenPayload) => Promise<Response>) => (req: NextRequest, ctx: C) => Promise<Response>;
26
26
  };
27
27
  declare function createAuditAuthNext(config: AuditAuthConfig): AuditAuthNextFacade;
28
- export type { AuditAuthNextFacade };
29
- export { createAuditAuthNext };
28
+
29
+ export { type AuditAuthNextFacade, createAuditAuthNext };
@@ -1,52 +1,54 @@
1
- import { cookies } from 'next/headers.js';
2
- import { AuditAuthNext } from '../sdk.js';
3
- import { SETTINGS } from '../settings.js';
1
+ import { cookies } from "next/headers.js";
2
+ import { AuditAuthNext } from "../sdk.js";
3
+ import { SETTINGS } from "../settings.js";
4
4
  function createAuditAuthNext(config) {
5
- const base = new URL(config.baseUrl);
6
- async function createInstance() {
7
- const store = await cookies();
8
- return new AuditAuthNext(config, {
9
- get: (name) => store.get(name)?.value,
10
- set: (name, value, options) => store.set(name, value, options),
11
- remove: (name) => store.delete(name),
12
- });
13
- }
14
- return {
15
- handlers: {
16
- GET: async (req, ctx) => {
17
- const instance = await createInstance();
18
- return instance.getHandlers().GET(req, ctx);
19
- },
20
- POST: async (req, ctx) => {
21
- const instance = await createInstance();
22
- return instance.getHandlers().POST(req, ctx);
23
- },
24
- },
25
- middleware: async (req) => {
26
- const instance = await createInstance();
27
- return instance.middleware(req);
28
- },
29
- getSession: async () => {
30
- const instance = await createInstance();
31
- return instance.getSession();
32
- },
33
- hasSession: async () => {
34
- const instance = await createInstance();
35
- return instance.hasSession();
36
- },
37
- fetch: async (url, init) => {
38
- const instance = await createInstance();
39
- return instance.fetch(url, init);
40
- },
41
- withAuthRequest: (handler) => {
42
- return async (req, ctx) => {
43
- const instance = await createInstance();
44
- return instance.withAuthRequest(handler)(req, ctx);
45
- };
46
- },
47
- getLoginUrl: () => new URL(SETTINGS.bff.paths.login, base),
48
- getLogoutUrl: () => new URL(SETTINGS.bff.paths.logout, base),
49
- getPortalUrl: () => new URL(SETTINGS.bff.paths.portal, base),
50
- };
5
+ const base = new URL(config.baseUrl);
6
+ async function createInstance() {
7
+ const store = await cookies();
8
+ return new AuditAuthNext(config, {
9
+ get: (name) => store.get(name)?.value,
10
+ set: (name, value, options) => store.set(name, value, options),
11
+ remove: (name) => store.delete(name)
12
+ });
13
+ }
14
+ return {
15
+ handlers: {
16
+ GET: async (req, ctx) => {
17
+ const instance = await createInstance();
18
+ return instance.getHandlers().GET(req, ctx);
19
+ },
20
+ POST: async (req, ctx) => {
21
+ const instance = await createInstance();
22
+ return instance.getHandlers().POST(req, ctx);
23
+ }
24
+ },
25
+ middleware: async (req) => {
26
+ const instance = await createInstance();
27
+ return instance.middleware(req);
28
+ },
29
+ getSession: async () => {
30
+ const instance = await createInstance();
31
+ return instance.getSession();
32
+ },
33
+ hasSession: async () => {
34
+ const instance = await createInstance();
35
+ return instance.hasSession();
36
+ },
37
+ fetch: async (url, init) => {
38
+ const instance = await createInstance();
39
+ return instance.fetch(url, init);
40
+ },
41
+ withAuthRequest: (handler) => {
42
+ return async (req, ctx) => {
43
+ const instance = await createInstance();
44
+ return instance.withAuthRequest(handler)(req, ctx);
45
+ };
46
+ },
47
+ getLoginUrl: () => new URL(SETTINGS.bff.paths.login, base),
48
+ getLogoutUrl: () => new URL(SETTINGS.bff.paths.logout, base),
49
+ getPortalUrl: () => new URL(SETTINGS.bff.paths.portal, base)
50
+ };
51
51
  }
52
- export { createAuditAuthNext };
52
+ export {
53
+ createAuditAuthNext
54
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var facade_exports = {};
17
+ module.exports = __toCommonJS(facade_exports);
18
+ __reExport(facade_exports, require("./createAuditAuth.js"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./createAuditAuth.js")
22
+ });
@@ -0,0 +1,4 @@
1
+ export { AuditAuthNextFacade, createAuditAuthNext } from './createAuditAuth.cjs';
2
+ import 'next/server.js';
3
+ import '@auditauth/core';
4
+ import '@auditauth/node';
@@ -1 +1,4 @@
1
- export * from './createAuditAuth.js';
1
+ export { AuditAuthNextFacade, createAuditAuthNext } from './createAuditAuth.js';
2
+ import 'next/server.js';
3
+ import '@auditauth/core';
4
+ import '@auditauth/node';
@@ -1 +1 @@
1
- export * from './createAuditAuth.js';
1
+ export * from "./createAuditAuth.js";
package/dist/guard.cjs ADDED
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var guard_exports = {};
21
+ __export(guard_exports, {
22
+ AuditAuthGuard: () => AuditAuthGuard,
23
+ useAuditAuth: () => useAuditAuth
24
+ });
25
+ module.exports = __toCommonJS(guard_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ var import_react = require("react");
28
+ var import_settings = require("./settings.js");
29
+ const AuthContext = (0, import_react.createContext)(null);
30
+ const useAuditAuth = () => {
31
+ const ctx = (0, import_react.useContext)(AuthContext);
32
+ if (!ctx) {
33
+ throw new Error("useAuditAuth must be used within AuditAuthProvider");
34
+ }
35
+ return ctx;
36
+ };
37
+ const AuditAuthGuard = (props) => {
38
+ const [user, setUser] = (0, import_react.useState)({});
39
+ (0, import_react.useEffect)(() => {
40
+ let cancelled = false;
41
+ const checkSession = async () => {
42
+ try {
43
+ const response = await fetch(import_settings.SETTINGS.bff.paths.session, {
44
+ credentials: "include",
45
+ cache: "no-store"
46
+ });
47
+ if (cancelled) return;
48
+ if (!response.ok) {
49
+ window.location.href = import_settings.SETTINGS.bff.paths.login;
50
+ return;
51
+ }
52
+ const data = await response.json();
53
+ setUser(data.user);
54
+ } catch {
55
+ window.location.href = import_settings.SETTINGS.bff.paths.login;
56
+ return;
57
+ }
58
+ };
59
+ checkSession();
60
+ return () => {
61
+ cancelled = true;
62
+ };
63
+ }, []);
64
+ const value = (0, import_react.useMemo)(() => ({
65
+ user
66
+ }), [user]);
67
+ if (!user.name) return null;
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AuthContext.Provider, { value, children: props.children });
69
+ };
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ AuditAuthGuard,
73
+ useAuditAuth
74
+ });
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SessionUser } from '@auditauth/core';
3
+
4
+ type AuthContextValue = {
5
+ user: SessionUser;
6
+ };
7
+ declare const useAuditAuth: () => AuthContextValue;
8
+ type AuditAuthGuardProps = {
9
+ children: React.ReactNode;
10
+ };
11
+ declare const AuditAuthGuard: (props: AuditAuthGuardProps) => react_jsx_runtime.JSX.Element | null;
12
+
13
+ export { AuditAuthGuard, useAuditAuth };
package/dist/guard.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { SessionUser } from "@auditauth/core";
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { SessionUser } from '@auditauth/core';
3
+
2
4
  type AuthContextValue = {
3
5
  user: SessionUser;
4
6
  };
@@ -6,5 +8,6 @@ declare const useAuditAuth: () => AuthContextValue;
6
8
  type AuditAuthGuardProps = {
7
9
  children: React.ReactNode;
8
10
  };
9
- declare const AuditAuthGuard: (props: AuditAuthGuardProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ declare const AuditAuthGuard: (props: AuditAuthGuardProps) => react_jsx_runtime.JSX.Element | null;
12
+
10
13
  export { AuditAuthGuard, useAuditAuth };
package/dist/guard.js CHANGED
@@ -1,49 +1,49 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import { createContext, useContext, useEffect, useMemo, useState } from "react";
4
- import { SETTINGS } from './settings.js';
4
+ import { SETTINGS } from "./settings.js";
5
5
  const AuthContext = createContext(null);
6
6
  const useAuditAuth = () => {
7
- const ctx = useContext(AuthContext);
8
- if (!ctx) {
9
- throw new Error('useAuditAuth must be used within AuditAuthProvider');
10
- }
11
- return ctx;
7
+ const ctx = useContext(AuthContext);
8
+ if (!ctx) {
9
+ throw new Error("useAuditAuth must be used within AuditAuthProvider");
10
+ }
11
+ return ctx;
12
12
  };
13
13
  const AuditAuthGuard = (props) => {
14
- const [user, setUser] = useState({});
15
- useEffect(() => {
16
- let cancelled = false;
17
- const checkSession = async () => {
18
- try {
19
- const response = await fetch(SETTINGS.bff.paths.session, {
20
- credentials: 'include',
21
- cache: 'no-store',
22
- });
23
- if (cancelled)
24
- return;
25
- if (!response.ok) {
26
- window.location.href = SETTINGS.bff.paths.login;
27
- return;
28
- }
29
- const data = await response.json();
30
- setUser(data.user);
31
- }
32
- catch {
33
- window.location.href = SETTINGS.bff.paths.login;
34
- return;
35
- }
36
- };
37
- checkSession();
38
- return () => {
39
- cancelled = true;
40
- };
41
- }, []);
42
- const value = useMemo(() => ({
43
- user,
44
- }), [user]);
45
- if (!user.name)
46
- return null;
47
- return (_jsx(AuthContext.Provider, { value: value, children: props.children }));
14
+ const [user, setUser] = useState({});
15
+ useEffect(() => {
16
+ let cancelled = false;
17
+ const checkSession = async () => {
18
+ try {
19
+ const response = await fetch(SETTINGS.bff.paths.session, {
20
+ credentials: "include",
21
+ cache: "no-store"
22
+ });
23
+ if (cancelled) return;
24
+ if (!response.ok) {
25
+ window.location.href = SETTINGS.bff.paths.login;
26
+ return;
27
+ }
28
+ const data = await response.json();
29
+ setUser(data.user);
30
+ } catch {
31
+ window.location.href = SETTINGS.bff.paths.login;
32
+ return;
33
+ }
34
+ };
35
+ checkSession();
36
+ return () => {
37
+ cancelled = true;
38
+ };
39
+ }, []);
40
+ const value = useMemo(() => ({
41
+ user
42
+ }), [user]);
43
+ if (!user.name) return null;
44
+ return /* @__PURE__ */ jsx(AuthContext.Provider, { value, children: props.children });
45
+ };
46
+ export {
47
+ AuditAuthGuard,
48
+ useAuditAuth
48
49
  };
49
- export { AuditAuthGuard, useAuditAuth };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var helpers_exports = {};
20
+ __export(helpers_exports, {
21
+ goToPortal: () => goToPortal,
22
+ login: () => login,
23
+ logout: () => logout
24
+ });
25
+ module.exports = __toCommonJS(helpers_exports);
26
+ var import_settings = require("./settings.js");
27
+ const login = () => {
28
+ window.location.href = import_settings.SETTINGS.bff.paths.login;
29
+ };
30
+ const logout = () => {
31
+ window.location.href = import_settings.SETTINGS.bff.paths.logout;
32
+ };
33
+ const goToPortal = () => {
34
+ window.location.href = import_settings.SETTINGS.bff.paths.portal;
35
+ };
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ goToPortal,
39
+ login,
40
+ logout
41
+ });
@@ -0,0 +1,5 @@
1
+ declare const login: () => void;
2
+ declare const logout: () => void;
3
+ declare const goToPortal: () => void;
4
+
5
+ export { goToPortal, login, logout };
package/dist/helpers.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare const login: () => void;
2
2
  declare const logout: () => void;
3
3
  declare const goToPortal: () => void;
4
- export { login, logout, goToPortal };
4
+
5
+ export { goToPortal, login, logout };
package/dist/helpers.js CHANGED
@@ -1,14 +1,15 @@
1
- /* -------------------------------------------------------------------------- */
2
- /* CLIENT SHORTCUTS */
3
- /* -------------------------------------------------------------------------- */
4
- import { SETTINGS } from './settings.js';
1
+ import { SETTINGS } from "./settings.js";
5
2
  const login = () => {
6
- window.location.href = SETTINGS.bff.paths.login;
3
+ window.location.href = SETTINGS.bff.paths.login;
7
4
  };
8
5
  const logout = () => {
9
- window.location.href = SETTINGS.bff.paths.logout;
6
+ window.location.href = SETTINGS.bff.paths.logout;
10
7
  };
11
8
  const goToPortal = () => {
12
- window.location.href = SETTINGS.bff.paths.portal;
9
+ window.location.href = SETTINGS.bff.paths.portal;
10
+ };
11
+ export {
12
+ goToPortal,
13
+ login,
14
+ logout
13
15
  };
14
- export { login, logout, goToPortal };
package/dist/index.cjs ADDED
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ AuditAuthGuard: () => import_guard.AuditAuthGuard,
23
+ AuditAuthNext: () => import_sdk.AuditAuthNext,
24
+ auditauthFetch: () => import_request.auditauthFetch,
25
+ goToPortal: () => import_helpers.goToPortal,
26
+ login: () => import_helpers.login,
27
+ logout: () => import_helpers.logout,
28
+ useAuditAuth: () => import_guard.useAuditAuth
29
+ });
30
+ module.exports = __toCommonJS(index_exports);
31
+ var import_sdk = require("./sdk.js");
32
+ var import_guard = require("./guard.js");
33
+ var import_helpers = require("./helpers.js");
34
+ var import_request = require("./request.js");
35
+ __reExport(index_exports, require("./facade/index.js"), module.exports);
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ AuditAuthGuard,
39
+ AuditAuthNext,
40
+ auditauthFetch,
41
+ goToPortal,
42
+ login,
43
+ logout,
44
+ useAuditAuth,
45
+ ...require("./facade/index.js")
46
+ });
@@ -0,0 +1,10 @@
1
+ export { AuditAuthNext } from './sdk.cjs';
2
+ export { AuditAuthGuard, useAuditAuth } from './guard.cjs';
3
+ export { goToPortal, login, logout } from './helpers.cjs';
4
+ export { auditauthFetch } from './request.cjs';
5
+ export { CookieAdapter, CookieOptions, Session } from './types.cjs';
6
+ export { AuditAuthNextFacade, createAuditAuthNext } from './facade/createAuditAuth.cjs';
7
+ import 'next/server.js';
8
+ import '@auditauth/core';
9
+ import '@auditauth/node';
10
+ import 'react/jsx-runtime';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  export { AuditAuthNext } from './sdk.js';
2
2
  export { AuditAuthGuard, useAuditAuth } from './guard.js';
3
- export { login, logout, goToPortal } from './helpers.js';
3
+ export { goToPortal, login, logout } from './helpers.js';
4
4
  export { auditauthFetch } from './request.js';
5
- export type * from './types.js';
6
- export * from './facade/index.js';
5
+ export { CookieAdapter, CookieOptions, Session } from './types.js';
6
+ export { AuditAuthNextFacade, createAuditAuthNext } from './facade/createAuditAuth.js';
7
+ import 'next/server.js';
8
+ import '@auditauth/core';
9
+ import '@auditauth/node';
10
+ import 'react/jsx-runtime';