@jupiterone/integration-sdk-core 12.7.0 → 12.8.1
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/README.md +4 -0
- package/dist/src/data/createIntegrationHelpers.d.ts +148 -0
- package/dist/src/data/createIntegrationHelpers.js +39 -0
- package/dist/src/data/createIntegrationHelpers.js.map +1 -0
- package/dist/src/data/index.d.ts +1 -0
- package/dist/src/data/index.js +1 -0
- package/dist/src/data/index.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { Static, TObject, TRef } from '@sinclair/typebox';
|
|
2
|
+
import { StepEntityMetadata } from '../types';
|
|
3
|
+
interface CreateIntegrationHelpersOptions<IntegrationName extends string, SchemaKey extends string, ClassSchemaMap extends Record<SchemaKey, TObject>> {
|
|
4
|
+
integrationName: IntegrationName;
|
|
5
|
+
classSchemaMap: ClassSchemaMap;
|
|
6
|
+
}
|
|
7
|
+
export declare const createIntegrationHelpers: <IntegrationName extends string, SchemaKey extends string, ClassSchemaMap extends Record<SchemaKey, TObject<import("@sinclair/typebox").TProperties>>>({ integrationName, classSchemaMap, }: CreateIntegrationHelpersOptions<IntegrationName, SchemaKey, ClassSchemaMap>) => {
|
|
8
|
+
createEntityType: <EntityName extends string>(entityName: EntityName) => `${IntegrationName}_${EntityName}`;
|
|
9
|
+
createEntityMetadata: <ResourceName extends string, Class extends keyof ClassSchemaMap & string, EntityType extends string, Schema extends TObject<import("@sinclair/typebox").TProperties>>({ resourceName, _class, _type, description, schema, ...entityMetadata }: Omit<StepEntityMetadata, "schema"> & {
|
|
10
|
+
resourceName: ResourceName;
|
|
11
|
+
_class: [Class, ...Class[]];
|
|
12
|
+
_type: EntityType;
|
|
13
|
+
description: string;
|
|
14
|
+
schema: Schema;
|
|
15
|
+
}) => readonly [{
|
|
16
|
+
partial?: boolean | undefined;
|
|
17
|
+
indexMetadata?: import("../types").GraphObjectIndexMetadata | undefined;
|
|
18
|
+
_class: (string | string[]) & [Class, ...Class[]];
|
|
19
|
+
_type: string & EntityType;
|
|
20
|
+
resourceName: string & ResourceName;
|
|
21
|
+
schema: import("@sinclair/typebox").TIntersect<[TRef<ClassSchemaMap[Class]>, ...TRef<ClassSchemaMap[Class]>[], TObject<import("@sinclair/typebox").Evaluate<import("@sinclair/typebox").TSetDistinct<["_class", "_type", ...import("@sinclair/typebox").TKeyOfPropertyKeys<Schema>], []> extends infer T ? T extends import("@sinclair/typebox").TSetDistinct<["_class", "_type", ...import("@sinclair/typebox").TKeyOfPropertyKeys<Schema>], []> ? T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? R extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? any : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
22
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
23
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
24
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
25
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
26
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
27
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_1 ? T_1 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
28
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
29
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
30
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
31
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
32
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
33
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_1 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_2 ? T_2 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_2 extends import("@sinclair/typebox").TNever ? [] : [T_2] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_3 ? T_3 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_3 extends import("@sinclair/typebox").TNever ? [T_1] : [T_1, T_3] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
34
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
35
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
36
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
37
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
38
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
39
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_4 ? T_4 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
40
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
41
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
42
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
43
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
44
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
45
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_4 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_5 ? T_5 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_5 extends import("@sinclair/typebox").TNever ? [] : [T_5] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_6 ? T_6 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_6 extends import("@sinclair/typebox").TNever ? [T_4] : [T_4, T_6] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
46
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
47
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
48
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
49
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
50
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
51
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_7 ? T_7 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
52
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
53
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
54
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
55
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
56
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
57
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_7 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_8 ? T_8 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_8 extends import("@sinclair/typebox").TNever ? [] : [T_8] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_9 ? T_9 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_9 extends import("@sinclair/typebox").TNever ? [T_7] : [T_7, T_9] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
58
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
59
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
60
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
61
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
62
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
63
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_10 ? T_10 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
64
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
65
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
66
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
67
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
68
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
69
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_10 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_11 ? T_11 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_11 extends import("@sinclair/typebox").TNever ? [] : [T_11] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_12 ? T_12 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_12 extends import("@sinclair/typebox").TNever ? [T_10] : [T_10, T_12] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
70
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
71
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
72
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
73
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
74
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
75
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_13 ? T_13 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
76
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
77
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
78
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
79
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
80
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
81
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_13 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_14 ? T_14 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_14 extends import("@sinclair/typebox").TNever ? [] : [T_14] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_15 ? T_15 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_15 extends import("@sinclair/typebox").TNever ? [T_13] : [T_13, T_15] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
82
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
83
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
84
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
85
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
86
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
87
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_16 ? T_16 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
88
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
89
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
90
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
91
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
92
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
93
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_16 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_17 ? T_17 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_17 extends import("@sinclair/typebox").TNever ? [] : [T_17] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_18 ? T_18 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_18 extends import("@sinclair/typebox").TNever ? [T_16] : [T_16, T_18] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
94
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
95
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
96
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
97
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
98
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
99
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_19 ? T_19 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
100
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
101
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
102
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
103
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
104
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
105
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_19 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_20 ? T_20 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_20 extends import("@sinclair/typebox").TNever ? [] : [T_20] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_21 ? T_21 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_21 extends import("@sinclair/typebox").TNever ? [T_19] : [T_19, T_21] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
106
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
107
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
108
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
109
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
110
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
111
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_22 ? T_22 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
112
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
113
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
114
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
115
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
116
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
117
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_22 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_23 ? T_23 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_23 extends import("@sinclair/typebox").TNever ? [] : [T_23] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_24 ? T_24 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_24 extends import("@sinclair/typebox").TNever ? [T_22] : [T_22, T_24] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
118
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
119
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
120
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
121
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
122
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
123
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_25 ? T_25 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
124
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
125
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
126
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
127
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
128
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
129
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_25 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_26 ? T_26 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_26 extends import("@sinclair/typebox").TNever ? [] : [T_26] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_27 ? T_27 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_27 extends import("@sinclair/typebox").TNever ? [T_25] : [T_25, T_27] : never : never : never : never>; } : { [_ in L]: import("@sinclair/typebox").TIntersectEvaluated<import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
130
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
131
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
132
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
133
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
134
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
135
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> extends infer T_28 ? T_28 extends import("@sinclair/typebox").Assert<L extends "_class" | "_type" ? {
|
|
136
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
137
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
138
|
+
}[L] : `${import("@sinclair/typebox").Assert<L, string | number>}` extends "_class" | "_type" ? {
|
|
139
|
+
_class: import("@sinclair/typebox").TTuple<import("@sinclair/typebox").TLiteral<Class>[]>;
|
|
140
|
+
_type: import("@sinclair/typebox").TLiteral<string & EntityType>;
|
|
141
|
+
}[import("@sinclair/typebox").Assert<L, string | number>] : import("@sinclair/typebox").TNever, import("@sinclair/typebox").TSchema> ? T_28 extends import("@sinclair/typebox").TNever ? import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_29 ? T_29 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_29 extends import("@sinclair/typebox").TNever ? [] : [T_29] : never : never : import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> extends infer T_30 ? T_30 extends import("@sinclair/typebox").Assert<import("@sinclair/typebox").TIndexFromPropertyKey<Schema, L>, import("@sinclair/typebox").TSchema> ? T_30 extends import("@sinclair/typebox").TNever ? [T_28] : [T_28, T_30] : never : never : never : never>; } : {} : never : never>>]>;
|
|
142
|
+
}, (entityData: Omit<Omit<Static<ClassSchemaMap[Class], unknown[] & []>, "displayName"> & {
|
|
143
|
+
displayName?: string | undefined;
|
|
144
|
+
}, "_class" | "_type">) => Omit<Static<ClassSchemaMap[Class], unknown[] & []>, "displayName"> & {
|
|
145
|
+
displayName?: string | undefined;
|
|
146
|
+
}];
|
|
147
|
+
};
|
|
148
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createIntegrationHelpers = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const createIntegrationHelpers = ({ integrationName, classSchemaMap, }) => {
|
|
6
|
+
const createEntityType = (entityName) => `${integrationName}_${entityName}`;
|
|
7
|
+
const createEntityMetadata = ({ resourceName, _class, _type, description, schema, ...entityMetadata }) => {
|
|
8
|
+
const classSchemaRefs = _class.map((className) => typebox_1.Type.Ref(classSchemaMap[className]));
|
|
9
|
+
const baseSchema = typebox_1.Type.Composite([
|
|
10
|
+
typebox_1.Type.Object({
|
|
11
|
+
_class: typebox_1.Type.Tuple(_class.map((className) => typebox_1.Type.Literal(className))),
|
|
12
|
+
_type: typebox_1.Type.Literal(_type),
|
|
13
|
+
}),
|
|
14
|
+
schema,
|
|
15
|
+
]);
|
|
16
|
+
const entitySchema = typebox_1.Type.Intersect([...classSchemaRefs, baseSchema], {
|
|
17
|
+
$id: `#${_type}`,
|
|
18
|
+
description: description,
|
|
19
|
+
});
|
|
20
|
+
const createEntityData = (entityData) => {
|
|
21
|
+
return {
|
|
22
|
+
...entityData,
|
|
23
|
+
_class: _class,
|
|
24
|
+
_type: _type,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const stepEntityMetadata = {
|
|
28
|
+
_class,
|
|
29
|
+
_type,
|
|
30
|
+
resourceName,
|
|
31
|
+
schema: typebox_1.Type.Strict(entitySchema),
|
|
32
|
+
...entityMetadata,
|
|
33
|
+
};
|
|
34
|
+
return [stepEntityMetadata, createEntityData];
|
|
35
|
+
};
|
|
36
|
+
return { createEntityType, createEntityMetadata };
|
|
37
|
+
};
|
|
38
|
+
exports.createIntegrationHelpers = createIntegrationHelpers;
|
|
39
|
+
//# sourceMappingURL=createIntegrationHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createIntegrationHelpers.js","sourceRoot":"","sources":["../../../src/data/createIntegrationHelpers.ts"],"names":[],"mappings":";;;AAAA,+CAAgE;AAYzD,MAAM,wBAAwB,GAAG,CAItC,EACA,eAAe,EACf,cAAc,GAKf,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,CACvB,UAAsB,EACtB,EAAE,CAAC,GAAG,eAAe,IAAI,UAAU,EAAW,CAAC;IAEjD,MAAM,oBAAoB,GAAG,CAK3B,EACA,YAAY,EACZ,MAAM,EACN,KAAK,EACL,WAAW,EACX,MAAM,EACN,GAAG,cAAc,EAOlB,EAAE,EAAE;QACH,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC/C,cAAI,CAAC,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAC+B,CAAC;QAErE,MAAM,UAAU,GAAG,cAAI,CAAC,SAAS,CAAC;YAChC,cAAI,CAAC,MAAM,CAAC;gBACV,MAAM,EAAE,cAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;gBACtE,KAAK,EAAE,cAAI,CAAC,OAAO,CAAC,KAAK,CAAC;aAC3B,CAAC;YACF,MAAM;SACP,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,cAAI,CAAC,SAAS,CAAC,CAAC,GAAG,eAAe,EAAE,UAAU,CAAC,EAAE;YACpE,GAAG,EAAE,IAAI,KAAK,EAAE;YAChB,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;QAKH,MAAM,gBAAgB,GAAG,CACvB,UAAsD,EACpC,EAAE;YACpB,OAAO;gBACL,GAAG,UAAU;gBACb,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,KAAK;aACO,CAAC;QACxB,CAAC,CAAC;QAEF,MAAM,kBAAkB,GAAG;YACzB,MAAM;YACN,KAAK;YACL,YAAY;YACZ,MAAM,EAAE,cAAI,CAAC,MAAM,CAAC,YAAY,CAAC;YACjC,GAAG,cAAc;SACW,CAAC;QAE/B,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,CAAU,CAAC;IACzD,CAAC,CAAC;IAEF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,CAAC;AACpD,CAAC,CAAC;AA7EW,QAAA,wBAAwB,4BA6EnC"}
|
package/dist/src/data/index.d.ts
CHANGED
package/dist/src/data/index.js
CHANGED
|
@@ -20,4 +20,5 @@ __exportStar(require("./ip"), exports);
|
|
|
20
20
|
__exportStar(require("./rawData"), exports);
|
|
21
21
|
__exportStar(require("./createIntegrationEntity"), exports);
|
|
22
22
|
__exportStar(require("./createIntegrationRelationship"), exports);
|
|
23
|
+
__exportStar(require("./createIntegrationHelpers"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,4CAA0B;AAC1B,uCAAqB;AACrB,4CAA0B;AAE1B,4DAA0C;AAC1C,kEAAgD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,4CAA0B;AAC1B,uCAAqB;AACrB,4CAA0B;AAE1B,4DAA0C;AAC1C,kEAAgD;AAChD,6DAA2C"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -14,10 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RelationshipClass = void 0;
|
|
17
|
+
exports.RelationshipClass = exports.SchemaType = void 0;
|
|
18
18
|
__exportStar(require("./data"), exports);
|
|
19
19
|
__exportStar(require("./types"), exports);
|
|
20
20
|
__exportStar(require("./errors"), exports);
|
|
21
|
+
var typebox_1 = require("@sinclair/typebox");
|
|
22
|
+
Object.defineProperty(exports, "SchemaType", { enumerable: true, get: function () { return typebox_1.Type; } });
|
|
21
23
|
var data_model_1 = require("@jupiterone/data-model");
|
|
22
24
|
Object.defineProperty(exports, "RelationshipClass", { enumerable: true, get: function () { return data_model_1.RelationshipClass; } });
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,qDAA2D;AAAlD,+GAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB;AACxB,2CAAyB;AACzB,6CAAuD;AAA9C,qGAAA,IAAI,OAAc;AAC3B,qDAA2D;AAAlD,+GAAA,iBAAiB,OAAA"}
|