<commit_before>

DEBUG = True

# Enable reads (GET), inserts (POST) and DELETE for resources/collections
# (if you omit this line, the API will default to ['GET'] and provide
# read-only access to the endpoint).
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']

# Enable reads (GET), edits (PATCH) and deletes of individual items
# (defaults to read-only item access).
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']

PUBLIC_METHODS = ['GET']
PUBLIC_ITEM_METHODS = ['GET']

# We enable standard client cache directives for all resources exposed by the
# API. We can always override these global settings later.
CACHE_CONTROL = 'max-age=20'
CACHE_EXPIRES = 20

XML = False
# Enable CORS for all domains
X_DOMAINS = "*"
X_HEADERS = "Content-Type, Accept, Authorization, X-Requested-With, " \
    " Access-Control-Request-Headers, Access-Control-Allow-Origin, " \
    " Access-Control-Allow-Credentials, X-HTTP-Method-Override, mozSystem, " \
    " Access-Control-Allow-Methods "


AUTH_FIELD = 'username'

MONGO_QUERY_BLACKLIST = []

# MONGO_HOST = 'localhost'
# MONGO_PORT = 27017

import os
MONGO_HOST = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
MONGO_PORT = int(os.environ.get('MONGODB_PORT_27017_TCP_PORT'))

# MONGO_USERNAME = 'dmUser'
# MONGO_PASSWORD = '<PASSWORD>'
# MONGO_USERNAME = 'ivan'
# MONGO_PASSWORD = '<PASSWORD>'


attachments = {
    'schema': {
        'file': {
            'type': 'media'
        },
        'name': {
            'type': 'string'
        },
        'user': {
            'type': 'string'
        }
    }
}

logs = {
    'schema': {
        'user': {
            'type': 'string'
        },
        'source_id': {
            'type': 'string'
        },
        'action': {
            'type': 'string'
        },
        'value': {
            'type': 'string'
        }
    }
}

# TODO: if URL + vtime are in DB, not store

history = {
    'schema': {
        'time': {
            'type': 'dict',
            'schema': {
                'id': {
                    'type': 'string'
                },
                'day': {
                    'type': 'number'
                },
                'hours': {
                    'type': 'number'
                },
                'minutes': {
                    'type': 'number'
                },
                'month': {
                    'type': 'number'
                },
                'seconds': {
                    'type': 'number'
                },
                'time': {
                    'type': 'string'
                },
                'transition': {
                    'type': 'string'
                },
                'referringVisitId': {
                    'type': 'string'
                },
                'visitId': {
                    'type': 'string'
                },
                'visitTime': {
                    'type': 'number'
                },
                'vtime': {
                    'type': 'number'
                },
                'weekday': {
                    'type': 'number'
                },
                'year': {
                    'type': 'number'
                }
            },
        },
        'search': {
            'type': 'list'
        },
        'user': {
            'type': 'string'
        },
        # 'id': {
        #     'type': 'string',
        #     'unique': True,
        #     'required': True
        # },
        'url': {
            'type': 'string',
            'minlength': 7,
            'required': True,
        },
        'title': {
            'type': 'string'
        },
        'typedCount': {
            'type': 'number'
        },
        'visitCount': {
            'type': 'number'
        },
        'visitNumber': {
            'type': 'number'
        },
        'referringVisitId': {
            'type': 'string'
        },
        'transition': {
            'type': 'string'
        },
        'vid': {
            'type': 'string'
        }
    }<commit_msg>domain attr added to history object<commit_after>

DEBUG = True

# Enable reads (GET), inserts (POST) and DELETE for resources/collections
# (if you omit this line, the API will default to ['GET'] and provide
# read-only access to the endpoint).
RESOURCE_METHODS = ['GET', 'POST', 'DELETE']

# Enable reads (GET), edits (PATCH) and deletes of individual items
# (defaults to read-only item access).
ITEM_METHODS = ['GET', 'PATCH', 'PUT', 'DELETE']

PUBLIC_METHODS = ['GET']
PUBLIC_ITEM_METHODS = ['GET']

# We enable standard client cache directives for all resources exposed by the
# API. We can always override these global settings later.
CACHE_CONTROL = 'max-age=20'
CACHE_EXPIRES = 20

XML = False
# Enable CORS for all domains
X_DOMAINS = "*"
X_HEADERS = "Content-Type, Accept, Authorization, X-Requested-With, " \
    " Access-Control-Request-Headers, Access-Control-Allow-Origin, " \
    " Access-Control-Allow-Credentials, X-HTTP-Method-Override, mozSystem, " \
    " Access-Control-Allow-Methods "


AUTH_FIELD = 'username'

MONGO_QUERY_BLACKLIST = []

# MONGO_HOST = 'localhost'
# MONGO_PORT = 27017

import os
MONGO_HOST = os.environ.get('MONGODB_PORT_27017_TCP_ADDR')
MONGO_PORT = int(os.environ.get('MONGODB_PORT_27017_TCP_PORT'))

# MONGO_USERNAME = 'dmUser'
# MONGO_PASSWORD = '<PASSWORD>'
# MONGO_USERNAME = 'ivan'
# MONGO_PASSWORD = '<PASSWORD>'


attachments = {
    'schema': {
        'file': {
            'type': 'media'
        },
        'name': {
            'type': 'string'
        },
        'user': {
            'type': 'string'
        }
    }
}

logs = {
    'schema': {
        'user': {
            'type': 'string'
        },
        'source_id': {
            'type': 'string'
        },
        'action': {
            'type': 'string'
        },
        'value': {
            'type': 'string'
        }
    }
}

# TODO: if URL + vtime are in DB, not store

history = {
    'schema': {
        'time': {
            'type': 'dict',
            'schema': {
                'id': {
                    'type': 'string'
                },
                'day': {
                    'type': 'number'
                },
                'hours': {
                    'type': 'number'
                },
                'minutes': {
                    'type': 'number'
                },
                'month': {
                    'type': 'number'
                },
                'seconds': {
                    'type': 'number'
                },
                'time': {
                    'type': 'string'
                },
                'transition': {
                    'type': 'string'
                },
                'referringVisitId': {
                    'type': 'string'
                },
                'visitId': {
                    'type': 'string'
                },
                'visitTime': {
                    'type': 'number'
                },
                'vtime': {
                    'type': 'number'
                },
                'weekday': {
                    'type': 'number'
                },
                'year': {
                    'type': 'number'
                }
            },
        },
        'search': {
            'type': 'list'
        },
        'user': {
            'type': 'string'
        },
        # 'id': {
        #     'type': 'string',
        #     'unique': True,
        #     'required': True
        # },
        'url': {
            'type': 'string',
            'minlength': 7,
            'required': True,
        },
        'domain': {
            'type': 'string',
            'minlength': 7,
            'required': True,
        },
        'title': {
            'type': 'string'
        },
        'typedCount': {
            'type': 'number'
        },
        'visitCount': {
            'type': 'number'
        },
        'visitNumber': {
            'type': 'number'
        },
        'referringVisitId': {
            'type': 'string'
        },
        'transition': {
            'type': 'string'
        },
        'vid': {
            'type': 'string'
        }
    }
{'fraction_non_alphanumeric': 0.14699716364533236, 'fraction_numerical': 0.0050561104945122705, 'mean_word_length': 1.214032214032214, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3463025', 'n_tokens_mistral': 2463, 'n_tokens_neox': 2335, 'n_words': 504}