Skip to content

Commit

Permalink
[backend] Fix the ability to add relationship references in CSV mapper(
Browse files Browse the repository at this point in the history
  • Loading branch information
CelineSebe authored Jul 8, 2024
1 parent 2b09daa commit 1b688ec
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion opencti-platform/opencti-graphql/src/database/stix-ref.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { schemaRelationsRefDefinition } from '../schema/schema-relationsRef';
import { STIX_CORE_RELATIONSHIPS } from '../schema/stixCoreRelationship';
import type { RefAttribute } from '../schema/attribute-definition';

export const schemaRelationsRefTypesMapping = () => {
return Array.from(schemaRelationsRefDefinition.relationsRefCacheArray.entries()).map(([key, refs]) => {
const relationshipsRefs = new Map<string, RefAttribute[]>();
STIX_CORE_RELATIONSHIPS.forEach((relation) => {
relationshipsRefs.set(relation, schemaRelationsRefDefinition.getRelationsRef(relation));
});
return [
...Array.from(relationshipsRefs.entries()),
...Array.from(schemaRelationsRefDefinition.relationsRefCacheArray.entries())
].map(([key, refs]) => {
return {
key,
values: refs.map((ref) => ({
Expand Down

0 comments on commit 1b688ec

Please sign in to comment.