@anvil-works/anvil-cli 0.8.0-canary.15 → 0.8.0-canary.16
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/cli.js +82 -89
- package/dist/commands/db.d.ts +3 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/env.d.ts +3 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/program.d.ts.map +1 -1
- package/dist/services/db.d.ts +7 -0
- package/dist/services/db.d.ts.map +1 -0
- package/dist/services/deps.d.ts.map +1 -1
- package/dist/services/environment.d.ts +5 -0
- package/dist/services/environment.d.ts.map +1 -0
- package/dist/services/http.d.ts +2 -0
- package/dist/services/http.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/commands/tables.d.ts +0 -7
- package/dist/commands/tables.d.ts.map +0 -1
- package/dist/services/tables.d.ts +0 -27
- package/dist/services/tables.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -12904,6 +12904,9 @@ var __webpack_exports__ = {};
|
|
|
12904
12904
|
function getGlobalOutputConfig() {
|
|
12905
12905
|
return globalOutputConfig;
|
|
12906
12906
|
}
|
|
12907
|
+
function canPrompt() {
|
|
12908
|
+
return !globalOutputConfig.jsonMode && !!(process.stdin.isTTY && process.stdout.isTTY);
|
|
12909
|
+
}
|
|
12907
12910
|
function assertCanPrompt(action = "This command", explicitAlternative = "Pass explicit flags instead.") {
|
|
12908
12911
|
if (globalOutputConfig.jsonMode) throw new Error(`${action} requires interactive input, but --json disables prompts. ${explicitAlternative}`);
|
|
12909
12912
|
if (!process.stdin.isTTY || !process.stdout.isTTY) throw new Error(`${action} requires interactive input, but stdin/stdout is not a TTY. ${explicitAlternative}`);
|
|
@@ -14507,6 +14510,14 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
|
|
|
14507
14510
|
html: htmlContent
|
|
14508
14511
|
};
|
|
14509
14512
|
}
|
|
14513
|
+
function formatHttpError(prefix, status, body) {
|
|
14514
|
+
if (!body) return `${prefix}: ${status}`;
|
|
14515
|
+
try {
|
|
14516
|
+
const parsed = JSON.parse(body);
|
|
14517
|
+
if ("string" == typeof parsed.error && parsed.error.trim()) return `${prefix}: ${parsed.error} (${status})`;
|
|
14518
|
+
} catch {}
|
|
14519
|
+
return `${prefix}: ${status} ${body}`;
|
|
14520
|
+
}
|
|
14510
14521
|
const ANVIL_GITIGNORE_ENTRY = "/.anvil/";
|
|
14511
14522
|
async function ensureProjectGitignoreIgnoresAnvilDir(projectRoot) {
|
|
14512
14523
|
const rootGitignorePath = external_path_default().join(projectRoot, ".gitignore");
|
|
@@ -14526,14 +14537,6 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
|
|
|
14526
14537
|
const ANVIL_DEPS_MANIFEST = "manifest.json";
|
|
14527
14538
|
const DEPS_MANIFEST_VERSION = 2;
|
|
14528
14539
|
const DEPENDENCY_CACHE_WARNING = "Dependency cache is missing or stale. Run `anvil deps fetch` before validation.";
|
|
14529
|
-
function formatFetchError(prefix, status, errorBody) {
|
|
14530
|
-
if (!errorBody) return `${prefix}: ${status}`;
|
|
14531
|
-
try {
|
|
14532
|
-
const parsed = JSON.parse(errorBody);
|
|
14533
|
-
if ("string" == typeof parsed.error && parsed.error.trim()) return `${prefix}: ${parsed.error} (${status})`;
|
|
14534
|
-
} catch {}
|
|
14535
|
-
return `${prefix}: ${status} ${errorBody}`;
|
|
14536
|
-
}
|
|
14537
14540
|
async function fetchAllDependencies(appId, anvilUrl = resolveAnvilUrl(), options = {}) {
|
|
14538
14541
|
const { commit, includeDocs = true, knownDependencies = [] } = options;
|
|
14539
14542
|
const token = await auth_getValidAuthToken(anvilUrl);
|
|
@@ -14552,7 +14555,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
|
|
|
14552
14555
|
});
|
|
14553
14556
|
if (!resp.ok) {
|
|
14554
14557
|
const errorBody = await resp.text();
|
|
14555
|
-
throw new Error(
|
|
14558
|
+
throw new Error(formatHttpError("Failed to fetch dependencies", resp.status, errorBody));
|
|
14556
14559
|
}
|
|
14557
14560
|
return await resp.json();
|
|
14558
14561
|
}
|
|
@@ -23611,99 +23614,88 @@ print(json.dumps({"issues": issues}))
|
|
|
23611
23614
|
}
|
|
23612
23615
|
});
|
|
23613
23616
|
}
|
|
23614
|
-
|
|
23615
|
-
|
|
23616
|
-
|
|
23617
|
-
|
|
23618
|
-
const parsed = JSON.parse(errorBody);
|
|
23619
|
-
if ("string" == typeof parsed.error && parsed.error.trim()) return `${prefix}: ${parsed.error} (${status})`;
|
|
23620
|
-
} catch {}
|
|
23621
|
-
return `${prefix}: ${status} ${errorBody}`;
|
|
23622
|
-
}
|
|
23623
|
-
async function fetchTableMappings(appId, anvilUrl = resolveAnvilUrl()) {
|
|
23617
|
+
async function applyDatabaseSchema(appId, options = {}) {
|
|
23618
|
+
const anvilUrl = options.anvilUrl ?? resolveAnvilUrl();
|
|
23619
|
+
const projectRoot = options.projectRoot ?? process.cwd();
|
|
23620
|
+
const appYaml = external_js_yaml_default().load(await external_fs_.promises.readFile(external_path_default().join(projectRoot, "anvil.yaml"), "utf8"));
|
|
23624
23621
|
const token = await auth_getValidAuthToken(anvilUrl);
|
|
23625
|
-
const
|
|
23622
|
+
const response = await fetch(`${anvilUrl}/ide/api/_/apps/${appId}/db/infer-from-env/apply-schema`, {
|
|
23623
|
+
method: "PUT",
|
|
23626
23624
|
headers: {
|
|
23627
|
-
Authorization: `Bearer ${token}
|
|
23628
|
-
|
|
23629
|
-
|
|
23630
|
-
|
|
23631
|
-
|
|
23632
|
-
|
|
23633
|
-
|
|
23634
|
-
const databases = await resp.json();
|
|
23635
|
-
const allTables = [];
|
|
23636
|
-
for (const db of databases)for (const table of db.tables || [])allTables.push({
|
|
23637
|
-
table_id: table.id,
|
|
23638
|
-
python_name: table.python_name,
|
|
23639
|
-
name: table.name
|
|
23640
|
-
});
|
|
23641
|
-
return {
|
|
23642
|
-
tables: allTables
|
|
23643
|
-
};
|
|
23644
|
-
}
|
|
23645
|
-
async function writeTableMappings(projectRoot, mappings) {
|
|
23646
|
-
const filePath = external_path_default().join(projectRoot, TABLE_MAPPINGS_PATH);
|
|
23647
|
-
await promises_default().mkdir(external_path_default().dirname(filePath), {
|
|
23648
|
-
recursive: true
|
|
23625
|
+
Authorization: `Bearer ${token}`,
|
|
23626
|
+
"Content-Type": "application/json"
|
|
23627
|
+
},
|
|
23628
|
+
body: JSON.stringify({
|
|
23629
|
+
schema: appYaml?.db_schema ?? {},
|
|
23630
|
+
table_id_hints: appYaml?.table_id_hints
|
|
23631
|
+
})
|
|
23649
23632
|
});
|
|
23650
|
-
|
|
23651
|
-
|
|
23652
|
-
async function readTableMappings(projectRoot) {
|
|
23653
|
-
const filePath = external_path_default().join(projectRoot, TABLE_MAPPINGS_PATH);
|
|
23654
|
-
try {
|
|
23655
|
-
const content = await promises_default().readFile(filePath, "utf-8");
|
|
23656
|
-
return JSON.parse(content);
|
|
23657
|
-
} catch {
|
|
23658
|
-
return null;
|
|
23659
|
-
}
|
|
23633
|
+
if (!response.ok) throw new Error(formatHttpError("Failed to apply database schema", response.status, await response.text()));
|
|
23634
|
+
return await response.json();
|
|
23660
23635
|
}
|
|
23661
|
-
async function
|
|
23662
|
-
|
|
23663
|
-
|
|
23664
|
-
force: true
|
|
23665
|
-
});
|
|
23636
|
+
async function confirmSchemaApplication(message) {
|
|
23637
|
+
if (!canPrompt()) return true;
|
|
23638
|
+
return logger_logger.confirm(message, true);
|
|
23666
23639
|
}
|
|
23667
|
-
function
|
|
23668
|
-
|
|
23669
|
-
|
|
23640
|
+
function registerDbCommand(program) {
|
|
23641
|
+
if ("1" !== process.env.ANVIL_AGENT_HOST) return;
|
|
23642
|
+
const db = program.command("db").description("Manage app databases");
|
|
23643
|
+
db.command("apply-schema").description("Apply the app schema to the database for the current environment").action(async ()=>{
|
|
23670
23644
|
try {
|
|
23671
23645
|
const projectRoot = process.cwd();
|
|
23646
|
+
auth_setRepoContext(projectRoot);
|
|
23672
23647
|
const anvilUrl = resolveAnvilUrl();
|
|
23673
|
-
const
|
|
23674
|
-
if (!
|
|
23675
|
-
|
|
23676
|
-
|
|
23677
|
-
|
|
23678
|
-
|
|
23679
|
-
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
|
|
23648
|
+
const appId = await resolvePrimaryAppId(projectRoot, anvilUrl);
|
|
23649
|
+
if (!appId) throw new Error("No Anvil app found in current directory. Make sure you're in a directory with an Anvil app git remote.");
|
|
23650
|
+
if (!await confirmSchemaApplication("Apply the app environment's schema to its database? This may delete tables, columns, or data.")) return void logger_logger.info("Schema application cancelled.");
|
|
23651
|
+
const response = await applyDatabaseSchema(appId, {
|
|
23652
|
+
anvilUrl,
|
|
23653
|
+
projectRoot
|
|
23654
|
+
});
|
|
23655
|
+
if (getGlobalOutputConfig().jsonMode) logJsonResult(true, {
|
|
23656
|
+
data: response
|
|
23657
|
+
});
|
|
23658
|
+
else logger_logger.success("Database schema applied.");
|
|
23659
|
+
} catch (error) {
|
|
23660
|
+
const message = errors_getErrorMessage(error);
|
|
23661
|
+
if (getGlobalOutputConfig().jsonMode) logJsonResult(false, {
|
|
23662
|
+
error: message
|
|
23663
|
+
});
|
|
23664
|
+
else logger_logger.error(message);
|
|
23687
23665
|
process.exit(1);
|
|
23688
23666
|
}
|
|
23689
23667
|
});
|
|
23690
|
-
|
|
23691
|
-
|
|
23692
|
-
|
|
23693
|
-
|
|
23694
|
-
|
|
23695
|
-
|
|
23696
|
-
|
|
23697
|
-
|
|
23698
|
-
process.exit(1);
|
|
23668
|
+
}
|
|
23669
|
+
async function ensureEnvironmentUrl(appId, envPid, options = {}) {
|
|
23670
|
+
const anvilUrl = options.anvilUrl ?? resolveAnvilUrl();
|
|
23671
|
+
const token = await auth_getValidAuthToken(anvilUrl);
|
|
23672
|
+
const response = await fetch(`${anvilUrl}/ide/api/_/apps/${encodeURIComponent(appId)}/environments/${encodeURIComponent(envPid)}/ensure-url`, {
|
|
23673
|
+
method: "POST",
|
|
23674
|
+
headers: {
|
|
23675
|
+
Authorization: `Bearer ${token}`
|
|
23699
23676
|
}
|
|
23700
23677
|
});
|
|
23701
|
-
|
|
23678
|
+
if (!response.ok) throw new Error(formatHttpError("Failed to get environment URL", response.status, await response.text()));
|
|
23679
|
+
const result = await response.json();
|
|
23680
|
+
return result.url;
|
|
23681
|
+
}
|
|
23682
|
+
function registerEnvCommand(program) {
|
|
23683
|
+
if ("1" !== process.env.ANVIL_AGENT_HOST) return;
|
|
23684
|
+
const env = program.command("env").description("Manage app environments");
|
|
23685
|
+
env.command("url").description("Get a private app URL for the current environment, creating one if necessary").action(async ()=>{
|
|
23702
23686
|
try {
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23687
|
+
const projectRoot = process.cwd();
|
|
23688
|
+
const envPid = await readEnvironmentPid(projectRoot);
|
|
23689
|
+
if (!envPid) throw new Error("No app environment associated with the current directory.");
|
|
23690
|
+
auth_setRepoContext(projectRoot);
|
|
23691
|
+
const anvilUrl = resolveAnvilUrl();
|
|
23692
|
+
const appId = await resolvePrimaryAppId(projectRoot, anvilUrl);
|
|
23693
|
+
if (!appId) throw new Error("No Anvil app found in current directory. Make sure you're in a directory with an Anvil app git remote.");
|
|
23694
|
+
logger_logger.info(await ensureEnvironmentUrl(appId, envPid, {
|
|
23695
|
+
anvilUrl
|
|
23696
|
+
}));
|
|
23697
|
+
} catch (error) {
|
|
23698
|
+
logger_logger.error(errors_getErrorMessage(error));
|
|
23707
23699
|
process.exit(1);
|
|
23708
23700
|
}
|
|
23709
23701
|
});
|
|
@@ -24128,7 +24120,8 @@ print(json.dumps({"issues": issues}))
|
|
|
24128
24120
|
registerVersionCommand(program, VERSION);
|
|
24129
24121
|
registerConfigureCommand(program, VERSION);
|
|
24130
24122
|
registerDepsCommand(program);
|
|
24131
|
-
|
|
24123
|
+
registerDbCommand(program);
|
|
24124
|
+
registerEnvCommand(program);
|
|
24132
24125
|
program.command("update").description("Update anvil to the latest version").alias("u").action(async ()=>{
|
|
24133
24126
|
await handleUpdateCommand();
|
|
24134
24127
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBpC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4CxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/commands/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgCzD"}
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -13,5 +13,6 @@ export { registerConvertTemplateCommand } from "./convertTemplate";
|
|
|
13
13
|
export { registerVersionCommand } from "./version";
|
|
14
14
|
export { registerConfigureCommand } from "./configure";
|
|
15
15
|
export { registerDepsCommand } from "./deps";
|
|
16
|
-
export {
|
|
16
|
+
export { registerDbCommand } from "./db";
|
|
17
|
+
export { registerEnvCommand } from "./env";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14578,6 +14578,14 @@ Promise.resolve()
|
|
|
14578
14578
|
html: htmlContent
|
|
14579
14579
|
};
|
|
14580
14580
|
}
|
|
14581
|
+
function formatHttpError(prefix, status, body) {
|
|
14582
|
+
if (!body) return `${prefix}: ${status}`;
|
|
14583
|
+
try {
|
|
14584
|
+
const parsed = JSON.parse(body);
|
|
14585
|
+
if ("string" == typeof parsed.error && parsed.error.trim()) return `${prefix}: ${parsed.error} (${status})`;
|
|
14586
|
+
} catch {}
|
|
14587
|
+
return `${prefix}: ${status} ${body}`;
|
|
14588
|
+
}
|
|
14581
14589
|
const ANVIL_GITIGNORE_ENTRY = "/.anvil/";
|
|
14582
14590
|
async function ensureProjectGitignoreIgnoresAnvilDir(projectRoot) {
|
|
14583
14591
|
const rootGitignorePath = external_path_default().join(projectRoot, ".gitignore");
|
|
@@ -14596,14 +14604,6 @@ Promise.resolve()
|
|
|
14596
14604
|
const ANVIL_DEPS_DIR = ".anvil/deps";
|
|
14597
14605
|
const ANVIL_DEPS_MANIFEST = "manifest.json";
|
|
14598
14606
|
const DEPS_MANIFEST_VERSION = 2;
|
|
14599
|
-
function formatFetchError(prefix, status, errorBody) {
|
|
14600
|
-
if (!errorBody) return `${prefix}: ${status}`;
|
|
14601
|
-
try {
|
|
14602
|
-
const parsed = JSON.parse(errorBody);
|
|
14603
|
-
if ("string" == typeof parsed.error && parsed.error.trim()) return `${prefix}: ${parsed.error} (${status})`;
|
|
14604
|
-
} catch {}
|
|
14605
|
-
return `${prefix}: ${status} ${errorBody}`;
|
|
14606
|
-
}
|
|
14607
14607
|
async function fetchAllDependencies(appId, anvilUrl = resolveAnvilUrl(), options = {}) {
|
|
14608
14608
|
const { commit, includeDocs = true, knownDependencies = [] } = options;
|
|
14609
14609
|
const token = await auth_getValidAuthToken(anvilUrl);
|
|
@@ -14622,7 +14622,7 @@ Promise.resolve()
|
|
|
14622
14622
|
});
|
|
14623
14623
|
if (!resp.ok) {
|
|
14624
14624
|
const errorBody = await resp.text();
|
|
14625
|
-
throw new Error(
|
|
14625
|
+
throw new Error(formatHttpError("Failed to fetch dependencies", resp.status, errorBody));
|
|
14626
14626
|
}
|
|
14627
14627
|
return await resp.json();
|
|
14628
14628
|
}
|
package/dist/program.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+BpC,OAAO,EAAyD,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAiC3G,KAAK,sBAAsB,GAAG,eAAe,GAAG;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAoKF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,MAAM,CAO7F;AAmLD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,MAAM,EAAE,CAezE;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAwFzD;AAiBD,wBAAgB,YAAY,IAAI,OAAO,CAmGtC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ApplyDatabaseSchemaOptions {
|
|
2
|
+
anvilUrl?: string;
|
|
3
|
+
projectRoot?: string;
|
|
4
|
+
}
|
|
5
|
+
/** Apply the current app environment's source schema to its database. */
|
|
6
|
+
export declare function applyDatabaseSchema(appId: string, options?: ApplyDatabaseSchemaOptions): Promise<Record<string, never>>;
|
|
7
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/services/db.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yEAAyE;AACzE,wBAAsB,mBAAmB,CACrC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,0BAA+B,GACzC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAwBhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../src/services/deps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../../src/services/deps.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,qBAAqB,IAAI,CAAC;AAGhC,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,2BAA2B;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,CAAC,EAAE,+BAA+B,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,6BAA6B;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IACzC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,mBAAmB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE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AAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,OAAO,CAAC,IAAI,CAAC,CA+Cf;AAMD;;GAEG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAO9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/services/environment.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,2BAA2B;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,2BAAgC,GAC1C,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/services/http.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAepF"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/commands/tables.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoE5D"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export interface TableMapping {
|
|
2
|
-
table_id: number;
|
|
3
|
-
python_name: string;
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
export interface TableMappingsResponse {
|
|
7
|
-
tables: TableMapping[];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Fetch table mappings from the Anvil server.
|
|
11
|
-
* Extracts table_id -> python_name mappings from all databases.
|
|
12
|
-
*/
|
|
13
|
-
export declare function fetchTableMappings(appId: string, anvilUrl?: string): Promise<TableMappingsResponse>;
|
|
14
|
-
/**
|
|
15
|
-
* Write table mappings to .anvil/table-mappings.json
|
|
16
|
-
*/
|
|
17
|
-
export declare function writeTableMappings(projectRoot: string, mappings: TableMappingsResponse): Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Read table mappings from .anvil/table-mappings.json
|
|
20
|
-
* Returns null if file does not exist.
|
|
21
|
-
*/
|
|
22
|
-
export declare function readTableMappings(projectRoot: string): Promise<TableMappingsResponse | null>;
|
|
23
|
-
/**
|
|
24
|
-
* Clear table mappings file.
|
|
25
|
-
*/
|
|
26
|
-
export declare function clearTableMappings(projectRoot: string): Promise<void>;
|
|
27
|
-
//# sourceMappingURL=tables.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../src/services/tables.ts"],"names":[],"mappings":"AAgCA,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,YAAY,EAAE,CAAC;CAC1B;AAkBD;;;GAGG;AACH,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,MAAM,EACb,QAAQ,SAAoB,GAC7B,OAAO,CAAC,qBAAqB,CAAC,CAwBhC;AAMD;;GAEG;AACH,wBAAsB,kBAAkB,CACpC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,qBAAqB,GAChC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACnC,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAQvC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3E"}
|