@snowtop/ent 0.2.0-alpha.10-test1 → 0.2.0-alpha.11-test1
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.js +5 -5
- package/action/executor.d.ts +1 -1
- package/action/executor.js +4 -4
- package/action/experimental_action.js +5 -5
- package/action/orchestrator.d.ts +2 -2
- package/action/privacy.d.ts +2 -2
- package/action/relative_value.js +3 -3
- package/auth/auth.d.ts +0 -1
- package/auth/auth.js +4 -5
- package/core/base.js +5 -5
- package/core/clause.js +59 -60
- package/core/config.d.ts +0 -1
- package/core/config.js +1 -2
- package/core/context.d.ts +0 -1
- package/core/convert.d.ts +0 -1
- package/core/convert.js +16 -17
- package/core/date.js +1 -2
- package/core/ent.js +50 -51
- package/core/global_schema.js +6 -7
- package/core/loaders/assoc_count_loader.d.ts +2 -2
- package/core/loaders/assoc_edge_loader.d.ts +2 -2
- package/core/loaders/loader.js +3 -3
- package/core/loaders/object_loader.d.ts +4 -4
- package/core/loaders/query_loader.d.ts +2 -2
- package/core/loaders/raw_count_loader.d.ts +2 -2
- package/core/loaders/raw_count_loader.js +2 -2
- package/core/logger.js +6 -7
- package/core/privacy.d.ts +2 -2
- package/core/privacy.js +4 -4
- package/core/query/shared_assoc_test.js +1 -2
- package/core/query_impl.js +4 -5
- package/core/viewer.d.ts +2 -2
- package/graphql/graphql_field_helpers.js +22 -22
- package/graphql/mutations/union.js +1 -2
- package/graphql/node_resolver.js +7 -7
- package/graphql/query/shared_assoc_test.js +1 -2
- package/graphql/scalars/time.d.ts +1 -1
- package/imports/dataz/example1/_auth.js +14 -10
- package/imports/index.js +1 -2
- package/names/names.js +5 -6
- package/package.json +13 -13
- package/parse_schema/parse.js +2 -3
- package/schema/binary_field.d.ts +2 -2
- package/schema/binary_field.js +3 -3
- package/schema/field.js +28 -28
- package/schema/json_field.js +7 -7
- package/schema/schema.d.ts +0 -1
- package/schema/schema.js +12 -12
- package/schema/struct_field.js +39 -15
- package/schema/union_field.js +3 -3
- package/testutils/action/complex_schemas.js +11 -11
- package/testutils/builder.d.ts +1 -1
- package/testutils/builder.js +7 -7
- package/testutils/db/fixture.js +1 -2
- package/testutils/db/temp_db.js +37 -37
- package/testutils/db/value.js +3 -4
- package/testutils/db_mock.js +38 -6
- package/testutils/ent-graphql-tests/index.d.ts +3 -3
- package/testutils/ent-graphql-tests/index.js +10 -11
- package/testutils/fake_data/const.js +2 -2
- package/testutils/fake_data/fake_contact.js +3 -3
- package/testutils/fake_data/fake_event.js +3 -3
- package/testutils/fake_data/fake_tag.js +4 -4
- package/testutils/fake_data/fake_user.js +4 -4
- package/testutils/fake_data/test_helpers.js +17 -17
- package/testutils/fake_data/user_query.js +2 -2
- package/testutils/parse_sql.js +3 -3
- package/testutils/query.js +2 -3
- package/testutils/write.js +3 -4
- package/tsc/ast.js +10 -11
- package/tsc/compilerOptions.js +5 -9
- package/tsc/move_generated.js +1 -2
- package/tsc/transform.js +1 -2
package/core/privacy.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AllowIfViewerHasIdentityPrivacyPolicy = exports.AllowIfViewerPrivacyPolicy = exports.AlwaysDenyPrivacyPolicy = exports.AlwaysAllowPrivacyPolicy = exports.
|
|
3
|
+
exports.AllowIfViewerHasIdentityPrivacyPolicy = exports.AllowIfViewerPrivacyPolicy = exports.AlwaysDenyPrivacyPolicy = exports.AlwaysAllowPrivacyPolicy = exports.AllowIfSubPolicyAllowsRule = exports.DelayedResultRule = exports.AllowIfConditionAppliesRule = exports.DenyIfViewerOutboundEdgeDoesNotExistRule = exports.DenyIfViewerInboundEdgeDoesNotExistRule = exports.DenyIfEdgeDoesNotExistRule = exports.DenyIfViewerOutboundEdgeExistsRule = exports.DenyIfViewerInboundEdgeExistsRule = exports.DenyIfEdgeExistsRule = exports.AllowIfViewerOutboundEdgeExistsRule = exports.AllowIfViewerInboundEdgeExistsRule = exports.AllowIfEdgeExistsRule = exports.DenyIfEntIsNotVisibleRule = exports.DenyIfEntIsVisibleRule = exports.DenyIfEntIsVisiblePolicy = exports.AllowIfEntIsVisiblePolicy = exports.AllowIfEntIsNotVisibleRule = exports.AllowIfEntIsVisibleRule = exports.DenyIfEntPropertyIsRule = exports.AllowIfEntPropertyIsRule = exports.AllowIfViewerIsEntPropertyRule = exports.AllowIfViewerIsRule = exports.DenyIfFuncRule = exports.AllowIfFuncRule = exports.DenyIfViewerEqualsRule = exports.AllowIfViewerEqualsRule = exports.AllowIfViewerRule = exports.AllowIfHasIdentity = exports.DenyIfLoggedInRule = exports.DenyIfLoggedOutRule = exports.AlwaysDenyRule = exports.AlwaysAllowRule = exports.EntPrivacyError = void 0;
|
|
4
|
+
exports.applyPrivacyPolicy = applyPrivacyPolicy;
|
|
5
|
+
exports.applyPrivacyPolicyX = applyPrivacyPolicyX;
|
|
6
|
+
exports.applyPrivacyPolicyImpl = applyPrivacyPolicyImpl;
|
|
4
7
|
const types_1 = require("util/types");
|
|
5
8
|
const base_1 = require("./base");
|
|
6
9
|
const ent_1 = require("./ent");
|
|
@@ -460,7 +463,6 @@ async function applyPrivacyPolicy(v, policy, ent) {
|
|
|
460
463
|
const err = await applyPrivacyPolicyImpl(v, policy, ent);
|
|
461
464
|
return err === null;
|
|
462
465
|
}
|
|
463
|
-
exports.applyPrivacyPolicy = applyPrivacyPolicy;
|
|
464
466
|
async function applyPrivacyPolicyX(v, policy, ent, throwErr) {
|
|
465
467
|
const err = await applyPrivacyPolicyImpl(v, policy, ent, throwErr);
|
|
466
468
|
if (err !== null) {
|
|
@@ -468,7 +470,6 @@ async function applyPrivacyPolicyX(v, policy, ent, throwErr) {
|
|
|
468
470
|
}
|
|
469
471
|
return true;
|
|
470
472
|
}
|
|
471
|
-
exports.applyPrivacyPolicyX = applyPrivacyPolicyX;
|
|
472
473
|
// this will throw an exception if fails or return error | null?
|
|
473
474
|
async function applyPrivacyPolicyImpl(v, policy, ent, throwErr) {
|
|
474
475
|
for (const rule of policy.rules) {
|
|
@@ -492,7 +493,6 @@ async function applyPrivacyPolicyImpl(v, policy, ent, throwErr) {
|
|
|
492
493
|
}
|
|
493
494
|
return new EntInvalidPrivacyPolicyError(policy, ent);
|
|
494
495
|
}
|
|
495
|
-
exports.applyPrivacyPolicyImpl = applyPrivacyPolicyImpl;
|
|
496
496
|
exports.AlwaysAllowPrivacyPolicy = {
|
|
497
497
|
rules: [exports.AlwaysAllowRule],
|
|
498
498
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assocTests =
|
|
3
|
+
exports.assocTests = assocTests;
|
|
4
4
|
const base_1 = require("../base");
|
|
5
5
|
const ent_1 = require("../ent");
|
|
6
6
|
const viewer_1 = require("../viewer");
|
|
@@ -1483,4 +1483,3 @@ function assocTests(ml, global = false) {
|
|
|
1483
1483
|
});
|
|
1484
1484
|
});
|
|
1485
1485
|
}
|
|
1486
|
-
exports.assocTests = assocTests;
|
package/core/query_impl.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getOrderByPhrase = getOrderByPhrase;
|
|
4
|
+
exports.reverseOrderBy = reverseOrderBy;
|
|
5
|
+
exports.getJoinInfo = getJoinInfo;
|
|
6
|
+
exports.buildQuery = buildQuery;
|
|
4
7
|
function getOrderByPhrase(orderby, alias) {
|
|
5
8
|
return orderby
|
|
6
9
|
.map((v) => {
|
|
@@ -19,7 +22,6 @@ function getOrderByPhrase(orderby, alias) {
|
|
|
19
22
|
})
|
|
20
23
|
.join(", ");
|
|
21
24
|
}
|
|
22
|
-
exports.getOrderByPhrase = getOrderByPhrase;
|
|
23
25
|
function reverseOrderBy(orderby) {
|
|
24
26
|
return orderby.map((o) => {
|
|
25
27
|
const o2 = { ...o };
|
|
@@ -27,7 +29,6 @@ function reverseOrderBy(orderby) {
|
|
|
27
29
|
return o2;
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
|
-
exports.reverseOrderBy = reverseOrderBy;
|
|
31
32
|
function getJoinInfo(join, clauseIdx = 1) {
|
|
32
33
|
let valuesUsed = 0;
|
|
33
34
|
const str = join
|
|
@@ -61,7 +62,6 @@ function getJoinInfo(join, clauseIdx = 1) {
|
|
|
61
62
|
valuesUsed,
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
|
-
exports.getJoinInfo = getJoinInfo;
|
|
65
65
|
function buildQuery(options) {
|
|
66
66
|
const fieldsAlias = options.fieldsAlias ?? options.alias;
|
|
67
67
|
const fields = options.fields
|
|
@@ -107,4 +107,3 @@ function buildQuery(options) {
|
|
|
107
107
|
}
|
|
108
108
|
return parts.join(" ");
|
|
109
109
|
}
|
|
110
|
-
exports.buildQuery = buildQuery;
|
package/core/viewer.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ID, Ent, Viewer, Context } from "./base";
|
|
2
2
|
export declare class LoggedOutViewer implements Viewer {
|
|
3
|
-
context?: Context
|
|
3
|
+
context?: Context | undefined;
|
|
4
4
|
marker: string;
|
|
5
|
-
constructor(context?: Context
|
|
5
|
+
constructor(context?: Context | undefined);
|
|
6
6
|
viewerID: null;
|
|
7
7
|
viewer(): Promise<null>;
|
|
8
8
|
instanceKey(): string;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CustomObjectTypes = void 0;
|
|
4
|
+
exports.validateOneCustomField = validateOneCustomField;
|
|
5
|
+
exports.validateCustomFields = validateCustomFields;
|
|
6
|
+
exports.validateCustomMutations = validateCustomMutations;
|
|
7
|
+
exports.validateCustomQueries = validateCustomQueries;
|
|
8
|
+
exports.validateFields = validateFields;
|
|
9
|
+
exports.validateNoCustomFields = validateNoCustomFields;
|
|
10
|
+
exports.validateCustomArgs = validateCustomArgs;
|
|
11
|
+
exports.validateCustomInputObjects = validateCustomInputObjects;
|
|
12
|
+
exports.validateCustomObjects = validateCustomObjects;
|
|
13
|
+
exports.validateCustomInterfaces = validateCustomInterfaces;
|
|
14
|
+
exports.validateCustomUnions = validateCustomUnions;
|
|
15
|
+
exports.validateNoCustomArgs = validateNoCustomArgs;
|
|
16
|
+
exports.validateNoCustomQueries = validateNoCustomQueries;
|
|
17
|
+
exports.validateNoCustomMutations = validateNoCustomMutations;
|
|
18
|
+
exports.validateNoCustomInputObjects = validateNoCustomInputObjects;
|
|
19
|
+
exports.validateNoCustomObjects = validateNoCustomObjects;
|
|
20
|
+
exports.validateNoCustomTypes = validateNoCustomTypes;
|
|
21
|
+
exports.validateNoCustomInterfaces = validateNoCustomInterfaces;
|
|
22
|
+
exports.validateNoCustomUnions = validateNoCustomUnions;
|
|
23
|
+
exports.validateNoCustom = validateNoCustom;
|
|
24
|
+
exports.validateCustomTypes = validateCustomTypes;
|
|
4
25
|
const graphql_1 = require("./graphql");
|
|
5
26
|
function validateOneCustomField(expected) {
|
|
6
27
|
let customFields = graphql_1.GQLCapture.getCustomFields();
|
|
@@ -10,7 +31,6 @@ function validateOneCustomField(expected) {
|
|
|
10
31
|
expect(fields).toBeDefined();
|
|
11
32
|
validateCustomFieldImpl(expected, fields[0]);
|
|
12
33
|
}
|
|
13
|
-
exports.validateOneCustomField = validateOneCustomField;
|
|
14
34
|
function validateCustomFieldsImpl(expected, actual) {
|
|
15
35
|
expect(actual.length).toBe(expected.length);
|
|
16
36
|
for (let i = 0; i < actual.length; i++) {
|
|
@@ -48,15 +68,12 @@ function validateCustomFields(expected) {
|
|
|
48
68
|
validateCustomFieldsImpl(expFields, list);
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
|
-
exports.validateCustomFields = validateCustomFields;
|
|
52
71
|
function validateCustomMutations(expected) {
|
|
53
72
|
validateCustomFieldsImpl(expected, graphql_1.GQLCapture.getCustomMutations());
|
|
54
73
|
}
|
|
55
|
-
exports.validateCustomMutations = validateCustomMutations;
|
|
56
74
|
function validateCustomQueries(expected) {
|
|
57
75
|
validateCustomFieldsImpl(expected, graphql_1.GQLCapture.getCustomQueries());
|
|
58
76
|
}
|
|
59
|
-
exports.validateCustomQueries = validateCustomQueries;
|
|
60
77
|
function validateFields(actual, expected) {
|
|
61
78
|
expect(actual.length).toBe(expected.length);
|
|
62
79
|
for (let j = 0; j < actual.length; j++) {
|
|
@@ -73,11 +90,9 @@ function validateFields(actual, expected) {
|
|
|
73
90
|
}
|
|
74
91
|
}
|
|
75
92
|
}
|
|
76
|
-
exports.validateFields = validateFields;
|
|
77
93
|
function validateNoCustomFields() {
|
|
78
94
|
expect(graphql_1.GQLCapture.getCustomFields().size).toBe(0);
|
|
79
95
|
}
|
|
80
|
-
exports.validateNoCustomFields = validateNoCustomFields;
|
|
81
96
|
function validateCustom(expected, actual) {
|
|
82
97
|
expect(actual.size).toBe(expected.length);
|
|
83
98
|
for (let i = 0; i < expected.length; i++) {
|
|
@@ -92,55 +107,42 @@ function validateCustom(expected, actual) {
|
|
|
92
107
|
function validateCustomArgs(expected) {
|
|
93
108
|
validateCustom(expected, graphql_1.GQLCapture.getCustomArgs());
|
|
94
109
|
}
|
|
95
|
-
exports.validateCustomArgs = validateCustomArgs;
|
|
96
110
|
function validateCustomInputObjects(expected) {
|
|
97
111
|
validateCustom(expected, graphql_1.GQLCapture.getCustomInputObjects());
|
|
98
112
|
}
|
|
99
|
-
exports.validateCustomInputObjects = validateCustomInputObjects;
|
|
100
113
|
function validateCustomObjects(expected) {
|
|
101
114
|
validateCustom(expected, graphql_1.GQLCapture.getCustomObjects());
|
|
102
115
|
}
|
|
103
|
-
exports.validateCustomObjects = validateCustomObjects;
|
|
104
116
|
function validateCustomInterfaces(expected) {
|
|
105
117
|
validateCustom(expected, graphql_1.GQLCapture.getCustomInterfaces());
|
|
106
118
|
}
|
|
107
|
-
exports.validateCustomInterfaces = validateCustomInterfaces;
|
|
108
119
|
function validateCustomUnions(expected) {
|
|
109
120
|
validateCustom(expected, graphql_1.GQLCapture.getCustomUnions());
|
|
110
121
|
}
|
|
111
|
-
exports.validateCustomUnions = validateCustomUnions;
|
|
112
122
|
function validateNoCustomArgs() {
|
|
113
123
|
expect(graphql_1.GQLCapture.getCustomArgs().size).toBe(0);
|
|
114
124
|
}
|
|
115
|
-
exports.validateNoCustomArgs = validateNoCustomArgs;
|
|
116
125
|
function validateNoCustomQueries() {
|
|
117
126
|
expect(graphql_1.GQLCapture.getCustomQueries().length).toBe(0);
|
|
118
127
|
}
|
|
119
|
-
exports.validateNoCustomQueries = validateNoCustomQueries;
|
|
120
128
|
function validateNoCustomMutations() {
|
|
121
129
|
expect(graphql_1.GQLCapture.getCustomMutations().length).toBe(0);
|
|
122
130
|
}
|
|
123
|
-
exports.validateNoCustomMutations = validateNoCustomMutations;
|
|
124
131
|
function validateNoCustomInputObjects() {
|
|
125
132
|
expect(graphql_1.GQLCapture.getCustomInputObjects().size).toBe(0);
|
|
126
133
|
}
|
|
127
|
-
exports.validateNoCustomInputObjects = validateNoCustomInputObjects;
|
|
128
134
|
function validateNoCustomObjects() {
|
|
129
135
|
expect(graphql_1.GQLCapture.getCustomObjects().size).toBe(0);
|
|
130
136
|
}
|
|
131
|
-
exports.validateNoCustomObjects = validateNoCustomObjects;
|
|
132
137
|
function validateNoCustomTypes() {
|
|
133
138
|
expect(graphql_1.GQLCapture.getCustomTypes().size).toBe(0);
|
|
134
139
|
}
|
|
135
|
-
exports.validateNoCustomTypes = validateNoCustomTypes;
|
|
136
140
|
function validateNoCustomInterfaces() {
|
|
137
141
|
expect(graphql_1.GQLCapture.getCustomInterfaces().size).toBe(0);
|
|
138
142
|
}
|
|
139
|
-
exports.validateNoCustomInterfaces = validateNoCustomInterfaces;
|
|
140
143
|
function validateNoCustomUnions() {
|
|
141
144
|
expect(graphql_1.GQLCapture.getCustomUnions().size).toBe(0);
|
|
142
145
|
}
|
|
143
|
-
exports.validateNoCustomUnions = validateNoCustomUnions;
|
|
144
146
|
var CustomObjectTypes;
|
|
145
147
|
(function (CustomObjectTypes) {
|
|
146
148
|
CustomObjectTypes[CustomObjectTypes["Field"] = 1] = "Field";
|
|
@@ -172,7 +174,6 @@ function validateNoCustom(...exceptions) {
|
|
|
172
174
|
validate(CustomObjectTypes.Interface, validateNoCustomInterfaces);
|
|
173
175
|
validate(CustomObjectTypes.Union, validateNoCustomUnions);
|
|
174
176
|
}
|
|
175
|
-
exports.validateNoCustom = validateNoCustom;
|
|
176
177
|
function validateCustomTypes(expected) {
|
|
177
178
|
const actual = graphql_1.GQLCapture.getCustomTypes();
|
|
178
179
|
expect(actual.size).toBe(expected.length);
|
|
@@ -186,4 +187,3 @@ function validateCustomTypes(expected) {
|
|
|
186
187
|
expect(obj.tsImportPath).toBe(expectedObj.tsImportPath);
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
exports.validateCustomTypes = validateCustomTypes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformUnionTypes =
|
|
3
|
+
exports.transformUnionTypes = transformUnionTypes;
|
|
4
4
|
// this transforms an input for union types from graphql format to TS format
|
|
5
5
|
// in graphql, we represent it as UnionType = {foo: FooType, bar: BarType, baz: BazType}
|
|
6
6
|
// in TS, we repseent it as UnionType = FooType | BarType | BazType
|
|
@@ -32,4 +32,3 @@ function transformUnionTypes(input, pathsList) {
|
|
|
32
32
|
}
|
|
33
33
|
return input;
|
|
34
34
|
}
|
|
35
|
-
exports.transformUnionTypes = transformUnionTypes;
|
package/graphql/node_resolver.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.nodeIDEncoder = exports.EntNodeResolver = void 0;
|
|
4
|
+
exports.registerResolver = registerResolver;
|
|
5
|
+
exports.clearResolvers = clearResolvers;
|
|
6
|
+
exports.resolveID = resolveID;
|
|
7
|
+
exports.mustDecodeIDFromGQLID = mustDecodeIDFromGQLID;
|
|
8
|
+
exports.mustDecodeNullableIDFromGQLID = mustDecodeNullableIDFromGQLID;
|
|
9
|
+
exports.encodeGQLID = encodeGQLID;
|
|
4
10
|
class EntNodeResolver {
|
|
5
11
|
constructor(loader) {
|
|
6
12
|
this.loader = loader;
|
|
@@ -41,12 +47,10 @@ let resolvers = new Map();
|
|
|
41
47
|
async function registerResolver(name, resolver) {
|
|
42
48
|
resolvers.set(name, resolver);
|
|
43
49
|
}
|
|
44
|
-
exports.registerResolver = registerResolver;
|
|
45
50
|
// mainly needed for tests
|
|
46
51
|
async function clearResolvers() {
|
|
47
52
|
resolvers.clear();
|
|
48
53
|
}
|
|
49
|
-
exports.clearResolvers = clearResolvers;
|
|
50
54
|
async function resolveID(viewer, id) {
|
|
51
55
|
for (const [_, resolver] of resolvers) {
|
|
52
56
|
const node = await resolver.decodeObj(viewer, id);
|
|
@@ -56,7 +60,6 @@ async function resolveID(viewer, id) {
|
|
|
56
60
|
}
|
|
57
61
|
return null;
|
|
58
62
|
}
|
|
59
|
-
exports.resolveID = resolveID;
|
|
60
63
|
// this takes an id and uses the default node resolver which
|
|
61
64
|
// should have been registered as part of entcodegen and decodes
|
|
62
65
|
const nodeIDEncoder = (source, _args) => {
|
|
@@ -75,7 +78,6 @@ function mustDecodeIDFromGQLID(id) {
|
|
|
75
78
|
}
|
|
76
79
|
return decoded;
|
|
77
80
|
}
|
|
78
|
-
exports.mustDecodeIDFromGQLID = mustDecodeIDFromGQLID;
|
|
79
81
|
// TODO get the right (non-any) return type here. may need to change codegen to do the right thing here
|
|
80
82
|
function mustDecodeNullableIDFromGQLID(id) {
|
|
81
83
|
// support undefined because fields in action
|
|
@@ -88,11 +90,9 @@ function mustDecodeNullableIDFromGQLID(id) {
|
|
|
88
90
|
}
|
|
89
91
|
return decoded;
|
|
90
92
|
}
|
|
91
|
-
exports.mustDecodeNullableIDFromGQLID = mustDecodeNullableIDFromGQLID;
|
|
92
93
|
// This takes an ent and returns the graphql id
|
|
93
94
|
function encodeGQLID(node) {
|
|
94
95
|
// let's do 3 parts. we take the "node" prefix
|
|
95
96
|
const str = `node:${node.nodeType}:${node.id}`;
|
|
96
97
|
return Buffer.from(str, "ascii").toString("base64");
|
|
97
98
|
}
|
|
98
|
-
exports.encodeGQLID = encodeGQLID;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sharedAssocTests =
|
|
3
|
+
exports.sharedAssocTests = sharedAssocTests;
|
|
4
4
|
const viewer_1 = require("../../core/viewer");
|
|
5
5
|
const jest_date_mock_1 = require("jest-date-mock");
|
|
6
6
|
const edge_connection_1 = require("./edge_connection");
|
|
@@ -200,4 +200,3 @@ function sharedAssocTests() {
|
|
|
200
200
|
]);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
exports.sharedAssocTests = sharedAssocTests;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GraphQLScalarType } from "graphql";
|
|
2
|
-
export declare const GraphQLTime: GraphQLScalarType<Date, string>;
|
|
2
|
+
export declare const GraphQLTime: GraphQLScalarType<Date, string | null>;
|
|
@@ -45,15 +45,17 @@ let UserAuthInput = (() => {
|
|
|
45
45
|
let _classDescriptor;
|
|
46
46
|
let _classExtraInitializers = [];
|
|
47
47
|
let _classThis;
|
|
48
|
-
let _instanceExtraInitializers = [];
|
|
49
48
|
let _emailAddress_decorators;
|
|
50
49
|
let _emailAddress_initializers = [];
|
|
50
|
+
let _emailAddress_extraInitializers = [];
|
|
51
51
|
let _password_decorators;
|
|
52
52
|
let _password_initializers = [];
|
|
53
|
+
let _password_extraInitializers = [];
|
|
53
54
|
var UserAuthInput = _classThis = class {
|
|
54
55
|
constructor() {
|
|
55
|
-
this.emailAddress =
|
|
56
|
-
this.password = __runInitializers(this, _password_initializers, void 0);
|
|
56
|
+
this.emailAddress = __runInitializers(this, _emailAddress_initializers, void 0);
|
|
57
|
+
this.password = (__runInitializers(this, _emailAddress_extraInitializers), __runInitializers(this, _password_initializers, void 0));
|
|
58
|
+
__runInitializers(this, _password_extraInitializers);
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
__setFunctionName(_classThis, "UserAuthInput");
|
|
@@ -67,8 +69,8 @@ let UserAuthInput = (() => {
|
|
|
67
69
|
class: "UserAuthInput",
|
|
68
70
|
type: graphql_2.GraphQLString,
|
|
69
71
|
})];
|
|
70
|
-
__esDecorate(null, null, _emailAddress_decorators, { kind: "field", name: "emailAddress", static: false, private: false, access: { has: obj => "emailAddress" in obj, get: obj => obj.emailAddress, set: (obj, value) => { obj.emailAddress = value; } }, metadata: _metadata }, _emailAddress_initializers,
|
|
71
|
-
__esDecorate(null, null, _password_decorators, { kind: "field", name: "password", static: false, private: false, access: { has: obj => "password" in obj, get: obj => obj.password, set: (obj, value) => { obj.password = value; } }, metadata: _metadata }, _password_initializers,
|
|
72
|
+
__esDecorate(null, null, _emailAddress_decorators, { kind: "field", name: "emailAddress", static: false, private: false, access: { has: obj => "emailAddress" in obj, get: obj => obj.emailAddress, set: (obj, value) => { obj.emailAddress = value; } }, metadata: _metadata }, _emailAddress_initializers, _emailAddress_extraInitializers);
|
|
73
|
+
__esDecorate(null, null, _password_decorators, { kind: "field", name: "password", static: false, private: false, access: { has: obj => "password" in obj, get: obj => obj.password, set: (obj, value) => { obj.password = value; } }, metadata: _metadata }, _password_initializers, _password_extraInitializers);
|
|
72
74
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
73
75
|
UserAuthInput = _classThis = _classDescriptor.value;
|
|
74
76
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -81,15 +83,17 @@ let UserAuthResponse = (() => {
|
|
|
81
83
|
let _classDescriptor;
|
|
82
84
|
let _classExtraInitializers = [];
|
|
83
85
|
let _classThis;
|
|
84
|
-
let _instanceExtraInitializers = [];
|
|
85
86
|
let _token_decorators;
|
|
86
87
|
let _token_initializers = [];
|
|
88
|
+
let _token_extraInitializers = [];
|
|
87
89
|
let _viewerID_decorators;
|
|
88
90
|
let _viewerID_initializers = [];
|
|
91
|
+
let _viewerID_extraInitializers = [];
|
|
89
92
|
var UserAuthResponse = _classThis = class {
|
|
90
93
|
constructor() {
|
|
91
|
-
this.token =
|
|
92
|
-
this.viewerID = __runInitializers(this, _viewerID_initializers, void 0);
|
|
94
|
+
this.token = __runInitializers(this, _token_initializers, void 0);
|
|
95
|
+
this.viewerID = (__runInitializers(this, _token_extraInitializers), __runInitializers(this, _viewerID_initializers, void 0));
|
|
96
|
+
__runInitializers(this, _viewerID_extraInitializers);
|
|
93
97
|
}
|
|
94
98
|
};
|
|
95
99
|
__setFunctionName(_classThis, "UserAuthResponse");
|
|
@@ -100,8 +104,8 @@ let UserAuthResponse = (() => {
|
|
|
100
104
|
type: graphql_2.GraphQLString,
|
|
101
105
|
})];
|
|
102
106
|
_viewerID_decorators = [(0, graphql_1.gqlField)({ class: "UserAuthResponses", type: graphql_2.GraphQLID })];
|
|
103
|
-
__esDecorate(null, null, _token_decorators, { kind: "field", name: "token", static: false, private: false, access: { has: obj => "token" in obj, get: obj => obj.token, set: (obj, value) => { obj.token = value; } }, metadata: _metadata }, _token_initializers,
|
|
104
|
-
__esDecorate(null, null, _viewerID_decorators, { kind: "field", name: "viewerID", static: false, private: false, access: { has: obj => "viewerID" in obj, get: obj => obj.viewerID, set: (obj, value) => { obj.viewerID = value; } }, metadata: _metadata }, _viewerID_initializers,
|
|
107
|
+
__esDecorate(null, null, _token_decorators, { kind: "field", name: "token", static: false, private: false, access: { has: obj => "token" in obj, get: obj => obj.token, set: (obj, value) => { obj.token = value; } }, metadata: _metadata }, _token_initializers, _token_extraInitializers);
|
|
108
|
+
__esDecorate(null, null, _viewerID_decorators, { kind: "field", name: "viewerID", static: false, private: false, access: { has: obj => "viewerID" in obj, get: obj => obj.viewerID, set: (obj, value) => { obj.viewerID = value; } }, metadata: _metadata }, _viewerID_initializers, _viewerID_extraInitializers);
|
|
105
109
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
106
110
|
UserAuthResponse = _classThis = _classDescriptor.value;
|
|
107
111
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
package/imports/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.parseCustomImports =
|
|
29
|
+
exports.parseCustomImports = parseCustomImports;
|
|
30
30
|
const glob = __importStar(require("glob"));
|
|
31
31
|
const typescript_1 = __importDefault(require("typescript"));
|
|
32
32
|
const fs = __importStar(require("fs"));
|
|
@@ -91,7 +91,6 @@ function parseCustomImports(filePath, inputs) {
|
|
|
91
91
|
},
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
exports.parseCustomImports = parseCustomImports;
|
|
95
94
|
function traverse(sourceFile, f, classMap) {
|
|
96
95
|
typescript_1.default.forEachChild(sourceFile, function (node) {
|
|
97
96
|
switch (node.kind) {
|
package/names/names.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toDBColumnOrTable = toDBColumnOrTable;
|
|
4
|
+
exports.toFilePath = toFilePath;
|
|
5
|
+
exports.toFieldName = toFieldName;
|
|
6
|
+
exports.toClassName = toClassName;
|
|
7
|
+
exports._splitCamelCase = _splitCamelCase;
|
|
4
8
|
const camel_case_1 = require("camel-case");
|
|
5
9
|
const pascal_case_1 = require("pascal-case");
|
|
6
10
|
const snake_case_1 = require("snake-case");
|
|
@@ -34,11 +38,9 @@ function toDBColumnOrTable(...strs) {
|
|
|
34
38
|
}
|
|
35
39
|
return name;
|
|
36
40
|
}
|
|
37
|
-
exports.toDBColumnOrTable = toDBColumnOrTable;
|
|
38
41
|
function toFilePath(s) {
|
|
39
42
|
return (0, snake_case_1.snakeCase)(s);
|
|
40
43
|
}
|
|
41
|
-
exports.toFilePath = toFilePath;
|
|
42
44
|
function toFieldName(...strs) {
|
|
43
45
|
let name = "";
|
|
44
46
|
let hasDoneLower = false;
|
|
@@ -71,11 +73,9 @@ function toFieldName(...strs) {
|
|
|
71
73
|
}
|
|
72
74
|
return name;
|
|
73
75
|
}
|
|
74
|
-
exports.toFieldName = toFieldName;
|
|
75
76
|
function toClassName(str) {
|
|
76
77
|
return (0, pascal_case_1.pascalCase)(str);
|
|
77
78
|
}
|
|
78
|
-
exports.toClassName = toClassName;
|
|
79
79
|
function isUpper(s) {
|
|
80
80
|
for (const c of s) {
|
|
81
81
|
if (!(c >= "A" && c <= "Z")) {
|
|
@@ -154,4 +154,3 @@ function _splitCamelCase(s) {
|
|
|
154
154
|
}
|
|
155
155
|
return results;
|
|
156
156
|
}
|
|
157
|
-
exports._splitCamelCase = _splitCamelCase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snowtop/ent",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.11-test1",
|
|
4
4
|
"description": "snowtop ent framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,27 +12,27 @@
|
|
|
12
12
|
"camel-case": "^4.1.2",
|
|
13
13
|
"cosmiconfig": "^9.0.0",
|
|
14
14
|
"dataloader": "^2.2.2",
|
|
15
|
-
"glob": "^
|
|
16
|
-
"graph-data-structure": "^
|
|
15
|
+
"glob": "^11.0.0",
|
|
16
|
+
"graph-data-structure": "^4.2.0",
|
|
17
17
|
"js-yaml": "^4.1.0",
|
|
18
18
|
"json5": "^2.2.3",
|
|
19
|
-
"luxon": "^3.
|
|
20
|
-
"memoizee": "^0.4.
|
|
19
|
+
"luxon": "^3.5.0",
|
|
20
|
+
"memoizee": "^0.4.17",
|
|
21
21
|
"minimist": "^1.2.8",
|
|
22
22
|
"pascal-case": "^3.1.2",
|
|
23
|
-
"pg": "^8.
|
|
24
|
-
"prettier": "^3.
|
|
23
|
+
"pg": "^8.13.1",
|
|
24
|
+
"prettier": "^3.3.3",
|
|
25
25
|
"snake-case": "^3.0.4",
|
|
26
26
|
"ts-node": "^11.0.0-beta.1",
|
|
27
27
|
"tsconfig-paths": "^4.2.0",
|
|
28
|
-
"tslib": "^2.
|
|
29
|
-
"typescript": "^5.
|
|
30
|
-
"uuid": "^
|
|
28
|
+
"tslib": "^2.8.1",
|
|
29
|
+
"typescript": "^5.6.3",
|
|
30
|
+
"uuid": "^11.0.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@swc-node/register": "^1.
|
|
34
|
-
"better-sqlite3": "^
|
|
35
|
-
"graphql": "^16.
|
|
33
|
+
"@swc-node/register": "^1.10.9",
|
|
34
|
+
"better-sqlite3": "^11.5.0",
|
|
35
|
+
"graphql": "^16.9.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"better-sqlite3": {
|
package/parse_schema/parse.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.processFields = processFields;
|
|
4
|
+
exports.parseSchema = parseSchema;
|
|
4
5
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
5
6
|
const const_1 = require("../core/const");
|
|
6
7
|
const global_schema_1 = require("../core/global_schema");
|
|
@@ -87,7 +88,6 @@ async function processFields(src, patternName) {
|
|
|
87
88
|
}
|
|
88
89
|
return ret;
|
|
89
90
|
}
|
|
90
|
-
exports.processFields = processFields;
|
|
91
91
|
async function transformServerDefault(name, f, value) {
|
|
92
92
|
if (f.valid) {
|
|
93
93
|
if (!(await f.valid(value))) {
|
|
@@ -458,7 +458,6 @@ async function parseSchema(potentialSchemas, globalSchema) {
|
|
|
458
458
|
},
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
exports.parseSchema = parseSchema;
|
|
462
461
|
function translatePrettier() {
|
|
463
462
|
const r = (0, cosmiconfig_1.cosmiconfigSync)("prettier").search();
|
|
464
463
|
if (!r) {
|
package/schema/binary_field.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import { Type, Field, FieldOptions } from "./schema";
|
|
|
3
3
|
export declare class ByteaField extends BaseField implements Field {
|
|
4
4
|
type: Type;
|
|
5
5
|
format(val: any): any;
|
|
6
|
-
valid(val: any):
|
|
6
|
+
valid(val: any): val is Buffer;
|
|
7
7
|
}
|
|
8
8
|
export declare function ByteaType(options?: FieldOptions): ByteaField & FieldOptions;
|
|
9
9
|
export declare class BinaryTextField extends BaseField implements Field {
|
|
10
10
|
type: Type;
|
|
11
11
|
format(val: any): any;
|
|
12
|
-
valid(val: any):
|
|
12
|
+
valid(val: any): val is Buffer;
|
|
13
13
|
}
|
|
14
14
|
export declare function BinaryTextType(options?: FieldOptions): BinaryTextField & FieldOptions;
|
package/schema/binary_field.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BinaryTextField = exports.ByteaField = void 0;
|
|
4
|
+
exports.ByteaType = ByteaType;
|
|
5
|
+
exports.BinaryTextType = BinaryTextType;
|
|
4
6
|
const field_1 = require("./field");
|
|
5
7
|
const schema_1 = require("./schema");
|
|
6
8
|
class ByteaField extends field_1.BaseField {
|
|
@@ -26,7 +28,6 @@ function ByteaType(options) {
|
|
|
26
28
|
const result = new ByteaField();
|
|
27
29
|
return Object.assign(result, options);
|
|
28
30
|
}
|
|
29
|
-
exports.ByteaType = ByteaType;
|
|
30
31
|
class BinaryTextField extends field_1.BaseField {
|
|
31
32
|
constructor() {
|
|
32
33
|
super(...arguments);
|
|
@@ -50,4 +51,3 @@ function BinaryTextType(options) {
|
|
|
50
51
|
const result = new BinaryTextField();
|
|
51
52
|
return Object.assign(result, options);
|
|
52
53
|
}
|
|
53
|
-
exports.BinaryTextType = BinaryTextType;
|