1.0.0-6 • Published 3 years ago

dynamics-web-api-helper v1.0.0-6

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

Microsoft Dynamics Web API helpers

Collection of simple helpers, to makes use of webApi more simpler.

  • stringify
  • batch request

stringify

stringify converts more readable & maintainable request object to url.

webAPIHelper({
	filter: ['_value', 'eq', id],
	   orderBy: 'priority',
	   select: [
	     '_createdby_value',
	     'createdon',
	     'some_value',
	     'modifiedon',
	   ],
	   expand: [
	     {
	       name: 'some_related_table',
	       select: [
	         'answer',
	         'name',
	       ],
	     },
	     {
	       name: 'other_related_table',
	       select: ['summarytype'],
	     },
	   ],
	 });

to "?$select=_createdby_value,createdon,some_value,modifiedon&$filter= _value eq id &$orderby=priority asc&$expand=some_related_table($select=answer,name),other_related_table($select=summarytype)"

batch request

A promisified class written over $batch api with transaction support. It also parses (unstable) the result to objects for easier user. Just the actual $batch call this also support maximum of 1000 requests at a time. Please use Promise.all with multiple batch instance for more queries.

It is also wort noting that $batch supports XMLHttp tables name not the webApi one.

1.0.0-5

3 years ago

1.0.0-6

3 years ago

1.0.0-4

3 years ago

1.0.0-1

3 years ago

1.0.0-3

3 years ago

1.0.0-2

3 years ago

1.0.0-0

3 years ago