Browse Source

Fix computed properties (#1223)

* Batch processing for events.

* Improve error handling.

* Fix tests

* More test fixes

* Fix computed properties and validate them.
pull/1224/head
Sebastian Stehle 1 year ago
committed by GitHub
parent
commit
c727e092f1
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 42
      frontend/generator/Generator/Program.cs
  2. 1
      frontend/src/app/features/administration/pages/restore/restore-page.component.scss
  3. 294
      frontend/src/app/shared/model/custom.ts
  4. 294
      frontend/src/app/shared/model/generated.ts

42
frontend/generator/Generator/Program.cs

@ -8,6 +8,9 @@ namespace Generator;
internal partial class Program internal partial class Program
{ {
private static readonly Regex RegexComputed = new Regex("return this\\.compute\\('(?<Name>[^']*)',");
private static readonly Regex RegexProperty = new Regex("public get (?<Name>[^(]*)\\(\\) {");
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
var cacheFile = "cache.json"; var cacheFile = "cache.json";
@ -142,6 +145,8 @@ internal partial class Program
var targetFolder = Path.Combine(codePath, @"..\\..\\src\\app\\shared\\model\\generated.ts"); var targetFolder = Path.Combine(codePath, @"..\\..\\src\\app\\shared\\model\\generated.ts");
ValidateComputed(code);
File.WriteAllText(targetFolder, code); File.WriteAllText(targetFolder, code);
} }
@ -162,4 +167,41 @@ internal partial class Program
folder = folder.Parent!; folder = folder.Parent!;
} }
} }
private static void ValidateComputed(string code)
{
var lines = code.Split('\n');
var i = 0;
foreach (var line in lines)
{
ValidateLine(lines, line, i);
i++;
}
}
private static void ValidateLine(string[] lines, string line, int index)
{
var computed = RegexComputed.Match(line);
if (!computed.Success)
{
return;
}
var cacheKey = computed.Groups["Name"].Value;
var previousLine = lines[index - 1];
var property = RegexProperty.Match(previousLine);
if (!property.Success)
{
Console.WriteLine($"Line {index}: Cannot find property for computed '{cacheKey}'");
return;
}
var propertyName = property.Groups["Name"].Value;
if (propertyName != cacheKey)
{
Console.WriteLine($"Line {index}: Invalid cache key '{cacheKey}' for property '{propertyName}'");
}
}
} }

1
frontend/src/app/features/administration/pages/restore/restore-page.component.scss

@ -49,6 +49,5 @@ h3 {
&-url { &-url {
@include truncate; @include truncate;
line-height: $circle-size;
} }
} }

294
frontend/src/app/shared/model/custom.ts

@ -5,109 +5,109 @@ import * as generated from './generated';
import { FieldPropertiesVisitor, META_FIELDS, tableField, tableFields } from './schemas'; import { FieldPropertiesVisitor, META_FIELDS, tableField, tableFields } from './schemas';
export class AppDto extends generated.AppDto { export class AppDto extends generated.AppDto {
get displayName() { public get displayName() {
return this.compute('displayName', () => StringHelper.firstNonEmpty(this.label, this.name)); return this.compute('displayName', () => StringHelper.firstNonEmpty(this.label, this.name));
} }
get canCreateSchema() { public get canCreateSchema() {
return this.compute('canCreateSchema', () => hasAnyLink(this._links, 'schemas/create')); return this.compute('canCreateSchema', () => hasAnyLink(this._links, 'schemas/create'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canLeave() { public get canLeave() {
return this.compute('canLeave', () => hasAnyLink(this._links, 'leave')); return this.compute('canLeave', () => hasAnyLink(this._links, 'leave'));
} }
get canReadAssets() { public get canReadAssets() {
return this.compute('canReadAssets', () => hasAnyLink(this._links, 'assets')); return this.compute('canReadAssets', () => hasAnyLink(this._links, 'assets'));
} }
get canReadAssetsScripts() { public get canReadAssetsScripts() {
return this.compute('canReadAssetsScripts', () => hasAnyLink(this._links, 'assets/scripts')); return this.compute('canReadAssetsScripts', () => hasAnyLink(this._links, 'assets/scripts'));
} }
get canReadClients() { public get canReadClients() {
return this.compute('canReadClients', () => hasAnyLink(this._links, 'clients')); return this.compute('canReadClients', () => hasAnyLink(this._links, 'clients'));
} }
get canReadContributors() { public get canReadContributors() {
return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors')); return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors'));
} }
get canReadJobs() { public get canReadJobs() {
return this.compute('canReadJobs', () => hasAnyLink(this._links, 'jobs')); return this.compute('canReadJobs', () => hasAnyLink(this._links, 'jobs'));
} }
get canReadLanguages() { public get canReadLanguages() {
return this.compute('canReadLanguages', () => hasAnyLink(this._links, 'languages')); return this.compute('canReadLanguages', () => hasAnyLink(this._links, 'languages'));
} }
get canReadPatterns() { public get canReadPatterns() {
return this.compute('canReadPatterns', () => hasAnyLink(this._links, 'patterns')); return this.compute('canReadPatterns', () => hasAnyLink(this._links, 'patterns'));
} }
get canReadPlans() { public get canReadPlans() {
return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans')); return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans'));
} }
get canReadRoles() { public get canReadRoles() {
return this.compute('canReadRoles', () => hasAnyLink(this._links, 'roles')); return this.compute('canReadRoles', () => hasAnyLink(this._links, 'roles'));
} }
get canReadRules() { public get canReadRules() {
return this.compute('canReadRules', () => hasAnyLink(this._links, 'rules')); return this.compute('canReadRules', () => hasAnyLink(this._links, 'rules'));
} }
get canReadSchemas() { public get canReadSchemas() {
return this.compute('canReadSchemas', () => hasAnyLink(this._links, 'schemas')); return this.compute('canReadSchemas', () => hasAnyLink(this._links, 'schemas'));
} }
get canReadWorkflows() { public get canReadWorkflows() {
return this.compute('canReadWorkflows', () => hasAnyLink(this._links, 'workflows')); return this.compute('canReadWorkflows', () => hasAnyLink(this._links, 'workflows'));
} }
get canUpdateGeneral() { public get canUpdateGeneral() {
return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update'));
} }
get canUpdateImage() { public get canUpdateImage() {
return this.compute('canUpdateImage', () => hasAnyLink(this._links, 'image/upload')); return this.compute('canUpdateImage', () => hasAnyLink(this._links, 'image/upload'));
} }
get canUpdateTeam() { public get canUpdateTeam() {
return this.compute('canUpdateTeam', () => hasAnyLink(this._links, 'transfer')); return this.compute('canUpdateTeam', () => hasAnyLink(this._links, 'transfer'));
} }
get canUploadAssets() { public get canUploadAssets() {
return this.compute('canUploadAssets', () => hasAnyLink(this._links, 'assets/create')); return this.compute('canUploadAssets', () => hasAnyLink(this._links, 'assets/create'));
} }
get image() { public get image() {
return this.compute('image', () => this._links['image']?.href); return this.compute('image', () => this._links['image']?.href);
} }
} }
export class AppLanguageDto extends generated.AppLanguageDto { export class AppLanguageDto extends generated.AppLanguageDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class AppLanguagesDto extends generated.AppLanguagesDto { export class AppLanguagesDto extends generated.AppLanguagesDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
export class AppSettingsDto extends generated.AppSettingsDto { export class AppSettingsDto extends generated.AppSettingsDto {
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
@ -121,23 +121,23 @@ export class AssetDto extends generated.AssetDto {
return this.compute('contentUrl', () => this._links['content']?.href); return this.compute('contentUrl', () => this._links['content']?.href);
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canMove() { public get canMove() {
return this.compute('canMove', () => hasAnyLink(this._links, 'move')); return this.compute('canMove', () => hasAnyLink(this._links, 'move'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
get canUpload() { public get canUpload() {
return this.compute('canUpload', () => hasAnyLink(this._links, 'upload')); return this.compute('canUpload', () => hasAnyLink(this._links, 'upload'));
} }
get canPreview() { public get canPreview() {
return this.compute('canPreview', () => { return this.compute('canPreview', () => {
const SVG_PREVIEW_LIMIT = 10 * 1024; const SVG_PREVIEW_LIMIT = 10 * 1024;
const MIME_TIFF = 'image/tiff'; const MIME_TIFF = 'image/tiff';
@ -170,89 +170,89 @@ export class AssetDto extends generated.AssetDto {
} }
export class AssetsDto extends generated.AssetsDto { export class AssetsDto extends generated.AssetsDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get canRenameTag() { public get canRenameTag() {
return this.compute('canRenameTag', () => hasAnyLink(this._links, 'tags/rename')); return this.compute('canRenameTag', () => hasAnyLink(this._links, 'tags/rename'));
} }
} }
export class AssetFolderDto extends generated.AssetFolderDto { export class AssetFolderDto extends generated.AssetFolderDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canMove() { public get canMove() {
return this.compute('canMove', () => hasAnyLink(this._links, 'move')); return this.compute('canMove', () => hasAnyLink(this._links, 'move'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class AssetFoldersDto extends generated.AssetsDto { export class AssetFoldersDto extends generated.AssetsDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
export class AssetScriptsDto extends generated.AssetScriptsDto { export class AssetScriptsDto extends generated.AssetScriptsDto {
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class AuthSchemeResponseDto extends generated.AuthSchemeResponseDto { export class AuthSchemeResponseDto extends generated.AuthSchemeResponseDto {
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class ClientDto extends generated.ClientDto { export class ClientDto extends generated.ClientDto {
get canRevoke() { public get canRevoke() {
return this.compute('canRevoke', () => hasAnyLink(this._links, 'delete')); return this.compute('canRevoke', () => hasAnyLink(this._links, 'delete'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class ClientsDto extends generated.ClientsDto { export class ClientsDto extends generated.ClientsDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
export class ContentDto extends generated.ContentDto { export class ContentDto extends generated.ContentDto {
get canPublish() { public get canPublish() {
return this.compute('canPublish', () => this.statusUpdates.find(x => x.status === 'Published')); return this.compute('canPublish', () => this.statusUpdates.find(x => x.status === 'Published'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canDraftCreate() { public get canDraftCreate() {
return this.compute('canDraftCreate', () => hasAnyLink(this._links, 'draft/create')); return this.compute('canDraftCreate', () => hasAnyLink(this._links, 'draft/create'));
} }
get canDraftDelete() { public get canDraftDelete() {
return this.compute('canDraftDelete', () => hasAnyLink(this._links, 'draft/delete')); return this.compute('canDraftDelete', () => hasAnyLink(this._links, 'draft/delete'));
} }
get canCancelStatus() { public get canCancelStatus() {
return this.compute('canCancelStatus', () => hasAnyLink(this._links, 'cancel')); return this.compute('canCancelStatus', () => hasAnyLink(this._links, 'cancel'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
get statusUpdates() { public get statusUpdates() {
return this.compute('statusUpdates', () => { return this.compute('statusUpdates', () => {
const updates: { status: string; color: string }[] = []; const updates: { status: string; color: string }[] = [];
for (const [key, link] of Object.entries(this._links)) { for (const [key, link] of Object.entries(this._links)) {
@ -267,12 +267,12 @@ export class ContentDto extends generated.ContentDto {
} }
export class ContentsDto extends generated.ContentsDto { export class ContentsDto extends generated.ContentsDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get canCreateAndPublish() { public get canCreateAndPublish() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create/publish')); return this.compute('canCreateAndPublish', () => hasAnyLink(this._links, 'create/publish'));
} }
} }
@ -281,35 +281,35 @@ export class ContributorDto extends generated.ContributorDto {
return `subject:${this.contributorId}`; return `subject:${this.contributorId}`;
} }
get canRevoke() { public get canRevoke() {
return this.compute('canRevoke ', () => hasAnyLink(this._links, 'update')); return this.compute('canRevoke', () => hasAnyLink(this._links, 'update'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate ', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class ContributorsDto extends generated.ContributorsDto { export class ContributorsDto extends generated.ContributorsDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get isInvited() { public get isInvited() {
return this.compute('isInvited', () => this._meta?.['isInvited'] === '1'); return this.compute('isInvited', () => this._meta?.['isInvited'] === '1');
} }
} }
export class EventConsumerDto extends generated.UserDto { export class EventConsumerDto extends generated.UserDto {
get canReset() { public get canReset() {
return this.compute('reset', () => hasAnyLink(this._links, 'reset')); return this.compute('canReset', () => hasAnyLink(this._links, 'reset'));
} }
get canStart() { public get canStart() {
return this.compute('canStart', () => hasAnyLink(this._links, 'start')); return this.compute('canStart', () => hasAnyLink(this._links, 'start'));
} }
get canStop() { public get canStop() {
return this.compute('canStop', () => hasAnyLink(this._links, 'stop')); return this.compute('canStop', () => hasAnyLink(this._links, 'stop'));
} }
} }
@ -319,15 +319,15 @@ export class FieldDto extends generated.FieldDto {
return this.properties; return this.properties;
} }
public get isInlineEditable(): boolean { public get isInlineEditable() {
return this.compute('isInlineEditable', () => !this.isDisabled && this.rawProperties.inlineEditable === true); return this.compute('isInlineEditable', () => !this.isDisabled && this.rawProperties.inlineEditable === true);
} }
public get isInvariant(): boolean { public get isInvariant() {
return this.compute('isInvariant', () => this.partitioning === 'invariant'); return this.compute('isInvariant', () => this.partitioning === 'invariant');
} }
public get isLocalizable(): boolean { public get isLocalizable() {
return this.compute('isLocalizable', () => this.partitioning === 'language'); return this.compute('isLocalizable', () => this.partitioning === 'language');
} }
@ -339,39 +339,39 @@ export class FieldDto extends generated.FieldDto {
return this.compute('displayPlaceholder', () => this.properties.placeholder || ''); return this.compute('displayPlaceholder', () => this.properties.placeholder || '');
} }
get canAddField() { public get canAddField() {
return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add')); return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDisable() { public get canDisable() {
return this.compute('canDisable', () => hasAnyLink(this._links, 'disable')); return this.compute('canDisable', () => hasAnyLink(this._links, 'disable'));
} }
get canEnable() { public get canEnable() {
return this.compute('canEnable', () => hasAnyLink(this._links, 'enable')); return this.compute('canEnable', () => hasAnyLink(this._links, 'enable'));
} }
get canOrderFields() { public get canOrderFields() {
return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order')); return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order'));
} }
get canHide() { public get canHide() {
return this.compute('canHide', () => hasAnyLink(this._links, 'hide')); return this.compute('canHide', () => hasAnyLink(this._links, 'hide'));
} }
get canLock() { public get canLock() {
return this.compute('canLock', () => hasAnyLink(this._links, 'lock')); return this.compute('canLock', () => hasAnyLink(this._links, 'lock'));
} }
get canShow() { public get canShow() {
return this.compute('canShow', () => hasAnyLink(this._links, 'show')); return this.compute('canShow', () => hasAnyLink(this._links, 'show'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
@ -389,160 +389,160 @@ export class NestedFieldDto extends generated.NestedFieldDto {
return this.compute('displayPlaceholder', () => this.properties.placeholder || ''); return this.compute('displayPlaceholder', () => this.properties.placeholder || '');
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDisable() { public get canDisable() {
return this.compute('canDisable', () => hasAnyLink(this._links, 'disable')); return this.compute('canDisable', () => hasAnyLink(this._links, 'disable'));
} }
get canEnable() { public get canEnable() {
return this.compute('canEnable', () => hasAnyLink(this._links, 'enable')); return this.compute('canEnable', () => hasAnyLink(this._links, 'enable'));
} }
get canHide() { public get canHide() {
return this.compute('canHide', () => hasAnyLink(this._links, 'hide')); return this.compute('canHide', () => hasAnyLink(this._links, 'hide'));
} }
get canLock() { public get canLock() {
return this.compute('canLock', () => hasAnyLink(this._links, 'lock')); return this.compute('canLock', () => hasAnyLink(this._links, 'lock'));
} }
get canShow() { public get canShow() {
return this.compute('canShow', () => hasAnyLink(this._links, 'show')); return this.compute('canShow', () => hasAnyLink(this._links, 'show'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class IndexDto extends generated.IndexDto { export class IndexDto extends generated.IndexDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
} }
export class IndexesDto extends generated.IndexesDto { export class IndexesDto extends generated.IndexesDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
export class JobDto extends generated.JobDto { export class JobDto extends generated.JobDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDownloadUrl() { public get canDownloadUrl() {
return this.compute('canDownloadUrl', () => hasAnyLink(this._links, 'download')); return this.compute('canDownloadUrl', () => hasAnyLink(this._links, 'download'));
} }
get downloadUrl() { public get downloadUrl() {
return this.compute('downloadUrl', () => this._links['download']?.href); return this.compute('downloadUrl', () => this._links['download']?.href);
} }
get isfailed() { public get isfailed() {
return this.status === 'Failed'; return this.status === 'Failed';
} }
} }
export class JobsDto extends generated.JobsDto { export class JobsDto extends generated.JobsDto {
get canCreateBackup() { public get canCreateBackup() {
return this.compute('canCreateBackup', () => hasAnyLink(this._links, 'create/backups')); return this.compute('canCreateBackup', () => hasAnyLink(this._links, 'create/backups'));
} }
} }
export class RoleDto extends generated.RoleDto { export class RoleDto extends generated.RoleDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class RolesDto extends generated.RolesDto { export class RolesDto extends generated.RolesDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
export class SchemaDto extends generated.SchemaDto { export class SchemaDto extends generated.SchemaDto {
get canAddField() { public get canAddField() {
return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add')); return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add'));
} }
get canContentsCreate() { public get canContentsCreate() {
return this.compute('canContentsCreate', () => hasAnyLink(this._links, 'contents/create')); return this.compute('canContentsCreate', () => hasAnyLink(this._links, 'contents/create'));
} }
get canContentsCreateAndPublish() { public get canContentsCreateAndPublish() {
return this.compute('canContentsCreateAndPublish', () => hasAnyLink(this._links, 'contents/create/publish')); return this.compute('canContentsCreateAndPublish', () => hasAnyLink(this._links, 'contents/create/publish'));
} }
get canContentsRead() { public get canContentsRead() {
return this.compute('canContentsCreateAndPublish', () => hasAnyLink(this._links, 'contents')); return this.compute('canContentsRead', () => hasAnyLink(this._links, 'contents'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canOrderFields() { public get canOrderFields() {
return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order')); return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order'));
} }
get canPublish() { public get canPublish() {
return this.compute('canPublish', () => hasAnyLink(this._links, 'publish')); return this.compute('canPublish', () => hasAnyLink(this._links, 'publish'));
} }
get canReadContents() { public get canReadContents() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'contents')); return this.compute('canReadContents', () => hasAnyLink(this._links, 'contents'));
} }
get canSynchronize() { public get canSynchronize() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'update/sync')); return this.compute('canSynchronize', () => hasAnyLink(this._links, 'update/sync'));
} }
get canUnpublish() { public get canUnpublish() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'unpublish')); return this.compute('canUnpublish', () => hasAnyLink(this._links, 'unpublish'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
get canUpdateCategory() { public get canUpdateCategory() {
return this.compute('canUpdateCategory', () => hasAnyLink(this._links, 'update/category')); return this.compute('canUpdateCategory', () => hasAnyLink(this._links, 'update/category'));
} }
get canUpdateRules() { public get canUpdateRules() {
return this.compute('canUpdateCategory', () => hasAnyLink(this._links, 'update/rules')); return this.compute('canUpdateRules', () => hasAnyLink(this._links, 'update/rules'));
} }
get canUpdateScripts() { public get canUpdateScripts() {
return this.compute('canUpdateScripts', () => hasAnyLink(this._links, 'update/scripts')); return this.compute('canUpdateScripts', () => hasAnyLink(this._links, 'update/scripts'));
} }
get canUpdateUIFields() { public get canUpdateUIFields() {
return this.compute('canUpdateUIFields', () => hasAnyLink(this._links, 'fields/ui')); return this.compute('canUpdateUIFields', () => hasAnyLink(this._links, 'fields/ui'));
} }
get canUpdateUrls() { public get canUpdateUrls() {
return this.compute('canUpdateUrls', () => hasAnyLink(this._links, 'update/urls')); return this.compute('canUpdateUrls', () => hasAnyLink(this._links, 'update/urls'));
} }
get displayName() { public get displayName() {
return this.compute('displayName', () => StringHelper.firstNonEmpty(this.properties.label, this.name)); return this.compute('displayName', () => StringHelper.firstNonEmpty(this.properties.label, this.name));
} }
get contentFields() { public get contentFields() {
return this.compute('displayName', () => this.fields.filter(x => x.properties.isContentField).map(tableField)); return this.compute('contentFields', () => this.fields.filter(x => x.properties.isContentField).map(tableField));
} }
get defaultListFields() { public get defaultListFields() {
return this.compute('defaultListFields', () => { return this.compute('defaultListFields', () => {
const listFields = tableFields(this.fieldsInLists, this.contentFields); const listFields = tableFields(this.fieldsInLists, this.contentFields);
@ -563,7 +563,7 @@ export class SchemaDto extends generated.SchemaDto {
}); });
} }
get defaultReferenceFields() { public get defaultReferenceFields() {
return this.compute('defaultReferenceFields', () => { return this.compute('defaultReferenceFields', () => {
const referenceFields = tableFields(this.fieldsInReferences, this.contentFields); const referenceFields = tableFields(this.fieldsInReferences, this.contentFields);
@ -637,99 +637,99 @@ export class SchemaDto extends generated.SchemaDto {
} }
export class DynamicRuleDto extends generated.DynamicRuleDto { export class DynamicRuleDto extends generated.DynamicRuleDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDisable() { public get canDisable() {
return this.compute('canDisable', () => hasAnyLink(this._links, 'disable')); return this.compute('canDisable', () => hasAnyLink(this._links, 'disable'));
} }
get canEnable() { public get canEnable() {
return this.compute('canEnable', () => hasAnyLink(this._links, 'enable')); return this.compute('canEnable', () => hasAnyLink(this._links, 'enable'));
} }
get canReadLogs() { public get canReadLogs() {
return this.compute('canReadLogs', () => hasAnyLink(this._links, 'logs')); return this.compute('canReadLogs', () => hasAnyLink(this._links, 'logs'));
} }
get canRun() { public get canRun() {
return this.compute('canRun', () => hasAnyLink(this._links, 'run')); return this.compute('canRun', () => hasAnyLink(this._links, 'run'));
} }
get canRunFromSnapshots() { public get canRunFromSnapshots() {
return this.compute('canRunFromSnapshots', () => hasAnyLink(this._links, 'run/snapshots')); return this.compute('canRunFromSnapshots', () => hasAnyLink(this._links, 'run/snapshots'));
} }
get canTrigger() { public get canTrigger() {
return this.compute('canTrigger', () => hasAnyLink(this._links, 'trigger')); return this.compute('canTrigger', () => hasAnyLink(this._links, 'trigger'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class DynamicRulesDto extends generated.DynamicRulesDto { export class DynamicRulesDto extends generated.DynamicRulesDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get canReadEvents() { public get canReadEvents() {
return this.compute('canReadEvents', () => hasAnyLink(this._links, 'events')); return this.compute('canReadEvents', () => hasAnyLink(this._links, 'events'));
} }
get canCancelRun() { public get canCancelRun() {
return this.compute('canCancelRun', () => hasAnyLink(this._links, 'run/cancel')); return this.compute('canCancelRun', () => hasAnyLink(this._links, 'run/cancel'));
} }
} }
export class RuleEventDto extends generated.RuleEventDto { export class RuleEventDto extends generated.RuleEventDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'cancel')); return this.compute('canDelete', () => hasAnyLink(this._links, 'cancel'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class RuleEventsDto extends generated.RuleEventsDto { export class RuleEventsDto extends generated.RuleEventsDto {
get canCancelAll() { public get canCancelAll() {
return this.compute('canCancelAll ', () => hasAnyLink(this._links, 'cancel')); return this.compute('canCancelAll', () => hasAnyLink(this._links, 'cancel'));
} }
} }
export class SearchResultDto extends generated.SearchResultDto { export class SearchResultDto extends generated.SearchResultDto {
get url() { public get url() {
return this.compute('url', () => this._links['url'].href); return this.compute('url', () => this._links['url'].href);
} }
} }
export class TeamDto extends generated.TeamDto { export class TeamDto extends generated.TeamDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canReadAuth() { public get canReadAuth() {
return this.compute('canReadAuth', () => hasAnyLink(this._links, 'auth')); return this.compute('canReadAuth', () => hasAnyLink(this._links, 'auth'));
} }
get canReadContributors() { public get canReadContributors() {
return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors')); return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors'));
} }
get canReadPlans() { public get canReadPlans() {
return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans')); return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans'));
} }
get canUpdateGeneral() { public get canUpdateGeneral() {
return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update'));
} }
} }
export class SchemasDto extends generated.SchemasDto { export class SchemasDto extends generated.SchemasDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
@ -745,45 +745,45 @@ export class ServerErrorDto extends generated.ServerErrorDto {
} }
export class UserDto extends generated.UserDto { export class UserDto extends generated.UserDto {
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canLock() { public get canLock() {
return this.compute('canLock', () => hasAnyLink(this._links, 'lock')); return this.compute('canLock', () => hasAnyLink(this._links, 'lock'));
} }
get canUnlock() { public get canUnlock() {
return this.compute('canUnlock', () => hasAnyLink(this._links, 'unlock')); return this.compute('canUnlock', () => hasAnyLink(this._links, 'unlock'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class UsersDto extends generated.UsersDto { export class UsersDto extends generated.UsersDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }
export class WorkflowDto extends generated.WorkflowDto { export class WorkflowDto extends generated.WorkflowDto {
get displayName() { public get displayName() {
return this.compute('displayName', () => StringHelper.firstNonEmpty(this.name, 'i18n:workflows.notNamed')); return this.compute('displayName', () => StringHelper.firstNonEmpty(this.name, 'i18n:workflows.notNamed'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
} }
export class WorkflowsDto extends generated.WorkflowsDto { export class WorkflowsDto extends generated.WorkflowsDto {
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
} }

294
frontend/src/app/shared/model/generated.ts

@ -319,7 +319,7 @@ export class UsersDto extends ResourceDto implements IUsersDto {
/** The users. */ /** The users. */
readonly items!: UserDto[]; readonly items!: UserDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -378,19 +378,19 @@ export class UserDto extends ResourceDto implements IUserDto {
/** Additional permissions for the user. */ /** Additional permissions for the user. */
readonly permissions!: string[]; readonly permissions!: string[];
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canLock() { public get canLock() {
return this.compute('canLock', () => hasAnyLink(this._links, 'lock')); return this.compute('canLock', () => hasAnyLink(this._links, 'lock'));
} }
get canUnlock() { public get canUnlock() {
return this.compute('canUnlock', () => hasAnyLink(this._links, 'unlock')); return this.compute('canUnlock', () => hasAnyLink(this._links, 'unlock'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -1094,11 +1094,11 @@ export class ContributorsDto extends ResourceDto implements IContributorsDto {
/** The metadata to provide information about this request. */ /** The metadata to provide information about this request. */
readonly _meta?: ContributorsMetadataDto | undefined; readonly _meta?: ContributorsMetadataDto | undefined;
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get isInvited() { public get isInvited() {
return this.compute('isInvited', () => this._meta?.['isInvited'] === '1'); return this.compute('isInvited', () => this._meta?.['isInvited'] === '1');
} }
@ -1163,12 +1163,12 @@ export class ContributorDto extends ResourceDto implements IContributorDto {
return `subject:${this.contributorId}`; return `subject:${this.contributorId}`;
} }
get canRevoke() { public get canRevoke() {
return this.compute('canRevoke ', () => hasAnyLink(this._links, 'update')); return this.compute('canRevoke', () => hasAnyLink(this._links, 'update'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate ', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
constructor(data?: IContributorDto) { constructor(data?: IContributorDto) {
@ -1366,23 +1366,23 @@ export class TeamDto extends ResourceDto implements ITeamDto {
/** The role name of the user. */ /** The role name of the user. */
readonly roleName?: string | undefined; readonly roleName?: string | undefined;
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canReadAuth() { public get canReadAuth() {
return this.compute('canReadAuth', () => hasAnyLink(this._links, 'auth')); return this.compute('canReadAuth', () => hasAnyLink(this._links, 'auth'));
} }
get canReadContributors() { public get canReadContributors() {
return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors')); return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors'));
} }
get canReadPlans() { public get canReadPlans() {
return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans')); return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans'));
} }
get canUpdateGeneral() { public get canUpdateGeneral() {
return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update'));
} }
@ -1571,7 +1571,7 @@ export class AuthSchemeResponseDto extends ResourceDto implements IAuthSchemeRes
/** The auth scheme if configured. */ /** The auth scheme if configured. */
readonly scheme?: AuthSchemeDto | undefined; readonly scheme?: AuthSchemeDto | undefined;
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -2167,7 +2167,7 @@ export class SearchResultDto extends ResourceDto implements ISearchResultDto {
/** An optional label. */ /** An optional label. */
readonly label?: string | undefined; readonly label?: string | undefined;
get url() { public get url() {
return this.compute('url', () => this._links['url'].href); return this.compute('url', () => this._links['url'].href);
} }
@ -2259,79 +2259,79 @@ export class SchemaDto extends ResourceDto implements ISchemaDto {
/** The list of fields. */ /** The list of fields. */
readonly fields!: FieldDto[]; readonly fields!: FieldDto[];
get canAddField() { public get canAddField() {
return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add')); return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add'));
} }
get canContentsCreate() { public get canContentsCreate() {
return this.compute('canContentsCreate', () => hasAnyLink(this._links, 'contents/create')); return this.compute('canContentsCreate', () => hasAnyLink(this._links, 'contents/create'));
} }
get canContentsCreateAndPublish() { public get canContentsCreateAndPublish() {
return this.compute('canContentsCreateAndPublish', () => hasAnyLink(this._links, 'contents/create/publish')); return this.compute('canContentsCreateAndPublish', () => hasAnyLink(this._links, 'contents/create/publish'));
} }
get canContentsRead() { public get canContentsRead() {
return this.compute('canContentsCreateAndPublish', () => hasAnyLink(this._links, 'contents')); return this.compute('canContentsRead', () => hasAnyLink(this._links, 'contents'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canOrderFields() { public get canOrderFields() {
return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order')); return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order'));
} }
get canPublish() { public get canPublish() {
return this.compute('canPublish', () => hasAnyLink(this._links, 'publish')); return this.compute('canPublish', () => hasAnyLink(this._links, 'publish'));
} }
get canReadContents() { public get canReadContents() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'contents')); return this.compute('canReadContents', () => hasAnyLink(this._links, 'contents'));
} }
get canSynchronize() { public get canSynchronize() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'update/sync')); return this.compute('canSynchronize', () => hasAnyLink(this._links, 'update/sync'));
} }
get canUnpublish() { public get canUnpublish() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'unpublish')); return this.compute('canUnpublish', () => hasAnyLink(this._links, 'unpublish'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canReadContents', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
get canUpdateCategory() { public get canUpdateCategory() {
return this.compute('canUpdateCategory', () => hasAnyLink(this._links, 'update/category')); return this.compute('canUpdateCategory', () => hasAnyLink(this._links, 'update/category'));
} }
get canUpdateRules() { public get canUpdateRules() {
return this.compute('canUpdateCategory', () => hasAnyLink(this._links, 'update/rules')); return this.compute('canUpdateRules', () => hasAnyLink(this._links, 'update/rules'));
} }
get canUpdateScripts() { public get canUpdateScripts() {
return this.compute('canUpdateScripts', () => hasAnyLink(this._links, 'update/scripts')); return this.compute('canUpdateScripts', () => hasAnyLink(this._links, 'update/scripts'));
} }
get canUpdateUIFields() { public get canUpdateUIFields() {
return this.compute('canUpdateUIFields', () => hasAnyLink(this._links, 'fields/ui')); return this.compute('canUpdateUIFields', () => hasAnyLink(this._links, 'fields/ui'));
} }
get canUpdateUrls() { public get canUpdateUrls() {
return this.compute('canUpdateUrls', () => hasAnyLink(this._links, 'update/urls')); return this.compute('canUpdateUrls', () => hasAnyLink(this._links, 'update/urls'));
} }
get displayName() { public get displayName() {
return this.compute('displayName', () => StringHelper.firstNonEmpty(this.properties.label, this.name)); return this.compute('displayName', () => StringHelper.firstNonEmpty(this.properties.label, this.name));
} }
get contentFields() { public get contentFields() {
return this.compute('displayName', () => this.fields.filter(x => x.properties.isContentField).map(tableField)); return this.compute('contentFields', () => this.fields.filter(x => x.properties.isContentField).map(tableField));
} }
get defaultListFields() { public get defaultListFields() {
return this.compute('defaultListFields', () => { return this.compute('defaultListFields', () => {
const listFields = tableFields(this.fieldsInLists, this.contentFields); const listFields = tableFields(this.fieldsInLists, this.contentFields);
@ -2352,7 +2352,7 @@ export class SchemaDto extends ResourceDto implements ISchemaDto {
}); });
} }
get defaultReferenceFields() { public get defaultReferenceFields() {
return this.compute('defaultReferenceFields', () => { return this.compute('defaultReferenceFields', () => {
const referenceFields = tableFields(this.fieldsInReferences, this.contentFields); const referenceFields = tableFields(this.fieldsInReferences, this.contentFields);
@ -2886,15 +2886,15 @@ export class FieldDto extends ResourceDto implements IFieldDto {
return this.properties; return this.properties;
} }
public get isInlineEditable(): boolean { public get isInlineEditable() {
return this.compute('isInlineEditable', () => !this.isDisabled && this.rawProperties.inlineEditable === true); return this.compute('isInlineEditable', () => !this.isDisabled && this.rawProperties.inlineEditable === true);
} }
public get isInvariant(): boolean { public get isInvariant() {
return this.compute('isInvariant', () => this.partitioning === 'invariant'); return this.compute('isInvariant', () => this.partitioning === 'invariant');
} }
public get isLocalizable(): boolean { public get isLocalizable() {
return this.compute('isLocalizable', () => this.partitioning === 'language'); return this.compute('isLocalizable', () => this.partitioning === 'language');
} }
@ -2906,39 +2906,39 @@ export class FieldDto extends ResourceDto implements IFieldDto {
return this.compute('displayPlaceholder', () => this.properties.placeholder || ''); return this.compute('displayPlaceholder', () => this.properties.placeholder || '');
} }
get canAddField() { public get canAddField() {
return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add')); return this.compute('canAddField', () => hasAnyLink(this._links, 'fields/add'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDisable() { public get canDisable() {
return this.compute('canDisable', () => hasAnyLink(this._links, 'disable')); return this.compute('canDisable', () => hasAnyLink(this._links, 'disable'));
} }
get canEnable() { public get canEnable() {
return this.compute('canEnable', () => hasAnyLink(this._links, 'enable')); return this.compute('canEnable', () => hasAnyLink(this._links, 'enable'));
} }
get canOrderFields() { public get canOrderFields() {
return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order')); return this.compute('canOrderFields', () => hasAnyLink(this._links, 'fields/order'));
} }
get canHide() { public get canHide() {
return this.compute('canHide', () => hasAnyLink(this._links, 'hide')); return this.compute('canHide', () => hasAnyLink(this._links, 'hide'));
} }
get canLock() { public get canLock() {
return this.compute('canLock', () => hasAnyLink(this._links, 'lock')); return this.compute('canLock', () => hasAnyLink(this._links, 'lock'));
} }
get canShow() { public get canShow() {
return this.compute('canShow', () => hasAnyLink(this._links, 'show')); return this.compute('canShow', () => hasAnyLink(this._links, 'show'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -4664,30 +4664,30 @@ export class NestedFieldDto extends ResourceDto implements INestedFieldDto {
return this.compute('displayPlaceholder', () => this.properties.placeholder || ''); return this.compute('displayPlaceholder', () => this.properties.placeholder || '');
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDisable() { public get canDisable() {
return this.compute('canDisable', () => hasAnyLink(this._links, 'disable')); return this.compute('canDisable', () => hasAnyLink(this._links, 'disable'));
} }
get canEnable() { public get canEnable() {
return this.compute('canEnable', () => hasAnyLink(this._links, 'enable')); return this.compute('canEnable', () => hasAnyLink(this._links, 'enable'));
} }
get canHide() { public get canHide() {
return this.compute('canHide', () => hasAnyLink(this._links, 'hide')); return this.compute('canHide', () => hasAnyLink(this._links, 'hide'));
} }
get canLock() { public get canLock() {
return this.compute('canLock', () => hasAnyLink(this._links, 'lock')); return this.compute('canLock', () => hasAnyLink(this._links, 'lock'));
} }
get canShow() { public get canShow() {
return this.compute('canShow', () => hasAnyLink(this._links, 'show')); return this.compute('canShow', () => hasAnyLink(this._links, 'show'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -5032,7 +5032,7 @@ export class IndexesDto extends ResourceDto implements IIndexesDto {
/** The indexes. */ /** The indexes. */
readonly items!: IndexDto[]; readonly items!: IndexDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -5081,7 +5081,7 @@ export class IndexDto extends ResourceDto implements IIndexDto {
/** The index fields. */ /** The index fields. */
readonly fields!: IndexFieldDto[]; readonly fields!: IndexFieldDto[];
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
@ -5275,7 +5275,7 @@ export class SchemasDto extends ResourceDto implements ISchemasDto {
/** The schemas. */ /** The schemas. */
readonly items!: SchemaDto[]; readonly items!: SchemaDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -9984,8 +9984,8 @@ export class RuleEventsDto extends ResourceDto implements IRuleEventsDto {
/** The rule events. */ /** The rule events. */
readonly items!: RuleEventDto[]; readonly items!: RuleEventDto[];
get canCancelAll() { public get canCancelAll() {
return this.compute('canCancelAll ', () => hasAnyLink(this._links, 'cancel')); return this.compute('canCancelAll', () => hasAnyLink(this._links, 'cancel'));
} }
constructor(data?: IRuleEventsDto) { constructor(data?: IRuleEventsDto) {
@ -10037,11 +10037,11 @@ export class RuleEventDto extends ResourceDto implements IRuleEventDto {
/** The flow state. */ /** The flow state. */
readonly flowState!: FlowExecutionStateDto; readonly flowState!: FlowExecutionStateDto;
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'cancel')); return this.compute('canDelete', () => hasAnyLink(this._links, 'cancel'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -10711,7 +10711,7 @@ export class JobsDto extends ResourceDto implements IJobsDto {
/** The jobs. */ /** The jobs. */
readonly items!: JobDto[]; readonly items!: JobDto[];
get canCreateBackup() { public get canCreateBackup() {
return this.compute('canCreateBackup', () => hasAnyLink(this._links, 'create/backups')); return this.compute('canCreateBackup', () => hasAnyLink(this._links, 'create/backups'));
} }
@ -10774,19 +10774,19 @@ export class JobDto extends ResourceDto implements IJobDto {
/** Indicates whether the job can be downloaded. */ /** Indicates whether the job can be downloaded. */
readonly canDownload!: boolean; readonly canDownload!: boolean;
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDownloadUrl() { public get canDownloadUrl() {
return this.compute('canDownloadUrl', () => hasAnyLink(this._links, 'download')); return this.compute('canDownloadUrl', () => hasAnyLink(this._links, 'download'));
} }
get downloadUrl() { public get downloadUrl() {
return this.compute('downloadUrl', () => this._links['download']?.href); return this.compute('downloadUrl', () => this._links['download']?.href);
} }
get isfailed() { public get isfailed() {
return this.status === 'Failed'; return this.status === 'Failed';
} }
@ -11098,15 +11098,15 @@ export class EventConsumerDto extends ResourceDto implements IEventConsumerDto {
/** The position within the vent stream. */ /** The position within the vent stream. */
readonly position?: string | undefined; readonly position?: string | undefined;
get canReset() { public get canReset() {
return this.compute('reset', () => hasAnyLink(this._links, 'reset')); return this.compute('canReset', () => hasAnyLink(this._links, 'reset'));
} }
get canStart() { public get canStart() {
return this.compute('canStart', () => hasAnyLink(this._links, 'start')); return this.compute('canStart', () => hasAnyLink(this._links, 'start'));
} }
get canStop() { public get canStop() {
return this.compute('canStop', () => hasAnyLink(this._links, 'stop')); return this.compute('canStop', () => hasAnyLink(this._links, 'stop'));
} }
@ -11169,12 +11169,12 @@ export class ContentsDto extends ResourceDto implements IContentsDto {
/** The possible statuses. */ /** The possible statuses. */
readonly statuses!: StatusInfoDto[]; readonly statuses!: StatusInfoDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get canCreateAndPublish() { public get canCreateAndPublish() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create/publish')); return this.compute('canCreateAndPublish', () => hasAnyLink(this._links, 'create/publish'));
} }
constructor(data?: IContentsDto) { constructor(data?: IContentsDto) {
@ -11272,31 +11272,31 @@ export class ContentDto extends ResourceDto implements IContentDto {
/** The version of the content. */ /** The version of the content. */
readonly version!: number; readonly version!: number;
get canPublish() { public get canPublish() {
return this.compute('canPublish', () => this.statusUpdates.find(x => x.status === 'Published')); return this.compute('canPublish', () => this.statusUpdates.find(x => x.status === 'Published'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canDraftCreate() { public get canDraftCreate() {
return this.compute('canDraftCreate', () => hasAnyLink(this._links, 'draft/create')); return this.compute('canDraftCreate', () => hasAnyLink(this._links, 'draft/create'));
} }
get canDraftDelete() { public get canDraftDelete() {
return this.compute('canDraftDelete', () => hasAnyLink(this._links, 'draft/delete')); return this.compute('canDraftDelete', () => hasAnyLink(this._links, 'draft/delete'));
} }
get canCancelStatus() { public get canCancelStatus() {
return this.compute('canCancelStatus', () => hasAnyLink(this._links, 'cancel')); return this.compute('canCancelStatus', () => hasAnyLink(this._links, 'cancel'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
get statusUpdates() { public get statusUpdates() {
return this.compute('statusUpdates', () => { return this.compute('statusUpdates', () => {
const updates: { status: string; color: string }[] = []; const updates: { status: string; color: string }[] = [];
for (const [key, link] of Object.entries(this._links)) { for (const [key, link] of Object.entries(this._links)) {
@ -12747,7 +12747,7 @@ export class AssetFoldersDto extends ResourceDto implements IAssetFoldersDto {
/** The path to the current folder. */ /** The path to the current folder. */
readonly path!: AssetFolderDto[]; readonly path!: AssetFolderDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -12816,15 +12816,15 @@ export class AssetFolderDto extends ResourceDto implements IAssetFolderDto {
/** The version of the asset folder. */ /** The version of the asset folder. */
readonly version!: number; readonly version!: number;
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canMove() { public get canMove() {
return this.compute('canMove', () => hasAnyLink(this._links, 'move')); return this.compute('canMove', () => hasAnyLink(this._links, 'move'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -13135,11 +13135,11 @@ export class AssetsDto extends ResourceDto implements IAssetsDto {
/** The assets. */ /** The assets. */
readonly items!: AssetDto[]; readonly items!: AssetDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get canRenameTag() { public get canRenameTag() {
return this.compute('canRenameTag', () => hasAnyLink(this._links, 'tags/rename')); return this.compute('canRenameTag', () => hasAnyLink(this._links, 'tags/rename'));
} }
@ -13244,23 +13244,23 @@ export class AssetDto extends ResourceDto implements IAssetDto {
return this.compute('contentUrl', () => this._links['content']?.href); return this.compute('contentUrl', () => this._links['content']?.href);
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canMove() { public get canMove() {
return this.compute('canMove', () => hasAnyLink(this._links, 'move')); return this.compute('canMove', () => hasAnyLink(this._links, 'move'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
get canUpload() { public get canUpload() {
return this.compute('canUpload', () => hasAnyLink(this._links, 'upload')); return this.compute('canUpload', () => hasAnyLink(this._links, 'upload'));
} }
get canPreview() { public get canPreview() {
return this.compute('canPreview', () => { return this.compute('canPreview', () => {
const SVG_PREVIEW_LIMIT = 10 * 1024; const SVG_PREVIEW_LIMIT = 10 * 1024;
const MIME_TIFF = 'image/tiff'; const MIME_TIFF = 'image/tiff';
@ -13909,7 +13909,7 @@ export class AssetScriptsDto extends ResourceDto implements IAssetScriptsDto {
/** The version of the app. */ /** The version of the app. */
readonly version!: number; readonly version!: number;
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -14073,7 +14073,7 @@ export class ClientsDto extends ResourceDto implements IClientsDto {
/** The clients. */ /** The clients. */
readonly items!: ClientDto[]; readonly items!: ClientDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -14132,11 +14132,11 @@ export class ClientDto extends ResourceDto implements IClientDto {
/** True to allow anonymous access without an access token for this client. */ /** True to allow anonymous access without an access token for this client. */
readonly allowAnonymous!: boolean; readonly allowAnonymous!: boolean;
get canRevoke() { public get canRevoke() {
return this.compute('canRevoke', () => hasAnyLink(this._links, 'delete')); return this.compute('canRevoke', () => hasAnyLink(this._links, 'delete'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -14345,7 +14345,7 @@ export class AppLanguagesDto extends ResourceDto implements IAppLanguagesDto {
/** The languages. */ /** The languages. */
readonly items!: AppLanguageDto[]; readonly items!: AppLanguageDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -14400,11 +14400,11 @@ export class AppLanguageDto extends ResourceDto implements IAppLanguageDto {
/** Indicates if the language is optional. */ /** Indicates if the language is optional. */
readonly isOptional!: boolean; readonly isOptional!: boolean;
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -14609,7 +14609,7 @@ export class RolesDto extends ResourceDto implements IRolesDto {
/** The roles. */ /** The roles. */
readonly items!: RoleDto[]; readonly items!: RoleDto[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -14666,11 +14666,11 @@ export class RoleDto extends ResourceDto implements IRoleDto {
/** Associated list of UI properties. */ /** Associated list of UI properties. */
readonly properties!: { [key: string]: any; }; readonly properties!: { [key: string]: any; };
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'update')); return this.compute('canDelete', () => hasAnyLink(this._links, 'update'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -14925,87 +14925,87 @@ export class AppDto extends ResourceDto implements IAppDto {
/** The properties from the role. */ /** The properties from the role. */
readonly roleProperties!: { [key: string]: any; }; readonly roleProperties!: { [key: string]: any; };
get displayName() { public get displayName() {
return this.compute('displayName', () => StringHelper.firstNonEmpty(this.label, this.name)); return this.compute('displayName', () => StringHelper.firstNonEmpty(this.label, this.name));
} }
get canCreateSchema() { public get canCreateSchema() {
return this.compute('canCreateSchema', () => hasAnyLink(this._links, 'schemas/create')); return this.compute('canCreateSchema', () => hasAnyLink(this._links, 'schemas/create'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canLeave() { public get canLeave() {
return this.compute('canLeave', () => hasAnyLink(this._links, 'leave')); return this.compute('canLeave', () => hasAnyLink(this._links, 'leave'));
} }
get canReadAssets() { public get canReadAssets() {
return this.compute('canReadAssets', () => hasAnyLink(this._links, 'assets')); return this.compute('canReadAssets', () => hasAnyLink(this._links, 'assets'));
} }
get canReadAssetsScripts() { public get canReadAssetsScripts() {
return this.compute('canReadAssetsScripts', () => hasAnyLink(this._links, 'assets/scripts')); return this.compute('canReadAssetsScripts', () => hasAnyLink(this._links, 'assets/scripts'));
} }
get canReadClients() { public get canReadClients() {
return this.compute('canReadClients', () => hasAnyLink(this._links, 'clients')); return this.compute('canReadClients', () => hasAnyLink(this._links, 'clients'));
} }
get canReadContributors() { public get canReadContributors() {
return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors')); return this.compute('canReadContributors', () => hasAnyLink(this._links, 'contributors'));
} }
get canReadJobs() { public get canReadJobs() {
return this.compute('canReadJobs', () => hasAnyLink(this._links, 'jobs')); return this.compute('canReadJobs', () => hasAnyLink(this._links, 'jobs'));
} }
get canReadLanguages() { public get canReadLanguages() {
return this.compute('canReadLanguages', () => hasAnyLink(this._links, 'languages')); return this.compute('canReadLanguages', () => hasAnyLink(this._links, 'languages'));
} }
get canReadPatterns() { public get canReadPatterns() {
return this.compute('canReadPatterns', () => hasAnyLink(this._links, 'patterns')); return this.compute('canReadPatterns', () => hasAnyLink(this._links, 'patterns'));
} }
get canReadPlans() { public get canReadPlans() {
return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans')); return this.compute('canReadPlans', () => hasAnyLink(this._links, 'plans'));
} }
get canReadRoles() { public get canReadRoles() {
return this.compute('canReadRoles', () => hasAnyLink(this._links, 'roles')); return this.compute('canReadRoles', () => hasAnyLink(this._links, 'roles'));
} }
get canReadRules() { public get canReadRules() {
return this.compute('canReadRules', () => hasAnyLink(this._links, 'rules')); return this.compute('canReadRules', () => hasAnyLink(this._links, 'rules'));
} }
get canReadSchemas() { public get canReadSchemas() {
return this.compute('canReadSchemas', () => hasAnyLink(this._links, 'schemas')); return this.compute('canReadSchemas', () => hasAnyLink(this._links, 'schemas'));
} }
get canReadWorkflows() { public get canReadWorkflows() {
return this.compute('canReadWorkflows', () => hasAnyLink(this._links, 'workflows')); return this.compute('canReadWorkflows', () => hasAnyLink(this._links, 'workflows'));
} }
get canUpdateGeneral() { public get canUpdateGeneral() {
return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdateGeneral', () => hasAnyLink(this._links, 'update'));
} }
get canUpdateImage() { public get canUpdateImage() {
return this.compute('canUpdateImage', () => hasAnyLink(this._links, 'image/upload')); return this.compute('canUpdateImage', () => hasAnyLink(this._links, 'image/upload'));
} }
get canUpdateTeam() { public get canUpdateTeam() {
return this.compute('canUpdateTeam', () => hasAnyLink(this._links, 'transfer')); return this.compute('canUpdateTeam', () => hasAnyLink(this._links, 'transfer'));
} }
get canUploadAssets() { public get canUploadAssets() {
return this.compute('canUploadAssets', () => hasAnyLink(this._links, 'assets/create')); return this.compute('canUploadAssets', () => hasAnyLink(this._links, 'assets/create'));
} }
get image() { public get image() {
return this.compute('image', () => this._links['image']?.href); return this.compute('image', () => this._links['image']?.href);
} }
@ -15323,7 +15323,7 @@ export class AppSettingsDto extends ResourceDto implements IAppSettingsDto {
/** The version of the app. */ /** The version of the app. */
readonly version!: number; readonly version!: number;
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -15631,7 +15631,7 @@ export class WorkflowsDto extends ResourceDto implements IWorkflowsDto {
/** The errros that should be fixed. */ /** The errros that should be fixed. */
readonly errors!: string[]; readonly errors!: string[];
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
@ -15698,15 +15698,15 @@ export class WorkflowDto extends ResourceDto implements IWorkflowDto {
/** The initial step. */ /** The initial step. */
readonly initial!: string; readonly initial!: string;
get displayName() { public get displayName() {
return this.compute('displayName', () => StringHelper.firstNonEmpty(this.name, 'i18n:workflows.notNamed')); return this.compute('displayName', () => StringHelper.firstNonEmpty(this.name, 'i18n:workflows.notNamed'));
} }
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }
@ -17155,15 +17155,15 @@ export class DynamicRulesDto extends ResourceDto implements IDynamicRulesDto {
/** The ID of the rule that is currently rerunning. */ /** The ID of the rule that is currently rerunning. */
readonly runningRuleId?: string | undefined; readonly runningRuleId?: string | undefined;
get canCreate() { public get canCreate() {
return this.compute('canCreate', () => hasAnyLink(this._links, 'create')); return this.compute('canCreate', () => hasAnyLink(this._links, 'create'));
} }
get canReadEvents() { public get canReadEvents() {
return this.compute('canReadEvents', () => hasAnyLink(this._links, 'events')); return this.compute('canReadEvents', () => hasAnyLink(this._links, 'events'));
} }
get canCancelRun() { public get canCancelRun() {
return this.compute('canCancelRun', () => hasAnyLink(this._links, 'run/cancel')); return this.compute('canCancelRun', () => hasAnyLink(this._links, 'run/cancel'));
} }
@ -17240,35 +17240,35 @@ export class DynamicRuleDto extends ResourceDto implements IDynamicRuleDto {
/** The date and time when the rule was executed the last time. */ /** The date and time when the rule was executed the last time. */
readonly lastExecuted?: DateTime | undefined; readonly lastExecuted?: DateTime | undefined;
get canDelete() { public get canDelete() {
return this.compute('canDelete', () => hasAnyLink(this._links, 'delete')); return this.compute('canDelete', () => hasAnyLink(this._links, 'delete'));
} }
get canDisable() { public get canDisable() {
return this.compute('canDisable', () => hasAnyLink(this._links, 'disable')); return this.compute('canDisable', () => hasAnyLink(this._links, 'disable'));
} }
get canEnable() { public get canEnable() {
return this.compute('canEnable', () => hasAnyLink(this._links, 'enable')); return this.compute('canEnable', () => hasAnyLink(this._links, 'enable'));
} }
get canReadLogs() { public get canReadLogs() {
return this.compute('canReadLogs', () => hasAnyLink(this._links, 'logs')); return this.compute('canReadLogs', () => hasAnyLink(this._links, 'logs'));
} }
get canRun() { public get canRun() {
return this.compute('canRun', () => hasAnyLink(this._links, 'run')); return this.compute('canRun', () => hasAnyLink(this._links, 'run'));
} }
get canRunFromSnapshots() { public get canRunFromSnapshots() {
return this.compute('canRunFromSnapshots', () => hasAnyLink(this._links, 'run/snapshots')); return this.compute('canRunFromSnapshots', () => hasAnyLink(this._links, 'run/snapshots'));
} }
get canTrigger() { public get canTrigger() {
return this.compute('canTrigger', () => hasAnyLink(this._links, 'trigger')); return this.compute('canTrigger', () => hasAnyLink(this._links, 'trigger'));
} }
get canUpdate() { public get canUpdate() {
return this.compute('canUpdate', () => hasAnyLink(this._links, 'update')); return this.compute('canUpdate', () => hasAnyLink(this._links, 'update'));
} }

Loading…
Cancel
Save