@or-sdk/graph 1.10.1-beta.4012.0 → 1.10.1
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/CHANGELOG.md +8 -0
- package/dist/types/Graphs.d.ts +0 -130
- package/dist/types/Graphs.d.ts.map +1 -1
- package/dist/types/types.d.ts +0 -12
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.10.1](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/graph@1.10.0...@or-sdk/graph@1.10.1) (2026-02-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @or-sdk/graph
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.10.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/graph@1.9.4...@or-sdk/graph@1.10.0) (2026-02-24)
|
|
7
15
|
|
|
8
16
|
|
package/dist/types/Graphs.d.ts
CHANGED
|
@@ -2,148 +2,18 @@ import { Base, List } from '@or-sdk/base';
|
|
|
2
2
|
import { WriteResponse, Graph, ExecuteQueryArgs, GraphInfo, GraphConfig, Query, ExecuteTransactionArgs, CreateNodeArgs, Node, NodeProperties } from './types';
|
|
3
3
|
export declare class Graphs extends Base {
|
|
4
4
|
constructor(params: GraphConfig);
|
|
5
|
-
/**
|
|
6
|
-
* Execute query in graph
|
|
7
|
-
* @param {ExecuteQueryArgs} query Query to run
|
|
8
|
-
* ```typescript
|
|
9
|
-
* type Place = Node<{ name: string; description: string; lat: number; lng: number }>
|
|
10
|
-
*
|
|
11
|
-
* const res = await graph.query<{ p: Place }>({
|
|
12
|
-
* graph: 'places',
|
|
13
|
-
* query: 'MATCH (p: Place) WHERE p.name = $name RETURN p',
|
|
14
|
-
* params: { name: 'CoffeePlace' }
|
|
15
|
-
* });
|
|
16
|
-
*
|
|
17
|
-
* console.log(res[0].n.name)
|
|
18
|
-
* // CoffeePlace
|
|
19
|
-
* ```
|
|
20
|
-
* @returns Query results as array
|
|
21
|
-
*/
|
|
22
5
|
query<T>({ query, params, graph, readonly }: ExecuteQueryArgs): Promise<T[]>;
|
|
23
|
-
/**
|
|
24
|
-
* Execute bulk of queries in transaction in graph
|
|
25
|
-
* @param {string} graph Graph name to execute transaction in
|
|
26
|
-
* @param {ExecuteTransactionArgs[]} queries Set of queries to run in transaction
|
|
27
|
-
* ```typescript
|
|
28
|
-
*
|
|
29
|
-
* const res = await graph.transaction('places', [
|
|
30
|
-
* {
|
|
31
|
-
* query: 'CREATE (p: Place { name: 'place1' })',
|
|
32
|
-
* },
|
|
33
|
-
* {
|
|
34
|
-
* query: 'CREATE (p: Place { name: $name })',
|
|
35
|
-
* params: { name: 'place2' }
|
|
36
|
-
* }
|
|
37
|
-
* ]);
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
6
|
transaction(graph: string, queries: ExecuteTransactionArgs[]): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* List graphs
|
|
43
|
-
* @param {string} [name] Graph name to search for.
|
|
44
|
-
* ```typescript
|
|
45
|
-
* const graphs = await graph.listGraphs();
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
7
|
listGraphs(name?: string): Promise<List<Graph>>;
|
|
49
|
-
/**
|
|
50
|
-
* Get graph info
|
|
51
|
-
* @param {string} [name] Graph name
|
|
52
|
-
* ```typescript
|
|
53
|
-
* const result = await graph.getGraphInfo('graph-name');
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
8
|
getGraphInfo(name: string): Promise<GraphInfo>;
|
|
57
|
-
/**
|
|
58
|
-
* Create graph
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const result = await graph.createGraph({
|
|
61
|
-
* name: 'graph-name',
|
|
62
|
-
* description: 'First steps in graphs',
|
|
63
|
-
* });
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
9
|
createGraph(graph: Graph): Promise<WriteResponse>;
|
|
67
|
-
/**
|
|
68
|
-
* Update graph
|
|
69
|
-
* ```typescript
|
|
70
|
-
* const result = await graph.updateGraph({
|
|
71
|
-
* name: 'graph-name',
|
|
72
|
-
* description: 'First steps in graphs'
|
|
73
|
-
* });
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
10
|
updateGraph(graph: Graph): Promise<WriteResponse>;
|
|
77
|
-
/**
|
|
78
|
-
* Delete graph
|
|
79
|
-
* @param {string} name Graph name to delete
|
|
80
|
-
* ```typescript
|
|
81
|
-
* await graph.deleteGraph('graph-name');
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
11
|
deleteGraph(name: string): Promise<WriteResponse>;
|
|
85
|
-
/**
|
|
86
|
-
* Save Query for future resuse
|
|
87
|
-
* @param graph
|
|
88
|
-
* @param param1
|
|
89
|
-
* @returns
|
|
90
|
-
*/
|
|
91
12
|
saveQuery(graph: string, { name, ...query }: Query): Promise<WriteResponse>;
|
|
92
|
-
/**
|
|
93
|
-
* List queries
|
|
94
|
-
* @param {string} graph Graph name to list queries for.
|
|
95
|
-
* @param {string} [name] Query name to search for.
|
|
96
|
-
* ```typescript
|
|
97
|
-
* const queries = await graph.listQueries();
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
13
|
listQueries(graph: string, name?: string): Promise<List<Query>>;
|
|
101
|
-
/**
|
|
102
|
-
* Get single saved query
|
|
103
|
-
* @param {string} graph Graph name queries belong to
|
|
104
|
-
* @param {string} name Query name.
|
|
105
|
-
* ```typescript
|
|
106
|
-
* const queries = await graph.listQueries();
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
14
|
getQuery(graph: string, name: string): Promise<Query>;
|
|
110
|
-
/**
|
|
111
|
-
* Delete saved query
|
|
112
|
-
* @param {string} graph Graph name query belongs to
|
|
113
|
-
* @param {string} name Query name to delete
|
|
114
|
-
* ```typescript
|
|
115
|
-
* const result = await graph.deleteQuery('db-name');
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
15
|
deleteQuery(graph: string, name: string): Promise<WriteResponse>;
|
|
119
|
-
/**
|
|
120
|
-
* Converts user provided message to executable cypher query.
|
|
121
|
-
* @param {string} graph Graph name
|
|
122
|
-
* @param {string} text Text to generate a Cypher query from
|
|
123
|
-
* @returns {Promise<string>} Promise that resolves to the generated Cypher query
|
|
124
|
-
*
|
|
125
|
-
* ```typescript
|
|
126
|
-
* const generatedCypher = await graph.textToCypher('my-graph', 'List all airports in London');
|
|
127
|
-
* console.log(generatedCypher);
|
|
128
|
-
* // MATCH (n:Airport) WHERE n.city = 'London' RETURN n
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
16
|
textToCypher(graph: string, text: string): Promise<string>;
|
|
132
|
-
/**
|
|
133
|
-
* Creates node in graph database
|
|
134
|
-
* @param {string[]} labels Node labels
|
|
135
|
-
* @param {object} properties Object with node properties, only string, number, boolean
|
|
136
|
-
* @param {string} databaseName Graph name
|
|
137
|
-
* @returns {Promise<Node>} Promise that returns created node
|
|
138
|
-
*
|
|
139
|
-
* ```typescript
|
|
140
|
-
* const node = await graph.createNode({
|
|
141
|
-
* labels: ['Label1', 'Label2'],
|
|
142
|
-
* properties: { name: 'Node' },
|
|
143
|
-
* databaseName: 'my-graph'
|
|
144
|
-
* });
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
17
|
createNode({ labels, properties, databaseName }: CreateNodeArgs): Promise<Node<NodeProperties>>;
|
|
148
18
|
}
|
|
149
19
|
//# sourceMappingURL=Graphs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graphs.d.ts","sourceRoot":"","sources":["../../src/Graphs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAY,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CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAkBxC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAepC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAmBhE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA0B1D,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;CAc7G"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { Token } from '@or-sdk/base';
|
|
2
2
|
export type GraphConfig = {
|
|
3
|
-
/**
|
|
4
|
-
* token
|
|
5
|
-
*/
|
|
6
3
|
token: Token;
|
|
7
|
-
/**
|
|
8
|
-
* Url of OneReach service discovery api
|
|
9
|
-
*/
|
|
10
4
|
discoveryUrl?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Account ID for cross-account requests (super admin only)
|
|
13
|
-
*/
|
|
14
5
|
accountId?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Url of OneReach graph api
|
|
17
|
-
*/
|
|
18
6
|
graphUrl?: string;
|
|
19
7
|
};
|
|
20
8
|
export type QueryParams = Record<string, null | number | string | boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,MAA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AAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,KAAK,EAAE,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/graph",
|
|
3
|
-
"version": "1.10.1
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dev": "pnpm build:watch:esm"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@or-sdk/base": "^0.44.0
|
|
21
|
+
"@or-sdk/base": "^0.44.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"concurrently": "9.0.1",
|
|
@@ -26,5 +26,6 @@
|
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"gitHead": "7d3b49250a670964dfe9e8e50e95417761c5473f"
|
|
30
31
|
}
|