Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global Travis */
import Model, { attr, belongsTo } from '@ember-data/model';
import { observer, computed } from '@ember/object';
import { alias, and, equal, not, reads } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import { isEqual } from '@ember/utils';
import { getOwner } from '@ember/application';
import Log from 'travis/models/log';
import DurationCalculations from 'travis/mixins/duration-calculations';
import DurationAttributes from 'travis/mixins/duration-attributes';
import promiseObject from 'travis/utils/promise-object';
export default Model.extend(DurationCalculations, DurationAttributes, {
api: service(),
jobConfigFetcher: service(),
features: service(),
logId: attr(),
queue: attr(),
state: attr(),
number: attr(),
allowFailure: attr('boolean'),
tags: attr(),
repositoryPrivate: attr(),
repositorySlug: attr(),
updatedAt: attr('date'),
_config: attr(),
repo: belongsTo('repo'),
build: belongsTo('build', { async: true }),
import Model, { attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { apiPath } from 'vault/macros/lazy-capabilities';
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
import attachCapabilities from 'vault/lib/attach-capabilities';
const ModelExport = Model.extend({
// used for getting appropriate options for backend
idPrefix: 'role/',
// the id prefixed with `role/` so we can use it as the *secret param for the secret show route
idForNav: computed('id', 'idPrefix', function() {
let modelId = this.id || '';
return `${this.idPrefix}${modelId}`;
}),
name: attr('string', {
// TODO: make this required for making a transformation
label: 'Name',
fieldValue: 'id',
readOnly: true,
subText: 'The name for your role. This cannot be edited later.',
}),
transformations: attr('array', {
// eslint-disable-next-line ember/no-observers
import EmberObject, { computed, observer } from '@ember/object';
import Model, { attr, hasMany } from '@ember-data/model';
import { A } from '@ember/array';
import compact from 'lodash-es/compact';
export default Model.extend({
appendQueryString: attr(),
headersString: attr(),
httpBasicAuth: attr(),
requireHttps: attr(),
disableApiKey: attr(),
apiKeyVerificationLevel: attr(),
requiredRoles: attr(),
requiredRolesOverride: attr(),
allowedIps: attr(),
allowedReferers: attr(),
rateLimitMode: attr(),
anonymousRateLimitBehavior: attr(),
authenticatedRateLimitBehavior: attr(),
passApiKeyHeader: attr(),
passApiKeyQueryParam: attr(),
defaultResponseHeadersString: attr(),
import Model, { attr } from '@ember-data/model';
import { buildValidations, validator } from 'ember-cp-validations';
const Validations = buildValidations({
name: validator('presence', true),
});
export default Model.extend(Validations, {
name: attr(),
apiScopeIds: attr({ defaultValue() { return [] } }),
permissionIds: attr({ defaultValue() { return [] } }),
admins: attr(),
createdAt: attr(),
updatedAt: attr(),
creator: attr(),
updater: attr(),
}).reopenClass({
urlRoot: '/api-umbrella/v1/admin_groups',
singlePayloadKey: 'admin_group',
arrayPayloadKey: 'data',
});
import Model, { attr, belongsTo } from '@ember-data/model';
export default Model.extend({
name: attr('string'),
value: attr('string'),
'public': attr('boolean'),
branch: attr('string'),
repo: belongsTo('repo', { async: true })
});
const Validations = buildValidations({
matcherType: [
validator('presence', true),
],
httpMethod: [
validator('presence', true),
],
frontendMatcher: [
validator('presence', true),
],
backendReplacement: [
validator('presence', true),
],
});
export default Model.extend(Validations, {
sortOrder: attr('number'),
matcherType: attr(),
httpMethod: attr(),
frontendMatcher: attr(),
backendReplacement: attr(),
}).reopenClass({
validationClass: Validations,
});
import Model, { hasMany, attr } from '@ember-data/model';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
export default Model.extend({
store: service(),
ownerId: attr('number'),
ownerName: attr('string'),
ownerType: attr('string'),
acceptedAt: attr('date'),
organizations: hasMany('organization'),
owner: computed('ownerName', 'ownerType', function () {
const { ownerName, ownerType = '', store } = this;
return ownerName && ownerType ? store.peekRecord(ownerType.toLowerCase(), ownerName) : null;
})
});
import Model, { attr } from '@ember-data/model';
export default Model.extend({
total: attr('object'),
endTime: attr('string'),
startTime: attr('string'),
});
import Model, { attr } from '@ember-data/model';
export const LEAD_UTM_FIELDS = {
SOURCE: 'utm_source',
CAMPAIGN: 'utm_campaign',
MEDIUM: 'utm_medium',
TERM: 'utm_term',
CONTENT: 'utm_content',
};
export default Model.extend({
name: attr('string'),
email: attr('string'),
team_size: attr('number'),
phone: attr('string'),
message: attr('string'),
referral_source: attr('string'),
utm_fields: attr(),
});
import Model, { attr } from '@ember-data/model';
export default Model.extend({
name: attr('string'),
builds: attr(),
price: attr(),
annual: attr('boolean'),
currency: attr(),
});