@steedos/service-object-mixin 2.6.1-beta.7 → 2.6.2-beta.3

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 +41 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-object-mixin",
3
- "version": "2.6.1-beta.7",
3
+ "version": "2.6.2-beta.3",
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": "b12f271460ef3686face095e875aa38e8ddc4c7f"
16
+ "gitHead": "7842aa5d3023622c0e140009cfdd081180563bdd"
17
17
  }
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2023-03-23 15:12:14
4
4
  * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
- * @LastEditTime: 2023-07-05 10:37:29
5
+ * @LastEditTime: 2023-11-14 10:27:19
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -27,7 +27,7 @@ module.exports = {
27
27
  /**
28
28
  * Dependencies
29
29
  */
30
- dependencies: [],
30
+ dependencies: ['objectql'],
31
31
 
32
32
  /**
33
33
  * Actions
@@ -233,8 +233,8 @@ module.exports = {
233
233
  }
234
234
  })
235
235
  },
236
- getUserObjectPermissions: async (userSession) => {
237
- return await this.broker.call("objectql.getUserObjectPermissions", {
236
+ getUserObjectPermission: async (userSession) => {
237
+ return await this.broker.call("objectql.getUserObjectPermission", {
238
238
  objectName,
239
239
  }, {
240
240
  meta: {
@@ -355,10 +355,47 @@ module.exports = {
355
355
  user: userSession
356
356
  }
357
357
  })
358
+ },
359
+ createIndex: async (fieldName) => {
360
+ return await this.broker.call("objectql.createIndex", {
361
+ objectName,
362
+ fieldName
363
+ })
364
+ },
365
+ dropIndex: async (fieldName) => {
366
+ return await this.broker.call("objectql.dropIndex", {
367
+ objectName,
368
+ fieldName
369
+ })
358
370
  }
359
371
 
360
372
  }
361
373
  }
374
+ },
375
+ /**
376
+ * 获取用户userSession
377
+ * 示例:const userSession = await this.getUser(userId, spaceId);
378
+ * @param string userId 必填
379
+ * @param string spaceId 非必填
380
+ * @returns {import('@steedos/objectql').SteedosUserSession} 用户的userSession
381
+ */
382
+ getUser: {
383
+ async handler(userId, spaceId) {
384
+ return await this.broker.call("@steedos/service-accounts.getUserSession", {
385
+ userId,
386
+ spaceId
387
+ })
388
+ }
389
+ },
390
+ /**
391
+ * 生成主键
392
+ * 示例:const newId = await this.makeNewID();
393
+ * @returns string id
394
+ */
395
+ makeNewID: {
396
+ async handler() {
397
+ return await this.broker.call("objectql.makeNewID")
398
+ }
362
399
  }
363
400
 
364
401
  },