@kitalive/sfdx-plugin 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,7 +18,7 @@ $ npm install -g @kitalive/sfdx-plugin
18
18
  $ sfdx COMMAND
19
19
  running command...
20
20
  $ sfdx (-v|--version|version)
21
- @kitalive/sfdx-plugin/0.1.5 darwin-x64 node-v16.12.0
21
+ @kitalive/sfdx-plugin/0.1.6 darwin-x64 node-v14.15.0
22
22
  $ sfdx --help [COMMAND]
23
23
  USAGE
24
24
  $ sfdx COMMAND
@@ -127,7 +127,7 @@ EXAMPLES
127
127
  10
128
128
  ```
129
129
 
130
- _See code: [src/commands/kit/data/bulk/upsert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.5/src/commands/kit/data/bulk/upsert.ts)_
130
+ _See code: [src/commands/kit/data/bulk/upsert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.6/src/commands/kit/data/bulk/upsert.ts)_
131
131
 
132
132
  ## `sfdx kit:data:csv:convert [-f <filepath>] [-o <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
133
133
 
@@ -177,7 +177,7 @@ EXAMPLES
177
177
  $ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :
178
178
  ```
179
179
 
180
- _See code: [src/commands/kit/data/csv/convert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.5/src/commands/kit/data/csv/convert.ts)_
180
+ _See code: [src/commands/kit/data/csv/convert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.6/src/commands/kit/data/csv/convert.ts)_
181
181
 
182
182
  ## `sfdx kit:layout:assignments:deploy -f <string> [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
183
183
 
@@ -212,7 +212,7 @@ EXAMPLES
212
212
  $ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json
213
213
  ```
214
214
 
215
- _See code: [src/commands/kit/layout/assignments/deploy.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.5/src/commands/kit/layout/assignments/deploy.ts)_
215
+ _See code: [src/commands/kit/layout/assignments/deploy.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.6/src/commands/kit/layout/assignments/deploy.ts)_
216
216
 
217
217
  ## `sfdx kit:layout:assignments:retrieve -f <string> [-p <string>] [-o <string>] [--merge] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
218
218
 
@@ -258,7 +258,7 @@ EXAMPLES
258
258
  $ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json
259
259
  ```
260
260
 
261
- _See code: [src/commands/kit/layout/assignments/retrieve.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.5/src/commands/kit/layout/assignments/retrieve.ts)_
261
+ _See code: [src/commands/kit/layout/assignments/retrieve.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.6/src/commands/kit/layout/assignments/retrieve.ts)_
262
262
 
263
263
  ## `sfdx kit:script:execute [-f <filepath>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
264
264
 
@@ -267,6 +267,7 @@ execute Node.js scripts in SfdxCommand context
267
267
  ```
268
268
  execute Node.js scripts in SfdxCommand context
269
269
  Available variables in Node.js scripts
270
+ argv: Parsed command line arguments after the file option
270
271
  conn: jsforce Connection
271
272
  context: SfdxCommand
272
273
 
@@ -291,6 +292,7 @@ OPTIONS
291
292
 
292
293
  DESCRIPTION
293
294
  Available variables in Node.js scripts
295
+ argv: Parsed command line arguments after the file option
294
296
  conn: jsforce Connection
295
297
  context: SfdxCommand
296
298
 
@@ -301,7 +303,9 @@ EXAMPLES
301
303
  $ sfdx kit:script -f ./path/to/script.js
302
304
  $ sfdx kit:script:execute
303
305
  > await conn.query('SELECT Id, Name FROM Account LIMIT 1')
306
+ Top level await is not enabled by default in REPL before Node.js v16
307
+ $ NODE_OPTIONS=--experimental-repl-await sfdx kit:script:execute
304
308
  ```
305
309
 
306
- _See code: [src/commands/kit/script/execute.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.5/src/commands/kit/script/execute.ts)_
310
+ _See code: [src/commands/kit/script/execute.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.1.6/src/commands/kit/script/execute.ts)_
307
311
  <!-- commandsstop -->
@@ -3,13 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const command_1 = require("@salesforce/command");
4
4
  const fs = require("fs-extra");
5
5
  const repl = require("repl");
6
+ const yargs_1 = require("yargs");
6
7
  class ScriptExecuteCommand extends command_1.SfdxCommand {
7
8
  async run() {
8
9
  const { file } = this.flags;
10
+ module.paths.push('./node_modules');
9
11
  if (file) {
12
+ const fileIndex = process.argv.indexOf(file);
13
+ const argv = yargs_1.default([]).parse(process.argv.slice(fileIndex + 1));
10
14
  const script = fs.readFileSync(file).toString('utf8');
11
15
  const asyncFunction = Object.getPrototypeOf(async () => { }).constructor;
12
- new asyncFunction('context', 'conn', script)(this, this.org.getConnection());
16
+ return await new asyncFunction('require', 'argv', 'context', 'conn', script)(require, argv, this, this.org.getConnection());
13
17
  }
14
18
  else {
15
19
  this.ux.log('Starting sfdx REPL mode');
@@ -18,6 +22,7 @@ class ScriptExecuteCommand extends command_1.SfdxCommand {
18
22
  this.ux.log(' context: SfdxCommand');
19
23
  this.ux.log('Type .exit or Press Ctrl+D to exit the REPL');
20
24
  const replServer = repl.start('> ');
25
+ replServer.context.require = require;
21
26
  replServer.context.context = this;
22
27
  replServer.context.conn = this.org.getConnection();
23
28
  return new Promise(resolve => replServer.on('exit', () => resolve()));
@@ -28,13 +33,16 @@ exports.default = ScriptExecuteCommand;
28
33
  ScriptExecuteCommand.description = [
29
34
  'execute Node.js scripts in SfdxCommand context',
30
35
  'Available variables in Node.js scripts',
36
+ ' argv: Parsed command line arguments after the file option',
31
37
  ' conn: jsforce Connection',
32
38
  ' context: SfdxCommand'
33
39
  ].join('\n');
34
40
  ScriptExecuteCommand.examples = [
35
41
  '$ sfdx kit:script -f ./path/to/script.js',
36
42
  '$ sfdx kit:script:execute',
37
- "> await conn.query('SELECT Id, Name FROM Account LIMIT 1')"
43
+ "> await conn.query('SELECT Id, Name FROM Account LIMIT 1')",
44
+ 'Top level await is not enabled by default in REPL before Node.js v16',
45
+ '$ NODE_OPTIONS=--experimental-repl-await sfdx kit:script:execute'
38
46
  ];
39
47
  ScriptExecuteCommand.aliases = ['kit:script'];
40
48
  ScriptExecuteCommand.strict = false;
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../src/commands/kit/script/execute.ts"],"names":[],"mappings":";;AAAA,iDAAyD;AACzD,+BAA+B;AAC/B,6BAA6B;AAE7B,MAAqB,oBAAqB,SAAQ,qBAAW;IAuBpD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAE5B,IAAI,IAAI,EAAE;YACR,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACtD,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YACxE,IAAI,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CA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G,CAAC,6CAA6C,CAAC,CAAC;YAE3D,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACpC,UAAU,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;YACrC,UAAU,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;YAClC,UAAU,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;YAEnD,OAAO,IAAI,OAAO,CAChB,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAClD,CAAC;SACH;IACH,CAAC;;AApDH,uCAqDC;AApDe,gCAAW,GAAG;IAC1B,gDAAgD;IAChD,wCAAwC;IACxC,6DAA6D;IAC7D,4BAA4B;IAC5B,wBAAwB;CACzB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEC,6BAAQ,GAAG;IACvB,0CAA0C;IAC1C,2BAA2B;IAC3B,4DAA4D;IAC5D,sEAAsE;IACtE,kEAAkE;CACnE,CAAC;AAEY,4BAAO,GAAG,CAAC,YAAY,CAAC,CAAC;AACzB,2BAAM,GAAG,KAAK,CAAC;AACZ,qCAAgB,GAAG,IAAI,CAAC;AACxB,oCAAe,GAAG,KAAK,CAAC;AAExB,gCAAW,GAAG;IAC7B,IAAI,EAAE,eAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;CACnG,CAAC"}
@@ -1 +1 @@
1
- {"version":"0.1.5","commands":{"kit:script:execute":{"id":"kit:script:execute","description":"execute Node.js scripts in SfdxCommand context\nAvailable variables in Node.js scripts\n conn: jsforce Connection\n context: SfdxCommand","usage":"<%= command.id %> [-f <filepath>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":["kit:script"],"examples":["$ sfdx kit:script -f ./path/to/script.js","$ sfdx kit:script:execute","> await conn.query('SELECT Id, Name FROM Account LIMIT 1')"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"file":{"name":"file","type":"option","char":"f","description":"the path of the Node.js script file to execute"}},"args":[]},"kit:data:bulk:upsert":{"id":"kit:data:bulk:upsert","description":"bulk upsert records from a CSV file\nUpsert records using Bulk API and returns a job ID and a batch ID. Use these IDs to check job status with data:bulk:status.\nFor information about CSV file formats, see [Prepare CSV Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm) in the Bulk API Developer Guide.","usage":"<%= command.id %> -o <string> -i <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:data:bulk:upsert -o Account -f ./path/to/Account.csv -m ./path/to/mapping.json","$ sfdx kit:data:bulk:upsert -o MyObject__c -f ./path/to/MyObject__c.csv -c ./path/to/convert.js -i MyExternalId__c -w 10"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"object":{"name":"object","type":"option","char":"o","description":"the sObject name to upsert","required":true},"externalid":{"name":"externalid","type":"option","char":"i","description":"the column name of the external ID","required":true,"default":"Id"},"csvfile":{"name":"csvfile","type":"option","char":"f","description":"the CSV file path that defines the records to upsert","required":true},"resultfile":{"name":"resultfile","type":"option","char":"r","description":"the CSV file path for writing the upsert results"},"encoding":{"name":"encoding","type":"option","char":"e","description":"the input CSV file encoding","default":"utf8"},"delimiter":{"name":"delimiter","type":"option","char":"d","description":"the input CSV file delimiter","default":","},"quote":{"name":"quote","type":"option","char":"q","description":"the input CSV file quote character","default":"\""},"skiplines":{"name":"skiplines","type":"option","description":"the number of lines to skip","default":0},"trim":{"name":"trim","type":"boolean","description":"trim all white space from columns","allowNo":false},"mapping":{"name":"mapping","type":"option","char":"m","description":"the path of the JSON file that defines CSV column mappings"},"converter":{"name":"converter","type":"option","char":"c","description":"the path of the script to convert CSV rows"},"setnull":{"name":"setnull","type":"boolean","description":"set blank values as null values during upsert operations (default: empty field values are ignored)","allowNo":false},"convertonly":{"name":"convertonly","type":"boolean","description":"output converted.csv file and skip upsert for debugging","allowNo":false},"concurrencymode":{"name":"concurrencymode","type":"option","description":"the concurrency mode (Parallel or Serial) for the job","default":"Parallel"},"assignmentruleid":{"name":"assignmentruleid","type":"option","description":"the ID of a specific assignment rule to run for a case or a lead."},"batchsize":{"name":"batchsize","type":"option","char":"s","description":"the batch size of the job","default":10000},"wait":{"name":"wait","type":"option","char":"w","description":"the number of minutes to wait for the command to complete before displaying the results"}},"args":[]},"kit:data:csv:convert":{"id":"kit:data:csv:convert","description":"convert CSV data using column mapping file or Node.js script","usage":"<%= command.id %> [-f <filepath>] [-o <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:data:csv:convert -f ./path/to/input.csv -m ./path/to/mapping.json","$ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"inputfile":{"name":"inputfile","type":"option","char":"f","description":"the path of the input CSV file (default: standard input)"},"outputfile":{"name":"outputfile","type":"option","char":"o","description":"the path of the output CSV file (default: standard output)"},"encoding":{"name":"encoding","type":"option","char":"e","description":"the input CSV file encoding","default":"utf8"},"delimiter":{"name":"delimiter","type":"option","char":"d","description":"the input CSV file delimiter","default":","},"quote":{"name":"quote","type":"option","char":"q","description":"the input CSV file quote character","default":"\""},"skiplines":{"name":"skiplines","type":"option","description":"the number of lines to skip","default":0},"trim":{"name":"trim","type":"boolean","description":"trim all white space from columns","allowNo":false},"mapping":{"name":"mapping","type":"option","char":"m","description":"the path of the JSON file that defines CSV column mappings"},"converter":{"name":"converter","type":"option","char":"c","description":"the path of the script to convert CSV rows"}},"args":[]},"kit:layout:assignments:deploy":{"id":"kit:layout:assignments:deploy","description":"deploy page layout assignments from JSON file","usage":"<%= command.id %> -f <string> [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:layout:assignments:deploy","$ sfdx kit:layout:assignments:deploy -f config/layout-assignments.scratch.json","$ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"file":{"name":"file","type":"option","char":"f","description":"input file path","required":true,"default":"config/layout-assignments.json"}},"args":[]},"kit:layout:assignments:retrieve":{"id":"kit:layout:assignments:retrieve","description":"retrieve page layout assignments and save to JSON file","usage":"<%= command.id %> -f <string> [-p <string>] [-o <string>] [--merge] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:layout:assignments:retrieve","$ sfdx kit:layout:assignments:retrieve -p Admin,Standard,StandardAul -o Account,CustomObject__c -f config/layout-assignments.scratch.json","$ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"file":{"name":"file","type":"option","char":"f","description":"output file path","required":true,"default":"config/layout-assignments.json"},"profile":{"name":"profile","type":"option","char":"p","description":"comma separated profile names to retrieve (default: all profiles)","required":false},"object":{"name":"object","type":"option","char":"o","description":"comma separated object names to retrieve (default: objects which have multiple layouts)","required":false},"merge":{"name":"merge","type":"boolean","description":"merge retrieved configurations with existing file","required":false,"allowNo":false}},"args":[]}}}
1
+ {"version":"0.1.6","commands":{"kit:script:execute":{"id":"kit:script:execute","description":"execute Node.js scripts in SfdxCommand context\nAvailable variables in Node.js scripts\n argv: Parsed command line arguments after the file option\n conn: jsforce Connection\n context: SfdxCommand","usage":"<%= command.id %> [-f <filepath>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":["kit:script"],"examples":["$ sfdx kit:script -f ./path/to/script.js","$ sfdx kit:script:execute","> await conn.query('SELECT Id, Name FROM Account LIMIT 1')","Top level await is not enabled by default in REPL before Node.js v16","$ NODE_OPTIONS=--experimental-repl-await sfdx kit:script:execute"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"file":{"name":"file","type":"option","char":"f","description":"the path of the Node.js script file to execute"}},"args":[]},"kit:data:bulk:upsert":{"id":"kit:data:bulk:upsert","description":"bulk upsert records from a CSV file\nUpsert records using Bulk API and returns a job ID and a batch ID. Use these IDs to check job status with data:bulk:status.\nFor information about CSV file formats, see [Prepare CSV Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm) in the Bulk API Developer Guide.","usage":"<%= command.id %> -o <string> -i <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:data:bulk:upsert -o Account -f ./path/to/Account.csv -m ./path/to/mapping.json","$ sfdx kit:data:bulk:upsert -o MyObject__c -f ./path/to/MyObject__c.csv -c ./path/to/convert.js -i MyExternalId__c -w 10"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"object":{"name":"object","type":"option","char":"o","description":"the sObject name to upsert","required":true},"externalid":{"name":"externalid","type":"option","char":"i","description":"the column name of the external ID","required":true,"default":"Id"},"csvfile":{"name":"csvfile","type":"option","char":"f","description":"the CSV file path that defines the records to upsert","required":true},"resultfile":{"name":"resultfile","type":"option","char":"r","description":"the CSV file path for writing the upsert results"},"encoding":{"name":"encoding","type":"option","char":"e","description":"the input CSV file encoding","default":"utf8"},"delimiter":{"name":"delimiter","type":"option","char":"d","description":"the input CSV file delimiter","default":","},"quote":{"name":"quote","type":"option","char":"q","description":"the input CSV file quote character","default":"\""},"skiplines":{"name":"skiplines","type":"option","description":"the number of lines to skip","default":0},"trim":{"name":"trim","type":"boolean","description":"trim all white space from columns","allowNo":false},"mapping":{"name":"mapping","type":"option","char":"m","description":"the path of the JSON file that defines CSV column mappings"},"converter":{"name":"converter","type":"option","char":"c","description":"the path of the script to convert CSV rows"},"setnull":{"name":"setnull","type":"boolean","description":"set blank values as null values during upsert operations (default: empty field values are ignored)","allowNo":false},"convertonly":{"name":"convertonly","type":"boolean","description":"output converted.csv file and skip upsert for debugging","allowNo":false},"concurrencymode":{"name":"concurrencymode","type":"option","description":"the concurrency mode (Parallel or Serial) for the job","default":"Parallel"},"assignmentruleid":{"name":"assignmentruleid","type":"option","description":"the ID of a specific assignment rule to run for a case or a lead."},"batchsize":{"name":"batchsize","type":"option","char":"s","description":"the batch size of the job","default":10000},"wait":{"name":"wait","type":"option","char":"w","description":"the number of minutes to wait for the command to complete before displaying the results"}},"args":[]},"kit:data:csv:convert":{"id":"kit:data:csv:convert","description":"convert CSV data using column mapping file or Node.js script","usage":"<%= command.id %> [-f <filepath>] [-o <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:data:csv:convert -f ./path/to/input.csv -m ./path/to/mapping.json","$ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"inputfile":{"name":"inputfile","type":"option","char":"f","description":"the path of the input CSV file (default: standard input)"},"outputfile":{"name":"outputfile","type":"option","char":"o","description":"the path of the output CSV file (default: standard output)"},"encoding":{"name":"encoding","type":"option","char":"e","description":"the input CSV file encoding","default":"utf8"},"delimiter":{"name":"delimiter","type":"option","char":"d","description":"the input CSV file delimiter","default":","},"quote":{"name":"quote","type":"option","char":"q","description":"the input CSV file quote character","default":"\""},"skiplines":{"name":"skiplines","type":"option","description":"the number of lines to skip","default":0},"trim":{"name":"trim","type":"boolean","description":"trim all white space from columns","allowNo":false},"mapping":{"name":"mapping","type":"option","char":"m","description":"the path of the JSON file that defines CSV column mappings"},"converter":{"name":"converter","type":"option","char":"c","description":"the path of the script to convert CSV rows"}},"args":[]},"kit:layout:assignments:deploy":{"id":"kit:layout:assignments:deploy","description":"deploy page layout assignments from JSON file","usage":"<%= command.id %> -f <string> [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:layout:assignments:deploy","$ sfdx kit:layout:assignments:deploy -f config/layout-assignments.scratch.json","$ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"file":{"name":"file","type":"option","char":"f","description":"input file path","required":true,"default":"config/layout-assignments.json"}},"args":[]},"kit:layout:assignments:retrieve":{"id":"kit:layout:assignments:retrieve","description":"retrieve page layout assignments and save to JSON file","usage":"<%= command.id %> -f <string> [-p <string>] [-o <string>] [--merge] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]","pluginName":"@kitalive/sfdx-plugin","pluginType":"core","aliases":[],"examples":["$ sfdx kit:layout:assignments:retrieve","$ sfdx kit:layout:assignments:retrieve -p Admin,Standard,StandardAul -o Account,CustomObject__c -f config/layout-assignments.scratch.json","$ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json"],"flags":{"json":{"name":"json","type":"boolean","description":"format output as json","allowNo":false},"loglevel":{"name":"loglevel","type":"option","description":"logging level for this command invocation","required":false,"helpValue":"(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL)","options":["trace","debug","info","warn","error","fatal","TRACE","DEBUG","INFO","WARN","ERROR","FATAL"],"default":"warn"},"targetusername":{"name":"targetusername","type":"option","char":"u","description":"username or alias for the target org; overrides default target org"},"apiversion":{"name":"apiversion","type":"option","description":"override the api version used for api requests made by this command"},"file":{"name":"file","type":"option","char":"f","description":"output file path","required":true,"default":"config/layout-assignments.json"},"profile":{"name":"profile","type":"option","char":"p","description":"comma separated profile names to retrieve (default: all profiles)","required":false},"object":{"name":"object","type":"option","char":"o","description":"comma separated object names to retrieve (default: objects which have multiple layouts)","required":false},"merge":{"name":"merge","type":"boolean","description":"merge retrieved configurations with existing file","required":false,"allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kitalive/sfdx-plugin",
3
3
  "description": "Kitalive SFDX plugin",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "author": "Akihiro Ono",
6
6
  "bugs": "https://github.com/Kitalive-Inc/sfdx-plugin/issues",
7
7
  "dependencies": {
@@ -15,7 +15,8 @@
15
15
  "fs-extra": "^9.1.0",
16
16
  "iconv-lite": "^0.6.2",
17
17
  "jsforce": "^1.10.1",
18
- "tslib": "^1"
18
+ "tslib": "^1",
19
+ "yargs": "^17.3.1"
19
20
  },
20
21
  "devDependencies": {
21
22
  "@oclif/dev-cli": "^1",
@@ -26,6 +27,7 @@
26
27
  "@types/chai": "^4",
27
28
  "@types/jsforce": "^1.9.29",
28
29
  "@types/mocha": "^5",
30
+ "@types/yargs": "^17.0.8",
29
31
  "chai": "^4",
30
32
  "globby": "^8",
31
33
  "mocha": "^5",