@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.
@@ -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':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oak-digital/types-4-strapi-2",
3
- "version": "0.2.10",
3
+ "version": "0.3.0",
4
4
  "description": "Typescript interface generator for Strapi 4 models",
5
5
  "bin": {
6
6
  "t4s": "./bin/index.js"