open-vault/ui/app/models/secret-v2.js

18 lines
570 B
JavaScript
Raw Normal View History

import DS from 'ember-data';
import { match } from '@ember/object/computed';
2018-04-03 14:16:57 +00:00
const { attr, hasMany, belongsTo, Model } = DS;
export default Model.extend({
engine: belongsTo('secret-engine'),
versions: hasMany('secret-v2-version', { async: false, inverse: null }),
selectedVersion: belongsTo('secret-v2-version', { async: false, inverse: 'secret' }),
createdTime: attr(),
updatedTime: attr(),
currentVersion: attr('number'),
oldestVersion: attr('number'),
maxVersions: attr('number'),
casRequired: attr('boolean'),
isFolder: match('id', /\/$/),
});