@oak-digital/types-4-strapi-2 1.0.0 → 1.0.1

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.
@@ -6,6 +6,7 @@ export default class ComponentInterface extends Interface {
6
6
  protected Options: Record<string, any>;
7
7
  constructor(baseName: string, namespace: Namespace, attributes: any, relativeDirectoryPath: string, category: string, fileCase: caseType, prefix?: string, options?: Record<string, any>);
8
8
  updateStrapiName(): void;
9
+ getFullName(): string;
9
10
  getInerfaceString(): string;
10
11
  getInterfaceFieldsString(): string;
11
12
  }
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const change_case_1 = require("change-case");
6
7
  const constants_1 = require("../constants");
7
8
  const Interface_1 = __importDefault(require("./Interface"));
8
9
  class ComponentInterface extends Interface_1.default {
@@ -25,6 +26,9 @@ class ComponentInterface extends Interface_1.default {
25
26
  updateStrapiName() {
26
27
  this.StrapiName = `${this.Category}.${this.getBaseName()}`;
27
28
  }
29
+ getFullName() {
30
+ return (0, change_case_1.pascalCase)(`${this.NamePrefix}.${this.getBaseName()}`);
31
+ }
28
32
  // TODO: make this more dynamic in parent
29
33
  getInerfaceString() {
30
34
  const isPopulatable = this.hasPopulatableAttributes();
@@ -4,7 +4,7 @@ import { File } from '../file/File';
4
4
  import { AttributeWithNested } from './builtinInterfaces';
5
5
  import { Namespace } from '../readers/types/content-type-reader';
6
6
  export default class Interface extends File {
7
- private NamePrefix;
7
+ protected NamePrefix: string;
8
8
  protected Attributes: Record<string, AttributeWithNested>;
9
9
  protected CollectionName: string | null;
10
10
  protected Namespace: Namespace;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oak-digital/types-4-strapi-2",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Typescript interface generator for Strapi 4 models",
5
5
  "bin": {
6
6
  "t4s": "./bin/index.js"