dynamics-meta
Version:
Library for download MetaData from Dynamics365
140 lines (136 loc) • 3.53 kB
text/typescript
declare enum FieldType {
String = "String",
Lookup = "Lookup",
Memo = "Memo",
Virtual = "Virtual",
DateTime = "DateTime",
Boolean = "Boolean",
Picklist = "Picklist",
Number = "Number",
Owner = "Owner",
State = "State",
Status = "Status",
PartyList = "PartyList",
Integer = "Integer",
Choice = "Choice",
EntityName = "EntityName",
Uniqueidentifier = "Uniqueidentifier"
}
type TMetaData = {
PrimaryIdAttribute: string;
PrimaryNameAttribute: string;
PrimaryImageAttribute: string;
LogicalName: string;
LogicalCollectionName: string;
SchemaName: string;
DisplayName: {
UserLocalizedLabel: {
Label: string;
};
};
DisplayCollectionName: {
UserLocalizedLabel: {
Label: string;
};
};
IsActivity: boolean;
OwnershipType: string;
ObjectTypeCode: number;
IsCustomEntity: boolean;
};
type TApiJoinParams = Pick<TMetaData, 'DisplayName' | 'LogicalName' | 'LogicalCollectionName' | 'PrimaryIdAttribute' | 'PrimaryNameAttribute'>;
type TFieldMetaData = {
'@odata.type': string;
LogicalName: string;
AttributeType: FieldType;
Format?: string;
FormatName?: {
Value: string;
};
DisplayName: {
UserLocalizedLabel: {
Label: string;
};
};
Description: {
UserLocalizedLabel: {
Label: string;
};
};
MaxLength?: number;
MinValue?: number;
MaxValue?: number;
Targets?: string[];
};
type PickListOptionsType = {
OptionSet: {
Options: Array<{
Value: string;
Label: {
UserLocalizedLabel: {
Label: string;
};
};
}>;
FalseOption?: {
Value: string;
Label: {
UserLocalizedLabel: {
Label: string;
};
};
};
TrueOption?: {
Value: string;
Label: {
UserLocalizedLabel: {
Label: string;
};
};
};
};
};
type TConfig = Record<string, {
name: string;
columns: readonly string[];
}>;
type TAppFieldMeta = {
label: string;
description: string;
type: FieldType;
format?: string;
formatName?: string;
extraType?: string;
options: [string, string][];
targets: string[];
maxLength?: number;
minValue?: number;
maxValue?: number;
};
type TAppEntityMeta = {
PrimaryIdAttribute: string;
PrimaryNameAttribute: string;
PrimaryImageAttribute: string;
logicalName: string;
url: string;
fields: Record<string, TAppFieldMeta>;
displayName: string;
displayCollectionName: string;
isActivity: boolean;
OwnershipType: string;
ObjectTypeCode: number;
schemaName: string;
IsCustomEntity: boolean;
};
type TJoinParams = {
PrimaryIdAttribute: string;
PrimaryNameAttribute: string;
LogicalName: string;
LogicalCollectionName: string;
DisplayName: string;
};
declare const getBuildFunction: (token: string, url: string, config: TConfig) => () => Promise<{
meta: Record<string, TAppEntityMeta>;
targetCollections: Record<string, TJoinParams>;
}>;
export { FieldType, type PickListOptionsType, type TApiJoinParams, type TAppEntityMeta, type TAppFieldMeta, type TConfig, type TFieldMetaData, type TJoinParams, type TMetaData, getBuildFunction };