@fabric-harness/databricks 3.0.0 → 3.0.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.
@@ -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,CA0B9E"}
@@ -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,45 @@ function positiveInteger(value, name) {
2016
2016
  return value;
2017
2017
  }
2018
2018
 
2019
+ // src/artifact-digest.ts
2020
+ import { createHash } from "crypto";
2021
+ import { lstat, readFile, readdir } from "fs/promises";
2022
+ import path from "path";
2023
+ async function digestDatabricksArtifact(target) {
2024
+ const targetInfo = await lstat(target);
2025
+ rejectUnsupportedEntry(target, targetInfo);
2026
+ if (targetInfo.isFile()) {
2027
+ return createHash("sha256").update(await readFile(target)).digest("hex");
2028
+ }
2029
+ const hash2 = createHash("sha256");
2030
+ async function append(directory, relativeDirectory) {
2031
+ for (const name of (await readdir(directory)).sort()) {
2032
+ const candidate = path.join(directory, name);
2033
+ const relative = path.join(relativeDirectory, name).replaceAll(path.sep, "/");
2034
+ const info = await lstat(candidate);
2035
+ rejectUnsupportedEntry(relative, info);
2036
+ if (info.isDirectory()) {
2037
+ hash2.update(`directory\0${relative}\0`);
2038
+ await append(candidate, relative);
2039
+ } else {
2040
+ const bytes = await readFile(candidate);
2041
+ hash2.update(`file\0${relative}\0${bytes.byteLength}\0`);
2042
+ hash2.update(bytes);
2043
+ }
2044
+ }
2045
+ }
2046
+ await append(target, "");
2047
+ return hash2.digest("hex");
2048
+ }
2049
+ function rejectUnsupportedEntry(entry, info) {
2050
+ if (info.isSymbolicLink()) {
2051
+ throw new Error(`Databricks artifact digest rejects symbolic links: ${entry}`);
2052
+ }
2053
+ if (!info.isFile() && !info.isDirectory()) {
2054
+ throw new Error(`Databricks artifact digest rejects non-file entries: ${entry}`);
2055
+ }
2056
+ }
2057
+
2019
2058
  // src/certification.ts
2020
2059
  import { redactText } from "@fabric-harness/sdk";
2021
2060
  var DATABRICKS_AUTHORING_CERTIFICATION_CHECKS = [
@@ -3963,16 +4002,16 @@ var DatabricksWorkspaceAuthoring = class {
3963
4002
  { retry: "never" }
3964
4003
  );
3965
4004
  }
3966
- deleteWorkspaceObject(path2, recursive = false) {
4005
+ deleteWorkspaceObject(path3, recursive = false) {
3967
4006
  return this.client.post(
3968
4007
  "/api/2.0/workspace/delete",
3969
- { path: path2, recursive },
4008
+ { path: path3, recursive },
3970
4009
  {},
3971
4010
  { retry: "never" }
3972
4011
  );
3973
4012
  }
3974
- mkdirs(path2) {
3975
- return this.client.post("/api/2.0/workspace/mkdirs", { path: path2 }, {}, { retry: "safe" });
4013
+ mkdirs(path3) {
4014
+ return this.client.post("/api/2.0/workspace/mkdirs", { path: path3 }, {}, { retry: "safe" });
3976
4015
  }
3977
4016
  };
3978
4017
  function databricksWorkspaceAuthoringTools(client2) {
@@ -4256,12 +4295,12 @@ function parseStringArray(value, label) {
4256
4295
  throw new Error(`databricks governance: ${label} must be a string array.`);
4257
4296
  return value;
4258
4297
  }
4259
- function pointerSegments(path2) {
4260
- return path2.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~"));
4298
+ function pointerSegments(path3) {
4299
+ return path3.slice(1).split("/").map((segment) => segment.replace(/~1/g, "/").replace(/~0/g, "~"));
4261
4300
  }
4262
- function pointerValues(input, path2) {
4301
+ function pointerValues(input, path3) {
4263
4302
  let current = [input];
4264
- for (const segment of pointerSegments(path2)) {
4303
+ for (const segment of pointerSegments(path3)) {
4265
4304
  current = current.flatMap((value) => {
4266
4305
  if (segment === "*") return Array.isArray(value) ? value : [];
4267
4306
  if (!value || typeof value !== "object" || Array.isArray(value)) return [];
@@ -5977,8 +6016,8 @@ function snakeValue2(value) {
5977
6016
  );
5978
6017
  const attachment = record2.attachment;
5979
6018
  if (attachment && typeof attachment === "object" && !Array.isArray(attachment)) {
5980
- delete record2.attachment;
5981
- Object.assign(record2, attachment);
6019
+ const { attachment: _attachment, ...withoutAttachment } = record2;
6020
+ return { ...withoutAttachment, ...attachment };
5982
6021
  }
5983
6022
  return record2;
5984
6023
  }
@@ -6569,23 +6608,23 @@ var DatabricksPreviewClient = class {
6569
6608
  this.signal = options.signal;
6570
6609
  this.extraHeaders = options.extraHeaders;
6571
6610
  }
6572
- get(path2, query, options) {
6573
- return this.request("GET", path2, void 0, query, options);
6611
+ get(path3, query, options) {
6612
+ return this.request("GET", path3, void 0, query, options);
6574
6613
  }
6575
- post(path2, body, query, options) {
6576
- return this.request("POST", path2, body, query, options);
6614
+ post(path3, body, query, options) {
6615
+ return this.request("POST", path3, body, query, options);
6577
6616
  }
6578
- put(path2, body, query, options) {
6579
- return this.request("PUT", path2, body, query, options);
6617
+ put(path3, body, query, options) {
6618
+ return this.request("PUT", path3, body, query, options);
6580
6619
  }
6581
- patch(path2, body, query, options) {
6582
- return this.request("PATCH", path2, body, query, options);
6620
+ patch(path3, body, query, options) {
6621
+ return this.request("PATCH", path3, body, query, options);
6583
6622
  }
6584
- delete(path2, body, query, options) {
6585
- return this.request("DELETE", path2, body, query, options);
6623
+ delete(path3, body, query, options) {
6624
+ return this.request("DELETE", path3, body, query, options);
6586
6625
  }
6587
- async request(method, path2, body, query = {}, options = {}) {
6588
- const response = await this.requestRaw(method, path2, body, query, options);
6626
+ async request(method, path3, body, query = {}, options = {}) {
6627
+ const response = await this.requestRaw(method, path3, body, query, options);
6589
6628
  if (response.status === 204) return void 0;
6590
6629
  return await response.json();
6591
6630
  }
@@ -6593,8 +6632,8 @@ var DatabricksPreviewClient = class {
6593
6632
  * Perform an authenticated request while leaving a successful response body unread. This is
6594
6633
  * intended for bounded binary downloads and streaming APIs such as Genie Agent Mode.
6595
6634
  */
6596
- async requestRaw(method, path2, body, query = {}, options = {}) {
6597
- const url2 = new URL(`${this.host}${path2.startsWith("/") ? path2 : `/${path2}`}`);
6635
+ async requestRaw(method, path3, body, query = {}, options = {}) {
6636
+ const url2 = new URL(`${this.host}${path3.startsWith("/") ? path3 : `/${path3}`}`);
6598
6637
  for (const [key, value] of Object.entries(query))
6599
6638
  if (value !== void 0) url2.searchParams.set(key, String(value));
6600
6639
  const bodyHasNativeIdempotency = typeof body === "object" && body !== null && typeof body.idempotency_token === "string";
@@ -8362,10 +8401,10 @@ function mergeDefs(...defs) {
8362
8401
  function cloneDef(schema) {
8363
8402
  return mergeDefs(schema._zod.def);
8364
8403
  }
8365
- function getElementAtPath(obj, path2) {
8366
- if (!path2)
8404
+ function getElementAtPath(obj, path3) {
8405
+ if (!path3)
8367
8406
  return obj;
8368
- return path2.reduce((acc, key) => acc?.[key], obj);
8407
+ return path3.reduce((acc, key) => acc?.[key], obj);
8369
8408
  }
8370
8409
  function promiseAllObject(promisesObj) {
8371
8410
  const keys = Object.keys(promisesObj);
@@ -8774,11 +8813,11 @@ function explicitlyAborted(x2, startIndex = 0) {
8774
8813
  }
8775
8814
  return false;
8776
8815
  }
8777
- function prefixIssues(path2, issues) {
8816
+ function prefixIssues(path3, issues) {
8778
8817
  return issues.map((iss) => {
8779
8818
  var _a3;
8780
8819
  (_a3 = iss).path ?? (_a3.path = []);
8781
- iss.path.unshift(path2);
8820
+ iss.path.unshift(path3);
8782
8821
  return iss;
8783
8822
  });
8784
8823
  }
@@ -8925,16 +8964,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
8925
8964
  }
8926
8965
  function formatError(error51, mapper = (issue2) => issue2.message) {
8927
8966
  const fieldErrors = { _errors: [] };
8928
- const processError = (error52, path2 = []) => {
8967
+ const processError = (error52, path3 = []) => {
8929
8968
  for (const issue2 of error52.issues) {
8930
8969
  if (issue2.code === "invalid_union" && issue2.errors.length) {
8931
- issue2.errors.map((issues) => processError({ issues }, [...path2, ...issue2.path]));
8970
+ issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
8932
8971
  } else if (issue2.code === "invalid_key") {
8933
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
8972
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8934
8973
  } else if (issue2.code === "invalid_element") {
8935
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
8974
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8936
8975
  } else {
8937
- const fullpath = [...path2, ...issue2.path];
8976
+ const fullpath = [...path3, ...issue2.path];
8938
8977
  if (fullpath.length === 0) {
8939
8978
  fieldErrors._errors.push(mapper(issue2));
8940
8979
  } else {
@@ -8961,17 +9000,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
8961
9000
  }
8962
9001
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
8963
9002
  const result = { errors: [] };
8964
- const processError = (error52, path2 = []) => {
9003
+ const processError = (error52, path3 = []) => {
8965
9004
  var _a3, _b;
8966
9005
  for (const issue2 of error52.issues) {
8967
9006
  if (issue2.code === "invalid_union" && issue2.errors.length) {
8968
- issue2.errors.map((issues) => processError({ issues }, [...path2, ...issue2.path]));
9007
+ issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
8969
9008
  } else if (issue2.code === "invalid_key") {
8970
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
9009
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8971
9010
  } else if (issue2.code === "invalid_element") {
8972
- processError({ issues: issue2.issues }, [...path2, ...issue2.path]);
9011
+ processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
8973
9012
  } else {
8974
- const fullpath = [...path2, ...issue2.path];
9013
+ const fullpath = [...path3, ...issue2.path];
8975
9014
  if (fullpath.length === 0) {
8976
9015
  result.errors.push(mapper(issue2));
8977
9016
  continue;
@@ -9003,8 +9042,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
9003
9042
  }
9004
9043
  function toDotPath(_path) {
9005
9044
  const segs = [];
9006
- const path2 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
9007
- for (const seg of path2) {
9045
+ const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
9046
+ for (const seg of path3) {
9008
9047
  if (typeof seg === "number")
9009
9048
  segs.push(`[${seg}]`);
9010
9049
  else if (typeof seg === "symbol")
@@ -21690,13 +21729,13 @@ function resolveRef(ref, ctx) {
21690
21729
  if (!ref.startsWith("#")) {
21691
21730
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
21692
21731
  }
21693
- const path2 = ref.slice(1).split("/").filter(Boolean);
21694
- if (path2.length === 0) {
21732
+ const path3 = ref.slice(1).split("/").filter(Boolean);
21733
+ if (path3.length === 0) {
21695
21734
  return ctx.rootSchema;
21696
21735
  }
21697
21736
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
21698
- if (path2[0] === defsKey) {
21699
- const key = path2[1];
21737
+ if (path3[0] === defsKey) {
21738
+ const key = path3[1];
21700
21739
  if (!key || !ctx.defs[key]) {
21701
21740
  throw new Error(`Reference not found: ${ref}`);
21702
21741
  }
@@ -22393,10 +22432,10 @@ async function findInPath(name) {
22393
22432
  }
22394
22433
  throw legacyError ?? new U2mCredentialsError("CLI_NOT_FOUND", "databricks CLI not found");
22395
22434
  }
22396
- async function validateCliPath(path2) {
22435
+ async function validateCliPath(path3) {
22397
22436
  let info;
22398
22437
  try {
22399
- info = await stat(path2);
22438
+ info = await stat(path3);
22400
22439
  } catch {
22401
22440
  throw new U2mCredentialsError("CLI_NOT_FOUND", "databricks CLI not found");
22402
22441
  }
@@ -22406,7 +22445,7 @@ async function validateCliPath(path2) {
22406
22445
  if (info.size < DATABRICKS_CLI_MIN_SIZE) {
22407
22446
  throw new U2mCredentialsError("LEGACY_CLI_DETECTED", "legacy databricks CLI detected; upgrade to >= 0.100.0");
22408
22447
  }
22409
- return path2;
22448
+ return path3;
22410
22449
  }
22411
22450
 
22412
22451
  // ../../node_modules/.pnpm/@databricks+sdk-core@0.21.0/node_modules/@databricks/sdk-core/dist/profiles/errors.js
@@ -22420,7 +22459,7 @@ var ProfileError = class extends Error {
22420
22459
  };
22421
22460
 
22422
22461
  // ../../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";
22462
+ import { access, readFile as readFile2 } from "fs/promises";
22424
22463
  import { homedir } from "os";
22425
22464
  import { join as join2 } from "path";
22426
22465
 
@@ -22600,9 +22639,9 @@ function defaultConfigFilePath() {
22600
22639
  return "";
22601
22640
  }
22602
22641
  }
22603
- async function fileExists(path2) {
22642
+ async function fileExists(path3) {
22604
22643
  try {
22605
- await access(path2);
22644
+ await access(path3);
22606
22645
  return true;
22607
22646
  } catch {
22608
22647
  return false;
@@ -22610,25 +22649,25 @@ async function fileExists(path2) {
22610
22649
  }
22611
22650
  async function loadFile(filePath, profileName) {
22612
22651
  let explicitFile = filePath !== void 0;
22613
- let path2;
22652
+ let path3;
22614
22653
  if (filePath !== void 0) {
22615
- path2 = filePath;
22654
+ path3 = filePath;
22616
22655
  } else {
22617
22656
  const envPath = process.env.DATABRICKS_CONFIG_FILE ?? "";
22618
22657
  if (envPath !== "") {
22619
- path2 = envPath;
22658
+ path3 = envPath;
22620
22659
  explicitFile = true;
22621
22660
  } else {
22622
- path2 = defaultConfigFilePath();
22661
+ path3 = defaultConfigFilePath();
22623
22662
  }
22624
22663
  }
22625
- if (!await fileExists(path2)) {
22664
+ if (!await fileExists(path3)) {
22626
22665
  if (explicitFile) {
22627
- throw new ProfileError("CONFIG_FILE_NOT_FOUND", `config file not found: ${path2}`);
22666
+ throw new ProfileError("CONFIG_FILE_NOT_FOUND", `config file not found: ${path3}`);
22628
22667
  }
22629
22668
  return {};
22630
22669
  }
22631
- const content = await readFile(path2, "utf8");
22670
+ const content = await readFile2(path3, "utf8");
22632
22671
  const data = parseIni(content);
22633
22672
  let resolved = profileName;
22634
22673
  if (resolved === void 0) {
@@ -22654,7 +22693,7 @@ async function loadFile(filePath, profileName) {
22654
22693
  const section = data.get(resolved);
22655
22694
  if (section === void 0 || isPhantomDefault(resolved, section)) {
22656
22695
  if (explicitProfile) {
22657
- throw new ProfileError("PROFILE_NOT_FOUND", `profile not found: "${resolved}" in ${path2}`);
22696
+ throw new ProfileError("PROFILE_NOT_FOUND", `profile not found: "${resolved}" in ${path3}`);
22658
22697
  }
22659
22698
  return {};
22660
22699
  }
@@ -36428,8 +36467,8 @@ function parseResponse8(body, schema) {
36428
36467
  function marshalRequest7(data, schema) {
36429
36468
  return jsonBigint7.stringify(schema.parse(data));
36430
36469
  }
36431
- function encodeMultiSegmentPath(path2) {
36432
- return path2.split("/").map((segment) => encodeURIComponent(segment)).join("/");
36470
+ function encodeMultiSegmentPath(path3) {
36471
+ return path3.split("/").map((segment) => encodeURIComponent(segment)).join("/");
36433
36472
  }
36434
36473
  async function sendAndCheckError2(opts) {
36435
36474
  opts.logger.debug("HTTP request", {
@@ -58444,17 +58483,17 @@ var UcVolumesAttachmentStore = class {
58444
58483
  return `${this.bytesPath(scope, digest)}.json`;
58445
58484
  }
58446
58485
  // ─── Files API ────────────────────────────────────────────────────────────
58447
- async writeFile(path2, bytes) {
58486
+ async writeFile(path3, bytes) {
58448
58487
  await this.client.uploadFile({
58449
- filePath: path2,
58488
+ filePath: path3,
58450
58489
  overwrite: true,
58451
58490
  contents: new Blob([viewToBuffer(bytes)]).stream()
58452
58491
  });
58453
58492
  }
58454
58493
  /** Raw file bytes, or `null` when the file does not exist (404). */
58455
- async readFile(path2) {
58494
+ async readFile(path3) {
58456
58495
  try {
58457
- const response = await this.client.downloadFile({ filePath: path2 });
58496
+ const response = await this.client.downloadFile({ filePath: path3 });
58458
58497
  if (!response.contents) return new Uint8Array();
58459
58498
  return new Uint8Array(await new Response(response.contents).arrayBuffer());
58460
58499
  } catch (error51) {
@@ -58463,9 +58502,9 @@ var UcVolumesAttachmentStore = class {
58463
58502
  }
58464
58503
  }
58465
58504
  /** True when the file existed and was deleted; false on 404. */
58466
- async deleteFile(path2) {
58505
+ async deleteFile(path3) {
58467
58506
  try {
58468
- await this.client.deleteFile({ filePath: path2 });
58507
+ await this.client.deleteFile({ filePath: path3 });
58469
58508
  return true;
58470
58509
  } catch (error51) {
58471
58510
  if (isNotFound(error51)) return false;
@@ -58473,14 +58512,14 @@ var UcVolumesAttachmentStore = class {
58473
58512
  }
58474
58513
  }
58475
58514
  /** Immediate children of a directory; empty for a missing directory (404). */
58476
- async listDirectory(path2) {
58515
+ async listDirectory(path3) {
58477
58516
  const entries = [];
58478
58517
  let pageToken;
58479
58518
  do {
58480
58519
  let listing;
58481
58520
  try {
58482
58521
  listing = await this.client.listDirectoryContents({
58483
- directoryPath: path2,
58522
+ directoryPath: path3,
58484
58523
  ...pageToken ? { pageToken } : {}
58485
58524
  });
58486
58525
  } catch (error51) {
@@ -59030,7 +59069,7 @@ var checks = [
59030
59069
  configured: Boolean(env2.DATABRICKS_CATALOG && env2.DATABRICKS_SCHEMA && env2.DATABRICKS_VOLUME),
59031
59070
  run: async () => {
59032
59071
  const bytes = new TextEncoder().encode(`fabric-harness-certification:${randomUUID()}`);
59033
- const digest = createHash("sha256").update(bytes).digest("hex");
59072
+ const digest = createHash2("sha256").update(bytes).digest("hex");
59034
59073
  const scope = `certification-${randomUUID()}`;
59035
59074
  const ref = {
59036
59075
  id: randomUUID(),
@@ -59243,9 +59282,9 @@ var required2 = splitCsv(
59243
59282
  }).join(",")
59244
59283
  );
59245
59284
  var packageManifest = JSON.parse(
59246
- await readFile2(new URL("../package.json", import.meta.url), "utf8")
59285
+ await readFile3(new URL("../package.json", import.meta.url), "utf8")
59247
59286
  );
59248
- var artifactSha256 = env2.FABRIC_DATABRICKS_ARTIFACT_PATH ? await digestArtifact(path.resolve(env2.FABRIC_DATABRICKS_ARTIFACT_PATH)) : void 0;
59287
+ var artifactSha256 = env2.FABRIC_DATABRICKS_ARTIFACT_PATH ? await digestDatabricksArtifact(path2.resolve(env2.FABRIC_DATABRICKS_ARTIFACT_PATH)) : void 0;
59249
59288
  var evidence = await runDatabricksCertification({
59250
59289
  workspaceHost: host,
59251
59290
  checks,
@@ -59266,14 +59305,14 @@ var evidence = await runDatabricksCertification({
59266
59305
  apiVersions: { ...DATABRICKS_API_VERSIONS },
59267
59306
  ...artifactSha256 ? { artifactSha256 } : {}
59268
59307
  });
59269
- var output = path.resolve(
59308
+ var output = path2.resolve(
59270
59309
  env2.FABRIC_DATABRICKS_EVIDENCE_PATH ?? "artifacts/databricks-certification.json"
59271
59310
  );
59272
- await mkdir(path.dirname(output), { recursive: true });
59311
+ await mkdir(path2.dirname(output), { recursive: true });
59273
59312
  await writeFile(output, `${JSON.stringify(evidence, null, 2)}
59274
59313
  `);
59275
59314
  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");
59315
+ const compatibilityOutput = path2.join(path2.dirname(output), "databricks-compatibility.json");
59277
59316
  await writeFile(
59278
59317
  compatibilityOutput,
59279
59318
  `${JSON.stringify(databricksCompatibilityRecord(evidence), null, 2)}
@@ -59459,19 +59498,4 @@ async function canReadTable(rest, fullName) {
59459
59498
  throw error51;
59460
59499
  }
59461
59500
  }
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
59501
  //# sourceMappingURL=certify.js.map