@crowdstrike/foundry-js 0.9.0 → 0.10.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/abstraction/cloud-function.d.ts +14 -5
- package/dist/abstraction/collection.d.ts +29 -0
- package/dist/abstraction/logscale.d.ts +21 -2
- package/dist/api.d.ts +82 -0
- package/dist/apis/available-apis.d.ts +1 -1
- package/dist/apis/devices/index.d.ts +78 -32
- package/dist/apis/mitre/index.d.ts +8 -8
- package/dist/apis/public-api.d.ts +13 -3
- package/dist/apis/remote-response/index.d.ts +2 -12
- package/dist/apis/types-response-for.d.ts +14 -15
- package/dist/apis/types.d.ts +3 -4
- package/dist/index.js +259 -119
- package/dist/index.js.map +1 -1
- package/dist/lib/resize-tracker.d.ts +3 -0
- package/dist/lib/ui.d.ts +32 -1
- package/dist/types.d.ts +38 -0
- package/package.json +1 -1
- package/dist/apis/actors/index.d.ts +0 -77
package/dist/lib/ui.d.ts
CHANGED
@@ -1,9 +1,40 @@
|
|
1
1
|
import type { Bridge } from '../bridge';
|
2
2
|
import type { ExtensionIdentifier, FileUploadType, LocalData, OpenModalOptions, PayloadForFileUploadType, ResponseForFileUploadType } from '../types';
|
3
|
+
/**
|
4
|
+
* Invoke UI features within the main Falcon Console.
|
5
|
+
*/
|
3
6
|
export declare class UI<DATA extends LocalData = LocalData> {
|
4
7
|
private bridge;
|
5
8
|
constructor(bridge: Bridge<DATA>);
|
6
|
-
|
9
|
+
/**
|
10
|
+
* Open a modal within the Falcon Console, rendering an UI extension of your choice.
|
11
|
+
*
|
12
|
+
* ```js
|
13
|
+
* const result = await api.ui.openModal({ id: '<extension ID as defined in the manifest>', type: 'extension' }, 'Modal title', {
|
14
|
+
path: '/foo',
|
15
|
+
data: { foo: 'bar' },
|
16
|
+
size: 'lg',
|
17
|
+
align: 'top',
|
18
|
+
});
|
19
|
+
```
|
20
|
+
*
|
21
|
+
* @param extension The identifier of the extension, consisting of {@link ExtensionIdentifier.id} and {@link ExtensionIdentifier.type}
|
22
|
+
* @param title The title to render in the header of the modal
|
23
|
+
* @param options
|
24
|
+
* @returns a Promise that resolves with the data passed to {@link closeModal}, or `undefined` if the user dismisses it
|
25
|
+
*/
|
26
|
+
openModal<PAYLOAD = unknown>(extension: ExtensionIdentifier, title: string, options?: OpenModalOptions): Promise<PAYLOAD | undefined>;
|
27
|
+
/**
|
28
|
+
* Close a modal already opened via {@link openModal}. This can be called both by the extension that is rendered inside the modal or by the extension that opened the modal.
|
29
|
+
*
|
30
|
+
* @param payload the data to return to the caller that opened the modal as the value of the resolved promise
|
31
|
+
*/
|
7
32
|
closeModal<PAYLOAD = unknown>(payload?: PAYLOAD): void;
|
33
|
+
/**
|
34
|
+
* This opens a file upload modal inside the Falcon Console, to support file uploads, even large binary files.
|
35
|
+
*
|
36
|
+
* @param fileUploadType the type of file upload
|
37
|
+
* @param initialData data that you want to pre-populate the form with
|
38
|
+
*/
|
8
39
|
uploadFile<TYPE extends FileUploadType>(fileUploadType: TYPE, initialData?: PayloadForFileUploadType<TYPE>): Promise<ResponseForFileUploadType<TYPE> | undefined>;
|
9
40
|
}
|
package/dist/types.d.ts
CHANGED
@@ -25,16 +25,45 @@ export interface UserData {
|
|
25
25
|
uuid: string;
|
26
26
|
username: string;
|
27
27
|
}
|
28
|
+
/**
|
29
|
+
* A map of custom app permissions, mapping permission keys to a boolean, indicating the permission status for the current user and that particular permission.
|
30
|
+
*/
|
31
|
+
export type Permissions = Record<string, boolean>;
|
32
|
+
/**
|
33
|
+
* The minimum {@link FalconApi.data} every UI extension receives from the Falcon Console.
|
34
|
+
*/
|
28
35
|
export interface LocalData {
|
29
36
|
app: {
|
30
37
|
id: string;
|
31
38
|
};
|
39
|
+
/**
|
40
|
+
* Details of the currently signed in user
|
41
|
+
*/
|
32
42
|
user: UserData;
|
43
|
+
/**
|
44
|
+
* The current light or dark mode in the Falcon Console
|
45
|
+
*/
|
33
46
|
theme: Theme;
|
47
|
+
/**
|
48
|
+
* Current customer ID
|
49
|
+
*/
|
34
50
|
cid: string;
|
51
|
+
/**
|
52
|
+
* The locale of the current user, e.g. 'en-us'
|
53
|
+
*/
|
35
54
|
locale: string;
|
55
|
+
/**
|
56
|
+
* Timezone of the current user, e.g. 'America/New_York'
|
57
|
+
*/
|
36
58
|
timezone?: string;
|
59
|
+
/**
|
60
|
+
* The date format preferred by the current user, in a [`moment.js` format](https://momentjs.com/docs/#/displaying/format/)
|
61
|
+
*/
|
37
62
|
dateFormat?: string;
|
63
|
+
/**
|
64
|
+
* A map of custom app permissions, mapping permission keys to a boolean, indicating the permission status for the current user and that particular permission.
|
65
|
+
*/
|
66
|
+
permissions?: Permissions;
|
38
67
|
[key: string]: unknown;
|
39
68
|
}
|
40
69
|
export interface DataUpdateMessage<DATA extends LocalData = LocalData> extends BaseMessage {
|
@@ -130,8 +159,17 @@ export interface CollectionResponseMessage extends BaseMessage {
|
|
130
159
|
}
|
131
160
|
export interface OpenModalOptions {
|
132
161
|
path?: string;
|
162
|
+
/**
|
163
|
+
* additional local data to pass to the modal's extension
|
164
|
+
*/
|
133
165
|
data?: Record<string, unknown>;
|
166
|
+
/**
|
167
|
+
* Vertical alignment of the modal, "top" or undefined (Default is center)
|
168
|
+
*/
|
134
169
|
align?: 'top';
|
170
|
+
/**
|
171
|
+
* Width of the modal (Default is "md")
|
172
|
+
*/
|
135
173
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
136
174
|
}
|
137
175
|
export interface OpenModalRequestMessage extends BaseMessage {
|
package/package.json
CHANGED
@@ -1,77 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
*
|
3
|
-
* This file is autogenerated.
|
4
|
-
*
|
5
|
-
* DO NOT EDIT DIRECTLY
|
6
|
-
*
|
7
|
-
**/
|
8
|
-
import type { Bridge } from '../../bridge';
|
9
|
-
import type { ApiResponsePayload, BaseApiRequestMessage, BaseApiResponseMessage, BaseUrlParams, QueryParam } from '../../types';
|
10
|
-
export type ActorsRequestApi = 'actors';
|
11
|
-
export type CommonApiResponseMessage = BaseApiResponseMessage<ApiResponsePayload>;
|
12
|
-
export interface CommonApiRequestMessage extends BaseApiRequestMessage<BaseUrlParams, unknown> {
|
13
|
-
api: ActorsRequestApi;
|
14
|
-
}
|
15
|
-
export interface GetEntitiesActorsGetV2QueryParams extends BaseUrlParams {
|
16
|
-
ids?: QueryParam;
|
17
|
-
}
|
18
|
-
export type GetEntitiesActorsGetV2ApiResponse = ApiResponsePayload;
|
19
|
-
export type GetEntitiesActorsGetV2ResponseMessage = BaseApiResponseMessage<GetEntitiesActorsGetV2ApiResponse>;
|
20
|
-
export interface GetEntitiesActorsGetV2RequestMessage extends BaseApiRequestMessage<GetEntitiesActorsGetV2QueryParams> {
|
21
|
-
api: ActorsRequestApi;
|
22
|
-
method: 'getEntitiesActorsGetV2';
|
23
|
-
}
|
24
|
-
export interface GetQueriesActorsV2QueryParams extends BaseUrlParams {
|
25
|
-
filter?: string;
|
26
|
-
limit?: QueryParam;
|
27
|
-
offset?: QueryParam;
|
28
|
-
q?: QueryParam;
|
29
|
-
sort?: QueryParam;
|
30
|
-
}
|
31
|
-
export type GetQueriesActorsV2ApiResponse = ApiResponsePayload;
|
32
|
-
export type GetQueriesActorsV2ResponseMessage = BaseApiResponseMessage<GetQueriesActorsV2ApiResponse>;
|
33
|
-
export interface GetQueriesActorsV2RequestMessage extends BaseApiRequestMessage<GetQueriesActorsV2QueryParams> {
|
34
|
-
api: ActorsRequestApi;
|
35
|
-
method: 'getQueriesActorsV2';
|
36
|
-
}
|
37
|
-
export type PostAggregatesActorsGetV2QueryParams = BaseUrlParams;
|
38
|
-
export type PostAggregatesActorsGetV2ApiResponse = ApiResponsePayload;
|
39
|
-
export interface PostAggregatesActorsGetV2PostData {
|
40
|
-
}
|
41
|
-
export type PostAggregatesActorsGetV2ResponseMessage = BaseApiResponseMessage<PostAggregatesActorsGetV2ApiResponse>;
|
42
|
-
export interface PostAggregatesActorsGetV2RequestMessage extends BaseApiRequestMessage<PostAggregatesActorsGetV2QueryParams, PostAggregatesActorsGetV2PostData> {
|
43
|
-
api: ActorsRequestApi;
|
44
|
-
method: 'postAggregatesActorsGetV2';
|
45
|
-
}
|
46
|
-
export interface PostEntitiesActorsGetV2QueryParams extends BaseUrlParams {
|
47
|
-
ids?: QueryParam;
|
48
|
-
}
|
49
|
-
export type PostEntitiesActorsGetV2ApiResponse = ApiResponsePayload;
|
50
|
-
export interface PostEntitiesActorsGetV2PostData {
|
51
|
-
}
|
52
|
-
export type PostEntitiesActorsGetV2ResponseMessage = BaseApiResponseMessage<PostEntitiesActorsGetV2ApiResponse>;
|
53
|
-
export interface PostEntitiesActorsGetV2RequestMessage extends BaseApiRequestMessage<PostEntitiesActorsGetV2QueryParams, PostEntitiesActorsGetV2PostData> {
|
54
|
-
api: ActorsRequestApi;
|
55
|
-
method: 'postEntitiesActorsGetV2';
|
56
|
-
}
|
57
|
-
export type PostEntitiesMitreV1QueryParams = BaseUrlParams;
|
58
|
-
export type PostEntitiesMitreV1ApiResponse = ApiResponsePayload;
|
59
|
-
export interface PostEntitiesMitreV1PostData {
|
60
|
-
}
|
61
|
-
export type PostEntitiesMitreV1ResponseMessage = BaseApiResponseMessage<PostEntitiesMitreV1ApiResponse>;
|
62
|
-
export interface PostEntitiesMitreV1RequestMessage extends BaseApiRequestMessage<PostEntitiesMitreV1QueryParams, PostEntitiesMitreV1PostData> {
|
63
|
-
api: ActorsRequestApi;
|
64
|
-
method: 'postEntitiesMitreV1';
|
65
|
-
}
|
66
|
-
export type ActorsApiRequestMessage = GetEntitiesActorsGetV2RequestMessage | GetQueriesActorsV2RequestMessage | PostAggregatesActorsGetV2RequestMessage | PostEntitiesActorsGetV2RequestMessage | PostEntitiesMitreV1RequestMessage;
|
67
|
-
export type ActorsApiResponseMessage = GetEntitiesActorsGetV2ResponseMessage | GetQueriesActorsV2ResponseMessage | PostAggregatesActorsGetV2ResponseMessage | PostEntitiesActorsGetV2ResponseMessage | PostEntitiesMitreV1ResponseMessage;
|
68
|
-
export declare class ActorsApiBridge {
|
69
|
-
private bridge;
|
70
|
-
constructor(bridge: Bridge);
|
71
|
-
getBridge(): Bridge<import("../../types").LocalData>;
|
72
|
-
getEntitiesActorsGetV2(urlParams?: GetEntitiesActorsGetV2QueryParams): Promise<GetEntitiesActorsGetV2ApiResponse>;
|
73
|
-
getQueriesActorsV2(urlParams?: GetQueriesActorsV2QueryParams): Promise<GetQueriesActorsV2ApiResponse>;
|
74
|
-
postAggregatesActorsGetV2(postBody: PostAggregatesActorsGetV2PostData, urlParams?: PostAggregatesActorsGetV2QueryParams): Promise<PostAggregatesActorsGetV2ApiResponse>;
|
75
|
-
postEntitiesActorsGetV2(postBody: PostEntitiesActorsGetV2PostData, urlParams?: PostEntitiesActorsGetV2QueryParams): Promise<PostEntitiesActorsGetV2ApiResponse>;
|
76
|
-
postEntitiesMitreV1(postBody: PostEntitiesMitreV1PostData, urlParams?: PostEntitiesMitreV1QueryParams): Promise<PostEntitiesMitreV1ApiResponse>;
|
77
|
-
}
|