@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.cjs CHANGED
@@ -308,6 +308,60 @@ var require_brace_expansion = __commonJS({
308
308
  }
309
309
  });
310
310
 
311
+ // package.json
312
+ var require_package = __commonJS({
313
+ "package.json"(exports, module2) {
314
+ module2.exports = {
315
+ name: "@hyperdx/cli",
316
+ version: "0.1.0-next.0",
317
+ description: "HyperDX command line tool",
318
+ publishConfig: {
319
+ access: "public"
320
+ },
321
+ bin: "./dist/index.js",
322
+ author: "Warren <warren@users.noreply.github.com>",
323
+ license: "MIT",
324
+ main: "./dist/index.js",
325
+ module: "./dist/index.js",
326
+ types: "./dist/index.d.ts",
327
+ type: "module",
328
+ exports: {
329
+ ".": {
330
+ require: "./dist/index.cjs",
331
+ import: "./dist/index.js",
332
+ types: "./dist/index.d.ts"
333
+ },
334
+ "./dist/lib": {
335
+ require: "./dist/lib.cjs",
336
+ import: "./dist/lib.js",
337
+ types: "./dist/lib.d.ts"
338
+ }
339
+ },
340
+ scripts: {
341
+ typegen: "tsup src/index.ts src/lib.ts --dts-only",
342
+ clean: "rimraf dist",
343
+ prebuild: "npm run clean",
344
+ build: "tsup"
345
+ },
346
+ installConfig: {
347
+ hoistingLimits: "workspaces"
348
+ },
349
+ devDependencies: {
350
+ "@types/node": "^18.15.5",
351
+ eslint: "^8.39.0",
352
+ "npm-run-all": "^4.1.5",
353
+ tsup: "6.6.2",
354
+ typescript: "^5.0.2"
355
+ },
356
+ dependencies: {
357
+ commander: "^10.0.0",
358
+ "cross-fetch": "^3.1.5",
359
+ glob: "^9.3.0"
360
+ }
361
+ };
362
+ }
363
+ });
364
+
311
365
  // src/index.ts
312
366
  var import_commander = require("commander");
313
367
 
@@ -7390,6 +7444,7 @@ var mjs_default = Object.assign(glob, {
7390
7444
  });
7391
7445
 
7392
7446
  // src/lib.ts
7447
+ var pj = require_package();
7393
7448
  var uploadSourcemaps = (_0) => __async(void 0, [_0], function* ({
7394
7449
  allowNoop,
7395
7450
  apiKey,
@@ -7431,9 +7486,11 @@ var uploadSourcemaps = (_0) => __async(void 0, [_0], function* ({
7431
7486
  console.info("Failed to upload source maps. Please see reason above.");
7432
7487
  return;
7433
7488
  }
7434
- const s3Keys = fileList.map(
7435
- ({ name }) => getS3Key(teamId, basePath || "", name, releaseId)
7436
- );
7489
+ const uploadKeys = fileList.map(({ name }) => ({
7490
+ basePath: basePath || "",
7491
+ fullName: name,
7492
+ releaseId
7493
+ }));
7437
7494
  const urlRes = yield (0, import_cross_fetch.default)(
7438
7495
  (0, import_path.join)(backend, "api", "v1", "sourcemaps", "upload-presigned-urls"),
7439
7496
  {
@@ -7443,7 +7500,8 @@ var uploadSourcemaps = (_0) => __async(void 0, [_0], function* ({
7443
7500
  Authorization: `Bearer ${apiKey}`
7444
7501
  },
7445
7502
  body: JSON.stringify({
7446
- keys: s3Keys
7503
+ pkgVersion: pj.version,
7504
+ keys: uploadKeys
7447
7505
  })
7448
7506
  }
7449
7507
  ).then((response) => {
@@ -7513,12 +7571,6 @@ function getAllSourceMapFiles(_0, _1) {
7513
7571
  return map;
7514
7572
  });
7515
7573
  }
7516
- function getS3Key(teamId, basePath, fileName, releaseId) {
7517
- if (releaseId === null || releaseId === void 0 || releaseId === "" || !releaseId) {
7518
- releaseId = "unversioned";
7519
- }
7520
- return `${teamId}/${releaseId}/${basePath}${fileName}`;
7521
- }
7522
7574
  function uploadFile(filePath, uploadUrl, name) {
7523
7575
  return __async(this, null, function* () {
7524
7576
  const fileContent = (0, import_fs2.readFileSync)(filePath);