@dhis2/app-service-data 3.6.0 → 3.6.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.
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isMetadataPackageInstallation = exports.addOrUpdateConfigurationProperty = exports.isAddOrUpdateSystemOrUserSetting = exports.isInterpretationCommentUpdate = exports.isCommentOnInterpretation = exports.isUpdateInterpretation = exports.isCreateInterpretation = exports.isCreateFeedbackMessage = exports.isReplyToMessageConversation = void 0;
6
+ exports.isExpressionDescriptionValidation = exports.isMetadataPackageInstallation = exports.addOrUpdateConfigurationProperty = exports.isAddOrUpdateSystemOrUserSetting = exports.isInterpretationCommentUpdate = exports.isCommentOnInterpretation = exports.isUpdateInterpretation = exports.isCreateInterpretation = exports.isCreateFeedbackMessage = exports.isReplyToMessageConversation = void 0;
7
7
 
8
8
  /*
9
9
  * Requests that expect a "text/plain" Content-Type have been collected by scanning
@@ -126,6 +126,13 @@ exports.addOrUpdateConfigurationProperty = addOrUpdateConfigurationProperty;
126
126
 
127
127
  const isMetadataPackageInstallation = (type, {
128
128
  resource
129
- }) => type === 'create' && resource === 'synchronization/metadataPull';
129
+ }) => type === 'create' && resource === 'synchronization/metadataPull'; // POST to 'indicaators/expression/description' (validate an expression)
130
130
 
131
- exports.isMetadataPackageInstallation = isMetadataPackageInstallation;
131
+
132
+ exports.isMetadataPackageInstallation = isMetadataPackageInstallation;
133
+
134
+ const isExpressionDescriptionValidation = (type, {
135
+ resource
136
+ }) => type === 'create' && resource === 'indicators/expression/description';
137
+
138
+ exports.isExpressionDescriptionValidation = isExpressionDescriptionValidation;
@@ -166,4 +166,16 @@ describe('isMetadataPackageInstallation', () => {
166
166
  resource: 'synchronization/somethingelse'
167
167
  })).toBe(false);
168
168
  });
169
+ });
170
+ describe('isExpressionDescriptionValidation', () => {
171
+ it('returns true for a POST to "indicators/expression/description"', () => {
172
+ expect((0, _textPlainMatchers.isExpressionDescriptionValidation)('create', {
173
+ resource: 'indicators/expression/description'
174
+ })).toBe(true);
175
+ });
176
+ it('retuns false for a POST to a different resource', () => {
177
+ expect((0, _textPlainMatchers.isMetadataPackageInstallation)('create', {
178
+ resource: 'indicators/expression/somethingelse'
179
+ })).toBe(false);
180
+ });
169
181
  });
@@ -95,4 +95,8 @@ export const addOrUpdateConfigurationProperty = (type, {
95
95
 
96
96
  export const isMetadataPackageInstallation = (type, {
97
97
  resource
98
- }) => type === 'create' && resource === 'synchronization/metadataPull';
98
+ }) => type === 'create' && resource === 'synchronization/metadataPull'; // POST to 'indicaators/expression/description' (validate an expression)
99
+
100
+ export const isExpressionDescriptionValidation = (type, {
101
+ resource
102
+ }) => type === 'create' && resource === 'indicators/expression/description';
@@ -1,4 +1,4 @@
1
- import { isReplyToMessageConversation, isCreateFeedbackMessage, isCreateInterpretation, isUpdateInterpretation, isCommentOnInterpretation, isInterpretationCommentUpdate, isAddOrUpdateSystemOrUserSetting, addOrUpdateConfigurationProperty, isMetadataPackageInstallation } from './textPlainMatchers';
1
+ import { isReplyToMessageConversation, isCreateFeedbackMessage, isCreateInterpretation, isUpdateInterpretation, isCommentOnInterpretation, isInterpretationCommentUpdate, isAddOrUpdateSystemOrUserSetting, addOrUpdateConfigurationProperty, isMetadataPackageInstallation, isExpressionDescriptionValidation } from './textPlainMatchers';
2
2
  describe('isReplyToMessageConversation', () => {
3
3
  it('retuns true for POST to `messageConversations/${id}`', () => {
4
4
  expect(isReplyToMessageConversation('create', {
@@ -163,4 +163,16 @@ describe('isMetadataPackageInstallation', () => {
163
163
  resource: 'synchronization/somethingelse'
164
164
  })).toBe(false);
165
165
  });
166
+ });
167
+ describe('isExpressionDescriptionValidation', () => {
168
+ it('returns true for a POST to "indicators/expression/description"', () => {
169
+ expect(isExpressionDescriptionValidation('create', {
170
+ resource: 'indicators/expression/description'
171
+ })).toBe(true);
172
+ });
173
+ it('retuns false for a POST to a different resource', () => {
174
+ expect(isMetadataPackageInstallation('create', {
175
+ resource: 'indicators/expression/somethingelse'
176
+ })).toBe(false);
177
+ });
166
178
  });
@@ -8,3 +8,4 @@ export declare const isInterpretationCommentUpdate: (type: FetchType, { resource
8
8
  export declare const isAddOrUpdateSystemOrUserSetting: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
9
9
  export declare const addOrUpdateConfigurationProperty: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
10
10
  export declare const isMetadataPackageInstallation: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
11
+ export declare const isExpressionDescriptionValidation: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/app-service-data",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
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.6.0",
25
+ "@dhis2/app-service-config": "3.6.2",
26
26
  "@dhis2/cli-app-scripts": "^7.1.1",
27
27
  "prop-types": "^15.7.2",
28
28
  "react": "^16.8",