From e9349cd82d3a054381c477a05fbe701bd7ecf752 Mon Sep 17 00:00:00 2001 From: Mendy Man Date: Thu, 20 Mar 2025 11:11:54 -0400 Subject: [PATCH 1/2] js: Enable `v1.environment.get-settings` --- codegen.toml | 1 - regen_openapi.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/codegen.toml b/codegen.toml index 0dc358469..8f1aecba1 100644 --- a/codegen.toml +++ b/codegen.toml @@ -31,7 +31,6 @@ template = "javascript/templates/api_resource.ts.jinja" output_dir = "javascript/src/api_internal" extra_codegen_args = [ "--include-mode=only-hidden", - "-e=v1.environment.get-settings", "-e=v1.event-type.update-retry-schedule", "-e=v1.event-type.get-retry-schedule", "-e=v1.sink.get", diff --git a/regen_openapi.py b/regen_openapi.py index 220b99c93..5cd57e409 100755 --- a/regen_openapi.py +++ b/regen_openapi.py @@ -15,7 +15,7 @@ print("Python 3.11 or greater is required to run the codegen") exit(1) -OPENAPI_CODEGEN_IMAGE = "ghcr.io/svix/openapi-codegen:20250317-287" +OPENAPI_CODEGEN_IMAGE = "ghcr.io/svix/openapi-codegen:20250320-289" REPO_ROOT = pathlib.Path(__file__).parent.resolve() DEBUG = os.getenv("DEBUG") is not None GREEN = "\033[92m" From e9c11437643d8e49c1ad9c0101e5fb6264797b81 Mon Sep 17 00:00:00 2001 From: Mendy Man Date: Thu, 20 Mar 2025 11:26:10 -0400 Subject: [PATCH 2/2] js: Pull in changes from latest codegen --- javascript/src/api_internal/environment.ts | 20 ++++ javascript/src/models/borderRadiusConfig.ts | 37 +++++++ javascript/src/models/borderRadiusEnum.ts | 20 ++++ javascript/src/models/customColorPalette.ts | 44 +++++++++ .../src/models/customStringsOverride.ts | 26 +++++ javascript/src/models/customThemeOverride.ts | 33 +++++++ .../src/models/environmentSettingsOut.ts | 96 +++++++++++++++++++ javascript/src/models/fontSizeConfig.ts | 20 ++++ 8 files changed, 296 insertions(+) create mode 100644 javascript/src/api_internal/environment.ts create mode 100644 javascript/src/models/borderRadiusConfig.ts create mode 100644 javascript/src/models/borderRadiusEnum.ts create mode 100644 javascript/src/models/customColorPalette.ts create mode 100644 javascript/src/models/customStringsOverride.ts create mode 100644 javascript/src/models/customThemeOverride.ts create mode 100644 javascript/src/models/environmentSettingsOut.ts create mode 100644 javascript/src/models/fontSizeConfig.ts diff --git a/javascript/src/api_internal/environment.ts b/javascript/src/api_internal/environment.ts new file mode 100644 index 000000000..12129e8ca --- /dev/null +++ b/javascript/src/api_internal/environment.ts @@ -0,0 +1,20 @@ +// this file is @generated +import { + EnvironmentSettingsOut, + EnvironmentSettingsOutSerializer, +} from "../models/environmentSettingsOut"; +import { HttpMethod, SvixRequest, SvixRequestContext } from "../request"; + +export class Environment { + public constructor(private readonly requestCtx: SvixRequestContext) {} + + /** Get the environment's settings. */ + public getSettings(): Promise { + const request = new SvixRequest(HttpMethod.GET, "/api/v1/environment/settings"); + + return request.send( + this.requestCtx, + EnvironmentSettingsOutSerializer._fromJsonObject + ); + } +} diff --git a/javascript/src/models/borderRadiusConfig.ts b/javascript/src/models/borderRadiusConfig.ts new file mode 100644 index 000000000..b29c011d0 --- /dev/null +++ b/javascript/src/models/borderRadiusConfig.ts @@ -0,0 +1,37 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { BorderRadiusEnum, BorderRadiusEnumSerializer } from "./borderRadiusEnum"; + +export interface BorderRadiusConfig { + button?: BorderRadiusEnum | null; + card?: BorderRadiusEnum | null; + input?: BorderRadiusEnum | null; +} + +export const BorderRadiusConfigSerializer = { + _fromJsonObject(object: any): BorderRadiusConfig { + return { + button: object["button"] + ? BorderRadiusEnumSerializer._fromJsonObject(object["button"]) + : undefined, + card: object["card"] + ? BorderRadiusEnumSerializer._fromJsonObject(object["card"]) + : undefined, + input: object["input"] + ? BorderRadiusEnumSerializer._fromJsonObject(object["input"]) + : undefined, + }; + }, + + _toJsonObject(self: BorderRadiusConfig): any { + return { + button: self.button + ? BorderRadiusEnumSerializer._toJsonObject(self.button) + : undefined, + card: self.card ? BorderRadiusEnumSerializer._toJsonObject(self.card) : undefined, + input: self.input + ? BorderRadiusEnumSerializer._toJsonObject(self.input) + : undefined, + }; + }, +}; diff --git a/javascript/src/models/borderRadiusEnum.ts b/javascript/src/models/borderRadiusEnum.ts new file mode 100644 index 000000000..489347a5e --- /dev/null +++ b/javascript/src/models/borderRadiusEnum.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export enum BorderRadiusEnum { + None = "none", + Lg = "lg", + Md = "md", + Sm = "sm", + Full = "full", +} + +export const BorderRadiusEnumSerializer = { + _fromJsonObject(object: any): BorderRadiusEnum { + return object; + }, + + _toJsonObject(self: BorderRadiusEnum): any { + return self; + }, +}; diff --git a/javascript/src/models/customColorPalette.ts b/javascript/src/models/customColorPalette.ts new file mode 100644 index 000000000..945016498 --- /dev/null +++ b/javascript/src/models/customColorPalette.ts @@ -0,0 +1,44 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CustomColorPalette { + backgroundHover?: string | null; + backgroundPrimary?: string | null; + backgroundSecondary?: string | null; + buttonPrimary?: string | null; + interactiveAccent?: string | null; + navigationAccent?: string | null; + primary?: string | null; + textDanger?: string | null; + textPrimary?: string | null; +} + +export const CustomColorPaletteSerializer = { + _fromJsonObject(object: any): CustomColorPalette { + return { + backgroundHover: object["backgroundHover"], + backgroundPrimary: object["backgroundPrimary"], + backgroundSecondary: object["backgroundSecondary"], + buttonPrimary: object["buttonPrimary"], + interactiveAccent: object["interactiveAccent"], + navigationAccent: object["navigationAccent"], + primary: object["primary"], + textDanger: object["textDanger"], + textPrimary: object["textPrimary"], + }; + }, + + _toJsonObject(self: CustomColorPalette): any { + return { + backgroundHover: self.backgroundHover, + backgroundPrimary: self.backgroundPrimary, + backgroundSecondary: self.backgroundSecondary, + buttonPrimary: self.buttonPrimary, + interactiveAccent: self.interactiveAccent, + navigationAccent: self.navigationAccent, + primary: self.primary, + textDanger: self.textDanger, + textPrimary: self.textPrimary, + }; + }, +}; diff --git a/javascript/src/models/customStringsOverride.ts b/javascript/src/models/customStringsOverride.ts new file mode 100644 index 000000000..73a8eab55 --- /dev/null +++ b/javascript/src/models/customStringsOverride.ts @@ -0,0 +1,26 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface CustomStringsOverride { + channelsHelp?: string | null; + channelsMany?: string | null; + channelsOne?: string | null; +} + +export const CustomStringsOverrideSerializer = { + _fromJsonObject(object: any): CustomStringsOverride { + return { + channelsHelp: object["channelsHelp"], + channelsMany: object["channelsMany"], + channelsOne: object["channelsOne"], + }; + }, + + _toJsonObject(self: CustomStringsOverride): any { + return { + channelsHelp: self.channelsHelp, + channelsMany: self.channelsMany, + channelsOne: self.channelsOne, + }; + }, +}; diff --git a/javascript/src/models/customThemeOverride.ts b/javascript/src/models/customThemeOverride.ts new file mode 100644 index 000000000..6bcea76a8 --- /dev/null +++ b/javascript/src/models/customThemeOverride.ts @@ -0,0 +1,33 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { BorderRadiusConfig, BorderRadiusConfigSerializer } from "./borderRadiusConfig"; +import { FontSizeConfig, FontSizeConfigSerializer } from "./fontSizeConfig"; + +export interface CustomThemeOverride { + borderRadius?: BorderRadiusConfig | null; + fontSize?: FontSizeConfig | null; +} + +export const CustomThemeOverrideSerializer = { + _fromJsonObject(object: any): CustomThemeOverride { + return { + borderRadius: object["borderRadius"] + ? BorderRadiusConfigSerializer._fromJsonObject(object["borderRadius"]) + : undefined, + fontSize: object["fontSize"] + ? FontSizeConfigSerializer._fromJsonObject(object["fontSize"]) + : undefined, + }; + }, + + _toJsonObject(self: CustomThemeOverride): any { + return { + borderRadius: self.borderRadius + ? BorderRadiusConfigSerializer._toJsonObject(self.borderRadius) + : undefined, + fontSize: self.fontSize + ? FontSizeConfigSerializer._toJsonObject(self.fontSize) + : undefined, + }; + }, +}; diff --git a/javascript/src/models/environmentSettingsOut.ts b/javascript/src/models/environmentSettingsOut.ts new file mode 100644 index 000000000..500f87d5e --- /dev/null +++ b/javascript/src/models/environmentSettingsOut.ts @@ -0,0 +1,96 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ +import { CustomColorPalette, CustomColorPaletteSerializer } from "./customColorPalette"; +import { + CustomStringsOverride, + CustomStringsOverrideSerializer, +} from "./customStringsOverride"; +import { + CustomThemeOverride, + CustomThemeOverrideSerializer, +} from "./customThemeOverride"; + +export interface EnvironmentSettingsOut { + colorPaletteDark?: CustomColorPalette | null; + colorPaletteLight?: CustomColorPalette | null; + customColor?: string | null; + customFontFamily?: string | null; + customFontFamilyUrl?: string | null; + customLogoUrl?: string | null; + customStringsOverride?: CustomStringsOverride | null; + customThemeOverride?: CustomThemeOverride | null; + displayName?: string | null; + enableChannels?: boolean; + enableEndpointMtlsConfig?: boolean; + enableEndpointOauthConfig?: boolean; + enableIntegrationManagement?: boolean; + enableMessageStream?: boolean; + enableMessageTags?: boolean; + enableTransformations?: boolean; + showUseSvixPlay?: boolean; + wipeSuccessfulPayload?: boolean; +} + +export const EnvironmentSettingsOutSerializer = { + _fromJsonObject(object: any): EnvironmentSettingsOut { + return { + colorPaletteDark: object["colorPaletteDark"] + ? CustomColorPaletteSerializer._fromJsonObject(object["colorPaletteDark"]) + : undefined, + colorPaletteLight: object["colorPaletteLight"] + ? CustomColorPaletteSerializer._fromJsonObject(object["colorPaletteLight"]) + : undefined, + customColor: object["customColor"], + customFontFamily: object["customFontFamily"], + customFontFamilyUrl: object["customFontFamilyUrl"], + customLogoUrl: object["customLogoUrl"], + customStringsOverride: object["customStringsOverride"] + ? CustomStringsOverrideSerializer._fromJsonObject(object["customStringsOverride"]) + : undefined, + customThemeOverride: object["customThemeOverride"] + ? CustomThemeOverrideSerializer._fromJsonObject(object["customThemeOverride"]) + : undefined, + displayName: object["displayName"], + enableChannels: object["enableChannels"], + enableEndpointMtlsConfig: object["enableEndpointMtlsConfig"], + enableEndpointOauthConfig: object["enableEndpointOauthConfig"], + enableIntegrationManagement: object["enableIntegrationManagement"], + enableMessageStream: object["enableMessageStream"], + enableMessageTags: object["enableMessageTags"], + enableTransformations: object["enableTransformations"], + showUseSvixPlay: object["showUseSvixPlay"], + wipeSuccessfulPayload: object["wipeSuccessfulPayload"], + }; + }, + + _toJsonObject(self: EnvironmentSettingsOut): any { + return { + colorPaletteDark: self.colorPaletteDark + ? CustomColorPaletteSerializer._toJsonObject(self.colorPaletteDark) + : undefined, + colorPaletteLight: self.colorPaletteLight + ? CustomColorPaletteSerializer._toJsonObject(self.colorPaletteLight) + : undefined, + customColor: self.customColor, + customFontFamily: self.customFontFamily, + customFontFamilyUrl: self.customFontFamilyUrl, + customLogoUrl: self.customLogoUrl, + customStringsOverride: self.customStringsOverride + ? CustomStringsOverrideSerializer._toJsonObject(self.customStringsOverride) + : undefined, + customThemeOverride: self.customThemeOverride + ? CustomThemeOverrideSerializer._toJsonObject(self.customThemeOverride) + : undefined, + displayName: self.displayName, + enableChannels: self.enableChannels, + enableEndpointMtlsConfig: self.enableEndpointMtlsConfig, + enableEndpointOauthConfig: self.enableEndpointOauthConfig, + enableIntegrationManagement: self.enableIntegrationManagement, + enableMessageStream: self.enableMessageStream, + enableMessageTags: self.enableMessageTags, + enableTransformations: self.enableTransformations, + showUseSvixPlay: self.showUseSvixPlay, + wipeSuccessfulPayload: self.wipeSuccessfulPayload, + }; + }, +}; diff --git a/javascript/src/models/fontSizeConfig.ts b/javascript/src/models/fontSizeConfig.ts new file mode 100644 index 000000000..eb90d9014 --- /dev/null +++ b/javascript/src/models/fontSizeConfig.ts @@ -0,0 +1,20 @@ +// this file is @generated +/* eslint @typescript-eslint/no-explicit-any: 0 */ + +export interface FontSizeConfig { + base?: number | null; +} + +export const FontSizeConfigSerializer = { + _fromJsonObject(object: any): FontSizeConfig { + return { + base: object["base"], + }; + }, + + _toJsonObject(self: FontSizeConfig): any { + return { + base: self.base, + }; + }, +};