qalita 2.9.2__py3-none-any.whl → 2.10.1__py3-none-any.whl
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.
- qalita/_frontend/.next/BUILD_ID +1 -1
- qalita/_frontend/.next/build-manifest.json +2 -2
- qalita/_frontend/.next/prerender-manifest.json +3 -3
- qalita/_frontend/.next/server/app/_global-error.html +2 -2
- qalita/_frontend/.next/server/app/_global-error.rsc +1 -1
- qalita/_frontend/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- qalita/_frontend/.next/server/app/_not-found.html +1 -1
- qalita/_frontend/.next/server/app/_not-found.rsc +2 -2
- qalita/_frontend/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/page_client-reference-manifest.js +1 -1
- qalita/_frontend/.next/server/app/sources/add/page_client-reference-manifest.js +1 -1
- qalita/_frontend/.next/server/app/sources/add.html +1 -1
- qalita/_frontend/.next/server/app/sources/add.rsc +3 -3
- qalita/_frontend/.next/server/app/sources/add.segments/_full.segment.rsc +3 -3
- qalita/_frontend/.next/server/app/sources/add.segments/_head.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/sources/add.segments/_index.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/sources/add.segments/_tree.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/sources/add.segments/sources/add/__PAGE__.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/sources/add.segments/sources/add.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/sources/add.segments/sources.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/sources/edit/[id]/page_client-reference-manifest.js +1 -1
- qalita/_frontend/.next/server/app/sources/page_client-reference-manifest.js +1 -1
- qalita/_frontend/.next/server/app/sources.html +1 -1
- qalita/_frontend/.next/server/app/sources.rsc +3 -3
- qalita/_frontend/.next/server/app/sources.segments/_full.segment.rsc +3 -3
- qalita/_frontend/.next/server/app/sources.segments/_head.segment.rsc +1 -1
- qalita/_frontend/.next/server/app/sources.segments/_index.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/sources.segments/_tree.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/sources.segments/sources/__PAGE__.segment.rsc +2 -2
- qalita/_frontend/.next/server/app/sources.segments/sources.segment.rsc +1 -1
- qalita/_frontend/.next/server/chunks/ssr/[root-of-the-server]__be91267c._.js +1 -1
- qalita/_frontend/.next/server/chunks/ssr/_cb7b44d6._.js +1 -1
- qalita/_frontend/.next/server/chunks/ssr/_d44c43ed._.js +1 -1
- qalita/_frontend/.next/server/chunks/ssr/components_DashboardContent_tsx_c3635665._.js +1 -1
- qalita/_frontend/.next/server/pages/404.html +1 -1
- qalita/_frontend/.next/server/pages/500.html +2 -2
- qalita/_frontend/.next/server/server-reference-manifest.js +1 -1
- qalita/_frontend/.next/server/server-reference-manifest.json +1 -1
- qalita/_frontend/.next/static/chunks/1e6a98e93c470083.css +1 -0
- qalita/_frontend/.next/static/chunks/499b7099996cc9f9.js +1 -0
- qalita/_frontend/.next/static/chunks/89c689b5748e28ed.js +1 -0
- qalita/_frontend/.next/static/chunks/ba22289f779d638e.js +1 -0
- qalita/_frontend/.next/static/chunks/dde1c328f398837e.js +1 -0
- qalita/_frontend/.next/static/chunks/facd124df217e016.js +1 -0
- qalita/commands/source.py +166 -2
- qalita/commands/worker.py +3 -3
- qalita/commands/worker_grpc.py +3 -3
- qalita/grpc/client.py +227 -32
- qalita/internal/action_executor.py +124 -11
- qalita/internal/config.py +7 -0
- qalita/internal/utils.py +1 -1
- {qalita-2.9.2.dist-info → qalita-2.10.1.dist-info}/METADATA +2 -1
- {qalita-2.9.2.dist-info → qalita-2.10.1.dist-info}/RECORD +69 -68
- qalita/_frontend/.next/static/chunks/02a64570f0a14789.js +0 -1
- qalita/_frontend/.next/static/chunks/27b3ba70c7ef50a8.js +0 -1
- qalita/_frontend/.next/static/chunks/517e9b74d1a3c0ce.js +0 -1
- qalita/_frontend/.next/static/chunks/6c99da4248e4fcfc.js +0 -1
- qalita/_frontend/.next/static/chunks/e4c3a252774ab7fd.css +0 -1
- /qalita/_frontend/.next/static/{SlJmHVnRND1B7HlzvPJuC → ymL1t781xjzJd1EX5euFe}/_buildManifest.js +0 -0
- /qalita/_frontend/.next/static/{SlJmHVnRND1B7HlzvPJuC → ymL1t781xjzJd1EX5euFe}/_clientMiddlewareManifest.json +0 -0
- /qalita/_frontend/.next/static/{SlJmHVnRND1B7HlzvPJuC → ymL1t781xjzJd1EX5euFe}/_ssgManifest.js +0 -0
- {qalita-2.9.2.dist-info → qalita-2.10.1.dist-info}/WHEEL +0 -0
- {qalita-2.9.2.dist-info → qalita-2.10.1.dist-info}/entry_points.txt +0 -0
- {qalita-2.9.2.dist-info → qalita-2.10.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,l,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},54842,e=>{"use strict";var l=e.i(43476),a=e.i(22016),s=e.i(57688);function n(){return(0,l.jsxs)(l.Fragment,{children:[[{name:"Flat files",items:[{value:"csv",label:"CSV",icon:"csv.svg",implemented:!0},{value:"json",label:"JSON",icon:"json.png",implemented:!0},{value:"parquet",label:"Parquet",icon:"parquet.svg",implemented:!0},{value:"excel",label:"Excel",icon:"excel.svg",implemented:!0},{value:"file",label:"File",icon:"file.svg",implemented:!0}]},{name:"Relational databases",items:[{value:"clickhouse",label:"ClickHouse",icon:"clickhouse.png",implemented:!0},{value:"cockroachdb",label:"CockroachDB",icon:"cockroach-db.png",implemented:!0},{value:"duckdb",label:"DuckDB",icon:"duckdb.png",implemented:!0},{value:"mariadb",label:"MariaDB",icon:"maria-db.png",implemented:!0},{value:"mssql",label:"Microsoft SQL Server",icon:"mssql.svg",implemented:!0},{value:"mysql",label:"MySQL",icon:"mysql.svg",implemented:!0},{value:"oracle",label:"Oracle",icon:"oracle.svg",implemented:!0},{value:"postgresql",label:"PostgreSQL",icon:"postgresql.svg",implemented:!0},{value:"singlestoredb",label:"SingleStoreDB",icon:"single-store.png",implemented:!0},{value:"sqlite",label:"SQLite",icon:"sqlite.svg",implemented:!0},{value:"yugabytedb",label:"YugabyteDB",icon:"yugabyte-db.png",implemented:!0},{value:"ibm_db2",label:"IBM Db2",icon:"ibm-db2.png",implemented:!0},{value:"sap_hana",label:"SAP HANA",icon:"sap-hana.png",implemented:!0},{value:"teradata",label:"Teradata",icon:"teradata.png",implemented:!0}]},{name:"NoSQL databases",items:[{value:"mongodb",label:"MongoDB",icon:"mongodb.svg",implemented:!0},{value:"cassandra",label:"Cassandra",icon:"cassandra.svg",implemented:!0},{value:"elasticsearch",label:"Elasticsearch",icon:"elasticsearch.svg",implemented:!0}]},{name:"Data storages",items:[{value:"folder",label:"Folder",icon:"folder.svg",implemented:!0},{value:"s3",label:"Amazon S3",icon:"s3.svg",implemented:!0},{value:"azure_blob",label:"Azure Blob Storage",icon:"azure_blob.svg",implemented:!0},{value:"gcs",label:"Google Cloud Storage",icon:"gcs.png",implemented:!0},{value:"hdfs",label:"HDFS",icon:"hdfs.svg",implemented:!0}]},{name:"Cloud databases",items:[{value:"alloydb",label:"AlloyDB for PostgreSQL",icon:"alloy-db.png",implemented:!0},{value:"aurora_mysql",label:"Amazon Aurora (MySQL)",icon:"amazon-rds.png",implemented:!0},{value:"aurora_postgresql",label:"Amazon Aurora (PostgreSQL)",icon:"amazon-rds.png",implemented:!0},{value:"rds_mysql",label:"Amazon RDS for MySQL",icon:"amazon-rds.png",implemented:!0},{value:"rds_postgresql",label:"Amazon RDS for PostgreSQL",icon:"amazon-rds.png",implemented:!0},{value:"rds_sqlserver",label:"Amazon RDS for SQL Server",icon:"amazon-rds.png",implemented:!0},{value:"azure_mysql",label:"Azure Database for MySQL",icon:"azure-database-mysql.png",implemented:!0},{value:"azure_postgresql",label:"Azure Database for PostgreSQL",icon:"azure-database-postgresql.png",implemented:!0},{value:"azure_sql_database",label:"Azure SQL Database",icon:"azure-sql-database.png",implemented:!0},{value:"azure_sql_managed_instance",label:"Azure SQL Managed Instance",icon:"azure-sql-managed-instance.png",implemented:!0},{value:"cloudsql_mysql",label:"Cloud SQL for MySQL",icon:"cloud-sql.png",implemented:!0},{value:"cloudsql_postgresql",label:"Cloud SQL for PostgreSQL",icon:"cloud-sql.png",implemented:!0},{value:"cloudsql_sqlserver",label:"Cloud SQL for SQL Server",icon:"cloud-sql.png",implemented:!0}]},{name:"SaaS databases",items:[{value:"databricks",label:"Databricks",icon:"databricks.png",implemented:!0},{value:"snowflake",label:"Snowflake",icon:"snowflake.png",implemented:!0},{value:"starburst",label:"Starburst",icon:"starburst.png",implemented:!0},{value:"trino",label:"Trino",icon:"starburst.png",implemented:!0}]},{name:"Data warehouses",items:[{value:"redshift",label:"Amazon Redshift",icon:"redshift.png",implemented:!0},{value:"bigquery",label:"Google BigQuery",icon:"bigquery.png",implemented:!0},{value:"athena",label:"Amazon Athena",icon:"amazon-athena.png",implemented:!0},{value:"synapse",label:"Azure Synapse Analytics",icon:"azure-synapse-analytics.png",implemented:!0}]},{name:"Time series databases",items:[{value:"questdb",label:"QuestDB",icon:"questdb.png",implemented:!0},{value:"timescale",label:"Timescale",icon:"timescale.png",implemented:!0}]}].map(e=>(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("h2",{className:"m-0 mb-2",children:e.name}),(0,l.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-4",children:e.items.map(e=>e.implemented?(0,l.jsxs)(a.default,{href:`/sources/add?type=${e.value}`,className:"btn light flex flex-col items-center justify-start gap-2.5 p-4 min-h-[120px] overflow-hidden",children:[(0,l.jsx)(s.default,{src:`/sources-logos/${e.icon}`,alt:e.label,width:40,height:40,className:"w-10 h-10 object-contain rounded-md flex-shrink-0",onError:e=>{e.target.src="/sources-logos/file.svg"}}),(0,l.jsx)("span",{className:"font-semibold text-center text-sm leading-tight w-full overflow-hidden",style:{wordBreak:"break-word"},children:e.label})]},e.value):(0,l.jsxs)("div",{className:"btn light bg-gray-100 flex flex-col items-center justify-start gap-2.5 p-4 opacity-50 cursor-not-allowed min-h-[120px] overflow-hidden",children:[(0,l.jsx)(s.default,{src:`/sources-logos/${e.icon}`,alt:`${e.label} (coming soon)`,title:"Not yet implemented",width:40,height:40,className:"w-10 h-10 object-contain rounded-md flex-shrink-0",onError:e=>{e.target.src="/sources-logos/file.svg"}}),(0,l.jsx)("span",{className:"font-semibold text-center text-sm leading-tight w-full overflow-hidden",style:{wordBreak:"break-word"},children:e.label})]},e.value))})]},e.name)),(0,l.jsxs)("div",{className:"actions mt-4",children:[(0,l.jsx)("a",{className:"btn",href:"mailto:contact@qalita.io?subject=Suggest%20a%20new%20source%20type&body=Hi%20QALITA%20team%2C%0A%0AI%27d%20like%20to%20suggest%20support%20for%20this%20source%20type%3A%20%5Bplease%20describe%5D%0A%0AThanks!",children:"Suggest a new source type"}),(0,l.jsx)(a.default,{className:"btn secondary",href:"/",children:"Cancel"})]})]})}e.s(["default",()=>n])},4849,e=>{"use strict";var l=e.i(43476),a=e.i(71645),s=e.i(18566),n=e.i(62319),t=e.i(56691),i=e.i(84198),o=e.i(54842);function r(){let e=(0,s.useSearchParams)(),a=(0,s.useRouter)(),n=e.get("type")||"";return(0,l.jsx)("div",{className:"card",children:n?(0,l.jsx)(i.default,{source:null,preselectedType:n,onSuccess:()=>a.push("/")}):(0,l.jsx)(o.default,{})})}function m(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.default,{}),(0,l.jsxs)("div",{className:"container-form",children:[(0,l.jsx)("h1",{children:"Add source"}),(0,l.jsx)(a.Suspense,{fallback:(0,l.jsx)("div",{className:"card",children:"Loading..."}),children:(0,l.jsx)(r,{})})]}),(0,l.jsx)(t.default,{})]})}e.s(["default",()=>m])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,s,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return c}});let c=e=>{}},28592,e=>{"use strict";var s=e.i(43476),t=e.i(18566),c=e.i(71645),r=e.i(62319),n=e.i(56691),a=e.i(84198);function i(){let e=(0,t.useParams)(),i=(0,t.useRouter)(),l=e.id,[d,o]=(0,c.useState)(null),[u,f]=(0,c.useState)(!0);return((0,c.useEffect)(()=>{async function e(){try{let e=encodeURIComponent(l),s=await fetch(`/api/sources/${e}`);if(s.ok){let e=await s.json();o(e)}}catch{}finally{f(!1)}}l&&e()},[l]),u)?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.default,{}),(0,s.jsx)("div",{className:"container-form",children:(0,s.jsx)("div",{className:"card",children:"Loading..."})}),(0,s.jsx)(n.default,{})]}):d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.default,{}),(0,s.jsxs)("div",{className:"container-form",children:[(0,s.jsx)("h1",{children:"Edit source"}),(0,s.jsx)("div",{className:"card",children:(0,s.jsx)(a.default,{source:d,preselectedType:"",onSuccess:()=>i.push("/")})})]}),(0,s.jsx)(n.default,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.default,{}),(0,s.jsx)("div",{className:"container-form",children:(0,s.jsxs)("div",{className:"card",children:[(0,s.jsx)("h2",{children:"Source not found"}),(0,s.jsxs)("p",{children:["Source ID: ",l]}),(0,s.jsx)("p",{children:"Check the browser console for debug information."})]})}),(0,s.jsx)(n.default,{})]})}e.s(["default",()=>i])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(e,a,s)=>{a.exports=e.r(76562)},84198,e=>{"use strict";var a=e.i(43476),s=e.i(71645),t=e.i(18566),n=e.i(57688);let r=["file","csv","json","parquet","excel","folder","postgresql","mysql","oracle","mssql","sqlite","clickhouse","duckdb","mariadb","cockroachdb","yugabytedb","singlestoredb","ibm_db2","sap_hana","teradata","mongodb","cassandra","elasticsearch","s3","gcs","azure_blob","hdfs","snowflake","bigquery","databricks","redshift","trino","starburst","athena","synapse","alloydb","aurora_mysql","aurora_postgresql","rds_mysql","rds_postgresql","rds_sqlserver","azure_mysql","azure_postgresql","azure_sql_database","azure_sql_managed_instance","cloudsql_mysql","cloudsql_postgresql","cloudsql_sqlserver","questdb","timescale"],l={mariadb:"mysql",cockroachdb:"postgresql",yugabytedb:"postgresql",singlestoredb:"mysql",starburst:"trino",alloydb:"postgresql",aurora_mysql:"mysql",aurora_postgresql:"postgresql",rds_mysql:"mysql",rds_postgresql:"postgresql",rds_sqlserver:"mssql",azure_mysql:"mysql",azure_postgresql:"postgresql",azure_sql_database:"mssql",azure_sql_managed_instance:"mssql",cloudsql_mysql:"mysql",cloudsql_postgresql:"postgresql",cloudsql_sqlserver:"mssql",questdb:"postgresql",timescale:"postgresql"},o={file:"file.svg",csv:"csv.svg",json:"json.png",parquet:"parquet.svg",excel:"excel.svg",folder:"folder.svg",postgresql:"postgresql.svg",mysql:"mysql.svg",oracle:"oracle.svg",mssql:"mssql.svg",sqlite:"sqlite.svg",clickhouse:"clickhouse.png",duckdb:"duckdb.png",mariadb:"maria-db.png",cockroachdb:"cockroach-db.png",yugabytedb:"yugabyte-db.png",singlestoredb:"single-store.png",ibm_db2:"ibm-db2.png",sap_hana:"sap-hana.png",teradata:"teradata.png",mongodb:"mongodb.svg",cassandra:"cassandra.svg",elasticsearch:"elasticsearch.svg",s3:"s3.svg",gcs:"gcs.png",azure_blob:"azure_blob.svg",hdfs:"hdfs.svg",snowflake:"snowflake.png",bigquery:"bigquery.png",databricks:"databricks.png",redshift:"redshift.png",trino:"starburst.png",starburst:"starburst.png",athena:"amazon-athena.png",synapse:"azure-synapse-analytics.png",alloydb:"alloy-db.png",aurora_mysql:"amazon-rds.png",aurora_postgresql:"amazon-rds.png",rds_mysql:"amazon-rds.png",rds_postgresql:"amazon-rds.png",rds_sqlserver:"amazon-rds.png",azure_mysql:"azure-database-mysql.png",azure_postgresql:"azure-database-postgresql.png",azure_sql_database:"azure-sql-database.png",azure_sql_managed_instance:"azure-sql-managed-instance.png",cloudsql_mysql:"cloud-sql.png",cloudsql_postgresql:"cloud-sql.png",cloudsql_sqlserver:"cloud-sql.png",questdb:"questdb.png",timescale:"timescale.png"};function i(e,a){let s={name:e?.name||"",type:e?.type||a||"file",description:e?.description||"",visibility:e?.visibility||"private",reference:e?.config?.reference||!1,sensitive:e?.config?.sensitive||!1};if(!e?.config)return s;let t=e.config,n=e.type||a||"file",r={...s};return"file"===n&&t.path?r.file_path=t.path:"csv"===n&&t.path?(r.csv_path=t.path,r.csv_delimiter=t.delimiter||",",r.csv_encoding=t.encoding||"utf-8",r.csv_header=t.has_header||!1):"json"===n&&t.path?r.json_path=t.path:"parquet"===n&&t.path?r.parquet_path=t.path:"excel"===n&&t.path?(r.excel_path=t.path,r.excel_sheet=t.sheet||"",r.excel_header_row=t.header_row||"1"):"sqlite"===n&&t.file_path?r.sqlite_file_path=t.file_path:"folder"===n&&t.path&&(r.folder_path=t.path),["postgresql","mysql","oracle","mssql"].includes(n)&&(t.host&&(r.db_host=t.host),t.port&&(r.db_port=t.port),t.username&&(r.db_username=t.username),t.password&&(r.db_password=t.password),t.database&&(r.db_database=t.database),t.table_or_query&&(r.db_table_or_query=t.table_or_query),("postgresql"===n||"oracle"===n)&&t.schema&&(r.db_schema=t.schema)),"mongodb"===n&&(t.host&&(r.mongo_host=t.host),t.port&&(r.mongo_port=t.port),t.username&&(r.mongo_username=t.username),t.password&&(r.mongo_password=t.password),t.database&&(r.mongo_database=t.database)),"s3"===n&&(t.bucket&&(r.s3_bucket=t.bucket),t.prefix&&(r.s3_prefix=t.prefix),t.access_key&&(r.s3_access_key=t.access_key),t.secret_key&&(r.s3_secret_key=t.secret_key),t.region&&(r.s3_region=t.region)),"gcs"===n&&(t.bucket&&(r.gcs_bucket=t.bucket),t.prefix&&(r.gcs_prefix=t.prefix),t.credentials&&(r.gcs_credentials=t.credentials)),"azure_blob"===n&&(t.container&&(r.azure_blob_container=t.container),t.prefix&&(r.azure_blob_prefix=t.prefix),t.account_name&&(r.azure_blob_account_name=t.account_name),t.connection_string&&(r.azure_blob_connection_string=t.connection_string)),"hdfs"===n&&(t.path&&(r.hdfs_path=t.path),t.namenode&&(r.hdfs_namenode=t.namenode)),"snowflake"===n&&(t.account&&(r.snowflake_account=t.account),(t.user||t.username)&&(r.snowflake_user=t.user||t.username),t.password&&(r.snowflake_password=t.password),t.database&&(r.snowflake_database=t.database),t.schema&&(r.snowflake_schema=t.schema),t.warehouse&&(r.snowflake_warehouse=t.warehouse),t.role&&(r.snowflake_role=t.role),t.table_or_query&&(r.snowflake_table_or_query=t.table_or_query)),"bigquery"===n&&(t.project&&(r.bigquery_project=t.project),t.dataset&&(r.bigquery_dataset=t.dataset),(t.credentials_json||t.credentials)&&(r.bigquery_credentials=t.credentials_json||t.credentials),t.table_or_query&&(r.bigquery_table_or_query=t.table_or_query)),"databricks"===n&&((t.server_hostname||t.host)&&(r.databricks_host=t.server_hostname||t.host),t.http_path&&(r.databricks_http_path=t.http_path),(t.access_token||t.token)&&(r.databricks_token=t.access_token||t.token),t.catalog&&(r.databricks_catalog=t.catalog),t.schema&&(r.databricks_schema=t.schema),t.table_or_query&&(r.databricks_table_or_query=t.table_or_query)),"redshift"===n&&(t.host&&(r.redshift_host=t.host),t.port&&(r.redshift_port=t.port),(t.user||t.username)&&(r.redshift_user=t.user||t.username),t.password&&(r.redshift_password=t.password),t.database&&(r.redshift_database=t.database),t.schema&&(r.redshift_schema=t.schema),t.table_or_query&&(r.redshift_table_or_query=t.table_or_query)),"clickhouse"===n&&(t.host&&(r.clickhouse_host=t.host),t.port&&(r.clickhouse_port=t.port),(t.user||t.username)&&(r.clickhouse_user=t.user||t.username),t.password&&(r.clickhouse_password=t.password),t.database&&(r.clickhouse_database=t.database),t.protocol&&(r.clickhouse_protocol=t.protocol),t.table_or_query&&(r.clickhouse_table_or_query=t.table_or_query)),"duckdb"===n&&((t.path||t.database)&&(r.duckdb_path=t.path||t.database),(t.motherduck_token||t.token)&&(r.duckdb_token=t.motherduck_token||t.token),t.schema&&(r.duckdb_schema=t.schema),t.table_or_query&&(r.duckdb_table_or_query=t.table_or_query)),"trino"===n&&(t.host&&(r.trino_host=t.host),t.port&&(r.trino_port=t.port),(t.user||t.username)&&(r.trino_user=t.user||t.username),t.catalog&&(r.trino_catalog=t.catalog),t.schema&&(r.trino_schema=t.schema),t.http_scheme&&(r.trino_http_scheme=t.http_scheme),t.table_or_query&&(r.trino_table_or_query=t.table_or_query)),"teradata"===n&&(t.host&&(r.teradata_host=t.host),(t.user||t.username)&&(r.teradata_user=t.user||t.username),t.password&&(r.teradata_password=t.password),t.database&&(r.teradata_database=t.database),t.schema&&(r.teradata_schema=t.schema),t.table_or_query&&(r.teradata_table_or_query=t.table_or_query)),"sap_hana"===n&&(t.host&&(r.sap_hana_host=t.host),t.port&&(r.sap_hana_port=t.port),(t.user||t.username)&&(r.sap_hana_user=t.user||t.username),t.password&&(r.sap_hana_password=t.password),t.schema&&(r.sap_hana_schema=t.schema),t.table_or_query&&(r.sap_hana_table_or_query=t.table_or_query)),"ibm_db2"===n&&(t.host&&(r.ibm_db2_host=t.host),t.port&&(r.ibm_db2_port=t.port),(t.user||t.username)&&(r.ibm_db2_user=t.user||t.username),t.password&&(r.ibm_db2_password=t.password),t.database&&(r.ibm_db2_database=t.database),t.schema&&(r.ibm_db2_schema=t.schema),t.table_or_query&&(r.ibm_db2_table_or_query=t.table_or_query)),"cassandra"===n&&(t.host&&(r.cassandra_host=t.host),t.port&&(r.cassandra_port=t.port),t.username&&(r.cassandra_username=t.username),t.password&&(r.cassandra_password=t.password),t.keyspace&&(r.cassandra_keyspace=t.keyspace),t.table_or_query&&(r.cassandra_table_or_query=t.table_or_query)),"elasticsearch"===n&&(t.host&&(r.elasticsearch_host=t.host),t.port&&(r.elasticsearch_port=t.port),t.username&&(r.elasticsearch_username=t.username),t.password&&(r.elasticsearch_password=t.password),void 0!==t.use_ssl&&(r.elasticsearch_use_ssl=t.use_ssl),t.cloud_id&&(r.elasticsearch_cloud_id=t.cloud_id),t.api_key&&(r.elasticsearch_api_key=t.api_key),t.table_or_query&&(r.elasticsearch_table_or_query=t.table_or_query)),"athena"===n&&(t.region&&(r.athena_region=t.region),t.database&&(r.athena_database=t.database),t.s3_staging_dir&&(r.athena_s3_staging_dir=t.s3_staging_dir),t.workgroup&&(r.athena_workgroup=t.workgroup),t.access_key&&(r.athena_access_key=t.access_key),t.secret_key&&(r.athena_secret_key=t.secret_key),t.table_or_query&&(r.athena_table_or_query=t.table_or_query)),"synapse"===n&&(t.host&&(r.synapse_host=t.host),t.port&&(r.synapse_port=t.port),(t.user||t.username)&&(r.synapse_user=t.user||t.username),t.password&&(r.synapse_password=t.password),t.database&&(r.synapse_database=t.database),t.schema&&(r.synapse_schema=t.schema),t.table_or_query&&(r.synapse_table_or_query=t.table_or_query)),r}function d({source:e,preselectedType:d,onSuccess:c}){let h=(0,t.useRouter)(),[p,_]=(0,s.useState)(()=>i(e,d)),[u,x]=(0,s.useState)(null),[b,m]=(0,s.useState)(!1),[j,g]=(0,s.useState)(null);(0,s.useEffect)(()=>{e&&_(i(e,d))},[e,d]);let y=e=>{let{name:a,value:s,type:t}=e.target;if("checkbox"===t){let s=e.target.checked;_(e=>({...e,[a]:s}))}else _(e=>({...e,[a]:s}))},v=async()=>{try{let e=await fetch("/api/sources/pick-file"),a=await e.json();if(a.path){let e="csv"===p.type?"csv_path":"excel"===p.type?"excel_path":"sqlite"===p.type?"sqlite_file_path":"file_path";_(s=>({...s,[e]:a.path}))}}catch{}},q=async()=>{try{let e=await fetch("/api/sources/pick-folder"),a=await e.json();a.path&&_(e=>({...e,folder_path:a.path}))}catch{}},k=async()=>{m(!0),g(null);try{let a,s=new FormData;Object.entries(p).forEach(([e,a])=>{null!=a&&s.append(e,String(a))}),e&&s.append("original_name",e.name);let t=await fetch("/api/sources/validate",{method:"POST",body:s}),n=await t.text();try{a=JSON.parse(n)}catch(e){g({message:`Validation failed: ${t.status} ${t.statusText}. ${n.substring(0,100)}`,ok:!1});return}g({message:a.message||(a.ok?"Valid.":"Invalid."),ok:a.ok||!1})}catch(e){g({message:`Validation failed due to a network error: ${e instanceof Error?e.message:String(e)}`,ok:!1})}finally{m(!1)}},f=async a=>{a.preventDefault(),x(null);try{let a=new FormData;Object.entries(p).forEach(([e,s])=>{null!=s&&("boolean"==typeof s?s&&a.append(e,"on"):a.append(e,String(s)))}),e&&a.append("original_name",e.name);let s=e&&e.name?`/api/sources/edit/${encodeURIComponent(e.name)}`:"/api/sources/add",t=await fetch(s,{method:"POST",body:a});if(t.ok)c();else{let e=await t.text();try{let a=JSON.parse(e);x(a.error||a.message||"Failed to save source")}catch{x("Failed to save source")}}}catch(e){x("Failed to save source")}},w=p.type,C=l[w]||w,N=o[w]||"folder.svg";return(0,a.jsxs)("form",{onSubmit:f,children:[u&&(0,a.jsx)("div",{className:"alert alert-error mb-3",children:u}),j&&(0,a.jsx)("div",{className:`alert ${j.ok?"alert-info":"alert-error"} mb-3`,children:j.message}),(0,a.jsxs)("label",{className:"mt-0",children:["Name",(0,a.jsx)("input",{type:"text",name:"name",value:p.name,onChange:y,required:!0})]}),(0,a.jsxs)("label",{children:["Description",(0,a.jsx)("input",{type:"text",name:"description",value:p.description,onChange:y})]}),(0,a.jsxs)("label",{children:["Type",(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.default,{src:`/sources-logos/${N}`,alt:w,width:24,height:24,className:"w-6 h-6"}),(0,a.jsx)("select",{name:"type",value:p.type,onChange:y,required:!0,children:r.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]})]}),["file","csv","json","parquet","excel","sqlite"].includes(w)&&(0,a.jsxs)("label",{children:["csv"===w?"CSV file path":"json"===w?"JSON file path":"parquet"===w?"Parquet file path":"excel"===w?"Excel file path":"sqlite"===w?"SQLite file path":"File path",(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-end",children:[(0,a.jsx)("input",{type:"text",name:"csv"===w?"csv_path":"json"===w?"json_path":"parquet"===w?"parquet_path":"excel"===w?"excel_path":"sqlite"===w?"sqlite_file_path":"file_path",value:p["csv"===w?"csv_path":"json"===w?"json_path":"parquet"===w?"parquet_path":"excel"===w?"excel_path":"sqlite"===w?"sqlite_file_path":"file_path"]||"",onChange:y,className:"w-full"}),(0,a.jsx)("button",{type:"button",className:"btn secondary",onClick:v,children:"Browse…"})]})]}),"csv"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Delimiter",(0,a.jsx)("input",{type:"text",name:"csv_delimiter",value:p.csv_delimiter||",",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Encoding",(0,a.jsx)("input",{type:"text",name:"csv_encoding",value:p.csv_encoding||"utf-8",onChange:y})]})})]}),(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",name:"csv_header",checked:p.csv_header||!1,onChange:y}),"Has header row"]})]}),"excel"===w&&(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Sheet name",(0,a.jsx)("input",{type:"text",name:"excel_sheet",value:p.excel_sheet||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Header row index",(0,a.jsx)("input",{type:"number",name:"excel_header_row",value:p.excel_header_row||1,onChange:y})]})})]}),"folder"===w&&(0,a.jsxs)("label",{children:["Folder path",(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-end",children:[(0,a.jsx)("input",{type:"text",name:"folder_path",value:p.folder_path||"",onChange:y}),(0,a.jsx)("button",{type:"button",className:"btn secondary",onClick:q,children:"Browse…"})]})]}),["postgresql","mysql","oracle","mssql"].includes(C)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"db_host",value:p.db_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"db_port",value:p.db_port||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Username",(0,a.jsx)("input",{type:"text",name:"db_username",value:p.db_username||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"db_password",value:p.db_password||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"db_database",value:p.db_database||"",onChange:y})]}),("postgresql"===C||"oracle"===C)&&(0,a.jsxs)("label",{children:["Schema",(0,a.jsx)("input",{type:"text",name:"db_schema",value:p.db_schema||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"db_table_or_query",value:p.db_table_or_query||"*",onChange:y})]})]}),"mongodb"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"mongo_host",value:p.mongo_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"mongo_port",value:p.mongo_port||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Username",(0,a.jsx)("input",{type:"text",name:"mongo_username",value:p.mongo_username||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"mongo_password",value:p.mongo_password||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"mongo_database",value:p.mongo_database||"",onChange:y})]})]}),"s3"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Bucket",(0,a.jsx)("input",{type:"text",name:"s3_bucket",value:p.s3_bucket||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Prefix",(0,a.jsx)("input",{type:"text",name:"s3_prefix",value:p.s3_prefix||"",onChange:y})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Access key",(0,a.jsx)("input",{type:"text",name:"s3_access_key",value:p.s3_access_key||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Secret key",(0,a.jsx)("input",{type:"password",name:"s3_secret_key",value:p.s3_secret_key||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Region",(0,a.jsx)("input",{type:"text",name:"s3_region",value:p.s3_region||"",onChange:y})]})]}),"gcs"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Bucket",(0,a.jsx)("input",{type:"text",name:"gcs_bucket",value:p.gcs_bucket||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Prefix",(0,a.jsx)("input",{type:"text",name:"gcs_prefix",value:p.gcs_prefix||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Credentials JSON path",(0,a.jsx)("input",{type:"text",name:"gcs_credentials",value:p.gcs_credentials||"",onChange:y})]})]}),"azure_blob"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Container",(0,a.jsx)("input",{type:"text",name:"azure_blob_container",value:p.azure_blob_container||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Prefix",(0,a.jsx)("input",{type:"text",name:"azure_blob_prefix",value:p.azure_blob_prefix||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Account name",(0,a.jsx)("input",{type:"text",name:"azure_blob_account_name",value:p.azure_blob_account_name||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Connection string",(0,a.jsx)("input",{type:"password",name:"azure_blob_connection_string",value:p.azure_blob_connection_string||"",onChange:y})]})]}),"hdfs"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Namenode host",(0,a.jsx)("input",{type:"text",name:"hdfs_namenode",value:p.hdfs_namenode||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"hdfs_port",value:p.hdfs_port||"",onChange:y})]}),(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"hdfs_user",value:p.hdfs_user||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Path",(0,a.jsx)("input",{type:"text",name:"hdfs_path",value:p.hdfs_path||"",onChange:y})]})]}),"snowflake"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Account",(0,a.jsx)("input",{type:"text",name:"snowflake_account",value:p.snowflake_account||"",onChange:y,placeholder:"your-account.region"})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"snowflake_user",value:p.snowflake_user||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"snowflake_password",value:p.snowflake_password||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"snowflake_database",value:p.snowflake_database||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema",(0,a.jsx)("input",{type:"text",name:"snowflake_schema",value:p.snowflake_schema||"PUBLIC",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Warehouse",(0,a.jsx)("input",{type:"text",name:"snowflake_warehouse",value:p.snowflake_warehouse||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Role (optional)",(0,a.jsx)("input",{type:"text",name:"snowflake_role",value:p.snowflake_role||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"snowflake_table_or_query",value:p.snowflake_table_or_query||"*",onChange:y})]})]}),"bigquery"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Project ID",(0,a.jsx)("input",{type:"text",name:"bigquery_project",value:p.bigquery_project||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Dataset",(0,a.jsx)("input",{type:"text",name:"bigquery_dataset",value:p.bigquery_dataset||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Credentials JSON path",(0,a.jsx)("input",{type:"text",name:"bigquery_credentials",value:p.bigquery_credentials||"",onChange:y,placeholder:"/path/to/service-account.json"})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"bigquery_table_or_query",value:p.bigquery_table_or_query||"*",onChange:y})]})]}),"databricks"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Server hostname",(0,a.jsx)("input",{type:"text",name:"databricks_host",value:p.databricks_host||"",onChange:y,placeholder:"abc-12345678-wxyz.cloud.databricks.com"})]}),(0,a.jsxs)("label",{children:["HTTP path",(0,a.jsx)("input",{type:"text",name:"databricks_http_path",value:p.databricks_http_path||"",onChange:y,placeholder:"/sql/1.0/warehouses/..."})]}),(0,a.jsxs)("label",{children:["Access token",(0,a.jsx)("input",{type:"password",name:"databricks_token",value:p.databricks_token||"",onChange:y})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Catalog (optional)",(0,a.jsx)("input",{type:"text",name:"databricks_catalog",value:p.databricks_catalog||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema (optional)",(0,a.jsx)("input",{type:"text",name:"databricks_schema",value:p.databricks_schema||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"databricks_table_or_query",value:p.databricks_table_or_query||"*",onChange:y})]})]}),"redshift"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"redshift_host",value:p.redshift_host||"",onChange:y,placeholder:"cluster.region.redshift.amazonaws.com"})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"redshift_port",value:p.redshift_port||5439,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"redshift_user",value:p.redshift_user||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"redshift_password",value:p.redshift_password||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"redshift_database",value:p.redshift_database||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema",(0,a.jsx)("input",{type:"text",name:"redshift_schema",value:p.redshift_schema||"public",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"redshift_table_or_query",value:p.redshift_table_or_query||"*",onChange:y})]})]}),"clickhouse"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"clickhouse_host",value:p.clickhouse_host||"localhost",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"clickhouse_port",value:p.clickhouse_port||8123,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"clickhouse_user",value:p.clickhouse_user||"default",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"clickhouse_password",value:p.clickhouse_password||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"clickhouse_database",value:p.clickhouse_database||"default",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Protocol",(0,a.jsxs)("select",{name:"clickhouse_protocol",value:p.clickhouse_protocol||"http",onChange:y,children:[(0,a.jsx)("option",{value:"http",children:"HTTP"}),(0,a.jsx)("option",{value:"native",children:"Native"})]})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"clickhouse_table_or_query",value:p.clickhouse_table_or_query||"*",onChange:y})]})]}),"duckdb"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{children:["Database path",(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-end",children:[(0,a.jsx)("input",{type:"text",name:"duckdb_path",value:p.duckdb_path||"",onChange:y,placeholder:"/path/to/database.duckdb or :memory:"}),(0,a.jsx)("button",{type:"button",className:"btn secondary",onClick:v,children:"Browse…"})]})]}),(0,a.jsxs)("label",{children:["MotherDuck token (optional, for cloud)",(0,a.jsx)("input",{type:"password",name:"duckdb_token",value:p.duckdb_token||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Schema",(0,a.jsx)("input",{type:"text",name:"duckdb_schema",value:p.duckdb_schema||"main",onChange:y})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"duckdb_table_or_query",value:p.duckdb_table_or_query||"*",onChange:y})]})]}),("trino"===w||"trino"===C)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"trino_host",value:p.trino_host||"localhost",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"trino_port",value:p.trino_port||8080,onChange:y})]})})]}),(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"trino_user",value:p.trino_user||"trino",onChange:y})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Catalog",(0,a.jsx)("input",{type:"text",name:"trino_catalog",value:p.trino_catalog||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema",(0,a.jsx)("input",{type:"text",name:"trino_schema",value:p.trino_schema||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["HTTP scheme",(0,a.jsxs)("select",{name:"trino_http_scheme",value:p.trino_http_scheme||"https",onChange:y,children:[(0,a.jsx)("option",{value:"https",children:"HTTPS"}),(0,a.jsx)("option",{value:"http",children:"HTTP"})]})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"trino_table_or_query",value:p.trino_table_or_query||"*",onChange:y})]})]}),"teradata"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"teradata_host",value:p.teradata_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"teradata_user",value:p.teradata_user||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"teradata_password",value:p.teradata_password||"",onChange:y})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database (optional)",(0,a.jsx)("input",{type:"text",name:"teradata_database",value:p.teradata_database||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema (optional)",(0,a.jsx)("input",{type:"text",name:"teradata_schema",value:p.teradata_schema||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"teradata_table_or_query",value:p.teradata_table_or_query||"*",onChange:y})]})]}),"sap_hana"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"sap_hana_host",value:p.sap_hana_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"sap_hana_port",value:p.sap_hana_port||30015,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"sap_hana_user",value:p.sap_hana_user||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"sap_hana_password",value:p.sap_hana_password||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Schema (optional)",(0,a.jsx)("input",{type:"text",name:"sap_hana_schema",value:p.sap_hana_schema||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"sap_hana_table_or_query",value:p.sap_hana_table_or_query||"*",onChange:y})]})]}),"ibm_db2"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"ibm_db2_host",value:p.ibm_db2_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"ibm_db2_port",value:p.ibm_db2_port||5e4,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"ibm_db2_user",value:p.ibm_db2_user||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"ibm_db2_password",value:p.ibm_db2_password||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"ibm_db2_database",value:p.ibm_db2_database||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema (optional)",(0,a.jsx)("input",{type:"text",name:"ibm_db2_schema",value:p.ibm_db2_schema||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"ibm_db2_table_or_query",value:p.ibm_db2_table_or_query||"*",onChange:y})]})]}),"cassandra"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"cassandra_host",value:p.cassandra_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"cassandra_port",value:p.cassandra_port||9042,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Username (optional)",(0,a.jsx)("input",{type:"text",name:"cassandra_username",value:p.cassandra_username||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password (optional)",(0,a.jsx)("input",{type:"password",name:"cassandra_password",value:p.cassandra_password||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Keyspace",(0,a.jsx)("input",{type:"text",name:"cassandra_keyspace",value:p.cassandra_keyspace||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"cassandra_table_or_query",value:p.cassandra_table_or_query||"*",onChange:y})]})]}),"elasticsearch"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"elasticsearch_host",value:p.elasticsearch_host||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"elasticsearch_port",value:p.elasticsearch_port||9200,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Username (optional)",(0,a.jsx)("input",{type:"text",name:"elasticsearch_username",value:p.elasticsearch_username||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password (optional)",(0,a.jsx)("input",{type:"password",name:"elasticsearch_password",value:p.elasticsearch_password||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",name:"elasticsearch_use_ssl",checked:p.elasticsearch_use_ssl||!1,onChange:y}),"Use SSL"]}),(0,a.jsxs)("label",{children:["Cloud ID (optional)",(0,a.jsx)("input",{type:"text",name:"elasticsearch_cloud_id",value:p.elasticsearch_cloud_id||"",onChange:y,placeholder:"Elastic Cloud ID"})]}),(0,a.jsxs)("label",{children:["API Key (optional)",(0,a.jsx)("input",{type:"password",name:"elasticsearch_api_key",value:p.elasticsearch_api_key||"",onChange:y})]}),(0,a.jsxs)("label",{children:["Index pattern (default '*')",(0,a.jsx)("input",{type:"text",name:"elasticsearch_table_or_query",value:p.elasticsearch_table_or_query||"*",onChange:y})]})]}),"athena"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Region",(0,a.jsx)("input",{type:"text",name:"athena_region",value:p.athena_region||"",onChange:y,placeholder:"us-east-1"})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"athena_database",value:p.athena_database||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["S3 staging directory",(0,a.jsx)("input",{type:"text",name:"athena_s3_staging_dir",value:p.athena_s3_staging_dir||"",onChange:y,placeholder:"s3://bucket/path/"})]}),(0,a.jsxs)("label",{children:["Workgroup (optional)",(0,a.jsx)("input",{type:"text",name:"athena_workgroup",value:p.athena_workgroup||"",onChange:y})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["AWS Access Key (optional)",(0,a.jsx)("input",{type:"text",name:"athena_access_key",value:p.athena_access_key||"",onChange:y,placeholder:"Uses IAM role if empty"})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["AWS Secret Key (optional)",(0,a.jsx)("input",{type:"password",name:"athena_secret_key",value:p.athena_secret_key||"",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"athena_table_or_query",value:p.athena_table_or_query||"*",onChange:y})]})]}),"synapse"===w&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Host",(0,a.jsx)("input",{type:"text",name:"synapse_host",value:p.synapse_host||"",onChange:y,placeholder:"xxx.sql.azuresynapse.net"})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Port",(0,a.jsx)("input",{type:"number",name:"synapse_port",value:p.synapse_port||1433,onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["User",(0,a.jsx)("input",{type:"text",name:"synapse_user",value:p.synapse_user||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Password",(0,a.jsx)("input",{type:"password",name:"synapse_password",value:p.synapse_password||"",onChange:y})]})})]}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Database",(0,a.jsx)("input",{type:"text",name:"synapse_database",value:p.synapse_database||"",onChange:y})]})}),(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Schema",(0,a.jsx)("input",{type:"text",name:"synapse_schema",value:p.synapse_schema||"dbo",onChange:y})]})})]}),(0,a.jsxs)("label",{children:["Tables or SQL (default '*')",(0,a.jsx)("input",{type:"text",name:"synapse_table_or_query",value:p.synapse_table_or_query||"*",onChange:y})]})]}),(0,a.jsxs)("div",{className:"row mb-3",children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{children:["Visibility",(0,a.jsxs)("select",{name:"visibility",value:p.visibility,onChange:y,children:[(0,a.jsx)("option",{value:"private",children:"Private"}),(0,a.jsx)("option",{value:"internal",children:"Internal"}),(0,a.jsx)("option",{value:"public",children:"Public"})]})]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 mt-3.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:`relative w-[46px] h-[26px] rounded-full cursor-pointer inline-block transition-colors duration-150 ${p.reference?"bg-primary-500":"bg-gray-200 dark:bg-gray-600"}`,onClick:()=>_(e=>({...e,reference:!e.reference})),children:(0,a.jsx)("div",{className:`absolute top-[3px] w-5 h-5 bg-white rounded-[35%] shadow-sm transition-all duration-150 ${p.reference?"left-[23px]":"left-[3px]"}`})}),(0,a.jsx)("span",{className:"text-gray-900 dark:text-gray-200",children:"Reference"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:`relative w-[46px] h-[26px] rounded-full cursor-pointer inline-block transition-colors duration-150 ${p.sensitive?"bg-primary-500":"bg-gray-200 dark:bg-gray-600"}`,onClick:()=>_(e=>({...e,sensitive:!e.sensitive})),children:(0,a.jsx)("div",{className:`absolute top-[3px] w-5 h-5 bg-white rounded-[35%] shadow-sm transition-all duration-150 ${p.sensitive?"left-[23px]":"left-[3px]"}`})}),(0,a.jsx)("span",{className:"text-gray-900 dark:text-gray-200",children:"Sensitive"})]})]})]}),(0,a.jsxs)("div",{className:"actions",children:[(0,a.jsx)("button",{type:"button",className:"btn secondary",onClick:k,disabled:b,children:b?"Validating...":"Validate"}),(0,a.jsx)("button",{type:"submit",className:"btn",children:"Save"}),(0,a.jsx)("button",{type:"button",className:"btn secondary",onClick:()=>h.push("/"),children:"Cancel"})]})]})}e.s(["default",()=>d])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,s,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"warnOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},10887,e=>{"use strict";var s=e.i(43476),a=e.i(71645),r=e.i(22016);function t(){return"/api"}async function n(){let e=await fetch(`${t()}/worker/status`);if(!e.ok){let s=await e.text();throw Error(`Failed to get worker status: ${e.status} - ${s.substring(0,100)}`)}let s=e.headers.get("content-type")||"";if(!s.includes("application/json")){let a=await e.text();throw Error(`Expected JSON but got ${s}: ${a.substring(0,100)}`)}return e.json()}async function l(){return(await fetch(`${t()}/worker/start`,{method:"POST"})).json()}async function i(){return(await fetch(`${t()}/worker/stop`,{method:"POST"})).json()}async function c(){await fetch(`${t()}/validate`,{method:"POST"})}async function d(){await fetch(`${t()}/push`,{method:"POST"})}async function o(e){let s=new FormData;s.append("pack_dir",e);let a=await fetch(`${t()}/pack/push`,{method:"POST",body:s});if(!a.ok){let e=await a.text();throw Error(`Failed to push pack: ${a.status} - ${e.substring(0,100)}`)}return a.json()}function h(){let[e,r]=(0,a.useState)(!1),[t,c]=(0,a.useState)(!0);(0,a.useEffect)(()=>{d();let e=setInterval(d,2e3);return()=>clearInterval(e)},[]);let d=async()=>{try{let e=await n();r(e.running||!1)}catch{}finally{c(!1)}},o=async()=>{try{e?await i():await l(),await d()}catch{}};return t?(0,s.jsx)("span",{className:"muted -mt-[13px]",children:"(loading...)"}):(0,s.jsxs)("div",{className:"flex gap-5 items-center",children:[(0,s.jsx)("div",{id:"worker_switch",className:`-mt-[11px] relative w-[46px] h-[26px] rounded-full cursor-pointer inline-block transition-colors duration-150 ${e?"bg-green-600":"bg-gray-200"}`,onClick:o,children:(0,s.jsx)("div",{id:"worker_knob",className:`absolute top-[3px] w-5 h-5 bg-white rounded-[35%] shadow-sm transition-all duration-150 ${e?"left-[23px]":"left-[3px]"}`})}),(0,s.jsxs)("span",{className:"muted -mt-[13px]",children:["(",e?"running":"stopped",")"]})]})}var u=e.i(57688);function m({isOpen:e,onClose:a,onConfirm:r,title:t,message:n,itemName:l}){return e?(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",onClick:a,children:(0,s.jsxs)("div",{className:"card min-w-[400px] max-w-[90%] bg-white dark:bg-gray-800 p-6",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("h2",{className:"mt-0 dark:text-white",children:t}),(0,s.jsx)("p",{className:"dark:text-gray-300",children:n}),l&&(0,s.jsx)("p",{className:"font-bold text-danger",children:l}),(0,s.jsxs)("div",{className:"actions mt-5 justify-end",children:[(0,s.jsx)("button",{className:"btn secondary",onClick:a,type:"button",children:"Cancel"}),(0,s.jsx)("button",{className:"btn danger",onClick:r,type:"button",children:"Delete"})]})]})}):null}let p={file:"file.svg",csv:"csv.svg",json:"json.png",parquet:"parquet.svg",excel:"excel.svg",folder:"folder.svg",postgresql:"postgresql.svg",mysql:"mysql.svg",oracle:"oracle.svg",mssql:"mssql.svg",sqlite:"sqlite.svg",clickhouse:"clickhouse.png",duckdb:"duckdb.png",mariadb:"maria-db.png",cockroachdb:"cockroach-db.png",yugabytedb:"yugabyte-db.png",singlestoredb:"single-store.png",ibm_db2:"ibm-db2.png",sap_hana:"sap-hana.png",teradata:"teradata.png",mongodb:"mongodb.svg",cassandra:"cassandra.svg",elasticsearch:"elasticsearch.svg",s3:"s3.svg",gcs:"gcs.png",azure_blob:"azure_blob.svg",hdfs:"hdfs.svg",snowflake:"snowflake.png",bigquery:"bigquery.png",databricks:"databricks.png",redshift:"redshift.png",trino:"starburst.png",starburst:"starburst.png",athena:"amazon-athena.png",synapse:"azure-synapse-analytics.png",alloydb:"alloy-db.png",aurora_mysql:"amazon-rds.png",aurora_postgresql:"amazon-rds.png",rds_mysql:"amazon-rds.png",rds_postgresql:"amazon-rds.png",rds_sqlserver:"amazon-rds.png",azure_mysql:"azure-database-mysql.png",azure_postgresql:"azure-database-postgresql.png",azure_sql_database:"azure-sql-database.png",azure_sql_managed_instance:"azure-sql-managed-instance.png",cloudsql_mysql:"cloud-sql.png",cloudsql_postgresql:"cloud-sql.png",cloudsql_sqlserver:"cloud-sql.png",questdb:"questdb.png",timescale:"timescale.png"};function g({sources:e,platformUrl:t}){let[n,l]=(0,a.useState)({isOpen:!1,sourceName:null}),i=async()=>{if(n.sourceName)try{await fetch(`/api/sources/delete/${encodeURIComponent(n.sourceName)}`,{method:"POST"}),window.location.reload()}catch{}finally{l({isOpen:!1,sourceName:null})}};return(0,s.jsxs)("div",{className:"card",children:[(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Name"}),(0,s.jsx)("th",{children:"Type"}),(0,s.jsx)("th",{children:"Visibility"}),(0,s.jsx)("th",{children:"Check"}),(0,s.jsx)("th",{})]})}),(0,s.jsx)("tbody",{children:e.map(e=>{let a=p[e.type]||"folder.svg",n=(e.visibility||"").toLowerCase(),i=(e.validate||"").toLowerCase();return(0,s.jsxs)("tr",{children:[(0,s.jsxs)("td",{className:"dark:text-gray-200",children:[e.id&&t?(0,s.jsx)("a",{href:`${t}/home/data-engineering/sources/${e.id}`,target:"_blank",rel:"noopener noreferrer",children:e.name}):e.name,e.description&&(0,s.jsx)("div",{className:"subtle",children:e.description})]}),(0,s.jsx)("td",{className:"dark:text-gray-200",children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(u.default,{src:`/sources-logos/${a}`,alt:e.type,width:20,height:20,className:"h-5 max-w-[30px] rounded"}),(0,s.jsx)("span",{children:e.type})]})}),(0,s.jsxs)("td",{children:["private"===n&&(0,s.jsxs)("span",{title:"private",className:"badge badge-private dark:text-gray-400",children:[(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"3",y:"9",width:"14",height:"8",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M6 9V7a4 4 0 1 1 8 0v2",stroke:"currentColor",strokeWidth:"2",fill:"none"})]}),"Private"]}),"internal"===n&&(0,s.jsxs)("span",{title:"internal",className:"badge badge-internal",children:[(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"3",y:"6",width:"14",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M7 6V4h6v2",stroke:"currentColor",strokeWidth:"2"})]}),"Internal"]}),"public"===n&&(0,s.jsxs)("span",{title:"public",className:"badge badge-public",children:[(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",stroke:"currentColor",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M2 10h16M10 2a12 12 0 0 1 0 16M10 2a12 12 0 0 0 0 16",stroke:"currentColor",strokeWidth:"2"})]}),"Public"]}),!["private","internal","public"].includes(n)&&(0,s.jsx)("span",{className:"muted",children:e.visibility})]}),(0,s.jsxs)("td",{children:["valid"===i&&(0,s.jsxs)("span",{title:"valid",className:"badge badge-valid",children:[(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M6 10.5l2.5 2.5L14 7.5",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Reachable"]}),"invalid"===i&&(0,s.jsxs)("span",{title:"invalid",className:"badge badge-invalid",children:[(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),"Unreachable"]}),!["valid","invalid"].includes(i)&&(0,s.jsx)("span",{className:"muted",children:e.validate||""})]}),(0,s.jsx)("td",{className:"muted"}),(0,s.jsx)("td",{children:(0,s.jsxs)("div",{className:"actions",children:[e.id?(0,s.jsx)(r.default,{className:"btn secondary",href:`/sources/edit/${encodeURIComponent(e.id)}`,children:"Edit"}):(0,s.jsx)("span",{className:"btn secondary opacity-50 cursor-not-allowed",title:"Source ID not available",children:"Edit"}),(0,s.jsx)("button",{className:"btn danger",type:"button",onClick:()=>{l({isOpen:!0,sourceName:e.name})},children:"Delete"})]})})]},e.name)})})]}),(0,s.jsx)(m,{isOpen:n.isOpen,onClose:()=>{l({isOpen:!1,sourceName:null})},onConfirm:i,title:"Delete Source",message:"Are you sure you want to delete this source? This action cannot be undone.",itemName:n.sourceName||void 0})]})}function x({initialData:e}){let[t,n]=(0,a.useState)(null),l=async()=>{try{await c(),n({message:"Validation completed",level:"info"}),setTimeout(()=>window.location.reload(),1e3)}catch(e){n({message:"Validation failed",level:"error"})}},i=async()=>{try{await d(),n({message:"Push completed",level:"info"}),setTimeout(()=>window.location.reload(),1e3)}catch(e){n({message:"Push failed",level:"error"})}},u=async e=>{e.preventDefault();let s=new FormData(e.currentTarget).get("pack_dir");if(!s)return void n({message:"Please select a pack folder",level:"error"});try{let e=await o(s);n({message:e.message||(e.ok?"Pack pushed successfully":"Pack push failed"),level:e.level||(e.ok?"info":"error")}),e.ok&&setTimeout(()=>window.location.reload(),1e3)}catch(e){n({message:`Pack push failed: ${e instanceof Error?e.message:"Unknown error"}`,level:"error"})}};return(0,s.jsxs)("div",{className:"container mt-3",children:[t&&(0,s.jsx)("div",{className:`alert ${"error"===t.level?"alert-error":"alert-info"} mb-3`,children:t.message}),(0,s.jsxs)("div",{className:"grid",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-start gap-3 mb-3",children:[(0,s.jsx)("h2",{className:"m-0 dark:text-white",children:"Sources"}),(0,s.jsxs)("div",{className:"actions",children:[(0,s.jsx)(r.default,{className:"btn",href:"/sources/add",children:"Add source"}),(0,s.jsx)("form",{className:"inline",onSubmit:e=>{e.preventDefault(),l()},children:(0,s.jsx)("button",{className:"btn secondary",type:"submit",children:"Validate"})}),(0,s.jsx)("form",{className:"inline",onSubmit:e=>{e.preventDefault(),i()},children:(0,s.jsx)("button",{className:"btn secondary",type:"submit",children:"Push"})})]})]}),(0,s.jsx)(g,{sources:e.sources,platformUrl:e.platform_url})]}),(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)("h2",{className:"dark:text-white",children:"Worker"}),(0,s.jsx)(h,{})]}),(0,s.jsx)("div",{className:"card mb-6",children:e.worker_conf?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-[160px_1fr] gap-y-2 gap-x-3",children:[(0,s.jsx)("div",{className:"muted",children:"Name"}),(0,s.jsx)("div",{"data-worker-name":!0,className:"dark:text-gray-200",children:e.platform_url?(0,s.jsx)("a",{href:`${e.platform_url}/home/data-engineering/workers/?worker=${e.worker_conf.name||""}`,target:"_blank",rel:"noopener noreferrer",children:e.worker_conf.name||""}):e.worker_conf.name||""}),(0,s.jsx)("div",{className:"muted",children:"Mode"}),(0,s.jsx)("div",{"data-worker-mode":!0,className:"dark:text-gray-200",children:e.worker_conf.mode||""}),(0,s.jsx)("div",{className:"muted",children:"Backend URL"}),(0,s.jsx)("div",{"data-worker-url":!0,className:"dark:text-gray-200",children:(0,s.jsx)("a",{href:e.worker_conf.url||"",target:"_blank",rel:"noopener noreferrer",children:e.worker_conf.url||""})}),(0,s.jsx)("div",{className:"muted",children:"Worker ID"}),(0,s.jsx)("div",{"data-worker-id":!0,className:"dark:text-gray-200",children:e.worker_conf.worker_id||""})]}),(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"muted mb-1.5",children:"Worker Runs"}),e.worker_runs_page&&e.worker_runs_page.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("ul",{className:"m-0 pl-[18px] dark:text-gray-200",children:e.worker_runs_page.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("span",{className:"muted",children:e.when})," —"," ",(0,s.jsx)("code",{className:"dark:bg-gray-700 dark:text-gray-200 px-1 rounded",children:(0,s.jsx)("a",{href:`/api/worker/run/${e.name}`,onClick:async s=>{s.preventDefault();try{await fetch(`/api/worker/run/${e.name}`)}catch{}},className:"cursor-pointer",children:e.name})})]},e.name))}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,s.jsxs)("div",{className:"muted",children:["Showing ",e.runs_start,"–",e.runs_end," of ",e.runs_total]}),(0,s.jsxs)("div",{className:"actions flex gap-2",children:[e.runs_has_prev?(0,s.jsx)(r.default,{className:"btn secondary",href:`/?runs_page=${e.runs_page-1}&runs_per_page=${e.runs_per_page}`,children:"Prev"}):(0,s.jsx)("button",{className:"btn secondary",disabled:!0,children:"Prev"}),e.runs_has_next?(0,s.jsx)(r.default,{className:"btn secondary",href:`/?runs_page=${e.runs_page+1}&runs_per_page=${e.runs_per_page}`,children:"Next"}):(0,s.jsx)("button",{className:"btn secondary",disabled:!0,children:"Next"})]})]})]}):(0,s.jsx)("div",{className:"muted",children:"No runs found."})]})]}):(0,s.jsx)("div",{className:"muted",children:'No worker configuration found. Use "qalita worker login" to configure.'})}),e.platform_url&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"dark:text-white",children:"Pack"}),(0,s.jsx)("div",{className:"card mb-6",children:(0,s.jsxs)("form",{onSubmit:u,children:[(0,s.jsx)("label",{className:"mt-0 mb-2",htmlFor:"pack_dir",children:"Pack folder"}),(0,s.jsxs)("div",{className:"flex gap-2 items-stretch",children:[(0,s.jsx)("input",{id:"pack_dir",name:"pack_dir",type:"text",placeholder:"/path/to/your_pack",className:"flex-1 !mt-0 h-[38px]"}),(0,s.jsx)("button",{type:"button",className:"btn secondary h-[38px] shrink-0",id:"browse_pack",onClick:async()=>{try{let e=await fetch("/api/sources/pick-folder"),s=await e.json();if(s.path){let e=document.getElementById("pack_dir");e&&(e.value=s.path)}}catch{}},children:"Browse…"})]}),(0,s.jsx)("div",{className:"flex justify-end mt-4",children:(0,s.jsx)("button",{className:"btn h-[38px]",type:"submit",children:"Push Pack"})})]})})]})]})]})]})}e.s(["default",()=>x],10887)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,l,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(a,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},54842,e=>{"use strict";var l=e.i(43476),a=e.i(22016),s=e.i(57688);function n(){return(0,l.jsxs)(l.Fragment,{children:[[{name:"Flat files",items:[{value:"csv",label:"CSV",icon:"csv.svg",implemented:!0},{value:"json",label:"JSON",icon:"json.png",implemented:!0},{value:"parquet",label:"Parquet",icon:"parquet.svg",implemented:!0},{value:"excel",label:"Excel",icon:"excel.svg",implemented:!0},{value:"file",label:"File",icon:"file.svg",implemented:!0}]},{name:"Relational databases",items:[{value:"clickhouse",label:"ClickHouse",icon:"clickhouse.png",implemented:!0},{value:"cockroachdb",label:"CockroachDB",icon:"cockroach-db.png",implemented:!0},{value:"duckdb",label:"DuckDB",icon:"duckdb.png",implemented:!0},{value:"mariadb",label:"MariaDB",icon:"maria-db.png",implemented:!0},{value:"mssql",label:"Microsoft SQL Server",icon:"mssql.svg",implemented:!0},{value:"mysql",label:"MySQL",icon:"mysql.svg",implemented:!0},{value:"oracle",label:"Oracle",icon:"oracle.svg",implemented:!0},{value:"postgresql",label:"PostgreSQL",icon:"postgresql.svg",implemented:!0},{value:"singlestoredb",label:"SingleStoreDB",icon:"single-store.png",implemented:!0},{value:"sqlite",label:"SQLite",icon:"sqlite.svg",implemented:!0},{value:"yugabytedb",label:"YugabyteDB",icon:"yugabyte-db.png",implemented:!0},{value:"ibm_db2",label:"IBM Db2",icon:"ibm-db2.png",implemented:!0},{value:"sap_hana",label:"SAP HANA",icon:"sap-hana.png",implemented:!0},{value:"teradata",label:"Teradata",icon:"teradata.png",implemented:!0}]},{name:"NoSQL databases",items:[{value:"mongodb",label:"MongoDB",icon:"mongodb.svg",implemented:!0},{value:"cassandra",label:"Cassandra",icon:"cassandra.svg",implemented:!0},{value:"elasticsearch",label:"Elasticsearch",icon:"elasticsearch.svg",implemented:!0}]},{name:"Data storages",items:[{value:"folder",label:"Folder",icon:"folder.svg",implemented:!0},{value:"s3",label:"Amazon S3",icon:"s3.svg",implemented:!0},{value:"azure_blob",label:"Azure Blob Storage",icon:"azure_blob.svg",implemented:!0},{value:"gcs",label:"Google Cloud Storage",icon:"gcs.png",implemented:!0},{value:"hdfs",label:"HDFS",icon:"hdfs.svg",implemented:!0}]},{name:"Cloud databases",items:[{value:"alloydb",label:"AlloyDB for PostgreSQL",icon:"alloy-db.png",implemented:!0},{value:"aurora_mysql",label:"Amazon Aurora (MySQL)",icon:"amazon-rds.png",implemented:!0},{value:"aurora_postgresql",label:"Amazon Aurora (PostgreSQL)",icon:"amazon-rds.png",implemented:!0},{value:"rds_mysql",label:"Amazon RDS for MySQL",icon:"amazon-rds.png",implemented:!0},{value:"rds_postgresql",label:"Amazon RDS for PostgreSQL",icon:"amazon-rds.png",implemented:!0},{value:"rds_sqlserver",label:"Amazon RDS for SQL Server",icon:"amazon-rds.png",implemented:!0},{value:"azure_mysql",label:"Azure Database for MySQL",icon:"azure-database-mysql.png",implemented:!0},{value:"azure_postgresql",label:"Azure Database for PostgreSQL",icon:"azure-database-postgresql.png",implemented:!0},{value:"azure_sql_database",label:"Azure SQL Database",icon:"azure-sql-database.png",implemented:!0},{value:"azure_sql_managed_instance",label:"Azure SQL Managed Instance",icon:"azure-sql-managed-instance.png",implemented:!0},{value:"cloudsql_mysql",label:"Cloud SQL for MySQL",icon:"cloud-sql.png",implemented:!0},{value:"cloudsql_postgresql",label:"Cloud SQL for PostgreSQL",icon:"cloud-sql.png",implemented:!0},{value:"cloudsql_sqlserver",label:"Cloud SQL for SQL Server",icon:"cloud-sql.png",implemented:!0}]},{name:"SaaS databases",items:[{value:"databricks",label:"Databricks",icon:"databricks.png",implemented:!0},{value:"snowflake",label:"Snowflake",icon:"snowflake.png",implemented:!0},{value:"starburst",label:"Starburst",icon:"starburst.png",implemented:!0},{value:"trino",label:"Trino",icon:"starburst.png",implemented:!0}]},{name:"Data warehouses",items:[{value:"redshift",label:"Amazon Redshift",icon:"redshift.png",implemented:!0},{value:"bigquery",label:"Google BigQuery",icon:"bigquery.png",implemented:!0},{value:"athena",label:"Amazon Athena",icon:"amazon-athena.png",implemented:!0},{value:"synapse",label:"Azure Synapse Analytics",icon:"azure-synapse-analytics.png",implemented:!0}]},{name:"Time series databases",items:[{value:"questdb",label:"QuestDB",icon:"questdb.png",implemented:!0},{value:"timescale",label:"Timescale",icon:"timescale.png",implemented:!0}]}].map(e=>(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("h2",{className:"m-0 mb-2",children:e.name}),(0,l.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(200px,1fr))] gap-4",children:e.items.map(e=>e.implemented?(0,l.jsxs)(a.default,{href:`/sources/add?type=${e.value}`,className:"btn light flex flex-col items-center justify-start gap-2.5 p-4 min-h-[120px] overflow-hidden",children:[(0,l.jsx)(s.default,{src:`/sources-logos/${e.icon}`,alt:e.label,width:40,height:40,className:"w-10 h-10 object-contain rounded-md flex-shrink-0",onError:e=>{e.target.src="/sources-logos/file.svg"}}),(0,l.jsx)("span",{className:"font-semibold text-center text-sm leading-tight w-full overflow-hidden",style:{wordBreak:"break-word"},children:e.label})]},e.value):(0,l.jsxs)("div",{className:"btn light bg-gray-100 flex flex-col items-center justify-start gap-2.5 p-4 opacity-50 cursor-not-allowed min-h-[120px] overflow-hidden",children:[(0,l.jsx)(s.default,{src:`/sources-logos/${e.icon}`,alt:`${e.label} (coming soon)`,title:"Not yet implemented",width:40,height:40,className:"w-10 h-10 object-contain rounded-md flex-shrink-0",onError:e=>{e.target.src="/sources-logos/file.svg"}}),(0,l.jsx)("span",{className:"font-semibold text-center text-sm leading-tight w-full overflow-hidden",style:{wordBreak:"break-word"},children:e.label})]},e.value))})]},e.name)),(0,l.jsxs)("div",{className:"actions mt-4",children:[(0,l.jsx)("a",{className:"btn",href:"mailto:contact@qalita.io?subject=Suggest%20a%20new%20source%20type&body=Hi%20QALITA%20team%2C%0A%0AI%27d%20like%20to%20suggest%20support%20for%20this%20source%20type%3A%20%5Bplease%20describe%5D%0A%0AThanks!",children:"Suggest a new source type"}),(0,l.jsx)(a.default,{className:"btn secondary",href:"/",children:"Cancel"})]})]})}e.s(["default",()=>n])},79516,e=>{"use strict";var l=e.i(43476),a=e.i(62319),s=e.i(56691),n=e.i(54842);function t(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.default,{}),(0,l.jsxs)("div",{className:"container-form",children:[(0,l.jsx)("h1",{children:"Select a source type"}),(0,l.jsx)("div",{className:"card",children:(0,l.jsx)(n.default,{})})]}),(0,l.jsx)(s.default,{})]})}e.s(["default",()=>t])}]);
|
qalita/commands/source.py
CHANGED
|
@@ -130,7 +130,9 @@ def validate_source(config):
|
|
|
130
130
|
if type_for_test == "database":
|
|
131
131
|
type_for_test = source["config"].get("type", "database")
|
|
132
132
|
if type_for_test in [
|
|
133
|
-
"mysql", "postgresql", "sqlite", "mongodb", "oracle", "s3", "gcs", "azure_blob", "hdfs",
|
|
133
|
+
"mysql", "postgresql", "sqlite", "mongodb", "oracle", "s3", "gcs", "azure_blob", "hdfs", "file", "folder",
|
|
134
|
+
"snowflake", "bigquery", "databricks", "redshift", "clickhouse", "duckdb", "trino",
|
|
135
|
+
"teradata", "sap_hana", "cassandra", "elasticsearch", "ibm_db2", "athena", "synapse"
|
|
134
136
|
]:
|
|
135
137
|
if not test_connection(source["config"], type_for_test):
|
|
136
138
|
logger.error(f"Connection test failed for source [{source['name']}] of type {type_for_test}")
|
|
@@ -244,6 +246,20 @@ def validate_source_object(config, source: dict, skip_connection: bool = False,
|
|
|
244
246
|
"hdfs",
|
|
245
247
|
"file",
|
|
246
248
|
"folder",
|
|
249
|
+
"snowflake",
|
|
250
|
+
"bigquery",
|
|
251
|
+
"databricks",
|
|
252
|
+
"redshift",
|
|
253
|
+
"clickhouse",
|
|
254
|
+
"duckdb",
|
|
255
|
+
"trino",
|
|
256
|
+
"teradata",
|
|
257
|
+
"sap_hana",
|
|
258
|
+
"cassandra",
|
|
259
|
+
"elasticsearch",
|
|
260
|
+
"ibm_db2",
|
|
261
|
+
"athena",
|
|
262
|
+
"synapse",
|
|
247
263
|
]
|
|
248
264
|
if type_for_test in supported:
|
|
249
265
|
if not test_connection(conf, type_for_test):
|
|
@@ -656,7 +672,7 @@ def add(config):
|
|
|
656
672
|
|
|
657
673
|
# ask for the source type
|
|
658
674
|
source["type"] = click.prompt(
|
|
659
|
-
"Source type (file, folder, postgresql, mysql, oracle, mssql, sqlite, mongodb, s3, gcs, azure_blob, hdfs)",
|
|
675
|
+
"Source type (file, folder, postgresql, mysql, oracle, mssql, sqlite, mongodb, s3, gcs, azure_blob, hdfs, snowflake, bigquery, databricks, redshift, clickhouse, duckdb, trino, teradata, sap_hana, cassandra, elasticsearch, ibm_db2, athena, synapse)",
|
|
660
676
|
)
|
|
661
677
|
|
|
662
678
|
# Configure according to the selected source type
|
|
@@ -739,6 +755,154 @@ def add(config):
|
|
|
739
755
|
source["config"]["port"] = click.prompt("HDFS port")
|
|
740
756
|
source["config"]["user"] = click.prompt("HDFS user")
|
|
741
757
|
source["config"]["path"] = click.prompt("HDFS path")
|
|
758
|
+
elif source["type"] == "snowflake":
|
|
759
|
+
source["config"]["account"] = click.prompt("Snowflake account identifier (e.g., xy12345.us-east-1)")
|
|
760
|
+
source["config"]["user"] = click.prompt("Snowflake username")
|
|
761
|
+
source["config"]["password"] = click.prompt("Snowflake password", hide_input=True)
|
|
762
|
+
source["config"]["warehouse"] = click.prompt("Snowflake warehouse")
|
|
763
|
+
source["config"]["database"] = click.prompt("Snowflake database")
|
|
764
|
+
source["config"]["schema"] = click.prompt("Snowflake schema", default="PUBLIC")
|
|
765
|
+
source["config"]["role"] = click.prompt("Snowflake role (optional)", default="")
|
|
766
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
767
|
+
"Table name, list of table names or SQL query (default '*' scans the entire database)",
|
|
768
|
+
default="*",
|
|
769
|
+
)
|
|
770
|
+
elif source["type"] == "bigquery":
|
|
771
|
+
source["config"]["project"] = click.prompt("Google Cloud project ID")
|
|
772
|
+
source["config"]["dataset"] = click.prompt("BigQuery dataset name")
|
|
773
|
+
source["config"]["credentials_json"] = click.prompt("Path to service account JSON credentials file")
|
|
774
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
775
|
+
"Table name, list of table names or SQL query (default '*' scans the entire dataset)",
|
|
776
|
+
default="*",
|
|
777
|
+
)
|
|
778
|
+
elif source["type"] == "databricks":
|
|
779
|
+
source["config"]["server_hostname"] = click.prompt("Databricks server hostname (e.g., adb-xxx.azuredatabricks.net)")
|
|
780
|
+
source["config"]["http_path"] = click.prompt("Databricks HTTP path (e.g., /sql/1.0/warehouses/xxx)")
|
|
781
|
+
source["config"]["access_token"] = click.prompt("Databricks access token", hide_input=True)
|
|
782
|
+
source["config"]["catalog"] = click.prompt("Databricks catalog (optional)", default="")
|
|
783
|
+
source["config"]["schema"] = click.prompt("Databricks schema (optional)", default="")
|
|
784
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
785
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
786
|
+
default="*",
|
|
787
|
+
)
|
|
788
|
+
elif source["type"] == "redshift":
|
|
789
|
+
source["config"]["host"] = click.prompt("Redshift cluster endpoint")
|
|
790
|
+
source["config"]["port"] = click.prompt("Redshift port", default="5439")
|
|
791
|
+
source["config"]["user"] = click.prompt("Redshift username")
|
|
792
|
+
source["config"]["password"] = click.prompt("Redshift password", hide_input=True)
|
|
793
|
+
source["config"]["database"] = click.prompt("Redshift database")
|
|
794
|
+
source["config"]["schema"] = click.prompt("Redshift schema", default="public")
|
|
795
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
796
|
+
"Table name, list of table names or SQL query (default '*' scans the entire schema)",
|
|
797
|
+
default="*",
|
|
798
|
+
)
|
|
799
|
+
elif source["type"] == "clickhouse":
|
|
800
|
+
source["config"]["host"] = click.prompt("ClickHouse host")
|
|
801
|
+
source["config"]["port"] = click.prompt("ClickHouse port", default="8123")
|
|
802
|
+
source["config"]["user"] = click.prompt("ClickHouse username", default="default")
|
|
803
|
+
source["config"]["password"] = click.prompt("ClickHouse password (optional)", default="", hide_input=True)
|
|
804
|
+
source["config"]["database"] = click.prompt("ClickHouse database", default="default")
|
|
805
|
+
source["config"]["protocol"] = click.prompt("ClickHouse protocol (http or native)", default="http")
|
|
806
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
807
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
808
|
+
default="*",
|
|
809
|
+
)
|
|
810
|
+
elif source["type"] == "duckdb":
|
|
811
|
+
source["config"]["path"] = click.prompt("DuckDB file path (or :memory: for in-memory)", default=":memory:")
|
|
812
|
+
motherduck = click.prompt("Use MotherDuck cloud?", type=bool, default=False)
|
|
813
|
+
if motherduck:
|
|
814
|
+
source["config"]["motherduck_token"] = click.prompt("MotherDuck token", hide_input=True)
|
|
815
|
+
source["config"]["schema"] = click.prompt("DuckDB schema", default="main")
|
|
816
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
817
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
818
|
+
default="*",
|
|
819
|
+
)
|
|
820
|
+
elif source["type"] == "trino":
|
|
821
|
+
source["config"]["host"] = click.prompt("Trino host")
|
|
822
|
+
source["config"]["port"] = click.prompt("Trino port", default="8080")
|
|
823
|
+
source["config"]["user"] = click.prompt("Trino username", default="trino")
|
|
824
|
+
source["config"]["catalog"] = click.prompt("Trino catalog")
|
|
825
|
+
source["config"]["schema"] = click.prompt("Trino schema")
|
|
826
|
+
source["config"]["http_scheme"] = click.prompt("HTTP scheme (http or https)", default="https")
|
|
827
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
828
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
829
|
+
default="*",
|
|
830
|
+
)
|
|
831
|
+
elif source["type"] == "teradata":
|
|
832
|
+
source["config"]["host"] = click.prompt("Teradata host")
|
|
833
|
+
source["config"]["user"] = click.prompt("Teradata username")
|
|
834
|
+
source["config"]["password"] = click.prompt("Teradata password", hide_input=True)
|
|
835
|
+
source["config"]["database"] = click.prompt("Teradata database (optional)", default="")
|
|
836
|
+
source["config"]["schema"] = click.prompt("Teradata schema (optional)", default="")
|
|
837
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
838
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
839
|
+
default="*",
|
|
840
|
+
)
|
|
841
|
+
elif source["type"] == "sap_hana":
|
|
842
|
+
source["config"]["host"] = click.prompt("SAP HANA host")
|
|
843
|
+
source["config"]["port"] = click.prompt("SAP HANA port", default="30015")
|
|
844
|
+
source["config"]["user"] = click.prompt("SAP HANA username")
|
|
845
|
+
source["config"]["password"] = click.prompt("SAP HANA password", hide_input=True)
|
|
846
|
+
source["config"]["schema"] = click.prompt("SAP HANA schema (optional)", default="")
|
|
847
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
848
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
849
|
+
default="*",
|
|
850
|
+
)
|
|
851
|
+
elif source["type"] == "cassandra":
|
|
852
|
+
source["config"]["host"] = click.prompt("Cassandra host")
|
|
853
|
+
source["config"]["port"] = click.prompt("Cassandra port", default="9042")
|
|
854
|
+
source["config"]["username"] = click.prompt("Cassandra username (optional)", default="")
|
|
855
|
+
source["config"]["password"] = click.prompt("Cassandra password (optional)", default="", hide_input=True)
|
|
856
|
+
source["config"]["keyspace"] = click.prompt("Cassandra keyspace")
|
|
857
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
858
|
+
"Table name, list of table names or CQL query (default '*' scans all tables)",
|
|
859
|
+
default="*",
|
|
860
|
+
)
|
|
861
|
+
elif source["type"] == "elasticsearch":
|
|
862
|
+
source["config"]["host"] = click.prompt("Elasticsearch host")
|
|
863
|
+
source["config"]["port"] = click.prompt("Elasticsearch port", default="9200")
|
|
864
|
+
source["config"]["username"] = click.prompt("Elasticsearch username (optional)", default="")
|
|
865
|
+
source["config"]["password"] = click.prompt("Elasticsearch password (optional)", default="", hide_input=True)
|
|
866
|
+
source["config"]["use_ssl"] = click.prompt("Use SSL?", type=bool, default=False)
|
|
867
|
+
source["config"]["cloud_id"] = click.prompt("Elastic Cloud ID (optional, leave empty for self-hosted)", default="")
|
|
868
|
+
source["config"]["api_key"] = click.prompt("API Key (optional)", default="", hide_input=True)
|
|
869
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
870
|
+
"Index name or pattern (default '*' scans all indices)",
|
|
871
|
+
default="*",
|
|
872
|
+
)
|
|
873
|
+
elif source["type"] == "ibm_db2":
|
|
874
|
+
source["config"]["host"] = click.prompt("IBM DB2 host")
|
|
875
|
+
source["config"]["port"] = click.prompt("IBM DB2 port", default="50000")
|
|
876
|
+
source["config"]["user"] = click.prompt("IBM DB2 username")
|
|
877
|
+
source["config"]["password"] = click.prompt("IBM DB2 password", hide_input=True)
|
|
878
|
+
source["config"]["database"] = click.prompt("IBM DB2 database")
|
|
879
|
+
source["config"]["schema"] = click.prompt("IBM DB2 schema (optional)", default="")
|
|
880
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
881
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
882
|
+
default="*",
|
|
883
|
+
)
|
|
884
|
+
elif source["type"] == "athena":
|
|
885
|
+
source["config"]["region"] = click.prompt("AWS region", default="us-east-1")
|
|
886
|
+
source["config"]["s3_staging_dir"] = click.prompt("S3 staging directory (e.g., s3://bucket/path/)")
|
|
887
|
+
source["config"]["database"] = click.prompt("Athena database")
|
|
888
|
+
source["config"]["workgroup"] = click.prompt("Athena workgroup (optional)", default="")
|
|
889
|
+
source["config"]["access_key"] = click.prompt("AWS Access Key (optional, uses IAM if empty)", default="")
|
|
890
|
+
source["config"]["secret_key"] = click.prompt("AWS Secret Key (optional)", default="", hide_input=True)
|
|
891
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
892
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
893
|
+
default="*",
|
|
894
|
+
)
|
|
895
|
+
elif source["type"] == "synapse":
|
|
896
|
+
source["config"]["host"] = click.prompt("Azure Synapse host (e.g., xxx.sql.azuresynapse.net)")
|
|
897
|
+
source["config"]["port"] = click.prompt("Azure Synapse port", default="1433")
|
|
898
|
+
source["config"]["user"] = click.prompt("Azure Synapse username")
|
|
899
|
+
source["config"]["password"] = click.prompt("Azure Synapse password", hide_input=True)
|
|
900
|
+
source["config"]["database"] = click.prompt("Azure Synapse database")
|
|
901
|
+
source["config"]["schema"] = click.prompt("Azure Synapse schema", default="dbo")
|
|
902
|
+
source["config"]["table_or_query"] = click.prompt(
|
|
903
|
+
"Table name, list of table names or SQL query (default '*' scans all tables)",
|
|
904
|
+
default="*",
|
|
905
|
+
)
|
|
742
906
|
else:
|
|
743
907
|
# Generic fallback
|
|
744
908
|
click.echo(f"Unknown or unsupported source type: {source['type']}")
|
qalita/commands/worker.py
CHANGED
|
@@ -673,7 +673,7 @@ def job_run(
|
|
|
673
673
|
|
|
674
674
|
"""Runs a job"""
|
|
675
675
|
agent_conf = config.load_worker_config()
|
|
676
|
-
|
|
676
|
+
# Note: Worker status stays "online" during job execution (only job status changes)
|
|
677
677
|
|
|
678
678
|
# Get Source Version & Version ID
|
|
679
679
|
# if source_version_id is None:
|
|
@@ -868,7 +868,7 @@ def job_run(
|
|
|
868
868
|
sys.exit(1)
|
|
869
869
|
|
|
870
870
|
# run the job
|
|
871
|
-
|
|
871
|
+
# Note: Worker status stays "online" during job execution (only job status changes)
|
|
872
872
|
try:
|
|
873
873
|
if job["id"] is not None:
|
|
874
874
|
r = send_api_request(
|
|
@@ -937,7 +937,7 @@ def job_run(
|
|
|
937
937
|
else:
|
|
938
938
|
status = "failed"
|
|
939
939
|
|
|
940
|
-
|
|
940
|
+
# Note: Worker status stays "online" (only job status reflects success/failure)
|
|
941
941
|
r = send_api_request(
|
|
942
942
|
request=f"/api/v2/jobs/{job['id']}",
|
|
943
943
|
mode="put",
|
qalita/commands/worker_grpc.py
CHANGED
|
@@ -752,7 +752,7 @@ class GrpcWorkerRunner:
|
|
|
752
752
|
|
|
753
753
|
# Update job status to running
|
|
754
754
|
await self.grpc_client.send_job_status(job_id, "running", start_date=start_time)
|
|
755
|
-
|
|
755
|
+
# Note: Worker status stays "online" during job execution (only job status changes)
|
|
756
756
|
|
|
757
757
|
try:
|
|
758
758
|
# Get source info
|
|
@@ -889,7 +889,7 @@ class GrpcWorkerRunner:
|
|
|
889
889
|
end_date=end_time,
|
|
890
890
|
logs_id=logs_id,
|
|
891
891
|
)
|
|
892
|
-
|
|
892
|
+
# Note: Worker status stays "online" (only job status reflects success/failure)
|
|
893
893
|
|
|
894
894
|
elapsed_time = end_time - start_time
|
|
895
895
|
logger.success(f"Job {job_id} finished with status {final_status}")
|
|
@@ -900,7 +900,7 @@ class GrpcWorkerRunner:
|
|
|
900
900
|
logger.error(f"Job {job_id} failed: {e}")
|
|
901
901
|
end_time = datetime.now(timezone.utc)
|
|
902
902
|
await self.grpc_client.send_job_status(job_id, "failed", error_message=str(e), end_date=end_time)
|
|
903
|
-
|
|
903
|
+
# Note: Worker status stays "online" (only job status reflects failure)
|
|
904
904
|
raise
|
|
905
905
|
|
|
906
906
|
async def _pull_pack(self, pack_id: int, asset: qalita_pb2.AssetUrl) -> str:
|