All files / lib/stack/api/content-type index.js

100% Statements 8/8
100% Branches 0/0
100% Functions 3/3
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40      9x         117x                     117x 117x             117x       288x 288x     117x        
import Entry from './entry.js';
import Base from '../base.js';
 
let connection = {};
 
 
class ContentType extends Base {
  constructor(uid) {
    super(uid);
    /**
     * @constructor
     * @hideconstructor
     * @name Stack#ContentType#Entry
     * @version 2.0.0
     * @desc An entry is the actual piece of content created using one of the defined content types
     * @see {@link https://www.contentstack.com/docs/apis/content-management-api/#entries| Entries}
     */
 
 
    this.Entry = Entry(this.constructor.connection, this.uid);
    return this;
  }
 
  // static module(plural = false) {
  //   return plural ? 'ContentTypes' : 'ContentType';
  // }
  static get connection() {
    return connection;
  }
}
export default (uiConnection) => {
  connection = uiConnection;
  return new Proxy(ContentType, {
    // target = Foo
    apply(Target, thisArg, argumentsList) {
      return new Target(...argumentsList);
    }
  });
};