Skip to content

js: Enable v1.environment.get-settings #1827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 20, 2025
Merged
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
1 change: 0 additions & 1 deletion codegen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 20 additions & 0 deletions javascript/src/api_internal/environment.ts
Original file line number Diff line number Diff line change
@@ -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<EnvironmentSettingsOut> {
const request = new SvixRequest(HttpMethod.GET, "/api/v1/environment/settings");

return request.send(
this.requestCtx,
EnvironmentSettingsOutSerializer._fromJsonObject
);
}
}
37 changes: 37 additions & 0 deletions javascript/src/models/borderRadiusConfig.ts
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
20 changes: 20 additions & 0 deletions javascript/src/models/borderRadiusEnum.ts
Original file line number Diff line number Diff line change
@@ -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;
},
};
44 changes: 44 additions & 0 deletions javascript/src/models/customColorPalette.ts
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
26 changes: 26 additions & 0 deletions javascript/src/models/customStringsOverride.ts
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
33 changes: 33 additions & 0 deletions javascript/src/models/customThemeOverride.ts
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
96 changes: 96 additions & 0 deletions javascript/src/models/environmentSettingsOut.ts
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
20 changes: 20 additions & 0 deletions javascript/src/models/fontSizeConfig.ts
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
2 changes: 1 addition & 1 deletion regen_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down