oleander-cli 0.25.1 → 0.25.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +41 -36
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -35457,6 +35457,7 @@ function registerSparkClustersCommand(cluster) {
|
|
|
35457
35457
|
// src/commands/spark/init.ts
|
|
35458
35458
|
var import_node_fs = require("fs");
|
|
35459
35459
|
var import_node_child_process = require("child_process");
|
|
35460
|
+
var import_node_crypto2 = require("crypto");
|
|
35460
35461
|
var import_node_path2 = require("path");
|
|
35461
35462
|
var import_node_os3 = require("os");
|
|
35462
35463
|
|
|
@@ -37783,8 +37784,13 @@ var inquirer = {
|
|
|
37783
37784
|
var lib_default = inquirer;
|
|
37784
37785
|
|
|
37785
37786
|
// src/commands/spark/init.ts
|
|
37786
|
-
var TEMPLATE_ARCHIVE_URL = "https://api.github.com/repos/OleanderHQ/pyspark-template/tarball";
|
|
37787
37787
|
var TEMPLATE_REPOSITORY_URL = "https://github.com/OleanderHQ/pyspark-template";
|
|
37788
|
+
var TEMPLATE_COMMIT = "bbbb217f967a5876a8e1b6228336092c1d637ac2";
|
|
37789
|
+
var TEMPLATE_ARCHIVE_SHA256 = "6304d6e05b6957eeb259b5947ac77a42dbc05feddaed7ea9de071c6106036373";
|
|
37790
|
+
var TEMPLATE_ARCHIVE_URLS = [
|
|
37791
|
+
`${TEMPLATE_REPOSITORY_URL}/archive/${TEMPLATE_COMMIT}.tar.gz`,
|
|
37792
|
+
`https://codeload.github.com/OleanderHQ/pyspark-template/tar.gz/${TEMPLATE_COMMIT}`
|
|
37793
|
+
];
|
|
37788
37794
|
var TEMPLATE_ENTRYPOINT_NAME = "entrypoint.py";
|
|
37789
37795
|
var TEMPLATE_CUSTOM_PACKAGE_NAME = "mylib";
|
|
37790
37796
|
var TEMPLATE_SPARK_JOB_CONFIG_NAME = "spark-job.mk";
|
|
@@ -37914,16 +37920,31 @@ function assertValidCustomPackageName(value) {
|
|
|
37914
37920
|
}
|
|
37915
37921
|
}
|
|
37916
37922
|
async function downloadTemplateArchive(archivePath) {
|
|
37923
|
+
const failures = [];
|
|
37924
|
+
for (const url of TEMPLATE_ARCHIVE_URLS) {
|
|
37925
|
+
try {
|
|
37926
|
+
await downloadFile(url, archivePath);
|
|
37927
|
+
const actualSha256 = (0, import_node_crypto2.createHash)("sha256").update(await import_node_fs.promises.readFile(archivePath)).digest("hex");
|
|
37928
|
+
if (actualSha256 !== TEMPLATE_ARCHIVE_SHA256) {
|
|
37929
|
+
throw new Error(
|
|
37930
|
+
`checksum mismatch (expected sha256 ${TEMPLATE_ARCHIVE_SHA256}, got ${actualSha256})`
|
|
37931
|
+
);
|
|
37932
|
+
}
|
|
37933
|
+
return;
|
|
37934
|
+
} catch (error) {
|
|
37935
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
37936
|
+
failures.push(`${url}: ${reason.trim()}`);
|
|
37937
|
+
}
|
|
37938
|
+
}
|
|
37939
|
+
throw new Error(
|
|
37940
|
+
`Failed to download template archive:
|
|
37941
|
+
${failures.join("\n")}`
|
|
37942
|
+
);
|
|
37943
|
+
}
|
|
37944
|
+
async function downloadFile(url, outputPath) {
|
|
37917
37945
|
const curl = (0, import_node_child_process.spawnSync)(
|
|
37918
37946
|
"curl",
|
|
37919
|
-
[
|
|
37920
|
-
"-fsSL",
|
|
37921
|
-
"-H",
|
|
37922
|
-
"User-Agent: oleander-cli",
|
|
37923
|
-
TEMPLATE_ARCHIVE_URL,
|
|
37924
|
-
"-o",
|
|
37925
|
-
archivePath
|
|
37926
|
-
],
|
|
37947
|
+
["-fsSL", "-H", "User-Agent: oleander-cli", url, "-o", outputPath],
|
|
37927
37948
|
{
|
|
37928
37949
|
encoding: "utf-8"
|
|
37929
37950
|
}
|
|
@@ -37933,25 +37954,20 @@ async function downloadTemplateArchive(archivePath) {
|
|
|
37933
37954
|
return;
|
|
37934
37955
|
}
|
|
37935
37956
|
if (curlError?.code && curlError.code !== "ENOENT") {
|
|
37936
|
-
throw new Error(
|
|
37937
|
-
`Failed to download template archive: ${curlError.message}`
|
|
37938
|
-
);
|
|
37957
|
+
throw new Error(curlError.message);
|
|
37939
37958
|
}
|
|
37940
37959
|
if (!curlError && curl.status !== 0) {
|
|
37941
37960
|
throw new Error(
|
|
37942
|
-
|
|
37961
|
+
curl.stderr || curl.stdout || `curl exited with status ${curl.status}`
|
|
37943
37962
|
);
|
|
37944
37963
|
}
|
|
37945
|
-
const response = await fetch(
|
|
37964
|
+
const response = await fetch(url, {
|
|
37946
37965
|
headers: { "User-Agent": "oleander-cli" }
|
|
37947
37966
|
});
|
|
37948
37967
|
if (!response.ok) {
|
|
37949
|
-
throw new Error(
|
|
37950
|
-
`Failed to download template archive: ${response.status} ${response.statusText}`
|
|
37951
|
-
);
|
|
37968
|
+
throw new Error(`${response.status} ${response.statusText}`);
|
|
37952
37969
|
}
|
|
37953
|
-
|
|
37954
|
-
await import_node_fs.promises.writeFile(archivePath, archiveBuffer);
|
|
37970
|
+
await import_node_fs.promises.writeFile(outputPath, Buffer.from(await response.arrayBuffer()));
|
|
37955
37971
|
}
|
|
37956
37972
|
function extractTemplateArchive(archivePath, extractedTemplateDir) {
|
|
37957
37973
|
const tar = (0, import_node_child_process.spawnSync)(
|
|
@@ -43758,18 +43774,12 @@ function registerCatalogNamespaceCommands(namespaces) {
|
|
|
43758
43774
|
|
|
43759
43775
|
// src/commands/catalogs/list-format.ts
|
|
43760
43776
|
var TYPE_ORDER = ["lakekeeper", "s3tables", "horizon", "tableflow"];
|
|
43761
|
-
var TYPE_LABEL = {
|
|
43762
|
-
lakekeeper: "oleander-managed",
|
|
43763
|
-
s3tables: "Amazon S3 Tables",
|
|
43764
|
-
horizon: "Snowflake Horizon",
|
|
43765
|
-
tableflow: "Confluent Tableflow"
|
|
43766
|
-
};
|
|
43767
43777
|
var EMPTY_REGION = "\u2014";
|
|
43768
43778
|
function catalogsToResults(catalogs) {
|
|
43769
43779
|
const columns = ["catalog", "type", "region", "created"];
|
|
43770
43780
|
const rows = [...catalogs].sort(compareCatalogType).map((catalog) => [
|
|
43771
43781
|
catalog.name ?? null,
|
|
43772
|
-
|
|
43782
|
+
catalog.type ?? null,
|
|
43773
43783
|
propertyValue(catalog, "region"),
|
|
43774
43784
|
formatCreated(catalog.created_at)
|
|
43775
43785
|
]);
|
|
@@ -43798,10 +43808,6 @@ function compareCatalogType(left2, right2) {
|
|
|
43798
43808
|
if (rightIndex === -1) return -1;
|
|
43799
43809
|
return leftIndex - rightIndex;
|
|
43800
43810
|
}
|
|
43801
|
-
function catalogTypeLabel(type) {
|
|
43802
|
-
if (!type) return null;
|
|
43803
|
-
return TYPE_LABEL[type] ?? type;
|
|
43804
|
-
}
|
|
43805
43811
|
function formatCreated(value) {
|
|
43806
43812
|
if (!value) return null;
|
|
43807
43813
|
const match = /^(\d{4}-\d{2}-\d{2})/.exec(value);
|
|
@@ -43920,9 +43926,8 @@ var FIELDS_BY_TYPE = {
|
|
|
43920
43926
|
};
|
|
43921
43927
|
function catalogDetailFields(catalog) {
|
|
43922
43928
|
const fields = [];
|
|
43923
|
-
|
|
43924
|
-
|
|
43925
|
-
fields.push({ key: "type", label: "Type", value: type });
|
|
43929
|
+
if (catalog.type) {
|
|
43930
|
+
fields.push({ key: "type", label: "Type", value: catalog.type });
|
|
43926
43931
|
}
|
|
43927
43932
|
for (const field of FIELDS_BY_TYPE[catalog.type ?? ""] ?? []) {
|
|
43928
43933
|
const value = propertyValue2(catalog, field.key);
|
|
@@ -45419,7 +45424,7 @@ var import_path5 = require("path");
|
|
|
45419
45424
|
var import_node_fs4 = require("fs");
|
|
45420
45425
|
|
|
45421
45426
|
// src/utils/duckdb-runtime.ts
|
|
45422
|
-
var
|
|
45427
|
+
var import_node_crypto3 = require("crypto");
|
|
45423
45428
|
var import_node_fs3 = require("fs");
|
|
45424
45429
|
var import_node_path4 = require("path");
|
|
45425
45430
|
var import_node_zlib = require("zlib");
|
|
@@ -45469,7 +45474,7 @@ async function ensureDuckdb(target) {
|
|
|
45469
45474
|
);
|
|
45470
45475
|
}
|
|
45471
45476
|
const archive = Buffer.from(await response.arrayBuffer());
|
|
45472
|
-
const digest = (0,
|
|
45477
|
+
const digest = (0, import_node_crypto3.createHash)("sha256").update(archive).digest("hex");
|
|
45473
45478
|
if (digest !== target.sha256) {
|
|
45474
45479
|
throw new Error(
|
|
45475
45480
|
`DuckDB ${DUCKDB_VERSION} download did not match its checksum`
|
|
@@ -45770,7 +45775,7 @@ var import_fs7 = require("fs");
|
|
|
45770
45775
|
// package.json
|
|
45771
45776
|
var package_default = {
|
|
45772
45777
|
name: "oleander-cli",
|
|
45773
|
-
version: "0.25.
|
|
45778
|
+
version: "0.25.3",
|
|
45774
45779
|
description: "oleander CLI",
|
|
45775
45780
|
keywords: [
|
|
45776
45781
|
"cli",
|