[CLD-7567] Deprecate Self Serve: Second Pass (#26853)
* Deprecate Self Serve: First Pass * Fix ci * Fix more ci * Remmove outdated server tests * Fix a missed spot opening purchase modal in Self Hosted * Fix i18n * Clean up some more server code, fix webapp test * Fix alignment of button * Fix linter * Fix i18n server side * Deprecate in product true up * Add back translation * Remove client functions * Put back client functions * webapp deprecation * Deprecate Self Serve: Second Pass * Fix various pipeline issues * Fix linter * Fix pipelines * Fix handlers_test.go * Fix console.error around hostedCustomer in reducer * PICKY LINTER PLEASE * Fix webapp tests, various other fixes for the CI pipelines * Fix i18n * Updates to accomadate enterprise code removal * Fix mocks * More removal * Fix * Adjustments from PR * Fixes for QA Feedback * Update * Add migrations to remove true up review history * Fix migrations check --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: maria.nunez <maria.nunez@mattermost.com>
Этот коммит содержится в:
@@ -340,10 +340,6 @@ func (c *Client4) cloudRoute() string {
|
||||
return "/cloud"
|
||||
}
|
||||
|
||||
func (c *Client4) hostedCustomerRoute() string {
|
||||
return "/hosted_customer"
|
||||
}
|
||||
|
||||
func (c *Client4) testEmailRoute() string {
|
||||
return "/email/test"
|
||||
}
|
||||
@@ -584,10 +580,6 @@ func (c *Client4) permissionsRoute() string {
|
||||
return "/permissions"
|
||||
}
|
||||
|
||||
func (c *Client4) limitsRoute() string {
|
||||
return "/limits"
|
||||
}
|
||||
|
||||
func (c *Client4) bookmarksRoute(channelId string) string {
|
||||
return c.channelRoute(channelId) + "/bookmarks"
|
||||
}
|
||||
@@ -8305,50 +8297,6 @@ func (c *Client4) GetMyIP(ctx context.Context) (*GetIPAddressResponse, *Response
|
||||
return response, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) CreateCustomerPayment(ctx context.Context) (*StripeSetupIntent, *Response, error) {
|
||||
r, err := c.DoAPIPost(ctx, c.cloudRoute()+"/payment", "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var setupIntent *StripeSetupIntent
|
||||
json.NewDecoder(r.Body).Decode(&setupIntent)
|
||||
|
||||
return setupIntent, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) ConfirmCustomerPayment(ctx context.Context, confirmRequest *ConfirmPaymentMethodRequest) (*Response, error) {
|
||||
json, err := json.Marshal(confirmRequest)
|
||||
if err != nil {
|
||||
return nil, NewAppError("ConfirmCustomerPayment", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
r, err := c.DoAPIPostBytes(ctx, c.cloudRoute()+"/payment/confirm", json)
|
||||
if err != nil {
|
||||
return BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) RequestCloudTrial(ctx context.Context, cloudTrialRequest *StartCloudTrialRequest) (*Subscription, *Response, error) {
|
||||
payload, err := json.Marshal(cloudTrialRequest)
|
||||
if err != nil {
|
||||
return nil, nil, NewAppError("RequestCloudTrial", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
r, err := c.DoAPIPutBytes(ctx, c.cloudRoute()+"/request-trial", payload)
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var subscription *Subscription
|
||||
json.NewDecoder(r.Body).Decode(&subscription)
|
||||
|
||||
return subscription, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) ValidateWorkspaceBusinessEmail(ctx context.Context) (*Response, error) {
|
||||
r, err := c.DoAPIPost(ctx, c.cloudRoute()+"/validate-workspace-business-email", "")
|
||||
if err != nil {
|
||||
@@ -8415,19 +8363,6 @@ func (c *Client4) GetCloudCustomer(ctx context.Context) (*CloudCustomer, *Respon
|
||||
return cloudCustomer, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetSubscriptionStatus(ctx context.Context, licenseId string) (*SubscriptionLicenseSelfServeStatusResponse, *Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, fmt.Sprintf("%s%s?licenseID=%s", c.cloudRoute(), "/subscription/self-serve-status", licenseId), "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var status *SubscriptionLicenseSelfServeStatusResponse
|
||||
json.NewDecoder(r.Body).Decode(&status)
|
||||
|
||||
return status, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetSubscription(ctx context.Context) (*Subscription, *Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.cloudRoute()+"/subscription", "")
|
||||
if err != nil {
|
||||
@@ -8488,23 +8423,6 @@ func (c *Client4) UpdateCloudCustomerAddress(ctx context.Context, address *Addre
|
||||
return customer, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) BootstrapSelfHostedSignup(ctx context.Context, req BootstrapSelfHostedSignupRequest) (*BootstrapSelfHostedSignupResponse, *Response, error) {
|
||||
reqBytes, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, nil, NewAppError("BootstrapSelfHostedSignup", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
r, err := c.DoAPIPostBytes(ctx, c.hostedCustomerRoute()+"/bootstrap", reqBytes)
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var res *BootstrapSelfHostedSignupResponse
|
||||
json.NewDecoder(r.Body).Decode(&res)
|
||||
|
||||
return res, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) ListImports(ctx context.Context) ([]string, *Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.importsRoute(), "")
|
||||
if err != nil {
|
||||
@@ -8793,96 +8711,6 @@ func (c *Client4) GetTeamsUsage(ctx context.Context) (*TeamsUsage, *Response, er
|
||||
return usage, BuildResponse(r), err
|
||||
}
|
||||
|
||||
func (c *Client4) SelfHostedSignupAvailable(ctx context.Context) (*Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.hostedCustomerRoute()+"/signup_available", "")
|
||||
|
||||
if err != nil {
|
||||
return BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) SelfHostedSignupCustomer(ctx context.Context, form *SelfHostedCustomerForm) (*Response, *SelfHostedSignupCustomerResponse, error) {
|
||||
payloadBytes, err := json.Marshal(form)
|
||||
if err != nil {
|
||||
return nil, nil, NewAppError("SelfHostedSignupCustomer", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
|
||||
r, err := c.DoAPIPost(ctx, c.hostedCustomerRoute()+"/customer", string(payloadBytes))
|
||||
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
data, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
response := SelfHostedSignupCustomerResponse{}
|
||||
err = json.Unmarshal(data, &response)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
|
||||
return BuildResponse(r), &response, nil
|
||||
}
|
||||
|
||||
func (c *Client4) SelfHostedSignupConfirm(ctx context.Context, form *SelfHostedConfirmPaymentMethodRequest) (*Response, *SelfHostedSignupConfirmClientResponse, error) {
|
||||
payloadBytes, err := json.Marshal(form)
|
||||
if err != nil {
|
||||
return nil, nil, NewAppError("SelfHostedSignupConfirm", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
|
||||
r, err := c.DoAPIPost(ctx, c.hostedCustomerRoute()+"/confirm", string(payloadBytes))
|
||||
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
|
||||
data, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
response := SelfHostedSignupConfirmClientResponse{}
|
||||
err = json.Unmarshal(data, &response)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
|
||||
defer closeBody(r)
|
||||
|
||||
return BuildResponse(r), &response, nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetSelfHostedInvoices(ctx context.Context) (*Response, []*Invoice, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.hostedCustomerRoute()+"/invoices", "")
|
||||
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
|
||||
data, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
invoices := []*Invoice{}
|
||||
err = json.Unmarshal(data, &invoices)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil, err
|
||||
}
|
||||
|
||||
defer closeBody(r)
|
||||
|
||||
return BuildResponse(r), invoices, nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetPostInfo(ctx context.Context, postId string) (*PostInfo, *Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.postRoute(postId)+"/info", "")
|
||||
if err != nil {
|
||||
@@ -8939,36 +8767,6 @@ func (c *Client4) CheckCWSConnection(ctx context.Context, userId string) (*Respo
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) SubmitTrueUpReview(ctx context.Context, req map[string]any) (*Response, error) {
|
||||
reqBytes, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, NewAppError("SubmitTrueUpReview", "api.marshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
r, err := c.DoAPIPostBytes(ctx, c.licenseRoute()+"/review", reqBytes)
|
||||
if err != nil {
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
func (c *Client4) GetServerLimits(ctx context.Context) (*ServerLimits, *Response, error) {
|
||||
r, err := c.DoAPIGet(ctx, c.limitsRoute()+"/users", "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
var serverLimits ServerLimits
|
||||
if r.StatusCode == http.StatusNotModified {
|
||||
return &serverLimits, BuildResponse(r), nil
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&serverLimits); err != nil {
|
||||
return nil, nil, NewAppError("GetServerLimits", "api.unmarshal_error", nil, "", http.StatusInternalServerError).Wrap(err)
|
||||
}
|
||||
return &serverLimits, BuildResponse(r), nil
|
||||
}
|
||||
|
||||
// CreateChannelBookmark creates a channel bookmark based on the provided struct.
|
||||
func (c *Client4) CreateChannelBookmark(ctx context.Context, channelBookmark *ChannelBookmark) (*ChannelBookmark, *Response, error) {
|
||||
channelBookmarkJSON, err := json.Marshal(channelBookmark)
|
||||
|
||||
Ссылка в новой задаче
Block a user