@sap-ux/axios-extension 1.21.2 → 1.21.3

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.
@@ -1,8 +1,8 @@
1
- import type { Service } from '../base/service-provider';
2
1
  import type { AxiosResponse } from 'axios';
3
2
  import { Axios } from 'axios';
4
3
  import type { Logger } from '@sap-ux/logger';
5
4
  import type { ManifestNamespace } from '@sap-ux/project-access';
5
+ import type { Service } from '../base/service-provider';
6
6
  import type { TransportConfig } from './ui5-abap-repository-service';
7
7
  export type Manifest = ManifestNamespace.SAPJSONSchemaForWebApplicationManifestFile & {
8
8
  [key: string]: unknown;
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LayeredRepositoryService = exports.AdaptationProjectType = void 0;
4
4
  const axios_1 = require("axios");
5
- const logger_1 = require("@sap-ux/logger");
6
5
  const fs_1 = require("fs");
6
+ const url_1 = require("url");
7
+ const logger_1 = require("@sap-ux/logger");
7
8
  const odata_request_error_1 = require("../base/odata-request-error");
8
9
  const message_1 = require("./message");
9
10
  /**
@@ -32,6 +33,13 @@ function getNamespaceAsString(namespace) {
32
33
  function isBuffer(input) {
33
34
  return input.BYTES_PER_ELEMENT !== undefined;
34
35
  }
36
+ /**
37
+ * Decodes url parameters.
38
+ *
39
+ * @param params An object containing the parameters to be decoded.
40
+ * @returns The decoded parameters as a string.
41
+ */
42
+ const decodeUrlParams = (params) => decodeURIComponent(params.toString());
35
43
  /**
36
44
  * Path suffix for all DTA actions.
37
45
  */
@@ -67,13 +75,13 @@ class LayeredRepositoryService extends axios_1.Axios {
67
75
  */
68
76
  async mergeAppDescriptorVariant(appDescriptorVariant, workspacePath) {
69
77
  const path = '/appdescr_variant_preview/';
70
- const params = new URLSearchParams(this.defaults?.params);
78
+ const params = new url_1.URLSearchParams(this.defaults?.params);
71
79
  if (workspacePath) {
72
80
  params.append('workspacePath', workspacePath);
73
81
  }
74
82
  try {
75
83
  const response = await this.put(path, appDescriptorVariant, {
76
- paramsSerializer: (params) => decodeURIComponent(params.toString()),
84
+ paramsSerializer: decodeUrlParams,
77
85
  params,
78
86
  headers: {
79
87
  'Content-Type': 'application/zip'
@@ -194,13 +202,16 @@ class LayeredRepositoryService extends axios_1.Axios {
194
202
  */
195
203
  async getSystemInfo(language = 'EN', cloudPackage) {
196
204
  try {
197
- const params = {
205
+ const params = new url_1.URLSearchParams({
198
206
  'sap-language': language
199
- };
207
+ });
200
208
  if (cloudPackage) {
201
- params['package'] = cloudPackage;
209
+ params.append('package', cloudPackage);
202
210
  }
203
- const response = await this.get(`${DTA_PATH_SUFFIX}system_info`, { params });
211
+ const response = await this.get(`${DTA_PATH_SUFFIX}system_info`, {
212
+ params,
213
+ paramsSerializer: decodeUrlParams
214
+ });
204
215
  this.tryLogResponse(response, 'Successful getting system info.');
205
216
  return JSON.parse(response.data);
206
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/axios-extension",
3
- "version": "1.21.2",
3
+ "version": "1.21.3",
4
4
  "description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.",
5
5
  "repository": {
6
6
  "type": "git",