diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d124b8..5bc1147 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,13 +18,9 @@ jobs: command: yarn - run: name: Testing - command: yarn test + command: yarn testcov - codecov/upload: file: coverage/lcov.info - node-8: - <<: *test - docker: - - image: node:8 node-10: <<: *test docker: @@ -48,7 +44,6 @@ workflows: "osiecki-sfdx-plugins": jobs: - node-latest - - node-8 - node-10 - cache: filters: diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..00ad71f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules\\typescript\\lib" +} \ No newline at end of file diff --git a/README.md b/README.md index a67c26f..6ae309f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ A plugin for the Salesforce CLI built by Adam Osiecki [![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/osieckiAdam/osiecki-sfdx-plugins?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/osiecki-sfdx-plugins/branch/master) [![Codecov](https://codecov.io/gh/osieckiAdam/osiecki-sfdx-plugins/branch/master/graph/badge.svg)](https://codecov.io/gh/osieckiAdam/osiecki-sfdx-plugins) [![Downloads/week](https://img.shields.io/npm/dw/osiecki-sfdx-plugins.svg)](https://npmjs.org/package/osiecki-sfdx-plugins) -[![License](https://img.shields.io/npm/l/osiecki-sfdx-plugins.svg)](https://github.com/osieckiAdam/osiecki-sfdx-plugins/blob/master/package.json) [![Greenkeeper badge](https://badges.greenkeeper.io/osieckiAdam/osiecki-sfdx-plugins.svg)](https://greenkeeper.io/) +[![License](https://img.shields.io/npm/l/osiecki-sfdx-plugins.svg)](https://github.com/osieckiAdam/osiecki-sfdx-plugins/blob/master/package.json) +[![Greenkeeper badge](https://badges.greenkeeper.io/osieckiAdam/osiecki-sfdx-plugins.svg)](https://greenkeeper.io/) [![Known Vulnerabilities](https://snyk.io/test/github/osieckiAdam/osiecki-sfdx-plugins/badge.svg)](https://snyk.io/test/github/osieckiAdam/osiecki-sfdx-plugins) ## Setup @@ -57,8 +58,8 @@ sfdx plugins:link ## Commands - -- [`sfdx oa:apex:log:delete [-c] [-a] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-oaapexlogdelete--c--a--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +* [`sfdx oa:apex:log:delete [-c] [-a] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-oaapexlogdelete--c--a--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) +* [`sfdx oa:data:soql:sel -f [-w ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-oadatasoqlsel--f-string--w-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal) ## `sfdx oa:apex:log:delete [-c] [-a] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` @@ -66,7 +67,7 @@ delete ApexLog entries from Your org ``` USAGE - $ sfdx oa:apex:log:delete [-c] [-a] [-u ] [--apiversion ] [--json] [--loglevel + $ sfdx oa:apex:log:delete [-c] [-a] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] OPTIONS @@ -118,6 +119,54 @@ EXAMPLES } ``` -_See code: [lib\commands\oa\apex\log\delete.js](https://github.com/osieckiAdam/osiecki-sfdx-plugins/blob/v0.1.3/lib\commands\oa\apex\log\delete.js)_ +_See code: [lib\commands\oa\apex\log\delete.js](https://github.com/osieckiAdam/osiecki-sfdx-plugins/blob/v0.2.0/lib\commands\oa\apex\log\delete.js)_ + +## `sfdx oa:data:soql:sel -f [-w ] [-u ] [--apiversion ] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]` + +generate query for all fields from SObject (SEL * FROM SObject) + +``` +USAGE + $ sfdx oa:data:soql:sel -f [-w ] [-u ] [--apiversion ] [--json] [--loglevel + trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] + +OPTIONS + -f, --from=from (required) SObject to generate query + for + + -u, --targetusername=targetusername username or alias for the target + org; overrides default target org + + -w, --where=where Add WHERE clause to Your query + + --apiversion=apiversion override the api version used for + api requests made by this command + + --json format output as json + + --loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for + this command invocation + +EXAMPLES + sfdx oa:data:soql:sel -f ApexLog + Your query was succesfully copied to clipboard: + SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, DurationMilliseconds, + SystemModstamp, StartTime, Location FROM ApexLog + + sfdx oa:data:soql:sel -f ApexLog --json + { + "status": 0, + "result": { + "query": "SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, + DurationMilliseconds, SystemModstamp, StartTime, Location FROM ApexLog" + } + } + + sfdx oa:data:soql:sel -f ApexLog -w "LogLength > 100" + Your query was succesfully copied to clipboard: + SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, DurationMilliseconds, + SystemModstamp, StartTime, Location FROM ApexLog WHERE Where LogLength > 100 +``` +_See code: [lib\commands\oa\data\soql\sel.js](https://github.com/osieckiAdam/osiecki-sfdx-plugins/blob/v0.2.0/lib\commands\oa\data\soql\sel.js)_ diff --git a/messages/queryall.json b/messages/queryall.json deleted file mode 100644 index 48819bc..0000000 --- a/messages/queryall.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "commandDescription": "query all fields from SObject, [SEL*]", - "copyToClipboardOnlyFlagDescription": "copy the generated query string to clipboard, does not execute the query" -} diff --git a/messages/sel.json b/messages/sel.json new file mode 100644 index 0000000..993dbb8 --- /dev/null +++ b/messages/sel.json @@ -0,0 +1,5 @@ +{ + "commandDescription": "generate query for all fields from SObject (SEL * FROM SObject)", + "fromFlagDescription": "SObject to generate query for", + "whereFlagDescription": "Add WHERE clause to Your query" +} diff --git a/package.json b/package.json index 3824d96..6037e2b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "osiecki-sfdx-plugins", "description": "SFDX plugins by Adam Osiecki", - "version": "0.1.3", + "version": "0.2.0", "author": "Adam Osiecki @osieckiAdam", "bugs": "https://github.com/osieckiAdam/osiecki-sfdx-plugins/issues", "dependencies": { @@ -10,7 +10,10 @@ "@oclif/errors": "^1", "@salesforce/command": "^2", "@salesforce/core": "^2", + "@types/copy-paste": "^1.1.30", "@types/jsforce": "^1.9.12", + "clipboardy": "^2.1.0", + "copy-paste": "^1.3.0", "tslib": "^1" }, "devDependencies": { @@ -61,7 +64,8 @@ "postpack": "rimraf oclif.manifest.json", "posttest": "tslint -p test -t stylish", "prepack": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme", - "test": "nyc --reporter=lcovonly --extension .ts mocha --forbid-only \"test/**/*.test.ts\"", + "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"", + "testcov": "nyc --reporter=lcovonly --extension .ts mocha --forbid-only \"test/**/*.test.ts\"", "version": "oclif-dev readme && git add README.md" } } diff --git a/src/commands/oa/apex/log/delete.ts b/src/commands/oa/apex/log/delete.ts index c20da47..e6cab4e 100644 --- a/src/commands/oa/apex/log/delete.ts +++ b/src/commands/oa/apex/log/delete.ts @@ -68,9 +68,6 @@ sfdx oa:apex:log:delete --json' .sobject('ApexLog') .find({}, ['Id']) .execute({ autoFetch: true, maxFetch: 10000 }, async (err, records) => { - if (err) { - return console.error(err); - } return records; }); return response; diff --git a/src/commands/oa/data/soql/sel.ts b/src/commands/oa/data/soql/sel.ts new file mode 100644 index 0000000..79dc28c --- /dev/null +++ b/src/commands/oa/data/soql/sel.ts @@ -0,0 +1,54 @@ +import { core, flags, SfdxCommand } from '@salesforce/command'; +import { AnyJson } from '@salesforce/ts-types'; +import ncp = require('copy-paste'); + +core.Messages.importMessagesDirectory(__dirname); +const messages = core.Messages.loadMessages('osiecki-sfdx-plugins', 'sel'); + +export default class Sel extends SfdxCommand { + + public static description = messages.getMessage('commandDescription'); + public static examples = [ + `sfdx oa:data:soql:sel -f ApexLog + Your query was succesfully copied to clipboard: + SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, DurationMilliseconds, + SystemModstamp, StartTime, Location FROM ApexLog + `, + `sfdx oa:data:soql:sel -f ApexLog --json + { + "status": 0, + "result": { + "query": "SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, + DurationMilliseconds, SystemModstamp, StartTime, Location FROM ApexLog" + } + } + `, + `sfdx oa:data:soql:sel -f ApexLog -w "LogLength > 100" + Your query was succesfully copied to clipboard: + SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, DurationMilliseconds, + SystemModstamp, StartTime, Location FROM ApexLog WHERE Where LogLength > 100 + ` + ]; + + protected static requiresUsername = true; + protected static flagsConfig = { + from: flags.string({ char: 'f', required: true, description: messages.getMessage('fromFlagDescription') }), + where: flags.string({ char: 'w', description: messages.getMessage('whereFlagDescription') }) + }; + + public async run(): Promise { + let query: string = ''; + const conn = this.org.getConnection(); + await conn.sobject(this.flags.from).find().where(this.flags.where) + .toSOQL((err, res) => { + if (err) { + this.ux.log(err.message); + } else { + query += res; + ncp.copy(query); + this.ux.log('Your query was succesfully copied to clipbzoard:\n' + query); + } + }); + return { query }; + } +} diff --git a/test/commands/apex/log/delete.test.ts b/test/commands/apex/log/delete.test.ts index 1b625f0..64b1e03 100644 --- a/test/commands/apex/log/delete.test.ts +++ b/test/commands/apex/log/delete.test.ts @@ -1,25 +1,21 @@ import { $$, expect, test } from '@salesforce/command/lib/test'; +import { ensureJsonMap, ensureString } from '@salesforce/ts-types'; import { EventEmitter } from 'events'; import * as deleteClass from '../../../../src/commands/oa/apex/log/delete'; class BatchMock extends EventEmitter { public poll() { } } const mockSubscripton = new BatchMock(); +const requestTimeout = 700; describe('apex:log:delete, 2 records queried', () => { beforeEach(() => { - $$.SANDBOX.stub(deleteClass.default.prototype, 'getAllApexLogs').callsFake(async () => { - return ([ - { Id: '07L1w000007NcJtEAK' }, { Id: '07L1w000007NcJoEAK' } - ]); - }); - // @ts-ignore $$.SANDBOX.stub(deleteClass.default.prototype, 'createBatch').callsFake(() => { return mockSubscripton; }); setTimeout(() => { mockSubscripton.emit('queue', { jobId: '1231233' }); - }, 600); + }, requestTimeout); }); @@ -34,14 +30,21 @@ describe('apex:log:delete, 2 records queried', () => { beforeEach(() => { setTimeout(() => { mockSubscripton.emit('progress', { numberRecordsProcessed: '1' }); - }, 700); + }, requestTimeout + 100); setTimeout(() => { mockSubscripton.emit('response', [{ id: '07L1w000007NcJtEAK', success: true, errors: [] }, { id: '07L1w000007NcJoEAK', success: true, errors: [] }]); - }, 800); + }, requestTimeout + 200); }); test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ Id: '07L1w000007OMcYEAW' }, { Id: '07L1w000007OMchEAG' }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com']) .it('runs oa:apex:log:delete -u test@org.com', ctx => { @@ -55,6 +58,13 @@ describe('apex:log:delete, 2 records queried', () => { test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ Id: '07L1w000007OMcYEAW' }, { Id: '07L1w000007OMchEAG' }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '--json']) .it('runs oa:apex:log:delete -u test@org.com --json', ctx => { @@ -64,6 +74,13 @@ describe('apex:log:delete, 2 records queried', () => { test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ Id: '07L1w000007OMcYEAW' }, { Id: '07L1w000007OMchEAG' }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '-a']) .it('runs oa:apex:log:delete -u test@org.com -a', ctx => { @@ -74,6 +91,13 @@ describe('apex:log:delete, 2 records queried', () => { test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ Id: '07L1w000007OMcYEAW' }, { Id: '07L1w000007OMchEAG' }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '-a', '--json']) .it('runs oa:apex:log:delete -u test@org.com -a --json', ctx => { @@ -88,11 +112,18 @@ describe('apex:log:delete, 2 records queried', () => { setTimeout(() => { mockSubscripton.emit('response', [{ id: '07L1w000007NcJtEAK', success: true, errors: [] }, { id: '07L1w000007NcJoEAK', success: false, errors: ['test error'] }]); - }, 600); + }, requestTimeout); }); test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ Id: '07L1w000007OMcYEAW' }, { Id: '07L1w000007OMchEAG' }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com']) .it('runs oa:apex:log:delete -u test@org.com', ctx => { @@ -101,6 +132,13 @@ describe('apex:log:delete, 2 records queried', () => { test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ id: '07L1w000007NcJtEAK', success: true, errors: [] }, { id: '07L1w000007NcJoEAK', success: false, errors: ['test error'] }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '--json']) .it('runs oa:apex:log:delete -u test@org.com --json', ctx => { @@ -113,11 +151,18 @@ describe('apex:log:delete, 2 records queried', () => { beforeEach(() => { setTimeout(() => { mockSubscripton.emit('error', ('test error message')); - }, 600); + }, requestTimeout); }); test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ Id: '07L1w000007OMcYEAW' }, { Id: '07L1w000007OMchEAG' }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com']) .it('runs oa:apex:log:delete -u test@org.com', ctx => { @@ -128,16 +173,15 @@ describe('apex:log:delete, 2 records queried', () => { describe('apex:log:delete, check only', () => { - beforeEach(() => { - $$.SANDBOX.stub(deleteClass.default.prototype, 'getAllApexLogs').callsFake(async () => { - return ([ - { Id: '07L1w000007NcJtEAK' }, { Id: '07L1w000007NcJoEAK' } - ]); - }); - }); - test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ id: '07L1w000007NcJtEAK', success: true, errors: [] }, { id: '07L1w000007NcJoEAK', success: false, errors: ['test error'] }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '-c']) .it('runs oa:apex:log:delete -u test@org.com -c', ctx => { @@ -146,6 +190,13 @@ describe('apex:log:delete, check only', () => { test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [{ id: '07L1w000007NcJtEAK', success: true, errors: [] }, { id: '07L1w000007NcJoEAK', success: false, errors: ['test error'] }] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '-c', '--json']) .it('runs oa:apex:log:delete -u test@org.com -c --json', ctx => { @@ -154,14 +205,16 @@ describe('apex:log:delete, check only', () => { }); describe('apex:log:delete, zero logs queried', () => { - beforeEach(() => { - $$.SANDBOX.stub(deleteClass.default.prototype, 'getAllApexLogs').callsFake(async () => { - return Promise.resolve([]); - }); - }); test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com']) .it('runs oa:apex:log:delete -u test@org.com', ctx => { @@ -170,6 +223,13 @@ describe('apex:log:delete, zero logs queried', () => { test .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + const requestMap = ensureJsonMap(request); + if (ensureString(requestMap.url).match('q=SELECT%20Id%20FROM%20ApexLog')) { + return Promise.resolve({ done: true, records: [] }); + } + return Promise.resolve({ records: [] }); + }) .stdout() .command(['oa:apex:log:delete', '-u', 'test@org.com', '--json']) .it('runs oa:apex:log:delete -u test@org.com --json', ctx => { diff --git a/test/commands/data/soql/sel.test.ts b/test/commands/data/soql/sel.test.ts new file mode 100644 index 0000000..e36a88e --- /dev/null +++ b/test/commands/data/soql/sel.test.ts @@ -0,0 +1,57 @@ +import { expect, test } from '@salesforce/command/lib/test'; +import { ensureString } from '@salesforce/ts-types'; + +describe('data:soql:gen', () => { + + test + .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + if (ensureString(request).includes('/describe')) { + return Promise.resolve({ + fields: [{ name: 'Id' }, { name: 'LogUserId' }, { name: 'LogLength' }, { name: 'LastModifiedDate' }, { name: 'Request' }, + { name: 'Operation' }, { name: 'Application' }, { name: 'Status' }, { name: 'DurationMilliseconds' }, { name: 'SystemModstamp' }, + { name: 'StartTime' }, { name: 'Location' }] + }); + } + + }) + .stdout() + .command(['oa:data:soql:sel', '-f', 'ApexLog', '-u', 'test@org.com']) + .it('runs oa:data:soql:sel -f ApexLog -u test@org.com', ctx => { + expect(ctx.stdout).to.contain('SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, DurationMilliseconds, SystemModstamp, StartTime, Location FROM ApexLog'); + }); + + test + .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + if (ensureString(request).includes('/describe')) { + return Promise.resolve({ + fields: [{ name: 'Id' }, { name: 'LogUserId' }, { name: 'LogLength' }, { name: 'LastModifiedDate' }, { name: 'Request' }, + { name: 'Operation' }, { name: 'Application' }, { name: 'Status' }, { name: 'DurationMilliseconds' }, { name: 'SystemModstamp' }, + { name: 'StartTime' }, { name: 'Location' }] + }); + } + + }) + .stdout() + .command(['oa:data:soql:sel', '-f', 'ApexLog', '-u', 'test@org.com', '--json']) + .it('runs oa:data:soql:sel -f ApexLog -u test@org.com', ctx => { + expect(ctx.stdout).to.contain('"query": "SELECT Id, LogUserId, LogLength, LastModifiedDate, Request, Operation, Application, Status, DurationMilliseconds, SystemModstamp, StartTime, Location FROM ApexLog"'); + }); + + test + .withOrg({ username: 'test@org.com' }, true) + .withConnectionRequest(request => { + if (ensureString(request).includes('/describe')) { + return Promise.reject({ + errorCode: 'NOT_FOUND', message: 'The requested resource does not exist' + }); + } + + }) + .stdout() + .command(['oa:data:soql:sel', '-f', 'ApexzLog', '-u', 'test@org.com']) + .it('runs oa:data:soql:sel -f Apexz Log -u test@org.com', ctx => { + expect(ctx.stdout).to.contain('The requested resource does not exist'); + }); +}); diff --git a/yarn.lock b/yarn.lock index 7d9de34..46cfdf8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -521,6 +521,11 @@ append-transform@^2.0.0: dependencies: default-require-extensions "^3.0.0" +arch@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" + integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg== + archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" @@ -780,6 +785,14 @@ cli-ux@^5.2.1: treeify "^1.1.0" tslib "^1.9.3" +clipboardy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-2.1.0.tgz#0123a0c8fac92f256dc56335e0bb8be97a4909a5" + integrity sha512-2pzOUxWcLlXWtn+Jd6js3o12TysNOOVes/aQfg+MT/35vrxWzedHlLwyoJpXjsFKWm95BTNEcMGD9+a7mKzZkQ== + dependencies: + arch "^2.1.1" + execa "^1.0.0" + cliui@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" @@ -1095,6 +1108,19 @@ execa@^0.10.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -1296,6 +1322,13 @@ get-stream@^3.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + get-stream@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9"