@crowdstrike/foundry-js 0.2.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/LICENSE.md +21 -0
- package/README.md +17 -0
- package/dist/api.d.ts +16 -0
- package/dist/apis/available-apis.d.ts +15 -0
- package/dist/apis/incidents/bridge.d.ts +15 -0
- package/dist/apis/incidents/types.d.ts +33 -0
- package/dist/apis/public-api.d.ts +23 -0
- package/dist/apis/remote-response/bridge.d.ts +15 -0
- package/dist/apis/remote-response/types.d.ts +33 -0
- package/dist/apis/types.d.ts +2 -0
- package/dist/apis/version.d.ts +1 -0
- package/dist/bridge.d.ts +15 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +911 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +69 -0
- package/dist/utils.d.ts +4 -0
- package/package.json +68 -0
package/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 CrowdStrike
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# @crowdstrike/foundry-js
|
2
|
+
|
3
|
+
`foundry.js` is the JavaScript SDK for authoring UI Extensions for CrowdStrike's Foundry platform.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```sh
|
8
|
+
npm install @crowdstrike/foundry-js
|
9
|
+
# or
|
10
|
+
yarn add @crowdstrike/foundry-js
|
11
|
+
# or
|
12
|
+
pnpm add @crowdstrike/foundry-js
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
> TODO
|
package/dist/api.d.ts
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
import { LocalData } from 'types';
|
2
|
+
import FalconPublicApis from './apis/public-api';
|
3
|
+
import Emittery from 'emittery';
|
4
|
+
import { Bridge } from './bridge';
|
5
|
+
interface EventMap<DATA extends LocalData> {
|
6
|
+
data: DATA;
|
7
|
+
}
|
8
|
+
export default class FalconApi<DATA extends LocalData = LocalData> extends FalconPublicApis {
|
9
|
+
events: Emittery<EventMap<DATA>, EventMap<DATA> & import("emittery").OmnipresentEventData, DATA extends undefined ? "data" : never>;
|
10
|
+
data?: DATA;
|
11
|
+
bridge: Bridge<DATA>;
|
12
|
+
connect(): Promise<void>;
|
13
|
+
private handleDataUpdate;
|
14
|
+
destroy(): void;
|
15
|
+
}
|
16
|
+
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* This file is autogenerated from the available APIs for App Platform.
|
4
|
+
*
|
5
|
+
* DO NOT EDIT DIRECTLY
|
6
|
+
*
|
7
|
+
* If you need to change the contents of this file please edit the above configuration file and
|
8
|
+
* then run:
|
9
|
+
*
|
10
|
+
* ```
|
11
|
+
* yarn cs-gen platform-apis
|
12
|
+
* ```
|
13
|
+
*
|
14
|
+
**/
|
15
|
+
export type ApiIdentifier = 'incidents' | 'remoteResponse';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* This file is autogenerated.
|
4
|
+
*
|
5
|
+
* DO NOT EDIT DIRECTLY
|
6
|
+
*
|
7
|
+
**/
|
8
|
+
import type { Bridge } from '../../bridge';
|
9
|
+
import type { GetQueriesIncidentsV1ApiResponse, GetQueriesIncidentsV1QueryParams, PostEntitiesIncidentsGetV1ApiResponse, PostEntitiesIncidentsGetV1PostData, PostEntitiesIncidentsGetV1QueryParams } from './types';
|
10
|
+
export declare class IncidentsApiBridge {
|
11
|
+
private bridge;
|
12
|
+
constructor(bridge: Bridge);
|
13
|
+
getIncidentIds(urlParams?: GetQueriesIncidentsV1QueryParams): Promise<GetQueriesIncidentsV1ApiResponse>;
|
14
|
+
getIncidentEntities(postBody: PostEntitiesIncidentsGetV1PostData, urlParams?: PostEntitiesIncidentsGetV1QueryParams): Promise<PostEntitiesIncidentsGetV1ApiResponse>;
|
15
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* This file is autogenerated.
|
4
|
+
*
|
5
|
+
* DO NOT EDIT DIRECTLY
|
6
|
+
*
|
7
|
+
**/
|
8
|
+
import type { BaseApiRequestMessage, BaseApiResponseMessage, ApiResponsePayload, BaseUrlParams, QueryParam } from '../../types';
|
9
|
+
export type IncidentsRequestApi = 'incidents';
|
10
|
+
export interface GetQueriesIncidentsV1QueryParams extends BaseUrlParams {
|
11
|
+
filter?: string;
|
12
|
+
limit?: QueryParam;
|
13
|
+
offset?: QueryParam;
|
14
|
+
sort?: QueryParam;
|
15
|
+
}
|
16
|
+
export type GetQueriesIncidentsV1ApiResponse = ApiResponsePayload<string>;
|
17
|
+
export interface GetQueriesIncidentsV1RequestMessage extends BaseApiRequestMessage<GetQueriesIncidentsV1QueryParams> {
|
18
|
+
api: IncidentsRequestApi;
|
19
|
+
method: 'getQueriesIncidentsV1';
|
20
|
+
}
|
21
|
+
export type GetQueriesIncidentsV1ResponseMessage = BaseApiResponseMessage<GetQueriesIncidentsV1ApiResponse>;
|
22
|
+
export interface PostEntitiesIncidentsGetV1QueryParams extends BaseUrlParams {
|
23
|
+
}
|
24
|
+
export interface PostEntitiesIncidentsGetV1PostData {
|
25
|
+
}
|
26
|
+
export type PostEntitiesIncidentsGetV1ApiResponse = ApiResponsePayload<any>;
|
27
|
+
export interface PostEntitiesIncidentsGetV1RequestMessage extends BaseApiRequestMessage<PostEntitiesIncidentsGetV1QueryParams, PostEntitiesIncidentsGetV1PostData> {
|
28
|
+
api: IncidentsRequestApi;
|
29
|
+
method: 'postEntitiesIncidentsGetV1';
|
30
|
+
}
|
31
|
+
export type PostEntitiesIncidentsGetV1ResponseMessage = BaseApiResponseMessage<PostEntitiesIncidentsGetV1ApiResponse>;
|
32
|
+
export type IncidentsApiRequestMessage = GetQueriesIncidentsV1RequestMessage | PostEntitiesIncidentsGetV1RequestMessage;
|
33
|
+
export type IncidentsApiResponseMessage = GetQueriesIncidentsV1ResponseMessage | PostEntitiesIncidentsGetV1ResponseMessage;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* This file is autogenerated from the available APIs for App Platform.
|
4
|
+
*
|
5
|
+
* DO NOT EDIT DIRECTLY
|
6
|
+
*
|
7
|
+
* If you need to change the contents of this file please edit the above configuration file and
|
8
|
+
* then run:
|
9
|
+
*
|
10
|
+
* ```
|
11
|
+
* yarn cs-gen platform-apis
|
12
|
+
* ```
|
13
|
+
*
|
14
|
+
**/
|
15
|
+
import { IncidentsApiBridge } from './incidents/bridge';
|
16
|
+
import { RemoteResponseApiBridge } from './remote-response/bridge';
|
17
|
+
import { Bridge } from '../bridge';
|
18
|
+
export default abstract class FalconPublicApis {
|
19
|
+
isConnected: boolean;
|
20
|
+
abstract bridge: Bridge<any>;
|
21
|
+
get incidents(): IncidentsApiBridge;
|
22
|
+
get remoteResponse(): RemoteResponseApiBridge;
|
23
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* This file is autogenerated.
|
4
|
+
*
|
5
|
+
* DO NOT EDIT DIRECTLY
|
6
|
+
*
|
7
|
+
**/
|
8
|
+
import type { Bridge } from '../../bridge';
|
9
|
+
import { GetQueriesScriptsV1ApiResponse, GetQueriesScriptsV1QueryParams, PostEntitiesScriptsGetV2ApiResponse, PostEntitiesScriptsGetV2PostData, PostEntitiesScriptsGetV2QueryParams } from './types';
|
10
|
+
export declare class RemoteResponseApiBridge {
|
11
|
+
private bridge;
|
12
|
+
constructor(bridge: Bridge);
|
13
|
+
getScriptIds(urlParams?: GetQueriesScriptsV1QueryParams): Promise<GetQueriesScriptsV1ApiResponse>;
|
14
|
+
getScriptEntities(postBody: PostEntitiesScriptsGetV2PostData, urlParams?: PostEntitiesScriptsGetV2QueryParams): Promise<PostEntitiesScriptsGetV2ApiResponse>;
|
15
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
*
|
3
|
+
* This file is autogenerated.
|
4
|
+
*
|
5
|
+
* DO NOT EDIT DIRECTLY
|
6
|
+
*
|
7
|
+
**/
|
8
|
+
import type { BaseApiRequestMessage, BaseApiResponseMessage, ApiResponsePayload, BaseUrlParams, QueryParam } from '../../types';
|
9
|
+
export type RemoteResponseRequestApi = 'remoteResponse';
|
10
|
+
export interface GetQueriesScriptsV1QueryParams extends BaseUrlParams {
|
11
|
+
filter?: string;
|
12
|
+
limit?: QueryParam;
|
13
|
+
offset?: QueryParam;
|
14
|
+
sort?: QueryParam;
|
15
|
+
}
|
16
|
+
export type GetQueriesScriptsV1ApiResponse = ApiResponsePayload<string>;
|
17
|
+
export interface GetQueriesScriptsV1RequestMessage extends BaseApiRequestMessage<GetQueriesScriptsV1QueryParams> {
|
18
|
+
api: RemoteResponseRequestApi;
|
19
|
+
method: 'getQueriesScriptsV1';
|
20
|
+
}
|
21
|
+
export type GetQueriesScriptsV1ResponseMessage = BaseApiResponseMessage<GetQueriesScriptsV1ApiResponse>;
|
22
|
+
export interface PostEntitiesScriptsGetV2QueryParams extends BaseUrlParams {
|
23
|
+
}
|
24
|
+
export interface PostEntitiesScriptsGetV2PostData {
|
25
|
+
}
|
26
|
+
export type PostEntitiesScriptsGetV2ApiResponse = ApiResponsePayload<any>;
|
27
|
+
export interface PostEntitiesScriptsGetV2RequestMessage extends BaseApiRequestMessage<PostEntitiesScriptsGetV2QueryParams, PostEntitiesScriptsGetV2PostData> {
|
28
|
+
api: RemoteResponseRequestApi;
|
29
|
+
method: 'postEntitiesScriptsGetV2';
|
30
|
+
}
|
31
|
+
export type PostEntitiesScriptsGetV2ResponseMessage = BaseApiResponseMessage<PostEntitiesScriptsGetV2ApiResponse>;
|
32
|
+
export type RemoteResponseApiRequestMessage = GetQueriesScriptsV1RequestMessage | PostEntitiesScriptsGetV2RequestMessage;
|
33
|
+
export type RemoteResponseApiResponseMessage = GetQueriesScriptsV1ResponseMessage | PostEntitiesScriptsGetV2ResponseMessage;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const VERSION = "current";
|
package/dist/bridge.d.ts
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { DataUpdateMessage, LocalData, PayloadOf, RequestMessage, ResponseFor } from './types';
|
2
|
+
interface BridgeOptions<DATA extends LocalData> {
|
3
|
+
onDataUpdate?: (event: DataUpdateMessage<DATA>) => void;
|
4
|
+
}
|
5
|
+
export declare class Bridge<DATA extends LocalData = LocalData> {
|
6
|
+
private onDataUpdate;
|
7
|
+
private pendingMessages;
|
8
|
+
private targetOrigin;
|
9
|
+
constructor({ onDataUpdate }?: BridgeOptions<DATA>);
|
10
|
+
destroy(): void;
|
11
|
+
setOrigin(origin: string): void;
|
12
|
+
postMessage<REQ extends RequestMessage>(message: REQ): Promise<PayloadOf<ResponseFor<REQ, DATA>>>;
|
13
|
+
private handleMessage;
|
14
|
+
}
|
15
|
+
export {};
|
package/dist/index.d.ts
ADDED