@rglabs/butterfly 3.0.0 → 3.0.2

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/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { program } from 'commander';
3
3
  import { config } from 'dotenv';
4
+ import { readFileSync } from 'fs';
5
+ import { fileURLToPath } from 'url';
6
+ import { dirname, join } from 'path';
4
7
  import setupCommand from './commands/setup.js';
5
8
  import downloadCommand from './commands/download.js';
6
9
  import uploadCommand from './commands/upload.js';
@@ -14,10 +17,13 @@ import syncDocsCommand from './commands/sync-docs.js';
14
17
  import translateCommand from './commands/translate.js';
15
18
  import viewReportCommand from './commands/view-report.js';
16
19
  config();
20
+ const __filename = fileURLToPath(import.meta.url);
21
+ const __dirname = dirname(__filename);
22
+ const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));
17
23
  program
18
24
  .name('butterfly-cli')
19
25
  .description('CLI tool to download resources from the Butterfly platform')
20
- .version('2.0.2');
26
+ .version(pkg.version);
21
27
  program
22
28
  .command('setup')
23
29
  .description('Configure authentication for the Butterfly platform')
package/dist/utils/api.js CHANGED
@@ -277,7 +277,7 @@ export class ButterflyAPI {
277
277
  formData.append('code', code);
278
278
  formData.append('trust_device', '1');
279
279
  formData.append('csrf_token', this.csrfToken);
280
- const verifyResponse = await this.client.post('/admin/ajax/twofactor/verify_code', formData, {
280
+ const verifyResponse = await this.client.post('/admin/ajax/two_factor/verify_code', formData, {
281
281
  headers: {
282
282
  'Content-Type': 'application/x-www-form-urlencoded',
283
283
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rglabs/butterfly",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "CLI tool to download resources from the Butterfly platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",