informat.company Team
Overview
Use informat.company object for team-related operations.
getCompany
Query current team information
informat.company.getCompany();Return Value
Type Company, returns the team
Example
informat.company.getCompany();{
"createAccountId": "wcueuhi1ib6ul",
"createTime": 1664196760747,
"dbIndex": 0,
"favicon": "0238219de8614a6a8a27db74d2dfc82a.jpg",
"id": "g09aj7cus3d8s",
"maxApplicationNum": 0,
"maxUserNum": 10000,
"name": "informat-UAT-team",
"updateTime": 1683595804684,
"version": "enterprise"
}queryRoleList
Query team role list
informat.company.queryRoleList();Return Value
Type Array<Role>, returns all roles
Example
informat.company.queryRoleList();[
{
"admin": true,
"createTime": 1664196760903,
"id": "admin",
"isAdmin": true,
"name": "admin",
"permissionIds": []
},
{
"admin": false,
"createTime": 1664196760907,
"id": "member",
"isAdmin": false,
"name": "member",
"permissionIds": ["InviteMember"]
},
{
"admin": false,
"createTime": 1670301261933,
"id": "supplier",
"isAdmin": false,
"name": "supplier",
"permissionIds": ["InviteMember"]
}
]addCompanyMember
Add account to team member list
informat.company.addCompanyMember(accountId, departmentList, roleList);Tip
Adding an account to team members is limited by the number of team members in the license. If the number of team members exceeds the license limit, the addition will fail.
| Parameter | Type | Description |
|---|---|---|
| accountId | String | Account ID |
| departmentList | Array<String> | Department ID list. If the list is empty, the user will be added to the root department |
| roleList | Array<String> | Role ID list |
Example
informat.company.addCompanyMember("zhangsan", ["yanfabu"], ["tester"]);deleteCompanyMember
Remove account from team members
informat.company.deleteCompanyMember(accountId);| Parameter | Type | Description |
|---|---|---|
| accountId | String | Account ID |
Return Value
Type Boolean, returns whether the removal was successful
Example
informat.company.deleteCompanyMember("zhangsan");trueupdateCompanyMember
Update team member
informat.company.updateCompanyMember(member);| Parameter | Type | Description |
|---|---|---|
| member | CompanyMember | Team member |
Example
informat.company.updateCompanyMember({
id: "zhangsan",
departmentList: ["yanfabu", "yunyingbu"],
roleList: ["tester", "devopser"],
leaderList: ["lisi"],
dingtalkUserId: "zhangsan",
weworkUserId: "eobg38987",
feishuUserId: "ecbg46933",
});queryCompanyMemberList
Query team member list
informat.company.queryCompanyMemberList(query);| Parameter | Type | Description |
|---|---|---|
| query | Query | Team member query conditions |
Return Value Type Array<CompanyMember>, team member list
Example
informat.company.queryCompanyMemberList({
pageIndex: 1,
pageSize: 100,
filter: {
conditionList: [
{
fieldId: "weworkUserId",
opt: "isnull",
},
],
},
});[
{
"createTime": 1700628322740,
"departmentKeyList": ["root"],
"departmentList": ["acocdpvd8d6a6"],
"id": "zhangsan",
"name": "zhangsan",
"rowNumber": 5,
"updateTime": 1700820250268
}
]queryCompanyMemberListCount
Query team member list count
informat.company.queryCompanyMemberListCount(filter);| Parameter | Type | Description |
|---|---|---|
| filter | Filter | Team member query filter |
Return Value
Type Integer, returns the total number of matches
Example
informat.company.queryCompanyMemberListCount({
conditionList: [
{
fieldId: "weworkUserId",
opt: "isnull",
},
],
});2queryAppGroupById
Query app group by ID
informat.company.queryAppGroupById(id);| Parameter | Type | Description |
|---|---|---|
| id | String | App group ID |
Return Value
Type AppGroup, returns the app group
Example
informat.company.queryAppGroupById("ruh8zp94ke3p0");{
"createTime": 1700628428167,
"id": "qvwfhdf328lex",
"name": "Demo (gitee link available for customer installation)",
"rowNumber": 1,
"updateTime": 1717149133338
}queryAppGroupList
Query app group list
informat.company.queryAppGroupList(query);| Parameter | Type | Description |
|---|---|---|
| query | Query | Query conditions |
Return Value
Type Array<AppGroup>, returns the app group list
Example
informat.company.queryAppGroupList({
pageIndex: 1,
pageSize: 100,
filter: {
conditionList: [
{
fieldId: "name",
opt: "isnotnull",
},
],
},
});[
{
"createTime": 1717146091865,
"id": "sjppghi7ofsci",
"name": "⚠️Case Study - Project Management",
"rowNumber": 5,
"updateTime": 1717660920434
},
{
"createTime": 1717660867337,
"id": "mjeb7d6mnrsi7",
"name": "⚠️Case Study - Manufacturing 2",
"rowNumber": 8,
"updateTime": 1717660937343
}
]queryAppGroupListCount
Query app group list count
informat.company.queryAppGroupListCount(filter);| Parameter | Type | Description |
|---|---|---|
| filter | Filter | Query filter |
Return Value
Type Integer, returns the total number of matches
Example
informat.company.queryAppGroupListCount({
conditionList: [
{
fieldId: "name",
opt: "contains",
value: "Case Study",
},
],
});4addAppGroup
Create app group
informat.company.addAppGroup(group);| Parameter | Type | Description |
|---|---|---|
| group | AppGroup | App group |
Return Value
Type String, ID of the newly added app group
Example
informat.company.addAppGroup({
name: "test-group",
});qunzjrmed162wupdateAppGroup
Edit app group
informat.company.updateAppGroup(group);| Parameter | Type | Description |
|---|---|---|
| group | AppGroup | App group |
Return Value
Type Integer, number of successfully edited groups
informat.company.updateAppGroup({
id: "qunzjrmed162w",
name: "test-group-2",
});1deleteAppGroup
Delete app group
informat.company.deleteAppGroup(id);WARNING
Cannot delete if there are apps under the group
| Parameter | Type | Description |
|---|---|---|
| id | String | App group ID |
Return Value
Type Integer, number of successfully deleted groups
Example
informat.company.deleteAppGroup("qunzjrmed162w");1queryAppList
Query app list
informat.company.queryAppList(query);| Parameter | Type | Description |
|---|---|---|
| query | Query | Query conditions |
Return Value
Type Array<Application>, returns the app list
Example
informat.company.queryAppList({
pageIndex: 1,
pageSize: 100,
filter: {
conditionList: [
{
fieldId: "name",
opt: "contains",
value: "test",
},
],
},
});[
{
"appDefineId": "com.mycompany",
"color": "c7",
"createAccountId": "zhangsan",
"createTime": 1680006873433,
"icon": "home",
"id": "ftegr30w93jya",
"name": "test-app",
"updateAccountId": "zhangsan",
"updateTime": 1696919628896
},
{
"appDefineId": "cn.informat.test",
"color": "c1",
"createAccountId": "zhangsan",
"createTime": 1664258560997,
"icon": "community",
"id": "btz5tka89273q",
"name": "test-full-field",
"updateAccountId": "zhangsan",
"updateTime": 1696919628886
}
]queryAppListCount
Query app list count
informat.company.queryAppListCount(filter);| Parameter | Type | Description |
|---|---|---|
| filter | Filter | Query filter |
Return Value
Type Integer, returns the total number of matches
Example
informat.company.queryAppListCount({
conditionList: [
{
fieldId: "name",
opt: "contains",
value: "test",
},
],
});2installApp
Install app
informat.company.installApp(req);| Parameter | Type | Description |
|---|---|---|
| req | InstallAppRequest | Installation information |
Return Value
Type String, ID of the newly installed app
Example
let company = informat.company.getCompany();
informat.company.installApp({
groupId: company.id,
imrUrl: "https://next.inforamt.cn/test.imr",
});uzafvisn1whcquninstallApp
Uninstall app
informat.company.uninstallApp(appId);| Parameter | Type | Description |
|---|---|---|
| appId | String | App ID |
Example
informat.company.uninstallApp("uzafvisn1whcq");getUserAppList
Query apps accessible to the user
informat.company.getUserAppList(accountId);| Parameter | Type | Description |
|---|---|---|
| accountId | String | Account ID |
Return Value
Type UserAppList, returns the app list
Example
informat.company.getUserAppList("zhangsan");{
"appGroupList": [
{
"createTime": 1737464180983,
"id": "nj4h8ci8kjpsu",
"name": "test-app-group",
"rowNumber": 1,
"updateTime": 1738810011210
},
{
"createTime": 1717142070955,
"id": "qdjpyk2iw8zzt",
"name": "test-iteration",
"rowNumber": 2,
"updateTime": 1738810011216
}
],
"appList": [
{
"appDefineBuild": 920,
"appDefineEditable": true,
"appDefineId": "com.demo.srm",
"appDefineVersion": "1.0",
"color": "c1",
"createAccountId": "lwfwqr67xsvup",
"createTime": 1725441476365,
"enableAppJsonLog": false,
"enableAppLog": false,
"icon": "instance-fill",
"id": "dvl8ig0j3odwh",
"logLevel": "DEBUG",
"name": "test-supplier-management",
"groupId": "nj4h8ci8kjpsu",
"updateTime": 1739861044583
},
{
"appDefineBuild": 54,
"appDefineEditable": true,
"appDefineId": "demoApp.pm",
"appDefineVersion": "1.0",
"color": "c2",
"createTime": 1725503438313,
"enableAppJsonLog": false,
"enableAppLog": false,
"icon": "task",
"id": "m4mfdpi5plchm",
"logLevel": "DEBUG",
"name": "test-project-management",
"groupId": "nj4h8ci8kjpsu",
"updateTime": 1740559881456
}
]
}
