Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compilation errors #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/errors": "^1",
"@salesforce/command": "^2",
"@salesforce/core": "^2",
"tslib": "^1"
},
"devDependencies": {
"@oclif/dev-cli": "^1",
"@oclif/plugin-help": "^2",
"@oclif/test": "^1",
"@salesforce/dev-config": "1.4.1",
"@salesforce/command": "^2.2.0",
"@salesforce/core": "^2.4.0",
"@salesforce/dev-config": "^1.4.1",
"@salesforce/ts-types": "^1.2.2",
"@types/chai": "^4",
"@types/mocha": "^5",
"@types/node": "^10",
"@types/node": "^10.17.21",
"chai": "^4",
"globby": "^8",
"mocha": "^5",
"nyc": "^14",
"nyc": "^14.1.1",
"ts-node": "^8",
"tslint": "^5"
},
Expand Down
6 changes: 3 additions & 3 deletions src/commands/wry/data/count.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {core, flags, SfdxCommand} from '@salesforce/command';
import fs = require('fs');
import {AnyJson} from '@salesforce/ts-types';

//import { Connection, ConnectionOptions, RequestInfo } from 'jsforce';

Expand Down Expand Up @@ -49,7 +49,7 @@ User: 5 records
protected static requiresProject = false;


public async run(): Promise<core.AnyJson> {
public async run(): Promise<AnyJson> {

//command line args
const objectsToCheckArg = this.flags.objects || '';
Expand Down Expand Up @@ -77,7 +77,7 @@ User: 5 records
objectsToCheck = [];

//https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_describe.htm
const sobjectsResultVar = await conn.request('/sobjects') as sobjectsResult;
const sobjectsResultVar = await conn.request('/sobjects') as unknown as sobjectsResult;

const excludeList : string[] = ['CollaborationGroupRecord', 'FeedItem'];

Expand Down
9 changes: 2 additions & 7 deletions src/commands/wry/file/replace.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {core, flags, SfdxCommand} from '@salesforce/command';
import {AnyJson} from '@salesforce/ts-types';
import fs = require('fs');

// Initialize Messages with the current plugin directory
Expand Down Expand Up @@ -45,7 +46,7 @@ export default class Replace extends SfdxCommand {
protected static requiresProject = false;


public async run(): Promise<core.AnyJson> {
public async run(): Promise<AnyJson> {

//get command line flags
const inputdirArg = this.flags.inputdir;
Expand Down Expand Up @@ -103,12 +104,6 @@ export default class Replace extends SfdxCommand {
if (err) { throw err; }

let objectType = null;
let ignoreResult1 = data.replace(/"records"[\s\S]*?attributes[\s\S]*?"type"[\s\S]*?"(.*)"/gm, function(x,y) {
//newData = data.replace(/"attributes".?{"type".?:.?"(.?)".?"RecordType"\\: {.?{.?}.?"DeveloperName".?"(.?)"}/gm, function(x,y,z) {
//console.log("objectType:\ty='"+y+"'");
objectType = y;
return y;
});
if(null!=objectType) {
console.log(oldFilePath+": sObjectType=\""+objectType+"\"");
}
Expand Down
3 changes: 2 additions & 1 deletion src/commands/wry/hello/org.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {core, flags, SfdxCommand} from '@salesforce/command';
import {AnyJson} from '@salesforce/ts-types';

// Initialize Messages with the current plugin directory
core.Messages.importMessagesDirectory(__dirname);
Expand Down Expand Up @@ -38,7 +39,7 @@ export default class Org extends SfdxCommand {
// Set this to true if your command requires a project workspace; 'requiresProject' is false by default
protected static requiresProject = false;

public async run(): Promise<core.AnyJson> {
public async run(): Promise<AnyJson> {
const name = this.flags.name || 'world';

// this.org is guaranteed because requiresUsername=true, as opposed to supportsUsername
Expand Down
6 changes: 3 additions & 3 deletions src/commands/wry/org/limits.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {core, flags, SfdxCommand} from '@salesforce/command';
import fs = require('fs');
import {AnyJson} from '@salesforce/ts-types';

//import { Connection, ConnectionOptions, RequestInfo } from 'jsforce';

Expand Down Expand Up @@ -47,7 +47,7 @@ SingleEmail: 15 of 15
protected static requiresProject = false;


public async run(): Promise<core.AnyJson> {
public async run(): Promise<AnyJson> {

const limitsToCheckArg = this.flags.limits || '';
let limitsToCheck = limitsToCheckArg.split(',');
Expand All @@ -57,7 +57,7 @@ SingleEmail: 15 of 15
const conn = this.org.getConnection();

//https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm
const limitsResultVar = await conn.request('/limits') as LimitsResult;
const limitsResultVar = await conn.request('/limits') as unknown as LimitsResult;

//you can drill through the variables, like:
//this.ux.log("limits="+limitsResultVar.DailyApiRequests.Max);
Expand Down