Skip to content

Commit

Permalink
[backend/frontend] Update dependency typescript to v5.4.3 (#6437)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Landry Trebon <landry.trebon@filigran.io>
  • Loading branch information
renovate[bot] and lndrtrbn committed Mar 30, 2024
1 parent 5ff2123 commit 8fb5dbb
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 47 deletions.
2 changes: 1 addition & 1 deletion opencti-platform/opencti-front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"relay-compiler": "16.2.0",
"relay-test-utils": "16.2.0",
"tap": "18.7.1",
"typescript": "5.3.3",
"typescript": "5.4.3",
"vite": "5.2.4",
"vite-plugin-relay": "2.1.0",
"vite-plugin-static-copy": "1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ const ResponseDialog: FunctionComponent<ResponseDialogProps> = ({
{format === 'html' && (
<CKEditor
id="response-dialog-editor"
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
editor={Editor}
config={{ language: 'en', toolbar: { shouldNotGroupWhenFull: true } }}
data={content}
Expand Down
26 changes: 23 additions & 3 deletions opencti-platform/opencti-front/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15078,7 +15078,7 @@ __metadata:
subscriptions-transport-ws: "npm:0.11.0"
tap: "npm:18.7.1"
three-spritetext: "npm:1.8.2"
typescript: "npm:5.3.3"
typescript: "npm:5.4.3"
unified: "npm:11.0.4"
use-analytics: "npm:1.1.0"
uuid: "npm:9.0.1"
Expand Down Expand Up @@ -19502,7 +19502,7 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:5.2 || 5.3, typescript@npm:5.3.3":
"typescript@npm:5.2 || 5.3":
version: 5.3.3
resolution: "typescript@npm:5.3.3"
bin:
Expand All @@ -19512,7 +19512,17 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.2 || 5.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>":
"typescript@npm:5.4.3":
version: 5.4.3
resolution: "typescript@npm:5.4.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/de4c69f49a7ad4b1ea66a6dcc8b055ac34eb56af059a069d8988dd811c5e649be07e042e5bf573e8d0ac3ec2f30e6c999aa651cd09f6e9cbc6113749e8b6be20
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.2 || 5.3#optional!builtin<compat/typescript>":
version: 5.3.3
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
bin:
Expand All @@ -19532,6 +19542,16 @@ __metadata:
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>":
version: 5.4.3
resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>::version=5.4.3&hash=5adc0c"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/5aedd97595582b08aadb8a70e8e3ddebaf5a9c1e5ad4d6503c2fcfc15329b5cf8d01145b09913e9555683ac16c5123a96be32b6d72614098ebd42df520eed9b1
languageName: node
linkType: hard

"ua-parser-js@npm:^1.0.35":
version: 1.0.37
resolution: "ua-parser-js@npm:1.0.37"
Expand Down
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
"fast-glob": "3.3.2",
"graphql-tag": "2.12.6",
"ts-loader": "9.5.1",
"typescript": "5.3.3",
"typescript": "5.4.3",
"vitest": "1.4.0"
},
"resolutions": {
Expand Down
14 changes: 7 additions & 7 deletions opencti-platform/opencti-graphql/src/manager/playbookManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ type ExecutorFn = {
playbookId: string,
dataInstanceId: string,
definition: ComponentDefinition,
previousStep: PlaybookExecutionStep<any> | null
nextStep: PlaybookExecutionStep<any>,
previousStep: PlaybookExecutionStep<object> | null
nextStep: PlaybookExecutionStep<object>,
previousStepBundle: StixBundle | null
bundle: StixBundle
externalCallback?: {
Expand Down Expand Up @@ -136,7 +136,7 @@ export const playbookExecutor = async ({
executionId,
dataInstanceId,
playbookId,
previousPlaybookNode: previousStep?.instance,
previousPlaybookNodeId: previousStep?.instance.id,
previousStepBundle,
playbookNode: instanceWithConfig,
bundle
Expand Down Expand Up @@ -222,7 +222,7 @@ export const playbookExecutor = async ({
executionId,
dataInstanceId,
playbookId,
previousPlaybookNode: previousStep?.instance,
previousPlaybookNodeId: previousStep?.instance.id,
playbookNode: instanceWithConfig,
previousStepBundle,
bundle
Expand Down Expand Up @@ -263,7 +263,7 @@ const playbookStreamHandler = async (streamEvents: Array<SseEvent<StreamDataEven
const isMatch = await isStixMatchFilterGroup(context, SYSTEM_USER, data, jsonFilters);
// 02. Execute the component
if (validEventType && isMatch) {
const nextStep: PlaybookExecutionStep<any> = { component: connector, instance };
const nextStep = { component: connector, instance };
const bundle: StixBundle = { id: uuidv4(), spec_version: STIX_SPEC_VERSION, type: 'bundle', objects: [data] };
await playbookExecutor({
// Basic
Expand Down Expand Up @@ -358,8 +358,8 @@ export const playbookStepExecution = async (context: AuthContext, user: AuthUser
}
const connector = PLAYBOOK_COMPONENTS[nextInstance.component_id];
// 02. Execute the component
const nextStep: PlaybookExecutionStep<any> = { component: connector, instance: nextInstance };
const previousStep: PlaybookExecutionStep<any> = { component: connector, instance: previousInstance };
const nextStep = { component: connector, instance: nextInstance };
const previousStep = { component: connector, instance: previousInstance };
// const previousData = JSON.parse(args.previous_data);
const bundle = JSON.parse(args.bundle) as StixBundle;
return playbookExecutor({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as R from 'ramda';
import { v4 as uuidv4 } from 'uuid';
import type { JSONSchemaType } from 'ajv';
import * as jsonpatch from 'fast-json-patch';
import { type BasicStoreEntityPlaybook, ENTITY_TYPE_PLAYBOOK, type PlaybookComponent, type PlaybookComponentConfiguration } from './playbook-types';
import { type BasicStoreEntityPlaybook, ENTITY_TYPE_PLAYBOOK, type PlaybookComponent } from './playbook-types';
import { AUTOMATION_MANAGER_USER, AUTOMATION_MANAGER_USER_UUID, executionContext, INTERNAL_USERS, isUserCanAccessStixElement, SYSTEM_USER } from '../../utils/access';
import { pushToConnector, pushToPlaybook } from '../../database/rabbitmq';
import {
Expand Down Expand Up @@ -81,7 +81,7 @@ const extractBundleBaseElement = (instanceId: string, bundle: StixBundle): StixO
};

// region built in playbook components
interface LoggerConfiguration extends PlaybookComponentConfiguration {
interface LoggerConfiguration {
level: string
}
const PLAYBOOK_LOGGER_COMPONENT_SCHEMA: JSONSchemaType<LoggerConfiguration> = {
Expand Down Expand Up @@ -119,7 +119,7 @@ const PLAYBOOK_LOGGER_COMPONENT: PlaybookComponent<LoggerConfiguration> = {
}
};

export interface StreamConfiguration extends PlaybookComponentConfiguration {
export interface StreamConfiguration {
create: boolean,
update: boolean,
delete: boolean,
Expand Down Expand Up @@ -150,7 +150,7 @@ const PLAYBOOK_INTERNAL_DATA_STREAM: PlaybookComponent<StreamConfiguration> = {
}
};

interface IngestionConfiguration extends PlaybookComponentConfiguration {}
interface IngestionConfiguration {}
const PLAYBOOK_INGESTION_COMPONENT: PlaybookComponent<IngestionConfiguration> = {
id: 'PLAYBOOK_INGESTION_COMPONENT',
name: 'Send for ingestion',
Expand All @@ -168,7 +168,7 @@ const PLAYBOOK_INGESTION_COMPONENT: PlaybookComponent<IngestionConfiguration> =
}
};

interface FilterConfiguration extends PlaybookComponentConfiguration {
interface FilterConfiguration {
all: boolean
filters: string
}
Expand Down Expand Up @@ -211,7 +211,7 @@ const PLAYBOOK_FILTERING_COMPONENT: PlaybookComponent<FilterConfiguration> = {
}
};

interface ReduceConfiguration extends PlaybookComponentConfiguration {
interface ReduceConfiguration {
filters: string
}
const PLAYBOOK_REDUCING_COMPONENT_SCHEMA: JSONSchemaType<ReduceConfiguration> = {
Expand Down Expand Up @@ -247,7 +247,7 @@ const PLAYBOOK_REDUCING_COMPONENT: PlaybookComponent<ReduceConfiguration> = {
}
};

interface ConnectorConfiguration extends PlaybookComponentConfiguration {
interface ConnectorConfiguration {
connector: string
}
const PLAYBOOK_CONNECTOR_COMPONENT_SCHEMA: JSONSchemaType<ConnectorConfiguration> = {
Expand All @@ -274,7 +274,7 @@ const PLAYBOOK_CONNECTOR_COMPONENT: PlaybookComponent<ConnectorConfiguration> =
const schemaElement = { properties: { connector: { oneOf: elements } } };
return R.mergeDeepRight<JSONSchemaType<ConnectorConfiguration>, any>(PLAYBOOK_CONNECTOR_COMPONENT_SCHEMA, schemaElement);
},
notify: async ({ executionId, playbookId, playbookNode, previousPlaybookNode, dataInstanceId, bundle }) => {
notify: async ({ executionId, playbookId, playbookNode, previousPlaybookNodeId, dataInstanceId, bundle }) => {
if (playbookNode.configuration.connector) {
const message = {
internal: {
Expand All @@ -284,7 +284,7 @@ const PLAYBOOK_CONNECTOR_COMPONENT: PlaybookComponent<ConnectorConfiguration> =
playbook_id: playbookId,
data_instance_id: dataInstanceId,
step_id: playbookNode.id,
previous_step_id: previousPlaybookNode?.id,
previous_step_id: previousPlaybookNodeId,
},
applicant_id: AUTOMATION_MANAGER_USER.id, // System user is responsible for the automation
},
Expand All @@ -308,7 +308,7 @@ const PLAYBOOK_CONNECTOR_COMPONENT: PlaybookComponent<ConnectorConfiguration> =
}
};

interface ContainerWrapperConfiguration extends PlaybookComponentConfiguration {
interface ContainerWrapperConfiguration {
container_type: string
all: boolean
}
Expand Down Expand Up @@ -384,7 +384,7 @@ const PLAYBOOK_CONTAINER_WRAPPER_COMPONENT: PlaybookComponent<ContainerWrapperCo
}
};

interface SharingConfiguration extends PlaybookComponentConfiguration {
interface SharingConfiguration {
organizations: string[]
}
const PLAYBOOK_SHARING_COMPONENT_SCHEMA: JSONSchemaType<SharingConfiguration> = {
Expand Down Expand Up @@ -470,7 +470,7 @@ interface UpdateValueConfiguration {
value: string
patch_value: string
}
interface UpdateConfiguration extends PlaybookComponentConfiguration {
interface UpdateConfiguration {
actions: { op: 'add' | 'replace' | 'remove', attribute: string, value: UpdateValueConfiguration[] }[]
all: boolean
}
Expand Down Expand Up @@ -585,7 +585,7 @@ const RESOLVE_OBSERVABLES = 'resolve_observables';
type StixWithSeenDates = StixThreatActor | StixCampaign | StixIncident | StixInfrastructure | StixMalware;
const ENTITIES_DATE_SEEN_PREFIX = ['threat-actor--', 'campaign--', 'incident--', 'infrastructure--', 'malware--'];
type SeenFilter = { element: StixWithSeenDates, isImpactedBefore: boolean, isImpactedAfter: boolean };
interface RuleConfiguration extends PlaybookComponentConfiguration {
interface RuleConfiguration {
rule: string
inferences: boolean
}
Expand Down Expand Up @@ -746,7 +746,7 @@ const convertAuthorizedMemberToUsers = async (authorized_members: { value: strin
.filter((u) => INTERNAL_USERS[u.id] === undefined);
return R.uniqBy(R.prop('id'), withoutInternalUsers);
};
export interface NotifierConfiguration extends PlaybookComponentConfiguration {
export interface NotifierConfiguration {
notifiers: string[]
authorized_members: object
}
Expand Down Expand Up @@ -810,7 +810,7 @@ const PLAYBOOK_NOTIFIER_COMPONENT: PlaybookComponent<NotifierConfiguration> = {
return { output_port: undefined, bundle };
}
};
interface CreateIndicatorConfiguration extends PlaybookComponentConfiguration {
interface CreateIndicatorConfiguration {
all: boolean
wrap_in_container: boolean
}
Expand Down Expand Up @@ -927,7 +927,7 @@ const PLAYBOOK_CREATE_INDICATOR_COMPONENT: PlaybookComponent<CreateIndicatorConf
return { output_port: 'unmodified', bundle };
}
};
interface CreateObservableConfiguration extends PlaybookComponentConfiguration {
interface CreateObservableConfiguration {
all: boolean
wrap_in_container: boolean
}
Expand Down Expand Up @@ -1039,7 +1039,8 @@ const PLAYBOOK_CREATE_OBSERVABLE_COMPONENT: PlaybookComponent<CreateObservableCo
};
// endregion

export const PLAYBOOK_COMPONENTS: { [k: string]: PlaybookComponent<any> } = {
// @ts-expect-error TODO improve playbook types to avoid this
export const PLAYBOOK_COMPONENTS: { [k: string]: PlaybookComponent<object> } = {
[PLAYBOOK_INTERNAL_DATA_STREAM.id]: PLAYBOOK_INTERNAL_DATA_STREAM,
[PLAYBOOK_LOGGER_COMPONENT.id]: PLAYBOOK_LOGGER_COMPONENT,
[PLAYBOOK_INGESTION_COMPONENT.id]: PLAYBOOK_INGESTION_COMPONENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export interface StixPlaybook extends StixObject {
}
}

export interface PlaybookComponentConfiguration {}

export interface NodeInstance<T extends PlaybookComponentConfiguration> {
export interface NodeInstance<T extends object> {
id: string
name: string,
component_id: string
Expand All @@ -53,22 +51,22 @@ export interface NodeInstance<T extends PlaybookComponentConfiguration> {

export interface PlaybookExecution { output_port: string | undefined, forceBundleTracking?: boolean, bundle: StixBundle }

export interface PlaybookExecutionStep<T extends PlaybookComponentConfiguration> {
component: PlaybookComponent<PlaybookComponentConfiguration>,
instance: NodeInstance<T>,
export interface PlaybookExecutionStep<T extends object> {
component: PlaybookComponent<T>,
instance: NodeDefinition,
}

export interface ExecutorParameters<T extends PlaybookComponentConfiguration> {
export interface ExecutorParameters<T extends object> {
executionId: string
playbookId: string
dataInstanceId: string
previousPlaybookNode: NodeInstance<T> | undefined
previousPlaybookNodeId: string | undefined
playbookNode: NodeInstance<T>
previousStepBundle: StixBundle | null
bundle: StixBundle
}

export interface PlaybookComponent<T extends PlaybookComponentConfiguration> {
export interface PlaybookComponent<T extends object> {
id: string
name: string
description: string
Expand Down
18 changes: 9 additions & 9 deletions opencti-platform/opencti-graphql/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11219,7 +11219,7 @@ __metadata:
tough-cookie: "npm:4.1.3"
ts-loader: "npm:9.5.1"
turndown: "npm:7.1.3"
typescript: "npm:5.3.3"
typescript: "npm:5.4.3"
unzipper: "npm:0.10.14"
uuid: "npm:9.0.1"
uuid-time: "npm:1.0.0"
Expand Down Expand Up @@ -13505,23 +13505,23 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:5.3.3":
version: 5.3.3
resolution: "typescript@npm:5.3.3"
"typescript@npm:5.4.3":
version: 5.4.3
resolution: "typescript@npm:5.4.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/6e4e6a14a50c222b3d14d4ea2f729e79f972fa536ac1522b91202a9a65af3605c2928c4a790a4a50aa13694d461c479ba92cedaeb1e7b190aadaa4e4b96b8e18
checksum: 10/de4c69f49a7ad4b1ea66a6dcc8b055ac34eb56af059a069d8988dd811c5e649be07e042e5bf573e8d0ac3ec2f30e6c999aa651cd09f6e9cbc6113749e8b6be20
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>":
version: 5.3.3
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
"typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>":
version: 5.4.3
resolution: "typescript@patch:typescript@npm%3A5.4.3#optional!builtin<compat/typescript>::version=5.4.3&hash=5adc0c"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 10/c93786fcc9a70718ba1e3819bab56064ead5817004d1b8186f8ca66165f3a2d0100fee91fa64c840dcd45f994ca5d615d8e1f566d39a7470fc1e014dbb4cf15d
checksum: 10/5aedd97595582b08aadb8a70e8e3ddebaf5a9c1e5ad4d6503c2fcfc15329b5cf8d01145b09913e9555683ac16c5123a96be32b6d72614098ebd42df520eed9b1
languageName: node
linkType: hard

Expand Down

0 comments on commit 8fb5dbb

Please sign in to comment.