@dhis2/app-service-data 3.4.2 → 3.4.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.
@@ -64,7 +64,7 @@ const isAction = resource => resource.startsWith(actionPrefix);
64
64
  const makeActionPath = resource => (0, _path.joinPath)('dhis-web-commons', "".concat(resource.substr(actionPrefix.length), ".action"));
65
65
 
66
66
  const skipApiVersion = (resource, config) => {
67
- if (resource === 'tracker') {
67
+ if (resource === 'tracker' || resource.startsWith('tracker/')) {
68
68
  var _config$serverVersion, _config$serverVersion2;
69
69
 
70
70
  if (!((_config$serverVersion = config.serverVersion) !== null && _config$serverVersion !== void 0 && _config$serverVersion.minor) || ((_config$serverVersion2 = config.serverVersion) === null || _config$serverVersion2 === void 0 ? void 0 : _config$serverVersion2.minor) < 38) {
@@ -153,6 +153,12 @@ describe('queryToResourcePath', () => {
153
153
  };
154
154
  expect((0, _queryToResourcePath.queryToResourcePath)(link, query, 'read')).toBe("".concat(link.unversionedApiPath, "/tracker"));
155
155
  });
156
+ it('should return an unversioned endpoint sub-resources of the new tracker importer (in version 2.37)', () => {
157
+ const query = {
158
+ resource: 'tracker/test'
159
+ };
160
+ expect((0, _queryToResourcePath.queryToResourcePath)(link, query, 'read')).toBe("".concat(link.unversionedApiPath, "/tracker/test"));
161
+ });
156
162
  it('should return a VERSIONED endpoint for the new tracker importer (in version 2.38)', () => {
157
163
  const query = {
158
164
  resource: 'tracker'
@@ -56,7 +56,7 @@ const isAction = resource => resource.startsWith(actionPrefix);
56
56
  const makeActionPath = resource => joinPath('dhis-web-commons', "".concat(resource.substr(actionPrefix.length), ".action"));
57
57
 
58
58
  const skipApiVersion = (resource, config) => {
59
- if (resource === 'tracker') {
59
+ if (resource === 'tracker' || resource.startsWith('tracker/')) {
60
60
  var _config$serverVersion, _config$serverVersion2;
61
61
 
62
62
  if (!((_config$serverVersion = config.serverVersion) !== null && _config$serverVersion !== void 0 && _config$serverVersion.minor) || ((_config$serverVersion2 = config.serverVersion) === null || _config$serverVersion2 === void 0 ? void 0 : _config$serverVersion2.minor) < 38) {
@@ -150,6 +150,12 @@ describe('queryToResourcePath', () => {
150
150
  };
151
151
  expect(queryToResourcePath(link, query, 'read')).toBe("".concat(link.unversionedApiPath, "/tracker"));
152
152
  });
153
+ it('should return an unversioned endpoint sub-resources of the new tracker importer (in version 2.37)', () => {
154
+ const query = {
155
+ resource: 'tracker/test'
156
+ };
157
+ expect(queryToResourcePath(link, query, 'read')).toBe("".concat(link.unversionedApiPath, "/tracker/test"));
158
+ });
153
159
  it('should return a VERSIONED endpoint for the new tracker importer (in version 2.38)', () => {
154
160
  const query = {
155
161
  resource: 'tracker'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/app-service-data",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "types": "build/types/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "build/**"
23
23
  ],
24
24
  "peerDependencies": {
25
- "@dhis2/app-service-config": "3.4.2",
25
+ "@dhis2/app-service-config": "3.4.3",
26
26
  "@dhis2/cli-app-scripts": "^7.1.1",
27
27
  "prop-types": "^15.7.2",
28
28
  "react": "^16.8",