@ronin/compiler 0.11.3-leo-ron-1083-1-experimental-233 → 0.11.3-leo-ron-1083-1-experimental-234

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -5990,9 +5990,9 @@ type NativeRecord = Record<string, unknown> & {
5990
5990
  id: string;
5991
5991
  ronin: {
5992
5992
  locked: boolean;
5993
- createdAt: Date;
5993
+ createdAt: string;
5994
5994
  createdBy: string | null;
5995
- updatedAt: Date;
5995
+ updatedAt: string;
5996
5996
  updatedBy: string | null;
5997
5997
  };
5998
5998
  };
package/dist/index.js CHANGED
@@ -1672,22 +1672,31 @@ var Transaction = class {
1672
1672
  records: this.formatRows(fields, rows, single)
1673
1673
  };
1674
1674
  if (pageSize && output.records.length > 0) {
1675
- if (queryInstructions?.before || queryInstructions?.after) {
1676
- const direction = queryInstructions?.before ? "moreAfter" : "moreBefore";
1677
- const firstRecord = output.records[0];
1675
+ if (output.records.length > pageSize) {
1676
+ if (queryInstructions?.before) {
1677
+ output.records.shift();
1678
+ } else {
1679
+ output.records.pop();
1680
+ }
1681
+ const direction = queryInstructions?.before ? "moreBefore" : "moreAfter";
1682
+ const lastRecord = output.records.at(
1683
+ direction === "moreAfter" ? -1 : 0
1684
+ );
1678
1685
  output[direction] = generatePaginationCursor(
1679
1686
  model,
1680
1687
  queryInstructions.orderedBy,
1681
- firstRecord
1688
+ lastRecord
1682
1689
  );
1683
1690
  }
1684
- if (output.records.length > pageSize) {
1685
- const direction = queryInstructions?.before ? "moreBefore" : "moreAfter";
1686
- const lastRecord = output.records.pop();
1691
+ if (queryInstructions?.before || queryInstructions?.after) {
1692
+ const direction = queryInstructions?.before ? "moreAfter" : "moreBefore";
1693
+ const firstRecord = output.records.at(
1694
+ direction === "moreAfter" ? -1 : 0
1695
+ );
1687
1696
  output[direction] = generatePaginationCursor(
1688
1697
  model,
1689
1698
  queryInstructions.orderedBy,
1690
- lastRecord
1699
+ firstRecord
1691
1700
  );
1692
1701
  }
1693
1702
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronin/compiler",
3
- "version": "0.11.3-leo-ron-1083-1-experimental-233",
3
+ "version": "0.11.3-leo-ron-1083-1-experimental-234",
4
4
  "type": "module",
5
5
  "description": "Compiles RONIN queries to SQL statements.",
6
6
  "publishConfig": {