@expo/entity 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/EnforcingEntityLoader.d.ts +5 -0
- package/build/EnforcingEntityLoader.js +8 -0
- package/build/EnforcingEntityLoader.js.map +1 -1
- package/build/Entity.d.ts +6 -6
- package/build/Entity.js +6 -29
- package/build/Entity.js.map +1 -1
- package/build/EntityAssociationLoader.d.ts +8 -8
- package/build/EntityAssociationLoader.js +4 -20
- package/build/EntityAssociationLoader.js.map +1 -1
- package/build/EntityFields.js +3 -2
- package/build/EntityFields.js.map +1 -1
- package/build/EntityLoader.d.ts +6 -0
- package/build/EntityLoader.js +11 -0
- package/build/EntityLoader.js.map +1 -1
- package/build/EntityMutationTriggerConfiguration.d.ts +5 -7
- package/build/EntityMutationTriggerConfiguration.js +3 -4
- package/build/EntityMutationTriggerConfiguration.js.map +1 -1
- package/build/EntityQueryContextProvider.d.ts +1 -1
- package/build/EntityQueryContextProvider.js +1 -1
- package/build/EntityQueryContextProvider.js.map +1 -1
- package/build/IEntityCacheAdapterProvider.d.ts +1 -1
- package/build/ReadonlyEntity.d.ts +1 -1
- package/build/ReadonlyEntity.js +1 -4
- package/build/ReadonlyEntity.js.map +1 -1
- package/build/ViewerContext.d.ts +2 -2
- package/build/ViewerContext.js +3 -3
- package/build/ViewerContext.js.map +1 -1
- package/build/__tests__/EnforcingEntityLoader-test.js +27 -0
- package/build/__tests__/EnforcingEntityLoader-test.js.map +1 -1
- package/build/__tests__/Entity-test.js +13 -13
- package/build/__tests__/Entity-test.js.map +1 -1
- package/build/__tests__/EntityAssociationLoader-test.js +69 -37
- package/build/__tests__/EntityAssociationLoader-test.js.map +1 -1
- package/build/__tests__/EntityCommonUseCases-test.js +19 -11
- package/build/__tests__/EntityCommonUseCases-test.js.map +1 -1
- package/build/__tests__/EntityEdges-test.js +72 -40
- package/build/__tests__/EntityEdges-test.js.map +1 -1
- package/build/__tests__/EntityFields-test.js +7 -1
- package/build/__tests__/EntityFields-test.js.map +1 -1
- package/build/__tests__/EntityLoader-constructor-test.js +1 -1
- package/build/__tests__/EntityLoader-constructor-test.js.map +1 -1
- package/build/__tests__/EntityLoader-test.js +22 -20
- package/build/__tests__/EntityLoader-test.js.map +1 -1
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.js +6 -6
- package/build/__tests__/EntityMutator-MutationCacheConsistency-test.js.map +1 -1
- package/build/__tests__/EntityMutator-test.js +20 -20
- package/build/__tests__/EntityMutator-test.js.map +1 -1
- package/build/__tests__/EntitySecondaryCacheLoader-test.js +10 -10
- package/build/__tests__/EntitySecondaryCacheLoader-test.js.map +1 -1
- package/build/__tests__/EntitySelfReferentialEdges-test.js +79 -47
- package/build/__tests__/EntitySelfReferentialEdges-test.js.map +1 -1
- package/build/__tests__/ReadonlyEntity-test.js +13 -13
- package/build/__tests__/ReadonlyEntity-test.js.map +1 -1
- package/build/__tests__/ViewerContext-test.js +2 -2
- package/build/__tests__/ViewerContext-test.js.map +1 -1
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.js +12 -8
- package/build/__tests__/cases/TwoEntitySameTableDisjointRows-test.js.map +1 -1
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js +15 -13
- package/build/__tests__/cases/TwoEntitySameTableOverlappingRows-test.js.map +1 -1
- package/build/internal/EntityDataManager.js +1 -1
- package/build/internal/EntityDataManager.js.map +1 -1
- package/build/internal/__tests__/EntityDataManager-test.js +11 -11
- package/build/internal/__tests__/EntityDataManager-test.js.map +1 -1
- package/build/testfixtures/SimpleTestEntity.d.ts +8 -8
- package/build/testfixtures/SimpleTestEntity.js.map +1 -1
- package/build/testfixtures/TestEntity.d.ts +12 -12
- package/build/testfixtures/TestEntity.js.map +1 -1
- package/build/testfixtures/TestEntity2.d.ts +8 -8
- package/build/testfixtures/TestEntity2.js.map +1 -1
- package/build/testfixtures/TestViewerContext.d.ts +3 -0
- package/build/testfixtures/TestViewerContext.js +6 -0
- package/build/testfixtures/TestViewerContext.js.map +1 -1
- package/package.json +2 -2
- package/src/EnforcingEntityLoader.ts +9 -0
- package/src/Entity.ts +6 -29
- package/src/EntityAssociationLoader.ts +9 -25
- package/src/EntityFields.ts +5 -3
- package/src/EntityLoader.ts +17 -0
- package/src/EntityMutationTriggerConfiguration.ts +5 -7
- package/src/EntityQueryContextProvider.ts +1 -1
- package/src/IEntityCacheAdapterProvider.ts +1 -1
- package/src/ReadonlyEntity.ts +1 -4
- package/src/ViewerContext.ts +5 -5
- package/src/__tests__/EnforcingEntityLoader-test.ts +43 -0
- package/src/__tests__/Entity-test.ts +43 -27
- package/src/__tests__/EntityAssociationLoader-test.ts +168 -86
- package/src/__tests__/EntityCommonUseCases-test.ts +36 -18
- package/src/__tests__/EntityEdges-test.ts +102 -40
- package/src/__tests__/EntityFields-test.ts +7 -1
- package/src/__tests__/EntityLoader-constructor-test.ts +1 -1
- package/src/__tests__/EntityLoader-test.ts +24 -20
- package/src/__tests__/EntityMutator-MutationCacheConsistency-test.ts +19 -16
- package/src/__tests__/EntityMutator-test.ts +67 -61
- package/src/__tests__/EntitySecondaryCacheLoader-test.ts +20 -11
- package/src/__tests__/EntitySelfReferentialEdges-test.ts +115 -47
- package/src/__tests__/ReadonlyEntity-test.ts +15 -13
- package/src/__tests__/ViewerContext-test.ts +3 -2
- package/src/__tests__/cases/TwoEntitySameTableDisjointRows-test.ts +33 -22
- package/src/__tests__/cases/TwoEntitySameTableOverlappingRows-test.ts +30 -22
- package/src/internal/EntityDataManager.ts +1 -1
- package/src/internal/__tests__/EntityDataManager-test.ts +11 -11
- package/src/testfixtures/SimpleTestEntity.ts +8 -8
- package/src/testfixtures/TestEntity.ts +15 -12
- package/src/testfixtures/TestEntity2.ts +8 -8
- package/src/testfixtures/TestViewerContext.ts +12 -1
|
@@ -51,9 +51,8 @@ export default interface EntityMutationTriggerConfiguration<
|
|
|
51
51
|
afterAll?: EntityMutationTrigger<TFields, TID, TViewerContext, TEntity, TSelectedFields>[];
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Trigger set that runs after committing the transaction
|
|
55
|
-
*
|
|
56
|
-
* this too will be within the transaction.
|
|
54
|
+
* Trigger set that runs after committing the mutation transaction. If the call to the mutation is wrapped in a transaction, these
|
|
55
|
+
* will be run after the wrapping transaction is completed.
|
|
57
56
|
*/
|
|
58
57
|
afterCommit?: EntityNonTransactionalMutationTrigger<
|
|
59
58
|
TFields,
|
|
@@ -65,9 +64,8 @@ export default interface EntityMutationTriggerConfiguration<
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
/**
|
|
68
|
-
* A trigger is a way to specify entity mutation operation side-effects that run within the
|
|
69
|
-
* same transaction as the mutation itself.
|
|
70
|
-
* the transaction if a transaction is supplied.
|
|
67
|
+
* A transactional trigger is a way to specify entity mutation operation side-effects that run within the
|
|
68
|
+
* same transaction as the mutation itself.
|
|
71
69
|
*/
|
|
72
70
|
export abstract class EntityMutationTrigger<
|
|
73
71
|
TFields extends object,
|
|
@@ -86,7 +84,7 @@ export abstract class EntityMutationTrigger<
|
|
|
86
84
|
|
|
87
85
|
/**
|
|
88
86
|
* A non-transactional trigger is like a EntityMutationTrigger but used for afterCommit triggers
|
|
89
|
-
* since they
|
|
87
|
+
* since they run after the transaction is committed.
|
|
90
88
|
*/
|
|
91
89
|
export abstract class EntityNonTransactionalMutationTrigger<
|
|
92
90
|
TFields extends object,
|
|
@@ -12,7 +12,7 @@ export default abstract class EntityQueryContextProvider {
|
|
|
12
12
|
/**
|
|
13
13
|
* Vend a regular (non-transactional) entity query context.
|
|
14
14
|
*/
|
|
15
|
-
public
|
|
15
|
+
public getNonTransactionalQueryContext(): EntityNonTransactionalQueryContext {
|
|
16
16
|
return new EntityNonTransactionalQueryContext(this.getQueryInterface(), this);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -7,7 +7,7 @@ import IEntityCacheAdapter from './IEntityCacheAdapter';
|
|
|
7
7
|
*/
|
|
8
8
|
export default interface IEntityCacheAdapterProvider {
|
|
9
9
|
/**
|
|
10
|
-
* Vend a cache adapter.
|
|
10
|
+
* Vend a cache adapter for an entity configuration.
|
|
11
11
|
*/
|
|
12
12
|
getCacheAdapter<TFields>(
|
|
13
13
|
entityConfiguration: EntityConfiguration<TFields>
|
package/src/ReadonlyEntity.ts
CHANGED
|
@@ -148,10 +148,7 @@ export default abstract class ReadonlyEntity<
|
|
|
148
148
|
TMSelectedFields
|
|
149
149
|
>,
|
|
150
150
|
viewerContext: TMViewerContext2,
|
|
151
|
-
queryContext: EntityQueryContext
|
|
152
|
-
.getViewerScopedEntityCompanionForClass(this)
|
|
153
|
-
.getQueryContextProvider()
|
|
154
|
-
.getQueryContext()
|
|
151
|
+
queryContext: EntityQueryContext
|
|
155
152
|
): EntityLoader<TMFields, TMID, TMViewerContext, TMEntity, TMPrivacyPolicy, TMSelectedFields> {
|
|
156
153
|
return viewerContext
|
|
157
154
|
.getViewerScopedEntityCompanionForClass(this)
|
package/src/ViewerContext.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { IEntityClass } from './Entity';
|
|
|
2
2
|
import EntityCompanionProvider, { DatabaseAdapterFlavor } from './EntityCompanionProvider';
|
|
3
3
|
import EntityPrivacyPolicy from './EntityPrivacyPolicy';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
EntityNonTransactionalQueryContext,
|
|
6
6
|
EntityTransactionalQueryContext,
|
|
7
7
|
TransactionConfig,
|
|
8
8
|
} from './EntityQueryContext';
|
|
@@ -67,12 +67,12 @@ export default class ViewerContext {
|
|
|
67
67
|
* Get the regular (non-transactional) query context for a database adaptor flavor.
|
|
68
68
|
* @param databaseAdaptorFlavor - database adaptor flavor
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
getNonTransactionalQueryContextForDatabaseAdaptorFlavor(
|
|
71
71
|
databaseAdaptorFlavor: DatabaseAdapterFlavor
|
|
72
|
-
):
|
|
72
|
+
): EntityNonTransactionalQueryContext {
|
|
73
73
|
return this.entityCompanionProvider
|
|
74
74
|
.getQueryContextProviderForDatabaseAdaptorFlavor(databaseAdaptorFlavor)
|
|
75
|
-
.
|
|
75
|
+
.getNonTransactionalQueryContext();
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -88,7 +88,7 @@ export default class ViewerContext {
|
|
|
88
88
|
): Promise<TResult> {
|
|
89
89
|
return await this.entityCompanionProvider
|
|
90
90
|
.getQueryContextProviderForDatabaseAdaptorFlavor(databaseAdaptorFlavor)
|
|
91
|
-
.
|
|
91
|
+
.getNonTransactionalQueryContext()
|
|
92
92
|
.runInTransactionIfNotInTransactionAsync(transactionScope, transactionConfig);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -222,6 +222,49 @@ describe(EnforcingEntityLoader, () => {
|
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
+
describe('loadManyByIDsNullableAsync', () => {
|
|
226
|
+
it('throws when result is unsuccessful even when there is a null result', async () => {
|
|
227
|
+
const entityLoaderMock = mock<EntityLoader<any, any, any, any, any, any>>(EntityLoader);
|
|
228
|
+
const rejection = new Error();
|
|
229
|
+
when(entityLoaderMock.loadManyByIDsNullableAsync(anything())).thenResolve(
|
|
230
|
+
new Map(
|
|
231
|
+
Object.entries({
|
|
232
|
+
hello: result(rejection),
|
|
233
|
+
world: null,
|
|
234
|
+
})
|
|
235
|
+
)
|
|
236
|
+
);
|
|
237
|
+
const entityLoader = instance(entityLoaderMock);
|
|
238
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(entityLoader);
|
|
239
|
+
await expect(enforcingEntityLoader.loadManyByIDsNullableAsync(anything())).rejects.toThrow(
|
|
240
|
+
rejection
|
|
241
|
+
);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('returns value when result is successful', async () => {
|
|
245
|
+
const entityLoaderMock = mock<EntityLoader<any, any, any, any, any, any>>(EntityLoader);
|
|
246
|
+
const resolved = {};
|
|
247
|
+
when(entityLoaderMock.loadManyByIDsNullableAsync(anything())).thenResolve(
|
|
248
|
+
new Map(
|
|
249
|
+
Object.entries({
|
|
250
|
+
hello: result(resolved),
|
|
251
|
+
world: null,
|
|
252
|
+
})
|
|
253
|
+
)
|
|
254
|
+
);
|
|
255
|
+
const entityLoader = instance(entityLoaderMock);
|
|
256
|
+
const enforcingEntityLoader = new EnforcingEntityLoader(entityLoader);
|
|
257
|
+
await expect(enforcingEntityLoader.loadManyByIDsNullableAsync(anything())).resolves.toEqual(
|
|
258
|
+
new Map(
|
|
259
|
+
Object.entries({
|
|
260
|
+
hello: resolved,
|
|
261
|
+
world: null,
|
|
262
|
+
})
|
|
263
|
+
)
|
|
264
|
+
);
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
|
|
225
268
|
describe('loadFirstByFieldEqualityConjunction', () => {
|
|
226
269
|
it('throws when result is unsuccessful', async () => {
|
|
227
270
|
const entityLoaderMock = mock<EntityLoader<any, any, any, any, any, any>>(EntityLoader);
|
|
@@ -4,25 +4,27 @@ import EntityConfiguration from '../EntityConfiguration';
|
|
|
4
4
|
import { UUIDField } from '../EntityFields';
|
|
5
5
|
import { CreateMutator, UpdateMutator } from '../EntityMutator';
|
|
6
6
|
import EntityPrivacyPolicy from '../EntityPrivacyPolicy';
|
|
7
|
-
import ViewerContext from '../ViewerContext';
|
|
8
7
|
import AlwaysAllowPrivacyPolicyRule from '../rules/AlwaysAllowPrivacyPolicyRule';
|
|
9
8
|
import AlwaysDenyPrivacyPolicyRule from '../rules/AlwaysDenyPrivacyPolicyRule';
|
|
10
9
|
import SimpleTestEntity from '../testfixtures/SimpleTestEntity';
|
|
10
|
+
import TestViewerContext from '../testfixtures/TestViewerContext';
|
|
11
11
|
import { createUnitTestEntityCompanionProvider } from '../utils/testing/createUnitTestEntityCompanionProvider';
|
|
12
12
|
|
|
13
13
|
describe(Entity, () => {
|
|
14
14
|
describe('creator', () => {
|
|
15
15
|
it('creates a new CreateMutator', () => {
|
|
16
16
|
const companionProvider = createUnitTestEntityCompanionProvider();
|
|
17
|
-
const viewerContext = new
|
|
18
|
-
expect(
|
|
17
|
+
const viewerContext = new TestViewerContext(companionProvider);
|
|
18
|
+
expect(
|
|
19
|
+
SimpleTestEntity.creator(viewerContext, viewerContext.getQueryContext())
|
|
20
|
+
).toBeInstanceOf(CreateMutator);
|
|
19
21
|
});
|
|
20
22
|
});
|
|
21
23
|
|
|
22
24
|
describe('updater', () => {
|
|
23
25
|
it('creates a new UpdateMutator', () => {
|
|
24
26
|
const companionProvider = createUnitTestEntityCompanionProvider();
|
|
25
|
-
const viewerContext = new
|
|
27
|
+
const viewerContext = new TestViewerContext(companionProvider);
|
|
26
28
|
const data = {
|
|
27
29
|
id: 'what',
|
|
28
30
|
};
|
|
@@ -32,14 +34,16 @@ describe(Entity, () => {
|
|
|
32
34
|
databaseFields: data,
|
|
33
35
|
selectedFields: data,
|
|
34
36
|
});
|
|
35
|
-
expect(SimpleTestEntity.updater(testEntity)).toBeInstanceOf(
|
|
37
|
+
expect(SimpleTestEntity.updater(testEntity, viewerContext.getQueryContext())).toBeInstanceOf(
|
|
38
|
+
UpdateMutator
|
|
39
|
+
);
|
|
36
40
|
});
|
|
37
41
|
});
|
|
38
42
|
|
|
39
43
|
describe('canViewerUpdateAsync', () => {
|
|
40
44
|
it('appropriately executes update privacy policy', async () => {
|
|
41
45
|
const companionProvider = createUnitTestEntityCompanionProvider();
|
|
42
|
-
const viewerContext = new
|
|
46
|
+
const viewerContext = new TestViewerContext(companionProvider);
|
|
43
47
|
const data = {
|
|
44
48
|
id: 'what',
|
|
45
49
|
};
|
|
@@ -49,13 +53,16 @@ describe(Entity, () => {
|
|
|
49
53
|
databaseFields: data,
|
|
50
54
|
selectedFields: data,
|
|
51
55
|
});
|
|
52
|
-
const canViewerUpdate = await SimpleTestDenyDeleteEntity.canViewerUpdateAsync(
|
|
56
|
+
const canViewerUpdate = await SimpleTestDenyDeleteEntity.canViewerUpdateAsync(
|
|
57
|
+
testEntity,
|
|
58
|
+
viewerContext.getQueryContext()
|
|
59
|
+
);
|
|
53
60
|
expect(canViewerUpdate).toBe(true);
|
|
54
61
|
});
|
|
55
62
|
|
|
56
63
|
it('denies when policy denies', async () => {
|
|
57
64
|
const companionProvider = createUnitTestEntityCompanionProvider();
|
|
58
|
-
const viewerContext = new
|
|
65
|
+
const viewerContext = new TestViewerContext(companionProvider);
|
|
59
66
|
const data = {
|
|
60
67
|
id: 'what',
|
|
61
68
|
};
|
|
@@ -65,7 +72,10 @@ describe(Entity, () => {
|
|
|
65
72
|
databaseFields: data,
|
|
66
73
|
selectedFields: data,
|
|
67
74
|
});
|
|
68
|
-
const canViewerUpdate = await SimpleTestDenyUpdateEntity.canViewerUpdateAsync(
|
|
75
|
+
const canViewerUpdate = await SimpleTestDenyUpdateEntity.canViewerUpdateAsync(
|
|
76
|
+
testEntity,
|
|
77
|
+
viewerContext.getQueryContext()
|
|
78
|
+
);
|
|
69
79
|
expect(canViewerUpdate).toBe(false);
|
|
70
80
|
});
|
|
71
81
|
});
|
|
@@ -73,7 +83,7 @@ describe(Entity, () => {
|
|
|
73
83
|
describe('canViewerDeleteAsync', () => {
|
|
74
84
|
it('appropriately executes update privacy policy', async () => {
|
|
75
85
|
const companionProvider = createUnitTestEntityCompanionProvider();
|
|
76
|
-
const viewerContext = new
|
|
86
|
+
const viewerContext = new TestViewerContext(companionProvider);
|
|
77
87
|
const data = {
|
|
78
88
|
id: 'what',
|
|
79
89
|
};
|
|
@@ -83,13 +93,16 @@ describe(Entity, () => {
|
|
|
83
93
|
databaseFields: data,
|
|
84
94
|
selectedFields: data,
|
|
85
95
|
});
|
|
86
|
-
const canViewerDelete = await SimpleTestDenyUpdateEntity.canViewerDeleteAsync(
|
|
96
|
+
const canViewerDelete = await SimpleTestDenyUpdateEntity.canViewerDeleteAsync(
|
|
97
|
+
testEntity,
|
|
98
|
+
viewerContext.getQueryContext()
|
|
99
|
+
);
|
|
87
100
|
expect(canViewerDelete).toBe(true);
|
|
88
101
|
});
|
|
89
102
|
|
|
90
103
|
it('denies when policy denies', async () => {
|
|
91
104
|
const companionProvider = createUnitTestEntityCompanionProvider();
|
|
92
|
-
const viewerContext = new
|
|
105
|
+
const viewerContext = new TestViewerContext(companionProvider);
|
|
93
106
|
const data = {
|
|
94
107
|
id: 'what',
|
|
95
108
|
};
|
|
@@ -99,7 +112,10 @@ describe(Entity, () => {
|
|
|
99
112
|
databaseFields: data,
|
|
100
113
|
selectedFields: data,
|
|
101
114
|
});
|
|
102
|
-
const canViewerDelete = await SimpleTestDenyDeleteEntity.canViewerDeleteAsync(
|
|
115
|
+
const canViewerDelete = await SimpleTestDenyDeleteEntity.canViewerDeleteAsync(
|
|
116
|
+
testEntity,
|
|
117
|
+
viewerContext.getQueryContext()
|
|
118
|
+
);
|
|
103
119
|
expect(canViewerDelete).toBe(false);
|
|
104
120
|
});
|
|
105
121
|
});
|
|
@@ -124,14 +140,14 @@ const testEntityConfiguration = new EntityConfiguration<TestEntityFields>({
|
|
|
124
140
|
class SimpleTestDenyUpdateEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
125
141
|
TestEntityFields,
|
|
126
142
|
string,
|
|
127
|
-
|
|
143
|
+
TestViewerContext,
|
|
128
144
|
SimpleTestDenyUpdateEntity
|
|
129
145
|
> {
|
|
130
146
|
protected override readonly readRules = [
|
|
131
147
|
new AlwaysAllowPrivacyPolicyRule<
|
|
132
148
|
TestEntityFields,
|
|
133
149
|
string,
|
|
134
|
-
|
|
150
|
+
TestViewerContext,
|
|
135
151
|
SimpleTestDenyUpdateEntity
|
|
136
152
|
>(),
|
|
137
153
|
];
|
|
@@ -139,7 +155,7 @@ class SimpleTestDenyUpdateEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
139
155
|
new AlwaysAllowPrivacyPolicyRule<
|
|
140
156
|
TestEntityFields,
|
|
141
157
|
string,
|
|
142
|
-
|
|
158
|
+
TestViewerContext,
|
|
143
159
|
SimpleTestDenyUpdateEntity
|
|
144
160
|
>(),
|
|
145
161
|
];
|
|
@@ -147,7 +163,7 @@ class SimpleTestDenyUpdateEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
147
163
|
new AlwaysDenyPrivacyPolicyRule<
|
|
148
164
|
TestEntityFields,
|
|
149
165
|
string,
|
|
150
|
-
|
|
166
|
+
TestViewerContext,
|
|
151
167
|
SimpleTestDenyUpdateEntity
|
|
152
168
|
>(),
|
|
153
169
|
];
|
|
@@ -155,7 +171,7 @@ class SimpleTestDenyUpdateEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
155
171
|
new AlwaysAllowPrivacyPolicyRule<
|
|
156
172
|
TestEntityFields,
|
|
157
173
|
string,
|
|
158
|
-
|
|
174
|
+
TestViewerContext,
|
|
159
175
|
SimpleTestDenyUpdateEntity
|
|
160
176
|
>(),
|
|
161
177
|
];
|
|
@@ -164,14 +180,14 @@ class SimpleTestDenyUpdateEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
164
180
|
class SimpleTestDenyDeleteEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
165
181
|
TestEntityFields,
|
|
166
182
|
string,
|
|
167
|
-
|
|
183
|
+
TestViewerContext,
|
|
168
184
|
SimpleTestDenyDeleteEntity
|
|
169
185
|
> {
|
|
170
186
|
protected override readonly readRules = [
|
|
171
187
|
new AlwaysAllowPrivacyPolicyRule<
|
|
172
188
|
TestEntityFields,
|
|
173
189
|
string,
|
|
174
|
-
|
|
190
|
+
TestViewerContext,
|
|
175
191
|
SimpleTestDenyDeleteEntity
|
|
176
192
|
>(),
|
|
177
193
|
];
|
|
@@ -179,7 +195,7 @@ class SimpleTestDenyDeleteEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
179
195
|
new AlwaysAllowPrivacyPolicyRule<
|
|
180
196
|
TestEntityFields,
|
|
181
197
|
string,
|
|
182
|
-
|
|
198
|
+
TestViewerContext,
|
|
183
199
|
SimpleTestDenyDeleteEntity
|
|
184
200
|
>(),
|
|
185
201
|
];
|
|
@@ -187,7 +203,7 @@ class SimpleTestDenyDeleteEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
187
203
|
new AlwaysAllowPrivacyPolicyRule<
|
|
188
204
|
TestEntityFields,
|
|
189
205
|
string,
|
|
190
|
-
|
|
206
|
+
TestViewerContext,
|
|
191
207
|
SimpleTestDenyDeleteEntity
|
|
192
208
|
>(),
|
|
193
209
|
];
|
|
@@ -195,17 +211,17 @@ class SimpleTestDenyDeleteEntityPrivacyPolicy extends EntityPrivacyPolicy<
|
|
|
195
211
|
new AlwaysDenyPrivacyPolicyRule<
|
|
196
212
|
TestEntityFields,
|
|
197
213
|
string,
|
|
198
|
-
|
|
214
|
+
TestViewerContext,
|
|
199
215
|
SimpleTestDenyDeleteEntity
|
|
200
216
|
>(),
|
|
201
217
|
];
|
|
202
218
|
}
|
|
203
219
|
|
|
204
|
-
class SimpleTestDenyUpdateEntity extends Entity<TestEntityFields, string,
|
|
220
|
+
class SimpleTestDenyUpdateEntity extends Entity<TestEntityFields, string, TestViewerContext> {
|
|
205
221
|
static defineCompanionDefinition(): EntityCompanionDefinition<
|
|
206
222
|
TestEntityFields,
|
|
207
223
|
string,
|
|
208
|
-
|
|
224
|
+
TestViewerContext,
|
|
209
225
|
SimpleTestDenyUpdateEntity,
|
|
210
226
|
SimpleTestDenyUpdateEntityPrivacyPolicy
|
|
211
227
|
> {
|
|
@@ -217,11 +233,11 @@ class SimpleTestDenyUpdateEntity extends Entity<TestEntityFields, string, Viewer
|
|
|
217
233
|
}
|
|
218
234
|
}
|
|
219
235
|
|
|
220
|
-
class SimpleTestDenyDeleteEntity extends Entity<TestEntityFields, string,
|
|
236
|
+
class SimpleTestDenyDeleteEntity extends Entity<TestEntityFields, string, TestViewerContext> {
|
|
221
237
|
static defineCompanionDefinition(): EntityCompanionDefinition<
|
|
222
238
|
TestEntityFields,
|
|
223
239
|
string,
|
|
224
|
-
|
|
240
|
+
TestViewerContext,
|
|
225
241
|
SimpleTestDenyDeleteEntity,
|
|
226
242
|
SimpleTestDenyDeleteEntityPrivacyPolicy
|
|
227
243
|
> {
|