@securitydept/basic-auth-context-client-react 0.3.0-beta.1 → 0.3.0-beta.11
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 +6 -0
- package/dist/index.d.mts +3 -17
- package/dist/index.mjs +5 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -2,4 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Basic Auth Context Client React of the SecurityDept TypeScript SDK, a layered authentication and authorization toolkit built as reusable Rust crates, a TypeScript client SDK workspace, and reference server/web apps.
|
|
4
4
|
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
- [Package documentation](https://www.npmjs.com/package/@securitydept/basic-auth-context-client-react)
|
|
8
|
+
- [SecurityDept TypeScript SDK guide](https://github.com/ethaxon/securitydept/blob/main/docs/en/007-CLIENT_SDK_GUIDE.md)
|
|
9
|
+
- [SecurityDept architecture](https://github.com/ethaxon/securitydept/blob/main/docs/en/001-ARCHITECTURE.md)
|
|
10
|
+
|
|
5
11
|
Repository: [ethaxon/securitydept](https://github.com/ethaxon/securitydept)
|
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { BasicAuthContextClient
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
|
|
1
|
+
import { BasicAuthContextClient } from "@securitydept/basic-auth-context-client";
|
|
5
2
|
//#region src/index.d.ts
|
|
6
|
-
|
|
7
|
-
/** Auth-context config only (baseUrl, zones, redirect policy). */
|
|
8
|
-
config: BasicAuthContextClientConfig;
|
|
9
|
-
/** React host glue only; runtime capability wiring does not live here. */
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
declare function BasicAuthContextProvider({
|
|
13
|
-
config,
|
|
14
|
-
children
|
|
15
|
-
}: BasicAuthContextProviderProps): _$react_jsx_runtime0.JSX.Element;
|
|
16
|
-
/** Access the `BasicAuthContextClient` from React context. */
|
|
17
|
-
declare function useBasicAuthContext(): BasicAuthContextClient;
|
|
3
|
+
declare function useBasicAuthContextClient(): BasicAuthContextClient;
|
|
18
4
|
//#endregion
|
|
19
|
-
export {
|
|
5
|
+
export { useBasicAuthContextClient };
|
|
20
6
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { BASIC_AUTH_CONTEXT_CLIENT } from "@securitydept/basic-auth-context-client";
|
|
2
|
+
import { useSecuritydeptContext } from "@securitydept/client-react";
|
|
4
3
|
//#region src/index.tsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const client = useMemo(() => new BasicAuthContextClient(config), [config]);
|
|
8
|
-
return /* @__PURE__ */ jsx(BasicAuthContext.Provider, {
|
|
9
|
-
value: client,
|
|
10
|
-
children
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
/** Access the `BasicAuthContextClient` from React context. */
|
|
14
|
-
function useBasicAuthContext() {
|
|
15
|
-
const ctx = useContext(BasicAuthContext);
|
|
16
|
-
if (!ctx) throw new Error("useBasicAuthContext must be used inside <BasicAuthContextProvider>");
|
|
17
|
-
return ctx;
|
|
4
|
+
function useBasicAuthContextClient() {
|
|
5
|
+
return useSecuritydeptContext().get(BASIC_AUTH_CONTEXT_CLIENT);
|
|
18
6
|
}
|
|
19
7
|
//#endregion
|
|
20
|
-
export {
|
|
8
|
+
export { useBasicAuthContextClient };
|
|
21
9
|
|
|
22
10
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.tsx"],"sourcesContent":["import {\n\tBASIC_AUTH_CONTEXT_CLIENT,\n\ttype BasicAuthContextClient,\n} from \"@securitydept/basic-auth-context-client\";\nimport { useSecuritydeptContext } from \"@securitydept/client-react\";\n\nexport function useBasicAuthContextClient(): BasicAuthContextClient {\n\treturn useSecuritydeptContext().get(BASIC_AUTH_CONTEXT_CLIENT);\n}\n"],"mappings":";;;AAMA,SAAgB,4BAAoD;CACnE,OAAO,uBAAuB,CAAC,CAAC,IAAI,yBAAyB;AAC9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@securitydept/basic-auth-context-client-react",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.11",
|
|
4
4
|
"description": "Basic Auth Context Client React of the SecurityDept TypeScript SDK, a layered authentication and authorization toolkit built as reusable Rust crates, a TypeScript client SDK workspace, and reference server/web apps.",
|
|
5
5
|
"author": "Zhou Yeheng <root@aitiotekt.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,13 +37,22 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@securitydept/basic-auth-context-client": "0.3.0-beta.
|
|
40
|
+
"@securitydept/basic-auth-context-client": "0.3.0-beta.11",
|
|
41
|
+
"@securitydept/client-react": "0.3.0-beta.11",
|
|
42
|
+
"@securitydept/client": "0.3.0-beta.11"
|
|
41
43
|
},
|
|
42
44
|
"peerDependencies": {
|
|
43
45
|
"react": ">=19.0.0"
|
|
44
46
|
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"react": "^19.2.8",
|
|
49
|
+
"vitest": "^4.1.10"
|
|
50
|
+
},
|
|
45
51
|
"scripts": {
|
|
46
52
|
"build": "tsdown",
|
|
47
|
-
"
|
|
53
|
+
"test": "vitest run --config ../../vitest.package.config.ts",
|
|
54
|
+
"test:watch": "vitest --config ../../vitest.package.config.ts",
|
|
55
|
+
"typecheck": "tsc -b --pretty false",
|
|
56
|
+
"build:dep": "pnpm run build"
|
|
48
57
|
}
|
|
49
58
|
}
|