@powerhousedao/reactor-api 6.0.0-dev.22 → 6.0.0-dev.24
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/dist/src/graphql/document-model-subgraph.d.ts +37 -43
- package/dist/src/graphql/document-model-subgraph.d.ts.map +1 -1
- package/dist/src/graphql/document-model-subgraph.js +218 -85
- package/dist/src/graphql/document-model-subgraph.js.map +1 -1
- package/dist/test/document-model-subgraph-legacy-permissions.test.d.ts +2 -0
- package/dist/test/document-model-subgraph-legacy-permissions.test.d.ts.map +1 -0
- package/dist/test/document-model-subgraph-legacy-permissions.test.js +518 -0
- package/dist/test/document-model-subgraph-legacy-permissions.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
import { type IDocumentDriveServer } from "document-drive";
|
|
2
1
|
import { type DocumentModelModule } from "document-model";
|
|
3
2
|
import { BaseSubgraph } from "./base-subgraph.js";
|
|
4
3
|
import type { SubgraphArgs } from "./types.js";
|
|
5
|
-
export declare function generateDocumentModelResolversLegacy(documentModel: DocumentModelModule, reactor: IDocumentDriveServer): {
|
|
6
|
-
Query: {
|
|
7
|
-
[x: string]: () => {
|
|
8
|
-
getDocument: (args: {
|
|
9
|
-
docId: string;
|
|
10
|
-
driveId: string;
|
|
11
|
-
}) => Promise<{
|
|
12
|
-
__typename?: string;
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
documentType: string;
|
|
16
|
-
revision: number;
|
|
17
|
-
createdAtUtcIso: string;
|
|
18
|
-
lastModifiedAtUtcIso: string;
|
|
19
|
-
operations: import("./types.js").GqlOperation[];
|
|
20
|
-
stateJSON: JSON;
|
|
21
|
-
state: unknown;
|
|
22
|
-
initialState: unknown;
|
|
23
|
-
driveId: string;
|
|
24
|
-
}>;
|
|
25
|
-
getDocuments: (args: {
|
|
26
|
-
driveId: string;
|
|
27
|
-
}) => Promise<{
|
|
28
|
-
__typename?: string;
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
documentType: string;
|
|
32
|
-
revision: number;
|
|
33
|
-
createdAtUtcIso: string;
|
|
34
|
-
lastModifiedAtUtcIso: string;
|
|
35
|
-
operations: import("./types.js").GqlOperation[];
|
|
36
|
-
stateJSON: JSON;
|
|
37
|
-
state: unknown;
|
|
38
|
-
initialState: unknown;
|
|
39
|
-
driveId: string;
|
|
40
|
-
}[]>;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
Mutation: {
|
|
44
|
-
[x: string]: any;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
4
|
export declare class DocumentModelSubgraphLegacy extends BaseSubgraph {
|
|
48
5
|
private documentModel;
|
|
49
6
|
constructor(documentModel: DocumentModelModule, args: SubgraphArgs);
|
|
7
|
+
/**
|
|
8
|
+
* Check if user has global read access (admin, user, or guest)
|
|
9
|
+
*/
|
|
10
|
+
private hasGlobalReadAccess;
|
|
11
|
+
/**
|
|
12
|
+
* Check if user has global write access (admin or user, not guest)
|
|
13
|
+
*/
|
|
14
|
+
private hasGlobalWriteAccess;
|
|
15
|
+
/**
|
|
16
|
+
* Get the parent IDs function for hierarchical permission checks
|
|
17
|
+
*/
|
|
18
|
+
private getParentIdsFn;
|
|
19
|
+
/**
|
|
20
|
+
* Check if user can read a document (with hierarchy)
|
|
21
|
+
*/
|
|
22
|
+
private canReadDocument;
|
|
23
|
+
/**
|
|
24
|
+
* Check if user can write to a document (with hierarchy)
|
|
25
|
+
*/
|
|
26
|
+
private canWriteDocument;
|
|
27
|
+
/**
|
|
28
|
+
* Throw an error if user cannot read the document
|
|
29
|
+
*/
|
|
30
|
+
private assertCanRead;
|
|
31
|
+
/**
|
|
32
|
+
* Throw an error if user cannot write to the document
|
|
33
|
+
*/
|
|
34
|
+
private assertCanWrite;
|
|
35
|
+
/**
|
|
36
|
+
* Check if user can execute a specific operation on a document.
|
|
37
|
+
* Throws an error if the operation is restricted and user lacks permission.
|
|
38
|
+
*/
|
|
39
|
+
private assertCanExecuteOperation;
|
|
40
|
+
/**
|
|
41
|
+
* Generate resolvers for this document model with permission checks
|
|
42
|
+
*/
|
|
43
|
+
private generateResolvers;
|
|
50
44
|
}
|
|
51
45
|
//# sourceMappingURL=document-model-subgraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-model-subgraph.d.ts","sourceRoot":"","sources":["../../../src/graphql/document-model-subgraph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-model-subgraph.d.ts","sourceRoot":"","sources":["../../../src/graphql/document-model-subgraph.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAOnE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,YAAY,CAAC;AAGxD,qBAAa,2BAA4B,SAAQ,YAAY;IAC3D,OAAO,CAAC,aAAa,CAAsB;gBAE/B,aAAa,EAAE,mBAAmB,EAAE,IAAI,EAAE,YAAY;IAUlE;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAM5B;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;YACW,eAAe;IAqB7B;;OAEG;YACW,gBAAgB;IAqB9B;;OAEG;YACW,aAAa;IAS3B;;OAEG;YACW,cAAc;IAY5B;;;OAGG;YACW,yBAAyB;IAuCvC;;OAEG;IACH,OAAO,CAAC,iBAAiB;CA2K1B"}
|
|
@@ -1,104 +1,237 @@
|
|
|
1
1
|
import { camelCase, kebabCase } from "change-case";
|
|
2
2
|
import { addFile } from "document-drive";
|
|
3
3
|
import { setName } from "document-model";
|
|
4
|
+
import { GraphQLError } from "graphql";
|
|
4
5
|
import { generateDocumentModelSchemaLegacy, getDocumentModelSchemaName, } from "../utils/create-schema.js";
|
|
5
6
|
import { BaseSubgraph } from "./base-subgraph.js";
|
|
6
7
|
import { buildGraphQlDocument } from "./utils.js";
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
export class DocumentModelSubgraphLegacy extends BaseSubgraph {
|
|
9
|
+
documentModel;
|
|
10
|
+
constructor(documentModel, args) {
|
|
11
|
+
super(args);
|
|
12
|
+
this.documentModel = documentModel;
|
|
13
|
+
this.name = kebabCase(documentModel.documentModel.global.name);
|
|
14
|
+
this.typeDefs = generateDocumentModelSchemaLegacy(this.documentModel.documentModel.global);
|
|
15
|
+
this.resolvers = this.generateResolvers();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if user has global read access (admin, user, or guest)
|
|
19
|
+
*/
|
|
20
|
+
hasGlobalReadAccess(ctx) {
|
|
21
|
+
const isGlobalAdmin = ctx.isAdmin?.(ctx.user?.address ?? "");
|
|
22
|
+
const isGlobalUser = ctx.isUser?.(ctx.user?.address ?? "");
|
|
23
|
+
const isGlobalGuest = ctx.isGuest?.(ctx.user?.address ?? "") ||
|
|
24
|
+
process.env.FREE_ENTRY === "true";
|
|
25
|
+
return !!(isGlobalAdmin || isGlobalUser || isGlobalGuest);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if user has global write access (admin or user, not guest)
|
|
29
|
+
*/
|
|
30
|
+
hasGlobalWriteAccess(ctx) {
|
|
31
|
+
const isGlobalAdmin = ctx.isAdmin?.(ctx.user?.address ?? "");
|
|
32
|
+
const isGlobalUser = ctx.isUser?.(ctx.user?.address ?? "");
|
|
33
|
+
return !!(isGlobalAdmin || isGlobalUser);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get the parent IDs function for hierarchical permission checks
|
|
37
|
+
*/
|
|
38
|
+
getParentIdsFn() {
|
|
39
|
+
return async (documentId) => {
|
|
40
|
+
try {
|
|
41
|
+
const result = await this.reactorClient.getParents(documentId);
|
|
42
|
+
return result.results.map((doc) => doc.header.id);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if user can read a document (with hierarchy)
|
|
51
|
+
*/
|
|
52
|
+
async canReadDocument(documentId, ctx) {
|
|
53
|
+
// Global access allows reading
|
|
54
|
+
if (this.hasGlobalReadAccess(ctx)) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
// Check document-level permissions with hierarchy
|
|
58
|
+
if (this.documentPermissionService) {
|
|
59
|
+
return this.documentPermissionService.canRead(documentId, ctx.user?.address, this.getParentIdsFn());
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if user can write to a document (with hierarchy)
|
|
65
|
+
*/
|
|
66
|
+
async canWriteDocument(documentId, ctx) {
|
|
67
|
+
// Global write access allows writing
|
|
68
|
+
if (this.hasGlobalWriteAccess(ctx)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
// Check document-level permissions with hierarchy
|
|
72
|
+
if (this.documentPermissionService) {
|
|
73
|
+
return this.documentPermissionService.canWrite(documentId, ctx.user?.address, this.getParentIdsFn());
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Throw an error if user cannot read the document
|
|
79
|
+
*/
|
|
80
|
+
async assertCanRead(documentId, ctx) {
|
|
81
|
+
const canRead = await this.canReadDocument(documentId, ctx);
|
|
82
|
+
if (!canRead) {
|
|
83
|
+
throw new GraphQLError("Forbidden: insufficient permissions to read this document");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Throw an error if user cannot write to the document
|
|
88
|
+
*/
|
|
89
|
+
async assertCanWrite(documentId, ctx) {
|
|
90
|
+
const canWrite = await this.canWriteDocument(documentId, ctx);
|
|
91
|
+
if (!canWrite) {
|
|
92
|
+
throw new GraphQLError("Forbidden: insufficient permissions to write to this document");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Check if user can execute a specific operation on a document.
|
|
97
|
+
* Throws an error if the operation is restricted and user lacks permission.
|
|
98
|
+
*/
|
|
99
|
+
async assertCanExecuteOperation(documentId, operationType, ctx) {
|
|
100
|
+
// Skip if no permission service
|
|
101
|
+
if (!this.documentPermissionService) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
// Global admins bypass operation-level restrictions
|
|
105
|
+
if (ctx.isAdmin?.(ctx.user?.address ?? "")) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// Check if this operation has any restrictions set
|
|
109
|
+
const isRestricted = await this.documentPermissionService.isOperationRestricted(documentId, operationType);
|
|
110
|
+
if (isRestricted) {
|
|
111
|
+
// Operation is restricted, check if user has permission
|
|
112
|
+
const canExecute = await this.documentPermissionService.canExecuteOperation(documentId, operationType, ctx.user?.address);
|
|
113
|
+
if (!canExecute) {
|
|
114
|
+
throw new GraphQLError(`Forbidden: insufficient permissions to execute operation "${operationType}" on this document`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Generate resolvers for this document model with permission checks
|
|
120
|
+
*/
|
|
121
|
+
generateResolvers() {
|
|
122
|
+
const documentType = this.documentModel.documentModel.global.id;
|
|
123
|
+
const documentName = getDocumentModelSchemaName(this.documentModel.documentModel.global);
|
|
124
|
+
const operations = this.documentModel.documentModel.global.specifications
|
|
125
|
+
.at(-1)
|
|
126
|
+
?.modules.flatMap((module) => module.operations.filter((op) => op.name)) ?? [];
|
|
127
|
+
return {
|
|
128
|
+
Query: {
|
|
129
|
+
[documentName]: (_, __, ctx) => {
|
|
130
|
+
return {
|
|
131
|
+
getDocument: async (args) => {
|
|
132
|
+
const { docId, driveId } = args;
|
|
133
|
+
if (!docId) {
|
|
134
|
+
throw new Error("Document id is required");
|
|
135
|
+
}
|
|
136
|
+
// Check read permission before accessing document
|
|
137
|
+
await this.assertCanRead(docId, ctx);
|
|
138
|
+
if (driveId) {
|
|
139
|
+
const docIds = await this.reactor.getDocuments(driveId);
|
|
140
|
+
if (!docIds.includes(docId)) {
|
|
141
|
+
throw new Error(`Document with id ${docId} is not part of ${driveId}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const doc = await this.reactor.getDocument(docId);
|
|
145
|
+
if (doc.header.documentType !== documentType) {
|
|
146
|
+
throw new Error(`Document with id ${docId} is not of type ${documentType}`);
|
|
26
147
|
}
|
|
27
|
-
}
|
|
28
|
-
const doc = await reactor.getDocument(docId);
|
|
29
|
-
if (doc.header.documentType !== documentType) {
|
|
30
|
-
throw new Error(`Document with id ${docId} is not of type ${documentType}`);
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
driveId: driveId,
|
|
34
|
-
...buildGraphQlDocument(doc),
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
getDocuments: async (args) => {
|
|
38
|
-
const { driveId } = args;
|
|
39
|
-
const docsIds = await reactor.getDocuments(driveId);
|
|
40
|
-
const docs = await Promise.all(docsIds.map(async (docId) => {
|
|
41
|
-
const doc = await reactor.getDocument(docId);
|
|
42
148
|
return {
|
|
43
149
|
driveId: driveId,
|
|
44
150
|
...buildGraphQlDocument(doc),
|
|
45
151
|
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
152
|
+
},
|
|
153
|
+
getDocuments: async (args) => {
|
|
154
|
+
const { driveId } = args;
|
|
155
|
+
// Check read permission on drive before listing documents
|
|
156
|
+
await this.assertCanRead(driveId, ctx);
|
|
157
|
+
const docsIds = await this.reactor.getDocuments(driveId);
|
|
158
|
+
const docs = await Promise.all(docsIds.map(async (docId) => {
|
|
159
|
+
const doc = await this.reactor.getDocument(docId);
|
|
160
|
+
return {
|
|
161
|
+
driveId: driveId,
|
|
162
|
+
...buildGraphQlDocument(doc),
|
|
163
|
+
};
|
|
164
|
+
}));
|
|
165
|
+
const filteredByType = docs.filter((doc) => doc.documentType === documentType);
|
|
166
|
+
// If user doesn't have global read access, filter by document-level permissions
|
|
167
|
+
if (!this.hasGlobalReadAccess(ctx) &&
|
|
168
|
+
this.documentPermissionService) {
|
|
169
|
+
const filteredDocs = [];
|
|
170
|
+
for (const doc of filteredByType) {
|
|
171
|
+
const canRead = await this.canReadDocument(doc.id, ctx);
|
|
172
|
+
if (canRead) {
|
|
173
|
+
filteredDocs.push(doc);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return filteredDocs;
|
|
177
|
+
}
|
|
178
|
+
return filteredByType;
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
},
|
|
67
182
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const {
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
183
|
+
Mutation: {
|
|
184
|
+
[`${documentName}_createDocument`]: async (_, args, ctx) => {
|
|
185
|
+
const { driveId, name } = args;
|
|
186
|
+
// If creating under a drive, check write permission on drive
|
|
187
|
+
if (driveId) {
|
|
188
|
+
await this.assertCanWrite(driveId, ctx);
|
|
74
189
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
throw new Error(`Action ${op.name} not found`);
|
|
190
|
+
else if (!this.hasGlobalWriteAccess(ctx)) {
|
|
191
|
+
throw new GraphQLError("Forbidden: insufficient permissions to create documents");
|
|
78
192
|
}
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
|
|
193
|
+
const document = await this.reactor.addDocument(documentType);
|
|
194
|
+
if (driveId) {
|
|
195
|
+
await this.reactor.addAction(driveId, addFile({
|
|
196
|
+
name,
|
|
197
|
+
id: document.header.id,
|
|
198
|
+
documentType: documentType,
|
|
199
|
+
}));
|
|
82
200
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
throw new Error(errorOp.error);
|
|
201
|
+
if (name) {
|
|
202
|
+
await this.reactor.addAction(document.header.id, setName(name));
|
|
86
203
|
}
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
204
|
+
return document.header.id;
|
|
205
|
+
},
|
|
206
|
+
...operations.reduce((mutations, op) => {
|
|
207
|
+
mutations[`${documentName}_${camelCase(op.name)}`] = async (_, args, ctx) => {
|
|
208
|
+
const { docId, input } = args;
|
|
209
|
+
// Check write permission before mutating document
|
|
210
|
+
await this.assertCanWrite(docId, ctx);
|
|
211
|
+
// Check operation-level permissions
|
|
212
|
+
await this.assertCanExecuteOperation(docId, op.name, ctx);
|
|
213
|
+
const doc = await this.reactor.getDocument(docId);
|
|
214
|
+
if (!doc) {
|
|
215
|
+
throw new Error("Document not found");
|
|
216
|
+
}
|
|
217
|
+
const action = this.documentModel.actions[camelCase(op.name)];
|
|
218
|
+
if (!action) {
|
|
219
|
+
throw new Error(`Action ${op.name} not found`);
|
|
220
|
+
}
|
|
221
|
+
const result = await this.reactor.addAction(docId, action(input));
|
|
222
|
+
if (result.status !== "SUCCESS") {
|
|
223
|
+
throw new Error(result.error?.message ?? `Failed to ${op.name}`);
|
|
224
|
+
}
|
|
225
|
+
const errorOp = result.operations.find((op) => op.error);
|
|
226
|
+
if (errorOp) {
|
|
227
|
+
throw new Error(errorOp.error);
|
|
228
|
+
}
|
|
229
|
+
return result.operations.at(-1)?.index ?? -1;
|
|
230
|
+
};
|
|
231
|
+
return mutations;
|
|
232
|
+
}, {}),
|
|
233
|
+
},
|
|
234
|
+
};
|
|
102
235
|
}
|
|
103
236
|
}
|
|
104
237
|
//# sourceMappingURL=document-model-subgraph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-model-subgraph.js","sourceRoot":"","sources":["../../../src/graphql/document-model-subgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,EAA6B,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAA4B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,
|
|
1
|
+
{"version":3,"file":"document-model-subgraph.js","sourceRoot":"","sources":["../../../src/graphql/document-model-subgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,EAA6B,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,OAAO,EAA4B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAA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,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,CAAC,IAAI,EAAE,CAChD,CAAC;wBACJ,CAAC;wBAED,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;wBACzD,IAAI,OAAO,EAAE,CAAC;4BACZ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;wBACjC,CAAC;wBAED,OAAO,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;oBAC/C,CAAC,CAAC;oBACF,OAAO,SAAS,CAAC;gBACnB,CAAC,EACD,EAAyB,CAC1B;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-model-subgraph-legacy-permissions.test.d.ts","sourceRoot":"","sources":["../../test/document-model-subgraph-legacy-permissions.test.ts"],"names":[],"mappings":""}
|