Remove app purchase/unpurchase
This commit is contained in:
19
src/apps.js
19
src/apps.js
@@ -1474,8 +1474,6 @@ async function install(data, auditSource) {
|
||||
if (addError && addError.reason === BoxError.ALREADY_EXISTS) throw getDuplicateErrorDetails(addError.message, locations, portBindings);
|
||||
if (addError) throw addError;
|
||||
|
||||
await purchaseApp({ appId, appstoreId: appStoreId, manifestId: manifest.id || 'customapp' });
|
||||
|
||||
const task = {
|
||||
args: { restoreConfig: null, skipDnsSetup, overwriteDns },
|
||||
values: { },
|
||||
@@ -2376,17 +2374,6 @@ async function exportApp(app, data, auditSource) {
|
||||
return { taskId };
|
||||
}
|
||||
|
||||
async function purchaseApp(data) {
|
||||
assert.strictEqual(typeof data, 'object');
|
||||
|
||||
const [purchaseError] = await safe(appstore.purchaseApp(data));
|
||||
if (!purchaseError) return;
|
||||
|
||||
await del(data.appId);
|
||||
|
||||
throw purchaseError;
|
||||
}
|
||||
|
||||
async function clone(app, data, user, auditSource) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof data, 'object');
|
||||
@@ -2458,8 +2445,6 @@ async function clone(app, data, user, auditSource) {
|
||||
if (addError && addError.reason === BoxError.ALREADY_EXISTS) throw getDuplicateErrorDetails(addError.message, locations, portBindings);
|
||||
if (addError) throw addError;
|
||||
|
||||
await purchaseApp({ appId: newAppId, appstoreId: app.appStoreId, manifestId: manifest.id || 'customapp' });
|
||||
|
||||
const restoreConfig = { remotePath: backupInfo.remotePath, backupFormat: backupInfo.format };
|
||||
const task = {
|
||||
args: { restoreConfig, overwriteDns, skipDnsSetup, oldManifest: null },
|
||||
@@ -2535,8 +2520,6 @@ async function unarchive(archive, data, auditSource) {
|
||||
if (addError && addError.reason === BoxError.ALREADY_EXISTS) throw getDuplicateErrorDetails(addError.message, locations, portBindings);
|
||||
if (addError) throw addError;
|
||||
|
||||
await purchaseApp({ appId, appstoreId: appStoreId, manifestId: manifest.id || 'customapp' });
|
||||
|
||||
const task = {
|
||||
args: { restoreConfig, overwriteDns },
|
||||
values: {},
|
||||
@@ -2564,8 +2547,6 @@ async function uninstall(app, auditSource) {
|
||||
const error = checkAppState(app, exports.ISTATE_PENDING_UNINSTALL);
|
||||
if (error) throw error;
|
||||
|
||||
await appstore.unpurchaseApp(appId, { appstoreId: app.appStoreId, manifestId: app.manifest.id || 'customapp' });
|
||||
|
||||
const task = {
|
||||
args: {},
|
||||
values: {},
|
||||
|
||||
Reference in New Issue
Block a user