Comments (1)
Sketching ideas.
import { validateRawData } from './rawData';
import { ResourceTagList, ResourceTagMap } from './tagging';
enum EntityClasses {
DEVICE = 'Device',
}
export interface GraphObject {
_key: string;
_type: string;
_class: string[];
}
export interface Entity extends GraphObject {
active: boolean;
[k: string]:
| string
| boolean
| number
| (string | boolean | number)[]
| null
| undefined;
}
export interface Device extends Entity {
deviceId: string | null;
make?: string;
}
/**
* A type representing entity data from a provider.
*/
type ProviderSourceData = {
/**
* Some providers include a collection of `tags` that will be stored on the
* generated entity as `tag.propertyName`, `propertyName` when the tag is
* registered in `tagProperties` or is known to be a common tag property name,
* and the tag values will be collected in the generated entity as `tags` (a
* `string[]`);
*/
tags?: ResourceTagList | ResourceTagMap;
[key: string]: any;
};
type GeneratedEntity<T extends Entity> = T & { _rawData: any };
interface NewEntityDataInput<T> {
entityData: {
assign: T;
source: ProviderSourceData;
};
}
export function createIntegrationEntity<T extends Entity>(
input: NewEntityDataInput<T>,
): GeneratedEntity<T> {
const generatedEntity: GeneratedEntity<T> = {
...input.entityData.assign,
_rawData: input.entityData.source,
};
validateRawData(generatedEntity);
return generatedEntity;
}
const d: Device = {
deviceId: null,
active: false,
_key: '',
_type: '',
_class: [],
};
const x = createIntegrationEntity<Device>({
entityData: {
assign: {
_class: ['Device'],
_key: 'a',
_type: 'b',
active: false,
deviceId: 'ss',
lol: 'x',
},
source: {},
},
});
from sdk.
Related Issues (20)
- Deprecate `convertProperties` HOT 1
- Add an additional type of error for when we exceed retries/quotas HOT 4
- Support supplying an API base URL in CLI commands HOT 3
- Add documentation for `j1` CLI
- Failing to publish integration event does not include system error response details
- Update `jobState.hasKey` documentation to cover edge case
- Entities and relationships should have consumable information about the properties on them
- Add `inspect` command or flag to integration CLI
- Integration step failure events do not expose original authorization or authentication errors HOT 1
- Introduce `beforeAddRelationship` hook into `IntegrationInvocationConfig` HOT 1
- Support async `beforeAddRelationship` HOT 1
- Introduce `deferUploads` option to step.
- onRelationshipsFlushed, onEntitiesFlushed possible unnecessarily locking? HOT 2
- Decouple the size of storage files from the size of the `GRAPH_OBJECT_BUFFER` HOT 1
- v9.0.0 Ideas HOT 3
- `j1-integration run` command results in `Unauthorized` when pointing to JupiterOne host
- Support YAML environment file
- Allow certain error codes in recordings
- Need logger in loadExecutionConfig
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.