Skip to content

Latest commit

 

History

History
2079 lines (1186 loc) · 65.5 KB

File metadata and controls

2079 lines (1186 loc) · 65.5 KB

@onzag/itemize / Modules / base/Root/Module/ItemDefinition/PropertyDefinition / default

Class: default

base/Root/Module/ItemDefinition/PropertyDefinition.default

The property definition class that defines how properties are to be defined

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new default(rawJSON, parentModule, parentItemDefinition, isExtension, originatingInstance?): default

Builds a property definition

Parameters

Name Type Description
rawJSON IPropertyDefinitionRawJSONDataType the raw json structure
parentModule default the parent module of the property
parentItemDefinition default the parent item definition
isExtension boolean whether it represents a prop extension (aka null parentItemDefinition)
originatingInstance? default usually null, but when properties are cloned, reinstantiated; this is the original instance that is attached to the root, the reason we need this is for merging functionality as it will keep itself attached to the root original property via this weak link

Returns

default

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:883

Properties

canCacheState

Private canCacheState: boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:865


defaultIf

Private Optional defaultIf: IPropertyDefinitionRuleDataType[]

Processed rules for default from the raw data

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:775


enforcedValues

Private Optional enforcedValues: IPropertyDefinitionRuleDataType[]

Processed enforced values from the raw data

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:783


globalSuperDefaultedValue

Private Optional globalSuperDefaultedValue: PropertyDefinitionSupportedType | default

this applies for predefined properties basically this is the new default value

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:804


globalSuperEnforcedValue

Private Optional globalSuperEnforcedValue: PropertyDefinitionSupportedType | default

enforced values and defaulted values, this is usually set manually and it applies to includes usually with enforced property values hence the enforced value is global

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:798


hiddenIf

Private Optional hiddenIf: default

Processed hidden conditions from the raw data

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:787


invalidIf

Private Optional invalidIf: IPropertyDefinitionInvalidRuleDataType[]

Processed rules for invalid if from the raw data

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:779


listeners

Private listeners: PropertyDefinitionListenerType[]

list of listeners

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:791


originatingInstance

Private originatingInstance: default

when a property is instantiated this is the original property which is directly attached to the tree

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:770


parentItemDefinition

Private parentItemDefinition: default

The parent item definition, if any, not available to extensions

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:761


parentModule

Private parentModule: default

the parent module of the property

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:757


policyName

Private policyName: string

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:498


policyType

Private policyType: string

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:497


propertyIsExtension

Private propertyIsExtension: boolean

Whether the property is an extension

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:765


rawData

rawData: IPropertyDefinitionRawJSONDataType

the raw data for the property definition

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:753


stateAppliedValue

Private stateAppliedValue: Object

representing the original applied state of the class

Index signature

▪ [slotId: string]: PropertyDefinitionSupportedType

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:816


stateInternalValue

Private stateInternalValue: Object

an internal value

Index signature

▪ [slotId: string]: any

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:849


stateLastCached

stateLastCached: Object

Index signature

▪ [slotId: string]: IPropertyDefinitionState<PropertyDefinitionSupportedType>

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:866


stateLastCachedWithExternal

stateLastCachedWithExternal: Object

Index signature

▪ [slotId: string]: IPropertyDefinitionState<PropertyDefinitionSupportedType>

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:869


stateLastUniqueCheck

stateLastUniqueCheck: Object

these are caches builtin the property to be used in the client side

Index signature

▪ [slotId: string]: { valid: boolean ; value: PropertyDefinitionSupportedType }

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:858


stateSuperEnforcedValue

Private stateSuperEnforcedValue: Object

this is less relevant than the single enforced and it is used when the value is applied manually during the user interaction, values are enforced

Index signature

▪ [slotId: string]: { owners: any[] ; value: PropertyDefinitionSupportedType }

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:824


stateValue

Private stateValue: Object

representing the state of the class

Index signature

▪ [slotId: string]: PropertyDefinitionSupportedType

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:810


stateValueHasBeenManuallySet

Private stateValueHasBeenManuallySet: Object

this only triggers as true when the value has been modified when it has been set by the set value function which is what is supposed to be used by the user

Index signature

▪ [slotId: string]: boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:843


stateValueModified

Private stateValueModified: Object

refers to whether the value in the state value has been modified by any interaction, either by apply value or set value by user

Index signature

▪ [slotId: string]: boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:835


indexChecker

Static indexChecker: PropertyDefinitionCheckerFunctionType = clientSideIndexChecker

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:496


supportedTypesStandard

Static supportedTypesStandard: PropertyDefinitionSupportedTypesStandardType = supportedTypesStandard

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:493

Methods

addChangeListener

addChangeListener(listener): void

Adds a change listener to the listener for changes note that these listeners only listens for user changes not to applied changes of the sorts

Parameters

Name Type Description
listener PropertyDefinitionListenerType the listener to add

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1049


applyValue

applyValue(id, version, value, modifiedState, doNotApplyValueInPropertyIfPropertyHasBeenManuallySet, rejectStateAppliedValue?): void

Applies the value to the property this is intended to be used for when values are loaded into this, and not meant for user input

Parameters

Name Type Description
id string the id of the slot
version string the slot version
value PropertyDefinitionSupportedType the value
modifiedState boolean a modified state to use
doNotApplyValueInPropertyIfPropertyHasBeenManuallySet boolean to avoid hot updating values when the user is modifying them and an apply value has been called because it has been updated somewhere else, we use this to avoid overriding, note that the value must also not be equal, as in, it must differs; otherwise the value is applied, and manually set will go back to false as it's been used applyValue on it, it's been set now by the computer
rejectStateAppliedValue? boolean does not make the value as a state applied, this is used by the item definition apply state function to apply a new state

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1680


buildFieldsForRoleAccess

buildFieldsForRoleAccess(action, role, userId, ownerUserId, rolesManager): Promise<IRQRequestFields>

Builds the fields for a given role and a given action and a given property

Parameters

Name Type Description
action ItemDefinitionIOActions the action that the user wants to execute
role string the role that is executing this action
userId string the user id
ownerUserId string the owner of the item definition for this property
rolesManager ICustomRoleManager -

Returns

Promise<IRQRequestFields>

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2393


checkAgainstRQDefinition

checkAgainstRQDefinition(v): boolean

Parameters

Name Type
v PropertyDefinitionSupportedType

Returns

boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1403


checkRoleAccessFor

checkRoleAccessFor(action, role, userId, ownerUserId, rolesManager, throwError): Promise<boolean>

Checks the role access for a specific IO action to a specific role basically just returns a boolean

Parameters

Name Type Description
action ItemDefinitionIOActions the action that wants to be performed
role string the role that wants to perform that action
userId string the user id that wants to perform the action (null is allowed for eg. GUEST_METAROLE)
ownerUserId string the owner of the item definition (provide UNSPECFIED_OWNER when no owner is known)
rolesManager ICustomRoleManager -
throwError boolean whether to throw an EndpointError during failure rather than returning a boolean

Returns

Promise<boolean>

a boolean on whether it has been granted access

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2473


checkSoftReadRoleAccessFor

checkSoftReadRoleAccessFor(role, userId, ownerUserId, rolesManager): Promise<boolean>

Checks the soft read role access to a given property

Parameters

Name Type
role string
userId string
ownerUserId string
rolesManager ICustomRoleManager

Returns

Promise<boolean>

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2443


cleanState

cleanState(): void

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:936


cleanValueFor

cleanValueFor(id, version): void

Frees the memory of stored values in a given slot id however it will not clear enforced values

Parameters

Name Type Description
id string the slot id
version string the slot version

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1850


clearSuperEnforced

clearSuperEnforced(id, version, owner?): void

Clears a super enforced value set in a slot id

Parameters

Name Type Description
id string the slot id
version string the slot version
owner? any an optional owner parameter it can only be removed if the owner is the same as the original

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1529


getAppliedValue

getAppliedValue<T>(id, version): T

Provides the applied value for a property

Type parameters

Name Type
T extends PropertyDefinitionSupportedType

Parameters

Name Type Description
id string the id
version string the version

Returns

T

the applied value

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1150


getConfigValue

getConfigValue(name): any

Provides the value of a special property if it's available they can only be of type, boolean, string, or number

Parameters

Name Type Description
name string the name of that specifial property

Returns

any

the special property value, either a boolean, number or string, or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2280


getCurrentValue

getCurrentValue<T>(id, version): T

Provides the current value of a property (as it is) for a given slot id

Type parameters

Name Type
T extends PropertyDefinitionSupportedType

Parameters

Name Type Description
id string the slot id
version string -

Returns

T

the current value

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1100


getDefaultValue

getDefaultValue(): PropertyDefinitionSupportedType

Gives the default set value

Returns

PropertyDefinitionSupportedType

a property definition value, or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2333


getEnforcedValue

getEnforcedValue<T>(id, version): Object

Provides the current enforced value (if any) to a given slot id

Type parameters

Name Type
T extends PropertyDefinitionSupportedType

Parameters

Name Type Description
id string the slot id
version string the slot version

Returns

Object

an object that specifies whether the value is enforced, and the value itself if true the value can be null

Name Type
enforced boolean
value? T

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:958


getI18nDataFor

getI18nDataFor(locale): any

Returns the locale data definition, or null

Parameters

Name Type Description
locale string the locale

Returns

any

the locale data

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2342


getId

getId(): string

gives the id of this property defintion

Returns

string

the id

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1031


getMaxDecimalCount

getMaxDecimalCount(): number

Provides the max decimal count as defined, does not provide the limits as they are defined in the constant, returns null simply if it's not defined

Returns

number

a number or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2257


getMaxLength

getMaxLength(): number

Provides the max length as defined, or null if not available

Returns

number

a number or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2237


getMinDecimalCount

getMinDecimalCount(): number

Provides the min decimal count as defined, does not provide the limits as they are defined in the constant, returns null simply if it's not defined

Returns

number

a number or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2267


getMinLength

getMinLength(): number

Provides the min length as defined or null if not available

Returns

number

a number or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2246


getNewInstance

getNewInstance(): default

Uses the raw data to instantiate a new instance of the item definition, uses the same on state change function for state changes so it remains linked to the module

Returns

default

a new instance

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2024


getParentItemDefinition

getParentItemDefinition(): default

Just gives the parent item definition

Returns

default

a item definition that holds this property if any

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2300


getParentModule

getParentModule(): default

Just gives the parent module

Returns

default

a Module

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2292


getPointerSynchronizationProperty

getPointerSynchronizationProperty(): default

Returns

default

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2222


getPointerTargetItem

getPointerTargetItem(): default

Returns

default

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2214


getPolicyName

getPolicyName(): string

if this is a property definition that belongs to a policy this will return the policy name

Returns

string

the policy name

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2055


getPolicyType

getPolicyType(): string

if this is a property definition that belongs to a policy this will return the policy type

Returns

string

the policy type

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2046


getPropertyDefinitionDescription

getPropertyDefinitionDescription(): IPropertyDefinitionSupportedType<PropertyDefinitionSupportedType>

Provides the property definition description from the supported standards

Returns

IPropertyDefinitionSupportedType<PropertyDefinitionSupportedType>

the property definition description for its type

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2087


getQualifiedPolicyIdentifier

getQualifiedPolicyIdentifier(policyType, policyName): string

Provides the qualified property identifier for this specific property

Parameters

Name Type Description
policyType string the policy type
policyName string the policy name

Returns

string

a string for the qualified policy prefix for this specific property id

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2552


getRequestFields

getRequestFields(): IRQRequestFields

Provides the request fields that are necessary and contained within this property in order to be rq requested, these come from the property description

Returns

IRQRequestFields

the requested fields that are necessary

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1070


getRolesWithAccessTo

getRolesWithAccessTo(action): string[]

Provides the specified roles with the access to perform an IO action to the property

Parameters

Name Type Description
action ItemDefinitionIOActions the action in question, DELETE is not an allowed action because properties cannot be deleted, only the item definition as a whole is deleted so it makes no sense, and while the same can be said about creation, creation can be done with incomplete values partial creation is a thing in itemize, and a property can be protected from an arbitrary value during creation, this comes in handy for example for the role in the user item, where an user cannot assign itself an arbitrary role during the IO action of creation

Returns

string[]

an array of string for the roles

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2368


getSearchBoost

getSearchBoost(): number

Returns

number

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2154


getSpecificValidValues

getSpecificValidValues(): PropertyDefinitionSupportedType[]

Provides the specific valid values of the given property

Returns

PropertyDefinitionSupportedType[]

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2178


getState

getState<T>(id, version): Promise<IPropertyDefinitionState<T>>

provides the current useful value for the property defintion

Type parameters

Name Type
T extends PropertyDefinitionSupportedType

Parameters

Name Type Description
id string the id of the current item definition as stored, pass null if not stored this also represents the slot
version string the version

Returns

Promise<IPropertyDefinitionState<T>>

a promise for the current value state

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1262


getStateNoExternalChecking

getStateNoExternalChecking<T>(id, version, emulateExternalChecking?): IPropertyDefinitionState<T>

provides the current useful value for the property defintion without doing any external checking, pass the id still as a cache of previously external checked results might apply

Type parameters

Name Type
T extends PropertyDefinitionSupportedType

Parameters

Name Type Description
id string the id of the current item definition as stored, pass null if not stored
version string the slot version
emulateExternalChecking? boolean -

Returns

IPropertyDefinitionState<T>

the current value state

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1166


getSubtype

getSubtype(): string

Provides the subtype of the property, if available

Returns

string

the subtype string or null

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2186


getType

getType(): PropertyDefinitionSupportedTypeName

gives the type of this property defintion

Returns

PropertyDefinitionSupportedTypeName

the type

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1039


getUniqueIdentifier

getUniqueIdentifier(id, version): string

Provides an unique identifier for a given id version combo for this given property

Parameters

Name Type
id string
version string

Returns

string

a string

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2072


hasSpecificValidValues

hasSpecificValidValues(): boolean

Checks whether the property has specific defined valid values

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2162


isCoercedIntoDefaultWhenNull

isCoercedIntoDefaultWhenNull(): boolean

Tells whether the value is coerced into default when null

Returns

boolean

a booean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2317


isCurrentlyHidden

isCurrentlyHidden(id, version): boolean

checks if it's currently hidden (not phantom)

Parameters

Name Type Description
id string the id
version string the version

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1021


isExtension

isExtension(): boolean

Tells if the property is an extension from the propext list, they usually have priority

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2309


isHidden

isHidden(): boolean

Tells whether the current property is defined as being hidden

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2119


isList

isList(): boolean

Specifies whether it represents a list form

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2170


isNonCaseSensitiveUnique

isNonCaseSensitiveUnique(): boolean

Whether the unique is not case sensitive

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2111


isNullable

isNullable(): boolean

Tells whether the current property is nullable

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2095


isPointer

isPointer(): boolean

Returns

boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2206


isPointerList

isPointerList(): boolean

Returns

boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2210


isPolicyPropertyDefinition

isPolicyPropertyDefinition(): boolean

Specifies whether the property definition belongs to a policy

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2063


isRangedSearchDisabled

isRangedSearchDisabled(): boolean

Checks whether the property can be range searched

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2135


isRetrievalDisabled

isRetrievalDisabled(): boolean

Checks whether the property can be retrieved

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2127


isRichText

isRichText(): boolean

Check whether the type is text, and if it's a rich text type

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2194


isSearchOnly

isSearchOnly(): boolean

Specifies if a property is used for custom searches

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2325


isSearchable

isSearchable(): boolean

Tells if it's searchable, either by default or because of a search level

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2144


isText

isText(): boolean

Returns

boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2198


isTracked

isTracked(): boolean

Returns

boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2202


isUnique

isUnique(): boolean

Tells whether there's an unique index on it

Returns

boolean

a boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2103


isValidValue

isValidValue(id, version, value): Promise<string>

Externally checks a valid value for this input using all its guns, this function is context aware

Parameters

Name Type Description
id string the id of the item as stored (pass null if new)
version string the slot version
value PropertyDefinitionSupportedType the value to check

Returns

Promise<string>

the invalid reason as a string

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1987


isValidValueNoExternalChecking

isValidValueNoExternalChecking(id, version, value, emulateExternalChecking?): string

Checks the valid value but ignores external checking pass the value still because cache might apply of previous external checking

Parameters

Name Type Description
id string the id of the item as stored (pass null if new)
version string the slot version
value PropertyDefinitionSupportedType the value to check
emulateExternalChecking? boolean -

Returns

string

the invalid reason as a string

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1926


markAsPolicy

markAsPolicy(policyType, policyName): default

Marks a property definition as a policy type

Parameters

Name Type Description
policyType string edit, delete, create
policyName string the policy name

Returns

default

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2034


mergeWithI18n

mergeWithI18n(pdef): void

Merges the raw json data locale information of this property with another of the same kind (only its language data)

Parameters

Name Type Description
pdef IPropertyDefinitionRawJSONDataType the property definition raw form

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2561


removeChangeListener

removeChangeListener(listener): void

Removes an added listener

Parameters

Name Type Description
listener PropertyDefinitionListenerType the listener to remove

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1057


restoreValueFor

restoreValueFor(id, version): void

Restores the value of the given slot id to the original applied value

Parameters

Name Type Description
id string the slot id
version string the version

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1895


setCurrentValue

setCurrentValue(id, version, newValue, internalValue): void

Sets the current value for the item, null is a valid value Specially if the item is nullable

The resulting value set might not be the same, if the item has a default null value, that is, if the value is set to that value it will be converted to null

Parameters

Name Type Description
id string the slot d
version string the slot version
newValue PropertyDefinitionSupportedType the new value
internalValue any the internal value

Returns

void

Throws

an error if the value is invalid by definition

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1620


setGlobalSuperDefault

setGlobalSuperDefault(value): void

Sets a super default value that superseeds any default value or values, the value might be another property definition to extract the value from

Parameters

Name Type Description
value PropertyDefinitionSupportedType | default the value to default to it can be a property

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1582


setGlobalSuperEnforced

setGlobalSuperEnforced(value): void

Sets a super enforced value that superseeds any enforced value or values and makes the field enforced, the value might be another property definition to extract the value from

Parameters

Name Type Description
value PropertyDefinitionSupportedType | default the value to enforce it can be a property

Returns

void

Throws

an error if the value is invalid

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1414


setSuperEnforced

setSuperEnforced(id, version, value, owner?): void

Sets a super enforced value to a given property in a given slot id, note a super enforced value won't override the global

Parameters

Name Type Description
id string the slot id
version string the slot version
value PropertyDefinitionSupportedType the value that has tobe super enforced
owner? any an owner parameter, if specified it can only be removed by the same owner

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:1448


toJSON

toJSON(): IPropertyDefinitionRawJSONDataType

Gets the raw data of the property

Returns

IPropertyDefinitionRawJSONDataType

the json form

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:2542


checkAgainstRQDefinition

checkAgainstRQDefinition(properyDefinitionRaw, v): boolean

Performs a check agains the json definition value for a property definition

Parameters

Name Type
properyDefinitionRaw IPropertyDefinitionRawJSONDataType
v PropertyDefinitionSupportedType

Returns

boolean

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:535


createFileForProperty

createFileForProperty(id, name, metadata, src): IRQFile

Parameters

Name Type
id string
name string
metadata string
src Blob

Returns

IRQFile

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:500


getQualifiedPolicyPrefix

getQualifiedPolicyPrefix(policyType, policyName): string

A static method that provides the policy prefix for a given policy name and type

Parameters

Name Type Description
policyType string the policy type
policyName string the policy name

Returns

string

a prefixed string that represents the qualified policy

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:523


isValidValue

isValidValue(propertyDefinitionRaw, value, checkAgainstValues): PropertyInvalidReason

Checks whether a value is valid or not using the raw data.

NOTE!!!! this function is context unaware and hence it cannot execute invalidIf conditional rule set rules

NOTE!!!!! this function is external events unaware and hence it cannot check for unique indexes

Parameters

Name Type Description
propertyDefinitionRaw IPropertyDefinitionRawJSONDataType The raw json property definition data
value PropertyDefinitionSupportedType the value to check against
checkAgainstValues boolean if to check against its own values some properties are enums, and this checks whether to check against these enums, but for example, when checking the information on the enums during the checkers.ts process, we don't want to check that because then it will always be valid

Returns

PropertyInvalidReason

a boolean on whether the value is valid

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:565


revokeFileForProperty

revokeFileForProperty(file): void

Parameters

Name Type
file IRQFile

Returns

void

Defined in

base/Root/Module/ItemDefinition/PropertyDefinition/index.ts:513