@hardfin/cli 0.1.1-dev.45 → 0.1.1-dev.46
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/README.md
CHANGED
|
@@ -511,8 +511,9 @@ A report carries the error, its stack trace, and what `hardfin status` would pri
|
|
|
511
511
|
moment. The command is named, and its flags are listed by name without their values.
|
|
512
512
|
|
|
513
513
|
A report never carries tokens, API keys, argument or flag values, request or response bodies,
|
|
514
|
-
people's or organizations' names, your hostname, or your home directory.
|
|
515
|
-
organization appear only as their Hardfin keys.
|
|
514
|
+
people's or organizations' names, an API key's label, your hostname, or your home directory.
|
|
515
|
+
A person and an organization appear only as their Hardfin keys and IDs. The report names the
|
|
516
|
+
few parts of an identity it carries, so a part the API adds later is left out.
|
|
516
517
|
|
|
517
518
|
| To | Set |
|
|
518
519
|
| ------------------------------------------------- | ------------------------------------------ |
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6c054d7b-a0a8-526c-90d7-5bbec53675dd")}catch(e){}}();
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
//#region src/cli.ts
|
|
6
6
|
module.enableCompileCache?.();
|
|
@@ -14,7 +14,7 @@ process.on("unhandledRejection", (error) => void toCrash(error));
|
|
|
14
14
|
try {
|
|
15
15
|
const answer = await toQuickAnswer(process.argv.slice(2));
|
|
16
16
|
if (answer === void 0) {
|
|
17
|
-
const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-
|
|
17
|
+
const { toCli, toParseExitCode, wasReportAttempted } = await import("./program-Da7dZSnW.js");
|
|
18
18
|
try {
|
|
19
19
|
await toCli().parseAsync(process.argv);
|
|
20
20
|
} catch (error) {
|
|
@@ -33,7 +33,7 @@ async function toCrash(error) {
|
|
|
33
33
|
isCrashing = true;
|
|
34
34
|
const isJSON = process.argv.includes("--json") || !process.stdout.isTTY;
|
|
35
35
|
try {
|
|
36
|
-
const { toReported, writeCrash } = await import("./program-
|
|
36
|
+
const { toReported, writeCrash } = await import("./program-Da7dZSnW.js");
|
|
37
37
|
writeCrash(error, isJSON);
|
|
38
38
|
await toReported(error, isJSON, void 0, "fatal");
|
|
39
39
|
} catch {
|
|
@@ -54,4 +54,4 @@ async function toQuickAnswer(args) {
|
|
|
54
54
|
export {};
|
|
55
55
|
|
|
56
56
|
//# sourceMappingURL=cli.js.map
|
|
57
|
-
//# debugId=
|
|
57
|
+
//# debugId=6c054d7b-a0a8-526c-90d7-5bbec53675dd
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e0ad2183-1cb1-5831-b5d1-b96dcf795d93")}catch(e){}}();
|
|
4
4
|
import { a as defineCommand, i as GLOBAL_FLAGS, r as ExitCode, t as toInvocation } from "./scrub-BZ0egWxC.js";
|
|
5
5
|
import { n as toAnswer$1, r as toCompletion, t as PATH_VALUES } from "./completion-tree-DLC6ARLR.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -3574,7 +3574,7 @@ async function report(error, occasion, resolved) {
|
|
|
3574
3574
|
try {
|
|
3575
3575
|
const status = settings ? await toStatus(settings) : void 0;
|
|
3576
3576
|
const secrets = [settings?.settings.apiKey, settings ? toCredential(settings.settings.issuerUrl)?.refreshToken : void 0];
|
|
3577
|
-
return await (await import("./sentry-
|
|
3577
|
+
return await (await import("./sentry-CC0H3uMB.js")).send({
|
|
3578
3578
|
error,
|
|
3579
3579
|
occasion,
|
|
3580
3580
|
telemetry,
|
|
@@ -6934,5 +6934,5 @@ async function toReported(error, isJSON, resolved, level = "error") {
|
|
|
6934
6934
|
//#endregion
|
|
6935
6935
|
export { toCli, toParseExitCode, toReported, wasReportAttempted, writeCrash };
|
|
6936
6936
|
|
|
6937
|
-
//# sourceMappingURL=program-
|
|
6938
|
-
//# debugId=
|
|
6937
|
+
//# sourceMappingURL=program-Da7dZSnW.js.map
|
|
6938
|
+
//# debugId=e0ad2183-1cb1-5831-b5d1-b96dcf795d93
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8beb7849-4488-5315-88c8-ae70cca2939f")}catch(e){}}();
|
|
4
4
|
import { n as toScrubbed } from "./scrub-BZ0egWxC.js";
|
|
5
5
|
import { dirname } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -4331,33 +4331,48 @@ function toIdentity(status) {
|
|
|
4331
4331
|
return (status?.["api"])?.identity;
|
|
4332
4332
|
}
|
|
4333
4333
|
/**
|
|
4334
|
-
*
|
|
4335
|
-
*
|
|
4334
|
+
* The parts of an identity a report carries. Each identifies the credential, the person or
|
|
4335
|
+
* the organization without saying who they are. Anything the API adds later is left out
|
|
4336
|
+
* until someone decides it belongs here.
|
|
4337
|
+
*/
|
|
4338
|
+
const IDENTITY_FIELDS = [
|
|
4339
|
+
"type",
|
|
4340
|
+
"identifier",
|
|
4341
|
+
"scopes",
|
|
4342
|
+
"createdAt",
|
|
4343
|
+
"expiresAt",
|
|
4344
|
+
"lastRegeneratedAt",
|
|
4345
|
+
"unavailable"
|
|
4346
|
+
];
|
|
4347
|
+
/** The parts of a person or an organization a report carries, which are how Hardfin finds them. */
|
|
4348
|
+
const RECORD_FIELDS = ["id", "key"];
|
|
4349
|
+
/**
|
|
4350
|
+
* toPrivate keeps only what identifies who a credential is from the status report. A name
|
|
4351
|
+
* is left out, and so is a key's label, which is whatever a person typed when they made it.
|
|
4336
4352
|
*/
|
|
4337
4353
|
function toPrivate(status) {
|
|
4338
|
-
const identity = toIdentity(status);
|
|
4339
|
-
if (!identity) return status;
|
|
4340
4354
|
const api = status["api"];
|
|
4341
|
-
|
|
4355
|
+
if (!isRecord(api) || !isRecord(api["identity"])) return status;
|
|
4356
|
+
const identity = api["identity"];
|
|
4342
4357
|
return {
|
|
4343
4358
|
...status,
|
|
4344
4359
|
api: {
|
|
4345
4360
|
...api,
|
|
4346
4361
|
identity: {
|
|
4347
|
-
...
|
|
4348
|
-
organization: organization ?
|
|
4349
|
-
|
|
4350
|
-
name: void 0
|
|
4351
|
-
} : void 0,
|
|
4352
|
-
person: person ? {
|
|
4353
|
-
...person,
|
|
4354
|
-
firstName: void 0,
|
|
4355
|
-
lastName: void 0
|
|
4356
|
-
} : void 0
|
|
4362
|
+
...toPicked(identity, IDENTITY_FIELDS),
|
|
4363
|
+
organization: isRecord(identity["organization"]) ? toPicked(identity["organization"], RECORD_FIELDS) : void 0,
|
|
4364
|
+
person: isRecord(identity["person"]) ? toPicked(identity["person"], RECORD_FIELDS) : void 0
|
|
4357
4365
|
}
|
|
4358
4366
|
}
|
|
4359
4367
|
};
|
|
4360
4368
|
}
|
|
4369
|
+
function isRecord(value) {
|
|
4370
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4371
|
+
}
|
|
4372
|
+
/** toPicked copies the named fields of a record, and none of the others. */
|
|
4373
|
+
function toPicked(record, fields) {
|
|
4374
|
+
return Object.fromEntries(fields.filter((field) => field in record).map((field) => [field, record[field]]));
|
|
4375
|
+
}
|
|
4361
4376
|
/** toTags picks the few values worth searching by, each with few distinct values. */
|
|
4362
4377
|
function toTags(delivery) {
|
|
4363
4378
|
const { occasion, status } = delivery;
|
|
@@ -4385,5 +4400,5 @@ function toTags(delivery) {
|
|
|
4385
4400
|
//#endregion
|
|
4386
4401
|
export { send };
|
|
4387
4402
|
|
|
4388
|
-
//# sourceMappingURL=sentry-
|
|
4389
|
-
//# debugId=
|
|
4403
|
+
//# sourceMappingURL=sentry-CC0H3uMB.js.map
|
|
4404
|
+
//# debugId=8beb7849-4488-5315-88c8-ae70cca2939f
|