<commit_before>const UsersService = require('../services/UsersService');
const UserFollowingsService = require('../services/UserFollowingsService');
const ApplicationsService = require('../services/ApplicationsService');
const AuthorizeRequestsService = require('../services/AuthorizeRequestsService');
const ApplicationAccessesService = require('../services/ApplicationAccessesService');
const PostsService = require('../services/PostsService');
const StorageFilesService = require('../services/StorageFilesService');
const { InvalidOperationError } = require('./errors');
const MongoAdapter = require('./MongoAdapter');

class ApiContext {
	/**
	 * @param {MongoAdapter} repository
	*/
	constructor(streams, lock, repository, config, options) {
		this.lock = lock;
		this.streams = streams;
		this.repository = repository;
		this.config = config;
		options = options || {};
		this.params = options.params || {};
		this.query = options.query || {};
		this.body = options.body || {};
		this.user = options.user;
		this.application = options.application;
		// service instances
		this.usersService = new UsersService(repository, config);
		this.userFollowingsService = new UserFollowingsService(repository, config);
		this.applicationsService = new ApplicationsService(repository, config);
		this.authorizeRequestsService = new AuthorizeRequestsService(repository, config);
		this.applicationAccessesService = new ApplicationAccessesService(repository, config);
		this.postsService = new PostsService(repository, config, this.usersService);
		this.storageFilesService = new StorageFilesService(repository, config);

		this.headers = {};
		// ヘッダーのキーを小文字に変換して格納<commit_msg>update jsdoc<commit_after>const UsersService = require('../services/UsersService');
const UserFollowingsService = require('../services/UserFollowingsService');
const ApplicationsService = require('../services/ApplicationsService');
const AuthorizeRequestsService = require('../services/AuthorizeRequestsService');
const ApplicationAccessesService = require('../services/ApplicationAccessesService');
const PostsService = require('../services/PostsService');
const StorageFilesService = require('../services/StorageFilesService');
const { InvalidOperationError } = require('./errors');
const AsyncLock = require('async-lock');
const MongoAdapter = require('./MongoAdapter');

class ApiContext {
	/**
	 * @param {AsyncLock} lock
	 * @param {MongoAdapter} repository
	*/
	constructor(streams, lock, repository, config, options) {
		this.lock = lock;
		this.streams = streams;
		this.repository = repository;
		this.config = config;
		options = options || {};
		this.params = options.params || {};
		this.query = options.query || {};
		this.body = options.body || {};
		this.user = options.user;
		this.application = options.application;
		// service instances
		this.usersService = new UsersService(repository, config);
		this.userFollowingsService = new UserFollowingsService(repository, config);
		this.applicationsService = new ApplicationsService(repository, config);
		this.authorizeRequestsService = new AuthorizeRequestsService(repository, config);
		this.applicationAccessesService = new ApplicationAccessesService(repository, config);
		this.postsService = new PostsService(repository, config, this.usersService);
		this.storageFilesService = new StorageFilesService(repository, config);

		this.headers = {};
		// ヘッダーのキーを小文字に変換して格納
{'fraction_non_alphanumeric': 0.12697947214076247, 'fraction_numerical': 0.0, 'mean_word_length': 5.8631790744466805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1174830', 'n_tokens_mistral': 932, 'n_tokens_neox': 888, 'n_words': 186}