@debugbundle/cli 1.5.1 → 1.5.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.
- package/dist/main.cjs +438 -162
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -15350,6 +15350,29 @@ var ImprovementSettingsUpdateSchema = external_exports.object({
|
|
|
15350
15350
|
message: "At least one improvement settings field must be provided."
|
|
15351
15351
|
});
|
|
15352
15352
|
|
|
15353
|
+
// ../../packages/shared-types/src/project-color-tags.ts
|
|
15354
|
+
var PROJECT_COLOR_TAG_VALUES = [
|
|
15355
|
+
"red",
|
|
15356
|
+
"orange",
|
|
15357
|
+
"amber",
|
|
15358
|
+
"yellow",
|
|
15359
|
+
"lime",
|
|
15360
|
+
"green",
|
|
15361
|
+
"emerald",
|
|
15362
|
+
"teal",
|
|
15363
|
+
"cyan",
|
|
15364
|
+
"sky",
|
|
15365
|
+
"blue",
|
|
15366
|
+
"indigo",
|
|
15367
|
+
"violet",
|
|
15368
|
+
"purple",
|
|
15369
|
+
"fuchsia",
|
|
15370
|
+
"pink",
|
|
15371
|
+
"rose",
|
|
15372
|
+
"slate"
|
|
15373
|
+
];
|
|
15374
|
+
var ProjectColorTagSchema = external_exports.enum(PROJECT_COLOR_TAG_VALUES);
|
|
15375
|
+
|
|
15353
15376
|
// ../../packages/shared-types/src/index.ts
|
|
15354
15377
|
function createUuidV4() {
|
|
15355
15378
|
const cryptoSource = globalThis.crypto;
|
|
@@ -15962,8 +15985,8 @@ function buildSkill() {
|
|
|
15962
15985
|
"When the user reports a bug, runtime failure, production incident, regression, broken deploy, or unknown error, start here before reading arbitrary source files.",
|
|
15963
15986
|
"",
|
|
15964
15987
|
"1. Run `debugbundle doctor --json` to learn whether the project is local-only or connected and whether the local scaffold is healthy.",
|
|
15965
|
-
"2. If `debugbundle doctor --json` reports `mode=local-only`, start with `debugbundle incidents --source local --status
|
|
15966
|
-
"3. If `debugbundle doctor --json` reports `mode=connected` and the target environment is cloud-enabled, check both `debugbundle incidents --source local --status
|
|
15988
|
+
"2. If `debugbundle doctor --json` reports `mode=local-only`, start with `debugbundle incidents --source local --status active --json`.",
|
|
15989
|
+
"3. If `debugbundle doctor --json` reports `mode=connected` and the target environment is cloud-enabled, check both `debugbundle incidents --source local --status active --json` and `debugbundle incidents --source cloud --status active --json` unless the user explicitly scoped the issue to local-only development. For user-reported production incidents, check cloud incidents after local incidents and explicitly report whether each source had matches.",
|
|
15967
15990
|
"4. Inspect the chosen incident with `debugbundle inspect <incident-id> --source <local|cloud> --json` and `debugbundle explain <incident-id> --source <local|cloud> --json`.",
|
|
15968
15991
|
"5. Fetch evidence before editing code: `debugbundle bundle <incident-id> --source <local|cloud> --json` and `debugbundle reproduce <incident-id> --source <local|cloud> --json`.",
|
|
15969
15992
|
"6. If local SDK or relay events have landed but no bundle exists yet, run `debugbundle process --preset <minimal|balanced|investigative> --json` and then list incidents again.",
|
|
@@ -15983,7 +16006,7 @@ function buildSkill() {
|
|
|
15983
16006
|
"2. Inspect the incident bundle and reproduction artifact before proposing a fix.",
|
|
15984
16007
|
"3. Run `debugbundle analyze --type improvement --local` after local processing when you need a deterministic change plan.",
|
|
15985
16008
|
"4. Apply the narrowest fix, then validate it with the repository test workflow from `.debugbundle/profile.json`.",
|
|
15986
|
-
"5. When the fix is confirmed, or when the incident was intentionally generated for smoke, verification, or dogfooding, resolve it with `debugbundle resolve <incident-id> [incident-id ...]` or MCP `resolve_incident` / `resolve_incidents` so the
|
|
16009
|
+
"5. When the fix is confirmed, or when the incident was intentionally generated for smoke, verification, or dogfooding, resolve it with `debugbundle resolve <incident-id> [incident-id ...]` or MCP `resolve_incident` / `resolve_incidents` so the needs-attention queue stays actionable.",
|
|
15987
16010
|
"",
|
|
15988
16011
|
"## Investigation Controls",
|
|
15989
16012
|
"",
|
|
@@ -16095,7 +16118,7 @@ function buildCliReference() {
|
|
|
16095
16118
|
"",
|
|
16096
16119
|
"## Investigation",
|
|
16097
16120
|
"",
|
|
16098
|
-
"- `debugbundle incidents [--source <local|cloud>] [--project-id <id>] [--environment <name>] [--service <name>] [--status <
|
|
16121
|
+
"- `debugbundle incidents [--source <local|cloud>] [--project-id <id>] [--environment <name>] [--service <name>] [--status <active|open|resolved|regressed|all>] [--severity <severity>] [--cursor <cursor>] [--limit <n>] [--json]`",
|
|
16099
16122
|
"- `debugbundle inspect <incident-id> [--source <local|cloud>] [--json]`",
|
|
16100
16123
|
"- `debugbundle explain <incident-id> [--source <local|cloud>] [--json]`",
|
|
16101
16124
|
"- `debugbundle bundle <incident-id> [--source <local|cloud>] [--json]`",
|
|
@@ -16185,15 +16208,15 @@ function buildCliReference() {
|
|
|
16185
16208
|
"Review open incidents and resolve the intentionally generated ones:",
|
|
16186
16209
|
"",
|
|
16187
16210
|
"```bash",
|
|
16188
|
-
"debugbundle incidents --status
|
|
16211
|
+
"debugbundle incidents --status active --json",
|
|
16189
16212
|
"debugbundle resolve <incident-id> [incident-id ...]",
|
|
16190
|
-
"debugbundle incidents --status
|
|
16213
|
+
"debugbundle incidents --status active --json",
|
|
16191
16214
|
"```",
|
|
16192
16215
|
"",
|
|
16193
16216
|
"If you want a title-based batch cleanup and have `jq` available:",
|
|
16194
16217
|
"",
|
|
16195
16218
|
"```bash",
|
|
16196
|
-
"debugbundle incidents --status
|
|
16219
|
+
"debugbundle incidents --status active --json \\",
|
|
16197
16220
|
` | jq -r '.incidents[] | select(.title | test("smoke test|dogfood|verification|synthetic"; "i")) | .incident_id' \\`,
|
|
16198
16221
|
" | xargs debugbundle resolve",
|
|
16199
16222
|
"```",
|
|
@@ -16272,10 +16295,10 @@ function buildMcpReference() {
|
|
|
16272
16295
|
"",
|
|
16273
16296
|
"## Smoke-Test Cleanup Recipe",
|
|
16274
16297
|
"",
|
|
16275
|
-
'1. Call `list_incidents` with `status: "
|
|
16298
|
+
'1. Call `list_incidents` with `status: "active"`.',
|
|
16276
16299
|
"2. Filter incidents whose titles show they were intentionally generated for smoke, dogfood, verification, or synthetic checks.",
|
|
16277
16300
|
"3. Call `resolve_incidents` for verified synthetic incidents, or `resolve_incident` for a single incident.",
|
|
16278
|
-
"4. Call `list_incidents` again and confirm the
|
|
16301
|
+
"4. Call `list_incidents` again and confirm the needs-attention queue only contains actionable failures.",
|
|
16279
16302
|
""
|
|
16280
16303
|
].join("\n");
|
|
16281
16304
|
}
|
|
@@ -16838,17 +16861,32 @@ var import_promises3 = require("node:fs/promises");
|
|
|
16838
16861
|
var import_node_path4 = require("node:path");
|
|
16839
16862
|
|
|
16840
16863
|
// ../../packages/retrieval-client/src/index.ts
|
|
16864
|
+
var ProjectColorTagResponseSchema = external_exports.unknown().transform((value, context) => {
|
|
16865
|
+
if (value === void 0 || value === null) {
|
|
16866
|
+
return null;
|
|
16867
|
+
}
|
|
16868
|
+
const parsed = ProjectColorTagSchema.safeParse(value);
|
|
16869
|
+
if (!parsed.success) {
|
|
16870
|
+
context.addIssue({
|
|
16871
|
+
code: external_exports.ZodIssueCode.custom,
|
|
16872
|
+
message: "Invalid project color tag"
|
|
16873
|
+
});
|
|
16874
|
+
return external_exports.NEVER;
|
|
16875
|
+
}
|
|
16876
|
+
return parsed.data;
|
|
16877
|
+
});
|
|
16841
16878
|
var IncidentReasonSchema = external_exports.object({
|
|
16842
16879
|
kind: external_exports.enum(["backend_exception", "frontend_exception", "request_failure", "error_log"]),
|
|
16843
16880
|
description: external_exports.string(),
|
|
16844
16881
|
event_type: external_exports.enum(["backend_exception", "frontend_exception", "request_event", "log_event"]),
|
|
16845
16882
|
event_class: external_exports.literal("incident_signal"),
|
|
16846
16883
|
matched_policy: external_exports.string()
|
|
16847
|
-
})
|
|
16884
|
+
});
|
|
16848
16885
|
var IncidentSchema = external_exports.object({
|
|
16849
16886
|
incident_id: external_exports.string(),
|
|
16850
16887
|
project_id: external_exports.string(),
|
|
16851
16888
|
project_name: external_exports.string(),
|
|
16889
|
+
project_color_tag: ProjectColorTagResponseSchema,
|
|
16852
16890
|
service_id: external_exports.string().nullable(),
|
|
16853
16891
|
service_name: external_exports.string().nullable(),
|
|
16854
16892
|
latest_deployment_id: external_exports.string().nullable(),
|
|
@@ -16866,11 +16904,12 @@ var IncidentSchema = external_exports.object({
|
|
|
16866
16904
|
regressed_at: external_exports.string().nullable(),
|
|
16867
16905
|
matched_fields: external_exports.array(external_exports.string()),
|
|
16868
16906
|
incident_reason: IncidentReasonSchema.optional()
|
|
16869
|
-
})
|
|
16907
|
+
});
|
|
16870
16908
|
var ImprovementSchema = external_exports.object({
|
|
16871
16909
|
improvement_id: external_exports.string(),
|
|
16872
16910
|
project_id: external_exports.string(),
|
|
16873
16911
|
project_name: external_exports.string(),
|
|
16912
|
+
project_color_tag: ProjectColorTagResponseSchema,
|
|
16874
16913
|
project_slug: external_exports.string(),
|
|
16875
16914
|
service_id: external_exports.string().nullable(),
|
|
16876
16915
|
service_name: external_exports.string(),
|
|
@@ -16895,7 +16934,7 @@ var ImprovementSchema = external_exports.object({
|
|
|
16895
16934
|
bundle_created_at: external_exports.string().nullable(),
|
|
16896
16935
|
bundle_updated_at: external_exports.string().nullable(),
|
|
16897
16936
|
bundle_failure_reason: external_exports.string().nullable()
|
|
16898
|
-
})
|
|
16937
|
+
});
|
|
16899
16938
|
var ServiceSchema3 = external_exports.object({
|
|
16900
16939
|
service_id: external_exports.string(),
|
|
16901
16940
|
project_id: external_exports.string(),
|
|
@@ -16903,37 +16942,37 @@ var ServiceSchema3 = external_exports.object({
|
|
|
16903
16942
|
runtime: external_exports.string().nullable(),
|
|
16904
16943
|
framework: external_exports.string().nullable(),
|
|
16905
16944
|
environment: external_exports.string()
|
|
16906
|
-
})
|
|
16945
|
+
});
|
|
16907
16946
|
var LogSchema = external_exports.object({
|
|
16908
16947
|
event_id: external_exports.string(),
|
|
16909
16948
|
event_type: external_exports.string(),
|
|
16910
16949
|
occurred_at: external_exports.string(),
|
|
16911
16950
|
is_sampled: external_exports.boolean(),
|
|
16912
16951
|
level: external_exports.string().nullable()
|
|
16913
|
-
})
|
|
16952
|
+
});
|
|
16914
16953
|
var IncidentsResponseSchema = external_exports.object({
|
|
16915
16954
|
incidents: external_exports.array(IncidentSchema),
|
|
16916
16955
|
next_cursor: external_exports.string().nullable().optional()
|
|
16917
|
-
})
|
|
16956
|
+
});
|
|
16918
16957
|
var IncidentResponseSchema = external_exports.object({
|
|
16919
16958
|
incident: IncidentSchema
|
|
16920
|
-
})
|
|
16959
|
+
});
|
|
16921
16960
|
var BulkIncidentResponseSchema = external_exports.object({
|
|
16922
16961
|
incidents: external_exports.array(IncidentSchema)
|
|
16923
|
-
})
|
|
16962
|
+
});
|
|
16924
16963
|
var ImprovementResponseSchema = external_exports.object({
|
|
16925
16964
|
improvement: ImprovementSchema
|
|
16926
|
-
})
|
|
16965
|
+
});
|
|
16927
16966
|
var IncidentContextArtifactSchema = external_exports.object({
|
|
16928
16967
|
status: external_exports.enum(["ready", "pending", "failed"]),
|
|
16929
16968
|
body: external_exports.unknown().optional(),
|
|
16930
16969
|
reason: external_exports.string().nullable().optional()
|
|
16931
|
-
})
|
|
16970
|
+
});
|
|
16932
16971
|
var IncidentContextLogsSchema = external_exports.object({
|
|
16933
16972
|
source: external_exports.enum(["retrieval", "bundle_context", "none"]),
|
|
16934
16973
|
items: external_exports.array(external_exports.unknown()),
|
|
16935
16974
|
next_cursor: external_exports.string().nullable()
|
|
16936
|
-
})
|
|
16975
|
+
});
|
|
16937
16976
|
var IncidentContextDeploySchema = external_exports.object({
|
|
16938
16977
|
latest_deployment_id: external_exports.string().nullable(),
|
|
16939
16978
|
commit_sha: external_exports.string().nullable(),
|
|
@@ -16941,23 +16980,23 @@ var IncidentContextDeploySchema = external_exports.object({
|
|
|
16941
16980
|
branch: external_exports.string().nullable(),
|
|
16942
16981
|
deployed_at: external_exports.string().nullable(),
|
|
16943
16982
|
regression_window: external_exports.boolean().nullable()
|
|
16944
|
-
})
|
|
16983
|
+
});
|
|
16945
16984
|
var IncidentContextGroupingSchema = external_exports.object({
|
|
16946
16985
|
fingerprint: external_exports.string(),
|
|
16947
16986
|
fingerprint_version: external_exports.string(),
|
|
16948
16987
|
matched_fields: external_exports.array(external_exports.string())
|
|
16949
|
-
})
|
|
16988
|
+
});
|
|
16950
16989
|
var IncidentContextVisibilitySchema = external_exports.object({
|
|
16951
16990
|
grouping: external_exports.string(),
|
|
16952
16991
|
bundle_regeneration: external_exports.string(),
|
|
16953
16992
|
spike_detection: external_exports.string(),
|
|
16954
16993
|
notification_cooldown: external_exports.string()
|
|
16955
|
-
})
|
|
16994
|
+
});
|
|
16956
16995
|
var IncidentContextRedactionSchema = external_exports.object({
|
|
16957
16996
|
redacted: external_exports.boolean(),
|
|
16958
16997
|
fields: external_exports.array(external_exports.string()),
|
|
16959
16998
|
notes: external_exports.string().nullable()
|
|
16960
|
-
})
|
|
16999
|
+
});
|
|
16961
17000
|
var IncidentContextPrimarySignalSchema = external_exports.object({
|
|
16962
17001
|
kind: IncidentReasonSchema.shape.kind.nullable(),
|
|
16963
17002
|
event_type: external_exports.string().nullable(),
|
|
@@ -16977,7 +17016,14 @@ var IncidentContextPrimarySignalSchema = external_exports.object({
|
|
|
16977
17016
|
line: external_exports.number().nullable(),
|
|
16978
17017
|
function: external_exports.string().nullable()
|
|
16979
17018
|
}).nullable()
|
|
16980
|
-
})
|
|
17019
|
+
});
|
|
17020
|
+
var IncidentContextBrowserSignalSchema = external_exports.object({
|
|
17021
|
+
browser_event_kind: external_exports.string().nullable(),
|
|
17022
|
+
browser_event_opaque: external_exports.boolean().nullable(),
|
|
17023
|
+
browser_event_message: external_exports.string().nullable(),
|
|
17024
|
+
client_kind: external_exports.enum(["human", "bot", "unknown"]),
|
|
17025
|
+
bot_family: external_exports.string().nullable()
|
|
17026
|
+
});
|
|
16981
17027
|
var IncidentContextSchema = external_exports.object({
|
|
16982
17028
|
incident: IncidentSchema,
|
|
16983
17029
|
incident_reason: IncidentReasonSchema.nullable(),
|
|
@@ -16989,22 +17035,23 @@ var IncidentContextSchema = external_exports.object({
|
|
|
16989
17035
|
grouping: IncidentContextGroupingSchema,
|
|
16990
17036
|
visibility: IncidentContextVisibilitySchema,
|
|
16991
17037
|
redaction: IncidentContextRedactionSchema.nullable(),
|
|
17038
|
+
browser_signal: IncidentContextBrowserSignalSchema.nullable().optional(),
|
|
16992
17039
|
suggested_next_checks: external_exports.array(external_exports.string())
|
|
16993
|
-
})
|
|
17040
|
+
});
|
|
16994
17041
|
var ServicesResponseSchema = external_exports.object({
|
|
16995
17042
|
services: external_exports.array(ServiceSchema3)
|
|
16996
|
-
})
|
|
17043
|
+
});
|
|
16997
17044
|
var ImprovementsResponseSchema = external_exports.object({
|
|
16998
17045
|
improvements: external_exports.array(ImprovementSchema),
|
|
16999
17046
|
next_cursor: external_exports.string().nullable().optional()
|
|
17000
|
-
})
|
|
17047
|
+
});
|
|
17001
17048
|
var LogsResponseSchema = external_exports.object({
|
|
17002
17049
|
logs: external_exports.array(LogSchema),
|
|
17003
17050
|
next_cursor: external_exports.string().nullable().optional()
|
|
17004
|
-
})
|
|
17051
|
+
});
|
|
17005
17052
|
var PendingStatusSchema = external_exports.object({
|
|
17006
17053
|
status: external_exports.literal("pending")
|
|
17007
|
-
})
|
|
17054
|
+
});
|
|
17008
17055
|
var BundleSchema = external_exports.object({
|
|
17009
17056
|
bundle_version: external_exports.number().int()
|
|
17010
17057
|
}).passthrough();
|
|
@@ -17012,14 +17059,14 @@ var ReproductionArtifactsSchema2 = external_exports.object({
|
|
|
17012
17059
|
curl: external_exports.string().nullable().optional(),
|
|
17013
17060
|
httpie: external_exports.string().nullable().optional(),
|
|
17014
17061
|
json_spec: external_exports.unknown().nullable().optional()
|
|
17015
|
-
})
|
|
17062
|
+
});
|
|
17016
17063
|
var ReproductionSchema = external_exports.object({
|
|
17017
17064
|
possible: external_exports.boolean(),
|
|
17018
17065
|
confidence: external_exports.number(),
|
|
17019
17066
|
reason: external_exports.string(),
|
|
17020
17067
|
artifacts: ReproductionArtifactsSchema2.nullable(),
|
|
17021
17068
|
feasibility_reference: external_exports.unknown().nullable()
|
|
17022
|
-
})
|
|
17069
|
+
});
|
|
17023
17070
|
var BundleResponseSchema = external_exports.union([PendingStatusSchema, BundleSchema]);
|
|
17024
17071
|
var ReproductionResponseSchema = external_exports.union([PendingStatusSchema, ReproductionSchema]);
|
|
17025
17072
|
var ApiErrorResponseSchema = external_exports.object({
|
|
@@ -17056,6 +17103,24 @@ async function expectServices(responsePromise) {
|
|
|
17056
17103
|
const parsed = await expectParsed(responsePromise, ServicesResponseSchema);
|
|
17057
17104
|
return parsed.services;
|
|
17058
17105
|
}
|
|
17106
|
+
function normalizeIncidentRecord(incident) {
|
|
17107
|
+
return {
|
|
17108
|
+
...incident,
|
|
17109
|
+
project_color_tag: incident.project_color_tag
|
|
17110
|
+
};
|
|
17111
|
+
}
|
|
17112
|
+
function normalizeIncidentContext(context) {
|
|
17113
|
+
return {
|
|
17114
|
+
...context,
|
|
17115
|
+
incident: normalizeIncidentRecord(context.incident)
|
|
17116
|
+
};
|
|
17117
|
+
}
|
|
17118
|
+
function normalizeImprovementRecord(improvement) {
|
|
17119
|
+
return {
|
|
17120
|
+
...improvement,
|
|
17121
|
+
project_color_tag: improvement.project_color_tag
|
|
17122
|
+
};
|
|
17123
|
+
}
|
|
17059
17124
|
function createRetrievalApi(client) {
|
|
17060
17125
|
return {
|
|
17061
17126
|
async listIncidents(input2) {
|
|
@@ -17094,7 +17159,7 @@ function createRetrievalApi(client) {
|
|
|
17094
17159
|
IncidentsResponseSchema
|
|
17095
17160
|
);
|
|
17096
17161
|
return {
|
|
17097
|
-
incidents: parsed.incidents,
|
|
17162
|
+
incidents: parsed.incidents.map(normalizeIncidentRecord),
|
|
17098
17163
|
next_cursor: parsed.next_cursor ?? null
|
|
17099
17164
|
};
|
|
17100
17165
|
},
|
|
@@ -17107,10 +17172,10 @@ function createRetrievalApi(client) {
|
|
|
17107
17172
|
}),
|
|
17108
17173
|
IncidentResponseSchema
|
|
17109
17174
|
);
|
|
17110
|
-
return parsed.incident;
|
|
17175
|
+
return normalizeIncidentRecord(parsed.incident);
|
|
17111
17176
|
},
|
|
17112
17177
|
async getIncidentContext(input2) {
|
|
17113
|
-
|
|
17178
|
+
const parsed = await expectParsed(
|
|
17114
17179
|
client.request({
|
|
17115
17180
|
method: "GET",
|
|
17116
17181
|
path: `/v1/incidents/${input2.incidentId}/context`,
|
|
@@ -17118,6 +17183,7 @@ function createRetrievalApi(client) {
|
|
|
17118
17183
|
}),
|
|
17119
17184
|
IncidentContextSchema
|
|
17120
17185
|
);
|
|
17186
|
+
return normalizeIncidentContext(parsed);
|
|
17121
17187
|
},
|
|
17122
17188
|
async resolveIncident(input2) {
|
|
17123
17189
|
const parsed = await expectParsed(
|
|
@@ -17128,7 +17194,7 @@ function createRetrievalApi(client) {
|
|
|
17128
17194
|
}),
|
|
17129
17195
|
IncidentResponseSchema
|
|
17130
17196
|
);
|
|
17131
|
-
return parsed.incident;
|
|
17197
|
+
return normalizeIncidentRecord(parsed.incident);
|
|
17132
17198
|
},
|
|
17133
17199
|
async resolveIncidents(input2) {
|
|
17134
17200
|
const parsed = await expectParsed(
|
|
@@ -17142,7 +17208,7 @@ function createRetrievalApi(client) {
|
|
|
17142
17208
|
}),
|
|
17143
17209
|
BulkIncidentResponseSchema
|
|
17144
17210
|
);
|
|
17145
|
-
return parsed.incidents;
|
|
17211
|
+
return parsed.incidents.map(normalizeIncidentRecord);
|
|
17146
17212
|
},
|
|
17147
17213
|
async reopenIncident(input2) {
|
|
17148
17214
|
const parsed = await expectParsed(
|
|
@@ -17153,7 +17219,7 @@ function createRetrievalApi(client) {
|
|
|
17153
17219
|
}),
|
|
17154
17220
|
IncidentResponseSchema
|
|
17155
17221
|
);
|
|
17156
|
-
return parsed.incident;
|
|
17222
|
+
return normalizeIncidentRecord(parsed.incident);
|
|
17157
17223
|
},
|
|
17158
17224
|
async reopenIncidents(input2) {
|
|
17159
17225
|
const parsed = await expectParsed(
|
|
@@ -17167,7 +17233,7 @@ function createRetrievalApi(client) {
|
|
|
17167
17233
|
}),
|
|
17168
17234
|
BulkIncidentResponseSchema
|
|
17169
17235
|
);
|
|
17170
|
-
return parsed.incidents;
|
|
17236
|
+
return parsed.incidents.map(normalizeIncidentRecord);
|
|
17171
17237
|
},
|
|
17172
17238
|
async getBundle(input2) {
|
|
17173
17239
|
const bundle = await expectParsed(
|
|
@@ -17264,7 +17330,7 @@ function createRetrievalApi(client) {
|
|
|
17264
17330
|
ImprovementsResponseSchema
|
|
17265
17331
|
);
|
|
17266
17332
|
return {
|
|
17267
|
-
improvements: parsed.improvements,
|
|
17333
|
+
improvements: parsed.improvements.map(normalizeImprovementRecord),
|
|
17268
17334
|
next_cursor: parsed.next_cursor ?? null
|
|
17269
17335
|
};
|
|
17270
17336
|
},
|
|
@@ -17277,7 +17343,7 @@ function createRetrievalApi(client) {
|
|
|
17277
17343
|
}),
|
|
17278
17344
|
ImprovementResponseSchema
|
|
17279
17345
|
);
|
|
17280
|
-
return parsed.improvement;
|
|
17346
|
+
return normalizeImprovementRecord(parsed.improvement);
|
|
17281
17347
|
},
|
|
17282
17348
|
async resolveImprovement(input2) {
|
|
17283
17349
|
const parsed = await expectParsed(
|
|
@@ -17288,7 +17354,7 @@ function createRetrievalApi(client) {
|
|
|
17288
17354
|
}),
|
|
17289
17355
|
ImprovementResponseSchema
|
|
17290
17356
|
);
|
|
17291
|
-
return parsed.improvement;
|
|
17357
|
+
return normalizeImprovementRecord(parsed.improvement);
|
|
17292
17358
|
},
|
|
17293
17359
|
async reopenImprovement(input2) {
|
|
17294
17360
|
const parsed = await expectParsed(
|
|
@@ -17299,7 +17365,7 @@ function createRetrievalApi(client) {
|
|
|
17299
17365
|
}),
|
|
17300
17366
|
ImprovementResponseSchema
|
|
17301
17367
|
);
|
|
17302
|
-
return parsed.improvement;
|
|
17368
|
+
return normalizeImprovementRecord(parsed.improvement);
|
|
17303
17369
|
},
|
|
17304
17370
|
async snoozeImprovement(input2) {
|
|
17305
17371
|
const parsed = await expectParsed(
|
|
@@ -17311,7 +17377,7 @@ function createRetrievalApi(client) {
|
|
|
17311
17377
|
}),
|
|
17312
17378
|
ImprovementResponseSchema
|
|
17313
17379
|
);
|
|
17314
|
-
return parsed.improvement;
|
|
17380
|
+
return normalizeImprovementRecord(parsed.improvement);
|
|
17315
17381
|
},
|
|
17316
17382
|
async getImprovementBundle(input2) {
|
|
17317
17383
|
return await expectParsed(
|
|
@@ -17327,7 +17393,7 @@ function createRetrievalApi(client) {
|
|
|
17327
17393
|
status: external_exports.literal("failed"),
|
|
17328
17394
|
reason: external_exports.string(),
|
|
17329
17395
|
related_incident_ids: external_exports.array(external_exports.string()).optional()
|
|
17330
|
-
})
|
|
17396
|
+
})
|
|
17331
17397
|
])
|
|
17332
17398
|
);
|
|
17333
17399
|
}
|
|
@@ -18235,7 +18301,7 @@ var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
|
|
|
18235
18301
|
method text NOT NULL CHECK (method IN ('GET', 'HEAD')),
|
|
18236
18302
|
expected_status_min integer NOT NULL DEFAULT 200 CHECK (expected_status_min BETWEEN 100 AND 599),
|
|
18237
18303
|
expected_status_max integer NOT NULL DEFAULT 399 CHECK (expected_status_max BETWEEN 100 AND 599),
|
|
18238
|
-
timeout_ms integer NOT NULL DEFAULT
|
|
18304
|
+
timeout_ms integer NOT NULL DEFAULT 2500 CHECK (timeout_ms BETWEEN 500 AND 5000),
|
|
18239
18305
|
interval_seconds integer NOT NULL CHECK (interval_seconds >= 30),
|
|
18240
18306
|
failure_threshold integer NOT NULL DEFAULT 3 CHECK (failure_threshold BETWEEN 1 AND 10),
|
|
18241
18307
|
recovery_threshold integer NOT NULL DEFAULT 2 CHECK (recovery_threshold BETWEEN 1 AND 10),
|
|
@@ -18349,6 +18415,136 @@ var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
|
|
|
18349
18415
|
`
|
|
18350
18416
|
];
|
|
18351
18417
|
|
|
18418
|
+
// ../../packages/storage/src/storage-bootstrap-account-analytics-statements.ts
|
|
18419
|
+
var STORAGE_BOOTSTRAP_ACCOUNT_ANALYTICS_STATEMENTS = [
|
|
18420
|
+
`
|
|
18421
|
+
CREATE TABLE account_analytics_accounts (
|
|
18422
|
+
analytics_account_id uuid PRIMARY KEY,
|
|
18423
|
+
organization_id uuid UNIQUE,
|
|
18424
|
+
organization_id_hash text NOT NULL UNIQUE,
|
|
18425
|
+
created_at timestamptz NOT NULL,
|
|
18426
|
+
first_seen_at timestamptz NOT NULL,
|
|
18427
|
+
metrics_collection_started_at timestamptz NOT NULL,
|
|
18428
|
+
backfilled_from_retained_rows_at timestamptz,
|
|
18429
|
+
deleted_at timestamptz,
|
|
18430
|
+
initial_plan text,
|
|
18431
|
+
latest_known_plan text,
|
|
18432
|
+
latest_capacity_units integer,
|
|
18433
|
+
account_deleted boolean NOT NULL DEFAULT false,
|
|
18434
|
+
metrics_schema_version integer NOT NULL DEFAULT 1,
|
|
18435
|
+
updated_at timestamptz NOT NULL DEFAULT now()
|
|
18436
|
+
)
|
|
18437
|
+
`,
|
|
18438
|
+
`
|
|
18439
|
+
CREATE TABLE account_metric_periods (
|
|
18440
|
+
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
18441
|
+
period_grain text NOT NULL CHECK (period_grain IN ('day', 'month', 'year', 'lifetime')),
|
|
18442
|
+
period_starts_at timestamptz NOT NULL,
|
|
18443
|
+
metric_key text NOT NULL,
|
|
18444
|
+
metric_value bigint NOT NULL DEFAULT 0,
|
|
18445
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
18446
|
+
PRIMARY KEY (analytics_account_id, period_grain, period_starts_at, metric_key)
|
|
18447
|
+
)
|
|
18448
|
+
`,
|
|
18449
|
+
`
|
|
18450
|
+
CREATE INDEX account_metric_periods_grain_period_metric_idx
|
|
18451
|
+
ON account_metric_periods (period_grain, period_starts_at, metric_key)
|
|
18452
|
+
`,
|
|
18453
|
+
`
|
|
18454
|
+
CREATE INDEX account_metric_periods_account_grain_period_idx
|
|
18455
|
+
ON account_metric_periods (analytics_account_id, period_grain, period_starts_at)
|
|
18456
|
+
`,
|
|
18457
|
+
`
|
|
18458
|
+
CREATE TABLE account_metric_events (
|
|
18459
|
+
dedupe_key_hash text PRIMARY KEY,
|
|
18460
|
+
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
18461
|
+
metric_source text NOT NULL,
|
|
18462
|
+
occurred_at timestamptz NOT NULL,
|
|
18463
|
+
recorded_at timestamptz NOT NULL DEFAULT now(),
|
|
18464
|
+
metric_deltas jsonb NOT NULL
|
|
18465
|
+
)
|
|
18466
|
+
`,
|
|
18467
|
+
`
|
|
18468
|
+
CREATE TABLE ingestion_rejection_diagnostic_periods (
|
|
18469
|
+
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
18470
|
+
period_starts_at timestamptz NOT NULL,
|
|
18471
|
+
rejection_reason text NOT NULL,
|
|
18472
|
+
project_id_text text NOT NULL DEFAULT '',
|
|
18473
|
+
service_name text NOT NULL DEFAULT '',
|
|
18474
|
+
service_environment text NOT NULL DEFAULT '',
|
|
18475
|
+
service_runtime text NOT NULL DEFAULT '',
|
|
18476
|
+
sdk_name text NOT NULL DEFAULT '',
|
|
18477
|
+
sdk_version text NOT NULL DEFAULT '',
|
|
18478
|
+
event_type text NOT NULL DEFAULT '',
|
|
18479
|
+
validation_code text NOT NULL DEFAULT '',
|
|
18480
|
+
validation_path text NOT NULL DEFAULT '',
|
|
18481
|
+
occurrences bigint NOT NULL DEFAULT 0,
|
|
18482
|
+
first_seen_at timestamptz NOT NULL,
|
|
18483
|
+
last_seen_at timestamptz NOT NULL,
|
|
18484
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
18485
|
+
PRIMARY KEY (
|
|
18486
|
+
analytics_account_id,
|
|
18487
|
+
period_starts_at,
|
|
18488
|
+
rejection_reason,
|
|
18489
|
+
project_id_text,
|
|
18490
|
+
service_name,
|
|
18491
|
+
service_environment,
|
|
18492
|
+
service_runtime,
|
|
18493
|
+
sdk_name,
|
|
18494
|
+
sdk_version,
|
|
18495
|
+
event_type,
|
|
18496
|
+
validation_code,
|
|
18497
|
+
validation_path
|
|
18498
|
+
)
|
|
18499
|
+
)
|
|
18500
|
+
`,
|
|
18501
|
+
`
|
|
18502
|
+
CREATE INDEX ingestion_rejection_diagnostic_periods_reason_period_idx
|
|
18503
|
+
ON ingestion_rejection_diagnostic_periods (rejection_reason, period_starts_at, last_seen_at DESC)
|
|
18504
|
+
`,
|
|
18505
|
+
`
|
|
18506
|
+
CREATE TABLE account_payment_retention_records (
|
|
18507
|
+
id uuid PRIMARY KEY,
|
|
18508
|
+
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
18509
|
+
organization_id_hash text NOT NULL,
|
|
18510
|
+
provider text NOT NULL,
|
|
18511
|
+
plan text,
|
|
18512
|
+
billing_state text,
|
|
18513
|
+
stripe_customer_id text,
|
|
18514
|
+
stripe_subscription_id text,
|
|
18515
|
+
billing_period_starts_at timestamptz,
|
|
18516
|
+
billing_period_ends_at timestamptz,
|
|
18517
|
+
additional_capacity_units integer,
|
|
18518
|
+
last_billing_event_id text,
|
|
18519
|
+
account_deleted_at timestamptz NOT NULL,
|
|
18520
|
+
recorded_at timestamptz NOT NULL DEFAULT now(),
|
|
18521
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
18522
|
+
UNIQUE (analytics_account_id, provider)
|
|
18523
|
+
)
|
|
18524
|
+
`,
|
|
18525
|
+
`
|
|
18526
|
+
CREATE INDEX account_payment_retention_records_provider_idx
|
|
18527
|
+
ON account_payment_retention_records (provider, account_deleted_at DESC)
|
|
18528
|
+
`,
|
|
18529
|
+
`
|
|
18530
|
+
CREATE TABLE account_payment_provider_events (
|
|
18531
|
+
provider_event_key text PRIMARY KEY,
|
|
18532
|
+
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
18533
|
+
organization_id_hash text NOT NULL,
|
|
18534
|
+
provider text NOT NULL,
|
|
18535
|
+
provider_event_id text NOT NULL,
|
|
18536
|
+
provider_event_type text NOT NULL,
|
|
18537
|
+
processed_at timestamptz NOT NULL,
|
|
18538
|
+
account_deleted_at timestamptz NOT NULL,
|
|
18539
|
+
recorded_at timestamptz NOT NULL DEFAULT now()
|
|
18540
|
+
)
|
|
18541
|
+
`,
|
|
18542
|
+
`
|
|
18543
|
+
CREATE UNIQUE INDEX account_payment_provider_events_provider_event_key
|
|
18544
|
+
ON account_payment_provider_events (provider, provider_event_id)
|
|
18545
|
+
`
|
|
18546
|
+
];
|
|
18547
|
+
|
|
18352
18548
|
// ../../packages/storage/src/storage-bootstrap-statements.ts
|
|
18353
18549
|
var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
18354
18550
|
`
|
|
@@ -18412,6 +18608,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
18412
18608
|
name text NOT NULL,
|
|
18413
18609
|
slug text NOT NULL,
|
|
18414
18610
|
environment_default text NOT NULL DEFAULT 'production',
|
|
18611
|
+
color_tag text
|
|
18612
|
+
CHECK (color_tag IN ('red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose', 'slate') OR color_tag IS NULL),
|
|
18415
18613
|
automated_improvement_bundles_enabled boolean NOT NULL DEFAULT true,
|
|
18416
18614
|
improvement_bundle_sensitivity text NOT NULL DEFAULT 'high_confidence'
|
|
18417
18615
|
CHECK (improvement_bundle_sensitivity IN ('high_confidence', 'balanced', 'verbose')),
|
|
@@ -19288,94 +19486,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
19288
19486
|
PRIMARY KEY (project_id, period_starts_at)
|
|
19289
19487
|
)
|
|
19290
19488
|
`,
|
|
19291
|
-
|
|
19292
|
-
CREATE TABLE account_analytics_accounts (
|
|
19293
|
-
analytics_account_id uuid PRIMARY KEY,
|
|
19294
|
-
organization_id uuid UNIQUE,
|
|
19295
|
-
organization_id_hash text NOT NULL UNIQUE,
|
|
19296
|
-
created_at timestamptz NOT NULL,
|
|
19297
|
-
first_seen_at timestamptz NOT NULL,
|
|
19298
|
-
metrics_collection_started_at timestamptz NOT NULL,
|
|
19299
|
-
backfilled_from_retained_rows_at timestamptz,
|
|
19300
|
-
deleted_at timestamptz,
|
|
19301
|
-
initial_plan text,
|
|
19302
|
-
latest_known_plan text,
|
|
19303
|
-
latest_capacity_units integer,
|
|
19304
|
-
account_deleted boolean NOT NULL DEFAULT false,
|
|
19305
|
-
metrics_schema_version integer NOT NULL DEFAULT 1,
|
|
19306
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
19307
|
-
)
|
|
19308
|
-
`,
|
|
19309
|
-
`
|
|
19310
|
-
CREATE TABLE account_metric_periods (
|
|
19311
|
-
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
19312
|
-
period_grain text NOT NULL CHECK (period_grain IN ('day', 'month', 'year', 'lifetime')),
|
|
19313
|
-
period_starts_at timestamptz NOT NULL,
|
|
19314
|
-
metric_key text NOT NULL,
|
|
19315
|
-
metric_value bigint NOT NULL DEFAULT 0,
|
|
19316
|
-
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
19317
|
-
PRIMARY KEY (analytics_account_id, period_grain, period_starts_at, metric_key)
|
|
19318
|
-
)
|
|
19319
|
-
`,
|
|
19320
|
-
`
|
|
19321
|
-
CREATE INDEX account_metric_periods_grain_period_metric_idx
|
|
19322
|
-
ON account_metric_periods (period_grain, period_starts_at, metric_key)
|
|
19323
|
-
`,
|
|
19324
|
-
`
|
|
19325
|
-
CREATE INDEX account_metric_periods_account_grain_period_idx
|
|
19326
|
-
ON account_metric_periods (analytics_account_id, period_grain, period_starts_at)
|
|
19327
|
-
`,
|
|
19328
|
-
`
|
|
19329
|
-
CREATE TABLE account_metric_events (
|
|
19330
|
-
dedupe_key_hash text PRIMARY KEY,
|
|
19331
|
-
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
19332
|
-
metric_source text NOT NULL,
|
|
19333
|
-
occurred_at timestamptz NOT NULL,
|
|
19334
|
-
recorded_at timestamptz NOT NULL DEFAULT now(),
|
|
19335
|
-
metric_deltas jsonb NOT NULL
|
|
19336
|
-
)
|
|
19337
|
-
`,
|
|
19338
|
-
`
|
|
19339
|
-
CREATE TABLE account_payment_retention_records (
|
|
19340
|
-
id uuid PRIMARY KEY,
|
|
19341
|
-
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
19342
|
-
organization_id_hash text NOT NULL,
|
|
19343
|
-
provider text NOT NULL,
|
|
19344
|
-
plan text,
|
|
19345
|
-
billing_state text,
|
|
19346
|
-
stripe_customer_id text,
|
|
19347
|
-
stripe_subscription_id text,
|
|
19348
|
-
billing_period_starts_at timestamptz,
|
|
19349
|
-
billing_period_ends_at timestamptz,
|
|
19350
|
-
additional_capacity_units integer,
|
|
19351
|
-
last_billing_event_id text,
|
|
19352
|
-
account_deleted_at timestamptz NOT NULL,
|
|
19353
|
-
recorded_at timestamptz NOT NULL DEFAULT now(),
|
|
19354
|
-
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
19355
|
-
UNIQUE (analytics_account_id, provider)
|
|
19356
|
-
)
|
|
19357
|
-
`,
|
|
19358
|
-
`
|
|
19359
|
-
CREATE INDEX account_payment_retention_records_provider_idx
|
|
19360
|
-
ON account_payment_retention_records (provider, account_deleted_at DESC)
|
|
19361
|
-
`,
|
|
19362
|
-
`
|
|
19363
|
-
CREATE TABLE account_payment_provider_events (
|
|
19364
|
-
provider_event_key text PRIMARY KEY,
|
|
19365
|
-
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
19366
|
-
organization_id_hash text NOT NULL,
|
|
19367
|
-
provider text NOT NULL,
|
|
19368
|
-
provider_event_id text NOT NULL,
|
|
19369
|
-
provider_event_type text NOT NULL,
|
|
19370
|
-
processed_at timestamptz NOT NULL,
|
|
19371
|
-
account_deleted_at timestamptz NOT NULL,
|
|
19372
|
-
recorded_at timestamptz NOT NULL DEFAULT now()
|
|
19373
|
-
)
|
|
19374
|
-
`,
|
|
19375
|
-
`
|
|
19376
|
-
CREATE UNIQUE INDEX account_payment_provider_events_provider_event_key
|
|
19377
|
-
ON account_payment_provider_events (provider, provider_event_id)
|
|
19378
|
-
`,
|
|
19489
|
+
...STORAGE_BOOTSTRAP_ACCOUNT_ANALYTICS_STATEMENTS,
|
|
19379
19490
|
`
|
|
19380
19491
|
CREATE TABLE operational_email_deliveries (
|
|
19381
19492
|
id uuid PRIMARY KEY,
|
|
@@ -19689,6 +19800,16 @@ var AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
19689
19800
|
ON availability_check_daily_rollups (project_id, day DESC)
|
|
19690
19801
|
`
|
|
19691
19802
|
]
|
|
19803
|
+
}),
|
|
19804
|
+
defineAvailabilityCheckStorageSchemaMigration({
|
|
19805
|
+
id: "202606180001_lower_availability_check_timeout_default",
|
|
19806
|
+
description: "Lower the database default timeout for newly inserted availability checks while preserving existing rows and the explicit 5000ms maximum.",
|
|
19807
|
+
statements: [
|
|
19808
|
+
`
|
|
19809
|
+
ALTER TABLE availability_checks
|
|
19810
|
+
ALTER COLUMN timeout_ms SET DEFAULT 2500
|
|
19811
|
+
`
|
|
19812
|
+
]
|
|
19692
19813
|
})
|
|
19693
19814
|
];
|
|
19694
19815
|
|
|
@@ -20550,6 +20671,70 @@ var STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
20550
20671
|
AND expires_at <= now()
|
|
20551
20672
|
`
|
|
20552
20673
|
]
|
|
20674
|
+
}),
|
|
20675
|
+
defineStorageSchemaMigration({
|
|
20676
|
+
id: "202606140001_add_ingestion_rejection_diagnostics",
|
|
20677
|
+
description: "Track sanitized ingestion rejection diagnostics for operator breakdowns.",
|
|
20678
|
+
statements: [
|
|
20679
|
+
`
|
|
20680
|
+
CREATE TABLE IF NOT EXISTS ingestion_rejection_diagnostic_periods (
|
|
20681
|
+
analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
|
|
20682
|
+
period_starts_at timestamptz NOT NULL,
|
|
20683
|
+
rejection_reason text NOT NULL,
|
|
20684
|
+
project_id_text text NOT NULL DEFAULT '',
|
|
20685
|
+
service_name text NOT NULL DEFAULT '',
|
|
20686
|
+
service_environment text NOT NULL DEFAULT '',
|
|
20687
|
+
service_runtime text NOT NULL DEFAULT '',
|
|
20688
|
+
sdk_name text NOT NULL DEFAULT '',
|
|
20689
|
+
sdk_version text NOT NULL DEFAULT '',
|
|
20690
|
+
event_type text NOT NULL DEFAULT '',
|
|
20691
|
+
validation_code text NOT NULL DEFAULT '',
|
|
20692
|
+
validation_path text NOT NULL DEFAULT '',
|
|
20693
|
+
occurrences bigint NOT NULL DEFAULT 0,
|
|
20694
|
+
first_seen_at timestamptz NOT NULL,
|
|
20695
|
+
last_seen_at timestamptz NOT NULL,
|
|
20696
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
20697
|
+
PRIMARY KEY (
|
|
20698
|
+
analytics_account_id,
|
|
20699
|
+
period_starts_at,
|
|
20700
|
+
rejection_reason,
|
|
20701
|
+
project_id_text,
|
|
20702
|
+
service_name,
|
|
20703
|
+
service_environment,
|
|
20704
|
+
service_runtime,
|
|
20705
|
+
sdk_name,
|
|
20706
|
+
sdk_version,
|
|
20707
|
+
event_type,
|
|
20708
|
+
validation_code,
|
|
20709
|
+
validation_path
|
|
20710
|
+
)
|
|
20711
|
+
)
|
|
20712
|
+
`,
|
|
20713
|
+
`
|
|
20714
|
+
CREATE INDEX IF NOT EXISTS ingestion_rejection_diagnostic_periods_reason_period_idx
|
|
20715
|
+
ON ingestion_rejection_diagnostic_periods (
|
|
20716
|
+
rejection_reason,
|
|
20717
|
+
period_starts_at,
|
|
20718
|
+
last_seen_at DESC
|
|
20719
|
+
)
|
|
20720
|
+
`
|
|
20721
|
+
]
|
|
20722
|
+
}),
|
|
20723
|
+
defineStorageSchemaMigration({
|
|
20724
|
+
id: "202606170001_add_project_color_tags",
|
|
20725
|
+
description: "Add optional project color tags for project metadata and retrieval surfaces.",
|
|
20726
|
+
statements: [
|
|
20727
|
+
"ALTER TABLE projects ADD COLUMN IF NOT EXISTS color_tag text",
|
|
20728
|
+
"ALTER TABLE projects DROP CONSTRAINT IF EXISTS projects_color_tag_check",
|
|
20729
|
+
`
|
|
20730
|
+
ALTER TABLE projects
|
|
20731
|
+
ADD CONSTRAINT projects_color_tag_check
|
|
20732
|
+
CHECK (
|
|
20733
|
+
color_tag IN ('red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose', 'slate')
|
|
20734
|
+
OR color_tag IS NULL
|
|
20735
|
+
)
|
|
20736
|
+
`
|
|
20737
|
+
]
|
|
20553
20738
|
})
|
|
20554
20739
|
];
|
|
20555
20740
|
|
|
@@ -20557,7 +20742,7 @@ var STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
20557
20742
|
var STORAGE_SCHEMA_MIGRATIONS2 = [
|
|
20558
20743
|
...STORAGE_SCHEMA_MIGRATIONS,
|
|
20559
20744
|
...AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS
|
|
20560
|
-
];
|
|
20745
|
+
].sort((left, right) => left.id.localeCompare(right.id));
|
|
20561
20746
|
|
|
20562
20747
|
// src/local-retrieval-store.ts
|
|
20563
20748
|
var CONNECTION_FILE_PATH2 = ".debugbundle/local/connection.json";
|
|
@@ -20758,6 +20943,9 @@ async function listLocalIncidents(input2, dependencies) {
|
|
|
20758
20943
|
if (input2.status === void 0 || input2.status === "all") {
|
|
20759
20944
|
return true;
|
|
20760
20945
|
}
|
|
20946
|
+
if (input2.status === "active") {
|
|
20947
|
+
return incident.status === "open";
|
|
20948
|
+
}
|
|
20761
20949
|
return incident.status === input2.status;
|
|
20762
20950
|
}).filter((incident) => input2.severity === void 0 ? true : incident.severity === input2.severity).filter((incident) => input2.firstSeenAfter === void 0 ? true : incident.first_seen_at >= input2.firstSeenAfter).sort(sortIncidentsDescending);
|
|
20763
20951
|
const startIndex = input2.cursor === void 0 ? 0 : incidents.findIndex((incident) => buildCursor(incident) === input2.cursor) + 1;
|
|
@@ -21302,9 +21490,24 @@ var import_promises8 = require("node:fs/promises");
|
|
|
21302
21490
|
var import_node_path9 = require("node:path");
|
|
21303
21491
|
|
|
21304
21492
|
// ../../packages/project-management-client/src/index.ts
|
|
21493
|
+
var ProjectColorTagResponseSchema2 = external_exports.unknown().transform((value, context) => {
|
|
21494
|
+
if (value === void 0 || value === null) {
|
|
21495
|
+
return null;
|
|
21496
|
+
}
|
|
21497
|
+
const parsed = ProjectColorTagSchema.safeParse(value);
|
|
21498
|
+
if (!parsed.success) {
|
|
21499
|
+
context.addIssue({
|
|
21500
|
+
code: external_exports.ZodIssueCode.custom,
|
|
21501
|
+
message: "Invalid project color tag"
|
|
21502
|
+
});
|
|
21503
|
+
return external_exports.NEVER;
|
|
21504
|
+
}
|
|
21505
|
+
return parsed.data;
|
|
21506
|
+
});
|
|
21305
21507
|
var ProjectMetricsSchema = external_exports.object({
|
|
21306
21508
|
open_incidents: external_exports.number().int().nonnegative().default(0),
|
|
21307
21509
|
regressed_incidents: external_exports.number().int().nonnegative().default(0),
|
|
21510
|
+
attention_incidents_today: external_exports.number().int().nonnegative().default(0),
|
|
21308
21511
|
opened_incidents_today: external_exports.number().int().nonnegative().default(0),
|
|
21309
21512
|
opened_incidents_month: external_exports.number().int().nonnegative().default(0),
|
|
21310
21513
|
monthly_bundle_requests: external_exports.number().int().nonnegative(),
|
|
@@ -21324,6 +21527,7 @@ var ProjectRecordSchema = external_exports.object({
|
|
|
21324
21527
|
name: external_exports.string(),
|
|
21325
21528
|
slug: external_exports.string(),
|
|
21326
21529
|
environment_default: external_exports.string(),
|
|
21530
|
+
color_tag: ProjectColorTagResponseSchema2,
|
|
21327
21531
|
organization_plan: external_exports.enum(["free", "solo", "team"]),
|
|
21328
21532
|
metrics: ProjectMetricsSchema,
|
|
21329
21533
|
created_at: external_exports.string(),
|
|
@@ -21347,6 +21551,7 @@ var DeletedProjectRecordSchema = external_exports.object({
|
|
|
21347
21551
|
name: external_exports.string(),
|
|
21348
21552
|
slug: external_exports.string(),
|
|
21349
21553
|
environment_default: external_exports.string(),
|
|
21554
|
+
color_tag: ProjectColorTagResponseSchema2,
|
|
21350
21555
|
organization_plan: external_exports.enum(["free", "solo", "team"]),
|
|
21351
21556
|
created_at: external_exports.string(),
|
|
21352
21557
|
updated_at: external_exports.string()
|
|
@@ -21373,6 +21578,18 @@ function parseApiError2(status, body) {
|
|
|
21373
21578
|
}
|
|
21374
21579
|
throw new ProjectManagementApiError(status, parsed.data.error);
|
|
21375
21580
|
}
|
|
21581
|
+
function normalizeProjectRecord(project) {
|
|
21582
|
+
return {
|
|
21583
|
+
...project,
|
|
21584
|
+
color_tag: project.color_tag
|
|
21585
|
+
};
|
|
21586
|
+
}
|
|
21587
|
+
function normalizeDeletedProjectRecord(project) {
|
|
21588
|
+
return {
|
|
21589
|
+
...project,
|
|
21590
|
+
color_tag: project.color_tag
|
|
21591
|
+
};
|
|
21592
|
+
}
|
|
21376
21593
|
async function expectProjects(responsePromise) {
|
|
21377
21594
|
const response = await responsePromise;
|
|
21378
21595
|
if (response.status < 200 || response.status >= 300) {
|
|
@@ -21382,7 +21599,7 @@ async function expectProjects(responsePromise) {
|
|
|
21382
21599
|
if (!parsed.success) {
|
|
21383
21600
|
throw new ProjectManagementApiError(response.status, "invalid_response_shape");
|
|
21384
21601
|
}
|
|
21385
|
-
return parsed.data.projects;
|
|
21602
|
+
return parsed.data.projects.map(normalizeProjectRecord);
|
|
21386
21603
|
}
|
|
21387
21604
|
async function expectProject(responsePromise) {
|
|
21388
21605
|
const response = await responsePromise;
|
|
@@ -21393,7 +21610,7 @@ async function expectProject(responsePromise) {
|
|
|
21393
21610
|
if (!parsed.success) {
|
|
21394
21611
|
throw new ProjectManagementApiError(response.status, "invalid_response_shape");
|
|
21395
21612
|
}
|
|
21396
|
-
return parsed.data.project;
|
|
21613
|
+
return normalizeProjectRecord(parsed.data.project);
|
|
21397
21614
|
}
|
|
21398
21615
|
async function expectDeletedProject(responsePromise) {
|
|
21399
21616
|
const response = await responsePromise;
|
|
@@ -21404,7 +21621,7 @@ async function expectDeletedProject(responsePromise) {
|
|
|
21404
21621
|
if (!parsed.success) {
|
|
21405
21622
|
throw new ProjectManagementApiError(response.status, "invalid_response_shape");
|
|
21406
21623
|
}
|
|
21407
|
-
return parsed.data.project;
|
|
21624
|
+
return normalizeDeletedProjectRecord(parsed.data.project);
|
|
21408
21625
|
}
|
|
21409
21626
|
function createProjectManagementApi(client) {
|
|
21410
21627
|
return {
|
|
@@ -21427,7 +21644,8 @@ function createProjectManagementApi(client) {
|
|
|
21427
21644
|
body: {
|
|
21428
21645
|
name: input2.name,
|
|
21429
21646
|
slug: input2.slug,
|
|
21430
|
-
...input2.environmentDefault === void 0 ? {} : { environment_default: input2.environmentDefault }
|
|
21647
|
+
...input2.environmentDefault === void 0 ? {} : { environment_default: input2.environmentDefault },
|
|
21648
|
+
...input2.colorTag === void 0 ? {} : { color_tag: input2.colorTag }
|
|
21431
21649
|
}
|
|
21432
21650
|
})
|
|
21433
21651
|
);
|
|
@@ -21443,6 +21661,9 @@ function createProjectManagementApi(client) {
|
|
|
21443
21661
|
if (input2.environmentDefault !== void 0) {
|
|
21444
21662
|
body["environment_default"] = input2.environmentDefault;
|
|
21445
21663
|
}
|
|
21664
|
+
if (input2.colorTag !== void 0) {
|
|
21665
|
+
body["color_tag"] = input2.colorTag;
|
|
21666
|
+
}
|
|
21446
21667
|
return expectProject(
|
|
21447
21668
|
client.request({
|
|
21448
21669
|
method: "PATCH",
|
|
@@ -28180,6 +28401,16 @@ function mapErrorToExitCode2(error) {
|
|
|
28180
28401
|
}
|
|
28181
28402
|
return 1;
|
|
28182
28403
|
}
|
|
28404
|
+
function formatRetrievalErrorOutput(error) {
|
|
28405
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
28406
|
+
if (error instanceof RetrievalApiError && error.status === 200 && error.code === "invalid_response_shape") {
|
|
28407
|
+
return [
|
|
28408
|
+
message,
|
|
28409
|
+
"The cloud API returned a success response that this CLI version could not parse. Update DebugBundle CLI and retry: npm install -g @debugbundle/cli@latest"
|
|
28410
|
+
].join("\n");
|
|
28411
|
+
}
|
|
28412
|
+
return message;
|
|
28413
|
+
}
|
|
28183
28414
|
function formatIncidentTable(incidents) {
|
|
28184
28415
|
if (incidents.length === 0) {
|
|
28185
28416
|
return "No incidents found.";
|
|
@@ -28286,7 +28517,7 @@ function formatLogsTable(logs) {
|
|
|
28286
28517
|
function mapErrorToResult(error) {
|
|
28287
28518
|
return {
|
|
28288
28519
|
exitCode: mapErrorToExitCode2(error),
|
|
28289
|
-
output:
|
|
28520
|
+
output: formatRetrievalErrorOutput(error)
|
|
28290
28521
|
};
|
|
28291
28522
|
}
|
|
28292
28523
|
function mapUnsupportedReopenResult() {
|
|
@@ -28374,8 +28605,15 @@ async function mapCombinedIncidentListResult(input2, api, dependencies) {
|
|
|
28374
28605
|
function mapAuthOrRetrievalError(error) {
|
|
28375
28606
|
return mapCliAuthErrorToResult(error) ?? mapErrorToResult(error);
|
|
28376
28607
|
}
|
|
28608
|
+
function resolveIncidentListStatusFilter(status) {
|
|
28609
|
+
if (status === "all") {
|
|
28610
|
+
return void 0;
|
|
28611
|
+
}
|
|
28612
|
+
return status ?? "active";
|
|
28613
|
+
}
|
|
28377
28614
|
async function listIncidentsCommand(input2, api) {
|
|
28378
28615
|
try {
|
|
28616
|
+
const statusFilter = resolveIncidentListStatusFilter(input2.status);
|
|
28379
28617
|
const requestInput = {
|
|
28380
28618
|
bearerToken: input2.bearerToken
|
|
28381
28619
|
};
|
|
@@ -28388,8 +28626,8 @@ async function listIncidentsCommand(input2, api) {
|
|
|
28388
28626
|
if (input2.service !== void 0) {
|
|
28389
28627
|
requestInput.service = input2.service;
|
|
28390
28628
|
}
|
|
28391
|
-
if (
|
|
28392
|
-
requestInput.status =
|
|
28629
|
+
if (statusFilter !== void 0) {
|
|
28630
|
+
requestInput.status = statusFilter;
|
|
28393
28631
|
}
|
|
28394
28632
|
if (input2.severity !== void 0) {
|
|
28395
28633
|
requestInput.severity = input2.severity;
|
|
@@ -28415,10 +28653,11 @@ async function listIncidentsCommand(input2, api) {
|
|
|
28415
28653
|
output: formatIncidentTable(incidents.incidents)
|
|
28416
28654
|
};
|
|
28417
28655
|
} catch (error) {
|
|
28418
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
28656
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
28419
28657
|
}
|
|
28420
28658
|
}
|
|
28421
28659
|
async function listIncidentsWithAuthCommand(input2, dependencies) {
|
|
28660
|
+
const statusFilter = resolveIncidentListStatusFilter(input2.status);
|
|
28422
28661
|
if (await shouldUseLocalRetrieval(input2.source, dependencies)) {
|
|
28423
28662
|
try {
|
|
28424
28663
|
const incidents = await listLocalIncidents(
|
|
@@ -28426,7 +28665,7 @@ async function listIncidentsWithAuthCommand(input2, dependencies) {
|
|
|
28426
28665
|
...input2.projectId === void 0 ? {} : { projectId: input2.projectId },
|
|
28427
28666
|
...input2.environment === void 0 ? {} : { environment: input2.environment },
|
|
28428
28667
|
...input2.service === void 0 ? {} : { service: input2.service },
|
|
28429
|
-
...
|
|
28668
|
+
...statusFilter === void 0 ? {} : { status: statusFilter },
|
|
28430
28669
|
...input2.severity === void 0 ? {} : { severity: input2.severity },
|
|
28431
28670
|
...input2.firstSeenAfter === void 0 ? {} : { firstSeenAfter: input2.firstSeenAfter },
|
|
28432
28671
|
...input2.cursor === void 0 ? {} : { cursor: input2.cursor },
|
|
@@ -28451,7 +28690,7 @@ async function listIncidentsWithAuthCommand(input2, dependencies) {
|
|
|
28451
28690
|
...input2.projectId === void 0 ? {} : { projectId: input2.projectId },
|
|
28452
28691
|
...input2.environment === void 0 ? {} : { environment: input2.environment },
|
|
28453
28692
|
...input2.service === void 0 ? {} : { service: input2.service },
|
|
28454
|
-
...
|
|
28693
|
+
...statusFilter === void 0 ? {} : { status: statusFilter },
|
|
28455
28694
|
...input2.severity === void 0 ? {} : { severity: input2.severity },
|
|
28456
28695
|
...input2.firstSeenAfter === void 0 ? {} : { firstSeenAfter: input2.firstSeenAfter },
|
|
28457
28696
|
...input2.cursor === void 0 ? {} : { cursor: input2.cursor },
|
|
@@ -28529,7 +28768,7 @@ async function getIncidentCommand(input2, api) {
|
|
|
28529
28768
|
output: formatIncidentDetail(incident)
|
|
28530
28769
|
};
|
|
28531
28770
|
} catch (error) {
|
|
28532
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
28771
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
28533
28772
|
}
|
|
28534
28773
|
}
|
|
28535
28774
|
async function readLocalIncidentContext(input2, dependencies) {
|
|
@@ -28575,7 +28814,7 @@ async function getIncidentContextCommand(input2, api) {
|
|
|
28575
28814
|
output: input2.json ? JSON.stringify(context) : formatIncidentContextDetail(context)
|
|
28576
28815
|
};
|
|
28577
28816
|
} catch (error) {
|
|
28578
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
28817
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
28579
28818
|
}
|
|
28580
28819
|
}
|
|
28581
28820
|
async function getIncidentContextWithAuthCommand(input2, dependencies) {
|
|
@@ -28700,7 +28939,7 @@ async function resolveIncidentCommand(input2, api) {
|
|
|
28700
28939
|
output: formatIncidentDetail(incident)
|
|
28701
28940
|
};
|
|
28702
28941
|
} catch (error) {
|
|
28703
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
28942
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
28704
28943
|
}
|
|
28705
28944
|
}
|
|
28706
28945
|
async function resolveIncidentWithAuthCommand(input2, dependencies) {
|
|
@@ -28875,7 +29114,7 @@ async function reopenIncidentCommand(input2, api) {
|
|
|
28875
29114
|
output: formatIncidentDetail(incident)
|
|
28876
29115
|
};
|
|
28877
29116
|
} catch (error) {
|
|
28878
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
29117
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
28879
29118
|
}
|
|
28880
29119
|
}
|
|
28881
29120
|
async function reopenIncidentWithAuthCommand(input2, dependencies) {
|
|
@@ -29021,7 +29260,7 @@ async function getBundleCommand(input2, api) {
|
|
|
29021
29260
|
output: input2.json ? JSON.stringify(bundle) : formatObjectOutput(bundle)
|
|
29022
29261
|
};
|
|
29023
29262
|
} catch (error) {
|
|
29024
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
29263
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
29025
29264
|
}
|
|
29026
29265
|
}
|
|
29027
29266
|
async function getBundleWithAuthCommand(input2, dependencies) {
|
|
@@ -29093,7 +29332,7 @@ async function getLogsCommand(input2, api) {
|
|
|
29093
29332
|
output: input2.json ? JSON.stringify(logs) : formatLogsTable(logs.logs)
|
|
29094
29333
|
};
|
|
29095
29334
|
} catch (error) {
|
|
29096
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
29335
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
29097
29336
|
}
|
|
29098
29337
|
}
|
|
29099
29338
|
async function getLogsWithAuthCommand(input2, dependencies) {
|
|
@@ -29131,7 +29370,7 @@ async function getReproductionCommand(input2, api) {
|
|
|
29131
29370
|
output: input2.json ? JSON.stringify(reproduction) : formatObjectOutput(reproduction)
|
|
29132
29371
|
};
|
|
29133
29372
|
} catch (error) {
|
|
29134
|
-
return { exitCode: mapErrorToExitCode2(error), output:
|
|
29373
|
+
return { exitCode: mapErrorToExitCode2(error), output: formatRetrievalErrorOutput(error) };
|
|
29135
29374
|
}
|
|
29136
29375
|
}
|
|
29137
29376
|
async function getReproductionWithAuthCommand(input2, dependencies) {
|
|
@@ -30216,7 +30455,7 @@ var CLI_USAGE_LINES = [
|
|
|
30216
30455
|
" debugbundle login --github-device [--label <label>] [--base-url <url>] [--auth-file <path>] [--json]",
|
|
30217
30456
|
" debugbundle profile validate [--json]",
|
|
30218
30457
|
" debugbundle whoami [--auth-file <path>] [--json]",
|
|
30219
|
-
" debugbundle incidents [--source <local|cloud>] [--project-id <id>] [--environment <name>] [--service <name>] [--status <
|
|
30458
|
+
" debugbundle incidents [--source <local|cloud>] [--project-id <id>] [--environment <name>] [--service <name>] [--status <active|open|resolved|regressed|all>] [--severity <severity>] [--first-seen-after <ISO8601>] [--cursor <cursor>] [--limit <n>] [--auth-file <path>] [--json]",
|
|
30220
30459
|
" debugbundle inspect <incident-id> [--source <local|cloud>] [--auth-file <path>] [--json]",
|
|
30221
30460
|
" debugbundle explain <incident-id> [--source <local|cloud>] [--auth-file <path>] [--json]",
|
|
30222
30461
|
" debugbundle resolve <incident-id> [incident-id ...] [--source <local|cloud>] [--auth-file <path>] [--json]",
|
|
@@ -30241,8 +30480,8 @@ var CLI_USAGE_LINES = [
|
|
|
30241
30480
|
" debugbundle github deliveries --project-id <id> [--status <status>] [--limit <n>] [--auth-file <path>] [--json]",
|
|
30242
30481
|
" debugbundle github deliveries retry <delivery-id> --project-id <id> [--auth-file <path>] [--json]",
|
|
30243
30482
|
" debugbundle project list [--limit <n>] [--auth-file <path>] [--json]",
|
|
30244
|
-
" debugbundle project create --name <name> --slug <slug> [--environment-default <env>] [--auth-file <path>] [--json]",
|
|
30245
|
-
" debugbundle project update <project-id> [--name <name>] [--slug <slug>] [--environment-default <env>] [--auth-file <path>] [--json]",
|
|
30483
|
+
" debugbundle project create --name <name> --slug <slug> [--environment-default <env>] [--color-tag <tag>] [--auth-file <path>] [--json]",
|
|
30484
|
+
" debugbundle project update <project-id> [--name <name>] [--slug <slug>] [--environment-default <env>] [--color-tag <tag> | --clear-color-tag] [--auth-file <path>] [--json]",
|
|
30246
30485
|
" debugbundle project delete <project-id> [--auth-file <path>] [--json]",
|
|
30247
30486
|
" debugbundle token project list <project-id> [--limit <n>] [--auth-file <path>] [--json]",
|
|
30248
30487
|
" debugbundle token project create <project-id> --label <label> [--allowed-origin <origin> ...] [--auth-file <path>] [--json]",
|
|
@@ -30606,7 +30845,7 @@ function parseArgv(argv) {
|
|
|
30606
30845
|
positionals.push(token);
|
|
30607
30846
|
continue;
|
|
30608
30847
|
}
|
|
30609
|
-
if (token === "--fix" || token === "--json" || token === "--check-relay" || token === "--privacy" || token === "--help" || token === "--version" || token === "--non-interactive" || token === "--local" || token === "--cloud" || token === "--events" || token === "--bundles" || token === "--all" || token === "--trigger-5xx" || token === "--expect-app-event" || token === "--github" || token === "--github-cli" || token === "--github-device") {
|
|
30848
|
+
if (token === "--fix" || token === "--json" || token === "--check-relay" || token === "--privacy" || token === "--help" || token === "--version" || token === "--non-interactive" || token === "--local" || token === "--cloud" || token === "--events" || token === "--bundles" || token === "--all" || token === "--trigger-5xx" || token === "--expect-app-event" || token === "--github" || token === "--github-cli" || token === "--github-device" || token === "--clear-color-tag") {
|
|
30610
30849
|
options.set(token.slice(2), true);
|
|
30611
30850
|
continue;
|
|
30612
30851
|
}
|
|
@@ -32494,6 +32733,9 @@ async function createProjectCommand(input2, api) {
|
|
|
32494
32733
|
if (input2.environmentDefault !== void 0) {
|
|
32495
32734
|
requestInput.environmentDefault = input2.environmentDefault;
|
|
32496
32735
|
}
|
|
32736
|
+
if (input2.colorTag !== void 0) {
|
|
32737
|
+
requestInput.colorTag = input2.colorTag;
|
|
32738
|
+
}
|
|
32497
32739
|
const project = await api.createProject(requestInput);
|
|
32498
32740
|
return {
|
|
32499
32741
|
exitCode: 0,
|
|
@@ -32518,6 +32760,9 @@ async function updateProjectCommand(input2, api) {
|
|
|
32518
32760
|
if (input2.environmentDefault !== void 0) {
|
|
32519
32761
|
requestInput.environmentDefault = input2.environmentDefault;
|
|
32520
32762
|
}
|
|
32763
|
+
if (input2.colorTag !== void 0) {
|
|
32764
|
+
requestInput.colorTag = input2.colorTag;
|
|
32765
|
+
}
|
|
32521
32766
|
const project = await api.updateProject(requestInput);
|
|
32522
32767
|
return {
|
|
32523
32768
|
exitCode: 0,
|
|
@@ -32574,6 +32819,9 @@ async function createProjectWithAuthCommand(input2, dependencies) {
|
|
|
32574
32819
|
if (input2.environmentDefault !== void 0) {
|
|
32575
32820
|
commandInput.environmentDefault = input2.environmentDefault;
|
|
32576
32821
|
}
|
|
32822
|
+
if (input2.colorTag !== void 0) {
|
|
32823
|
+
commandInput.colorTag = input2.colorTag;
|
|
32824
|
+
}
|
|
32577
32825
|
if (input2.json !== void 0) {
|
|
32578
32826
|
commandInput.json = input2.json;
|
|
32579
32827
|
}
|
|
@@ -32601,6 +32849,9 @@ async function updateProjectWithAuthCommand(input2, dependencies) {
|
|
|
32601
32849
|
if (input2.environmentDefault !== void 0) {
|
|
32602
32850
|
commandInput.environmentDefault = input2.environmentDefault;
|
|
32603
32851
|
}
|
|
32852
|
+
if (input2.colorTag !== void 0) {
|
|
32853
|
+
commandInput.colorTag = input2.colorTag;
|
|
32854
|
+
}
|
|
32604
32855
|
if (input2.json !== void 0) {
|
|
32605
32856
|
commandInput.json = input2.json;
|
|
32606
32857
|
}
|
|
@@ -32903,6 +33154,16 @@ async function revokeMemberTokenWithAuthCommand(input2, dependencies) {
|
|
|
32903
33154
|
}
|
|
32904
33155
|
|
|
32905
33156
|
// src/management-billing-project-token-command-handlers.ts
|
|
33157
|
+
function readProjectColorTagOption(parsedArgv) {
|
|
33158
|
+
const colorTag = readStringOption(parsedArgv, "color-tag");
|
|
33159
|
+
if (colorTag === void 0) {
|
|
33160
|
+
return void 0;
|
|
33161
|
+
}
|
|
33162
|
+
if (PROJECT_COLOR_TAG_VALUES.includes(colorTag)) {
|
|
33163
|
+
return colorTag;
|
|
33164
|
+
}
|
|
33165
|
+
throw new CliInputError("Invalid value for --color-tag.");
|
|
33166
|
+
}
|
|
32906
33167
|
async function handleBillingCommand(parsedArgv, dependencies) {
|
|
32907
33168
|
const action = requirePositional(parsedArgv, 1, "action");
|
|
32908
33169
|
if (action === "get") {
|
|
@@ -33056,7 +33317,7 @@ async function handleProjectCommand(parsedArgv, dependencies) {
|
|
|
33056
33317
|
return await (dependencies.listProjectsCommand ?? listProjectsWithAuthCommand)(input2);
|
|
33057
33318
|
}
|
|
33058
33319
|
if (action === "create") {
|
|
33059
|
-
expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default"]);
|
|
33320
|
+
expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default", "color-tag"]);
|
|
33060
33321
|
ensureNoExtraPositionals(parsedArgv, 2);
|
|
33061
33322
|
const name = readStringOption(parsedArgv, "name");
|
|
33062
33323
|
if (name === void 0) {
|
|
@@ -33071,10 +33332,14 @@ async function handleProjectCommand(parsedArgv, dependencies) {
|
|
|
33071
33332
|
if (environmentDefault !== void 0) {
|
|
33072
33333
|
input2.environmentDefault = environmentDefault;
|
|
33073
33334
|
}
|
|
33335
|
+
const colorTag = readProjectColorTagOption(parsedArgv);
|
|
33336
|
+
if (colorTag !== void 0) {
|
|
33337
|
+
input2.colorTag = colorTag;
|
|
33338
|
+
}
|
|
33074
33339
|
return await (dependencies.createProjectCommand ?? createProjectWithAuthCommand)(input2);
|
|
33075
33340
|
}
|
|
33076
33341
|
if (action === "update") {
|
|
33077
|
-
expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default"]);
|
|
33342
|
+
expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default", "color-tag", "clear-color-tag"]);
|
|
33078
33343
|
ensureNoExtraPositionals(parsedArgv, 3);
|
|
33079
33344
|
const input2 = appendCommonAuthOptions(parsedArgv, {
|
|
33080
33345
|
projectId: requirePositional(parsedArgv, 2, "project-id")
|
|
@@ -33091,7 +33356,18 @@ async function handleProjectCommand(parsedArgv, dependencies) {
|
|
|
33091
33356
|
if (environmentDefault !== void 0) {
|
|
33092
33357
|
input2.environmentDefault = environmentDefault;
|
|
33093
33358
|
}
|
|
33094
|
-
if (
|
|
33359
|
+
if (readBooleanOption(parsedArgv, "clear-color-tag") === true) {
|
|
33360
|
+
if (readStringOption(parsedArgv, "color-tag") !== void 0) {
|
|
33361
|
+
throw new CliInputError("Use either --color-tag or --clear-color-tag.");
|
|
33362
|
+
}
|
|
33363
|
+
input2.colorTag = null;
|
|
33364
|
+
} else {
|
|
33365
|
+
const colorTag = readProjectColorTagOption(parsedArgv);
|
|
33366
|
+
if (colorTag !== void 0) {
|
|
33367
|
+
input2.colorTag = colorTag;
|
|
33368
|
+
}
|
|
33369
|
+
}
|
|
33370
|
+
if (input2.name === void 0 && input2.slug === void 0 && input2.environmentDefault === void 0 && input2.colorTag === void 0) {
|
|
33095
33371
|
throw new CliInputError("At least one project field must be provided.");
|
|
33096
33372
|
}
|
|
33097
33373
|
return await (dependencies.updateProjectCommand ?? updateProjectWithAuthCommand)(input2);
|
|
@@ -33807,7 +34083,7 @@ async function handleHealthCommand(parsedArgv, dependencies) {
|
|
|
33807
34083
|
method,
|
|
33808
34084
|
expectedStatusMin: readIntegerOption(parsedArgv, "expected-status-min") ?? 200,
|
|
33809
34085
|
expectedStatusMax: readIntegerOption(parsedArgv, "expected-status-max") ?? 399,
|
|
33810
|
-
timeoutMs: readIntegerOption(parsedArgv, "timeout-ms") ??
|
|
34086
|
+
timeoutMs: readIntegerOption(parsedArgv, "timeout-ms") ?? 2500,
|
|
33811
34087
|
intervalSeconds,
|
|
33812
34088
|
failureThreshold: readIntegerOption(parsedArgv, "failure-threshold") ?? 3,
|
|
33813
34089
|
recoveryThreshold: readIntegerOption(parsedArgv, "recovery-threshold") ?? 2,
|
|
@@ -33906,7 +34182,7 @@ async function handleHealthCommand(parsedArgv, dependencies) {
|
|
|
33906
34182
|
method,
|
|
33907
34183
|
expectedStatusMin: readIntegerOption(parsedArgv, "expected-status-min") ?? 200,
|
|
33908
34184
|
expectedStatusMax: readIntegerOption(parsedArgv, "expected-status-max") ?? 399,
|
|
33909
|
-
timeoutMs: readIntegerOption(parsedArgv, "timeout-ms") ??
|
|
34185
|
+
timeoutMs: readIntegerOption(parsedArgv, "timeout-ms") ?? 2500
|
|
33910
34186
|
})
|
|
33911
34187
|
);
|
|
33912
34188
|
}
|
|
@@ -36674,7 +36950,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
|
|
|
36674
36950
|
// package.json
|
|
36675
36951
|
var package_default = {
|
|
36676
36952
|
name: "@debugbundle/cli",
|
|
36677
|
-
version: "1.5.
|
|
36953
|
+
version: "1.5.3",
|
|
36678
36954
|
private: false,
|
|
36679
36955
|
description: "Command-line interface for DebugBundle",
|
|
36680
36956
|
license: "AGPL-3.0-only",
|