commercetools-go-sdk
commercetools-go-sdk copied to clipboard
Add custom applicaton support (work in progress)
Example usage::
newClient.CustomApplicationGetWithID(context.TODO(), "ckcmb5qvmzpes0714901hx27v")
draft := &commercetools.CustomApplicationDraft{
Name: "terraform-test",
NavbarMenu: commercetools.CustomApplicationNavbarMenu{
Key: "foobar",
URIPath: "no-idea",
Permissions: []string{"ViewCategories"},
LabelAllLocales: []commercetools.CustomApplicationLabelLocale{
commercetools.CustomApplicationLabelLocale{
Locale: "NL",
Value: "Michael Test",
},
},
Submenu: []commercetools.CustomApplicationNavbarSubmenu{},
},
}
app, err := newClient.CustomApplicationCreate(context.TODO(), draft)
if err != nil {
panic(err)
}
Codecov Report
Merging #52 (c7d2465) into master (1c49bc0) will decrease coverage by
4.65%
. The diff coverage is31.61%
.
@@ Coverage Diff @@
## master #52 +/- ##
==========================================
- Coverage 15.53% 10.88% -4.66%
==========================================
Files 70 69 -1
Lines 15246 15272 +26
==========================================
- Hits 2369 1662 -707
- Misses 12360 13354 +994
+ Partials 517 256 -261
Impacted Files | Coverage Δ | |
---|---|---|
commercetools/client.go | 60.37% <ø> (-5.67%) |
:arrow_down: |
commercetools/service_custom_applications.go | 25.00% <25.00%> (ø) |
|
commercetools/client_graphql.go | 73.13% <62.96%> (+73.13%) |
:arrow_up: |
commercetools/service_message.go | 0.00% <0.00%> (-60.00%) |
:arrow_down: |
commercetools/service_product_projection.go | 11.90% <0.00%> (-33.34%) |
:arrow_down: |
commercetools/service_review.go | 0.00% <0.00%> (-31.47%) |
:arrow_down: |
commercetools/service_payment.go | 0.00% <0.00%> (-31.47%) |
:arrow_down: |
commercetools/service_shopping_list.go | 0.00% <0.00%> (-31.47%) |
:arrow_down: |
commercetools/service_discount_code.go | 0.00% <0.00%> (-30.77%) |
:arrow_down: |
commercetools/service_category.go | 0.00% <0.00%> (-29.89%) |
:arrow_down: |
... and 36 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 089f176...84762d3. Read the comment docs.
@emmenko which permissions do we need to actually create a custom application. Retrieving works fine but when creating a new one I receive the following
{"errors":[{"message":"Missing or invalid authentication token.","locations":[{"line":3,"column":4}],"path":["createProjectExtensionApplication"],"extensions":{"code":"UNAUTHENTICATED"}}],"data":{"createProjectExtensionApplication":null}}
Hi @mvantellingen , thanks for taking over 🙏
To manage custom applications, you need an access token with the scope manage_project_settings
. For retrieving a custom application, you simply need an access token with access to the project (could be any scope).
Let me know if you need any more assist. I'm also happy to review the PR if you need me to. Thanks
FYI: we're planning to change some things about how you manage and register Custom Applications. The current API should stay for backwards compatibility, but there would be a new one.
I'll get in touch once we have it in place.
FYI: we're planning to change some things about how you manage and register Custom Applications. The current API should stay for backwards compatibility, but there would be a new one.
I'll get in touch once we have it in place.
Hi @emmenko,
I would like to take some steps to get the support in the terraform provider (we really need it for a couple of components we are creating). Is the new API already available?
Custom apps can only be configured through the GraphQL instead