@twin.org/auditable-item-graph-models 0.0.1-next.8 → 0.0.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.
Files changed (54) hide show
  1. package/dist/cjs/index.cjs +265 -393
  2. package/dist/esm/index.mjs +264 -393
  3. package/dist/types/index.d.ts +4 -3
  4. package/dist/types/models/IAuditableItemGraphAlias.d.ts +9 -4
  5. package/dist/types/models/IAuditableItemGraphAuditedElement.d.ts +2 -2
  6. package/dist/types/models/IAuditableItemGraphChangeset.d.ts +16 -14
  7. package/dist/types/models/IAuditableItemGraphComponent.d.ts +52 -36
  8. package/dist/types/models/IAuditableItemGraphEdge.d.ts +11 -6
  9. package/dist/types/models/IAuditableItemGraphPatchOperation.d.ts +3 -1
  10. package/dist/types/models/IAuditableItemGraphResource.d.ts +3 -2
  11. package/dist/types/models/IAuditableItemGraphVertex.d.ts +13 -4
  12. package/dist/types/models/IAuditableItemGraphVertexList.d.ts +11 -4
  13. package/dist/types/models/api/IAuditableItemGraphCreateRequest.d.ts +6 -6
  14. package/dist/types/models/api/IAuditableItemGraphGetRequest.d.ts +2 -2
  15. package/dist/types/models/api/IAuditableItemGraphListRequest.d.ts +10 -2
  16. package/dist/types/models/api/IAuditableItemGraphUpdateRequest.d.ts +6 -6
  17. package/dist/types/models/auditableItemGraphContexts.d.ts +17 -0
  18. package/dist/types/models/auditableItemGraphTopics.d.ts +17 -0
  19. package/dist/types/models/auditableItemGraphTypes.d.ts +4 -20
  20. package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexCreated.d.ts +9 -0
  21. package/dist/types/models/eventBus/IAuditableItemGraphEventBusVertexUpdated.d.ts +14 -0
  22. package/docs/changelog.md +90 -1
  23. package/docs/reference/classes/AuditableItemGraphDataTypes.md +3 -3
  24. package/docs/reference/index.md +6 -4
  25. package/docs/reference/interfaces/IAuditableItemGraphAlias.md +18 -18
  26. package/docs/reference/interfaces/IAuditableItemGraphAuditedElement.md +4 -4
  27. package/docs/reference/interfaces/IAuditableItemGraphChangeset.md +14 -22
  28. package/docs/reference/interfaces/IAuditableItemGraphComponent.md +109 -37
  29. package/docs/reference/interfaces/IAuditableItemGraphCreateRequest.md +4 -4
  30. package/docs/reference/interfaces/IAuditableItemGraphEdge.md +21 -21
  31. package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexCreated.md +11 -0
  32. package/docs/reference/interfaces/IAuditableItemGraphEventBusVertexUpdated.md +19 -0
  33. package/docs/reference/interfaces/IAuditableItemGraphGetRequest.md +2 -2
  34. package/docs/reference/interfaces/IAuditableItemGraphListRequest.md +15 -3
  35. package/docs/reference/interfaces/IAuditableItemGraphPatchOperation.md +2 -2
  36. package/docs/reference/interfaces/IAuditableItemGraphResource.md +5 -5
  37. package/docs/reference/interfaces/IAuditableItemGraphUpdateRequest.md +4 -4
  38. package/docs/reference/interfaces/IAuditableItemGraphVertex.md +18 -18
  39. package/docs/reference/interfaces/IAuditableItemGraphVertexList.md +6 -6
  40. package/docs/reference/type-aliases/AuditableItemGraphContexts.md +5 -0
  41. package/docs/reference/type-aliases/AuditableItemGraphTopics.md +5 -0
  42. package/docs/reference/type-aliases/AuditableItemGraphTypes.md +1 -1
  43. package/docs/reference/type-aliases/VerifyDepth.md +1 -1
  44. package/docs/reference/variables/AuditableItemGraphContexts.md +19 -0
  45. package/docs/reference/variables/AuditableItemGraphTopics.md +19 -0
  46. package/docs/reference/variables/AuditableItemGraphTypes.md +6 -30
  47. package/package.json +12 -10
  48. package/dist/types/models/IAuditableItemGraphCredential.d.ts +0 -34
  49. package/dist/types/models/IAuditableItemGraphVerification.d.ts +0 -29
  50. package/dist/types/models/auditableItemGraphVerificationState.d.ts +0 -37
  51. package/docs/reference/interfaces/IAuditableItemGraphCredential.md +0 -59
  52. package/docs/reference/interfaces/IAuditableItemGraphVerification.md +0 -47
  53. package/docs/reference/type-aliases/AuditableItemGraphVerificationState.md +0 -5
  54. package/docs/reference/variables/AuditableItemGraphVerificationState.md +0 -49
@@ -5,17 +5,18 @@ export * from "./models/api/IAuditableItemGraphGetResponse";
5
5
  export * from "./models/api/IAuditableItemGraphListRequest";
6
6
  export * from "./models/api/IAuditableItemGraphListResponse";
7
7
  export * from "./models/api/IAuditableItemGraphUpdateRequest";
8
+ export * from "./models/auditableItemGraphContexts";
9
+ export * from "./models/auditableItemGraphTopics";
8
10
  export * from "./models/auditableItemGraphTypes";
9
- export * from "./models/auditableItemGraphVerificationState";
11
+ export * from "./models/eventBus/IAuditableItemGraphEventBusVertexCreated";
12
+ export * from "./models/eventBus/IAuditableItemGraphEventBusVertexUpdated";
10
13
  export * from "./models/IAuditableItemGraphAlias";
11
14
  export * from "./models/IAuditableItemGraphAuditedElement";
12
15
  export * from "./models/IAuditableItemGraphChangeset";
13
16
  export * from "./models/IAuditableItemGraphComponent";
14
- export * from "./models/IAuditableItemGraphCredential";
15
17
  export * from "./models/IAuditableItemGraphEdge";
16
18
  export * from "./models/IAuditableItemGraphPatchOperation";
17
19
  export * from "./models/IAuditableItemGraphResource";
18
- export * from "./models/IAuditableItemGraphVerification";
19
20
  export * from "./models/IAuditableItemGraphVertex";
20
21
  export * from "./models/IAuditableItemGraphVertexList";
21
22
  export * from "./models/verifyDepth";
@@ -1,4 +1,5 @@
1
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
+ import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
2
3
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
3
4
  import type { IAuditableItemGraphAuditedElement } from "./IAuditableItemGraphAuditedElement";
4
5
  /**
@@ -8,15 +9,19 @@ export interface IAuditableItemGraphAlias extends IAuditableItemGraphAuditedElem
8
9
  /**
9
10
  * JSON-LD Context.
10
11
  */
11
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
12
+ "@context": typeof AuditableItemGraphContexts.ContextRoot | [typeof AuditableItemGraphContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];
13
+ /**
14
+ * The id of the element.
15
+ */
16
+ id: string;
12
17
  /**
13
18
  * JSON-LD Type.
14
19
  */
15
20
  type: typeof AuditableItemGraphTypes.Alias;
16
21
  /**
17
- * The JSON-LD object for the alias.
22
+ * The JSON-LD annotation object for the alias.
18
23
  */
19
- aliasObject?: IJsonLdNodeObject;
24
+ annotationObject?: IJsonLdNodeObject;
20
25
  /**
21
26
  * The format of the id in the alias.
22
27
  */
@@ -5,11 +5,11 @@ export interface IAuditableItemGraphAuditedElement {
5
5
  /**
6
6
  * The id of the element.
7
7
  */
8
- id: string;
8
+ id?: string;
9
9
  /**
10
10
  * The date/time of when the element was created.
11
11
  */
12
- dateCreated: string;
12
+ dateCreated?: string;
13
13
  /**
14
14
  * The date/time of when the element was modified.
15
15
  */
@@ -1,18 +1,28 @@
1
+ import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
2
+ import type { IImmutableProofVerification } from "@twin.org/immutable-proof-models";
3
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
1
4
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
2
5
  import type { IAuditableItemGraphPatchOperation } from "./IAuditableItemGraphPatchOperation";
3
- import type { IAuditableItemGraphVerification } from "./IAuditableItemGraphVerification";
4
6
  /**
5
- * Interface describing a set of updates to the vertex.
7
+ * Interface describing a set of changes to the vertex.
6
8
  */
7
9
  export interface IAuditableItemGraphChangeset {
8
10
  /**
9
11
  * JSON-LD Context.
10
12
  */
11
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
13
+ "@context": [
14
+ typeof AuditableItemGraphContexts.ContextRoot,
15
+ typeof AuditableItemGraphContexts.ContextRootCommon,
16
+ ...IJsonLdContextDefinitionElement[]
17
+ ];
12
18
  /**
13
19
  * JSON-LD Type.
14
20
  */
15
21
  type: typeof AuditableItemGraphTypes.Changeset;
22
+ /**
23
+ * The id of the changeset.
24
+ */
25
+ id: string;
16
26
  /**
17
27
  * The date/time of when the changeset was created.
18
28
  */
@@ -26,19 +36,11 @@ export interface IAuditableItemGraphChangeset {
26
36
  */
27
37
  patches: IAuditableItemGraphPatchOperation[];
28
38
  /**
29
- * The hash for the changeset.
30
- */
31
- hash: string;
32
- /**
33
- * The signature for the changeset.
34
- */
35
- signature: string;
36
- /**
37
- * The immutable storage id containing the signature for the changeset.
39
+ * The immutable proof id which contains the signature for this changeset.
38
40
  */
39
- immutableStorageId?: string;
41
+ proofId?: string;
40
42
  /**
41
43
  * The verification for the changeset.
42
44
  */
43
- verification?: IAuditableItemGraphVerification;
45
+ verification?: IImmutableProofVerification;
44
46
  }
@@ -1,6 +1,6 @@
1
1
  import type { IComponent } from "@twin.org/core";
2
2
  import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
3
- import type { SortDirection } from "@twin.org/entity";
3
+ import type { IComparator, SortDirection } from "@twin.org/entity";
4
4
  import type { IAuditableItemGraphVertex } from "./IAuditableItemGraphVertex";
5
5
  import type { IAuditableItemGraphVertexList } from "./IAuditableItemGraphVertexList";
6
6
  import type { VerifyDepth } from "./verifyDepth";
@@ -10,49 +10,62 @@ import type { VerifyDepth } from "./verifyDepth";
10
10
  export interface IAuditableItemGraphComponent extends IComponent {
11
11
  /**
12
12
  * Create a new graph vertex.
13
- * @param vertexObject The object for the vertex as JSON-LD.
14
- * @param aliases Alternative aliases that can be used to identify the vertex.
15
- * @param resources The resources attached to the vertex.
16
- * @param edges The edges connected to the vertex.
13
+ * @param vertex The vertex to create.
14
+ * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.
15
+ * @param vertex.aliases Alternative aliases that can be used to identify the vertex.
16
+ * @param vertex.resources The resources attached to the vertex.
17
+ * @param vertex.edges The edges connected to the vertex.
17
18
  * @param userIdentity The identity to create the auditable item graph operation with.
18
19
  * @param nodeIdentity The node identity to use for vault operations.
19
20
  * @returns The id of the new graph item.
20
21
  */
21
- create(vertexObject?: IJsonLdNodeObject, aliases?: {
22
- id: string;
23
- aliasFormat?: string;
24
- aliasObject?: IJsonLdNodeObject;
25
- }[], resources?: {
26
- id: string;
27
- resourceObject?: IJsonLdNodeObject;
28
- }[], edges?: {
29
- id: string;
30
- edgeRelationship: string;
31
- edgeObject?: IJsonLdNodeObject;
32
- }[], userIdentity?: string, nodeIdentity?: string): Promise<string>;
22
+ create(vertex: {
23
+ annotationObject?: IJsonLdNodeObject;
24
+ aliases?: {
25
+ id: string;
26
+ aliasFormat?: string;
27
+ annotationObject?: IJsonLdNodeObject;
28
+ }[];
29
+ resources?: {
30
+ id?: string;
31
+ resourceObject?: IJsonLdNodeObject;
32
+ }[];
33
+ edges?: {
34
+ id: string;
35
+ edgeRelationships: string[];
36
+ annotationObject?: IJsonLdNodeObject;
37
+ }[];
38
+ }, userIdentity?: string, nodeIdentity?: string): Promise<string>;
33
39
  /**
34
40
  * Update a graph vertex.
35
- * @param id The id of the vertex to update.
36
- * @param vertexObject The object for the vertex as JSON-LD.
37
- * @param aliases Alternative aliases that can be used to identify the vertex.
38
- * @param resources The resources attached to the vertex.
39
- * @param edges The edges connected to the vertex.
41
+ * @param vertex The vertex to update.
42
+ * @param vertex.id The id of the vertex to update.
43
+ * @param vertex.annotationObject The annotation object for the vertex as JSON-LD.
44
+ * @param vertex.aliases Alternative aliases that can be used to identify the vertex.
45
+ * @param vertex.resources The resources attached to the vertex.
46
+ * @param vertex.edges The edges connected to the vertex.
40
47
  * @param userIdentity The identity to create the auditable item graph operation with.
41
48
  * @param nodeIdentity The node identity to use for vault operations.
42
49
  * @returns Nothing.
43
50
  */
44
- update(id: string, vertexObject?: IJsonLdNodeObject, aliases?: {
45
- id: string;
46
- aliasFormat?: string;
47
- aliasObject?: IJsonLdNodeObject;
48
- }[], resources?: {
49
- id: string;
50
- resourceObject?: IJsonLdNodeObject;
51
- }[], edges?: {
51
+ update(vertex: {
52
52
  id: string;
53
- edgeRelationship: string;
54
- edgeObject?: IJsonLdNodeObject;
55
- }[], userIdentity?: string, nodeIdentity?: string): Promise<void>;
53
+ annotationObject?: IJsonLdNodeObject;
54
+ aliases?: {
55
+ id: string;
56
+ aliasFormat?: string;
57
+ annotationObject?: IJsonLdNodeObject;
58
+ }[];
59
+ resources?: {
60
+ id?: string;
61
+ resourceObject?: IJsonLdNodeObject;
62
+ }[];
63
+ edges?: {
64
+ id: string;
65
+ edgeRelationships: string[];
66
+ annotationObject?: IJsonLdNodeObject;
67
+ }[];
68
+ }, userIdentity?: string, nodeIdentity?: string): Promise<void>;
56
69
  /**
57
70
  * Get a graph vertex.
58
71
  * @param id The id of the vertex to get.
@@ -69,18 +82,20 @@ export interface IAuditableItemGraphComponent extends IComponent {
69
82
  verifySignatureDepth?: VerifyDepth;
70
83
  }): Promise<IAuditableItemGraphVertex>;
71
84
  /**
72
- * Remove the immutable storage for an item.
85
+ * Remove the verifiable storage for an item.
73
86
  * @param id The id of the vertex to remove the storage from.
74
87
  * @param nodeIdentity The node identity to use for vault operations.
75
88
  * @returns Nothing.
76
89
  * @throws NotFoundError if the vertex is not found.
77
90
  */
78
- removeImmutable(id: string, nodeIdentity?: string): Promise<void>;
91
+ removeVerifiable(id: string, nodeIdentity?: string): Promise<void>;
79
92
  /**
80
93
  * Query the graph for vertices.
81
94
  * @param options The query options.
82
95
  * @param options.id The optional id to look for.
83
96
  * @param options.idMode Look in id, alias or both, defaults to both.
97
+ * @param options.resourceTypes Include vertices with specific resource types.
98
+ * @param conditions Conditions to use in the query.
84
99
  * @param orderBy The order for the results, defaults to dateCreated.
85
100
  * @param orderByDirection The direction for the order, defaults to descending.
86
101
  * @param properties The properties to return, if not provided defaults to id, dateCreated, aliases and object.
@@ -91,5 +106,6 @@ export interface IAuditableItemGraphComponent extends IComponent {
91
106
  query(options?: {
92
107
  id?: string;
93
108
  idMode?: "id" | "alias" | "both";
94
- }, orderBy?: keyof Pick<IAuditableItemGraphVertex, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, properties?: (keyof IAuditableItemGraphVertex)[], cursor?: string, pageSize?: number): Promise<IAuditableItemGraphVertexList>;
109
+ resourceTypes?: string[];
110
+ }, conditions?: IComparator[], orderBy?: keyof Pick<IAuditableItemGraphVertex, "dateCreated" | "dateModified">, orderByDirection?: SortDirection, properties?: (keyof IAuditableItemGraphVertex)[], cursor?: string, pageSize?: number): Promise<IAuditableItemGraphVertexList>;
95
111
  }
@@ -1,4 +1,5 @@
1
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
+ import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
2
3
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
3
4
  import type { IAuditableItemGraphAuditedElement } from "./IAuditableItemGraphAuditedElement";
4
5
  /**
@@ -8,17 +9,21 @@ export interface IAuditableItemGraphEdge extends IAuditableItemGraphAuditedEleme
8
9
  /**
9
10
  * JSON-LD Context.
10
11
  */
11
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
12
+ "@context": typeof AuditableItemGraphContexts.ContextRoot | [typeof AuditableItemGraphContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];
13
+ /**
14
+ * The id of the element.
15
+ */
16
+ id: string;
12
17
  /**
13
18
  * JSON-LD Type.
14
19
  */
15
20
  type: typeof AuditableItemGraphTypes.Edge;
16
21
  /**
17
- * The JSON-LD object for the edge.
22
+ * The JSON-LD annotation object for the edge.
18
23
  */
19
- edgeObject?: IJsonLdNodeObject;
24
+ annotationObject?: IJsonLdNodeObject;
20
25
  /**
21
- * The relationship between the two vertices.
26
+ * The relationships between the two vertices.
22
27
  */
23
- edgeRelationship: string;
28
+ edgeRelationships: string[];
24
29
  }
@@ -1,3 +1,5 @@
1
+ import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
2
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
1
3
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
2
4
  /**
3
5
  * The patch operation for JSON diffs.
@@ -6,7 +8,7 @@ export interface IAuditableItemGraphPatchOperation {
6
8
  /**
7
9
  * JSON-LD Context.
8
10
  */
9
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
11
+ "@context": typeof AuditableItemGraphContexts.ContextRoot | [typeof AuditableItemGraphContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];
10
12
  /**
11
13
  * JSON-LD Type.
12
14
  */
@@ -1,4 +1,5 @@
1
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
+ import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
2
3
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
3
4
  import type { IAuditableItemGraphAuditedElement } from "./IAuditableItemGraphAuditedElement";
4
5
  /**
@@ -8,7 +9,7 @@ export interface IAuditableItemGraphResource extends IAuditableItemGraphAuditedE
8
9
  /**
9
10
  * JSON-LD Context.
10
11
  */
11
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
12
+ "@context": typeof AuditableItemGraphContexts.ContextRoot | [typeof AuditableItemGraphContexts.ContextRoot, ...IJsonLdContextDefinitionElement[]];
12
13
  /**
13
14
  * JSON-LD Type.
14
15
  */
@@ -1,4 +1,5 @@
1
- import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
1
+ import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
2
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
2
3
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
3
4
  import type { IAuditableItemGraphAlias } from "./IAuditableItemGraphAlias";
4
5
  import type { IAuditableItemGraphAuditedElement } from "./IAuditableItemGraphAuditedElement";
@@ -12,7 +13,15 @@ export interface IAuditableItemGraphVertex extends Omit<IAuditableItemGraphAudit
12
13
  /**
13
14
  * JSON-LD Context.
14
15
  */
15
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
16
+ "@context": [
17
+ typeof AuditableItemGraphContexts.ContextRoot,
18
+ typeof AuditableItemGraphContexts.ContextRootCommon,
19
+ ...IJsonLdContextDefinitionElement[]
20
+ ];
21
+ /**
22
+ * The id of the element.
23
+ */
24
+ id: string;
16
25
  /**
17
26
  * JSON-LD Type.
18
27
  */
@@ -22,9 +31,9 @@ export interface IAuditableItemGraphVertex extends Omit<IAuditableItemGraphAudit
22
31
  */
23
32
  nodeIdentity?: string;
24
33
  /**
25
- * The JSON-LD object for the vertex.
34
+ * The JSON-LD annotation object for the vertex.
26
35
  */
27
- vertexObject?: IJsonLdNodeObject;
36
+ annotationObject?: IJsonLdNodeObject;
28
37
  /**
29
38
  * Alternative aliases that can be used to identify the vertex.
30
39
  */
@@ -1,3 +1,6 @@
1
+ import type { IJsonLdContextDefinitionElement } from "@twin.org/data-json-ld";
2
+ import type { SchemaOrgContexts, SchemaOrgTypes } from "@twin.org/standards-schema-org";
3
+ import type { AuditableItemGraphContexts } from "./auditableItemGraphContexts";
1
4
  import type { AuditableItemGraphTypes } from "./auditableItemGraphTypes";
2
5
  import type { IAuditableItemGraphVertex } from "./IAuditableItemGraphVertex";
3
6
  /**
@@ -7,17 +10,21 @@ export interface IAuditableItemGraphVertexList {
7
10
  /**
8
11
  * JSON-LD Context.
9
12
  */
10
- "@context": typeof AuditableItemGraphTypes.ContextRoot | [typeof AuditableItemGraphTypes.ContextRoot, ...string[]];
13
+ "@context": [
14
+ typeof SchemaOrgContexts.ContextRoot,
15
+ typeof AuditableItemGraphContexts.ContextRoot,
16
+ ...IJsonLdContextDefinitionElement[]
17
+ ];
11
18
  /**
12
19
  * JSON-LD Type.
13
20
  */
14
- type: typeof AuditableItemGraphTypes.VertexList;
21
+ type: [typeof SchemaOrgTypes.ItemList, typeof AuditableItemGraphTypes.VertexList];
15
22
  /**
16
23
  * The list of vertices.
17
24
  */
18
- vertices: IAuditableItemGraphVertex[];
25
+ [SchemaOrgTypes.ItemListElement]: IAuditableItemGraphVertex[];
19
26
  /**
20
27
  * The cursor to get the next chunk of vertices.
21
28
  */
22
- cursor?: string;
29
+ [SchemaOrgTypes.NextItem]?: string;
23
30
  }
@@ -6,24 +6,24 @@ export interface IAuditableItemGraphCreateRequest {
6
6
  /**
7
7
  * The data to be used in the vertex.
8
8
  */
9
- body?: {
9
+ body: {
10
10
  /**
11
11
  * The object to be used in the vertex as JSON-LD.
12
12
  */
13
- vertexObject?: IJsonLdNodeObject;
13
+ annotationObject?: IJsonLdNodeObject;
14
14
  /**
15
15
  * Alternative aliases that can be used to identify the vertex.
16
16
  */
17
17
  aliases?: {
18
18
  id: string;
19
19
  aliasFormat?: string;
20
- aliasObject?: IJsonLdNodeObject;
20
+ annotationObject?: IJsonLdNodeObject;
21
21
  }[];
22
22
  /**
23
23
  * The resources attached to the vertex.
24
24
  */
25
25
  resources?: {
26
- id: string;
26
+ id?: string;
27
27
  resourceObject?: IJsonLdNodeObject;
28
28
  }[];
29
29
  /**
@@ -31,8 +31,8 @@ export interface IAuditableItemGraphCreateRequest {
31
31
  */
32
32
  edges?: {
33
33
  id: string;
34
- edgeRelationship: string;
35
- edgeObject?: IJsonLdNodeObject;
34
+ edgeRelationships: string[];
35
+ annotationObject?: IJsonLdNodeObject;
36
36
  }[];
37
37
  };
38
38
  }
@@ -26,11 +26,11 @@ export interface IAuditableItemGraphGetRequest {
26
26
  /**
27
27
  * Whether to include deleted aliases, resource, edges, defaults to false.
28
28
  */
29
- includeDeleted?: boolean;
29
+ includeDeleted?: boolean | string;
30
30
  /**
31
31
  * Whether to include the changesets of the vertex, defaults to false.
32
32
  */
33
- includeChangesets?: boolean;
33
+ includeChangesets?: boolean | string;
34
34
  /**
35
35
  * How many signatures to verify, none, current or all, defaults to "none".
36
36
  */
@@ -23,6 +23,14 @@ export interface IAuditableItemGraphListRequest {
23
23
  * Which field to look in with the id, defaults to both.
24
24
  */
25
25
  idMode?: "id" | "alias" | "both";
26
+ /**
27
+ * Include vertices with specific resource types, comma separated.
28
+ */
29
+ resourceTypes?: string;
30
+ /**
31
+ * The conditions to filter the streams, JSON stringified IComparator[].
32
+ */
33
+ conditions?: string;
26
34
  /**
27
35
  * The order for the results, default to dateCreated.
28
36
  */
@@ -32,7 +40,7 @@ export interface IAuditableItemGraphListRequest {
32
40
  */
33
41
  orderByDirection?: SortDirection;
34
42
  /**
35
- * The properties to return as a comma separated list, defaults to "id,dateCreated,aliases,vertexObject".
43
+ * The properties to return as a comma separated list, defaults to "id,dateCreated,aliases,annotationObject".
36
44
  */
37
45
  properties?: string;
38
46
  /**
@@ -42,6 +50,6 @@ export interface IAuditableItemGraphListRequest {
42
50
  /**
43
51
  * The maximum number of entities in a page.
44
52
  */
45
- pageSize?: number;
53
+ pageSize?: number | string;
46
54
  };
47
55
  }
@@ -15,24 +15,24 @@ export interface IAuditableItemGraphUpdateRequest {
15
15
  /**
16
16
  * The data to be used in the vertex.
17
17
  */
18
- body?: {
18
+ body: {
19
19
  /**
20
20
  * The object to be used in the vertex as JSON-LD.
21
21
  */
22
- vertexObject?: IJsonLdNodeObject;
22
+ annotationObject?: IJsonLdNodeObject;
23
23
  /**
24
24
  * Alternative aliases that can be used to identify the vertex.
25
25
  */
26
26
  aliases?: {
27
27
  id: string;
28
28
  aliasFormat?: string;
29
- aliasObject?: IJsonLdNodeObject;
29
+ annotationObject?: IJsonLdNodeObject;
30
30
  }[];
31
31
  /**
32
32
  * The resources attached to the vertex.
33
33
  */
34
34
  resources?: {
35
- id: string;
35
+ id?: string;
36
36
  resourceObject?: IJsonLdNodeObject;
37
37
  }[];
38
38
  /**
@@ -40,8 +40,8 @@ export interface IAuditableItemGraphUpdateRequest {
40
40
  */
41
41
  edges?: {
42
42
  id: string;
43
- edgeRelationship: string;
44
- edgeObject?: IJsonLdNodeObject;
43
+ edgeRelationships: string[];
44
+ annotationObject?: IJsonLdNodeObject;
45
45
  }[];
46
46
  };
47
47
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The contexts of auditable item graph data.
3
+ */
4
+ export declare const AuditableItemGraphContexts: {
5
+ /**
6
+ * The context root for the auditable item graph types.
7
+ */
8
+ readonly ContextRoot: "https://schema.twindev.org/aig/";
9
+ /**
10
+ * The context root for the common types.
11
+ */
12
+ readonly ContextRootCommon: "https://schema.twindev.org/common/";
13
+ };
14
+ /**
15
+ * The contexts of auditable item graph data.
16
+ */
17
+ export type AuditableItemGraphContexts = (typeof AuditableItemGraphContexts)[keyof typeof AuditableItemGraphContexts];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The topics for auditable item graph event bus notifications.
3
+ */
4
+ export declare const AuditableItemGraphTopics: {
5
+ /**
6
+ * A vertex was created.
7
+ */
8
+ readonly VertexCreated: "auditable-item-graph:vertex-created";
9
+ /**
10
+ * A vertex was updated.
11
+ */
12
+ readonly VertexUpdated: "auditable-item-graph:vertex-updated";
13
+ };
14
+ /**
15
+ * The topics for auditable item graph event bus notifications.
16
+ */
17
+ export type AuditableItemGraphTopics = (typeof AuditableItemGraphTopics)[keyof typeof AuditableItemGraphTopics];
@@ -2,14 +2,14 @@
2
2
  * The types of auditable item graph data.
3
3
  */
4
4
  export declare const AuditableItemGraphTypes: {
5
- /**
6
- * The context root for the auditable item graph types.
7
- */
8
- readonly ContextRoot: "https://schema.twindev.org/aig/";
9
5
  /**
10
6
  * Represents auditable item graph vertex.
11
7
  */
12
8
  readonly Vertex: "AuditableItemGraphVertex";
9
+ /**
10
+ * Represents auditable item graph vertex list.
11
+ */
12
+ readonly VertexList: "AuditableItemGraphVertexList";
13
13
  /**
14
14
  * Represents auditable item graph alias.
15
15
  */
@@ -30,22 +30,6 @@ export declare const AuditableItemGraphTypes: {
30
30
  * Represents patch operation.
31
31
  */
32
32
  readonly PatchOperation: "AuditableItemGraphPatchOperation";
33
- /**
34
- * Represents the immutable credential payload.
35
- */
36
- readonly Credential: "AuditableItemGraphPatchCredential";
37
- /**
38
- * Represents auditable item stream verification.
39
- */
40
- readonly Verification: "AuditableItemGraphVerification";
41
- /**
42
- * Represents auditable item stream verification state.
43
- */
44
- readonly VerificationState: "AuditableItemGraphVerificationState";
45
- /**
46
- * Represents auditable item stream vertex list.
47
- */
48
- readonly VertexList: "AuditableItemGraphVertexList";
49
33
  };
50
34
  /**
51
35
  * The types of auditable item graph data.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Event bus payload for vertex created.
3
+ */
4
+ export interface IAuditableItemGraphEventBusVertexCreated {
5
+ /**
6
+ * The id of the vertex created.
7
+ */
8
+ id: string;
9
+ }
@@ -0,0 +1,14 @@
1
+ import type { IPatchOperation } from "@twin.org/core";
2
+ /**
3
+ * Event bus payload for vertex updated.
4
+ */
5
+ export interface IAuditableItemGraphEventBusVertexUpdated {
6
+ /**
7
+ * The id of the vertex updated.
8
+ */
9
+ id: string;
10
+ /**
11
+ * The patches in the changeset.
12
+ */
13
+ patches: IPatchOperation[];
14
+ }