@steedos/service-object-mixin 2.5.16 → 2.5.17-beta.10

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/package.service.js +27 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-object-mixin",
3
- "version": "2.5.16",
3
+ "version": "2.5.17-beta.10",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -13,5 +13,5 @@
13
13
  "description": "steedos package",
14
14
  "repository": {},
15
15
  "license": "MIT",
16
- "gitHead": "29c5576aac882d8ae615c0542c458bb82afd77db"
16
+ "gitHead": "d4a1c8b4938c6b7853b4890902ec7b9ea60a1a70"
17
17
  }
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2023-03-23 15:12:14
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-08-03 11:02:58
4
+ * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
+ * @LastEditTime: 2023-10-21 13:51:19
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -359,6 +359,31 @@ module.exports = {
359
359
 
360
360
  }
361
361
  }
362
+ },
363
+ /**
364
+ * 获取用户userSession
365
+ * 示例:const userSession = await this.getUser(userId, spaceId);
366
+ * @param string userId 必填
367
+ * @param string spaceId 非必填
368
+ * @returns {import('@steedos/objectql').SteedosUserSession} 用户的userSession
369
+ */
370
+ getUser: {
371
+ async handler(userId, spaceId) {
372
+ return await this.broker.call("@steedos/service-accounts.getUserSession", {
373
+ userId,
374
+ spaceId
375
+ })
376
+ }
377
+ },
378
+ /**
379
+ * 生成主键
380
+ * 示例:const newId = await this.makeNewID();
381
+ * @returns string id
382
+ */
383
+ makeNewID: {
384
+ async handler() {
385
+ return await this.broker.call("objectql.makeNewID")
386
+ }
362
387
  }
363
388
 
364
389
  },