Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
39 changes: 34 additions & 5 deletions azure-pipeline - Search.Algolia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@ 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'

Expand All @@ -28,11 +38,7 @@ steps:
feedsToUse: 'select'
projects: '$(project)'
includeNuGetOrg: true
- task: UseDotNet@2
displayName: 'Use SDK version 9.0.203'
inputs:
packageType: 'sdk'
version: '9.0.203'

- task: VSBuild@1
displayName: 'Build Project'
inputs:
Expand All @@ -55,3 +61,26 @@ steps:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
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
Expand Up @@ -7,12 +7,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="17.0.0-beta" />
<PackageReference Include="Umbraco.Cms" Version="17.0.0-rc2" />
</ItemGroup>

<ItemGroup>
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Search.Algolia\Umbraco.Cms.Integrations.Search.Algolia.csproj" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,9 @@
"AllowConcurrentLogins": false
}
}
},
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True",
"umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite"
}
}
}
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:58030',
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 { GetContentTypesData, GetContentTypesResponse, GetSearchContentTypeIndexByIdData, GetSearchContentTypeIndexByIdResponse, GetIndicesData, GetIndicesResponse, PostSaveIndexData, PostSaveIndexResponse, DeleteSearchIndexData, DeleteSearchIndexResponse, GetSearchIndexByIdData, GetSearchIndexByIdResponse, GetSearchIndexData, GetSearchIndexResponse, PostBuildSearchIndexData, PostBuildSearchIndexResponse } 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 { DeleteSearchIndexData, DeleteSearchIndexErrors, DeleteSearchIndexResponses, GetContentTypesData, GetContentTypesErrors, GetContentTypesResponses, GetIndicesData, GetIndicesErrors, GetIndicesResponses, GetSearchContentTypeIndexByIdData, GetSearchContentTypeIndexByIdErrors, GetSearchContentTypeIndexByIdResponses, GetSearchIndexByIdData, GetSearchIndexByIdErrors, GetSearchIndexByIdResponses, GetSearchIndexData, GetSearchIndexErrors, GetSearchIndexResponses, PostBuildSearchIndexData, PostBuildSearchIndexErrors, PostBuildSearchIndexResponses, PostSaveIndexData, PostSaveIndexErrors, PostSaveIndexResponses } 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 AlgoliaSearchService {
export class AlgoliaSearch {
public static getContentTypes<ThrowOnError extends boolean = true>(options?: Options<GetContentTypesData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetContentTypesResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetContentTypesResponses, GetContentTypesErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -33,7 +34,7 @@ export class AlgoliaSearchService {
}

public static getSearchContentTypeIndexById<ThrowOnError extends boolean = true>(options: Options<GetSearchContentTypeIndexByIdData, ThrowOnError>) {
return (options.client ?? _heyApiClient).get<GetSearchContentTypeIndexByIdResponse, unknown, ThrowOnError>({
return (options.client ?? client).get<GetSearchContentTypeIndexByIdResponses, GetSearchContentTypeIndexByIdErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -46,7 +47,7 @@ export class AlgoliaSearchService {
}

public static getIndices<ThrowOnError extends boolean = true>(options?: Options<GetIndicesData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetIndicesResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetIndicesResponses, GetIndicesErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -59,7 +60,7 @@ export class AlgoliaSearchService {
}

public static postSaveIndex<ThrowOnError extends boolean = true>(options?: Options<PostSaveIndexData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).post<PostSaveIndexResponse, unknown, ThrowOnError>({
return (options?.client ?? client).post<PostSaveIndexResponses, PostSaveIndexErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -76,7 +77,7 @@ export class AlgoliaSearchService {
}

public static deleteSearchIndex<ThrowOnError extends boolean = true>(options: Options<DeleteSearchIndexData, ThrowOnError>) {
return (options.client ?? _heyApiClient).delete<DeleteSearchIndexResponse, unknown, ThrowOnError>({
return (options.client ?? client).delete<DeleteSearchIndexResponses, DeleteSearchIndexErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -89,7 +90,7 @@ export class AlgoliaSearchService {
}

public static getSearchIndexById<ThrowOnError extends boolean = true>(options: Options<GetSearchIndexByIdData, ThrowOnError>) {
return (options.client ?? _heyApiClient).get<GetSearchIndexByIdResponse, unknown, ThrowOnError>({
return (options.client ?? client).get<GetSearchIndexByIdResponses, GetSearchIndexByIdErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -102,7 +103,7 @@ export class AlgoliaSearchService {
}

public static getSearchIndex<ThrowOnError extends boolean = true>(options: Options<GetSearchIndexData, ThrowOnError>) {
return (options.client ?? _heyApiClient).get<GetSearchIndexResponse, unknown, ThrowOnError>({
return (options.client ?? client).get<GetSearchIndexResponses, GetSearchIndexErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -115,7 +116,7 @@ export class AlgoliaSearchService {
}

public static postBuildSearchIndex<ThrowOnError extends boolean = true>(options?: Options<PostBuildSearchIndexData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).post<PostBuildSearchIndexResponse, unknown, ThrowOnError>({
return (options?.client ?? client).post<PostBuildSearchIndexResponses, PostBuildSearchIndexErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -130,5 +131,4 @@ export class AlgoliaSearchService {
}
});
}

}
}
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 ContentTypeDtoModel = {
id: number;
icon: string;
Expand Down Expand Up @@ -39,6 +43,15 @@ export type NotificationHeaderModel = {
type: EventMessageTypeModel;
};

export type ProblemDetails = {
type?: string | null;
title?: string | null;
status?: number | null;
detail?: string | null;
instance?: string | null;
[key: string]: unknown | string | null | string | null | number | null | string | null | string | null | undefined;
};

export type ResponseModel = {
itemsCount: number;
pagesCount: number;
Expand All @@ -48,7 +61,7 @@ export type ResponseModel = {
}>;
};

export type ResultModelReadable = {
export type ResultModel = {
success: boolean;
error: string;
readonly failure: boolean;
Expand Down Expand Up @@ -119,8 +132,14 @@ export type GetIndicesErrors = {
* The resource is protected and requires an authentication token
*/
401: unknown;
/**
* Internal Server Error
*/
500: ProblemDetails;
};

export type GetIndicesError = GetIndicesErrors[keyof GetIndicesErrors];

export type GetIndicesResponses = {
/**
* OK
Expand All @@ -142,13 +161,19 @@ export type PostSaveIndexErrors = {
* The resource is protected and requires an authentication token
*/
401: unknown;
/**
* Internal Server Error
*/
500: ProblemDetails;
};

export type PostSaveIndexError = PostSaveIndexErrors[keyof PostSaveIndexErrors];

export type PostSaveIndexResponses = {
/**
* OK
*/
200: ResultModelReadable;
200: ResultModel;
};

export type PostSaveIndexResponse = PostSaveIndexResponses[keyof PostSaveIndexResponses];
Expand All @@ -173,7 +198,7 @@ export type DeleteSearchIndexResponses = {
/**
* OK
*/
200: ResultModelReadable;
200: ResultModel;
};

export type DeleteSearchIndexResponse = DeleteSearchIndexResponses[keyof DeleteSearchIndexResponses];
Expand Down Expand Up @@ -248,11 +273,7 @@ export type PostBuildSearchIndexResponses = {
/**
* OK
*/
200: ResultModelReadable;
200: ResultModel;
};

export type PostBuildSearchIndexResponse = PostBuildSearchIndexResponses[keyof PostBuildSearchIndexResponses];

export type ClientOptions = {
baseUrl: 'http://localhost:58030' | (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:58030/umbraco/swagger/algolia-search-management/swagger.json',
input: 'http://localhost:28157/umbraco/swagger/algolia-search-management/swagger.json',
output: {
path: 'generated',
},
Expand Down
Loading