@frontitude/cli
Version:
The Frontitude CLI enables product teams to integrate their code with Frontitude (frontitude.com), thus creating a single source of truth for their product copy, from design to development.
1 lines • 1.71 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.mapTagNamesToIds=exports.getSettings=exports.getWorkspaceLocales=exports.pullCopyLibrary=exports.getWorkspaceProjects=void 0;const tslib_1=require("tslib"),fetch_1=tslib_1.__importDefault(require("./fetch")),envConfig_1=tslib_1.__importDefault(require("../../envConfig")),ErrorNames=tslib_1.__importStar(require("../../common/constants/ErrorNames"));async function getWorkspaceProjects(){const e={method:"POST",type:"json",body:JSON.stringify({})};return(0,fetch_1.default)(`${envConfig_1.default.SERVER_URL}/workspace/get_projects`,e)}async function pullCopyLibrary(e){try{const t={method:"POST",type:"json",body:JSON.stringify(e)};return await(0,fetch_1.default)(`${envConfig_1.default.SERVER_URL}/workspace/export_text_component`,t)}catch(e){throw"HTTP_CODE_405"===e.name&&(e.name=ErrorNames.PERMISSION_DENIED_DEVELOPER_INTEGRATION_IS_TURNED_OFF),e}}async function getWorkspaceLocales(){const e={method:"POST",type:"json",body:JSON.stringify({})};return(0,fetch_1.default)(`${envConfig_1.default.SERVER_URL}/workspace/get_workspace_locales`,e)}async function getSettings(){const e={method:"POST",type:"json",body:JSON.stringify({})};return(0,fetch_1.default)(`${envConfig_1.default.SERVER_URL}/workspace/get_settings`,e)}async function mapTagNamesToIds(e){const t={method:"POST",type:"json",body:JSON.stringify({tagNames:e})};return(0,fetch_1.default)(`${envConfig_1.default.SERVER_URL}/workspace/map_tag_names_to_ids`,t)}exports.getWorkspaceProjects=getWorkspaceProjects,exports.pullCopyLibrary=pullCopyLibrary,exports.getWorkspaceLocales=getWorkspaceLocales,exports.getSettings=getSettings,exports.mapTagNamesToIds=mapTagNamesToIds;