UNPKG

@citrineos/data

Version:

The OCPP data module which includes all persistence layer implementation.

36 lines 1.33 kB
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project // // SPDX-License-Identifier: Apache-2.0 import { Sequelize } from 'sequelize-typescript'; import { Logger } from 'tslog'; import {} from '../../../interfaces/index.js'; import { Authorization } from '../model/index.js'; import { SequelizeRepository } from './Base.js'; export class SequelizeAuthorizationRepository extends SequelizeRepository { constructor(config, logger, sequelizeInstance) { super(config, Authorization.MODEL_NAME, logger, sequelizeInstance); } async readAllByQuerystring(tenantId, query) { return await super.readAllByQuery(tenantId, this._constructQuery(query)); } async readOnlyOneByQuerystring(tenantId, query) { return await super.readOnlyOneByQuery(tenantId, this._constructQuery(query)); } /** * Private Methods */ _constructQuery(queryParams) { const where = {}; if (queryParams.idToken) { where.idToken = queryParams.idToken; } // 1.6 doesn't have the concept of token type. But we need to support token type for 2.0.1 messages. if (queryParams.type) { where.idTokenType = queryParams.type; } return { where, }; } } //# sourceMappingURL=Authorization.js.map