Skip to content

Commit

Permalink
EN-326 Add Custom Apps support via Management Api
Browse files Browse the repository at this point in the history
  • Loading branch information
František Záhora authored and František Záhora committed Nov 20, 2024
1 parent 4685d24 commit abfa113
Show file tree
Hide file tree
Showing 21 changed files with 810 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Kontent.Ai.Management.Tests/Data/CustomApp/CustomApp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "907623af-edeb-4096-8bb1-b24e1c476888",
"name": "Custom App",
"codename": "custom-app",
"source_url": "https://customapplication.net",
"config": "{ \"enabled\": \"True\" }",
"allowed_roles": [
{
"id": "051e7717-0b51-4bfa-a180-542718ae6829"
},
{
"id": "3c6cec4f-6f01-4eed-b5f4-7b2e7c8367e8"
}
]
}
53 changes: 53 additions & 0 deletions Kontent.Ai.Management.Tests/Data/CustomApp/CustomAppsPage1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"custom_apps": [
{
"id": "907623af-edeb-4096-8bb1-b24e1c476888",
"name": "Custom App",
"codename": "custom-app",
"source_url": "https://customapplication.net",
"config": "{ \"enabled\": \"True\" }",
"allowed_roles": [
{
"id": "051e7717-0b51-4bfa-a180-542718ae6829"
},
{
"id": "3c6cec4f-6f01-4eed-b5f4-7b2e7c8367e8"
}
]
},
{
"id": "3c52d8e9-b21a-4fd2-98c5-dc76b238617a",
"name": "Advanced App",
"codename": "advanced-app",
"source_url": "https://advancedapplication.com",
"config": "{ \"enabled\": \"True\", \"version\": \"1.2\" }",
"allowed_roles": [
{
"id": "17f8d60e-c437-4fcd-b4f3-f99508ff5de3"
},
{
"id": "5d3a36c0-b3e6-470d-9a1f-8714303a2850"
}
]
},
{
"id": "f7a8c6c2-b914-44f7-bb74-9b5d6d4b7b9f",
"name": "Pro App",
"codename": "pro-app",
"source_url": "https://proapplication.org",
"config": "{ \"enabled\": \"True\", \"max_users\": \"50\" }",
"allowed_roles": [
{
"id": "29b9b01e-95d9-4ca5-a0d1-d764ee65d019"
},
{
"id": "9b9f4b7c-1b5d-4007-a8b3-d0cba7e88f98"
}
]
}
],
"pagination": {
"continuation_token": "+RID:~...",
"next_page": "https://manage.kontent.ai/v2/projects/<project_id>/<resource>?continuationToken=%2bRID%3a~..."
}
}
53 changes: 53 additions & 0 deletions Kontent.Ai.Management.Tests/Data/CustomApp/CustomAppsPage2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"custom_apps": [
{
"id": "d392aec1-9f74-44a0-97a4-d0f19db20a8b",
"name": "Beta App",
"codename": "beta-app",
"source_url": "https://betaapplication.io",
"config": "{ \"enabled\": \"False\", \"feature_flag\": \"beta_test\" }",
"allowed_roles": [
{
"id": "3e3c6d7b-fb6f-42ab-bf50-e2f84c88b093"
},
{
"id": "2347aabb-7403-4f1a-8a92-8a0e9e426ff9"
}
]
},
{
"id": "eb5429c5-d9e3-4628-8e59-7285863c6330",
"name": "Custom App 2.0",
"codename": "custom-app-v2",
"source_url": "https://customapp2.0.com",
"config": "{ \"enabled\": \"True\", \"update_check\": \"True\" }",
"allowed_roles": [
{
"id": "5d6c0f93-e6d3-488b-b73a-f0b52d56f927"
},
{
"id": "f870be79-3b45-4f67-ae2a-2db7ca55dbe4"
}
]
},
{
"id": "d8756d4b-fd4f-462d-b18b-df7b2e7f8a99",
"name": "Mobile App",
"codename": "mobile-app",
"source_url": "https://mobileapplication.mobi",
"config": "{ \"enabled\": \"True\", \"platform\": \"mobile\" }",
"allowed_roles": [
{
"id": "0f601fa5-4538-4f87-b973-c876db9a1498"
},
{
"id": "affd2f57-0a5a-4c89-8c93-78bb24a1b29f"
}
]
}
],
"pagination": {
"continuation_token": "+RID:~...",
"next_page": "https://manage.kontent.ai/v2/projects/<project_id>/<resource>?continuationToken=%2bRID%3a~..."
}
}
53 changes: 53 additions & 0 deletions Kontent.Ai.Management.Tests/Data/CustomApp/CustomAppsPage3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"custom_apps": [
{
"id": "bbad8934-f918-4de3-9297-b0f689df5015",
"name": "Enterprise App",
"codename": "enterprise-app",
"source_url": "https://enterpriseapplication.com",
"config": "{ \"enabled\": \"True\", \"enterprise_mode\": \"enabled\" }",
"allowed_roles": [
{
"id": "4a1a0de2-b3d4-4f5d-82fd-f175a5b5e7f7"
},
{
"id": "76d2e5a8-b2db-468d-b4c2-b5e6c229d453"
}
]
},
{
"id": "4a33f45c-1b13-4010-84cf-cc204cdbb768",
"name": "Test App",
"codename": "test-app",
"source_url": "https://testapplication.test",
"config": "{ \"enabled\": \"False\", \"test_mode\": \"active\" }",
"allowed_roles": [
{
"id": "87a56a6b-09a7-4c9d-86c4-d5332b04596f"
},
{
"id": "0638d1d9-7682-4840-a6b5-2831498fdaaf"
}
]
},
{
"id": "e1dcee56-5ed3-4f9a-957f-04522832b351",
"name": "Demo App",
"codename": "demo-app",
"source_url": "https://demoapplication.demo",
"config": "{ \"enabled\": \"True\", \"demo_mode\": \"active\" }",
"allowed_roles": [
{
"id": "3b8f9fbe-bd16-4789-b591-5370591844d7"
},
{
"id": "2f3991f1-5cfc-45b5-a1e5-8f94e8b92c6a"
}
]
}
],
"pagination": {
"continuation_token": null,
"next_page": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "907623af-edeb-4096-8bb1-b24e1c476888",
"name": "New Custom App Name",
"codename": "new_custom_app_codename",
"source_url": "https://customapplication.net",
"config": "{ \"enabled\": \"True\" }",
"allowed_roles": [
{
"id": "051e7717-0b51-4bfa-a180-542718ae6829"
},
{
"id": "f8f0b5cb-f5b7-42e8-af85-fbdab3ddfacf"
},
{
"id": "2c009e0b-bd05-4119-a189-58ed52b6818a"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "907623af-edeb-4096-8bb1-b24e1c476888",
"name": "New Custom App Name",
"codename": "new_custom_app_codename",
"source_url": "https://customapplication.net",
"config": "{ \"enabled\": \"True\" }",
"allowed_roles": [
{
"id": "f8f0b5cb-f5b7-42e8-af85-fbdab3ddfacf"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "907623af-edeb-4096-8bb1-b24e1c476888",
"name": "New Custom App Name",
"codename": "new_custom_app_codename",
"source_url": "https://customapplication.net",
"config": "{ \"enabled\": \"True\" }",
"allowed_roles": [
{
"id": "051e7717-0b51-4bfa-a180-542718ae6829"
},
{
"id": "f8f0b5cb-f5b7-42e8-af85-fbdab3ddfacf"
}
]
}
12 changes: 12 additions & 0 deletions Kontent.Ai.Management.Tests/Kontent.Ai.Management.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
<None Update="Data\WebSpotlight\GetStatusWebSpotlightResponse.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\CustomApp\CustomAppsPage2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\CustomApp\CustomAppsPage3.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\CustomApp\ModifyCustomApp_Remove_ModifiesCustomApp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Data\CustomApp\ModifyCustomApp_AddInto_ModifiesCustomApp.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit abfa113

Please sign in to comment.