From ebee17addaaf60ddbd1b1873f04d9da6aa924f19 Mon Sep 17 00:00:00 2001 From: Markus Ahlstrand Date: Tue, 3 Sep 2024 08:23:31 +0200 Subject: [PATCH] Make properties with defaults optional --- apps/demo/CHANGELOG.md | 6 ++++++ apps/demo/package.json | 2 +- packages/adapter-interfaces/CHANGELOG.md | 6 ++++++ packages/adapter-interfaces/package.json | 2 +- .../adapter-interfaces/src/types/Application.ts | 14 ++++++++++++-- .../adapter-interfaces/src/types/Connection.ts | 7 ++++--- packages/authhero/CHANGELOG.md | 7 +++++++ packages/authhero/package.json | 2 +- packages/drizzle/CHANGELOG.md | 7 +++++++ packages/drizzle/package.json | 2 +- packages/kysely/CHANGELOG.md | 7 +++++++ packages/kysely/package.json | 2 +- 12 files changed, 54 insertions(+), 10 deletions(-) diff --git a/apps/demo/CHANGELOG.md b/apps/demo/CHANGELOG.md index c061eb8..9606f77 100644 --- a/apps/demo/CHANGELOG.md +++ b/apps/demo/CHANGELOG.md @@ -1,5 +1,11 @@ # @authhero/demo +## 0.0.24 + +### Patch Changes + +- authhero@0.2.26 + ## 0.0.23 ### Patch Changes diff --git a/apps/demo/package.json b/apps/demo/package.json index 4e1e04d..6d0c5ac 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -1,7 +1,7 @@ { "name": "@authhero/demo", "private": true, - "version": "0.0.23", + "version": "0.0.24", "scripts": { "dev": "bun --watch src/bun.ts" }, diff --git a/packages/adapter-interfaces/CHANGELOG.md b/packages/adapter-interfaces/CHANGELOG.md index dcddebd..94af393 100644 --- a/packages/adapter-interfaces/CHANGELOG.md +++ b/packages/adapter-interfaces/CHANGELOG.md @@ -1,5 +1,11 @@ # @authhero/adapter-interfaces +## 0.15.3 + +### Patch Changes + +- Make properties with defaults optional + ## 0.15.2 ### Patch Changes diff --git a/packages/adapter-interfaces/package.json b/packages/adapter-interfaces/package.json index 8d0d810..d81b675 100644 --- a/packages/adapter-interfaces/package.json +++ b/packages/adapter-interfaces/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.15.2", + "version": "0.15.3", "files": [ "dist" ], diff --git a/packages/adapter-interfaces/src/types/Application.ts b/packages/adapter-interfaces/src/types/Application.ts index 5803a2c..b33d118 100644 --- a/packages/adapter-interfaces/src/types/Application.ts +++ b/packages/adapter-interfaces/src/types/Application.ts @@ -25,6 +25,7 @@ export const applicationInsertSchema = z.object({ name: z.string(), callbacks: z .array(z.string()) + .optional() .openapi({ description: "Comma-separated list of URLs whitelisted to use as a callback to the client after authentication.", @@ -32,6 +33,7 @@ export const applicationInsertSchema = z.object({ .default([]), allowed_origins: z .array(z.string()) + .optional() .openapi({ description: "Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level. Query strings and hash information are not taken into account when validating these URLs.", @@ -39,6 +41,7 @@ export const applicationInsertSchema = z.object({ .default([]), web_origins: z .array(z.string()) + .optional() .openapi({ description: "Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode.", @@ -46,6 +49,7 @@ export const applicationInsertSchema = z.object({ .default([]), allowed_logout_urls: z .array(z.string()) + .optional() .openapi({ description: "Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains.", @@ -53,6 +57,7 @@ export const applicationInsertSchema = z.object({ .default([]), allowed_clients: z .array(z.string()) + .optional() .openapi({ description: "Ids of clients that will be allowed to perform delegation requests. Clients that will be allowed to make delegation request. By default, all your clients will be allowed. This field allows you to specify specific clients", @@ -62,6 +67,7 @@ export const applicationInsertSchema = z.object({ .object({ samlp: samlpAddon.optional(), }) + .optional() .openapi({ description: "Addons associated with the client. The key is the addon's package name and the value is an object with the configuration for the addon.", @@ -69,13 +75,17 @@ export const applicationInsertSchema = z.object({ .default({}), email_validation: z .enum(["enabled", "disabled", "enforced"]) + .optional() .default("enforced") .openapi({ description: "Defines if it possible to sign in with an unverified email and if verification emails will be sent. This is not available in auth0", }), - client_secret: z.string().default(() => nanoid()), - disable_sign_ups: z.boolean().default(false).openapi({ + client_secret: z + .string() + .optional() + .default(() => nanoid()), + disable_sign_ups: z.boolean().optional().default(false).openapi({ description: "Prevents users from signing up using the hosted login page. This is not available in auth0", }), diff --git a/packages/adapter-interfaces/src/types/Connection.ts b/packages/adapter-interfaces/src/types/Connection.ts index d6fa0b7..e5ffbec 100644 --- a/packages/adapter-interfaces/src/types/Connection.ts +++ b/packages/adapter-interfaces/src/types/Connection.ts @@ -30,9 +30,10 @@ export const connectionInsertSchema = z.object({ app_secret: z.string().optional(), scope: z.string().optional(), }) - .optional(), - enabled_clients: z.array(z.string()).optional(), - authorization_endpoint: z.string().optional(), + .optional() + .default({}), + enabled_clients: z.array(z.string()).optional().default([]), + authorization_endpoint: z.string().optional().default(""), response_type: z.custom().optional(), response_mode: z.custom().optional(), diff --git a/packages/authhero/CHANGELOG.md b/packages/authhero/CHANGELOG.md index 06cabe2..039fd38 100644 --- a/packages/authhero/CHANGELOG.md +++ b/packages/authhero/CHANGELOG.md @@ -1,5 +1,12 @@ # authhero +## 0.2.26 + +### Patch Changes + +- Updated dependencies + - @authhero/adapter-interfaces@0.15.3 + ## 0.2.25 ### Patch Changes diff --git a/packages/authhero/package.json b/packages/authhero/package.json index 6e4b434..c1b4dd4 100644 --- a/packages/authhero/package.json +++ b/packages/authhero/package.json @@ -1,6 +1,6 @@ { "name": "authhero", - "version": "0.2.25", + "version": "0.2.26", "files": [ "dist" ], diff --git a/packages/drizzle/CHANGELOG.md b/packages/drizzle/CHANGELOG.md index cdda2f3..4579c20 100644 --- a/packages/drizzle/CHANGELOG.md +++ b/packages/drizzle/CHANGELOG.md @@ -1,5 +1,12 @@ # @authhero/drizzle +## 0.1.42 + +### Patch Changes + +- Updated dependencies + - @authhero/adapter-interfaces@0.15.3 + ## 0.1.41 ### Patch Changes diff --git a/packages/drizzle/package.json b/packages/drizzle/package.json index 330d70d..966775e 100644 --- a/packages/drizzle/package.json +++ b/packages/drizzle/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.1.41", + "version": "0.1.42", "files": [ "dist" ], diff --git a/packages/kysely/CHANGELOG.md b/packages/kysely/CHANGELOG.md index 6112140..c57930b 100644 --- a/packages/kysely/CHANGELOG.md +++ b/packages/kysely/CHANGELOG.md @@ -1,5 +1,12 @@ # @authhero/kysely-adapter +## 0.9.3 + +### Patch Changes + +- Updated dependencies + - @authhero/adapter-interfaces@0.15.3 + ## 0.9.2 ### Patch Changes diff --git a/packages/kysely/package.json b/packages/kysely/package.json index 4b2b63a..309fee5 100644 --- a/packages/kysely/package.json +++ b/packages/kysely/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/markusahlstrand/authhero" }, - "version": "0.9.2", + "version": "0.9.3", "files": [ "dist" ],