@dhis2/app-service-data 3.14.0 → 3.14.1
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 +14 -2
- package/build/es/links/RestAPILink/queryToRequestOptions/textPlainMatchers.js +9 -0
- package/build/es/links/RestAPILink/queryToRequestOptions/textPlainMatchers.test.js +15 -3
- 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.isReplyToMessageConversation = exports.isMetadataPackageInstallation = exports.isInterpretationCommentUpdate = exports.isExpressionDescriptionValidation = exports.isCreateInterpretation = exports.isCreateFeedbackMessage = exports.isCommentOnInterpretation = exports.isAddOrUpdateSystemOrUserSetting = exports.addOrUpdateConfigurationProperty = void 0;
|
|
6
|
+
exports.isUpdateInterpretation = exports.isReplyToMessageConversation = exports.isMetadataPackageInstallation = exports.isInterpretationCommentUpdate = exports.isFilterDescriptionValidation = exports.isExpressionDescriptionValidation = exports.isCreateInterpretation = exports.isCreateFeedbackMessage = 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:
|
|
@@ -137,4 +137,14 @@ const isExpressionDescriptionValidation = (type, _ref10) => {
|
|
|
137
137
|
const pattern = /^(indicators|programIndicators)\/expression\/description$/;
|
|
138
138
|
return type === 'create' && pattern.test(resource);
|
|
139
139
|
};
|
|
140
|
-
|
|
140
|
+
|
|
141
|
+
// POST to 'programIndicator/filter/description' (validate a filter)
|
|
142
|
+
exports.isExpressionDescriptionValidation = isExpressionDescriptionValidation;
|
|
143
|
+
const isFilterDescriptionValidation = (type, _ref11) => {
|
|
144
|
+
let {
|
|
145
|
+
resource
|
|
146
|
+
} = _ref11;
|
|
147
|
+
const pattern = /^programIndicators\/filter\/description$/;
|
|
148
|
+
return type === 'create' && pattern.test(resource);
|
|
149
|
+
};
|
|
150
|
+
exports.isFilterDescriptionValidation = isFilterDescriptionValidation;
|
|
@@ -173,7 +173,7 @@ describe('isExpressionDescriptionValidation', () => {
|
|
|
173
173
|
})).toBe(true);
|
|
174
174
|
});
|
|
175
175
|
it('retuns false for a POST to a different resource', () => {
|
|
176
|
-
expect((0, _textPlainMatchers.
|
|
176
|
+
expect((0, _textPlainMatchers.isExpressionDescriptionValidation)('create', {
|
|
177
177
|
resource: 'indicators/expression/somethingelse'
|
|
178
178
|
})).toBe(false);
|
|
179
179
|
});
|
|
@@ -183,8 +183,20 @@ describe('isExpressionDescriptionValidation', () => {
|
|
|
183
183
|
})).toBe(true);
|
|
184
184
|
});
|
|
185
185
|
it('retuns false for a POST to a different resource', () => {
|
|
186
|
-
expect((0, _textPlainMatchers.
|
|
186
|
+
expect((0, _textPlainMatchers.isExpressionDescriptionValidation)('create', {
|
|
187
187
|
resource: 'programIndicators/expression/somethingelse'
|
|
188
188
|
})).toBe(false);
|
|
189
189
|
});
|
|
190
|
+
});
|
|
191
|
+
describe('isFilterDescriptionValidation', () => {
|
|
192
|
+
it('returns true for a POST to "programIndicators/filter/description"', () => {
|
|
193
|
+
expect((0, _textPlainMatchers.isFilterDescriptionValidation)('create', {
|
|
194
|
+
resource: 'programIndicators/filter/description'
|
|
195
|
+
})).toBe(true);
|
|
196
|
+
});
|
|
197
|
+
it('retuns false for a POST to a different resource', () => {
|
|
198
|
+
expect((0, _textPlainMatchers.isFilterDescriptionValidation)('create', {
|
|
199
|
+
resource: 'programIndicators/filter/somethingelse'
|
|
200
|
+
})).toBe(false);
|
|
201
|
+
});
|
|
190
202
|
});
|
|
@@ -121,4 +121,13 @@ export const isExpressionDescriptionValidation = (type, _ref10) => {
|
|
|
121
121
|
} = _ref10;
|
|
122
122
|
const pattern = /^(indicators|programIndicators)\/expression\/description$/;
|
|
123
123
|
return type === 'create' && pattern.test(resource);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// POST to 'programIndicator/filter/description' (validate a filter)
|
|
127
|
+
export const isFilterDescriptionValidation = (type, _ref11) => {
|
|
128
|
+
let {
|
|
129
|
+
resource
|
|
130
|
+
} = _ref11;
|
|
131
|
+
const pattern = /^programIndicators\/filter\/description$/;
|
|
132
|
+
return type === 'create' && pattern.test(resource);
|
|
124
133
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isReplyToMessageConversation, isCreateFeedbackMessage, isCreateInterpretation, isUpdateInterpretation, isCommentOnInterpretation, isInterpretationCommentUpdate, isAddOrUpdateSystemOrUserSetting, addOrUpdateConfigurationProperty, isMetadataPackageInstallation, isExpressionDescriptionValidation } from './textPlainMatchers';
|
|
1
|
+
import { isReplyToMessageConversation, isCreateFeedbackMessage, isCreateInterpretation, isUpdateInterpretation, isCommentOnInterpretation, isInterpretationCommentUpdate, isAddOrUpdateSystemOrUserSetting, addOrUpdateConfigurationProperty, isMetadataPackageInstallation, isExpressionDescriptionValidation, isFilterDescriptionValidation } from './textPlainMatchers';
|
|
2
2
|
describe('isReplyToMessageConversation', () => {
|
|
3
3
|
it('retuns true for POST to `messageConversations/${id}`', () => {
|
|
4
4
|
expect(isReplyToMessageConversation('create', {
|
|
@@ -171,7 +171,7 @@ describe('isExpressionDescriptionValidation', () => {
|
|
|
171
171
|
})).toBe(true);
|
|
172
172
|
});
|
|
173
173
|
it('retuns false for a POST to a different resource', () => {
|
|
174
|
-
expect(
|
|
174
|
+
expect(isExpressionDescriptionValidation('create', {
|
|
175
175
|
resource: 'indicators/expression/somethingelse'
|
|
176
176
|
})).toBe(false);
|
|
177
177
|
});
|
|
@@ -181,8 +181,20 @@ describe('isExpressionDescriptionValidation', () => {
|
|
|
181
181
|
})).toBe(true);
|
|
182
182
|
});
|
|
183
183
|
it('retuns false for a POST to a different resource', () => {
|
|
184
|
-
expect(
|
|
184
|
+
expect(isExpressionDescriptionValidation('create', {
|
|
185
185
|
resource: 'programIndicators/expression/somethingelse'
|
|
186
186
|
})).toBe(false);
|
|
187
187
|
});
|
|
188
|
+
});
|
|
189
|
+
describe('isFilterDescriptionValidation', () => {
|
|
190
|
+
it('returns true for a POST to "programIndicators/filter/description"', () => {
|
|
191
|
+
expect(isFilterDescriptionValidation('create', {
|
|
192
|
+
resource: 'programIndicators/filter/description'
|
|
193
|
+
})).toBe(true);
|
|
194
|
+
});
|
|
195
|
+
it('retuns false for a POST to a different resource', () => {
|
|
196
|
+
expect(isFilterDescriptionValidation('create', {
|
|
197
|
+
resource: 'programIndicators/filter/somethingelse'
|
|
198
|
+
})).toBe(false);
|
|
199
|
+
});
|
|
188
200
|
});
|
|
@@ -9,3 +9,4 @@ export declare const isAddOrUpdateSystemOrUserSetting: (type: FetchType, { resou
|
|
|
9
9
|
export declare const addOrUpdateConfigurationProperty: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
|
|
10
10
|
export declare const isMetadataPackageInstallation: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
|
|
11
11
|
export declare const isExpressionDescriptionValidation: (type: FetchType, { resource }: ResolvedResourceQuery) => boolean;
|
|
12
|
+
export declare const isFilterDescriptionValidation: (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.14.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"types": "build/types/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@tanstack/react-query": "^4.36.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@dhis2/app-service-config": "3.14.
|
|
39
|
+
"@dhis2/app-service-config": "3.14.1",
|
|
40
40
|
"prop-types": "^15.7.2",
|
|
41
41
|
"react": "^16.8 || ^18",
|
|
42
42
|
"react-dom": "^16.8 || ^18"
|