@malloy-publisher/sdk 0.0.188 → 0.0.382-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ServerProvider-lOQXDlqB.cjs.js +1 -0
- package/dist/{ServerProvider-CEtr6AbQ.es.js → ServerProvider-on-8FH5Z.es.js} +1254 -780
- package/dist/client/api.d.ts +550 -25
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +56 -45
- package/dist/{core-B4ZYB7aS.es.js → core-CjeTkq8O.es.js} +1 -1
- package/dist/{core-KuJReEQ7.cjs.js → core-YNpOLuB1.cjs.js} +1 -1
- package/dist/{index-Cj8pM737.cjs.js → index-BOLBP6_i.cjs.js} +2 -2
- package/dist/{index-D24FXJoc.es.js → index-DRDu9kIV.es.js} +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +2 -2
- package/package.json +1 -1
- package/dist/ServerProvider-CFg9jduS.cjs.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const B=require("react/jsx-runtime"),E=require("@tanstack/react-query"),u=require("axios"),v=require("react"),m="http://localhost/api/v0".replace(/\/+$/,"");class A{constructor(a,e=m,r=u){this.basePath=e,this.axios=r,a&&(this.configuration=a,this.basePath=a.basePath??e)}configuration}class ne extends Error{constructor(a,e){super(e),this.field=a,this.name="RequiredError"}}const P={},V="https://example.com",h=function(c,a,e){if(e==null)throw new ne(a,`Required parameter ${a} was null or undefined when calling ${c}.`)};function F(c,a,e=""){a!=null&&(typeof a=="object"?Array.isArray(a)?a.forEach(r=>F(c,r,e)):Object.keys(a).forEach(r=>F(c,a[r],`${e}${e!==""?".":""}${r}`)):c.has(e)?c.append(e,a):c.set(e,a))}const b=function(c,...a){const e=new URLSearchParams(c.search);F(e,a),c.search=e.toString()},y=function(c,a,e){const r=typeof c!="string";return(r&&e&&e.isJsonMime?e.isJsonMime(a.headers["Content-Type"]):r)?JSON.stringify(c!==void 0?c:{}):c||""},O=function(c){return c.pathname+c.search+c.hash},g=function(c,a,e,r){return(t=a,o=e)=>{const s={...c.options,url:(t.defaults.baseURL?"":r?.basePath??o)+c.url};return t.request(s)}},ce={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3",Azure:"azure"},le={ServicePrincipal:"service_principal",SasToken:"sas_token"},ie={Error:"error",Warn:"warn",Debug:"debug"},pe={Success:"success",Error:"error"},de={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck",Ducklake:"ducklake"},he={Ok:"ok",Failed:"failed"},ue={Embedded:"embedded",Materialized:"materialized"},me={Equal:"equal",In:"in",Like:"like",GreaterThan:"greater_than",LessThan:"less_than"},Pe={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Ve={Markdown:"markdown",Code:"code"},be={Markdown:"markdown",Code:"code"},Oe={Initializing:"initializing",Serving:"serving",Draining:"draining"},$=function(c){return{createConnection:async(a,e,r,t={})=>{h("createConnection","projectName",a),h("createConnection","connectionName",e),h("createConnection","connection",r);const o="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},l.data=y(r,l,c),{url:O(s),options:l}},deleteConnection:async(a,e,r={})=>{h("deleteConnection","projectName",a),h("deleteConnection","connectionName",e);const t="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"DELETE",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},getConnection:async(a,e,r={})=>{h("getConnection","projectName",a),h("getConnection","connectionName",e);const t="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"GET",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},getQuerydata:async(a,e,r,t,o={})=>{h("getQuerydata","projectName",a),h("getQuerydata","connectionName",e);const s="/projects/{projectName}/connections/{connectionName}/queryData".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},d={};r!==void 0&&(d.sqlStatement=r),t!==void 0&&(d.options=t),b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},{url:O(n),options:i}},getSqlsource:async(a,e,r,t={})=>{h("getSqlsource","projectName",a),h("getSqlsource","connectionName",e);const o="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.sqlStatement=r),b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},{url:O(s),options:l}},getTable:async(a,e,r,t,o={})=>{h("getTable","projectName",a),h("getTable","connectionName",e),h("getTable","schemaName",r),h("getTable","tablePath",t);const s="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(r))).replace("{tablePath}",encodeURIComponent(String(t))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={};b(n,{});let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},{url:O(n),options:i}},getTemporarytable:async(a,e,r,t={})=>{h("getTemporarytable","projectName",a),h("getTemporarytable","connectionName",e);const o="/projects/{projectName}/connections/{connectionName}/temporaryTable".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.sqlStatement=r),b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},{url:O(s),options:l}},listConnections:async(a,e={})=>{h("listConnections","projectName",a);const r="/projects/{projectName}/connections".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"GET",...o,...e},n={};b(t,{});let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},{url:O(t),options:s}},listSchemas:async(a,e,r={})=>{h("listSchemas","projectName",a),h("listSchemas","connectionName",e);const t="/projects/{projectName}/connections/{connectionName}/schemas".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"GET",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},listTables:async(a,e,r,t,o={})=>{h("listTables","projectName",a),h("listTables","connectionName",e),h("listTables","schemaName",r);const s="/projects/{projectName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},d={};t&&(d.tableNames=t),b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},{url:O(n),options:i}},postQuerydata:async(a,e,r,t,o={})=>{h("postQuerydata","projectName",a),h("postQuerydata","connectionName",e),h("postQuerydata","postSqlsourceRequest",r);const s="/projects/{projectName}/connections/{connectionName}/sqlQuery".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"POST",...l,...o},p={},d={};t!==void 0&&(d.options=t),p["Content-Type"]="application/json",b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},i.data=y(r,i,c),{url:O(n),options:i}},postSqlsource:async(a,e,r,t={})=>{h("postSqlsource","projectName",a),h("postSqlsource","connectionName",e),h("postSqlsource","postSqlsourceRequest",r);const o="/projects/{projectName}/connections/{connectionName}/sqlSource".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},l.data=y(r,l,c),{url:O(s),options:l}},postTemporarytable:async(a,e,r,t={})=>{h("postTemporarytable","projectName",a),h("postTemporarytable","connectionName",e),h("postTemporarytable","postSqlsourceRequest",r);const o="/projects/{projectName}/connections/{connectionName}/sqlTemporaryTable".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"POST",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},l.data=y(r,l,c),{url:O(s),options:l}},updateConnection:async(a,e,r,t={})=>{h("updateConnection","projectName",a),h("updateConnection","connectionName",e),h("updateConnection","updateConnectionRequest",r);const o="/projects/{projectName}/connections/{connectionName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{connectionName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"PATCH",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},l.data=y(r,l,c),{url:O(s),options:l}}}},S=function(c){const a=$(c);return{async createConnection(e,r,t,o){const s=await a.createConnection(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.createConnection"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async deleteConnection(e,r,t){const o=await a.deleteConnection(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.deleteConnection"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async getConnection(e,r,t){const o=await a.getConnection(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.getConnection"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async getQuerydata(e,r,t,o,s){const n=await a.getQuerydata(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.getQuerydata"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async getSqlsource(e,r,t,o){const s=await a.getSqlsource(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.getSqlsource"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async getTable(e,r,t,o,s){const n=await a.getTable(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.getTable"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async getTemporarytable(e,r,t,o){const s=await a.getTemporarytable(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.getTemporarytable"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async listConnections(e,r){const t=await a.listConnections(e,r),o=c?.serverIndex??0,s=P["ConnectionsApi.listConnections"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async listSchemas(e,r,t){const o=await a.listSchemas(e,r,t),s=c?.serverIndex??0,n=P["ConnectionsApi.listSchemas"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async listTables(e,r,t,o,s){const n=await a.listTables(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.listTables"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async postQuerydata(e,r,t,o,s){const n=await a.postQuerydata(e,r,t,o,s),l=c?.serverIndex??0,i=P["ConnectionsApi.postQuerydata"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async postSqlsource(e,r,t,o){const s=await a.postSqlsource(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.postSqlsource"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async postTemporarytable(e,r,t,o){const s=await a.postTemporarytable(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.postTemporarytable"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)},async updateConnection(e,r,t,o){const s=await a.updateConnection(e,r,t,o),n=c?.serverIndex??0,l=P["ConnectionsApi.updateConnection"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},ge=function(c,a,e){const r=S(c);return{createConnection(t,o,s,n){return r.createConnection(t,o,s,n).then(l=>l(e,a))},deleteConnection(t,o,s){return r.deleteConnection(t,o,s).then(n=>n(e,a))},getConnection(t,o,s){return r.getConnection(t,o,s).then(n=>n(e,a))},getQuerydata(t,o,s,n,l){return r.getQuerydata(t,o,s,n,l).then(i=>i(e,a))},getSqlsource(t,o,s,n){return r.getSqlsource(t,o,s,n).then(l=>l(e,a))},getTable(t,o,s,n,l){return r.getTable(t,o,s,n,l).then(i=>i(e,a))},getTemporarytable(t,o,s,n){return r.getTemporarytable(t,o,s,n).then(l=>l(e,a))},listConnections(t,o){return r.listConnections(t,o).then(s=>s(e,a))},listSchemas(t,o,s){return r.listSchemas(t,o,s).then(n=>n(e,a))},listTables(t,o,s,n,l){return r.listTables(t,o,s,n,l).then(i=>i(e,a))},postQuerydata(t,o,s,n,l){return r.postQuerydata(t,o,s,n,l).then(i=>i(e,a))},postSqlsource(t,o,s,n){return r.postSqlsource(t,o,s,n).then(l=>l(e,a))},postTemporarytable(t,o,s,n){return r.postTemporarytable(t,o,s,n).then(l=>l(e,a))},updateConnection(t,o,s,n){return r.updateConnection(t,o,s,n).then(l=>l(e,a))}}};class L extends A{createConnection(a,e,r,t){return S(this.configuration).createConnection(a,e,r,t).then(o=>o(this.axios,this.basePath))}deleteConnection(a,e,r){return S(this.configuration).deleteConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getConnection(a,e,r){return S(this.configuration).getConnection(a,e,r).then(t=>t(this.axios,this.basePath))}getQuerydata(a,e,r,t,o){return S(this.configuration).getQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getSqlsource(a,e,r,t){return S(this.configuration).getSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}getTable(a,e,r,t,o){return S(this.configuration).getTable(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getTemporarytable(a,e,r,t){return S(this.configuration).getTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}listConnections(a,e){return S(this.configuration).listConnections(a,e).then(r=>r(this.axios,this.basePath))}listSchemas(a,e,r){return S(this.configuration).listSchemas(a,e,r).then(t=>t(this.axios,this.basePath))}listTables(a,e,r,t,o){return S(this.configuration).listTables(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}postQuerydata(a,e,r,t,o){return S(this.configuration).postQuerydata(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}postSqlsource(a,e,r,t){return S(this.configuration).postSqlsource(a,e,r,t).then(o=>o(this.axios,this.basePath))}postTemporarytable(a,e,r,t){return S(this.configuration).postTemporarytable(a,e,r,t).then(o=>o(this.axios,this.basePath))}updateConnection(a,e,r,t){return S(this.configuration).updateConnection(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const H=function(c){return{testConnectionConfiguration:async(a,e={})=>{h("testConnectionConfiguration","connection",a);const r="/connections/test",t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"POST",...o,...e},n={},l={};n["Content-Type"]="application/json",b(t,l);let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},s.data=y(a,s,c),{url:O(t),options:s}}}},Q=function(c){const a=H(c);return{async testConnectionConfiguration(e,r){const t=await a.testConnectionConfiguration(e,r),o=c?.serverIndex??0,s=P["ConnectionsTestApi.testConnectionConfiguration"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)}}},Ce=function(c,a,e){const r=Q(c);return{testConnectionConfiguration(t,o){return r.testConnectionConfiguration(t,o).then(s=>s(e,a))}}};class Se extends A{testConnectionConfiguration(a,e){return Q(this.configuration).testConnectionConfiguration(a,e).then(r=>r(this.axios,this.basePath))}}const W=function(c){return{listDatabases:async(a,e,r,t={})=>{h("listDatabases","projectName",a),h("listDatabases","packageName",e);const o="/projects/{projectName}/packages/{packageName}/databases".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},{url:O(s),options:l}}}},M=function(c){const a=W(c);return{async listDatabases(e,r,t,o){const s=await a.listDatabases(e,r,t,o),n=c?.serverIndex??0,l=P["DatabasesApi.listDatabases"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},ye=function(c,a,e){const r=M(c);return{listDatabases(t,o,s,n){return r.listDatabases(t,o,s,n).then(l=>l(e,a))}}};class D extends A{listDatabases(a,e,r,t){return M(this.configuration).listDatabases(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const f=function(c){return{compileModelSource:async(a,e,r,t,o={})=>{h("compileModelSource","projectName",a),h("compileModelSource","packageName",e),h("compileModelSource","path",r),h("compileModelSource","compileRequest",t);const s="/projects/{projectName}/packages/{packageName}/models/{path}/compile".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"POST",...l,...o},p={},d={};p["Content-Type"]="application/json",b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},i.data=y(t,i,c),{url:O(n),options:i}},executeQueryModel:async(a,e,r,t,o={})=>{h("executeQueryModel","projectName",a),h("executeQueryModel","packageName",e),h("executeQueryModel","path",r),h("executeQueryModel","queryRequest",t);const s="/projects/{projectName}/packages/{packageName}/models/{path}/query".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"POST",...l,...o},p={},d={};p["Content-Type"]="application/json",b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},i.data=y(t,i,c),{url:O(n),options:i}},getModel:async(a,e,r,t,o={})=>{h("getModel","projectName",a),h("getModel","packageName",e),h("getModel","path",r);const s="/projects/{projectName}/packages/{packageName}/models/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},d={};t!==void 0&&(d.versionId=t),b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},{url:O(n),options:i}},listModels:async(a,e,r,t={})=>{h("listModels","projectName",a),h("listModels","packageName",e);const o="/projects/{projectName}/packages/{packageName}/models".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},{url:O(s),options:l}}}},R=function(c){const a=f(c);return{async compileModelSource(e,r,t,o,s){const n=await a.compileModelSource(e,r,t,o,s),l=c?.serverIndex??0,i=P["ModelsApi.compileModelSource"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async executeQueryModel(e,r,t,o,s){const n=await a.executeQueryModel(e,r,t,o,s),l=c?.serverIndex??0,i=P["ModelsApi.executeQueryModel"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async getModel(e,r,t,o,s){const n=await a.getModel(e,r,t,o,s),l=c?.serverIndex??0,i=P["ModelsApi.getModel"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async listModels(e,r,t,o){const s=await a.listModels(e,r,t,o),n=c?.serverIndex??0,l=P["ModelsApi.listModels"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},Ae=function(c,a,e){const r=R(c);return{compileModelSource(t,o,s,n,l){return r.compileModelSource(t,o,s,n,l).then(i=>i(e,a))},executeQueryModel(t,o,s,n,l){return r.executeQueryModel(t,o,s,n,l).then(i=>i(e,a))},getModel(t,o,s,n,l){return r.getModel(t,o,s,n,l).then(i=>i(e,a))},listModels(t,o,s,n){return r.listModels(t,o,s,n).then(l=>l(e,a))}}};class G extends A{compileModelSource(a,e,r,t,o){return R(this.configuration).compileModelSource(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}executeQueryModel(a,e,r,t,o){return R(this.configuration).executeQueryModel(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}getModel(a,e,r,t,o){return R(this.configuration).getModel(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listModels(a,e,r,t){return R(this.configuration).listModels(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const z=function(c){return{executeNotebookCell:async(a,e,r,t,o,s,n,l={})=>{h("executeNotebookCell","projectName",a),h("executeNotebookCell","packageName",e),h("executeNotebookCell","path",r),h("executeNotebookCell","cellIndex",t);const i="/projects/{projectName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))).replace("{cellIndex}",encodeURIComponent(String(t))),p=new URL(i,V);let d;c&&(d=c.baseOptions);const C={method:"GET",...d,...l},j={},x={};o!==void 0&&(x.versionId=o),s!==void 0&&(x.filter_params=s),n!==void 0&&(x.bypass_filters=n),b(p,x);let w=d&&d.headers?d.headers:{};return C.headers={...j,...w,...l.headers},{url:O(p),options:C}},getNotebook:async(a,e,r,t,o={})=>{h("getNotebook","projectName",a),h("getNotebook","packageName",e),h("getNotebook","path",r);const s="/projects/{projectName}/packages/{packageName}/notebooks/{path}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(r))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},d={};t!==void 0&&(d.versionId=t),b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},{url:O(n),options:i}},listNotebooks:async(a,e,r,t={})=>{h("listNotebooks","projectName",a),h("listNotebooks","packageName",e);const o="/projects/{projectName}/packages/{packageName}/notebooks".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"GET",...n,...t},i={},p={};r!==void 0&&(p.versionId=r),b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},{url:O(s),options:l}}}},I=function(c){const a=z(c);return{async executeNotebookCell(e,r,t,o,s,n,l,i){const p=await a.executeNotebookCell(e,r,t,o,s,n,l,i),d=c?.serverIndex??0,C=P["NotebooksApi.executeNotebookCell"]?.[d]?.url;return(j,x)=>g(p,u,m,c)(j,C||x)},async getNotebook(e,r,t,o,s){const n=await a.getNotebook(e,r,t,o,s),l=c?.serverIndex??0,i=P["NotebooksApi.getNotebook"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async listNotebooks(e,r,t,o){const s=await a.listNotebooks(e,r,t,o),n=c?.serverIndex??0,l=P["NotebooksApi.listNotebooks"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},je=function(c,a,e){const r=I(c);return{executeNotebookCell(t,o,s,n,l,i,p,d){return r.executeNotebookCell(t,o,s,n,l,i,p,d).then(C=>C(e,a))},getNotebook(t,o,s,n,l){return r.getNotebook(t,o,s,n,l).then(i=>i(e,a))},listNotebooks(t,o,s,n){return r.listNotebooks(t,o,s,n).then(l=>l(e,a))}}};class _ extends A{executeNotebookCell(a,e,r,t,o,s,n,l){return I(this.configuration).executeNotebookCell(a,e,r,t,o,s,n,l).then(i=>i(this.axios,this.basePath))}getNotebook(a,e,r,t,o){return I(this.configuration).getNotebook(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listNotebooks(a,e,r,t){return I(this.configuration).listNotebooks(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const xe={True:"true",False:"false"},J=function(c){return{createPackage:async(a,e,r={})=>{h("createPackage","projectName",a),h("createPackage","_package",e);const t="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(a))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"POST",...s,...r},l={},i={};l["Content-Type"]="application/json",b(o,i);let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},n.data=y(e,n,c),{url:O(o),options:n}},deletePackage:async(a,e,r={})=>{h("deletePackage","projectName",a),h("deletePackage","packageName",e);const t="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"DELETE",...s,...r},l={};b(o,{});let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},getPackage:async(a,e,r,t,o={})=>{h("getPackage","projectName",a),h("getPackage","packageName",e);const s="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),n=new URL(s,V);let l;c&&(l=c.baseOptions);const i={method:"GET",...l,...o},p={},d={};r!==void 0&&(d.versionId=r),t!==void 0&&(d.reload=t),b(n,d);let C=l&&l.headers?l.headers:{};return i.headers={...p,...C,...o.headers},{url:O(n),options:i}},listPackages:async(a,e={})=>{h("listPackages","projectName",a);const r="/projects/{projectName}/packages".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"GET",...o,...e},n={};b(t,{});let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},{url:O(t),options:s}},updatePackage:async(a,e,r,t={})=>{h("updatePackage","projectName",a),h("updatePackage","packageName",e),h("updatePackage","_package",r);const o="/projects/{projectName}/packages/{packageName}".replace("{projectName}",encodeURIComponent(String(a))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,V);let n;c&&(n=c.baseOptions);const l={method:"PATCH",...n,...t},i={},p={};i["Content-Type"]="application/json",b(s,p);let d=n&&n.headers?n.headers:{};return l.headers={...i,...d,...t.headers},l.data=y(r,l,c),{url:O(s),options:l}}}},k=function(c){const a=J(c);return{async createPackage(e,r,t){const o=await a.createPackage(e,r,t),s=c?.serverIndex??0,n=P["PackagesApi.createPackage"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async deletePackage(e,r,t){const o=await a.deletePackage(e,r,t),s=c?.serverIndex??0,n=P["PackagesApi.deletePackage"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async getPackage(e,r,t,o,s){const n=await a.getPackage(e,r,t,o,s),l=c?.serverIndex??0,i=P["PackagesApi.getPackage"]?.[l]?.url;return(p,d)=>g(n,u,m,c)(p,i||d)},async listPackages(e,r){const t=await a.listPackages(e,r),o=c?.serverIndex??0,s=P["PackagesApi.listPackages"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async updatePackage(e,r,t,o){const s=await a.updatePackage(e,r,t,o),n=c?.serverIndex??0,l=P["PackagesApi.updatePackage"]?.[n]?.url;return(i,p)=>g(s,u,m,c)(i,l||p)}}},ke=function(c,a,e){const r=k(c);return{createPackage(t,o,s){return r.createPackage(t,o,s).then(n=>n(e,a))},deletePackage(t,o,s){return r.deletePackage(t,o,s).then(n=>n(e,a))},getPackage(t,o,s,n,l){return r.getPackage(t,o,s,n,l).then(i=>i(e,a))},listPackages(t,o){return r.listPackages(t,o).then(s=>s(e,a))},updatePackage(t,o,s,n){return r.updatePackage(t,o,s,n).then(l=>l(e,a))}}};class K extends A{createPackage(a,e,r){return k(this.configuration).createPackage(a,e,r).then(t=>t(this.axios,this.basePath))}deletePackage(a,e,r){return k(this.configuration).deletePackage(a,e,r).then(t=>t(this.axios,this.basePath))}getPackage(a,e,r,t,o){return k(this.configuration).getPackage(a,e,r,t,o).then(s=>s(this.axios,this.basePath))}listPackages(a,e){return k(this.configuration).listPackages(a,e).then(r=>r(this.axios,this.basePath))}updatePackage(a,e,r,t){return k(this.configuration).updatePackage(a,e,r,t).then(o=>o(this.axios,this.basePath))}}const Y=function(c){return{createProject:async(a,e={})=>{h("createProject","project",a);const r="/projects",t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"POST",...o,...e},n={},l={};n["Content-Type"]="application/json",b(t,l);let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},s.data=y(a,s,c),{url:O(t),options:s}},deleteProject:async(a,e={})=>{h("deleteProject","projectName",a);const r="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"DELETE",...o,...e},n={};b(t,{});let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},{url:O(t),options:s}},getProject:async(a,e,r={})=>{h("getProject","projectName",a);const t="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"GET",...s,...r},l={},i={};e!==void 0&&(i.reload=e),b(o,i);let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},{url:O(o),options:n}},listProjects:async(a={})=>{const e="/projects",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"GET",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}},updateProject:async(a,e,r={})=>{h("updateProject","projectName",a),h("updateProject","project",e);const t="/projects/{projectName}".replace("{projectName}",encodeURIComponent(String(a))),o=new URL(t,V);let s;c&&(s=c.baseOptions);const n={method:"PATCH",...s,...r},l={},i={};l["Content-Type"]="application/json",b(o,i);let p=s&&s.headers?s.headers:{};return n.headers={...l,...p,...r.headers},n.data=y(e,n,c),{url:O(o),options:n}}}},N=function(c){const a=Y(c);return{async createProject(e,r){const t=await a.createProject(e,r),o=c?.serverIndex??0,s=P["ProjectsApi.createProject"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async deleteProject(e,r){const t=await a.deleteProject(e,r),o=c?.serverIndex??0,s=P["ProjectsApi.deleteProject"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async getProject(e,r,t){const o=await a.getProject(e,r,t),s=c?.serverIndex??0,n=P["ProjectsApi.getProject"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)},async listProjects(e){const r=await a.listProjects(e),t=c?.serverIndex??0,o=P["ProjectsApi.listProjects"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)},async updateProject(e,r,t){const o=await a.updateProject(e,r,t),s=c?.serverIndex??0,n=P["ProjectsApi.updateProject"]?.[s]?.url;return(l,i)=>g(o,u,m,c)(l,n||i)}}},Ne=function(c,a,e){const r=N(c);return{createProject(t,o){return r.createProject(t,o).then(s=>s(e,a))},deleteProject(t,o){return r.deleteProject(t,o).then(s=>s(e,a))},getProject(t,o,s){return r.getProject(t,o,s).then(n=>n(e,a))},listProjects(t){return r.listProjects(t).then(o=>o(e,a))},updateProject(t,o,s){return r.updateProject(t,o,s).then(n=>n(e,a))}}};class X extends A{createProject(a,e){return N(this.configuration).createProject(a,e).then(r=>r(this.axios,this.basePath))}deleteProject(a,e){return N(this.configuration).deleteProject(a,e).then(r=>r(this.axios,this.basePath))}getProject(a,e,r){return N(this.configuration).getProject(a,e,r).then(t=>t(this.axios,this.basePath))}listProjects(a){return N(this.configuration).listProjects(a).then(e=>e(this.axios,this.basePath))}updateProject(a,e,r){return N(this.configuration).updateProject(a,e,r).then(t=>t(this.axios,this.basePath))}}const Z=function(c){return{getStatus:async(a={})=>{const e="/status",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"GET",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}}}},q=function(c){const a=Z(c);return{async getStatus(e){const r=await a.getStatus(e),t=c?.serverIndex??0,o=P["PublisherApi.getStatus"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)}}},ve=function(c,a,e){const r=q(c);return{getStatus(t){return r.getStatus(t).then(o=>o(e,a))}}};class ee extends A{getStatus(a){return q(this.configuration).getStatus(a).then(e=>e(this.axios,this.basePath))}}const te=function(c){return{getWatchStatus:async(a={})=>{const e="/watch-mode/status",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"GET",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}},startWatching:async(a,e={})=>{h("startWatching","startWatchRequest",a);const r="/watch-mode/start",t=new URL(r,V);let o;c&&(o=c.baseOptions);const s={method:"POST",...o,...e},n={},l={};n["Content-Type"]="application/json",b(t,l);let i=o&&o.headers?o.headers:{};return s.headers={...n,...i,...e.headers},s.data=y(a,s,c),{url:O(t),options:s}},stopWatching:async(a={})=>{const e="/watch-mode/stop",r=new URL(e,V);let t;c&&(t=c.baseOptions);const o={method:"POST",...t,...a},s={};b(r,{});let l=t&&t.headers?t.headers:{};return o.headers={...s,...l,...a.headers},{url:O(r),options:o}}}},U=function(c){const a=te(c);return{async getWatchStatus(e){const r=await a.getWatchStatus(e),t=c?.serverIndex??0,o=P["WatchModeApi.getWatchStatus"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)},async startWatching(e,r){const t=await a.startWatching(e,r),o=c?.serverIndex??0,s=P["WatchModeApi.startWatching"]?.[o]?.url;return(n,l)=>g(t,u,m,c)(n,s||l)},async stopWatching(e){const r=await a.stopWatching(e),t=c?.serverIndex??0,o=P["WatchModeApi.stopWatching"]?.[t]?.url;return(s,n)=>g(r,u,m,c)(s,o||n)}}},Re=function(c,a,e){const r=U(c);return{getWatchStatus(t){return r.getWatchStatus(t).then(o=>o(e,a))},startWatching(t,o){return r.startWatching(t,o).then(s=>s(e,a))},stopWatching(t){return r.stopWatching(t).then(o=>o(e,a))}}};class ae extends A{getWatchStatus(a){return U(this.configuration).getWatchStatus(a).then(e=>e(this.axios,this.basePath))}startWatching(a,e){return U(this.configuration).startWatching(a,e).then(r=>r(this.axios,this.basePath))}stopWatching(a){return U(this.configuration).stopWatching(a).then(e=>e(this.axios,this.basePath))}}class re{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(a={}){this.apiKey=a.apiKey,this.username=a.username,this.password=a.password,this.accessToken=a.accessToken,this.basePath=a.basePath,this.serverIndex=a.serverIndex,this.baseOptions={...a.baseOptions,headers:{...a.baseOptions?.headers}},this.formDataCtor=a.formDataCtor}isJsonMime(a){const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return a!==null&&(e.test(a)||a.toLowerCase()==="application/json-patch+json")}}const oe=new E.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}});u.defaults.baseURL||(u.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet");const se=v.createContext(void 0),Ie=(c,a)=>{const e=`${window.location.protocol}//${window.location.host}/api/v0`,r=u.create({baseURL:c||e,withCredentials:!0,timeout:6e5});r.interceptors.request.use(async o=>{const s=await a?.();return o.headers.Authorization=s||"",o});const t=new re({basePath:e});return{models:new G(t,e,r),publisher:new ee(t,e,r),projects:new X(t,e,r),packages:new K(t,e,r),notebooks:new _(t,e,r),connections:new L(t,e,r),databases:new D(t,e,r),watchMode:new ae(t,e,r)}},Ue=({children:c,getAccessToken:a,baseURL:e,mutable:r})=>{const t=v.useMemo(()=>Ie(e,a),[e,a]),o=e||`${window.location.protocol}//${window.location.host}/api/v0`,[s,n]=v.useState(r),[l,i]=v.useState(!0);v.useEffect(()=>{let d=!0;return(async()=>{try{const j=await t.publisher.getStatus();if(d){const w=j.data?.frozenConfig;let T;w?T=!1:r===void 0?T=!0:T=r,n(T),i(!1)}}catch(j){console.error("Failed to fetch publisher status:",j),d&&(n(r),i(!1))}})(),()=>{d=!1}},[t,r]);const p={server:o,getAccessToken:a,apiClients:t,mutable:s,isLoadingStatus:l};return B.jsx(E.QueryClientProvider,{client:oe,children:B.jsx(se.Provider,{value:p,children:c})})},Te=()=>{const c=v.useContext(se);if(c===void 0)throw new Error("useServer must be used within a ServerProvider");return c};exports.AttachedDatabaseTypeEnum=ce;exports.AzureConnectionAuthTypeEnum=le;exports.CompileProblemSeverityEnum=ie;exports.CompileResultStatusEnum=pe;exports.Configuration=re;exports.ConnectionStatusStatusEnum=he;exports.ConnectionTypeEnum=de;exports.ConnectionsApi=L;exports.ConnectionsApiAxiosParamCreator=$;exports.ConnectionsApiFactory=ge;exports.ConnectionsApiFp=S;exports.ConnectionsTestApi=Se;exports.ConnectionsTestApiAxiosParamCreator=H;exports.ConnectionsTestApiFactory=Ce;exports.ConnectionsTestApiFp=Q;exports.DatabaseTypeEnum=ue;exports.DatabasesApi=D;exports.DatabasesApiAxiosParamCreator=W;exports.DatabasesApiFactory=ye;exports.DatabasesApiFp=M;exports.ExecuteNotebookCellBypassFiltersEnum=xe;exports.FilterTypeEnum=me;exports.LogMessageSeverityEnum=Pe;exports.ModelsApi=G;exports.ModelsApiAxiosParamCreator=f;exports.ModelsApiFactory=Ae;exports.ModelsApiFp=R;exports.NotebookCellResultTypeEnum=be;exports.NotebookCellTypeEnum=Ve;exports.NotebooksApi=_;exports.NotebooksApiAxiosParamCreator=z;exports.NotebooksApiFactory=je;exports.NotebooksApiFp=I;exports.PackagesApi=K;exports.PackagesApiAxiosParamCreator=J;exports.PackagesApiFactory=ke;exports.PackagesApiFp=k;exports.ProjectsApi=X;exports.ProjectsApiAxiosParamCreator=Y;exports.ProjectsApiFactory=Ne;exports.ProjectsApiFp=N;exports.PublisherApi=ee;exports.PublisherApiAxiosParamCreator=Z;exports.PublisherApiFactory=ve;exports.PublisherApiFp=q;exports.ServerProvider=Ue;exports.ServerStatusOperationalStateEnum=Oe;exports.WatchModeApi=ae;exports.WatchModeApiAxiosParamCreator=te;exports.WatchModeApiFactory=Re;exports.WatchModeApiFp=U;exports.globalQueryClient=oe;exports.useServer=Te;
|