legispro-cli 1.0.7

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 (88) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +696 -0
  3. package/bin/dev +17 -0
  4. package/bin/dev.cmd +3 -0
  5. package/bin/run +5 -0
  6. package/bin/run.cmd +3 -0
  7. package/dist/commands/backup/create.d.ts +7 -0
  8. package/dist/commands/backup/create.js +26 -0
  9. package/dist/commands/backup/list.d.ts +7 -0
  10. package/dist/commands/backup/list.js +38 -0
  11. package/dist/commands/collection/add.d.ts +12 -0
  12. package/dist/commands/collection/add.js +108 -0
  13. package/dist/commands/collection/create.d.ts +14 -0
  14. package/dist/commands/collection/create.js +132 -0
  15. package/dist/commands/collection/delete.d.ts +10 -0
  16. package/dist/commands/collection/delete.js +53 -0
  17. package/dist/commands/collection/download.d.ts +11 -0
  18. package/dist/commands/collection/download.js +87 -0
  19. package/dist/commands/collection/get.d.ts +10 -0
  20. package/dist/commands/collection/get.js +54 -0
  21. package/dist/commands/collection/list.d.ts +7 -0
  22. package/dist/commands/collection/list.js +25 -0
  23. package/dist/commands/collection/perms.d.ts +12 -0
  24. package/dist/commands/collection/perms.js +82 -0
  25. package/dist/commands/collection/update.d.ts +16 -0
  26. package/dist/commands/collection/update.js +174 -0
  27. package/dist/commands/collection/upload.d.ts +12 -0
  28. package/dist/commands/collection/upload.js +127 -0
  29. package/dist/commands/config/get.d.ts +1 -0
  30. package/dist/commands/config/get.js +19 -0
  31. package/dist/commands/config/set.d.ts +1 -0
  32. package/dist/commands/config/set.js +125 -0
  33. package/dist/commands/db/init.d.ts +7 -0
  34. package/dist/commands/db/init.js +90 -0
  35. package/dist/commands/db/memory.d.ts +7 -0
  36. package/dist/commands/db/memory.js +27 -0
  37. package/dist/commands/db/uptime.d.ts +7 -0
  38. package/dist/commands/db/uptime.js +17 -0
  39. package/dist/commands/db/version.d.ts +7 -0
  40. package/dist/commands/db/version.js +17 -0
  41. package/dist/commands/document/copy.d.ts +7 -0
  42. package/dist/commands/document/copy.js +35 -0
  43. package/dist/commands/document/list.d.ts +7 -0
  44. package/dist/commands/document/list.js +34 -0
  45. package/dist/commands/group/create.d.ts +14 -0
  46. package/dist/commands/group/create.js +132 -0
  47. package/dist/commands/group/delete.d.ts +10 -0
  48. package/dist/commands/group/delete.js +50 -0
  49. package/dist/commands/group/get.d.ts +10 -0
  50. package/dist/commands/group/get.js +51 -0
  51. package/dist/commands/group/list.d.ts +7 -0
  52. package/dist/commands/group/list.js +20 -0
  53. package/dist/commands/group/update.d.ts +14 -0
  54. package/dist/commands/group/update.js +132 -0
  55. package/dist/commands/locks/add.d.ts +7 -0
  56. package/dist/commands/locks/add.js +80 -0
  57. package/dist/commands/locks/clear.d.ts +7 -0
  58. package/dist/commands/locks/clear.js +23 -0
  59. package/dist/commands/locks/list.d.ts +7 -0
  60. package/dist/commands/locks/list.js +86 -0
  61. package/dist/commands/services/health.d.ts +8 -0
  62. package/dist/commands/services/health.js +66 -0
  63. package/dist/commands/user/create.d.ts +26 -0
  64. package/dist/commands/user/create.js +374 -0
  65. package/dist/commands/user/delete.d.ts +10 -0
  66. package/dist/commands/user/delete.js +58 -0
  67. package/dist/commands/user/get.d.ts +10 -0
  68. package/dist/commands/user/get.js +53 -0
  69. package/dist/commands/user/list.d.ts +7 -0
  70. package/dist/commands/user/list.js +24 -0
  71. package/dist/commands/user/login.d.ts +13 -0
  72. package/dist/commands/user/login.js +93 -0
  73. package/dist/commands/user/update.d.ts +25 -0
  74. package/dist/commands/user/update.js +267 -0
  75. package/dist/index.d.ts +1 -0
  76. package/dist/index.js +5 -0
  77. package/dist/lib/fusiondb-client.d.ts +52 -0
  78. package/dist/lib/fusiondb-client.js +655 -0
  79. package/dist/lib/rclone-client.d.ts +11 -0
  80. package/dist/lib/rclone-client.js +41 -0
  81. package/dist/lib/types.d.ts +79 -0
  82. package/dist/lib/types.js +2 -0
  83. package/dist/lib/utils.d.ts +4 -0
  84. package/dist/lib/utils.js +7 -0
  85. package/dist/lib/xml-templates.d.ts +6 -0
  86. package/dist/lib/xml-templates.js +66 -0
  87. package/oclif.manifest.json +1063 -0
  88. package/package.json +98 -0
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RcloneClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const path_1 = tslib_1.__importDefault(require("path"));
6
+ const rclone = require("rclone.js").promises;
7
+ class RcloneClient {
8
+ constructor() {
9
+ }
10
+ static get instance() {
11
+ return this._instance;
12
+ }
13
+ setConfig(cmd) {
14
+ const configFile = path_1.default.join(cmd.config.configDir, 'config.json');
15
+ const env = require(configFile);
16
+ this._webdavUrl = env.protocol + "://" + env.hostname + ":" + env.port;
17
+ this._webdavUser = env.user;
18
+ this._webdavPassword = env.password;
19
+ }
20
+ list(url) {
21
+ let password = '';
22
+ (async () => {
23
+ const pass = await rclone.obscure(this._webdavPassword);
24
+ password = pass;
25
+ // console.log(pass);
26
+ })();
27
+ (async () => {
28
+ const results = await rclone.ls(":webdav:" + url + "/", {
29
+ "webdav-url": this._webdavUrl,
30
+ "webdav-user": this._webdavUser,
31
+ "webdav-pass": password,
32
+ "max-depth": 2,
33
+ });
34
+ console.log(results);
35
+ })();
36
+ return '';
37
+ }
38
+ }
39
+ exports.RcloneClient = RcloneClient;
40
+ // singleton
41
+ RcloneClient._instance = new RcloneClient();
@@ -0,0 +1,79 @@
1
+ /**
2
+ * FusionDB Metadata
3
+ */
4
+ export interface Metadata {
5
+ key: string;
6
+ value: string;
7
+ }
8
+ /**
9
+ * FusionDB Users
10
+ */
11
+ export interface User {
12
+ userName: string;
13
+ password?: string;
14
+ enabled?: boolean;
15
+ expired?: boolean;
16
+ umask?: number;
17
+ primaryGroup?: string;
18
+ groups?: string[];
19
+ metadata?: Metadata[];
20
+ }
21
+ /**
22
+ * FusionDB Groups
23
+ */
24
+ export interface Group {
25
+ groupName: string;
26
+ managers?: string[];
27
+ metadata?: Metadata[];
28
+ }
29
+ /**
30
+ * FusionDB Collection
31
+ */
32
+ export interface Collection {
33
+ uri: string;
34
+ owner: string | undefined;
35
+ group: string | undefined;
36
+ mode: string;
37
+ created?: string;
38
+ }
39
+ /**
40
+ * FusionDB Document
41
+ */
42
+ export interface Document {
43
+ uri: string;
44
+ mediaType: string;
45
+ binaryDoc: boolean;
46
+ owner: string;
47
+ group: string;
48
+ mode: string;
49
+ }
50
+ export interface Project {
51
+ name: string;
52
+ title: string;
53
+ type: string;
54
+ baseURI: string;
55
+ defaultExt: string;
56
+ }
57
+ /**
58
+ * FusionDB Collection ACL
59
+ */
60
+ export interface Acl {
61
+ mode?: string;
62
+ target?: string;
63
+ accessType?: string;
64
+ who?: string;
65
+ }
66
+ export interface Config {
67
+ hostname: string;
68
+ protocol: string;
69
+ port: number;
70
+ user: string;
71
+ password: string;
72
+ webdav: string;
73
+ group: string;
74
+ }
75
+ export interface Lock {
76
+ uri: string;
77
+ owner: string;
78
+ expires: string;
79
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { FusiondbClient } from './fusiondb-client';
2
+ import { RcloneClient } from './rclone-client';
3
+ export declare const client: FusiondbClient;
4
+ export declare const rclone: RcloneClient;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rclone = exports.client = void 0;
4
+ const fusiondb_client_1 = require("./fusiondb-client");
5
+ const rclone_client_1 = require("./rclone-client");
6
+ exports.client = fusiondb_client_1.FusiondbClient.instance;
7
+ exports.rclone = rclone_client_1.RcloneClient.instance;
@@ -0,0 +1,6 @@
1
+ export declare class XmlTemplates {
2
+ /**
3
+ * Scratchpad XML template literal
4
+ */
5
+ static scratchpad: string;
6
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XmlTemplates = void 0;
4
+ class XmlTemplates {
5
+ }
6
+ exports.XmlTemplates = XmlTemplates;
7
+ /**
8
+ * Scratchpad XML template literal
9
+ */
10
+ XmlTemplates.scratchpad = `<?xml version="1.0" encoding="UTF-8"?>
11
+ <!-- This document is datafile used by LegisPro for the scratchpad feature. It uses the akomaNtoso structure and elements. But, the document it is not meant to be valid against the Akoma Ntoso schema. -->
12
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:akn="http://docs.oasis-open.org/legaldocml/ns/akn/3.0" xmlns:orml="http://schemas.oregon.gov/orml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/legaldocml/ns/akn/3.0 akomantoso30.proposed.xsd http://www.w3.org/1999/xhtml akn-table-module.xsd">
13
+ <portion includedIn="#legispro">
14
+ <meta>
15
+ <identification source="#legispro">
16
+ <FRBRWork>
17
+ <FRBRthis value="/akn/us-or/data/scratchpad/{{username}}" />
18
+ <FRBRuri value="/akn/us-or/data/scratchpad/{{username}}" />
19
+ <FRBRdate name="fileCreated" date="2021-12-07" />
20
+ <FRBRauthor href="#legispro" />
21
+ <FRBRcountry value="US-OR" />
22
+ <FRBRname value="Scratchpad" />
23
+ </FRBRWork>
24
+ <FRBRExpression>
25
+ <FRBRthis value="/akn/us-or/data/scratchpad/{{username}}" />
26
+ <FRBRuri value="/akn/us-or/data/scratchpad/{{username}}" />
27
+ <FRBRdate name="fileCreated" date="2021-12-07" />
28
+ <FRBRauthor href="#legispro" />
29
+ <FRBRlanguage language="eng" />
30
+ </FRBRExpression>
31
+ <FRBRManifestation>
32
+ <FRBRthis value="/akn/us-or/data/scratchpad/demo/!main.xml" />
33
+ <FRBRuri value="/akn/us-or/data/scratchpad/demo/!main.akn" />
34
+ <FRBRdate name="fileCreated" date="2021-12-07" />
35
+ <FRBRauthor href="#OLA" />
36
+ <FRBRformat value="application/akn+xml" />
37
+ </FRBRManifestation>
38
+ </identification>
39
+ <references source="#legispro">
40
+ <TLCProcess eId="legispro" href="/akn/xcential/taxonomy/process/legispro" showAs="LegisPro" />
41
+ <TLCProcess eId="conversion" href="/akn/xcential/taxonomy/process/conversion" showAs="Conversion" />
42
+ <TLCOrganization eId="OLA" href="http://www.oregonlegislature.gov/" showAs="OLA" />
43
+ </references>
44
+ </meta>
45
+ <portionBody>
46
+ <orml:scratchpadFragment>
47
+ <?placeholder {Paste Content Here}?>
48
+ </orml:scratchpadFragment>
49
+ <orml:scratchpadFragment>
50
+ <?placeholder {Paste Content Here}?>
51
+ </orml:scratchpadFragment>
52
+ <orml:scratchpadFragment>
53
+ <?placeholder {Paste Content Here}?>
54
+ </orml:scratchpadFragment>
55
+ <orml:scratchpadFragment>
56
+ <?placeholder {Paste Content Here}?>
57
+ </orml:scratchpadFragment>
58
+ <orml:scratchpadFragment>
59
+ <?placeholder {Paste Content Here}?>
60
+ </orml:scratchpadFragment>
61
+ <orml:scratchpadFragment>
62
+ <?placeholder {Paste Content Here}?>
63
+ </orml:scratchpadFragment>
64
+ </portionBody>
65
+ </portion>
66
+ </akomaNtoso>`;