@sap-ux/odata-service-writer 0.22.5 → 0.23.1

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,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAnnotationNamespaces = void 0;
3
+ exports.getAnnotationNamespaces = getAnnotationNamespaces;
4
4
  const fast_xml_parser_1 = require("fast-xml-parser");
5
5
  const i18n_1 = require("../i18n");
6
6
  /**
@@ -31,7 +31,6 @@ function getAnnotationNamespaces({ metadata, annotations }) {
31
31
  }
32
32
  return schemaNamespaces;
33
33
  }
34
- exports.getAnnotationNamespaces = getAnnotationNamespaces;
35
34
  /**
36
35
  * Convert specified xml string to JSON.
37
36
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enhanceData = void 0;
3
+ exports.enhanceData = enhanceData;
4
4
  const types_1 = require("../types");
5
5
  const constants_1 = require("./constants");
6
6
  /**
@@ -79,5 +79,4 @@ function enhanceData(service) {
79
79
  }
80
80
  }
81
81
  }
82
- exports.enhanceData = enhanceData;
83
82
  //# sourceMappingURL=defaults.js.map
package/dist/i18n.js CHANGED
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.t = exports.initI18n = void 0;
6
+ exports.initI18n = initI18n;
7
+ exports.t = t;
7
8
  const i18next_1 = __importDefault(require("i18next"));
8
9
  const odata_service_writer_i18n_json_1 = __importDefault(require("./translations/odata-service-writer.i18n.json"));
9
10
  const NS = 'odata-service-writer';
@@ -23,7 +24,6 @@ async function initI18n() {
23
24
  ns: [NS]
24
25
  });
25
26
  }
26
- exports.initI18n = initI18n;
27
27
  /**
28
28
  * Helper function facading the call call to i18next.
29
29
  *
@@ -34,7 +34,6 @@ exports.initI18n = initI18n;
34
34
  function t(key, options) {
35
35
  return i18next_1.default.t(key, options);
36
36
  }
37
- exports.t = t;
38
37
  initI18n().catch(() => {
39
38
  // Ignore any errors since the write will still work
40
39
  });
package/dist/index.js CHANGED
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ServiceType = exports.OdataVersion = exports.generate = exports.findProjectFiles = void 0;
6
+ exports.ServiceType = exports.OdataVersion = void 0;
7
+ exports.findProjectFiles = findProjectFiles;
8
+ exports.generate = generate;
7
9
  const path_1 = require("path");
8
10
  const mem_fs_1 = require("mem-fs");
9
11
  const mem_fs_editor_1 = require("mem-fs-editor");
@@ -53,7 +55,6 @@ async function findProjectFiles(basePath, fs) {
53
55
  }
54
56
  return files;
55
57
  }
56
- exports.findProjectFiles = findProjectFiles;
57
58
  /**
58
59
  * Writes the odata service related file updates to an existing UI5 project specified by the base path.
59
60
  *
@@ -92,7 +93,10 @@ async function generate(basePath, service, fs) {
92
93
  }
93
94
  catch (error) {
94
95
  if (error instanceof ui5_config_1.YAMLError && error.code === ui5_config_1.yamlErrorCode.nodeNotFound) {
95
- ui5Config.addFioriToolsProxydMiddleware({ backend: [service.previewSettings] });
96
+ ui5Config.addFioriToolsProxydMiddleware({
97
+ backend: [service.previewSettings],
98
+ ignoreCertError: service.ignoreCertError
99
+ });
96
100
  }
97
101
  else {
98
102
  throw error;
@@ -103,7 +107,10 @@ async function generate(basePath, service, fs) {
103
107
  ui5LocalConfigPath = (0, path_1.join)((0, path_1.dirname)(paths.ui5Yaml), 'ui5-local.yaml');
104
108
  if (fs.exists(ui5LocalConfigPath)) {
105
109
  ui5LocalConfig = await ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
106
- ui5LocalConfig.addFioriToolsProxydMiddleware({ backend: [service.previewSettings] });
110
+ ui5LocalConfig.addFioriToolsProxydMiddleware({
111
+ backend: [service.previewSettings],
112
+ ignoreCertError: service.ignoreCertError
113
+ });
107
114
  }
108
115
  }
109
116
  // Add mockserver entries
@@ -144,5 +151,4 @@ async function generate(basePath, service, fs) {
144
151
  }
145
152
  return fs;
146
153
  }
147
- exports.generate = generate;
148
154
  //# sourceMappingURL=index.js.map
package/dist/types.d.ts CHANGED
@@ -68,5 +68,9 @@ export interface OdataService {
68
68
  annotations?: EdmxAnnotationsInfo | CdsAnnotationsInfo;
69
69
  localAnnotationsName?: string;
70
70
  previewSettings?: Partial<ProxyBackend>;
71
+ /**
72
+ * Indicates whether certificate errors should be ignored.
73
+ */
74
+ ignoreCertError?: boolean;
71
75
  }
72
76
  //# sourceMappingURL=types.d.ts.map
package/dist/updates.js CHANGED
@@ -26,7 +26,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.updatePackageJson = exports.updateCdsFilesWithAnnotations = exports.writeAnnotationXmlFiles = exports.updateManifest = void 0;
29
+ exports.updateManifest = updateManifest;
30
+ exports.writeAnnotationXmlFiles = writeAnnotationXmlFiles;
31
+ exports.updateCdsFilesWithAnnotations = updateCdsFilesWithAnnotations;
32
+ exports.updatePackageJson = updatePackageJson;
30
33
  const ejs_1 = require("ejs");
31
34
  const path_1 = __importStar(require("path"));
32
35
  const i18n_1 = require("./i18n");
@@ -57,7 +60,6 @@ function updateManifest(basePath, service, fs, templateRoot) {
57
60
  // resulting in unexpected behaviour and problems when webpacking. Passing an empty options object prevents this.
58
61
  fs.extendJSON(manifestPath, JSON.parse((0, ejs_1.render)(manifestJsonExt, manifestSettings, {})));
59
62
  }
60
- exports.updateManifest = updateManifest;
61
63
  /**
62
64
  * Updates the cds index or service file with the provided annotations.
63
65
  * This function takes an Editor instance and cds annotations
@@ -99,7 +101,6 @@ function writeAnnotationXmlFiles(fs, basePath, service) {
99
101
  fs.write((0, path_1.join)(basePath, 'webapp', 'localService', `${annotations.technicalName}.xml`), (0, prettify_xml_1.default)(annotations.xml, { indent: 4 }));
100
102
  }
101
103
  }
102
- exports.writeAnnotationXmlFiles = writeAnnotationXmlFiles;
103
104
  /**
104
105
  * Updates cds files with the provided annotations.
105
106
  * This function takes cds annotations and an Editor instance,
@@ -115,7 +116,6 @@ async function updateCdsFilesWithAnnotations(annotations, fs) {
115
116
  fs.write(annotationCdsPath, annotations.cdsFileContents);
116
117
  await updateCdsIndexOrServiceFile(fs, annotations);
117
118
  }
118
- exports.updateCdsFilesWithAnnotations = updateCdsFilesWithAnnotations;
119
119
  /**
120
120
  * Determines model settings based on the UI5 version.
121
121
  *
@@ -162,5 +162,4 @@ function updatePackageJson(path, fs, addMockServer) {
162
162
  }
163
163
  fs.writeJSON(path, packageJson);
164
164
  }
165
- exports.updatePackageJson = updatePackageJson;
166
165
  //# sourceMappingURL=updates.js.map
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aodata-service-writer"
11
11
  },
12
- "version": "0.22.5",
12
+ "version": "0.23.1",
13
13
  "license": "Apache-2.0",
14
14
  "main": "dist/index.js",
15
15
  "files": [
@@ -27,8 +27,8 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "prettify-xml": "1.2.0",
29
29
  "semver": "7.5.4",
30
- "@sap-ux/mockserver-config-writer": "0.6.4",
31
- "@sap-ux/ui5-config": "0.24.1"
30
+ "@sap-ux/mockserver-config-writer": "0.6.6",
31
+ "@sap-ux/ui5-config": "0.25.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/ejs": "3.1.2",
@@ -38,7 +38,7 @@
38
38
  "@types/semver": "7.5.2",
39
39
  "fs-extra": "10.0.0",
40
40
  "lodash": "4.17.21",
41
- "@sap-ux/project-access": "1.27.1"
41
+ "@sap-ux/project-access": "1.28.5"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=18.x"