1.0.9 • Published 3 years ago

@spring-global/spring-odata-request-builder v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Spring oData request builder

OData Request builder

Installation

npm install @spring-global/spring-odata-request-builder

Usage

Get

oDataRequestBuilder.get(userRequestContext: IUserRequestContext,columns: string[], parameters?: IODataFilter | IODataFilter[], orderBy?: SortedField): Promise

  • userRequestContext: user request information
  • columns: the select columns
  • parameters: the select filters
  • orderBy: the select order by

Post

oDataRequestBuilder.post(userRequestContext: IUserRequestContext, object: Object): Promise;

  • userRequestContext: user request information
  • object: the object to insert

Put

oDataRequestBuilder.put(userRequestContext: IUserRequestContext, object: Object): Promise;

  • userRequestContext: user request information
  • object: the object to update

Delete

oDataRequestBuilder.del(userRequestContext: IUserRequestContext, id: string): Promise

  • userRequestContext: user request information
  • id: the id to delete

Types

userRequestContext

  • dataServiceUrl: string; -- Url of data service
  • tableName?: string; -- Table Name
  • loggedUser?: string; -- The logged user
  • scopeTenant?: string; -- The tenant identifier
  • scopeUser?: string; -- Scoped User. Used in data isolation
  • scopeRegion?: string; -- Scoped Region. Used in data isolation

IODataFilter

  • field: string; -- the filter field
  • value: string; -- the filter value
  • compareOperation?: Operator; -- filter operation
  • logicalOperation?: FilterLogicalConnector; -- filter logical connector

Operator

Valid filters operation: "and" | "or" | "eq" | "ne" | "gt" | "ge" | "lt" | "le" | "search.in" | "substringof"

FilterLogicalConnector

Valid logical connectors: 'and' | 'or'

SortedField

  • field: string; -- the order field
  • order?: "ASC" | "DESC"; -- the order. ASC is the default value.
1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago