libs/sdk/src/lib/model/split-journey-configuration.schema.ts
[id: string]:
|
import type {
GlobalActions,
GlobalServiceActivators,
PfeConfig,
PfeNavigationConfiguration
} from '@allianz/ngx-pfe';
import type { PageConfiguration } from '@allianz/taly-core/schemas';
import type { PagesJsonSchema } from './pages-json.schema';
interface WithSchema {
/** The JSON Schema for this file */
$schema?: string;
}
export interface ApplicationJsonSchema
extends Omit<PagesJsonSchema, 'pages'>,
PfeConfig,
WithSchema {}
export interface PageJsonSchema extends PageConfiguration, WithSchema {}
export interface NavigationJsonSchema
extends Omit<PfeNavigationConfiguration, 'serviceActivators'>,
WithSchema {}
// We need to use `type` for the next two types because the base types are defined using an
// index type that is not `string` and we can't add a string-typed property (like "$schema").
// `interface` doesn't allow this but `type` does.
// See https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures for details
export type GlobalServiceActivatorsJsonSchema = GlobalServiceActivators & WithSchema;
export type GlobalActionsJsonSchema = GlobalActions & WithSchema;
// Temporary workaround to suppress IDE warnings on custom Actions and ServiceActivators
// Note: The types used for the Global Service Activator and Global Actions differ between the TypeScript model and the JSON schema.
// TODO: Implement a postscript in schema generation to resolve broken PFE schemas
type ActionsOrServiceActivatorsSchemaEntry = { [key: string]: unknown } | string;
export interface GlobalActionsWithSchema {
[id: string]: ActionsOrServiceActivatorsSchemaEntry;
}
export interface GlobalServiceActivatorsWithSchema {
[id: string]: ActionsOrServiceActivatorsSchemaEntry;
}