import { ClientManifestTypes, BundleTargetTypes, RuleLogicalOperator, ManifestLoadStatus, OmniaClientRuntimes, OmniaBackendRuntimes } from "./Enums"; import { WebComponentDefinition } from "./ComponentComposer"; import { GuidValue } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models"; import { OmniaNamedModel } from "."; export interface OmniaManifests { webcomponent: Array; resource: Array; groupedResouresAndComponents: Array; blockedManifest: Array; configuration: Array; } export interface OmniaServiceManifests { [omniaServiceId: string]: OmniaManifests; } export interface ClientManifest { manifestType: ClientManifestTypes; } export interface RegiterApiConfiguration { disableAutoLoadingManifests?: boolean; } export interface BundleIdentity { /** The unique id of the manifest, this will be the id of the resources added. */ resourceId: string; /** The unique id of the omnia service to which the resource id belong. */ omniaServiceId: string; } export interface BundleManifest extends ClientManifest, BundleIdentity { /** The friendly name of the manifest */ resourceName?: string; /** Whether the manifest is available in AuthDisabled route */ authDisabled?: boolean; } export interface ClientManifestByTypeCollection { [manifestType: string]: Array; } export interface ManifestLoadResult { manifest: LoadableBundleManifest; status: ManifestLoadStatus; } export interface LoadableBundleManifest extends BundleManifest, ManifestSupportingCombinedLoadRules { version: { [bundleType: string]: string; }; dependingOnManifests: Array; availableBundleTargetTypes: Array; } export interface ApiBundleManifest { api?: string[]; extendApi?: string[]; extendApiRules?: Array; extendApiConfiguration?: { [api: string]: any; }; registerApiConfiguration?: { [api: string]: RegiterApiConfiguration; }; } export interface SecurityBundleManifest { /** whether the resource manifest has the authentication disabled (used in non login routes, e.g. Login/OnBoarding) */ authDisabled?: boolean; } export interface ResourcesBundleManifest extends LoadableBundleManifest, ApiBundleManifest, SecurityBundleManifest { } export interface WebComponentBundleManifest extends LoadableBundleManifest, ApiBundleManifest, SecurityBundleManifest { /** The name for this component, this should be a none conflicting name e.g. use project as prefix myuniqueprojectname-componentName. i.e. */ elementName: string; definition: WebComponentDefinition; } export interface GroupedBundleManifest extends LoadableBundleManifest, SecurityBundleManifest { /** The manifest id's in this group */ manifestIdsInGroup: Array; } export interface BlockedBundleManifest extends BundleIdentity, ClientManifest { } /** Rule applied client side The rule is related to a manifest being loaded, if the rule matches a manifest being loaded, the manifest attached to this rule will also load. (Note: make as restrictive rules as possible, only match when truly needed, think performance) */ export interface LoadIfManifestLoaded extends BundleIdentity, CombinableLoadRule { } /** Rules applied clientside Every rule is compared to the current server relative url of the page (Note: make as restrictive rules as possible, only match when truly needed, think performance) */ export interface LoadByUrlMatchingRule extends CombinableLoadRule { /** For all urls starting with e.g. / <- from and rest of path, /site1/page2 etc */ startsWith?: string; /** Loaded if regEx matches current serverrelative path Example url:https://somthing.sharepoint.com/sites/test-pub?debug=true&play=true Rule: regEx = regEx: ".*?(play=true)" Result: Loads if url contains "play=true" */ regEx?: string; } export interface CombinableLoadRule { } export interface ClientResolvableLoadRule { rule: CombinableLoadRule; logicalOperator: RuleLogicalOperator; resolver?: () => Promise; } export interface ManifestSupportingCombinedLoadRules { combinedLoadRules: Array; } /** Rules applied clientside Every rule is executed and matched against the DOM (Note: make as restrictive rules as possible, only match when truly needed, think performance) */ export interface DomMatchingRule extends CombinableLoadRule { /** Loaded if an element is found which matches this selector. see: https://www.w3schools.com/cssref/css_selectors.asp */ cssSelector: string; } /** Rules applied clientside Every rule is matched against the enabled features (Note: make as restrictive rules as possible, only match when truly needed, think performance) */ export interface FeatureActiveRule extends CombinableLoadRule { /** The id of the feature which should be active */ featureId: GuidValue; } /** Rules applied clientside Every rule is matched against licenses (Note: make as restrictive rules as possible, only match when truly needed, think performance) */ export interface LicenseRule extends CombinableLoadRule { /** The id of the license */ licenseId: GuidValue; } export interface ClientRuntimeRule extends CombinableLoadRule { clientRuntimeTypes: Array; } export interface BackendRuntimeRule extends CombinableLoadRule { backendRuntimeTypes: Array; } /** Rules applied clientside Every rule is matched against user properties (Note: make as restrictive rules as possible, only match when truly needed, think performance) */ export interface UserMatchingRule extends CombinableLoadRule { /** name of user property ex: name, email,etc... */ userPropertyName: string; value: any; userPropertyBagModel?: OmniaNamedModel; }