Index

json-api/src/providers.ts

JsonApi
JsonApi: Provider[]
Type : Provider[]
Default value : [ { provide: SimpleAdapter, useClass: JsonApiAdapters.Simple }, { provide: ToOneAdapter, useClass: JsonApiAdapters.ToOne }, { provide: ToManyAdapter, useClass: JsonApiAdapters.ToMany }, { provide: SimpleBuilder, useClass: JsonApiBuilders.Simple }, { provide: ToOneBuilder, useClass: JsonApiBuilders.ToOne }, { provide: ToManyBuilder, useClass: JsonApiBuilders.ToMany }, jsonApiInterceptor ]

json-api/src/interceptor.ts

jsonApiInterceptor
jsonApiInterceptor: object
Type : object
Default value : { provide: HTTP_INTERCEPTORS, useClass: HeadersInterceptor, multi: true }

core/src/utils.ts

METAKEYS
METAKEYS: object
Type : object
Default value : { FIELDS: 'orm:fields', ATTRIBUTES: 'orm:attributes', RELATIONS: 'orm:relations', MAP: 'orm:map', UPDATED: 'orm:updated', INSTANCES: 'orm:instances', NAME: 'orm:name' }

json-api/src/index.ts

SimpleAdapter
SimpleAdapter:
Default value : JsonApiAdapters.Simple
SimpleBuilder
SimpleBuilder:
Default value : JsonApiBuilders.Simple
ToManyAdapter
ToManyAdapter:
Default value : JsonApiAdapters.ToMany
ToManyBuilder
ToManyBuilder:
Default value : JsonApiBuilders.ToMany
ToOneAdapter
ToOneAdapter:
Default value : JsonApiAdapters.ToOne
ToOneBuilder
ToOneBuilder:
Default value : JsonApiBuilders.ToOne

core/src/resource.decorators.ts

ToMany
ToMany:
Default value : function <TRelated extends Resource>(RelatedResource: any, mapFrom?: string) { return (target: any, key: string) => { const ctor = target.constructor; initMetaData(ctor); Reflect.defineMetadata(METAKEYS.MAP, mapFrom, ctor, key); Reflect.getMetadata(METAKEYS.FIELDS, ctor).push(key); Reflect.getMetadata(METAKEYS.RELATIONS, ctor)[key] = new RelationConfiguration(ctor, RelatedResource, key, RelationType.ToMany); }; }

Use this field decorator to parse the corresponding field from a json response by your API and to identify the key as a To-Many relationship.

ToOne
ToOne:
Default value : function<TRelated extends Resource>(RelatedResource: any, mapFrom?: string) { return (target: any, key: string) => { const ctor = target.constructor; initMetaData(ctor); Reflect.defineMetadata(METAKEYS.MAP, mapFrom, ctor, key); Reflect.getMetadata(METAKEYS.FIELDS, ctor).push(key); Reflect.getMetadata(METAKEYS.RELATIONS, ctor)[key] = new RelationConfiguration(ctor, RelatedResource, key, RelationType.ToOne); }; }

Use this field decorator to parse the corresponding field from a json response by your API and to identify the key as a To-One relationship.

result-matching ""

    No results matching ""