@hyperdx/cli 0.0.0 → 0.1.0-next.0

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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  uploadSourcemaps
4
- } from "./chunk-7UYWVS7D.js";
4
+ } from "./chunk-VAVYH44V.js";
5
5
 
6
6
  // src/index.ts
7
7
  import { program } from "commander";
package/dist/lib.cjs CHANGED
@@ -312,6 +312,60 @@ var require_brace_expansion = __commonJS({
312
312
  }
313
313
  });
314
314
 
315
+ // package.json
316
+ var require_package = __commonJS({
317
+ "package.json"(exports, module2) {
318
+ module2.exports = {
319
+ name: "@hyperdx/cli",
320
+ version: "0.1.0-next.0",
321
+ description: "HyperDX command line tool",
322
+ publishConfig: {
323
+ access: "public"
324
+ },
325
+ bin: "./dist/index.js",
326
+ author: "Warren <warren@users.noreply.github.com>",
327
+ license: "MIT",
328
+ main: "./dist/index.js",
329
+ module: "./dist/index.js",
330
+ types: "./dist/index.d.ts",
331
+ type: "module",
332
+ exports: {
333
+ ".": {
334
+ require: "./dist/index.cjs",
335
+ import: "./dist/index.js",
336
+ types: "./dist/index.d.ts"
337
+ },
338
+ "./dist/lib": {
339
+ require: "./dist/lib.cjs",
340
+ import: "./dist/lib.js",
341
+ types: "./dist/lib.d.ts"
342
+ }
343
+ },
344
+ scripts: {
345
+ typegen: "tsup src/index.ts src/lib.ts --dts-only",
346
+ clean: "rimraf dist",
347
+ prebuild: "npm run clean",
348
+ build: "tsup"
349
+ },
350
+ installConfig: {
351
+ hoistingLimits: "workspaces"
352
+ },
353
+ devDependencies: {
354
+ "@types/node": "^18.15.5",
355
+ eslint: "^8.39.0",
356
+ "npm-run-all": "^4.1.5",
357
+ tsup: "6.6.2",
358
+ typescript: "^5.0.2"
359
+ },
360
+ dependencies: {
361
+ commander: "^10.0.0",
362
+ "cross-fetch": "^3.1.5",
363
+ glob: "^9.3.0"
364
+ }
365
+ };
366
+ }
367
+ });
368
+
315
369
  // src/lib.ts
316
370
  var lib_exports = {};
317
371
  __export(lib_exports, {
@@ -7396,6 +7450,7 @@ var mjs_default = Object.assign(glob, {
7396
7450
  });
7397
7451
 
7398
7452
  // src/lib.ts
7453
+ var pj = require_package();
7399
7454
  var uploadSourcemaps = (_0) => __async(void 0, [_0], function* ({
7400
7455
  allowNoop,
7401
7456
  apiKey,
@@ -7437,9 +7492,11 @@ var uploadSourcemaps = (_0) => __async(void 0, [_0], function* ({
7437
7492
  console.info("Failed to upload source maps. Please see reason above.");
7438
7493
  return;
7439
7494
  }
7440
- const s3Keys = fileList.map(
7441
- ({ name }) => getS3Key(teamId, basePath || "", name, releaseId)
7442
- );
7495
+ const uploadKeys = fileList.map(({ name }) => ({
7496
+ basePath: basePath || "",
7497
+ fullName: name,
7498
+ releaseId
7499
+ }));
7443
7500
  const urlRes = yield (0, import_cross_fetch.default)(
7444
7501
  (0, import_path.join)(backend, "api", "v1", "sourcemaps", "upload-presigned-urls"),
7445
7502
  {
@@ -7449,7 +7506,8 @@ var uploadSourcemaps = (_0) => __async(void 0, [_0], function* ({
7449
7506
  Authorization: `Bearer ${apiKey}`
7450
7507
  },
7451
7508
  body: JSON.stringify({
7452
- keys: s3Keys
7509
+ pkgVersion: pj.version,
7510
+ keys: uploadKeys
7453
7511
  })
7454
7512
  }
7455
7513
  ).then((response) => {
@@ -7519,12 +7577,6 @@ function getAllSourceMapFiles(_0, _1) {
7519
7577
  return map;
7520
7578
  });
7521
7579
  }
7522
- function getS3Key(teamId, basePath, fileName, releaseId) {
7523
- if (releaseId === null || releaseId === void 0 || releaseId === "" || !releaseId) {
7524
- releaseId = "unversioned";
7525
- }
7526
- return `${teamId}/${releaseId}/${basePath}${fileName}`;
7527
- }
7528
7580
  function uploadFile(filePath, uploadUrl, name) {
7529
7581
  return __async(this, null, function* () {
7530
7582
  const fileContent = (0, import_fs2.readFileSync)(filePath);