Skip to content
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

feat: add Resource Type to contentful-management [DANTE-1832] #2429

Merged

Conversation

mayakarabula
Copy link
Member

@mayakarabula mayakarabula commented Sep 2, 2024

Summary

Add Resource Type for Native External References

Description

Motivation and Context

Checklist (check all before merging)

  • Both unit and integration tests are passing
  • There are no breaking changes
  • Changes are reflected in the documentation

When adding a new method:

  • The new method is exported through the default and plain CMA client
  • All new public types are exported from ./lib/export-types.ts
  • Added a unit test for the new method
  • Added an integration test for the new method
  • The new method is added to the documentation

@mayakarabula mayakarabula marked this pull request as ready for review September 9, 2024 15:33
@mayakarabula mayakarabula requested a review from a team as a code owner September 9, 2024 15:33
@@ -92,6 +105,44 @@ function createResourceProviderApi(makeRequest: MakeRequest) {
params: getParams(data),
})
},

getResourceType: function getResourceType(id: string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a common pattern in this SDK to expose sub resources both in parent resource methods and standalone? Also, do we need docs for these methods?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a separate ticket for updating the docs after we finish this one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the other question about the standalone vs parent resource in the legacy client, usually in normal cases the parent resource has create and get methods and the standalone resource (child resource) has the update and delete. Let me give you an example to make it clearer: if you want to create a new appDefinition, you do it through the organization resource, so you init the client, getOrganisation, and then through the organisation entity you do the createAppDefition so you end up with the AppDefintion entity that you can update or delete. You cannot add a get on that standalone entity because you can't call that method on the entity itself. however, in the plain client you can do it because basically you call everything related to the standalone entity on the standalone entity.

@mayakarabula mayakarabula merged commit 8fa9399 into master Sep 16, 2024
7 checks passed
@mayakarabula mayakarabula deleted the feat/DANTE-1832-add-resource-type-to-contentful-management branch September 16, 2024 17:05
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 11.34.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

6 participants