@oak-digital/types-4-strapi-2 0.5.2 → 0.5.3

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.
@@ -139,7 +139,9 @@ var Attributes = /** @class */ (function () {
139
139
  if (attr.repeatable) {
140
140
  str += '[]';
141
141
  }
142
- str += requiredString; // resolves #20. components can be null.
142
+ else {
143
+ str += requiredString; // resolves #20. components can be null.
144
+ }
143
145
  break;
144
146
  case 'media':
145
147
  var mediaMultipleString = attr.multiple
@@ -80,16 +80,22 @@ exports.createMediaInterface = createMediaInterface;
80
80
  function createMediaFormatInterface(directory, caseTypeName, prefix) {
81
81
  var stringRequiredFields = ['name', 'hash', 'ext', 'mime', 'url'];
82
82
  var stringFields = ['path'];
83
- var numberFields = ['width', 'height', 'size'];
83
+ var numberRequiredFields = ['size', 'width', 'height']; // TODO: not sure if this is corrext
84
+ var numberFields = [];
84
85
  var mediaAttrs = {};
85
86
  stringRequiredFields.forEach(function (s) {
86
- mediaAttrs[s] = { type: 'string', required: true };
87
+ var _a;
88
+ mediaAttrs[s] = (_a = { type: 'string', required: true }, _a[constants_1.CERTAINLY_REQUIRED_KEY] = true, _a);
87
89
  });
88
90
  stringFields.forEach(function (s) {
89
91
  mediaAttrs[s] = { type: 'string' };
90
92
  });
93
+ numberRequiredFields.forEach(function (s) {
94
+ var _a;
95
+ mediaAttrs[s] = (_a = { type: 'integer', required: true }, _a[constants_1.CERTAINLY_REQUIRED_KEY] = true, _a);
96
+ });
91
97
  numberFields.forEach(function (s) {
92
- mediaAttrs[s] = { type: 'integer', required: true };
98
+ mediaAttrs[s] = { type: 'integer' };
93
99
  });
94
100
  return new BuiltinComponentInterface_1.default('MediaFormat', mediaAttrs, directory, caseTypeName, prefix);
95
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oak-digital/types-4-strapi-2",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Typescript interface generator for Strapi 4 models",
5
5
  "bin": {
6
6
  "t4s": "./bin/index.js"