0.0.21 • Published 4 years ago

ts-confluence-client v0.0.21

Weekly downloads
6
License
Apache-2.0
Repository
-
Last release
4 years ago

Typescript Confluence Client

A client for the Confluence Cloud API written in TypeScript.

Installation

npm install ts-confluence-client

Usage

Example of code for updating an attachment.

const confluence = new Confluence({
    host: process.env.CONFLUENCE_HOST,          // e.g. https://myconf.atlassian.net/wiki
    username: process.env.CONFLUENCE_USERNAME,  // e.g. me@email.com
    apiToken: process.env.CONFLUENCE_API_KEY    // e.g. XXXXXXXXXXXXXXXXXXXXXX
});

confluence.content.updateAttachment('294913',{        
    file: './tests/data/attachment.txt',
    comment: "",
    minorEdit: StringBoolean.true
})
    .then((pages: object[]) => {
        
    })
    .catch((err: IErrorResponse) => {
        throw new Error(`Error occurred: ${err.message}`);
    });

Development

Running tests

Before running tests you will need to define the environment variables either directly using export in your shell before running the tests or by create a .env file in the root that looks something like this:

CONFLUENCE_HOST=https://myconf.atlassian.net/wiki
CONFLUENCE_USERNAME=me@email.com
CONFLUENCE_API_KEY=XXXXXXXXXXXXXXXXXXXXXX

Then run tests using:

npm run test

Publishing a new version

Update the version number:

npm version patch # or major,minor,etc.
 

And publish with:

npm publish
0.0.21

4 years ago

0.0.20

5 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.14

6 years ago

0.0.15

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

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.1

6 years ago