Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### BREAKING

**Starting from this version, `miactl` is compatible only with Mia-Platform Console v13.2.1 or higher.**

The breaking change consists of:

- marketplace endpoints use `/api/marketplace` prefix instead of `/api/backend/marketplace`.

## [v0.17.2] - 2025-03-04

### Changed
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ miactl marketplace apply -f ./path/to/myFantasticGoTemplate.json -f ./path/to/my
# Apply all the valid configuration files in the directory myFantasticGoTemplates to the Marketplace
miactl marketplace apply -f myFantasticGoTemplates`

applyEndpointTemplate = "/api/backend/marketplace/tenants/%s/resources"
applyEndpointTemplate = "/api/marketplace/tenants/%s/resources"

imageAssetType = "imageAssetType"
imageKey = "image"
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/apply/upload_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

const (
uploadImageEndpointTemplate = "/api/backend/marketplace/tenants/%s/files"
uploadImageEndpointTemplate = "/api/marketplace/tenants/%s/files"
multipartFieldName = "marketplace_image"

localPathKey = "localPath"
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/marketplace/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import (

const (
// deleteItemEndpointTemplate formatting template for item deletion by objectID backend endpoint; specify tenantID, objectID
deleteItemEndpointTemplate = "/api/backend/marketplace/tenants/%s/resources/%s"
deleteItemEndpointTemplate = "/api/marketplace/tenants/%s/resources/%s"
// deleteItemByTupleEndpointTemplate formatting template for item deletion by the tuple itemID versionID endpoint; specify companyID, itemID, version
deleteItemByTupleEndpointTemplate = "/api/backend/marketplace/tenants/%s/resources/%s/versions/%s"
deleteItemByTupleEndpointTemplate = "/api/marketplace/tenants/%s/resources/%s/versions/%s"

cmdDeleteLongDescription = `Delete a single Marketplace item
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/marketplace/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
)

const (
getItemByObjectIDEndpointTemplate = "/api/backend/marketplace/%s"
getItemByItemIDAndVersionEndpointTemplate = "/api/backend/marketplace/tenants/%s/resources/%s/versions/%s"
getItemByObjectIDEndpointTemplate = "/api/marketplace/%s"
getItemByItemIDAndVersionEndpointTemplate = "/api/marketplace/tenants/%s/resources/%s/versions/%s"

cmdGetLongDescription = `Get a single Marketplace item
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

const (
listMarketplaceEndpoint = "/api/backend/marketplace/"
listMarketplaceEndpoint = "/api/marketplace/"
listCmdLong = `List Marketplace items
This command lists the Marketplace items of a company.
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/marketplace/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestBuildMarketplaceItemsList(t *testing.T) {
func privateAndPublicMarketplaceHandler(t *testing.T) http.HandlerFunc {
t.Helper()
return func(w http.ResponseWriter, r *http.Request) {
if strings.EqualFold(r.URL.Path, "/api/backend/marketplace/") &&
if strings.EqualFold(r.URL.Path, "/api/marketplace/") &&
r.Method == http.MethodGet &&
r.URL.Query().Get("includeTenantId") == "my-company" {
_, err := w.Write([]byte(marketplaceItemsBodyContent(t)))
Expand All @@ -140,7 +140,7 @@ func privateAndPublicMarketplaceHandler(t *testing.T) http.HandlerFunc {
func privateCompanyMarketplaceHandler(t *testing.T) http.HandlerFunc {
t.Helper()
return func(w http.ResponseWriter, r *http.Request) {
if strings.EqualFold(r.URL.Path, "/api/backend/marketplace/") &&
if strings.EqualFold(r.URL.Path, "/api/marketplace/") &&
r.Method == http.MethodGet &&
r.URL.Query().Get("tenantId") == "my-company" {
_, err := w.Write([]byte(marketplacePrivateCompanyBodyContent(t)))
Expand All @@ -155,7 +155,7 @@ func privateCompanyMarketplaceHandler(t *testing.T) http.HandlerFunc {
func wrongPayloadHandler(t *testing.T) http.HandlerFunc {
t.Helper()
return func(w http.ResponseWriter, r *http.Request) {
if strings.EqualFold(r.URL.Path, "/api/backend/marketplace/") &&
if strings.EqualFold(r.URL.Path, "/api/marketplace/") &&
r.Method == http.MethodGet &&
r.URL.Query().Get("tenantId") == "my-company" {
_, err := w.Write([]byte("{}")) // Incorrect payload
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/marketplace/list_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/spf13/cobra"
)

const listItemVersionsEndpointTemplate = "/api/backend/marketplace/tenants/%s/resources/%s/versions"
const listItemVersionsEndpointTemplate = "/api/marketplace/tenants/%s/resources/%s/versions"

var (
ErrGenericServerError = errors.New("server error while fetching item versions")
Expand Down