@cubicweb/client 3.0.0-alpha.4 → 3.0.0-alpha.6
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/README.md +28 -16
- package/lib/api/Api.d.ts +25 -10
- package/lib/api/Api.d.ts.map +1 -1
- package/lib/api/Api.js +69 -43
- package/lib/api/Api.js.map +1 -1
- package/lib/api/Client.d.ts +11 -6
- package/lib/api/Client.d.ts.map +1 -1
- package/lib/api/Client.js +20 -11
- package/lib/api/Client.js.map +1 -1
- package/lib/api/Transaction.d.ts +30 -21
- package/lib/api/Transaction.d.ts.map +1 -1
- package/lib/api/Transaction.js +44 -36
- package/lib/api/Transaction.js.map +1 -1
- package/lib/schema/classes/EntitySchema.d.ts +2 -0
- package/lib/schema/classes/EntitySchema.d.ts.map +1 -1
- package/lib/schema/classes/EntitySchema.js +2 -0
- package/lib/schema/classes/EntitySchema.js.map +1 -1
- package/lib/schema/classes/RelationDefinitionSchema.d.ts +2 -0
- package/lib/schema/classes/RelationDefinitionSchema.d.ts.map +1 -1
- package/lib/schema/classes/RelationDefinitionSchema.js +2 -0
- package/lib/schema/classes/RelationDefinitionSchema.js.map +1 -1
- package/lib/schema/classes/Schema.d.ts +2 -0
- package/lib/schema/classes/Schema.d.ts.map +1 -1
- package/lib/schema/classes/Schema.js +2 -0
- package/lib/schema/classes/Schema.js.map +1 -1
- package/lib/schema/classes/Utils.d.ts +28 -0
- package/lib/schema/classes/Utils.d.ts.map +1 -1
- package/lib/schema/classes/Utils.js +22 -0
- package/lib/schema/classes/Utils.js.map +1 -1
- package/lib/schema/raw/Constraints.d.ts +17 -9
- package/lib/schema/raw/Constraints.d.ts.map +1 -1
- package/lib/schema/raw/Entities.d.ts +4 -0
- package/lib/schema/raw/Entities.d.ts.map +1 -1
- package/lib/schema/raw/RelationDefinitions.d.ts +12 -0
- package/lib/schema/raw/RelationDefinitions.d.ts.map +1 -1
- package/lib/schema/raw/Schema.d.ts +2 -0
- package/lib/schema/raw/Schema.d.ts.map +1 -1
- package/lib/schema/raw/Utils.d.ts +6 -0
- package/lib/schema/raw/Utils.d.ts.map +1 -1
- package/package.json +4 -8
- package/src/api/Api.ts +81 -40
- package/src/api/Client.ts +24 -20
- package/src/api/Transaction.ts +57 -31
- package/src/schema/classes/EntitySchema.ts +2 -0
- package/src/schema/classes/RelationDefinitionSchema.ts +2 -0
- package/src/schema/classes/Schema.ts +2 -0
- package/src/schema/classes/Utils.ts +28 -0
- package/src/schema/raw/Constraints.ts +20 -8
- package/src/schema/raw/Entities.ts +4 -0
- package/src/schema/raw/RelationDefinitions.ts +12 -0
- package/src/schema/raw/Schema.ts +2 -0
- package/src/schema/raw/Utils.ts +6 -0
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
# @cubicweb/client
|
|
2
2
|
|
|
3
|
-
This library
|
|
4
|
-
used to communicate with instances running with the
|
|
3
|
+
This library allows any JavaScript client to communicate with a [CubicWeb](https://cubicweb.org/) instance running with the
|
|
5
4
|
[API cube](https://forge.extranet.logilab.fr/cubicweb/cubes/api).
|
|
6
5
|
It replaces the [cwclientlibjs](https://forge.extranet.logilab.fr/open-source/cwclientlibjs)
|
|
7
6
|
library.
|
|
8
7
|
|
|
9
8
|
The full documentation is available [here](https://cubicweb.pages.logilab.fr/cubicwebjs/client).
|
|
10
9
|
|
|
10
|
+
**Compatible with [API cube](https://forge.extranet.logilab.fr/cubicweb/cubes/api) version 0.11 only.**
|
|
11
|
+
|
|
11
12
|
## Installation
|
|
12
13
|
|
|
13
|
-
@cubicweb/client is
|
|
14
|
+
@cubicweb/client is available from NPM:
|
|
14
15
|
```bash
|
|
15
16
|
# With NPM
|
|
16
17
|
npm i @cubicweb/client
|
|
@@ -76,20 +77,22 @@ client
|
|
|
76
77
|
});
|
|
77
78
|
|
|
78
79
|
// Execute a series of request in a transaction
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
const transaction = new Transaction()
|
|
81
|
+
transaction.push({
|
|
82
|
+
query: `INSERT Person X: X name "test"`
|
|
83
|
+
})
|
|
84
|
+
transaction.push({
|
|
85
|
+
query: `Any X Where X eid %(created_eid)s`,
|
|
86
|
+
params: {
|
|
87
|
+
created_eid: {
|
|
88
|
+
queryIndex: 0,
|
|
89
|
+
row: 0,
|
|
90
|
+
column: 0,
|
|
91
|
+
}
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
+
})
|
|
94
|
+
client
|
|
95
|
+
.executeTransaction(transaction)
|
|
93
96
|
.then((callbackResult) => {
|
|
94
97
|
console.log("Transaction was successul and the callback returned:");
|
|
95
98
|
console.log(callbackResult);
|
|
@@ -203,3 +206,12 @@ const entity = schema.getEntity("InvalidEntityType");
|
|
|
203
206
|
// TS will be happy and your entity will have the type 'ValidEntityType'.
|
|
204
207
|
const entity = schema.getEntity("ValidEntityType");
|
|
205
208
|
```
|
|
209
|
+
|
|
210
|
+
## Contribute
|
|
211
|
+
|
|
212
|
+
All `@cubicweb` libraries are in the [cubicwebjs monorepo](https://forge.extranet.logilab.fr/cubicweb/cubicwebjs).
|
|
213
|
+
Please refer to the main README.
|
|
214
|
+
|
|
215
|
+
## Get Help
|
|
216
|
+
|
|
217
|
+
Contact us on [Matrix](https://matrix.to/#/#cubicweb:matrix.logilab.org) and check the roadmap on the [CubicWeb Repository](https://forge.extranet.logilab.fr/cubicweb/cubicweb).
|
package/lib/api/Api.d.ts
CHANGED
|
@@ -2,25 +2,35 @@ import { RawSchema } from "../schema/raw/Schema";
|
|
|
2
2
|
import { TransactionResult, Transaction } from "./Transaction";
|
|
3
3
|
/**
|
|
4
4
|
* Type representing an RQL request and its associated parameters.
|
|
5
|
+
*
|
|
6
|
+
* @category Api
|
|
5
7
|
*/
|
|
6
8
|
export type RQLQuery = [string, RQLParams];
|
|
7
9
|
export type RQLParamValue = string | number | boolean | null;
|
|
8
10
|
/**
|
|
9
11
|
* Type representing RQL parameters to send along a request.
|
|
12
|
+
*
|
|
13
|
+
* @category Api
|
|
10
14
|
*/
|
|
11
15
|
export interface RQLParams {
|
|
12
16
|
[key: string]: RQLParamValue;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* Type representing a row returned in a result set.
|
|
20
|
+
*
|
|
21
|
+
* @category Api
|
|
16
22
|
*/
|
|
17
23
|
export type RqlRow = Array<string | number | boolean | null>;
|
|
18
24
|
/**
|
|
19
25
|
* Type representing a RQL request result.
|
|
26
|
+
*
|
|
27
|
+
* @category Api
|
|
20
28
|
*/
|
|
21
29
|
export type ResultSet = Array<RqlRow>;
|
|
22
30
|
/**
|
|
23
31
|
* Type representing the currently logged user's data
|
|
32
|
+
*
|
|
33
|
+
* @category Api
|
|
24
34
|
*/
|
|
25
35
|
export interface CurrentUser {
|
|
26
36
|
login: string;
|
|
@@ -29,6 +39,8 @@ export interface CurrentUser {
|
|
|
29
39
|
}
|
|
30
40
|
/**
|
|
31
41
|
* Type representing the body of an error sent by CubicWeb's API.
|
|
42
|
+
*
|
|
43
|
+
* @category Api
|
|
32
44
|
*/
|
|
33
45
|
type ApiError = {
|
|
34
46
|
title: string;
|
|
@@ -37,6 +49,8 @@ type ApiError = {
|
|
|
37
49
|
};
|
|
38
50
|
/**
|
|
39
51
|
* Type representing the error data sent to clients when retrieving an API error.
|
|
52
|
+
*
|
|
53
|
+
* @category Api
|
|
40
54
|
*/
|
|
41
55
|
export type ApiErrorResponse = {
|
|
42
56
|
status: number;
|
|
@@ -56,7 +70,7 @@ export default class Api {
|
|
|
56
70
|
private _schemaApiUrl;
|
|
57
71
|
private _loginApiUrl;
|
|
58
72
|
private _currentUserApiUrl;
|
|
59
|
-
private
|
|
73
|
+
private _binaryApiUrl;
|
|
60
74
|
/**
|
|
61
75
|
* Class used to handle requests to the CubicWeb API.
|
|
62
76
|
*
|
|
@@ -70,14 +84,6 @@ export default class Api {
|
|
|
70
84
|
constructor(apiUrl: string);
|
|
71
85
|
get apiUrl(): string;
|
|
72
86
|
private getApiRoute;
|
|
73
|
-
/**
|
|
74
|
-
* Executes the given query and waits for the response.
|
|
75
|
-
*
|
|
76
|
-
* @param query The RQL query to send
|
|
77
|
-
* @param params The additional parameters for the request
|
|
78
|
-
* @returns A promise with the request's result set
|
|
79
|
-
*/
|
|
80
|
-
execute(query: string, params: RQLParams): Promise<ResultSet>;
|
|
81
87
|
/**
|
|
82
88
|
* Retrieves the CubicWeb instance's JSON schema.
|
|
83
89
|
*
|
|
@@ -98,7 +104,16 @@ export default class Api {
|
|
|
98
104
|
* @returns A promise resolving to the current user
|
|
99
105
|
*/
|
|
100
106
|
currentUser(): Promise<CurrentUser>;
|
|
101
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Get the binary for the given entity attribute
|
|
109
|
+
*
|
|
110
|
+
* @returns A promise resolving to the binary
|
|
111
|
+
*/
|
|
112
|
+
binary(eid: number, attribute: string): Promise<Blob>;
|
|
113
|
+
rql(transaction: Transaction): Promise<TransactionResult>;
|
|
114
|
+
private getTransactionParams;
|
|
115
|
+
private multipartTransaction;
|
|
116
|
+
private jsonTransaction;
|
|
102
117
|
private handleUserErrors;
|
|
103
118
|
}
|
|
104
119
|
export {};
|
package/lib/api/Api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../src/api/Api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEZ,MAAM,eAAe,CAAC;AAEvB
|
|
1
|
+
{"version":3,"file":"Api.d.ts","sourceRoot":"","sources":["../../src/api/Api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEZ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AC,WAAW;IAInB;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;IAOlC;;;;;;OAMG;IACG,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB9D;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAOzC;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWrD,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAY/D,OAAO,CAAC,oBAAoB;YAkBd,oBAAoB;YAmBpB,eAAe;IAY7B,OAAO,CAAC,gBAAgB;CAgBzB"}
|
package/lib/api/Api.js
CHANGED
|
@@ -37,7 +37,7 @@ class Api {
|
|
|
37
37
|
this._schemaApiUrl = this.getApiRoute("schema");
|
|
38
38
|
this._loginApiUrl = this.getApiRoute("login");
|
|
39
39
|
this._currentUserApiUrl = this.getApiRoute("current-user");
|
|
40
|
-
this.
|
|
40
|
+
this._binaryApiUrl = this.getApiRoute("binary");
|
|
41
41
|
}
|
|
42
42
|
get apiUrl() {
|
|
43
43
|
return this._apiUrl;
|
|
@@ -45,27 +45,6 @@ class Api {
|
|
|
45
45
|
getApiRoute(route) {
|
|
46
46
|
return `${this._apiUrl}/${this._version}/${route}`;
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Executes the given query and waits for the response.
|
|
50
|
-
*
|
|
51
|
-
* @param query The RQL query to send
|
|
52
|
-
* @param params The additional parameters for the request
|
|
53
|
-
* @returns A promise with the request's result set
|
|
54
|
-
*/
|
|
55
|
-
execute(query, params) {
|
|
56
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
try {
|
|
58
|
-
return yield nonNullFetchApi(this._rqlApiUrl, {
|
|
59
|
-
method: "POST",
|
|
60
|
-
body: JSON.stringify({ query, params }),
|
|
61
|
-
credentials: "include", // FIXME is it secure?
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
this.handleUserErrors(e);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
48
|
/**
|
|
70
49
|
* Retrieves the CubicWeb instance's JSON schema.
|
|
71
50
|
*
|
|
@@ -117,34 +96,79 @@ class Api {
|
|
|
117
96
|
});
|
|
118
97
|
});
|
|
119
98
|
}
|
|
120
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Get the binary for the given entity attribute
|
|
101
|
+
*
|
|
102
|
+
* @returns A promise resolving to the binary
|
|
103
|
+
*/
|
|
104
|
+
binary(eid, attribute) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const params = new URLSearchParams({
|
|
107
|
+
eid: eid.toString(),
|
|
108
|
+
attribute,
|
|
109
|
+
});
|
|
110
|
+
return yield nonNullFetchApi(this._binaryApiUrl + params, {
|
|
111
|
+
method: "GET",
|
|
112
|
+
credentials: "include",
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
rql(transaction) {
|
|
121
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
const data = transaction.queries.map((transactionQuery) => ({
|
|
123
|
-
query: transactionQuery.query,
|
|
124
|
-
params: Object.fromEntries(Object.entries(transactionQuery.params).map(([key, value]) => [
|
|
125
|
-
key,
|
|
126
|
-
(0, Transaction_1.isTransactionQueryRef)(value)
|
|
127
|
-
? {
|
|
128
|
-
queryIndex: value.queryIndex,
|
|
129
|
-
row: value.row,
|
|
130
|
-
column: value.column,
|
|
131
|
-
}
|
|
132
|
-
: value,
|
|
133
|
-
])),
|
|
134
|
-
}));
|
|
135
118
|
try {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
119
|
+
if (Object.keys(transaction.binaries).length > 0) {
|
|
120
|
+
return yield this.multipartTransaction(transaction);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
return yield this.jsonTransaction(transaction);
|
|
124
|
+
}
|
|
142
125
|
}
|
|
143
126
|
catch (e) {
|
|
144
127
|
this.handleUserErrors(e);
|
|
145
128
|
}
|
|
146
129
|
});
|
|
147
130
|
}
|
|
131
|
+
getTransactionParams(transaction) {
|
|
132
|
+
return transaction.queries.map((transactionQuery) => ({
|
|
133
|
+
query: transactionQuery.query,
|
|
134
|
+
params: Object.fromEntries(Object.entries(transactionQuery.params).map(([key, value]) => [
|
|
135
|
+
key,
|
|
136
|
+
(0, Transaction_1.isTransactionQueryScalarRef)(value)
|
|
137
|
+
? {
|
|
138
|
+
queryIndex: value.queryIndex,
|
|
139
|
+
row: value.row,
|
|
140
|
+
column: value.column,
|
|
141
|
+
}
|
|
142
|
+
: value,
|
|
143
|
+
])),
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
multipartTransaction(transaction) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const jsonParams = this.getTransactionParams(transaction);
|
|
149
|
+
const formData = new FormData();
|
|
150
|
+
formData.append("queries", JSON.stringify(jsonParams));
|
|
151
|
+
Object.entries(transaction.binaries).forEach(([key, value]) => {
|
|
152
|
+
formData.append(key, value);
|
|
153
|
+
});
|
|
154
|
+
const resultSets = yield nonNullFetchApi(this._rqlApiUrl, {
|
|
155
|
+
method: "POST",
|
|
156
|
+
credentials: "include",
|
|
157
|
+
body: formData,
|
|
158
|
+
});
|
|
159
|
+
return new Transaction_1.TransactionResult(resultSets);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
jsonTransaction(transaction) {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
const resultSets = yield nonNullFetchApi(this._rqlApiUrl, {
|
|
165
|
+
method: "POST",
|
|
166
|
+
credentials: "include",
|
|
167
|
+
body: JSON.stringify(this.getTransactionParams(transaction)),
|
|
168
|
+
});
|
|
169
|
+
return new Transaction_1.TransactionResult(resultSets);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
148
172
|
handleUserErrors(error) {
|
|
149
173
|
if (typeof error === "object" &&
|
|
150
174
|
error !== null &&
|
|
@@ -197,7 +221,9 @@ function fetchApi(input, init) {
|
|
|
197
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
222
|
let headers = init === null || init === void 0 ? void 0 : init.headers;
|
|
199
223
|
if ((init === null || init === void 0 ? void 0 : init.method) && init.method !== "GET" && init.method !== "DELETE") {
|
|
200
|
-
headers = Object.assign({ "Content-Type": "application/json;charset=UTF-8"
|
|
224
|
+
headers = Object.assign({ "Content-Type": "application/json;charset=UTF-8",
|
|
225
|
+
// CSRF custom header necessary for POST requests
|
|
226
|
+
"X-Client-Name": "XMLHttpRequest" }, init === null || init === void 0 ? void 0 : init.headers);
|
|
201
227
|
}
|
|
202
228
|
const response = yield fetch(input, Object.assign(Object.assign({}, init), { headers }));
|
|
203
229
|
const status = response.status;
|
package/lib/api/Api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../src/api/Api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAA4C;AAE5C,+CAIuB;
|
|
1
|
+
{"version":3,"file":"Api.js","sourceRoot":"","sources":["../../src/api/Api.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAA4C;AAE5C,+CAIuB;AAgEvB;;;;;;;GAOG;AACH,MAAqB,GAAG;IAStB;;;;;;;;;OASG;IACH,YAAY,MAAc;QAjBlB,aAAQ,GAAG,IAAI,CAAC;QAkBtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QA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;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACjB,OAAO,IAAI,CAAC;aACb;SACF;aAAM;YACL,IAAI,IAAI,CAAC;YACT,IAAI;gBACF,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;aAC9B;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;aAC/C;YACD,sBAAQ,MAAM,IAAK,IAAI,EAAG;SAC3B;IACH,CAAC;CAAA"}
|
package/lib/api/Client.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Schema } from "../schema/classes/Schema";
|
|
2
2
|
import { RQLParams, ResultSet, CurrentUser } from "./Api";
|
|
3
|
-
import {
|
|
3
|
+
import { BinariesParam, Transaction, TransactionResult } from "./Transaction";
|
|
4
4
|
/**
|
|
5
5
|
* Class used to communicate with a CubicWeb instance's API.
|
|
6
|
+
*
|
|
7
|
+
* @category Api
|
|
6
8
|
*/
|
|
7
9
|
export default class Client {
|
|
8
10
|
private api;
|
|
9
|
-
private transactionBackend;
|
|
10
11
|
/**
|
|
11
12
|
* Class used to communicate with a CubicWeb instance's API.
|
|
12
13
|
*
|
|
@@ -14,9 +15,7 @@ export default class Client {
|
|
|
14
15
|
* Example: if you can retrieve the schema with https://example.com/api/v1/schema,
|
|
15
16
|
* use https://example.com/api as `apiUrl`.
|
|
16
17
|
*/
|
|
17
|
-
constructor(apiUrl: string
|
|
18
|
-
transactionBackend?: TransactionBackend;
|
|
19
|
-
});
|
|
18
|
+
constructor(apiUrl: string);
|
|
20
19
|
get apiUrl(): string;
|
|
21
20
|
/**
|
|
22
21
|
* Executes the given query and waits for the response.
|
|
@@ -25,7 +24,7 @@ export default class Client {
|
|
|
25
24
|
* @param params The additional parameters for the request
|
|
26
25
|
* @returns A promise with the request's result set
|
|
27
26
|
*/
|
|
28
|
-
execute(query: string, params?: RQLParams): Promise<ResultSet>;
|
|
27
|
+
execute(query: string, params?: RQLParams, binaries?: BinariesParam): Promise<ResultSet>;
|
|
29
28
|
/**
|
|
30
29
|
* Retrieves the CubicWeb instance's JSON schema.
|
|
31
30
|
*
|
|
@@ -51,5 +50,11 @@ export default class Client {
|
|
|
51
50
|
* @returns A promise fulfilled when the transaction is completed
|
|
52
51
|
*/
|
|
53
52
|
executeTransaction(transaction: Transaction): Promise<TransactionResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Get the binary for the given entity attribute
|
|
55
|
+
*
|
|
56
|
+
* @returns A promise resolving to the binary
|
|
57
|
+
*/
|
|
58
|
+
getBinary(eid: number, attribute: string): Promise<Blob>;
|
|
54
59
|
}
|
|
55
60
|
//# sourceMappingURL=Client.d.ts.map
|
package/lib/api/Client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/api/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../src/api/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,OAAO,CAAC,GAAG,CAAM;IAEjB;;;;;;OAMG;gBACS,MAAM,EAAE,MAAM;IAI1B,IAAI,MAAM,WAET;IAED;;;;;;OAMG;IACG,OAAO,CACX,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,SAAc,EACtB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,SAAS,CAAC;IAQrB;;;;OAIG;IACG,MAAM;IAKZ;;;;;;OAMG;IACG,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAI3C;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;IAIzC;;;OAGG;IACG,kBAAkB,CACtB,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,iBAAiB,CAAC;IAI7B;;;;OAIG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAG/C"}
|
package/lib/api/Client.js
CHANGED
|
@@ -17,6 +17,8 @@ const Api_1 = __importDefault(require("./Api"));
|
|
|
17
17
|
const Transaction_1 = require("./Transaction");
|
|
18
18
|
/**
|
|
19
19
|
* Class used to communicate with a CubicWeb instance's API.
|
|
20
|
+
*
|
|
21
|
+
* @category Api
|
|
20
22
|
*/
|
|
21
23
|
class Client {
|
|
22
24
|
/**
|
|
@@ -26,15 +28,8 @@ class Client {
|
|
|
26
28
|
* Example: if you can retrieve the schema with https://example.com/api/v1/schema,
|
|
27
29
|
* use https://example.com/api as `apiUrl`.
|
|
28
30
|
*/
|
|
29
|
-
constructor(apiUrl
|
|
31
|
+
constructor(apiUrl) {
|
|
30
32
|
this.api = new Api_1.default(apiUrl);
|
|
31
|
-
const { transactionBackend } = options;
|
|
32
|
-
if (transactionBackend === undefined) {
|
|
33
|
-
this.transactionBackend = new Transaction_1.NativeTransactionBackend(this.api);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.transactionBackend = transactionBackend;
|
|
37
|
-
}
|
|
38
33
|
}
|
|
39
34
|
get apiUrl() {
|
|
40
35
|
return this.api.apiUrl;
|
|
@@ -46,9 +41,13 @@ class Client {
|
|
|
46
41
|
* @param params The additional parameters for the request
|
|
47
42
|
* @returns A promise with the request's result set
|
|
48
43
|
*/
|
|
49
|
-
execute(query, params = {}) {
|
|
44
|
+
execute(query, params = {}, binaries) {
|
|
50
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
|
|
46
|
+
const transaction = new Transaction_1.Transaction();
|
|
47
|
+
const transactionQuery = transaction.push(query, params);
|
|
48
|
+
transaction.setBinaries(binaries);
|
|
49
|
+
const result = yield this.executeTransaction(transaction);
|
|
50
|
+
return result.resolveQuery(transactionQuery.ref());
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
53
|
/**
|
|
@@ -90,7 +89,17 @@ class Client {
|
|
|
90
89
|
*/
|
|
91
90
|
executeTransaction(transaction) {
|
|
92
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
return yield this.
|
|
92
|
+
return yield this.api.rql(transaction);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get the binary for the given entity attribute
|
|
97
|
+
*
|
|
98
|
+
* @returns A promise resolving to the binary
|
|
99
|
+
*/
|
|
100
|
+
getBinary(eid, attribute) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
return yield this.api.binary(eid, attribute);
|
|
94
103
|
});
|
|
95
104
|
}
|
|
96
105
|
}
|
package/lib/api/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../src/api/Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,gDAA+D;AAC/D,+
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../src/api/Client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qDAAkD;AAClD,gDAA+D;AAC/D,+CAA8E;AAE9E;;;;GAIG;AACH,MAAqB,MAAM;IAGzB;;;;;;OAMG;IACH,YAAY,MAAc;QACxB,IA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AAG,EAAE,SAAS,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF;AArFD,yBAqFC"}
|
package/lib/api/Transaction.d.ts
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ResultSet, RQLParamValue } from "./Api";
|
|
2
|
+
export type BinariesParam = Record<string, Blob>;
|
|
2
3
|
export declare class Transaction {
|
|
3
4
|
private _queries;
|
|
4
|
-
|
|
5
|
+
private _binaries;
|
|
6
|
+
push(query: string, params: Record<string, RQLParamValue | TransactionQueryScalarRef>): TransactionQuery;
|
|
7
|
+
setBinaries(binaries?: BinariesParam): void;
|
|
8
|
+
get binaries(): BinariesParam;
|
|
5
9
|
get queries(): ReadonlyArray<TransactionQuery>;
|
|
6
10
|
}
|
|
11
|
+
export declare class TransactionQuery {
|
|
12
|
+
readonly query: string;
|
|
13
|
+
readonly params: Record<string, RQLParamValue | TransactionQueryScalarRef>;
|
|
14
|
+
readonly index: number;
|
|
15
|
+
constructor(query: string, params: Record<string, RQLParamValue | TransactionQueryScalarRef>, index: number);
|
|
16
|
+
ref(): TransactionQueryRef;
|
|
17
|
+
}
|
|
7
18
|
export declare class TransactionResult {
|
|
8
19
|
private resultSets;
|
|
9
20
|
constructor(resultSets: ReadonlyArray<ResultSet>);
|
|
10
|
-
|
|
21
|
+
resolveQuery(ref: TransactionQueryRef): ResultSet;
|
|
22
|
+
resolveRow(ref: TransactionQueryRowRef): import("./Api").RqlRow;
|
|
23
|
+
resolveScalar(ref: TransactionQueryScalarRef): string | number | boolean | null;
|
|
11
24
|
}
|
|
12
|
-
export
|
|
13
|
-
queryIndex: number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
export declare class TransactionQuery {
|
|
18
|
-
readonly query: string;
|
|
19
|
-
readonly params: Record<string, RQLParamValue | TransactionQueryRef>;
|
|
20
|
-
readonly index: number;
|
|
21
|
-
constructor(query: string, params: Record<string, RQLParamValue | TransactionQueryRef>, index: number);
|
|
22
|
-
ref(row?: number, column?: number): TransactionQueryRef;
|
|
25
|
+
export declare class TransactionQueryRef {
|
|
26
|
+
readonly queryIndex: number;
|
|
27
|
+
constructor(queryIndex: number);
|
|
28
|
+
row(r: number): TransactionQueryRowRef;
|
|
23
29
|
}
|
|
24
|
-
export declare
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
export declare class TransactionQueryRowRef {
|
|
31
|
+
readonly queryIndex: number;
|
|
32
|
+
readonly row: number;
|
|
33
|
+
constructor(queryIndex: number, row: number);
|
|
34
|
+
column(c: number): TransactionQueryScalarRef;
|
|
27
35
|
}
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
export interface TransactionQueryScalarRef {
|
|
37
|
+
readonly queryIndex: number;
|
|
38
|
+
readonly row: number;
|
|
39
|
+
readonly column: number;
|
|
32
40
|
}
|
|
41
|
+
export declare function isTransactionQueryScalarRef(value: RQLParamValue | TransactionQueryScalarRef): value is TransactionQueryScalarRef;
|
|
33
42
|
//# sourceMappingURL=Transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../src/api/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../../src/api/Transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEjD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAEjD,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,SAAS,CAAqB;IAEtC,IAAI,CACF,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,yBAAyB,CAAC,GAChE,gBAAgB;IAUnB,WAAW,CAAC,QAAQ,CAAC,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