speedly 1.2.27 → 1.2.28
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/dist/cjs/modules/translation/translation.validator.d.ts +1 -3
- package/dist/cjs/modules/translation/translation.validator.js +12 -8
- package/dist/cjs/util/makeOptional.d.ts +1 -0
- package/dist/cjs/util/makeOptional.js +17 -0
- package/dist/esm/modules/translation/translation.validator.js +10 -8
- package/dist/esm/util/makeOptional.d.ts +1 -0
- package/dist/esm/util/makeOptional.js +17 -0
- package/package.json +1 -1
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const makeOptional_1 = __importDefault(require("../../util/makeOptional"));
|
|
7
|
+
const yup_config_1 = require("./../../yup.config");
|
|
8
|
+
const paramId = (0, yup_config_1.object)({
|
|
9
|
+
id: (0, yup_config_1.string)().required('id is required').oid('id is invalid')
|
|
6
10
|
});
|
|
7
|
-
const schema = object({
|
|
8
|
-
translatedText: string().required('translatedText is required'),
|
|
11
|
+
const schema = (0, yup_config_1.object)({
|
|
12
|
+
translatedText: (0, yup_config_1.string)().required('translatedText is required'),
|
|
9
13
|
});
|
|
10
14
|
//? exports
|
|
11
15
|
exports.put = {
|
|
12
16
|
params: paramId,
|
|
13
|
-
|
|
17
|
+
body: (0, makeOptional_1.default)(schema)
|
|
14
18
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (schema: any): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = default_1;
|
|
7
|
+
const yup_config_1 = __importDefault(require("./../yup.config"));
|
|
8
|
+
function default_1(schema) {
|
|
9
|
+
if (schema.fields) {
|
|
10
|
+
const shape = {};
|
|
11
|
+
for (const key in schema.fields) {
|
|
12
|
+
shape[key] = schema.fields[key].optional();
|
|
13
|
+
}
|
|
14
|
+
return yup_config_1.default.object().shape(shape);
|
|
15
|
+
}
|
|
16
|
+
return schema;
|
|
17
|
+
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
id: string().required('id is required').oid('id is invalid')
|
|
6
|
+
const makeOptional_1 = __importDefault(require("../../util/makeOptional"));
|
|
7
|
+
const yup_config_1 = require("./../../yup.config");
|
|
8
|
+
const paramId = (0, yup_config_1.object)({
|
|
9
|
+
id: (0, yup_config_1.string)().required('id is required').oid('id is invalid')
|
|
8
10
|
});
|
|
9
|
-
const schema = object({
|
|
10
|
-
translatedText: string().required('translatedText is required'),
|
|
11
|
+
const schema = (0, yup_config_1.object)({
|
|
12
|
+
translatedText: (0, yup_config_1.string)().required('translatedText is required'),
|
|
11
13
|
});
|
|
12
14
|
//? exports
|
|
13
15
|
exports.put = {
|
|
14
16
|
params: paramId,
|
|
15
|
-
|
|
17
|
+
body: (0, makeOptional_1.default)(schema)
|
|
16
18
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (schema: any): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = default_1;
|
|
7
|
+
const yup_config_1 = __importDefault(require("./../yup.config"));
|
|
8
|
+
function default_1(schema) {
|
|
9
|
+
if (schema.fields) {
|
|
10
|
+
const shape = {};
|
|
11
|
+
for (const key in schema.fields) {
|
|
12
|
+
shape[key] = schema.fields[key].optional();
|
|
13
|
+
}
|
|
14
|
+
return yup_config_1.default.object().shape(shape);
|
|
15
|
+
}
|
|
16
|
+
return schema;
|
|
17
|
+
}
|