@insforge/shared 1.1.3 → 1.1.5
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/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -69,6 +69,10 @@ interface InsforgeAuthMethods {
|
|
|
69
69
|
}>;
|
|
70
70
|
loginWithOAuth: (provider: OAuthProvider, redirectTo: string) => Promise<void>;
|
|
71
71
|
getPublicAuthConfig: () => Promise<GetPublicAuthConfigResponse | null>;
|
|
72
|
+
getSession: () => Promise<{
|
|
73
|
+
accessToken: string;
|
|
74
|
+
user: InsforgeUser;
|
|
75
|
+
} | null>;
|
|
72
76
|
}
|
|
73
77
|
/**
|
|
74
78
|
* Auth config - configuration values
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,10 @@ interface InsforgeAuthMethods {
|
|
|
69
69
|
}>;
|
|
70
70
|
loginWithOAuth: (provider: OAuthProvider, redirectTo: string) => Promise<void>;
|
|
71
71
|
getPublicAuthConfig: () => Promise<GetPublicAuthConfigResponse | null>;
|
|
72
|
+
getSession: () => Promise<{
|
|
73
|
+
accessToken: string;
|
|
74
|
+
user: InsforgeUser;
|
|
75
|
+
} | null>;
|
|
72
76
|
}
|
|
73
77
|
/**
|
|
74
78
|
* Auth config - configuration values
|
package/dist/react.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/contexts.tsx"],"names":["createContext"],"mappings":";;;;;AAmBO,IAAM,eAAA,GAAkBA,oBAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2BA,oBAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyBA,oBAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwBA,oBAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.cjs","sourcesContent":["import { createContext } from 'react';\nimport type {\n InsforgeContextValue,\n InsforgeAuthState,\n InsforgeAuthMethods,\n InsforgeAuthConfig,\n} from '../types';\n\n/**\n * InsforgeContext - The single source of truth for authentication state\n *\n * This Context is defined in @insforge/shared to prevent duplication across\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\n * import this Context definition, ensuring there's only ONE Context instance.\n *\n * Pattern learned from @clerk/shared\n *\n * @deprecated Internal use only. Use useInsforge() hook instead.\n */\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\nInsforgeContext.displayName = 'InsforgeContext';\n\n/**\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\n *\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\n * It updates when auth state changes.\n */\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\n\n/**\n * InsforgeMethodsContext - Stable method references\n *\n * This context holds method references that NEVER change once initialized.\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\n * This prevents useEffect re-runs when state changes.\n *\n * Pattern learned from @clerk/shared - they store the Clerk instance\n * in a separate context to keep method references stable.\n */\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\n\n/**\n * InsforgeConfigContext - Static configuration values\n *\n * This context holds configuration values like baseUrl, afterSignInUrl.\n * These rarely change after initialization.\n */\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/contexts.tsx"],"names":["createContext"],"mappings":";;;;;AAmBO,IAAM,eAAA,GAAkBA,oBAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2BA,oBAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyBA,oBAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwBA,oBAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.cjs","sourcesContent":["import { createContext } from 'react';\r\nimport type {\r\n InsforgeContextValue,\r\n InsforgeAuthState,\r\n InsforgeAuthMethods,\r\n InsforgeAuthConfig,\r\n} from '../types';\r\n\r\n/**\r\n * InsforgeContext - The single source of truth for authentication state\r\n *\r\n * This Context is defined in @insforge/shared to prevent duplication across\r\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\r\n * import this Context definition, ensuring there's only ONE Context instance.\r\n *\r\n * Pattern learned from @clerk/shared\r\n *\r\n * @deprecated Internal use only. Use useInsforge() hook instead.\r\n */\r\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\r\nInsforgeContext.displayName = 'InsforgeContext';\r\n\r\n/**\r\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\r\n *\r\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\r\n * It updates when auth state changes.\r\n */\r\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\r\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\r\n\r\n/**\r\n * InsforgeMethodsContext - Stable method references\r\n *\r\n * This context holds method references that NEVER change once initialized.\r\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\r\n * This prevents useEffect re-runs when state changes.\r\n *\r\n * Pattern learned from @clerk/shared - they store the Clerk instance\r\n * in a separate context to keep method references stable.\r\n */\r\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\r\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\r\n\r\n/**\r\n * InsforgeConfigContext - Static configuration values\r\n *\r\n * This context holds configuration values like baseUrl, afterSignInUrl.\r\n * These rarely change after initialization.\r\n */\r\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\r\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\r\n"]}
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/contexts.tsx"],"names":[],"mappings":";;;AAmBO,IAAM,eAAA,GAAkB,cAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2B,cAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyB,cAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwB,cAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.js","sourcesContent":["import { createContext } from 'react';\nimport type {\n InsforgeContextValue,\n InsforgeAuthState,\n InsforgeAuthMethods,\n InsforgeAuthConfig,\n} from '../types';\n\n/**\n * InsforgeContext - The single source of truth for authentication state\n *\n * This Context is defined in @insforge/shared to prevent duplication across\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\n * import this Context definition, ensuring there's only ONE Context instance.\n *\n * Pattern learned from @clerk/shared\n *\n * @deprecated Internal use only. Use useInsforge() hook instead.\n */\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\nInsforgeContext.displayName = 'InsforgeContext';\n\n/**\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\n *\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\n * It updates when auth state changes.\n */\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\n\n/**\n * InsforgeMethodsContext - Stable method references\n *\n * This context holds method references that NEVER change once initialized.\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\n * This prevents useEffect re-runs when state changes.\n *\n * Pattern learned from @clerk/shared - they store the Clerk instance\n * in a separate context to keep method references stable.\n */\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\n\n/**\n * InsforgeConfigContext - Static configuration values\n *\n * This context holds configuration values like baseUrl, afterSignInUrl.\n * These rarely change after initialization.\n */\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/react/contexts.tsx"],"names":[],"mappings":";;;AAmBO,IAAM,eAAA,GAAkB,cAAgD,MAAS;AACxF,eAAA,CAAgB,WAAA,GAAc,iBAAA;AAQvB,IAAM,wBAAA,GAA2B,cAA6C,MAAS;AAC9F,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAYhC,IAAM,sBAAA,GAAyB,cAA+C,MAAS;AAC9F,sBAAA,CAAuB,WAAA,GAAc,wBAAA;AAQ9B,IAAM,qBAAA,GAAwB,cAA8C,MAAS;AAC5F,qBAAA,CAAsB,WAAA,GAAc,uBAAA","file":"react.js","sourcesContent":["import { createContext } from 'react';\r\nimport type {\r\n InsforgeContextValue,\r\n InsforgeAuthState,\r\n InsforgeAuthMethods,\r\n InsforgeAuthConfig,\r\n} from '../types';\r\n\r\n/**\r\n * InsforgeContext - The single source of truth for authentication state\r\n *\r\n * This Context is defined in @insforge/shared to prevent duplication across\r\n * multiple tsup entry points. All packages (@insforge/react, @insforge/nextjs, etc.)\r\n * import this Context definition, ensuring there's only ONE Context instance.\r\n *\r\n * Pattern learned from @clerk/shared\r\n *\r\n * @deprecated Internal use only. Use useInsforge() hook instead.\r\n */\r\nexport const InsforgeContext = createContext<InsforgeContextValue | undefined>(undefined);\r\nInsforgeContext.displayName = 'InsforgeContext';\r\n\r\n/**\r\n * InsforgeAuthStateContext - Reactive auth state that changes on sign in/out\r\n *\r\n * This context holds the reactive state: user, userId, isLoaded, isSignedIn.\r\n * It updates when auth state changes.\r\n */\r\nexport const InsforgeAuthStateContext = createContext<InsforgeAuthState | undefined>(undefined);\r\nInsforgeAuthStateContext.displayName = 'InsforgeAuthStateContext';\r\n\r\n/**\r\n * InsforgeMethodsContext - Stable method references\r\n *\r\n * This context holds method references that NEVER change once initialized.\r\n * Methods like signIn, signOut, verifyEmail etc. are stored here.\r\n * This prevents useEffect re-runs when state changes.\r\n *\r\n * Pattern learned from @clerk/shared - they store the Clerk instance\r\n * in a separate context to keep method references stable.\r\n */\r\nexport const InsforgeMethodsContext = createContext<InsforgeAuthMethods | undefined>(undefined);\r\nInsforgeMethodsContext.displayName = 'InsforgeMethodsContext';\r\n\r\n/**\r\n * InsforgeConfigContext - Static configuration values\r\n *\r\n * This context holds configuration values like baseUrl, afterSignInUrl.\r\n * These rarely change after initialization.\r\n */\r\nexport const InsforgeConfigContext = createContext<InsforgeAuthConfig | undefined>(undefined);\r\nInsforgeConfigContext.displayName = 'InsforgeConfigContext';\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Shared utilities and React contexts for Insforge packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react": ">=18.0.0 <20.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@insforge/shared-schemas": "^1.1.
|
|
43
|
+
"@insforge/shared-schemas": "^1.1.43"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/react": "^19.2.2",
|