Skip to content

Commit 7767d77

Browse files
authored
Merge pull request #266 from umbraco/v16/zapier
V16/zapier
2 parents 3258614 + f760c1b commit 7767d77

28 files changed

+2342
-2399
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Mvc.ApiExplorer;
3+
using Microsoft.AspNetCore.Mvc.Controllers;
4+
using Microsoft.Extensions.Options;
5+
using Umbraco.Cms.Api.Common.OpenApi;
6+
7+
namespace Umbraco.Cms.Integrations.Automation.Zapier.Api.Configuration
8+
{
9+
internal class ZapierOperationIdHandler : OperationIdHandler
10+
{
11+
public ZapierOperationIdHandler(IOptions<ApiVersioningOptions> apiVersioningOptions) : base(apiVersioningOptions)
12+
{
13+
}
14+
15+
protected override bool CanHandle(ApiDescription apiDescription, ControllerActionDescriptor controllerActionDescriptor)
16+
=> controllerActionDescriptor.ControllerTypeInfo.Namespace?.StartsWith("Umbraco.Cms.Integrations.Automation.") is true;
17+
}
18+
}

src/Umbraco.Cms.Integrations.Automation.Zapier/Api/Management/Controllers/GetContentByTypeController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ public GetContentByTypeController(
3939
_umbracoHelper = umbracoHelper;
4040
}
4141

42-
[HttpGet("content-type/{alias}/content")]
42+
[HttpGet("content-type/{alias}/content", Name = Constants.OperationIdentifiers.GetContentByType)]
4343
[ProducesResponseType(typeof(List<Dictionary<string, string>>), StatusCodes.Status200OK)]
44-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
4544
public IActionResult GetContentByContentType(string alias)
4645
{
4746
if (!IsAccessValid())

src/Umbraco.Cms.Integrations.Automation.Zapier/Api/Management/Controllers/GetContentTypesController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public GetContentTypesController(IOptions<ZapierSettings> options, IContentTypeS
2525

2626
[HttpGet("content-types")]
2727
[ProducesResponseType(typeof(IEnumerable<ContentTypeDto>), StatusCodes.Status200OK)]
28-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
2928
public IActionResult GetContentTypes()
3029
{
3130
if (!IsAccessValid())

src/Umbraco.Cms.Integrations.Automation.Zapier/Api/Management/Controllers/GetSubscriptionHookController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public GetSubscriptionHookController(
2020
ZapierSubscriptionHookService zapierSubscriptionHookService)
2121
: base(options, userValidationService) => _zapierSubscriptionHookService = zapierSubscriptionHookService;
2222

23-
[HttpGet("subscription-hooks")]
23+
[HttpGet("subscription-hooks", Name = Constants.OperationIdentifiers.GetSubscriptionHooks)]
2424
[ProducesResponseType(typeof(IEnumerable<SubscriptionDto>), StatusCodes.Status200OK)]
2525
public IActionResult GetAll() => Ok(_zapierSubscriptionHookService.GetAll());
2626
}

src/Umbraco.Cms.Integrations.Automation.Zapier/Api/Management/Controllers/UpdateSubscriptionHookController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public UpdateSubscriptionHookController(IOptions<ZapierSettings> options,
2525
_zapierSubscriptionHookService = zapierSubscriptionHookService;
2626
}
2727

28-
[HttpPost("subscription")]
29-
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
28+
[HttpPost("subscription", Name = Constants.OperationIdentifiers.UpdateSubscription)]
3029
[ProducesResponseType(StatusCodes.Status400BadRequest)]
3130
[ProducesResponseType(typeof(bool), StatusCodes.Status200OK)]
3231
public IActionResult UpdatePreferences([FromBody] SubscriptionDto dto)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
3+
import type { ClientOptions } from './types.gen';
4+
import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';
5+
6+
/**
7+
* The `createClientConfig()` function will be called on client initialization
8+
* and the returned object will become the client's initial configuration.
9+
*
10+
* You may want to initialize your client this way instead of calling
11+
* `setConfig()`. This is useful for example if you're using Next.js
12+
* to ensure your client always has the correct values.
13+
*/
14+
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
15+
16+
export const client = createClient(createConfig<ClientOptions>({
17+
baseUrl: 'http://localhost:30450',
18+
throwOnError: true
19+
}));

src/Umbraco.Cms.Integrations.Automation.Zapier/Client/generated/core/ApiError.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/Umbraco.Cms.Integrations.Automation.Zapier/Client/generated/core/ApiRequestOptions.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Umbraco.Cms.Integrations.Automation.Zapier/Client/generated/core/ApiResult.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/Umbraco.Cms.Integrations.Automation.Zapier/Client/generated/core/CancelablePromise.ts

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)