@kontent-ai/management-sdk
Version:
Official Kontent.ai management SDK
59 lines (58 loc) • 2.36 kB
TypeScript
import { CustomAppsContracts, SharedContracts } from '../../contracts';
import { SharedModels } from '../shared/shared-models';
export declare namespace CustomAppModels {
class CustomApp implements SharedModels.IBaseModel<CustomAppsContracts.ICustomAppContract> {
id: string;
name: string;
codename: string;
source_url: string;
config: string | null;
allowed_roles?: SharedContracts.ICodenameIdReferenceContract[];
display_mode: CustomAppsContracts.CustomAppDisplayMode;
_raw: CustomAppsContracts.ICustomAppContract;
constructor(data: {
name: string;
id: string;
codename: string;
source_url: string;
config: string | null;
allowed_roles?: SharedContracts.ICodenameIdReferenceContract[];
display_mode: CustomAppsContracts.CustomAppDisplayMode;
_raw: CustomAppsContracts.ICustomAppContract;
});
}
interface IAddCustomAppData {
name: string;
source_url: string;
codename?: string;
config?: string | null;
allowed_roles?: SharedContracts.ICodenameIdReferenceContract[];
display_mode?: CustomAppsContracts.CustomAppDisplayMode;
}
type ModifyCustomAppPropertyName = 'name' | 'source_url' | 'config' | 'allowed_roles' | 'display_mode';
type ModifyCustomAppOperation = {
op: 'addInto';
value: SharedContracts.IReferenceObjectContract[];
property_name: Extract<ModifyCustomAppPropertyName, 'allowed_roles'>;
} | ({
op: 'replace';
value: SharedContracts.IReferenceObjectContract[];
property_name: Extract<ModifyCustomAppPropertyName, 'allowed_roles'>;
} | {
op: 'replace';
value: string;
property_name: Extract<ModifyCustomAppPropertyName, 'name' | 'source_url'>;
} | {
op: 'replace';
value: string | null;
property_name: Extract<ModifyCustomAppPropertyName, 'config'>;
} | {
op: 'replace';
value: CustomAppsContracts.CustomAppDisplayMode;
property_name: Extract<ModifyCustomAppPropertyName, 'display_mode'>;
}) | {
op: 'remove';
value: SharedContracts.IReferenceObjectContract[];
property_name: Extract<ModifyCustomAppPropertyName, 'allowed_roles'>;
};
}