Skip to content

features, refactoring and fixes for 1.0.0 #97

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

Merged
merged 98 commits into from
Apr 10, 2023
Merged

features, refactoring and fixes for 1.0.0 #97

merged 98 commits into from
Apr 10, 2023

Conversation

johguentner
Copy link
Member

  • unions types for filters and sorts
  • phpunit --> pest
  • drop support for PHP 7.4

mechelon and others added 29 commits September 8, 2022 17:23
Added the Pest dependency for future tests
…ata" array that contains "status"

if exists, the status is passed as the code for the NotionException. Otherwise, 0
…sure that http status codes are being passed
…query

Allow single sorting property in sortBy method of database endpoint
@johguentner johguentner added this to the 🌳 v1.0.0 milestone Jan 26, 2023
mechelon and others added 20 commits February 6, 2023 10:23
- to ``::fromText(...)``
- within ``EndpointCommentsTest``
- move filling of trait related attributes to the context of `fillEssentials()`
- to avoid missunderstanding
- add phpdocs for `create()`
refactor timestampable traits of entities into trait
add missing database attributes and introduce traits for general attributes
@ijpatricio
Copy link

Hey @johguentner
I'm playing with Notion API and Laravel 10, so this dev branch would be the one to go.
Is it usable "at my own risk", or is it a target of further developments?

@mechelon
Copy link
Member

mechelon commented Apr 8, 2023

Hey @ijpatricio

We plan to release the 1.0 version with Laravel 10 support in the next 1-3 days but until now the dev branch is good to go ☺️ we don't plan any further development on this except for maybe some minor adjustments.
Please be aware that the upcoming version has some breaking changes and the docs are not up to date yet.

@ijpatricio
Copy link

Excellent! Thank you, @mechelon

PS: Your talk on explaining Inertia on LaraconEU was brilliant 👏

@richardhj
Copy link
Contributor

Can you update the Notion-Version header to the latest "2022-06-28" when doing this release?
You are currently using version "2021-05-13," which is behind - for example, you cannot fetch "Phone" properties.

@johguentner
Copy link
Member Author

Can you update the Notion-Version header to the latest "2022-06-28" when doing this release? You are currently using version "2021-05-13," which is behind - for example, you cannot fetch "Phone" properties.

Hi @richardhj,
thanks for your question. This is not so easily possible, because there are other breaking changes introduced by Notion since then (for example https://developers.notion.com/page/changelog#may-19-2021). We want to solve those asap after releasing 1.0.0.
We have prepared a new testing-strategy within the branch record-and-fake-tests to allow better refactoring of those breaking changes.

btw: The PhoneNumber property should be supported without an issue. Do you have an example, which does not work?

@mechelon mechelon added the WTD Triggering whatthediff.ai label Apr 10, 2023
@what-the-diff
Copy link

what-the-diff bot commented Apr 10, 2023

PR Summary

  • Removed PHP 7.4 support
  • Switched to pestphp for testing
    Replaced phpunit with pestphp for more efficient testing
  • Updated README and CONTRIBUTING files
    Included updated information about the package and added a link to the Patreon page
  • Added Comments endpoint
  • Improved method return values
    Changed some methods to return $this instead of void for better usability
  • Fixed bug in Database::query()
    Resolved an issue with start_cursor not being converted to string before sending it to Notion API
  • Enhanced entities with new traits
    • Added HasTimestamps trait to Comment, Database, and Page
    • Added HasArchive trait to entities with archived attributes
    • Added HasParent trait to entities with parent attributes (e.g., Block)
  • Added FilterBag class
    Introduced FilterBag class for nested filters in queries
  • Refactored Entity class structure
    Moved essential attributes (id, objectType) into a new parent class "Entity"
  • Removed unused code from Date property
  • Updated tests and added new tests
    • Added exception code, SortingTest, and CommentTest
    • Updated PagePropertyTest with assertions for asText() method
    • Fixed an issue with archived value in response_specific_block_200
  • Updated Database and Page entities
    Added missing properties and corresponding assertions in their tests
  • Fixed typos and code issues
    Including typo on user model (object_type) and removed an unused import statement in NotionApiTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WTD Triggering whatthediff.ai
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants