@binalyze/air-sdk 5.4.0 → 5.4.2
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/dist/air/AIR.d.ts +13 -12
- package/dist/air/AIR.js +1 -0
- package/dist/air/AIR.js.map +1 -1
- package/dist/domains/acquisitions.d.ts +2 -2
- package/dist/domains/acquisitions.js.map +1 -1
- package/dist/domains/api-tokens.d.ts +2 -2
- package/dist/domains/api-tokens.js.map +1 -1
- package/dist/domains/assets.d.ts +2 -2
- package/dist/domains/assets.js +20 -32
- package/dist/domains/assets.js.map +1 -1
- package/dist/domains/baseline.d.ts +2 -2
- package/dist/domains/baseline.js.map +1 -1
- package/dist/domains/cases.d.ts +2 -2
- package/dist/domains/cases.js +12 -43
- package/dist/domains/cases.js.map +1 -1
- package/dist/domains/index.d.ts +1 -0
- package/dist/domains/index.js +1 -0
- package/dist/domains/index.js.map +1 -1
- package/dist/domains/interact.d.ts +2 -2
- package/dist/domains/interact.js +30 -18
- package/dist/domains/interact.js.map +1 -1
- package/dist/domains/investigation.d.ts +2 -0
- package/dist/domains/investigation.js +118 -0
- package/dist/domains/investigation.js.map +1 -0
- package/dist/domains/organization.d.ts +2 -2
- package/dist/domains/organization.js +24 -15
- package/dist/domains/organization.js.map +1 -1
- package/dist/domains/repositories.d.ts +2 -2
- package/dist/domains/repositories.js.map +1 -1
- package/dist/domains/tasks.d.ts +2 -2
- package/dist/domains/tasks.js.map +1 -1
- package/dist/domains/triage.d.ts +2 -2
- package/dist/domains/triage.js +57 -45
- package/dist/domains/triage.js.map +1 -1
- package/dist/domains/users.d.ts +2 -2
- package/dist/domains/users.js.map +1 -1
- package/dist/sdk/typescript-axios/sdk.gen.d.ts +2 -2
- package/dist/sdk/typescript-axios/sdk.gen.js +13 -7
- package/dist/sdk/typescript-axios/sdk.gen.js.map +1 -1
- package/dist/sdk/typescript-axios/types.gen.d.ts +730 -365
- package/dist/types/acquisitions.d.ts +3 -3
- package/dist/types/api-tokens.d.ts +8 -8
- package/dist/types/assets.d.ts +27 -39
- package/dist/types/baseline.d.ts +12 -12
- package/dist/types/cases.d.ts +27 -42
- package/dist/types/common.d.ts +27 -0
- package/dist/types/common.js +3 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/interact.d.ts +12 -12
- package/dist/types/investigation.d.ts +75 -0
- package/dist/types/investigation.js +3 -0
- package/dist/types/investigation.js.map +1 -0
- package/dist/types/organization.d.ts +13 -22
- package/dist/types/organization.js +3 -0
- package/dist/types/organization.js.map +1 -1
- package/dist/types/repositories.d.ts +9 -13
- package/dist/types/repositories.js +1 -0
- package/dist/types/repositories.js.map +1 -1
- package/dist/types/tasks.d.ts +25 -34
- package/dist/types/triage.d.ts +8 -8
- package/dist/types/users.d.ts +9 -13
- package/dist/types/users.js +1 -0
- package/dist/types/users.js.map +1 -1
- package/dist/utils/builders.d.ts +26 -0
- package/dist/utils/builders.js +85 -0
- package/dist/utils/builders.js.map +1 -0
- package/dist/utils/error-helpers.d.ts +6 -0
- package/dist/utils/error-helpers.js +109 -0
- package/dist/utils/error-helpers.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/result.d.ts +2 -0
- package/dist/utils/result.js +19 -0
- package/dist/utils/result.js.map +1 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +3 -1
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AcquisitionProfileDto, AssignedTaskDto } from '../generated/bindings';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IAssignedTask extends AssignedTaskDto {
|
|
3
3
|
}
|
|
4
|
-
export interface
|
|
4
|
+
export interface IAcquisitionsAPI {
|
|
5
5
|
getProfile: (options: {
|
|
6
6
|
id: string;
|
|
7
7
|
}) => Promise<AcquisitionProfileDto>;
|
|
@@ -11,5 +11,5 @@ export interface AcquisitionsAPI {
|
|
|
11
11
|
endpointId: string;
|
|
12
12
|
caseId?: string;
|
|
13
13
|
taskName?: string;
|
|
14
|
-
}) => Promise<Array<
|
|
14
|
+
}) => Promise<Array<IAssignedTask>>;
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ApiTokensCreateData, ApiTokensDeleteResponses, ApiTokensUpdateData } from '../generated/bindings';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IApiToken {
|
|
3
3
|
_id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string | null;
|
|
@@ -11,7 +11,7 @@ export interface ApiToken {
|
|
|
11
11
|
createdAt?: string;
|
|
12
12
|
updatedAt?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface IApiTokensPage extends Array<IApiToken> {
|
|
15
15
|
_pagination?: {
|
|
16
16
|
totalEntityCount?: number;
|
|
17
17
|
pageSize?: number;
|
|
@@ -19,24 +19,24 @@ export interface ApiTokensPage extends Array<ApiToken> {
|
|
|
19
19
|
totalPageCount?: number;
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export interface
|
|
22
|
+
export interface IGetApiTokensOptions {
|
|
23
23
|
organizationIds?: number | number[];
|
|
24
24
|
pageNumber?: number;
|
|
25
25
|
pageSize?: number;
|
|
26
26
|
searchTerm?: string;
|
|
27
27
|
}
|
|
28
|
-
export interface
|
|
28
|
+
export interface IApiTokensAPI {
|
|
29
29
|
get: (options: {
|
|
30
30
|
id: string;
|
|
31
|
-
}) => Promise<
|
|
32
|
-
getMany: (options?:
|
|
31
|
+
}) => Promise<IApiToken>;
|
|
32
|
+
getMany: (options?: IGetApiTokensOptions) => Promise<IApiTokensPage>;
|
|
33
33
|
create: (options: {
|
|
34
34
|
input: ApiTokensCreateData['body'];
|
|
35
|
-
}) => Promise<
|
|
35
|
+
}) => Promise<IApiToken>;
|
|
36
36
|
update: (options: {
|
|
37
37
|
id: string;
|
|
38
38
|
input?: ApiTokensUpdateData['body'];
|
|
39
|
-
}) => Promise<
|
|
39
|
+
}) => Promise<IApiToken>;
|
|
40
40
|
delete: (options: {
|
|
41
41
|
id: string;
|
|
42
42
|
}) => Promise<ApiTokensDeleteResponses[200]>;
|
package/dist/types/assets.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AddTagsToEndpointsByFilterDto, AssetsAddTagsData, AssetsAssignIsolationTaskData, AssetsAssignIsolationTaskResponses, AssetsAssignRebootTaskData, AssetsAssignRebootTaskResponses, AssetsAssignShutdownTaskData, AssetsAssignShutdownTaskResponses, AssetsGetManyData, AssetsGetMany4Data, AssetsGetTasksData, AssetsRemoveTagsData, FilterEndpointDto, FilterEndpointTasksDto, RemoveTagsFromEndpointsByFilterDto, RebootEndpointDto, SetIsolationOnEndpointDto, ShutdownEndpointDto } from '../generated/bindings';
|
|
2
|
-
|
|
2
|
+
import type { IReadonlyPage, IPaginationMetadata } from './common';
|
|
3
|
+
export interface IAssetEntity {
|
|
3
4
|
_id: string;
|
|
4
5
|
name?: string;
|
|
5
6
|
buildArch?: string;
|
|
@@ -43,16 +44,12 @@ export interface AssetEntity {
|
|
|
43
44
|
versionUpdating?: boolean;
|
|
44
45
|
managedStatus?: string;
|
|
45
46
|
}
|
|
46
|
-
export interface
|
|
47
|
-
_pagination?:
|
|
48
|
-
totalEntityCount?: number;
|
|
49
|
-
pageSize?: number;
|
|
50
|
-
currentPage?: number;
|
|
51
|
-
totalPageCount?: number;
|
|
52
|
-
};
|
|
47
|
+
export interface IAssetsPage extends Array<IAssetEntity> {
|
|
48
|
+
_pagination?: IPaginationMetadata;
|
|
53
49
|
}
|
|
54
|
-
export type
|
|
55
|
-
export
|
|
50
|
+
export type IReadonlyAssetsPage = IReadonlyPage<IAssetEntity>;
|
|
51
|
+
export type Asset = IAssetEntity;
|
|
52
|
+
export interface IAssetTaskEntity {
|
|
56
53
|
_id: string;
|
|
57
54
|
taskId?: string;
|
|
58
55
|
name?: string;
|
|
@@ -75,34 +72,25 @@ export interface AssetTaskEntity {
|
|
|
75
72
|
response?: Record<string, unknown>;
|
|
76
73
|
reportUrl?: string;
|
|
77
74
|
}
|
|
78
|
-
export interface
|
|
79
|
-
_pagination?:
|
|
80
|
-
totalEntityCount?: number;
|
|
81
|
-
pageSize?: number;
|
|
82
|
-
currentPage?: number;
|
|
83
|
-
totalPageCount?: number;
|
|
84
|
-
};
|
|
75
|
+
export interface IAssetTasksPage extends Array<IAssetTaskEntity> {
|
|
76
|
+
_pagination?: IPaginationMetadata;
|
|
85
77
|
}
|
|
78
|
+
export type IReadonlyAssetTasksPage = IReadonlyPage<IAssetTaskEntity>;
|
|
86
79
|
export type AssetAssignedTask = (AssetsAssignRebootTaskResponses[201] extends Array<infer R> ? R : never) | (AssetsAssignShutdownTaskResponses[201] extends Array<infer R> ? R : never) | (AssetsAssignIsolationTaskResponses[201] extends Array<infer R> ? R : never);
|
|
87
|
-
export interface
|
|
88
|
-
_pagination?:
|
|
89
|
-
totalEntityCount?: number;
|
|
90
|
-
pageSize?: number;
|
|
91
|
-
currentPage?: number;
|
|
92
|
-
totalPageCount?: number;
|
|
93
|
-
};
|
|
80
|
+
export interface IAssetAssignedTasksPage extends Array<IAssetAssignedTaskEntity> {
|
|
81
|
+
_pagination?: IPaginationMetadata;
|
|
94
82
|
}
|
|
95
|
-
export interface
|
|
83
|
+
export interface IGetAssetsOptions {
|
|
96
84
|
pageNumber?: number;
|
|
97
85
|
pageSize?: number;
|
|
98
86
|
sortBy?: NonNullable<AssetsGetManyData['query']>['sortBy'];
|
|
99
87
|
sortType?: NonNullable<AssetsGetManyData['query']>['sortType'];
|
|
100
88
|
filter?: Partial<FilterEndpointDto>;
|
|
101
89
|
}
|
|
102
|
-
export interface
|
|
90
|
+
export interface IGetAssetOptions {
|
|
103
91
|
id: AssetsGetMany4Data['path']['id'];
|
|
104
92
|
}
|
|
105
|
-
export interface
|
|
93
|
+
export interface IGetAssetTasksOptions {
|
|
106
94
|
id: AssetsGetTasksData['path']['id'];
|
|
107
95
|
pageNumber?: number;
|
|
108
96
|
pageSize?: number;
|
|
@@ -110,13 +98,13 @@ export interface GetAssetTasksOptions {
|
|
|
110
98
|
sortType?: NonNullable<AssetsGetTasksData['query']>['sortType'];
|
|
111
99
|
filter?: FilterEndpointTasksDto;
|
|
112
100
|
}
|
|
113
|
-
export interface
|
|
101
|
+
export interface IUpdateAssetTagsOptions {
|
|
114
102
|
filter?: Partial<FilterEndpointDto> & {
|
|
115
103
|
organizationIds?: number[];
|
|
116
104
|
};
|
|
117
105
|
tags: AddTagsToEndpointsByFilterDto['tags'];
|
|
118
106
|
}
|
|
119
|
-
export interface
|
|
107
|
+
export interface IRemoveAssetTagsOptions {
|
|
120
108
|
filter?: Partial<FilterEndpointDto> & {
|
|
121
109
|
organizationIds?: number[];
|
|
122
110
|
};
|
|
@@ -130,13 +118,13 @@ export type AssignIsolationTaskOptions = Omit<SetIsolationOnEndpointDto, 'organi
|
|
|
130
118
|
};
|
|
131
119
|
export type AssignRebootTaskOptions = RebootEndpointDto;
|
|
132
120
|
export type AssignShutdownTaskOptions = ShutdownEndpointDto;
|
|
133
|
-
export interface
|
|
134
|
-
get: (options:
|
|
135
|
-
getMany: (options?:
|
|
136
|
-
getTasks: (options:
|
|
137
|
-
addTags: (options:
|
|
138
|
-
removeTags: (options:
|
|
139
|
-
assignIsolationTask: (options: AssignIsolationTaskOptions) => Promise<
|
|
121
|
+
export interface IAssetsAPI {
|
|
122
|
+
get: (options: IGetAssetOptions) => Promise<Asset>;
|
|
123
|
+
getMany: (options?: IGetAssetsOptions) => Promise<IAssetsPage>;
|
|
124
|
+
getTasks: (options: IGetAssetTasksOptions) => Promise<IAssetTasksPage>;
|
|
125
|
+
addTags: (options: IUpdateAssetTagsOptions) => Promise<IAddTagsResult>;
|
|
126
|
+
removeTags: (options: IRemoveAssetTagsOptions) => Promise<RemoveTagsResult>;
|
|
127
|
+
assignIsolationTask: (options: AssignIsolationTaskOptions) => Promise<IAssetAssignedTasksPage>;
|
|
140
128
|
assignRebootTask: (options: AssignRebootTaskOptions) => Promise<AssetAssignedTask[]>;
|
|
141
129
|
assignShutdownTask: (options: AssignShutdownTaskOptions) => Promise<AssetAssignedTask[]>;
|
|
142
130
|
}
|
|
@@ -145,14 +133,14 @@ export type AssetsRemoveTagsPayload = AssetsRemoveTagsData['body'];
|
|
|
145
133
|
export type AssetsAssignIsolationTaskPayload = AssetsAssignIsolationTaskData['body'];
|
|
146
134
|
export type AssetsAssignRebootTaskPayload = AssetsAssignRebootTaskData['body'];
|
|
147
135
|
export type AssetsAssignShutdownTaskPayload = AssetsAssignShutdownTaskData['body'];
|
|
148
|
-
export interface
|
|
136
|
+
export interface IAddTagsResult {
|
|
149
137
|
success: boolean;
|
|
150
138
|
statusCode?: number;
|
|
151
139
|
message?: string;
|
|
152
140
|
matchedCount?: number;
|
|
153
141
|
}
|
|
154
|
-
export type RemoveTagsResult =
|
|
155
|
-
export interface
|
|
142
|
+
export type RemoveTagsResult = IAddTagsResult;
|
|
143
|
+
export interface IAssetAssignedTaskEntity {
|
|
156
144
|
_id: string;
|
|
157
145
|
name: string;
|
|
158
146
|
organizationId: number;
|
package/dist/types/baseline.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import type { AssignedTaskDto } from '../generated/bindings';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IBaselineAssignedTask extends AssignedTaskDto {
|
|
3
3
|
taskId: string;
|
|
4
4
|
taskName?: string;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface IBaselineAcquireFilter {
|
|
7
7
|
organizationIds?: number[];
|
|
8
8
|
includedEndpointIds?: string[];
|
|
9
9
|
excludedEndpointIds?: string[];
|
|
10
10
|
[key: string]: unknown;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
13
|
-
filter:
|
|
12
|
+
export interface IBaselineAcquireOptions {
|
|
13
|
+
filter: IBaselineAcquireFilter;
|
|
14
14
|
caseId?: string;
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface IBaselineCompareOptions {
|
|
17
17
|
taskIds: string[];
|
|
18
18
|
endpointId?: string;
|
|
19
19
|
vendorDeviceId?: string;
|
|
20
20
|
taskName?: string;
|
|
21
21
|
caseId?: string;
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface IBaselineComparisonReportOptions {
|
|
24
24
|
endpointId: string;
|
|
25
25
|
taskId: string;
|
|
26
26
|
}
|
|
27
|
-
export interface
|
|
27
|
+
export interface IBaselineComparisonReportByVendorDeviceIdOptions {
|
|
28
28
|
vendorDeviceId: string;
|
|
29
29
|
taskId: string;
|
|
30
30
|
}
|
|
31
|
-
export interface
|
|
32
|
-
acquire: (options:
|
|
33
|
-
compare: (options:
|
|
34
|
-
getComparisonReport: (options:
|
|
35
|
-
getComparisonReportByVendorDeviceId: (options:
|
|
31
|
+
export interface IBaselineAPI {
|
|
32
|
+
acquire: (options: IBaselineAcquireOptions) => Promise<IBaselineAssignedTask[]>;
|
|
33
|
+
compare: (options: IBaselineCompareOptions) => Promise<IBaselineAssignedTask>;
|
|
34
|
+
getComparisonReport: (options: IBaselineComparisonReportOptions) => Promise<string>;
|
|
35
|
+
getComparisonReportByVendorDeviceId: (options: IBaselineComparisonReportByVendorDeviceIdOptions) => Promise<string>;
|
|
36
36
|
}
|
package/dist/types/cases.d.ts
CHANGED
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type Case = CaseDto & CaseEntity;
|
|
9
|
-
export interface CasesPage extends Array<Case> {
|
|
10
|
-
_pagination?: {
|
|
11
|
-
totalEntityCount?: number;
|
|
12
|
-
pageSize?: number;
|
|
13
|
-
currentPage?: number;
|
|
14
|
-
totalPageCount?: number;
|
|
15
|
-
};
|
|
1
|
+
import type { CaseResponseDto, CreateCaseDto, FilterCaseActivitiesDto, FilterCaseTasksDto, FilterCaseUsersDto, FilterUserCasesDto, FilterEndpointDto } from '../generated/bindings';
|
|
2
|
+
import type { IAssetsPage } from './assets';
|
|
3
|
+
import type { IReadonlyPage, IPaginationMetadata } from './common';
|
|
4
|
+
import type { ITaskAssignmentsPage } from './tasks';
|
|
5
|
+
export type Case = CaseResponseDto;
|
|
6
|
+
export interface ICasesPage extends Array<Case> {
|
|
7
|
+
_pagination?: IPaginationMetadata;
|
|
16
8
|
}
|
|
17
|
-
export
|
|
9
|
+
export type IReadonlyCasesPage = IReadonlyPage<Case>;
|
|
10
|
+
export interface IGetCasesOptions {
|
|
18
11
|
pageNumber?: number;
|
|
19
12
|
pageSize?: number;
|
|
20
13
|
sortBy?: string;
|
|
21
14
|
sortType?: 'ASC' | 'DESC';
|
|
22
15
|
filter?: Partial<FilterUserCasesDto>;
|
|
23
16
|
}
|
|
24
|
-
export interface
|
|
17
|
+
export interface ICasesAPI {
|
|
25
18
|
checkName: (options: {
|
|
26
19
|
name: string;
|
|
27
20
|
}) => Promise<boolean>;
|
|
28
21
|
get: (options: {
|
|
29
22
|
id: string;
|
|
30
23
|
}) => Promise<Case>;
|
|
31
|
-
getMany: (options?:
|
|
24
|
+
getMany: (options?: IGetCasesOptions) => Promise<ICasesPage>;
|
|
32
25
|
changeOwner: (options: {
|
|
33
26
|
id: string;
|
|
34
27
|
newOwnerId: string;
|
|
@@ -44,42 +37,42 @@ export interface CasesAPI {
|
|
|
44
37
|
pageNumber?: number;
|
|
45
38
|
pageSize?: number;
|
|
46
39
|
filter?: FilterCaseActivitiesDto;
|
|
47
|
-
}) => Promise<
|
|
40
|
+
}) => Promise<ICaseActivitiesPage>;
|
|
48
41
|
getEndpoints: (options: {
|
|
49
42
|
id: string;
|
|
50
43
|
pageNumber?: number;
|
|
51
44
|
pageSize?: number;
|
|
52
45
|
filter?: Partial<FilterEndpointDto>;
|
|
53
|
-
}) => Promise<
|
|
46
|
+
}) => Promise<IAssetsPage>;
|
|
54
47
|
getTasks: (options: {
|
|
55
48
|
id: string;
|
|
56
49
|
pageNumber?: number;
|
|
57
50
|
pageSize?: number;
|
|
58
51
|
filter?: FilterCaseTasksDto;
|
|
59
|
-
}) => Promise<
|
|
52
|
+
}) => Promise<ITaskAssignmentsPage>;
|
|
60
53
|
getUsers: (options: {
|
|
61
54
|
id: string;
|
|
62
55
|
pageNumber?: number;
|
|
63
56
|
pageSize?: number;
|
|
64
57
|
filter?: FilterCaseUsersDto;
|
|
65
|
-
}) => Promise<
|
|
58
|
+
}) => Promise<ICaseUsersPage>;
|
|
66
59
|
}
|
|
67
60
|
export type CreateCaseInput = Omit<CreateCaseDto, 'organizationId' | 'visibility' | 'assignedUserIds'> & {
|
|
68
61
|
organizationId?: number;
|
|
69
62
|
visibility?: NonNullable<CreateCaseDto['visibility']>;
|
|
70
63
|
assignedUserIds?: CreateCaseDto['assignedUserIds'];
|
|
71
64
|
};
|
|
72
|
-
export interface
|
|
65
|
+
export interface ICaseActivityOptions {
|
|
73
66
|
username?: string;
|
|
74
67
|
apiTokenName?: string;
|
|
75
68
|
eventOrigin?: string;
|
|
76
69
|
organizationIds?: number[];
|
|
77
70
|
}
|
|
78
|
-
export interface
|
|
71
|
+
export interface ICaseActivityData {
|
|
79
72
|
[key: string]: unknown;
|
|
80
73
|
name?: string;
|
|
81
74
|
caseId?: string;
|
|
82
|
-
options?:
|
|
75
|
+
options?: ICaseActivityOptions;
|
|
83
76
|
organizationId?: number;
|
|
84
77
|
organizationIds?: number[];
|
|
85
78
|
ownerUser?: string;
|
|
@@ -93,24 +86,20 @@ export interface CaseActivityData {
|
|
|
93
86
|
endpointId?: string;
|
|
94
87
|
endpointName?: string;
|
|
95
88
|
}
|
|
96
|
-
export interface
|
|
89
|
+
export interface ICaseActivityEntity {
|
|
97
90
|
id: number;
|
|
98
91
|
caseId: string;
|
|
99
92
|
type: string;
|
|
100
93
|
performedBy: string;
|
|
101
|
-
data:
|
|
94
|
+
data: ICaseActivityData;
|
|
102
95
|
createdAt: string;
|
|
103
96
|
description?: string | null;
|
|
104
97
|
}
|
|
105
|
-
export interface
|
|
106
|
-
_pagination?:
|
|
107
|
-
totalEntityCount?: number;
|
|
108
|
-
pageSize?: number;
|
|
109
|
-
currentPage?: number;
|
|
110
|
-
totalPageCount?: number;
|
|
111
|
-
};
|
|
98
|
+
export interface ICaseActivitiesPage extends Array<ICaseActivityEntity> {
|
|
99
|
+
_pagination?: IPaginationMetadata;
|
|
112
100
|
}
|
|
113
|
-
export
|
|
101
|
+
export type IReadonlyCaseActivitiesPage = IReadonlyPage<ICaseActivityEntity>;
|
|
102
|
+
export interface ICaseUserEntity {
|
|
114
103
|
_id: string;
|
|
115
104
|
email?: string;
|
|
116
105
|
username?: string;
|
|
@@ -133,11 +122,7 @@ export interface CaseUserEntity {
|
|
|
133
122
|
updatedAt?: string;
|
|
134
123
|
strategy?: string;
|
|
135
124
|
}
|
|
136
|
-
export interface
|
|
137
|
-
_pagination?:
|
|
138
|
-
totalEntityCount?: number;
|
|
139
|
-
pageSize?: number;
|
|
140
|
-
currentPage?: number;
|
|
141
|
-
totalPageCount?: number;
|
|
142
|
-
};
|
|
125
|
+
export interface ICaseUsersPage extends Array<ICaseUserEntity> {
|
|
126
|
+
_pagination?: IPaginationMetadata;
|
|
143
127
|
}
|
|
128
|
+
export type IReadonlyCaseUsersPage = IReadonlyPage<ICaseUserEntity>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface IPaginationMetadata {
|
|
2
|
+
totalEntityCount?: number;
|
|
3
|
+
pageSize?: number;
|
|
4
|
+
currentPage?: number;
|
|
5
|
+
totalPageCount?: number;
|
|
6
|
+
}
|
|
7
|
+
export type IReadonlyPage<T> = ReadonlyArray<T> & {
|
|
8
|
+
_pagination?: IPaginationMetadata;
|
|
9
|
+
};
|
|
10
|
+
export interface ISDKError {
|
|
11
|
+
message: string;
|
|
12
|
+
statusCode?: number;
|
|
13
|
+
code?: string;
|
|
14
|
+
}
|
|
15
|
+
export type ResultSuccess<T> = {
|
|
16
|
+
success: true;
|
|
17
|
+
result: T;
|
|
18
|
+
statusCode: number;
|
|
19
|
+
};
|
|
20
|
+
export type ResultFailure = {
|
|
21
|
+
success: false;
|
|
22
|
+
result: null;
|
|
23
|
+
statusCode: number;
|
|
24
|
+
message: string;
|
|
25
|
+
code?: string;
|
|
26
|
+
};
|
|
27
|
+
export type Result<T> = ResultSuccess<T> | ResultFailure;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":""}
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -25,4 +25,6 @@ __exportStar(require("./organization"), exports);
|
|
|
25
25
|
__exportStar(require("./repositories"), exports);
|
|
26
26
|
__exportStar(require("./tasks"), exports);
|
|
27
27
|
__exportStar(require("./triage"), exports);
|
|
28
|
+
__exportStar(require("./common"), exports);
|
|
29
|
+
__exportStar(require("./investigation"), exports);
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,0CAAwB;AACxB,6CAA2B;AAC3B,iDAA+B;AAC/B,iDAA+B;AAC/B,0CAAwB;AACxB,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,iDAA+B;AAC/B,2CAAyB;AACzB,+CAA6B;AAC7B,6CAA2B;AAC3B,0CAAwB;AACxB,6CAA2B;AAC3B,iDAA+B;AAC/B,iDAA+B;AAC/B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,kDAAgC"}
|
package/dist/types/interact.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { InteractShellAssignTaskData, InteractShellAssignTaskResponses, InteractSessionCloseData, InteractSessionCloseResponses, InteractSessionExecuteAsyncCommandData, InteractSessionExecuteAsyncCommandResponses, InteractSessionExecuteCommandData, InteractSessionExecuteCommandResponses, InteractSessionGetCommandMessageData, InteractSessionGetCommandMessageResponses, InteractSessionInterruptCommandData, InteractSessionInterruptCommandResponses } from '../generated/bindings';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IInteractCommandOption {
|
|
3
3
|
name: string;
|
|
4
4
|
abbreviations: string[];
|
|
5
5
|
effect: string;
|
|
6
6
|
required: boolean;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface IInteractCommand {
|
|
9
9
|
command: string[];
|
|
10
10
|
description?: string;
|
|
11
|
-
options:
|
|
11
|
+
options: IInteractCommandOption[];
|
|
12
12
|
privilege: string;
|
|
13
13
|
usage: string[];
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ export type InteractAsyncCommandResult = InteractSessionExecuteAsyncCommandRespo
|
|
|
18
18
|
export type InteractCommandMessage = InteractSessionGetCommandMessageResponses[200];
|
|
19
19
|
export type InteractInterruptCommandResult = InteractSessionInterruptCommandResponses[200];
|
|
20
20
|
export type InteractCloseSessionResult = InteractSessionCloseResponses[200];
|
|
21
|
-
export interface
|
|
21
|
+
export interface ICloseSessionResult {
|
|
22
22
|
success: boolean;
|
|
23
23
|
sessionId?: string;
|
|
24
24
|
statusCode?: number;
|
|
@@ -39,24 +39,24 @@ export type ExecuteInteractCommandOptions = InteractSessionExecuteCommandData['b
|
|
|
39
39
|
export type ExecuteInteractAsyncCommandOptions = InteractSessionExecuteAsyncCommandData['body'] & {
|
|
40
40
|
sessionId: InteractSessionExecuteAsyncCommandData['path']['sessionId'];
|
|
41
41
|
};
|
|
42
|
-
export interface
|
|
42
|
+
export interface IGetInteractCommandMessageOptions {
|
|
43
43
|
sessionId: InteractSessionGetCommandMessageData['path']['sessionId'];
|
|
44
44
|
messageId: InteractSessionGetCommandMessageData['path']['messageId'];
|
|
45
45
|
}
|
|
46
|
-
export interface
|
|
46
|
+
export interface IInterruptInteractCommandOptions {
|
|
47
47
|
sessionId: InteractSessionInterruptCommandData['path']['sessionId'];
|
|
48
48
|
messageId: InteractSessionInterruptCommandData['path']['messageId'];
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface ICloseInteractSessionOptions {
|
|
51
51
|
sessionId: InteractSessionCloseData['path']['sessionId'];
|
|
52
52
|
}
|
|
53
|
-
export interface
|
|
54
|
-
getCommands: () => Promise<
|
|
53
|
+
export interface IInteractAPI {
|
|
54
|
+
getCommands: () => Promise<IInteractCommand[]>;
|
|
55
55
|
createShellSession: (options: CreateInteractShellSessionOptions) => Promise<InteractShellSession>;
|
|
56
56
|
executeCommand: (options: ExecuteInteractCommandOptions) => Promise<InteractCommandExecutionResult>;
|
|
57
57
|
executeAsyncCommand: (options: ExecuteInteractAsyncCommandOptions) => Promise<InteractAsyncCommandResult>;
|
|
58
|
-
getCommandMessage: (options:
|
|
59
|
-
interruptCommand: (options:
|
|
60
|
-
closeSession: (options:
|
|
58
|
+
getCommandMessage: (options: IGetInteractCommandMessageOptions) => Promise<InteractCommandMessage>;
|
|
59
|
+
interruptCommand: (options: IInterruptInteractCommandOptions) => Promise<InteractInterruptCommandResult>;
|
|
60
|
+
closeSession: (options: ICloseInteractSessionOptions) => Promise<ICloseSessionResult>;
|
|
61
61
|
}
|
|
62
62
|
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { FilterInvestigationFindingsDtoWritable, FilterInvestigationActivitiesDtoWritable, InvestigationFindingsStructureResponseDto, InvestigationFindingsSummaryResponseDto, InvestigationMitreTacticDto, InvestigationActivityDto, InvestigationFindingDto } from '../generated/bindings';
|
|
2
|
+
import type { PageWithPagination } from '../utils';
|
|
3
|
+
export type InvestigationHubFindingsStructure = InvestigationFindingsStructureResponseDto;
|
|
4
|
+
export type InvestigationHubFinding = InvestigationFindingDto;
|
|
5
|
+
export type InvestigationHubFindings = PageWithPagination<InvestigationHubFinding>;
|
|
6
|
+
export type InvestigationHubFindingsSummary = InvestigationFindingsSummaryResponseDto;
|
|
7
|
+
export type InvestigationHubMitreTactic = InvestigationMitreTacticDto;
|
|
8
|
+
export type InvestigationActivityData = {
|
|
9
|
+
flagId?: number;
|
|
10
|
+
source?: string;
|
|
11
|
+
assetId?: string;
|
|
12
|
+
evidence?: string;
|
|
13
|
+
flagName?: string;
|
|
14
|
+
objectId?: number;
|
|
15
|
+
platform?: string;
|
|
16
|
+
username?: string;
|
|
17
|
+
assetName?: string;
|
|
18
|
+
flagDescription?: string;
|
|
19
|
+
taskAssignmentId?: string;
|
|
20
|
+
} & Record<string, unknown>;
|
|
21
|
+
export type InvestigationHubActivity = Omit<InvestigationActivityDto, 'data'> & {
|
|
22
|
+
data: InvestigationActivityData;
|
|
23
|
+
};
|
|
24
|
+
export type InvestigationActivitiesPage = PageWithPagination<InvestigationHubActivity>;
|
|
25
|
+
export interface IGetFindingsStructureOptions {
|
|
26
|
+
investigationId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IGetFindingsOptions {
|
|
29
|
+
investigationId: string;
|
|
30
|
+
assignmentIds?: string[];
|
|
31
|
+
/** alias accepted by wrapper; mapped to assignmentIds */
|
|
32
|
+
includedEndpointIds?: string[];
|
|
33
|
+
filter?: FilterInvestigationFindingsDtoWritable['filter'];
|
|
34
|
+
onlyExcludedFindings?: boolean;
|
|
35
|
+
skip?: number;
|
|
36
|
+
take?: number;
|
|
37
|
+
sort?: NonNullable<FilterInvestigationFindingsDtoWritable['sort']>;
|
|
38
|
+
}
|
|
39
|
+
export interface IGetFindingsSummaryOptions {
|
|
40
|
+
investigationId: string;
|
|
41
|
+
assignmentIds?: string[];
|
|
42
|
+
includedEndpointIds?: string[];
|
|
43
|
+
findingTypes?: string[];
|
|
44
|
+
flagIds?: number[];
|
|
45
|
+
findingCreatedBy?: ('DRONE' | 'USER')[];
|
|
46
|
+
mitreTechniqueIds?: string[];
|
|
47
|
+
mitreTacticIds?: string[];
|
|
48
|
+
dateTimeRange?: unknown;
|
|
49
|
+
}
|
|
50
|
+
export interface IGetMitreMatchesOptions {
|
|
51
|
+
investigationId: string;
|
|
52
|
+
assignmentIds?: string[];
|
|
53
|
+
includedEndpointIds?: string[];
|
|
54
|
+
findingTypes?: string[];
|
|
55
|
+
flagIds?: number[];
|
|
56
|
+
findingCreatedBy?: ('DRONE' | 'USER')[];
|
|
57
|
+
mitreTechniqueIds?: string[];
|
|
58
|
+
mitreTacticIds?: string[];
|
|
59
|
+
dateTimeRange?: unknown;
|
|
60
|
+
}
|
|
61
|
+
export interface IGetActivitiesOptions {
|
|
62
|
+
investigationId: string;
|
|
63
|
+
filter?: Partial<FilterInvestigationActivitiesDtoWritable>;
|
|
64
|
+
pageNumber?: number;
|
|
65
|
+
pageSize?: number;
|
|
66
|
+
sortBy?: string;
|
|
67
|
+
sortType?: 'ASC' | 'DESC';
|
|
68
|
+
}
|
|
69
|
+
export interface IInvestigationHubAPI {
|
|
70
|
+
getFindingsStructure: (options: IGetFindingsStructureOptions) => Promise<InvestigationHubFindingsStructure>;
|
|
71
|
+
getFindings: (options: IGetFindingsOptions) => Promise<InvestigationHubFindings>;
|
|
72
|
+
getFindingsSummary: (options: IGetFindingsSummaryOptions) => Promise<InvestigationHubFindingsSummary>;
|
|
73
|
+
getMitreMatches: (options: IGetMitreMatchesOptions) => Promise<InvestigationHubMitreTactic[]>;
|
|
74
|
+
getActivities: (options: IGetActivitiesOptions) => Promise<InvestigationActivitiesPage>;
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"investigation.js","sourceRoot":"","sources":["../../src/types/investigation.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import type { OrganizationsGetManyData, OrganizationGetResponses, OrganizationGetData, OrganizationCreateData, OrganizationCreateResponses, OrganizationUpdateData, OrganizationRemoveUsersData, OrganizationAssignUsersData, OrganizationRemoveTagsData, OrganizationAddTagsData, OrganizationGetUsersResponses, OrganizationUpdateShareableDeploymentStatusData, OrganizationUpdateDeploymentTokenData, FilterOrganizationUsersDto } from '../generated/bindings';
|
|
2
|
+
import type { IPaginationMetadata } from './common';
|
|
2
3
|
export type Organization = OrganizationGetResponses[200];
|
|
3
|
-
export
|
|
4
|
-
_pagination?:
|
|
5
|
-
|
|
6
|
-
pageSize?: number;
|
|
7
|
-
currentPage?: number;
|
|
8
|
-
totalPageCount?: number;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
4
|
+
export interface IOrganizationsPage extends Array<OrganizationListItem> {
|
|
5
|
+
_pagination?: IPaginationMetadata;
|
|
6
|
+
}
|
|
11
7
|
export type OrganizationUser = OrganizationGetUsersResponses[200] extends infer T ? T extends {
|
|
12
8
|
entities: Array<infer U>;
|
|
13
9
|
} ? U : unknown : unknown;
|
|
14
|
-
export
|
|
15
|
-
_pagination?:
|
|
16
|
-
|
|
17
|
-
pageSize?: number;
|
|
18
|
-
currentPage?: number;
|
|
19
|
-
totalPageCount?: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
10
|
+
export interface IOrganizationUsersPage extends Array<OrganizationUser> {
|
|
11
|
+
_pagination?: IPaginationMetadata;
|
|
12
|
+
}
|
|
22
13
|
export type OrganizationListItem = OrganizationCreateResponses[201];
|
|
23
|
-
export
|
|
14
|
+
export interface IAssignUsersResult {
|
|
24
15
|
organization: Organization;
|
|
25
16
|
requestedUserIds: string[];
|
|
26
17
|
assignedUserIds: string[];
|
|
27
18
|
notAssignedUserIds: string[];
|
|
28
|
-
}
|
|
29
|
-
export interface
|
|
19
|
+
}
|
|
20
|
+
export interface IOrganizationAPI {
|
|
30
21
|
addTags: (options: {
|
|
31
22
|
id?: number;
|
|
32
23
|
tags: OrganizationAddTagsData['body']['tags'];
|
|
@@ -34,7 +25,7 @@ export interface OrganizationAPI {
|
|
|
34
25
|
assignUsers: (options: {
|
|
35
26
|
id?: number;
|
|
36
27
|
userIds: OrganizationAssignUsersData['body']['userIds'];
|
|
37
|
-
}) => Promise<
|
|
28
|
+
}) => Promise<IAssignUsersResult>;
|
|
38
29
|
checkNameExists: (options: {
|
|
39
30
|
name: string;
|
|
40
31
|
}) => Promise<boolean>;
|
|
@@ -42,7 +33,7 @@ export interface OrganizationAPI {
|
|
|
42
33
|
input: OrganizationCreateData['body'];
|
|
43
34
|
}) => Promise<OrganizationListItem>;
|
|
44
35
|
get: (options?: OrganizationGetData['path']) => Promise<Organization>;
|
|
45
|
-
getMany: (options?: OrganizationsGetManyData['query']) => Promise<
|
|
36
|
+
getMany: (options?: OrganizationsGetManyData['query']) => Promise<IOrganizationsPage>;
|
|
46
37
|
getUsers: (options?: {
|
|
47
38
|
id?: number;
|
|
48
39
|
pageNumber?: number;
|
|
@@ -50,7 +41,7 @@ export interface OrganizationAPI {
|
|
|
50
41
|
sortType?: 'ASC' | 'DESC';
|
|
51
42
|
sortBy?: string;
|
|
52
43
|
filter?: FilterOrganizationUsersDto;
|
|
53
|
-
}) => Promise<
|
|
44
|
+
}) => Promise<IOrganizationUsersPage>;
|
|
54
45
|
removeTags: (options: {
|
|
55
46
|
id?: number;
|
|
56
47
|
tags: OrganizationRemoveTagsData['body']['tags'];
|