@oak-digital/types-4-strapi-2 0.2.10 → 0.3.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/lib/interface/Attributes.js +13 -0
- package/package.json +1 -1
|
@@ -39,6 +39,9 @@ var Attributes = /** @class */ (function () {
|
|
|
39
39
|
case 'media':
|
|
40
40
|
dependencyNames.push('builtins::Media');
|
|
41
41
|
break;
|
|
42
|
+
case 'dynamiczone':
|
|
43
|
+
dependencyNames.push.apply(dependencyNames, attr.components);
|
|
44
|
+
break;
|
|
42
45
|
default:
|
|
43
46
|
continue;
|
|
44
47
|
}
|
|
@@ -55,6 +58,7 @@ var Attributes = /** @class */ (function () {
|
|
|
55
58
|
return dependencies;
|
|
56
59
|
};
|
|
57
60
|
Attributes.prototype.attributeToString = function (attrName, attr) {
|
|
61
|
+
var _this = this;
|
|
58
62
|
var _a, _b, _c, _d;
|
|
59
63
|
var optionalString = this.isAttributeOptional(attr) ? '?' : '';
|
|
60
64
|
var str = " ".concat(attrName).concat(optionalString, ": ");
|
|
@@ -96,6 +100,15 @@ var Attributes = /** @class */ (function () {
|
|
|
96
100
|
var typeString = enums.join(' | ');
|
|
97
101
|
str += typeString;
|
|
98
102
|
break;
|
|
103
|
+
case 'dynamiczone':
|
|
104
|
+
// console.log(attr.components);
|
|
105
|
+
var relations = attr.components
|
|
106
|
+
.map(function (componentName) { return _this.RelationNames[componentName].name; });
|
|
107
|
+
// console.log(relations);
|
|
108
|
+
var relationsString = relations.join(' | ');
|
|
109
|
+
// console.log(relationsString);
|
|
110
|
+
str += "Array<".concat(relationsString, ">");
|
|
111
|
+
break;
|
|
99
112
|
case 'string':
|
|
100
113
|
case 'text':
|
|
101
114
|
case 'richtext':
|