1.0.15 • Published 2 years ago

nathan-activity-logging v1.0.15

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 years ago

Activity-log

How to install

    npm install nathan-activity-logging

How to use

In index.js import and initialize the ActivityLog instance

    const ActivityLogs = require("nathan-activity-logging")
    ...
    // initialization 
    const activity_logs = new ActivityLogs()

    // then export it 
    module.exports = activity_logs

In Models files

    // Import the instance from index
    const ActivityLogs = require("../index")
    ...
    // Add this snippet after the schema
    // Parameters ( schema_from_above)
    ActivityLogs.logging(modelSchema)

Fetch from activity logs

    query = {
        "performed_on": "users"
    }
    pagination = 10
    ActivityLogs.fetchActivities(query, pagination)

In Models files

    // Define the following
    ACTIVITY_LOG_KEY = "ACCESS_KEY_N4TH4N"
    ACTIVITY_LOG_NAME = "etapon"
    ACTIVITY_LOG_API_URL = "https://activitylog-api-staging.devnhr.com/v1/activities"
1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago