@jorsek/cms-api-v1
The official wrapper for the easyDITA CMS API v1
Last updated 2 months ago by pboz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @jorsek/cms-api-v1 
SYNC missed versions from official npm registry.

easyDITA CMS API Wrapper

The goal of this repo is to be a super-simple wrapper for the easyDITA CMS API. This wrapper uses CMS API v1, v2 is currently being built, you will likely need to migrate your code when v2 is released.

Note: There is no typing implemented. It's unlikely that we'll implement types before creating a new project for v2, as much as I'd love to.

Usage

import cmsAPI, {cmsAPIUtil} from '@jorsek/cms-api-v1';

const cmsAPIConnection = cmsAPI({
  subdomain: 'your-org.easydita.com',
  email: 'your@username.com',
  token: 'yourGeneratedToken'
})

// if you want to use the utils...
const cmsAPIUtils = cmsAPIUtil(cmsAPIConnection);


try {
  const res = await cmsAPIConnection(`${uuid}/metadata`);

} catch (e) {
  
  if (e instanceOf Errors.Authentication) {
    
  }
}

Running tests

In order to run the test suite, you must have a keys.json file with the following structure:

{
  "CMS_ORG": "",
  "CMS_SUBDOMAIN": "",
  "CMS_API_USER": "",
	"CMS_API_USER_TOKEN": "",
	"testing_values": {
		"folder_uuid_for_create":"",
		"example_map_uuid":"",
		"example_topic_1_uuid":"",
    "example_topic_1_path":""
	}
}

Current Tags

  • 1.0.2                                ...           latest (2 months ago)

7 Versions

  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
  • 1.0.0                                ...           2 months ago
  • 0.0.4                                ...           2 months ago
  • 0.0.3                                ...           2 months ago
  • 0.0.2                                ...           2 months ago
  • 0.0.1                                ...           2 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |