Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/*
* properties
*/
// ISO 8601 date + time string
creationDate: attr('date'),
// user name
name: attr('string'),
// array of users selections
// must be in same order as options property of poll
selections: fragmentArray('selection'),
// Croodle version user got created with
version: attr('string', {
encrypted: false
})
});
CLEAN: 'clean'
};
export default Model.extend({
created_at: attr(),
event_type: attr(),
result: attr(),
message: attr('string'),
headCommit: attr(),
baseCommit: attr(),
branchName: attr('string'),
pullRequestMergeable: attr('string'),
tagName: attr('string'),
pullRequest: attr('boolean'),
pullRequestTitle: attr('string'),
pullRequestNumber: attr('number'),
config: attr(),
raw_configs: attr(),
uniqRawConfigs: uniqBy('raw_configs', 'source'),
noYaml: empty('raw_configs'),
repo: belongsTo('repo', { async: true }),
commit: belongsTo('commit', { async: true }),
// API models this as hasMany but serializers:request#normalize overrides it
build: belongsTo('build', { async: true }),
isAccepted: computed('result', 'build.id', function () {
// For some reason some of the requests have a null result beside the fact that
// the build was created. We need to look into it, but for now we can just assume
// that if build was created, the request was accepted
let result = this.result;
import Model, { attr, belongsTo } from '@ember-data/model';
import { computed } from '@ember/object';
import DurationCalculations from 'travis/mixins/duration-calculations';
import DurationAttributes from 'travis/mixins/duration-attributes';
export default Model.extend(DurationCalculations, DurationAttributes, {
number: attr(),
name: attr('string'),
state: attr(),
build: belongsTo('build', { async: true }),
notStarted: computed('state', function () {
let state = this.state;
let waitingStates = ['queued', 'created', 'received'];
return waitingStates.includes(state);
}),
});
github: 'GitHub Marketplace',
manual: 'manual',
stripe: 'Stripe'
};
export default Model.extend({
api: service(),
accounts: service(),
source: attr(),
status: attr(),
validTo: attr(),
permissions: attr(),
organizationId: attr(),
coupon: attr(),
clientSecret: attr(),
paymentIntent: attr(),
billingInfo: belongsTo('billing-info', { async: false }),
creditCardInfo: belongsTo('credit-card-info', { async: false }),
invoices: hasMany('invoice'),
owner: belongsTo('owner', { polymorphic: true }),
plan: belongsTo(),
isSubscribed: equal('status', 'subscribed'),
isCanceled: equal('status', 'canceled'),
isExpired: equal('status', 'expired'),
isPending: equal('status', 'pending'),
isIncomplete: equal('status', 'incomplete'),
isStripe: equal('source', 'stripe'),
isGithub: equal('source', 'github'),
isManual: equal('source', 'manual'),
firstName: validator('presence', true),
lastName: validator('presence', true),
email: validator('presence', true),
});
export default Model.extend(Validations, {
apiKey: attr(),
apiKeyHidesAt: attr(),
apiKeyPreview: attr(),
firstName: attr(),
lastName: attr(),
email: attr(),
emailVerified: attr(),
website: attr(),
useDescription: attr(),
registrationSource: attr(),
termsAndConditions: attr(),
sendWelcomeEmail: attr(),
throttleByIp: attr('boolean'),
roles: attr(),
enabled: attr('boolean'),
createdAt: attr(),
updatedAt: attr(),
creator: attr(),
updater: attr(),
registrationIp: attr(),
registrationUserAgent: attr(),
registrationReferer: attr(),
registrationOrigin: attr(),
settings: belongsTo('api/settings', { async: false }),
import Model from '@ember-data/model';
import { attr, belongsTo } from '@ember-data/model';
export default class JobVersion extends Model {
@belongsTo('job') job;
@attr('boolean') stable;
@attr('date') submitTime;
@attr('number') number;
@attr() diff;
revertTo() {
return this.store.adapterFor('job-version').revertTo(this);
}
}
import Model, { attr, belongsTo } from '@ember-data/model';
import { computed } from '@ember/object';
export default Model.extend({
createdAt: attr('date'),
url: attr('string'),
amountDue: attr('number'),
subscription: belongsTo('subscription'),
year: computed('createdAt', function () {
return this.createdAt.getFullYear();
})
});
import { attr } from '@ember-data/model';
import Fragment from 'ember-data-model-fragments/fragment';
import { array } from 'ember-data-model-fragments/attributes';
export default class Network extends Fragment {
@attr('string') device;
@attr('string') cidr;
@attr('string') ip;
@attr('string') mode;
@attr('number') mbits;
@array() ports;
}
import Model, { attr, belongsTo } from '@ember-data/model';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Model.extend({
sha: attr(),
branch: attr(),
message: attr(),
compareUrl: attr(),
authorName: attr(),
authorEmail: attr(),
committerName: attr(),
committerEmail: attr(),
committedAt: attr(),
committerAvatarUrl: attr(),
authorAvatarUrl: attr(),
build: belongsTo('build'),
externalLinks: service(),
subject: computed('message', function () {
import Model, { attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
export default Model.extend({
idPrefix: 'role/',
backend: attr('string', { readOnly: true }),
name: attr('string', {
label: 'Role name',
}),
database: attr('array', {
label: '',
editType: 'searchSelect',
fallbackComponent: 'string-list',
models: ['database/connection'],
selectLimit: 1,
onlyAllowExisting: true,
subLabel: 'Database name',
subText: 'The database for which credentials will be generated.',
}),
type: attr('string', {
label: 'Type of role',
noDefault: true,