feat: Convert model files to JS

This commit is contained in:
Faruk AYDIN
2024-01-04 19:27:13 +01:00
parent b693c12500
commit 8819ddefa7
20 changed files with 140 additions and 363 deletions

View File

@@ -0,0 +1,31 @@
import Base from './base';
import SamlAuthProvider from './saml-auth-provider.ee';
class SamlAuthProvidersRoleMapping extends Base {
static tableName = 'saml_auth_providers_role_mappings';
static jsonSchema = {
type: 'object',
required: ['samlAuthProviderId', 'roleId', 'remoteRoleName'],
properties: {
id: { type: 'string', format: 'uuid' },
samlAuthProviderId: { type: 'string', format: 'uuid' },
roleId: { type: 'string', format: 'uuid' },
remoteRoleName: { type: 'string', minLength: 1 },
},
};
static relationMappings = () => ({
samlAuthProvider: {
relation: Base.BelongsToOneRelation,
modelClass: SamlAuthProvider,
join: {
from: 'saml_auth_providers_role_mappings.saml_auth_provider_id',
to: 'saml_auth_providers.id',
},
},
});
}
export default SamlAuthProvidersRoleMapping;