dbdocs 0.8.1 → 0.8.3

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/bin/run CHANGED
File without changes
@@ -1 +1 @@
1
- {"version":"0.8.1","commands":{"build":{"id":"build","description":"build docs","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","description":"project name","multiple":false},"public":{"name":"public","type":"boolean","description":"anyone with the URL can access","helpGroup":"sharing","allowNo":false,"exclusive":["private","password"]},"private":{"name":"private","type":"boolean","description":"only invited people can access","helpGroup":"sharing","allowNo":false,"exclusive":["public","password"]},"password":{"name":"password","type":"option","char":"p","description":"anyone with the URL + password can access","helpGroup":"sharing","multiple":false,"exclusive":["public","private"]}},"args":[{"name":"filepath","description":"dbml file path"}]},"login":{"id":"login","description":"login to dbdocs\nlogin with your dbdocs credentials\n","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"logout":{"id":"logout","description":"logout\nclears local login credentials\n","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"ls":{"id":"ls","description":"list projects","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"password":{"id":"password","description":"set password for your project or remove password","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"project name","helpValue":"project name","multiple":false},"set":{"name":"set","type":"option","char":"s","description":"password for your project","helpValue":"password","multiple":false},"remove":{"name":"remove","type":"boolean","char":"r","description":"remove password from your project","allowNo":false}},"args":[]},"remove":{"id":"remove","description":"remove project","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"project_name","description":"name of the project which you want to remove"}]},"rename":{"id":"rename","description":"change your username","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"token":{"id":"token","description":"generate or revoke your authentication token","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{"generate":{"name":"generate","type":"boolean","char":"g","description":"generate authentication token","allowNo":false},"revoke":{"name":"revoke","type":"boolean","char":"r","description":"revoke authentication token","allowNo":false}},"args":[]},"validate":{"id":"validate","description":"validate docs content","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"filepath","description":"dbml file path"}]}}}
1
+ {"version":"0.8.3","commands":{"build":{"id":"build","description":"build docs","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","description":"project name","multiple":false},"public":{"name":"public","type":"boolean","description":"anyone with the URL can access","helpGroup":"sharing","allowNo":false,"exclusive":["private","password"]},"private":{"name":"private","type":"boolean","description":"only invited people can access","helpGroup":"sharing","allowNo":false,"exclusive":["public","password"]},"password":{"name":"password","type":"option","char":"p","description":"anyone with the URL + password can access","helpGroup":"sharing","multiple":false,"exclusive":["public","private"]}},"args":[{"name":"filepath","description":"dbml file path"}]},"login":{"id":"login","description":"login to dbdocs\nlogin with your dbdocs credentials\n","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"logout":{"id":"logout","description":"logout\nclears local login credentials\n","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"ls":{"id":"ls","description":"list projects","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"password":{"id":"password","description":"set password for your project or remove password","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"project name","helpValue":"project name","multiple":false},"set":{"name":"set","type":"option","char":"s","description":"password for your project","helpValue":"password","multiple":false},"remove":{"name":"remove","type":"boolean","char":"r","description":"remove password from your project","allowNo":false}},"args":[]},"remove":{"id":"remove","description":"remove project","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"project_name","description":"name of the project which you want to remove"}]},"rename":{"id":"rename","description":"change your username","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[]},"token":{"id":"token","description":"generate or revoke your authentication token","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{"generate":{"name":"generate","type":"boolean","char":"g","description":"generate authentication token","allowNo":false},"revoke":{"name":"revoke","type":"boolean","char":"r","description":"revoke authentication token","allowNo":false}},"args":[]},"validate":{"id":"validate","description":"validate docs content","strict":true,"pluginName":"dbdocs","pluginAlias":"dbdocs","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"filepath","description":"dbml file path"}]}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbdocs",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "author": "@holistics",
5
5
  "bin": {
6
6
  "dbdocs": "./bin/run"
@@ -9,7 +9,7 @@
9
9
  "oclif/**/ansi-regex": "^3.0.1"
10
10
  },
11
11
  "dependencies": {
12
- "@dbml/core": "^2.5.3",
12
+ "@dbml/core": "^2.6.0",
13
13
  "@oclif/core": "1.12.1",
14
14
  "@oclif/plugin-help": "5.1.12",
15
15
  "axios": "0.27.2",
@@ -19,6 +19,7 @@
19
19
  "netrc-parser": "^3.1.6",
20
20
  "open": "^7.0.0",
21
21
  "ora": "^4.0.3",
22
+ "remove-markdown": "^0.5.0",
22
23
  "update-notifier": "^6.0.2"
23
24
  },
24
25
  "devDependencies": {
@@ -5,6 +5,7 @@ const fs = require('fs');
5
5
  const path = require('path');
6
6
  const ora = require('ora');
7
7
  const chalk = require('chalk');
8
+ const removeMd = require('remove-markdown');
8
9
  const { vars } = require('../vars');
9
10
  const verifyToken = require('../utils/verifyToken');
10
11
  const { getOrg } = require('../utils/org');
@@ -83,6 +84,7 @@ class BuildCommand extends Command {
83
84
  const isPublic = getIsPublicValueFromBuildFlag(publicFlag, privateFlag, password);
84
85
  const { newProject } = await build({
85
86
  projectName: project,
87
+ description: removeMd(model.description),
86
88
  isPublic,
87
89
  password,
88
90
  orgName: org,
@@ -7,6 +7,7 @@ const netrc = require('netrc-parser').default;
7
7
  const { vars } = require('../vars');
8
8
  const { isValidEmail } = require('../validators/email');
9
9
  const { isValidOtp } = require('../validators/otp');
10
+ const { LOGIN_METHODS } = require('../utils/constants');
10
11
 
11
12
  async function askForOtp (spinner, shortLivedToken, email) {
12
13
  const cliSpinner = spinner;
@@ -77,8 +78,8 @@ class LoginCommand extends Command {
77
78
  type: 'rawlist',
78
79
  message: 'Choose a login method:',
79
80
  choices: [
80
- { name: 'Email', value: 'Email' },
81
- { name: 'GitHub', value: 'GitHub' },
81
+ { name: 'Email', value: LOGIN_METHODS.EMAIL },
82
+ { name: 'GitHub/Google', value: LOGIN_METHODS.GITHUB_GOOGLE },
82
83
  ],
83
84
  name: 'loginMethod',
84
85
  },
@@ -86,14 +87,9 @@ class LoginCommand extends Command {
86
87
 
87
88
  const { loginMethod } = loginMethodAnswer;
88
89
 
89
- const loginMethods = {
90
- EMAIL: 'Email',
91
- GITHUB: 'GitHub',
92
- };
93
-
94
90
  let authToken;
95
91
 
96
- if (loginMethod === loginMethods.EMAIL) {
92
+ if (loginMethod === LOGIN_METHODS.EMAIL) {
97
93
  authToken = await loginViaEmail(spinner);
98
94
  } else {
99
95
  await open(`${vars.hostUrl}/login/cli`, { wait: false });
@@ -14,8 +14,14 @@ const FLAG_HELP_GROUP = {
14
14
  sharing: 'sharing',
15
15
  };
16
16
 
17
+ const LOGIN_METHODS = {
18
+ EMAIL: 'Email',
19
+ GITHUB_GOOGLE: 'GitHub/Google',
20
+ };
21
+
17
22
  module.exports = {
18
23
  PROJECT_GENERAL_ACCESS_TYPE,
19
24
  PROJECT_SHARING_TEXT,
20
25
  FLAG_HELP_GROUP,
26
+ LOGIN_METHODS,
21
27
  };
@@ -11,6 +11,7 @@ function parse (content) {
11
11
  });
12
12
  return {
13
13
  name: databaseObject.name,
14
+ description: databaseObject.note,
14
15
  schemas,
15
16
  };
16
17
  }