Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,5 @@ $RECYCLE.BIN/
# Umbraco specific gitignore
#
**/config.outputPath.js

appsettings.Local.json
8 changes: 8 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +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>
</configuration>
2 changes: 2 additions & 0 deletions Umbraco.Cms.Integrations.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ 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
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
azure-pipeline - Search.Algolia.yml = azure-pipeline - Search.Algolia.yml
azure-pipeline - SEO.SemrushTools.yml = azure-pipeline - SEO.SemrushTools.yml
azure-pipelines - Automation.Zapier.yml = azure-pipelines - Automation.Zapier.yml
azure-pipelines - Commerce.Shopify.yml = azure-pipelines - Commerce.Shopify.yml
NuGet.config = NuGet.config
README.md = README.md
EndProjectSection
EndProject
Expand Down
47 changes: 37 additions & 10 deletions azure-pipelines - Commerce.Shopify.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.Commerce.Shopify/**
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 Down Expand Up @@ -72,3 +76,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
4 changes: 4 additions & 0 deletions examples/Umbraco.Cms.Integrations.Testsite.V17/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

#if DEBUG
builder.Configuration.AddJsonFile("appsettings.Local.json", optional: true, reloadOnChange: true);
#endif

builder.CreateUmbracoBuilder()
.AddBackOffice()
.AddWebsite()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "umbraco",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
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 @@ -7,7 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="17.0.0-beta" />
<PackageReference Include="Umbraco.Cms" Version="17.0.0" />
<ProjectReference Include="..\..\src\Umbraco.Cms.Integrations.Commerce.Shopify\Umbraco.Cms.Integrations.Commerce.Shopify.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
}
}
},
"ConnectionStrings": {
"umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True",
"umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite"
},
"Umbraco": {
"CMS": {
"Global": {
Expand Down
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 { PostAccessTokenData, PostAccessTokenResponse, GetAuthorizationUrlData, GetAuthorizationUrlResponse, GetCheckConfigurationData, GetCheckConfigurationResponse, GetListData, GetListResponse, PostListByIdsData, PostListByIdsResponse, PostRefreshAccessTokenData, PostRefreshAccessTokenResponse, PostRevokeAccessTokenData, GetTotalPagesData, GetTotalPagesResponse, GetValidateAccessTokenData, GetValidateAccessTokenResponse } 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 { GetAuthorizationUrlData, GetAuthorizationUrlErrors, GetAuthorizationUrlResponses, GetCheckConfigurationData, GetCheckConfigurationErrors, GetCheckConfigurationResponses, GetListData, GetListErrors, GetListResponses, GetTotalPagesData, GetTotalPagesErrors, GetTotalPagesResponses, GetValidateAccessTokenData, GetValidateAccessTokenErrors, GetValidateAccessTokenResponses, PostAccessTokenData, PostAccessTokenErrors, PostAccessTokenResponses, PostListByIdsData, PostListByIdsErrors, PostListByIdsResponses, PostRefreshAccessTokenData, PostRefreshAccessTokenErrors, PostRefreshAccessTokenResponses, PostRevokeAccessTokenData, PostRevokeAccessTokenErrors, PostRevokeAccessTokenResponses } 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 ShopifyService {
export class Shopify {
public static postAccessToken<ThrowOnError extends boolean = true>(options?: Options<PostAccessTokenData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).post<PostAccessTokenResponse, unknown, ThrowOnError>({
return (options?.client ?? client).post<PostAccessTokenResponses, PostAccessTokenErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -37,7 +38,7 @@ export class ShopifyService {
}

public static getAuthorizationUrl<ThrowOnError extends boolean = true>(options?: Options<GetAuthorizationUrlData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetAuthorizationUrlResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetAuthorizationUrlResponses, GetAuthorizationUrlErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -50,7 +51,7 @@ export class ShopifyService {
}

public static getCheckConfiguration<ThrowOnError extends boolean = true>(options?: Options<GetCheckConfigurationData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetCheckConfigurationResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetCheckConfigurationResponses, GetCheckConfigurationErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -63,7 +64,7 @@ export class ShopifyService {
}

public static getList<ThrowOnError extends boolean = true>(options?: Options<GetListData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetListResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetListResponses, GetListErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -76,7 +77,7 @@ export class ShopifyService {
}

public static postListByIds<ThrowOnError extends boolean = true>(options?: Options<PostListByIdsData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).post<PostListByIdsResponse, unknown, ThrowOnError>({
return (options?.client ?? client).post<PostListByIdsResponses, PostListByIdsErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -93,7 +94,7 @@ export class ShopifyService {
}

public static postRefreshAccessToken<ThrowOnError extends boolean = true>(options?: Options<PostRefreshAccessTokenData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).post<PostRefreshAccessTokenResponse, unknown, ThrowOnError>({
return (options?.client ?? client).post<PostRefreshAccessTokenResponses, PostRefreshAccessTokenErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -106,7 +107,7 @@ export class ShopifyService {
}

public static postRevokeAccessToken<ThrowOnError extends boolean = true>(options?: Options<PostRevokeAccessTokenData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).post<unknown, unknown, ThrowOnError>({
return (options?.client ?? client).post<PostRevokeAccessTokenResponses, PostRevokeAccessTokenErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -119,7 +120,7 @@ export class ShopifyService {
}

public static getTotalPages<ThrowOnError extends boolean = true>(options?: Options<GetTotalPagesData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetTotalPagesResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetTotalPagesResponses, GetTotalPagesErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -132,7 +133,7 @@ export class ShopifyService {
}

public static getValidateAccessToken<ThrowOnError extends boolean = true>(options?: Options<GetValidateAccessTokenData, ThrowOnError>) {
return (options?.client ?? _heyApiClient).get<GetValidateAccessTokenResponse, unknown, ThrowOnError>({
return (options?.client ?? client).get<GetValidateAccessTokenResponses, GetValidateAccessTokenErrors, ThrowOnError>({
security: [
{
scheme: 'bearer',
Expand All @@ -143,5 +144,4 @@ export class ShopifyService {
...options
});
}

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

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

export type ConfigurationTypeModel = {
readonly value: string;
};

export type EditorSettingsModelReadable = {
export type EditorSettingsModel = {
isValid: boolean;
type: ConfigurationTypeModel;
};

export type EditorSettingsModelWritable = {
isValid: boolean;
};

export enum EventMessageTypeModel {
DEFAULT = 'Default',
INFO = 'Info',
Expand Down Expand Up @@ -79,6 +79,11 @@ export type ResponseDtoProductsListDtoModel = {
take: number;
};

export type EditorSettingsModelWritable = {
isValid: boolean;
type: unknown;
};

export type PostAccessTokenData = {
body?: OAuthRequestDtoModel;
path?: never;
Expand Down Expand Up @@ -143,7 +148,7 @@ export type GetCheckConfigurationResponses = {
/**
* OK
*/
200: EditorSettingsModelReadable;
200: EditorSettingsModel;
};

export type GetCheckConfigurationResponse = GetCheckConfigurationResponses[keyof GetCheckConfigurationResponses];
Expand Down Expand Up @@ -285,7 +290,3 @@ export type GetValidateAccessTokenResponses = {
};

export type GetValidateAccessTokenResponse = GetValidateAccessTokenResponses[keyof GetValidateAccessTokenResponses];

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/shopify-management/swagger.json',
input: 'http://localhost:28157/umbraco/swagger/shopify-management/swagger.json',
output: {
path: 'generated',
},
Expand Down
Loading