Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

redux-data-service

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals


Type aliases

FetchAllAction

Ƭ FetchAllAction: IAction<IQueryBuilder, IPostActionHandlers & IForceReload>

Defined in Services/DataService/ShouldFetchAll.ts:7


FetchItemAction

Ƭ FetchItemAction: IAction<object, IForceReload>

Defined in Services/DataService/ShouldFetchItem.ts:5


FilterValue

Ƭ FilterValue: * string | number | boolean *

Defined in Query/QueryBuilder.ts:13


IActionCreator

Ƭ IActionCreator: function

Defined in Services/IService.ts:14

Type declaration

▸(payload?: T, meta?: M): IAction<T, M>

Parameters:

Name Type
Optional payload T
Optional meta M

Returns: IAction<T, M>


IActionEpic

Ƭ IActionEpic: Epic<IObservableAction<T, M>, any, any>

Defined in Services/IService.ts:24


IConfigureStore

Ƭ IConfigureStore: function

Defined in Store/ConfigureStore.ts:10

Type declaration

▸(reducers: IReducers<any>, epics: IActionEpic[]): Store<any>

Parameters:

Name Type
reducers IReducers<any>
epics IActionEpic[]

Returns: Store<any>


IDataServiceStateRecord

Ƭ IDataServiceStateRecord: * Record<IDataServiceState<T>> & Readonly<IDataServiceState<T>> *

Defined in Services/DataService/DataServiceStateRecord.ts:7


IModelKeys

Ƭ IModelKeys: * object | null *

Defined in Model/IModel.ts:8


IObservableAction

Ƭ IObservableAction: * ActionsObservable<IAction<T, M>> & IAction<T, M> *

Defined in Services/IService.ts:23


IQueryCacheRecord

Ƭ IQueryCacheRecord: * Record<IQueryCache> & Readonly<IQueryCache> *

Defined in Query/QueryCacheRecord.ts:4


IReducer

Ƭ IReducer: function

Defined in Services/IService.ts:20

Type declaration

▸(state: S, action: IAction): S

Parameters:

Name Type
state S
action IAction

Returns: S


IReducers

Ƭ IReducers: * object | __type *

Defined in Services/IService.ts:21


Omit

Ƭ Omit: Omit&lt;T, K&gt;

Defined in Omit.ts:8

Creates a type whose signature contains the given interface T, minus the keys named in K.

For example: Omit<IStudentData, "name" | "age"> will return a type with the given interface but without "name" or "age".

"Borrowed" from Material UI.


SortDirection

Ƭ SortDirection: * "asc" | "desc" *

Defined in Query/QueryBuilder.ts:6


Variables

<Const> DEFAULT_COALESCE_BUFFER_TIME

● DEFAULT_COALESCE_BUFFER_TIME: 50 = 50

Defined in Configure.ts:29


<Const> DataServiceStateRecord

● DataServiceStateRecord: Factory<IDataServiceState<any>> = Record<IDataServiceState>({ items: Map<string, IModel>(), requestCache: Map<string, IQueryCacheRecord>(), })

Defined in Services/DataService/DataServiceStateRecord.ts:10

The state used for a DataService implementation


<Const> QueryCacheRecord

● QueryCacheRecord: Factory<IQueryCache> = Record({ query: undefined, response: undefined, isLoading: false, errors: undefined, })

Defined in Query/QueryCacheRecord.ts:9

Creates an ImmutableJS Record of IQueryCache


<Let> _FakeXHR

● _FakeXHR: any

Defined in TestUtils/StubXhr.ts:4


<Let> _FakedXHRHistory

● _FakedXHRHistory: any[] = []

Defined in TestUtils/StubXhr.ts:3


<Let> _modelDataCreatorMap

● _modelDataCreatorMap: IModelDataCreatorMap

Defined in TestUtils/Mock/MockDataCreators.ts:8


<Let> configuration

● configuration: IConfiguration = {} as IConfiguration

Defined in Configure.ts:40


<Let> initializationComplete

● initializationComplete: boolean = false

Defined in Initialize.ts:4


<Const> initialize

● initialize: (Anonymous function) = makeInitialize(Initializers)

Defined in Initialize.ts:37

Initializers are fired once when the app boots up, providing a useful hook for initializing the application. For instance, if a third-party dependency needs some initial setup, create an initializer in the Initializers directory.

Every function exported from the Initializers directory whose name starts with "initialize" will be executed.


<Const> initializeValidateJS

● initializeValidateJS: (Anonymous function) = makeInitializeValidateJS(validateJS, Validators)

Defined in Initializers/InitializeValidateJS.ts:27

Validation initializers are pulled out of the Validation directory and executed using a standard naming convention such that they are executed if their name starts with "initialize". They are passed an instance of validate.js


<Const> mapValuesWithKeys

● mapValuesWithKeys: any = convert("mapValues", mapValues, { cap: false, })

Defined in Utils/Lodash.ts:11

By default, lodash/fp/mapValues does not return the key to the iterator. This example was lifted from their docs to make it work as expected. type: {any}

see: https://github.com/lodash/lodash/wiki/FP-Guide


<Const> mapWithKeys

● mapWithKeys: any = convert("map", map, { cap: false, })

Defined in Utils/Lodash.ts:22

By default, lodash/fp/map does not return the key to the iterator. This example was lifted from their docs to make it work as expected. type: {any}

see: https://github.com/lodash/lodash/wiki/FP-Guide


<Let> serviceMap

● serviceMap: IServiceMap

Defined in Services/ServiceProvider.ts:21


Functions

<Const> addPenultimateFieldToPath

addPenultimateFieldToPath(path: string, field: any): string[]

Defined in Utils/String.ts:24

Given a path string in dot notation compatible with lodash's get and set functions, will return the path as an array of strings with the given field as the second to last item.

Parameters:

Name Type Description
path string -
field any -

Returns: string[]


attr

attr(fieldType: IFieldType, options?: IFieldOptions): IDecorator<IAttrs>

Defined in Model/Decorators/Attr.ts:24

A decorator which maps a property's getter and setter to getField and setField methods implemented on the target class.

Parameters:

Name Type Default value Description
fieldType IFieldType - -
Default value options IFieldOptions {} -

Returns: IDecorator<IAttrs>


belongsTo

belongsTo(options?: IRelationshipOptions): IDecorator<IRelationship>

Defined in Model/Decorators/BelongsTo.ts:14

A decorator which creates a "BelongsTo" relationship, for establishing a one-to-many or one-to-one relationship to the related service, such that this service has one of the related service. The relatedFieldName is the FK field on this model, for identifying the ID of the related model.

If no serviceName is provided, the property being decorated will be used. If no relatedFieldName is provided, the serviceName will be used with the suffix "Id". eg: "organizationId"

Parameters:

Name Type Default value Description
Default value options IRelationshipOptions {} -

Returns: IDecorator<IRelationship>


configure

configure(config: IConfiguration, configureStore?: IConfigureStore): Store<any>

Defined in Configure.ts:46

Parameters:

Name Type Default value
config IConfiguration -
Default value configureStore IConfigureStore defaultConfigureStore

Returns: Store<any>


<Const> configureStore

configureStore(reducers: IReducers<any>, epics: IActionEpic[]): Store<Object, AnyAction> & object

Defined in Store/ConfigureStore.ts:12

Parameters:

Name Type
reducers IReducers<any>
epics IActionEpic[]

Returns: Store<Object, AnyAction> & object


<Const> createEnumField

createEnumField(fieldEnum: any): IFieldType<any> & object

Defined in Model/FieldType/EnumField.ts:4

Parameters:

Name Type
fieldEnum any

Returns: IFieldType<any> & object


createMockFakeModel

createMockFakeModel(overrideValues?: Partial<IFakeModelData>): FakeModel

Defined in Model/Model.mock.ts:44

Parameters:

Name Type
Optional overrideValues Partial<IFakeModelData>

Returns: FakeModel


createMockFakeModelArray

createMockFakeModelArray(numItems?: number): IFakeModelData[]

Defined in Model/Model.mock.ts:59

Generates an array of items using fake data

Parameters:

Name Type Default value Description
Default value numItems number 10 -

Returns: IFakeModelData[]


createMockFakeModelData

createMockFakeModelData(id?: string): IFakeModelData

Defined in Model/Model.mock.ts:35

Generates a single item using fake data

Parameters:

Name Type Description
Optional id string -

Returns: IFakeModelData


createMockFakeModels

createMockFakeModels(numItems?: number): FakeModel[]

Defined in Model/Model.mock.ts:69

Parameters:

Name Type Default value
Default value numItems number 10

Returns: FakeModel[]


createMockQueryResponse

createMockQueryResponse(overrideValues?: Partial<IQueryResponse>): IQueryResponse

Defined in Query/IQueryCache.mock.ts:6

Creates a mock IQueryResponse object

Parameters:

Name Type
Optional overrideValues Partial<IQueryResponse>

Returns: IQueryResponse


createMockServiceState

createMockServiceState<T>(service: IService<T>, actions?: IAction[]): object

Defined in TestUtils/Mock/CreateMockServiceState.ts:12

Creates a mock state object for the given service to plug it into a mock Redux store see: redux-test-utils/createMockStore

Type parameters:

T

Parameters:

Name Type Default value Description
service IService<T> - -
Default value actions IAction[] [] -

Returns: object any


<Const> createRecordEpic

createRecordEpic(__namedParameters: object): any

Defined in Services/DataService/Epics/CreateRecordEpic.ts:18

Parameters:

__namedParameters: object

Name Type
actions IActionCreators
adapter IAdapter<any>
mapper IMapper<any, any>
name string
serializer ISerializer<any, any>
types IActionTypes

Returns: any


fetchAllReducer

fetchAllReducer<T>(state: IDataServiceStateRecord<T>, action: FetchAllAction): Record<IDataServiceState<T>> & object

Defined in Services/DataService/Reducers/FetchAllReducer.ts:10

Sets isLoading = true on the cached request associated to the given IQueryBuilder in the action's payload if it appears we will perform the request.

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action FetchAllAction

Returns: Record<IDataServiceState<T>> & object


field

field(fieldType: IFieldType, options?: * IFieldOptions & any*): IDecorator<IFieldTypes>

Defined in Model/Decorators/Field.ts:30

A decorator which marks the FieldType for the property and sets up default validation rules.

Note: Chances are you should use the @attr, @belongsTo or @hasMany decorators instead, each of which wrap this decorator.

Parameters:

Name Type Default value Description
fieldType IFieldType - -
Default value options IFieldOptions & any {} -

Returns: IDecorator<IFieldTypes>


<Const> flattenObjectKeys

flattenObjectKeys(obj: any): any

Defined in Utils/Lodash.ts:39

Flattens the keys of an object's immediate children onto a copy of the parent object.

For example:

Given input: { a: { b: 123, c: 456 }, name: "Jessica" }, This will output: { "a.b": 123, "a.c": 456, name: "Jessica" }.

Note that this function will intentionally go only one level deep.

Parameters:

Name Type Description
obj any -

Returns: any


getConfiguration

getConfiguration(): IConfiguration

Defined in Configure.ts:42

Returns: IConfiguration


getDataService

getDataService<T>(name: string): DataService<T>

Defined in Services/ServiceProvider.ts:44

Get the requested DataService using getService.

Type parameters:

Parameters:

Name Type Description
name string -

Returns: DataService<T>


<Const> getDateTimeFormat

getDateTimeFormat(options: any): any

Defined in Validators/DateTime.ts:3

Parameters:

Name Type
options any

Returns: any


getEpics

getEpics(): IActionEpic[]

Defined in Services/ServiceProvider.ts:110

Creates the root epic which will be added to the redux-observable epic middleware

Note: This method is called on startup. You should not need to call it directly except for testing purposes.

Returns: IActionEpic[]


getFakeXHR

getFakeXHR(): any

Defined in TestUtils/StubXhr.ts:15

Returns: any


getFakedXHRHistory

getFakedXHRHistory(): any[]

Defined in TestUtils/StubXhr.ts:19

Returns: any[]


<Const> getFieldTypeForRelationship

getFieldTypeForRelationship(relationshipType: RelationshipType): IFieldType<any>

Defined in Model/Decorators/Relationship.ts:60

Get the corresponding FieldType object for the given RelationshipType.

Parameters:

Name Type Description
relationshipType RelationshipType -

Returns: IFieldType<any>


getModelDataCreatorMap

getModelDataCreatorMap(): IModelDataCreatorMap

Defined in TestUtils/Mock/MockDataCreators.ts:22

Returns: IModelDataCreatorMap


<Const> getNestedFieldName

getNestedFieldName(path: any): any

Defined in Utils/String.ts:11

Given a path string in dot notation compatible with lodash's get and set functions, this will return the nested value.

For example, given path "a.b.c", this will return "c".

Parameters:

Name Type Description
path any -

Returns: any


getReducers

getReducers(): IReducers<any>

Defined in Services/ServiceProvider.ts:101

Creates the root reducer to be added to the Redux store. Note: This method is called on startup. You should not need to call it directly except for testing purposes.

Returns: IReducers<any>


<Const> getRelatedFieldNameForRelationship

getRelatedFieldNameForRelationship(relationshipType: RelationshipType, baseName: string): string

Defined in Model/Decorators/Relationship.ts:81

Determine the property name of the related field depending on the relationship.

BelongsTo will add the suffix "Id" to the given baseName HasMany will add the suffix "Ids" to the given baseName

Parameters:

Name Type Description
relationshipType RelationshipType -
baseName string -

Returns: string


getService

getService<T>(name: any): IService<T>

Defined in Services/ServiceProvider.ts:30

Behaves as a dependency injection service to facilitate injecting service instances based on their name and module. This is useful for testing so services can be replaced with mocks.

Type parameters:

T

Parameters:

Name Type Description
name any -

Returns: IService<T>


hasMany

hasMany(options?: IRelationshipOptions): IDecorator<IRelationship>

Defined in Model/Decorators/HasMany.ts:14

A decorator which creates a "HasMany" relationship, for establishing a many-to-one or many-to-many relationship to the related service, such that this service has many of the related service. The relatedFieldName is the FK field on this model, for identifying the IDs of the related models.

If no serviceName is provided, the property being decorated will be used. If no relatedFieldName is provided, the serviceName will be used with the suffix "Ids". eg: "studentIds"

Parameters:

Name Type Default value Description
Default value options IRelationshipOptions {} -

Returns: IDecorator<IRelationship>


<Const> initializeDateTimeValidator

initializeDateTimeValidator(validate: any): any

Defined in Validators/DateTime.ts:19

Parameters:

Name Type
validate any

Returns: any


initializeMockDataCreators

initializeMockDataCreators(modules: any): void

Defined in TestUtils/Mock/MockDataCreators.ts:11

Build a modelDataCreatorMap for later use in the seedService* functions

Parameters:

Name Type
modules any

Returns: void


<Const> initializePhoneNumberValidator

initializePhoneNumberValidator(validate: any): (Anonymous function)

Defined in Validators/PhoneNumber.ts:1

Parameters:

Name Type
validate any

Returns: (Anonymous function)


initializeServices

initializeServices(modules: IModuleMap): void

Defined in Services/ServiceProvider.ts:62

Initialize the map of services to enable dependency injection.

We assume each module exports a class which follows the naming convention: "Service" For example: the "country" module should export a CountryService

Note: This is called when the application boots up, pulling in the map from the "fakeModelModule" directory to automagically register all fakeModelModule. Eventually, it would be nice to register services as they are requested and dynamically update the redux store as they are needed. This would be especially ideal for code splitting.

You should not need to call this method directly unless it is needed for testing.

Parameters:

Name Type Description
modules IModuleMap

Returns: void


initializeTestServices

initializeTestServices(modules?: IModuleMap, configOptions?: Partial<IConfiguration>): Store<any>

Defined in TestUtils/InitializeTestServices.ts:17

Registers the services, short circuits their XHR epics and returns a Redux store. Will use a MemoryAdapter and MemorySerializer by default.

Parameters:

Name Type Default value
Default value modules IModuleMap {}
Default value configOptions Partial<IConfiguration> {}

Returns: Store<any>


<Const> isApplicationInitialized

isApplicationInitialized(): boolean

Defined in Initialize.ts:11

Determine if the application's initializers have been fired yet.

Returns: boolean


isEnum

isEnum(fieldEnum: any, options?: IIsEnumOptions): IDecorator<IFieldTypes>

Defined in Model/Decorators/IsEnum.ts:17

A decorator which maps a property's getter and setter to getField and setField methods implemented on the target class.

Parameters:

Name Type Default value Description
fieldEnum any - -
Default value options IIsEnumOptions {} -

Returns: IDecorator<IFieldTypes>


loggerMiddleware

loggerMiddleware(): (Anonymous function)

Defined in Store/Middleware/Logger.ts:1

Returns: (Anonymous function)


<Const> makeInitialize

makeInitialize(initializers: any): (Anonymous function)

Defined in Initialize.ts:20

Parameters:

Name Type
initializers any

Returns: (Anonymous function)


<Const> makeInitializeValidateJS

makeInitializeValidateJS(validate: validateJS.ValidateJS, validators: IValidatorMap): (Anonymous function)

Defined in Initializers/InitializeValidateJS.ts:14

Parameters:

Name Type
validate validateJS.ValidateJS
validators IValidatorMap

Returns: (Anonymous function)


pushAllReducer

pushAllReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<IPushAll<T>>): IDataServiceStateRecord<T>

Defined in Services/DataService/Reducers/PushAllReducer.ts:10

Adds/Updates the given array of IModel instances onto the store

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<IPushAll<T>>

Returns: IDataServiceStateRecord<T>


pushRecordReducer

pushRecordReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<IModel<T>>): Record<IDataServiceState<T>> & object

Defined in Services/DataService/Reducers/PushRecordReducer.ts:6

Adds/Updates the given IModel instance to the store

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<IModel<T>>

Returns: Record<IDataServiceState<T>> & object


registerService

registerService(service: IService<any>): void

Defined in Services/ServiceProvider.ts:92

Enables service dependency injection by registering services so they can later be retrieved (injected) as needed.

Note: Until we can support dynamically updating the redux store, you should not need to call this method except as a convenience for testing purposes.

Parameters:

Name Type Description
service IService<any>

Returns: void


relationship

relationship(relationshipType: RelationshipType, options?: IRelationshipOptions): IDecorator<IRelationship>

Defined in Model/Decorators/Relationship.ts:103

A decorator which establishes that the decorated property is related to the given serviceName through the given relatedFieldName. You probably want to use @belongsTo or @hasMany decorators, which wrap this one.

If no serviceName is provided, the name of the property being decorated will be used. If no relatedFieldName is provided, the name of the property being decorated will be used with the suffix "Id" or "Ids" depending on the relationship.

Parameters:

Name Type Default value Description
relationshipType RelationshipType - -
Default value options IRelationshipOptions {} -

Returns: IDecorator<IRelationship>


required

required(message?: string, allowEmpty?: boolean): IDecorator<IValidate>

Defined in Model/Decorators/Required.ts:11

Decorator to conveniently set a "required" validation rule.

Parameters:

Name Type Default value Description
Default value message string "is required" -
Default value allowEmpty boolean false -

Returns: IDecorator<IValidate>


<Const> resetInitializationStatus

resetInitializationStatus(): boolean

Defined in Initialize.ts:18

Reset the application's initialization status.

Returns: boolean


seedService

seedService<T>(serviceName: string, overrideValues?: Partial<T>): IModel<T>

Defined in TestUtils/Seed/SeedService.ts:11

Adds seed data to the redux store for a single specific service

Type parameters:

Parameters:

Name Type Default value Description
serviceName string - service to seed
Default value overrideValues Partial<T> {} values to override in seed

Returns: IModel<T>


seedServiceList

seedServiceList<T>(serviceName: string, count?: number, overrideValues?: Partial<T>, options?: Partial< object & IQueryResponse>): IModel<T>[]

Defined in TestUtils/Seed/SeedServiceList.ts:20

Adds the given number of seeds to the redux store for a single specified service. If overrideValues are provided, they will be passed to each item.

The given options param may be used to set the query params or the shape of the response envelope. If options.queryParams are not given, the overrideValues will be used by default.

Type parameters:

Parameters:

Name Type Default value
serviceName string -
Default value count number 5
Default value overrideValues Partial<T> {}
Default value options Partial< object & IQueryResponse> {}

Returns: IModel<T>[]


seedServices

seedServices(serviceNames?: string[]): __type

Defined in TestUtils/Seed/SeedServices.ts:9

Add multiple seeds for each of the initialized services

Parameters:

Name Type Description
Optional serviceNames string[] services to seed, defaults to all services initialized in initializeTestServices()

Returns: __type


setFieldReducer

setFieldReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<ISetField<T>>): Record<IDataServiceState<T>> & object

Defined in Services/DataService/Reducers/SetFieldReducer.ts:7

Sets the field on the item associated to the given id

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<ISetField<T>>

Returns: Record<IDataServiceState<T>> & object


setMetaFieldReducer

setMetaFieldReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<ISetMetaField<T>>): Record<IDataServiceState<T>> & object

Defined in Services/DataService/Reducers/SetMetaFieldReducer.ts:13

Sets the given meta field for the IModel instance associated to the given id

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<ISetMetaField<T>>

Returns: Record<IDataServiceState<T>> & object


setQueryResponseReducer

setQueryResponseReducer(state: IDataServiceStateRecord<any>, action: IAction<IQueryCache>): Record<IDataServiceState<any>> & object

Defined in Services/DataService/Reducers/SetQueryResponseReducer.ts:6

Sets the given IQueryCache to the requestCache, using its query.getHashCode() as a key

Parameters:

Name Type
state IDataServiceStateRecord<any>
action IAction<IQueryCache>

Returns: Record<IDataServiceState<any>> & object


setRelationshipReducer

setRelationshipReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<ISetField<T>>): Record<IDataServiceState<T>> & object

Defined in Services/DataService/Reducers/SetRelationshipReducer.ts:7

Sets the given relationship onto the IModel associated to the given id

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<ISetField<T>>

Returns: Record<IDataServiceState<T>> & object


setTimeoutPromise

setTimeoutPromise<T>(callback: function, delay?: number): Promise<T>

Defined in Utils/SetTimeoutPromise.ts:8

Calls setTimeout with the given callback function for the given delay in milliseconds and returns a promise.

The promise will resolve with the value returned from the callback if it succeeds; it will reject with an Error if one is thrown.

Type parameters:

T

Parameters:

Name Type Default value
callback function -
Default value delay number 0

Returns: Promise<T>


shouldFetchAll

shouldFetchAll(state: IDataServiceStateRecord<any>, action: FetchAllAction): boolean

Defined in Services/DataService/ShouldFetchAll.ts:13

Determines if the given FetchAllAction should fire based on whether or not we already have an existing request cache associated to the action's query params.

Parameters:

Name Type
state IDataServiceStateRecord<any>
action FetchAllAction

Returns: boolean


shouldFetchItem

shouldFetchItem(state: IDataServiceStateRecord<any>, action: FetchItemAction): boolean

Defined in Services/DataService/ShouldFetchItem.ts:11

Determines if the given FetchItemAction should fire based on whether or not we already have the requested item based on its id, or if we should force reload it.

Parameters:

Name Type
state IDataServiceStateRecord<any>
action FetchItemAction

Returns: boolean


stubXHR

stubXHR(): void

Defined in TestUtils/StubXhr.ts:7

Stub all XHR requests via Sinon

Returns: void


unloadAllReducer

unloadAllReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<null>): Record<IDataServiceState<any>> & object

Defined in Services/DataService/Reducers/UnloadAllReducer.ts:6

Disconnects all IModel instances from the store and returns a new copy of the store

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<null>

Returns: Record<IDataServiceState<any>> & object


unloadRecordReducer

unloadRecordReducer<T>(state: IDataServiceStateRecord<T>, action: IAction<IModelId>): Record<IDataServiceState<T>> & object

Defined in Services/DataService/Reducers/UnloadRecordReducer.ts:7

Disconnects the IModel associated to the given id and removes it from the store

Type parameters:

Parameters:

Name Type
state IDataServiceStateRecord<T>
action IAction<IModelId>

Returns: Record<IDataServiceState<T>> & object


validation

validation(validationRules: any): IDecorator<IValidate>

Defined in Model/Decorators/Validation.ts:18

A property decorator for specifying validation rules.

We currently use Validate.js, but this should work with any rules-based validation engine.

Parameters:

Name Type Description
validationRules any -

Returns: IDecorator<IValidate>


Object literals

<Const> ArrayField

ArrayField: object

Defined in Model/FieldType/ArrayField.ts:4

defaultValue

● defaultValue: undefined[] = []

Defined in Model/FieldType/ArrayField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/ArrayField.ts:5


type

● type: string = "array"

Defined in Model/FieldType/ArrayField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/ArrayField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<any>

Defined in Model/FieldType/ArrayField.ts:10

Parameters:

Name Type
value any

Returns: Promise<any>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/ArrayField.ts:6

type

● type: string = "array"

Defined in Model/FieldType/ArrayField.ts:6




<Const> BelongsToField

BelongsToField: object

Defined in Model/FieldType/BelongsToField.ts:4

serialize

● serialize: false = false

Defined in Model/FieldType/BelongsToField.ts:6


type

● type: string = "belongsTo"

Defined in Model/FieldType/BelongsToField.ts:7



<Const> BooleanField

BooleanField: object

Defined in Model/FieldType/BooleanField.ts:4

defaultValue

● defaultValue: false = false

Defined in Model/FieldType/BooleanField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/BooleanField.ts:5


type

● type: string = "boolean"

Defined in Model/FieldType/BooleanField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/BooleanField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<boolean>

Defined in Model/FieldType/BooleanField.ts:10

Parameters:

Name Type
value any

Returns: Promise<boolean>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/BooleanField.ts:6

type

● type: string = "boolean"

Defined in Model/FieldType/BooleanField.ts:6




<Const> DateField

DateField: object

Defined in Model/FieldType/DateField.ts:5

defaultValue

● defaultValue: null = null

Defined in Model/FieldType/DateField.ts:8


serialize

● serialize: true = true

Defined in Model/FieldType/DateField.ts:6


type

● type: string = "date"

Defined in Model/FieldType/DateField.ts:19


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/DateField.ts:9

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: * string | any*): Promise<Date>

Defined in Model/FieldType/DateField.ts:11

Parameters:

Name Type
value string | any

Returns: Promise<Date>


transform

transform(date: Date): Promise<string>

Defined in Model/FieldType/DateField.ts:10

Parameters:

Name Type
date Date

Returns: Promise<string>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/DateField.ts:7

datetime

datetime: object

Defined in Model/FieldType/DateField.ts:7

dateOnly

● dateOnly: boolean = true

Defined in Model/FieldType/DateField.ts:7





<Const> DateTimeField

DateTimeField: object

Defined in Model/FieldType/DateTimeField.ts:4

defaultValue

● defaultValue: null = null

Defined in Model/FieldType/DateTimeField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/DateTimeField.ts:5


type

● type: string = "dateTime"

Defined in Model/FieldType/DateTimeField.ts:18


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/DateTimeField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: * string | any*): Promise<Date>

Defined in Model/FieldType/DateTimeField.ts:10

Parameters:

Name Type
value string | any

Returns: Promise<Date>


transform

transform(date: Date): Promise<string>

Defined in Model/FieldType/DateTimeField.ts:9

Parameters:

Name Type
date Date

Returns: Promise<string>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/DateTimeField.ts:6

datetime

● datetime: boolean = true

Defined in Model/FieldType/DateTimeField.ts:6




<Const> EmailField

EmailField: object

Defined in Model/FieldType/EmailField.ts:4

type

● type: string = "email"

Defined in Model/FieldType/EmailField.ts:7


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/EmailField.ts:6

email

● email: boolean = true

Defined in Model/FieldType/EmailField.ts:6




<Const> FileField

FileField: object

Defined in Model/FieldType/FileField.ts:3

defaultValidationRules

● defaultValidationRules: object

Defined in Model/FieldType/FileField.ts:5

Type declaration


defaultValue

● defaultValue: null = null

Defined in Model/FieldType/FileField.ts:6


serialize

● serialize: true = true

Defined in Model/FieldType/FileField.ts:4


type

● type: string = "file"

Defined in Model/FieldType/FileField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/FileField.ts:7

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): any

Defined in Model/FieldType/FileField.ts:8

Parameters:

Name Type
value any

Returns: any


transform

transform(file: File): Promise<any[]>

Defined in Model/FieldType/FileField.ts:10

Parameters:

Name Type
file File

Returns: Promise<any[]>



<Const> HasManyField

HasManyField: object

Defined in Model/FieldType/HasManyField.ts:4

serialize

● serialize: false = false

Defined in Model/FieldType/HasManyField.ts:6


type

● type: string = "hasMany"

Defined in Model/FieldType/HasManyField.ts:7



<Const> NumberField

NumberField: object

Defined in Model/FieldType/NumberField.ts:4

defaultValue

● defaultValue: number = 0

Defined in Model/FieldType/NumberField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/NumberField.ts:5


type

● type: string = "number"

Defined in Model/FieldType/NumberField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/NumberField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<number>

Defined in Model/FieldType/NumberField.ts:10

Parameters:

Name Type
value any

Returns: Promise<number>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/NumberField.ts:6

numericality

● numericality: boolean = true

Defined in Model/FieldType/NumberField.ts:6




<Const> ObjectField

ObjectField: object

Defined in Model/FieldType/ObjectField.ts:4

defaultValue

● defaultValue: null = null

Defined in Model/FieldType/ObjectField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/ObjectField.ts:5


type

● type: string = "object"

Defined in Model/FieldType/ObjectField.ts:8


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/ObjectField.ts:9

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<any>

Defined in Model/FieldType/ObjectField.ts:10

Parameters:

Name Type
value any

Returns: Promise<any>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/ObjectField.ts:6

type

● type: string = "object"

Defined in Model/FieldType/ObjectField.ts:6




<Const> PhoneNumberField

PhoneNumberField: object

Defined in Model/FieldType/PhoneNumberField.ts:4

defaultValue

● defaultValue: string = ""

Defined in Model/FieldType/PhoneNumberField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/PhoneNumberField.ts:5


type

● type: string = "phoneNumber"

Defined in Model/FieldType/PhoneNumberField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/PhoneNumberField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<string>

Defined in Model/FieldType/PhoneNumberField.ts:10

Parameters:

Name Type
value any

Returns: Promise<string>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/PhoneNumberField.ts:6

phoneNumber

● phoneNumber: boolean = true

Defined in Model/FieldType/PhoneNumberField.ts:6




<Const> StringField

StringField: object

Defined in Model/FieldType/StringField.ts:4

defaultValue

● defaultValue: string = ""

Defined in Model/FieldType/StringField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/StringField.ts:5


type

● type: string = "string"

Defined in Model/FieldType/StringField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/StringField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<string>

Defined in Model/FieldType/StringField.ts:10

Parameters:

Name Type
value any

Returns: Promise<string>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/StringField.ts:6

type

● type: string = "string"

Defined in Model/FieldType/StringField.ts:6




<Const> TimeField

TimeField: object

Defined in Model/FieldType/TimeField.ts:5

defaultValue

● defaultValue: null = null

Defined in Model/FieldType/TimeField.ts:8


serialize

● serialize: true = true

Defined in Model/FieldType/TimeField.ts:6


type

● type: string = "time"

Defined in Model/FieldType/TimeField.ts:16


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/TimeField.ts:9

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(serializedDate: string): Promise<Date>

Defined in Model/FieldType/TimeField.ts:11

Parameters:

Name Type
serializedDate string

Returns: Promise<Date>


transform

transform(date: Date): Promise<string>

Defined in Model/FieldType/TimeField.ts:10

Parameters:

Name Type
date Date

Returns: Promise<string>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/TimeField.ts:7

datetime

datetime: object

Defined in Model/FieldType/TimeField.ts:7

message

● message: string = "must be a valid time"

Defined in Model/FieldType/TimeField.ts:7


timeOnly

● timeOnly: boolean = true

Defined in Model/FieldType/TimeField.ts:7





<Const> URLField

URLField: object

Defined in Model/FieldType/URLField.ts:4

defaultValue

● defaultValue: string = ""

Defined in Model/FieldType/URLField.ts:7


serialize

● serialize: true = true

Defined in Model/FieldType/URLField.ts:5


type

● type: string = "URL"

Defined in Model/FieldType/URLField.ts:9


isValidType

isValidType(value: any): boolean

Defined in Model/FieldType/URLField.ts:8

Parameters:

Name Type
value any

Returns: boolean


normalize

normalize(value: any): Promise<string>

Defined in Model/FieldType/URLField.ts:10

Parameters:

Name Type
value any

Returns: Promise<string>


defaultValidationRules

defaultValidationRules: object

Defined in Model/FieldType/URLField.ts:6

url

url: object

Defined in Model/FieldType/URLField.ts:6

allowLocal

● allowLocal: boolean = true

Defined in Model/FieldType/URLField.ts:6





<Const> defaultConfiguration

defaultConfiguration: object

Defined in Configure.ts:31

adapter

● adapter: RestAdapter = RestAdapter

Defined in Configure.ts:32


coalesceBufferTime

● coalesceBufferTime: number = DEFAULT_COALESCE_BUFFER_TIME

Defined in Configure.ts:37


coalesceFindRequests

● coalesceFindRequests: false = false

Defined in Configure.ts:36


mapper

● mapper: Mapper = Mapper

Defined in Configure.ts:34


preferPatchOverPut

● preferPatchOverPut: false = false

Defined in Configure.ts:35


serializer

● serializer: RestSerializer = RestSerializer

Defined in Configure.ts:33



<Const> fakeModelModule

fakeModelModule: object

Defined in TestUtils/FakeModelModule.ts:4

fakeModel

fakeModel: object

Defined in TestUtils/FakeModelModule.ts:5

FakeModel

● FakeModel: FakeModel

Defined in TestUtils/FakeModelModule.ts:6


FakeModelService

● FakeModelService: FakeModelService

Defined in TestUtils/FakeModelModule.ts:7


createMockFakeModel

● createMockFakeModel: createMockFakeModel

Defined in TestUtils/FakeModelModule.ts:8