Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASTS-1245: Updating folders setup to build correct default folder structure #60

Open
wants to merge 7 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 64 additions & 10 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const { install, installGlobal } = require("../lib/install.js");
const { initHelp, installHelp } = require("../lib/help");
const { uninstall, info, run, list } = require("../lib/index");
const init = require("../lib/init").init;
const connectorInit = require("../lib/init").connectorInit;

const yargsInteractive = require("yargs-interactive");
const yargs = require("yargs");

const { cyan, dim, bright } = require("ansicolor");
Expand All @@ -13,6 +15,34 @@ const asTable = require("as-table").configure({
dash: bright(cyan("-")),
});

const options = {
interactive: {
default: true,
},
name: {
type: "input",
describe: "Enter connector name",
},
type: {
type: "list",
describe: "Enter connector type",
choices: ["BI", "SQL", "ETL"],
},
auth: {
type: "checkbox",
describe: "Enter oauth type",
choices: ["basic", "api", "oauth2", "aws", "gcp"],
},
AssetList: {
type: "input",
describe: "Enter asset names in comma separated list",
},
linear: {
type: "confirm",
describe: "Create linear task with subtask for package?",
},
};

yargs
.command({
command: "install <package>",
Expand Down Expand Up @@ -138,17 +168,41 @@ yargs
command: "init [package_name]",
desc: "Initializes an Argo package inside the current working directory",
builder: (yargs) =>
yargs.option("force", {
alias: "f",
type: "boolean",
description: "Force the command",
default: true,
}),
yargs
.option("force", {
alias: "f",
type: "boolean",
description: "Force the command",
default: true,
})
.option("connector", {
alias: "connect",
type: "boolean",
description: "want to add connector the command",
default: false,
}),
handler: (argv) => {
init(argv.force, argv.package_name).then((packageName) => {
const re = new RegExp("NAME", "g");
console.log(initHelp.replace(re, packageName));
});
if (argv.connector) {
yargsInteractive()
.usage("$0 <command> [args]")
.interactive(options)
.then((result) => {
connectorInit(
argv.force,
result.name,
result.type,
result.auth,
result.AssetList,
result.scripts,
result.linear
);
});
} else {
init(argv.force, argv.package_name).then((packageName) => {
const re = new RegExp("NAME", "g");
console.log(initHelp.replace(re, packageName));
});
}
},
})
.command({
Expand Down
Empty file added lib/connectors/BI/README.md
Empty file.
153 changes: 153 additions & 0 deletions lib/connectors/BI/configmaps/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: atlan-NAME
data:
NAME-api: "10"
config: |
{
"properties": {
"connection": {
"type": "string",
"required": false,
"ui": {
"widget": "connection",
"label": "",
"placeholder": "Connection Name",
"connectionOptions": false
}
},
"publish-mode": {
"type": "string",
"enum": ["production", "test", "dev"],
"default": "production",
"enumNames": ["Production", "Test", "Development"],
"ui": {
"widget": "select",
"label": "Run Mode",
"grid": 4,
"placeholder": "Connection Mode"
}
},
"credentials-fetch-strategy": {
"type": "string",
"enum": ["k8s_secret", "credential_guid"],
"default": "credential_guid",
"enumNames": ["k8s Secret Key", "Credential Guid"],
"ui": {
"widget": "select",
"label": "Credential Type",
"placeholder": "Credential Type"
}
},
"credential-guid": {
"type": "string",
"ui": {
"widget": "credential",
"label": "",
"credentialType": "atlan-connectors-NAME",
"placeholder": "Credential Guid",
"hidden": false
}
},
"credential-kube-secret-name": {
"type": "string",
"ui": {
"label": "Credential Secret Name",
"placeholder": "Credential Secret Name",
"hidden": true
}
},
"atlas-auth-type": {
"type": "string",
"enum": ["internal", "apikey"],
"default": "internal",
"enumNames": ["Internal", "API Key"],
"ui": {
"widget": "select",
"label": "Atlas Authentication Type",
"placeholder": "Atlas Authentication Type",
"hidden": true
}
},
"runtime-properties": {
"type": "object",
"ui": {
"label": "Run time properties",
"hidden": true
}
},
"include-filter": {
"type": "object",
"additionalProperties": {
"type": "array"
},
"default": "{}",
"ui": {
"widget": "apitree",
"connectorConfigName": "atlan-connectors-NAME",
"credential": "credential-guid",
"label": "Include Metadata",
"description": "Selected assets only will be processed. Exclude gets preference over include.",
"grid": 4
}
},
"exclude-filter": {
"type": "object",
"additionalProperties": {
"type": "array"
},
"default": "{}",
"ui": {
"widget": "apitree",
"connectorConfigName": "atlan-connectors-NAME",
"credential": "credential-guid",
"label": "Exclude Metadata",
"description": "Selected assets will not be processed.",
"grid": 4
}
}
},
"anyOf": [
{
"properties": {
"credentials-fetch-strategy": {
"const": "k8s_secret"
}
},
"required": ["credential-kube-secret-name"]
},
{
"properties": {
"credentials-fetch-strategy": {
"const": "credential_guid"
}
},
"required": ["credential-guid"]
}
],
"steps": [
{
"id": "credential",
"title": "Credential",
"description": "Credential Details",
"properties": [
"credential-guid"
]
},
{
"id": "connection",
"title": "Connection",
"description": "Connection Details",
"properties": [
"connection"
]
},
{
"id": "metadata",
"title": "Metadata",
"description": "Metadata",
"properties": ["include-filter", "exclude-filter"]
}
]
}
4 changes: 4 additions & 0 deletions lib/connectors/BI/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function dummy() {
console.log("don't call this dummy.");
}
module.exports = dummy;
53 changes: 53 additions & 0 deletions lib/connectors/BI/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@atlan/NAME",
"version": "0.3.6",
"description": "Package to crawl NAME assets and publish to Atlan for discovery",
"keywords": [
"NAME",
"bi",
"connector",
"crawler"
],
"main": "index.js",
"scripts": {},
"author": {
"name": "Atlan",
"email": "hello@atlan.com",
"url": "https://atlan.com"
},
"repository": {
"type": "git",
"url": "https://github.com/atlanhq/marketplace-packages.git"
},
"license": "MIT",
"dependencies": {
"@atlan/crawler": "^2.1.5",
"@atlan/sql-parser": "^0.3.16",
"rest-api": "^0.8.5",
"utils": "^0.2.4"
},
"bugs": {
"url": "https://atlan.com",
"email": "support@atlan.com"
},
"config": {
"labels": {
"orchestration.atlan.com/verified": "true",
"orchestration.atlan.com/type": "connector",
"orchestration.atlan.com/source": "NAME",
"orchestration.atlan.com/sourceCategory": "bi",
"orchestration.atlan.com/certified": "true"
},
"annotations": {
"orchestration.atlan.com/name": "NAME Assets",
"orchestration.atlan.com/allowSchedule": "true",
"orchestration.atlan.com/dependentPackage": "",
"orchestration.atlan.com/emoji": "🚀",
"orchestration.atlan.com/categories": "NAME,crawler",
"orchestration.atlan.com/icon": "http://assets.atlan.com/assets/NAME.svg",
"orchestration.atlan.com/marketplaceLink": "https://packages.atlan.com/-/web/detail/@atlan/NAME",
"orchestration.atlan.com/logo": "http://assets.atlan.com/assets/NAME.svg",
"orchestration.atlan.com/docsUrl": ""
}
}
}
Loading