@snowtop/ent 0.1.0-alpha160-test6 → 0.1.0-alpha160
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/core/query/shared_assoc_test.d.ts +2 -0
- package/core/query/shared_assoc_test.js +804 -0
- package/core/query/shared_test.d.ts +21 -0
- package/core/query/shared_test.js +736 -0
- package/graphql/query/shared_assoc_test.d.ts +1 -0
- package/graphql/query/shared_assoc_test.js +203 -0
- package/package.json +6 -48
- package/{dist/scripts → scripts}/custom_compiler.js +0 -0
- package/{dist/scripts → scripts}/custom_graphql.js +0 -0
- package/dist/package.json +0 -64
- package/src/action/action.ts +0 -330
- package/src/action/executor.ts +0 -453
- package/src/action/experimental_action.ts +0 -277
- package/src/action/index.ts +0 -31
- package/src/action/operations.ts +0 -967
- package/src/action/orchestrator.ts +0 -1527
- package/src/action/privacy.ts +0 -37
- package/src/action/relative_value.ts +0 -242
- package/src/action/transaction.ts +0 -38
- package/src/auth/auth.ts +0 -77
- package/src/auth/index.ts +0 -8
- package/src/core/base.ts +0 -367
- package/src/core/clause.ts +0 -1065
- package/src/core/config.ts +0 -219
- package/src/core/const.ts +0 -5
- package/src/core/context.ts +0 -135
- package/src/core/convert.ts +0 -106
- package/src/core/date.ts +0 -23
- package/src/core/db.ts +0 -498
- package/src/core/ent.ts +0 -1740
- package/src/core/global_schema.ts +0 -49
- package/src/core/loaders/assoc_count_loader.ts +0 -99
- package/src/core/loaders/assoc_edge_loader.ts +0 -250
- package/src/core/loaders/index.ts +0 -12
- package/src/core/loaders/loader.ts +0 -66
- package/src/core/loaders/object_loader.ts +0 -489
- package/src/core/loaders/query_loader.ts +0 -314
- package/src/core/loaders/raw_count_loader.ts +0 -175
- package/src/core/logger.ts +0 -49
- package/src/core/privacy.ts +0 -660
- package/src/core/query/assoc_query.ts +0 -240
- package/src/core/query/custom_clause_query.ts +0 -174
- package/src/core/query/custom_query.ts +0 -302
- package/src/core/query/index.ts +0 -9
- package/src/core/query/query.ts +0 -674
- package/src/core/query_impl.ts +0 -32
- package/src/core/viewer.ts +0 -52
- package/src/ent.code-workspace +0 -73
- package/src/graphql/builtins/connection.ts +0 -25
- package/src/graphql/builtins/edge.ts +0 -16
- package/src/graphql/builtins/node.ts +0 -12
- package/src/graphql/graphql.ts +0 -891
- package/src/graphql/graphql_field_helpers.ts +0 -221
- package/src/graphql/index.ts +0 -42
- package/src/graphql/mutations/union.ts +0 -39
- package/src/graphql/node_resolver.ts +0 -122
- package/src/graphql/query/connection_type.ts +0 -113
- package/src/graphql/query/edge_connection.ts +0 -171
- package/src/graphql/query/page_info.ts +0 -34
- package/src/graphql/query/shared_edge_connection.ts +0 -287
- package/src/graphql/scalars/orderby_direction.ts +0 -13
- package/src/graphql/scalars/time.ts +0 -38
- package/src/imports/dataz/example1/_auth.ts +0 -51
- package/src/imports/dataz/example1/_viewer.ts +0 -35
- package/src/imports/index.ts +0 -213
- package/src/index.ts +0 -145
- package/src/parse_schema/parse.ts +0 -585
- package/src/schema/base_schema.ts +0 -224
- package/src/schema/field.ts +0 -1087
- package/src/schema/index.ts +0 -53
- package/src/schema/json_field.ts +0 -94
- package/src/schema/schema.ts +0 -1028
- package/src/schema/struct_field.ts +0 -234
- package/src/schema/union_field.ts +0 -105
- package/src/scripts/custom_compiler.ts +0 -331
- package/src/scripts/custom_graphql.ts +0 -550
- package/src/scripts/migrate_v0.1.ts +0 -41
- package/src/scripts/move_types.ts +0 -131
- package/src/scripts/read_schema.ts +0 -67
- package/src/setupPackage.js +0 -42
- package/src/testutils/action/complex_schemas.ts +0 -517
- package/src/testutils/builder.ts +0 -422
- package/src/testutils/context/test_context.ts +0 -25
- package/src/testutils/db/fixture.ts +0 -32
- package/src/testutils/db/temp_db.ts +0 -941
- package/src/testutils/db/value.ts +0 -294
- package/src/testutils/db_mock.ts +0 -351
- package/src/testutils/db_time_zone.ts +0 -40
- package/src/testutils/ent-graphql-tests/index.ts +0 -653
- package/src/testutils/fake_comms.ts +0 -50
- package/src/testutils/fake_data/const.ts +0 -64
- package/src/testutils/fake_data/events_query.ts +0 -145
- package/src/testutils/fake_data/fake_contact.ts +0 -150
- package/src/testutils/fake_data/fake_event.ts +0 -150
- package/src/testutils/fake_data/fake_tag.ts +0 -139
- package/src/testutils/fake_data/fake_user.ts +0 -232
- package/src/testutils/fake_data/index.ts +0 -1
- package/src/testutils/fake_data/internal.ts +0 -8
- package/src/testutils/fake_data/tag_query.ts +0 -56
- package/src/testutils/fake_data/test_helpers.ts +0 -388
- package/src/testutils/fake_data/user_query.ts +0 -524
- package/src/testutils/fake_log.ts +0 -52
- package/src/testutils/mock_date.ts +0 -10
- package/src/testutils/mock_log.ts +0 -39
- package/src/testutils/parse_sql.ts +0 -685
- package/src/testutils/test_edge_global_schema.ts +0 -49
- package/src/testutils/write.ts +0 -70
- package/src/tsc/ast.ts +0 -351
- package/src/tsc/compilerOptions.ts +0 -85
- package/src/tsc/move_generated.ts +0 -191
- package/src/tsc/transform.ts +0 -226
- package/src/tsc/transform_action.ts +0 -224
- package/src/tsc/transform_ent.ts +0 -66
- package/src/tsc/transform_schema.ts +0 -546
- package/tsconfig.json +0 -20
- /package/{dist/action → action}/action.d.ts +0 -0
- /package/{dist/action → action}/action.js +0 -0
- /package/{dist/action → action}/executor.d.ts +0 -0
- /package/{dist/action → action}/executor.js +0 -0
- /package/{dist/action → action}/experimental_action.d.ts +0 -0
- /package/{dist/action → action}/experimental_action.js +0 -0
- /package/{dist/action → action}/index.d.ts +0 -0
- /package/{dist/action → action}/index.js +0 -0
- /package/{dist/action → action}/operations.d.ts +0 -0
- /package/{dist/action → action}/operations.js +0 -0
- /package/{dist/action → action}/orchestrator.d.ts +0 -0
- /package/{dist/action → action}/orchestrator.js +0 -0
- /package/{dist/action → action}/privacy.d.ts +0 -0
- /package/{dist/action → action}/privacy.js +0 -0
- /package/{dist/action → action}/relative_value.d.ts +0 -0
- /package/{dist/action → action}/relative_value.js +0 -0
- /package/{dist/action → action}/transaction.d.ts +0 -0
- /package/{dist/action → action}/transaction.js +0 -0
- /package/{dist/auth → auth}/auth.d.ts +0 -0
- /package/{dist/auth → auth}/auth.js +0 -0
- /package/{dist/auth → auth}/index.d.ts +0 -0
- /package/{dist/auth → auth}/index.js +0 -0
- /package/{dist/core → core}/base.d.ts +0 -0
- /package/{dist/core → core}/base.js +0 -0
- /package/{dist/core → core}/clause.d.ts +0 -0
- /package/{dist/core → core}/clause.js +0 -0
- /package/{dist/core → core}/config.d.ts +0 -0
- /package/{dist/core → core}/config.js +0 -0
- /package/{dist/core → core}/const.d.ts +0 -0
- /package/{dist/core → core}/const.js +0 -0
- /package/{dist/core → core}/context.d.ts +0 -0
- /package/{dist/core → core}/context.js +0 -0
- /package/{dist/core → core}/convert.d.ts +0 -0
- /package/{dist/core → core}/convert.js +0 -0
- /package/{dist/core → core}/date.d.ts +0 -0
- /package/{dist/core → core}/date.js +0 -0
- /package/{dist/core → core}/db.d.ts +0 -0
- /package/{dist/core → core}/db.js +0 -0
- /package/{dist/core → core}/ent.d.ts +0 -0
- /package/{dist/core → core}/ent.js +0 -0
- /package/{dist/core → core}/global_schema.d.ts +0 -0
- /package/{dist/core → core}/global_schema.js +0 -0
- /package/{dist/core → core}/loaders/assoc_count_loader.d.ts +0 -0
- /package/{dist/core → core}/loaders/assoc_count_loader.js +0 -0
- /package/{dist/core → core}/loaders/assoc_edge_loader.d.ts +0 -0
- /package/{dist/core → core}/loaders/assoc_edge_loader.js +0 -0
- /package/{dist/core → core}/loaders/index.d.ts +0 -0
- /package/{dist/core → core}/loaders/index.js +0 -0
- /package/{dist/core → core}/loaders/loader.d.ts +0 -0
- /package/{dist/core → core}/loaders/loader.js +0 -0
- /package/{dist/core → core}/loaders/object_loader.d.ts +0 -0
- /package/{dist/core → core}/loaders/object_loader.js +0 -0
- /package/{dist/core → core}/loaders/query_loader.d.ts +0 -0
- /package/{dist/core → core}/loaders/query_loader.js +0 -0
- /package/{dist/core → core}/loaders/raw_count_loader.d.ts +0 -0
- /package/{dist/core → core}/loaders/raw_count_loader.js +0 -0
- /package/{dist/core → core}/logger.d.ts +0 -0
- /package/{dist/core → core}/logger.js +0 -0
- /package/{dist/core → core}/privacy.d.ts +0 -0
- /package/{dist/core → core}/privacy.js +0 -0
- /package/{dist/core → core}/query/assoc_query.d.ts +0 -0
- /package/{dist/core → core}/query/assoc_query.js +0 -0
- /package/{dist/core → core}/query/custom_clause_query.d.ts +0 -0
- /package/{dist/core → core}/query/custom_clause_query.js +0 -0
- /package/{dist/core → core}/query/custom_query.d.ts +0 -0
- /package/{dist/core → core}/query/custom_query.js +0 -0
- /package/{dist/core → core}/query/index.d.ts +0 -0
- /package/{dist/core → core}/query/index.js +0 -0
- /package/{dist/core → core}/query/query.d.ts +0 -0
- /package/{dist/core → core}/query/query.js +0 -0
- /package/{dist/core → core}/query_impl.d.ts +0 -0
- /package/{dist/core → core}/query_impl.js +0 -0
- /package/{dist/core → core}/viewer.d.ts +0 -0
- /package/{dist/core → core}/viewer.js +0 -0
- /package/{dist/graphql → graphql}/builtins/connection.d.ts +0 -0
- /package/{dist/graphql → graphql}/builtins/connection.js +0 -0
- /package/{dist/graphql → graphql}/builtins/edge.d.ts +0 -0
- /package/{dist/graphql → graphql}/builtins/edge.js +0 -0
- /package/{dist/graphql → graphql}/builtins/node.d.ts +0 -0
- /package/{dist/graphql → graphql}/builtins/node.js +0 -0
- /package/{dist/graphql → graphql}/graphql.d.ts +0 -0
- /package/{dist/graphql → graphql}/graphql.js +0 -0
- /package/{dist/graphql → graphql}/graphql_field_helpers.d.ts +0 -0
- /package/{dist/graphql → graphql}/graphql_field_helpers.js +0 -0
- /package/{dist/graphql → graphql}/index.d.ts +0 -0
- /package/{dist/graphql → graphql}/index.js +0 -0
- /package/{dist/graphql → graphql}/mutations/union.d.ts +0 -0
- /package/{dist/graphql → graphql}/mutations/union.js +0 -0
- /package/{dist/graphql → graphql}/node_resolver.d.ts +0 -0
- /package/{dist/graphql → graphql}/node_resolver.js +0 -0
- /package/{dist/graphql → graphql}/query/connection_type.d.ts +0 -0
- /package/{dist/graphql → graphql}/query/connection_type.js +0 -0
- /package/{dist/graphql → graphql}/query/edge_connection.d.ts +0 -0
- /package/{dist/graphql → graphql}/query/edge_connection.js +0 -0
- /package/{dist/graphql → graphql}/query/page_info.d.ts +0 -0
- /package/{dist/graphql → graphql}/query/page_info.js +0 -0
- /package/{dist/graphql → graphql}/query/shared_edge_connection.d.ts +0 -0
- /package/{dist/graphql → graphql}/query/shared_edge_connection.js +0 -0
- /package/{dist/graphql → graphql}/scalars/orderby_direction.d.ts +0 -0
- /package/{dist/graphql → graphql}/scalars/orderby_direction.js +0 -0
- /package/{dist/graphql → graphql}/scalars/time.d.ts +0 -0
- /package/{dist/graphql → graphql}/scalars/time.js +0 -0
- /package/{dist/imports → imports}/dataz/example1/_auth.d.ts +0 -0
- /package/{dist/imports → imports}/dataz/example1/_auth.js +0 -0
- /package/{dist/imports → imports}/dataz/example1/_viewer.d.ts +0 -0
- /package/{dist/imports → imports}/dataz/example1/_viewer.js +0 -0
- /package/{dist/imports → imports}/index.d.ts +0 -0
- /package/{dist/imports → imports}/index.js +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/parse_schema → parse_schema}/parse.d.ts +0 -0
- /package/{dist/parse_schema → parse_schema}/parse.js +0 -0
- /package/{dist/schema → schema}/base_schema.d.ts +0 -0
- /package/{dist/schema → schema}/base_schema.js +0 -0
- /package/{dist/schema → schema}/field.d.ts +0 -0
- /package/{dist/schema → schema}/field.js +0 -0
- /package/{dist/schema → schema}/index.d.ts +0 -0
- /package/{dist/schema → schema}/index.js +0 -0
- /package/{dist/schema → schema}/json_field.d.ts +0 -0
- /package/{dist/schema → schema}/json_field.js +0 -0
- /package/{dist/schema → schema}/schema.d.ts +0 -0
- /package/{dist/schema → schema}/schema.js +0 -0
- /package/{dist/schema → schema}/struct_field.d.ts +0 -0
- /package/{dist/schema → schema}/struct_field.js +0 -0
- /package/{dist/schema → schema}/union_field.d.ts +0 -0
- /package/{dist/schema → schema}/union_field.js +0 -0
- /package/{dist/scripts → scripts}/custom_compiler.d.ts +0 -0
- /package/{dist/scripts → scripts}/custom_graphql.d.ts +0 -0
- /package/{dist/scripts → scripts}/migrate_v0.1.d.ts +0 -0
- /package/{dist/scripts → scripts}/migrate_v0.1.js +0 -0
- /package/{dist/scripts → scripts}/move_types.d.ts +0 -0
- /package/{dist/scripts → scripts}/move_types.js +0 -0
- /package/{dist/scripts → scripts}/read_schema.d.ts +0 -0
- /package/{dist/scripts → scripts}/read_schema.js +0 -0
- /package/{dist/testutils → testutils}/action/complex_schemas.d.ts +0 -0
- /package/{dist/testutils → testutils}/action/complex_schemas.js +0 -0
- /package/{dist/testutils → testutils}/builder.d.ts +0 -0
- /package/{dist/testutils → testutils}/builder.js +0 -0
- /package/{dist/testutils → testutils}/context/test_context.d.ts +0 -0
- /package/{dist/testutils → testutils}/context/test_context.js +0 -0
- /package/{dist/testutils → testutils}/db/fixture.d.ts +0 -0
- /package/{dist/testutils → testutils}/db/fixture.js +0 -0
- /package/{dist/testutils → testutils}/db/temp_db.d.ts +0 -0
- /package/{dist/testutils → testutils}/db/temp_db.js +0 -0
- /package/{dist/testutils → testutils}/db/value.d.ts +0 -0
- /package/{dist/testutils → testutils}/db/value.js +0 -0
- /package/{dist/testutils → testutils}/db_mock.d.ts +0 -0
- /package/{dist/testutils → testutils}/db_mock.js +0 -0
- /package/{dist/testutils → testutils}/db_time_zone.d.ts +0 -0
- /package/{dist/testutils → testutils}/db_time_zone.js +0 -0
- /package/{dist/testutils → testutils}/ent-graphql-tests/index.d.ts +0 -0
- /package/{dist/testutils → testutils}/ent-graphql-tests/index.js +0 -0
- /package/{dist/testutils → testutils}/fake_comms.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_comms.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/const.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/const.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/events_query.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/events_query.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_contact.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_contact.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_event.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_event.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_tag.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_tag.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_user.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/fake_user.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/index.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/index.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/internal.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/internal.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/tag_query.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/tag_query.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/test_helpers.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/test_helpers.js +0 -0
- /package/{dist/testutils → testutils}/fake_data/user_query.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_data/user_query.js +0 -0
- /package/{dist/testutils → testutils}/fake_log.d.ts +0 -0
- /package/{dist/testutils → testutils}/fake_log.js +0 -0
- /package/{dist/testutils → testutils}/mock_date.d.ts +0 -0
- /package/{dist/testutils → testutils}/mock_date.js +0 -0
- /package/{dist/testutils → testutils}/mock_log.d.ts +0 -0
- /package/{dist/testutils → testutils}/mock_log.js +0 -0
- /package/{dist/testutils → testutils}/parse_sql.d.ts +0 -0
- /package/{dist/testutils → testutils}/parse_sql.js +0 -0
- /package/{dist/testutils → testutils}/test_edge_global_schema.d.ts +0 -0
- /package/{dist/testutils → testutils}/test_edge_global_schema.js +0 -0
- /package/{dist/testutils → testutils}/write.d.ts +0 -0
- /package/{dist/testutils → testutils}/write.js +0 -0
- /package/{dist/tsc → tsc}/ast.d.ts +0 -0
- /package/{dist/tsc → tsc}/ast.js +0 -0
- /package/{dist/tsc → tsc}/compilerOptions.d.ts +0 -0
- /package/{dist/tsc → tsc}/compilerOptions.js +0 -0
- /package/{dist/tsc → tsc}/move_generated.d.ts +0 -0
- /package/{dist/tsc → tsc}/move_generated.js +0 -0
- /package/{dist/tsc → tsc}/transform.d.ts +0 -0
- /package/{dist/tsc → tsc}/transform.js +0 -0
- /package/{dist/tsc → tsc}/transform_action.d.ts +0 -0
- /package/{dist/tsc → tsc}/transform_action.js +0 -0
- /package/{dist/tsc → tsc}/transform_ent.d.ts +0 -0
- /package/{dist/tsc → tsc}/transform_ent.js +0 -0
- /package/{dist/tsc → tsc}/transform_schema.d.ts +0 -0
- /package/{dist/tsc → tsc}/transform_schema.js +0 -0
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { FieldMap, Pattern, FieldOverrideMap } from "./schema";
|
|
2
|
-
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
import { TimestampType, UUIDType } from "./field";
|
|
4
|
-
import { Action, AssocEdgeGroup, Constraint, Edge, Index, Schema } from ".";
|
|
5
|
-
|
|
6
|
-
let tsFields: FieldMap = {
|
|
7
|
-
createdAt: TimestampType({
|
|
8
|
-
hideFromGraphQL: true,
|
|
9
|
-
disableUserEditable: true,
|
|
10
|
-
defaultValueOnCreate: () => {
|
|
11
|
-
return new Date();
|
|
12
|
-
},
|
|
13
|
-
}),
|
|
14
|
-
updatedAt: TimestampType({
|
|
15
|
-
hideFromGraphQL: true,
|
|
16
|
-
disableUserEditable: true,
|
|
17
|
-
defaultValueOnCreate: () => {
|
|
18
|
-
return new Date();
|
|
19
|
-
},
|
|
20
|
-
onlyUpdateIfOtherFieldsBeingSet_BETA: true,
|
|
21
|
-
defaultValueOnEdit: () => {
|
|
22
|
-
return new Date();
|
|
23
|
-
},
|
|
24
|
-
}),
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// Timestamps is a Pattern that adds a createdAt and updatedAt timestamp fields to the ent
|
|
28
|
-
export const Timestamps: Pattern = {
|
|
29
|
-
name: "timestamps",
|
|
30
|
-
fields: tsFields,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
let nodeField = UUIDType({
|
|
34
|
-
primaryKey: true,
|
|
35
|
-
disableUserEditable: true,
|
|
36
|
-
defaultValueOnCreate: () => {
|
|
37
|
-
return uuidv4();
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
let nodeFields: FieldMap = {
|
|
42
|
-
// inconsistent naming :(
|
|
43
|
-
ID: nodeField,
|
|
44
|
-
...tsFields,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
let nodeFieldsWithTZ: FieldMap = {
|
|
48
|
-
// inconsistent naming :(
|
|
49
|
-
ID: nodeField,
|
|
50
|
-
createdAt: TimestampType({
|
|
51
|
-
hideFromGraphQL: true,
|
|
52
|
-
disableUserEditable: true,
|
|
53
|
-
defaultValueOnCreate: () => {
|
|
54
|
-
return new Date();
|
|
55
|
-
},
|
|
56
|
-
withTimezone: true,
|
|
57
|
-
}),
|
|
58
|
-
updatedAt: TimestampType({
|
|
59
|
-
hideFromGraphQL: true,
|
|
60
|
-
disableUserEditable: true,
|
|
61
|
-
defaultValueOnCreate: () => {
|
|
62
|
-
return new Date();
|
|
63
|
-
},
|
|
64
|
-
defaultValueOnEdit: () => {
|
|
65
|
-
return new Date();
|
|
66
|
-
},
|
|
67
|
-
withTimezone: true,
|
|
68
|
-
}),
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// Node is a Pattern that adds 3 fields to the ent: (id, createdAt, and updatedAt timestamps)
|
|
72
|
-
export const Node: Pattern = {
|
|
73
|
-
name: "node",
|
|
74
|
-
fields: nodeFields,
|
|
75
|
-
disableMixin: true,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export interface SchemaConfig extends Schema {}
|
|
79
|
-
|
|
80
|
-
// Ent schema. has Node Pattern by default.
|
|
81
|
-
// exists just to have less typing and easier for clients to implement
|
|
82
|
-
export class EntSchema implements Schema {
|
|
83
|
-
fields: FieldMap;
|
|
84
|
-
|
|
85
|
-
fieldOverrides: FieldOverrideMap | undefined;
|
|
86
|
-
|
|
87
|
-
tableName: string | undefined;
|
|
88
|
-
|
|
89
|
-
patterns: Pattern[] = [Node];
|
|
90
|
-
|
|
91
|
-
edges: Edge[] | undefined;
|
|
92
|
-
|
|
93
|
-
edgeGroups: AssocEdgeGroup[] | undefined;
|
|
94
|
-
|
|
95
|
-
actions: Action[] | undefined;
|
|
96
|
-
|
|
97
|
-
enumTable: boolean | undefined;
|
|
98
|
-
|
|
99
|
-
dbRows: { [key: string]: any }[] | undefined;
|
|
100
|
-
|
|
101
|
-
constraints: Constraint[] | undefined;
|
|
102
|
-
|
|
103
|
-
indices: Index[] | undefined;
|
|
104
|
-
|
|
105
|
-
hideFromGraphQL?: boolean;
|
|
106
|
-
|
|
107
|
-
customGraphQLInterfaces?: string[] | undefined;
|
|
108
|
-
|
|
109
|
-
supportUpsert?: boolean | undefined;
|
|
110
|
-
|
|
111
|
-
showCanViewerSee?: boolean | undefined;
|
|
112
|
-
|
|
113
|
-
showCanViewerEdit?: boolean | undefined;
|
|
114
|
-
|
|
115
|
-
constructor(cfg: SchemaConfig) {
|
|
116
|
-
this.fields = cfg.fields;
|
|
117
|
-
this.fieldOverrides = cfg.fieldOverrides;
|
|
118
|
-
this.tableName = cfg.tableName;
|
|
119
|
-
if (cfg.patterns) {
|
|
120
|
-
this.patterns.push(...cfg.patterns);
|
|
121
|
-
}
|
|
122
|
-
this.edges = cfg.edges;
|
|
123
|
-
this.edgeGroups = cfg.edgeGroups;
|
|
124
|
-
this.actions = cfg.actions;
|
|
125
|
-
this.enumTable = cfg.enumTable;
|
|
126
|
-
this.dbRows = cfg.dbRows;
|
|
127
|
-
this.constraints = cfg.constraints;
|
|
128
|
-
this.indices = cfg.indices;
|
|
129
|
-
this.hideFromGraphQL = cfg.hideFromGraphQL;
|
|
130
|
-
// TODO annoying that have to list these...
|
|
131
|
-
this.customGraphQLInterfaces = cfg.customGraphQLInterfaces;
|
|
132
|
-
this.supportUpsert = cfg.supportUpsert;
|
|
133
|
-
this.showCanViewerSee = cfg.showCanViewerSee;
|
|
134
|
-
this.showCanViewerEdit = cfg.showCanViewerEdit;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export class EntSchemaWithTZ implements Schema {
|
|
139
|
-
fields: FieldMap;
|
|
140
|
-
|
|
141
|
-
fieldOverrides: FieldOverrideMap | undefined;
|
|
142
|
-
|
|
143
|
-
tableName: string | undefined;
|
|
144
|
-
|
|
145
|
-
patterns: Pattern[] = [
|
|
146
|
-
{
|
|
147
|
-
// default schema added
|
|
148
|
-
name: "nodeWithTZ",
|
|
149
|
-
fields: nodeFieldsWithTZ,
|
|
150
|
-
disableMixin: true,
|
|
151
|
-
},
|
|
152
|
-
];
|
|
153
|
-
|
|
154
|
-
edges: Edge[] | undefined;
|
|
155
|
-
|
|
156
|
-
edgeGroups: AssocEdgeGroup[] | undefined;
|
|
157
|
-
|
|
158
|
-
actions: Action[] | undefined;
|
|
159
|
-
|
|
160
|
-
enumTable: boolean | undefined;
|
|
161
|
-
|
|
162
|
-
dbRows: { [key: string]: any }[] | undefined;
|
|
163
|
-
|
|
164
|
-
constraints: Constraint[] | undefined;
|
|
165
|
-
|
|
166
|
-
indices: Index[] | undefined;
|
|
167
|
-
|
|
168
|
-
hideFromGraphQL?: boolean;
|
|
169
|
-
|
|
170
|
-
customGraphQLInterfaces?: string[] | undefined;
|
|
171
|
-
|
|
172
|
-
supportUpsert?: boolean | undefined;
|
|
173
|
-
|
|
174
|
-
showCanViewerSee?: boolean | undefined;
|
|
175
|
-
|
|
176
|
-
showCanViewerEdit?: boolean | undefined;
|
|
177
|
-
|
|
178
|
-
constructor(cfg: SchemaConfig) {
|
|
179
|
-
this.fields = cfg.fields;
|
|
180
|
-
this.fieldOverrides = cfg.fieldOverrides;
|
|
181
|
-
this.tableName = cfg.tableName;
|
|
182
|
-
if (cfg.patterns) {
|
|
183
|
-
this.patterns.push(...cfg.patterns);
|
|
184
|
-
}
|
|
185
|
-
this.edges = cfg.edges;
|
|
186
|
-
this.edgeGroups = cfg.edgeGroups;
|
|
187
|
-
this.actions = cfg.actions;
|
|
188
|
-
this.enumTable = cfg.enumTable;
|
|
189
|
-
this.dbRows = cfg.dbRows;
|
|
190
|
-
this.constraints = cfg.constraints;
|
|
191
|
-
this.indices = cfg.indices;
|
|
192
|
-
this.hideFromGraphQL = cfg.hideFromGraphQL;
|
|
193
|
-
// TODO annoying that have to list these...
|
|
194
|
-
this.customGraphQLInterfaces = cfg.customGraphQLInterfaces;
|
|
195
|
-
this.supportUpsert = cfg.supportUpsert;
|
|
196
|
-
this.showCanViewerSee = cfg.showCanViewerSee;
|
|
197
|
-
this.showCanViewerEdit = cfg.showCanViewerEdit;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// @deprecated use EntSchema
|
|
202
|
-
export abstract class BaseEntSchema {
|
|
203
|
-
addPatterns(...patterns: Pattern[]) {
|
|
204
|
-
this.patterns.push(...patterns);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
patterns: Pattern[] = [Node];
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// @deprecated use EntSchemaWithTZ
|
|
211
|
-
export abstract class BaseEntSchemaWithTZ {
|
|
212
|
-
addPatterns(...patterns: Pattern[]) {
|
|
213
|
-
this.patterns.push(...patterns);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
patterns: Pattern[] = [
|
|
217
|
-
{
|
|
218
|
-
// default schema added
|
|
219
|
-
name: "nodeWithTZ",
|
|
220
|
-
fields: nodeFieldsWithTZ,
|
|
221
|
-
disableMixin: true,
|
|
222
|
-
},
|
|
223
|
-
];
|
|
224
|
-
}
|