diff --git a/README.md b/README.md index 6c61bda..cdcb024 100644 --- a/README.md +++ b/README.md @@ -1067,6 +1067,12 @@ starts the OAuth sign-in of an MCP connection: open `AuthorizeUrl` in a browser attempt). A signed-in connection shows `SignedIn`, `SignedInBy`, `SignedInAt` and `TokenExpiresAt`; a listing shows `ConnectSteps` and `OAuthRedirectUrl`. +`Code.SignOutMarketplaceIntegrationAsync` +(`POST /{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out`) +signs an MCP connection out: `WasSignedIn` says whether it was, `Revoke` what +happened to the vendor token (`Revoked`, `NoRevocationEndpoint`, `Failed` or +null). + `TestMarketplaceIntegrationAsync` also returns `AccessChanges` (`ReadOnlyAdded`, `ReadOnlyRemoved`, `NotGrantable`) and each step's `ErrorCode`. diff --git a/src/Norbix.Sdk.Types/Generated/Hub.dtos.cs b/src/Norbix.Sdk.Types/Generated/Hub.dtos.cs index 843286c..fee4e77 100644 --- a/src/Norbix.Sdk.Types/Generated/Hub.dtos.cs +++ b/src/Norbix.Sdk.Types/Generated/Hub.dtos.cs @@ -1352,11 +1352,14 @@ public partial class IssueServiceUserApiKeyResponse public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual string Key { get; set; } + public virtual string? Environment { get; set; } + public virtual CodeMashResponseStatus? ResponseStatus { get; set; } } public partial class ListServiceUserApiKeysResponse { public virtual List Keys { get; set; } = []; + public virtual CodeMashResponseStatus? ResponseStatus { get; set; } } public partial class NotificationSettingsChannelDto @@ -1786,6 +1789,7 @@ public partial class ServiceUserApiKeyDto public virtual string Name { get; set; } public virtual string? VisibleKey { get; set; } public virtual List Scopes { get; set; } = []; + public virtual string? Environment { get; set; } public virtual DateTime CreatedDate { get; set; } public virtual DateTime? ExpiryDate { get; set; } public virtual DateTime? CancelledDate { get; set; } @@ -2933,6 +2937,16 @@ public partial interface IHasResponsibleUserId string UserId { get; set; } } + [DataContract] + public partial class NotificationReadMarkDto + { + [DataMember] + public virtual string UserId { get; set; } + + [DataMember] + public virtual DateTime ReadAtUtc { get; set; } + } + public partial class NotificationStatusChangeEntryDto { public virtual DateTime Time { get; set; } @@ -2978,6 +2992,9 @@ public partial class PushCampaignBatchNotificationDto [DataMember] public virtual PushMessageContentDto? Content { get; set; } + + [DataMember] + public virtual List? ReadBy { get; set; } } [DataContract] @@ -3693,6 +3710,12 @@ public partial class MarketplaceAccessChangesDto [DataMember] public virtual IReadOnlyList NotGrantable { get; set; } + + [DataMember] + public virtual IReadOnlyList ReadOnlyHintOverridden { get; set; } + + [DataMember] + public virtual IReadOnlyList ExcludedFromFullAccess { get; set; } } [DataContract] @@ -3779,6 +3802,9 @@ public partial class MarketplaceAccessRoleDto [DataMember] public virtual string? DefaultNotApplied { get; set; } + + [DataMember] + public virtual bool CanChange { get; set; } } [DataContract] @@ -3792,6 +3818,12 @@ public partial class MarketplaceAccessToolDto [DataMember] public virtual bool Grantable { get; set; } + + [DataMember] + public virtual bool Curated { get; set; } + + [DataMember] + public virtual bool ExcludedFromFullAccess { get; set; } } public enum MarketplaceAvailability @@ -4039,6 +4071,12 @@ public partial class MarketplaceFunctionRunDto [DataMember] public virtual string? Input { get; set; } + + [DataMember] + public virtual string? IntegrationId { get; set; } + + [DataMember] + public virtual string? ToolName { get; set; } } [DataContract] @@ -6724,6 +6762,24 @@ public partial class PushDeviceListProjection [DataMember] public virtual int? PlatformApiLevel { get; set; } + + [DataMember] + public virtual string? Platform { get; set; } + + [DataMember] + public virtual string? AppVersion { get; set; } + + [DataMember] + public virtual string? InstallationId { get; set; } + + [DataMember] + public virtual string? Locale { get; set; } + + [DataMember] + public virtual string? TimeZone { get; set; } + + [DataMember] + public virtual DateTime? UpdatedAtUtc { get; set; } } public partial class PushIntegrationDto @@ -11615,6 +11671,11 @@ public partial class GetMarketplaceFunctionRuns /// public virtual string? TaskId { get; set; } + /// + ///The MCP connection whose tool runs to list — the calls an AI chat made to one of its tools without a saved function (int_…). One of functionId / triggerId / taskId / integrationId. + /// + public virtual string? IntegrationId { get; set; } + /// ///How many runs, newest first: 1-50. Default 20. /// @@ -11769,6 +11830,9 @@ public partial class GetMarketplaceIntegrationAccessResponse [DataMember] public virtual IReadOnlyList Functions { get; set; } + + [DataMember] + public virtual bool CanManage { get; set; } } public partial class GetMarketplaceIntegrationResponse @@ -11968,6 +12032,23 @@ public partial class SetMarketplaceIntegrationTokenMappingsResponse { } + [NorbixRoute("/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out", "POST")] + public partial class SignOutMarketplaceIntegration + : CodeMashRequestBase, INorbixRequest + { + /// + ///Integration view id, from get_marketplace_integrations. + /// + public virtual string IntegrationViewId { get; set; } + } + + public partial class SignOutMarketplaceIntegrationResponse + : ResponseBase + { + public virtual bool WasSignedIn { get; set; } + public virtual string? Revoke { get; set; } + } + [NorbixRoute("/{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/start", "POST")] public partial class StartMarketplaceIntegrationSignIn : CodeMashRequestBase, INorbixRequest @@ -13179,6 +13260,8 @@ public partial class FindOneRecord ///Set true to get every reference value as { id, display } (display = the target's displayField per the schema; null when the target is gone). Needs read permission on every source the schema links to (users, roles, taxonomy, collection, files) — otherwise the read is refused with CM-ERRORS-DATABASE-056 naming the source. Default false returns the stored ids. /// public virtual bool ExpandReferences { get; set; } + + public virtual bool AllLanguages { get; set; } } public partial class FindOneRecordResponse @@ -13218,6 +13301,8 @@ public partial class FindRecords ///Set true to get every reference value as { id, display } (display = the target's displayField per the schema; null when the target is gone). Needs read permission on every source the schema links to (users, roles, taxonomy, collection, files) — otherwise the read is refused with CM-ERRORS-DATABASE-056 naming the source. Default false returns the stored ids. /// public virtual bool ExpandReferences { get; set; } + + public virtual bool AllLanguages { get; set; } } public partial class FindRecordsResponse diff --git a/tests/Norbix.Hub.Tests/MarketplaceSignOutTests.cs b/tests/Norbix.Hub.Tests/MarketplaceSignOutTests.cs new file mode 100644 index 0000000..d538868 --- /dev/null +++ b/tests/Norbix.Hub.Tests/MarketplaceSignOutTests.cs @@ -0,0 +1,36 @@ +using Norbix.Sdk.Tests.Helpers; +using Norbix.Sdk.Types.Hub; + +using NUnit.Framework; + +using VerifyNUnit; + +namespace Norbix.Hub.Tests; + +/// +/// Route 30 of the marketplace contract (gateway item access-2b): sign an MCP +/// connection out of OAuth. This case pins a real connection id in the path and +/// reads WasSignedIn / Revoke back from the generated response. Nothing leaves +/// the process. +/// +[TestFixture] +public sealed class MarketplaceSignOutTests +{ + [Test] + public async Task Sign_out_puts_the_connection_id_in_the_path_and_returns_the_revoke_outcome() + { + using var fixture = NorbixTestFixture.Create(o => + { + o.AccountId = "test-account"; + o.BearerToken = "test-bearer"; + }); + fixture.RespondNext(new { wasSignedIn = true, revoke = "Revoked" }); + + var response = await fixture.Client.Code.SignOutMarketplaceIntegrationAsync( + new SignOutMarketplaceIntegration { IntegrationViewId = "int_6Qp1dW2kRm8NsT4vYc0Hb" }); + + await Verifier.Verify( + new { Sent = fixture.LastRequest, response!.WasSignedIn, response.Revoke }, + VerifyConfig.VerifySettings); + } +} diff --git a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Code.verified.txt b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Code.verified.txt index 878296c..fd69b7e 100644 --- a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Code.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Code.verified.txt @@ -1,7 +1,7 @@ { Target: Hub, Group: code, - Count: 43, + Count: 44, Endpoints: [ { Target: Hub, @@ -700,7 +700,7 @@ Sent: { Method: GET, Path: /v2/code/marketplace/functions/runs, - Query: ?functionId={guid}&triggerId={guid}&taskId={guid}&limit=1&env=test-env, + Query: ?functionId={guid}&triggerId={guid}&taskId={guid}&integrationId={guid}&limit=1&env=test-env, Headers: { Authorization: Bearer test-bearer, norbix-account-id: test-account, @@ -1052,7 +1052,8 @@ IsSystem: false, Fixed: false, IsCustom: false, - Manage: false + Manage: false, + CanChange: false } ], Packages: [ @@ -1063,12 +1064,15 @@ Tools: [ { ReadOnly: false, - Grantable: false + Grantable: false, + Curated: false, + ExcludedFromFullAccess: false } ], Functions: [ {} ], + CanManage: true, ResponseStatus: { IsSuccess: true } @@ -1385,6 +1389,40 @@ } } }, + { + Target: Hub, + Group: code, + MethodName: SignOutMarketplaceIntegrationAsync, + RequestType: SignOutMarketplaceIntegration, + HttpMethod: POST, + Path: /{version}/code/marketplace/integrations/{IntegrationViewId}/oauth/sign-out, + PathParams: [ + IntegrationViewId + ], + IsAccountScoped: false, + IsUnauthenticated: false, + Sent: { + Method: POST, + Path: /v2/code/marketplace/integrations/{guid}/oauth/sign-out, + Headers: { + Authorization: Bearer test-bearer, + Content-Type: application/json; charset=utf-8, + norbix-account-id: test-account, + norbix-project-id: test-project + }, + Body: { + env: test-env + } + }, + ResponseType: SignOutMarketplaceIntegrationResponse, + Response: { + WasSignedIn: true, + Revoke: test-revoke, + ResponseStatus: { + IsSuccess: true + } + } + }, { Target: Hub, Group: code, @@ -1466,6 +1504,12 @@ ], NotGrantable: [ test-string + ], + ReadOnlyHintOverridden: [ + test-string + ], + ExcludedFromFullAccess: [ + test-string ] }, ResponseStatus: { diff --git a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Database.verified.txt b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Database.verified.txt index ae82f77..c38e2b5 100644 --- a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Database.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Database.verified.txt @@ -1067,7 +1067,7 @@ Sent: { Method: GET, Path: /v2/database/collections/test-collectionName/{guid}, - Query: ?databaseIntegrationId={guid}&expandReferences=True&env=test-env, + Query: ?databaseIntegrationId={guid}&expandReferences=True&allLanguages=True&env=test-env, Headers: { Authorization: Bearer test-bearer, norbix-account-id: test-account, @@ -1099,7 +1099,7 @@ Sent: { Method: GET, Path: /v2/database/collections/test-collectionName, - Query: ?databaseIntegrationId={guid}&filter=test-filter&contactId={guid}&schemaVersion=1&pagingArgs=Norbix.Sdk.Types.Hub.PagingArgs&sortBy=test-sortBy&sortOrder=1&expandReferences=True&env=test-env&startingAfter=test-startingAfter&endingBefore=test-endingBefore&pageSize=1, + Query: ?databaseIntegrationId={guid}&filter=test-filter&contactId={guid}&schemaVersion=1&pagingArgs=Norbix.Sdk.Types.Hub.PagingArgs&sortBy=test-sortBy&sortOrder=1&expandReferences=True&allLanguages=True&env=test-env&startingAfter=test-startingAfter&endingBefore=test-endingBefore&pageSize=1, Headers: { Authorization: Bearer test-bearer, norbix-account-id: test-account, diff --git a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Membership.verified.txt b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Membership.verified.txt index af69d26..ed2c679 100644 --- a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Membership.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Membership.verified.txt @@ -1524,7 +1524,11 @@ Response: { Id: 7, Name: test-name, - Key: test-key + Key: test-key, + Environment: test-environment, + ResponseStatus: { + IsSuccess: true + } } }, { @@ -1555,7 +1559,10 @@ { Active: false } - ] + ], + ResponseStatus: { + IsSuccess: true + } } } ] diff --git a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Notifications.verified.txt b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Notifications.verified.txt index bae6bc4..f7c24be 100644 --- a/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Notifications.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/EndpointCoverageTests.Hub.Notifications.verified.txt @@ -1982,11 +1982,13 @@ HasMore: false }, Content: {}, + ReadBy: [ + {} + ], CampaignId: Guid_1, BatchId: Guid_1, NotificationId: Guid_1, - RefNotificationId: Guid_1, - Body: test-body + RefNotificationId: Guid_1 }, ResponseStatus: { IsSuccess: true diff --git a/tests/Norbix.Hub.Tests/test_results/MarketplaceAccessTests.Access_matrix_puts_the_connection_id_in_the_path_with_no_body.verified.txt b/tests/Norbix.Hub.Tests/test_results/MarketplaceAccessTests.Access_matrix_puts_the_connection_id_in_the_path_with_no_body.verified.txt index ef58809..b9e2b04 100644 --- a/tests/Norbix.Hub.Tests/test_results/MarketplaceAccessTests.Access_matrix_puts_the_connection_id_in_the_path_with_no_body.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/MarketplaceAccessTests.Access_matrix_puts_the_connection_id_in_the_path_with_no_body.verified.txt @@ -17,7 +17,8 @@ Fixed: false, IsCustom: false, Manage: false, - DefaultNotApplied: The person who enabled the connection may not manage policies. + DefaultNotApplied: The person who enabled the connection may not manage policies., + CanChange: false } ], Packages: [ @@ -32,7 +33,9 @@ { Name: get_me, ReadOnly: true, - Grantable: true + Grantable: true, + Curated: false, + ExcludedFromFullAccess: false } ], Functions: [ diff --git a/tests/Norbix.Hub.Tests/test_results/MarketplaceSignOutTests.Sign_out_puts_the_connection_id_in_the_path_and_returns_the_revoke_outcome.verified.txt b/tests/Norbix.Hub.Tests/test_results/MarketplaceSignOutTests.Sign_out_puts_the_connection_id_in_the_path_and_returns_the_revoke_outcome.verified.txt new file mode 100644 index 0000000..585d13c --- /dev/null +++ b/tests/Norbix.Hub.Tests/test_results/MarketplaceSignOutTests.Sign_out_puts_the_connection_id_in_the_path_and_returns_the_revoke_outcome.verified.txt @@ -0,0 +1,13 @@ +{ + Sent: { + Method: POST, + Path: /v2/code/marketplace/integrations/int_6Qp1dW2kRm8NsT4vYc0Hb/oauth/sign-out, + Headers: { + Authorization: Bearer test-bearer, + norbix-account-id: test-account, + norbix-project-id: test-project + } + }, + WasSignedIn: true, + Revoke: Revoked +} \ No newline at end of file diff --git a/tests/Norbix.Hub.Tests/test_results/PushEndpointTests.GetPushCampaignBatchNotificationAsync.verified.txt b/tests/Norbix.Hub.Tests/test_results/PushEndpointTests.GetPushCampaignBatchNotificationAsync.verified.txt index 3bba767..794c8e2 100644 --- a/tests/Norbix.Hub.Tests/test_results/PushEndpointTests.GetPushCampaignBatchNotificationAsync.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/PushEndpointTests.GetPushCampaignBatchNotificationAsync.verified.txt @@ -30,11 +30,13 @@ HasMore: false }, Content: {}, + ReadBy: [ + {} + ], CampaignId: Guid_1, BatchId: Guid_1, NotificationId: Guid_1, - RefNotificationId: Guid_1, - Body: test-body + RefNotificationId: Guid_1 }, ResponseStatus: { IsSuccess: true diff --git a/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindOneRecordExpandReferences.verified.txt b/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindOneRecordExpandReferences.verified.txt index a92fb21..e20b547 100644 --- a/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindOneRecordExpandReferences.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindOneRecordExpandReferences.verified.txt @@ -2,7 +2,7 @@ Sent: { Method: GET, Path: /v2/database/collections/orders/ord_1, - Query: ?expandReferences=True, + Query: ?expandReferences=True&allLanguages=False, Headers: { Authorization: Bearer test-bearer, norbix-account-id: test-account, diff --git a/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindRecordsExpandReferences.verified.txt b/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindRecordsExpandReferences.verified.txt index 346a1fb..45add51 100644 --- a/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindRecordsExpandReferences.verified.txt +++ b/tests/Norbix.Hub.Tests/test_results/SchemaContentTests.FindRecordsExpandReferences.verified.txt @@ -2,7 +2,7 @@ Sent: { Method: GET, Path: /v2/database/collections/orders, - Query: ?expandReferences=True, + Query: ?expandReferences=True&allLanguages=False, Headers: { Authorization: Bearer test-bearer, norbix-account-id: test-account,