<commit_before>var agent = require('superagent');
var PAGES_URI = '/xms/api/pages';
var PAGE_URI = '/xms/api/pages/{id}';
var format = require("string-template")

var defPages = [{"_id":"549394dd0e22880de0000001","view":"index","content":"This is a test","title":"Test Title","createdOn":1418956973794,"createdBy":"kev_nz"},{"_id":"549395360e22880de0000002","view":"index","content":"Another Test","title":"Another Test Title","createdOn":1418958114420,"createdBy":"kev_nz"},{"_id":"54939de1972a76e2e8000001","view":"index","content":"A third","title":"Third Test Title","createdOn":1418960039157,"createdBy":"kev_nz"}];

var PagesClient = {
    
    getPages: function (callback) {
        agent
            .get(PAGES_URI)
            .end(callback);
    },
    addPage: function (page, callback) {
        agent
            .post(PAGES_URI)
            .send(page)
            .set('Accept', 'application/json')
            .end(callback);
    },
    editPage: function (page, callback) {
        agent
            .post(format(PAGE_URI, {id: page._id})
            .send(page)
            .set('Accept', 'application/json')
            .end(callback);
    }
};

module.exports = PagesClient;<commit_msg>handle additional states of the pages<commit_after>import agent from 'superagent';
import format from 'string-template';

const PAGES_URI = '/xms/api/pages';
const PAGE_URI = '/xms/api/pages/{id}';
const PUBLISHED_PAGES_URI = '/xms/api/pages/published';
const DRAFT_PAGES_URI = '/xms/api/pages/draft';
const QUEUED_PAGES_URI = '/xms/api/pages/queued';
const DELETED_PAGES_URI = '/xms/api/pages/deleted';

var PagesClient = {
    
    
    getPages: function (callback) {
        agent
            .get(PAGES_URI)
            .end(callback);
    },
    addPage: function (page, callback) {
        agent
            .post(PAGES_URI)
            .send(page)
            .set('Accept', 'application/json')
            .end(callback);
    },
    editPage: function (page, callback) {
        agent
            .post(format(PAGE_URI, {id: page._id})
            .send(page)
            .set('Accept', 'application/json')
            .end(callback);
    }
};

module.exports = PagesClient;
{'fraction_non_alphanumeric': 0.16255707762557078, 'fraction_numerical': 0.04474885844748858, 'mean_word_length': 2.8641975308641974, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '770611', 'n_tokens_mistral': 781, 'n_tokens_neox': 697, 'n_words': 119}