Skip to content

Commit

Permalink
Add support for Favorites Preferences open / closed
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspar09 committed Dec 20, 2023
1 parent f5674ed commit 0ac03aa
Showing 1 changed file with 82 additions and 70 deletions.
152 changes: 82 additions & 70 deletions user/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,128 +2,139 @@ const Username = {
type: 'string',
minLength: 1,
maxLength: 48,
pattern: '^[a-z0-9][a-z0-9-]*[a-z0-9]$'
pattern: '^[a-z0-9][a-z0-9-]*[a-z0-9]$',

Check failure on line 5 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
};

const Name = {
type: 'string',
minLength: 1,
maxLength: 32
maxLength: 32,

Check failure on line 11 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
};

const Email = {
type: 'string',
minLength: 5,
maxLength: 256
maxLength: 256,

Check failure on line 17 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
};

const ImportFlowGitProvider = {
oneOf: [
{
'enum': ['github', 'gitlab', 'bitbucket']
enum: ['github', 'gitlab', 'bitbucket'],

Check failure on line 23 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Properties should be quoted as 'enum' is a reserved word

Check failure on line 23 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
},
{
type: 'null'
}
]
type: 'null',

Check failure on line 26 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
},

Check failure on line 27 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
],

Check failure on line 28 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
};

const ImportFlowGitNamespace = {
oneOf: [
{
type: 'string'
type: 'string',

Check failure on line 34 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
},
{
type: 'null'
}
]
type: 'null',

Check failure on line 37 in user/index.js

View workflow job for this annotation

GitHub Actions / Tests

Unexpected trailing comma
},
],
};

const ImportFlowGitNamespaceId = {
oneOf: [
{
type: 'string'
type: 'string',
},
{
type: 'number'
type: 'number',
},
{
type: 'null'
}
]
type: 'null',
},
],
};

const ScopeId = {
type: 'string'
type: 'string',
};

const GitNamespaceId = {
oneOf: [
{
type: 'string'
type: 'string',
},
{
type: 'number'
type: 'number',
},
{
type: 'null'
}
]
type: 'null',
},
],
};

const ViewPreference = {
oneOf: [
{
'enum': ['cards', 'list']
enum: ['cards', 'list'],
},
{
type: 'null',
},
],
};

const FavoritesViewPreference = {
oneOf: [
{
enum: ['open', 'closed'],
},
{
type: 'null'
}
]
type: 'null',
},
],
};

const PlatformVersion = {
oneOf: [
{
// A `null` platform version means to always use the latest
type: 'null'
type: 'null',
},
{
type: 'integer',
minimum: 1,
maximum: 2
}
]
maximum: 2,
},
],
};

const Avatar = {
type: 'string',
minLength: 40,
maxLength: 40,
pattern: '^[0-9a-f]+$'
pattern: '^[0-9a-f]+$',
};

const Bio = {
type: 'string'
type: 'string',
};

const Website = {
type: 'string',
minLength: 4,
maxLength: 40
maxLength: 40,
};

const Profile = {
type: 'object',
properties: {
service: {
type: 'string'
type: 'string',
},
link: {
type: 'string'
}
type: 'string',
},
},
additionalProperties: false
additionalProperties: false,
};

const Profiles = {
Expand All @@ -132,110 +143,110 @@ const Profiles = {
maxItems: 100,
uniqueItems: true,
items: Profile,
additionalProperties: false
additionalProperties: false,
};

const RemoteCaching = {
type: 'object',
properties: {
enabled: {
type: 'boolean'
}
type: 'boolean',
},
},
additionalProperties: false
additionalProperties: false,
};

const ToastDismissal = {
type: 'object',
properties: {
scopeId: {
type: 'string'
type: 'string',
},
createdAt: {
type: 'number'
}
type: 'number',
},
},
additionalProperties: false
additionalProperties: false,
};

const DismissedToast = {
type: 'object',
properties: {
name: {
type: 'string'
type: 'string',
},
dismissals: {
type: 'array',
minItems: 0,
maxItems: 50,
items: ToastDismissal
}
items: ToastDismissal,
},
},
additionalProperties: false
additionalProperties: false,
};

const DismissedToasts = {
type: 'array',
minItems: 0,
maxItems: 50,
items: DismissedToast,
additionalProperties: false
additionalProperties: false,
};

const FavoriteProjectOrSpace = {
type: 'object',
properties: {
projectId: {
type: 'string'
type: 'string',
},
spaceId: {
type: 'string'
type: 'string',
},
scopeId: {
type: 'string'
type: 'string',
},
scopeSlug: {
type: 'string'
}
type: 'string',
},
},
additionalProperties: false
additionalProperties: false,
};

const FavoriteProjectsAndSpaces = {
type: 'array',
minItems: 0,
items: FavoriteProjectOrSpace,
additionalProperties: false
additionalProperties: false,
};

const EnablePreviewFeedback = {
oneOf: [
{
'enum': [
enum: [
'on',
'off',
'default',
'on-force',
'off-force',
'default-force'
]
'default-force',
],
},
{
type: 'null'
}
]
type: 'null',
},
],
};

const DefaultTeamId = {
oneOf: [
{
type: 'string',
maxLength: 29
maxLength: 29,
},
{
type: 'null'
}
]
type: 'null',
},
],
};

const User = {
Expand All @@ -257,12 +268,13 @@ const User = {
scopeId: ScopeId,
gitNamespaceId: GitNamespaceId,
viewPreference: ViewPreference,
favoritesViewPreference: FavoritesViewPreference,
remoteCaching: RemoteCaching,
dismissedToasts: DismissedToasts,
enablePreviewFeedback: EnablePreviewFeedback,
favoriteProjectsAndSpaces: FavoriteProjectsAndSpaces,
defaultTeamId: DefaultTeamId
}
defaultTeamId: DefaultTeamId,
},
};

module.exports = {
Expand All @@ -278,5 +290,5 @@ module.exports = {
ScopeId,
GitNamespaceId,
ViewPreference,
DismissedToasts
DismissedToasts,
};

0 comments on commit 0ac03aa

Please sign in to comment.