@eqtylab/explorer 0.0.0

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 (140) hide show
  1. package/.env.api +6 -0
  2. package/.env.iframe +2 -0
  3. package/.env.manifest +2 -0
  4. package/.envrc +1 -0
  5. package/.eslintrc.cjs +17 -0
  6. package/.github/workflows/ci.yml +46 -0
  7. package/.github/workflows/publish.yml +44 -0
  8. package/.husky/pre-push +2 -0
  9. package/.prettierignore +2 -0
  10. package/.prettierrc.json +13 -0
  11. package/LICENSE +201 -0
  12. package/README.md +84 -0
  13. package/flake.lock +61 -0
  14. package/flake.nix +23 -0
  15. package/index.html +13 -0
  16. package/package.json +93 -0
  17. package/postcss.config.js +5 -0
  18. package/public/logos/eci.svg +23 -0
  19. package/public/logos/eqty.svg +3 -0
  20. package/public/manifests/B-200-merged.json +773 -0
  21. package/public/manifests/amd-sev.json +426 -0
  22. package/public/manifests/anchors.json +609 -0
  23. package/public/manifests/association-no-metadata.json +1393 -0
  24. package/public/manifests/association.json +1402 -0
  25. package/public/manifests/eqty-docker.json +562 -0
  26. package/public/manifests/governance.json +1324 -0
  27. package/public/manifests/intel-tdx-with-nvidia.json +441 -0
  28. package/public/manifests/intel-tdx.json +404 -0
  29. package/public/manifests/iroh-collections.json +1285 -0
  30. package/public/manifests/model-signing.json +1536 -0
  31. package/public/manifests/multiple-registrations.json +129 -0
  32. package/public/manifests/no-vcs.json +114 -0
  33. package/public/manifests/storage.json +294 -0
  34. package/public/manifests/sub-graphs.json +1 -0
  35. package/src/animations/variants.ts +52 -0
  36. package/src/app/apiClient/integrityService/fetchAttributes.ts +29 -0
  37. package/src/app/apiClient/integrityService/fetchManifest.ts +28 -0
  38. package/src/app/apiClient/integrityService/types.ts +12 -0
  39. package/src/app/components/integrityService/IntegrityService.tsx +105 -0
  40. package/src/app/components/integrityService/components/AuthButton.tsx +26 -0
  41. package/src/app/components/integrityService/components/FiltersModal.tsx +214 -0
  42. package/src/app/components/integrityService/components/FiltersToggle.tsx +28 -0
  43. package/src/app/components/manifestViewer/ManifestViewer.tsx +90 -0
  44. package/src/app/components/manifestViewer/components/ManifestButtons.tsx +215 -0
  45. package/src/app/config.json +23 -0
  46. package/src/app/config.ts +28 -0
  47. package/src/app/pages/index.tsx +34 -0
  48. package/src/app/stores/manifestStore.ts +19 -0
  49. package/src/app/utils/appMode.ts +37 -0
  50. package/src/assets/fonts/TWKLausanne-300.woff +0 -0
  51. package/src/assets/fonts/TWKLausanne-300.woff2 +0 -0
  52. package/src/assets/fonts/TWKLausanne-400.woff +0 -0
  53. package/src/assets/fonts/TWKLausanne-400.woff2 +0 -0
  54. package/src/assets/fonts/TWKLausanne-500.woff +0 -0
  55. package/src/assets/fonts/TWKLausanne-500.woff2 +0 -0
  56. package/src/assets/fonts/TWKLausanne-600.woff +0 -0
  57. package/src/assets/fonts/TWKLausanne-600.woff2 +0 -0
  58. package/src/assets/vectors/eqtylab.svg +6 -0
  59. package/src/components/app-header.tsx +61 -0
  60. package/src/components/dark-mode-switch.tsx +16 -0
  61. package/src/components/ui/accordion.tsx +47 -0
  62. package/src/components/ui/certificate-chain.tsx +60 -0
  63. package/src/components/ui/certificate-code.tsx +39 -0
  64. package/src/components/ui/details.tsx +20 -0
  65. package/src/components/ui/display-code.tsx +47 -0
  66. package/src/components/ui/panel-label.tsx +12 -0
  67. package/src/components/ui/verify-state-badge.tsx +32 -0
  68. package/src/explorer-component/LineageExplorer.tsx +89 -0
  69. package/src/explorer-component/components/CustomEdge.tsx +28 -0
  70. package/src/explorer-component/components/LineageFlow.tsx +220 -0
  71. package/src/explorer-component/components/NodeIconLoader.tsx +26 -0
  72. package/src/explorer-component/components/nodes/ComputationNode.tsx +56 -0
  73. package/src/explorer-component/components/nodes/CustomNode.tsx +112 -0
  74. package/src/explorer-component/components/nodes/index.ts +4 -0
  75. package/src/explorer-component/components/nodes/nodes.tsx +144 -0
  76. package/src/explorer-component/components/nodes/types.ts +167 -0
  77. package/src/explorer-component/components/sidebar/SectionList.tsx +54 -0
  78. package/src/explorer-component/components/sidebar/SectionTitle.tsx +10 -0
  79. package/src/explorer-component/components/sidebar/Sidebar.tsx +70 -0
  80. package/src/explorer-component/components/sidebar/SidebarWrapper.tsx +76 -0
  81. package/src/explorer-component/components/sidebar/sections/CustomSection.tsx +238 -0
  82. package/src/explorer-component/components/sidebar/sections/FileViewer.tsx +229 -0
  83. package/src/explorer-component/components/sidebar/sections/GovernanceSection.tsx +52 -0
  84. package/src/explorer-component/components/sidebar/sections/RegistrationSection.tsx +254 -0
  85. package/src/explorer-component/components/sidebar/sections/SigstoreSection.tsx +37 -0
  86. package/src/explorer-component/components/sidebar/sections/StorageSection.tsx +73 -0
  87. package/src/explorer-component/components/sidebar/sections/custom/IrohCollectionsView.tsx +139 -0
  88. package/src/explorer-component/components/sidebar/sections/registration/VerificationIcon.tsx +108 -0
  89. package/src/explorer-component/components/sidebar/sections/registration/actor/ActorBadge.tsx +62 -0
  90. package/src/explorer-component/components/sidebar/sections/registration/actor/svg/AMDLogo.tsx +40 -0
  91. package/src/explorer-component/components/sidebar/sections/registration/actor/svg/AzureLogo.tsx +65 -0
  92. package/src/explorer-component/components/sidebar/sections/registration/actor/svg/IntelLogo.tsx +24 -0
  93. package/src/explorer-component/components/sidebar/sections/registration/actor/svg/NvidiaLogo.tsx +27 -0
  94. package/src/explorer-component/components/sidebar/sections/registration/verifierClient.ts +13 -0
  95. package/src/explorer-component/icons/AttributionIcon.svg +6 -0
  96. package/src/explorer-component/icons/BenchmarkIcon.svg +6 -0
  97. package/src/explorer-component/icons/BenchmarkResultIcon.svg +6 -0
  98. package/src/explorer-component/icons/CertificateIcon.svg +6 -0
  99. package/src/explorer-component/icons/CodeIcon.svg +6 -0
  100. package/src/explorer-component/icons/ComputationIcon.svg +6 -0
  101. package/src/explorer-component/icons/DataIcon.svg +6 -0
  102. package/src/explorer-component/icons/DatabaseIcon.svg +6 -0
  103. package/src/explorer-component/icons/DatasetIcon.svg +6 -0
  104. package/src/explorer-component/icons/DeltaLakeIcon.svg +7 -0
  105. package/src/explorer-component/icons/DocumentIcon.svg +6 -0
  106. package/src/explorer-component/icons/MediaIcon.svg +6 -0
  107. package/src/explorer-component/icons/ModelIcon.svg +6 -0
  108. package/src/explorer-component/icons/TeamIcon.svg +3 -0
  109. package/src/explorer-component/icons/TokenIcon.svg +6 -0
  110. package/src/explorer-component/icons/UnknownIcon.svg +6 -0
  111. package/src/explorer-component/icons/index.ts +35 -0
  112. package/src/explorer-component/index.ts +5 -0
  113. package/src/explorer-component/integrityTypes/AnchorTypes.ts +31 -0
  114. package/src/explorer-component/integrityTypes/StatementTypes.ts +333 -0
  115. package/src/explorer-component/integrityTypes/VCTypes.ts +85 -0
  116. package/src/explorer-component/integrityTypes/types.ts +3 -0
  117. package/src/explorer-component/utils/config.ts +163 -0
  118. package/src/explorer-component/utils/formatTimestamp.ts +5 -0
  119. package/src/explorer-component/utils/generateGraph.ts +271 -0
  120. package/src/explorer-component/utils/layoutGraph.ts +148 -0
  121. package/src/explorer-component/utils/resolveIrohBlobs.ts +117 -0
  122. package/src/explorer-component/utils/statementHelpers.ts +252 -0
  123. package/src/explorer-component/utils/stripPrefix.ts +4 -0
  124. package/src/hooks/use-mobile.tsx +19 -0
  125. package/src/index.ts +3 -0
  126. package/src/lib/resource-types.ts +31 -0
  127. package/src/lib/use-escape-key.tsx +16 -0
  128. package/src/lib/utils.ts +19 -0
  129. package/src/main.css +82 -0
  130. package/src/main.tsx +39 -0
  131. package/src/v-comp-viewer/components/container-did-details.tsx +53 -0
  132. package/src/v-comp-viewer/components/system-did-details.tsx +356 -0
  133. package/src/v-comp-viewer/useVComp.ts +196 -0
  134. package/src/v-comp-viewer/utils.tsx +824 -0
  135. package/src/vite-env.d.ts +1 -0
  136. package/tsconfig.json +33 -0
  137. package/tsconfig.node.json +10 -0
  138. package/vercel.json +13 -0
  139. package/vite.app.config.ts +48 -0
  140. package/vite.lib.config.ts +61 -0
@@ -0,0 +1,333 @@
1
+ import { VerifiableCredential } from "./VCTypes";
2
+
3
+ export type Statement =
4
+ | ComputationStatement
5
+ | DataStatement
6
+ // | DidStatement
7
+ // | DsseStatement
8
+ | GovernanceStatement
9
+ | MetadataStatement
10
+ | SigstoreStatement
11
+ | StorageStatement
12
+ | VcStatement;
13
+
14
+ export const RegistrationTypes = {
15
+ Computation: "ComputationRegistration",
16
+ Data: "DataRegistration",
17
+ Did: "DidRegistration",
18
+ Governance: "GovernanceRegistration",
19
+ Metadata: "MetadataRegistration",
20
+ Storage: "StorageRegistration",
21
+ Credential: "CredentialRegistration",
22
+ Sigstore: "SigstoreRegistration",
23
+ } as const;
24
+
25
+ export function StatementToJSON(value: Statement) {
26
+ if (value === undefined || value === null) {
27
+ return undefined;
28
+ }
29
+
30
+ switch (value.type) {
31
+ case RegistrationTypes.Data: {
32
+ return DataStatementToJSON(value as DataStatement);
33
+ }
34
+ case RegistrationTypes.Computation: {
35
+ return ComputationStatementToJSON(value as ComputationStatement);
36
+ }
37
+ case RegistrationTypes.Metadata: {
38
+ return MetadataStatementToJSON(value as MetadataStatement);
39
+ }
40
+ case RegistrationTypes.Governance: {
41
+ return GovernanceStatementToJSON(value as GovernanceStatement);
42
+ }
43
+ default: {
44
+ throw new Error(`Unknown statement type: ${value.type}`);
45
+ }
46
+ }
47
+ }
48
+
49
+ export interface ComputationStatement {
50
+ context: string;
51
+ id: string;
52
+ type: string;
53
+ computation?: string;
54
+ executedOn?: string;
55
+ input: string;
56
+ operatedBy?: string;
57
+ output: string;
58
+ registeredBy: string;
59
+ timestamp: string;
60
+ }
61
+
62
+ export function ComputationStatementFromJSON(json: any) {
63
+ if (json === undefined || json === null) {
64
+ return json;
65
+ }
66
+ return {
67
+ context: json["@context"],
68
+ id: json["@id"],
69
+ type: json["@type"],
70
+ computation: json["computation"] ? json["computation"] : undefined,
71
+ executedOn: json["executedOn"] ? json["executedOn"] : undefined,
72
+ input: json["input"],
73
+ operatedBy: json["operatedBy"],
74
+ output: json["output"],
75
+ registeredBy: json["registeredBy"],
76
+ timestamp: json["timestamp"],
77
+ };
78
+ }
79
+
80
+ export function ComputationStatementToJSON(value: ComputationStatement) {
81
+ if (value === undefined || value === null) {
82
+ return undefined;
83
+ }
84
+ return {
85
+ "@context": value.context,
86
+ "@id": value.id,
87
+ "@type": value.type,
88
+ computation: value.computation,
89
+ executedOn: value.executedOn,
90
+ input: value.input,
91
+ operatedBy: value.operatedBy,
92
+ output: value.output,
93
+ registeredBy: value.registeredBy,
94
+ timestamp: value.timestamp,
95
+ };
96
+ }
97
+
98
+ //End Computation ***********************
99
+
100
+ // Data ***********************
101
+ export interface DataStatement {
102
+ context: string;
103
+ id: string;
104
+ type: string;
105
+ data: string;
106
+ registeredBy: string;
107
+ timestamp: string;
108
+ }
109
+ export function DataStatementFromJSON(json: any) {
110
+ if (json === undefined || json === null) {
111
+ return json;
112
+ }
113
+ return {
114
+ context: json["@context"],
115
+ id: json["@id"],
116
+ type: json["@type"],
117
+ data: json["data"],
118
+ registeredBy: json["registeredBy"],
119
+ timestamp: json["timestamp"],
120
+ };
121
+ }
122
+
123
+ function DataStatementToJSON(value: DataStatement) {
124
+ if (value === undefined || value === undefined) {
125
+ return undefined;
126
+ }
127
+ return {
128
+ "@context": value.context,
129
+ "@id": value.id,
130
+ "@type": value.type,
131
+ data: value.data,
132
+ registeredBy: value.registeredBy,
133
+ timestamp: value.timestamp,
134
+ };
135
+ }
136
+
137
+ //End Data ***********************
138
+
139
+ // Metadata ***********************
140
+ export interface MetadataStatement {
141
+ context: string;
142
+ id: string;
143
+ type: string;
144
+ metadata: string;
145
+ registeredBy: string;
146
+ subject: string;
147
+ timestamp: string;
148
+ }
149
+ export function MetadataStatementFromJSON(json: any) {
150
+ if (json === undefined || json === null) {
151
+ return json;
152
+ }
153
+ return {
154
+ context: json["@context"],
155
+ id: json["@id"],
156
+ type: json["@type"],
157
+ metadata: json["metadata"],
158
+ registeredBy: json["registeredBy"],
159
+ subject: json["subject"],
160
+ timestamp: json["timestamp"],
161
+ };
162
+ }
163
+ export function MetadataStatementToJSON(value: MetadataStatement) {
164
+ if (value === undefined || value === null) {
165
+ return value;
166
+ }
167
+ return {
168
+ "@context": value.context,
169
+ "@id": value.id,
170
+ "@type": value.type,
171
+ metadata: value.metadata,
172
+ registeredBy: value.registeredBy,
173
+ subject: value.subject,
174
+ timestamp: value.timestamp,
175
+ };
176
+ }
177
+ //End Metadata ***********************
178
+
179
+ // Storage ***********************
180
+ export interface StorageStatement {
181
+ context: string;
182
+ id: string;
183
+ type: string;
184
+ data: string;
185
+ operatedBy: string;
186
+ registeredBy: string;
187
+ storedOn: string;
188
+ timestamp: string;
189
+ }
190
+
191
+ export function StorageStatementFromJSON(json: any) {
192
+ if (json === undefined || json === null) {
193
+ return json;
194
+ }
195
+ return {
196
+ context: json["@context"],
197
+ id: json["@id"],
198
+ type: json["@type"],
199
+ data: json["data"],
200
+ operatedBy: json["operatedBy"],
201
+ registeredBy: json["registeredBy"],
202
+ storedOn: json["storedOn"],
203
+ timestamp: json["timestamp"],
204
+ };
205
+ }
206
+ //End Storage ***********************
207
+
208
+ // VCStatement ***********************
209
+ export interface VcStatement {
210
+ context: string;
211
+ id: string;
212
+ type: string;
213
+ credential: VerifiableCredential;
214
+ registeredBy: string;
215
+ timestamp: string;
216
+ }
217
+
218
+ export function VcStatementFromJSON(json: any) {
219
+ if (json === undefined || json === null) {
220
+ return json;
221
+ }
222
+ return {
223
+ context: json["@context"],
224
+ id: json["@id"],
225
+ type: json["@type"],
226
+ credential: json["credential"],
227
+ registeredBy: json["registeredBy"],
228
+ timestamp: json["timestamp"],
229
+ };
230
+ }
231
+ //End VCStatement ***********************
232
+
233
+ // SigstoreStatement ***********************
234
+ export interface SigstoreStatement {
235
+ context: string;
236
+ id: string;
237
+ type: string;
238
+ subject: string;
239
+ sigstoreBundle: string;
240
+ registeredBy: string;
241
+ timestamp: string;
242
+ }
243
+
244
+ export function SigstoreStatementFromJSON(json: any) {
245
+ if (json === undefined || json === null) {
246
+ return json;
247
+ }
248
+ return {
249
+ context: json["@context"],
250
+ id: json["@id"],
251
+ type: json["@type"],
252
+ subject: json["subject"],
253
+ sigstoreBundle: json["sigstoreBundle"],
254
+ registeredBy: json["registeredBy"],
255
+ timestamp: json["timestamp"],
256
+ };
257
+ }
258
+
259
+ export function SigstoreStatementToJSON(value: SigstoreStatement) {
260
+ if (value === undefined || value === null) {
261
+ return value;
262
+ }
263
+ return {
264
+ "@context": value.context,
265
+ "@id": value.id,
266
+ "@type": value.type,
267
+ subject: value.subject,
268
+ sigstoreBundle: value.sigstoreBundle,
269
+ registeredBy: value.registeredBy,
270
+ timestamp: value.timestamp,
271
+ };
272
+ }
273
+
274
+ export interface SigstoreBundle {
275
+ dsseEnvelope: {
276
+ payload: string;
277
+ payloadType: string;
278
+ signatures: Array<{
279
+ keyid: string;
280
+ sig: string;
281
+ }>;
282
+ };
283
+ mediaType: string;
284
+ verificationMaterial: {
285
+ publicKey: {
286
+ hint: string;
287
+ };
288
+ tlogEntries: Array<any>;
289
+ };
290
+ }
291
+ //End SigstoreStatement ***********************
292
+
293
+ // Governance ***********************
294
+ export interface GovernanceStatement {
295
+ context: string;
296
+ id: string;
297
+ type: string;
298
+ document: string;
299
+ registeredBy: string;
300
+ subject: string;
301
+ timestamp: string;
302
+ }
303
+
304
+ export function GovernanceStatementFromJSON(json: any) {
305
+ if (json === undefined || json === null) {
306
+ return json;
307
+ }
308
+ return {
309
+ context: json["@context"],
310
+ id: json["@id"],
311
+ type: json["@type"],
312
+ document: json["document"],
313
+ registeredBy: json["registeredBy"],
314
+ subject: json["subject"],
315
+ timestamp: json["timestamp"],
316
+ };
317
+ }
318
+
319
+ export function GovernanceStatementToJSON(value: GovernanceStatement) {
320
+ if (value === undefined || value === null) {
321
+ return value;
322
+ }
323
+ return {
324
+ "@context": value.context,
325
+ "@id": value.id,
326
+ "@type": value.type,
327
+ document: value.document,
328
+ registeredBy: value.registeredBy,
329
+ subject: value.subject,
330
+ timestamp: value.timestamp,
331
+ };
332
+ }
333
+ //End Governance ***********************
@@ -0,0 +1,85 @@
1
+ import { Statement, VcStatement } from "./StatementTypes";
2
+
3
+ export type TeeEnvType = "AMD SEV" | "Intel TDX" | "Azure" | "EQTY Docker" | null;
4
+
5
+ export interface Actor {
6
+ did: string;
7
+ actorName: string | null;
8
+ teeEnv: TeeEnvType;
9
+ usesNvidia: boolean;
10
+ vcompStatements: Map<VCompType, Statement[]>;
11
+ vcompEvidence: Map<VCompEvidence, VcStatement[]>;
12
+ metadata: object | null;
13
+ }
14
+
15
+ export function createEmptyActor(did: string): Actor {
16
+ return {
17
+ did: did,
18
+ actorName: null,
19
+ teeEnv: null,
20
+ usesNvidia: false,
21
+ vcompStatements: new Map(),
22
+ vcompEvidence: new Map(),
23
+ metadata: {},
24
+ };
25
+ }
26
+
27
+ export type VerifiableCredential = {
28
+ "@context": string[];
29
+ id: string;
30
+ type: string[];
31
+ credentialSubject: {
32
+ id: string;
33
+ };
34
+ issuer: string;
35
+ issuanceDate: string;
36
+ validFrom: string;
37
+ proof: {
38
+ type: string;
39
+ proofPurpose: string;
40
+ verificationMethod: string;
41
+ created: string;
42
+ jws: string;
43
+ };
44
+ };
45
+
46
+ export function vcFromString(vc: object): VerifiableCredential | null {
47
+ const maybeVc = vc as Partial<VerifiableCredential>;
48
+ if (
49
+ !maybeVc ||
50
+ !Array.isArray(maybeVc["@context"]) ||
51
+ !Array.isArray(maybeVc.type) ||
52
+ typeof maybeVc.credentialSubject?.id !== "string"
53
+ ) {
54
+ return null;
55
+ }
56
+
57
+ return maybeVc as VerifiableCredential;
58
+ }
59
+
60
+ export const VCompTypeList = [
61
+ "EqtyVCompAmdSevV1",
62
+ "EqtyVCompIntelTdxV0",
63
+ "EqtyVCompAzureV1",
64
+ "EqtyVCompDockerV1",
65
+ ] as const;
66
+
67
+ export type VCompType = (typeof VCompTypeList)[number];
68
+
69
+ export function isVCompType(value: string): value is VCompType {
70
+ return VCompTypeList.includes(value as VCompType);
71
+ }
72
+
73
+ export const VCompEvidenceList = [
74
+ "EqtyVCompAmdSevV1Evidence",
75
+ "EqtyVCompIntelTdxV0Evidence",
76
+ "EqtyVCompAzureV1Evidence",
77
+ "EqtyVCompDockerV1Evidence",
78
+ "EqtyVCompNvidiaCcV0Evidence",
79
+ ] as const;
80
+
81
+ export type VCompEvidence = (typeof VCompEvidenceList)[number];
82
+
83
+ export function isVCompEvidence(value: string): value is VCompEvidence {
84
+ return VCompEvidenceList.includes(value as VCompEvidence);
85
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./AnchorTypes";
2
+ export * from "./StatementTypes";
3
+ export * from "./VCTypes";
@@ -0,0 +1,163 @@
1
+ import { NodeConfig, defaultNodeSize } from "../components/nodes/types";
2
+
3
+ export type ExplorerConfig = {
4
+ nodes: Map<string, NodeConfig>;
5
+ fallbackConfig: NodeConfig;
6
+ };
7
+
8
+ // Example:
9
+ // {
10
+ // displayType: "Model", // Label displayed in the Node
11
+ // shape: "square", // Shape of the Node (options: see ../components/nodes/types ["square" | "round"])
12
+ // icon: "ModelIcon", // Icon to display in the node. Must exist in ./public/icons folder!
13
+ // component: "CustomNode", // React component to use to render the Node. (options: see ../components/nodes/types ["CustomNode" | "ComputationNode"])
14
+ // },
15
+ //
16
+
17
+ const fallbackNodeConfig: NodeConfig = {
18
+ displayType: "Unknown",
19
+ shape: "square",
20
+ icon: "UnknownIcon",
21
+ component: "CustomNode",
22
+ size: defaultNodeSize,
23
+ };
24
+
25
+ export const nodeConfigMap: Map<string, NodeConfig> = new Map([
26
+ [
27
+ "Model",
28
+ {
29
+ ...fallbackNodeConfig,
30
+ displayType: "Model",
31
+ icon: "ModelIcon",
32
+ },
33
+ ],
34
+ [
35
+ "Agent",
36
+ {
37
+ ...fallbackNodeConfig,
38
+ displayType: "Agent",
39
+ icon: "ModelIcon",
40
+ },
41
+ ],
42
+ [
43
+ "Attribution",
44
+ {
45
+ ...fallbackNodeConfig,
46
+ displayType: "Attribution",
47
+ icon: "AttributionIcon",
48
+ },
49
+ ],
50
+ [
51
+ "Benchmark",
52
+ {
53
+ ...fallbackNodeConfig,
54
+ displayType: "Benchmark",
55
+ icon: "BenchmarkIcon",
56
+ },
57
+ ],
58
+ [
59
+ "Benchmark_result",
60
+ {
61
+ ...fallbackNodeConfig,
62
+ displayType: "Benchmark Result",
63
+ icon: "BenchmarkResultIcon",
64
+ },
65
+ ],
66
+ [
67
+ "Certificate",
68
+ {
69
+ ...fallbackNodeConfig,
70
+ displayType: "Certificate",
71
+ icon: "CertificateIcon",
72
+ },
73
+ ],
74
+ [
75
+ "Code",
76
+ {
77
+ ...fallbackNodeConfig,
78
+ displayType: "Code",
79
+ icon: "CodeIcon",
80
+ },
81
+ ],
82
+ [
83
+ "Data",
84
+ {
85
+ ...fallbackNodeConfig,
86
+ displayType: "Data",
87
+ icon: "DataIcon",
88
+ },
89
+ ],
90
+ [
91
+ "Database",
92
+ {
93
+ ...fallbackNodeConfig,
94
+ displayType: "Database",
95
+ icon: "DatabaseIcon",
96
+ },
97
+ ],
98
+ [
99
+ "Dataset",
100
+ {
101
+ ...fallbackNodeConfig,
102
+ displayType: "Dataset",
103
+ icon: "DatasetIcon",
104
+ },
105
+ ],
106
+ [
107
+ "Document",
108
+ {
109
+ ...fallbackNodeConfig,
110
+ displayType: "Document",
111
+ icon: "DocumentIcon",
112
+ },
113
+ ],
114
+ [
115
+ "Internet",
116
+ {
117
+ ...fallbackNodeConfig,
118
+ displayType: "Internet",
119
+ icon: "DocumentIcon",
120
+ },
121
+ ],
122
+ [
123
+ "Media",
124
+ {
125
+ ...fallbackNodeConfig,
126
+ displayType: "Media File",
127
+ icon: "MediaIcon",
128
+ },
129
+ ],
130
+ [
131
+ "Token",
132
+ {
133
+ ...fallbackNodeConfig,
134
+ displayType: "Token",
135
+ icon: "TokenIcon",
136
+ },
137
+ ],
138
+ [
139
+ "Computation",
140
+ {
141
+ ...fallbackNodeConfig,
142
+ displayType: "Computation",
143
+ icon: "ComputationIcon",
144
+ component: "ComputationNode",
145
+ size: { width: 56, height: 56 },
146
+ },
147
+ ],
148
+ ]);
149
+
150
+ /// Merges the nodeOverrides with the defaults. nodeOverrides take precedence over the defaults
151
+ export function buildNodeConfig(nodeOverrides?: { [key: string]: Partial<NodeConfig> }): ExplorerConfig {
152
+ const mergedNodes = new Map<string, NodeConfig>();
153
+
154
+ for (const [key, defaultNode] of nodeConfigMap.entries()) {
155
+ const override = nodeOverrides?.[key];
156
+ mergedNodes.set(key, {
157
+ ...defaultNode,
158
+ ...override,
159
+ });
160
+ }
161
+
162
+ return { nodes: mergedNodes, fallbackConfig: fallbackNodeConfig };
163
+ }
@@ -0,0 +1,5 @@
1
+ import { formatInTimeZone } from "date-fns-tz";
2
+
3
+ export const formatTimestamp = (timestamp: string) => {
4
+ return formatInTimeZone(timestamp, "UTC", "d MMMM yyyy 'at' HH:mm a");
5
+ };