0.0.32 • Published 6 years ago
edgecaas v0.0.32
Edge CaaS
A javascript library for Edge CaaS API
https://developer.ibm.com/edge/caas
How to install it
Install
npm i edgecaasUpgrade to latest version
npm outdated
npm i edgecaas@latestHow to use it
React
import caas from 'edgecaas'
function App() {
caas.ensureW3idLogin('demo')
caas.get('catalogs').then((result) => {
console.log(result)
}).catch((error) => {
console.error(error);
});
...Node
const caas = require('edgecaas')
caas.basicAuth('demo', 'demo')
let catalogs = await caas.getCatalogs()
let document = await caas.getDocument('ARZdzxFe', 'html')HTML
<script src="https://unpkg.com/edgecaas@0.0.29/EdgeCaaS.js"></script> Auth functions
- basicAuth(id, secret)
- bearerAuth(token)
- getTokenCookie(token)
- setTokenCookie(token)
- deleteTokenCookie()
w3id functions
- async ensureW3idLogin(libraryId) - if user is not logged in, redirects to w3id SSO login with the current url as redirect param
- async doW3idLoginCallback() - gets the token based on the code received in query params, sets the caasToken cookie and the bearer authorization, and redirects to original url
- getW3idSSOLoginUrl(libraryId, queryString)
- async getW3idToken(code)
IBMid functions
- async ensureIBMidLogin(libraryId) - if user is not logged in, redirects to IBMid SSO login with the current url as redirect param
- async doIBMidLoginCallback() - gets the token based on the code received in query params, sets the caasToken cookie and the bearer authorization, and redirects to original url
- getIBMidSSOLoginUrl(libraryId, queryString)
- async getIBMidToken(code)
Generic API functions
- async get(path)
- async post(path, body)
- async put(path, body)
- async delete(path)
Content functions
- async getCatalogs()
- async getCatalog(catalogId)
- async getDocuments(catalogId)
- async getDocument(catalogId, documentId, language)
- async addDocument(catalogId, documentId, language, jsonBody)
- async updateDocument(catalogId, documentId, language, jsonBody)
- async deleteDocument(catalogId, documentId, language)
- async getDocumentContents(catalogId, documentId, language)
- async getDocumentContentsByIndex(catalogId, documentId, language, index)
- async getDocumentFile(catalogId, documentId, language, filePath)
0.0.32
6 years ago
0.0.31
6 years ago
0.0.30
6 years ago
0.0.25
6 years ago
0.0.26
6 years ago
0.0.27
6 years ago
0.0.28
6 years ago
0.0.29
6 years ago
0.0.24
6 years ago
0.0.23
6 years ago
0.0.22
6 years ago
0.0.21
6 years ago
0.0.20
6 years ago
0.0.19
6 years ago
0.0.16
6 years ago
0.0.17
6 years ago
0.0.18
6 years ago
0.0.10
6 years ago
0.0.11
6 years ago
0.0.12
6 years ago
0.0.13
6 years ago
0.0.14
6 years ago
0.0.15
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago