identity-admin 1.28.5 → 1.28.7
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.
|
@@ -9,12 +9,14 @@ const helpers_1 = require("../types/helpers");
|
|
|
9
9
|
var pluralize = require('pluralize');
|
|
10
10
|
class SchemaGenerator {
|
|
11
11
|
static generateSchema(schema, model, modelName, resource, configurations) {
|
|
12
|
+
var _a;
|
|
12
13
|
const schemaFields = Object.keys(schema);
|
|
13
14
|
var populatedString = '';
|
|
14
15
|
if (!model) {
|
|
15
16
|
model = {};
|
|
16
17
|
}
|
|
17
18
|
schemaFields.forEach((field) => {
|
|
19
|
+
var _a, _b;
|
|
18
20
|
const schemaField = schema[field];
|
|
19
21
|
const refCheck = schemaField.options.ref;
|
|
20
22
|
const translation = ResourceHelper_1.default.checkResourceTranslation(resource, field);
|
|
@@ -22,7 +24,7 @@ class SchemaGenerator {
|
|
|
22
24
|
model[field] = model[field] ? model[field] : {};
|
|
23
25
|
if (fieldType === helpers_1.FieldTypes.REFERENCE) {
|
|
24
26
|
populatedString = StringUtils_1.default.getPopulatedString(populatedString, field);
|
|
25
|
-
model[field].path = StringUtils_1.default.lowerCaseFirstLetter(refCheck);
|
|
27
|
+
model[field].path = (_a = model[field].path) !== null && _a !== void 0 ? _a : StringUtils_1.default.lowerCaseFirstLetter(refCheck);
|
|
26
28
|
const resourceModel = resource.properties.model;
|
|
27
29
|
if (resourceModel && resourceModel[field] && resourceModel[field].mediaUploader) {
|
|
28
30
|
model[field].mediaUploader = true;
|
|
@@ -50,7 +52,7 @@ class SchemaGenerator {
|
|
|
50
52
|
}
|
|
51
53
|
else if (schema[field].caster.options.ref) {
|
|
52
54
|
populatedString = StringUtils_1.default.getPopulatedString(populatedString, field);
|
|
53
|
-
model[field].path = StringUtils_1.default.lowerCaseFirstLetter(schema[field].caster.options.ref);
|
|
55
|
+
model[field].path = (_b = model[field].path) !== null && _b !== void 0 ? _b : StringUtils_1.default.lowerCaseFirstLetter(schema[field].caster.options.ref);
|
|
54
56
|
model[field].apiRoute = model[field].apiRoute ? model[field].apiRoute : this.getRefPath(schema[field].caster.options.ref, configurations);
|
|
55
57
|
model[field].arrayType = model[field].arrayType ? model[field].arrayType : helpers_1.FieldTypes.REFERENCE;
|
|
56
58
|
}
|
|
@@ -92,7 +94,7 @@ class SchemaGenerator {
|
|
|
92
94
|
model[extraField].value = ResourceHelper_1.default.checkResourceTranslation(resource, extraField)
|
|
93
95
|
? ResourceHelper_1.default.checkResourceTranslation(resource, extraField)
|
|
94
96
|
: StringUtils_1.default.convertCamelCaseToWord(extraField);
|
|
95
|
-
model[extraField].path = StringUtils_1.default.getRefPath(extraField);
|
|
97
|
+
model[extraField].path = (_a = model[extraField].path) !== null && _a !== void 0 ? _a : StringUtils_1.default.getRefPath(extraField);
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
return [model, populatedString];
|
package/lib/types/helpers.d.ts
CHANGED
package/lib/types/helpers.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
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
|
-
exports.ImageOptimizingCategories = exports.NeighborTypes = exports.HandlerStrategy = exports.FileTypes = exports.FieldTypes = exports.ActionTypes = exports.ActionNames = exports.Virtuals = void 0;
|
|
6
|
+
exports.FilterHelper = exports.ImageOptimizingCategories = exports.NeighborTypes = exports.HandlerStrategy = exports.FileTypes = exports.FieldTypes = exports.ActionTypes = exports.ActionNames = exports.Virtuals = void 0;
|
|
4
7
|
var Virtuals;
|
|
5
8
|
(function (Virtuals) {
|
|
6
9
|
Virtuals["SHOW"] = "SHOW";
|
|
@@ -75,3 +78,5 @@ var ImageOptimizingCategories;
|
|
|
75
78
|
ImageOptimizingCategories["NORMAL"] = "NORMAL";
|
|
76
79
|
ImageOptimizingCategories["BANNERS"] = "BANNERS";
|
|
77
80
|
})(ImageOptimizingCategories = exports.ImageOptimizingCategories || (exports.ImageOptimizingCategories = {}));
|
|
81
|
+
var FiltersHelper_1 = require("../helpers/FiltersHelper");
|
|
82
|
+
Object.defineProperty(exports, "FilterHelper", { enumerable: true, get: function () { return __importDefault(FiltersHelper_1).default; } });
|