@oak-digital/types-4-strapi-2 0.3.2 → 0.3.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.
@@ -1,4 +1,4 @@
1
- export declare const caseTypesArray: string[];
1
+ export declare const caseTypesArray: readonly ["camel", "capital", "dot", "snake", "pascal", "constant", "kebab"];
2
2
  export declare type caseType = typeof caseTypesArray[number];
3
3
  export declare function checkCaseType(caseName: caseType): caseName is caseType;
4
4
  export declare function changeCase(text: string, caseName: caseType): string;
@@ -13,8 +13,8 @@ export default class InterfaceManager {
13
13
  builtinsPrefixOverridesPrefix: boolean;
14
14
  deleteOld: boolean;
15
15
  prettierFile: any;
16
- fileCaseType: string;
17
- folderCaseType: string;
16
+ fileCaseType: "camel" | "capital" | "dot" | "snake" | "pascal" | "constant" | "kebab";
17
+ folderCaseType: "camel" | "capital" | "dot" | "snake" | "pascal" | "constant" | "kebab";
18
18
  };
19
19
  constructor(outRoot: string, strapiSrcRoot: string, options?: any);
20
20
  validateOptions(): void;
@@ -17,10 +17,7 @@ function createMediaInterface(directory, caseTypeName, prefix) {
17
17
  'url',
18
18
  'provider',
19
19
  ];
20
- var stringFields = [
21
- 'previewUrl',
22
- 'provider_metadata',
23
- ];
20
+ var stringFields = ['previewUrl', 'provider_metadata'];
24
21
  var numberFields = ['width', 'height', 'size'];
25
22
  var mediaFormat = {
26
23
  type: 'component',
@@ -60,14 +57,18 @@ function createMediaInterface(directory, caseTypeName, prefix) {
60
57
  }
61
58
  exports.createMediaInterface = createMediaInterface;
62
59
  function createMediaFormatInterface(directory, caseTypeName, prefix) {
63
- var stringFields = ['name', 'hash', 'ext', 'mime', 'path', 'url'];
60
+ var stringRequiredFields = ['name', 'hash', 'ext', 'mime', 'url'];
61
+ var stringFields = ['path'];
64
62
  var numberFields = ['width', 'height', 'size'];
65
63
  var mediaAttrs = {};
64
+ stringRequiredFields.forEach(function (s) {
65
+ mediaAttrs[s] = { type: 'string', required: true };
66
+ });
66
67
  stringFields.forEach(function (s) {
67
68
  mediaAttrs[s] = { type: 'string' };
68
69
  });
69
70
  numberFields.forEach(function (s) {
70
- mediaAttrs[s] = { type: 'integer' };
71
+ mediaAttrs[s] = { type: 'integer', required: true };
71
72
  });
72
73
  return new BuiltinComponentInterface_1.default('MediaFormat', mediaAttrs, directory, caseTypeName, prefix);
73
74
  }
@@ -0,0 +1,2 @@
1
+ import { SupportedPluginNamesType } from "./types";
2
+ export declare const registerPlugins: (pluginNames: Set<SupportedPluginNamesType>) => void;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerPlugins = void 0;
4
+ var registerPlugins = function (pluginNames) {
5
+ if (pluginNames.has('url-alias')) {
6
+ }
7
+ };
8
+ exports.registerPlugins = registerPlugins;
@@ -0,0 +1,2 @@
1
+ export declare const supportedPluginNames: readonly ["url-alias"];
2
+ export declare type SupportedPluginNamesType = typeof supportedPluginNames[number];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportedPluginNames = void 0;
4
+ exports.supportedPluginNames = [
5
+ 'url-alias',
6
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oak-digital/types-4-strapi-2",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Typescript interface generator for Strapi 4 models",
5
5
  "bin": {
6
6
  "t4s": "./bin/index.js"