
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
gits-assignment-service
Advanced tools
This is a NodeJS client library for GITS Assignment Management Service.
An assignment usually look like this :
{
"_id": string_uuid_v4,
"title": string,
"description": string,
"creation_date": integer_timestamp_in_seconds, // example: 1507000739
"due_date": integer_timestamp_in_seconds,
"update_date": integer_timestamp_in_seconds,
"assignee": {
"id": some_value, // could be string or interer, up to you
... // your custom fields, example: name, department_id, type, email, etc
},
"assignor": {
"id": some_value, // could be string or interer, up to you
... // your custom fields, example: name, department_id, type, email, etc
},
"created_by": {
"id": some_value, // could be string or interer, up to you
... // your custom fields, example: name, department_id, type, email, etc
},
"updated_by": {
"id": some_value, // could be string or interer, up to you
... // your custom fields, example: name, department_id, type, email, etc
},
"state": {
"id" : string, // the state id, for state references, keep scrolling
},
"extras": {
... // your custom fields, example: name, department_id, type, email, etc
},
"logs": [
{
"date": 12312,
"type": "edit",
"context": {
... // your custom fields, example: name, department_id, type, email, etc
}
},
]
}
A "State" looks like this
{
"_id": "",
"name": "",
"nexts": [ "next_state_id_1", "next_state_id_2" ]
}
A state has a nexts field. This field contains array of state ids. Let's say an assignment is in a state called pending. The pending state has nexts which is [ 'active', 'invalid', 'rejected' ]. That means pending state can only move forward to one of those three states.
npm install --save gits-assigntment-service
curl -X POST \
http://159.203.169.253:3040/application/create \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: a7bc2296-9215-6c0f-5010-6d7667bd65b3' \
-d '{
"name" : "<app-name>",
"url": "<app-url>",
"country": "<a-valid-country-code>",
"email" : "<an-email-address-for-login>",
"password": "<md5-string>"
}'
/application/logincurl -X POST \
http://159.203.169.253:3040/application/login \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 37b17eb5-cb83-6178-d230-fdcc323775e7' \
-d '{
"email": "<your-email>",
"password": "<md5-string>"
}'
const assignmentService = require('gits-assignment-service');
// mandatory
assignmentService.key("your-app-key");
assignmentService.secret("your-app-secret");
// a user is just an object with at least an id field (String)
assignmentService.user({ id: 'qwerty' });
// optional
// verbosity
assignmentService.verbose({error: 1, result: 1, info: 1});
Get Assignments
assignmentService.assignment.get( query, sort, limit, callback );
This api will return an array of assignments
query is an object. It's structure follows mongodb query structure. ex: {_id: 'qwerty'} will find any assignment with _id equals qwertysort is an object. It's structure follows mongodb $sort structure of mongodb aggregation. Detail here.limit is a positive integercallback is a standard es6 callback. (err, result) => {}Get Assignments (Pagination Mode)
assignmentService.assignment.get( query, sort, limit, page, callback );
page is an integerThis api will return an object like this :
{
"list": [ /** list of assignments */ ],
"page": {
"total_page": 3,
"total_data": 7,
"current_page": 2
}
}
Create Assignment
assignmentService.assignment.create( {
"title": "fancy title",
"description": "order from Vitsa",
"creation_date": 1507631751,
"updated_date": 0,
"due_date": 1507770000,
"assignee": { "id": "kumangxxx@gmail.com", "name": "Rahadian Ahmad" },
"assignor": { "id": "ragil@gits.co.id", "name": "Ragil Kamal" },
"extras": {},
"stateId": "a-workflow-id"
}, callback )
This api will return the newly created assignment (String).
Edit Assignment
assignmentService.assignment.edit( query, update, callback );
This api will return an integer indicating how many documents was edited.
update is an object. It's structure follows mongodb update command. Details hereDelete Assignment
assignmentService.assignment.delete( query, callback );
This api will return an integer indicating how many assignments was deleted
Change State
assignmentService.assignment.changeState(assignmentId, newWorkflowId, callback);
This api will return the updated id.
Workflow is a collection of states. A state has nexts field. nexts field could contain 0 state or a fuckton of states.
Create a State
assignmentService.workflow.create({
"before": [ /** before ids */ ], // array of string
"state": {
"name": "some-name",
"type": "some-type",
"next": [ /** next ids */ ] // array of string
}
}, callback )
This api will return the newly created id
Delete a State
assignmentService.workflow.delete(stateId, callback);
This api will return the just deleted id.
Get state's next states
assignmentService.workflow.getNexts(stateId, callback);
This api will return an array of states
Get all states
assignmentService.workflow.getAll(callback);
This api will return all your states. (without their nexts field)
Add nexts to a state
assignmentService.workflow.addNexts(stateId, [ 'id-1', 'id-2', ... , 'id-n' ], callback);
This api will return the newly updated id
Remove nexts to a state
assignmentService.workflow.removeNext(stateId, [ 'id-1', 'id-2', ... , 'id-n' ], callback);
This api will return the newly updated id
FAQs
Client library for GITS Assignment Service
We found that gits-assignment-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.