From 94c28580b4ec8cca38a204097d816dfd48d9684f Mon Sep 17 00:00:00 2001 From: Arnaud de Mouhy Date: Thu, 6 Feb 2025 12:01:29 +0100 Subject: [PATCH 1/2] fix unknown property accessKey in createClient --- packages/clients/src/scw/client-settings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/clients/src/scw/client-settings.ts b/packages/clients/src/scw/client-settings.ts index f2fe7f49b..f297df389 100644 --- a/packages/clients/src/scw/client-settings.ts +++ b/packages/clients/src/scw/client-settings.ts @@ -10,14 +10,14 @@ import { isURL, isZone, } from '../internal/validations/string-validation' -import type { ProfileDefaultValues } from './client-ini-profile' +import type { Profile } from './client-ini-profile' /** * Holds default values of settings. * * @public */ -export type DefaultValues = ProfileDefaultValues & { +export type DefaultValues = Profile & { /** * The default number of results when requesting a paginated resource. */ From fbc09d1d8285225a9f0593f67cd66298bd6d623c Mon Sep 17 00:00:00 2001 From: Arnaud de Mouhy Date: Thu, 6 Feb 2025 13:43:46 +0100 Subject: [PATCH 2/2] fix: apiURL is optional --- packages/clients/src/scw/client-settings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/clients/src/scw/client-settings.ts b/packages/clients/src/scw/client-settings.ts index f297df389..47b10fc94 100644 --- a/packages/clients/src/scw/client-settings.ts +++ b/packages/clients/src/scw/client-settings.ts @@ -112,11 +112,11 @@ export const assertValidSettings = (obj: Readonly): void => { } // API URL. - if (!isURL(obj.apiURL)) { + if (obj.apiURL && !isURL(obj.apiURL)) { throw new Error(`Invalid URL ${obj.apiURL}`) } - if (obj.apiURL.endsWith('/')) { + if (obj.apiURL?.endsWith('/')) { throw new Error( `Invalid URL ${obj.apiURL}: it should not have a trailing slash`, )