@sap-ux/odata-service-writer 0.23.0 → 0.23.2

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.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Editor } from 'mem-fs-editor';
2
- import { OdataService, OdataVersion, ServiceType, CdsAnnotationsInfo, EdmxAnnotationsInfo } from './types';
2
+ import { getAnnotationNamespaces } from './data';
3
+ import { OdataService, OdataVersion, ServiceType, CdsAnnotationsInfo, EdmxAnnotationsInfo, NamespaceAlias } from './types';
3
4
  /**
4
5
  * Try finding a package.json and a ui5.yaml for the given project by looking upwards in the folder hierachy.
5
6
  *
@@ -22,4 +23,5 @@ export declare function findProjectFiles(basePath: string, fs: Editor): Promise<
22
23
  */
23
24
  declare function generate(basePath: string, service: OdataService, fs?: Editor): Promise<Editor>;
24
25
  export { generate, OdataVersion, OdataService, ServiceType, EdmxAnnotationsInfo, CdsAnnotationsInfo };
26
+ export { getAnnotationNamespaces, NamespaceAlias };
25
27
  //# sourceMappingURL=index.d.ts.map
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.getAnnotationNamespaces = 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");
@@ -11,6 +13,7 @@ const updates_1 = require("./updates");
11
13
  const ui5_config_1 = require("@sap-ux/ui5-config");
12
14
  const prettify_xml_1 = __importDefault(require("prettify-xml"));
13
15
  const data_1 = require("./data");
16
+ Object.defineProperty(exports, "getAnnotationNamespaces", { enumerable: true, get: function () { return data_1.getAnnotationNamespaces; } });
14
17
  const i18n_1 = require("./i18n");
15
18
  const types_1 = require("./types");
16
19
  Object.defineProperty(exports, "OdataVersion", { enumerable: true, get: function () { return types_1.OdataVersion; } });
@@ -53,7 +56,6 @@ async function findProjectFiles(basePath, fs) {
53
56
  }
54
57
  return files;
55
58
  }
56
- exports.findProjectFiles = findProjectFiles;
57
59
  /**
58
60
  * Writes the odata service related file updates to an existing UI5 project specified by the base path.
59
61
  *
@@ -150,5 +152,4 @@ async function generate(basePath, service, fs) {
150
152
  }
151
153
  return fs;
152
154
  }
153
- exports.generate = generate;
154
155
  //# sourceMappingURL=index.js.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.23.0",
12
+ "version": "0.23.2",
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.5",
31
- "@sap-ux/ui5-config": "0.25.0"
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.4"
41
+ "@sap-ux/project-access": "1.28.6"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=18.x"