@ultipa-graph/ultipa-driver 5.1.5-s5.2 → 6.0.0
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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/client.d.ts +194 -0
- package/dist/client.js +390 -0
- package/dist/config.d.ts +65 -0
- package/dist/config.js +135 -0
- package/dist/connection.d.ts +30 -0
- package/dist/connection.js +190 -0
- package/dist/errors.d.ts +99 -0
- package/dist/errors.js +237 -0
- package/dist/index.d.ts +14 -5
- package/dist/index.js +88 -39
- package/dist/printers.d.ts +33 -0
- package/dist/printers.js +312 -0
- package/dist/proto/gqldb.proto +632 -0
- package/dist/response.d.ts +256 -0
- package/dist/response.js +723 -0
- package/dist/services/admin-service.d.ts +40 -0
- package/dist/services/admin-service.js +115 -0
- package/dist/services/bulk-import-service.d.ts +35 -0
- package/dist/services/bulk-import-service.js +108 -0
- package/dist/services/converters.d.ts +57 -0
- package/dist/services/converters.js +254 -0
- package/dist/services/data-service.d.ts +44 -0
- package/dist/services/data-service.js +206 -0
- package/dist/services/graph-service.d.ts +32 -0
- package/dist/services/graph-service.js +127 -0
- package/dist/services/health-service.d.ts +50 -0
- package/dist/services/health-service.js +78 -0
- package/dist/services/index.d.ts +13 -0
- package/dist/services/index.js +30 -0
- package/dist/services/query-service.d.ts +39 -0
- package/dist/services/query-service.js +112 -0
- package/dist/services/service-context.d.ts +39 -0
- package/dist/services/service-context.js +73 -0
- package/dist/services/session-service.d.ts +24 -0
- package/dist/services/session-service.js +66 -0
- package/dist/services/transaction-service.d.ts +33 -0
- package/dist/services/transaction-service.js +100 -0
- package/dist/services.d.ts +28 -0
- package/dist/services.js +122 -0
- package/dist/session.d.ts +45 -0
- package/dist/session.js +75 -0
- package/dist/transaction.d.ts +42 -0
- package/dist/transaction.js +89 -0
- package/dist/types/bulk_import.d.ts +53 -0
- package/dist/types/bulk_import.js +6 -0
- package/dist/types/data_types.d.ts +116 -0
- package/dist/types/data_types.js +122 -0
- package/dist/types/enums.d.ts +59 -0
- package/dist/types/enums.js +67 -0
- package/dist/types/graph_models.d.ts +54 -0
- package/dist/types/graph_models.js +6 -0
- package/dist/types/index.d.ts +11 -5
- package/dist/types/index.js +36 -37
- package/dist/types/metadata.d.ts +60 -0
- package/dist/types/metadata.js +6 -0
- package/dist/types/schema.d.ts +31 -0
- package/dist/types/schema.js +6 -0
- package/dist/types/typed_value.d.ts +25 -0
- package/dist/types/typed_value.js +1176 -0
- package/dist/types/wrappers.d.ts +23 -0
- package/dist/types/wrappers.js +39 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +24 -0
- package/package.json +49 -62
- package/dist/connection/connection.final.d.ts +0 -14
- package/dist/connection/connection.final.js +0 -94
- package/dist/connection/connection.final.js.map +0 -1
- package/dist/connection/connection.pool.d.ts +0 -21
- package/dist/connection/connection.pool.js +0 -103
- package/dist/connection/connection.pool.js.map +0 -1
- package/dist/connection/extra/algos/algo.extra.d.ts +0 -34
- package/dist/connection/extra/algos/algo.extra.js +0 -69
- package/dist/connection/extra/algos/algo.extra.js.map +0 -1
- package/dist/connection/extra/algos/algo.utils.d.ts +0 -3
- package/dist/connection/extra/algos/algo.utils.js +0 -54
- package/dist/connection/extra/algos/algo.utils.js.map +0 -1
- package/dist/connection/extra/algos/community.d.ts +0 -27
- package/dist/connection/extra/algos/community.js +0 -76
- package/dist/connection/extra/algos/community.js.map +0 -1
- package/dist/connection/extra/algos/degrees.d.ts +0 -10
- package/dist/connection/extra/algos/degrees.js +0 -24
- package/dist/connection/extra/algos/degrees.js.map +0 -1
- package/dist/connection/extra/algos/embedding.d.ts +0 -13
- package/dist/connection/extra/algos/embedding.js +0 -33
- package/dist/connection/extra/algos/embedding.js.map +0 -1
- package/dist/connection/extra/algos/index.d.ts +0 -5
- package/dist/connection/extra/algos/index.js +0 -14
- package/dist/connection/extra/algos/index.js.map +0 -1
- package/dist/connection/extra/base.extra.d.ts +0 -18
- package/dist/connection/extra/base.extra.js +0 -111
- package/dist/connection/extra/base.extra.js.map +0 -1
- package/dist/connection/extra/batch.insert.extra.d.ts +0 -58
- package/dist/connection/extra/batch.insert.extra.js +0 -354
- package/dist/connection/extra/batch.insert.extra.js.map +0 -1
- package/dist/connection/extra/connection.base.d.ts +0 -112
- package/dist/connection/extra/connection.base.js +0 -530
- package/dist/connection/extra/connection.base.js.map +0 -1
- package/dist/connection/extra/connection.d.ts +0 -17
- package/dist/connection/extra/connection.js +0 -44
- package/dist/connection/extra/connection.js.map +0 -1
- package/dist/connection/extra/graph.extra.d.ts +0 -54
- package/dist/connection/extra/graph.extra.js +0 -151
- package/dist/connection/extra/graph.extra.js.map +0 -1
- package/dist/connection/extra/hdc.extra.d.ts +0 -89
- package/dist/connection/extra/hdc.extra.js +0 -322
- package/dist/connection/extra/hdc.extra.js.map +0 -1
- package/dist/connection/extra/index.extra.d.ts +0 -102
- package/dist/connection/extra/index.extra.js +0 -210
- package/dist/connection/extra/index.extra.js.map +0 -1
- package/dist/connection/extra/job.extra.d.ts +0 -32
- package/dist/connection/extra/job.extra.js +0 -122
- package/dist/connection/extra/job.extra.js.map +0 -1
- package/dist/connection/extra/meta.extra.d.ts +0 -36
- package/dist/connection/extra/meta.extra.js +0 -123
- package/dist/connection/extra/meta.extra.js.map +0 -1
- package/dist/connection/extra/policy.extra.d.ts +0 -32
- package/dist/connection/extra/policy.extra.js +0 -114
- package/dist/connection/extra/policy.extra.js.map +0 -1
- package/dist/connection/extra/privilege.extra.d.ts +0 -8
- package/dist/connection/extra/privilege.extra.js +0 -20
- package/dist/connection/extra/privilege.extra.js.map +0 -1
- package/dist/connection/extra/property.extra.d.ts +0 -66
- package/dist/connection/extra/property.extra.js +0 -190
- package/dist/connection/extra/property.extra.js.map +0 -1
- package/dist/connection/extra/schema.extra.d.ts +0 -108
- package/dist/connection/extra/schema.extra.js +0 -253
- package/dist/connection/extra/schema.extra.js.map +0 -1
- package/dist/connection/extra/search.extra.d.ts +0 -12
- package/dist/connection/extra/search.extra.js +0 -117
- package/dist/connection/extra/search.extra.js.map +0 -1
- package/dist/connection/extra/task.extra.d.ts +0 -24
- package/dist/connection/extra/task.extra.js +0 -107
- package/dist/connection/extra/task.extra.js.map +0 -1
- package/dist/connection/extra/user.extra.d.ts +0 -28
- package/dist/connection/extra/user.extra.js +0 -91
- package/dist/connection/extra/user.extra.js.map +0 -1
- package/dist/connection/extra/user.privilege.extra.d.ts +0 -64
- package/dist/connection/extra/user.privilege.extra.js +0 -273
- package/dist/connection/extra/user.privilege.extra.js.map +0 -1
- package/dist/connection/index.d.ts +0 -5
- package/dist/connection/index.js +0 -13
- package/dist/connection/index.js.map +0 -1
- package/dist/connection/network.manager.d.ts +0 -28
- package/dist/connection/network.manager.js +0 -179
- package/dist/connection/network.manager.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/printers/alias.d.ts +0 -2
- package/dist/printers/alias.js +0 -39
- package/dist/printers/alias.js.map +0 -1
- package/dist/printers/any.d.ts +0 -2
- package/dist/printers/any.js +0 -63
- package/dist/printers/any.js.map +0 -1
- package/dist/printers/array.aio.d.ts +0 -3
- package/dist/printers/array.aio.js +0 -259
- package/dist/printers/array.aio.js.map +0 -1
- package/dist/printers/common.d.ts +0 -0
- package/dist/printers/common.js +0 -1
- package/dist/printers/common.js.map +0 -1
- package/dist/printers/edge.d.ts +0 -5
- package/dist/printers/edge.js +0 -78
- package/dist/printers/edge.js.map +0 -1
- package/dist/printers/explain.plan.d.ts +0 -2
- package/dist/printers/explain.plan.js +0 -46
- package/dist/printers/explain.plan.js.map +0 -1
- package/dist/printers/index.d.ts +0 -24
- package/dist/printers/index.js +0 -43
- package/dist/printers/index.js.map +0 -1
- package/dist/printers/node.d.ts +0 -5
- package/dist/printers/node.js +0 -77
- package/dist/printers/node.js.map +0 -1
- package/dist/printers/path.d.ts +0 -3
- package/dist/printers/path.js +0 -62
- package/dist/printers/path.js.map +0 -1
- package/dist/printers/status.d.ts +0 -3
- package/dist/printers/status.js +0 -68
- package/dist/printers/status.js.map +0 -1
- package/dist/printers/table.d.ts +0 -2
- package/dist/printers/table.js +0 -56
- package/dist/printers/table.js.map +0 -1
- package/dist/proto/tmp.js +0 -366
- package/dist/proto/ultipa_grpc_pb.d.ts +0 -258
- package/dist/proto/ultipa_grpc_pb.js +0 -366
- package/dist/proto/ultipa_grpc_pb.js.map +0 -1
- package/dist/proto/ultipa_pb.d.ts +0 -1
- package/dist/proto/ultipa_pb.js +0 -12119
- package/dist/proto/ultipa_pb.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/types.algos.params.d.ts +0 -545
- package/dist/types/types.algos.params.js +0 -16
- package/dist/types/types.algos.params.js.map +0 -1
- package/dist/types/types.d.ts +0 -1214
- package/dist/types/types.extra.d.ts +0 -146
- package/dist/types/types.extra.js +0 -27
- package/dist/types/types.extra.js.map +0 -1
- package/dist/types/types.js +0 -1606
- package/dist/types/types.js.map +0 -1
- package/dist/types/util.d.ts +0 -15
- package/dist/types/util.js +0 -136
- package/dist/types/util.js.map +0 -1
- package/dist/utils/common.d.ts +0 -3
- package/dist/utils/common.js +0 -22
- package/dist/utils/common.js.map +0 -1
- package/dist/utils/config.d.ts +0 -3
- package/dist/utils/config.js +0 -7
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/format.d.ts +0 -45
- package/dist/utils/format.js +0 -879
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.js +0 -30
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/params.validate.d.ts +0 -4
- package/dist/utils/params.validate.js +0 -14
- package/dist/utils/params.validate.js.map +0 -1
- package/dist/utils/property.d.ts +0 -24
- package/dist/utils/property.js +0 -203
- package/dist/utils/property.js.map +0 -1
- package/dist/utils/raft.retry.d.ts +0 -0
- package/dist/utils/raft.retry.js +0 -1
- package/dist/utils/raft.retry.js.map +0 -1
- package/dist/utils/serialize/commont.d.ts +0 -12
- package/dist/utils/serialize/commont.js +0 -46
- package/dist/utils/serialize/commont.js.map +0 -1
- package/dist/utils/serialize/deserialize.d.ts +0 -10
- package/dist/utils/serialize/deserialize.js +0 -288
- package/dist/utils/serialize/deserialize.js.map +0 -1
- package/dist/utils/serialize/null.d.ts +0 -32
- package/dist/utils/serialize/null.js +0 -178
- package/dist/utils/serialize/null.js.map +0 -1
- package/dist/utils/serialize/serialize.d.ts +0 -10
- package/dist/utils/serialize/serialize.js +0 -146
- package/dist/utils/serialize/serialize.js.map +0 -1
- package/dist/utils/stream.helper.d.ts +0 -10
- package/dist/utils/stream.helper.js +0 -71
- package/dist/utils/stream.helper.js.map +0 -1
- package/dist/utils/time.record.d.ts +0 -15
- package/dist/utils/time.record.js +0 -52
- package/dist/utils/time.record.js.map +0 -1
- package/dist/utils/timezone.d.ts +0 -7
- package/dist/utils/timezone.js +0 -21
- package/dist/utils/timezone.js.map +0 -1
- package/dist/utils/ultipa.datetime.d.ts +0 -14
- package/dist/utils/ultipa.datetime.js +0 -160
- package/dist/utils/ultipa.datetime.js.map +0 -1
- package/dist/utils/uql-maker.d.ts +0 -165
- package/dist/utils/uql-maker.js +0 -402
- package/dist/utils/uql-maker.js.map +0 -1
- package/dist/utils/uql.parse.d.ts +0 -27
- package/dist/utils/uql.parse.js +0 -205
- package/dist/utils/uql.parse.js.map +0 -1
- package/readme.md +0 -65
- package/src/proto/build.sh +0 -41
- package/src/proto/build_windows.sh +0 -40
- package/src/proto/ultipa.proto +0 -531
- package/src/proto/ultipa_grpc_pb.d.ts +0 -92
- package/src/proto/ultipa_grpc_pb.js +0 -414
- package/src/proto/ultipa_pb.d.ts +0 -1983
- package/src/proto/ultipa_pb.js +0 -14852
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ConnectionBase } from "./connection.base";
|
|
2
|
-
import { Policy, RequestConfig, Response, PropertyPrivilege } from "../../types/types";
|
|
3
|
-
export declare class PolicyExtra extends ConnectionBase {
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves all policies from the instance. A policy includes system privileges, graph privileges, property privileges and other policies.
|
|
6
|
-
*/
|
|
7
|
-
showPolicy(config?: RequestConfig): Promise<Policy[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves a policy from the instance by its name.
|
|
10
|
-
*/
|
|
11
|
-
getPolicy(policyName: string, config?: RequestConfig): Promise<Policy>;
|
|
12
|
-
/**
|
|
13
|
-
* Creates a policy in the instance.
|
|
14
|
-
*/
|
|
15
|
-
createPolicy(policy: Policy, config?: RequestConfig): Promise<Response>;
|
|
16
|
-
/**
|
|
17
|
-
* Alters the system privileges, graph privileges, property privileges and policies of one existing policy in the instance by its name.
|
|
18
|
-
*/
|
|
19
|
-
alterPolicy(policy: Policy, config?: RequestConfig): Promise<Response>;
|
|
20
|
-
/**
|
|
21
|
-
* Drops one policy from the instance by its name.
|
|
22
|
-
*/
|
|
23
|
-
dropPolicy(policyName: string, config?: RequestConfig): Promise<Response>;
|
|
24
|
-
/**
|
|
25
|
-
* Grant user policy
|
|
26
|
-
*/
|
|
27
|
-
grantPolicy(userName: string, graphPrivileges?: Map<string, string[]>, systemPrivileges?: string[], policies?: string[], PropertyPrivilege?: PropertyPrivilege, config?: RequestConfig): Promise<Response>;
|
|
28
|
-
/**
|
|
29
|
-
* Revoke user policy List
|
|
30
|
-
*/
|
|
31
|
-
revokePolicy(userName: string, graphPrivileges?: Map<string, string[]>, systemPrivileges?: string[], policies?: string[], PropertyPrivilege?: PropertyPrivilege, config?: RequestConfig): Promise<Response>;
|
|
32
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PolicyExtra = void 0;
|
|
4
|
-
const connection_base_1 = require("./connection.base");
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
const types_extra_1 = require("../../types/types.extra");
|
|
7
|
-
const { CommandList } = utils_1.UQLMAKER;
|
|
8
|
-
class PolicyExtra extends connection_base_1.ConnectionBase {
|
|
9
|
-
/**
|
|
10
|
-
* Retrieves all policies from the instance. A policy includes system privileges, graph privileges, property privileges and other policies.
|
|
11
|
-
*/
|
|
12
|
-
async showPolicy(config) {
|
|
13
|
-
let command = CommandList.showPolicy;
|
|
14
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config);
|
|
15
|
-
let res = await this.uql(uqlMaker.toString(), config);
|
|
16
|
-
return res.items[types_extra_1.ResponseTableName.POLICY]?.asPolicies();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves a policy from the instance by its name.
|
|
20
|
-
*/
|
|
21
|
-
async getPolicy(policyName, config) {
|
|
22
|
-
let command = CommandList.getPolicy;
|
|
23
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, policyName);
|
|
24
|
-
let res = await this.uql(uqlMaker.toString(), config);
|
|
25
|
-
return res.items[types_extra_1.ResponseTableName.POLICY]?.asPolicies().find(v => v.name == policyName);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Creates a policy in the instance.
|
|
29
|
-
*/
|
|
30
|
-
async createPolicy(policy, config) {
|
|
31
|
-
let command = CommandList.createPolicy;
|
|
32
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, [policy.name,
|
|
33
|
-
policy?.graphPrivileges ? Object.fromEntries(policy?.graphPrivileges) : {},
|
|
34
|
-
policy.systemPrivileges || [], policy.policies || [], policy.propertyPrivileges || {}]);
|
|
35
|
-
return this.uql(uqlMaker.toString(), config);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Alters the system privileges, graph privileges, property privileges and policies of one existing policy in the instance by its name.
|
|
39
|
-
*/
|
|
40
|
-
async alterPolicy(policy, config) {
|
|
41
|
-
let command = CommandList.alterPolicy;
|
|
42
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, policy.name);
|
|
43
|
-
let set = {};
|
|
44
|
-
if (policy?.graphPrivileges) {
|
|
45
|
-
set.graph_privileges =
|
|
46
|
-
policy?.graphPrivileges ? Object.fromEntries(policy?.graphPrivileges) : {};
|
|
47
|
-
}
|
|
48
|
-
if (policy?.systemPrivileges) {
|
|
49
|
-
set.system_privileges = policy.systemPrivileges;
|
|
50
|
-
}
|
|
51
|
-
if (policy?.policies) {
|
|
52
|
-
set.policies = policy.policies;
|
|
53
|
-
}
|
|
54
|
-
if (policy?.propertyPrivileges) {
|
|
55
|
-
set.property_privileges = policy.propertyPrivileges;
|
|
56
|
-
}
|
|
57
|
-
uqlMaker.addParam("set", set);
|
|
58
|
-
return this.uql(uqlMaker.toString(), config);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Drops one policy from the instance by its name.
|
|
62
|
-
*/
|
|
63
|
-
async dropPolicy(policyName, config) {
|
|
64
|
-
let command = CommandList.dropPolicy;
|
|
65
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, policyName);
|
|
66
|
-
return this.uql(uqlMaker.toString(), config);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Grant user policy
|
|
70
|
-
*/
|
|
71
|
-
async grantPolicy(userName, graphPrivileges, systemPrivileges, policies, PropertyPrivilege, config) {
|
|
72
|
-
let command = CommandList.grantUser;
|
|
73
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, userName);
|
|
74
|
-
let set = {};
|
|
75
|
-
if (graphPrivileges) {
|
|
76
|
-
graphPrivileges ? Object.fromEntries(graphPrivileges) : {};
|
|
77
|
-
}
|
|
78
|
-
if (systemPrivileges) {
|
|
79
|
-
set.system_privileges = systemPrivileges;
|
|
80
|
-
}
|
|
81
|
-
if (policies) {
|
|
82
|
-
set.policies = policies;
|
|
83
|
-
}
|
|
84
|
-
if (PropertyPrivilege) {
|
|
85
|
-
set.property_privileges = PropertyPrivilege;
|
|
86
|
-
}
|
|
87
|
-
uqlMaker.addParam("params", set);
|
|
88
|
-
return this.uql(uqlMaker.toString(), config);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Revoke user policy List
|
|
92
|
-
*/
|
|
93
|
-
async revokePolicy(userName, graphPrivileges, systemPrivileges, policies, PropertyPrivilege, config) {
|
|
94
|
-
let command = CommandList.revokeUser;
|
|
95
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, userName);
|
|
96
|
-
let set = {};
|
|
97
|
-
if (graphPrivileges) {
|
|
98
|
-
set.graph_privileges = graphPrivileges ? Object.fromEntries(graphPrivileges) : {};
|
|
99
|
-
}
|
|
100
|
-
if (systemPrivileges) {
|
|
101
|
-
set.system_privileges = systemPrivileges;
|
|
102
|
-
}
|
|
103
|
-
if (policies) {
|
|
104
|
-
set.policies = policies;
|
|
105
|
-
}
|
|
106
|
-
if (PropertyPrivilege) {
|
|
107
|
-
set.property_privileges = PropertyPrivilege;
|
|
108
|
-
}
|
|
109
|
-
uqlMaker.addParam("params", set);
|
|
110
|
-
return this.uql(uqlMaker.toString(), config);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.PolicyExtra = PolicyExtra;
|
|
114
|
-
//# sourceMappingURL=policy.extra.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"policy.extra.js","sourceRoot":"","sources":["../../../src/connection/extra/policy.extra.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAGlD,uCAAuC;AACvC,yDAA4D;AAC5D,MAAM,EAAE,WAAW,EAAE,GAAG,gBAAQ,CAAA;AAEhC,MAAa,WAAY,SAAQ,gCAAc;IAC3C;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,MAAsB;QACnC,IAAI,OAAO,GAAG,WAAW,CAAC,UAAU,CAAA;QACpC,IAAI,QAAQ,GAAG,IAAI,gBAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC5C,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAA;QACrD,OAAO,GAAG,CAAC,KAAK,CAAC,+BAAiB,CAAC,MAAM,CAAC,EAAE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E;YACnB,GAAG,CAAC,mBAAmB,GAAG,iBAAiB,CAAA;SAC9C;QACD,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;QAChC,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAA;IAChD,CAAC;CACJ;AA1HD,kCA0HC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ConnectionBase } from "./connection.base";
|
|
2
|
-
import { Privilege, RequestConfig } from "../../types/types";
|
|
3
|
-
export declare class PrivilegeExtra extends ConnectionBase {
|
|
4
|
-
/**
|
|
5
|
-
* Retrieves all system privileges and graph privileges, which are actually UQL command names categorized based on their operation scope.
|
|
6
|
-
*/
|
|
7
|
-
showPrivilege(config?: RequestConfig): Promise<Privilege[]>;
|
|
8
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PrivilegeExtra = void 0;
|
|
4
|
-
const connection_base_1 = require("./connection.base");
|
|
5
|
-
const utils_1 = require("../../utils");
|
|
6
|
-
const { CommandList } = utils_1.UQLMAKER;
|
|
7
|
-
class PrivilegeExtra extends connection_base_1.ConnectionBase {
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves all system privileges and graph privileges, which are actually UQL command names categorized based on their operation scope.
|
|
10
|
-
*/
|
|
11
|
-
async showPrivilege(config) {
|
|
12
|
-
let command = CommandList.showPrivilege;
|
|
13
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config);
|
|
14
|
-
let res = await this.uql(uqlMaker.toString(), config);
|
|
15
|
-
let result = res.items["_privilege"].asPrivileges();
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.PrivilegeExtra = PrivilegeExtra;
|
|
20
|
-
//# sourceMappingURL=privilege.extra.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"privilege.extra.js","sourceRoot":"","sources":["../../../src/connection/extra/privilege.extra.ts"],"names":[],"mappings":";;;AACA,uDAAkD;AAElD,uCAAuC;AAEvC,MAAM,EAAE,WAAW,EAAE,GAAG,gBAAQ,CAAA;AAEhC,MAAa,cAAe,SAAQ,gCAAc;IAC9C;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,MAAsB;QACtC,IAAI,OAAO,GAAG,WAAW,CAAC,aAAa,CAAA;QACvC,IAAI,QAAQ,GAAG,IAAI,gBAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QAC5C,IAAI,GAAG,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAA;QACrD,IAAI,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,YAAY,EAAE,CAAA;QACnD,OAAO,MAAM,CAAA;IACjB,CAAC;CAEJ;AAZD,wCAYC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ConnectionBase } from "./connection.base";
|
|
2
|
-
import { AllProperties, DBType, Property, RequestConfig, Response, ResponseWithExistCheck } from "../../types/types";
|
|
3
|
-
export declare class PropertyExtra extends ConnectionBase {
|
|
4
|
-
/**
|
|
5
|
-
* Loads one custom property of nodes or edges to the computing engine for query acceleration.
|
|
6
|
-
*/
|
|
7
|
-
lte(dbType: DBType, propertyName: string, schemaName?: string, config?: RequestConfig): Promise<import("../../types/types").JobResponse>;
|
|
8
|
-
/**
|
|
9
|
-
* Unloads one custom property of nodes or edges from the computing engine to save the memory.
|
|
10
|
-
*/
|
|
11
|
-
ufe(dbType: DBType, propertyName: string, schemaName?: string, config?: RequestConfig): Promise<Response>;
|
|
12
|
-
/**
|
|
13
|
-
* Retrieves custom properties of nodes or edges from the current graphset.if have dbType param,return List<property>.if not,return AllProperties
|
|
14
|
-
*/
|
|
15
|
-
showProperty(dbType?: DBType, schemaName?: string, config?: RequestConfig): Promise<AllProperties>;
|
|
16
|
-
/**
|
|
17
|
-
* Retrieves custom properties of nodes from the current graphset.
|
|
18
|
-
*/
|
|
19
|
-
showNodeProperty(schemaName?: string, config?: RequestConfig): Promise<Property[]>;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves custom properties of edges from the current graphset.
|
|
22
|
-
*/
|
|
23
|
-
showEdgeProperty(schemaName?: string, config?: RequestConfig): Promise<Property[]>;
|
|
24
|
-
/**
|
|
25
|
-
* Retrieves a custom property of nodes or edges from the current graphset.
|
|
26
|
-
* @param dbType: DBType
|
|
27
|
-
* @param schemaName: String
|
|
28
|
-
* @param propertyName: String
|
|
29
|
-
* @param config: RequestConfig
|
|
30
|
-
*/
|
|
31
|
-
getProperty(dbType: DBType, schemaName: string, propertyName: string, config?: RequestConfig): Promise<Property>;
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves a custom property of nodes from the current graphset.
|
|
34
|
-
*/
|
|
35
|
-
getNodeProperty(schemaName: string, propertyName: string, config?: RequestConfig): Promise<Property>;
|
|
36
|
-
/**
|
|
37
|
-
* Retrieves a custom property of edges from the current graphset.
|
|
38
|
-
*/
|
|
39
|
-
getEdgeProperty(schemaName: string, propertyName: string, config?: RequestConfig): Promise<Property>;
|
|
40
|
-
/**
|
|
41
|
-
* Checks if a specified node or edge has a certain property
|
|
42
|
-
* @param dbType
|
|
43
|
-
* @param schemaName
|
|
44
|
-
* @param propertyName
|
|
45
|
-
* @param config
|
|
46
|
-
* @returns
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
private hasProperty;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a new property for a node or edge schema in the current graphset.
|
|
52
|
-
*/
|
|
53
|
-
createProperty(dbType: DBType, property: Property, config?: RequestConfig): Promise<Response>;
|
|
54
|
-
/**
|
|
55
|
-
* Creates a new property for a node or edge schema in the current graphset, handling cases where the given property name already exists by ignoring the error.
|
|
56
|
-
*/
|
|
57
|
-
createPropertyIfNotExist(dbType: DBType, property: Property, config?: RequestConfig): Promise<ResponseWithExistCheck>;
|
|
58
|
-
/**
|
|
59
|
-
* Drops one custom property from the current graphset by its name and the associated schema.
|
|
60
|
-
*/
|
|
61
|
-
dropProperty(dbType: DBType, property: Property, config?: RequestConfig): Promise<Response>;
|
|
62
|
-
/**
|
|
63
|
-
* Alters the name and description of one existing custom property in the current graphset by its name.
|
|
64
|
-
*/
|
|
65
|
-
alterProperty(dbType: DBType, originProp: Property, newProp: Property, config?: RequestConfig): Promise<Response>;
|
|
66
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PropertyExtra = void 0;
|
|
4
|
-
const connection_base_1 = require("./connection.base");
|
|
5
|
-
const types_1 = require("../../types/types");
|
|
6
|
-
const utils_1 = require("../../utils");
|
|
7
|
-
const { CommandList, SchemaStringWithDefault } = utils_1.UQLMAKER;
|
|
8
|
-
class PropertyExtra extends connection_base_1.ConnectionBase {
|
|
9
|
-
/**
|
|
10
|
-
* Loads one custom property of nodes or edges to the computing engine for query acceleration.
|
|
11
|
-
*/
|
|
12
|
-
async lte(dbType, propertyName, schemaName, config) {
|
|
13
|
-
let command = dbType === types_1.DBType.DBNODE ? CommandList.lteNode : CommandList.lteEdge;
|
|
14
|
-
let commandParams = SchemaStringWithDefault(schemaName, propertyName);
|
|
15
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandParams);
|
|
16
|
-
return this.uqlJobResponse(uqlMaker, config);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Unloads one custom property of nodes or edges from the computing engine to save the memory.
|
|
20
|
-
*/
|
|
21
|
-
async ufe(dbType, propertyName, schemaName, config) {
|
|
22
|
-
let command = dbType === types_1.DBType.DBNODE ? CommandList.ufeNode : CommandList.ufeEdge;
|
|
23
|
-
let commandParams = SchemaStringWithDefault(schemaName, propertyName);
|
|
24
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandParams);
|
|
25
|
-
return this.uql(uqlMaker.toString(), config);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves custom properties of nodes or edges from the current graphset.if have dbType param,return List<property>.if not,return AllProperties
|
|
29
|
-
*/
|
|
30
|
-
async showProperty(dbType, schemaName, config) {
|
|
31
|
-
let command = CommandList.showProperty;
|
|
32
|
-
let commandP = null;
|
|
33
|
-
if (dbType !== undefined) {
|
|
34
|
-
command = dbType === types_1.DBType.DBNODE
|
|
35
|
-
? CommandList.showNodeProperty
|
|
36
|
-
: CommandList.showEdgeProperty;
|
|
37
|
-
if (schemaName) {
|
|
38
|
-
commandP = SchemaStringWithDefault(schemaName);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandP);
|
|
42
|
-
let res = await this.uql(uqlMaker.toString(), config);
|
|
43
|
-
let nodeProperty = res.aliases.find(a => a.name === "_nodeProperty") ? res.items["_nodeProperty"].asProperties() : [];
|
|
44
|
-
let edgeProperty = res.aliases.find(a => a.name === "_edgeProperty") ? res.items["_edgeProperty"].asProperties() : [];
|
|
45
|
-
return {
|
|
46
|
-
nodeProperties: nodeProperty || [],
|
|
47
|
-
edgeProperties: edgeProperty || [],
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Retrieves custom properties of nodes from the current graphset.
|
|
52
|
-
*/
|
|
53
|
-
async showNodeProperty(schemaName, config) {
|
|
54
|
-
let command = CommandList.showNodeProperty;
|
|
55
|
-
let commandP = SchemaStringWithDefault(schemaName);
|
|
56
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandP);
|
|
57
|
-
let res = await this.uql(uqlMaker.toString(), config);
|
|
58
|
-
return res.items["_nodeProperty"].asProperties();
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves custom properties of edges from the current graphset.
|
|
62
|
-
*/
|
|
63
|
-
async showEdgeProperty(schemaName, config) {
|
|
64
|
-
let command = CommandList.showEdgeProperty;
|
|
65
|
-
let commandP = SchemaStringWithDefault(schemaName);
|
|
66
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandP);
|
|
67
|
-
let res = await this.uql(uqlMaker.toString(), config);
|
|
68
|
-
return res.items["_edgeProperty"].asProperties();
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Retrieves a custom property of nodes or edges from the current graphset.
|
|
72
|
-
* @param dbType: DBType
|
|
73
|
-
* @param schemaName: String
|
|
74
|
-
* @param propertyName: String
|
|
75
|
-
* @param config: RequestConfig
|
|
76
|
-
*/
|
|
77
|
-
async getProperty(dbType, schemaName, propertyName, config) {
|
|
78
|
-
let listProperty = await this.showProperty(dbType, schemaName, config);
|
|
79
|
-
let properties = dbType === types_1.DBType.DBNODE
|
|
80
|
-
? listProperty.nodeProperties
|
|
81
|
-
: listProperty.edgeProperties;
|
|
82
|
-
let propertyItem = properties.find((property) => property.name === propertyName);
|
|
83
|
-
// if (propertyItem == undefined) {
|
|
84
|
-
// throw new Error(`Property ${propertyName} not found in ${DBType[dbType]} ${schemaName}`)
|
|
85
|
-
// }
|
|
86
|
-
return propertyItem;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Retrieves a custom property of nodes from the current graphset.
|
|
90
|
-
*/
|
|
91
|
-
async getNodeProperty(schemaName, propertyName, config) {
|
|
92
|
-
return this.getProperty(types_1.DBType.DBNODE, schemaName, propertyName, config);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Retrieves a custom property of edges from the current graphset.
|
|
96
|
-
*/
|
|
97
|
-
async getEdgeProperty(schemaName, propertyName, config) {
|
|
98
|
-
return this.getProperty(types_1.DBType.DBEDGE, schemaName, propertyName, config);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Checks if a specified node or edge has a certain property
|
|
102
|
-
* @param dbType
|
|
103
|
-
* @param schemaName
|
|
104
|
-
* @param propertyName
|
|
105
|
-
* @param config
|
|
106
|
-
* @returns
|
|
107
|
-
* @private
|
|
108
|
-
*/
|
|
109
|
-
async hasProperty(dbType, schemaName, propertyName, config) {
|
|
110
|
-
let res;
|
|
111
|
-
dbType === types_1.DBType.DBNODE
|
|
112
|
-
? res = await this.getNodeProperty(schemaName, propertyName, config)
|
|
113
|
-
: res = await this.getEdgeProperty(schemaName, propertyName, config);
|
|
114
|
-
return res != null;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Creates a new property for a node or edge schema in the current graphset.
|
|
118
|
-
*/
|
|
119
|
-
async createProperty(dbType, property, config) {
|
|
120
|
-
try {
|
|
121
|
-
let command = dbType === types_1.DBType.DBNODE
|
|
122
|
-
? CommandList.createNodeProperty
|
|
123
|
-
: CommandList.createEdgeProperty;
|
|
124
|
-
let p_type = property.type ? property.type : types_1.UltipaPropertyType.STRING;
|
|
125
|
-
let commandParams = [
|
|
126
|
-
SchemaStringWithDefault(property?.schema),
|
|
127
|
-
utils_1.UQLMAKER.ForceString(property.name),
|
|
128
|
-
utils_1.PropertyUtils.GetPropertyTypeDesc(p_type, property.subType, property.decimalExtra).toLowerCase(),
|
|
129
|
-
property.description || "",
|
|
130
|
-
];
|
|
131
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandParams);
|
|
132
|
-
return this.uql(uqlMaker.toString(), config);
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
return utils_1.FormatResponse.catchUltipaUqlError(error);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Creates a new property for a node or edge schema in the current graphset, handling cases where the given property name already exists by ignoring the error.
|
|
140
|
-
*/
|
|
141
|
-
async createPropertyIfNotExist(dbType, property, config) {
|
|
142
|
-
let isPropertyExist = await this.hasProperty(dbType, property.schema, property.name, config);
|
|
143
|
-
if (isPropertyExist) {
|
|
144
|
-
return {
|
|
145
|
-
exist: true,
|
|
146
|
-
response: {
|
|
147
|
-
status: utils_1.FormatResponse.successStatus(),
|
|
148
|
-
statistics: utils_1.FormatResponse.statisticsSum(),
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
let res = await this.createProperty(dbType, property, config);
|
|
153
|
-
return {
|
|
154
|
-
exist: false,
|
|
155
|
-
response: res
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Drops one custom property from the current graphset by its name and the associated schema.
|
|
160
|
-
*/
|
|
161
|
-
async dropProperty(dbType, property, config) {
|
|
162
|
-
let command = dbType === types_1.DBType.DBNODE
|
|
163
|
-
? CommandList.dropNodeProperty
|
|
164
|
-
: CommandList.dropEdgeProperty;
|
|
165
|
-
let commandParams = SchemaStringWithDefault(property.schema, property.name);
|
|
166
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandParams);
|
|
167
|
-
return this.uql(uqlMaker.toString(), config);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Alters the name and description of one existing custom property in the current graphset by its name.
|
|
171
|
-
*/
|
|
172
|
-
async alterProperty(dbType, originProp, newProp, config) {
|
|
173
|
-
let command = dbType === types_1.DBType.DBNODE
|
|
174
|
-
? CommandList.updateNodeProperty
|
|
175
|
-
: CommandList.updateEdgeProperty;
|
|
176
|
-
let commandParams = SchemaStringWithDefault(originProp.schema, originProp.name);
|
|
177
|
-
let uqlMaker = new utils_1.UQLMAKER(command, config, commandParams);
|
|
178
|
-
let set = {};
|
|
179
|
-
if (newProp.name) {
|
|
180
|
-
set.name = newProp.name;
|
|
181
|
-
}
|
|
182
|
-
if ((0, utils_1.isNotNullString)(newProp.description)) {
|
|
183
|
-
set.description = newProp.description;
|
|
184
|
-
}
|
|
185
|
-
uqlMaker.addParam("set", set);
|
|
186
|
-
return this.uql(uqlMaker.toString(), config);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
exports.PropertyExtra = PropertyExtra;
|
|
190
|
-
//# sourceMappingURL=property.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AAC;CAMJ;AApPD,sCAoPC"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { DBType, RequestConfig, Schema, ResponseWithExistCheck } from "../../types/types";
|
|
2
|
-
import { PropertyExtra } from "./property.extra";
|
|
3
|
-
export declare class SchemaExra extends PropertyExtra {
|
|
4
|
-
private showSchemaBase;
|
|
5
|
-
/**
|
|
6
|
-
* Retrieves all nodes and edge schemas from the current graphset.
|
|
7
|
-
* @param config
|
|
8
|
-
*/
|
|
9
|
-
showSchema(config?: RequestConfig): Promise<Schema[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Get one schema info
|
|
12
|
-
* @param isNode
|
|
13
|
-
* @param name
|
|
14
|
-
* @param config
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
private getSchemaBase;
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves a node or edge schema from the current graphset.
|
|
20
|
-
* @param name
|
|
21
|
-
* @param dbType
|
|
22
|
-
* @param config
|
|
23
|
-
*/
|
|
24
|
-
getSchema(schemaName: string, dbType: DBType, config?: RequestConfig): Promise<Schema>;
|
|
25
|
-
/**
|
|
26
|
-
*Retrieves a node schema from the current graphset.
|
|
27
|
-
* @param schemaName
|
|
28
|
-
* @param config
|
|
29
|
-
* @returns Response<Schema>
|
|
30
|
-
*/
|
|
31
|
-
getNodeSchema(schemaName: string, config?: RequestConfig): Promise<Schema>;
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves all node schemas from the current graphset.
|
|
34
|
-
* @param config
|
|
35
|
-
* @returns Response<Schema[]>
|
|
36
|
-
*/
|
|
37
|
-
showNodeSchema(config?: RequestConfig): Promise<Schema[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Retrieves an edge schema from the current graphset.
|
|
40
|
-
* @param config
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
getEdgeSchema(schemaName: string, config?: RequestConfig): Promise<Schema>;
|
|
44
|
-
/**
|
|
45
|
-
* Retrieves all node schemas from the current graphset.
|
|
46
|
-
* @param config
|
|
47
|
-
* @returns Response<Schema[]>
|
|
48
|
-
*/
|
|
49
|
-
showEdgeSchema(config?: RequestConfig): Promise<Schema[]>;
|
|
50
|
-
private createSchemaBase;
|
|
51
|
-
/**
|
|
52
|
-
* Creates a new schema in the current graphset.
|
|
53
|
-
* @param schema
|
|
54
|
-
* @param isCreateProperties
|
|
55
|
-
* @param config
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
createSchema(schema: Schema, isCreateProperties?: boolean, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
59
|
-
private hasSchema;
|
|
60
|
-
/**
|
|
61
|
-
* Creates a new schema in the current graphset, handling cases where the given schema name already exists by ignoring the error.
|
|
62
|
-
* @param schema
|
|
63
|
-
* @param config
|
|
64
|
-
*/
|
|
65
|
-
createSchemaIfNotExist(schema: Schema, isCreateProperties?: boolean, config?: RequestConfig): Promise<ResponseWithExistCheck>;
|
|
66
|
-
/**
|
|
67
|
-
* Drops one schema from the current graphset by its name.
|
|
68
|
-
*/
|
|
69
|
-
dropSchema(schema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
70
|
-
/**
|
|
71
|
-
* Creates a new node schema in the current graphset.
|
|
72
|
-
* @param req
|
|
73
|
-
* @param config
|
|
74
|
-
* @returns
|
|
75
|
-
*/
|
|
76
|
-
createNodeSchema(req: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
77
|
-
/**
|
|
78
|
-
* Creates a new edge schema in the current graphset.
|
|
79
|
-
* @param req
|
|
80
|
-
* @param config
|
|
81
|
-
* @returns
|
|
82
|
-
*/
|
|
83
|
-
createEdgeSchema(req: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
84
|
-
/**
|
|
85
|
-
* Alters the name and description of one existing schema in the current graphset by its name.
|
|
86
|
-
* @param schema
|
|
87
|
-
* @param newSchema
|
|
88
|
-
* @param config
|
|
89
|
-
* @returns
|
|
90
|
-
*/
|
|
91
|
-
alterSchema(originalSchema: Schema, newSchema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
92
|
-
/**
|
|
93
|
-
* Alters the name and description of one existing node schema in the current graphset by its name.
|
|
94
|
-
* @param schema
|
|
95
|
-
* @param newSchema
|
|
96
|
-
* @param config
|
|
97
|
-
* @returns
|
|
98
|
-
*/
|
|
99
|
-
alterNodeSchema(originalSchema: Schema, newSchema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
100
|
-
/**
|
|
101
|
-
* Alters the name and description of one existing edge schema in the current graphset by its name.
|
|
102
|
-
* @param schema
|
|
103
|
-
* @param newSchema
|
|
104
|
-
* @param config
|
|
105
|
-
* @returns
|
|
106
|
-
*/
|
|
107
|
-
alterEdgeSchema(originalSchema: Schema, newSchema: Schema, config?: RequestConfig): Promise<import("../../types/types").Response>;
|
|
108
|
-
}
|