@snowtop/ent 0.1.0-alpha16 → 0.1.0-alpha160-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.d.ts +25 -14
- package/action/action.js +22 -7
- package/action/executor.d.ts +16 -3
- package/action/executor.js +89 -28
- package/action/experimental_action.d.ts +25 -16
- package/action/experimental_action.js +34 -14
- package/action/index.d.ts +4 -1
- package/action/index.js +7 -1
- package/action/operations.d.ts +126 -0
- package/action/operations.js +686 -0
- package/action/orchestrator.d.ts +43 -12
- package/action/orchestrator.js +461 -101
- 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 +56 -23
- package/core/base.js +7 -1
- package/core/clause.d.ts +103 -39
- package/core/clause.js +430 -66
- package/core/config.d.ts +13 -3
- package/core/config.js +10 -1
- package/core/const.d.ts +3 -0
- package/core/const.js +6 -0
- package/core/context.d.ts +6 -3
- package/core/context.js +22 -3
- package/core/convert.d.ts +1 -1
- package/core/date.js +1 -5
- package/core/db.d.ts +12 -8
- package/core/db.js +21 -9
- package/core/ent.d.ts +99 -95
- package/core/ent.js +550 -602
- package/core/global_schema.d.ts +7 -0
- package/core/global_schema.js +51 -0
- package/core/loaders/assoc_count_loader.d.ts +5 -2
- package/core/loaders/assoc_count_loader.js +19 -3
- package/core/loaders/assoc_edge_loader.d.ts +2 -3
- package/core/loaders/assoc_edge_loader.js +23 -17
- package/core/loaders/index.d.ts +1 -2
- package/core/loaders/index.js +1 -5
- package/core/loaders/loader.d.ts +3 -3
- package/core/loaders/loader.js +4 -21
- package/core/loaders/object_loader.d.ts +30 -9
- package/core/loaders/object_loader.js +226 -79
- package/core/loaders/query_loader.d.ts +7 -13
- package/core/loaders/query_loader.js +60 -24
- package/core/loaders/raw_count_loader.d.ts +1 -0
- package/core/loaders/raw_count_loader.js +8 -3
- package/core/logger.d.ts +1 -1
- package/core/logger.js +1 -0
- package/core/privacy.d.ts +26 -16
- package/core/privacy.js +68 -51
- package/core/query/assoc_query.d.ts +3 -2
- package/core/query/assoc_query.js +10 -2
- package/core/query/custom_clause_query.d.ts +29 -0
- package/core/query/custom_clause_query.js +105 -0
- package/core/query/custom_query.d.ts +19 -2
- package/core/query/custom_query.js +111 -13
- package/core/query/index.d.ts +1 -0
- package/core/query/index.js +3 -1
- package/core/query/query.d.ts +18 -4
- package/core/query/query.js +135 -58
- package/core/query/shared_assoc_test.d.ts +2 -1
- package/core/query/shared_assoc_test.js +186 -55
- package/core/query/shared_test.d.ts +9 -2
- package/core/query/shared_test.js +529 -236
- package/core/query_impl.d.ts +8 -0
- package/core/query_impl.js +28 -0
- package/core/viewer.d.ts +2 -0
- package/core/viewer.js +3 -1
- package/graphql/graphql.d.ts +108 -22
- package/graphql/graphql.js +183 -137
- package/graphql/graphql_field_helpers.d.ts +9 -3
- package/graphql/graphql_field_helpers.js +22 -2
- package/graphql/index.d.ts +2 -2
- package/graphql/index.js +5 -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 +23 -5
- package/index.js +35 -10
- package/package.json +19 -19
- package/parse_schema/parse.d.ts +33 -9
- package/parse_schema/parse.js +182 -33
- 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 +232 -72
- 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 +171 -64
- 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 +37 -41
- package/testutils/builder.js +66 -46
- 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} +251 -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 +31 -19
- 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 +48 -0
- package/testutils/fake_data/test_helpers.d.ts +14 -6
- package/testutils/fake_data/test_helpers.js +31 -15
- package/testutils/fake_data/user_query.d.ts +16 -6
- package/testutils/fake_data/user_query.js +72 -23
- 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 +15 -3
- package/tsc/ast.js +114 -23
- 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/core/loaders/index_loader.d.ts +0 -14
- package/core/loaders/index_loader.js +0 -27
- package/graphql/enums.d.ts +0 -3
- package/graphql/enums.js +0 -25
- package/scripts/move_generated.js +0 -141
- package/scripts/transform_actions.js +0 -266
- package/scripts/transform_code.d.ts +0 -1
- package/scripts/transform_code.js +0 -111
- package/scripts/transform_schema.d.ts +0 -1
- /package/scripts/{move_generated.d.ts → migrate_v0.1.d.ts} +0 -0
- /package/scripts/{transform_actions.d.ts → move_types.d.ts} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const minimist_1 = __importDefault(require("minimist"));
|
|
7
|
+
const transform_1 = require("../tsc/transform");
|
|
8
|
+
const transform_schema_1 = require("../tsc/transform_schema");
|
|
9
|
+
const transform_ent_1 = require("../tsc/transform_ent");
|
|
10
|
+
const move_generated_1 = require("../tsc/move_generated");
|
|
11
|
+
const transform_action_1 = require("../tsc/transform_action");
|
|
12
|
+
const ast_1 = require("../tsc/ast");
|
|
13
|
+
// todo-sqlite
|
|
14
|
+
// ts-node-script --swc --project ./tsconfig.json -r tsconfig-paths/register ../../ts/src/scripts/migrate_v0.1.ts --transform_schema --old_base_class BaseEntTodoSchema --new_schema_class TodoEntSchema --transform_path src/schema/patterns/base
|
|
15
|
+
function main() {
|
|
16
|
+
const customInfo = (0, ast_1.getCustomInfo)();
|
|
17
|
+
const options = (0, minimist_1.default)(process.argv.slice(2));
|
|
18
|
+
// install 0.1.x dependencies
|
|
19
|
+
// maybe provide options to make this easier if someone wants to do this in steps to see what's happening
|
|
20
|
+
if (options.move_generated) {
|
|
21
|
+
(0, move_generated_1.moveGenerated)(customInfo.relativeImports);
|
|
22
|
+
}
|
|
23
|
+
// codegen write-all --disable-custom-graphql
|
|
24
|
+
if (options.transform_schema) {
|
|
25
|
+
(0, transform_1.transform)(new transform_schema_1.TransformSchema(customInfo.relativeImports, options.old_base_class, options.new_schema_class, options.transform_path));
|
|
26
|
+
}
|
|
27
|
+
// codegen write-all --disable-custom-graphql
|
|
28
|
+
if (options.transform_ent) {
|
|
29
|
+
(0, transform_1.transform)(new transform_ent_1.TransformEnt());
|
|
30
|
+
}
|
|
31
|
+
if (options.transform_action) {
|
|
32
|
+
(0, transform_1.transform)(new transform_action_1.TransformAction(customInfo));
|
|
33
|
+
}
|
|
34
|
+
// codegen write-all
|
|
35
|
+
}
|
|
36
|
+
main();
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const transform_1 = require("../tsc/transform");
|
|
30
|
+
const ast_1 = require("../tsc/ast");
|
|
31
|
+
const typescript_1 = __importStar(require("typescript"));
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
class GatherExportsInGeneratedTypes {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.glob = "src/ent/generated/types.ts";
|
|
36
|
+
this.names = [];
|
|
37
|
+
}
|
|
38
|
+
traverseChild(sourceFile, contents, file, node) {
|
|
39
|
+
const modifiers = typescript_1.default.canHaveModifiers(node)
|
|
40
|
+
? typescript_1.default.getModifiers(node)
|
|
41
|
+
: undefined;
|
|
42
|
+
const exported = modifiers?.filter((mod) => mod.getText(sourceFile) === "export");
|
|
43
|
+
if (exported?.length) {
|
|
44
|
+
if (typescript_1.default.isEnumDeclaration(node) ||
|
|
45
|
+
typescript_1.default.isInterfaceDeclaration(node) ||
|
|
46
|
+
typescript_1.default.isTypeAliasDeclaration(node)) {
|
|
47
|
+
this.names.push(node.name.text);
|
|
48
|
+
}
|
|
49
|
+
if (typescript_1.default.isFunctionDeclaration(node) && node.name?.text) {
|
|
50
|
+
this.names.push(node.name.text);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { node };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class TransformImports {
|
|
57
|
+
constructor() {
|
|
58
|
+
this.glob = "src/**/*.ts";
|
|
59
|
+
this.prettierGlob = "src/**/*.ts";
|
|
60
|
+
this.impsToMove = new Map();
|
|
61
|
+
this.cwd = "";
|
|
62
|
+
this.relative = false;
|
|
63
|
+
this.cwd = process.cwd();
|
|
64
|
+
const gt = new GatherExportsInGeneratedTypes();
|
|
65
|
+
(0, transform_1.transform)(gt);
|
|
66
|
+
gt.names.forEach((v) => this.impsToMove.set(v, true));
|
|
67
|
+
this.relative = (0, ast_1.getCustomInfo)().relativeImports ?? this.relative;
|
|
68
|
+
}
|
|
69
|
+
getSrcPath(file, text) {
|
|
70
|
+
if (text.startsWith("src")) {
|
|
71
|
+
return text;
|
|
72
|
+
}
|
|
73
|
+
const dir = path_1.default.dirname(path_1.default.join(this.cwd, file));
|
|
74
|
+
const fullPath = path_1.default.join(dir, text);
|
|
75
|
+
return path_1.default.relative(this.cwd, fullPath);
|
|
76
|
+
}
|
|
77
|
+
traverseChild(sourceFile, contents, file, node) {
|
|
78
|
+
if (!(0, typescript_1.isImportDeclaration)(node)) {
|
|
79
|
+
return { node };
|
|
80
|
+
}
|
|
81
|
+
const impInfo = (0, ast_1.getImportInfo)(node, sourceFile);
|
|
82
|
+
if (!impInfo) {
|
|
83
|
+
return { node };
|
|
84
|
+
}
|
|
85
|
+
const text = node.moduleSpecifier.getText(sourceFile).slice(1, -1);
|
|
86
|
+
const pathToWrite = (0, ast_1.transformRelative)(file, "src/ent/generated/types", this.relative);
|
|
87
|
+
const current = (0, ast_1.transformRelative)(file, text, this.relative);
|
|
88
|
+
const srcPath = this.getSrcPath(file, text);
|
|
89
|
+
// nothing to do here
|
|
90
|
+
if (!srcPath.startsWith("src/ent") || pathToWrite === current) {
|
|
91
|
+
return { node };
|
|
92
|
+
}
|
|
93
|
+
// let's see if we can simplify
|
|
94
|
+
let seenImports = [];
|
|
95
|
+
for (let imp of impInfo.imports) {
|
|
96
|
+
imp = imp.trim();
|
|
97
|
+
if (this.impsToMove.has(imp)) {
|
|
98
|
+
seenImports.push(imp);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (!seenImports.length) {
|
|
102
|
+
return { node };
|
|
103
|
+
}
|
|
104
|
+
let imports = new Map([[pathToWrite, seenImports]]);
|
|
105
|
+
return {
|
|
106
|
+
rawString: (0, ast_1.transformImport)(contents, node, sourceFile, {
|
|
107
|
+
removeImports: seenImports,
|
|
108
|
+
transformPath: text,
|
|
109
|
+
}),
|
|
110
|
+
traversed: true,
|
|
111
|
+
imports,
|
|
112
|
+
allowSeenImportsAdded: true,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// ts-node-script --swc --project ./tsconfig.json -r tsconfig-paths/register ../../ts/src/scripts/move_types.ts
|
|
117
|
+
function main() {
|
|
118
|
+
(0, transform_1.transform)(new TransformImports());
|
|
119
|
+
}
|
|
120
|
+
main();
|
package/scripts/read_schema.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];
|
|
@@ -22,24 +26,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
27
|
};
|
|
24
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
const
|
|
29
|
+
const glob = __importStar(require("glob"));
|
|
26
30
|
const path = __importStar(require("path"));
|
|
27
31
|
const pascal_case_1 = require("pascal-case");
|
|
28
32
|
const minimist_1 = __importDefault(require("minimist"));
|
|
29
|
-
const process_1 = require("process");
|
|
30
33
|
const parse_1 = require("../parse_schema/parse");
|
|
34
|
+
const ast_1 = require("../tsc/ast");
|
|
31
35
|
function main() {
|
|
32
36
|
const options = (0, minimist_1.default)(process.argv.slice(2));
|
|
33
37
|
if (!options.path) {
|
|
34
38
|
throw new Error("path required");
|
|
35
39
|
}
|
|
40
|
+
const customInfo = (0, ast_1.getCustomInfo)();
|
|
41
|
+
const globalSchemaPath = customInfo.globalSchemaPath || "__global__schema.ts";
|
|
42
|
+
let globalSchema;
|
|
36
43
|
const r = /(\w+).ts/;
|
|
37
|
-
|
|
44
|
+
// do we still even need this...
|
|
45
|
+
const paths = glob.sync(path.join(options.path, "*.ts"), {
|
|
38
46
|
ignore: [`\d+_read_schema.ts`],
|
|
39
47
|
});
|
|
40
48
|
let potentialSchemas = {};
|
|
41
49
|
for (const p of paths) {
|
|
42
50
|
const basename = path.basename(p);
|
|
51
|
+
if (basename === globalSchemaPath) {
|
|
52
|
+
globalSchema = require(p).default;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
43
55
|
const match = r.exec(basename);
|
|
44
56
|
if (!match) {
|
|
45
57
|
throw new Error(`non-typescript file ${p} returned by glob`);
|
|
@@ -61,13 +73,16 @@ function main() {
|
|
|
61
73
|
potentialSchemas[(0, pascal_case_1.pascalCase)(schema)] = s;
|
|
62
74
|
}
|
|
63
75
|
// console.log(potentialSchemas);
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
// NB: do not change this to async/await
|
|
77
|
+
// doing so runs it buffer limit on linux (65536 bytes) and we lose data reading in go
|
|
78
|
+
(0, parse_1.parseSchema)(potentialSchemas, globalSchema).then((result) => {
|
|
79
|
+
console.log(JSON.stringify(result));
|
|
80
|
+
});
|
|
66
81
|
}
|
|
67
82
|
try {
|
|
68
83
|
main();
|
|
69
84
|
}
|
|
70
85
|
catch (err) {
|
|
71
86
|
console.error(err);
|
|
72
|
-
|
|
87
|
+
process.exit(1);
|
|
73
88
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Ent, ID, Viewer, Data } from "../../core/base";
|
|
2
|
+
import { DataOperation } from "../../action/operations";
|
|
3
|
+
import { Action, Builder, Executor, WriteOperation, Trigger, Observer, TriggerReturn } from "../../action/action";
|
|
4
|
+
import { EdgeInputData } from "../../action/orchestrator";
|
|
5
|
+
import { User, Group, Message, Contact, SimpleBuilder, BuilderSchema, SimpleAction, BaseEnt } from "../../testutils/builder";
|
|
6
|
+
import { MockLogs } from "../../testutils/mock_log";
|
|
7
|
+
import { Table } from "../db/temp_db";
|
|
8
|
+
export declare function setupTest(): void;
|
|
9
|
+
export declare function getML(): MockLogs;
|
|
10
|
+
export declare function getOperations(): DataOperation<Ent<Viewer<Ent<any> | null, ID | null>>>[];
|
|
11
|
+
export declare const UserSchema: BuilderSchema<User>;
|
|
12
|
+
export declare class UserWithBalance extends User {
|
|
13
|
+
}
|
|
14
|
+
export declare const UserBalanceSchema: BuilderSchema<UserWithBalance>;
|
|
15
|
+
export declare class UserWithBalanceWithCheck extends UserWithBalance {
|
|
16
|
+
}
|
|
17
|
+
export declare const UserBalanceWithCheckSchema: BuilderSchema<UserWithBalanceWithCheck>;
|
|
18
|
+
export declare class Account extends BaseEnt {
|
|
19
|
+
accountID: string;
|
|
20
|
+
nodeType: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const AccountSchema: BuilderSchema<Account>;
|
|
23
|
+
export declare const ContactSchema: BuilderSchema<Contact>;
|
|
24
|
+
export declare const GroupSchema: BuilderSchema<Group>;
|
|
25
|
+
export declare class GroupMembership extends BaseEnt {
|
|
26
|
+
nodeType: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const GroupMembershipSchema: BuilderSchema<GroupMembership>;
|
|
29
|
+
export declare class Changelog extends BaseEnt {
|
|
30
|
+
nodeType: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const ChangelogSchema: BuilderSchema<Changelog>;
|
|
33
|
+
export declare const MessageSchema: BuilderSchema<Message>;
|
|
34
|
+
export declare function executeAction<T extends Ent, E = any>(action: Action<T, Builder<T>>, name?: E): Promise<Executor>;
|
|
35
|
+
export declare function createGroup(): Promise<Group>;
|
|
36
|
+
export declare function createUser(): Promise<User>;
|
|
37
|
+
export declare class MessageAction extends SimpleAction<Message> {
|
|
38
|
+
constructor(viewer: Viewer, fields: Map<string, any>, operation: WriteOperation, existingEnt: Message | null);
|
|
39
|
+
getTriggers(): Trigger<Message, SimpleBuilder<Message, Message | null>>[];
|
|
40
|
+
getObservers(): Observer<Message, SimpleBuilder<Message>>[];
|
|
41
|
+
}
|
|
42
|
+
export declare class UserAction extends SimpleAction<User> {
|
|
43
|
+
contactAction: SimpleAction<Contact> | undefined;
|
|
44
|
+
constructor(viewer: Viewer, fields: Map<string, any>, operation: WriteOperation, existingEnt: User | null);
|
|
45
|
+
getTriggers(): Trigger<User, SimpleBuilder<User>>[];
|
|
46
|
+
getObservers(): Observer<User, SimpleBuilder<User>>[];
|
|
47
|
+
}
|
|
48
|
+
type getMembershipFunction = (viewer: Viewer, edge: EdgeInputData) => SimpleAction<Ent>;
|
|
49
|
+
export declare class GroupMembershipTrigger implements Trigger<Group, SimpleBuilder<Group>> {
|
|
50
|
+
private getter;
|
|
51
|
+
constructor(getter: getMembershipFunction);
|
|
52
|
+
changeset(builder: SimpleBuilder<Group>, input: Data): TriggerReturn;
|
|
53
|
+
}
|
|
54
|
+
export declare class EditGroupAction extends SimpleAction<Group> {
|
|
55
|
+
viewer: Viewer;
|
|
56
|
+
private getter;
|
|
57
|
+
constructor(viewer: Viewer, schema: BuilderSchema<Group>, fields: Map<string, any>, existingEnt: Group, getter: getMembershipFunction);
|
|
58
|
+
getTriggers: () => GroupMembershipTrigger[];
|
|
59
|
+
}
|
|
60
|
+
export declare function verifyGroupMembers(group: Group, members: User[]): Promise<ID[]>;
|
|
61
|
+
export declare function loadMemberships(viewer: Viewer, membershipids: ID[]): Promise<GroupMembership[]>;
|
|
62
|
+
export declare function loadChangelogs(viewer: Viewer, clids: ID[]): Promise<Changelog[]>;
|
|
63
|
+
export declare function verifyChangelogFromMeberships(user: User, memberships: GroupMembership[]): Promise<void>;
|
|
64
|
+
export declare class GroupMemberOf extends BaseEnt {
|
|
65
|
+
nodeType: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const GroupMemberOfSchema: BuilderSchema<GroupMemberOf>;
|
|
68
|
+
export declare const getTables: () => Table[];
|
|
69
|
+
export {};
|