legispro-cli 1.0.7 → 1.0.8

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.
Files changed (78) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +45 -17
  3. package/bin/dev.cmd +3 -3
  4. package/bin/dev.js +5 -0
  5. package/bin/run.cmd +3 -3
  6. package/bin/run.js +5 -0
  7. package/dist/commands/backup/create.js +13 -16
  8. package/dist/commands/backup/list.js +15 -18
  9. package/dist/commands/collection/add.d.ts +3 -3
  10. package/dist/commands/collection/add.js +31 -34
  11. package/dist/commands/collection/create.d.ts +5 -5
  12. package/dist/commands/collection/create.js +46 -49
  13. package/dist/commands/collection/delete.d.ts +1 -1
  14. package/dist/commands/collection/delete.js +20 -23
  15. package/dist/commands/collection/download.d.ts +2 -2
  16. package/dist/commands/collection/download.js +28 -31
  17. package/dist/commands/collection/get.d.ts +1 -1
  18. package/dist/commands/collection/get.js +21 -24
  19. package/dist/commands/collection/list.js +13 -16
  20. package/dist/commands/collection/perms.d.ts +3 -3
  21. package/dist/commands/collection/perms.js +29 -32
  22. package/dist/commands/collection/update.d.ts +7 -7
  23. package/dist/commands/collection/update.js +50 -54
  24. package/dist/commands/collection/upload.d.ts +3 -3
  25. package/dist/commands/collection/upload.js +39 -42
  26. package/dist/commands/config/get.d.ts +5 -1
  27. package/dist/commands/config/get.js +7 -10
  28. package/dist/commands/config/set.d.ts +5 -1
  29. package/dist/commands/config/set.js +41 -24
  30. package/dist/commands/db/init.js +18 -21
  31. package/dist/commands/db/memory.js +10 -12
  32. package/dist/commands/db/uptime.js +8 -10
  33. package/dist/commands/db/version.js +8 -10
  34. package/dist/commands/deploy/index.d.ts +10 -0
  35. package/dist/commands/deploy/index.js +126 -0
  36. package/dist/commands/document/copy.js +15 -18
  37. package/dist/commands/document/list.js +15 -18
  38. package/dist/commands/group/create.d.ts +5 -5
  39. package/dist/commands/group/create.js +36 -39
  40. package/dist/commands/group/delete.d.ts +1 -1
  41. package/dist/commands/group/delete.js +19 -22
  42. package/dist/commands/group/get.d.ts +1 -1
  43. package/dist/commands/group/get.js +20 -23
  44. package/dist/commands/group/list.js +8 -10
  45. package/dist/commands/group/update.d.ts +5 -5
  46. package/dist/commands/group/update.js +36 -39
  47. package/dist/commands/locks/add.js +16 -18
  48. package/dist/commands/locks/clear.js +11 -13
  49. package/dist/commands/services/health.js +11 -14
  50. package/dist/commands/user/create.d.ts +17 -17
  51. package/dist/commands/user/create.js +104 -107
  52. package/dist/commands/user/delete.d.ts +1 -1
  53. package/dist/commands/user/delete.js +24 -27
  54. package/dist/commands/user/get.d.ts +1 -1
  55. package/dist/commands/user/get.js +20 -23
  56. package/dist/commands/user/list.js +10 -13
  57. package/dist/commands/user/login.d.ts +2 -2
  58. package/dist/commands/user/login.js +30 -33
  59. package/dist/commands/user/update.d.ts +16 -16
  60. package/dist/commands/user/update.js +108 -111
  61. package/dist/index.js +1 -5
  62. package/dist/lib/fusiondb-client.d.ts +2 -1
  63. package/dist/lib/fusiondb-client.js +19 -18
  64. package/dist/lib/gh.d.ts +26 -0
  65. package/dist/lib/gh.js +37 -0
  66. package/dist/lib/rclone-client.js +12 -15
  67. package/dist/lib/shell.d.ts +24 -0
  68. package/dist/lib/shell.js +68 -0
  69. package/dist/lib/types.js +1 -2
  70. package/dist/lib/utils.d.ts +2 -2
  71. package/dist/lib/utils.js +4 -7
  72. package/dist/lib/xml-templates.js +61 -65
  73. package/oclif.manifest.json +958 -520
  74. package/package.json +102 -98
  75. package/bin/dev +0 -17
  76. package/bin/run +0 -5
  77. package/dist/commands/locks/list.d.ts +0 -7
  78. package/dist/commands/locks/list.js +0 -86
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const utils_1 = require("../../lib/utils");
6
- const enquirer_1 = require("enquirer");
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- class GroupCreate extends core_1.Command {
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ import enquirer from 'enquirer';
4
+ import chalk from 'chalk';
5
+ class GroupCreate extends Command {
9
6
  async run() {
10
- utils_1.client.setConfig(this);
7
+ client.setConfig(this);
11
8
  const { flags } = await this.parse(GroupCreate);
12
9
  // prompts
13
10
  if (!flags.name) {
14
- const name_answer = await (0, enquirer_1.prompt)([
11
+ const name_answer = await enquirer.prompt([
15
12
  {
16
13
  type: 'input',
17
14
  name: 'name',
@@ -21,7 +18,7 @@ class GroupCreate extends core_1.Command {
21
18
  ]);
22
19
  // @ts-ignore
23
20
  flags.name = name_answer['name'];
24
- const res = await (0, enquirer_1.prompt)([
21
+ const res = await enquirer.prompt([
25
22
  {
26
23
  type: 'input',
27
24
  name: 'description',
@@ -88,45 +85,45 @@ class GroupCreate extends core_1.Command {
88
85
  managers: manager_list,
89
86
  metadata: meta,
90
87
  };
91
- let create_group_response = await utils_1.client.createGroup(group);
88
+ let create_group_response = await client.createGroup(group);
92
89
  // Spinner.stopAndPersist({
93
90
  // symbol: "✨",
94
91
  // text: `${chalk.bold(chalk.green('Group created'))}`
95
92
  // })
96
93
  if (create_group_response.status == 204) {
97
- this.log(`${chalk_1.default.bold.green('Group created')}`);
94
+ this.log(`${chalk.bold.green('Group created')}`);
98
95
  this.exit();
99
96
  }
100
97
  else {
101
- this.log(`${chalk_1.default.red("Error:")} (${create_group_response.status}) ${create_group_response.statusText}.`);
98
+ this.log(`${chalk.red("Error:")} (${create_group_response.status}) ${create_group_response.statusText}.`);
102
99
  // this.log(create_group_response);
103
100
  this.exit();
104
101
  }
105
102
  }
106
103
  }
104
+ static flags = {
105
+ name: Flags.string({
106
+ description: 'Name',
107
+ required: false
108
+ }),
109
+ managers: Flags.string({
110
+ description: 'Managers',
111
+ required: false
112
+ }),
113
+ email: Flags.string({
114
+ description: 'email',
115
+ required: false
116
+ }),
117
+ language: Flags.string({
118
+ description: 'language',
119
+ required: false
120
+ }),
121
+ description: Flags.string({
122
+ description: 'description',
123
+ required: false
124
+ }),
125
+ };
126
+ static description = "Create group";
127
+ static examples = [`$ legispro groupr:create`,];
107
128
  }
108
- GroupCreate.flags = {
109
- name: core_1.Flags.string({
110
- description: 'Name',
111
- required: false
112
- }),
113
- managers: core_1.Flags.string({
114
- description: 'Managers',
115
- required: false
116
- }),
117
- email: core_1.Flags.string({
118
- description: 'email',
119
- required: false
120
- }),
121
- language: core_1.Flags.string({
122
- description: 'language',
123
- required: false
124
- }),
125
- description: core_1.Flags.string({
126
- description: 'description',
127
- required: false
128
- }),
129
- };
130
- GroupCreate.description = "Create group";
131
- GroupCreate.examples = [`$ legispro groupr:create`,];
132
- exports.default = GroupCreate;
129
+ export default GroupCreate;
@@ -2,7 +2,7 @@ import { Command } from '@oclif/core';
2
2
  declare class GroupDelete extends Command {
3
3
  run(): Promise<void>;
4
4
  static flags: {
5
- name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
5
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
6
  };
7
7
  static description: string;
8
8
  static examples: string[];
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const utils_1 = require("../../lib/utils");
6
- const enquirer_1 = require("enquirer");
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- class GroupDelete extends core_1.Command {
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ import enquirer from 'enquirer';
4
+ import chalk from "chalk";
5
+ class GroupDelete extends Command {
9
6
  async run() {
10
- utils_1.client.setConfig(this);
7
+ client.setConfig(this);
11
8
  const { flags } = await this.parse(GroupDelete);
12
9
  if (!flags.name) {
13
- const res = await (0, enquirer_1.prompt)([
10
+ const res = await enquirer.prompt([
14
11
  {
15
12
  type: 'input',
16
13
  name: 'name',
@@ -26,25 +23,25 @@ class GroupDelete extends core_1.Command {
26
23
  }
27
24
  }
28
25
  if (flags.name) {
29
- let res = await utils_1.client.deleteGroup(flags.name);
26
+ let res = await client.deleteGroup(flags.name);
30
27
  if (res.status == 204) {
31
28
  // this.log(JSON.stringify(res.data, null, 2));
32
- this.log(`${chalk_1.default.bold(chalk_1.default.green('Group deleted'))}`);
29
+ this.log(`${chalk.bold(chalk.green('Group deleted'))}`);
33
30
  this.exit();
34
31
  }
35
32
  else {
36
- this.log(`${chalk_1.default.red("Error:")} (${res.status}) ${res.statusText}.`);
33
+ this.log(`${chalk.red("Error:")} (${res.status}) ${res.statusText}.`);
37
34
  this.exit();
38
35
  }
39
36
  }
40
37
  }
38
+ static flags = {
39
+ name: Flags.string({
40
+ description: 'Name',
41
+ required: false
42
+ }),
43
+ };
44
+ static description = "Get group information";
45
+ static examples = [`$ legispro group:get --name demo`,];
41
46
  }
42
- GroupDelete.flags = {
43
- name: core_1.Flags.string({
44
- description: 'Name',
45
- required: false
46
- }),
47
- };
48
- GroupDelete.description = "Get group information";
49
- GroupDelete.examples = [`$ legispro group:get --name demo`,];
50
- exports.default = GroupDelete;
47
+ export default GroupDelete;
@@ -2,7 +2,7 @@ import { Command } from '@oclif/core';
2
2
  declare class GroupGet extends Command {
3
3
  run(): Promise<void>;
4
4
  static flags: {
5
- name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
5
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
6
  };
7
7
  static description: string;
8
8
  static examples: string[];
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const utils_1 = require("../../lib/utils");
6
- const enquirer_1 = require("enquirer");
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- const treeify = require('treeify');
9
- class GroupGet extends core_1.Command {
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ import enquirer from 'enquirer';
4
+ import chalk from "chalk";
5
+ import treeify from 'treeify';
6
+ class GroupGet extends Command {
10
7
  async run() {
11
- utils_1.client.setConfig(this);
8
+ client.setConfig(this);
12
9
  const { flags } = await this.parse(GroupGet);
13
10
  if (!flags.name) {
14
- const res = await (0, enquirer_1.prompt)([
11
+ const res = await enquirer.prompt([
15
12
  {
16
13
  type: 'input',
17
14
  name: 'name',
@@ -27,25 +24,25 @@ class GroupGet extends core_1.Command {
27
24
  }
28
25
  }
29
26
  if (flags.name) {
30
- let res = await utils_1.client.getGroup(flags.name);
27
+ let res = await client.getGroup(flags.name);
31
28
  if (res.status == 200) {
32
29
  // this.log(JSON.stringify(res.data, null, 2));
33
- this.log(treeify.asTree(res.data, true));
30
+ this.log(treeify.asTree(res.data, true, false));
34
31
  this.exit();
35
32
  }
36
33
  else {
37
- this.log(`${chalk_1.default.red("Error:")} group ${flags.name} doesn't exist.`);
34
+ this.log(`${chalk.red("Error:")} group ${flags.name} doesn't exist.`);
38
35
  this.exit();
39
36
  }
40
37
  }
41
38
  }
39
+ static flags = {
40
+ name: Flags.string({
41
+ description: 'Name',
42
+ required: false
43
+ }),
44
+ };
45
+ static description = "Get group information";
46
+ static examples = [`$ legispro group:get --name demo`,];
42
47
  }
43
- GroupGet.flags = {
44
- name: core_1.Flags.string({
45
- description: 'Name',
46
- required: false
47
- }),
48
- };
49
- GroupGet.description = "Get group information";
50
- GroupGet.examples = [`$ legispro group:get --name demo`,];
51
- exports.default = GroupGet;
48
+ export default GroupGet;
@@ -1,11 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const utils_1 = require("../../lib/utils");
5
- class GroupList extends core_1.Command {
1
+ import { Command } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ class GroupList extends Command {
6
4
  async run() {
7
- utils_1.client.setConfig(this);
8
- let groups = await utils_1.client.getGroups();
5
+ client.setConfig(this);
6
+ let groups = await client.getGroups();
9
7
  // const users: User[] = [];
10
8
  // for (let name of names) {
11
9
  // users.push({userName: name})
@@ -14,7 +12,7 @@ class GroupList extends core_1.Command {
14
12
  this.log(groups);
15
13
  this.exit();
16
14
  }
15
+ static description = "Get list of all groups";
16
+ static examples = [`$ legispro group:list`,];
17
17
  }
18
- GroupList.description = "Get list of all groups";
19
- GroupList.examples = [`$ legispro group:list`,];
20
- exports.default = GroupList;
18
+ export default GroupList;
@@ -2,11 +2,11 @@ import { Command } from '@oclif/core';
2
2
  declare class GroupUpdate extends Command {
3
3
  run(): Promise<void>;
4
4
  static flags: {
5
- name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
- managers: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- email: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- language: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
5
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ managers: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ email: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ language: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  };
11
11
  static description: string;
12
12
  static examples: string[];
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const utils_1 = require("../../lib/utils");
6
- const enquirer_1 = require("enquirer");
7
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
8
- class GroupUpdate extends core_1.Command {
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ import enquirer from 'enquirer';
4
+ import chalk from 'chalk';
5
+ class GroupUpdate extends Command {
9
6
  async run() {
10
- utils_1.client.setConfig(this);
7
+ client.setConfig(this);
11
8
  const { flags } = await this.parse(GroupUpdate);
12
9
  // prompts
13
10
  if (!flags.name) {
14
- const name_answer = await (0, enquirer_1.prompt)([
11
+ const name_answer = await enquirer.prompt([
15
12
  {
16
13
  type: 'input',
17
14
  name: 'name',
@@ -21,7 +18,7 @@ class GroupUpdate extends core_1.Command {
21
18
  ]);
22
19
  // @ts-ignore
23
20
  flags.name = name_answer['name'];
24
- const res = await (0, enquirer_1.prompt)([
21
+ const res = await enquirer.prompt([
25
22
  {
26
23
  type: 'input',
27
24
  name: 'description',
@@ -88,45 +85,45 @@ class GroupUpdate extends core_1.Command {
88
85
  managers: manager_list,
89
86
  metadata: meta,
90
87
  };
91
- let create_group_response = await utils_1.client.createGroup(group);
88
+ let create_group_response = await client.createGroup(group);
92
89
  // Spinner.stopAndPersist({
93
90
  // symbol: "✨",
94
91
  // text: `${chalk.bold(chalk.green('Group created'))}`
95
92
  // })
96
93
  if (create_group_response.status == 204) {
97
- this.log(`${chalk_1.default.bold(chalk_1.default.green('Group created'))}`);
94
+ this.log(`${chalk.bold(chalk.green('Group created'))}`);
98
95
  this.exit();
99
96
  }
100
97
  else {
101
- this.log(`${chalk_1.default.red("Error:")} (${create_group_response.status}) ${create_group_response.statusText}.`);
98
+ this.log(`${chalk.red("Error:")} (${create_group_response.status}) ${create_group_response.statusText}.`);
102
99
  // this.log(create_group_response);
103
100
  this.exit();
104
101
  }
105
102
  }
106
103
  }
104
+ static flags = {
105
+ name: Flags.string({
106
+ description: 'Name',
107
+ required: false
108
+ }),
109
+ managers: Flags.string({
110
+ description: 'Managers',
111
+ required: false
112
+ }),
113
+ email: Flags.string({
114
+ description: 'email',
115
+ required: false
116
+ }),
117
+ language: Flags.string({
118
+ description: 'language',
119
+ required: false
120
+ }),
121
+ description: Flags.string({
122
+ description: 'description',
123
+ required: false
124
+ }),
125
+ };
126
+ static description = "Create group";
127
+ static examples = [`$ legispro groupr:create`,];
107
128
  }
108
- GroupUpdate.flags = {
109
- name: core_1.Flags.string({
110
- description: 'Name',
111
- required: false
112
- }),
113
- managers: core_1.Flags.string({
114
- description: 'Managers',
115
- required: false
116
- }),
117
- email: core_1.Flags.string({
118
- description: 'email',
119
- required: false
120
- }),
121
- language: core_1.Flags.string({
122
- description: 'language',
123
- required: false
124
- }),
125
- description: core_1.Flags.string({
126
- description: 'description',
127
- required: false
128
- }),
129
- };
130
- GroupUpdate.description = "Create group";
131
- GroupUpdate.examples = [`$ legispro groupr:create`,];
132
- exports.default = GroupUpdate;
129
+ export default GroupUpdate;
@@ -1,14 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const utils_1 = require("../../lib/utils");
5
- class LocksAdd extends core_1.Command {
1
+ import { Command } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ class LocksAdd extends Command {
6
4
  async run() {
7
- utils_1.client.setConfig(this);
5
+ client.setConfig(this);
8
6
  let etc_uri = '/db/etc';
9
7
  let etc_coll_mode = 'rwxrws--T';
10
8
  let etc_file_mode = 'rw-rw----';
11
- const locksCollectionExists = await utils_1.client.existsCollection(etc_uri);
9
+ const locksCollectionExists = await client.existsCollection(etc_uri);
12
10
  if (!locksCollectionExists) {
13
11
  // Create etc collection
14
12
  let collection = {
@@ -17,10 +15,10 @@ class LocksAdd extends core_1.Command {
17
15
  group: 'users',
18
16
  mode: etc_coll_mode,
19
17
  };
20
- let create_response = await utils_1.client.createCollection(collection);
21
- let modify_response = await utils_1.client.modifyCollection(collection);
18
+ let create_response = await client.createCollection(collection);
19
+ let modify_response = await client.modifyCollection(collection);
22
20
  // Mods.xml
23
- let modsExists = await utils_1.client.existsCollection(`${etc_uri}/Mods.xml`);
21
+ let modsExists = await client.existsCollection(`${etc_uri}/Mods.xml`);
24
22
  if (!modsExists) {
25
23
  let mods_uri = `${etc_uri}/Mods.xml`;
26
24
  let mods_xml = '<mods xmlns="http://www.xcential.com/schemas/mods/1.0" xmlns:d="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></mods>';
@@ -33,8 +31,8 @@ class LocksAdd extends core_1.Command {
33
31
  group: 'users',
34
32
  mode: etc_file_mode
35
33
  };
36
- let mods_xml_response = await utils_1.client.createDocument(mods_uri, mods_buffer);
37
- let update_mods_xml_props_response = await utils_1.client.updateDocumentProperties(mods_xml_document);
34
+ let mods_xml_response = await client.createDocument(mods_uri, mods_buffer);
35
+ let update_mods_xml_props_response = await client.updateDocumentProperties(mods_xml_document);
38
36
  // this.log(update_mods_xml_props_response);
39
37
  if (update_mods_xml_props_response.status == 204) {
40
38
  this.log('Mods.xml added');
@@ -44,7 +42,7 @@ class LocksAdd extends core_1.Command {
44
42
  }
45
43
  }
46
44
  // Locks.xml
47
- let locksExists = await utils_1.client.existsCollection(`${etc_uri}/Locks.xml`);
45
+ let locksExists = await client.existsCollection(`${etc_uri}/Locks.xml`);
48
46
  if (!locksExists) {
49
47
  let locks_uri = `${etc_uri}/Locks.xml`;
50
48
  let locks_xml = '<locks xmlns="http://www.xcential.com/schemas/locks/1.0" xmlns:d="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></locks>';
@@ -57,8 +55,8 @@ class LocksAdd extends core_1.Command {
57
55
  group: 'users',
58
56
  mode: etc_file_mode
59
57
  };
60
- let locks_xml_response = await utils_1.client.createDocument(locks_uri, locks_buffer);
61
- let update_locks_xml_props_response = await utils_1.client.updateDocumentProperties(locks_xml_document);
58
+ let locks_xml_response = await client.createDocument(locks_uri, locks_buffer);
59
+ let update_locks_xml_props_response = await client.updateDocumentProperties(locks_xml_document);
62
60
  // this.log(update_locks_xml_props_response);
63
61
  if (update_locks_xml_props_response.status == 204) {
64
62
  this.log('Locks.xml added');
@@ -74,7 +72,7 @@ class LocksAdd extends core_1.Command {
74
72
  this.exit();
75
73
  }
76
74
  }
75
+ static description = "Add Locks and Mods XML files";
76
+ static examples = [`$ legispro locks:add`,];
77
77
  }
78
- LocksAdd.description = "Add Locks and Mods XML files";
79
- LocksAdd.examples = [`$ legispro locks:add`,];
80
- exports.default = LocksAdd;
78
+ export default LocksAdd;
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const utils_1 = require("../../lib/utils");
5
- const xpath = require('xpath');
6
- const dom = require('xmldom').DOMParser;
7
- class LocksClear extends core_1.Command {
1
+ import { Command } from '@oclif/core';
2
+ import { client } from "../../lib/utils.js";
3
+ import xpath from 'xpath';
4
+ import { DOMParser as dom } from 'xmldom';
5
+ class LocksClear extends Command {
8
6
  async run() {
9
- utils_1.client.setConfig(this);
10
- let response = await utils_1.client.clearExpiredLocks();
7
+ client.setConfig(this);
8
+ let response = await client.clearExpiredLocks();
11
9
  if (response.status == 200) {
12
- // this.log(response.data);
10
+ // this.log(response.data);
13
11
  let doc = new dom().parseFromString(response.data, "application/xml");
14
12
  let select = xpath.useNamespaces({ "exist": "http://exist.sourceforge.net/NS/exist" });
15
13
  let count = select("string(/exist:result/@exist:count)", doc);
@@ -17,7 +15,7 @@ class LocksClear extends core_1.Command {
17
15
  this.exit();
18
16
  }
19
17
  }
18
+ static description = "Clear expired locks";
19
+ static examples = [`$ legispro locks:clear`,];
20
20
  }
21
- LocksClear.description = "Clear expired locks";
22
- LocksClear.examples = [`$ legispro locks:clear`,];
23
- exports.default = LocksClear;
21
+ export default LocksClear;
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const core_1 = require("@oclif/core");
5
- const axios_1 = tslib_1.__importDefault(require("axios"));
6
- const utils_1 = require("../../lib/utils");
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
- class ServicesHealth extends core_1.Command {
1
+ import { Command } from '@oclif/core';
2
+ import axios from 'axios';
3
+ import { client } from "../../lib/utils.js";
4
+ import path from "path";
5
+ class ServicesHealth extends Command {
9
6
  async run() {
10
- const configFile = path_1.default.join(this.config.configDir, 'config.json');
7
+ const configFile = path.join(this.config.configDir, 'config.json');
11
8
  const env = require(configFile);
12
- utils_1.client.setConfig(this);
9
+ client.setConfig(this);
13
10
  const services = [
14
11
  {
15
12
  name: "Resolver",
@@ -55,12 +52,12 @@ class ServicesHealth extends core_1.Command {
55
52
  this.exit();
56
53
  }
57
54
  get(url) {
58
- return (0, axios_1.default)({
55
+ return axios({
59
56
  method: 'GET',
60
57
  url: url
61
58
  });
62
59
  }
60
+ static description = "Perform services health check";
61
+ static examples = [`$ legispro services:health`,];
63
62
  }
64
- ServicesHealth.description = "Perform services health check";
65
- ServicesHealth.examples = [`$ legispro services:health`,];
66
- exports.default = ServicesHealth;
63
+ export default ServicesHealth;
@@ -2,23 +2,23 @@ import { Command } from '@oclif/core';
2
2
  declare class UserCreate extends Command {
3
3
  run(): Promise<void>;
4
4
  static flags: {
5
- username: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
- groups: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- email: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- language: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- password: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- primaryGroup: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
- alias: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- timezone: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- firstName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
- lastName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
- country: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
17
- fullName: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
18
- enabled: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
- expired: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
- umask: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
- scratchpad: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
5
+ username: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ groups: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ email: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ language: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ password: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ primaryGroup: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ timezone: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ firstName: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ lastName: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ country: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ fullName: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ enabled: import("@oclif/core/interfaces").BooleanFlag<boolean>;
19
+ expired: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ umask: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
21
+ scratchpad: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
22
  };
23
23
  static description: string;
24
24
  static examples: string[];