eservices-core 1.0.300 → 1.0.301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.300
2
+ * eservices-core v1.0.301
3
3
  * (c) 2022 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -3168,7 +3168,18 @@ class dataService {
3168
3168
  if (typeof fields === 'object')
3169
3169
  return add(Object.keys(fields).join(' '));
3170
3170
  }
3171
+ function appendOrder(query, order) {
3172
+ if (!order)
3173
+ return;
3174
+ if (!Object.keys(order).length)
3175
+ return;
3176
+ const orderStr = Object.entries(order)
3177
+ .map(([name, direction]) => `@${name} ${direction}`)
3178
+ .join(',');
3179
+ query.append('order', orderStr);
3180
+ }
3171
3181
  appendFieldsParam(queryUrl, options.fields);
3182
+ appendOrder(queryUrl, options.order);
3172
3183
  let result = yield Request(`/close-api/data/${entity}?${queryUrl.toString()}`, {
3173
3184
  method: 'GET',
3174
3185
  headers: {
@@ -8,6 +8,9 @@ interface ListOptions {
8
8
  fields?: string | string[] | {
9
9
  [name: string]: any;
10
10
  };
11
+ order?: {
12
+ [name: string]: string;
13
+ };
11
14
  }
12
15
  export default class dataService {
13
16
  constructor();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.300",
3
+ "version": "1.0.301",
4
4
  "description": "----",
5
5
  "author": "",
6
6
  "scripts": {