@memberjunction/server 0.9.128 → 0.9.141
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.log.json +27 -0
- package/dist/apolloServer/TransactionPlugin.js +45 -45
- package/dist/apolloServer/TransactionPlugin.js.map +1 -1
- package/dist/apolloServer/index.js +26 -26
- package/dist/auth/exampleNewUserSubClass.js +53 -63
- package/dist/auth/exampleNewUserSubClass.js.map +1 -1
- package/dist/auth/index.js +110 -104
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/newUsers.js +65 -66
- package/dist/auth/newUsers.js.map +1 -1
- package/dist/cache.js +10 -10
- package/dist/config.js +62 -61
- package/dist/config.js.map +1 -1
- package/dist/context.js +101 -101
- package/dist/context.js.map +1 -1
- package/dist/directives/Public.js +33 -33
- package/dist/directives/Public.js.map +1 -1
- package/dist/directives/index.js +17 -17
- package/dist/entitySubclasses/userViewEntity.server.js +127 -127
- package/dist/entitySubclasses/userViewEntity.server.js.map +1 -1
- package/dist/generated/generated.js +20205 -19004
- package/dist/generated/generated.js.map +1 -1
- package/dist/generic/PushStatusResolver.js +58 -58
- package/dist/generic/PushStatusResolver.js.map +1 -1
- package/dist/generic/ResolverBase.js +231 -231
- package/dist/generic/ResolverBase.js.map +1 -1
- package/dist/generic/RunViewResolver.js +400 -400
- package/dist/generic/RunViewResolver.js.map +1 -1
- package/dist/index.js +131 -131
- package/dist/index.js.map +1 -1
- package/dist/orm.js +33 -33
- package/dist/orm.js.map +1 -1
- package/dist/resolvers/AskSkipResolver.js +246 -246
- package/dist/resolvers/AskSkipResolver.js.map +1 -1
- package/dist/resolvers/ColorResolver.js +93 -93
- package/dist/resolvers/ColorResolver.js.map +1 -1
- package/dist/resolvers/DatasetResolver.js +167 -167
- package/dist/resolvers/DatasetResolver.js.map +1 -1
- package/dist/resolvers/EntityRecordNameResolver.js +111 -111
- package/dist/resolvers/EntityRecordNameResolver.js.map +1 -1
- package/dist/resolvers/EntityResolver.js +59 -59
- package/dist/resolvers/EntityResolver.js.map +1 -1
- package/dist/resolvers/MergeRecordsResolver.js +282 -282
- package/dist/resolvers/MergeRecordsResolver.js.map +1 -1
- package/dist/resolvers/QueryResolver.js +74 -0
- package/dist/resolvers/QueryResolver.js.map +1 -0
- package/dist/resolvers/ReportResolver.js +73 -73
- package/dist/resolvers/ReportResolver.js.map +1 -1
- package/dist/resolvers/UserFavoriteResolver.js +161 -161
- package/dist/resolvers/UserFavoriteResolver.js.map +1 -1
- package/dist/resolvers/UserResolver.js +69 -69
- package/dist/resolvers/UserResolver.js.map +1 -1
- package/dist/resolvers/UserViewResolver.js +101 -101
- package/dist/resolvers/UserViewResolver.js.map +1 -1
- package/dist/types.js +2 -2
- package/package.json +11 -11
- package/src/apolloServer/TransactionPlugin.ts +1 -1
- package/src/auth/exampleNewUserSubClass.ts +3 -1
- package/src/auth/index.ts +13 -4
- package/src/config.ts +1 -0
- package/src/generated/generated.ts +921 -2
- package/src/resolvers/AskSkipResolver.ts +1 -1
- package/src/resolvers/QueryResolver.ts +42 -0
- package/src/resolvers/ReportResolver.ts +0 -15
- package/tsconfig.json +2 -2
|
@@ -1,401 +1,401 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RunViewResolver = exports.RunViewResult = exports.RunViewResultRow = exports.RunDynamicViewInput = exports.RunViewByNameInput = exports.RunViewByIDInput = void 0;
|
|
16
|
-
const type_graphql_1 = require("type-graphql");
|
|
17
|
-
const ResolverBase_1 = require("./ResolverBase");
|
|
18
|
-
let RunViewByIDInput = class RunViewByIDInput {
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
RunViewByIDInput
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
let RunViewByNameInput = class RunViewByNameInput {
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
RunViewByNameInput
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
let RunDynamicViewInput = class RunDynamicViewInput {
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
RunDynamicViewInput
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
let RunViewResultRow = class RunViewResultRow {
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
RunViewResultRow
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
let RunViewResult = class RunViewResult {
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
RunViewResult
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
let RunViewResolver = class RunViewResolver extends ResolverBase_1.ResolverBase {
|
|
300
|
-
async RunViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
301
|
-
try {
|
|
302
|
-
const rawData = await super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
303
|
-
if (rawData === null)
|
|
304
|
-
return null;
|
|
305
|
-
const entityId = await dataSource.query(`SELECT EntityID from [${this.MJCoreSchema}].vwUserViews WHERE Name='${input.ViewName}'`);
|
|
306
|
-
const returnData = this.processRawData(rawData.Results, entityId[0].EntityID);
|
|
307
|
-
return {
|
|
308
|
-
Results: returnData,
|
|
309
|
-
UserViewRunID: rawData?.UserViewRunID,
|
|
310
|
-
RowCount: rawData?.RowCount,
|
|
311
|
-
TotalRowCount: rawData?.TotalRowCount,
|
|
312
|
-
ExecutionTime: rawData?.ExecutionTime,
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
catch (err) {
|
|
316
|
-
console.log(err);
|
|
317
|
-
return null;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
async RunViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
321
|
-
try {
|
|
322
|
-
const rawData = await super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
323
|
-
if (rawData === null)
|
|
324
|
-
return null;
|
|
325
|
-
const entityId = await dataSource.query(`SELECT EntityID from [${this.MJCoreSchema}].vwUserViews WHERE ID=${input.ViewID}`);
|
|
326
|
-
const returnData = this.processRawData(rawData.Results, entityId[0].EntityID);
|
|
327
|
-
return {
|
|
328
|
-
Results: returnData,
|
|
329
|
-
UserViewRunID: rawData?.UserViewRunID,
|
|
330
|
-
RowCount: rawData?.RowCount,
|
|
331
|
-
TotalRowCount: rawData?.TotalRowCount,
|
|
332
|
-
ExecutionTime: rawData?.ExecutionTime,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
catch (err) {
|
|
336
|
-
console.log(err);
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
async RunDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
341
|
-
try {
|
|
342
|
-
const rawData = await super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
343
|
-
if (rawData === null)
|
|
344
|
-
return null;
|
|
345
|
-
const entityId = await dataSource.query(`SELECT ID from [${this.MJCoreSchema}].vwEntities WHERE Name='${input.EntityName}'`);
|
|
346
|
-
const returnData = this.processRawData(rawData.Results, entityId[0].EntityID);
|
|
347
|
-
return {
|
|
348
|
-
Results: returnData,
|
|
349
|
-
UserViewRunID: rawData?.UserViewRunID,
|
|
350
|
-
RowCount: rawData?.RowCount,
|
|
351
|
-
TotalRowCount: rawData?.TotalRowCount,
|
|
352
|
-
ExecutionTime: rawData?.ExecutionTime,
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
catch (err) {
|
|
356
|
-
console.log(err);
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
processRawData(rawData, entityId) {
|
|
361
|
-
const returnResult = [];
|
|
362
|
-
for (let i = 0; i < rawData.length; i++) {
|
|
363
|
-
const row = rawData[i];
|
|
364
|
-
returnResult.push({
|
|
365
|
-
ID: row.ID,
|
|
366
|
-
EntityID: entityId,
|
|
367
|
-
Data: JSON.stringify(row),
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
return returnResult;
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
__param(
|
|
377
|
-
|
|
378
|
-
__metadata("design:
|
|
379
|
-
__metadata("design:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
__param(
|
|
385
|
-
|
|
386
|
-
__metadata("design:
|
|
387
|
-
__metadata("design:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
__param(
|
|
393
|
-
|
|
394
|
-
__metadata("design:
|
|
395
|
-
__metadata("design:
|
|
396
|
-
|
|
397
|
-
RunViewResolver
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.RunViewResolver = exports.RunViewResult = exports.RunViewResultRow = exports.RunDynamicViewInput = exports.RunViewByNameInput = exports.RunViewByIDInput = void 0;
|
|
16
|
+
const type_graphql_1 = require("type-graphql");
|
|
17
|
+
const ResolverBase_1 = require("./ResolverBase");
|
|
18
|
+
let RunViewByIDInput = class RunViewByIDInput {
|
|
19
|
+
};
|
|
20
|
+
exports.RunViewByIDInput = RunViewByIDInput;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], RunViewByIDInput.prototype, "ViewID", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
27
|
+
nullable: true,
|
|
28
|
+
description: 'Optional, pass in a valid condition to append to the view WHERE clause. For example, UpdatedAt >= Some Date - if not provided, no filter is applied',
|
|
29
|
+
}),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], RunViewByIDInput.prototype, "ExtraFilter", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
34
|
+
nullable: true,
|
|
35
|
+
description: 'Optional, pass in a valid order by clause sort the results on the server. For example, CreatedAt DESC to order by row creation date in reverse order. Any Valid SQL Order By clause is okay - if not provided, no server-side sorting is applied',
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], RunViewByIDInput.prototype, "OrderBy", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, type_graphql_1.Field)(() => [String], {
|
|
41
|
+
nullable: true,
|
|
42
|
+
description: 'Optional, array of entity field names, if not provided, ID and all other columns used in the view columns are returned. If provided, only the fields in the array are returned.',
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], RunViewByIDInput.prototype, "Fields", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], RunViewByIDInput.prototype, "UserSearchString", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true, description: 'Pass in a UserViewRun ID value to exclude all records from that run from results' }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], RunViewByIDInput.prototype, "ExcludeUserViewRunID", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
56
|
+
nullable: true,
|
|
57
|
+
description: 'Pass in a valid condition to append to the view WHERE clause to override the Exclude List. For example, UpdatedAt >= Some Date',
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], RunViewByIDInput.prototype, "OverrideExcludeFilter", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
63
|
+
nullable: true,
|
|
64
|
+
description: 'If set to True, the results of this view are saved into a new UserViewRun record and the UserViewRun.ID is passed back in the results.',
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Boolean)
|
|
67
|
+
], RunViewByIDInput.prototype, "SaveViewResults", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
70
|
+
nullable: true,
|
|
71
|
+
description: 'if set to true, the resulting data will filter out ANY records that were ever returned by this view, when the SaveViewResults property was set to true. This is useful if you want to run a particular view over time and make sure the results returned each time are new to the view.',
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", Boolean)
|
|
74
|
+
], RunViewByIDInput.prototype, "ExcludeDataFromAllPriorViewRuns", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
77
|
+
nullable: true,
|
|
78
|
+
description: 'if set to true, if there IS any UserViewMaxRows property set for the entity in question, it will be IGNORED. This is useful in scenarios where you want to programmatically run a view and get ALL the data back, regardless of the MaxRows setting on the entity.',
|
|
79
|
+
}),
|
|
80
|
+
__metadata("design:type", Boolean)
|
|
81
|
+
], RunViewByIDInput.prototype, "IgnoreMaxRows", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
84
|
+
nullable: true,
|
|
85
|
+
description: 'If set to true, an Audit Log record will be created for the view run, regardless of the property settings in the entity for auditing view runs',
|
|
86
|
+
}),
|
|
87
|
+
__metadata("design:type", Boolean)
|
|
88
|
+
], RunViewByIDInput.prototype, "ForceAuditLog", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
91
|
+
nullable: true,
|
|
92
|
+
description: "if provided and either ForceAuditLog is set, or the entity's property settings for logging view runs are set to true, this will be used as the Audit Log Description.",
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], RunViewByIDInput.prototype, "AuditLogDescription", void 0);
|
|
96
|
+
exports.RunViewByIDInput = RunViewByIDInput = __decorate([
|
|
97
|
+
(0, type_graphql_1.InputType)()
|
|
98
|
+
], RunViewByIDInput);
|
|
99
|
+
let RunViewByNameInput = class RunViewByNameInput {
|
|
100
|
+
};
|
|
101
|
+
exports.RunViewByNameInput = RunViewByNameInput;
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, type_graphql_1.Field)(() => String),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], RunViewByNameInput.prototype, "ViewName", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
108
|
+
nullable: true,
|
|
109
|
+
description: 'Optional, pass in a valid condition to append to the view WHERE clause. For example, UpdatedAt >= Some Date - if not provided, no filter is applied',
|
|
110
|
+
}),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], RunViewByNameInput.prototype, "ExtraFilter", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
115
|
+
nullable: true,
|
|
116
|
+
description: 'Optional, pass in a valid order by clause sort the results on the server. For example, CreatedAt DESC to order by row creation date in reverse order. Any Valid SQL Order By clause is okay - if not provided, no server-side sorting is applied',
|
|
117
|
+
}),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], RunViewByNameInput.prototype, "OrderBy", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, type_graphql_1.Field)(() => [String], {
|
|
122
|
+
nullable: true,
|
|
123
|
+
description: 'Optional, array of entity field names, if not provided, ID and all other columns used in the view are returned. If provided, only the fields in the array are returned.',
|
|
124
|
+
}),
|
|
125
|
+
__metadata("design:type", Array)
|
|
126
|
+
], RunViewByNameInput.prototype, "Fields", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true }),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], RunViewByNameInput.prototype, "UserSearchString", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true, description: 'Pass in a UserViewRun ID value to exclude all records from that run from results' }),
|
|
133
|
+
__metadata("design:type", Number)
|
|
134
|
+
], RunViewByNameInput.prototype, "ExcludeUserViewRunID", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
137
|
+
nullable: true,
|
|
138
|
+
description: 'Pass in a valid condition to append to the view WHERE clause to override the Exclude List. For example, UpdatedAt >= Some Date',
|
|
139
|
+
}),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], RunViewByNameInput.prototype, "OverrideExcludeFilter", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
144
|
+
nullable: true,
|
|
145
|
+
description: 'If set to True, the results of this view are saved into a new UserViewRun record and the UserViewRun.ID is passed back in the results.',
|
|
146
|
+
}),
|
|
147
|
+
__metadata("design:type", Boolean)
|
|
148
|
+
], RunViewByNameInput.prototype, "SaveViewResults", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
151
|
+
nullable: true,
|
|
152
|
+
description: 'if set to true, the resulting data will filter out ANY records that were ever returned by this view, when the SaveViewResults property was set to true. This is useful if you want to run a particular view over time and make sure the results returned each time are new to the view.',
|
|
153
|
+
}),
|
|
154
|
+
__metadata("design:type", Boolean)
|
|
155
|
+
], RunViewByNameInput.prototype, "ExcludeDataFromAllPriorViewRuns", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
158
|
+
nullable: true,
|
|
159
|
+
description: 'if set to true, if there IS any UserViewMaxRows property set for the entity in question, it will be IGNORED. This is useful in scenarios where you want to programmatically run a view and get ALL the data back, regardless of the MaxRows setting on the entity.',
|
|
160
|
+
}),
|
|
161
|
+
__metadata("design:type", Boolean)
|
|
162
|
+
], RunViewByNameInput.prototype, "IgnoreMaxRows", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
165
|
+
nullable: true,
|
|
166
|
+
description: 'If set to true, an Audit Log record will be created for the view run, regardless of the property settings in the entity for auditing view runs',
|
|
167
|
+
}),
|
|
168
|
+
__metadata("design:type", Boolean)
|
|
169
|
+
], RunViewByNameInput.prototype, "ForceAuditLog", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
172
|
+
nullable: true,
|
|
173
|
+
description: "if provided and either ForceAuditLog is set, or the entity's property settings for logging view runs are set to true, this will be used as the Audit Log Description.",
|
|
174
|
+
}),
|
|
175
|
+
__metadata("design:type", String)
|
|
176
|
+
], RunViewByNameInput.prototype, "AuditLogDescription", void 0);
|
|
177
|
+
exports.RunViewByNameInput = RunViewByNameInput = __decorate([
|
|
178
|
+
(0, type_graphql_1.InputType)()
|
|
179
|
+
], RunViewByNameInput);
|
|
180
|
+
let RunDynamicViewInput = class RunDynamicViewInput {
|
|
181
|
+
};
|
|
182
|
+
exports.RunDynamicViewInput = RunDynamicViewInput;
|
|
183
|
+
__decorate([
|
|
184
|
+
(0, type_graphql_1.Field)(() => String),
|
|
185
|
+
__metadata("design:type", String)
|
|
186
|
+
], RunDynamicViewInput.prototype, "EntityName", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
189
|
+
nullable: true,
|
|
190
|
+
description: 'Optional, pass in a valid condition to use as the view WHERE clause. For example, UpdatedAt >= Some Date - if not provided, no filter is applied',
|
|
191
|
+
}),
|
|
192
|
+
__metadata("design:type", String)
|
|
193
|
+
], RunDynamicViewInput.prototype, "ExtraFilter", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
196
|
+
nullable: true,
|
|
197
|
+
description: 'Optional, pass in a valid order by clause sort the results on the server. For example, CreatedAt DESC to order by row creation date in reverse order. Any Valid SQL Order By clause is okay - if not provided, no server-side sorting is applied',
|
|
198
|
+
}),
|
|
199
|
+
__metadata("design:type", String)
|
|
200
|
+
], RunDynamicViewInput.prototype, "OrderBy", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
(0, type_graphql_1.Field)(() => [String], {
|
|
203
|
+
nullable: true,
|
|
204
|
+
description: 'Optional, array of entity field names, if not provided, all columns are returned. If provided, only the fields in the array are returned.',
|
|
205
|
+
}),
|
|
206
|
+
__metadata("design:type", Array)
|
|
207
|
+
], RunDynamicViewInput.prototype, "Fields", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true }),
|
|
210
|
+
__metadata("design:type", String)
|
|
211
|
+
], RunDynamicViewInput.prototype, "UserSearchString", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true, description: 'Pass in a UserViewRun ID value to exclude all records from that run from results' }),
|
|
214
|
+
__metadata("design:type", Number)
|
|
215
|
+
], RunDynamicViewInput.prototype, "ExcludeUserViewRunID", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
218
|
+
nullable: true,
|
|
219
|
+
description: 'Pass in a valid condition to append to the view WHERE clause to override the Exclude List. For example, UpdatedAt >= Some Date',
|
|
220
|
+
}),
|
|
221
|
+
__metadata("design:type", String)
|
|
222
|
+
], RunDynamicViewInput.prototype, "OverrideExcludeFilter", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
225
|
+
nullable: true,
|
|
226
|
+
description: 'if set to true, if there IS any UserViewMaxRows property set for the entity in question, it will be IGNORED. This is useful in scenarios where you want to programmatically run a view and get ALL the data back, regardless of the MaxRows setting on the entity.',
|
|
227
|
+
}),
|
|
228
|
+
__metadata("design:type", Boolean)
|
|
229
|
+
], RunDynamicViewInput.prototype, "IgnoreMaxRows", void 0);
|
|
230
|
+
__decorate([
|
|
231
|
+
(0, type_graphql_1.Field)(() => Boolean, {
|
|
232
|
+
nullable: true,
|
|
233
|
+
description: 'If set to true, an Audit Log record will be created for the view run, regardless of the property settings in the entity for auditing view runs',
|
|
234
|
+
}),
|
|
235
|
+
__metadata("design:type", Boolean)
|
|
236
|
+
], RunDynamicViewInput.prototype, "ForceAuditLog", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, type_graphql_1.Field)(() => String, {
|
|
239
|
+
nullable: true,
|
|
240
|
+
description: "if provided and either ForceAuditLog is set, or the entity's property settings for logging view runs are set to true, this will be used as the Audit Log Description.",
|
|
241
|
+
}),
|
|
242
|
+
__metadata("design:type", String)
|
|
243
|
+
], RunDynamicViewInput.prototype, "AuditLogDescription", void 0);
|
|
244
|
+
exports.RunDynamicViewInput = RunDynamicViewInput = __decorate([
|
|
245
|
+
(0, type_graphql_1.InputType)()
|
|
246
|
+
], RunDynamicViewInput);
|
|
247
|
+
let RunViewResultRow = class RunViewResultRow {
|
|
248
|
+
};
|
|
249
|
+
exports.RunViewResultRow = RunViewResultRow;
|
|
250
|
+
__decorate([
|
|
251
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int),
|
|
252
|
+
__metadata("design:type", Number)
|
|
253
|
+
], RunViewResultRow.prototype, "ID", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int),
|
|
256
|
+
__metadata("design:type", Number)
|
|
257
|
+
], RunViewResultRow.prototype, "EntityID", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
(0, type_graphql_1.Field)(() => String),
|
|
260
|
+
__metadata("design:type", String)
|
|
261
|
+
], RunViewResultRow.prototype, "Data", void 0);
|
|
262
|
+
exports.RunViewResultRow = RunViewResultRow = __decorate([
|
|
263
|
+
(0, type_graphql_1.ObjectType)()
|
|
264
|
+
], RunViewResultRow);
|
|
265
|
+
let RunViewResult = class RunViewResult {
|
|
266
|
+
};
|
|
267
|
+
exports.RunViewResult = RunViewResult;
|
|
268
|
+
__decorate([
|
|
269
|
+
(0, type_graphql_1.Field)(() => [RunViewResultRow]),
|
|
270
|
+
__metadata("design:type", Array)
|
|
271
|
+
], RunViewResult.prototype, "Results", void 0);
|
|
272
|
+
__decorate([
|
|
273
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true }),
|
|
274
|
+
__metadata("design:type", Number)
|
|
275
|
+
], RunViewResult.prototype, "UserViewRunID", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true }),
|
|
278
|
+
__metadata("design:type", Number)
|
|
279
|
+
], RunViewResult.prototype, "RowCount", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true }),
|
|
282
|
+
__metadata("design:type", Number)
|
|
283
|
+
], RunViewResult.prototype, "TotalRowCount", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
(0, type_graphql_1.Field)(() => type_graphql_1.Int, { nullable: true }),
|
|
286
|
+
__metadata("design:type", Number)
|
|
287
|
+
], RunViewResult.prototype, "ExecutionTime", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
(0, type_graphql_1.Field)(() => String, { nullable: true }),
|
|
290
|
+
__metadata("design:type", String)
|
|
291
|
+
], RunViewResult.prototype, "ErrorMessage", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
(0, type_graphql_1.Field)(() => Boolean, { nullable: false }),
|
|
294
|
+
__metadata("design:type", Boolean)
|
|
295
|
+
], RunViewResult.prototype, "Success", void 0);
|
|
296
|
+
exports.RunViewResult = RunViewResult = __decorate([
|
|
297
|
+
(0, type_graphql_1.ObjectType)()
|
|
298
|
+
], RunViewResult);
|
|
299
|
+
let RunViewResolver = class RunViewResolver extends ResolverBase_1.ResolverBase {
|
|
300
|
+
async RunViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
301
|
+
try {
|
|
302
|
+
const rawData = await super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
303
|
+
if (rawData === null)
|
|
304
|
+
return null;
|
|
305
|
+
const entityId = await dataSource.query(`SELECT EntityID from [${this.MJCoreSchema}].vwUserViews WHERE Name='${input.ViewName}'`);
|
|
306
|
+
const returnData = this.processRawData(rawData.Results, entityId[0].EntityID);
|
|
307
|
+
return {
|
|
308
|
+
Results: returnData,
|
|
309
|
+
UserViewRunID: rawData?.UserViewRunID,
|
|
310
|
+
RowCount: rawData?.RowCount,
|
|
311
|
+
TotalRowCount: rawData?.TotalRowCount,
|
|
312
|
+
ExecutionTime: rawData?.ExecutionTime,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
catch (err) {
|
|
316
|
+
console.log(err);
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
async RunViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
321
|
+
try {
|
|
322
|
+
const rawData = await super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
323
|
+
if (rawData === null)
|
|
324
|
+
return null;
|
|
325
|
+
const entityId = await dataSource.query(`SELECT EntityID from [${this.MJCoreSchema}].vwUserViews WHERE ID=${input.ViewID}`);
|
|
326
|
+
const returnData = this.processRawData(rawData.Results, entityId[0].EntityID);
|
|
327
|
+
return {
|
|
328
|
+
Results: returnData,
|
|
329
|
+
UserViewRunID: rawData?.UserViewRunID,
|
|
330
|
+
RowCount: rawData?.RowCount,
|
|
331
|
+
TotalRowCount: rawData?.TotalRowCount,
|
|
332
|
+
ExecutionTime: rawData?.ExecutionTime,
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
catch (err) {
|
|
336
|
+
console.log(err);
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
async RunDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
341
|
+
try {
|
|
342
|
+
const rawData = await super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
343
|
+
if (rawData === null)
|
|
344
|
+
return null;
|
|
345
|
+
const entityId = await dataSource.query(`SELECT ID from [${this.MJCoreSchema}].vwEntities WHERE Name='${input.EntityName}'`);
|
|
346
|
+
const returnData = this.processRawData(rawData.Results, entityId[0].EntityID);
|
|
347
|
+
return {
|
|
348
|
+
Results: returnData,
|
|
349
|
+
UserViewRunID: rawData?.UserViewRunID,
|
|
350
|
+
RowCount: rawData?.RowCount,
|
|
351
|
+
TotalRowCount: rawData?.TotalRowCount,
|
|
352
|
+
ExecutionTime: rawData?.ExecutionTime,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
catch (err) {
|
|
356
|
+
console.log(err);
|
|
357
|
+
return null;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
processRawData(rawData, entityId) {
|
|
361
|
+
const returnResult = [];
|
|
362
|
+
for (let i = 0; i < rawData.length; i++) {
|
|
363
|
+
const row = rawData[i];
|
|
364
|
+
returnResult.push({
|
|
365
|
+
ID: row.ID,
|
|
366
|
+
EntityID: entityId,
|
|
367
|
+
Data: JSON.stringify(row),
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
return returnResult;
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
exports.RunViewResolver = RunViewResolver;
|
|
374
|
+
__decorate([
|
|
375
|
+
(0, type_graphql_1.Query)(() => RunViewResult),
|
|
376
|
+
__param(0, (0, type_graphql_1.Arg)('input', () => RunViewByNameInput)),
|
|
377
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
378
|
+
__metadata("design:type", Function),
|
|
379
|
+
__metadata("design:paramtypes", [RunViewByNameInput, Object, type_graphql_1.PubSubEngine]),
|
|
380
|
+
__metadata("design:returntype", Promise)
|
|
381
|
+
], RunViewResolver.prototype, "RunViewByName", null);
|
|
382
|
+
__decorate([
|
|
383
|
+
(0, type_graphql_1.Query)(() => RunViewResult),
|
|
384
|
+
__param(0, (0, type_graphql_1.Arg)('input', () => RunViewByIDInput)),
|
|
385
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
386
|
+
__metadata("design:type", Function),
|
|
387
|
+
__metadata("design:paramtypes", [RunViewByIDInput, Object, type_graphql_1.PubSubEngine]),
|
|
388
|
+
__metadata("design:returntype", Promise)
|
|
389
|
+
], RunViewResolver.prototype, "RunViewByID", null);
|
|
390
|
+
__decorate([
|
|
391
|
+
(0, type_graphql_1.Query)(() => RunViewResult),
|
|
392
|
+
__param(0, (0, type_graphql_1.Arg)('input', () => RunDynamicViewInput)),
|
|
393
|
+
__param(1, (0, type_graphql_1.Ctx)()),
|
|
394
|
+
__metadata("design:type", Function),
|
|
395
|
+
__metadata("design:paramtypes", [RunDynamicViewInput, Object, type_graphql_1.PubSubEngine]),
|
|
396
|
+
__metadata("design:returntype", Promise)
|
|
397
|
+
], RunViewResolver.prototype, "RunDynamicView", null);
|
|
398
|
+
exports.RunViewResolver = RunViewResolver = __decorate([
|
|
399
|
+
(0, type_graphql_1.Resolver)(RunViewResultRow)
|
|
400
|
+
], RunViewResolver);
|
|
401
401
|
//# sourceMappingURL=RunViewResolver.js.map
|