Skip to content

Commit 447bc23

Browse files
authored
Merge pull request #290 from umbraco/feature/v17/semrush
Update Semrush for Umbraco 17
2 parents d5ac557 + f1ee7ab commit 447bc23

30 files changed

+3335
-1092
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>

Umbraco.Cms.Integrations.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VisualStudioVersion = 18.0.11111.16
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2801CB6C-78DE-4129-B5C6-D349F47F9B5C}"
77
ProjectSection(SolutionItems) = preProject
8-
.gitignore = .gitignore
8+
.gitignore = .gitignore
99
azure-pipeline - Crm.ActiveCampaign.yml = azure-pipeline - Crm.ActiveCampaign.yml
1010
azure-pipeline - Crm.Dynamics.yml = azure-pipeline - Crm.Dynamics.yml
1111
azure-pipeline - Crm.Hubspot.yml = azure-pipeline - Crm.Hubspot.yml

azure-pipeline - SEO.SemrushTools.yml

Lines changed: 38 additions & 11 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.SEO.Semrush/**
@@ -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'
@@ -56,4 +60,27 @@ steps:
5660
inputs:
5761
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
5862
ArtifactName: 'drop'
59-
publishLocation: 'Container'
63+
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 & 1 deletion
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.SEO.Semrush\Umbraco.Cms.Integrations.SEO.Semrush.csproj" />
1112
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Automation.Zapier\Umbraco.Cms.Integrations.Automation.Zapier.csproj" />
1213
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Crm.Dynamics\Umbraco.Cms.Integrations.Crm.Dynamics.csproj" />
1314
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Crm.ActiveCampaign\Umbraco.Cms.Integrations.Crm.ActiveCampaign.csproj" />
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// This file is auto-generated by @hey-api/openapi-ts
2+
23
export * from './types.gen';
34
export * from './client.gen';
4-
export * from './sdk.gen';
5+
export * from './sdk.gen';

src/Umbraco.Cms.Integrations.SEO.Semrush/Client/generated/sdk.gen.ts

Lines changed: 20 additions & 21 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 { GetTokenDetailsData, GetTokenDetailsResponse, PostTokenGetData, PostTokenGetResponse, PostTokenGetError, PostTokenRefreshData, PostTokenRefreshResponse, PostTokenRevokeData, PostTokenRevokeResponse, GetTokenValidateData, GetTokenValidateResponse, GetAuthData, GetAuthResponse, GetAuthUrlData, GetAuthUrlResponse, GetColumnsData, GetColumnsResponse, GetContentPropertiesData, GetContentPropertiesResponse, GetDataSourcesData, GetDataSourcesResponse, GetPingData, GetPingResponse, GetRelatedPhrasesData, GetRelatedPhrasesResponse } 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 { GetAuthData, GetAuthErrors, GetAuthResponses, GetAuthUrlData, GetAuthUrlErrors, GetAuthUrlResponses, GetColumnsData, GetColumnsErrors, GetColumnsResponses, GetContentPropertiesData, GetContentPropertiesErrors, GetContentPropertiesResponses, GetDataSourcesData, GetDataSourcesErrors, GetDataSourcesResponses, GetPingData, GetPingErrors, GetPingResponses, GetRelatedPhrasesData, GetRelatedPhrasesErrors, GetRelatedPhrasesResponses, GetTokenDetailsData, GetTokenDetailsErrors, GetTokenDetailsResponses, GetTokenValidateData, GetTokenValidateErrors, GetTokenValidateResponses, PostTokenGetData, PostTokenGetErrors, PostTokenGetResponses, PostTokenRefreshData, PostTokenRefreshErrors, PostTokenRefreshResponses, PostTokenRevokeData, PostTokenRevokeErrors, PostTokenRevokeResponses } 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 AccessTokenService {
22+
export class AccessToken {
2223
public static getTokenDetails<ThrowOnError extends boolean = true>(options?: Options<GetTokenDetailsData, ThrowOnError>) {
23-
return (options?.client ?? _heyApiClient).get<GetTokenDetailsResponse, unknown, ThrowOnError>({
24+
return (options?.client ?? client).get<GetTokenDetailsResponses, GetTokenDetailsErrors, ThrowOnError>({
2425
security: [
2526
{
2627
scheme: 'bearer',
@@ -33,7 +34,7 @@ export class AccessTokenService {
3334
}
3435

3536
public static postTokenGet<ThrowOnError extends boolean = true>(options?: Options<PostTokenGetData, ThrowOnError>) {
36-
return (options?.client ?? _heyApiClient).post<PostTokenGetResponse, PostTokenGetError, ThrowOnError>({
37+
return (options?.client ?? client).post<PostTokenGetResponses, PostTokenGetErrors, ThrowOnError>({
3738
security: [
3839
{
3940
scheme: 'bearer',
@@ -50,7 +51,7 @@ export class AccessTokenService {
5051
}
5152

5253
public static postTokenRefresh<ThrowOnError extends boolean = true>(options?: Options<PostTokenRefreshData, ThrowOnError>) {
53-
return (options?.client ?? _heyApiClient).post<PostTokenRefreshResponse, unknown, ThrowOnError>({
54+
return (options?.client ?? client).post<PostTokenRefreshResponses, PostTokenRefreshErrors, ThrowOnError>({
5455
security: [
5556
{
5657
scheme: 'bearer',
@@ -63,7 +64,7 @@ export class AccessTokenService {
6364
}
6465

6566
public static postTokenRevoke<ThrowOnError extends boolean = true>(options?: Options<PostTokenRevokeData, ThrowOnError>) {
66-
return (options?.client ?? _heyApiClient).post<PostTokenRevokeResponse, unknown, ThrowOnError>({
67+
return (options?.client ?? client).post<PostTokenRevokeResponses, PostTokenRevokeErrors, ThrowOnError>({
6768
security: [
6869
{
6970
scheme: 'bearer',
@@ -76,7 +77,7 @@ export class AccessTokenService {
7677
}
7778

7879
public static getTokenValidate<ThrowOnError extends boolean = true>(options?: Options<GetTokenValidateData, ThrowOnError>) {
79-
return (options?.client ?? _heyApiClient).get<GetTokenValidateResponse, unknown, ThrowOnError>({
80+
return (options?.client ?? client).get<GetTokenValidateResponses, GetTokenValidateErrors, ThrowOnError>({
8081
security: [
8182
{
8283
scheme: 'bearer',
@@ -87,12 +88,11 @@ export class AccessTokenService {
8788
...options
8889
});
8990
}
90-
9191
}
9292

93-
export class SemrushService {
93+
export class Semrush {
9494
public static getAuth<ThrowOnError extends boolean = true>(options?: Options<GetAuthData, ThrowOnError>) {
95-
return (options?.client ?? _heyApiClient).get<GetAuthResponse, unknown, ThrowOnError>({
95+
return (options?.client ?? client).get<GetAuthResponses, GetAuthErrors, ThrowOnError>({
9696
security: [
9797
{
9898
scheme: 'bearer',
@@ -105,7 +105,7 @@ export class SemrushService {
105105
}
106106

107107
public static getAuthUrl<ThrowOnError extends boolean = true>(options?: Options<GetAuthUrlData, ThrowOnError>) {
108-
return (options?.client ?? _heyApiClient).get<GetAuthUrlResponse, unknown, ThrowOnError>({
108+
return (options?.client ?? client).get<GetAuthUrlResponses, GetAuthUrlErrors, ThrowOnError>({
109109
security: [
110110
{
111111
scheme: 'bearer',
@@ -118,7 +118,7 @@ export class SemrushService {
118118
}
119119

120120
public static getColumns<ThrowOnError extends boolean = true>(options?: Options<GetColumnsData, ThrowOnError>) {
121-
return (options?.client ?? _heyApiClient).get<GetColumnsResponse, unknown, ThrowOnError>({
121+
return (options?.client ?? client).get<GetColumnsResponses, GetColumnsErrors, ThrowOnError>({
122122
security: [
123123
{
124124
scheme: 'bearer',
@@ -131,7 +131,7 @@ export class SemrushService {
131131
}
132132

133133
public static getContentProperties<ThrowOnError extends boolean = true>(options?: Options<GetContentPropertiesData, ThrowOnError>) {
134-
return (options?.client ?? _heyApiClient).get<GetContentPropertiesResponse, unknown, ThrowOnError>({
134+
return (options?.client ?? client).get<GetContentPropertiesResponses, GetContentPropertiesErrors, ThrowOnError>({
135135
security: [
136136
{
137137
scheme: 'bearer',
@@ -144,7 +144,7 @@ export class SemrushService {
144144
}
145145

146146
public static getDataSources<ThrowOnError extends boolean = true>(options?: Options<GetDataSourcesData, ThrowOnError>) {
147-
return (options?.client ?? _heyApiClient).get<GetDataSourcesResponse, unknown, ThrowOnError>({
147+
return (options?.client ?? client).get<GetDataSourcesResponses, GetDataSourcesErrors, ThrowOnError>({
148148
security: [
149149
{
150150
scheme: 'bearer',
@@ -157,7 +157,7 @@ export class SemrushService {
157157
}
158158

159159
public static getPing<ThrowOnError extends boolean = true>(options?: Options<GetPingData, ThrowOnError>) {
160-
return (options?.client ?? _heyApiClient).get<GetPingResponse, unknown, ThrowOnError>({
160+
return (options?.client ?? client).get<GetPingResponses, GetPingErrors, ThrowOnError>({
161161
security: [
162162
{
163163
scheme: 'bearer',
@@ -170,7 +170,7 @@ export class SemrushService {
170170
}
171171

172172
public static getRelatedPhrases<ThrowOnError extends boolean = true>(options?: Options<GetRelatedPhrasesData, ThrowOnError>) {
173-
return (options?.client ?? _heyApiClient).get<GetRelatedPhrasesResponse, unknown, ThrowOnError>({
173+
return (options?.client ?? client).get<GetRelatedPhrasesResponses, GetRelatedPhrasesErrors, ThrowOnError>({
174174
security: [
175175
{
176176
scheme: 'bearer',
@@ -181,5 +181,4 @@ export class SemrushService {
181181
...options
182182
});
183183
}
184-
185-
}
184+
}

src/Umbraco.Cms.Integrations.SEO.Semrush/Client/generated/types.gen.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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 AuthorizationRequestDtoModel = {
48
code: string;
59
};
@@ -58,29 +62,29 @@ export type RelatedPhrasesDataDtoModel = {
5862
rows: Array<Array<string>>;
5963
};
6064

61-
export type RelatedPhrasesDtoModelReadable = {
65+
export type RelatedPhrasesDtoModel = {
6266
readonly isSuccessful: boolean;
6367
error: string;
6468
status: number;
6569
data: RelatedPhrasesDataDtoModel;
6670
totalPages: number;
6771
};
6872

69-
export type RelatedPhrasesDtoModelWritable = {
70-
error: string;
71-
status: number;
72-
data: RelatedPhrasesDataDtoModel;
73-
totalPages: number;
74-
};
75-
76-
export type TokenDtoModelReadable = {
73+
export type TokenDtoModel = {
7774
access_token: string;
7875
token_type: string;
7976
expires_in: number;
8077
refresh_token: string;
8178
readonly isAccessTokenAvailable: boolean;
8279
};
8380

81+
export type RelatedPhrasesDtoModelWritable = {
82+
error: string;
83+
status: number;
84+
data: RelatedPhrasesDataDtoModel;
85+
totalPages: number;
86+
};
87+
8488
export type TokenDtoModelWritable = {
8589
access_token: string;
8690
token_type: string;
@@ -106,7 +110,7 @@ export type GetTokenDetailsResponses = {
106110
/**
107111
* OK
108112
*/
109-
200: TokenDtoModelReadable;
113+
200: TokenDtoModel;
110114
};
111115

112116
export type GetTokenDetailsResponse = GetTokenDetailsResponses[keyof GetTokenDetailsResponses];
@@ -374,11 +378,7 @@ export type GetRelatedPhrasesResponses = {
374378
/**
375379
* OK
376380
*/
377-
200: RelatedPhrasesDtoModelReadable;
381+
200: RelatedPhrasesDtoModel;
378382
};
379383

380384
export type GetRelatedPhrasesResponse = GetRelatedPhrasesResponses[keyof GetRelatedPhrasesResponses];
381-
382-
export type ClientOptions = {
383-
baseUrl: 'http://localhost:30450' | (string & {});
384-
};

src/Umbraco.Cms.Integrations.SEO.Semrush/Client/openapi-ts.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineConfig({
44
logs: {
55
level: 'debug',
66
},
7-
input: 'http://localhost:30450/umbraco/swagger/semrush-management/swagger.json',
7+
input: 'http://localhost:28157/umbraco/swagger/semrush-management/swagger.json',
88
output: {
99
path: 'generated',
1010
},

0 commit comments

Comments
 (0)