Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

APP-15551 - Update location _type #56

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/jupiterone.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The following entities are created:
| Consumable | `snipeit_consumable_resource` | `Resource` |
| Hardware | `snipeit_hardware` | `Device` |
| License | `snipeit_licensed_application` | `Application` |
| Location | `snipeit_location` | `Site` |
| Location | `snipeit_managed_location` | `Site` |
| Service | `snipeit_service` | `Service` |
| User | `snipeit_user` | `User` |

Expand All @@ -96,7 +96,7 @@ The following relationships are created:
| `snipeit_account` | **HAS** | `snipeit_consumable_resource` |
| `snipeit_account` | **MANAGES** | `snipeit_hardware` |
| `snipeit_account` | **HAS** | `snipeit_licensed_application` |
| `snipeit_account` | **MANAGES** | `snipeit_location` |
| `snipeit_account` | **MANAGES** | `snipeit_managed_location` |
| `snipeit_account` | **PROVIDES** | `snipeit_service` |
| `snipeit_account` | **HAS** | `snipeit_user` |
| `snipeit_hardware` | **INSTALLED** | `snipeit_licensed_application` |
Expand All @@ -107,10 +107,10 @@ The following relationships are created:

The following mapped relationships are created:

| Source Entity `_type` | Relationship `_class` | Target Entity `_type` | Direction |
| --------------------- | --------------------- | --------------------- | --------- |
| `snipeit_location` | **HAS** | `*snipeit_hardware*` | FORWARD |
| `snipeit_user` | **IS** | `*snipeit_person*` | FORWARD |
| Source Entity `_type` | Relationship `_class` | Target Entity `_type` | Direction |
| -------------------------- | --------------------- | --------------------- | --------- |
| `snipeit_managed_location` | **HAS** | `*snipeit_hardware*` | FORWARD |
| `snipeit_user` | **IS** | `*snipeit_person*` | FORWARD |

<!--
********************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const [LocationEntityMetadata, createLocationAssignEntity] =
createEntityMetadata({
resourceName: 'Location',
_class: ['Site'],
_type: createEntityType('location'),
_type: createEntityType('managed_location'),
description: 'Snipe-IT Location',
schema: SchemaType.Object({
locationId: SchemaType.Number(),
Expand Down
4 changes: 4 additions & 0 deletions src/steps/fetch-account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export async function fetchAccount({
from: accountEntity,
to: locationEntity,
_class: RelationshipClass.MANAGES,
properties: {
// If this is not present, the generated type will be 'snipeit_account_manages_managed_location'. We want it to be 'snipeit_account_manages_location'.
_type: Relationships.ACCOUNT_MANAGES_LOCATION._type,
},
}),
);
await jobState.addRelationships(relationships);
Expand Down
Loading