@mshow3/basic-user-api
Advanced tools
Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "@mshow3/basic-user-api", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "你好示例API", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -11,12 +11,12 @@ "use strict"; | ||
*/ | ||
captcha: api_1.HTTP(['user'], ''), | ||
captcha: api_1.HTTP(["user"], ""), | ||
/** | ||
* 恢复用户会话信息,以及续订用户会话超时时间 | ||
*/ | ||
resume: api_1.HTTP(['user'], ''), | ||
register: api_1.HTTP(['user'], ''), | ||
resume: api_1.HTTP(["user"], ""), | ||
register: api_1.HTTP(["user"], ""), | ||
/** | ||
* 使用用户名和密码进行登录 | ||
*/ | ||
pwLogin: api_1.HTTP(['user'], ''), | ||
pwLogin: api_1.HTTP(["user"], "") | ||
}; |
@@ -7,7 +7,8 @@ "use strict"; | ||
exports.DbApi = { | ||
userAdmin: api_1.DB_CRUD(DbSchema_1.schemasUser.user, {}, ['user'], 'admin'), | ||
userAdmin: api_1.DB_CRUD(DbSchema_1.schemasUser.user, {}, ["user"], "admin"), | ||
userGroup: api_1.DB_CRUD(DbSchema_1.schemasUser.groups, {}, ["user"], "admin"), | ||
user: api_1.DB_R(DbSchema_1.schemasUser.user, { | ||
excludeFields: [], | ||
sessionMatch: { name: '{{user.client.name}}' }, | ||
}, ['user'], ''), | ||
sessionMatch: { name: "{{user.client.name}}" } | ||
}, ["user"], "") | ||
}; |
@@ -16,9 +16,15 @@ "use strict"; | ||
fields: { name: 1 }, | ||
options: { unique: true, sparse: false, dropDups: true }, | ||
options: { unique: true, sparse: false, dropDups: true } | ||
}, | ||
name: { | ||
fields: { name: 1 }, | ||
options: { unique: true, sparse: false, dropDups: true }, | ||
}, | ||
options: { unique: true, sparse: false, dropDups: true } | ||
} | ||
}), | ||
// 用户组 | ||
groups: new api_1.DbSchema( | ||
// 数据库创建参数: | ||
{}, | ||
// 数据库索引: | ||
{}) | ||
}); |
@@ -6,23 +6,24 @@ "use strict"; | ||
client: { | ||
_id: '', | ||
name: '', | ||
displayName: '', | ||
sid: '', | ||
_id: "", | ||
name: "", | ||
displayName: "", | ||
sid: "", | ||
group: [], | ||
actor: [], | ||
permissions: [] //用户权限组 | ||
}, | ||
server: { | ||
captcha: '', | ||
}, | ||
captcha: "" // 用户校验码 | ||
} | ||
}, | ||
thirdLogin: { | ||
client: { | ||
imgUrl: '', | ||
nickName: '', | ||
imgUrl: "", | ||
nickName: "" // 用户显示名称 | ||
}, | ||
server: { | ||
moduleName: '', | ||
id: '', | ||
}, | ||
}, | ||
moduleName: "", | ||
id: "" // 三方用户id | ||
} | ||
} | ||
}; |
{ | ||
"name": "@mshow3/basic-user-api", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "你好示例API", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -1,2 +0,2 @@ | ||
import { HTTP } from '@vmm/api'; | ||
import { HTTP } from "@vmm/api"; | ||
@@ -15,3 +15,3 @@ /** | ||
} | ||
>(['user'], ''), | ||
>(["user"], ""), | ||
/** | ||
@@ -25,3 +25,3 @@ * 恢复用户会话信息,以及续订用户会话超时时间 | ||
} | ||
>(['user'], ''), | ||
>(["user"], ""), | ||
register: HTTP< | ||
@@ -32,7 +32,10 @@ { name: string; pwHash: string; mobile: string; email: string }, | ||
} | ||
>(['user'], ''), | ||
>(["user"], ""), | ||
/** | ||
* 使用用户名和密码进行登录 | ||
*/ | ||
pwLogin: HTTP<{ userName: string; pwHash: string; captcha: string }, { err?: string }>(['user'], ''), | ||
pwLogin: HTTP< | ||
{ userName: string; pwHash: string; captcha: string }, | ||
{ err?: string } | ||
>(["user"], "") | ||
}; |
@@ -1,7 +0,8 @@ | ||
import { DB_CRUD, DB_R, DB_RU } from '@vmm/api'; | ||
import { schemasUser } from './DbSchema'; | ||
import { DB_CRUD, DB_R, DB_RU } from "@vmm/api"; | ||
import { schemasUser } from "./DbSchema"; | ||
// dbSchemas. | ||
export const DbApi = { | ||
userAdmin: DB_CRUD(schemasUser.user, {}, ['user'], 'admin'), | ||
userAdmin: DB_CRUD(schemasUser.user, {}, ["user"], "admin"), | ||
userGroup: DB_CRUD(schemasUser.groups, {}, ["user"], "admin"), | ||
user: DB_R( | ||
@@ -11,7 +12,7 @@ schemasUser.user, | ||
excludeFields: [], | ||
sessionMatch: { name: '{{user.client.name}}' }, | ||
sessionMatch: { name: "{{user.client.name}}" } | ||
}, | ||
['user'], | ||
'', | ||
), | ||
["user"], | ||
"" | ||
) | ||
}; |
@@ -1,3 +0,9 @@ | ||
import { DbSchema, createDbSchemas } from '@vmm/api'; | ||
import { DbSchema, createDbSchemas } from "@vmm/api"; | ||
export interface PERM { | ||
module: string; | ||
page: string; | ||
pageName: string; | ||
} | ||
/** | ||
@@ -29,10 +35,21 @@ * 用户数据库 | ||
fields: { name: 1 }, | ||
options: { unique: true, sparse: false, dropDups: true }, | ||
options: { unique: true, sparse: false, dropDups: true } | ||
}, | ||
name: { | ||
fields: { name: 1 }, | ||
options: { unique: true, sparse: false, dropDups: true }, | ||
}, | ||
}, | ||
options: { unique: true, sparse: false, dropDups: true } | ||
} | ||
} | ||
), | ||
// 用户组 | ||
groups: new DbSchema<// 数据库定义: | ||
{ | ||
name: string; // 用户组名称 | ||
menu: PERM[]; //用户显示名称 | ||
}>( | ||
// 数据库创建参数: | ||
{}, | ||
// 数据库索引: | ||
{} | ||
) | ||
}); |
@@ -0,25 +1,31 @@ | ||
interface PERM { | ||
module: string; | ||
page: string; | ||
pageName: string; | ||
} | ||
export const sessions = { | ||
user: { | ||
client: { | ||
_id: '', // 用户 ID | ||
name: '', // 用户显示名称 | ||
displayName: '', // 用户显示名称 | ||
sid: '', // 用户会话 ID | ||
_id: "", // 用户 ID | ||
name: "", // 用户显示名称 | ||
displayName: "", // 用户显示名称 | ||
sid: "", // 用户会话 ID | ||
group: [] as string[], // 用户分组 | ||
actor: [] as string[], // 用户角色 | ||
permissions: [] as PERM[] //用户权限组 | ||
}, | ||
server: { | ||
captcha: '', // 用户校验码 | ||
}, | ||
captcha: "" // 用户校验码 | ||
} | ||
}, | ||
thirdLogin: { | ||
client: { | ||
imgUrl: '', // 头像url | ||
nickName: '', // 用户显示名称 | ||
imgUrl: "", // 头像url | ||
nickName: "" // 用户显示名称 | ||
}, | ||
server: { | ||
moduleName: '',// 三方登录模块名 | ||
id: '', // 三方用户id | ||
}, | ||
}, | ||
moduleName: "", // 三方登录模块名 | ||
id: "" // 三方用户id | ||
} | ||
} | ||
}; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15873
446
1