Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into type-indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
d-gubert committed Oct 26, 2020
2 parents 15e735a + 25c3457 commit 2478300
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 43 deletions.
10 changes: 3 additions & 7 deletions app/apps/server/communication/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class AppsRestApi {
const downloadPromise = new Promise((resolve, reject) => {
const token = getWorkspaceAccessToken(true, 'marketplace:download', false);

HTTP.get(`${ baseUrl }/v1/apps/${ this.bodyParams.appId }/download/${ this.bodyParams.version }?token=${ token }`, {
HTTP.get(`${ baseUrl }/v2/apps/${ this.bodyParams.appId }/download/${ this.bodyParams.version }?token=${ token }`, {
headers,
npmRequestOptions: { encoding: null },
}, (error, result) => {
Expand Down Expand Up @@ -228,17 +228,13 @@ export class AppsRestApi {
return API.v1.failure({ error: 'Failed to get a file to install for the App. ' });
}

const aff = Promise.await(manager.add(buff.toString('base64'), true, marketplaceInfo));
const aff = Promise.await(manager.add(buff, true, marketplaceInfo));
const info = aff.getAppInfo();

if (aff.hasStorageError()) {
return API.v1.failure({ status: 'storage_error', messages: [aff.getStorageError()] });
}

if (aff.getCompilerErrors().length) {
return API.v1.failure({ status: 'compiler_error', messages: aff.getCompilerErrors() });
}

if (aff.hasAppUserError()) {
return API.v1.failure({
status: 'app_user_error',
Expand Down Expand Up @@ -433,7 +429,7 @@ export class AppsRestApi {

let result;
try {
result = HTTP.get(`${ baseUrl }/v1/apps/${ this.bodyParams.appId }/download/${ this.bodyParams.version }`, {
result = HTTP.get(`${ baseUrl }/v2/apps/${ this.bodyParams.appId }/download/${ this.bodyParams.version }`, {
headers,
npmRequestOptions: { encoding: null },
});
Expand Down
55 changes: 21 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"@nivo/heatmap": "^0.61.0",
"@nivo/line": "^0.61.1",
"@nivo/pie": "^0.61.1",
"@rocket.chat/apps-engine": "1.19.0-alpha.3941",
"@rocket.chat/apps-engine": "1.19.0-alpha.3984",
"@rocket.chat/css-in-js": "^0.17.0",
"@rocket.chat/fuselage": "^0.17.0",
"@rocket.chat/fuselage-hooks": "^0.17.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/data/apps/apps-data.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const APP_URL = 'https://github.com/RocketChat/Apps.RocketChat.Tester/blob/master/dist/appsrocketchattester_0.0.1.zip?raw=true';
export const APP_URL = 'https://github.com/RocketChat/Apps.RocketChat.Tester/blob/master/dist/appsrocketchattester_0.0.2.zip?raw=true';
export const APP_NAME = 'Apps.RocketChat.Tester';
export const APP_USERNAME = 'appsrocketchattester.bot';
export const apps = (path = '') => `/api/apps${ path }`;

0 comments on commit 2478300

Please sign in to comment.