travelling-sdk

1.2.1 • Public • Published

Classes

Travelling
Config
Groups
GroupsType
Group
GroupUsers
GroupUser
GroupType
GroupTypeUsers

Both requests are disabled. Dont use.

GroupTypeUser
GroupRequest
GroupRequestUser
Users
UsersDomain
User
UserCurrent
Auth

Auth endpoints

AuthToken
AuthDomain
AuthDomainToken

Functions

SDK(host, opts)

SDK - importing the SDK for use

Travelling

Kind: global class

Travelling.healthCheck(authorization_bearer)

healthCheck - server's health check

Path: health

Kind: static method of Travelling

Param Type Description
authorization_bearer string The client_credentials generated OAUth2 access token.

Travelling.metrics(authorization_bearer)

metrics - servers metrics

Path: metrics

Kind: static method of Travelling

Param Type Description
authorization_bearer string The client_credentials generated OAUth2 access token.

Config

Kind: global class

Config.getProperty(property, authorization_bearer)

getProperty - Gets a property from travellings config.

Path: api/v1/config/:property

Kind: static method of Config

Param Type Description
property any (example: password)
authorization_bearer string The client_credentials generated OAUth2 access token.

Groups

Kind: global class

Groups.export(authorization_bearer)

export - Exports all groups in the proper format to be imported.

Path: api/v1/groups/export

Kind: static method of Groups

Param Type Description
authorization_bearer string The client_credentials generated OAUth2 access token.

Groups.import(body, authorization_bearer)

import - Imports all groups from the exported format.

Path: api/v1/groups/import

Kind: static method of Groups

Param Type Description
body Object
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
    "group": {
        "anonymous": {
            "type": "group",
            "allowed": [
                {
                    "route": "/travelling/portal/*",
                    "host": null,
                    "name": "*-travelling-portal-*"
                },
                {
                    "route": "/travelling/api/v1/auth/*",
                    "host": null,
                    "name": "*-travelling-api-v1-auth-*"
                },
                {
                    "route": "/travelling/api/v1/user/me/route/allowed",
                    "host": null,
                    "method": "GET",
                    "name": "get-travelling-api-v1-user-me-route-allowed"
                },
                {
                    "route": "/travelling/api/v1/user/me/permission/allowed/*",
                    "host": null,
                    "method": "GET",
                    "name": "get-travelling-api-v1-user-me-permission-allowed-*"
                },
                {
                    "route": "/travelling/assets/*",
                    "host": null,
                    "removeFromPath": "/travelling/assets/",
                    "method": "GET",
                    "name": "get-travelling-assets-*"
                },
                {
                    "route": "/travelling/api/v1/config/password",
                    "host": null,
                    "method": "GET",
                    "name": "get-travelling-api-v1-config-password"
                },
                {
                    "route": "/favicon.ico",
                    "host": null,
                    "method": "GET",
                    "name": "get-favicon.ico"
                }
            ],
            "inherited": null,
            "is_default": false
        },
        "group3": {
            "type": "group",
            "allowed": null,
            "inherited": [
                "testgroup|group1",
                "group|group2"
            ],
            "is_default": false
        },
        "superadmin": {
            "type": "group",
            "allowed": [
                {
                    "host": null,
                    "route": "/travelling/*",
                    "name": "*-travelling-*"
                },
                {
                    "name": "test-one-*-three"
                }
            ],
            "inherited": [
                "group|anonymous"
            ],
            "is_default": false
        },
        "group4": {
            "type": "group",
            "allowed": null,
            "inherited": [],
            "is_default": false
        },
        "group2": {
            "type": "group",
            "allowed": [
                {
                    "route": "/test/get",
                    "host": "https://127.0.0.1:4268/:username/:group",
                    "removeFromPath": "/test/get",
                    "method": "GET",
                    "name": "get-test-get"
                },
                {
                    "route": "/test/post",
                    "host": "http://127.0.0.1:4267/?id=:id&permission=:permission",
                    "removeFromPath": "/test/post",
                    "method": "POST",
                    "name": "post-test-post"
                }
            ],
            "inherited": [
                "testgroup|group1"
            ],
            "is_default": false
        },
        "group5": {
            "type": "group",
            "allowed": [
                {
                    "route": "/test/delete/:grouptype",
                    "host": "https://127.0.0.1:4268",
                    "removeFromPath": "/test/delete",
                    "method": "DELETE",
                    "name": "delete-test-delete-:grouptype"
                }
            ],
            "inherited": [
                "group|group4",
                "group|superadmin"
            ],
            "is_default": true
        },
        "group1": {
            "type": "group",
            "allowed": null,
            "inherited": null,
            "is_default": false
        }
    },
    "testgroup": {
        "group1": {
            "type": "testgroup",
            "allowed": null,
            "inherited": [
                "group|group4"
            ],
            "is_default": false
        },
        "superadmin": {
            "type": "testgroup",
            "allowed": null,
            "inherited": null,
            "is_default": false
        }
    }
}

Groups.get(authorization_bearer)

get - Get all the groups

Path: api/v1/groups

Kind: static method of Groups

Param Type Description
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupsType

Kind: global class

GroupsType.all(type, authorization_bearer)

all - Gets all groups of a particular type

Path: api/v1/groups/type/:type

Kind: static method of GroupsType

Param Type Description
type any The type of the group
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupsType.getTypesList(authorization_bearer)

getTypesList - Gets all the types of groups currently made.

Path: api/v1/groups/types

Kind: static method of GroupsType

Param Type Description
authorization_bearer string The client_credentials generated OAUth2 access token.

Group

Kind: global class

Group.addPermission(id, permission, authorization_bearer)

addPermission - Adds a permission to a group.

Path: api/v1/group/id/:id/insert/permission/:permission

Kind: static method of Group

Param Type Description
id any Name of the group (example: anonymous)
permission any Permission (example: test-one-two-*)
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.deletePermission(id, permission, authorization_bearer)

deletePermission - Removes a permission/route from a group.

Path: api/v1/group/id/:id/permission/:permission

Kind: static method of Group

Param Type Description
id any Name of the group (example: anonymous)
permission any Name or Route (example: test-one-two-*)
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.addRoute(body, id, authorization_bearer)

addRoute - Adds a route to a group.

{
    "route": "test/permissions/*", // optional
    "host": null, // optional, defaults to travelling host
    "method": "*", // optional, defaults to '*'
    "remove_from_path": 'test/', // optional 
    "name": "test-permissions-*"  // Required and needs to be unqiue, defaults to method + route seperated by '-' instead of `/`
}

Path: api/v1/group/id/:id/insert/route

Kind: static method of Group

Param Type Description
body Object
id any
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"route": "test/permissions/*",
    "host": null, 
    "method": "*", 
    "name": "test-permissions-*"  
}

Group.removeInheritance(id, inherited, grouptype, authorization_bearer)

removeInheritance - Removes an inheritance from a group.

Path: api/v1/group/id/:id/remove/inheritance/:inherited/type/:grouptype

Kind: static method of Group

Param Type Description
id any Name of the group (example: test1234)
inherited any Name of the group to inherit from (example: group4)
grouptype any The type of the inherited group
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.inheritFrom(id, inherited, grouptype, authorization_bearer)

inheritFrom - Adds an inheritance to a group.

Path: api/v1/group/id/:id/inherit/from/:inherited/type/:grouptype

Kind: static method of Group

Param Type Description
id any Name of the group (example: test1234)
inherited any Name of the group to inherit from (example: group4)
grouptype any The type of the inherited group
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.setDefault(id, authorization_bearer)

setDefault - Sets the group to be the default group for new users.

Path: api/v1/group/id/:id/set/default

Kind: static method of Group

Param Type Description
id any id or name (example: group6)
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.delete(id, authorization_bearer)

delete - delete group by its id or name

Path: api/v1/group/id/:id

Kind: static method of Group

Param Type Description
id any id or name
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.edit(body, id, authorization_bearer)

edit - Edits a group

Path: api/v1/group/id/:id

Kind: static method of Group

Param Type Description
body Object
id any (example: ab31efc8-40a5-4d38-a347-adb4e38d0075)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
    "allowed": [
        {
            "route": "/travelling/portal/*",
            "host": null,
            "remove_from_path": "/travelling/portal",
            "method": "*",
            "name": "*-travelling-portal-*"
        },
        {
            "route": "/travelling/api/v1/auth/*",
            "host": null,
            "method": "*",
            "name": "*-travelling-api-v1-auth-*"
        },
        {
            "route": "/travelling/api/v1/user/me/route/allowed",
            "host": null,
            "method": "GET",
            "name": "get-travelling-api-v1-user-me-route-allowed"
        },
        {
            "route": "/travelling/api/v1/user/me/permission/allowed/*",
            "host": null,
            "method": "GET",
            "name": "get-travelling-api-v1-user-me-permission-allowed-*"
        },
        {
            "route": "/travelling/assets/*",
            "host": null,
            "remove_from_path": "/travelling/assets/",
            "method": "*",
            "name": "*-travelling-assets-*"
        },
        {
            "route": "travelling/api/v1/config/password",
            "host": null,
            "method": "get"
        }
    ]
}

Group.get(id, authorization_bearer)

get - Get a group by it's id or name.

Path: api/v1/group/id/:id

Kind: static method of Group

Param Type Description
id any id or name (example: group1)
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.createByName(id, authorization_bearer)

createByName - Add a new blank group with the set name.

Path: api/v1/group/id/:id

Kind: static method of Group

Param Type Description
id any Name of the new group (example: test123)
authorization_bearer string The client_credentials generated OAUth2 access token.

Group.create(body, authorization_bearer)

create - Add a new group

Path: api/v1/group

Kind: static method of Group

Param Type Description
body Object
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
    "name": "group1",
    "type": "accounts",
    "allowed": [
        {
            "route": "/test",
            "host": "http://127.0.0.1:1237/",
            "remove_from_path": "test",
            "method": "*",
            "name": "all-test"
        }
    ],
    "is_default": false
}

GroupUsers

Kind: global class

GroupUsers.inherited(id)

inherited - Gets all the users that belong to the group and all of its inherited groups.

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/group/id/:id/users/inherited

Kind: static method of GroupUsers

Param Type Description
id any id or name (example: superadmin)

GroupUsers.get(id)

get - Gets all the users that belong to the group.

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/group/id/:id/users

Kind: static method of GroupUsers

Param Type Description
id any id or name (example: superadmin)

GroupUser

Kind: global class

GroupUser.delete(group, type, id, authorization_bearer)

delete - Delete a user by it's id or username from group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id

Kind: static method of GroupUser

Param Type Description
group any id or name of the group
type any The type of the group (example: accounts)
id any id or name (example: user7)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupUser.removeGroupInheritance(group, type, id, inheritgroupid, inheritgrouptype, authorization_bearer)

removeGroupInheritance - Remove a user to a group of a particular type of group.

Path: api/v1/group/id/:group/type/:type/user/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of GroupUser

Param Type Description
group any id or name of the group (example: group1)
type any type of group (example: group)
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupUser.addGroupInheritance(group, type, id, inheritgroupid, inheritgrouptype, authorization_bearer)

addGroupInheritance - Add a group for the current user from a group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of GroupUser

Param Type Description
group any id or name of the group (example: group1)
type any type of group (example: group)
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupUser.editPropertyValue(group, type, id, property, value, authorization_bearer)

editPropertyValue - Edit a current user's property data as a path param from a group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id/property/:property/:value

Kind: static method of GroupUser

Param Type Description
group any id or name of the group
type any The type of the group (example: group)
id any id or name (example: user5)
property any (example: email)
value any (example: swag@yolo.com)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupUser.editProperty(body, group, type, id, property, authorization_bearer)

editProperty - Edit a user's property by it's id or username from a group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id/property/:property

Kind: static method of GroupUser

Param Type Description
body Object
group any id or name of the group
type any The type of the group (example: accounts)
id any id or name (example: user6)
property any (example: email)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"locked": false
}

GroupUser.edit(body, group, type, id, authorization_bearer)

edit - Edit a user by it's id or username from group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id

Kind: static method of GroupUser

Param Type Description
body Object
group any id or name of the group
type any The type of the group (example: accounts)
id any id or name (example: user6)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"locked": false
}

GroupUser.getProperty(group, type, id, property, authorization_bearer)

getProperty - Get a user's property by it's id or username from group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id/property/:property

Kind: static method of GroupUser

Param Type Description
group any id or name of the group
type any The type of the group (example: accounts)
id any id or name (example: user6)
property any (example: email)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupUser.get(group, type, id, authorization_bearer)

get - Get a user by it's id or username from group of a particular type.

Path: api/v1/group/id/:group/type/:type/user/:id

Kind: static method of GroupUser

Param Type Description
group any id or name of the group
type any The type of the group (example: accounts)
id any id or name (example: user6)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType

Kind: global class

GroupType.deletePermission(id, type, permission, authorization_bearer)

deletePermission - Removes a permission/route from a group of a particular type.

Path: api/v1/group/id/:id/type/:type/permission/:permission

Kind: static method of GroupType

Param Type Description
id any Name of the group (example: anonymous)
type any Type of the group (example: group)
permission any Name or Route (example: test-one-three-*)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.addPermission(id, type, permission, authorization_bearer)

addPermission - Adds a permission to a group of a particular type.

Path: api/v1/group/id/:id/type/:type/insert/permission/:permission

Kind: static method of GroupType

Param Type Description
id any Name of the group (example: anonymous)
type any Type of the group (example: group)
permission any Permission (example: test-one-three-*)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.addRoute(body, id, type, authorization_bearer)

addRoute - Adds a route to a group of a particular type.

{
    "route": "test/permissions/*", // optional
    "host": null, // optional, defaults to travelling host
    "method": "*", // optional, defaults to '*'
    "remove_from_path": 'test/', // optional 
    "name": "test-permissions-*"  // Required and needs to be unqiue, defaults to method + route seperated by '-' instead of `/`
}

Path: api/v1/group/id/:id/type/:type/insert/route

Kind: static method of GroupType

Param Type Description
body Object
id any Name of the group
type any
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"route": "test/permissions/*",
    "host": null, 
    "method": "*", 
    "name": "test-permissions-*"  
}

GroupType.removeInheritance(id, type, inherited, grouptype, authorization_bearer)

removeInheritance - Removes an inheritance from a group of a particular type.

Path: api/v1/group/id/:id/type/:type/remove/inheritance/:inherited/type/:grouptype

Kind: static method of GroupType

Param Type Description
id any Name of the group (example: test1234)
type any The type of the group (example: accounts)
inherited any Name of the group to inherit from (example: superadmin)
grouptype any The type of the inherited group
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.inheritFrom(id, type, inherited, grouptype, authorization_bearer)

inheritFrom - Adds an inheritance to a group of a particular type.

Path: api/v1/group/id/:id/type/:type/inherit/from/:inherited/type/:grouptype

Kind: static method of GroupType

Param Type Description
id any Name of the group (example: group1)
type any The type of the group (example: testgroup)
inherited any Name of the group to inherit from (example: test123)
grouptype any The type of the inherited group
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.setDefault(id, type)

setDefault - Sets the group of a particular type to be the default group for new users.

Path: api/v1/group/id/:id/type/:type/set/default

Kind: static method of GroupType

Param Type Description
id any id or name (example: group1)
type any The type of the group (example: account)

GroupType.delete(id, type, authorization_bearer)

delete - delete group of a particular type by its name or id

Path: api/v1/group/id/:id/type/:type

Kind: static method of GroupType

Param Type Description
id any id or name
type any The type of the group
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.get(id, type, authorization_bearer)

get - Get a group by it's id or name of a particular type.

Path: api/v1/group/id/:id/type/:type

Kind: static method of GroupType

Param Type Description
id any id or name (example: group1)
type any The type of the group (example: accounts)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.edit(body, id, type, authorization_bearer)

edit - Edits a group of a particular type

Path: api/v1/group/id/:id/type/:type

Kind: static method of GroupType

Param Type Description
body Object
id any id or name
type any The type of the group
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{"inherited":["a717b880-b17b-4995-9610-cf451a06d015","7ec8c351-7b8a-4ea8-95cc-0d990b225768"]}

GroupType.createByName(id, type, authorization_bearer)

createByName - Add a new blank group with the set name and type

Path: api/v1/group/id/:id/type/:type

Kind: static method of GroupType

Param Type Description
id any Name of the new group (example: test1234)
type any Type of the new group (example: accounts)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupType.create(body, type, authorization_bearer)

create - Add a new group of a particular type

Path: api/v1/group/type/:type

Kind: static method of GroupType

Param Type Description
body Object
type any The type of the group
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
    "name": "group1",
    "type": "accounts",
    "allowed": [
        {
            "route": "/test",
            "host": "http://127.0.0.1:1237/",
            "remove_from_path": "test",
            "method": "*",
            "name": "all-test"
        }
    ],
    "is_default": false
}

GroupTypeUsers

Both requests are disabled. Dont use.

Kind: global class

GroupTypeUsers.get(id, type)

get - Gets all the users that belong to the group of a particular type by its name or id.

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/group/id/:id/type/:type/users

Kind: static method of GroupTypeUsers

Param Type
id any
type any

GroupTypeUsers.inherited(id, type)

inherited - Gets all the users that belong to the group of a particular type by its name or id and all of its inherited groups.

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/group/id/:id/type/:type/users/inherited

Kind: static method of GroupTypeUsers

Param Type Description
id any (example: group4)
type any The type of the group (example: groups)

GroupTypeUser

Kind: global class

GroupTypeUser.delete(type, id, authorization_bearer)

delete - Delete a user by it's id or username from group of a particular type.

Path: api/v1/group/type/:type/user/:id

Kind: static method of GroupTypeUser

Param Type Description
type any The type of the group (example: accounts)
id any id or name (example: user7)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupTypeUser.removeGroupInheritance(type, id, inheritgroupid, inheritgrouptype, authorization_bearer)

removeGroupInheritance - Remove a user to a group of a particular type of group.

Path: api/v1/group/type/:type/user/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of GroupTypeUser

Param Type Description
type any type of group (example: group)
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupTypeUser.addGroupInheritance(type, id, inheritgroupid, inheritgrouptype, authorization_bearer)

addGroupInheritance - Add a user to a group of a particular type of group.

Path: api/v1/group/type/:type/user/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of GroupTypeUser

Param Type Description
type any type of group (example: group)
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupTypeUser.editPropertyValue(type, id, property, value, authorization_bearer)

editPropertyValue - Edit a current user's property data as a path param from a group of a particular type.

Path: api/v1/group/type/:type/user/:id/property/:property/:value

Kind: static method of GroupTypeUser

Param Type Description
type any The type of the group (example: group)
id any id or name (example: user5)
property any (example: email)
value any (example: swag@yolo.com)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupTypeUser.editProperty(body, type, id, property, authorization_bearer)

editProperty - Edit a user's property by it's id or username from a group of a particular type.

Path: api/v1/group/type/:type/user/:id/property/:property

Kind: static method of GroupTypeUser

Param Type Description
body Object
type any The type of the group (example: accounts)
id any id or name (example: user6)
property any (example: email)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"locked": false
}

GroupTypeUser.edit(body, type, id, authorization_bearer)

edit - Edit a user by it's id or username from group of a particular type.

Path: api/v1/group/type/:type/user/:id

Kind: static method of GroupTypeUser

Param Type Description
body Object
type any The type of the group (example: accounts)
id any id or name (example: user6)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"locked": false
}

GroupTypeUser.getProperty(type, id, property, authorization_bearer)

getProperty - Get a user's property by it's id or username from group of a particular type.

Path: api/v1/group/type/:type/user/:id/property/:property

Kind: static method of GroupTypeUser

Param Type Description
type any The type of the group (example: accounts)
id any id or name (example: user6)
property any (example: email)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupTypeUser.get(type, id, authorization_bearer)

get - Get a user by it's id or username from group of a particular type.

Path: api/v1/group/type/:type/user/:id

Kind: static method of GroupTypeUser

Param Type Description
type any The type of the group (example: accounts)
id any id or name (example: user6)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupRequest

Kind: global class

GroupRequestUser

Kind: global class

GroupRequestUser.delete(body, type, id, authorization_bearer)

delete - Delete a user by it's id or username from the user's group_request of a particular type.

Path: api/v1/group/request/type/:type/user/:id

Kind: static method of GroupRequestUser

Param Type Description
body Object
type any (example: testgroup)
id any (example: user69)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"locked": false
}

GroupRequestUser.addGroupInheritance(type, id, inheritgroupid, inheritgrouptype, authorization_bearer)

addGroupInheritance - Add a user to a group from the user's group_request of a particular type.

Path: api/v1/group/request/type/:type/user/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of GroupRequestUser

Param Type Description
type any type of group (example: group)
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

GroupRequestUser.editProperty(body, type, id, property, authorization_bearer)

editProperty - Edit a user's property by it's id or username from the user's group_request of a particular type.

Path: api/v1/group/request/type/:type/user/:id/property/:property

Kind: static method of GroupRequestUser

Param Type Description
body Object
type any (example: accounts)
id any (example: user6)
property any (example: email)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

"chad@yolo.com"

GroupRequestUser.edit(body, type, id, authorization_bearer)

edit - Edit a user by it's id or username from the user's group_request of a particular type.

Path: api/v1/group/request/type/:type/user/:id

Kind: static method of GroupRequestUser

Param Type Description
body Object
type any (example: accounts)
id any (example: user6)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"locked": false
}

Users

Kind: global class

Users.byGroupRequest(group_request, authorization_bearer)

byGroupRequest - Gets all the users that have the specified group request

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/users/group/request/:group_request

Kind: static method of Users

Param Type Description
group_request any name of the group (example: superadmin)
authorization_bearer string The client_credentials generated OAUth2 access token.

Users.get(sort, limit, filter, sortdir, authorization_bearer)

get - Gets all the users

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/users

Kind: static method of Users

Param Type Description
sort any (example: created_on)
limit any (example: 200)
filter any (example: locked=false)
sortdir any (example: ASC)
authorization_bearer string The client_credentials generated OAUth2 access token.

UsersDomain

Kind: global class

UsersDomain.get(domain, sort, limit, filter, sortdir, authorization_bearer)

get - Gets all the users

Optional Query Params
Param Description
id optional (example: 26c6aeff-ab95-4bdd-8260-534cf92d1c23)
username optional (example: user7)
locked optional (example: true)
locked_reason optional (example: Activation Required email your admin to get your account activated)
group_request optional (example: superadmin)
failed_login_attempts optional (example: 0)
change_username optional (example: false)
change_password optional (example: false)
reset_password optional (example: false)
email_verify optional (example: false)
group_id optional (example: 7320292c-627e-4e5a-b059-583eabdd6264)
email optional (example: test@test.ai)
created_on optional (example: 1568419646794)
last_login optional (example: null)

Path: api/v1/users/domain/:domain

Kind: static method of UsersDomain

Param Type Description
domain any (example: traziventures.com)
sort any (example: created_on)
limit any (example: 200)
filter any (example: locked=false)
sortdir any (example: ASC)
authorization_bearer string The client_credentials generated OAUth2 access token.

User

Kind: global class

User.delete(id, authorization_bearer)

delete - Delete a user by it's Id.

Path: api/v1/user/id/:id

Kind: static method of User

Param Type Description
id any Id or Username (example: 39A2BC37-61AE-434C-B245-A731A27CF8DA)
authorization_bearer string The client_credentials generated OAUth2 access token.

User.removeGroupInheritance(id, inheritgroupid, inheritgrouptype, authorization_bearer)

removeGroupInheritance - Remove a user from a group.

Path: api/v1/user/id/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of User

Param Type Description
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

User.addGroupInheritance(id, inheritgroupid, inheritgrouptype, authorization_bearer)

addGroupInheritance - Add a user to a group.

Path: api/v1/user/id/:id/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of User

Param Type Description
id any id or name of the user (example: user5)
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

User.editPropertyValue(id, property, value, authorization_bearer)

editPropertyValue - Edit a current user's property data as a path param.

Path: api/v1/user/id/:id/property/:property/:value

Kind: static method of User

Param Type Description
id any Id or Username
property any (example: group_id)
value any (example: 595d3f9a-5383-4da9-a465-b975d8a5e28e)
authorization_bearer string The client_credentials generated OAUth2 access token.

User.editProperty(body, id, property, authorization_bearer)

editProperty - Edit a user's property by id.

Path: api/v1/user/id/:id/property/:property

Kind: static method of User

Param Type Description
body Object
id any Id or Username (example: 39A2BC37-61AE-434C-B245-A731A27CF8DA)
property any
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

user6

User.edit(body, id, authorization_bearer)

edit - Edit a user's by id.

Path: api/v1/user/id/:id

Kind: static method of User

Param Type Description
body Object
id any Id or Username (example: 39A2BC37-61AE-434C-B245-A731A27CF8DA)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"username" : "user6",
	"password" : "Awickednewawesomepasword4242!@"
}

User.getProperty(id, property, authorization_bearer)

getProperty - Get a user's property by it's id.

Path: api/v1/user/id/:id/property/:property

Kind: static method of User

Param Type Description
id any Id or Username (example: 39A2BC37-61AE-434C-B245-A731A27CF8DA)
property any
authorization_bearer string The client_credentials generated OAUth2 access token.

User.get(id, authorization_bearer)

get - Get a user by it's id.

Path: api/v1/user/id/:id

Kind: static method of User

Param Type Description
id any (example: 39A2BC37-61AE-434C-B245-A731A27CF8DA)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent

Kind: global class

UserCurrent.registerToken(body, authorization_bearer)

registerToken - Registers a new credentials service for client_credentials based access token auth.

Path: api/v1/user/me/token

Kind: static method of UserCurrent

Param Type Description
body Object
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"name": "conversate"
}

UserCurrent.removeGroupInheritance(inheritgroupid, inheritgrouptype, authorization_bearer)

removeGroupInheritance - Remove a user from a group.

Path: api/v1/user/me/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of UserCurrent

Param Type Description
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.addGroupInheritance(inheritgroupid, inheritgrouptype, authorization_bearer)

addGroupInheritance - Add a user to a group.

Path: api/v1/user/me/inheritance/group/:inheritgroupid/type/:inheritgrouptype

Kind: static method of UserCurrent

Param Type Description
inheritgroupid any id or name of the group to inherit (example: group2)
inheritgrouptype any type of the group to inherit (example: group)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.editPropertyValue(property, value, authorization_bearer)

editPropertyValue - Edit a current user's property data as a path param.

Path: api/v1/user/me/property/:property/:value

Kind: static method of UserCurrent

Param Type Description
property any (example: group_id)
value any (example: 595d3f9a-5383-4da9-a465-b975d8a5e28e)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.editProperty(body, property, authorization_bearer)

editProperty - Edit a current user's property data.

Path: api/v1/user/me/property/:property

Kind: static method of UserCurrent

Param Type Description
body Object
property any (example: user_data)
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
	"test": 123
}

UserCurrent.deleteToken(id, authorization_bearer)

deleteToken - Deletes a client_credentials based access token auth.

Path: api/v1/user/me/token/:id

Kind: static method of UserCurrent

Param Type Description
id any id or name of the token
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.edit(body, authorization_bearer)

edit - Updates the current logged in user.

Path: api/v1/user/me

Kind: static method of UserCurrent

Param Type Description
body Object
authorization_bearer string The client_credentials generated OAUth2 access token.

Example
body

{
    "username": "user6",
    "password": "Awickednewawesomepasword4242!@"
}

UserCurrent.getProperty(property, authorization_bearer)

getProperty - Gets the currently logged in user's single property

Path: api/v1/user/me/property/:property

Kind: static method of UserCurrent

Param Type Description
property any (example: username)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.routeCheck(method, route, authorization_bearer)

routeCheck - Checks if current logged in user can access the route with method.

Path: api/v1/user/me/route/allowed

Kind: static method of UserCurrent

Param Type Description
method any (example: get)
route any (example: /travelling/api/v1/group/request/type/anonymous/user/)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.permissionCheck(permission, authorization_bearer)

permissionCheck - Checks to see if the current user can access content based on permission.

Path: api/v1/user/me/permission/allowed/:permission

Kind: static method of UserCurrent

Param Type Description
permission any name of the route/permission (example: get-travelling)
authorization_bearer string The client_credentials generated OAUth2 access token.

UserCurrent.get(authorization_bearer)

get - Gets the currently logged in user

Path: api/v1/user/me

Kind: static method of UserCurrent

Param Type Description
authorization_bearer string The client_credentials generated OAUth2 access token.

Auth

Auth endpoints

Kind: global class

Auth.accessToken()

accessToken - Oauth2 client_credentials access token flow. Body must be application/x-www-form-urlencoded and must contain the grant_type. client_id & client_secret will be sent in a Basic Authorization header as base64(client_id:client_secret)

Path: api/v1/auth/token

Kind: static method of Auth

Auth.authorize(client_id, response_type, state, redirect_uri, group_request)

authorize - Authorization Code Grant

Path: api/v1/auth/oauth/authorize

Kind: static method of Auth

Param Type
client_id any
response_type any
state any
redirect_uri any
group_request any

Auth.activate(token)

activate - Activates and unlocks user

Path: api/v1/auth/activate

Kind: static method of Auth

Param Type Description
token any (example: activation_token)

Auth.resetPasswordAutoLogin(body, token)

resetPasswordAutoLogin - Resets the password if the recovery token is valid of the user, then authenticates the user and returns cookies.

Path: api/v1/auth/password/reset/login

Kind: static method of Auth

Param Type Description
body Object
token any (example: [thegeneratedtoken])

Example
body

{
	"password":"asdf"
}

Auth.resetPassword(body, token)

resetPassword - Resets the password if the recovery token is valid of the user.

Path: api/v1/auth/password/reset

Kind: static method of Auth

Param Type Description
body Object
token any (example: [thegeneratedtoken])

Example
body

{
	"password":"asdf"
}

Auth.forgotPassword(body)

forgotPassword - Generates a recovery token and sends a email to the attached user (if they exist)

Path: api/v1/auth/password/forgot

Kind: static method of Auth

Param Type
body Object

Example
body

{
	"email": "test@test.com"
}

Auth.logout()

logout -

Path: api/v1/auth/logout

Kind: static method of Auth

Auth.login(body)

login - Register a user

Path: api/v1/auth/login

Kind: static method of Auth

Param Type
body Object

Example
body

{
	"username": "test",
	"password": "Pas5w0r!d",
    "domain": "default"
}

Auth.register(body)

register - Register a user

group_request is optional.

Path: api/v1/auth/register

Kind: static method of Auth

Param Type
body Object

Example
body

{
	"username":"test",
	"password":"Pas5w0r!d",
	"email": "test@test.com",
    "domain": "default"
}

AuthToken

Kind: global class

AuthToken.forgotPassword(body)

forgotPassword - Generates a recovery token and returns the token to the attached user (if they exist) instead of sending an email. CAUTION SECURITY RISK: Would not expose this URL publicly or have it be allowed by anyone who is not a superadmin type level*

Path: api/v1/auth/password/forgot

Kind: static method of AuthToken

Param Type
body Object

Example
body

{
	"email": "test@test.com"
}

AuthDomain

Kind: global class

AuthDomain.forgotPassword(body, domain)

forgotPassword - Generates a recovery token and sends a email to the attached user (if they exist)

Path: api/v1/auth/password/forgot/domain/:domain

Kind: static method of AuthDomain

Param Type Description
body Object
domain any (example: test.com)

Example
body

{
	"email": "test@test.com"
}

AuthDomain.login(body, domain)

login - Register a user

Path: api/v1/auth/login/domain/:domain

Kind: static method of AuthDomain

Param Type Description
body Object
domain any (example: test.com)

Example
body

{
	"username": "test",
	"password": "Pas5w0r!d",
    "domain": "default"
}

AuthDomain.register(body, domain)

register - Register a user

group_request is optional.

Path: api/v1/auth/register/domain/:domain

Kind: static method of AuthDomain

Param Type Description
body Object
domain any (example: test.com)

Example
body

{
	"username":"test",
	"password":"Pas5w0r!d",
	"email": "test@test.com"
}

AuthDomainToken

Kind: global class

AuthDomainToken.forgotPassword(body)

forgotPassword - Generates a recovery token and returns the token to the attached user (if they exist) instead of sending an email. CAUTION SECURITY RISK: Would not expose this URL publicly or have it be allowed by anyone who is not a superadmin type level*

Path: api/v1/auth/password/forgot

Kind: static method of AuthDomainToken

Param Type
body Object

Example
body

{
	"email": "test@test.com"
}

SDK(host, opts)

SDK - importing the SDK for use

Kind: global function

Param Type Description
host string the hostname to the service (example: http://127.0.0.1)
opts object options that will be appened to every request. Fasquest Lib Options (example: {headers: {'API-KEY':'34098hodf'}})

Example
init

const { Travelling } = require('./sdk.js')('http://127.0.0.1');

Readme

Keywords

none

Package Sidebar

Install

npm i travelling-sdk

Weekly Downloads

0

Version

1.2.1

License

ISC

Unpacked Size

408 kB

Total Files

4

Last publish

Collaborators

  • phara0h