Manta Developers
GitHub
Menu

@manta-eu/react/hooks/typed-memories/schemas

Reference for @manta-eu/react/hooks/typed-memories/schemas as it is on main.

Type Aliases

AutonomyRule

AutonomyRule = TypedMemoryBase & AutonomyRuleProperties


AutonomyRuleInput

AutonomyRuleInput = MemoryText & AutonomyRuleProperties


AutonomyRuleProperties

AutonomyRuleProperties = object

Properties

approverRole

approverRole: string

autonomyCurrency

autonomyCurrency: string

autonomyDesk

autonomyDesk: string

autoPilotLimit

autoPilotLimit: number

reviewerRole

reviewerRole: string


Desk

Desk = TypedMemoryBase & WithOptional<DeskProperties, "deskTemplate">


DeskInput

DeskInput = MemoryText & WithOptional<DeskProperties, "deskTemplate">


DeskProperties

DeskProperties = object

Properties

deskKey

deskKey: string

deskName

deskName: string

deskTemplate

deskTemplate: string | null


ExtraPropertiesInput

ExtraPropertiesInput = object

Properties

extraProperties?

optional extraProperties?: ExtraPropertyValues


ExtraPropertyValues

ExtraPropertyValues = Record<string, string[]>


Goal

Goal = TypedMemoryBase & GoalProperties


GoalDirection

GoalDirection = typeof goalDirections[number]


GoalInput

GoalInput = MemoryText & WithOptional<Omit<GoalProperties, "goalStatus">, "goalCurrency">


GoalMilestone

GoalMilestone = TypedMemoryBase & GoalMilestoneProperties


GoalMilestoneInput

GoalMilestoneInput = MemoryText & GoalMilestoneProperties


GoalMilestoneProperties

GoalMilestoneProperties = object

Properties

milestoneDate

milestoneDate: string

milestoneGoalMeasure

milestoneGoalMeasure: string

milestoneValue

milestoneValue: number


GoalProperties

GoalProperties = object

Properties

goalCurrency

goalCurrency: string | null

goalDesk

goalDesk: string

goalDirection

goalDirection: GoalDirection

goalMeasure

goalMeasure: string

goalStatus

goalStatus: string | null

goalTarget

goalTarget: number

goalTargetDate

goalTargetDate: string

goalUnit

goalUnit: GoalUnit


GoalUnit

GoalUnit = typeof goalUnits[number]


MemoryOwner

MemoryOwner = object

Properties

iri

iri: string

name

name: string | null


MemoryText

MemoryText = object

Properties

description?

optional description?: string | null

label

label: string


OwnerInput

OwnerInput = object

The owning member’s IRI; on update null clears it and omitting keeps it.

Properties

owner?

optional owner?: string | null


TypedMemoryBase

TypedMemoryBase = object

Properties

description

description: string | null

extraValues?

optional extraValues?: ExtraPropertyValues

iri

iri: string

label

label: string

owner?

optional owner?: MemoryOwner


TypedMemoryRow

TypedMemoryRow = Pick<GQLMemoryFieldsFragment, "iri" | "label" | "description" | "scope" | "memorySubclass" | "customPropertyValues" | "owner">


TypedMemorySpec

TypedMemorySpec<T> = object

Type Parameters

T

T extends object

Properties

fields

fields: z.ZodType<T>

kind

kind: GQLMemoryKind

name

name: string

paths

paths: Readonly<Record<keyof T & string, string>>

subclassIri

subclassIri: string

writableFields

writableFields: z.ZodType<Record<string, unknown>>


WithOptional

WithOptional<T, K> = Omit<T, K> & Partial<Pick<T, K>>

Type Parameters

T

T

K

K extends keyof T

Variables

autonomyRuleFields

const autonomyRuleFields: ZodObject<{ approverRole: ZodString; autonomyCurrency: ZodPipe<ZodString, ZodTransform<string, string>>; autonomyDesk: ZodString; autoPilotLimit: ZodPipe<ZodUnion<readonly [ZodNumber, ZodPipe<ZodString, ZodTransform<number, string>>]>, ZodNumber>; reviewerRole: ZodString; }, $strip>


autonomyRuleSpec

const autonomyRuleSpec: TypedMemorySpec<AutonomyRuleProperties>


deskFields

const deskFields: ZodObject<{ deskKey: ZodString; deskName: ZodString; deskTemplate: ZodPipe<ZodOptional<ZodNullable<ZodString>>, ZodTransform<string | null, string | null | undefined>>; }, $strip>


deskSpec

const deskSpec: TypedMemorySpec<DeskProperties>


goalDirections

const goalDirections: readonly ["increase", "decrease"]


goalFields

const goalFields: ZodObject<{ goalCurrency: ZodPipe<ZodOptional<ZodNullable<ZodPipe<ZodString, ZodTransform<string, string>>>>, ZodTransform<string | null, string | null | undefined>>; goalDesk: ZodString; goalDirection: ZodEnum<{ decrease: "decrease"; increase: "increase"; }>; goalMeasure: ZodString; goalStatus: ZodPipe<ZodOptional<ZodNullable<ZodString>>, ZodTransform<string | null, string | null | undefined>>; goalTarget: ZodPipe<ZodUnion<readonly [ZodNumber, ZodPipe<ZodString, ZodTransform<number, string>>]>, ZodNumber>; goalTargetDate: ZodPipe<ZodString, ZodISODate>; goalUnit: ZodEnum<{ count: "count"; currency: "currency"; percent: "percent"; ratio: "ratio"; }>; }, $strip>


goalMilestoneFields

const goalMilestoneFields: ZodObject<{ milestoneDate: ZodPipe<ZodString, ZodISODate>; milestoneGoalMeasure: ZodString; milestoneValue: ZodPipe<ZodUnion<readonly [ZodNumber, ZodPipe<ZodString, ZodTransform<number, string>>]>, ZodNumber>; }, $strip>


goalMilestoneSpec

const goalMilestoneSpec: TypedMemorySpec<GoalMilestoneProperties>


goalSpec

const goalSpec: TypedMemorySpec<GoalProperties>


goalUnits

const goalUnits: readonly ["currency", "percent", "count", "ratio"]


memoryDecimal

const memoryDecimal: ZodPipe<ZodUnion<readonly [ZodNumber, ZodPipe<ZodString, ZodTransform<number, string>>]>, ZodNumber>

Functions

companyTypedMemories()

companyTypedMemories<T>(rows, spec): (TypedMemoryBase & T)[]

Type Parameters

T

T extends object

Parameters

rows

readonly TypedMemoryRow[]

spec

TypedMemorySpec<T>

Returns

(TypedMemoryBase & T)[]


createMemoryInputFor()

createMemoryInputFor<T>(spec, input): GQLCreateMemoryInput

Type Parameters

T

T extends object

Parameters

spec

TypedMemorySpec<T>

input

MemoryText & Partial<T> & object & ExtraPropertiesInput & OwnerInput

Returns

GQLCreateMemoryInput


onlyExtraValues()

onlyExtraValues(values, paths): ExtraPropertyValues

Parameters

values

ExtraPropertyValues | undefined

paths

Readonly<Record<string, string>>

Returns

ExtraPropertyValues


parseTypedMemory()

parseTypedMemory<T>(row, spec): TypedMemoryBase & T | null

Type Parameters

T

T extends object

Parameters

row

TypedMemoryRow

spec

TypedMemorySpec<T>

Returns

TypedMemoryBase & T | null


storedProperties()

storedProperties(row): Record<string, string>

Parameters

row

Pick<TypedMemoryRow, "customPropertyValues">

Returns

Record<string, string>


typedMemoryFromResponse()

typedMemoryFromResponse<T>(spec, memory, error): TypedMemoryBase & T

Type Parameters

T

T extends object

Parameters

spec

TypedMemorySpec<T>

memory

TypedMemoryRow | null | undefined

error

string | null | undefined

Returns

TypedMemoryBase & T


updateMemoryInputFor()

updateMemoryInputFor<T>(spec, current, changes): GQLUpdateMemoryInput

Type Parameters

T

T extends object

Parameters

spec

TypedMemorySpec<T>

current

TypedMemoryBase & T

changes

Partial<MemoryText & T> & ExtraPropertiesInput & OwnerInput

Returns

GQLUpdateMemoryInput