Skip to content

Commit 9e81fa3

Browse files
authored
Merge pull request #294 from umbraco/feature/v17/activecampaign
Feature/v17/activecampaign
2 parents 22174b3 + c3f0563 commit 9e81fa3

33 files changed

+2185
-1096
lines changed

NuGet.config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<packageSources>
4-
<clear />
5-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6-
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
7-
</packageSources>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
7+
</packageSources>
88
</configuration>

azure-pipeline - Crm.ActiveCampaign.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
trigger:
22
branches:
33
include:
4-
- main-v16
5-
- v16/dev
4+
- main-v17
5+
- v17/dev
66
paths:
77
include:
88
- src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/**
@@ -16,24 +16,28 @@ variables:
1616
project: 'src/$(projectName)/$(projectName).csproj'
1717
buildPlatform: 'Any CPU'
1818
buildConfiguration: 'Release'
19+
productGroup: 'DXP'
20+
productVersion: 'v17'
21+
DT_API_KEY: $(dtApiKey)
22+
DT_BASE_URL: $(dtBaseUrl)
1923

2024
steps:
25+
- task: UseDotNet@2
26+
displayName: 'Use SDK version 10.0.100'
27+
inputs:
28+
packageType: 'sdk'
29+
version: '10.0.100'
30+
2131
- task: NuGetToolInstaller@1
2232
displayName: 'Install NuGet'
2333

2434
- task: DotNetCoreCLI@2
2535
displayName: 'NuGet Restore'
2636
inputs:
2737
command: 'restore'
28-
feedsToUse: 'select'
38+
feedsToUse: 'config'
2939
projects: '$(project)'
30-
includeNuGetOrg: true
31-
32-
- task: UseDotNet@2
33-
displayName: 'Use SDK version 9.0.203'
34-
inputs:
35-
packageType: 'sdk'
36-
version: '9.0.203'
40+
nugetConfigPath: 'NuGet.config'
3741

3842
- task: VSBuild@1
3943
displayName: 'Build Project'
@@ -57,3 +61,26 @@ steps:
5761
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
5862
ArtifactName: 'drop'
5963
publishLocation: 'Container'
64+
65+
# Generate/upload SBOM with cdxgen
66+
- script: |
67+
cd $(Build.SourcesDirectory)
68+
npm install --global @cyclonedx/cdxgen
69+
displayName: 'Install cdxgen'
70+
71+
- script: |
72+
mkdir -p $(Build.ArtifactStagingDirectory)/bom
73+
cd $(Build.SourcesDirectory)
74+
75+
cdxgen --recurse --output $(Build.ArtifactStagingDirectory)\bom\bom.json --json-pretty --project-group "$(productGroup)" --project-name "$(projectName)" --project-version "$(productVersion)" --server-url "$(DT_BASE_URL)" --api-key "$(DT_API_KEY)" --deep
76+
displayName: 'Generate & Upload SBOM with cdxgen'
77+
env:
78+
DT_API_KEY: $(DT_API_KEY)
79+
DT_BASE_URL: $(DT_BASE_URL)
80+
81+
# Publish SBOM artifact
82+
- task: PublishPipelineArtifact@1
83+
displayName: 'Publish SBOM Artifact'
84+
inputs:
85+
targetPath: $(Build.ArtifactStagingDirectory)/bom
86+
artifactName: SBOM

examples/Umbraco.Cms.Integrations.Testsite.V17/Umbraco.Cms.Integrations.Testsite.V17.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
33
<TargetFramework>net10.0</TargetFramework>
44
<ImplicitUsings>enable</ImplicitUsings>
@@ -8,6 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Umbraco.Cms" Version="17.0.0" />
11+
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Crm.ActiveCampaign\Umbraco.Cms.Integrations.Crm.ActiveCampaign.csproj" />
1112
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Commerce.Shopify\Umbraco.Cms.Integrations.Commerce.Shopify.csproj" />
1213
</ItemGroup>
1314

@@ -21,6 +22,4 @@
2122
<!-- Razor files are needed for the backoffice to work correctly -->
2223
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
2324
</PropertyGroup>
24-
25-
2625
</Project>

src/Umbraco.Cms.Integrations.Automation.Zapier/NuGet.config

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

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/ActiveCampaignComposer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.Extensions.DependencyInjection;
2-
using Microsoft.OpenApi.Models;
2+
using Microsoft.OpenApi;
33
using Swashbuckle.AspNetCore.SwaggerGen;
44
using Umbraco.Cms.Api.Common.OpenApi;
55
using Umbraco.Cms.Core.Composing;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@umbraco-cms:registry=https://www.myget.org/F/umbracoprereleases/npm/
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3-
import type { ClientOptions } from './types.gen';
4-
import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';
3+
import { type ClientOptions, type Config, createClient, createConfig } from '@hey-api/client-fetch';
4+
5+
import type { ClientOptions as ClientOptions2 } from './types.gen';
56

67
/**
78
* The `createClientConfig()` function will be called on client initialization
@@ -11,9 +12,9 @@ import { type Config, type ClientOptions as DefaultClientOptions, createClient,
1112
* `setConfig()`. This is useful for example if you're using Next.js
1213
* to ensure your client always has the correct values.
1314
*/
14-
export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;
15+
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
1516

16-
export const client = createClient(createConfig<ClientOptions>({
17-
baseUrl: 'http://localhost:30450',
17+
export const client = createClient(createConfig<ClientOptions2>({
18+
baseUrl: 'http://localhost:28157',
1819
throwOnError: true
19-
}));
20+
}));
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// This file is auto-generated by @hey-api/openapi-ts
2-
export * from './types.gen';
2+
3+
export type * from './types.gen';
34
export * from './client.gen';
4-
export * from './sdk.gen';
5+
export * from './sdk.gen';

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Client/generated/sdk.gen.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3-
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
4-
import type { GetApiAccessData, GetApiAccessResponse, GetFormsData, GetFormsResponse, GetFormsByIdData, GetFormsByIdResponse } from './types.gen';
5-
import { client as _heyApiClient } from './client.gen';
3+
import type { Client, Options as Options2, TDataShape } from '@hey-api/client-fetch';
64

7-
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
5+
import { client } from './client.gen';
6+
import type { GetApiAccessData, GetApiAccessErrors, GetApiAccessResponses, GetFormsByIdData, GetFormsByIdErrors, GetFormsByIdResponses, GetFormsData, GetFormsErrors, GetFormsResponses } from './types.gen';
7+
8+
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
89
/**
910
* You can provide a client instance returned by `createClient()` instead of
1011
* individual options. This might be also useful if you want to implement a
@@ -18,9 +19,9 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
1819
meta?: Record<string, unknown>;
1920
};
2021

21-
export class ActiveCampaignFormsService {
22+
export class ActiveCampaignForms {
2223
public static getApiAccess<ThrowOnError extends boolean = true>(options?: Options<GetApiAccessData, ThrowOnError>) {
23-
return (options?.client ?? _heyApiClient).get<GetApiAccessResponse, unknown, ThrowOnError>({
24+
return (options?.client ?? client).get<GetApiAccessResponses, GetApiAccessErrors, ThrowOnError>({
2425
security: [
2526
{
2627
scheme: 'bearer',
@@ -33,7 +34,7 @@ export class ActiveCampaignFormsService {
3334
}
3435

3536
public static getForms<ThrowOnError extends boolean = true>(options?: Options<GetFormsData, ThrowOnError>) {
36-
return (options?.client ?? _heyApiClient).get<GetFormsResponse, unknown, ThrowOnError>({
37+
return (options?.client ?? client).get<GetFormsResponses, GetFormsErrors, ThrowOnError>({
3738
security: [
3839
{
3940
scheme: 'bearer',
@@ -46,7 +47,7 @@ export class ActiveCampaignFormsService {
4647
}
4748

4849
public static getFormsById<ThrowOnError extends boolean = true>(options: Options<GetFormsByIdData, ThrowOnError>) {
49-
return (options.client ?? _heyApiClient).get<GetFormsByIdResponse, unknown, ThrowOnError>({
50+
return (options.client ?? client).get<GetFormsByIdResponses, GetFormsByIdErrors, ThrowOnError>({
5051
security: [
5152
{
5253
scheme: 'bearer',
@@ -57,5 +58,4 @@ export class ActiveCampaignFormsService {
5758
...options
5859
});
5960
}
60-
61-
}
61+
}

src/Umbraco.Cms.Integrations.Crm.ActiveCampaign/Client/generated/types.gen.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3+
export type ClientOptions = {
4+
baseUrl: 'http://localhost:28157' | (string & {});
5+
};
6+
37
export type ApiAccessDtoModel = {
48
readonly account: string;
59
readonly isApiConfigurationValid: boolean;
610
};
711

8-
export type FormCollectionResponseDtoModelReadable = {
12+
export type FormCollectionResponseDtoModel = {
913
message: string;
1014
forms: Array<FormDtoModel>;
11-
meta: MetaDtoModelReadable;
12-
};
13-
14-
export type FormCollectionResponseDtoModelWritable = {
15-
message: string;
16-
forms: Array<FormDtoModel>;
17-
meta: MetaDtoModelWritable;
15+
meta: MetaDtoModel;
1816
};
1917

2018
export type FormDtoModel = {
@@ -27,7 +25,7 @@ export type FormResponseDtoModel = {
2725
form: FormDtoModel;
2826
};
2927

30-
export type MetaDtoModelReadable = {
28+
export type MetaDtoModel = {
3129
total: string;
3230
readonly totalPages: number;
3331
};
@@ -73,10 +71,6 @@ export type GetFormsErrors = {
7371
* The resource is protected and requires an authentication token
7472
*/
7573
401: unknown;
76-
/**
77-
* Payment Required
78-
*/
79-
402: unknown;
8074
/**
8175
* Forbidden
8276
*/
@@ -95,7 +89,7 @@ export type GetFormsResponses = {
9589
/**
9690
* OK
9791
*/
98-
200: FormCollectionResponseDtoModelReadable;
92+
200: FormCollectionResponseDtoModel;
9993
};
10094

10195
export type GetFormsResponse = GetFormsResponses[keyof GetFormsResponses];
@@ -136,7 +130,3 @@ export type GetFormsByIdResponses = {
136130
};
137131

138132
export type GetFormsByIdResponse = GetFormsByIdResponses[keyof GetFormsByIdResponses];
139-
140-
export type ClientOptions = {
141-
baseUrl: 'http://localhost:30450' | (string & {});
142-
};

0 commit comments

Comments
 (0)