remult 0.23.0-exp.22 → 0.23.0-exp.24
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/esm/graphql.js +12 -1
- package/esm/server/expressBridge.js +1 -1
- package/esm/src/remult3/remult3.js +1 -0
- package/graphql.js +9 -1
- package/package.json +1 -1
- package/server/expressBridge.js +1 -1
- package/src/remult3/remult3.js +1 -0
package/esm/graphql.js
CHANGED
|
@@ -220,6 +220,14 @@ _Side note: \`Math.ceil(totalCount / limit)\` to determine how many pages there
|
|
|
220
220
|
comment: `
|
|
221
221
|
For **page by page** pagination.
|
|
222
222
|
Select a dedicated page.`,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
key: 'offset',
|
|
226
|
+
value: 'Int',
|
|
227
|
+
comment: `
|
|
228
|
+
For **page by page** pagination.
|
|
229
|
+
Set the offset needed.
|
|
230
|
+
_Side node: if \`page\` arg is set, \`offset\` will be ignored._`,
|
|
223
231
|
},
|
|
224
232
|
{
|
|
225
233
|
key: 'orderBy',
|
|
@@ -757,7 +765,10 @@ function toCamelCase(str) {
|
|
|
757
765
|
.join('');
|
|
758
766
|
}
|
|
759
767
|
function bridgeQueryOptionsToDataApiGet(arg1) {
|
|
760
|
-
|
|
768
|
+
let { limit, page, orderBy, where, offset } = arg1;
|
|
769
|
+
if (!page && offset) {
|
|
770
|
+
page = Math.floor(offset / limit) + 1;
|
|
771
|
+
}
|
|
761
772
|
return (key) => {
|
|
762
773
|
if (limit && key === '_limit') {
|
|
763
774
|
return limit;
|
|
@@ -925,7 +925,7 @@ export class RouteImplementation {
|
|
|
925
925
|
}
|
|
926
926
|
let idPosition = path.lastIndexOf('/');
|
|
927
927
|
if (idPosition >= 0) {
|
|
928
|
-
lowerPath =
|
|
928
|
+
lowerPath = lowerPath.substring(0, idPosition) + '/:id';
|
|
929
929
|
m = this.map.get(lowerPath);
|
|
930
930
|
if (m) {
|
|
931
931
|
let h = m.get(req.method.toLowerCase());
|
package/graphql.js
CHANGED
|
@@ -270,6 +270,11 @@ function remultGraphql(options) {
|
|
|
270
270
|
value: 'Int',
|
|
271
271
|
comment: "\nFor **page by page** pagination.\nSelect a dedicated page.",
|
|
272
272
|
},
|
|
273
|
+
{
|
|
274
|
+
key: 'offset',
|
|
275
|
+
value: 'Int',
|
|
276
|
+
comment: "\nFor **page by page** pagination.\nSet the offset needed.\n_Side node: if `page` arg is set, `offset` will be ignored._",
|
|
277
|
+
},
|
|
273
278
|
{
|
|
274
279
|
key: 'orderBy',
|
|
275
280
|
value: "".concat(key, "OrderBy"),
|
|
@@ -868,7 +873,10 @@ function toCamelCase(str) {
|
|
|
868
873
|
.join('');
|
|
869
874
|
}
|
|
870
875
|
function bridgeQueryOptionsToDataApiGet(arg1) {
|
|
871
|
-
var limit = arg1.limit, page = arg1.page, orderBy = arg1.orderBy, where = arg1.where;
|
|
876
|
+
var limit = arg1.limit, page = arg1.page, orderBy = arg1.orderBy, where = arg1.where, offset = arg1.offset;
|
|
877
|
+
if (!page && offset) {
|
|
878
|
+
page = Math.floor(offset / limit) + 1;
|
|
879
|
+
}
|
|
872
880
|
return function (key) {
|
|
873
881
|
if (limit && key === '_limit') {
|
|
874
882
|
return limit;
|
package/package.json
CHANGED
package/server/expressBridge.js
CHANGED
|
@@ -1340,7 +1340,7 @@ var RouteImplementation = /** @class */ (function () {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
var idPosition = path.lastIndexOf('/');
|
|
1342
1342
|
if (idPosition >= 0) {
|
|
1343
|
-
lowerPath =
|
|
1343
|
+
lowerPath = lowerPath.substring(0, idPosition) + '/:id';
|
|
1344
1344
|
m = this.map.get(lowerPath);
|
|
1345
1345
|
if (m) {
|
|
1346
1346
|
var h = m.get(req.method.toLowerCase());
|
package/src/remult3/remult3.js
CHANGED
|
@@ -30,3 +30,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
//p1 - when the include doesn't find the many to one - it deletes the id!!!
|
|
31
31
|
//y1 - discuss a default date formatter
|
|
32
32
|
//p1 - consider using this in saving etc...
|
|
33
|
+
//p1 - when subscribe is forbidden - the query still runs after the renew process
|