Skip to content

Commit 42f0003

Browse files
committed
Remove explicit Props/SecuredProps across the codebase
1 parent 780bffe commit 42f0003

File tree

55 files changed

+17
-351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+17
-351
lines changed

src/common/resource.dto.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
import { createMetadataDecorator } from '@seedcompany/nest';
1111
import { LazyGetter as Once } from 'lazy-get-decorator';
1212
import { DateTime } from 'luxon';
13-
import { keys as keysOf } from 'ts-transformer-keys';
1413
import type {
1514
ResourceDBMap,
1615
ResourceLike,
@@ -53,9 +52,6 @@ export const resolveByTypename =
5352
})
5453
@DbLabel('BaseNode')
5554
export abstract class Resource extends DataObject {
56-
static readonly Props: string[] = keysOf<Resource>();
57-
static readonly SecuredProps: string[] = [];
58-
5955
readonly __typename?: string;
6056

6157
@IdField()

src/components/authorization/dto/assignable-roles.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import { RegisterResource } from '~/core/resources';
1717
@RegisterResource()
1818
@Calculated()
1919
export class AssignableRoles {
20-
static Props = [];
21-
static SecuredProps = [];
2220
static Relations = mapValues.fromList(Role, () => undefined)
2321
.asRecord satisfies ResourceRelationsShape;
2422
}

src/components/authorization/dto/beta-features.dto.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
32
import { Calculated, type ResourceRelationsShape } from '~/common';
43
import { RegisterResource } from '~/core/resources';
54
import { Granter, ResourceGranter } from '../policy';
@@ -10,9 +9,6 @@ import { Granter, ResourceGranter } from '../policy';
109
@Calculated()
1110
@ObjectType()
1211
export class BetaFeatures {
13-
static readonly Props = keysOf<BetaFeatures>();
14-
static readonly SecuredProps = [];
15-
1612
// Declaring as relations as well so privileges can use.
1713
static readonly Relations = {
1814
projectChangeRequests: undefined,

src/components/budget/dto/budget-record.dto.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
32
import {
43
Calculated,
54
type ID,
@@ -8,7 +7,6 @@ import {
87
type Secured,
98
SecuredFloatNullable,
109
SecuredInt,
11-
type SecuredProps,
1210
Sensitivity,
1311
SensitivityField,
1412
} from '~/common';
@@ -27,8 +25,6 @@ const Interfaces = IntersectTypes(Resource, ChangesetAware);
2725
implements: Interfaces.members,
2826
})
2927
export class BudgetRecord extends Interfaces {
30-
static readonly Props = keysOf<BudgetRecord>();
31-
static readonly SecuredProps = keysOf<SecuredProps<BudgetRecord>>();
3228
static readonly Parent = () => import('./budget.dto').then((m) => m.Budget);
3329

3430
@Field(() => Budget)

src/components/budget/dto/budget.dto.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
32
import {
43
Calculated,
54
DbLabel,
65
IntersectTypes,
76
Resource,
87
type ResourceRelationsShape,
98
SecuredProperty,
10-
type SecuredProps,
119
Sensitivity,
1210
SensitivityField,
1311
} from '~/common';
@@ -28,8 +26,6 @@ const Interfaces = IntersectTypes(Resource, ChangesetAware);
2826
implements: Interfaces.members,
2927
})
3028
export class Budget extends Interfaces {
31-
static readonly Props = keysOf<Budget>();
32-
static readonly SecuredProps = keysOf<SecuredProps<Budget>>();
3329
static readonly Relations = (() => ({
3430
records: [BudgetRecord],
3531
})) satisfies ResourceRelationsShape;

src/components/ceremony/dto/ceremony.dto.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
32
import {
43
Calculated,
54
Resource,
65
SecuredBoolean,
76
SecuredDateNullable,
87
SecuredProperty,
9-
type SecuredProps,
108
Sensitivity,
119
SensitivityField,
1210
} from '~/common';
@@ -20,8 +18,6 @@ import { CeremonyType } from './ceremony-type.enum';
2018
implements: [Resource],
2119
})
2220
export class Ceremony extends Resource {
23-
static readonly Props = keysOf<Ceremony>();
24-
static readonly SecuredProps = keysOf<SecuredProps<Ceremony>>();
2521
static readonly Parent = () =>
2622
import('../../engagement/dto').then((m) => m.IEngagement);
2723

src/components/changeset/dto/changeset.dto.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Field, InterfaceType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
3-
import { Resource, type SecuredProps } from '~/common';
2+
import { Resource } from '~/common';
43
import { RegisterResource } from '~/core/resources';
54

65
@RegisterResource()
@@ -9,8 +8,6 @@ import { RegisterResource } from '~/core/resources';
98
resolveType: (obj: Changeset) => obj.__typename,
109
})
1110
export class Changeset extends Resource {
12-
static readonly Props: string[] = keysOf<Changeset>();
13-
static readonly SecuredProps: string[] = keysOf<SecuredProps<Changeset>>();
1411
declare __typename: string;
1512

1613
@Field({

src/components/comments/dto/comment-thread.dto.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
32
import {
43
type ID,
54
Resource,
65
type ResourceRelationsShape,
7-
type SecuredProps,
86
type SetUnsecuredType,
97
type UnsecuredDto,
108
} from '~/common';
@@ -18,9 +16,6 @@ import { Comment } from './comment.dto';
1816
implements: [Resource],
1917
})
2018
export class CommentThread extends Resource {
21-
static readonly Props = keysOf<CommentThread>();
22-
static readonly SecuredProps: string[] =
23-
keysOf<SecuredProps<CommentThread>>();
2419
static readonly Relations = {
2520
comments: [Comment],
2621
} satisfies ResourceRelationsShape;

src/components/comments/dto/comment.dto.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import { Field, ObjectType } from '@nestjs/graphql';
22
import { DateTime } from 'luxon';
3-
import { keys as keysOf } from 'ts-transformer-keys';
4-
import {
5-
DateTimeField,
6-
type ID,
7-
Resource,
8-
type SecuredProps,
9-
SecuredRichText,
10-
} from '~/common';
3+
import { DateTimeField, type ID, Resource, SecuredRichText } from '~/common';
114
import { e } from '~/core/gel';
125
import { RegisterResource } from '~/core/resources';
136

@@ -16,8 +9,6 @@ import { RegisterResource } from '~/core/resources';
169
implements: [Resource],
1710
})
1811
export class Comment extends Resource {
19-
static readonly Props = keysOf<Comment>();
20-
static readonly SecuredProps: string[] = keysOf<SecuredProps<Comment>>();
2112
static readonly Parent = () =>
2213
import('./comment-thread.dto').then((m) => m.CommentThread);
2314

src/components/comments/dto/commentable.dto.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { InterfaceType } from '@nestjs/graphql';
2-
import { keys as keysOf } from 'ts-transformer-keys';
32
import {
43
resolveByTypename,
54
Resource,
65
type ResourceRelationsShape,
7-
type SecuredProps,
86
} from '~/common';
97
import { e } from '~/core/gel';
108
import { RegisterResource } from '~/core/resources';
@@ -17,8 +15,6 @@ import { CommentThread } from './comment-thread.dto';
1715
resolveType: resolveByTypename(Commentable.name),
1816
})
1917
export abstract class Commentable extends Resource {
20-
static readonly Props: string[] = keysOf<Commentable>();
21-
static readonly SecuredProps: string[] = keysOf<SecuredProps<Commentable>>();
2218
static readonly Relations = {
2319
commentThreads: [CommentThread],
2420
} satisfies ResourceRelationsShape;

0 commit comments

Comments
 (0)