@snowtop/ent 0.1.0-alpha15 → 0.1.0-alpha150
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 +27 -16
- package/action/action.js +22 -7
- package/action/executor.d.ts +16 -3
- package/action/executor.js +90 -23
- package/action/experimental_action.d.ts +25 -16
- package/action/experimental_action.js +35 -9
- package/action/index.d.ts +3 -1
- package/action/index.js +7 -1
- package/action/operations.d.ts +125 -0
- package/action/operations.js +684 -0
- package/action/orchestrator.d.ts +38 -12
- package/action/orchestrator.js +427 -102
- package/action/relative_value.d.ts +47 -0
- package/action/relative_value.js +125 -0
- package/action/transaction.d.ts +10 -0
- package/action/transaction.js +23 -0
- package/auth/auth.d.ts +1 -1
- package/core/base.d.ts +51 -21
- package/core/base.js +7 -1
- package/core/clause.d.ts +85 -40
- package/core/clause.js +375 -64
- package/core/config.d.ts +15 -1
- package/core/config.js +10 -1
- package/core/const.d.ts +3 -0
- package/core/const.js +6 -0
- package/core/context.d.ts +4 -2
- package/core/context.js +20 -2
- package/core/convert.d.ts +1 -1
- package/core/date.js +1 -5
- package/core/db.d.ts +12 -8
- package/core/db.js +18 -8
- package/core/ent.d.ts +68 -94
- package/core/ent.js +535 -586
- package/core/global_schema.d.ts +7 -0
- package/core/global_schema.js +51 -0
- package/core/loaders/assoc_count_loader.d.ts +1 -0
- package/core/loaders/assoc_count_loader.js +10 -2
- package/core/loaders/assoc_edge_loader.d.ts +1 -1
- package/core/loaders/assoc_edge_loader.js +10 -13
- package/core/loaders/index.d.ts +1 -1
- package/core/loaders/index.js +1 -3
- package/core/loaders/index_loader.d.ts +3 -3
- package/core/loaders/loader.d.ts +2 -2
- package/core/loaders/loader.js +5 -5
- package/core/loaders/object_loader.d.ts +30 -9
- package/core/loaders/object_loader.js +225 -78
- package/core/loaders/query_loader.d.ts +6 -12
- package/core/loaders/query_loader.js +54 -13
- package/core/loaders/raw_count_loader.js +5 -1
- package/core/logger.d.ts +1 -1
- package/core/logger.js +1 -0
- package/core/privacy.d.ts +7 -6
- package/core/privacy.js +21 -25
- package/core/query/assoc_query.d.ts +3 -2
- package/core/query/assoc_query.js +9 -1
- package/core/query/custom_clause_query.d.ts +27 -0
- package/core/query/custom_clause_query.js +88 -0
- package/core/query/custom_query.d.ts +17 -2
- package/core/query/custom_query.js +88 -13
- package/core/query/index.d.ts +1 -0
- package/core/query/index.js +3 -1
- package/core/query/query.d.ts +15 -3
- package/core/query/query.js +128 -53
- package/core/query/shared_assoc_test.d.ts +2 -1
- package/core/query/shared_assoc_test.js +44 -54
- package/core/query/shared_test.d.ts +8 -1
- package/core/query/shared_test.js +532 -236
- package/core/viewer.d.ts +2 -0
- package/core/viewer.js +3 -1
- package/graphql/graphql.d.ts +52 -19
- package/graphql/graphql.js +174 -136
- package/graphql/graphql_field_helpers.d.ts +7 -1
- package/graphql/graphql_field_helpers.js +21 -1
- package/graphql/index.d.ts +2 -2
- package/graphql/index.js +3 -5
- package/graphql/query/connection_type.d.ts +9 -9
- package/graphql/query/shared_assoc_test.js +1 -1
- package/graphql/query/shared_edge_connection.js +1 -19
- package/graphql/scalars/orderby_direction.d.ts +2 -0
- package/graphql/scalars/orderby_direction.js +15 -0
- package/imports/dataz/example1/_auth.js +128 -47
- package/imports/dataz/example1/_viewer.js +87 -39
- package/imports/index.d.ts +7 -2
- package/imports/index.js +20 -5
- package/index.d.ts +14 -5
- package/index.js +26 -10
- package/package.json +18 -17
- package/parse_schema/parse.d.ts +31 -9
- package/parse_schema/parse.js +179 -32
- package/schema/base_schema.d.ts +13 -3
- package/schema/base_schema.js +13 -0
- package/schema/field.d.ts +78 -21
- package/schema/field.js +231 -71
- package/schema/index.d.ts +2 -2
- package/schema/index.js +7 -2
- package/schema/json_field.d.ts +16 -4
- package/schema/json_field.js +32 -2
- package/schema/schema.d.ts +109 -20
- package/schema/schema.js +42 -53
- package/schema/struct_field.d.ts +15 -3
- package/schema/struct_field.js +117 -22
- package/schema/union_field.d.ts +1 -1
- package/scripts/custom_compiler.js +12 -8
- package/scripts/custom_graphql.js +145 -34
- package/scripts/migrate_v0.1.js +36 -0
- package/scripts/move_types.js +120 -0
- package/scripts/read_schema.js +22 -7
- package/testutils/action/complex_schemas.d.ts +69 -0
- package/testutils/action/complex_schemas.js +405 -0
- package/testutils/builder.d.ts +39 -43
- package/testutils/builder.js +75 -49
- package/testutils/db/fixture.d.ts +10 -0
- package/testutils/db/fixture.js +26 -0
- package/testutils/db/{test_db.d.ts → temp_db.d.ts} +32 -8
- package/testutils/db/{test_db.js → temp_db.js} +244 -48
- package/testutils/db/value.d.ts +7 -0
- package/testutils/db/value.js +251 -0
- package/testutils/db_mock.d.ts +16 -4
- package/testutils/db_mock.js +52 -9
- package/testutils/db_time_zone.d.ts +4 -0
- package/testutils/db_time_zone.js +41 -0
- package/testutils/ent-graphql-tests/index.d.ts +7 -1
- package/testutils/ent-graphql-tests/index.js +56 -26
- package/testutils/fake_comms.js +1 -1
- package/testutils/fake_data/const.d.ts +2 -1
- package/testutils/fake_data/const.js +3 -0
- package/testutils/fake_data/fake_contact.d.ts +7 -3
- package/testutils/fake_data/fake_contact.js +13 -7
- package/testutils/fake_data/fake_event.d.ts +4 -1
- package/testutils/fake_data/fake_event.js +7 -6
- package/testutils/fake_data/fake_tag.d.ts +36 -0
- package/testutils/fake_data/fake_tag.js +89 -0
- package/testutils/fake_data/fake_user.d.ts +8 -5
- package/testutils/fake_data/fake_user.js +16 -15
- package/testutils/fake_data/index.js +5 -1
- package/testutils/fake_data/internal.d.ts +2 -0
- package/testutils/fake_data/internal.js +7 -1
- package/testutils/fake_data/tag_query.d.ts +13 -0
- package/testutils/fake_data/tag_query.js +43 -0
- package/testutils/fake_data/test_helpers.d.ts +11 -4
- package/testutils/fake_data/test_helpers.js +29 -13
- package/testutils/fake_data/user_query.d.ts +11 -4
- package/testutils/fake_data/user_query.js +54 -22
- package/testutils/fake_log.js +1 -1
- package/testutils/parse_sql.d.ts +6 -0
- package/testutils/parse_sql.js +16 -2
- package/testutils/test_edge_global_schema.d.ts +15 -0
- package/testutils/test_edge_global_schema.js +62 -0
- package/testutils/write.d.ts +2 -2
- package/testutils/write.js +33 -7
- package/tsc/ast.d.ts +25 -2
- package/tsc/ast.js +141 -17
- package/tsc/compilerOptions.js +5 -1
- package/tsc/move_generated.d.ts +1 -0
- package/tsc/move_generated.js +164 -0
- package/tsc/transform.d.ts +22 -0
- package/tsc/transform.js +182 -0
- package/tsc/transform_action.d.ts +22 -0
- package/tsc/transform_action.js +183 -0
- package/tsc/transform_ent.d.ts +17 -0
- package/tsc/transform_ent.js +60 -0
- package/tsc/transform_schema.d.ts +27 -0
- package/{scripts → tsc}/transform_schema.js +146 -117
- package/graphql/enums.d.ts +0 -3
- package/graphql/enums.js +0 -25
- package/scripts/move_generated.js +0 -142
- package/scripts/transform_code.js +0 -113
- package/scripts/transform_schema.d.ts +0 -1
- /package/scripts/{move_generated.d.ts → migrate_v0.1.d.ts} +0 -0
- /package/scripts/{transform_code.d.ts → move_types.d.ts} +0 -0
|
@@ -5,7 +5,6 @@ import * as clause from "../../core/clause";
|
|
|
5
5
|
import { AssocEdgeQueryBase, EdgeQuerySource } from "../../core/query/assoc_query";
|
|
6
6
|
import { FakeUser, FakeEvent, FakeContact, EventToAttendeesQuery, EventToDeclinedQuery, EventToHostsQuery, EventToInvitedQuery, EventToMaybeQuery } from "./internal";
|
|
7
7
|
import { RawCountLoaderFactory } from "../../core/loaders/raw_count_loader";
|
|
8
|
-
import { IndexLoaderFactory } from "../../core/loaders/index_loader";
|
|
9
8
|
import { QueryLoaderFactory } from "../../core/loaders/query_loader";
|
|
10
9
|
export declare class UserToContactsQuery extends AssocEdgeQueryBase<FakeUser, FakeContact, AssocEdge> {
|
|
11
10
|
constructor(viewer: Viewer, src: EdgeQuerySource<FakeUser>);
|
|
@@ -13,12 +12,22 @@ export declare class UserToContactsQuery extends AssocEdgeQueryBase<FakeUser, Fa
|
|
|
13
12
|
sourceEnt(id: ID): Promise<FakeUser | null>;
|
|
14
13
|
}
|
|
15
14
|
export declare const userToContactsCountLoaderFactory: RawCountLoaderFactory;
|
|
16
|
-
export declare const userToContactsDataLoaderFactory:
|
|
15
|
+
export declare const userToContactsDataLoaderFactory: QueryLoaderFactory<unknown>;
|
|
16
|
+
export declare class UserToContactsFkeyQueryDeprecated extends CustomEdgeQueryBase<FakeUser, FakeContact> {
|
|
17
|
+
constructor(viewer: Viewer, src: ID | FakeUser);
|
|
18
|
+
static query(viewer: Viewer, src: FakeUser | ID): UserToContactsFkeyQueryDeprecated;
|
|
19
|
+
sourceEnt(id: ID): Promise<FakeUser | null>;
|
|
20
|
+
}
|
|
17
21
|
export declare class UserToContactsFkeyQuery extends CustomEdgeQueryBase<FakeUser, FakeContact> {
|
|
18
22
|
constructor(viewer: Viewer, src: ID | FakeUser);
|
|
19
23
|
static query(viewer: Viewer, src: FakeUser | ID): UserToContactsFkeyQuery;
|
|
20
24
|
sourceEnt(id: ID): Promise<FakeUser | null>;
|
|
21
25
|
}
|
|
26
|
+
export declare class UserToContactsFkeyQueryAsc extends CustomEdgeQueryBase<FakeUser, FakeContact> {
|
|
27
|
+
constructor(viewer: Viewer, src: ID | FakeUser);
|
|
28
|
+
static query(viewer: Viewer, src: FakeUser | ID): UserToContactsFkeyQuery;
|
|
29
|
+
sourceEnt(id: ID): Promise<FakeUser | null>;
|
|
30
|
+
}
|
|
22
31
|
export declare class UserToFriendsQuery extends AssocEdgeQueryBase<FakeUser, FakeUser, AssocEdge> {
|
|
23
32
|
constructor(viewer: Viewer, src: EdgeQuerySource<FakeUser>);
|
|
24
33
|
static query(viewer: Viewer, src: EdgeQuerySource<FakeUser>): UserToFriendsQuery;
|
|
@@ -84,8 +93,6 @@ export declare class UserToHostedEventsQuery extends AssocEdgeQueryBase<FakeUser
|
|
|
84
93
|
}
|
|
85
94
|
export declare const getNextWeekClause: () => clause.Clause;
|
|
86
95
|
export declare function getCompleteClause(id: ID): clause.Clause;
|
|
87
|
-
export declare const userToEventsInNextWeekCountLoaderFactory: RawCountLoaderFactory;
|
|
88
|
-
export declare const userToEventsInNextWeekDataLoaderFactory: QueryLoaderFactory<unknown>;
|
|
89
96
|
export declare class UserToEventsInNextWeekQuery extends CustomEdgeQueryBase<FakeUser, FakeEvent> {
|
|
90
97
|
constructor(viewer: Viewer, src: ID | FakeUser);
|
|
91
98
|
static query(viewer: Viewer, src: FakeUser | ID): UserToEventsInNextWeekQuery;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.UserToFollowingQuery = exports.UserToEventsInNextWeekQuery = exports.
|
|
26
|
+
exports.UserToFollowingQuery = exports.UserToEventsInNextWeekQuery = exports.getCompleteClause = exports.getNextWeekClause = exports.UserToHostedEventsQuery = exports.UserToEventsAttendingQuery = exports.UserToIncomingFriendRequestsQuery = exports.UserToFriendRequestsQuery = exports.UserToCustomEdgeQuery = exports.CustomEdge = exports.UserToFriendsQuery = exports.UserToContactsFkeyQueryAsc = exports.UserToContactsFkeyQuery = exports.UserToContactsFkeyQueryDeprecated = exports.userToContactsDataLoaderFactory = exports.userToContactsCountLoaderFactory = exports.UserToContactsQuery = void 0;
|
|
23
27
|
const custom_query_1 = require("../../core/query/custom_query");
|
|
24
28
|
const ent_1 = require("../../core/ent");
|
|
25
29
|
const clause = __importStar(require("../../core/clause"));
|
|
@@ -28,7 +32,6 @@ const internal_1 = require("./internal");
|
|
|
28
32
|
const raw_count_loader_1 = require("../../core/loaders/raw_count_loader");
|
|
29
33
|
const assoc_count_loader_1 = require("../../core/loaders/assoc_count_loader");
|
|
30
34
|
const assoc_edge_loader_1 = require("../../core/loaders/assoc_edge_loader");
|
|
31
|
-
const index_loader_1 = require("../../core/loaders/index_loader");
|
|
32
35
|
const fake_contact_1 = require("./fake_contact");
|
|
33
36
|
const jest_date_mock_1 = require("jest-date-mock");
|
|
34
37
|
const luxon_1 = require("luxon");
|
|
@@ -52,10 +55,13 @@ exports.userToContactsCountLoaderFactory = new raw_count_loader_1.RawCountLoader
|
|
|
52
55
|
...internal_1.FakeContact.loaderOptions(),
|
|
53
56
|
groupCol: "user_id",
|
|
54
57
|
});
|
|
55
|
-
exports.userToContactsDataLoaderFactory = new
|
|
58
|
+
exports.userToContactsDataLoaderFactory = new query_loader_1.QueryLoaderFactory({
|
|
59
|
+
...internal_1.FakeContact.loaderOptions(),
|
|
60
|
+
groupCol: "user_id",
|
|
56
61
|
toPrime: [fake_contact_1.contactLoader],
|
|
57
62
|
});
|
|
58
|
-
|
|
63
|
+
// note: this is still used in graphql tests...
|
|
64
|
+
class UserToContactsFkeyQueryDeprecated extends custom_query_1.CustomEdgeQueryBase {
|
|
59
65
|
constructor(viewer, src) {
|
|
60
66
|
super(viewer, {
|
|
61
67
|
src,
|
|
@@ -63,6 +69,27 @@ class UserToContactsFkeyQuery extends custom_query_1.CustomEdgeQueryBase {
|
|
|
63
69
|
countLoaderFactory: exports.userToContactsCountLoaderFactory,
|
|
64
70
|
dataLoaderFactory: exports.userToContactsDataLoaderFactory,
|
|
65
71
|
options: internal_1.FakeContact.loaderOptions(),
|
|
72
|
+
sortColumn: "created_at",
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
static query(viewer, src) {
|
|
76
|
+
return new UserToContactsFkeyQueryDeprecated(viewer, src);
|
|
77
|
+
}
|
|
78
|
+
sourceEnt(id) {
|
|
79
|
+
return internal_1.FakeUser.load(this.viewer, id);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.UserToContactsFkeyQueryDeprecated = UserToContactsFkeyQueryDeprecated;
|
|
83
|
+
// this replaces UserToContactsFkeyQueryDeprecated
|
|
84
|
+
class UserToContactsFkeyQuery extends custom_query_1.CustomEdgeQueryBase {
|
|
85
|
+
constructor(viewer, src) {
|
|
86
|
+
super(viewer, {
|
|
87
|
+
src,
|
|
88
|
+
loadEntOptions: internal_1.FakeContact.loaderOptions(),
|
|
89
|
+
groupCol: "user_id",
|
|
90
|
+
name: "user_to_contacts",
|
|
91
|
+
// instead of the id col...
|
|
92
|
+
sortColumn: "created_at",
|
|
66
93
|
});
|
|
67
94
|
}
|
|
68
95
|
static query(viewer, src) {
|
|
@@ -73,6 +100,24 @@ class UserToContactsFkeyQuery extends custom_query_1.CustomEdgeQueryBase {
|
|
|
73
100
|
}
|
|
74
101
|
}
|
|
75
102
|
exports.UserToContactsFkeyQuery = UserToContactsFkeyQuery;
|
|
103
|
+
class UserToContactsFkeyQueryAsc extends custom_query_1.CustomEdgeQueryBase {
|
|
104
|
+
constructor(viewer, src) {
|
|
105
|
+
super(viewer, {
|
|
106
|
+
src,
|
|
107
|
+
loadEntOptions: internal_1.FakeContact.loaderOptions(),
|
|
108
|
+
groupCol: "user_id",
|
|
109
|
+
name: "user_to_contacts",
|
|
110
|
+
sortColumn: "created_at ASC",
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
static query(viewer, src) {
|
|
114
|
+
return new UserToContactsFkeyQueryAsc(viewer, src);
|
|
115
|
+
}
|
|
116
|
+
sourceEnt(id) {
|
|
117
|
+
return internal_1.FakeUser.load(this.viewer, id);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.UserToContactsFkeyQueryAsc = UserToContactsFkeyQueryAsc;
|
|
76
121
|
class UserToFriendsQuery extends assoc_query_1.AssocEdgeQueryBase {
|
|
77
122
|
constructor(viewer, src) {
|
|
78
123
|
super(viewer, src, new assoc_count_loader_1.AssocEdgeCountLoaderFactory(internal_1.EdgeType.UserToFriends), new assoc_edge_loader_1.AssocEdgeLoaderFactory(internal_1.EdgeType.UserToFriends, ent_1.AssocEdge), internal_1.FakeUser.loaderOptions());
|
|
@@ -257,27 +302,14 @@ function getCompleteClause(id) {
|
|
|
257
302
|
return clause.And(clause.Eq("user_id", id), (0, exports.getNextWeekClause)());
|
|
258
303
|
}
|
|
259
304
|
exports.getCompleteClause = getCompleteClause;
|
|
260
|
-
exports.userToEventsInNextWeekCountLoaderFactory = new raw_count_loader_1.RawCountLoaderFactory({
|
|
261
|
-
...internal_1.FakeEvent.loaderOptions(),
|
|
262
|
-
groupCol: "user_id",
|
|
263
|
-
clause: (0, exports.getNextWeekClause)(),
|
|
264
|
-
});
|
|
265
|
-
exports.userToEventsInNextWeekDataLoaderFactory = new query_loader_1.QueryLoaderFactory({
|
|
266
|
-
...internal_1.FakeEvent.loaderOptions(),
|
|
267
|
-
groupCol: "user_id",
|
|
268
|
-
clause: (0, exports.getNextWeekClause)(),
|
|
269
|
-
toPrime: [fake_contact_1.contactLoader],
|
|
270
|
-
sortColumn: "start_time",
|
|
271
|
-
});
|
|
272
305
|
class UserToEventsInNextWeekQuery extends custom_query_1.CustomEdgeQueryBase {
|
|
273
306
|
constructor(viewer, src) {
|
|
274
307
|
super(viewer, {
|
|
275
308
|
src,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
// hmm TODO shouldn't need to write this twice...
|
|
309
|
+
groupCol: "user_id",
|
|
310
|
+
clause: (0, exports.getNextWeekClause)(),
|
|
311
|
+
loadEntOptions: internal_1.FakeEvent.loaderOptions(),
|
|
312
|
+
name: "events_in_next_week",
|
|
281
313
|
sortColumn: "start_time",
|
|
282
314
|
});
|
|
283
315
|
}
|
package/testutils/fake_log.js
CHANGED
|
@@ -21,12 +21,12 @@ class FakeLogger {
|
|
|
21
21
|
this.logs = [];
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
exports.FakeLogger = FakeLogger;
|
|
25
24
|
// todo this is quick and ideal.
|
|
26
25
|
// more ideal is capturing all console.logs
|
|
27
26
|
// we do it in golang for example
|
|
28
27
|
// and will need this for production launch anyways
|
|
29
28
|
FakeLogger.logs = [];
|
|
29
|
+
exports.FakeLogger = FakeLogger;
|
|
30
30
|
// TODO instead of needing to add this manually
|
|
31
31
|
// we need to build a way to add global observers (and maybe triggers)
|
|
32
32
|
// to be run on every action/mutation
|
package/testutils/parse_sql.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export declare class EqOp {
|
|
|
9
9
|
constructor(col: string, value: any);
|
|
10
10
|
apply(data: Data): boolean;
|
|
11
11
|
}
|
|
12
|
+
export declare class NotEqOp {
|
|
13
|
+
private col;
|
|
14
|
+
private value;
|
|
15
|
+
constructor(col: string, value: any);
|
|
16
|
+
apply(data: Data): boolean;
|
|
17
|
+
}
|
|
12
18
|
export declare class GreaterOp {
|
|
13
19
|
private col;
|
|
14
20
|
private value;
|
package/testutils/parse_sql.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.performQuery = exports.OrOp = exports.AndOp = exports.InOp = exports.LessEqOp = exports.GreaterEqOp = exports.LessOp = exports.GreaterOp = exports.EqOp = exports.getDataToReturn = void 0;
|
|
3
|
+
exports.performQuery = exports.OrOp = exports.AndOp = exports.InOp = exports.LessEqOp = exports.GreaterEqOp = exports.LessOp = exports.GreaterOp = exports.NotEqOp = exports.EqOp = exports.getDataToReturn = void 0;
|
|
4
4
|
const node_sql_parser_1 = require("node-sql-parser");
|
|
5
5
|
function getTableName(table) {
|
|
6
6
|
if (Array.isArray(table)) {
|
|
@@ -184,6 +184,16 @@ class EqOp {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
exports.EqOp = EqOp;
|
|
187
|
+
class NotEqOp {
|
|
188
|
+
constructor(col, value) {
|
|
189
|
+
this.col = col;
|
|
190
|
+
this.value = value;
|
|
191
|
+
}
|
|
192
|
+
apply(data) {
|
|
193
|
+
return data[this.col] !== this.value;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
exports.NotEqOp = NotEqOp;
|
|
187
197
|
class GreaterOp {
|
|
188
198
|
constructor(col, value) {
|
|
189
199
|
this.col = col;
|
|
@@ -307,8 +317,12 @@ function getOp(where, values) {
|
|
|
307
317
|
return new AndOp([getOp(where.left, values), getOp(where.right, values)]);
|
|
308
318
|
case "OR":
|
|
309
319
|
return new OrOp([getOp(where.left, values), getOp(where.right, values)]);
|
|
320
|
+
case "IS":
|
|
321
|
+
return new EqOp(getColumnFromRef(where.left), where.right?.value);
|
|
322
|
+
case "IS NOT":
|
|
323
|
+
return new NotEqOp(getColumnFromRef(where.left), where.right?.value);
|
|
310
324
|
default:
|
|
311
|
-
console.
|
|
325
|
+
console.debug(where);
|
|
312
326
|
throw new Error(`unsupported op ${where.operator}`);
|
|
313
327
|
}
|
|
314
328
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EdgeUpdateOperation, TransformedEdgeUpdateOperation } from "../schema";
|
|
2
|
+
import * as clause from "../core/clause";
|
|
3
|
+
import { AssocEdge } from "../core/ent";
|
|
4
|
+
import { Data } from "../core/base";
|
|
5
|
+
export declare class EdgeWithDeletedAt extends AssocEdge {
|
|
6
|
+
deletedAt: Date | null;
|
|
7
|
+
constructor(data: Data);
|
|
8
|
+
}
|
|
9
|
+
export declare const testEdgeGlobalSchema: {
|
|
10
|
+
extraEdgeFields: {
|
|
11
|
+
deletedAt: import("../schema").TimestampField;
|
|
12
|
+
};
|
|
13
|
+
transformEdgeRead(): clause.Clause;
|
|
14
|
+
transformEdgeWrite(stmt: EdgeUpdateOperation): TransformedEdgeUpdateOperation | null;
|
|
15
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.testEdgeGlobalSchema = exports.EdgeWithDeletedAt = void 0;
|
|
27
|
+
const schema_1 = require("../schema");
|
|
28
|
+
const clause = __importStar(require("../core/clause"));
|
|
29
|
+
const ent_1 = require("../core/ent");
|
|
30
|
+
class EdgeWithDeletedAt extends ent_1.AssocEdge {
|
|
31
|
+
constructor(data) {
|
|
32
|
+
super(data);
|
|
33
|
+
this.deletedAt = data.deleted_at;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.EdgeWithDeletedAt = EdgeWithDeletedAt;
|
|
37
|
+
exports.testEdgeGlobalSchema = {
|
|
38
|
+
extraEdgeFields: {
|
|
39
|
+
// need this to be lowerCamelCase because we do this based on field name
|
|
40
|
+
// #510
|
|
41
|
+
deletedAt: (0, schema_1.TimestampType)({
|
|
42
|
+
nullable: true,
|
|
43
|
+
index: true,
|
|
44
|
+
defaultValueOnCreate: () => null,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
transformEdgeRead() {
|
|
48
|
+
return clause.Eq("deleted_at", null);
|
|
49
|
+
},
|
|
50
|
+
transformEdgeWrite(stmt) {
|
|
51
|
+
switch (stmt.op) {
|
|
52
|
+
case schema_1.SQLStatementOperation.Delete:
|
|
53
|
+
return {
|
|
54
|
+
op: schema_1.SQLStatementOperation.Update,
|
|
55
|
+
data: {
|
|
56
|
+
deleted_at: new Date(),
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
},
|
|
62
|
+
};
|
package/testutils/write.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EditRowOptions, Data,
|
|
1
|
+
import { EditRowOptions, Data, DataOptions, CreateRowOptions } from "../core/base";
|
|
2
2
|
import * as clause from "../core/clause";
|
|
3
3
|
export declare function createRowForTest(options: CreateRowOptions, suffix?: string): Promise<Data | null>;
|
|
4
|
-
export declare function editRowForTest(options: EditRowOptions,
|
|
4
|
+
export declare function editRowForTest(options: EditRowOptions, suffix?: string): Promise<Data | null>;
|
|
5
5
|
export declare function deleteRowsForTest(options: DataOptions, cls: clause.Clause): Promise<void>;
|
package/testutils/write.js
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
26
|
exports.deleteRowsForTest = exports.editRowForTest = exports.createRowForTest = void 0;
|
|
7
27
|
const ent_1 = require("../core/ent");
|
|
8
|
-
const db_1 =
|
|
28
|
+
const db_1 = __importStar(require("../core/db"));
|
|
9
29
|
function isSyncClient(client) {
|
|
10
30
|
return client.execSync !== undefined;
|
|
11
31
|
}
|
|
12
32
|
async function createRowForTest(options, suffix) {
|
|
13
|
-
|
|
33
|
+
let client;
|
|
34
|
+
if (db_1.Dialect.SQLite === db_1.default.getDialect()) {
|
|
35
|
+
client = db_1.default.getInstance().getSQLiteClient();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
client = await db_1.default.getInstance().getNewClient();
|
|
39
|
+
}
|
|
14
40
|
try {
|
|
15
41
|
if (isSyncClient(client)) {
|
|
16
42
|
return (0, ent_1.createRowSync)(client, options, suffix || "");
|
|
@@ -22,13 +48,13 @@ async function createRowForTest(options, suffix) {
|
|
|
22
48
|
}
|
|
23
49
|
}
|
|
24
50
|
exports.createRowForTest = createRowForTest;
|
|
25
|
-
async function editRowForTest(options,
|
|
51
|
+
async function editRowForTest(options, suffix) {
|
|
26
52
|
const client = await db_1.default.getInstance().getNewClient();
|
|
27
53
|
try {
|
|
28
54
|
if (isSyncClient(client)) {
|
|
29
|
-
return (0, ent_1.editRowSync)(client, options,
|
|
55
|
+
return (0, ent_1.editRowSync)(client, options, suffix || "");
|
|
30
56
|
}
|
|
31
|
-
return await (0, ent_1.editRow)(client, options,
|
|
57
|
+
return await (0, ent_1.editRow)(client, options, suffix);
|
|
32
58
|
}
|
|
33
59
|
finally {
|
|
34
60
|
client.release();
|
package/tsc/ast.d.ts
CHANGED
|
@@ -10,12 +10,35 @@ export interface ClassInfo {
|
|
|
10
10
|
wrapClassContents(inner: string): string;
|
|
11
11
|
}
|
|
12
12
|
export declare function getClassInfo(fileContents: string, sourceFile: ts.SourceFile, node: ts.ClassDeclaration): ClassInfo | undefined;
|
|
13
|
-
|
|
13
|
+
type transformImportFn = (imp: string) => string;
|
|
14
14
|
interface transformOpts {
|
|
15
15
|
removeImports?: string[];
|
|
16
16
|
newImports?: string[];
|
|
17
17
|
transform?: transformImportFn;
|
|
18
|
+
transformPath: string;
|
|
18
19
|
}
|
|
19
|
-
export declare function transformImport(fileContents: string, importNode: ts.ImportDeclaration, sourceFile: ts.SourceFile, opts
|
|
20
|
+
export declare function transformImport(fileContents: string, importNode: ts.ImportDeclaration, sourceFile: ts.SourceFile, opts: transformOpts): string | undefined;
|
|
20
21
|
export declare function updateImportPath(fileContents: string, importNode: ts.ImportDeclaration, sourceFile: ts.SourceFile, newPath: string): string | undefined;
|
|
22
|
+
export declare function isRelativeImport(node: ts.ImportDeclaration, sourceFile: ts.SourceFile): boolean;
|
|
23
|
+
export declare function isRelativeGeneratedImport(node: ts.ImportDeclaration, sourceFile: ts.SourceFile): boolean;
|
|
24
|
+
export declare function isSrcGeneratedImport(node: ts.ImportDeclaration, sourceFile: ts.SourceFile): boolean;
|
|
25
|
+
interface importInfo {
|
|
26
|
+
imports: string[];
|
|
27
|
+
start: number;
|
|
28
|
+
end: number;
|
|
29
|
+
importText: string;
|
|
30
|
+
importPath: string;
|
|
31
|
+
default?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function getImportInfo(imp: ts.ImportDeclaration, sourceFile: ts.SourceFile): importInfo | undefined;
|
|
34
|
+
export declare function transformRelative(file: string, importPath: string, relative?: boolean): string;
|
|
35
|
+
export interface customInfo {
|
|
36
|
+
viewerInfo: {
|
|
37
|
+
path: string;
|
|
38
|
+
name: string;
|
|
39
|
+
};
|
|
40
|
+
relativeImports?: boolean;
|
|
41
|
+
globalSchemaPath?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function getCustomInfo(): customInfo;
|
|
21
44
|
export {};
|
package/tsc/ast.js
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updateImportPath = exports.transformImport = exports.getClassInfo = exports.getPreText = void 0;
|
|
29
|
+
exports.getCustomInfo = exports.transformRelative = exports.getImportInfo = exports.isSrcGeneratedImport = exports.isRelativeGeneratedImport = exports.isRelativeImport = exports.updateImportPath = exports.transformImport = exports.getClassInfo = exports.getPreText = void 0;
|
|
7
30
|
const typescript_1 = __importDefault(require("typescript"));
|
|
31
|
+
const path = __importStar(require("path"));
|
|
32
|
+
const js_yaml_1 = require("js-yaml");
|
|
33
|
+
const fs = __importStar(require("fs"));
|
|
34
|
+
const const_1 = require("../core/const");
|
|
8
35
|
function getPreText(fileContents, node, sourceFile) {
|
|
9
36
|
return fileContents.substring(node.getFullStart(), node.getStart(sourceFile));
|
|
10
37
|
}
|
|
@@ -31,8 +58,7 @@ function getClassInfo(fileContents, sourceFile, node) {
|
|
|
31
58
|
}
|
|
32
59
|
}
|
|
33
60
|
}
|
|
34
|
-
|
|
35
|
-
if (!className || !node.heritageClauses || !classExtends) {
|
|
61
|
+
if (!className) {
|
|
36
62
|
return undefined;
|
|
37
63
|
}
|
|
38
64
|
let hasExport = false;
|
|
@@ -82,24 +108,22 @@ exports.getClassInfo = getClassInfo;
|
|
|
82
108
|
function transformImport(fileContents, importNode, sourceFile, opts) {
|
|
83
109
|
// remove quotes too
|
|
84
110
|
const text = importNode.moduleSpecifier.getText(sourceFile).slice(1, -1);
|
|
85
|
-
if (text
|
|
86
|
-
text !== "@snowtop/ent/schema" &&
|
|
87
|
-
text !== "@snowtop/ent/schema/") {
|
|
111
|
+
if (text != opts.transformPath) {
|
|
88
112
|
return;
|
|
89
113
|
}
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const end = importText.lastIndexOf("}");
|
|
93
|
-
if (start === -1 || end === -1) {
|
|
114
|
+
const impInfo = getImportInfo(importNode, sourceFile);
|
|
115
|
+
if (!impInfo) {
|
|
94
116
|
return;
|
|
95
117
|
}
|
|
96
|
-
|
|
97
|
-
.substring(start + 1, end)
|
|
98
|
-
// .trim()
|
|
99
|
-
.split(",");
|
|
118
|
+
let { imports, start, end, importText, default: def } = impInfo;
|
|
100
119
|
let removeImportsMap = {};
|
|
101
120
|
if (opts?.removeImports) {
|
|
102
|
-
opts.removeImports.forEach((imp) =>
|
|
121
|
+
opts.removeImports.forEach((imp) => {
|
|
122
|
+
removeImportsMap[imp] = true;
|
|
123
|
+
if (def === imp) {
|
|
124
|
+
def = "";
|
|
125
|
+
}
|
|
126
|
+
});
|
|
103
127
|
}
|
|
104
128
|
let finalImports = new Set();
|
|
105
129
|
for (let i = 0; i < imports.length; i++) {
|
|
@@ -119,11 +143,18 @@ function transformImport(fileContents, importNode, sourceFile, opts) {
|
|
|
119
143
|
opts.newImports.forEach((imp) => finalImports.add(imp));
|
|
120
144
|
}
|
|
121
145
|
const comment = getPreText(fileContents, importNode, sourceFile);
|
|
146
|
+
if (!finalImports.size) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
122
149
|
return (comment +
|
|
123
150
|
"import " +
|
|
124
|
-
|
|
151
|
+
// add default
|
|
152
|
+
(def || "") +
|
|
153
|
+
// should probably always be "{" now that we support default
|
|
154
|
+
(start >= 0 ? importText.substring(0, start + 1) : "{") +
|
|
125
155
|
Array.from(finalImports).join(", ") +
|
|
126
|
-
|
|
156
|
+
// should probably always be "}"
|
|
157
|
+
(end >= 0 ? importText.substring(end) : "}") +
|
|
127
158
|
' from "' +
|
|
128
159
|
text +
|
|
129
160
|
'";');
|
|
@@ -152,3 +183,96 @@ function updateImportPath(fileContents, importNode, sourceFile, newPath) {
|
|
|
152
183
|
'";');
|
|
153
184
|
}
|
|
154
185
|
exports.updateImportPath = updateImportPath;
|
|
186
|
+
function isRelativeImport(node, sourceFile) {
|
|
187
|
+
const text = node.moduleSpecifier.getText(sourceFile).slice(1, -1);
|
|
188
|
+
return text.startsWith("..") || text.startsWith("./");
|
|
189
|
+
}
|
|
190
|
+
exports.isRelativeImport = isRelativeImport;
|
|
191
|
+
function isRelativeGeneratedImport(node, sourceFile) {
|
|
192
|
+
const text = node.moduleSpecifier.getText(sourceFile).slice(1, -1);
|
|
193
|
+
return ((text.startsWith("..") || text.startsWith("./")) &&
|
|
194
|
+
text.indexOf("/generated") !== -1);
|
|
195
|
+
}
|
|
196
|
+
exports.isRelativeGeneratedImport = isRelativeGeneratedImport;
|
|
197
|
+
function isSrcGeneratedImport(node, sourceFile) {
|
|
198
|
+
const text = node.moduleSpecifier.getText(sourceFile).slice(1, -1);
|
|
199
|
+
return text.startsWith("src") && text.includes("/generated");
|
|
200
|
+
}
|
|
201
|
+
exports.isSrcGeneratedImport = isSrcGeneratedImport;
|
|
202
|
+
// TODO doesn't support default + {} yet
|
|
203
|
+
function getImportInfo(imp, sourceFile) {
|
|
204
|
+
const importText = imp.importClause?.getText(sourceFile) || "";
|
|
205
|
+
const start = importText.indexOf("{");
|
|
206
|
+
const end = importText.lastIndexOf("}");
|
|
207
|
+
const text = imp.moduleSpecifier.getText(sourceFile).slice(1, -1);
|
|
208
|
+
if ((start === -1 || end === -1) && !importText.length) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
let imports = [];
|
|
212
|
+
let def;
|
|
213
|
+
if (start !== -1 && end !== -1) {
|
|
214
|
+
imports = importText
|
|
215
|
+
.substring(start + 1, end)
|
|
216
|
+
//.trim()
|
|
217
|
+
.split(",");
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
def = importText;
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
importPath: text,
|
|
224
|
+
importText,
|
|
225
|
+
start,
|
|
226
|
+
end,
|
|
227
|
+
imports,
|
|
228
|
+
default: def,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
exports.getImportInfo = getImportInfo;
|
|
232
|
+
function transformRelative(file, importPath, relative) {
|
|
233
|
+
if (!relative || !importPath.startsWith("src")) {
|
|
234
|
+
return importPath;
|
|
235
|
+
}
|
|
236
|
+
const fileFullPath = path.join(process.cwd(), file);
|
|
237
|
+
const impFullPath = path.join(process.cwd(), importPath);
|
|
238
|
+
// relative path is from directory
|
|
239
|
+
return normalizePath(path.relative(path.dirname(fileFullPath), impFullPath));
|
|
240
|
+
}
|
|
241
|
+
exports.transformRelative = transformRelative;
|
|
242
|
+
function normalizePath(p) {
|
|
243
|
+
if (p.endsWith("..")) {
|
|
244
|
+
return p + "/";
|
|
245
|
+
}
|
|
246
|
+
if (!p.startsWith("..")) {
|
|
247
|
+
return "./" + p;
|
|
248
|
+
}
|
|
249
|
+
return p;
|
|
250
|
+
}
|
|
251
|
+
// also used in parse schema logic
|
|
252
|
+
function getCustomInfo() {
|
|
253
|
+
let yaml = {};
|
|
254
|
+
let relativeImports = false;
|
|
255
|
+
try {
|
|
256
|
+
yaml = (0, js_yaml_1.load)(fs.readFileSync(path.join(process.cwd(), "ent.yml"), {
|
|
257
|
+
encoding: "utf8",
|
|
258
|
+
}));
|
|
259
|
+
relativeImports = yaml?.codegen?.relativeImports || false;
|
|
260
|
+
if (yaml?.codegen?.templatizedViewer) {
|
|
261
|
+
return {
|
|
262
|
+
viewerInfo: yaml.codegen.templatizedViewer,
|
|
263
|
+
relativeImports,
|
|
264
|
+
globalSchemaPath: yaml.globalSchemaPath,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
catch (e) { }
|
|
269
|
+
return {
|
|
270
|
+
viewerInfo: {
|
|
271
|
+
path: const_1.PACKAGE,
|
|
272
|
+
name: "Viewer",
|
|
273
|
+
},
|
|
274
|
+
relativeImports,
|
|
275
|
+
globalSchemaPath: yaml.globalSchemaPath,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
exports.getCustomInfo = getCustomInfo;
|
package/tsc/compilerOptions.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function moveGenerated(relativeImports: boolean): void;
|