-
Notifications
You must be signed in to change notification settings - Fork 1
Point to 2.41 schemas #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Point to 2.41 schemas #323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it seems the upgrade to v41 was pretty painless - only the need for explicit access fields (which is a best practice, anyway). I guess it will be harder for v42, where the prop userCredentials has been removed.
Only, let's take the opportunity to refactor all the d2-api imports and make them pass though types/d2-api.ts (best practice):
$ grep -r '@eyeseetea/d2-api' src/ | grep -v types/d2-api
src/data/repositories/UserD2ApiRepository.ts:import { PatchOperation } from "@eyeseetea/d2-api/api/patch";
src/data/repositories/UserD2ApiRepository.ts:import { ErrorReport } from "@eyeseetea/d2-api/api/common";
src/data/D2ApiTracker.ts:import { TeiGetRequest } from "@eyeseetea/d2-api/api/trackedEntityInstances";
src/data/utils.ts:import { MetadataResponse } from "@eyeseetea/d2-api/api";
src/utils/futures.ts:import { CancelableResponse } from "@eyeseetea/d2-api/repositories/CancelableResponse";
src/domain/usecases/__tests__/SaveUserOrgUnitUseCase.spec.ts:import { MetadataResponse } from "@eyeseetea/d2-api/api";
src/domain/usecases/__tests__/CopyInUserUseCase.spec.ts:import { MetadataResponse } from "@eyeseetea/d2-api/api";
Done! Would be ok to expose in @eyeseetea/d2-api/api/index also "common", "patch" and "trackedEntityInstances" to don't do??: |
tokland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good!
Yes! Ideally, all useful public interface should be exported so we can write |
|
Ask to Codex to review PR:
They are tasks not related to this PR or this task, but as they are, but since they are very small tasks, I have done them in this PR. The first task about hardcoded version of d2-api, Codex has done this code. In my opinion, it is adding incorrect types, and I'm not sure if it makes sense to set the API version from the env variables, since the code is adapted to a specific d2-api version. |
📌 References
📝 Implementation
📹 Screenshots/Screen capture
🔥 Testing
It needs new version of d2-api: EyeSeeTea/d2-api#178
To test it:
Go to that branch of d2-api:
yarn install yarn build cd build yarn linkOn this app:
yarn link "@eyeseetea/d2-api"