Skip to content
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

chore(Entities): Add default constructor parameter #1036

Merged
merged 1 commit into from
Apr 26, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class CamelErrorHandlerVisualEntity implements BaseVisualCamelEntity {
id: string;
readonly type = EntityType.ErrorHandler;

constructor(public errorHandlerDef: { errorHandler: ErrorHandlerBuilderDeserializer }) {
constructor(public errorHandlerDef: { errorHandler: ErrorHandlerBuilderDeserializer } = { errorHandler: {} }) {
const id = getCamelRandomId('errorHandler');
this.id = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class CamelInterceptFromVisualEntity
readonly type = EntityType.InterceptFrom;
static readonly ROOT_PATH = 'interceptFrom';

constructor(interceptFromRaw: { interceptFrom: InterceptFrom }) {
constructor(interceptFromRaw: { interceptFrom: InterceptFrom } = { interceptFrom: {} }) {
let interceptFromDef: { interceptFrom: Exclude<InterceptFrom, string> };
if (typeof interceptFromRaw.interceptFrom === 'string') {
interceptFromDef = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export class CamelInterceptSendToEndpointVisualEntity
readonly type = EntityType.InterceptSendToEndpoint;
static readonly ROOT_PATH = 'interceptSendToEndpoint';

constructor(interceptSendToEndpointRaw: { interceptSendToEndpoint: InterceptSendToEndpoint }) {
constructor(
interceptSendToEndpointRaw: { interceptSendToEndpoint: InterceptSendToEndpoint } = { interceptSendToEndpoint: {} },
) {
let interceptSendToEndpointDef: { interceptSendToEndpoint: Exclude<InterceptSendToEndpoint, string> };
if (typeof interceptSendToEndpointRaw.interceptSendToEndpoint === 'string') {
interceptSendToEndpointDef = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CamelInterceptVisualEntity
readonly type = EntityType.Intercept;
static readonly ROOT_PATH = 'intercept';

constructor(public interceptDef: { intercept: Intercept }) {
constructor(public interceptDef: { intercept: Intercept } = { intercept: {} }) {
super(interceptDef);
const id = interceptDef.intercept.id ?? getCamelRandomId(CamelInterceptVisualEntity.ROOT_PATH);
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CamelOnCompletionVisualEntity
readonly type = EntityType.OnCompletion;
static readonly ROOT_PATH = 'onCompletion';

constructor(public onCompletionDef: { onCompletion: OnCompletion }) {
constructor(public onCompletionDef: { onCompletion: OnCompletion } = { onCompletion: {} }) {
super(onCompletionDef);
const id = onCompletionDef.onCompletion.id ?? getCamelRandomId(CamelOnCompletionVisualEntity.ROOT_PATH);
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class CamelOnExceptionVisualEntity
readonly type = EntityType.OnException;
private static readonly ROOT_PATH = 'onException';

constructor(public onExceptionDef: { onException: OnException }) {
constructor(public onExceptionDef: { onException: OnException } = { onException: {} }) {
super(onExceptionDef);
const id = onExceptionDef.onException.id ?? getCamelRandomId(CamelOnExceptionVisualEntity.ROOT_PATH);
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class CamelRestConfigurationVisualEntity implements BaseVisualCamelEntity
readonly type = EntityType.RestConfiguration;
private schemaValidator: ValidateFunction<RestConfiguration> | undefined;

constructor(public restConfigurationDef: { restConfiguration: RestConfiguration }) {
constructor(public restConfigurationDef: { restConfiguration: RestConfiguration } = { restConfiguration: {} }) {
const id = getCamelRandomId('restConfiguration');
this.id = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export class CamelRouteConfigurationVisualEntity
'onCompletion',
];

constructor(public routeConfigurationDef: { routeConfiguration: RouteConfigurationDefinition }) {
constructor(
public routeConfigurationDef: { routeConfiguration: RouteConfigurationDefinition } = { routeConfiguration: {} },
) {
super(routeConfigurationDef);
const id =
routeConfigurationDef.routeConfiguration.id ?? getCamelRandomId(CamelRouteConfigurationVisualEntity.ROOT_PATH);
Expand Down
Loading