@snowtop/ent 0.1.0-alpha86 → 0.1.0-alpha89
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/action/action.d.ts +1 -1
- package/action/orchestrator.js +15 -11
- package/core/base.d.ts +1 -1
- package/core/clause.d.ts +3 -0
- package/core/clause.js +34 -12
- package/core/ent.d.ts +3 -0
- package/core/ent.js +27 -6
- package/index.d.ts +2 -1
- package/index.js +4 -2
- package/package.json +1 -1
- package/schema/schema.d.ts +3 -1
package/action/action.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export interface Observer<TEnt extends Ent<TViewer>, TBuilder extends Builder<TE
|
|
|
46
46
|
observe(builder: TBuilder, input: TInput): void | Promise<void>;
|
|
47
47
|
}
|
|
48
48
|
export interface Validator<TEnt extends Ent<TViewer>, TBuilder extends Builder<TEnt, TViewer, TExistingEnt>, TViewer extends Viewer = Viewer, TInput extends Data = Data, TExistingEnt extends TMaybleNullableEnt<TEnt> = MaybeNull<TEnt>> {
|
|
49
|
-
validate(builder: TBuilder, input: TInput): Promise<void> | void;
|
|
49
|
+
validate(builder: TBuilder, input: TInput): Promise<void | undefined | Error> | void | Error | undefined;
|
|
50
50
|
}
|
|
51
51
|
export interface Action<TEnt extends Ent<TViewer>, TBuilder extends Builder<TEnt, TViewer, TExistingEnt>, TViewer extends Viewer = Viewer, TInput extends Data = Data, TExistingEnt extends TMaybleNullableEnt<TEnt> = MaybeNull<TEnt>> {
|
|
52
52
|
readonly viewer: Viewer;
|
package/action/orchestrator.js
CHANGED
|
@@ -368,13 +368,14 @@ class Orchestrator {
|
|
|
368
368
|
// not ideal we're calling this twice. fix...
|
|
369
369
|
// needed for now. may need to rewrite some of this?
|
|
370
370
|
const editedFields2 = await this.options.editedFields();
|
|
371
|
-
const [errors,
|
|
371
|
+
const [errors, errs2] = await Promise.all([
|
|
372
372
|
this.formatAndValidateFields(schemaFields, editedFields2),
|
|
373
373
|
this.validators(validators, action, builder),
|
|
374
374
|
]);
|
|
375
375
|
if (privacyError !== null) {
|
|
376
376
|
errors.unshift(privacyError);
|
|
377
377
|
}
|
|
378
|
+
errors.push(...errs2);
|
|
378
379
|
return errors;
|
|
379
380
|
}
|
|
380
381
|
async triggers(action, builder, triggers) {
|
|
@@ -420,16 +421,19 @@ class Orchestrator {
|
|
|
420
421
|
}
|
|
421
422
|
}
|
|
422
423
|
async validators(validators, action, builder) {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
|
|
424
|
+
const errors = [];
|
|
425
|
+
await Promise.all(validators.map(async (v) => {
|
|
426
|
+
try {
|
|
427
|
+
const r = await v.validate(builder, action.getInput());
|
|
428
|
+
if (r instanceof Error) {
|
|
429
|
+
errors.push(r);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
catch (err) {
|
|
433
|
+
errors.push(err);
|
|
434
|
+
}
|
|
435
|
+
}));
|
|
436
|
+
return errors;
|
|
433
437
|
}
|
|
434
438
|
isBuilder(val) {
|
|
435
439
|
return val.placeholderID !== undefined;
|
package/core/base.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ interface LoadableEntOptions<TEnt extends Ent, TViewer extends Viewer = Viewer>
|
|
|
97
97
|
loaderFactory: LoaderFactoryWithOptions;
|
|
98
98
|
ent: EntConstructor<TEnt, TViewer>;
|
|
99
99
|
}
|
|
100
|
-
interface LoaderFactoryWithOptions extends LoaderFactoryWithLoaderMany<any, Data | null> {
|
|
100
|
+
export interface LoaderFactoryWithOptions extends LoaderFactoryWithLoaderMany<any, Data | null> {
|
|
101
101
|
options?: SelectDataOptions;
|
|
102
102
|
}
|
|
103
103
|
export interface LoadEntOptions<TEnt extends Ent, TViewer extends Viewer = Viewer> extends LoadableEntOptions<TEnt, TViewer>, SelectBaseDataOptions {
|
package/core/clause.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface Clause {
|
|
|
4
4
|
values(): any[];
|
|
5
5
|
instanceKey(): string;
|
|
6
6
|
logValues(): any[];
|
|
7
|
+
compositeOp?: string;
|
|
7
8
|
}
|
|
8
9
|
export interface SensitiveValue {
|
|
9
10
|
value(): any;
|
|
@@ -37,6 +38,7 @@ export declare class inClause implements Clause {
|
|
|
37
38
|
declare class compositeClause implements Clause {
|
|
38
39
|
private clauses;
|
|
39
40
|
private sep;
|
|
41
|
+
compositeOp: string;
|
|
40
42
|
constructor(clauses: Clause[], sep: string);
|
|
41
43
|
clause(idx: number): string;
|
|
42
44
|
columns(): string[];
|
|
@@ -97,6 +99,7 @@ export declare function LessEq(col: string, value: any): simpleClause;
|
|
|
97
99
|
export declare function And(...args: Clause[]): compositeClause;
|
|
98
100
|
export declare function AndOptional(...args: (Clause | undefined)[]): Clause;
|
|
99
101
|
export declare function Or(...args: Clause[]): compositeClause;
|
|
102
|
+
export declare function OrOptional(...args: (Clause | undefined)[]): Clause;
|
|
100
103
|
export declare function In(col: string, ...values: any): Clause;
|
|
101
104
|
export declare function In(col: string, values: any[], type?: string): Clause;
|
|
102
105
|
interface TsQuery {
|
package/core/clause.js
CHANGED
|
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.JSONPathValuePredicate = exports.JSONObjectFieldKeyAsText = exports.JSONObjectFieldKeyASJSON = exports.sensitiveValue = exports.TsVectorWebsearchToTsQuery = exports.TsVectorPhraseToTsQuery = exports.TsVectorPlainToTsQuery = exports.TsVectorColTsQuery = exports.WebsearchToTsQuery = exports.PhraseToTsQuery = exports.PlainToTsQuery = exports.TsQuery = exports.In = exports.Or = exports.AndOptional = exports.And = exports.LessEq = exports.GreaterEq = exports.Less = exports.Greater = exports.NotEq = exports.Eq = exports.ArrayNotEq = exports.ArrayEq = exports.PostgresArrayNotOverlaps = exports.PostgresArrayOverlaps = exports.PostgresArrayNotContains = exports.PostgresArrayNotContainsValue = exports.PostgresArrayContains = exports.PostgresArrayContainsValue = exports.inClause = void 0;
|
|
22
|
+
exports.JSONPathValuePredicate = exports.JSONObjectFieldKeyAsText = exports.JSONObjectFieldKeyASJSON = exports.sensitiveValue = exports.TsVectorWebsearchToTsQuery = exports.TsVectorPhraseToTsQuery = exports.TsVectorPlainToTsQuery = exports.TsVectorColTsQuery = exports.WebsearchToTsQuery = exports.PhraseToTsQuery = exports.PlainToTsQuery = exports.TsQuery = exports.In = exports.OrOptional = exports.Or = exports.AndOptional = exports.And = exports.LessEq = exports.GreaterEq = exports.Less = exports.Greater = exports.NotEq = exports.Eq = exports.ArrayNotEq = exports.ArrayEq = exports.PostgresArrayNotOverlaps = exports.PostgresArrayOverlaps = exports.PostgresArrayNotContains = exports.PostgresArrayNotContainsValue = exports.PostgresArrayContains = exports.PostgresArrayContainsValue = exports.inClause = void 0;
|
|
23
23
|
const db_1 = __importStar(require("./db"));
|
|
24
24
|
function isSensitive(val) {
|
|
25
25
|
return (val !== null &&
|
|
@@ -59,9 +59,9 @@ class simpleClause {
|
|
|
59
59
|
return [this.col];
|
|
60
60
|
}
|
|
61
61
|
values() {
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
return
|
|
62
|
+
const nullClause = this.nullClause();
|
|
63
|
+
if (nullClause) {
|
|
64
|
+
return nullClause.values();
|
|
65
65
|
}
|
|
66
66
|
if (isSensitive(this.value)) {
|
|
67
67
|
return [this.value.value()];
|
|
@@ -69,9 +69,9 @@ class simpleClause {
|
|
|
69
69
|
return [this.value];
|
|
70
70
|
}
|
|
71
71
|
logValues() {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
return
|
|
72
|
+
const nullClause = this.nullClause();
|
|
73
|
+
if (nullClause) {
|
|
74
|
+
return nullClause.logValues();
|
|
75
75
|
}
|
|
76
76
|
if (isSensitive(this.value)) {
|
|
77
77
|
return [this.value.logValue()];
|
|
@@ -79,9 +79,9 @@ class simpleClause {
|
|
|
79
79
|
return [this.value];
|
|
80
80
|
}
|
|
81
81
|
instanceKey() {
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
82
|
+
const nullClause = this.nullClause();
|
|
83
|
+
if (nullClause) {
|
|
84
|
+
return nullClause.instanceKey();
|
|
85
85
|
}
|
|
86
86
|
return `${this.col}${this.op}${rawValue(this.value)}`;
|
|
87
87
|
}
|
|
@@ -300,11 +300,17 @@ class compositeClause {
|
|
|
300
300
|
constructor(clauses, sep) {
|
|
301
301
|
this.clauses = clauses;
|
|
302
302
|
this.sep = sep;
|
|
303
|
+
this.compositeOp = this.sep;
|
|
303
304
|
}
|
|
304
305
|
clause(idx) {
|
|
305
306
|
let clauses = [];
|
|
306
307
|
for (const clause of this.clauses) {
|
|
307
|
-
|
|
308
|
+
let cls = clause.clause(idx);
|
|
309
|
+
// if composite clause and a different op, add parens so that we enforce order of precedence
|
|
310
|
+
if (clause.compositeOp && clause.compositeOp !== this.sep) {
|
|
311
|
+
cls = `(${cls})`;
|
|
312
|
+
}
|
|
313
|
+
clauses.push(cls);
|
|
308
314
|
idx = idx + clause.values().length;
|
|
309
315
|
}
|
|
310
316
|
return clauses.join(this.sep);
|
|
@@ -332,7 +338,14 @@ class compositeClause {
|
|
|
332
338
|
}
|
|
333
339
|
instanceKey() {
|
|
334
340
|
let keys = [];
|
|
335
|
-
this.clauses.forEach((clause) =>
|
|
341
|
+
this.clauses.forEach((clause) => {
|
|
342
|
+
if (clause.compositeOp && clause.compositeOp != this.sep) {
|
|
343
|
+
keys.push(`(${clause.instanceKey()})`);
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
keys.push(clause.instanceKey());
|
|
347
|
+
}
|
|
348
|
+
});
|
|
336
349
|
return keys.join(this.sep);
|
|
337
350
|
}
|
|
338
351
|
}
|
|
@@ -513,6 +526,15 @@ function Or(...args) {
|
|
|
513
526
|
return new compositeClause(args, " OR ");
|
|
514
527
|
}
|
|
515
528
|
exports.Or = Or;
|
|
529
|
+
function OrOptional(...args) {
|
|
530
|
+
// @ts-ignore
|
|
531
|
+
let filtered = args.filter((v) => v !== undefined);
|
|
532
|
+
if (filtered.length === 1) {
|
|
533
|
+
return filtered[0];
|
|
534
|
+
}
|
|
535
|
+
return Or(...filtered);
|
|
536
|
+
}
|
|
537
|
+
exports.OrOptional = OrOptional;
|
|
516
538
|
function In(...args) {
|
|
517
539
|
if (args.length < 2) {
|
|
518
540
|
throw new Error(`invalid args passed to In`);
|
package/core/ent.d.ts
CHANGED
|
@@ -56,6 +56,9 @@ export declare type CustomQuery = string | parameterizedQueryOptions | clause.Cl
|
|
|
56
56
|
* }) // doesn't change the query
|
|
57
57
|
*/
|
|
58
58
|
export declare function loadCustomData(options: SelectCustomDataOptions, query: CustomQuery, context: Context | undefined): Promise<Data[]>;
|
|
59
|
+
interface CustomCountOptions extends DataOptions {
|
|
60
|
+
}
|
|
61
|
+
export declare function loadCustomCount(options: CustomCountOptions, query: CustomQuery, context: Context | undefined): Promise<number>;
|
|
59
62
|
export declare function loadDerivedEnt<TEnt extends Ent<TViewer>, TViewer extends Viewer>(viewer: TViewer, data: Data, loader: new (viewer: TViewer, data: Data) => TEnt): Promise<TEnt | null>;
|
|
60
63
|
export declare function loadDerivedEntX<TEnt extends Ent<TViewer>, TViewer extends Viewer>(viewer: TViewer, data: Data, loader: new (viewer: TViewer, data: Data) => TEnt): Promise<TEnt>;
|
|
61
64
|
export declare function loadRowX(options: LoadRowOptions): Promise<Data>;
|
package/core/ent.js
CHANGED
|
@@ -22,8 +22,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
26
|
-
exports.getEdgeTypeInGroup = exports.applyPrivacyPolicyForRows = exports.applyPrivacyPolicyForRow = exports.loadNodesByEdge = void 0;
|
|
25
|
+
exports.loadRawEdgeCountX = exports.loadUniqueNode = exports.loadUniqueEdge = exports.loadCustomEdges = exports.getEdgeClauseAndFields = exports.loadEdges = exports.defaultEdgeQueryOptions = exports.DefaultLimit = exports.loadEdgeDatas = exports.loadEdgeData = exports.assocEdgeLoader = exports.AssocEdgeData = exports.getCursor = exports.AssocEdge = exports.DeleteNodeOperation = exports.deleteRowsSync = exports.deleteRows = exports.editRowSync = exports.editRow = exports.buildUpdateQuery = exports.createRowSync = exports.createRow = exports.buildInsertQuery = exports.EdgeOperation = exports.__hasGlobalSchema = exports.clearGlobalSchema = exports.setGlobalSchema = exports.EditNodeOperation = exports.RawQueryOperation = exports.buildGroupQuery = exports.buildQuery = exports.loadRows = exports.performRawQuery = exports.loadRow = exports.loadRowX = exports.loadDerivedEntX = exports.loadDerivedEnt = exports.loadCustomCount = exports.loadCustomData = exports.loadCustomEnts = exports.loadEntsFromClause = exports.loadEntsList = exports.loadEnts = exports.loadEntXFromClause = exports.loadEntFromClause = exports.loadEntXViaKey = exports.loadEntX = exports.loadEntViaKey = exports.loadEnt = exports.getEntKey = void 0;
|
|
26
|
+
exports.getEdgeTypeInGroup = exports.applyPrivacyPolicyForRows = exports.applyPrivacyPolicyForRow = exports.loadNodesByEdge = exports.loadEdgeForID2 = void 0;
|
|
27
27
|
const db_1 = __importStar(require("./db"));
|
|
28
28
|
const privacy_1 = require("./privacy");
|
|
29
29
|
const clause = __importStar(require("./clause"));
|
|
@@ -196,6 +196,11 @@ function getEntKey(viewer, id, options) {
|
|
|
196
196
|
}
|
|
197
197
|
exports.getEntKey = getEntKey;
|
|
198
198
|
async function loadEnt(viewer, id, options) {
|
|
199
|
+
if (typeof id !== "string" &&
|
|
200
|
+
typeof id !== "number" &&
|
|
201
|
+
typeof id !== "bigint") {
|
|
202
|
+
throw new Error(`invalid id ${id} passed to loadEnt`);
|
|
203
|
+
}
|
|
199
204
|
const r = await getEntLoader(viewer, options).load(id);
|
|
200
205
|
return r instanceof ErrorWrapper ? null : r;
|
|
201
206
|
}
|
|
@@ -239,6 +244,11 @@ async function loadEntViaKey(viewer, key, options) {
|
|
|
239
244
|
}
|
|
240
245
|
exports.loadEntViaKey = loadEntViaKey;
|
|
241
246
|
async function loadEntX(viewer, id, options) {
|
|
247
|
+
if (typeof id !== "string" &&
|
|
248
|
+
typeof id !== "number" &&
|
|
249
|
+
typeof id !== "bigint") {
|
|
250
|
+
throw new Error(`invalid id ${id} passed to loadEntX`);
|
|
251
|
+
}
|
|
242
252
|
const r = await getEntLoader(viewer, options).load(id);
|
|
243
253
|
if (r instanceof ErrorWrapper) {
|
|
244
254
|
throw r.error;
|
|
@@ -254,10 +264,7 @@ async function loadEntXViaKey(viewer, key, options) {
|
|
|
254
264
|
// todo make this better
|
|
255
265
|
throw new Error(`${options.loaderFactory.name}: couldn't find row for value ${key}`);
|
|
256
266
|
}
|
|
257
|
-
|
|
258
|
-
// TODO every row.id needs to be audited...
|
|
259
|
-
// https://github.com/lolopinto/ent/issues/1064
|
|
260
|
-
const r = await getEntLoader(viewer, options).load(row.id);
|
|
267
|
+
const r = await applyPrivacyPolicyForRowAndStoreInEntLoader(viewer, row, options);
|
|
261
268
|
if (r instanceof ErrorWrapper) {
|
|
262
269
|
throw r.error;
|
|
263
270
|
}
|
|
@@ -407,6 +414,20 @@ async function loadCustomData(options, query, context) {
|
|
|
407
414
|
return rows;
|
|
408
415
|
}
|
|
409
416
|
exports.loadCustomData = loadCustomData;
|
|
417
|
+
// NOTE: if you use a raw query or paramterized query with this,
|
|
418
|
+
// you should use `SELECT count(*) as count...`
|
|
419
|
+
async function loadCustomCount(options, query, context) {
|
|
420
|
+
// TODO also need to loaderify this in case we're querying for this a lot...
|
|
421
|
+
const rows = await loadCustomDataImpl({
|
|
422
|
+
...options,
|
|
423
|
+
fields: ["count(1) as count"],
|
|
424
|
+
}, query, context);
|
|
425
|
+
if (rows.length) {
|
|
426
|
+
return parseInt(rows[0].count);
|
|
427
|
+
}
|
|
428
|
+
return 0;
|
|
429
|
+
}
|
|
430
|
+
exports.loadCustomCount = loadCustomCount;
|
|
410
431
|
function isPrimableLoader(loader) {
|
|
411
432
|
return loader != undefined;
|
|
412
433
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./core/base";
|
|
2
|
-
export { loadEnt, loadCustomData, loadCustomEnts, loadEntX, loadEnts, CustomQuery, loadDerivedEnt, loadDerivedEntX, loadEntViaKey, loadEntXViaKey, performRawQuery, loadRowX, loadRow, loadRows, DataOperation, EditNodeOptions, EditNodeOperation, RawQueryOperation, EdgeOperation, DeleteNodeOperation, AssocEdge, AssocEdgeInputOptions, AssocEdgeInput, AssocEdgeData, loadEdgeData, loadEdgeDatas, loadEdges, loadUniqueEdge, loadUniqueNode, loadRawEdgeCountX, loadEdgeForID2, loadNodesByEdge, getEdgeTypeInGroup, setGlobalSchema, } from "./core/ent";
|
|
2
|
+
export { loadEnt, loadCustomData, loadCustomEnts, loadCustomCount, loadEntX, loadEnts, CustomQuery, loadDerivedEnt, loadDerivedEntX, loadEntViaKey, loadEntXViaKey, performRawQuery, loadRowX, loadRow, loadRows, DataOperation, EditNodeOptions, EditNodeOperation, RawQueryOperation, EdgeOperation, DeleteNodeOperation, AssocEdge, AssocEdgeInputOptions, AssocEdgeInput, AssocEdgeData, loadEdgeData, loadEdgeDatas, loadEdges, loadUniqueEdge, loadUniqueNode, loadRawEdgeCountX, loadEdgeForID2, loadNodesByEdge, getEdgeTypeInGroup, setGlobalSchema, } from "./core/ent";
|
|
3
3
|
import DB from "./core/db";
|
|
4
4
|
export * from "./core/loaders";
|
|
5
5
|
export { DB };
|
|
@@ -13,6 +13,7 @@ declare const query: {
|
|
|
13
13
|
And: typeof q.And;
|
|
14
14
|
AndOptional: typeof q.AndOptional;
|
|
15
15
|
Or: typeof q.Or;
|
|
16
|
+
OrOptional: typeof q.OrOptional;
|
|
16
17
|
In: typeof q.In;
|
|
17
18
|
Greater: typeof q.Greater;
|
|
18
19
|
Less: typeof q.Less;
|
package/index.js
CHANGED
|
@@ -25,13 +25,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
29
|
-
exports.setLogLevels = exports.loadConfig = exports.LoggedOutViewer = exports.IDViewer = exports.ContextCache = exports.query = exports.AllowIfViewerHasIdentityPrivacyPolicy = exports.AllowIfViewerPrivacyPolicy = exports.AllowIfSubPolicyAllowsRule = exports.AllowIfConditionAppliesRule = exports.AlwaysDenyPrivacyPolicy = exports.AlwaysAllowPrivacyPolicy = exports.applyPrivacyPolicyX = exports.applyPrivacyPolicy = exports.DelayedResultRule = exports.DenyIfEntIsVisiblePolicy = exports.AllowIfEntIsVisiblePolicy = exports.DenyIfEntIsNotVisibleRule = exports.DenyIfEntIsVisibleRule = exports.AllowIfEntIsNotVisibleRule = exports.AllowIfEntIsVisibleRule = exports.DenyIfViewerOutboundEdgeDoesNotExistRule = exports.DenyIfViewerInboundEdgeDoesNotExistRule = exports.DenyIfEdgeDoesNotExistRule = void 0;
|
|
28
|
+
exports.DenyIfViewerInboundEdgeExistsRule = exports.DenyIfEdgeExistsRule = exports.AllowIfViewerOutboundEdgeExistsRule = exports.AllowIfViewerInboundEdgeExistsRule = exports.AllowIfEdgeExistsRule = exports.DenyIfViewerEqualsRule = exports.AllowIfViewerEqualsRule = exports.DenyIfEntPropertyIsRule = exports.AllowIfEntPropertyIsRule = exports.AllowIfViewerIsEntPropertyRule = exports.AllowIfViewerIsRule = exports.AllowIfFuncRule = exports.AllowIfViewerRule = exports.AllowIfHasIdentity = exports.DenyIfLoggedOutRule = exports.DenyIfLoggedInRule = exports.AlwaysDenyRule = exports.AlwaysAllowRule = exports.EntPrivacyError = exports.DB = exports.setGlobalSchema = exports.getEdgeTypeInGroup = exports.loadNodesByEdge = exports.loadEdgeForID2 = exports.loadRawEdgeCountX = exports.loadUniqueNode = exports.loadUniqueEdge = exports.loadEdges = exports.loadEdgeDatas = exports.loadEdgeData = exports.AssocEdgeData = exports.AssocEdge = exports.DeleteNodeOperation = exports.EdgeOperation = exports.RawQueryOperation = exports.EditNodeOperation = exports.loadRows = exports.loadRow = exports.loadRowX = exports.performRawQuery = exports.loadEntXViaKey = exports.loadEntViaKey = exports.loadDerivedEntX = exports.loadDerivedEnt = exports.loadEnts = exports.loadEntX = exports.loadCustomCount = exports.loadCustomEnts = exports.loadCustomData = exports.loadEnt = void 0;
|
|
29
|
+
exports.setLogLevels = exports.loadConfig = exports.LoggedOutViewer = exports.IDViewer = exports.ContextCache = exports.query = exports.AllowIfViewerHasIdentityPrivacyPolicy = exports.AllowIfViewerPrivacyPolicy = exports.AllowIfSubPolicyAllowsRule = exports.AllowIfConditionAppliesRule = exports.AlwaysDenyPrivacyPolicy = exports.AlwaysAllowPrivacyPolicy = exports.applyPrivacyPolicyX = exports.applyPrivacyPolicy = exports.DelayedResultRule = exports.DenyIfEntIsVisiblePolicy = exports.AllowIfEntIsVisiblePolicy = exports.DenyIfEntIsNotVisibleRule = exports.DenyIfEntIsVisibleRule = exports.AllowIfEntIsNotVisibleRule = exports.AllowIfEntIsVisibleRule = exports.DenyIfViewerOutboundEdgeDoesNotExistRule = exports.DenyIfViewerInboundEdgeDoesNotExistRule = exports.DenyIfEdgeDoesNotExistRule = exports.DenyIfViewerOutboundEdgeExistsRule = void 0;
|
|
30
30
|
__exportStar(require("./core/base"), exports);
|
|
31
31
|
var ent_1 = require("./core/ent");
|
|
32
32
|
Object.defineProperty(exports, "loadEnt", { enumerable: true, get: function () { return ent_1.loadEnt; } });
|
|
33
33
|
Object.defineProperty(exports, "loadCustomData", { enumerable: true, get: function () { return ent_1.loadCustomData; } });
|
|
34
34
|
Object.defineProperty(exports, "loadCustomEnts", { enumerable: true, get: function () { return ent_1.loadCustomEnts; } });
|
|
35
|
+
Object.defineProperty(exports, "loadCustomCount", { enumerable: true, get: function () { return ent_1.loadCustomCount; } });
|
|
35
36
|
Object.defineProperty(exports, "loadEntX", { enumerable: true, get: function () { return ent_1.loadEntX; } });
|
|
36
37
|
Object.defineProperty(exports, "loadEnts", { enumerable: true, get: function () { return ent_1.loadEnts; } });
|
|
37
38
|
Object.defineProperty(exports, "loadDerivedEnt", { enumerable: true, get: function () { return ent_1.loadDerivedEnt; } });
|
|
@@ -111,6 +112,7 @@ const query = {
|
|
|
111
112
|
And: q.And,
|
|
112
113
|
AndOptional: q.AndOptional,
|
|
113
114
|
Or: q.Or,
|
|
115
|
+
OrOptional: q.OrOptional,
|
|
114
116
|
In: q.In,
|
|
115
117
|
Greater: q.Greater,
|
|
116
118
|
Less: q.Less,
|
package/package.json
CHANGED
package/schema/schema.d.ts
CHANGED
|
@@ -68,7 +68,8 @@ export interface AssocEdgeGroup {
|
|
|
68
68
|
tableName?: string;
|
|
69
69
|
assocEdges: AssocEdge[];
|
|
70
70
|
statusEnums?: string[];
|
|
71
|
-
|
|
71
|
+
viewerBased?: boolean;
|
|
72
|
+
nullStates?: string | string[];
|
|
72
73
|
nullStateFn?: string;
|
|
73
74
|
edgeAction?: EdgeGroupAction;
|
|
74
75
|
}
|
|
@@ -210,6 +211,7 @@ export interface FieldOptions {
|
|
|
210
211
|
[x: string]: any;
|
|
211
212
|
}
|
|
212
213
|
export interface PolymorphicOptions {
|
|
214
|
+
name?: string;
|
|
213
215
|
types?: string[];
|
|
214
216
|
hideFromInverseGraphQL?: boolean;
|
|
215
217
|
disableBuilderType?: boolean;
|