View a Tugboat Repository's History

Returns the activity history of a Tugboat Repository, or a set of Repositories.

Arguments

  • repo - Required
    The ID of the repo for which to retrieve the history.

  • type - Optional
    The type of event to return. If not specified, all events are returned. This can be a single value, or an array of types.

  • children - Optional
    If true, the events of the repo's children are also returned. Default: false

  • before - Optional
    Only return events that occurred before this date. A Date object is expected.

  • after - Optional
    Only return events that occurred after this date. A Date object is expected.

  • limit - Optional
    Only return the last N events.

Example

socket.emit('tugboat', 'repos', 'history', args, callback);

Output

single

[
    {
        "_id": "58f7ce6db6e1d9000158a9be",
        "updatedAt": "2017-04-19T20:54:05.666Z",
        "createdAt": "2017-04-19T20:54:05.666Z",
        "type": "activity",
        "data": {
            "event": "create",
            "args": {
                "agent": "tugboat",
                "name": "repo1",
                "project": "58f7cb35b6e1d9000158a9af"
            },
            "authkey": "0"
        },
        "repo": "58f7ce6db6e1d9000158a9bd",
        "project": "58f7cb35b6e1d9000158a9af",
        "id": "58f7ce6db6e1d9000158a9be"
    }
]

array

[
    [
        {
            "_id": "58f7ce6db6e1d9000158a9be",
            "updatedAt": "2017-04-19T20:54:05.666Z",
            "createdAt": "2017-04-19T20:54:05.666Z",
            "type": "activity",
            "data": {
                "event": "create",
                "args": {
                    "agent": "tugboat",
                    "name": "repo1",
                    "project": "58f7cb35b6e1d9000158a9af"
                },
                "authkey": "0"
            },
            "repo": "58f7ce6db6e1d9000158a9bd",
            "project": "58f7cb35b6e1d9000158a9af",
            "id": "58f7ce6db6e1d9000158a9be"
        }
    ],
    [
        {
            "_id": "58f7ce73b6e1d9000158a9c2",
            "updatedAt": "2017-04-19T20:54:11.905Z",
            "createdAt": "2017-04-19T20:54:11.905Z",
            "type": "activity",
            "data": {
                "event": "create",
                "args": {
                    "agent": "tugboat",
                    "name": "repo2",
                    "project": "58f7cb35b6e1d9000158a9af"
                },
                "authkey": "0"
            },
            "repo": "58f7ce73b6e1d9000158a9c1",
            "project": "58f7cb35b6e1d9000158a9af",
            "id": "58f7ce73b6e1d9000158a9c2"
        }
    ]
]

Errors

  • 1005: No Repositories Found
    Returned if the requested repositories do not exist, or the requestor does not have permission to view their history.

  • 1006: No Project ID Provided
    The required repo argument was not included in the request.

results matching ""

    No results matching ""