@neuralinnovations/dataisland-sdk 0.0.1-dev32 → 0.0.1-dev33
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/README.md +14 -3
- package/dist/package.json +1 -1
- package/dist/src/dto/statisticsResponse.d.ts +11 -0
- package/dist/src/dto/statisticsResponse.d.ts.map +1 -0
- package/dist/src/dto/statisticsResponse.js +3 -0
- package/dist/src/dto/statisticsResponse.js.map +1 -0
- package/dist/src/dto/userInfoResponse.d.ts +10 -0
- package/dist/src/dto/userInfoResponse.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.d.ts +20 -1
- package/dist/src/storages/organizations/organization.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.d.ts +5 -1
- package/dist/src/storages/organizations/organization.impl.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.impl.js +33 -0
- package/dist/src/storages/organizations/organization.impl.js.map +1 -1
- package/dist/src/storages/organizations/organization.js.map +1 -1
- package/dist/src/storages/user/userProfile.impl.d.ts.map +1 -1
- package/dist/src/storages/user/userProfile.impl.js.map +1 -1
- package/dist/src/utils/browserUtils.d.ts.map +1 -1
- package/dist/src/utils/browserUtils.js +1 -5
- package/dist/src/utils/browserUtils.js.map +1 -1
- package/package.json +1 -1
- package/src/dto/statisticsResponse.ts +12 -0
- package/src/dto/userInfoResponse.ts +12 -0
- package/src/storages/organizations/organization.impl.ts +66 -1
- package/src/storages/organizations/organization.ts +25 -1
- package/src/storages/user/userProfile.impl.ts +2 -0
- package/src/utils/browserUtils.ts +1 -5
package/README.md
CHANGED
@@ -16,8 +16,9 @@ The DataIsland Client SDK is a TypeScript library designed to seamlessly integra
|
|
16
16
|
5. [Use workspaces](#use-workspaces)
|
17
17
|
6. [Use files](#use-files)
|
18
18
|
7. [Use access groups](#use-access-groups)
|
19
|
-
8. [Use
|
20
|
-
9. [
|
19
|
+
8. [Use statistics](#use-statistics)
|
20
|
+
9. [Use invites](#use-invites)
|
21
|
+
10. [References](docs/modules.md)
|
21
22
|
|
22
23
|
---
|
23
24
|
|
@@ -163,7 +164,7 @@ if (file.status !== FileStatus.UPLOADING) {
|
|
163
164
|
// Show results
|
164
165
|
} else {
|
165
166
|
file.subscribe((event) => {
|
166
|
-
const progress = event.data.progress
|
167
|
+
const progress = event.data.progress
|
167
168
|
})
|
168
169
|
}
|
169
170
|
```
|
@@ -304,6 +305,16 @@ const group = await organization.accessGroups.create(
|
|
304
305
|
await organization.accessGroups.delete(group.id)
|
305
306
|
```
|
306
307
|
|
308
|
+
### Use Statistics
|
309
|
+
|
310
|
+
Statistics access methods are stored in organization object. There are several methods for different statistics data, and all of them includes dateFrom and dateTo parameters. These parameters are numbers that represent current time in seconds ( UNIX Epoch) . Here are some examples:
|
311
|
+
|
312
|
+
```
|
313
|
+
const organizationStatistics = await org.statistics(dateFrom, dateTo)
|
314
|
+
const organizationMembersStatistics = await org.membersStatistics(dateFrom, dateTo)
|
315
|
+
const userStatistics = await org.userStatistic(userId, dateFrom, dateTo)
|
316
|
+
```
|
317
|
+
|
307
318
|
### Use Invites
|
308
319
|
|
309
320
|
You can invite users to organization with provided emails and selected access groups. Use create invite link method of seleted organization.
|
package/dist/package.json
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
export interface StatisticsResponse {
|
2
|
+
dateFrom: number;
|
3
|
+
dateTo: number;
|
4
|
+
data: StatisticsData[];
|
5
|
+
}
|
6
|
+
export interface StatisticsData {
|
7
|
+
date: number;
|
8
|
+
promptUsage: number;
|
9
|
+
completionUsage: number;
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=statisticsResponse.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"statisticsResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/statisticsResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,cAAc,EAAE,CAAA;CACzB;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;CAC1B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"statisticsResponse.js","sourceRoot":"","sources":["../../../src/dto/statisticsResponse.ts"],"names":[],"mappings":""}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { WorkspaceDto } from "./workspacesResponse";
|
2
2
|
import { UserId } from "../storages/user/userProfile";
|
3
3
|
import { OrganizationId } from "../storages/organizations/organizations";
|
4
|
+
import { StatisticsData } from "./statisticsResponse";
|
4
5
|
export interface UserInfoResponse {
|
5
6
|
adminInOrganization: string[];
|
6
7
|
organizations: OrganizationDto[];
|
@@ -40,4 +41,13 @@ export interface OrganizationWorkspaces extends OrganizationDto {
|
|
40
41
|
export interface MembersResponse {
|
41
42
|
members: UserDto;
|
42
43
|
}
|
44
|
+
export interface UsersStatisticsResponse {
|
45
|
+
dateFrom: number;
|
46
|
+
dateTo: number;
|
47
|
+
membersData: UsetStatisticsData[];
|
48
|
+
}
|
49
|
+
export interface UsetStatisticsData {
|
50
|
+
userId: UserId;
|
51
|
+
data: StatisticsData[];
|
52
|
+
}
|
43
53
|
//# sourceMappingURL=userInfoResponse.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userInfoResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/userInfoResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;
|
1
|
+
{"version":3,"file":"userInfoResponse.d.ts","sourceRoot":"","sources":["../../../src/dto/userInfoResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAA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AAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,kBAAkB,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,cAAc,EAAE,CAAA;CACzB"}
|
@@ -3,8 +3,9 @@ import { OrganizationId } from "./organizations";
|
|
3
3
|
import { Groups } from "../groups/groups";
|
4
4
|
import { Chats } from "../chats/chats";
|
5
5
|
import { EventDispatcher } from "../../events";
|
6
|
-
import { UserDto } from "../../dto/userInfoResponse";
|
6
|
+
import { UserDto, UsersStatisticsResponse } from "../../dto/userInfoResponse";
|
7
7
|
import { GroupId } from "../groups/group";
|
8
|
+
import { StatisticsResponse } from "../../dto/statisticsResponse";
|
8
9
|
/**
|
9
10
|
* Organization event.
|
10
11
|
*/
|
@@ -43,6 +44,24 @@ export declare abstract class Organization extends EventDispatcher<OrganizationE
|
|
43
44
|
* Get organization members
|
44
45
|
*/
|
45
46
|
abstract members(): Promise<UserDto[]>;
|
47
|
+
/**
|
48
|
+
* Get organization statistics
|
49
|
+
* @param dateFrom
|
50
|
+
* @param dateTo
|
51
|
+
*/
|
52
|
+
abstract statistics(dateFrom: number, dateTo: number): Promise<StatisticsResponse>;
|
53
|
+
/**
|
54
|
+
* Get organization statistics
|
55
|
+
* @param dateFrom
|
56
|
+
* @param dateTo
|
57
|
+
*/
|
58
|
+
abstract membersStatistics(dateFrom: number, dateTo: number): Promise<UsersStatisticsResponse>;
|
59
|
+
/**
|
60
|
+
* Get statistics for user
|
61
|
+
* @param dateFrom
|
62
|
+
* @param dateTo
|
63
|
+
*/
|
64
|
+
abstract userStatistic(userid: string, dateFrom: number, dateTo: number): Promise<StatisticsResponse>;
|
46
65
|
/**
|
47
66
|
* Change organization name and description.
|
48
67
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,8BAAsB,YAAa,SAAQ,eAAe,CACxD,iBAAiB,EACjB,YAAY,CACb;IACC;;OAEG;IACH,QAAQ,KAAK,EAAE,IAAI,cAAc,CAAA;IAEjC;;OAEG;IACH,QAAQ,KAAK,IAAI,IAAI,MAAM,CAAA;IAE3B;;OAEG;IACH,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAA;IAElC;;OAEG;IACH,QAAQ,KAAK,UAAU,IAAI,UAAU,CAAA;IAErC;;OAEG;IACH,QAAQ,KAAK,KAAK,IAAI,KAAK,CAAA;IAE3B;;OAEG;IACH,QAAQ,KAAK,YAAY,IAAI,MAAM,CAAA;IAEnC;;OAEG;IACH,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAEtC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAGlF;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAG9F;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAErG;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAEjE;;OAEG;IACH,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CACpF"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { OrganizationId } from "./organizations";
|
2
2
|
import { Disposable } from "../../disposable";
|
3
|
-
import { OrganizationDto, UserDto } from "../../dto/userInfoResponse";
|
3
|
+
import { OrganizationDto, UserDto, UsersStatisticsResponse } from "../../dto/userInfoResponse";
|
4
4
|
import { Workspaces } from "../workspaces/workspaces";
|
5
5
|
import { Context } from "../../context";
|
6
6
|
import { Organization } from "./organization";
|
7
7
|
import { Groups } from "../groups/groups";
|
8
8
|
import { Chats } from "../chats/chats";
|
9
|
+
import { StatisticsResponse } from "../../dto/statisticsResponse";
|
9
10
|
export declare class OrganizationImpl extends Organization implements Disposable {
|
10
11
|
private readonly context;
|
11
12
|
private _isDisposed;
|
@@ -27,6 +28,9 @@ export declare class OrganizationImpl extends Organization implements Disposable
|
|
27
28
|
get chats(): Chats;
|
28
29
|
members(): Promise<UserDto[]>;
|
29
30
|
change(name: string, description: string): Promise<void>;
|
31
|
+
statistics(dateFrom: number, dateTo: number): Promise<StatisticsResponse>;
|
32
|
+
membersStatistics(dateFrom: number, dateTo: number): Promise<UsersStatisticsResponse>;
|
33
|
+
userStatistic(userId: string, dateFrom: number, dateTo: number): Promise<StatisticsResponse>;
|
30
34
|
createInviteLink(emails: string[], accessGroups: string[]): Promise<void>;
|
31
35
|
}
|
32
36
|
//# sourceMappingURL=organization.impl.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;
|
1
|
+
{"version":3,"file":"organization.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAGtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;A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,MAAM,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAgBhF"}
|
@@ -103,6 +103,39 @@ class OrganizationImpl extends organization_1.Organization {
|
|
103
103
|
data: this
|
104
104
|
});
|
105
105
|
}
|
106
|
+
async statistics(dateFrom, dateTo) {
|
107
|
+
var _a;
|
108
|
+
// send request to the server
|
109
|
+
const response = await ((_a = this.context
|
110
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Stats/organization").searchParam("organizationId", this.id).searchParam("dateFrom", dateFrom.toString()).searchParam("dateTo", dateTo.toString()).sendGet());
|
111
|
+
// check response status
|
112
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
113
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed during fetch of organization statistics ${this.id}`, response);
|
114
|
+
}
|
115
|
+
return await response.json();
|
116
|
+
}
|
117
|
+
async membersStatistics(dateFrom, dateTo) {
|
118
|
+
var _a;
|
119
|
+
// send request to the server
|
120
|
+
const response = await ((_a = this.context
|
121
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Stats/organization/members").searchParam("organizationId", this.id).searchParam("dateFrom", dateFrom.toString()).searchParam("dateTo", dateTo.toString()).sendGet());
|
122
|
+
// check response status
|
123
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
124
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed during fetch of organization members statistics ${this.id}`, response);
|
125
|
+
}
|
126
|
+
return await response.json();
|
127
|
+
}
|
128
|
+
async userStatistic(userId, dateFrom, dateTo) {
|
129
|
+
var _a;
|
130
|
+
// send request to the server
|
131
|
+
const response = await ((_a = this.context
|
132
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/Stats/user").searchParam("userId", userId).searchParam("organizationId", this.id).searchParam("dateFrom", dateFrom.toString()).searchParam("dateTo", dateTo.toString()).sendGet());
|
133
|
+
// check response status
|
134
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
135
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed during fetch of user statistics ${this.id}`, response);
|
136
|
+
}
|
137
|
+
return await response.json();
|
138
|
+
}
|
106
139
|
async createInviteLink(emails, accessGroups) {
|
107
140
|
var _a;
|
108
141
|
const response = await ((_a = this.context
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.impl.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":";;;AAIA,mEAA8D;AAE9D,iDAAgE;AAChE,uDAAkD;AAElD,oDAA+C;AAE/C,0DAAsD;AACtD,gEAA4D;
|
1
|
+
{"version":3,"file":"organization.impl.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.impl.ts"],"names":[],"mappings":";;;AAIA,mEAA8D;AAE9D,iDAAgE;AAChE,uDAAkD;AAElD,oDAA+C;AAE/C,0DAAsD;AACtD,gEAA4D;AAG5D,MAAa,gBAAiB,SAAQ,2BAAY;IAQhD,YAA6B,OAAgB;QAC3C,KAAK,EAAE,CAAA;QADoB,YAAO,GAAP,OAAO,CAAS;QAPrC,gBAAW,GAAY,KAAK,CAAA;QAC5B,aAAQ,GAAY,KAAK,CAAA;QAQ/B,IAAI,CAAC,WAAW,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACzD,IAAI,CAAC,aAAa,GAAG,IAAI,wBAAU,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACvD,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACjD,CAAC;IAEM,KAAK,CAAC,QAAQ,CACnB,OAAwB,EACxB,OAAgB;QAEhB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,QAAQ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AAY,CAAC;YACZ,cAAc,EAAE,IAAI,CAAC,EAAE;YACvB,MAAM,EAAE,MAAM;YACd,cAAc,EAAE,YAAY;SAC7B,CAAC,CAAA,CAAA;QACJ,IAAI,6BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnC,MAAM,6BAAa,CAAC,UAAU,CAC5B,gDAAgD,IAAI,CAAC,EAAE,EAAE,EACzD,QAAQ,CACT,CAAA;QACH,CAAC;IACH,CAAC;CACF;AAtND,4CAsNC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":";;;AAIA,yCAA8C;
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../../../src/storages/organizations/organization.ts"],"names":[],"mappings":";;;AAIA,yCAA8C;AAK9C;;GAEG;AACH,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;AACrB,CAAC,EAFW,iBAAiB,iCAAjB,iBAAiB,QAE5B;AAED;;GAEG;AACH,MAAsB,YAAa,SAAQ,wBAG1C;CAoEA;AAvED,oCAuEC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userProfile.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/user/userProfile.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,OAAO,CAAC,OAAO,CAAC,CAAkB;
|
1
|
+
{"version":3,"file":"userProfile.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/user/userProfile.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,OAAO,CAAC,OAAO,CAAC,CAAkB;IAGlC,IAAI,EAAE,IAAI,MAAM,CAKf;IAED,IAAI,IAAI,IAAI,MAAM,CAKjB;IAED,IAAI,KAAK,IAAI,MAAM,CAKlB;IAED,IAAI,SAAS,IAAI,OAAO,CAKvB;IAED,IAAI,WAAW,IAAI,OAAO,CAKzB;IAED,IAAI,SAAS,IAAI,IAAI,CAKpB;IAED,IAAI,UAAU,IAAI,IAAI,CAKrB;IAED,QAAQ,CAAC,OAAO,EAAE,gBAAgB;CAQnC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userProfile.impl.js","sourceRoot":"","sources":["../../../../src/storages/user/userProfile.impl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAGtD,MAAa,eAAgB,SAAQ,yBAAW;
|
1
|
+
{"version":3,"file":"userProfile.impl.js","sourceRoot":"","sources":["../../../../src/storages/user/userProfile.impl.ts"],"names":[],"mappings":";;;AAAA,+CAAsD;AAGtD,MAAa,eAAgB,SAAQ,yBAAW;IAI9C,IAAI,EAAE;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;QAC7B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,IAAI;QACN,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;QACvC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,KAAK;QACP,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA;QACxC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,SAAS;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAA;QACpC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,WAAW;QACb,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAA;QAC1C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,SAAS;QACX,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC/C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAChD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;IAC/C,CAAC;IAED,QAAQ,CAAC,OAAyB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,CAAC;YACZ,IAAI,EAAE,uBAAS,CAAC,OAAO;YACvB,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;CAEF;AA7DD,0CA6DC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"browserUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/browserUtils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"browserUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/browserUtils.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,SAAS,SAAU,MAAM,SAAS,MAAM,GAAG,SAAS,KAAG,IAGnE,CAAA;AAED,eAAO,MAAM,SAAS,SAAU,MAAM,KAAG,MAAM,GAAG,SAkBjD,CAAA;AAED,eAAO,MAAM,iBAAiB,wBAY7B,CAAA"}
|
@@ -13,9 +13,7 @@ const getNavigator = () => {
|
|
13
13
|
if (!globalThis.navigator) {
|
14
14
|
globalThis.navigator = {
|
15
15
|
userAgent: "",
|
16
|
-
|
17
|
-
hardwareConcurrency: 0,
|
18
|
-
cookieEnabled: false
|
16
|
+
hardwareConcurrency: 0
|
19
17
|
};
|
20
18
|
}
|
21
19
|
return navigator;
|
@@ -56,9 +54,7 @@ const createFingerprint = () => {
|
|
56
54
|
const win = getWidow();
|
57
55
|
const fingerprint = new Map();
|
58
56
|
fingerprint.set("userAgent", nav.userAgent);
|
59
|
-
fingerprint.set("language", nav.language);
|
60
57
|
fingerprint.set("hardware_concurrency", nav.hardwareConcurrency);
|
61
|
-
fingerprint.set("cookie_enabled", nav.cookieEnabled);
|
62
58
|
fingerprint.set("pixel_ratio", win.devicePixelRatio);
|
63
59
|
fingerprint.set("session_storage", win.sessionStorage);
|
64
60
|
fingerprint.set("local_storage", win.localStorage);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"browserUtils.js","sourceRoot":"","sources":["../../../src/utils/browserUtils.ts"],"names":[],"mappings":";;;AAAA,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,IAAI,CAAE,UAAkB,CAAC,QAAQ,EAAE,CAAC;QACjC,UAAkB,CAAC,QAAQ,GAAG;YAC7B,MAAM,EAAE,EAAE;SACX,CAAA;IACH,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,IAAI,CAAE,UAAkB,CAAC,SAAS,EAAE,CAAC;QAClC,UAAkB,CAAC,SAAS,GAAG;Y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B"}
|
package/package.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { WorkspaceDto } from "./workspacesResponse"
|
2
2
|
import { UserId } from "../storages/user/userProfile"
|
3
3
|
import { OrganizationId } from "../storages/organizations/organizations"
|
4
|
+
import { StatisticsData } from "./statisticsResponse"
|
4
5
|
|
5
6
|
export interface UserInfoResponse {
|
6
7
|
adminInOrganization: string[]
|
@@ -48,3 +49,14 @@ export interface OrganizationWorkspaces extends OrganizationDto {
|
|
48
49
|
export interface MembersResponse {
|
49
50
|
members: UserDto
|
50
51
|
}
|
52
|
+
|
53
|
+
export interface UsersStatisticsResponse {
|
54
|
+
dateFrom: number
|
55
|
+
dateTo: number
|
56
|
+
membersData: UsetStatisticsData[]
|
57
|
+
}
|
58
|
+
|
59
|
+
export interface UsetStatisticsData {
|
60
|
+
userId: UserId
|
61
|
+
data: StatisticsData[]
|
62
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { OrganizationId } from "./organizations"
|
2
2
|
import { Disposable } from "../../disposable"
|
3
|
-
import { OrganizationDto, UserDto } from "../../dto/userInfoResponse"
|
3
|
+
import { OrganizationDto, UserDto, UsersStatisticsResponse } from "../../dto/userInfoResponse"
|
4
4
|
import { Workspaces } from "../workspaces/workspaces"
|
5
5
|
import { WorkspacesImpl } from "../workspaces/workspaces.impl"
|
6
6
|
import { Context } from "../../context"
|
@@ -11,6 +11,7 @@ import { ChatsImpl } from "../chats/chats.impl"
|
|
11
11
|
import { Chats } from "../chats/chats"
|
12
12
|
import { RpcService } from "../../services/rpcService"
|
13
13
|
import { ResponseUtils } from "../../services/responseUtils"
|
14
|
+
import { StatisticsResponse } from "../../dto/statisticsResponse"
|
14
15
|
|
15
16
|
export class OrganizationImpl extends Organization implements Disposable {
|
16
17
|
private _isDisposed: boolean = false
|
@@ -146,6 +147,70 @@ export class OrganizationImpl extends Organization implements Disposable {
|
|
146
147
|
})
|
147
148
|
}
|
148
149
|
|
150
|
+
async statistics(dateFrom: number, dateTo: number): Promise<StatisticsResponse> {
|
151
|
+
// send request to the server
|
152
|
+
const response = await this.context
|
153
|
+
.resolve(RpcService)
|
154
|
+
?.requestBuilder("api/v1/Stats/organization")
|
155
|
+
.searchParam("organizationId", this.id)
|
156
|
+
.searchParam("dateFrom", dateFrom.toString())
|
157
|
+
.searchParam("dateTo", dateTo.toString())
|
158
|
+
.sendGet()
|
159
|
+
|
160
|
+
// check response status
|
161
|
+
if (ResponseUtils.isFail(response)) {
|
162
|
+
await ResponseUtils.throwError(
|
163
|
+
`Failed during fetch of organization statistics ${this.id}`,
|
164
|
+
response
|
165
|
+
)
|
166
|
+
}
|
167
|
+
|
168
|
+
return await response!.json() as StatisticsResponse
|
169
|
+
}
|
170
|
+
|
171
|
+
async membersStatistics(dateFrom: number, dateTo: number): Promise<UsersStatisticsResponse> {
|
172
|
+
// send request to the server
|
173
|
+
const response = await this.context
|
174
|
+
.resolve(RpcService)
|
175
|
+
?.requestBuilder("api/v1/Stats/organization/members")
|
176
|
+
.searchParam("organizationId", this.id)
|
177
|
+
.searchParam("dateFrom", dateFrom.toString())
|
178
|
+
.searchParam("dateTo", dateTo.toString())
|
179
|
+
.sendGet()
|
180
|
+
|
181
|
+
// check response status
|
182
|
+
if (ResponseUtils.isFail(response)) {
|
183
|
+
await ResponseUtils.throwError(
|
184
|
+
`Failed during fetch of organization members statistics ${this.id}`,
|
185
|
+
response
|
186
|
+
)
|
187
|
+
}
|
188
|
+
|
189
|
+
return await response!.json() as UsersStatisticsResponse
|
190
|
+
}
|
191
|
+
|
192
|
+
async userStatistic(userId: string, dateFrom: number, dateTo: number): Promise<StatisticsResponse> {
|
193
|
+
// send request to the server
|
194
|
+
const response = await this.context
|
195
|
+
.resolve(RpcService)
|
196
|
+
?.requestBuilder("api/v1/Stats/user")
|
197
|
+
.searchParam("userId", userId)
|
198
|
+
.searchParam("organizationId", this.id)
|
199
|
+
.searchParam("dateFrom", dateFrom.toString())
|
200
|
+
.searchParam("dateTo", dateTo.toString())
|
201
|
+
.sendGet()
|
202
|
+
|
203
|
+
// check response status
|
204
|
+
if (ResponseUtils.isFail(response)) {
|
205
|
+
await ResponseUtils.throwError(
|
206
|
+
`Failed during fetch of user statistics ${this.id}`,
|
207
|
+
response
|
208
|
+
)
|
209
|
+
}
|
210
|
+
|
211
|
+
return await response!.json() as StatisticsResponse
|
212
|
+
}
|
213
|
+
|
149
214
|
async createInviteLink(emails: string[], accessGroups: string[]): Promise<void> {
|
150
215
|
const response = await this.context
|
151
216
|
.resolve(RpcService)
|
@@ -3,8 +3,9 @@ import { OrganizationId } from "./organizations"
|
|
3
3
|
import { Groups } from "../groups/groups"
|
4
4
|
import { Chats } from "../chats/chats"
|
5
5
|
import { EventDispatcher } from "../../events"
|
6
|
-
import { UserDto } from "../../dto/userInfoResponse"
|
6
|
+
import { UserDto, UsersStatisticsResponse } from "../../dto/userInfoResponse"
|
7
7
|
import { GroupId } from "../groups/group"
|
8
|
+
import { StatisticsResponse } from "../../dto/statisticsResponse"
|
8
9
|
|
9
10
|
/**
|
10
11
|
* Organization event.
|
@@ -55,6 +56,29 @@ export abstract class Organization extends EventDispatcher<
|
|
55
56
|
*/
|
56
57
|
abstract members(): Promise<UserDto[]>
|
57
58
|
|
59
|
+
/**
|
60
|
+
* Get organization statistics
|
61
|
+
* @param dateFrom
|
62
|
+
* @param dateTo
|
63
|
+
*/
|
64
|
+
abstract statistics(dateFrom: number, dateTo: number): Promise<StatisticsResponse>
|
65
|
+
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Get organization statistics
|
69
|
+
* @param dateFrom
|
70
|
+
* @param dateTo
|
71
|
+
*/
|
72
|
+
abstract membersStatistics(dateFrom: number, dateTo: number): Promise<UsersStatisticsResponse>
|
73
|
+
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Get statistics for user
|
77
|
+
* @param dateFrom
|
78
|
+
* @param dateTo
|
79
|
+
*/
|
80
|
+
abstract userStatistic(userid: string, dateFrom: number, dateTo: number): Promise<StatisticsResponse>
|
81
|
+
|
58
82
|
/**
|
59
83
|
* Change organization name and description.
|
60
84
|
*/
|
@@ -4,6 +4,7 @@ import { UserInfoResponse } from "../../dto/userInfoResponse"
|
|
4
4
|
export class UserProfileImpl extends UserProfile {
|
5
5
|
private content?: UserInfoResponse
|
6
6
|
|
7
|
+
|
7
8
|
get id(): string {
|
8
9
|
if (this.content) {
|
9
10
|
return this.content.user.id
|
@@ -60,4 +61,5 @@ export class UserProfileImpl extends UserProfile {
|
|
60
61
|
data: this
|
61
62
|
})
|
62
63
|
}
|
64
|
+
|
63
65
|
}
|
@@ -11,9 +11,7 @@ const getNavigator = () => {
|
|
11
11
|
if (!(globalThis as any).navigator) {
|
12
12
|
(globalThis as any).navigator = {
|
13
13
|
userAgent: "",
|
14
|
-
|
15
|
-
hardwareConcurrency: 0,
|
16
|
-
cookieEnabled: false
|
14
|
+
hardwareConcurrency: 0
|
17
15
|
}
|
18
16
|
}
|
19
17
|
return navigator
|
@@ -61,9 +59,7 @@ export const createFingerprint = () => {
|
|
61
59
|
const fingerprint = new Map<string, any>()
|
62
60
|
|
63
61
|
fingerprint.set("userAgent", nav.userAgent)
|
64
|
-
fingerprint.set("language", nav.language)
|
65
62
|
fingerprint.set("hardware_concurrency", nav.hardwareConcurrency)
|
66
|
-
fingerprint.set("cookie_enabled", nav.cookieEnabled)
|
67
63
|
fingerprint.set("pixel_ratio", win.devicePixelRatio)
|
68
64
|
fingerprint.set("session_storage", win.sessionStorage)
|
69
65
|
fingerprint.set("local_storage", win.localStorage)
|