@3sixty/auditable-item-graph-service 0.0.0-stage → 0.20.0-next.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 (89) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +26 -2
  3. package/dist/es/auditableItemGraphRoutes.js +1136 -0
  4. package/dist/es/auditableItemGraphRoutes.js.map +1 -0
  5. package/dist/es/auditableItemGraphService.js +1913 -0
  6. package/dist/es/auditableItemGraphService.js.map +1 -0
  7. package/dist/es/entities/auditableItemGraphAlias.js +70 -0
  8. package/dist/es/entities/auditableItemGraphAlias.js.map +1 -0
  9. package/dist/es/entities/auditableItemGraphChangeset.js +79 -0
  10. package/dist/es/entities/auditableItemGraphChangeset.js.map +1 -0
  11. package/dist/es/entities/auditableItemGraphEdge.js +70 -0
  12. package/dist/es/entities/auditableItemGraphEdge.js.map +1 -0
  13. package/dist/es/entities/auditableItemGraphPatch.js +45 -0
  14. package/dist/es/entities/auditableItemGraphPatch.js.map +1 -0
  15. package/dist/es/entities/auditableItemGraphResource.js +54 -0
  16. package/dist/es/entities/auditableItemGraphResource.js.map +1 -0
  17. package/dist/es/entities/auditableItemGraphVertex.js +97 -0
  18. package/dist/es/entities/auditableItemGraphVertex.js.map +1 -0
  19. package/dist/es/entities/auditableItemGraphVertexIndex.js +95 -0
  20. package/dist/es/entities/auditableItemGraphVertexIndex.js.map +1 -0
  21. package/dist/es/entities/auditableItemGraphVertexV0.js +107 -0
  22. package/dist/es/entities/auditableItemGraphVertexV0.js.map +1 -0
  23. package/dist/es/entities/auditableItemGraphVertexV1.js +113 -0
  24. package/dist/es/entities/auditableItemGraphVertexV1.js.map +1 -0
  25. package/dist/es/index.js +19 -0
  26. package/dist/es/index.js.map +1 -0
  27. package/dist/es/models/IAuditableItemGraphServiceConfig.js +4 -0
  28. package/dist/es/models/IAuditableItemGraphServiceConfig.js.map +1 -0
  29. package/dist/es/models/IAuditableItemGraphServiceConstructorOptions.js +2 -0
  30. package/dist/es/models/IAuditableItemGraphServiceConstructorOptions.js.map +1 -0
  31. package/dist/es/models/IAuditableItemGraphServiceContext.js +4 -0
  32. package/dist/es/models/IAuditableItemGraphServiceContext.js.map +1 -0
  33. package/dist/es/restEntryPoints.js +13 -0
  34. package/dist/es/restEntryPoints.js.map +1 -0
  35. package/dist/es/schema.js +27 -0
  36. package/dist/es/schema.js.map +1 -0
  37. package/dist/es/utils/auditableItemGraphVertexIndexHelper.js +57 -0
  38. package/dist/es/utils/auditableItemGraphVertexIndexHelper.js.map +1 -0
  39. package/dist/types/auditableItemGraphRoutes.d.ts +94 -0
  40. package/dist/types/auditableItemGraphService.d.ts +164 -0
  41. package/dist/types/entities/auditableItemGraphAlias.d.ts +34 -0
  42. package/dist/types/entities/auditableItemGraphChangeset.d.ts +34 -0
  43. package/dist/types/entities/auditableItemGraphEdge.d.ts +34 -0
  44. package/dist/types/entities/auditableItemGraphPatch.d.ts +21 -0
  45. package/dist/types/entities/auditableItemGraphResource.d.ts +26 -0
  46. package/dist/types/entities/auditableItemGraphVertex.d.ts +50 -0
  47. package/dist/types/entities/auditableItemGraphVertexIndex.d.ts +39 -0
  48. package/dist/types/entities/auditableItemGraphVertexV0.d.ts +53 -0
  49. package/dist/types/entities/auditableItemGraphVertexV1.d.ts +58 -0
  50. package/dist/types/index.d.ts +16 -0
  51. package/dist/types/models/IAuditableItemGraphServiceConfig.d.ts +9 -0
  52. package/dist/types/models/IAuditableItemGraphServiceConstructorOptions.d.ts +38 -0
  53. package/dist/types/models/IAuditableItemGraphServiceContext.d.ts +17 -0
  54. package/dist/types/restEntryPoints.d.ts +5 -0
  55. package/dist/types/schema.d.ts +4 -0
  56. package/dist/types/utils/auditableItemGraphVertexIndexHelper.d.ts +25 -0
  57. package/docs/changelog.md +16 -0
  58. package/docs/examples.md +273 -0
  59. package/docs/open-api/spec.json +2190 -0
  60. package/docs/reference/classes/AuditableItemGraphAlias.md +69 -0
  61. package/docs/reference/classes/AuditableItemGraphChangeset.md +69 -0
  62. package/docs/reference/classes/AuditableItemGraphEdge.md +69 -0
  63. package/docs/reference/classes/AuditableItemGraphPatch.md +45 -0
  64. package/docs/reference/classes/AuditableItemGraphResource.md +53 -0
  65. package/docs/reference/classes/AuditableItemGraphService.md +539 -0
  66. package/docs/reference/classes/AuditableItemGraphVertex.md +93 -0
  67. package/docs/reference/classes/AuditableItemGraphVertexIndex.md +75 -0
  68. package/docs/reference/classes/AuditableItemGraphVertexIndexHelper.md +84 -0
  69. package/docs/reference/classes/AuditableItemGraphVertexV0.md +101 -0
  70. package/docs/reference/classes/AuditableItemGraphVertexV1.md +109 -0
  71. package/docs/reference/functions/auditableItemGraphChangesetGet.md +31 -0
  72. package/docs/reference/functions/auditableItemGraphChangesetList.md +31 -0
  73. package/docs/reference/functions/auditableItemGraphCreate.md +37 -0
  74. package/docs/reference/functions/auditableItemGraphGet.md +31 -0
  75. package/docs/reference/functions/auditableItemGraphList.md +31 -0
  76. package/docs/reference/functions/auditableItemGraphRemoveProof.md +31 -0
  77. package/docs/reference/functions/auditableItemGraphUpdate.md +31 -0
  78. package/docs/reference/functions/auditableItemGraphUpdatePartial.md +31 -0
  79. package/docs/reference/functions/auditableItemGraphVersionGet.md +31 -0
  80. package/docs/reference/functions/auditableItemGraphVersionList.md +31 -0
  81. package/docs/reference/functions/generateRestRoutesAuditableItemGraph.md +25 -0
  82. package/docs/reference/functions/initSchema.md +9 -0
  83. package/docs/reference/index.md +40 -0
  84. package/docs/reference/interfaces/IAuditableItemGraphServiceConfig.md +11 -0
  85. package/docs/reference/interfaces/IAuditableItemGraphServiceConstructorOptions.md +83 -0
  86. package/docs/reference/variables/restEntryPoints.md +5 -0
  87. package/docs/reference/variables/tagsAuditableItemGraph.md +5 -0
  88. package/locales/en.json +34 -0
  89. package/package.json +64 -5
@@ -0,0 +1,58 @@
1
+ import type { AuditableItemGraphAuditMode } from "@3sixty/auditable-item-graph-models";
2
+ import { type IJsonLdNodeObject } from "@3sixty/data-json-ld";
3
+ import type { AuditableItemGraphAlias } from "./auditableItemGraphAlias.js";
4
+ import type { AuditableItemGraphEdge } from "./auditableItemGraphEdge.js";
5
+ import type { AuditableItemGraphResource } from "./auditableItemGraphResource.js";
6
+ /**
7
+ * Class describing the auditable item graph vertex.
8
+ */
9
+ export declare class AuditableItemGraphVertexV1 {
10
+ /**
11
+ * The id of the vertex.
12
+ */
13
+ id: string;
14
+ /**
15
+ * The identity of the organization which controls the vertex.
16
+ */
17
+ organizationIdentity: string;
18
+ /**
19
+ * The date/time of when the vertex was created.
20
+ */
21
+ dateCreated: string;
22
+ /**
23
+ * The date/time of when the vertex was last modified.
24
+ */
25
+ dateModified?: string;
26
+ /**
27
+ * How the mutations of the vertex are recorded, when absent the vertex behaves as audited.
28
+ */
29
+ auditMode?: AuditableItemGraphAuditMode;
30
+ /**
31
+ * Combined alias index for the vertex used for querying.
32
+ */
33
+ aliasIndex?: string;
34
+ /**
35
+ * Combined resource type index for the vertex used for querying.
36
+ */
37
+ resourceTypeIndex?: string;
38
+ /**
39
+ * Object to associate with the vertex as JSON-LD.
40
+ */
41
+ annotationObject?: IJsonLdNodeObject;
42
+ /**
43
+ * Alternative aliases that can be used to identify the vertex.
44
+ */
45
+ aliases?: AuditableItemGraphAlias[];
46
+ /**
47
+ * The resources attached to the vertex.
48
+ */
49
+ resources?: AuditableItemGraphResource[];
50
+ /**
51
+ * Edges connected to the vertex.
52
+ */
53
+ edges?: AuditableItemGraphEdge[];
54
+ /**
55
+ * The current version of the vertex, incremented on each changeset.
56
+ */
57
+ version?: number;
58
+ }
@@ -0,0 +1,16 @@
1
+ export * from "./auditableItemGraphRoutes.js";
2
+ export * from "./auditableItemGraphService.js";
3
+ export * from "./entities/auditableItemGraphAlias.js";
4
+ export * from "./entities/auditableItemGraphChangeset.js";
5
+ export * from "./entities/auditableItemGraphEdge.js";
6
+ export * from "./entities/auditableItemGraphPatch.js";
7
+ export * from "./entities/auditableItemGraphResource.js";
8
+ export * from "./entities/auditableItemGraphVertex.js";
9
+ export * from "./entities/auditableItemGraphVertexIndex.js";
10
+ export * from "./entities/auditableItemGraphVertexV0.js";
11
+ export * from "./entities/auditableItemGraphVertexV1.js";
12
+ export * from "./models/IAuditableItemGraphServiceConfig.js";
13
+ export * from "./models/IAuditableItemGraphServiceConstructorOptions.js";
14
+ export * from "./restEntryPoints.js";
15
+ export * from "./schema.js";
16
+ export * from "./utils/auditableItemGraphVertexIndexHelper.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Configuration for the auditable item graph service.
3
+ */
4
+ export interface IAuditableItemGraphServiceConfig {
5
+ /**
6
+ * Timeout in milliseconds for acquiring a mutex lock.
7
+ */
8
+ mutexTimeoutMs?: number;
9
+ }
@@ -0,0 +1,38 @@
1
+ import type { IAuditableItemGraphServiceConfig } from "./IAuditableItemGraphServiceConfig.js";
2
+ /**
3
+ * Options for the constructor of the auditable item graph service.
4
+ */
5
+ export interface IAuditableItemGraphServiceConstructorOptions {
6
+ /**
7
+ * The immutable proof component type.
8
+ * @default immutable-proof
9
+ */
10
+ immutableProofComponentType?: string;
11
+ /**
12
+ * The entity storage for vertices.
13
+ * @default auditable-item-graph-vertex
14
+ */
15
+ vertexEntityStorageType?: string;
16
+ /**
17
+ * The entity storage for vertex indices.
18
+ * @default auditable-item-graph-vertex-index
19
+ */
20
+ vertexIndexEntityStorageType?: string;
21
+ /**
22
+ * The entity storage for changesets.
23
+ * @default auditable-item-graph-changeset
24
+ */
25
+ changesetEntityStorageType?: string;
26
+ /**
27
+ * The event bus component type, defaults to no event bus.
28
+ */
29
+ eventBusComponentType?: string;
30
+ /**
31
+ * The component type for the optional telemetry component used for event metrics, defaults to no telemetry.
32
+ */
33
+ telemetryComponentType?: string;
34
+ /**
35
+ * The configuration for the service.
36
+ */
37
+ config?: IAuditableItemGraphServiceConfig;
38
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Context for the auditable item graph service.
3
+ */
4
+ export interface IAuditableItemGraphServiceContext {
5
+ /**
6
+ * The current date/time.
7
+ */
8
+ now: string;
9
+ /**
10
+ * The organization identity for the operation.
11
+ */
12
+ organizationIdentity: string;
13
+ /**
14
+ * The user identity for the operation.
15
+ */
16
+ userIdentity?: string;
17
+ }
@@ -0,0 +1,5 @@
1
+ import type { IRestRouteEntryPoint } from "@3sixty/api-models";
2
+ /**
3
+ * The REST entry points for the auditable item graph service.
4
+ */
5
+ export declare const restEntryPoints: IRestRouteEntryPoint[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Initialize the schema for the auditable item graph entity storage connector.
3
+ */
4
+ export declare function initSchema(): void;
@@ -0,0 +1,25 @@
1
+ import type { AuditableItemGraphVertexIndex } from "../entities/auditableItemGraphVertexIndex.js";
2
+ /**
3
+ * Helper methods for building auditable item graph vertex index entries.
4
+ */
5
+ export declare class AuditableItemGraphVertexIndexHelper {
6
+ /**
7
+ * Create the index entry for one type and value of a vertex. The value is case folded and
8
+ * hashed, and the id is derived from the content so the same entry always produces the same id.
9
+ * The modification date is excluded from the id as it is optional and changes over time.
10
+ * @param vertexId The id of the vertex the entry refers to.
11
+ * @param type The index type.
12
+ * @param value The index value.
13
+ * @param dateCreated The creation date of the vertex.
14
+ * @param dateModified The modification date of the vertex.
15
+ * @returns The index entry.
16
+ */
17
+ static createIndexEntry(vertexId: string, type: string, value: string, dateCreated: string, dateModified?: string): AuditableItemGraphVertexIndex;
18
+ /**
19
+ * Hash an index value so the composite index key has a fixed size whatever the value length.
20
+ * The value is case folded first so lookups are case insensitive.
21
+ * @param value The value to hash.
22
+ * @returns The base64 url encoded Blake2b-160 hash, or undefined when there is no value.
23
+ */
24
+ static hashValue(value?: string): string | undefined;
25
+ }
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## [0.20.0-next.1](https://github.com/3sixtyglobal/auditable-item-graph/compare/auditable-item-graph-service-v0.20.0-next.0...auditable-item-graph-service-v0.20.0-next.1) (2026-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * publish packages under the [@3sixty](https://github.com/3sixty) namespace ([69a615e](https://github.com/3sixtyglobal/auditable-item-graph/commit/69a615ed9a59cc91795d1f8fd65cc778cea7e783))
9
+ * updated ts compile ([5631c11](https://github.com/3sixtyglobal/auditable-item-graph/commit/5631c11fa969a8917e68253c50bf962c10e75814))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @3sixty/auditable-item-graph-models bumped from 0.20.0-next.0 to 0.20.0-next.1
@@ -0,0 +1,273 @@
1
+ # Auditable Item Graph Service Examples
2
+
3
+ Use these examples when you want to run graph operations in process, keep an audit trail, and work with strongly typed entities.
4
+
5
+ ## AuditableItemGraphService
6
+
7
+ ```typescript
8
+ import { AuditableItemGraphService } from '@3sixty/auditable-item-graph-service';
9
+
10
+ const service = new AuditableItemGraphService();
11
+
12
+ console.log(service.className()); // AuditableItemGraphService
13
+ ```
14
+
15
+ ```typescript
16
+ import { AuditableItemGraphService } from '@3sixty/auditable-item-graph-service';
17
+
18
+ const service = new AuditableItemGraphService();
19
+
20
+ const vertexId = await service.create({
21
+ annotationObject: {
22
+ '@context': 'https://www.w3.org/ns/activitystreams',
23
+ type: 'Create',
24
+ actor: {
25
+ type: 'Person',
26
+ id: 'did:example:alice',
27
+ name: 'Alice'
28
+ },
29
+ object: {
30
+ type: 'Note',
31
+ content: 'Initial version'
32
+ }
33
+ },
34
+ aliases: [{ id: 'order-2026-0195', aliasFormat: 'orderRef' }],
35
+ resources: [
36
+ { resourceObject: { '@context': 'https://schema.org', type: 'Thing', name: 'Order 2026-0195' } }
37
+ ]
38
+ });
39
+
40
+ await service.update({
41
+ id: vertexId,
42
+ aliases: [{ id: 'order-2026-0195', aliasFormat: 'orderRef' }],
43
+ resources: [
44
+ {
45
+ id: 'resource-order',
46
+ resourceObject: {
47
+ '@context': 'https://schema.org',
48
+ type: 'Thing',
49
+ name: 'Order 2026-0195 (amended)'
50
+ }
51
+ }
52
+ ],
53
+ edges: [{ targetId: 'aig:018f5a6cfd9444d58c7c2d4df1fd0fff', edgeRelationships: ['derivedFrom'] }]
54
+ });
55
+
56
+ console.log(vertexId); // aig:018f5a6cfd9444d58c7c2d4df1fd0a23
57
+ ```
58
+
59
+ ```typescript
60
+ import { VerifyDepth } from '@3sixty/auditable-item-graph-models';
61
+ import { AuditableItemGraphService } from '@3sixty/auditable-item-graph-service';
62
+
63
+ const service = new AuditableItemGraphService();
64
+ const vertexId = 'aig:018f5a6cfd9444d58c7c2d4df1fd0a23';
65
+
66
+ const vertex = await service.get(vertexId, {
67
+ includeDeleted: false,
68
+ verifySignatureDepth: VerifyDepth.Current
69
+ });
70
+
71
+ const changesetChunk = await service.getChangesets(vertexId, undefined, 10, {
72
+ verifySignatureDepth: VerifyDepth.Current
73
+ });
74
+
75
+ const firstChangeset = changesetChunk.changesets.itemListElement?.[0];
76
+
77
+ if (firstChangeset?.id) {
78
+ const changeset = await service.getChangeset(firstChangeset.id, {
79
+ verifySignatureDepth: VerifyDepth.Current
80
+ });
81
+
82
+ console.log(vertex.id); // aig:018f5a6cfd9444d58c7c2d4df1fd0a23
83
+ console.log(changeset.id); // aig:018f5a6cfd9444d58c7c2d4df1fd0a23:changeset:018f5a6cfd9444d58c7c2d4df1fd0b10
84
+ }
85
+ ```
86
+
87
+ ```typescript
88
+ import { ComparisonOperator, SortDirection } from '@3sixty/entity';
89
+ import { AuditableItemGraphService } from '@3sixty/auditable-item-graph-service';
90
+
91
+ const service = new AuditableItemGraphService();
92
+
93
+ const queryResult = await service.query(
94
+ {
95
+ id: 'order-2026',
96
+ idMode: 'alias',
97
+ idExact: false,
98
+ resourceTypes: ['Thing']
99
+ },
100
+ [
101
+ {
102
+ field: 'dateCreated',
103
+ comparison: ComparisonOperator.GreaterThan,
104
+ value: '2026-01-01T00:00:00.000Z'
105
+ }
106
+ ],
107
+ 'dateCreated',
108
+ SortDirection.Descending,
109
+ ['id', 'dateCreated', 'aliases'],
110
+ undefined,
111
+ 25
112
+ );
113
+
114
+ console.log(queryResult.entries.itemListElement?.length ?? 0); // 3
115
+
116
+ await service.removeVerifiable('aig:018f5a6cfd9444d58c7c2d4df1fd0a23');
117
+ ```
118
+
119
+ Vertices which only need their current state can opt out of versioning with `auditMode`. Bypass is a
120
+ terminal mode; switching an audited vertex to bypass compacts its history and removes the associated
121
+ proofs, and a bypass vertex can never return to audited.
122
+
123
+ ```typescript
124
+ import { AuditableItemGraphAuditMode } from '@3sixty/auditable-item-graph-models';
125
+ import { AuditableItemGraphService } from '@3sixty/auditable-item-graph-service';
126
+
127
+ const service = new AuditableItemGraphService();
128
+
129
+ const lookupId = await service.create({
130
+ auditMode: AuditableItemGraphAuditMode.Bypass,
131
+ aliases: [{ id: 'currency-rates', aliasFormat: 'lookupRef' }]
132
+ });
133
+
134
+ // Overwrites the stored state in place, no changeset is written.
135
+ await service.updatePartial({
136
+ id: lookupId,
137
+ annotationObject: { '@context': 'https://schema.org', type: 'Thing', name: 'Rates 2026-03-10' }
138
+ });
139
+
140
+ const changesets = await service.getChangesets(lookupId);
141
+
142
+ console.log(changesets.changesets.itemListElement?.length ?? 0); // 0
143
+
144
+ // Archive an existing audited vertex by compacting it to its current state.
145
+ await service.updatePartial({
146
+ id: 'aig:018f5a6cfd9444d58c7c2d4df1fd0a23',
147
+ auditMode: AuditableItemGraphAuditMode.Bypass
148
+ });
149
+ ```
150
+
151
+ ## AuditableItemGraphVertex
152
+
153
+ ```typescript
154
+ import {
155
+ AuditableItemGraphAlias,
156
+ AuditableItemGraphEdge,
157
+ AuditableItemGraphResource,
158
+ AuditableItemGraphVertex
159
+ } from '@3sixty/auditable-item-graph-service';
160
+
161
+ const alias = new AuditableItemGraphAlias();
162
+ alias.id = 'order-2026-0195';
163
+ alias.aliasFormat = 'orderRef';
164
+ alias.dateCreated = '2026-03-10T09:30:00.000Z';
165
+
166
+ const resource = new AuditableItemGraphResource();
167
+ resource.id = 'resource-order';
168
+ resource.dateCreated = '2026-03-10T09:30:00.000Z';
169
+ resource.resourceObject = {
170
+ '@context': 'https://schema.org',
171
+ type: 'Thing',
172
+ name: 'Order 2026-0195'
173
+ };
174
+
175
+ const edge = new AuditableItemGraphEdge();
176
+ edge.id = 'edge-1';
177
+ edge.dateCreated = '2026-03-10T09:30:00.000Z';
178
+ edge.targetId = 'aig:018f5a6cfd9444d58c7c2d4df1fd0fff';
179
+ edge.edgeRelationships = ['derivedFrom'];
180
+
181
+ const vertex = new AuditableItemGraphVertex();
182
+ vertex.id = '018f5a6cfd9444d58c7c2d4df1fd0a23';
183
+ vertex.organizationIdentity = 'did:web:example.org';
184
+ vertex.dateCreated = '2026-03-10T09:30:00.000Z';
185
+ vertex.aliases = [alias];
186
+ vertex.resources = [resource];
187
+ vertex.edges = [edge];
188
+
189
+ console.log(vertex.aliases?.length ?? 0); // 1
190
+ ```
191
+
192
+ ## AuditableItemGraphChangeset
193
+
194
+ ```typescript
195
+ import {
196
+ AuditableItemGraphChangeset,
197
+ AuditableItemGraphPatch
198
+ } from '@3sixty/auditable-item-graph-service';
199
+
200
+ const patch = new AuditableItemGraphPatch();
201
+ patch.op = 'replace';
202
+ patch.path = '/resources/0/resourceObject/name';
203
+ patch.value = 'Order 2026-0195 (amended)';
204
+
205
+ const changeset = new AuditableItemGraphChangeset();
206
+ changeset.id = '018f5a6cfd9444d58c7c2d4df1fd0b10';
207
+ changeset.vertexId = '018f5a6cfd9444d58c7c2d4df1fd0a23';
208
+ changeset.dateCreated = '2026-03-10T09:40:00.000Z';
209
+ changeset.userIdentity = 'did:web:example.org:users:alice';
210
+ changeset.patches = [patch];
211
+
212
+ console.log(changeset.patches.length); // 1
213
+ ```
214
+
215
+ ## AuditableItemGraphAlias
216
+
217
+ ```typescript
218
+ import { AuditableItemGraphAlias } from '@3sixty/auditable-item-graph-service';
219
+
220
+ const alias = new AuditableItemGraphAlias();
221
+ alias.id = 'order-2026-0195';
222
+ alias.aliasFormat = 'orderRef';
223
+ alias.dateCreated = '2026-03-10T09:30:00.000Z';
224
+
225
+ console.log(alias.id); // order-2026-0195
226
+ ```
227
+
228
+ ## AuditableItemGraphResource
229
+
230
+ ```typescript
231
+ import { AuditableItemGraphResource } from '@3sixty/auditable-item-graph-service';
232
+
233
+ const resource = new AuditableItemGraphResource();
234
+ resource.id = 'resource-order';
235
+ resource.dateCreated = '2026-03-10T09:30:00.000Z';
236
+ resource.resourceObject = {
237
+ '@context': 'https://schema.org',
238
+ type: 'Thing',
239
+ name: 'Order 2026-0195'
240
+ };
241
+
242
+ console.log(resource.id); // resource-order
243
+ ```
244
+
245
+ ## AuditableItemGraphEdge
246
+
247
+ ```typescript
248
+ import { AuditableItemGraphEdge } from '@3sixty/auditable-item-graph-service';
249
+
250
+ const edge = new AuditableItemGraphEdge();
251
+ edge.id = 'edge-1';
252
+ edge.dateCreated = '2026-03-10T09:30:00.000Z';
253
+ edge.targetId = 'aig:018f5a6cfd9444d58c7c2d4df1fd0fff';
254
+ edge.edgeRelationships = ['derivedFrom'];
255
+
256
+ console.log(edge.edgeRelationships[0]); // derivedFrom
257
+ ```
258
+
259
+ ## AuditableItemGraphPatch
260
+
261
+ ```typescript
262
+ import { AuditableItemGraphPatch } from '@3sixty/auditable-item-graph-service';
263
+
264
+ const patch = new AuditableItemGraphPatch();
265
+ patch.op = 'add';
266
+ patch.path = '/aliases/-';
267
+ patch.value = {
268
+ id: 'order-2026-0195',
269
+ aliasFormat: 'orderRef'
270
+ };
271
+
272
+ console.log(patch.op); // add
273
+ ```