@memberjunction/server 2.79.0 → 2.80.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/dist/resolvers/CreateQueryResolver.d.ts +71 -0
- package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
- package/dist/resolvers/CreateQueryResolver.js +481 -16
- package/dist/resolvers/CreateQueryResolver.js.map +1 -1
- package/package.json +34 -34
- package/src/resolvers/CreateQueryResolver.ts +385 -25
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PubSubEngine } from 'type-graphql';
|
|
2
2
|
import { AppContext } from '../types.js';
|
|
3
|
+
import { UserInfo } from '@memberjunction/core';
|
|
3
4
|
import { QueryResolver } from '../generated/generated.js';
|
|
4
5
|
import { DeleteOptionsInput } from '../generic/DeleteOptionsInput.js';
|
|
5
6
|
export declare enum QueryStatus {
|
|
@@ -8,6 +9,9 @@ export declare enum QueryStatus {
|
|
|
8
9
|
Rejected = "Rejected",
|
|
9
10
|
Expired = "Expired"
|
|
10
11
|
}
|
|
12
|
+
export declare class QueryPermissionInputType {
|
|
13
|
+
RoleID: string;
|
|
14
|
+
}
|
|
11
15
|
export declare class CreateQuerySystemUserInput {
|
|
12
16
|
Name: string;
|
|
13
17
|
CategoryID?: string;
|
|
@@ -22,11 +26,76 @@ export declare class CreateQuerySystemUserInput {
|
|
|
22
26
|
QualityRank?: number;
|
|
23
27
|
ExecutionCostRank?: number;
|
|
24
28
|
UsesTemplate?: boolean;
|
|
29
|
+
Permissions?: QueryPermissionInputType[];
|
|
30
|
+
}
|
|
31
|
+
export declare class UpdateQuerySystemUserInput {
|
|
32
|
+
ID: string;
|
|
33
|
+
Name?: string;
|
|
34
|
+
CategoryID?: string;
|
|
35
|
+
CategoryPath?: string;
|
|
36
|
+
UserQuestion?: string;
|
|
37
|
+
Description?: string;
|
|
38
|
+
SQL?: string;
|
|
39
|
+
TechnicalDescription?: string;
|
|
40
|
+
OriginalSQL?: string;
|
|
41
|
+
Feedback?: string;
|
|
42
|
+
Status?: QueryStatus;
|
|
43
|
+
QualityRank?: number;
|
|
44
|
+
ExecutionCostRank?: number;
|
|
45
|
+
UsesTemplate?: boolean;
|
|
46
|
+
Permissions?: QueryPermissionInputType[];
|
|
47
|
+
}
|
|
48
|
+
export declare class QueryFieldType {
|
|
49
|
+
ID: string;
|
|
50
|
+
QueryID: string;
|
|
51
|
+
Name: string;
|
|
52
|
+
Description?: string;
|
|
53
|
+
Type?: string;
|
|
54
|
+
Sequence: number;
|
|
55
|
+
SQLBaseType?: string;
|
|
56
|
+
SQLFullType?: string;
|
|
57
|
+
IsComputed: boolean;
|
|
58
|
+
ComputationDescription?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare class QueryParameterType {
|
|
61
|
+
ID: string;
|
|
62
|
+
QueryID: string;
|
|
63
|
+
Name: string;
|
|
64
|
+
Type: string;
|
|
65
|
+
DefaultValue?: string;
|
|
66
|
+
Comments?: string;
|
|
67
|
+
IsRequired: boolean;
|
|
68
|
+
}
|
|
69
|
+
export declare class QueryEntityType {
|
|
70
|
+
ID: string;
|
|
71
|
+
QueryID: string;
|
|
72
|
+
EntityID: string;
|
|
73
|
+
EntityName?: string;
|
|
74
|
+
Sequence: number;
|
|
75
|
+
}
|
|
76
|
+
export declare class QueryPermissionType {
|
|
77
|
+
ID: string;
|
|
78
|
+
QueryID: string;
|
|
79
|
+
RoleID: string;
|
|
80
|
+
RoleName?: string;
|
|
25
81
|
}
|
|
26
82
|
export declare class CreateQueryResultType {
|
|
27
83
|
Success: boolean;
|
|
28
84
|
ErrorMessage?: string;
|
|
29
85
|
QueryData?: string;
|
|
86
|
+
Fields?: QueryFieldType[];
|
|
87
|
+
Parameters?: QueryParameterType[];
|
|
88
|
+
Entities?: QueryEntityType[];
|
|
89
|
+
Permissions?: QueryPermissionType[];
|
|
90
|
+
}
|
|
91
|
+
export declare class UpdateQueryResultType {
|
|
92
|
+
Success: boolean;
|
|
93
|
+
ErrorMessage?: string;
|
|
94
|
+
QueryData?: string;
|
|
95
|
+
Fields?: QueryFieldType[];
|
|
96
|
+
Parameters?: QueryParameterType[];
|
|
97
|
+
Entities?: QueryEntityType[];
|
|
98
|
+
Permissions?: QueryPermissionType[];
|
|
30
99
|
}
|
|
31
100
|
export declare class DeleteQueryResultType {
|
|
32
101
|
Success: boolean;
|
|
@@ -35,6 +104,8 @@ export declare class DeleteQueryResultType {
|
|
|
35
104
|
}
|
|
36
105
|
export declare class QueryResolverExtended extends QueryResolver {
|
|
37
106
|
CreateQuerySystemUser(input: CreateQuerySystemUserInput, context: AppContext, pubSub: PubSubEngine): Promise<CreateQueryResultType>;
|
|
107
|
+
protected createPermissions(permissions: QueryPermissionInputType[], queryID: string, contextUser: UserInfo): Promise<QueryPermissionType[]>;
|
|
108
|
+
UpdateQuerySystemUser(input: UpdateQuerySystemUserInput, context: AppContext, pubSub: PubSubEngine): Promise<UpdateQueryResultType>;
|
|
38
109
|
DeleteQuerySystemResolver(ID: string, options: DeleteOptionsInput | null, context: AppContext, pubSub: PubSubEngine): Promise<DeleteQueryResultType>;
|
|
39
110
|
private findOrCreateCategoryPath;
|
|
40
111
|
private findCategoryByNameAndParent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateQueryResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/CreateQueryResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwF,YAAY,EAAE,MAAM,cAAc,CAAC;AAClI,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"CreateQueryResolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/CreateQueryResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwF,YAAY,EAAE,MAAM,cAAc,CAAC;AAClI,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAA+B,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAG3F,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CA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CAsB5C"}
|
|
@@ -27,6 +27,17 @@ registerEnumType(QueryStatus, {
|
|
|
27
27
|
name: "QueryStatus",
|
|
28
28
|
description: "Status of a query: Pending, Approved, Rejected, or Expired"
|
|
29
29
|
});
|
|
30
|
+
let QueryPermissionInputType = class QueryPermissionInputType {
|
|
31
|
+
RoleID;
|
|
32
|
+
};
|
|
33
|
+
__decorate([
|
|
34
|
+
Field(() => String),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], QueryPermissionInputType.prototype, "RoleID", void 0);
|
|
37
|
+
QueryPermissionInputType = __decorate([
|
|
38
|
+
InputType()
|
|
39
|
+
], QueryPermissionInputType);
|
|
40
|
+
export { QueryPermissionInputType };
|
|
30
41
|
let CreateQuerySystemUserInput = class CreateQuerySystemUserInput {
|
|
31
42
|
Name;
|
|
32
43
|
CategoryID;
|
|
@@ -41,6 +52,7 @@ let CreateQuerySystemUserInput = class CreateQuerySystemUserInput {
|
|
|
41
52
|
QualityRank;
|
|
42
53
|
ExecutionCostRank;
|
|
43
54
|
UsesTemplate;
|
|
55
|
+
Permissions;
|
|
44
56
|
};
|
|
45
57
|
__decorate([
|
|
46
58
|
Field(() => String),
|
|
@@ -94,14 +106,257 @@ __decorate([
|
|
|
94
106
|
Field(() => Boolean, { nullable: true }),
|
|
95
107
|
__metadata("design:type", Boolean)
|
|
96
108
|
], CreateQuerySystemUserInput.prototype, "UsesTemplate", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
Field(() => [QueryPermissionInputType], { nullable: true }),
|
|
111
|
+
__metadata("design:type", Array)
|
|
112
|
+
], CreateQuerySystemUserInput.prototype, "Permissions", void 0);
|
|
97
113
|
CreateQuerySystemUserInput = __decorate([
|
|
98
114
|
InputType()
|
|
99
115
|
], CreateQuerySystemUserInput);
|
|
100
116
|
export { CreateQuerySystemUserInput };
|
|
117
|
+
let UpdateQuerySystemUserInput = class UpdateQuerySystemUserInput {
|
|
118
|
+
ID;
|
|
119
|
+
Name;
|
|
120
|
+
CategoryID;
|
|
121
|
+
CategoryPath;
|
|
122
|
+
UserQuestion;
|
|
123
|
+
Description;
|
|
124
|
+
SQL;
|
|
125
|
+
TechnicalDescription;
|
|
126
|
+
OriginalSQL;
|
|
127
|
+
Feedback;
|
|
128
|
+
Status;
|
|
129
|
+
QualityRank;
|
|
130
|
+
ExecutionCostRank;
|
|
131
|
+
UsesTemplate;
|
|
132
|
+
Permissions;
|
|
133
|
+
};
|
|
134
|
+
__decorate([
|
|
135
|
+
Field(() => String),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], UpdateQuerySystemUserInput.prototype, "ID", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
Field(() => String, { nullable: true }),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], UpdateQuerySystemUserInput.prototype, "Name", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
Field(() => String, { nullable: true }),
|
|
144
|
+
__metadata("design:type", String)
|
|
145
|
+
], UpdateQuerySystemUserInput.prototype, "CategoryID", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
Field(() => String, { nullable: true }),
|
|
148
|
+
__metadata("design:type", String)
|
|
149
|
+
], UpdateQuerySystemUserInput.prototype, "CategoryPath", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
Field(() => String, { nullable: true }),
|
|
152
|
+
__metadata("design:type", String)
|
|
153
|
+
], UpdateQuerySystemUserInput.prototype, "UserQuestion", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
Field(() => String, { nullable: true }),
|
|
156
|
+
__metadata("design:type", String)
|
|
157
|
+
], UpdateQuerySystemUserInput.prototype, "Description", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
Field(() => String, { nullable: true }),
|
|
160
|
+
__metadata("design:type", String)
|
|
161
|
+
], UpdateQuerySystemUserInput.prototype, "SQL", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
Field(() => String, { nullable: true }),
|
|
164
|
+
__metadata("design:type", String)
|
|
165
|
+
], UpdateQuerySystemUserInput.prototype, "TechnicalDescription", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
Field(() => String, { nullable: true }),
|
|
168
|
+
__metadata("design:type", String)
|
|
169
|
+
], UpdateQuerySystemUserInput.prototype, "OriginalSQL", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
Field(() => String, { nullable: true }),
|
|
172
|
+
__metadata("design:type", String)
|
|
173
|
+
], UpdateQuerySystemUserInput.prototype, "Feedback", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
Field(() => QueryStatus, { nullable: true }),
|
|
176
|
+
__metadata("design:type", String)
|
|
177
|
+
], UpdateQuerySystemUserInput.prototype, "Status", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
Field(() => Number, { nullable: true }),
|
|
180
|
+
__metadata("design:type", Number)
|
|
181
|
+
], UpdateQuerySystemUserInput.prototype, "QualityRank", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
Field(() => Number, { nullable: true }),
|
|
184
|
+
__metadata("design:type", Number)
|
|
185
|
+
], UpdateQuerySystemUserInput.prototype, "ExecutionCostRank", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
Field(() => Boolean, { nullable: true }),
|
|
188
|
+
__metadata("design:type", Boolean)
|
|
189
|
+
], UpdateQuerySystemUserInput.prototype, "UsesTemplate", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
Field(() => [QueryPermissionInputType], { nullable: true }),
|
|
192
|
+
__metadata("design:type", Array)
|
|
193
|
+
], UpdateQuerySystemUserInput.prototype, "Permissions", void 0);
|
|
194
|
+
UpdateQuerySystemUserInput = __decorate([
|
|
195
|
+
InputType()
|
|
196
|
+
], UpdateQuerySystemUserInput);
|
|
197
|
+
export { UpdateQuerySystemUserInput };
|
|
198
|
+
let QueryFieldType = class QueryFieldType {
|
|
199
|
+
ID;
|
|
200
|
+
QueryID;
|
|
201
|
+
Name;
|
|
202
|
+
Description;
|
|
203
|
+
Type;
|
|
204
|
+
Sequence;
|
|
205
|
+
SQLBaseType;
|
|
206
|
+
SQLFullType;
|
|
207
|
+
IsComputed;
|
|
208
|
+
ComputationDescription;
|
|
209
|
+
};
|
|
210
|
+
__decorate([
|
|
211
|
+
Field(() => String),
|
|
212
|
+
__metadata("design:type", String)
|
|
213
|
+
], QueryFieldType.prototype, "ID", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
Field(() => String),
|
|
216
|
+
__metadata("design:type", String)
|
|
217
|
+
], QueryFieldType.prototype, "QueryID", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
Field(() => String),
|
|
220
|
+
__metadata("design:type", String)
|
|
221
|
+
], QueryFieldType.prototype, "Name", void 0);
|
|
222
|
+
__decorate([
|
|
223
|
+
Field(() => String, { nullable: true }),
|
|
224
|
+
__metadata("design:type", String)
|
|
225
|
+
], QueryFieldType.prototype, "Description", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
Field(() => String, { nullable: true }),
|
|
228
|
+
__metadata("design:type", String)
|
|
229
|
+
], QueryFieldType.prototype, "Type", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
Field(() => Number),
|
|
232
|
+
__metadata("design:type", Number)
|
|
233
|
+
], QueryFieldType.prototype, "Sequence", void 0);
|
|
234
|
+
__decorate([
|
|
235
|
+
Field(() => String, { nullable: true }),
|
|
236
|
+
__metadata("design:type", String)
|
|
237
|
+
], QueryFieldType.prototype, "SQLBaseType", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
Field(() => String, { nullable: true }),
|
|
240
|
+
__metadata("design:type", String)
|
|
241
|
+
], QueryFieldType.prototype, "SQLFullType", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
Field(() => Boolean),
|
|
244
|
+
__metadata("design:type", Boolean)
|
|
245
|
+
], QueryFieldType.prototype, "IsComputed", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
Field(() => String, { nullable: true }),
|
|
248
|
+
__metadata("design:type", String)
|
|
249
|
+
], QueryFieldType.prototype, "ComputationDescription", void 0);
|
|
250
|
+
QueryFieldType = __decorate([
|
|
251
|
+
ObjectType()
|
|
252
|
+
], QueryFieldType);
|
|
253
|
+
export { QueryFieldType };
|
|
254
|
+
let QueryParameterType = class QueryParameterType {
|
|
255
|
+
ID;
|
|
256
|
+
QueryID;
|
|
257
|
+
Name;
|
|
258
|
+
Type;
|
|
259
|
+
DefaultValue;
|
|
260
|
+
Comments;
|
|
261
|
+
IsRequired;
|
|
262
|
+
};
|
|
263
|
+
__decorate([
|
|
264
|
+
Field(() => String),
|
|
265
|
+
__metadata("design:type", String)
|
|
266
|
+
], QueryParameterType.prototype, "ID", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
Field(() => String),
|
|
269
|
+
__metadata("design:type", String)
|
|
270
|
+
], QueryParameterType.prototype, "QueryID", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
Field(() => String),
|
|
273
|
+
__metadata("design:type", String)
|
|
274
|
+
], QueryParameterType.prototype, "Name", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
Field(() => String),
|
|
277
|
+
__metadata("design:type", String)
|
|
278
|
+
], QueryParameterType.prototype, "Type", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
Field(() => String, { nullable: true }),
|
|
281
|
+
__metadata("design:type", String)
|
|
282
|
+
], QueryParameterType.prototype, "DefaultValue", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
Field(() => String, { nullable: true }),
|
|
285
|
+
__metadata("design:type", String)
|
|
286
|
+
], QueryParameterType.prototype, "Comments", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
Field(() => Boolean),
|
|
289
|
+
__metadata("design:type", Boolean)
|
|
290
|
+
], QueryParameterType.prototype, "IsRequired", void 0);
|
|
291
|
+
QueryParameterType = __decorate([
|
|
292
|
+
ObjectType()
|
|
293
|
+
], QueryParameterType);
|
|
294
|
+
export { QueryParameterType };
|
|
295
|
+
let QueryEntityType = class QueryEntityType {
|
|
296
|
+
ID;
|
|
297
|
+
QueryID;
|
|
298
|
+
EntityID;
|
|
299
|
+
EntityName;
|
|
300
|
+
Sequence;
|
|
301
|
+
};
|
|
302
|
+
__decorate([
|
|
303
|
+
Field(() => String),
|
|
304
|
+
__metadata("design:type", String)
|
|
305
|
+
], QueryEntityType.prototype, "ID", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
Field(() => String),
|
|
308
|
+
__metadata("design:type", String)
|
|
309
|
+
], QueryEntityType.prototype, "QueryID", void 0);
|
|
310
|
+
__decorate([
|
|
311
|
+
Field(() => String),
|
|
312
|
+
__metadata("design:type", String)
|
|
313
|
+
], QueryEntityType.prototype, "EntityID", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
Field(() => String, { nullable: true }),
|
|
316
|
+
__metadata("design:type", String)
|
|
317
|
+
], QueryEntityType.prototype, "EntityName", void 0);
|
|
318
|
+
__decorate([
|
|
319
|
+
Field(() => Number),
|
|
320
|
+
__metadata("design:type", Number)
|
|
321
|
+
], QueryEntityType.prototype, "Sequence", void 0);
|
|
322
|
+
QueryEntityType = __decorate([
|
|
323
|
+
ObjectType()
|
|
324
|
+
], QueryEntityType);
|
|
325
|
+
export { QueryEntityType };
|
|
326
|
+
let QueryPermissionType = class QueryPermissionType {
|
|
327
|
+
ID;
|
|
328
|
+
QueryID;
|
|
329
|
+
RoleID;
|
|
330
|
+
RoleName;
|
|
331
|
+
};
|
|
332
|
+
__decorate([
|
|
333
|
+
Field(() => String),
|
|
334
|
+
__metadata("design:type", String)
|
|
335
|
+
], QueryPermissionType.prototype, "ID", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
Field(() => String),
|
|
338
|
+
__metadata("design:type", String)
|
|
339
|
+
], QueryPermissionType.prototype, "QueryID", void 0);
|
|
340
|
+
__decorate([
|
|
341
|
+
Field(() => String),
|
|
342
|
+
__metadata("design:type", String)
|
|
343
|
+
], QueryPermissionType.prototype, "RoleID", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
Field(() => String, { nullable: true }),
|
|
346
|
+
__metadata("design:type", String)
|
|
347
|
+
], QueryPermissionType.prototype, "RoleName", void 0);
|
|
348
|
+
QueryPermissionType = __decorate([
|
|
349
|
+
ObjectType()
|
|
350
|
+
], QueryPermissionType);
|
|
351
|
+
export { QueryPermissionType };
|
|
101
352
|
let CreateQueryResultType = class CreateQueryResultType {
|
|
102
353
|
Success;
|
|
103
354
|
ErrorMessage;
|
|
104
355
|
QueryData;
|
|
356
|
+
Fields;
|
|
357
|
+
Parameters;
|
|
358
|
+
Entities;
|
|
359
|
+
Permissions;
|
|
105
360
|
};
|
|
106
361
|
__decorate([
|
|
107
362
|
Field(() => Boolean),
|
|
@@ -115,10 +370,67 @@ __decorate([
|
|
|
115
370
|
Field(() => String, { nullable: true }),
|
|
116
371
|
__metadata("design:type", String)
|
|
117
372
|
], CreateQueryResultType.prototype, "QueryData", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
Field(() => [QueryFieldType], { nullable: true }),
|
|
375
|
+
__metadata("design:type", Array)
|
|
376
|
+
], CreateQueryResultType.prototype, "Fields", void 0);
|
|
377
|
+
__decorate([
|
|
378
|
+
Field(() => [QueryParameterType], { nullable: true }),
|
|
379
|
+
__metadata("design:type", Array)
|
|
380
|
+
], CreateQueryResultType.prototype, "Parameters", void 0);
|
|
381
|
+
__decorate([
|
|
382
|
+
Field(() => [QueryEntityType], { nullable: true }),
|
|
383
|
+
__metadata("design:type", Array)
|
|
384
|
+
], CreateQueryResultType.prototype, "Entities", void 0);
|
|
385
|
+
__decorate([
|
|
386
|
+
Field(() => [QueryPermissionType], { nullable: true }),
|
|
387
|
+
__metadata("design:type", Array)
|
|
388
|
+
], CreateQueryResultType.prototype, "Permissions", void 0);
|
|
118
389
|
CreateQueryResultType = __decorate([
|
|
119
390
|
ObjectType()
|
|
120
391
|
], CreateQueryResultType);
|
|
121
392
|
export { CreateQueryResultType };
|
|
393
|
+
let UpdateQueryResultType = class UpdateQueryResultType {
|
|
394
|
+
Success;
|
|
395
|
+
ErrorMessage;
|
|
396
|
+
QueryData;
|
|
397
|
+
Fields;
|
|
398
|
+
Parameters;
|
|
399
|
+
Entities;
|
|
400
|
+
Permissions;
|
|
401
|
+
};
|
|
402
|
+
__decorate([
|
|
403
|
+
Field(() => Boolean),
|
|
404
|
+
__metadata("design:type", Boolean)
|
|
405
|
+
], UpdateQueryResultType.prototype, "Success", void 0);
|
|
406
|
+
__decorate([
|
|
407
|
+
Field(() => String, { nullable: true }),
|
|
408
|
+
__metadata("design:type", String)
|
|
409
|
+
], UpdateQueryResultType.prototype, "ErrorMessage", void 0);
|
|
410
|
+
__decorate([
|
|
411
|
+
Field(() => String, { nullable: true }),
|
|
412
|
+
__metadata("design:type", String)
|
|
413
|
+
], UpdateQueryResultType.prototype, "QueryData", void 0);
|
|
414
|
+
__decorate([
|
|
415
|
+
Field(() => [QueryFieldType], { nullable: true }),
|
|
416
|
+
__metadata("design:type", Array)
|
|
417
|
+
], UpdateQueryResultType.prototype, "Fields", void 0);
|
|
418
|
+
__decorate([
|
|
419
|
+
Field(() => [QueryParameterType], { nullable: true }),
|
|
420
|
+
__metadata("design:type", Array)
|
|
421
|
+
], UpdateQueryResultType.prototype, "Parameters", void 0);
|
|
422
|
+
__decorate([
|
|
423
|
+
Field(() => [QueryEntityType], { nullable: true }),
|
|
424
|
+
__metadata("design:type", Array)
|
|
425
|
+
], UpdateQueryResultType.prototype, "Entities", void 0);
|
|
426
|
+
__decorate([
|
|
427
|
+
Field(() => [QueryPermissionType], { nullable: true }),
|
|
428
|
+
__metadata("design:type", Array)
|
|
429
|
+
], UpdateQueryResultType.prototype, "Permissions", void 0);
|
|
430
|
+
UpdateQueryResultType = __decorate([
|
|
431
|
+
ObjectType()
|
|
432
|
+
], UpdateQueryResultType);
|
|
433
|
+
export { UpdateQueryResultType };
|
|
122
434
|
let DeleteQueryResultType = class DeleteQueryResultType {
|
|
123
435
|
Success;
|
|
124
436
|
ErrorMessage;
|
|
@@ -146,28 +458,34 @@ let QueryResolverExtended = class QueryResolverExtended extends QueryResolver {
|
|
|
146
458
|
let finalCategoryID = input.CategoryID;
|
|
147
459
|
if (input.CategoryPath) {
|
|
148
460
|
const md = new Metadata();
|
|
149
|
-
finalCategoryID = await this.findOrCreateCategoryPath(input.CategoryPath, md, context.userPayload.userRecord
|
|
461
|
+
finalCategoryID = await this.findOrCreateCategoryPath(input.CategoryPath, md, context.userPayload.userRecord);
|
|
150
462
|
}
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
SQL: input.SQL,
|
|
157
|
-
TechnicalDescription: input.TechnicalDescription,
|
|
158
|
-
OriginalSQL: input.OriginalSQL,
|
|
159
|
-
Feedback: input.Feedback,
|
|
463
|
+
const provider = GetReadWriteProvider(context.providers);
|
|
464
|
+
const record = await provider.GetEntityObject("Queries", context.userPayload.userRecord);
|
|
465
|
+
const fieldsToSet = {
|
|
466
|
+
...input,
|
|
467
|
+
CategoryID: finalCategoryID || input.CategoryID,
|
|
160
468
|
Status: input.Status || 'Approved',
|
|
161
469
|
QualityRank: input.QualityRank || 0,
|
|
162
|
-
ExecutionCostRank: input.ExecutionCostRank,
|
|
163
470
|
UsesTemplate: input.UsesTemplate || false
|
|
164
471
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
472
|
+
delete fieldsToSet.Permissions;
|
|
473
|
+
record.SetMany(fieldsToSet, true);
|
|
474
|
+
this.ListenForEntityMessages(record, pubSub, context.userPayload.userRecord);
|
|
475
|
+
if (await record.Save()) {
|
|
476
|
+
await this.AfterCreate(provider, input);
|
|
477
|
+
const queryID = record.ID;
|
|
478
|
+
if (input.Permissions && input.Permissions.length > 0) {
|
|
479
|
+
await this.createPermissions(input.Permissions, queryID, context.userPayload.userRecord);
|
|
480
|
+
await record.RefreshRelatedMetadata(true);
|
|
481
|
+
}
|
|
168
482
|
return {
|
|
169
483
|
Success: true,
|
|
170
|
-
QueryData: JSON.stringify(
|
|
484
|
+
QueryData: JSON.stringify(record.GetAll()),
|
|
485
|
+
Fields: record.QueryFields,
|
|
486
|
+
Parameters: record.QueryParameters,
|
|
487
|
+
Entities: record.QueryEntities,
|
|
488
|
+
Permissions: record.QueryPermissions
|
|
171
489
|
};
|
|
172
490
|
}
|
|
173
491
|
else {
|
|
@@ -185,6 +503,143 @@ let QueryResolverExtended = class QueryResolverExtended extends QueryResolver {
|
|
|
185
503
|
};
|
|
186
504
|
}
|
|
187
505
|
}
|
|
506
|
+
async createPermissions(permissions, queryID, contextUser) {
|
|
507
|
+
const createdPermissions = [];
|
|
508
|
+
if (permissions && permissions.length > 0) {
|
|
509
|
+
const md = new Metadata();
|
|
510
|
+
for (const perm of permissions) {
|
|
511
|
+
const permissionEntity = await md.GetEntityObject('Query Permissions', contextUser);
|
|
512
|
+
if (permissionEntity) {
|
|
513
|
+
permissionEntity.QueryID = queryID;
|
|
514
|
+
permissionEntity.RoleID = perm.RoleID;
|
|
515
|
+
const saveResult = await permissionEntity.Save();
|
|
516
|
+
if (saveResult) {
|
|
517
|
+
createdPermissions.push({
|
|
518
|
+
ID: permissionEntity.ID,
|
|
519
|
+
QueryID: permissionEntity.QueryID,
|
|
520
|
+
RoleID: permissionEntity.RoleID,
|
|
521
|
+
RoleName: permissionEntity.Role
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
return createdPermissions;
|
|
528
|
+
}
|
|
529
|
+
async UpdateQuerySystemUser(input, context, pubSub) {
|
|
530
|
+
try {
|
|
531
|
+
const provider = GetReadWriteProvider(context.providers);
|
|
532
|
+
const queryEntity = await provider.GetEntityObject('Queries', context.userPayload.userRecord);
|
|
533
|
+
if (!queryEntity || !await queryEntity.Load(input.ID)) {
|
|
534
|
+
return {
|
|
535
|
+
Success: false,
|
|
536
|
+
ErrorMessage: `Query with ID ${input.ID} not found`
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
let finalCategoryID = input.CategoryID;
|
|
540
|
+
if (input.CategoryPath) {
|
|
541
|
+
const md = new Metadata();
|
|
542
|
+
finalCategoryID = await this.findOrCreateCategoryPath(input.CategoryPath, md, context.userPayload.userRecord);
|
|
543
|
+
}
|
|
544
|
+
if (input.Name !== undefined)
|
|
545
|
+
queryEntity.Name = input.Name;
|
|
546
|
+
if (finalCategoryID !== undefined)
|
|
547
|
+
queryEntity.CategoryID = finalCategoryID;
|
|
548
|
+
if (input.UserQuestion !== undefined)
|
|
549
|
+
queryEntity.UserQuestion = input.UserQuestion;
|
|
550
|
+
if (input.Description !== undefined)
|
|
551
|
+
queryEntity.Description = input.Description;
|
|
552
|
+
if (input.SQL !== undefined)
|
|
553
|
+
queryEntity.SQL = input.SQL;
|
|
554
|
+
if (input.TechnicalDescription !== undefined)
|
|
555
|
+
queryEntity.TechnicalDescription = input.TechnicalDescription;
|
|
556
|
+
if (input.OriginalSQL !== undefined)
|
|
557
|
+
queryEntity.OriginalSQL = input.OriginalSQL;
|
|
558
|
+
if (input.Feedback !== undefined)
|
|
559
|
+
queryEntity.Feedback = input.Feedback;
|
|
560
|
+
if (input.Status !== undefined)
|
|
561
|
+
queryEntity.Status = input.Status;
|
|
562
|
+
if (input.QualityRank !== undefined)
|
|
563
|
+
queryEntity.QualityRank = input.QualityRank;
|
|
564
|
+
if (input.ExecutionCostRank !== undefined)
|
|
565
|
+
queryEntity.ExecutionCostRank = input.ExecutionCostRank;
|
|
566
|
+
if (input.UsesTemplate !== undefined)
|
|
567
|
+
queryEntity.UsesTemplate = input.UsesTemplate;
|
|
568
|
+
const saveResult = await queryEntity.Save();
|
|
569
|
+
if (!saveResult) {
|
|
570
|
+
return {
|
|
571
|
+
Success: false,
|
|
572
|
+
ErrorMessage: `Failed to update query: ${queryEntity.LatestResult?.Message || 'Unknown error'}`
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
const queryID = queryEntity.ID;
|
|
576
|
+
if (input.Permissions !== undefined) {
|
|
577
|
+
const rv = new RunView();
|
|
578
|
+
const existingPermissions = await rv.RunView({
|
|
579
|
+
EntityName: 'Query Permissions',
|
|
580
|
+
ExtraFilter: `QueryID='${queryID}'`,
|
|
581
|
+
ResultType: 'entity_object'
|
|
582
|
+
}, context.userPayload.userRecord);
|
|
583
|
+
if (existingPermissions.Success && existingPermissions.Results) {
|
|
584
|
+
for (const perm of existingPermissions.Results) {
|
|
585
|
+
await perm.Delete();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
await this.createPermissions(input.Permissions, queryID, context.userPayload.userRecord);
|
|
589
|
+
await queryEntity.RefreshRelatedMetadata(true);
|
|
590
|
+
}
|
|
591
|
+
const fields = queryEntity.QueryFields.map(f => ({
|
|
592
|
+
ID: f.ID,
|
|
593
|
+
QueryID: f.QueryID,
|
|
594
|
+
Name: f.Name,
|
|
595
|
+
Description: f.Description || undefined,
|
|
596
|
+
Type: f.SQLBaseType || undefined,
|
|
597
|
+
Sequence: f.Sequence,
|
|
598
|
+
SQLBaseType: f.SQLBaseType || undefined,
|
|
599
|
+
SQLFullType: f.SQLFullType || undefined,
|
|
600
|
+
IsComputed: f.IsComputed,
|
|
601
|
+
ComputationEnabled: true,
|
|
602
|
+
ComputationDescription: f.ComputationDescription || undefined
|
|
603
|
+
}));
|
|
604
|
+
const parameters = queryEntity.QueryParameters.map(p => ({
|
|
605
|
+
ID: p.ID,
|
|
606
|
+
QueryID: p.QueryID,
|
|
607
|
+
Name: p.Name,
|
|
608
|
+
Type: p.Type,
|
|
609
|
+
DefaultValue: p.DefaultValue || undefined,
|
|
610
|
+
Comments: '',
|
|
611
|
+
IsRequired: p.IsRequired
|
|
612
|
+
}));
|
|
613
|
+
const entities = queryEntity.QueryEntities.map(e => ({
|
|
614
|
+
ID: e.ID,
|
|
615
|
+
QueryID: e.QueryID,
|
|
616
|
+
EntityID: e.EntityID,
|
|
617
|
+
EntityName: e.Entity || undefined,
|
|
618
|
+
Sequence: e.Sequence || 0
|
|
619
|
+
}));
|
|
620
|
+
const permissions = queryEntity.QueryPermissions.map(p => ({
|
|
621
|
+
ID: p.ID,
|
|
622
|
+
QueryID: p.QueryID,
|
|
623
|
+
RoleID: p.RoleID,
|
|
624
|
+
RoleName: p.Role || undefined
|
|
625
|
+
}));
|
|
626
|
+
return {
|
|
627
|
+
Success: true,
|
|
628
|
+
QueryData: JSON.stringify(queryEntity.GetAll()),
|
|
629
|
+
Fields: fields,
|
|
630
|
+
Parameters: parameters,
|
|
631
|
+
Entities: entities,
|
|
632
|
+
Permissions: permissions
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
catch (err) {
|
|
636
|
+
LogError(err);
|
|
637
|
+
return {
|
|
638
|
+
Success: false,
|
|
639
|
+
ErrorMessage: `QueryResolverExtended::UpdateQuerySystemUser --- Error updating query: ${err instanceof Error ? err.message : String(err)}`
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
}
|
|
188
643
|
async DeleteQuerySystemResolver(ID, options, context, pubSub) {
|
|
189
644
|
try {
|
|
190
645
|
if (!ID || ID.trim() === '') {
|
|
@@ -221,7 +676,7 @@ let QueryResolverExtended = class QueryResolverExtended extends QueryResolver {
|
|
|
221
676
|
};
|
|
222
677
|
}
|
|
223
678
|
}
|
|
224
|
-
async findOrCreateCategoryPath(categoryPath, md, contextUser
|
|
679
|
+
async findOrCreateCategoryPath(categoryPath, md, contextUser) {
|
|
225
680
|
if (!categoryPath || categoryPath.trim() === '') {
|
|
226
681
|
throw new Error('CategoryPath cannot be empty');
|
|
227
682
|
}
|
|
@@ -297,6 +752,16 @@ __decorate([
|
|
|
297
752
|
__metadata("design:paramtypes", [CreateQuerySystemUserInput, Object, PubSubEngine]),
|
|
298
753
|
__metadata("design:returntype", Promise)
|
|
299
754
|
], QueryResolverExtended.prototype, "CreateQuerySystemUser", null);
|
|
755
|
+
__decorate([
|
|
756
|
+
RequireSystemUser(),
|
|
757
|
+
Mutation(() => UpdateQueryResultType),
|
|
758
|
+
__param(0, Arg('input', () => UpdateQuerySystemUserInput)),
|
|
759
|
+
__param(1, Ctx()),
|
|
760
|
+
__param(2, PubSub()),
|
|
761
|
+
__metadata("design:type", Function),
|
|
762
|
+
__metadata("design:paramtypes", [UpdateQuerySystemUserInput, Object, PubSubEngine]),
|
|
763
|
+
__metadata("design:returntype", Promise)
|
|
764
|
+
], QueryResolverExtended.prototype, "UpdateQuerySystemUser", null);
|
|
300
765
|
__decorate([
|
|
301
766
|
RequireSystemUser(),
|
|
302
767
|
Mutation(() => DeleteQueryResultType),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateQueryResolver.js","sourceRoot":"","sources":["../../src/resolvers/CreateQueryResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAElI,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAY,YAAY,EAAqB,MAAM,sBAAsB,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAKtE,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;AACvB,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,gBAAgB,CAAC,WAAW,EAAE;IAC1B,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4DAA4D;CAC5E,CAAC,CAAC;AAGI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;I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C,WAAA,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAA;IACvB,WAAA,GAAG,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5D,WAAA,GAAG,EAAE,CAAA;IACL,WAAA,MAAM,EAAE,CAAA;;6CAF8D,kBAAkB,UAEvE,YAAY;;sEA0CjC;AAtSQ,qBAAqB;IADjC,QAAQ,EAAE;GACE,qBAAqB,CAuYjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.80.0",
|
|
4
4
|
"description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -22,39 +22,39 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apollo/server": "^4.9.1",
|
|
24
24
|
"@graphql-tools/utils": "^10.0.1",
|
|
25
|
-
"@memberjunction/actions": "2.
|
|
26
|
-
"@memberjunction/ai": "2.
|
|
27
|
-
"@memberjunction/ai-core-plus": "2.
|
|
28
|
-
"@memberjunction/ai-agents": "2.
|
|
29
|
-
"@memberjunction/aiengine": "2.
|
|
30
|
-
"@memberjunction/ai-prompts": "2.
|
|
31
|
-
"@memberjunction/ai-agent-manager-actions": "2.
|
|
32
|
-
"@memberjunction/ai-mistral": "2.
|
|
33
|
-
"@memberjunction/ai-openai": "2.
|
|
34
|
-
"@memberjunction/ai-anthropic": "2.
|
|
35
|
-
"@memberjunction/ai-groq": "2.
|
|
36
|
-
"@memberjunction/ai-cerebras": "2.
|
|
37
|
-
"@memberjunction/ai-vectors-pinecone": "2.
|
|
38
|
-
"@memberjunction/core": "2.
|
|
39
|
-
"@memberjunction/core-actions": "2.
|
|
40
|
-
"@memberjunction/actions-bizapps-accounting": "2.
|
|
41
|
-
"@memberjunction/actions-bizapps-crm": "2.
|
|
42
|
-
"@memberjunction/actions-bizapps-lms": "2.
|
|
43
|
-
"@memberjunction/actions-bizapps-social": "2.
|
|
44
|
-
"@memberjunction/core-entities": "2.
|
|
45
|
-
"@memberjunction/core-entities-server": "2.
|
|
46
|
-
"@memberjunction/data-context": "2.
|
|
47
|
-
"@memberjunction/data-context-server": "2.
|
|
48
|
-
"@memberjunction/doc-utils": "2.
|
|
49
|
-
"@memberjunction/entity-communications-server": "2.
|
|
50
|
-
"@memberjunction/external-change-detection": "2.
|
|
51
|
-
"@memberjunction/global": "2.
|
|
52
|
-
"@memberjunction/graphql-dataprovider": "2.
|
|
53
|
-
"@memberjunction/queue": "2.
|
|
54
|
-
"@memberjunction/skip-types": "2.
|
|
55
|
-
"@memberjunction/sqlserver-dataprovider": "2.
|
|
56
|
-
"@memberjunction/storage": "2.
|
|
57
|
-
"@memberjunction/templates": "2.
|
|
25
|
+
"@memberjunction/actions": "2.80.0",
|
|
26
|
+
"@memberjunction/ai": "2.80.0",
|
|
27
|
+
"@memberjunction/ai-core-plus": "2.80.0",
|
|
28
|
+
"@memberjunction/ai-agents": "2.80.0",
|
|
29
|
+
"@memberjunction/aiengine": "2.80.0",
|
|
30
|
+
"@memberjunction/ai-prompts": "2.80.0",
|
|
31
|
+
"@memberjunction/ai-agent-manager-actions": "2.80.0",
|
|
32
|
+
"@memberjunction/ai-mistral": "2.80.0",
|
|
33
|
+
"@memberjunction/ai-openai": "2.80.0",
|
|
34
|
+
"@memberjunction/ai-anthropic": "2.80.0",
|
|
35
|
+
"@memberjunction/ai-groq": "2.80.0",
|
|
36
|
+
"@memberjunction/ai-cerebras": "2.80.0",
|
|
37
|
+
"@memberjunction/ai-vectors-pinecone": "2.80.0",
|
|
38
|
+
"@memberjunction/core": "2.80.0",
|
|
39
|
+
"@memberjunction/core-actions": "2.80.0",
|
|
40
|
+
"@memberjunction/actions-bizapps-accounting": "2.80.0",
|
|
41
|
+
"@memberjunction/actions-bizapps-crm": "2.80.0",
|
|
42
|
+
"@memberjunction/actions-bizapps-lms": "2.80.0",
|
|
43
|
+
"@memberjunction/actions-bizapps-social": "2.80.0",
|
|
44
|
+
"@memberjunction/core-entities": "2.80.0",
|
|
45
|
+
"@memberjunction/core-entities-server": "2.80.0",
|
|
46
|
+
"@memberjunction/data-context": "2.80.0",
|
|
47
|
+
"@memberjunction/data-context-server": "2.80.0",
|
|
48
|
+
"@memberjunction/doc-utils": "2.80.0",
|
|
49
|
+
"@memberjunction/entity-communications-server": "2.80.0",
|
|
50
|
+
"@memberjunction/external-change-detection": "2.80.0",
|
|
51
|
+
"@memberjunction/global": "2.80.0",
|
|
52
|
+
"@memberjunction/graphql-dataprovider": "2.80.0",
|
|
53
|
+
"@memberjunction/queue": "2.80.0",
|
|
54
|
+
"@memberjunction/skip-types": "2.80.0",
|
|
55
|
+
"@memberjunction/sqlserver-dataprovider": "2.80.0",
|
|
56
|
+
"@memberjunction/storage": "2.80.0",
|
|
57
|
+
"@memberjunction/templates": "2.80.0",
|
|
58
58
|
"@types/compression": "^1.7.5",
|
|
59
59
|
"@types/cors": "^2.8.13",
|
|
60
60
|
"@types/jsonwebtoken": "9.0.6",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Arg, Ctx, Field, InputType, Mutation, ObjectType, registerEnumType, Resolver, PubSub, PubSubEngine } from 'type-graphql';
|
|
2
|
-
import { AppContext
|
|
3
|
-
import { LogError, Metadata, RunView, UserInfo, CompositeKey
|
|
2
|
+
import { AppContext } from '../types.js';
|
|
3
|
+
import { LogError, Metadata, RunView, UserInfo, CompositeKey } from '@memberjunction/core';
|
|
4
4
|
import { RequireSystemUser } from '../directives/RequireSystemUser.js';
|
|
5
|
-
import { QueryCategoryEntity } from '@memberjunction/core-entities';
|
|
5
|
+
import { QueryCategoryEntity, QueryPermissionEntity } from '@memberjunction/core-entities';
|
|
6
6
|
import { QueryResolver } from '../generated/generated.js';
|
|
7
7
|
import { GetReadWriteProvider } from '../util.js';
|
|
8
8
|
import { DeleteOptionsInput } from '../generic/DeleteOptionsInput.js';
|
|
9
|
+
import { QueryEntityExtended } from '@memberjunction/core-entities-server';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Query status enumeration for GraphQL
|
|
@@ -22,6 +23,12 @@ registerEnumType(QueryStatus, {
|
|
|
22
23
|
description: "Status of a query: Pending, Approved, Rejected, or Expired"
|
|
23
24
|
});
|
|
24
25
|
|
|
26
|
+
@InputType()
|
|
27
|
+
export class QueryPermissionInputType {
|
|
28
|
+
@Field(() => String)
|
|
29
|
+
RoleID!: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
@InputType()
|
|
26
33
|
export class CreateQuerySystemUserInput {
|
|
27
34
|
@Field(() => String)
|
|
@@ -62,6 +69,147 @@ export class CreateQuerySystemUserInput {
|
|
|
62
69
|
|
|
63
70
|
@Field(() => Boolean, { nullable: true })
|
|
64
71
|
UsesTemplate?: boolean;
|
|
72
|
+
|
|
73
|
+
@Field(() => [QueryPermissionInputType], { nullable: true })
|
|
74
|
+
Permissions?: QueryPermissionInputType[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@InputType()
|
|
78
|
+
export class UpdateQuerySystemUserInput {
|
|
79
|
+
@Field(() => String)
|
|
80
|
+
ID!: string;
|
|
81
|
+
|
|
82
|
+
@Field(() => String, { nullable: true })
|
|
83
|
+
Name?: string;
|
|
84
|
+
|
|
85
|
+
@Field(() => String, { nullable: true })
|
|
86
|
+
CategoryID?: string;
|
|
87
|
+
|
|
88
|
+
@Field(() => String, { nullable: true })
|
|
89
|
+
CategoryPath?: string;
|
|
90
|
+
|
|
91
|
+
@Field(() => String, { nullable: true })
|
|
92
|
+
UserQuestion?: string;
|
|
93
|
+
|
|
94
|
+
@Field(() => String, { nullable: true })
|
|
95
|
+
Description?: string;
|
|
96
|
+
|
|
97
|
+
@Field(() => String, { nullable: true })
|
|
98
|
+
SQL?: string;
|
|
99
|
+
|
|
100
|
+
@Field(() => String, { nullable: true })
|
|
101
|
+
TechnicalDescription?: string;
|
|
102
|
+
|
|
103
|
+
@Field(() => String, { nullable: true })
|
|
104
|
+
OriginalSQL?: string;
|
|
105
|
+
|
|
106
|
+
@Field(() => String, { nullable: true })
|
|
107
|
+
Feedback?: string;
|
|
108
|
+
|
|
109
|
+
@Field(() => QueryStatus, { nullable: true })
|
|
110
|
+
Status?: QueryStatus;
|
|
111
|
+
|
|
112
|
+
@Field(() => Number, { nullable: true })
|
|
113
|
+
QualityRank?: number;
|
|
114
|
+
|
|
115
|
+
@Field(() => Number, { nullable: true })
|
|
116
|
+
ExecutionCostRank?: number;
|
|
117
|
+
|
|
118
|
+
@Field(() => Boolean, { nullable: true })
|
|
119
|
+
UsesTemplate?: boolean;
|
|
120
|
+
|
|
121
|
+
@Field(() => [QueryPermissionInputType], { nullable: true })
|
|
122
|
+
Permissions?: QueryPermissionInputType[];
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@ObjectType()
|
|
126
|
+
export class QueryFieldType {
|
|
127
|
+
@Field(() => String)
|
|
128
|
+
ID!: string;
|
|
129
|
+
|
|
130
|
+
@Field(() => String)
|
|
131
|
+
QueryID!: string;
|
|
132
|
+
|
|
133
|
+
@Field(() => String)
|
|
134
|
+
Name!: string;
|
|
135
|
+
|
|
136
|
+
@Field(() => String, { nullable: true })
|
|
137
|
+
Description?: string;
|
|
138
|
+
|
|
139
|
+
@Field(() => String, { nullable: true })
|
|
140
|
+
Type?: string;
|
|
141
|
+
|
|
142
|
+
@Field(() => Number)
|
|
143
|
+
Sequence!: number;
|
|
144
|
+
|
|
145
|
+
@Field(() => String, { nullable: true })
|
|
146
|
+
SQLBaseType?: string;
|
|
147
|
+
|
|
148
|
+
@Field(() => String, { nullable: true })
|
|
149
|
+
SQLFullType?: string;
|
|
150
|
+
|
|
151
|
+
@Field(() => Boolean)
|
|
152
|
+
IsComputed!: boolean;
|
|
153
|
+
|
|
154
|
+
@Field(() => String, { nullable: true })
|
|
155
|
+
ComputationDescription?: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@ObjectType()
|
|
159
|
+
export class QueryParameterType {
|
|
160
|
+
@Field(() => String)
|
|
161
|
+
ID!: string;
|
|
162
|
+
|
|
163
|
+
@Field(() => String)
|
|
164
|
+
QueryID!: string;
|
|
165
|
+
|
|
166
|
+
@Field(() => String)
|
|
167
|
+
Name!: string;
|
|
168
|
+
|
|
169
|
+
@Field(() => String)
|
|
170
|
+
Type!: string;
|
|
171
|
+
|
|
172
|
+
@Field(() => String, { nullable: true })
|
|
173
|
+
DefaultValue?: string;
|
|
174
|
+
|
|
175
|
+
@Field(() => String, { nullable: true })
|
|
176
|
+
Comments?: string;
|
|
177
|
+
|
|
178
|
+
@Field(() => Boolean)
|
|
179
|
+
IsRequired!: boolean;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@ObjectType()
|
|
183
|
+
export class QueryEntityType {
|
|
184
|
+
@Field(() => String)
|
|
185
|
+
ID!: string;
|
|
186
|
+
|
|
187
|
+
@Field(() => String)
|
|
188
|
+
QueryID!: string;
|
|
189
|
+
|
|
190
|
+
@Field(() => String)
|
|
191
|
+
EntityID!: string;
|
|
192
|
+
|
|
193
|
+
@Field(() => String, { nullable: true })
|
|
194
|
+
EntityName?: string;
|
|
195
|
+
|
|
196
|
+
@Field(() => Number)
|
|
197
|
+
Sequence!: number;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@ObjectType()
|
|
201
|
+
export class QueryPermissionType {
|
|
202
|
+
@Field(() => String)
|
|
203
|
+
ID!: string;
|
|
204
|
+
|
|
205
|
+
@Field(() => String)
|
|
206
|
+
QueryID!: string;
|
|
207
|
+
|
|
208
|
+
@Field(() => String)
|
|
209
|
+
RoleID!: string;
|
|
210
|
+
|
|
211
|
+
@Field(() => String, { nullable: true })
|
|
212
|
+
RoleName?: string;
|
|
65
213
|
}
|
|
66
214
|
|
|
67
215
|
@ObjectType()
|
|
@@ -74,6 +222,42 @@ export class CreateQueryResultType {
|
|
|
74
222
|
|
|
75
223
|
@Field(() => String, { nullable: true })
|
|
76
224
|
QueryData?: string;
|
|
225
|
+
|
|
226
|
+
@Field(() => [QueryFieldType], { nullable: true })
|
|
227
|
+
Fields?: QueryFieldType[];
|
|
228
|
+
|
|
229
|
+
@Field(() => [QueryParameterType], { nullable: true })
|
|
230
|
+
Parameters?: QueryParameterType[];
|
|
231
|
+
|
|
232
|
+
@Field(() => [QueryEntityType], { nullable: true })
|
|
233
|
+
Entities?: QueryEntityType[];
|
|
234
|
+
|
|
235
|
+
@Field(() => [QueryPermissionType], { nullable: true })
|
|
236
|
+
Permissions?: QueryPermissionType[];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@ObjectType()
|
|
240
|
+
export class UpdateQueryResultType {
|
|
241
|
+
@Field(() => Boolean)
|
|
242
|
+
Success!: boolean;
|
|
243
|
+
|
|
244
|
+
@Field(() => String, { nullable: true })
|
|
245
|
+
ErrorMessage?: string;
|
|
246
|
+
|
|
247
|
+
@Field(() => String, { nullable: true })
|
|
248
|
+
QueryData?: string;
|
|
249
|
+
|
|
250
|
+
@Field(() => [QueryFieldType], { nullable: true })
|
|
251
|
+
Fields?: QueryFieldType[];
|
|
252
|
+
|
|
253
|
+
@Field(() => [QueryParameterType], { nullable: true })
|
|
254
|
+
Parameters?: QueryParameterType[];
|
|
255
|
+
|
|
256
|
+
@Field(() => [QueryEntityType], { nullable: true })
|
|
257
|
+
Entities?: QueryEntityType[];
|
|
258
|
+
|
|
259
|
+
@Field(() => [QueryPermissionType], { nullable: true })
|
|
260
|
+
Permissions?: QueryPermissionType[];
|
|
77
261
|
}
|
|
78
262
|
|
|
79
263
|
@ObjectType()
|
|
@@ -108,46 +292,222 @@ export class QueryResolverExtended extends QueryResolver {
|
|
|
108
292
|
let finalCategoryID = input.CategoryID;
|
|
109
293
|
if (input.CategoryPath) {
|
|
110
294
|
const md = new Metadata();
|
|
111
|
-
finalCategoryID = await this.findOrCreateCategoryPath(input.CategoryPath, md, context.userPayload.userRecord
|
|
295
|
+
finalCategoryID = await this.findOrCreateCategoryPath(input.CategoryPath, md, context.userPayload.userRecord);
|
|
112
296
|
}
|
|
113
|
-
|
|
114
|
-
//
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
OriginalSQL: input.OriginalSQL,
|
|
123
|
-
Feedback: input.Feedback,
|
|
297
|
+
|
|
298
|
+
// Use QueryEntityExtended which handles AI processing
|
|
299
|
+
const provider = GetReadWriteProvider(context.providers);
|
|
300
|
+
const record = await provider.GetEntityObject<QueryEntityExtended>("Queries", context.userPayload.userRecord);
|
|
301
|
+
|
|
302
|
+
// Set the fields from input, handling CategoryPath resolution
|
|
303
|
+
const fieldsToSet = {
|
|
304
|
+
...input,
|
|
305
|
+
CategoryID: finalCategoryID || input.CategoryID,
|
|
124
306
|
Status: input.Status || 'Approved',
|
|
125
307
|
QualityRank: input.QualityRank || 0,
|
|
126
|
-
ExecutionCostRank: input.ExecutionCostRank,
|
|
127
308
|
UsesTemplate: input.UsesTemplate || false
|
|
128
309
|
};
|
|
310
|
+
// Remove Permissions from the fields to set since we handle them separately
|
|
311
|
+
delete (fieldsToSet as any).Permissions;
|
|
129
312
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (
|
|
313
|
+
record.SetMany(fieldsToSet, true);
|
|
314
|
+
this.ListenForEntityMessages(record, pubSub, context.userPayload.userRecord);
|
|
315
|
+
|
|
316
|
+
// Pass the transactionScopeId from the user payload to the save operation
|
|
317
|
+
if (await record.Save()) {
|
|
318
|
+
// save worked, fire the AfterCreate event and then return all the data
|
|
319
|
+
await this.AfterCreate(provider, input); // fire event
|
|
320
|
+
const queryID = record.ID;
|
|
321
|
+
|
|
322
|
+
if (input.Permissions && input.Permissions.length > 0) {
|
|
323
|
+
await this.createPermissions(input.Permissions, queryID, context.userPayload.userRecord);
|
|
324
|
+
await record.RefreshRelatedMetadata(true); // force DB update since we just created new permissions
|
|
325
|
+
}
|
|
326
|
+
|
|
135
327
|
return {
|
|
136
328
|
Success: true,
|
|
137
|
-
QueryData: JSON.stringify(
|
|
329
|
+
QueryData: JSON.stringify(record.GetAll()),
|
|
330
|
+
Fields: record.QueryFields,
|
|
331
|
+
Parameters: record.QueryParameters,
|
|
332
|
+
Entities: record.QueryEntities,
|
|
333
|
+
Permissions: record.QueryPermissions
|
|
138
334
|
};
|
|
139
|
-
}
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
140
337
|
return {
|
|
141
338
|
Success: false,
|
|
142
339
|
ErrorMessage: 'Failed to create query using CreateRecord method'
|
|
143
340
|
};
|
|
144
341
|
}
|
|
342
|
+
}
|
|
343
|
+
catch (err) {
|
|
344
|
+
LogError(err);
|
|
345
|
+
return {
|
|
346
|
+
Success: false,
|
|
347
|
+
ErrorMessage: `QueryResolverExtended::CreateQuerySystemUser --- Error creating query: ${err instanceof Error ? err.message : String(err)}`
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
protected async createPermissions(permissions: QueryPermissionInputType[], queryID: string, contextUser: UserInfo): Promise<QueryPermissionType[]> {
|
|
353
|
+
// Create permissions if provided
|
|
354
|
+
const createdPermissions: QueryPermissionType[] = [];
|
|
355
|
+
if (permissions && permissions.length > 0) {
|
|
356
|
+
const md = new Metadata();
|
|
357
|
+
for (const perm of permissions) {
|
|
358
|
+
const permissionEntity = await md.GetEntityObject<QueryPermissionEntity>('Query Permissions', contextUser);
|
|
359
|
+
if (permissionEntity) {
|
|
360
|
+
permissionEntity.QueryID = queryID;
|
|
361
|
+
permissionEntity.RoleID = perm.RoleID;
|
|
362
|
+
|
|
363
|
+
const saveResult = await permissionEntity.Save();
|
|
364
|
+
if (saveResult) {
|
|
365
|
+
createdPermissions.push({
|
|
366
|
+
ID: permissionEntity.ID,
|
|
367
|
+
QueryID: permissionEntity.QueryID,
|
|
368
|
+
RoleID: permissionEntity.RoleID,
|
|
369
|
+
RoleName: permissionEntity.Role // The view includes the Role name
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return createdPermissions;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Updates an existing query with the provided attributes. This mutation is restricted to system users only.
|
|
380
|
+
* @param input - UpdateQuerySystemUserInput containing the query ID and fields to update
|
|
381
|
+
* @param context - Application context containing user information
|
|
382
|
+
* @returns UpdateQueryResultType with success status and updated query data including related entities
|
|
383
|
+
*/
|
|
384
|
+
@RequireSystemUser()
|
|
385
|
+
@Mutation(() => UpdateQueryResultType)
|
|
386
|
+
async UpdateQuerySystemUser(
|
|
387
|
+
@Arg('input', () => UpdateQuerySystemUserInput) input: UpdateQuerySystemUserInput,
|
|
388
|
+
@Ctx() context: AppContext,
|
|
389
|
+
@PubSub() pubSub: PubSubEngine
|
|
390
|
+
): Promise<UpdateQueryResultType> {
|
|
391
|
+
try {
|
|
392
|
+
// Load the existing query using QueryEntityExtended
|
|
393
|
+
const provider = GetReadWriteProvider(context.providers);
|
|
394
|
+
const queryEntity = await provider.GetEntityObject<QueryEntityExtended>('Queries', context.userPayload.userRecord);
|
|
395
|
+
if (!queryEntity || !await queryEntity.Load(input.ID)) {
|
|
396
|
+
return {
|
|
397
|
+
Success: false,
|
|
398
|
+
ErrorMessage: `Query with ID ${input.ID} not found`
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Handle CategoryPath if provided
|
|
403
|
+
let finalCategoryID = input.CategoryID;
|
|
404
|
+
if (input.CategoryPath) {
|
|
405
|
+
const md = new Metadata();
|
|
406
|
+
finalCategoryID = await this.findOrCreateCategoryPath(input.CategoryPath, md, context.userPayload.userRecord);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// Update fields that were provided
|
|
410
|
+
if (input.Name !== undefined) queryEntity.Name = input.Name;
|
|
411
|
+
if (finalCategoryID !== undefined) queryEntity.CategoryID = finalCategoryID;
|
|
412
|
+
if (input.UserQuestion !== undefined) queryEntity.UserQuestion = input.UserQuestion;
|
|
413
|
+
if (input.Description !== undefined) queryEntity.Description = input.Description;
|
|
414
|
+
if (input.SQL !== undefined) queryEntity.SQL = input.SQL;
|
|
415
|
+
if (input.TechnicalDescription !== undefined) queryEntity.TechnicalDescription = input.TechnicalDescription;
|
|
416
|
+
if (input.OriginalSQL !== undefined) queryEntity.OriginalSQL = input.OriginalSQL;
|
|
417
|
+
if (input.Feedback !== undefined) queryEntity.Feedback = input.Feedback;
|
|
418
|
+
if (input.Status !== undefined) queryEntity.Status = input.Status;
|
|
419
|
+
if (input.QualityRank !== undefined) queryEntity.QualityRank = input.QualityRank;
|
|
420
|
+
if (input.ExecutionCostRank !== undefined) queryEntity.ExecutionCostRank = input.ExecutionCostRank;
|
|
421
|
+
if (input.UsesTemplate !== undefined) queryEntity.UsesTemplate = input.UsesTemplate;
|
|
422
|
+
|
|
423
|
+
// Save the updated query
|
|
424
|
+
const saveResult = await queryEntity.Save();
|
|
425
|
+
if (!saveResult) {
|
|
426
|
+
return {
|
|
427
|
+
Success: false,
|
|
428
|
+
ErrorMessage: `Failed to update query: ${queryEntity.LatestResult?.Message || 'Unknown error'}`
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const queryID = queryEntity.ID;
|
|
433
|
+
|
|
434
|
+
// Handle permissions update if provided
|
|
435
|
+
if (input.Permissions !== undefined) {
|
|
436
|
+
// Delete existing permissions
|
|
437
|
+
const rv = new RunView();
|
|
438
|
+
const existingPermissions = await rv.RunView<QueryPermissionEntity>({
|
|
439
|
+
EntityName: 'Query Permissions',
|
|
440
|
+
ExtraFilter: `QueryID='${queryID}'`,
|
|
441
|
+
ResultType: 'entity_object'
|
|
442
|
+
}, context.userPayload.userRecord);
|
|
443
|
+
|
|
444
|
+
if (existingPermissions.Success && existingPermissions.Results) {
|
|
445
|
+
for (const perm of existingPermissions.Results) {
|
|
446
|
+
await perm.Delete();
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Create new permissions
|
|
451
|
+
await this.createPermissions(input.Permissions, queryID, context.userPayload.userRecord);
|
|
452
|
+
|
|
453
|
+
// Refresh the metadata to get updated permissions
|
|
454
|
+
await queryEntity.RefreshRelatedMetadata(true);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Use the properties from QueryEntityExtended instead of manual loading
|
|
458
|
+
const fields: QueryFieldType[] = queryEntity.QueryFields.map(f => ({
|
|
459
|
+
ID: f.ID,
|
|
460
|
+
QueryID: f.QueryID,
|
|
461
|
+
Name: f.Name,
|
|
462
|
+
Description: f.Description || undefined,
|
|
463
|
+
Type: f.SQLBaseType || undefined,
|
|
464
|
+
Sequence: f.Sequence,
|
|
465
|
+
SQLBaseType: f.SQLBaseType || undefined,
|
|
466
|
+
SQLFullType: f.SQLFullType || undefined,
|
|
467
|
+
IsComputed: f.IsComputed,
|
|
468
|
+
ComputationEnabled: true, // Default to true as it's not in QueryFieldInfo
|
|
469
|
+
ComputationDescription: f.ComputationDescription || undefined
|
|
470
|
+
}));
|
|
471
|
+
|
|
472
|
+
const parameters: QueryParameterType[] = queryEntity.QueryParameters.map(p => ({
|
|
473
|
+
ID: p.ID,
|
|
474
|
+
QueryID: p.QueryID,
|
|
475
|
+
Name: p.Name,
|
|
476
|
+
Type: p.Type,
|
|
477
|
+
DefaultValue: p.DefaultValue || undefined,
|
|
478
|
+
Comments: '', // Not available in QueryParameterInfo
|
|
479
|
+
IsRequired: p.IsRequired
|
|
480
|
+
}));
|
|
481
|
+
|
|
482
|
+
const entities: QueryEntityType[] = queryEntity.QueryEntities.map(e => ({
|
|
483
|
+
ID: e.ID,
|
|
484
|
+
QueryID: e.QueryID,
|
|
485
|
+
EntityID: e.EntityID,
|
|
486
|
+
EntityName: e.Entity || undefined, // Property is called Entity, not EntityName
|
|
487
|
+
Sequence: e.Sequence || 0
|
|
488
|
+
}));
|
|
489
|
+
|
|
490
|
+
const permissions: QueryPermissionType[] = queryEntity.QueryPermissions.map(p => ({
|
|
491
|
+
ID: p.ID,
|
|
492
|
+
QueryID: p.QueryID,
|
|
493
|
+
RoleID: p.RoleID,
|
|
494
|
+
RoleName: p.Role || undefined // Property is called Role, not RoleName
|
|
495
|
+
}));
|
|
496
|
+
|
|
497
|
+
return {
|
|
498
|
+
Success: true,
|
|
499
|
+
QueryData: JSON.stringify(queryEntity.GetAll()),
|
|
500
|
+
Fields: fields,
|
|
501
|
+
Parameters: parameters,
|
|
502
|
+
Entities: entities,
|
|
503
|
+
Permissions: permissions
|
|
504
|
+
};
|
|
145
505
|
|
|
146
506
|
} catch (err) {
|
|
147
507
|
LogError(err);
|
|
148
508
|
return {
|
|
149
509
|
Success: false,
|
|
150
|
-
ErrorMessage: `QueryResolverExtended::
|
|
510
|
+
ErrorMessage: `QueryResolverExtended::UpdateQuerySystemUser --- Error updating query: ${err instanceof Error ? err.message : String(err)}`
|
|
151
511
|
};
|
|
152
512
|
}
|
|
153
513
|
}
|
|
@@ -217,7 +577,7 @@ export class QueryResolverExtended extends QueryResolver {
|
|
|
217
577
|
* @param contextUser - User context for operations
|
|
218
578
|
* @returns The ID of the final category in the path
|
|
219
579
|
*/
|
|
220
|
-
private async findOrCreateCategoryPath(categoryPath: string, md: Metadata, contextUser: UserInfo
|
|
580
|
+
private async findOrCreateCategoryPath(categoryPath: string, md: Metadata, contextUser: UserInfo): Promise<string> {
|
|
221
581
|
if (!categoryPath || categoryPath.trim() === '') {
|
|
222
582
|
throw new Error('CategoryPath cannot be empty');
|
|
223
583
|
}
|