translation-io-sync
Version:
This Typescript implementation acts as a `translation.io` client
22 lines (21 loc) • 657 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UrlBuilder = void 0;
const path_1 = require("path");
const PREFIX = "/api/projects";
const SCHEMA = "https://";
class UrlBuilder {
constructor(configuration) {
this.configuration = configuration;
}
synchronize() {
return `${SCHEMA}${this.configuration.hostname}${this.computePath("sync")}`;
}
init() {
return `${SCHEMA}${this.configuration.hostname}${this.computePath("init")}`;
}
computePath(action) {
return (0, path_1.join)(PREFIX, this.configuration.apiKey, action);
}
}
exports.UrlBuilder = UrlBuilder;