MCPcopy Create free account
hub / github.com/decaporg/decap-cms / constructor

Method constructor

packages/decap-cms-backend-github/src/API.ts:256–280  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

254 commitAuthor?: {};
255
256 constructor(config: Config) {
257 this.apiRoot = config.apiRoot || 'https://api.github.com';
258 this.token = config.token || '';
259 this.tokenKeyword = config.tokenKeyword || 'token';
260 this.branch = config.branch || 'master';
261 this.useOpenAuthoring = config.useOpenAuthoring;
262 this.repo = config.repo || '';
263 this.originRepo = config.originRepo || this.repo;
264 this.repoURL = `/repos/${this.repo}`;
265 // when not in 'useOpenAuthoring' mode originRepoURL === repoURL
266 this.originRepoURL = `/repos/${this.originRepo}`;
267
268 const [repoParts, originRepoParts] = [this.repo.split('/'), this.originRepo.split('/')];
269 this.repoOwner = repoParts[0];
270 this.repoName = repoParts[1];
271
272 this.originRepoOwner = originRepoParts[0];
273 this.originRepoName = originRepoParts[1];
274
275 this.mergeMethod = config.squashMerges ? 'squash' : 'merge';
276 this.cmsLabelPrefix = config.cmsLabelPrefix;
277 this.initialWorkflowStatus = config.initialWorkflowStatus;
278 this.baseUrl = config.baseUrl;
279 this.getUser = config.getUser;
280 }
281
282 static DEFAULT_COMMIT_MESSAGE = 'Automatically generated by Decap CMS';
283

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected