@fabric-harness/databricks 3.0.0 → 3.0.2

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Digest a release artifact using the standard SHA-256 file digest. Directory targets use a
3
+ * deterministic, tagged tree digest so deployment bundles can be certified without archiving them.
4
+ */
5
+ export declare function digestDatabricksArtifact(target: string): Promise<string>;
6
+ //# sourceMappingURL=artifact-digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-digest.d.ts","sourceRoot":"","sources":["../src/artifact-digest.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAwB9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"certification-sweeper.d.ts","sourceRoot":"","sources":["../src/certification-sweeper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,wCAAwC,mCAAmC,CAAC;AAGzF,MAAM,WAAW,mCAAmC;IAClD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,cAAc,GAAG,WAAW,CAAC,CAAC;IACrD,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACxD,YAAY,EAAE,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AC;CAC9C;AAED,kFAAkF;AAClF,wBAAsB,qCAAqC,CACzD,OAAO,EAAE,mCAAmC,EAC5C,OAAO,GAAE,mCAAwC,GAChD,OAAO,CAAC,kCAAkC,CAAC,CAqH7C"}
package/dist/certify.js CHANGED
@@ -1793,9 +1793,9 @@ var require_json_bigint = __commonJS({
1793
1793
  });
1794
1794
 
1795
1795
  // src/certify.ts
1796
- import { createHash, randomUUID } from "crypto";
1797
- import { mkdir, readFile as readFile2, readdir, stat as stat2, writeFile } from "fs/promises";
1798
- import path from "path";
1796
+ import { createHash as createHash2, randomUUID } from "crypto";
1797
+ import { mkdir, readFile as readFile3, writeFile } from "fs/promises";
1798
+ import path2 from "path";
1799
1799
  import {
1800
1800
  evaluateToolCallPolicy as evaluateToolCallPolicy2,
1801
1801
  runWithSubmissionContext
@@ -1951,13 +1951,13 @@ function connectionResourceName(value) {
1951
1951
  ).join(".")}`;
1952
1952
  }
1953
1953
  function externalBasePath(value) {
1954
- const path2 = value.trim();
1955
- if (!path2.startsWith("/") || path2.startsWith("//") || path2.includes("?") || path2.includes("#")) {
1954
+ const path3 = value.trim();
1955
+ if (!path3.startsWith("/") || path3.startsWith("//") || path3.includes("?") || path3.includes("#")) {
1956
1956
  throw new Error(
1957
1957
  "databricks agent services: basePath must be an absolute URL path without a query or fragment."
1958
1958
  );
1959
1959
  }
1960
- return path2;
1960
+ return path3;
1961
1961
  }
1962
1962
  function ucIdentifier(value, label) {
1963
1963
  const normalized = value.trim();
@@ -2016,6 +2016,35 @@ function positiveInteger(value, name) {
2016
2016
  return value;
2017
2017
  }
2018
2018
 
2019
+ // src/artifact-digest.ts
2020
+ import { createHash } from "crypto";
2021
+ import { readFile, readdir, stat } from "fs/promises";
2022
+ import path from "path";
2023
+ async function digestDatabricksArtifact(target) {
2024
+ const targetInfo = await stat(target);
2025
+ if (!targetInfo.isDirectory()) {
2026
+ return createHash("sha256").update(await readFile(target)).digest("hex");
2027
+ }
2028
+ const hash2 = createHash("sha256");
2029
+ async function append(directory, relativeDirectory) {
2030
+ for (const name of (await readdir(directory)).sort()) {
2031
+ const candidate = path.join(directory, name);
2032
+ const relative = path.join(relativeDirectory, name).replaceAll(path.sep, "/");
2033
+ const info = await stat(candidate);
2034
+ if (info.isDirectory()) {
2035
+ hash2.update(`directory\0${relative}\0`);
2036
+ await append(candidate, relative);
2037
+ } else {
2038
+ const bytes = await readFile(candidate);
2039
+ hash2.update(`file\0${relative}\0${bytes.byteLength}\0`);
2040
+ hash2.update(bytes);
2041
+ }
2042
+ }
2043
+ }
2044
+ await append(target, "");
2045
+ return hash2.digest("hex");
2046
+ }
2047
+
2019
2048
  // src/certification.ts
2020
2049
  import { redactText } from "@fabric-harness/sdk";
2021
2050
  var DATABRICKS_AUTHORING_CERTIFICATION_CHECKS = [
@@ -3963,16 +3992,16 @@ var DatabricksWorkspaceAuthoring = class {
3963
3992
  { retry: "never" }
3964
3993
  );
3965
3994
  }
3966
- deleteWorkspaceObject(path2, recursive = false) {
3995
+ deleteWorkspaceObject(path3, recursive = false) {
3967
3996
  return this.client.post(
3968
3997
  "/api/2.0/workspace/delete",
3969
- { path: path2, recursive },
3998
+ { path: path3, recursive },
3970
3999
  {},
3971
4000
  { retry: "never" }
3972
4001
  );
3973
4002
  }
3974
- mkdirs(path2) {
3975
- return this.client.post("/api/2.0/workspace/mkdirs", { path: path2 }, {}, { retry: "safe" });
4003
+ mkdirs(path3) {
4004
+ return this.client.post("/api/2.0/workspace/mkdirs", { path: path3 }, {}, { retry: "safe" });
3976
4005
  }
3977
4006
  };
3978
4007
  function databricksWorkspaceAuthoringTools(client2) {
@@ -4256,12 +4285,12 @@ function parseStringArray(value, label) {
4256
4285
  throw new Error(`databricks governance: ${label} must be a string array.`);
4257
4286
  return value;
4258
4287
  }
4259
- function pointerSegments(path2) {
4260
- return path2.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~"));
4288
+ function pointerSegments(path3) {
4289
+ return path3.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~"));
4261
4290
  }
4262
- function pointerValues(input, path2) {
4291
+ function pointerValues(input, path3) {
4263
4292
  let current = [input];
4264
- for (const segment of pointerSegments(path2)) {
4293
+ for (const segment of pointerSegments(path3)) {
4265
4294
  current = current.flatMap((value) => {
4266
4295
  if (segment === "*") return Array.isArray(value) ? value : [];
4267
4296
  if (!value || typeof value !== "object" || Array.isArray(value)) return [];
@@ -5977,8 +6006,8 @@ function snakeValue2(value) {
5977
6006
  );
5978
6007
  const attachment = record2.attachment;
5979
6008
  if (attachment && typeof attachment === "object" && !Array.isArray(attachment)) {
5980
- delete record2.attachment;
5981
- Object.assign(record2, attachment);
6009
+ const { attachment: _attachment, ...withoutAttachment } = record2;
6010
+ return { ...withoutAttachment, ...attachment };
5982
6011
  }
5983
6012
  return record2;
5984
6013
  }
@@ -6569,23 +6598,23 @@ var DatabricksPreviewClient = class {
6569
6598
  this.signal = options.signal;
6570
6599
  this.extraHeaders = options.extraHeaders;
6571
6600
  }
6572
- get(path2, query, options) {
6573
- return this.request("GET", path2, void 0, query, options);
6601
+ get(path3, query, options) {
6602
+ return this.request("GET", path3, void 0, query, options);
6574
6603
  }
6575
- post(path2, body, query, options) {
6576
- return this.request("POST", path2, body, query, options);
6604
+ post(path3, body, query, options) {
6605
+ return this.request("POST", path3, body, query, options);
6577
6606
  }
6578
- put(path2, body, query, options) {
6579
- return this.request("PUT", path2, body, query, options);
6607
+ put(path3, body, query, options) {
6608
+ return this.request("PUT", path3, body, query, options);
6580
6609
  }
6581
- patch(path2, body, query, options) {
6582
- return this.request("PATCH", path2, body, query, options);
6610
+ patch(path3, body, query, options) {
6611
+ return this.request("PATCH", path3, body, query, options);
6583
6612
  }
6584
- delete(path2, body, query, options) {
6585
- return this.request("DELETE", path2, body, query, options);
6613
+ delete(path3, body, query, options) {
6614
+ return this.request("DELETE", path3, body, query, options);
6586
6615
  }
6587
- async request(method, path2, body, query = {}, options = {}) {
6588
- const response = await this.requestRaw(method, path2, body, query, options);
6616
+ async request(method, path3, body, query = {}, options = {}) {
6617
+ const response = await this.requestRaw(method, path3, body, query, options);
6589
6618
  if (response.status === 204) return void 0;
6590
6619
  return await response.json();
6591
6620
  }
@@ -6593,8 +6622,8 @@ var DatabricksPreviewClient = class {
6593
6622
  * Perform an authenticated request while leaving a successful response body unread. This is
6594
6623
  * intended for bounded binary downloads and streaming APIs such as Genie Agent Mode.
6595
6624
  */
6596
- async requestRaw(method, path2, body, query = {}, options = {}) {
6597
- const url2 = new URL(`${this.host}${path2.startsWith("/") ? path2 : `/${path2}`}`);
6625
+ async requestRaw(method, path3, body, query = {}, options = {}) {
6626
+ const url2 = new URL(`${this.host}${path3.startsWith("/") ? path3 : `/${path3}`}`);
6598
6627
  for (const [key, value] of Object.entries(query))
6599
6628
  if (value !== void 0) url2.searchParams.set(key, String(value));
6600
6629
  const bodyHasNativeIdempotency = typeof body === "object" && body !== null && typeof body.idempotency_token === "string";
@@ -8362,10 +8391,10 @@ function mergeDefs(...defs) {
8362
8391
  function cloneDef(schema) {
8363
8392
  return mergeDefs(schema._zod.def);
8364
8393
  }
8365
- function getElementAtPath(obj, path2) {
8366
- if (!path2)
8394
+ function getElementAtPath(obj, path3) {
8395
+ if (!path3)
8367
8396
  return obj;
8368
- return path2.reduce((acc, key) => acc?.[key], obj);
8397
+ return path3.reduce((acc, key) => acc?.[key], obj);
8369
8398
  }
8370
8399
  function promiseAllObject(promisesObj) {
8371
8400
  const keys = Object.keys(promisesObj);
@@ -8774,11 +8803,11 @@ function explicitlyAborted(x2, startIndex = 0) {
8774
8803
  }
8775
8804
  return false;
8776
8805
  }
8777
- function prefixIssues(path2, issues) {
8806
+ function prefixIssues(path3, issues) {
8778
8807
  return issues.map((iss) => {
8779
8808
  var _a3;
8780
8809
  (_a3 = iss).path ?? (_a3.path = []);
8781
- iss.path.unshift(path2);
8810
+ iss.path.unshift(path3);
8782
8811
  return iss;
8783
8812
  });
8784
8813
  }
@@ -8925,16 +8954,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
8925
8954
  }
8926
8955
  function formatError(error51, mapper = (issue2) => issue2.message) {
8927
8956
  const fieldErrors = { _errors: [] };
8928
- const processError = (error52, path2 = []) => {
8957
+ const processError = (error52, path3 = []) => {
8929
8958
  for (const issue2 of error52.issues) {
8930
8959
  if (issue2.code === "invalid_union" && issue2.errors.length) {
8931
- issue2.errors.map((issues) => processError({ issues }, [...path2, ...issue2.path]));
8960
+ issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
8932
8961
  } else if (issue2.code === "invalid_key") {
8933
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
8962
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8934
8963
  } else if (issue2.code === "invalid_element") {
8935
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
8964
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8936
8965
  } else {
8937
- const fullpath = [...path2, ...issue2.path];
8966
+ const fullpath = [...path3, ...issue2.path];
8938
8967
  if (fullpath.length === 0) {
8939
8968
  fieldErrors._errors.push(mapper(issue2));
8940
8969
  } else {
@@ -8961,17 +8990,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
8961
8990
  }
8962
8991
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
8963
8992
  const result = { errors: [] };
8964
- const processError = (error52, path2 = []) => {
8993
+ const processError = (error52, path3 = []) => {
8965
8994
  var _a3, _b;
8966
8995
  for (const issue2 of error52.issues) {
8967
8996
  if (issue2.code === "invalid_union" && issue2.errors.length) {
8968
- issue2.errors.map((issues) => processError({ issues }, [...path2, ...issue2.path]));
8997
+ issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
8969
8998
  } else if (issue2.code === "invalid_key") {
8970
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
8999
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8971
9000
  } else if (issue2.code === "invalid_element") {
8972
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
9001
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8973
9002
  } else {
8974
- const fullpath = [...path2, ...issue2.path];
9003
+ const fullpath = [...path3, ...issue2.path];
8975
9004
  if (fullpath.length === 0) {
8976
9005
  result.errors.push(mapper(issue2));
8977
9006
  continue;
@@ -9003,8 +9032,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
9003
9032
  }
9004
9033
  function toDotPath(_path) {
9005
9034
  const segs = [];
9006
- const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
9007
- for (const seg of path2) {
9035
+ const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
9036
+ for (const seg of path3) {
9008
9037
  if (typeof seg === "number")
9009
9038
  segs.push(`[${seg}]`);
9010
9039
  else if (typeof seg === "symbol")
@@ -21690,13 +21719,13 @@ function resolveRef(ref, ctx) {
21690
21719
  if (!ref.startsWith("#")) {
21691
21720
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
21692
21721
  }
21693
- const path2 = ref.slice(1).split("/").filter(Boolean);
21694
- if (path2.length === 0) {
21722
+ const path3 = ref.slice(1).split("/").filter(Boolean);
21723
+ if (path3.length === 0) {
21695
21724
  return ctx.rootSchema;
21696
21725
  }
21697
21726
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
21698
- if (path2[0] === defsKey) {
21699
- const key = path2[1];
21727
+ if (path3[0] === defsKey) {
21728
+ const key = path3[1];
21700
21729
  if (!key || !ctx.defs[key]) {
21701
21730
  throw new Error(`Reference not found: ${ref}`);
21702
21731
  }
@@ -22287,7 +22316,7 @@ var PatCredentials = class {
22287
22316
 
22288
22317
  // ../../node_modules/.pnpm/@databricks+sdk-auth@0.21.0/node_modules/@databricks/sdk-auth/dist/credentials/u2m.js
22289
22318
  import { execFile } from "child_process";
22290
- import { stat } from "fs/promises";
22319
+ import { stat as stat2 } from "fs/promises";
22291
22320
  import { join, sep } from "path";
22292
22321
  import { env, platform } from "process";
22293
22322
  import { promisify } from "util";
@@ -22393,10 +22422,10 @@ async function findInPath(name) {
22393
22422
  }
22394
22423
  throw legacyError ?? new U2mCredentialsError("CLI_NOT_FOUND", "databricks CLI not found");
22395
22424
  }
22396
- async function validateCliPath(path2) {
22425
+ async function validateCliPath(path3) {
22397
22426
  let info;
22398
22427
  try {
22399
- info = await stat(path2);
22428
+ info = await stat2(path3);
22400
22429
  } catch {
22401
22430
  throw new U2mCredentialsError("CLI_NOT_FOUND", "databricks CLI not found");
22402
22431
  }
@@ -22406,7 +22435,7 @@ async function validateCliPath(path2) {
22406
22435
  if (info.size < DATABRICKS_CLI_MIN_SIZE) {
22407
22436
  throw new U2mCredentialsError("LEGACY_CLI_DETECTED", "legacy databricks CLI detected; upgrade to >= 0.100.0");
22408
22437
  }
22409
- return path2;
22438
+ return path3;
22410
22439
  }
22411
22440
 
22412
22441
  // ../../node_modules/.pnpm/@databricks+sdk-core@0.21.0/node_modules/@databricks/sdk-core/dist/profiles/errors.js
@@ -22420,7 +22449,7 @@ var ProfileError = class extends Error {
22420
22449
  };
22421
22450
 
22422
22451
  // ../../node_modules/.pnpm/@databricks+sdk-core@0.21.0/node_modules/@databricks/sdk-core/dist/profiles/resolve.js
22423
- import { access, readFile } from "fs/promises";
22452
+ import { access, readFile as readFile2 } from "fs/promises";
22424
22453
  import { homedir } from "os";
22425
22454
  import { join as join2 } from "path";
22426
22455
 
@@ -22600,9 +22629,9 @@ function defaultConfigFilePath() {
22600
22629
  return "";
22601
22630
  }
22602
22631
  }
22603
- async function fileExists(path2) {
22632
+ async function fileExists(path3) {
22604
22633
  try {
22605
- await access(path2);
22634
+ await access(path3);
22606
22635
  return true;
22607
22636
  } catch {
22608
22637
  return false;
@@ -22610,25 +22639,25 @@ async function fileExists(path2) {
22610
22639
  }
22611
22640
  async function loadFile(filePath, profileName) {
22612
22641
  let explicitFile = filePath !== void 0;
22613
- let path2;
22642
+ let path3;
22614
22643
  if (filePath !== void 0) {
22615
- path2 = filePath;
22644
+ path3 = filePath;
22616
22645
  } else {
22617
22646
  const envPath = process.env.DATABRICKS_CONFIG_FILE ?? "";
22618
22647
  if (envPath !== "") {
22619
- path2 = envPath;
22648
+ path3 = envPath;
22620
22649
  explicitFile = true;
22621
22650
  } else {
22622
- path2 = defaultConfigFilePath();
22651
+ path3 = defaultConfigFilePath();
22623
22652
  }
22624
22653
  }
22625
- if (!await fileExists(path2)) {
22654
+ if (!await fileExists(path3)) {
22626
22655
  if (explicitFile) {
22627
- throw new ProfileError("CONFIG_FILE_NOT_FOUND", `config file not found: ${path2}`);
22656
+ throw new ProfileError("CONFIG_FILE_NOT_FOUND", `config file not found: ${path3}`);
22628
22657
  }
22629
22658
  return {};
22630
22659
  }
22631
- const content = await readFile(path2, "utf8");
22660
+ const content = await readFile2(path3, "utf8");
22632
22661
  const data = parseIni(content);
22633
22662
  let resolved = profileName;
22634
22663
  if (resolved === void 0) {
@@ -22654,7 +22683,7 @@ async function loadFile(filePath, profileName) {
22654
22683
  const section = data.get(resolved);
22655
22684
  if (section === void 0 || isPhantomDefault(resolved, section)) {
22656
22685
  if (explicitProfile) {
22657
- throw new ProfileError("PROFILE_NOT_FOUND", `profile not found: "${resolved}" in ${path2}`);
22686
+ throw new ProfileError("PROFILE_NOT_FOUND", `profile not found: "${resolved}" in ${path3}`);
22658
22687
  }
22659
22688
  return {};
22660
22689
  }
@@ -36428,8 +36457,8 @@ function parseResponse8(body, schema) {
36428
36457
  function marshalRequest7(data, schema) {
36429
36458
  return jsonBigint7.stringify(schema.parse(data));
36430
36459
  }
36431
- function encodeMultiSegmentPath(path2) {
36432
- return path2.split("/").map((segment) => encodeURIComponent(segment)).join("/");
36460
+ function encodeMultiSegmentPath(path3) {
36461
+ return path3.split("/").map((segment) => encodeURIComponent(segment)).join("/");
36433
36462
  }
36434
36463
  async function sendAndCheckError2(opts) {
36435
36464
  opts.logger.debug("HTTP request", {
@@ -58444,17 +58473,17 @@ var UcVolumesAttachmentStore = class {
58444
58473
  return `${this.bytesPath(scope, digest)}.json`;
58445
58474
  }
58446
58475
  // ─── Files API ────────────────────────────────────────────────────────────
58447
- async writeFile(path2, bytes) {
58476
+ async writeFile(path3, bytes) {
58448
58477
  await this.client.uploadFile({
58449
- filePath: path2,
58478
+ filePath: path3,
58450
58479
  overwrite: true,
58451
58480
  contents: new Blob([viewToBuffer(bytes)]).stream()
58452
58481
  });
58453
58482
  }
58454
58483
  /** Raw file bytes, or `null` when the file does not exist (404). */
58455
- async readFile(path2) {
58484
+ async readFile(path3) {
58456
58485
  try {
58457
- const response = await this.client.downloadFile({ filePath: path2 });
58486
+ const response = await this.client.downloadFile({ filePath: path3 });
58458
58487
  if (!response.contents) return new Uint8Array();
58459
58488
  return new Uint8Array(await new Response(response.contents).arrayBuffer());
58460
58489
  } catch (error51) {
@@ -58463,9 +58492,9 @@ var UcVolumesAttachmentStore = class {
58463
58492
  }
58464
58493
  }
58465
58494
  /** True when the file existed and was deleted; false on 404. */
58466
- async deleteFile(path2) {
58495
+ async deleteFile(path3) {
58467
58496
  try {
58468
- await this.client.deleteFile({ filePath: path2 });
58497
+ await this.client.deleteFile({ filePath: path3 });
58469
58498
  return true;
58470
58499
  } catch (error51) {
58471
58500
  if (isNotFound(error51)) return false;
@@ -58473,14 +58502,14 @@ var UcVolumesAttachmentStore = class {
58473
58502
  }
58474
58503
  }
58475
58504
  /** Immediate children of a directory; empty for a missing directory (404). */
58476
- async listDirectory(path2) {
58505
+ async listDirectory(path3) {
58477
58506
  const entries = [];
58478
58507
  let pageToken;
58479
58508
  do {
58480
58509
  let listing;
58481
58510
  try {
58482
58511
  listing = await this.client.listDirectoryContents({
58483
- directoryPath: path2,
58512
+ directoryPath: path3,
58484
58513
  ...pageToken ? { pageToken } : {}
58485
58514
  });
58486
58515
  } catch (error51) {
@@ -59030,7 +59059,7 @@ var checks = [
59030
59059
  configured: Boolean(env2.DATABRICKS_CATALOG && env2.DATABRICKS_SCHEMA && env2.DATABRICKS_VOLUME),
59031
59060
  run: async () => {
59032
59061
  const bytes = new TextEncoder().encode(`fabric-harness-certification:${randomUUID()}`);
59033
- const digest = createHash("sha256").update(bytes).digest("hex");
59062
+ const digest = createHash2("sha256").update(bytes).digest("hex");
59034
59063
  const scope = `certification-${randomUUID()}`;
59035
59064
  const ref = {
59036
59065
  id: randomUUID(),
@@ -59243,9 +59272,9 @@ var required2 = splitCsv(
59243
59272
  }).join(",")
59244
59273
  );
59245
59274
  var packageManifest = JSON.parse(
59246
- await readFile2(new URL("../package.json", import.meta.url), "utf8")
59275
+ await readFile3(new URL("../package.json", import.meta.url), "utf8")
59247
59276
  );
59248
- var artifactSha256 = env2.FABRIC_DATABRICKS_ARTIFACT_PATH ? await digestArtifact(path.resolve(env2.FABRIC_DATABRICKS_ARTIFACT_PATH)) : void 0;
59277
+ var artifactSha256 = env2.FABRIC_DATABRICKS_ARTIFACT_PATH ? await digestDatabricksArtifact(path2.resolve(env2.FABRIC_DATABRICKS_ARTIFACT_PATH)) : void 0;
59249
59278
  var evidence = await runDatabricksCertification({
59250
59279
  workspaceHost: host,
59251
59280
  checks,
@@ -59266,14 +59295,14 @@ var evidence = await runDatabricksCertification({
59266
59295
  apiVersions: { ...DATABRICKS_API_VERSIONS },
59267
59296
  ...artifactSha256 ? { artifactSha256 } : {}
59268
59297
  });
59269
- var output = path.resolve(
59298
+ var output = path2.resolve(
59270
59299
  env2.FABRIC_DATABRICKS_EVIDENCE_PATH ?? "artifacts/databricks-certification.json"
59271
59300
  );
59272
- await mkdir(path.dirname(output), { recursive: true });
59301
+ await mkdir(path2.dirname(output), { recursive: true });
59273
59302
  await writeFile(output, `${JSON.stringify(evidence, null, 2)}
59274
59303
  `);
59275
59304
  if (evidence.passed && evidence.workspaceCloud && evidence.workspaceRegion && evidence.authMode && evidence.runtimeVersion && evidence.packageVersion && evidence.artifactSha256) {
59276
- const compatibilityOutput = path.join(path.dirname(output), "databricks-compatibility.json");
59305
+ const compatibilityOutput = path2.join(path2.dirname(output), "databricks-compatibility.json");
59277
59306
  await writeFile(
59278
59307
  compatibilityOutput,
59279
59308
  `${JSON.stringify(databricksCompatibilityRecord(evidence), null, 2)}
@@ -59459,19 +59488,4 @@ async function canReadTable(rest, fullName) {
59459
59488
  throw error51;
59460
59489
  }
59461
59490
  }
59462
- async function digestArtifact(target) {
59463
- const hash2 = createHash("sha256");
59464
- async function append(candidate, relative) {
59465
- const info = await stat2(candidate);
59466
- if (info.isDirectory()) {
59467
- for (const name of (await readdir(candidate)).sort())
59468
- await append(path.join(candidate, name), path.join(relative, name));
59469
- return;
59470
- }
59471
- hash2.update(relative.replaceAll(path.sep, "/"));
59472
- hash2.update(await readFile2(candidate));
59473
- }
59474
- await append(target, ".");
59475
- return hash2.digest("hex");
59476
- }
59477
59491
  //# sourceMappingURL=certify.js.map