@dhis2/app-service-data 3.15.1 → 3.16.0
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/build/cjs/links/RestAPILink/queryToRequestOptions/textPlainMatchers.js +12 -2
- package/build/cjs/links/RestAPILink/queryToRequestOptions/textPlainMatchers.test.js +12 -0
- package/build/es/links/RestAPILink/queryToRequestOptions/textPlainMatchers.js +9 -0
- package/build/es/links/RestAPILink/queryToRequestOptions/textPlainMatchers.test.js +13 -1
- package/build/types/links/RestAPILink/queryToRequestOptions/textPlainMatchers.d.ts +1 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isUpdateInterpretation = exports.isSkipTestDescriptionValid = exports.isReplyToMessageConversation = exports.isMetadataPackageInstallation = exports.isInterpretationCommentUpdate = exports.isFilterDescriptionValidation = exports.isExpressionDescriptionValidation = exports.isCreateInterpretation = exports.isCreateFeedbackMessage = exports.isCommentOnInterpretation = exports.isAddOrUpdateSystemOrUserSetting = exports.addOrUpdateConfigurationProperty = void 0;
|
|
6
|
+
exports.isUpdateInterpretation = exports.isSkipTestDescriptionValid = exports.isReplyToMessageConversation = exports.isMetadataPackageInstallation = exports.isInterpretationCommentUpdate = exports.isFilterDescriptionValidation = exports.isExpressionDescriptionValidation = exports.isCreateInterpretation = exports.isCreateFeedbackMessage = exports.isConditionDescriptionValidation = exports.isCommentOnInterpretation = exports.isAddOrUpdateSystemOrUserSetting = exports.addOrUpdateConfigurationProperty = void 0;
|
|
7
7
|
/*
|
|
8
8
|
* Requests that expect a "text/plain" Content-Type have been collected by scanning
|
|
9
9
|
* the developer documentation:
|
|
@@ -157,4 +157,14 @@ const isSkipTestDescriptionValid = (type, _ref10) => {
|
|
|
157
157
|
const pattern = /^predictors\/skipTest\/description$/;
|
|
158
158
|
return type === 'create' && pattern.test(resource);
|
|
159
159
|
};
|
|
160
|
-
|
|
160
|
+
|
|
161
|
+
// POST to 'programRules/condition/description' (validate a program rule condition)
|
|
162
|
+
exports.isSkipTestDescriptionValid = isSkipTestDescriptionValid;
|
|
163
|
+
const isConditionDescriptionValidation = (type, _ref11) => {
|
|
164
|
+
let {
|
|
165
|
+
resource
|
|
166
|
+
} = _ref11;
|
|
167
|
+
const pattern = /^programRules\/condition\/description$/;
|
|
168
|
+
return type === 'create' && pattern.test(resource);
|
|
169
|
+
};
|
|
170
|
+
exports.isConditionDescriptionValidation = isConditionDescriptionValidation;
|
|
@@ -231,4 +231,16 @@ describe('isSkipTestDescriptionValid', () => {
|
|
|
231
231
|
resource: 'predictors/skipTest/somethingelse'
|
|
232
232
|
})).toBe(false);
|
|
233
233
|
});
|
|
234
|
+
});
|
|
235
|
+
describe('isConditionDescriptionValidation', () => {
|
|
236
|
+
it('returns true for a POST to "programRules/condition/description"', () => {
|
|
237
|
+
expect((0, _textPlainMatchers.isConditionDescriptionValidation)('create', {
|
|
238
|
+
resource: 'programRules/condition/description'
|
|
239
|
+
})).toBe(true);
|
|
240
|
+
});
|
|
241
|
+
it('retuns false for a POST to a different resource', () => {
|
|
242
|
+
expect((0, _textPlainMatchers.isConditionDescriptionValidation)('create', {
|
|
243
|
+
resource: 'programRules/condition/somethingelse'
|
|
244
|
+
})).toBe(false);
|
|
245
|
+
});
|
|
234
246
|
});
|
|
@@ -139,4 +139,13 @@ export const isSkipTestDescriptionValid = (type, _ref10) => {
|
|
|
139
139
|
} = _ref10;
|
|
140
140
|
const pattern = /^predictors\/skipTest\/description$/;
|
|
141
141
|
return type === 'create' && pattern.test(resource);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// POST to 'programRules/condition/description' (validate a program rule condition)
|
|
145
|
+
export const isConditionDescriptionValidation = (type, _ref11) => {
|
|
146
|
+
let {
|
|
147
|
+
resource
|
|
148
|
+
} = _ref11;
|
|
149
|
+
const pattern = /^programRules\/condition\/description$/;
|
|
150
|
+
return type === 'create' && pattern.test(resource);
|
|
142
151
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isReplyToMessageConversation, isCreateFeedbackMessage, isCreateInterpretation, isUpdateInterpretation, isCommentOnInterpretation, isInterpretationCommentUpdate, isAddOrUpdateSystemOrUserSetting, addOrUpdateConfigurationProperty, isMetadataPackageInstallation, isExpressionDescriptionValidation, isFilterDescriptionValidation, isSkipTestDescriptionValid } from './textPlainMatchers';
|
|
1
|
+
import { isReplyToMessageConversation, isCreateFeedbackMessage, isCreateInterpretation, isUpdateInterpretation, isCommentOnInterpretation, isInterpretationCommentUpdate, isAddOrUpdateSystemOrUserSetting, addOrUpdateConfigurationProperty, isMetadataPackageInstallation, isExpressionDescriptionValidation, isFilterDescriptionValidation, isSkipTestDescriptionValid, isConditionDescriptionValidation } from './textPlainMatchers';
|
|
2
2
|
describe('isReplyToMessageConversation', () => {
|
|
3
3
|
it('retuns true for POST to `messageConversations/${id}`', () => {
|
|
4
4
|
expect(isReplyToMessageConversation('create', {
|
|
@@ -229,4 +229,16 @@ describe('isSkipTestDescriptionValid', () => {
|
|
|
229
229
|
resource: 'predictors/skipTest/somethingelse'
|
|
230
230
|
})).toBe(false);
|
|
231
231
|
});
|
|
232
|
+
});
|
|
233
|
+
describe('isConditionDescriptionValidation', () => {
|
|
234
|
+
it('returns true for a POST to "programRules/condition/description"', () => {
|
|
235
|
+
expect(isConditionDescriptionValidation('create', {
|
|
236
|
+
resource: 'programRules/condition/description'
|
|
237
|
+
})).toBe(true);
|
|
238
|
+
});
|
|
239
|
+
it('retuns false for a POST to a different resource', () => {
|
|
240
|
+
expect(isConditionDescriptionValidation('create', {
|
|
241
|
+
resource: 'programRules/condition/somethingelse'
|
|
242
|
+
})).toBe(false);
|
|
243
|
+
});
|
|
232
244
|
});
|
|
@@ -11,3 +11,4 @@ export declare const isMetadataPackageInstallation: (type: FetchType, { resource
|
|
|
11
11
|
export declare const isExpressionDescriptionValidation: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
|
|
12
12
|
export declare const isFilterDescriptionValidation: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
|
|
13
13
|
export declare const isSkipTestDescriptionValid: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
|
|
14
|
+
export declare const isConditionDescriptionValidation: (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.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"types": "build/types/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"prop-types": "^15.7.2"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@dhis2/app-service-config": "3.
|
|
40
|
+
"@dhis2/app-service-config": "3.16.0",
|
|
41
41
|
"react": "^16.8.6 || ^18",
|
|
42
42
|
"react-dom": "^16.8.6 || ^18"
|
|
43
43
|
}
|