Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
</packageSources>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion Umbraco.Cms.Integrations.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 18.0.11111.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2801CB6C-78DE-4129-B5C6-D349F47F9B5C}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.gitignore = .gitignore
azure-pipeline - Crm.ActiveCampaign.yml = azure-pipeline - Crm.ActiveCampaign.yml
azure-pipeline - Crm.Dynamics.yml = azure-pipeline - Crm.Dynamics.yml
azure-pipeline - Crm.Hubspot.yml = azure-pipeline - Crm.Hubspot.yml
Expand Down
49 changes: 38 additions & 11 deletions azure-pipeline - SEO.SemrushTools.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
trigger:
branches:
include:
- main-v16
- v16/dev
- main-v17
- v17/dev
paths:
include:
- src/Umbraco.Cms.Integrations.SEO.Semrush/**
Expand All @@ -16,24 +16,28 @@ variables:
project: 'src/$(projectName)/$(projectName).csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
productGroup: 'DXP'
productVersion: 'v17'
DT_API_KEY: $(dtApiKey)
DT_BASE_URL: $(dtBaseUrl)

steps:
- task: UseDotNet@2
displayName: 'Use SDK version 10.0.100'
inputs:
packageType: 'sdk'
version: '10.0.100'

- task: NuGetToolInstaller@1
displayName: 'Install NuGet'

- task: DotNetCoreCLI@2
displayName: 'NuGet Restore'
inputs:
command: 'restore'
feedsToUse: 'select'
feedsToUse: 'config'
projects: '$(project)'
includeNuGetOrg: true

- task: UseDotNet@2
displayName: 'Use SDK version 9.0.203'
inputs:
packageType: 'sdk'
version: '9.0.203'
nugetConfigPath: 'NuGet.config'

- task: VSBuild@1
displayName: 'Build Project'
Expand All @@ -56,4 +60,27 @@ steps:
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
publishLocation: 'Container'

# Generate/upload SBOM with cdxgen
- script: |
cd $(Build.SourcesDirectory)
npm install --global @cyclonedx/cdxgen
displayName: 'Install cdxgen'

- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/bom
cd $(Build.SourcesDirectory)

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
displayName: 'Generate & Upload SBOM with cdxgen'
env:
DT_API_KEY: $(DT_API_KEY)
DT_BASE_URL: $(DT_BASE_URL)

# Publish SBOM artifact
- task: PublishPipelineArtifact@1
displayName: 'Publish SBOM Artifact'
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/bom
artifactName: SBOM
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -8,6 +8,7 @@

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="17.0.0" />
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.SEO.Semrush\Umbraco.Cms.Integrations.SEO.Semrush.csproj" />
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Automation.Zapier\Umbraco.Cms.Integrations.Automation.Zapier.csproj" />
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Crm.Dynamics\Umbraco.Cms.Integrations.Crm.Dynamics.csproj" />
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Crm.ActiveCampaign\Umbraco.Cms.Integrations.Crm.ActiveCampaign.csproj" />
Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Cms.Integrations.SEO.Semrush/Client/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@umbraco-cms:registry=https://www.myget.org/F/umbracoprereleases/npm/
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// This file is auto-generated by @hey-api/openapi-ts

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

import type { ClientOptions as ClientOptions2 } from './types.gen';

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

export const client = createClient(createConfig<ClientOptions>({
baseUrl: 'http://localhost:30450',
export const client = createClient(createConfig<ClientOptions2>({
baseUrl: 'http://localhost:28157',
throwOnError: true
}));
}));
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file is auto-generated by @hey-api/openapi-ts

export * from './types.gen';
export * from './client.gen';
export * from './sdk.gen';
export * from './sdk.gen';
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// This file is auto-generated by @hey-api/openapi-ts

import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
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';
import { client as _heyApiClient } from './client.gen';
import type { Client, Options as Options2, TDataShape } from '@hey-api/client-fetch';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
import { client } from './client.gen';
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';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
/**
* You can provide a client instance returned by `createClient()` instead of
* individual options. This might be also useful if you want to implement a
Expand All @@ -18,9 +19,9 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
meta?: Record<string, unknown>;
};

export class AccessTokenService {
export class AccessToken {
public static getTokenDetails<ThrowOnError extends boolean = true>(options?: Options<GetTokenDetailsData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetTokenDetailsResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetTokenDetailsResponses, GetTokenDetailsErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -33,7 +34,7 @@ export class AccessTokenService {
}

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

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

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

public static getTokenValidate<ThrowOnError extends boolean = true>(options?: Options<GetTokenValidateData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetTokenValidateResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetTokenValidateResponses, GetTokenValidateErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -87,12 +88,11 @@ export class AccessTokenService {
...options
});
}

}

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

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

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

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

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

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

public static getRelatedPhrases<ThrowOnError extends boolean = true>(options?: Options<GetRelatedPhrasesData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetRelatedPhrasesResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetRelatedPhrasesResponses, GetRelatedPhrasesErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -181,5 +181,4 @@ export class SemrushService {
...options
});
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
baseUrl: 'http://localhost:28157' | (string & {});
};

export type AuthorizationRequestDtoModel = {
code: string;
};
Expand Down Expand Up @@ -58,29 +62,29 @@ export type RelatedPhrasesDataDtoModel = {
rows: Array<Array<string>>;
};

export type RelatedPhrasesDtoModelReadable = {
export type RelatedPhrasesDtoModel = {
readonly isSuccessful: boolean;
error: string;
status: number;
data: RelatedPhrasesDataDtoModel;
totalPages: number;
};

export type RelatedPhrasesDtoModelWritable = {
error: string;
status: number;
data: RelatedPhrasesDataDtoModel;
totalPages: number;
};

export type TokenDtoModelReadable = {
export type TokenDtoModel = {
access_token: string;
token_type: string;
expires_in: number;
refresh_token: string;
readonly isAccessTokenAvailable: boolean;
};

export type RelatedPhrasesDtoModelWritable = {
error: string;
status: number;
data: RelatedPhrasesDataDtoModel;
totalPages: number;
};

export type TokenDtoModelWritable = {
access_token: string;
token_type: string;
Expand All @@ -106,7 +110,7 @@ export type GetTokenDetailsResponses = {
/**
* OK
*/
200: TokenDtoModelReadable;
200: TokenDtoModel;
};

export type GetTokenDetailsResponse = GetTokenDetailsResponses[keyof GetTokenDetailsResponses];
Expand Down Expand Up @@ -374,11 +378,7 @@ export type GetRelatedPhrasesResponses = {
/**
* OK
*/
200: RelatedPhrasesDtoModelReadable;
200: RelatedPhrasesDtoModel;
};

export type GetRelatedPhrasesResponse = GetRelatedPhrasesResponses[keyof GetRelatedPhrasesResponses];

export type ClientOptions = {
baseUrl: 'http://localhost:30450' | (string & {});
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default defineConfig({
logs: {
level: 'debug',
},
input: 'http://localhost:30450/umbraco/swagger/semrush-management/swagger.json',
input: 'http://localhost:28157/umbraco/swagger/semrush-management/swagger.json',
output: {
path: 'generated',
},
Expand Down
Loading
Loading