@pubinfo-nightly/module-auth 2025.11.14

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 PUBINFO 腾龙框架
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,15 @@
1
+ export declare const LoginWithFourA: import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').DefineComponent<import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ExtractPropTypes<{
2
+ color: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ }>, () => import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').VNode<import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').RendererNode, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').RendererElement, {
7
+ [key: string]: any;
8
+ }>, {}, {}, {}, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ComponentOptionsMixin, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ComponentOptionsMixin, {}, string, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').PublicProps, Readonly<import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ExtractPropTypes<{
9
+ color: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ }>> & Readonly<{}>, {
14
+ color: string;
15
+ }, {}, {}, {}, string, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,11 @@
1
+ export declare const RedirectLogin: import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').DefineComponent<import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ExtractPropTypes<{
2
+ id: StringConstructor;
3
+ src: StringConstructor;
4
+ color: StringConstructor;
5
+ }>, () => import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').VNode<import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').RendererNode, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').RendererElement, {
6
+ [key: string]: any;
7
+ }>, {}, {}, {}, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ComponentOptionsMixin, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ComponentOptionsMixin, {}, string, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').PublicProps, Readonly<import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ExtractPropTypes<{
8
+ id: StringConstructor;
9
+ src: StringConstructor;
10
+ color: StringConstructor;
11
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('../../../../../node_modules/.pnpm/vue@3.5.17_typescript@5.8.3/node_modules/vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,2 @@
1
+ import { InternalContext } from './interface';
2
+ export declare const ctx: import('unctx').UseContext<InternalContext>;
package/dist/core.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { Recordable, ThirdParty } from './interface';
2
+ /**
3
+ * 前往登录
4
+ * @param id 唯一值
5
+ * @param options 登录时需要传递的参数
6
+ */
7
+ export declare function signIn(id: ThirdParty, options?: Recordable): Promise<any>;
8
+ /**
9
+ * 生成二维码
10
+ * @param id 第三方的唯一值
11
+ * @param options 生成二维码需要传递的参数
12
+ * @param options.id `getElementById`中指定的`id`
13
+ */
14
+ export declare function renderQRCode(id: ThirdParty, options: {
15
+ id: string;
16
+ } & Recordable): void;
17
+ /**
18
+ * 认证
19
+ * @param id 第三方的唯一值
20
+ */
21
+ export declare function authenticate(id: ThirdParty): Promise<any>;
22
+ /**
23
+ * 重定向至统一登录页
24
+ */
25
+ export declare function redirect(): void;
@@ -0,0 +1,22 @@
1
+ import { ProviderUserOptions, Recordable, ThirdParty } from './interface';
2
+ /**
3
+ * 获取指定的 `Provider`
4
+ * @param id
5
+ */
6
+ export declare function getProvider(id?: ThirdParty): import('./interface').ProviderOptions;
7
+ /**
8
+ * 构建第三方授权登录地址
9
+ * @param provider
10
+ */
11
+ export declare function createUrlByProvider(provider: ProviderUserOptions): string;
12
+ /**
13
+ * 构建携带 `params` 的 URL
14
+ * @param url
15
+ * @param params
16
+ */
17
+ export declare function createUrl(url?: string, params?: Recordable): string;
18
+ /**
19
+ * 读取 `URL` 上的 `params` 参数
20
+ * @param url
21
+ */
22
+ export declare function readUrlParams(url?: string): URLSearchParams;
@@ -0,0 +1,6 @@
1
+ import { ModuleOptions } from 'pubinfo-nightly';
2
+ import { AuthOptions } from './interface';
3
+ export declare function auth(options: AuthOptions): ModuleOptions;
4
+ export { LoginWithFourA } from './components/LoginWithFourA';
5
+ export { authenticate, redirect, renderQRCode, signIn, } from './core';
6
+ export * from './interface';