(config: Config)
| 132 | commitAuthor?: {}; |
| 133 | |
| 134 | constructor(config: Config) { |
| 135 | if (!config.apiRoot) { |
| 136 | throw new Error('API root is required'); |
| 137 | } |
| 138 | |
| 139 | this.apiRoot = config.apiRoot; |
| 140 | this.token = config.token || ''; |
| 141 | this.branch = config.branch || 'master'; |
| 142 | this.repo = config.repo || ''; |
| 143 | this.originRepo = config.originRepo || this.repo; |
| 144 | this.useOpenAuthoring = !!config.useOpenAuthoring; |
| 145 | this.cmsLabelPrefix = config.cmsLabelPrefix || ''; |
| 146 | this.initialWorkflowStatus = config.initialWorkflowStatus || 'draft'; |
| 147 | this.repoURL = `/repos/${this.repo}`; |
| 148 | this.originRepoURL = `/repos/${this.originRepo}`; |
| 149 | |
| 150 | const [repoParts, originRepoParts] = [this.repo.split('/'), this.originRepo.split('/')]; |
| 151 | this.repoOwner = repoParts[0]; |
| 152 | this.repoName = repoParts[1]; |
| 153 | |
| 154 | this.originRepoOwner = originRepoParts[0]; |
| 155 | this.originRepoName = originRepoParts[1]; |
| 156 | } |
| 157 | |
| 158 | static DEFAULT_COMMIT_MESSAGE = 'Automatically generated by Static CMS'; |
| 159 |
nothing calls this directly
no outgoing calls
no test coverage detected