Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cozy/cozy-libs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cozy-device-helper@2.2.2
Choose a base ref
...
head repository: cozy/cozy-libs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cozy-device-helper@2.3.0
Choose a head ref

Commits on Aug 4, 2022

  1. fix: Select action icon

    Merkur39 committed Aug 4, 2022
    Copy the full SHA
    033fce7 View commit details
  2. [skip ci] Publish

     - cozy-mespapiers-lib@1.1.15
    Cozy Bot committed Aug 4, 2022
    Copy the full SHA
    651e156 View commit details
  3. Copy the full SHA
    73859b5 View commit details
  4. [skip ci] Publish

     - cozy-mespapiers-lib@1.2.0
    Cozy Bot committed Aug 4, 2022
    Copy the full SHA
    774aede View commit details
  5. Copy the full SHA
    c8e550f View commit details
  6. feat: Do not use the MoreOptions component anymore

    This component is no longer used temporarily,
    it will be used as soon as it offers more options
    than the PapersFab component
    Merkur39 committed Aug 4, 2022
    Copy the full SHA
    e51b29c View commit details
  7. feat: Limit max width of bitmap images

    For bitmap images, block the max width
    This prevents certain image width from being too large
    Merkur39 committed Aug 4, 2022
    Copy the full SHA
    507a52b View commit details
  8. Copy the full SHA
    7d9a296 View commit details
  9. [skip ci] Publish

     - cozy-mespapiers-lib@1.3.0
    Cozy Bot committed Aug 4, 2022
    Copy the full SHA
    374a3a8 View commit details

Commits on Aug 5, 2022

  1. fix: Remove a reconnection step

    When the trigger is in a state which needs reconnection and when the
    user clicks on the "Reconnect" button, he still needed to click on a
    "reconnect" button one more time to display the BI webview.
    
    Now the BI webview is displayed directly.
    
    There are still some screens we don't want to display after the BI
    webview but this will be fixed in another PR
    doubleface authored and probot-auto-merge[bot] committed Aug 5, 2022
    Copy the full SHA
    05d2cb6 View commit details
  2. fix: Remove unused request to BI connection

    This also removes a getTemporaryToken request which can save a lot of
    time visible by the user.
    
    We only used the id of the connection which we already have.
    doubleface authored and probot-auto-merge[bot] committed Aug 5, 2022
    Copy the full SHA
    be09798 View commit details
  3. [skip ci] Publish

     - cozy-harvest-lib@9.24.4
     - cozy-mespapiers-lib@1.3.1
    Cozy Bot committed Aug 5, 2022
    Copy the full SHA
    6143254 View commit details
  4. Copy the full SHA
    59a132f View commit details
  5. feat: Close OAuthWindow only on login success

    doubleface authored and probot-auto-merge[bot] committed Aug 5, 2022
    Copy the full SHA
    a8cf6a3 View commit details
  6. [skip ci] Publish

     - cozy-harvest-lib@9.25.0
     - cozy-mespapiers-lib@1.3.2
    Cozy Bot committed Aug 5, 2022
    Copy the full SHA
    9fe45cf View commit details

Commits on Aug 9, 2022

  1. Copy the full SHA
    88e246b View commit details
  2. Copy the full SHA
    8adf192 View commit details
  3. [skip ci] Publish

     - cozy-mespapiers-lib@1.4.0
    Cozy Bot committed Aug 9, 2022
    Copy the full SHA
    4456d69 View commit details
  4. Copy the full SHA
    ce13857 View commit details
  5. [skip ci] Publish

     - cozy-mespapiers-lib@1.5.0
    Cozy Bot committed Aug 9, 2022
    Copy the full SHA
    b9c2428 View commit details

Commits on Aug 10, 2022

  1. fix: Use correct image size

    The images used are usually 230x128
    Merkur39 committed Aug 10, 2022
    Copy the full SHA
    d290c39 View commit details
  2. [skip ci] Publish

     - cozy-mespapiers-lib@1.5.1
    Cozy Bot committed Aug 10, 2022
    Copy the full SHA
    1445850 View commit details

Commits on Aug 11, 2022

  1. Copy the full SHA
    2897f2c View commit details
  2. Copy the full SHA
    a77d785 View commit details
  3. [skip ci] Publish

     - cozy-mespapiers-lib@1.5.2
    Cozy Bot committed Aug 11, 2022
    Copy the full SHA
    bfc52cc View commit details

Commits on Aug 16, 2022

  1. feat: Add SearchResultLine component

    This component displays one line per file
    with an associated action button
    Merkur39 committed Aug 16, 2022
    Copy the full SHA
    d4c160c View commit details
  2. Copy the full SHA
    fdf384d View commit details
  3. fix: Open file action

    Merkur39 committed Aug 16, 2022
    Copy the full SHA
    2272ac3 View commit details
  4. [skip ci] Publish

     - cozy-mespapiers-lib@1.6.0
    Cozy Bot committed Aug 16, 2022
    Copy the full SHA
    095d6e7 View commit details

Commits on Aug 17, 2022

  1. docs: Update documentation

    Merkur39 committed Aug 17, 2022
    Copy the full SHA
    bbd56e2 View commit details
  2. [skip ci] Publish

     - cozy-mespapiers-lib@1.6.1
    Cozy Bot committed Aug 17, 2022
    Copy the full SHA
    ac49692 View commit details

Commits on Aug 18, 2022

  1. Copy the full SHA
    574e142 View commit details
  2. Copy the full SHA
    69220bf View commit details
  3. Copy the full SHA
    0692e64 View commit details
  4. Copy the full SHA
    53fc761 View commit details
  5. Copy the full SHA
    5580a69 View commit details
  6. feat: Add minLength constraint to InputMask

    It's possible to specify a minimum character length in an InputMask.
    Merkur39 committed Aug 18, 2022
    Copy the full SHA
    de6b122 View commit details
  7. Copy the full SHA
    43b8f09 View commit details
  8. [skip ci] Publish

     - cozy-mespapiers-lib@1.7.0
    Cozy Bot committed Aug 18, 2022
    Copy the full SHA
    8da718a View commit details

Commits on Aug 19, 2022

  1. Copy the full SHA
    75f17ec View commit details
  2. Copy the full SHA
    a0d85b1 View commit details
  3. Copy the full SHA
    51978d3 View commit details
  4. [skip ci] Publish

     - cozy-mespapiers-lib@1.8.0
    Cozy Bot committed Aug 19, 2022
    Copy the full SHA
    2e0b273 View commit details

Commits on Aug 22, 2022

  1. feat: Detect reconnect explicitely

    Before, we detected a reconnect with the presence of a connection id in
    the account. But if we use the creation BI webview to handle
    synchronizations, there will be a connection id in the account and the
    wrong url parameters will be used.
    
    Now we pass a "reconnect" parameter explicitiely
    doubleface authored and doubleface committed Aug 22, 2022
    Copy the full SHA
    b092392 View commit details
  2. feat: Use BI account creation webview to handle accounts synchonization

    The goal is to avoid to display the BI manage webview which allows
    modify, delete or create other BI connections of the user, which we
    cannot handle on cozy side at the moment.
    
    The user will need to enter it's own bank credentials before modifying
    accounts synchronization.
    
    The webview will close on its own.
    doubleface authored and doubleface committed Aug 22, 2022
    Copy the full SHA
    1b5e5ff View commit details
  3. feat: Handle cas with multiple bank ids

    We get the the bank id from the bi connection to not propose the full
    list of banks to the user each time he wants to update his
    synchronizations.
    doubleface authored and doubleface committed Aug 22, 2022
    Copy the full SHA
    9729626 View commit details
  4. [skip ci] Publish

     - cozy-harvest-lib@9.26.0
     - cozy-mespapiers-lib@1.8.1
    Cozy Bot committed Aug 22, 2022
    Copy the full SHA
    c161a91 View commit details
  5. fix: RefreshContracts now updates contracts in realtime

    The update of contracts was still done on the io.cozy.accounts and now
    the source to display the contracts is in io.cozy.bank.accounts.
    
    There were also some cases where the update of contracts was done
    multiple times and causes some 409 conflicts on accounts
    doubleface authored and doubleface committed Aug 22, 2022
    Copy the full SHA
    463e716 View commit details
  6. [skip ci] Publish

     - cozy-harvest-lib@9.26.1
     - cozy-mespapiers-lib@1.8.2
    Cozy Bot committed Aug 22, 2022
    Copy the full SHA
    cd08838 View commit details

Commits on Aug 23, 2022

  1. fix: Rename build job

    Current "test" job is responsible for running build, lint and tests, so
    its name is more about building the project than just testing it
    
    This commit renames it "build" to have a clearer intention
    Ldoppea committed Aug 23, 2022
    Copy the full SHA
    af6829a View commit details
Showing with 2,047 additions and 695 deletions.
  1. +1 −1 .travis.yml
  2. +1 −1 CODEOWNERS
  3. +19 −0 packages/cozy-authentication/CHANGELOG.md
  4. +3 −2 packages/cozy-authentication/package.json
  5. +30 −0 packages/cozy-codemods/CHANGELOG.md
  6. +3 −2 packages/cozy-codemods/package.json
  7. +3 −0 packages/cozy-codemods/src/transforms/__testfixtures__/transform-mui-styles-imports.input.js
  8. +1 −0 packages/cozy-codemods/src/transforms/__testfixtures__/transform-mui-styles-imports.output.js
  9. +2 −0 packages/cozy-codemods/src/transforms/__tests__/transform-mui-styles-imports.spec.js
  10. +25 −0 packages/cozy-codemods/src/transforms/transform-mui-styles-imports.js
  11. +16 −0 packages/cozy-device-helper/CHANGELOG.md
  12. +1 −1 packages/cozy-device-helper/package.json
  13. +12 −0 packages/cozy-device-helper/src/flagship.ts
  14. +23 −0 packages/cozy-doctypes/CHANGELOG.md
  15. +4 −3 packages/cozy-doctypes/package.json
  16. +17 −4 packages/cozy-doctypes/src/Document.js
  17. +107 −0 packages/cozy-harvest-lib/CHANGELOG.md
  18. +1 −1 packages/cozy-harvest-lib/README.md
  19. +6 −6 packages/cozy-harvest-lib/package.json
  20. +7 −0 packages/cozy-harvest-lib/src/components/DisconnectedAccountModal.spec.jsx
  21. +17 −13 ...st-lib/src/components/KonnectorConfiguration/ConfigurationTab/BIContractActivationWindow.spec.jsx
  22. +19 −29 ...harvest-lib/src/components/KonnectorConfiguration/ConfigurationTab/BiContractActivationWindow.jsx
  23. +2 −1 packages/cozy-harvest-lib/src/components/KonnectorConfiguration/ConfigurationTab/Contracts.jsx
  24. +30 −17 packages/cozy-harvest-lib/src/components/OAuthForm.jsx
  25. +14 −3 packages/cozy-harvest-lib/src/components/OAuthForm.spec.js
  26. +1 −3 packages/cozy-harvest-lib/src/components/OAuthWindow.jsx
  27. +13 −5 packages/cozy-harvest-lib/src/components/Routes.jsx
  28. +2 −13 packages/cozy-harvest-lib/src/components/__snapshots__/OAuthForm.spec.js.snap
  29. +5 −1 packages/cozy-harvest-lib/src/helpers/useKonnectorWithTriggers.js
  30. +3 −2 packages/cozy-harvest-lib/src/locales/en.json
  31. +3 −2 packages/cozy-harvest-lib/src/locales/fr.json
  32. +51 −71 packages/cozy-harvest-lib/src/services/biWebView.js
  33. +93 −130 packages/cozy-harvest-lib/src/services/biWebView.spec.js
  34. +8 −0 packages/cozy-intent/CHANGELOG.md
  35. +2 −2 packages/cozy-intent/package.json
  36. +11 −0 packages/cozy-interapp/CHANGELOG.md
  37. +3 −2 packages/cozy-interapp/package.json
  38. +11 −0 packages/cozy-logger/CHANGELOG.md
  39. +3 −2 packages/cozy-logger/package.json
  40. +243 −0 packages/cozy-mespapiers-lib/CHANGELOG.md
  41. +7 −1 packages/cozy-mespapiers-lib/README.md
  42. +6 −2 packages/cozy-mespapiers-lib/docs/papersDefinitions.md
  43. +9 −9 packages/cozy-mespapiers-lib/package.json
  44. BIN packages/cozy-mespapiers-lib/src/assets/images/IlluIdCardExpirationDateHelp.png
  45. +3 −1 packages/cozy-mespapiers-lib/src/components/Actions/Items/open.js
  46. +25 −0 packages/cozy-mespapiers-lib/src/components/Actions/Items/rename.js
  47. +3 −2 packages/cozy-mespapiers-lib/src/components/Actions/Items/select.js
  48. +8 −1 packages/cozy-mespapiers-lib/src/components/CompositeHeader/CompositeHeaderImage.jsx
  49. +71 −0 packages/cozy-mespapiers-lib/src/components/Home/FilterButton.jsx
  50. +44 −36 packages/cozy-mespapiers-lib/src/components/Home/Home.jsx
  51. +6 −5 packages/cozy-mespapiers-lib/src/components/Home/helpers.js
  52. +41 −12 packages/cozy-mespapiers-lib/src/components/Home/helpers.spec.js
  53. +1 −5 packages/cozy-mespapiers-lib/src/components/MesPapiersLib.jsx
  54. +2 −2 packages/cozy-mespapiers-lib/src/components/ModelSteps/Contact.jsx
  55. +3 −2 packages/cozy-mespapiers-lib/src/components/ModelSteps/ContactList.jsx
  56. +12 −2 packages/cozy-mespapiers-lib/src/components/ModelSteps/ContactWrapper.jsx
  57. +4 −0 packages/cozy-mespapiers-lib/src/components/MoreOptions/MoreOptions.jsx
  58. +39 −16 packages/cozy-mespapiers-lib/src/components/Papers/PaperItem.jsx
  59. +30 −0 packages/cozy-mespapiers-lib/src/components/Papers/PaperItem.spec.jsx
  60. +6 −2 packages/cozy-mespapiers-lib/src/components/Papers/PaperLine.jsx
  61. +20 −2 packages/cozy-mespapiers-lib/src/components/Papers/PapersList.jsx
  62. +144 −0 packages/cozy-mespapiers-lib/src/components/Papers/Renaming/RenameInput.jsx
  63. +35 −0 packages/cozy-mespapiers-lib/src/components/Papers/Renaming/helpers.js
  64. +15 −7 packages/cozy-mespapiers-lib/src/components/Papers/helpers.js
  65. +49 −7 packages/cozy-mespapiers-lib/src/components/SearchResult/SearchResult.jsx
  66. +81 −0 packages/cozy-mespapiers-lib/src/components/SearchResult/SearchResultLine.jsx
  67. +1 −0 packages/cozy-mespapiers-lib/src/constants/const.js
  68. +1 −1 packages/cozy-mespapiers-lib/src/constants/papersDefinitions.json
  69. +13 −1 packages/cozy-mespapiers-lib/src/locales/en.json
  70. +13 −1 packages/cozy-mespapiers-lib/src/locales/fr.json
  71. +19 −3 packages/cozy-mespapiers-lib/src/utils/input.js
  72. +6 −6 packages/cozy-mespapiers-lib/src/utils/input.spec.js
  73. +11 −0 packages/cozy-mjml/CHANGELOG.md
  74. +2 −1 packages/cozy-mjml/package.json
  75. +11 −0 packages/cozy-procedures/CHANGELOG.md
  76. +2 −1 packages/cozy-procedures/package.json
  77. +11 −0 packages/cozy-realtime/CHANGELOG.md
  78. +2 −2 packages/cozy-realtime/package.json
  79. +19 −0 packages/cozy-scanner/CHANGELOG.md
  80. +3 −2 packages/cozy-scanner/package.json
  81. +27 −0 packages/cozy-sharing/CHANGELOG.md
  82. +3 −3 packages/cozy-sharing/package.json
  83. +21 −0 packages/eslint-config-cozy-app/CHANGELOG.md
  84. +12 −13 packages/eslint-config-cozy-app/package.json
  85. +27 −0 packages/playgrounds/CHANGELOG.md
  86. +6 −6 packages/playgrounds/package.json
  87. +357 −224 yarn.lock
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ jobs:
include:
- name: 'Repo Doctor'
script: '[ $TRAVIS_EVENT_TYPE = "cron" ] && pushd ./packages/repo-doctor && yarn start:mattermost && popd || true'
- name: 'Tests'
- name: 'Build'
script:
- ./scripts/travis.sh

2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -13,4 +13,4 @@ packages/eslint-config-cozy-app/ @acezard @trollepierre
packages/renovate-config-cozy/ @doubleface @trollepierre
packages/renovate-config-cozy-libs/ @doubleface @trollepierre
packages/cozy-sharing/ @Ldoppea @acezard @trollepierre
packages/cozy-mespapiers-lib/ @Merkur39 @JF-Cozy
packages/cozy-mespapiers-lib/ @Merkur39 @JF-Cozy @PolariTOON
19 changes: 19 additions & 0 deletions packages/cozy-authentication/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.10.6](https://github.com/cozy/cozy-libs/compare/cozy-authentication@2.10.5...cozy-authentication@2.10.6) (2022-09-06)

**Note:** Version bump only for package cozy-authentication





## 2.10.5 (2022-08-29)


### Bug Fixes

* Add prepublish script ([30a26e5](https://github.com/cozy/cozy-libs/commit/30a26e5109dcdfc636c76e6cdd20fdec313359ee))





## 2.10.4 (2022-08-01)

**Note:** Version bump only for package cozy-authentication
5 changes: 3 additions & 2 deletions packages/cozy-authentication/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cozy-authentication",
"version": "2.10.4",
"version": "2.10.6",
"description": "Component providing login to a Cozy",
"main": "dist/index.js",
"files": [
@@ -11,6 +11,7 @@
"scripts": {
"prepare": "yarn build; yarn copy-files",
"build": "env BABEL_ENV=transpilation yarn babel src/ --out-dir dist",
"prepublishOnly": "yarn build",
"watch": "yarn build -w",
"test": "yarn jest src",
"copy-files": "cp -r src/locales/ dist/locales/",
@@ -38,7 +39,7 @@
"react-router": "6.3.0"
},
"dependencies": {
"cozy-device-helper": "^2.2.2",
"cozy-device-helper": "^2.3.0",
"localforage": "1.7.3",
"prop-types": "15.7.2",
"snarkdown": "1.2.2",
30 changes: 30 additions & 0 deletions packages/cozy-codemods/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.18.2](https://github.com/cozy/cozy-libs/compare/@cozy/codemods@1.18.1...@cozy/codemods@1.18.2) (2022-08-31)

**Note:** Version bump only for package @cozy/codemods





## [1.18.1](https://github.com/cozy/cozy-libs/compare/@cozy/codemods@1.18.0...@cozy/codemods@1.18.1) (2022-08-29)


### Bug Fixes

* Add prepublish script ([30a26e5](https://github.com/cozy/cozy-libs/commit/30a26e5109dcdfc636c76e6cdd20fdec313359ee))





# 1.18.0 (2022-08-24)


### Features

* Add codemods for mui styles imports ([4522034](https://github.com/cozy/cozy-libs/commit/4522034de4bf09ec448d62c3d84e2a1571f9005a)), closes [cozy/cozy-ui#2204](https://github.com/cozy/cozy-ui/issues/2204)





## 1.17.1 (2022-08-01)

**Note:** Version bump only for package @cozy/codemods
5 changes: 3 additions & 2 deletions packages/cozy-codemods/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cozy/codemods",
"version": "1.17.1",
"version": "1.18.2",
"description": "Codeshifts used inside Cozies",
"main": "index.js",
"repository": "https://github.com/cozy/cozy-libs",
@@ -12,6 +12,7 @@
"scripts": {
"docs": "jsdoc2md -f 'src/**/*.js' -t .README.md.template > README.md",
"build": "babel src -d dist --verbose",
"prepublishOnly": "yarn build",
"test": "jest",
"cli": "node src/cli.js"
},
@@ -25,7 +26,7 @@
"jscodeshift": "^0.11.0"
},
"devDependencies": {
"eslint-config-cozy-app": "^4.2.1",
"eslint-config-cozy-app": "^5.0.0",
"jest": "26.6.3",
"jsdoc-to-markdown": "5.0.3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import makeStyles from "cozy-ui/transpiled/react/helpers/makeStyles";
import useTheme from "cozy-ui/transpiled/react/helpers/useTheme";
import withStyles from "cozy-ui/transpiled/react/helpers/withStyles";
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import { makeStyles, useTheme, withStyles } from "cozy-ui/transpiled/react/styles";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const defineTest = require('jscodeshift/dist/testUtils').defineTest
defineTest(__dirname, 'transform-mui-styles-imports')
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { imports } from '..'

export default function transformMuiStylesImports(file, api) {
var j = api.jscodeshift
const root = j(file.source)

imports.simplify(root, {
imports: {
makeStyles: {
importPath: 'cozy-ui/transpiled/react/styles',
defaultImport: false
},
useTheme: {
importPath: 'cozy-ui/transpiled/react/styles',
defaultImport: false
},
withStyles: {
importPath: 'cozy-ui/transpiled/react/styles',
defaultImport: false
}
}
})

return root.toSource()
}
16 changes: 16 additions & 0 deletions packages/cozy-device-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 2.3.0 (2022-09-06)


### Bug Fixes

* Use correct image size ([d290c39](https://github.com/cozy/cozy-libs/commit/d290c39a26edfdd7e35fbe3f6822ac7e3dc5f769))


### Features

* Update FlagshipMetadata interface ([d8da519](https://github.com/cozy/cozy-libs/commit/d8da519be2a54602d856ba3eecb4b2a6e18b74e5))





## 2.2.2 (2022-08-01)

**Note:** Version bump only for package cozy-device-helper
2 changes: 1 addition & 1 deletion packages/cozy-device-helper/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cozy-device-helper",
"description": "To know more information about the device platform",
"version": "2.2.2",
"version": "2.3.0",
"author": "Cozy",
"bugs": {
"url": "https://github.com/cozy/cozy-libs/issues"
12 changes: 12 additions & 0 deletions packages/cozy-device-helper/src/flagship.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,19 @@ export enum FlagshipRoutes {
Stack = 'stack'
}

export enum BiometryType {
Face = 'Face',
FaceID = 'FaceID',
Fingerprint = 'Fingerprint',
Iris = 'Iris',
TouchID = 'TouchID'
}

export interface FlagshipMetadata {
capabilities?: {
biometryType?: BiometryType
}
hasBiometry?: boolean
immersive?: boolean
navbarHeight?: number
platform?: Record<string, unknown>
23 changes: 23 additions & 0 deletions packages/cozy-doctypes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,29 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.85.3](https://github.com/cozy/cozy-libs/compare/cozy-doctypes@1.85.2...cozy-doctypes@1.85.3) (2022-08-29)


### Bug Fixes

* Add prepublish script ([30a26e5](https://github.com/cozy/cozy-libs/commit/30a26e5109dcdfc636c76e6cdd20fdec313359ee))





## 1.85.2 (2022-08-29)


### Bug Fixes

* Remove a reconnection step ([05d2cb6](https://github.com/cozy/cozy-libs/commit/05d2cb674d9ce69164cf0a099059520cbf4f1722))
* Use bookmark if present ([ea12d1d](https://github.com/cozy/cozy-libs/commit/ea12d1dbe3437794734a4b3505670a5434201a19))





## [1.85.1](https://github.com/cozy/cozy-libs/compare/cozy-doctypes@1.85.0...cozy-doctypes@1.85.1) (2022-08-01)

**Note:** Version bump only for package cozy-doctypes
7 changes: 4 additions & 3 deletions packages/cozy-doctypes/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "cozy-doctypes",
"version": "1.85.1",
"version": "1.85.3",
"description": "Definitions for Cozy models",
"main": "src/index.js",
"browser": "dist/index.js",
"repository": "git@github.com:cozy/cozy-libs.git",
"author": "Cozy",
"license": "MIT",
"dependencies": {
"cozy-logger": "^1.9.0",
"cozy-logger": "^1.9.1",
"date-fns": "^1.30.1",
"es6-promise-pool": "^2.5.0",
"lodash": "^4.17.19",
@@ -37,7 +37,8 @@
},
"scripts": {
"lint": "cd ../../; yarn eslint --ext js,jsx packages/cozy-doctypes",
"build": "babel src -d dist",
"build": "babel src -d dist --verbose",
"prepublishOnly": "yarn build",
"watch": "yarn build --watch",
"test": "jest src/",
"encrypt-banking-tests": "cd src/banking/; make encrypted.tar.gz.gpg",
21 changes: 17 additions & 4 deletions packages/cozy-doctypes/src/Document.js
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ const sortBy = require('lodash/sortBy')
const get = require('lodash/get')
const { parallelMap } = require('./utils')
const CozyClient = require('cozy-client/dist/CozyClient').default
const Q = require('cozy-client/dist/queries/dsl').Q
const log = require('cozy-logger').namespace('Document')
const querystring = require('querystring')

@@ -579,12 +580,24 @@ class Document {
return this.fetchAll()
}

const result = []
let query
// let's deal with very old cozy-client where Q doesn't exist.
if (Q !== undefined) {
query = Q(this.doctype).where(selector)
} else {
query = this.cozyClient.find(this.doctype).where(selector)
}

let resp = await this.cozyClient.query(query)
let result = resp.data

const query = this.cozyClient.find(this.doctype).where(selector)
let resp = { next: true }
while (resp && resp.next) {
resp = await this.cozyClient.query(query.offset(result.length))
if (resp.bookmark && query.offsetBookmark) {
resp = await this.cozyClient.query(query.offsetBookmark(resp.bookmark))
} else {
resp = await this.cozyClient.query(query.offset(result.length))
}

result.push(...resp.data)
}

Loading