Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 042fbe1

Browse files
committed
Dynamic Entities CRUD paths and api explorer links
1 parent 8d89dc4 commit 042fbe1

2 files changed

Lines changed: 59 additions & 8 deletions

File tree

‎src/routes/(protected)/dynamic-entities/system/[id]/+page.svelte‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,35 @@
4343
role: `CanCreateDynamicEntity_System${entityName}`,
4444
description: `Create new ${entityName} records`,
4545
endpoint: `POST /obp/dynamic-entity/${entityName}`,
46+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_create${entityName}_`,
4647
},
4748
{
48-
operation: "Read",
49+
operation: "Read (list)",
4950
role: `CanGetDynamicEntity_System${entityName}`,
50-
description: `View ${entityName} records`,
51+
description: `List all ${entityName} records`,
5152
endpoint: `GET /obp/dynamic-entity/${entityName}`,
53+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_get${entityName}List_`,
54+
},
55+
{
56+
operation: "Read (single)",
57+
role: `CanGetDynamicEntity_System${entityName}`,
58+
description: `View a single ${entityName} record by ID`,
59+
endpoint: `GET /obp/dynamic-entity/${entityName}/{RECORD_ID}`,
60+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_getSingle${entityName}_`,
5261
},
5362
{
5463
operation: "Update",
5564
role: `CanUpdateDynamicEntity_System${entityName}`,
5665
description: `Update existing ${entityName} records`,
5766
endpoint: `PUT /obp/dynamic-entity/${entityName}/{RECORD_ID}`,
67+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_update${entityName}_`,
5868
},
5969
{
6070
operation: "Delete",
6171
role: `CanDeleteDynamicEntity_System${entityName}`,
6272
description: `Delete ${entityName} records`,
6373
endpoint: `DELETE /obp/dynamic-entity/${entityName}/{RECORD_ID}`,
74+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_delete${entityName}_`,
6475
},
6576
];
6677
});
@@ -519,8 +530,20 @@
519530
<p class="mt-1 font-mono text-xs text-gray-500 dark:text-gray-500">
520531
{roleReq.role}
521532
</p>
522-
<p class="mt-1 font-mono text-xs text-blue-600 dark:text-blue-400">
523-
{roleReq.endpoint}
533+
<p class="mt-1 flex items-center gap-2 font-mono text-xs text-blue-600 dark:text-blue-400">
534+
<span>{roleReq.endpoint}</span>
535+
<a
536+
href={roleReq.explorerUrl}
537+
target="_blank"
538+
rel="noopener noreferrer"
539+
class="inline-flex items-center gap-1 rounded bg-purple-100 px-1.5 py-0.5 text-xs font-medium text-purple-700 no-underline hover:bg-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:hover:bg-purple-900/50"
540+
title="Open in API Explorer"
541+
>
542+
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
543+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
544+
</svg>
545+
API Explorer
546+
</a>
524547
</p>
525548
</div>
526549
{#if !userHasRole(roleReq.role)}

‎src/routes/(protected)/dynamic-entities/system/[id]/crud/+page.svelte‎

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import { goto } from "$app/navigation";
3+
import { page } from "$app/stores";
34
import type { PageData } from "./$types";
45
import { trackedFetch } from "$lib/utils/trackedFetch";
56
import {
@@ -13,6 +14,10 @@
1314
let entity = $derived(data.entity);
1415
let userEntitlements = $derived(data.userEntitlements || []);
1516
17+
const apiExplorerUrl =
18+
$page.data.externalLinks?.API_EXPLORER_URL ||
19+
"https://apiexplorer-ii-sandbox.openbankproject.com";
20+
1621
// Helper function to get the entity name (in v6.0.0, this is in the entity_name field)
1722
function getEntityName(entity: any): string {
1823
return entity.entity_name || "Unknown";
@@ -49,24 +54,35 @@
4954
role: `CanCreateDynamicEntity_System${entityName}`,
5055
description: `Create new ${entityName} records`,
5156
endpoint: `POST /obp/dynamic-entity/${entityName}`,
57+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_create${entityName}_`,
5258
},
5359
{
54-
operation: "Read",
60+
operation: "Read (list)",
5561
role: `CanGetDynamicEntity_System${entityName}`,
56-
description: `View ${entityName} records`,
62+
description: `List all ${entityName} records`,
5763
endpoint: `GET /obp/dynamic-entity/${entityName}`,
64+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_get${entityName}List_`,
65+
},
66+
{
67+
operation: "Read (single)",
68+
role: `CanGetDynamicEntity_System${entityName}`,
69+
description: `View a single ${entityName} record by ID`,
70+
endpoint: `GET /obp/dynamic-entity/${entityName}/{RECORD_ID}`,
71+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_getSingle${entityName}_`,
5872
},
5973
{
6074
operation: "Update",
6175
role: `CanUpdateDynamicEntity_System${entityName}`,
6276
description: `Update existing ${entityName} records`,
6377
endpoint: `PUT /obp/dynamic-entity/${entityName}/{RECORD_ID}`,
78+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_update${entityName}_`,
6479
},
6580
{
6681
operation: "Delete",
6782
role: `CanDeleteDynamicEntity_System${entityName}`,
6883
description: `Delete ${entityName} records`,
6984
endpoint: `DELETE /obp/dynamic-entity/${entityName}/{RECORD_ID}`,
85+
explorerUrl: `${apiExplorerUrl}/resource-docs/OBPdynamic-entity?operationid=OBPv4.0.0-dynamicEntity_delete${entityName}_`,
7086
},
7187
];
7288
});
@@ -732,9 +748,21 @@
732748
{roleReq.role}
733749
</p>
734750
<p
735-
class="mt-1 font-mono text-xs text-blue-600 dark:text-blue-400"
751+
class="mt-1 flex items-center gap-2 font-mono text-xs text-blue-600 dark:text-blue-400"
736752
>
737-
{roleReq.endpoint}
753+
<span>{roleReq.endpoint}</span>
754+
<a
755+
href={roleReq.explorerUrl}
756+
target="_blank"
757+
rel="noopener noreferrer"
758+
class="inline-flex items-center gap-1 rounded bg-purple-100 px-1.5 py-0.5 text-xs font-medium text-purple-700 no-underline hover:bg-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:hover:bg-purple-900/50"
759+
title="Open in API Explorer"
760+
>
761+
<svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
762+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
763+
</svg>
764+
API Explorer
765+
</a>
738766
</p>
739767
</div>
740768
{#if !userHasRole(roleReq.role)}

0 commit comments

Comments
 (0)