Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public exportData(overrideSettings: Settings, data: IETCopyData): Promise {
if (!Util.doesLogOutputsEachStep()) {
UX.create()
.then((ux) => {
ux.startSpinner("ETCopyData:Export");
})
.catch((err) => { Util.throwError(err); });
}
return new Promise((resolve, reject) => {
this.initializeETCopy(overrideSettings, data)
.then((value: IETCopyData) => {
data = value;
})
.then(() => {
// Export data
const promises = [];
promises.push(Exporter.all(data.orgs.get(WhichOrg.SOURCE), ""));
// promises.push(Exporter.exportMetadata(data.orgs.get(WhichOrg.DESTINATION), ""));
public deleteData(overrideSettings: Settings, data: IETCopyData): Promise {
if (!Util.doesLogOutputsEachStep()) {
UX.create()
.then((ux) => {
ux.startSpinner("ETCopyData:Delete");
})
.catch((err) => { Util.throwError(err); });
}
return new Promise((resolve, reject) => {
this.initializeETCopy(overrideSettings, data)
.then((value: IETCopyData) => {
data = value;
})
.then(() => {
// Delete data
const importer: Importer = new Importer();
const orgDestination: OrgManager = data.orgs.get(WhichOrg.DESTINATION);
return importer.deleteAll(orgDestination);
})
public importData(overrideSettings: Settings, data: IETCopyData): Promise {
if (!Util.doesLogOutputsEachStep()) {
UX.create()
.then((ux) => {
ux.startSpinner("ETCopyData:Import");
})
.catch((err) => { Util.throwError(err); });
}
return new Promise((resolve, reject) => {
this.initializeETCopy(overrideSettings, data)
.then((value: IETCopyData) => {
data = value;
})
.then(() => {
// Import data
const importer: Importer = new Importer();
const orgSource: OrgManager = data.orgs.get(WhichOrg.SOURCE);
const orgDestination: OrgManager = data.orgs.get(WhichOrg.DESTINATION);
return importer.importAll(orgSource, orgDestination);
display: (() => {
// LEARNING: [ARRAY]: Shadow clone of the array.
const data = this.entries.slice(0);
// LEARNING: Getting ux in a static method
UX.create()
.then((ux) => {
ux.table(data, {
columns: [
{ key: "timestamp", label: "Timestamp" },
{ key: "entryNumber", label: "#" },
{ key: "level", label: "Level" },
{ key: "lineNumber", label: "Line Number" },
{ key: "description", label: "Description" },
],
});
});
}),
};
it('should throw the page error on internal errors', async function() {
this.timeout(1000 * 300);
this.slow(1000 * 30);
const defaultScratchOrg = await core.Org.create({});
const ux = await UX.create();
const bf = new Browserforce(defaultScratchOrg, ux.cli);
await bf.login();
process.env.BROWSERFORCE_RETRY_TIMEOUT_MS = '0';
await assert.rejects(async () => {
await bf.openPage(
'_ui/common/config/field/StandardFieldAttributes/d?type=Account&id=INVALID_Name'
);
}, /Insufficient Privileges/);
delete process.env.BROWSERFORCE_RETRY_TIMEOUT_MS;
await bf.logout();
});
it('should not throw any error opening a page', async function() {
public compareSchemas(overrideSettings: Settings, data: IETCopyData): Promise {
if (!Util.doesLogOutputsEachStep()) {
UX.create()
.then((ux) => {
ux.startSpinner("ETCopyData:Compare");
})
.catch((err) => { Util.throwError(err); });
}
return new Promise((resolve, reject) => {
this.initializeETCopy(overrideSettings, data)
.then((value: IETCopyData) => {
data = value;
})
.then(() => {
resolve();
})
.catch((err) => { reject(err); });
});
}