@binalyze/air-sdk 5.2.0 → 5.4.1
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 +18 -12
- package/dist/domains/acquisitions.js.map +1 -1
- package/dist/domains/api-tokens.d.ts +2 -2
- package/dist/domains/api-tokens.js +48 -26
- package/dist/domains/api-tokens.js.map +1 -1
- package/dist/domains/assets.d.ts +2 -2
- package/dist/domains/assets.js +121 -62
- package/dist/domains/assets.js.map +1 -1
- package/dist/domains/baseline.d.ts +2 -2
- package/dist/domains/baseline.js +46 -23
- package/dist/domains/baseline.js.map +1 -1
- package/dist/domains/cases.d.ts +2 -2
- package/dist/domains/cases.js +63 -60
- 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 +58 -24
- 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 +160 -49
- package/dist/domains/organization.js.map +1 -1
- package/dist/domains/repositories.d.ts +2 -2
- package/dist/domains/repositories.js +14 -7
- package/dist/domains/repositories.js.map +1 -1
- package/dist/domains/tasks.d.ts +2 -2
- package/dist/domains/tasks.js +28 -23
- package/dist/domains/tasks.js.map +1 -1
- package/dist/domains/triage.d.ts +2 -2
- package/dist/domains/triage.js +101 -23
- package/dist/domains/triage.js.map +1 -1
- package/dist/domains/users.d.ts +2 -2
- package/dist/domains/users.js +16 -9
- package/dist/domains/users.js.map +1 -1
- package/dist/generated/bindings.d.ts +1 -0
- package/dist/generated/bindings.js +1 -0
- package/dist/generated/bindings.js.map +1 -1
- package/dist/sdk/typescript-axios/client/client.gen.js +52 -19
- package/dist/sdk/typescript-axios/client/client.gen.js.map +1 -1
- package/dist/sdk/typescript-axios/client/types.gen.d.ts +14 -12
- package/dist/sdk/typescript-axios/client/utils.gen.d.ts +1 -7
- package/dist/sdk/typescript-axios/client/utils.gen.js +29 -82
- package/dist/sdk/typescript-axios/client/utils.gen.js.map +1 -1
- package/dist/sdk/typescript-axios/client.gen.d.ts +1 -1
- package/dist/sdk/typescript-axios/core/bodySerializer.gen.js +3 -0
- package/dist/sdk/typescript-axios/core/bodySerializer.gen.js.map +1 -1
- package/dist/sdk/typescript-axios/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/sdk/typescript-axios/core/serverSentEvents.gen.js +141 -0
- package/dist/sdk/typescript-axios/core/serverSentEvents.gen.js.map +1 -0
- package/dist/sdk/typescript-axios/core/types.gen.d.ts +12 -12
- package/dist/sdk/typescript-axios/core/utils.gen.d.ts +19 -0
- package/dist/sdk/typescript-axios/core/utils.gen.js +95 -0
- package/dist/sdk/typescript-axios/core/utils.gen.js.map +1 -0
- package/dist/sdk/typescript-axios/index.js +2 -2
- package/dist/sdk/typescript-axios/index.js.map +1 -1
- package/dist/sdk/typescript-axios/sdk.gen.d.ts +177 -28
- package/dist/sdk/typescript-axios/sdk.gen.js +664 -122
- package/dist/sdk/typescript-axios/sdk.gen.js.map +1 -1
- package/dist/sdk/typescript-axios/types.gen.d.ts +4310 -660
- package/dist/types/acquisitions.d.ts +11 -6
- package/dist/types/api-tokens.d.ts +42 -15
- package/dist/types/assets.d.ts +147 -8
- package/dist/types/baseline.d.ts +35 -4
- package/dist/types/cases.d.ts +126 -14
- 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 +61 -8
- 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 +64 -12
- package/dist/types/organization.js +3 -0
- package/dist/types/organization.js.map +1 -1
- package/dist/types/repositories.d.ts +19 -3
- package/dist/types/repositories.js +1 -0
- package/dist/types/repositories.js.map +1 -1
- package/dist/types/tasks.d.ts +124 -6
- package/dist/types/triage.d.ts +46 -10
- package/dist/types/users.d.ts +19 -3
- 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 +29 -0
- package/dist/utils/utils.js +82 -0
- package/dist/utils/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { AcquisitionProfileDto, AssignedTaskDto } from '../generated/bindings';
|
|
2
|
+
export interface IAssignedTask extends AssignedTaskDto {
|
|
3
|
+
}
|
|
4
|
+
export interface IAcquisitionsAPI {
|
|
5
|
+
getProfile: (options: {
|
|
6
|
+
id: string;
|
|
7
|
+
}) => Promise<AcquisitionProfileDto>;
|
|
8
|
+
assignEvidenceTask: (options: {
|
|
4
9
|
acquisitionProfileId: string;
|
|
5
|
-
organizationId
|
|
10
|
+
organizationId?: number;
|
|
6
11
|
endpointId: string;
|
|
7
|
-
caseId
|
|
12
|
+
caseId?: string;
|
|
8
13
|
taskName?: string;
|
|
9
|
-
}) => Promise<
|
|
14
|
+
}) => Promise<Array<IAssignedTask>>;
|
|
10
15
|
}
|
|
@@ -1,16 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import type { ApiTokensCreateData, ApiTokensDeleteResponses, ApiTokensUpdateData } from '../generated/bindings';
|
|
2
|
+
export interface IApiToken {
|
|
3
|
+
_id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string | null;
|
|
6
|
+
username: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
expirationDate?: string | null;
|
|
9
|
+
lastUsedAt?: string | null;
|
|
10
|
+
roleId: string;
|
|
11
|
+
createdAt?: string;
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IApiTokensPage extends Array<IApiToken> {
|
|
15
|
+
_pagination?: {
|
|
16
|
+
totalEntityCount?: number;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
currentPage?: number;
|
|
19
|
+
totalPageCount?: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface IGetApiTokensOptions {
|
|
23
|
+
organizationIds?: number | number[];
|
|
24
|
+
pageNumber?: number;
|
|
25
|
+
pageSize?: number;
|
|
26
|
+
searchTerm?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IApiTokensAPI {
|
|
29
|
+
get: (options: {
|
|
30
|
+
id: string;
|
|
31
|
+
}) => Promise<IApiToken>;
|
|
32
|
+
getMany: (options?: IGetApiTokensOptions) => Promise<IApiTokensPage>;
|
|
33
|
+
create: (options: {
|
|
34
|
+
input: ApiTokensCreateData['body'];
|
|
35
|
+
}) => Promise<IApiToken>;
|
|
36
|
+
update: (options: {
|
|
37
|
+
id: string;
|
|
38
|
+
input?: ApiTokensUpdateData['body'];
|
|
39
|
+
}) => Promise<IApiToken>;
|
|
40
|
+
delete: (options: {
|
|
41
|
+
id: string;
|
|
42
|
+
}) => Promise<ApiTokensDeleteResponses[200]>;
|
|
16
43
|
}
|
package/dist/types/assets.d.ts
CHANGED
|
@@ -1,9 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
import type { IReadonlyPage, IPaginationMetadata } from './common';
|
|
3
|
+
export interface IAssetEntity {
|
|
4
|
+
_id: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
buildArch?: string;
|
|
7
|
+
tags?: string[];
|
|
8
|
+
isolationStatus?: string;
|
|
9
|
+
netInterfaces?: unknown[];
|
|
10
|
+
createdAt?: string;
|
|
11
|
+
updatedAt?: string;
|
|
12
|
+
organizationId?: number;
|
|
13
|
+
ipAddress?: string;
|
|
14
|
+
groupId?: string;
|
|
15
|
+
groupFullPath?: string;
|
|
16
|
+
label?: string | null;
|
|
17
|
+
os?: string;
|
|
18
|
+
isServer?: boolean;
|
|
19
|
+
agentInstalled?: boolean;
|
|
20
|
+
lastSeen?: string;
|
|
21
|
+
version?: string;
|
|
22
|
+
versionNo?: number;
|
|
23
|
+
registeredAt?: string;
|
|
24
|
+
platform?: string;
|
|
25
|
+
securityToken?: string;
|
|
26
|
+
systemResources?: Record<string, unknown>;
|
|
27
|
+
cloud?: Record<string, unknown>;
|
|
28
|
+
hasEvidence?: boolean;
|
|
29
|
+
relayServerId?: string | null;
|
|
30
|
+
connectionRoute?: string | null;
|
|
31
|
+
features?: Record<string, unknown>;
|
|
32
|
+
assetId?: number;
|
|
33
|
+
assetType?: string;
|
|
34
|
+
timezoneOffset?: number;
|
|
35
|
+
vendorId?: string | null;
|
|
36
|
+
vendorDeviceId?: string | null;
|
|
37
|
+
responderId?: string;
|
|
38
|
+
excludedFromUpdates?: boolean;
|
|
39
|
+
unsupportedOsToUpdate?: boolean;
|
|
40
|
+
lastRelayId?: string | null;
|
|
41
|
+
lastRelaySeen?: string | null;
|
|
42
|
+
onlineStatus?: string;
|
|
43
|
+
issues?: string[];
|
|
44
|
+
versionUpdating?: boolean;
|
|
45
|
+
managedStatus?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface IAssetsPage extends Array<IAssetEntity> {
|
|
48
|
+
_pagination?: IPaginationMetadata;
|
|
49
|
+
}
|
|
50
|
+
export type IReadonlyAssetsPage = IReadonlyPage<IAssetEntity>;
|
|
51
|
+
export type Asset = IAssetEntity;
|
|
52
|
+
export interface IAssetTaskEntity {
|
|
53
|
+
_id: string;
|
|
54
|
+
taskId?: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
type?: string;
|
|
57
|
+
endpointId?: string;
|
|
58
|
+
endpointName?: string;
|
|
59
|
+
organizationId?: number;
|
|
60
|
+
status?: string;
|
|
61
|
+
subStatus?: string | null;
|
|
62
|
+
recurrence?: unknown | null;
|
|
63
|
+
progress?: number;
|
|
64
|
+
durations?: Record<string, number>;
|
|
65
|
+
duration?: number;
|
|
66
|
+
caseIds?: string[];
|
|
67
|
+
metadata?: Record<string, unknown>;
|
|
68
|
+
createdAt?: string;
|
|
69
|
+
createdBy?: string;
|
|
70
|
+
updatedAt?: string;
|
|
71
|
+
displayType?: string;
|
|
72
|
+
response?: Record<string, unknown>;
|
|
73
|
+
reportUrl?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface IAssetTasksPage extends Array<IAssetTaskEntity> {
|
|
76
|
+
_pagination?: IPaginationMetadata;
|
|
77
|
+
}
|
|
78
|
+
export type IReadonlyAssetTasksPage = IReadonlyPage<IAssetTaskEntity>;
|
|
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);
|
|
80
|
+
export interface IAssetAssignedTasksPage extends Array<IAssetAssignedTaskEntity> {
|
|
81
|
+
_pagination?: IPaginationMetadata;
|
|
82
|
+
}
|
|
83
|
+
export interface IGetAssetsOptions {
|
|
84
|
+
pageNumber?: number;
|
|
85
|
+
pageSize?: number;
|
|
86
|
+
sortBy?: NonNullable<AssetsGetManyData['query']>['sortBy'];
|
|
87
|
+
sortType?: NonNullable<AssetsGetManyData['query']>['sortType'];
|
|
88
|
+
filter?: Partial<FilterEndpointDto>;
|
|
89
|
+
}
|
|
90
|
+
export interface IGetAssetOptions {
|
|
91
|
+
id: AssetsGetMany4Data['path']['id'];
|
|
92
|
+
}
|
|
93
|
+
export interface IGetAssetTasksOptions {
|
|
94
|
+
id: AssetsGetTasksData['path']['id'];
|
|
95
|
+
pageNumber?: number;
|
|
96
|
+
pageSize?: number;
|
|
97
|
+
sortBy?: NonNullable<AssetsGetTasksData['query']>['sortBy'];
|
|
98
|
+
sortType?: NonNullable<AssetsGetTasksData['query']>['sortType'];
|
|
99
|
+
filter?: FilterEndpointTasksDto;
|
|
100
|
+
}
|
|
101
|
+
export interface IUpdateAssetTagsOptions {
|
|
102
|
+
filter?: Partial<FilterEndpointDto> & {
|
|
103
|
+
organizationIds?: number[];
|
|
104
|
+
};
|
|
105
|
+
tags: AddTagsToEndpointsByFilterDto['tags'];
|
|
106
|
+
}
|
|
107
|
+
export interface IRemoveAssetTagsOptions {
|
|
108
|
+
filter?: Partial<FilterEndpointDto> & {
|
|
109
|
+
organizationIds?: number[];
|
|
110
|
+
};
|
|
111
|
+
tags: RemoveTagsFromEndpointsByFilterDto['tags'];
|
|
112
|
+
}
|
|
113
|
+
export type AssignIsolationTaskOptions = Omit<SetIsolationOnEndpointDto, 'organizationId' | 'filter'> & {
|
|
114
|
+
organizationId?: number;
|
|
115
|
+
filter?: Partial<FilterEndpointDto> & {
|
|
116
|
+
organizationIds?: number[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export type AssignRebootTaskOptions = RebootEndpointDto;
|
|
120
|
+
export type AssignShutdownTaskOptions = ShutdownEndpointDto;
|
|
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>;
|
|
128
|
+
assignRebootTask: (options: AssignRebootTaskOptions) => Promise<AssetAssignedTask[]>;
|
|
129
|
+
assignShutdownTask: (options: AssignShutdownTaskOptions) => Promise<AssetAssignedTask[]>;
|
|
130
|
+
}
|
|
131
|
+
export type AssetsAddTagsPayload = AssetsAddTagsData['body'];
|
|
132
|
+
export type AssetsRemoveTagsPayload = AssetsRemoveTagsData['body'];
|
|
133
|
+
export type AssetsAssignIsolationTaskPayload = AssetsAssignIsolationTaskData['body'];
|
|
134
|
+
export type AssetsAssignRebootTaskPayload = AssetsAssignRebootTaskData['body'];
|
|
135
|
+
export type AssetsAssignShutdownTaskPayload = AssetsAssignShutdownTaskData['body'];
|
|
136
|
+
export interface IAddTagsResult {
|
|
137
|
+
success: boolean;
|
|
138
|
+
statusCode?: number;
|
|
139
|
+
message?: string;
|
|
140
|
+
matchedCount?: number;
|
|
141
|
+
}
|
|
142
|
+
export type RemoveTagsResult = IAddTagsResult;
|
|
143
|
+
export interface IAssetAssignedTaskEntity {
|
|
144
|
+
_id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
organizationId: number;
|
|
147
|
+
taskDetailsViewUrl: string;
|
|
9
148
|
}
|
package/dist/types/baseline.d.ts
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { AssignedTaskDto } from '../generated/bindings';
|
|
2
|
+
export interface IBaselineAssignedTask extends AssignedTaskDto {
|
|
3
|
+
taskId: string;
|
|
4
|
+
taskName?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IBaselineAcquireFilter {
|
|
7
|
+
organizationIds?: number[];
|
|
8
|
+
includedEndpointIds?: string[];
|
|
9
|
+
excludedEndpointIds?: string[];
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface IBaselineAcquireOptions {
|
|
13
|
+
filter: IBaselineAcquireFilter;
|
|
14
|
+
caseId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IBaselineCompareOptions {
|
|
17
|
+
taskIds: string[];
|
|
18
|
+
endpointId?: string;
|
|
19
|
+
vendorDeviceId?: string;
|
|
20
|
+
taskName?: string;
|
|
21
|
+
caseId?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface IBaselineComparisonReportOptions {
|
|
24
|
+
endpointId: string;
|
|
25
|
+
taskId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface IBaselineComparisonReportByVendorDeviceIdOptions {
|
|
28
|
+
vendorDeviceId: string;
|
|
29
|
+
taskId: string;
|
|
30
|
+
}
|
|
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>;
|
|
5
36
|
}
|
package/dist/types/cases.d.ts
CHANGED
|
@@ -1,16 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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;
|
|
8
|
+
}
|
|
9
|
+
export type IReadonlyCasesPage = IReadonlyPage<Case>;
|
|
10
|
+
export interface IGetCasesOptions {
|
|
11
|
+
pageNumber?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
sortBy?: string;
|
|
14
|
+
sortType?: 'ASC' | 'DESC';
|
|
15
|
+
filter?: Partial<FilterUserCasesDto>;
|
|
16
|
+
}
|
|
17
|
+
export interface ICasesAPI {
|
|
18
|
+
checkName: (options: {
|
|
8
19
|
name: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
}) => Promise<boolean>;
|
|
21
|
+
get: (options: {
|
|
22
|
+
id: string;
|
|
23
|
+
}) => Promise<Case>;
|
|
24
|
+
getMany: (options?: IGetCasesOptions) => Promise<ICasesPage>;
|
|
25
|
+
changeOwner: (options: {
|
|
26
|
+
id: string;
|
|
27
|
+
newOwnerId: string;
|
|
28
|
+
}) => Promise<Case>;
|
|
29
|
+
close: (options: {
|
|
30
|
+
id: string;
|
|
31
|
+
}) => Promise<Case>;
|
|
32
|
+
create: (options: {
|
|
33
|
+
input: CreateCaseInput;
|
|
34
|
+
}) => Promise<Case>;
|
|
35
|
+
getActivities: (options: {
|
|
36
|
+
id: string;
|
|
37
|
+
pageNumber?: number;
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
filter?: FilterCaseActivitiesDto;
|
|
40
|
+
}) => Promise<ICaseActivitiesPage>;
|
|
41
|
+
getEndpoints: (options: {
|
|
42
|
+
id: string;
|
|
43
|
+
pageNumber?: number;
|
|
44
|
+
pageSize?: number;
|
|
45
|
+
filter?: Partial<FilterEndpointDto>;
|
|
46
|
+
}) => Promise<IAssetsPage>;
|
|
47
|
+
getTasks: (options: {
|
|
48
|
+
id: string;
|
|
49
|
+
pageNumber?: number;
|
|
50
|
+
pageSize?: number;
|
|
51
|
+
filter?: FilterCaseTasksDto;
|
|
52
|
+
}) => Promise<ITaskAssignmentsPage>;
|
|
53
|
+
getUsers: (options: {
|
|
54
|
+
id: string;
|
|
55
|
+
pageNumber?: number;
|
|
56
|
+
pageSize?: number;
|
|
57
|
+
filter?: FilterCaseUsersDto;
|
|
58
|
+
}) => Promise<ICaseUsersPage>;
|
|
59
|
+
}
|
|
60
|
+
export type CreateCaseInput = Omit<CreateCaseDto, 'organizationId' | 'visibility' | 'assignedUserIds'> & {
|
|
61
|
+
organizationId?: number;
|
|
62
|
+
visibility?: NonNullable<CreateCaseDto['visibility']>;
|
|
63
|
+
assignedUserIds?: CreateCaseDto['assignedUserIds'];
|
|
64
|
+
};
|
|
65
|
+
export interface ICaseActivityOptions {
|
|
66
|
+
username?: string;
|
|
67
|
+
apiTokenName?: string;
|
|
68
|
+
eventOrigin?: string;
|
|
69
|
+
organizationIds?: number[];
|
|
70
|
+
}
|
|
71
|
+
export interface ICaseActivityData {
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
name?: string;
|
|
74
|
+
caseId?: string;
|
|
75
|
+
options?: ICaseActivityOptions;
|
|
76
|
+
organizationId?: number;
|
|
77
|
+
organizationIds?: number[];
|
|
78
|
+
ownerUser?: string;
|
|
79
|
+
visibility?: string;
|
|
80
|
+
eventSource?: string;
|
|
81
|
+
eventVersion?: number;
|
|
82
|
+
assignedUsers?: string[];
|
|
83
|
+
publishedDate?: string;
|
|
84
|
+
oldCaseOwnerName?: string;
|
|
85
|
+
newCaseOwnerName?: string;
|
|
86
|
+
endpointId?: string;
|
|
87
|
+
endpointName?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ICaseActivityEntity {
|
|
90
|
+
id: number;
|
|
91
|
+
caseId: string;
|
|
92
|
+
type: string;
|
|
93
|
+
performedBy: string;
|
|
94
|
+
data: ICaseActivityData;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
description?: string | null;
|
|
97
|
+
}
|
|
98
|
+
export interface ICaseActivitiesPage extends Array<ICaseActivityEntity> {
|
|
99
|
+
_pagination?: IPaginationMetadata;
|
|
100
|
+
}
|
|
101
|
+
export type IReadonlyCaseActivitiesPage = IReadonlyPage<ICaseActivityEntity>;
|
|
102
|
+
export interface ICaseUserEntity {
|
|
103
|
+
_id: string;
|
|
104
|
+
email?: string;
|
|
105
|
+
username?: string;
|
|
106
|
+
roles?: unknown[];
|
|
107
|
+
profile?: {
|
|
108
|
+
name?: string;
|
|
109
|
+
surname?: string;
|
|
110
|
+
department?: string;
|
|
111
|
+
};
|
|
112
|
+
hasPassword?: boolean;
|
|
113
|
+
organizationIds?: number[] | 'ALL';
|
|
114
|
+
tfaEnabled?: boolean;
|
|
115
|
+
isAuthorizedForAllOrganizations?: boolean;
|
|
116
|
+
isGlobalAdmin?: boolean;
|
|
117
|
+
isOrganizationAdmin?: boolean;
|
|
118
|
+
isNotInOrganizations?: boolean;
|
|
119
|
+
lastLogin?: string | null;
|
|
120
|
+
onlineStatus?: string;
|
|
121
|
+
createdAt?: string;
|
|
122
|
+
updatedAt?: string;
|
|
123
|
+
strategy?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ICaseUsersPage extends Array<ICaseUserEntity> {
|
|
126
|
+
_pagination?: IPaginationMetadata;
|
|
16
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,9 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interruptCommand: (sessionId: string, messageId: string) => Promise<any>;
|
|
8
|
-
closeSession: (sessionId: string) => Promise<any>;
|
|
1
|
+
import type { InteractShellAssignTaskData, InteractShellAssignTaskResponses, InteractSessionCloseData, InteractSessionCloseResponses, InteractSessionExecuteAsyncCommandData, InteractSessionExecuteAsyncCommandResponses, InteractSessionExecuteCommandData, InteractSessionExecuteCommandResponses, InteractSessionGetCommandMessageData, InteractSessionGetCommandMessageResponses, InteractSessionInterruptCommandData, InteractSessionInterruptCommandResponses } from '../generated/bindings';
|
|
2
|
+
export interface IInteractCommandOption {
|
|
3
|
+
name: string;
|
|
4
|
+
abbreviations: string[];
|
|
5
|
+
effect: string;
|
|
6
|
+
required: boolean;
|
|
9
7
|
}
|
|
8
|
+
export interface IInteractCommand {
|
|
9
|
+
command: string[];
|
|
10
|
+
description?: string;
|
|
11
|
+
options: IInteractCommandOption[];
|
|
12
|
+
privilege: string;
|
|
13
|
+
usage: string[];
|
|
14
|
+
}
|
|
15
|
+
export type InteractShellSession = InteractShellAssignTaskResponses[201];
|
|
16
|
+
export type InteractCommandExecutionResult = InteractSessionExecuteCommandResponses[200];
|
|
17
|
+
export type InteractAsyncCommandResult = InteractSessionExecuteAsyncCommandResponses[200];
|
|
18
|
+
export type InteractCommandMessage = InteractSessionGetCommandMessageResponses[200];
|
|
19
|
+
export type InteractInterruptCommandResult = InteractSessionInterruptCommandResponses[200];
|
|
20
|
+
export type InteractCloseSessionResult = InteractSessionCloseResponses[200];
|
|
21
|
+
export interface ICloseSessionResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
sessionId?: string;
|
|
24
|
+
statusCode?: number;
|
|
25
|
+
message?: string;
|
|
26
|
+
}
|
|
27
|
+
type InteractShellAssignTaskBody = InteractShellAssignTaskData['body'];
|
|
28
|
+
export type CreateInteractShellSessionOptions = Omit<InteractShellAssignTaskBody, 'vendorId' | 'assetId' | 'vendorDeviceId' | 'taskName' | 'caseId' | 'taskConfig'> & {
|
|
29
|
+
vendorId?: string;
|
|
30
|
+
assetId?: string;
|
|
31
|
+
vendorDeviceId?: string;
|
|
32
|
+
taskName?: string;
|
|
33
|
+
caseId?: string;
|
|
34
|
+
taskConfig?: InteractShellAssignTaskBody['taskConfig'];
|
|
35
|
+
};
|
|
36
|
+
export type ExecuteInteractCommandOptions = InteractSessionExecuteCommandData['body'] & {
|
|
37
|
+
sessionId: InteractSessionExecuteCommandData['path']['sessionId'];
|
|
38
|
+
};
|
|
39
|
+
export type ExecuteInteractAsyncCommandOptions = InteractSessionExecuteAsyncCommandData['body'] & {
|
|
40
|
+
sessionId: InteractSessionExecuteAsyncCommandData['path']['sessionId'];
|
|
41
|
+
};
|
|
42
|
+
export interface IGetInteractCommandMessageOptions {
|
|
43
|
+
sessionId: InteractSessionGetCommandMessageData['path']['sessionId'];
|
|
44
|
+
messageId: InteractSessionGetCommandMessageData['path']['messageId'];
|
|
45
|
+
}
|
|
46
|
+
export interface IInterruptInteractCommandOptions {
|
|
47
|
+
sessionId: InteractSessionInterruptCommandData['path']['sessionId'];
|
|
48
|
+
messageId: InteractSessionInterruptCommandData['path']['messageId'];
|
|
49
|
+
}
|
|
50
|
+
export interface ICloseInteractSessionOptions {
|
|
51
|
+
sessionId: InteractSessionCloseData['path']['sessionId'];
|
|
52
|
+
}
|
|
53
|
+
export interface IInteractAPI {
|
|
54
|
+
getCommands: () => Promise<IInteractCommand[]>;
|
|
55
|
+
createShellSession: (options: CreateInteractShellSessionOptions) => Promise<InteractShellSession>;
|
|
56
|
+
executeCommand: (options: ExecuteInteractCommandOptions) => Promise<InteractCommandExecutionResult>;
|
|
57
|
+
executeAsyncCommand: (options: ExecuteInteractAsyncCommandOptions) => Promise<InteractAsyncCommandResult>;
|
|
58
|
+
getCommandMessage: (options: IGetInteractCommandMessageOptions) => Promise<InteractCommandMessage>;
|
|
59
|
+
interruptCommand: (options: IInterruptInteractCommandOptions) => Promise<InteractInterruptCommandResult>;
|
|
60
|
+
closeSession: (options: ICloseInteractSessionOptions) => Promise<ICloseSessionResult>;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { FilterInvestigationFindingsDtoWritable, FilterInvestigationActivitiesDtoWritable, InvestigationFindingsStructureResponseDto, InvestigationFindingsSummaryResponseDto, InvestigationMitreTacticDto, InvestigationActivityDto, InvestigationFindingsPageDto } from '../generated/bindings';
|
|
2
|
+
import type { PageWithPagination } from '../utils';
|
|
3
|
+
export type InvestigationHubFindingsStructure = InvestigationFindingsStructureResponseDto;
|
|
4
|
+
export type InvestigationHubFinding = InvestigationFindingsPageDto['entities'][number];
|
|
5
|
+
export type InvestigationHubFindings = InvestigationFindingsPageDto;
|
|
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":""}
|