@sap-ux/ui5-middleware-fe-mockserver 2.1.2 → 2.1.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.
- package/README.md +21 -17
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -40,24 +40,24 @@ In order to use the mock server, the npm module `@sap/ux-ui5-fe-mockserver-middl
|
|
|
40
40
|
|
|
41
41
|
specVersion: '2.0'
|
|
42
42
|
metadata:
|
|
43
|
-
|
|
43
|
+
name: <NAME>
|
|
44
44
|
type: application
|
|
45
45
|
server:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
customMiddleware:
|
|
47
|
+
- name: sap-fe-mockserver
|
|
48
|
+
mountPath: /
|
|
49
|
+
afterMiddleware: compression
|
|
50
|
+
configuration:
|
|
51
|
+
annotations:
|
|
52
|
+
- localPath: './webapp/localService/myServiceAnnotation.xml'
|
|
53
|
+
urlPath: '/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations*'
|
|
54
|
+
services:
|
|
55
|
+
- urlPath: '/sap/opu/odata/sap/<SERVICE_NAME>'
|
|
56
|
+
metadataPath: './webapp/localService/metadata.xml'
|
|
57
|
+
mockdataPath: './webapp/localService/data'
|
|
58
|
+
- urlPath: '/sap/opu/odata/sap/<OTHER_SERVICE_NAME>'
|
|
59
|
+
metadataPath: './webapp/localService/other_metadata.xml'
|
|
60
|
+
mockdataPath: './webapp/localService/data'
|
|
61
61
|
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -82,6 +82,10 @@ Additional option are available either per service of for all services if define
|
|
|
82
82
|
- strictKeyMode : disable the default "loose" mode for the key matching, you can try this if the mockserver returns too much data
|
|
83
83
|
- contextBasedIsolation : enable the support of "tenants", by adding /tenant-xxx at the very start of your service call you will be able to work on tenant isolated data.
|
|
84
84
|
|
|
85
|
+
You can also define static annotation file using the `annotations` entry, each annotation must provide
|
|
86
|
+
|
|
87
|
+
- urlPath : where will your annotation be accessible from
|
|
88
|
+
- localPath : local path to your annotation file
|
|
85
89
|
|
|
86
90
|
**Sample application**
|
|
87
91
|
|
|
@@ -95,4 +99,4 @@ Please assign tag: _SAP Fiori tools_
|
|
|
95
99
|
To log an issue with SAP Fiori tools, please see [Contact SAP Support](https://help.sap.com/viewer/1bb01966b27a429ebf62fa2e45354fea/Latest/en-US).
|
|
96
100
|
|
|
97
101
|
## Keywords
|
|
98
|
-
Mockserver, Middleware
|
|
102
|
+
Mockserver, Middleware
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/ui5-middleware-fe-mockserver",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "SAP Fiori tools - UI5 middleware for the Fiori elements mock server",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@sap-ux/fe-mockserver-core": "1.1.
|
|
9
|
+
"@sap-ux/fe-mockserver-core": "1.1.3"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@types/express": "4.17.13"
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
30
30
|
"test-u": "jest --ci --forceExit --detectOpenHandles --colors -u"
|
|
31
31
|
},
|
|
32
|
-
"readme": "# @sap-ux/ui5-middleware-fe-mockserver\n\n## Features\n\nThe **SAP Fiori - UI5 middleware for the Fiori elements mock server** is a middleware extension for the [UI5 Tooling](https://github.com/SAP/ui5-tooling). As an alternative to proxying OData requests to a live backend, it supports loading mock data for OData v2/v4 requests for supported Fiori elements templates. As the mock server runs locally without requiring a network connection to a backend system, it is useful for development and test scenarios.\n\n## Installation\nnpm\n`npm install --save-dev @sap-ux/ui5-middleware-fe-mockserver`\n\nyarn\n`yarn add @sap-ux/ui5-middleware-fe-mockserver --dev`\n\npnpm\n`pnpm add @sap-ux/ui5-middleware-fe-mockserver --dev`\n\n## Usage\n\nIn order to use the mock server, the npm module `@sap/ux-ui5-fe-mockserver-middleware` needs to be added as devDependency and ui5.dependencies to `package.json`, and a valid `ui5.yaml` configuration needs to be provided.\n**Entries in package.json**\n\n```\n[..]\n\n\"devDependencies\": {\n \"@sap-ux/ui5-middleware-fe-mockserver\": \"^1\"\n},\n\"ui5\": {\n \"dependencies\": [\n \"@sap-ux/ui5-middleware-fe-mockserver\"\n ]\n}\n\n[..]\n```\n\n**Example for a yaml configuration file**\n\n```\n\nspecVersion: '2.0'\nmetadata:\n
|
|
32
|
+
"readme": "# @sap-ux/ui5-middleware-fe-mockserver\n\n## Features\n\nThe **SAP Fiori - UI5 middleware for the Fiori elements mock server** is a middleware extension for the [UI5 Tooling](https://github.com/SAP/ui5-tooling). As an alternative to proxying OData requests to a live backend, it supports loading mock data for OData v2/v4 requests for supported Fiori elements templates. As the mock server runs locally without requiring a network connection to a backend system, it is useful for development and test scenarios.\n\n## Installation\nnpm\n`npm install --save-dev @sap-ux/ui5-middleware-fe-mockserver`\n\nyarn\n`yarn add @sap-ux/ui5-middleware-fe-mockserver --dev`\n\npnpm\n`pnpm add @sap-ux/ui5-middleware-fe-mockserver --dev`\n\n## Usage\n\nIn order to use the mock server, the npm module `@sap/ux-ui5-fe-mockserver-middleware` needs to be added as devDependency and ui5.dependencies to `package.json`, and a valid `ui5.yaml` configuration needs to be provided.\n**Entries in package.json**\n\n```\n[..]\n\n\"devDependencies\": {\n \"@sap-ux/ui5-middleware-fe-mockserver\": \"^1\"\n},\n\"ui5\": {\n \"dependencies\": [\n \"@sap-ux/ui5-middleware-fe-mockserver\"\n ]\n}\n\n[..]\n```\n\n**Example for a yaml configuration file**\n\n```\n\nspecVersion: '2.0'\nmetadata:\n name: <NAME>\ntype: application\nserver:\n customMiddleware:\n - name: sap-fe-mockserver\n mountPath: /\n afterMiddleware: compression\n configuration:\n annotations:\n - localPath: './webapp/localService/myServiceAnnotation.xml'\n urlPath: '/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Annotations*'\n services:\n - urlPath: '/sap/opu/odata/sap/<SERVICE_NAME>'\n metadataPath: './webapp/localService/metadata.xml'\n mockdataPath: './webapp/localService/data'\n - urlPath: '/sap/opu/odata/sap/<OTHER_SERVICE_NAME>'\n metadataPath: './webapp/localService/other_metadata.xml'\n mockdataPath: './webapp/localService/data'\n\n```\n\n\n## Service Configuration\n\nEach service must provide at least two things\n\n- urlPath : where will your service be accessible from\n- metadataPath : local path to your metadata file\n\nOn top of that you can specify one of the following option\n\n- mockdataPath : the path to the folder containing the mockdata files\n- generateMockData : whether or not you want to use automatically generated mockdata\n\nAdditional option are available either per service of for all services if defined globally\n\n- debug : toggle the debug mode\n- watch : toggle the watch mode, the mockserver will restart the service where data or metadata have changed\n- noETag : disable ETag support on metadata\n- strictKeyMode : disable the default \"loose\" mode for the key matching, you can try this if the mockserver returns too much data\n- contextBasedIsolation : enable the support of \"tenants\", by adding /tenant-xxx at the very start of your service call you will be able to work on tenant isolated data.\n\nYou can also define static annotation file using the `annotations` entry, each annotation must provide\n\n- urlPath : where will your annotation be accessible from\n- localPath : local path to your annotation file\n\n**Sample application**\n\nSee the usage in demo apps [SAP Fiori sample apps](https://github.com/SAP-samples/fiori-tools-samples)\n\n## Support\n\nJoin the [SAP Fiori tools Community](https://community.sap.com/search/?by=updated&ct=blog&mt=73555000100800002345). Ask Questions, Read the Latest Blogs, Explore Content.\nPlease assign tag: _SAP Fiori tools_\n\nTo log an issue with SAP Fiori tools, please see [Contact SAP Support](https://help.sap.com/viewer/1bb01966b27a429ebf62fa2e45354fea/Latest/en-US).\n\n## Keywords\nMockserver, Middleware\n"
|
|
33
33
|
}
|