@seidor-cloud-produtos/orbit-backend-lib 0.0.58 → 0.0.60

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.
@@ -12,14 +12,22 @@ class MappingModel {
12
12
  for (const key in params.header) {
13
13
  if (
14
14
  this.getHeaders()[key] === undefined ||
15
- (key?.toUpperCase && key.toUpperCase() === 'ACCEPT')
15
+ (key?.toUpperCase &&
16
+ ['ACCEPT-ENCODING', 'ACCEPT'].includes(key.toUpperCase()))
16
17
  ) {
17
18
  this.setHeader(key, params.header[key]);
18
19
  }
19
20
  }
20
21
  for (const key in params.querystring) {
21
22
  if (this.getQuery()[key] === undefined) {
22
- this.setQuery(key, params.querystring[key]);
23
+ if (key.endsWith('[]')) {
24
+ this.setQuery(
25
+ key.substring(0, key.length - 2),
26
+ params.querystring[key].split(','),
27
+ );
28
+ } else {
29
+ this.setQuery(key, params.querystring[key]);
30
+ }
23
31
  }
24
32
  }
25
33
  for (const key in params.path) {
@@ -76,6 +76,7 @@ describe('MappingModel', () => {
76
76
  query_string_name_1: 'query_string_value_1',
77
77
  query_string_name_2: 'query_string_value_2',
78
78
  query_string_name_3: 'query_string_value_3',
79
+ ['test[]']: 'id1,id2',
79
80
  },
80
81
  path: {
81
82
  path_name_1: 'path_value_1',
@@ -118,6 +119,7 @@ describe('MappingModel', () => {
118
119
  expect(instance['setQuery'].mock.calls).toStrictEqual([
119
120
  ['query_string_name_1', 'query_string_value_1'],
120
121
  ['query_string_name_3', 'query_string_value_3'],
122
+ ['test', ['id1', 'id2']],
121
123
  ]);
122
124
  expect(instance['setPathParams'].mock.calls).toStrictEqual([
123
125
  ['path_name_1', 'path_value_1'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",