@testsmith/api-spector 0.8.9 → 0.9.1
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/out/main/chunks/{broker-client-170x6Jx9.js → broker-client-JU-AwkVE.js} +6 -6
- package/out/main/chunks/{perf-report-ChaO3K0w.js → perf-report-KXGZgCDY.js} +1 -1
- package/out/main/chunks/{perf-run-wfdvpJev.js → perf-run-BEbf2piB.js} +1 -1
- package/out/main/chunks/{request-exec-s7k-oRi2.js → request-exec-DroNv29-.js} +36 -21
- package/out/main/contract.js +2 -2
- package/out/main/flow.js +17 -4
- package/out/main/index.js +5 -5
- package/out/main/lib.js +1 -1
- package/out/main/perf-worker.js +2 -2
- package/out/main/perf.js +4 -4
- package/out/main/register-handlers.js +27 -15
- package/out/main/runner.js +5 -5
- package/out/renderer/assets/{GraphQLEditor-CR3JSOwU.js → GraphQLEditor-CJm8glW5.js} +1 -1
- package/out/renderer/assets/{SoapEditor-eAhSrhoc.js → SoapEditor-C2eMs7-Z.js} +1 -1
- package/out/renderer/assets/{index-D_-cF6J0.js → index-Bf9-CiTh.js} +1145 -263
- package/out/renderer/assets/index-C5qn-ccU.css +627 -0
- package/out/renderer/index.html +2 -2
- package/package.json +1 -1
- package/out/renderer/assets/index-Dj6OhE3D.css +0 -627
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphQLEditor-
|
|
2
|
-
import { r as requireReact, g as getDefaultExportFromCjs, R as React, a as reactExports, b as autocompletion, h as hoverTooltip, j as jsxRuntimeExports,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphQLEditor-CJm8glW5.js","./codemirror-BKmwMUlV.js","./ajv-CJPwFjiP.js","./SoapEditor-C2eMs7-Z.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { r as requireReact, g as getDefaultExportFromCjs, R as React, a as reactExports, b as autocompletion, h as hoverTooltip, j as jsxRuntimeExports, V as ViewPlugin, E as EditorView, k as keymap, t as toggleComment, D as Decoration, c as RangeSetBuilder, x as xml, d as json, e as ReactCodeMirror, o as oneDark, f as javascript } from "./codemirror-BKmwMUlV.js";
|
|
3
3
|
import { r as requireAjv } from "./ajv-CJPwFjiP.js";
|
|
4
4
|
var client = { exports: {} };
|
|
5
5
|
var reactDomClient_production = {};
|
|
@@ -14979,6 +14979,325 @@ function useActiveEnvironment() {
|
|
|
14979
14979
|
[environments, activeEnvironmentId]
|
|
14980
14980
|
);
|
|
14981
14981
|
}
|
|
14982
|
+
const FAKER_NS_ALL = ["airline", "animal", "book", "color", "commerce", "company", "database", "datatype", "date", "finance", "food", "git", "hacker", "helpers", "image", "internet", "location", "lorem", "music", "number", "person", "phone", "science", "string", "system", "vehicle", "word"];
|
|
14983
|
+
const FAKER_ALL = {
|
|
14984
|
+
"datatype": [
|
|
14985
|
+
"boolean"
|
|
14986
|
+
],
|
|
14987
|
+
"date": [
|
|
14988
|
+
"anytime",
|
|
14989
|
+
"between",
|
|
14990
|
+
"betweens",
|
|
14991
|
+
"birthdate",
|
|
14992
|
+
"future",
|
|
14993
|
+
"month",
|
|
14994
|
+
"past",
|
|
14995
|
+
"recent",
|
|
14996
|
+
"soon",
|
|
14997
|
+
"timeZone",
|
|
14998
|
+
"weekday"
|
|
14999
|
+
],
|
|
15000
|
+
"helpers": [
|
|
15001
|
+
"arrayElement",
|
|
15002
|
+
"arrayElements",
|
|
15003
|
+
"enumValue",
|
|
15004
|
+
"fake",
|
|
15005
|
+
"fromRegExp",
|
|
15006
|
+
"maybe",
|
|
15007
|
+
"multiple",
|
|
15008
|
+
"mustache",
|
|
15009
|
+
"objectEntry",
|
|
15010
|
+
"objectKey",
|
|
15011
|
+
"objectValue",
|
|
15012
|
+
"rangeToNumber",
|
|
15013
|
+
"replaceCreditCardSymbols",
|
|
15014
|
+
"replaceSymbols",
|
|
15015
|
+
"shuffle",
|
|
15016
|
+
"slugify",
|
|
15017
|
+
"uniqueArray",
|
|
15018
|
+
"weightedArrayElement"
|
|
15019
|
+
],
|
|
15020
|
+
"location": [
|
|
15021
|
+
"buildingNumber",
|
|
15022
|
+
"cardinalDirection",
|
|
15023
|
+
"city",
|
|
15024
|
+
"continent",
|
|
15025
|
+
"country",
|
|
15026
|
+
"countryCode",
|
|
15027
|
+
"county",
|
|
15028
|
+
"direction",
|
|
15029
|
+
"language",
|
|
15030
|
+
"latitude",
|
|
15031
|
+
"longitude",
|
|
15032
|
+
"nearbyGPSCoordinate",
|
|
15033
|
+
"ordinalDirection",
|
|
15034
|
+
"postalAddress",
|
|
15035
|
+
"secondaryAddress",
|
|
15036
|
+
"state",
|
|
15037
|
+
"street",
|
|
15038
|
+
"streetAddress",
|
|
15039
|
+
"timeZone",
|
|
15040
|
+
"zipCode"
|
|
15041
|
+
],
|
|
15042
|
+
"number": [
|
|
15043
|
+
"bigInt",
|
|
15044
|
+
"binary",
|
|
15045
|
+
"float",
|
|
15046
|
+
"hex",
|
|
15047
|
+
"int",
|
|
15048
|
+
"octal",
|
|
15049
|
+
"romanNumeral"
|
|
15050
|
+
],
|
|
15051
|
+
"string": [
|
|
15052
|
+
"alpha",
|
|
15053
|
+
"alphanumeric",
|
|
15054
|
+
"binary",
|
|
15055
|
+
"fromCharacters",
|
|
15056
|
+
"hexadecimal",
|
|
15057
|
+
"nanoid",
|
|
15058
|
+
"numeric",
|
|
15059
|
+
"octal",
|
|
15060
|
+
"sample",
|
|
15061
|
+
"symbol",
|
|
15062
|
+
"ulid",
|
|
15063
|
+
"uuid"
|
|
15064
|
+
],
|
|
15065
|
+
"airline": [
|
|
15066
|
+
"aircraftType",
|
|
15067
|
+
"airline",
|
|
15068
|
+
"airplane",
|
|
15069
|
+
"airport",
|
|
15070
|
+
"flightNumber",
|
|
15071
|
+
"recordLocator",
|
|
15072
|
+
"seat"
|
|
15073
|
+
],
|
|
15074
|
+
"animal": [
|
|
15075
|
+
"bear",
|
|
15076
|
+
"bird",
|
|
15077
|
+
"cat",
|
|
15078
|
+
"cetacean",
|
|
15079
|
+
"cow",
|
|
15080
|
+
"crocodilia",
|
|
15081
|
+
"dog",
|
|
15082
|
+
"fish",
|
|
15083
|
+
"horse",
|
|
15084
|
+
"insect",
|
|
15085
|
+
"lion",
|
|
15086
|
+
"petName",
|
|
15087
|
+
"rabbit",
|
|
15088
|
+
"rodent",
|
|
15089
|
+
"snake",
|
|
15090
|
+
"type"
|
|
15091
|
+
],
|
|
15092
|
+
"book": [
|
|
15093
|
+
"author",
|
|
15094
|
+
"format",
|
|
15095
|
+
"genre",
|
|
15096
|
+
"publisher",
|
|
15097
|
+
"series",
|
|
15098
|
+
"title"
|
|
15099
|
+
],
|
|
15100
|
+
"color": [
|
|
15101
|
+
"cmyk",
|
|
15102
|
+
"colorByCSSColorSpace",
|
|
15103
|
+
"cssSupportedFunction",
|
|
15104
|
+
"cssSupportedSpace",
|
|
15105
|
+
"hsl",
|
|
15106
|
+
"human",
|
|
15107
|
+
"hwb",
|
|
15108
|
+
"lab",
|
|
15109
|
+
"lch",
|
|
15110
|
+
"rgb",
|
|
15111
|
+
"space"
|
|
15112
|
+
],
|
|
15113
|
+
"commerce": [
|
|
15114
|
+
"department",
|
|
15115
|
+
"isbn",
|
|
15116
|
+
"price",
|
|
15117
|
+
"product",
|
|
15118
|
+
"productAdjective",
|
|
15119
|
+
"productDescription",
|
|
15120
|
+
"productMaterial",
|
|
15121
|
+
"productName",
|
|
15122
|
+
"upc"
|
|
15123
|
+
],
|
|
15124
|
+
"company": [
|
|
15125
|
+
"buzzAdjective",
|
|
15126
|
+
"buzzNoun",
|
|
15127
|
+
"buzzPhrase",
|
|
15128
|
+
"buzzVerb",
|
|
15129
|
+
"catchPhrase",
|
|
15130
|
+
"catchPhraseAdjective",
|
|
15131
|
+
"catchPhraseDescriptor",
|
|
15132
|
+
"catchPhraseNoun",
|
|
15133
|
+
"name"
|
|
15134
|
+
],
|
|
15135
|
+
"database": [
|
|
15136
|
+
"collation",
|
|
15137
|
+
"column",
|
|
15138
|
+
"engine",
|
|
15139
|
+
"mongodbObjectId",
|
|
15140
|
+
"type"
|
|
15141
|
+
],
|
|
15142
|
+
"finance": [
|
|
15143
|
+
"accountName",
|
|
15144
|
+
"accountNumber",
|
|
15145
|
+
"amount",
|
|
15146
|
+
"bic",
|
|
15147
|
+
"bitcoinAddress",
|
|
15148
|
+
"creditCardCVV",
|
|
15149
|
+
"creditCardIssuer",
|
|
15150
|
+
"creditCardNumber",
|
|
15151
|
+
"currency",
|
|
15152
|
+
"currencyCode",
|
|
15153
|
+
"currencyName",
|
|
15154
|
+
"currencyNumericCode",
|
|
15155
|
+
"currencySymbol",
|
|
15156
|
+
"ethereumAddress",
|
|
15157
|
+
"iban",
|
|
15158
|
+
"litecoinAddress",
|
|
15159
|
+
"pin",
|
|
15160
|
+
"routingNumber",
|
|
15161
|
+
"transactionDescription",
|
|
15162
|
+
"transactionType"
|
|
15163
|
+
],
|
|
15164
|
+
"food": [
|
|
15165
|
+
"adjective",
|
|
15166
|
+
"description",
|
|
15167
|
+
"dish",
|
|
15168
|
+
"ethnicCategory",
|
|
15169
|
+
"fruit",
|
|
15170
|
+
"ingredient",
|
|
15171
|
+
"meat",
|
|
15172
|
+
"spice",
|
|
15173
|
+
"vegetable"
|
|
15174
|
+
],
|
|
15175
|
+
"git": [
|
|
15176
|
+
"branch",
|
|
15177
|
+
"commitDate",
|
|
15178
|
+
"commitEntry",
|
|
15179
|
+
"commitMessage",
|
|
15180
|
+
"commitSha"
|
|
15181
|
+
],
|
|
15182
|
+
"hacker": [
|
|
15183
|
+
"abbreviation",
|
|
15184
|
+
"adjective",
|
|
15185
|
+
"ingverb",
|
|
15186
|
+
"noun",
|
|
15187
|
+
"phrase",
|
|
15188
|
+
"verb"
|
|
15189
|
+
],
|
|
15190
|
+
"image": [
|
|
15191
|
+
"avatar",
|
|
15192
|
+
"avatarGitHub",
|
|
15193
|
+
"dataUri",
|
|
15194
|
+
"personPortrait",
|
|
15195
|
+
"url",
|
|
15196
|
+
"urlLoremFlickr",
|
|
15197
|
+
"urlPicsumPhotos"
|
|
15198
|
+
],
|
|
15199
|
+
"internet": [
|
|
15200
|
+
"displayName",
|
|
15201
|
+
"domainName",
|
|
15202
|
+
"domainSuffix",
|
|
15203
|
+
"domainWord",
|
|
15204
|
+
"email",
|
|
15205
|
+
"emoji",
|
|
15206
|
+
"exampleEmail",
|
|
15207
|
+
"httpMethod",
|
|
15208
|
+
"httpStatusCode",
|
|
15209
|
+
"ip",
|
|
15210
|
+
"ipv4",
|
|
15211
|
+
"ipv6",
|
|
15212
|
+
"jwt",
|
|
15213
|
+
"jwtAlgorithm",
|
|
15214
|
+
"mac",
|
|
15215
|
+
"password",
|
|
15216
|
+
"port",
|
|
15217
|
+
"protocol",
|
|
15218
|
+
"url",
|
|
15219
|
+
"userAgent",
|
|
15220
|
+
"username"
|
|
15221
|
+
],
|
|
15222
|
+
"lorem": [
|
|
15223
|
+
"lines",
|
|
15224
|
+
"paragraph",
|
|
15225
|
+
"paragraphs",
|
|
15226
|
+
"sentence",
|
|
15227
|
+
"sentences",
|
|
15228
|
+
"slug",
|
|
15229
|
+
"text",
|
|
15230
|
+
"word",
|
|
15231
|
+
"words"
|
|
15232
|
+
],
|
|
15233
|
+
"music": [
|
|
15234
|
+
"album",
|
|
15235
|
+
"artist",
|
|
15236
|
+
"genre",
|
|
15237
|
+
"songName"
|
|
15238
|
+
],
|
|
15239
|
+
"person": [
|
|
15240
|
+
"bio",
|
|
15241
|
+
"firstName",
|
|
15242
|
+
"fullName",
|
|
15243
|
+
"gender",
|
|
15244
|
+
"jobArea",
|
|
15245
|
+
"jobDescriptor",
|
|
15246
|
+
"jobTitle",
|
|
15247
|
+
"jobType",
|
|
15248
|
+
"lastName",
|
|
15249
|
+
"middleName",
|
|
15250
|
+
"prefix",
|
|
15251
|
+
"sex",
|
|
15252
|
+
"sexType",
|
|
15253
|
+
"suffix",
|
|
15254
|
+
"zodiacSign"
|
|
15255
|
+
],
|
|
15256
|
+
"phone": [
|
|
15257
|
+
"imei",
|
|
15258
|
+
"number"
|
|
15259
|
+
],
|
|
15260
|
+
"science": [
|
|
15261
|
+
"chemicalElement",
|
|
15262
|
+
"unit"
|
|
15263
|
+
],
|
|
15264
|
+
"system": [
|
|
15265
|
+
"commonFileExt",
|
|
15266
|
+
"commonFileName",
|
|
15267
|
+
"commonFileType",
|
|
15268
|
+
"cron",
|
|
15269
|
+
"directoryPath",
|
|
15270
|
+
"fileExt",
|
|
15271
|
+
"fileName",
|
|
15272
|
+
"filePath",
|
|
15273
|
+
"fileType",
|
|
15274
|
+
"mimeType",
|
|
15275
|
+
"networkInterface",
|
|
15276
|
+
"semver"
|
|
15277
|
+
],
|
|
15278
|
+
"vehicle": [
|
|
15279
|
+
"bicycle",
|
|
15280
|
+
"color",
|
|
15281
|
+
"fuel",
|
|
15282
|
+
"manufacturer",
|
|
15283
|
+
"model",
|
|
15284
|
+
"type",
|
|
15285
|
+
"vehicle",
|
|
15286
|
+
"vin",
|
|
15287
|
+
"vrm"
|
|
15288
|
+
],
|
|
15289
|
+
"word": [
|
|
15290
|
+
"adjective",
|
|
15291
|
+
"adverb",
|
|
15292
|
+
"conjunction",
|
|
15293
|
+
"interjection",
|
|
15294
|
+
"noun",
|
|
15295
|
+
"preposition",
|
|
15296
|
+
"sample",
|
|
15297
|
+
"verb",
|
|
15298
|
+
"words"
|
|
15299
|
+
]
|
|
15300
|
+
};
|
|
14982
15301
|
const DYNAMIC_VAR_NAMES = [
|
|
14983
15302
|
"$uuid",
|
|
14984
15303
|
"$timestamp",
|
|
@@ -15123,23 +15442,23 @@ function chaiChainCompletion(textBefore, pos) {
|
|
|
15123
15442
|
const options = (CHAI_AFTER[lastWord] ?? CHAI_DEFAULT).filter((o) => o.label.toLowerCase().includes(partial));
|
|
15124
15443
|
return { from: pos - m[2].length, options, validFor: /^\w*$/ };
|
|
15125
15444
|
}
|
|
15126
|
-
const
|
|
15127
|
-
|
|
15128
|
-
|
|
15129
|
-
|
|
15130
|
-
|
|
15131
|
-
|
|
15132
|
-
|
|
15133
|
-
|
|
15134
|
-
|
|
15135
|
-
|
|
15136
|
-
|
|
15137
|
-
|
|
15138
|
-
|
|
15139
|
-
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
const
|
|
15445
|
+
const CURATED_NS_INFO = {
|
|
15446
|
+
string: "String generators",
|
|
15447
|
+
number: "Number generators",
|
|
15448
|
+
person: "Names, titles, etc.",
|
|
15449
|
+
internet: "Emails, URLs, IPs, etc.",
|
|
15450
|
+
date: "Date generators",
|
|
15451
|
+
lorem: "Lorem ipsum text",
|
|
15452
|
+
location: "Addresses, cities, countries",
|
|
15453
|
+
finance: "Credit cards, currency, etc.",
|
|
15454
|
+
color: "Color values",
|
|
15455
|
+
company: "Company names, catch phrases",
|
|
15456
|
+
commerce: "Products, prices, departments",
|
|
15457
|
+
image: "Image URLs / placeholders",
|
|
15458
|
+
system: "File names, MIME types, semver",
|
|
15459
|
+
helpers: "Utility helpers (slugify, arrayElement, …)"
|
|
15460
|
+
};
|
|
15461
|
+
const CURATED_SUB = {
|
|
15143
15462
|
string: [
|
|
15144
15463
|
{ label: "uuid", type: "function", detail: "()", info: "Random UUID v4" },
|
|
15145
15464
|
{ label: "alphanumeric", type: "function", detail: "(length)", info: "Random alphanumeric string" },
|
|
@@ -15242,6 +15561,18 @@ const FAKER_SUB = {
|
|
|
15242
15561
|
{ label: "multiple", type: "function", detail: "(fn, {count}?)", info: "Call a generator multiple times" }
|
|
15243
15562
|
]
|
|
15244
15563
|
};
|
|
15564
|
+
const FAKER_NAMESPACES = FAKER_NS_ALL.map((ns) => ({
|
|
15565
|
+
label: ns,
|
|
15566
|
+
type: "property",
|
|
15567
|
+
info: CURATED_NS_INFO[ns] ?? `faker.${ns} generators`
|
|
15568
|
+
}));
|
|
15569
|
+
const FAKER_SUB = Object.fromEntries(
|
|
15570
|
+
FAKER_NS_ALL.map((ns) => {
|
|
15571
|
+
const curated = new Map((CURATED_SUB[ns] ?? []).map((c) => [c.label, c]));
|
|
15572
|
+
const items = (FAKER_ALL[ns] ?? []).map((name) => curated.get(name) ?? { label: name, type: "function", detail: "()" });
|
|
15573
|
+
return [ns, items];
|
|
15574
|
+
})
|
|
15575
|
+
);
|
|
15245
15576
|
function makeAtCompletionSource(varNames) {
|
|
15246
15577
|
return function atSource(context) {
|
|
15247
15578
|
const line = context.state.doc.lineAt(context.pos);
|
|
@@ -15654,6 +15985,7 @@ function useVarValues() {
|
|
|
15654
15985
|
}
|
|
15655
15986
|
return result;
|
|
15656
15987
|
}
|
|
15988
|
+
const Workspace = "Workspace";
|
|
15657
15989
|
const Collections$6 = "Collections";
|
|
15658
15990
|
const History$6 = "History";
|
|
15659
15991
|
const Git$6 = "Git";
|
|
@@ -15859,6 +16191,13 @@ const or$6 = "or";
|
|
|
15859
16191
|
const Disabled$6 = "Disabled";
|
|
15860
16192
|
const en = {
|
|
15861
16193
|
"Close tab": "Close tab",
|
|
16194
|
+
"Open api-spector.dev": "Open api-spector.dev",
|
|
16195
|
+
Workspace,
|
|
16196
|
+
"API Spector home": "API Spector home",
|
|
16197
|
+
"Request body": "Request body",
|
|
16198
|
+
"Script editor": "Script editor",
|
|
16199
|
+
"JSON schema": "JSON schema",
|
|
16200
|
+
"Filtered response": "Filtered response",
|
|
15862
16201
|
Collections: Collections$6,
|
|
15863
16202
|
History: History$6,
|
|
15864
16203
|
"Mock servers": "Mock servers",
|
|
@@ -24624,7 +24963,7 @@ function parseVarTokens(str) {
|
|
|
24624
24963
|
found.push({ name, display });
|
|
24625
24964
|
}
|
|
24626
24965
|
};
|
|
24627
|
-
for (const m of str.matchAll(/\{\{([^}]
|
|
24966
|
+
for (const m of str.matchAll(/\{\{\s*((?:[^{}]|\{[^{}]*\})+?)\s*\}\}/g)) push(m[1].trim(), `{{${m[1].trim()}}}`);
|
|
24628
24967
|
for (const m of str.matchAll(/\[([A-Za-z_]\w*)\]/g)) push(m[1], `[${m[1]}]`);
|
|
24629
24968
|
return found;
|
|
24630
24969
|
}
|
|
@@ -24689,7 +25028,7 @@ function VarInput({ value: value2, onChange, className, wrapperClassName, static
|
|
|
24689
25028
|
partialLen.current = from;
|
|
24690
25029
|
setSuggestions(items);
|
|
24691
25030
|
setSuggestionMode("var");
|
|
24692
|
-
setActiveIndex(-1);
|
|
25031
|
+
setActiveIndex(items.length ? 0 : -1);
|
|
24693
25032
|
}
|
|
24694
25033
|
function detectQuery(val, cursor) {
|
|
24695
25034
|
const before = val.slice(0, cursor);
|
|
@@ -24758,9 +25097,12 @@ function VarInput({ value: value2, onChange, className, wrapperClassName, static
|
|
|
24758
25097
|
} else if (e.key === "ArrowUp") {
|
|
24759
25098
|
e.preventDefault();
|
|
24760
25099
|
setActiveIndex((i) => Math.max(i - 1, -1));
|
|
24761
|
-
} else if (e.key === "Enter"
|
|
24762
|
-
|
|
24763
|
-
|
|
25100
|
+
} else if (e.key === "Enter") {
|
|
25101
|
+
const idx = activeIndex >= 0 ? activeIndex : suggestionMode === "var" ? 0 : -1;
|
|
25102
|
+
if (idx >= 0 && idx < suggestions.length) {
|
|
25103
|
+
e.preventDefault();
|
|
25104
|
+
apply(suggestions[idx]);
|
|
25105
|
+
}
|
|
24764
25106
|
} else if (e.key === "Escape") {
|
|
24765
25107
|
setSuggestions([]);
|
|
24766
25108
|
}
|
|
@@ -24776,9 +25118,10 @@ function VarInput({ value: value2, onChange, className, wrapperClassName, static
|
|
|
24776
25118
|
const before = value2.slice(0, cursor);
|
|
24777
25119
|
const after = value2.slice(cursor);
|
|
24778
25120
|
const start2 = cursor - partialLen.current;
|
|
24779
|
-
const
|
|
25121
|
+
const closeAlready = item.close && after.startsWith("}}");
|
|
25122
|
+
const insert = item.insert + (item.close && !closeAlready ? "}}" : "");
|
|
24780
25123
|
const newVal = before.slice(0, start2) + insert + after;
|
|
24781
|
-
const newCursor = start2 + insert.length;
|
|
25124
|
+
const newCursor = start2 + insert.length + (closeAlready ? 2 : 0);
|
|
24782
25125
|
onChange(newVal);
|
|
24783
25126
|
if (item.close) {
|
|
24784
25127
|
setSuggestions([]);
|
|
@@ -24843,6 +25186,298 @@ function VarInput({ value: value2, onChange, className, wrapperClassName, static
|
|
|
24843
25186
|
}
|
|
24844
25187
|
);
|
|
24845
25188
|
}
|
|
25189
|
+
const SCOPE_HAS_INSTANCES = {
|
|
25190
|
+
request: true,
|
|
25191
|
+
folder: true,
|
|
25192
|
+
collection: true,
|
|
25193
|
+
environment: true,
|
|
25194
|
+
global: false
|
|
25195
|
+
};
|
|
25196
|
+
function colOf(s, id2) {
|
|
25197
|
+
return id2 ? s.collections[id2]?.data : void 0;
|
|
25198
|
+
}
|
|
25199
|
+
function describeLoc(loc) {
|
|
25200
|
+
const s = useStore$1.getState();
|
|
25201
|
+
switch (loc.kind) {
|
|
25202
|
+
case "global":
|
|
25203
|
+
return "globals";
|
|
25204
|
+
case "environment":
|
|
25205
|
+
return `environment "${s.environments[loc.environmentId ?? ""]?.data.name ?? "?"}"`;
|
|
25206
|
+
case "collection":
|
|
25207
|
+
return `collection "${colOf(s, loc.collectionId)?.name ?? "?"}"`;
|
|
25208
|
+
case "folder": {
|
|
25209
|
+
const col = colOf(s, loc.collectionId);
|
|
25210
|
+
const f = col && loc.folderId ? findFolder$1(col.rootFolder, loc.folderId) : null;
|
|
25211
|
+
return `folder "${f?.name ?? "?"}"`;
|
|
25212
|
+
}
|
|
25213
|
+
case "request":
|
|
25214
|
+
return `request "${colOf(s, loc.collectionId)?.requests[loc.requestId ?? ""]?.name ?? "?"}"`;
|
|
25215
|
+
}
|
|
25216
|
+
}
|
|
25217
|
+
function readVarAt(loc, key) {
|
|
25218
|
+
const s = useStore$1.getState();
|
|
25219
|
+
switch (loc.kind) {
|
|
25220
|
+
case "global":
|
|
25221
|
+
return s.globals[key];
|
|
25222
|
+
case "environment":
|
|
25223
|
+
return s.environments[loc.environmentId ?? ""]?.data.variables.find((v) => v.key === key)?.value;
|
|
25224
|
+
case "collection":
|
|
25225
|
+
return colOf(s, loc.collectionId)?.collectionVariables?.[key];
|
|
25226
|
+
case "folder": {
|
|
25227
|
+
const col = colOf(s, loc.collectionId);
|
|
25228
|
+
const f = col && loc.folderId ? findFolder$1(col.rootFolder, loc.folderId) : null;
|
|
25229
|
+
return f?.variables?.[key];
|
|
25230
|
+
}
|
|
25231
|
+
case "request":
|
|
25232
|
+
return colOf(s, loc.collectionId)?.requests[loc.requestId ?? ""]?.variables?.[key];
|
|
25233
|
+
}
|
|
25234
|
+
}
|
|
25235
|
+
function hasVarAt(loc, key) {
|
|
25236
|
+
const s = useStore$1.getState();
|
|
25237
|
+
switch (loc.kind) {
|
|
25238
|
+
case "global":
|
|
25239
|
+
return key in s.globals;
|
|
25240
|
+
case "environment":
|
|
25241
|
+
return !!s.environments[loc.environmentId ?? ""]?.data.variables.some((v) => v.key === key);
|
|
25242
|
+
case "collection":
|
|
25243
|
+
return !!colOf(s, loc.collectionId)?.collectionVariables && key in (colOf(s, loc.collectionId).collectionVariables ?? {});
|
|
25244
|
+
case "folder": {
|
|
25245
|
+
const col = colOf(s, loc.collectionId);
|
|
25246
|
+
const f = col && loc.folderId ? findFolder$1(col.rootFolder, loc.folderId) : null;
|
|
25247
|
+
return !!f?.variables && key in f.variables;
|
|
25248
|
+
}
|
|
25249
|
+
case "request": {
|
|
25250
|
+
const r = colOf(s, loc.collectionId)?.requests[loc.requestId ?? ""];
|
|
25251
|
+
return !!r?.variables && key in r.variables;
|
|
25252
|
+
}
|
|
25253
|
+
}
|
|
25254
|
+
}
|
|
25255
|
+
function isEncryptedEnvSecret(loc, key) {
|
|
25256
|
+
if (loc.kind !== "environment") return false;
|
|
25257
|
+
const v = useStore$1.getState().environments[loc.environmentId ?? ""]?.data.variables.find((x) => x.key === key);
|
|
25258
|
+
return !!(v?.secret && v.secretEncrypted);
|
|
25259
|
+
}
|
|
25260
|
+
function omit(map, key) {
|
|
25261
|
+
const next = { ...map ?? {} };
|
|
25262
|
+
delete next[key];
|
|
25263
|
+
return next;
|
|
25264
|
+
}
|
|
25265
|
+
function addVarAt(loc, key, value2) {
|
|
25266
|
+
const s = useStore$1.getState();
|
|
25267
|
+
switch (loc.kind) {
|
|
25268
|
+
case "global":
|
|
25269
|
+
{
|
|
25270
|
+
const next = { ...s.globals, [key]: value2 };
|
|
25271
|
+
s.setGlobals(next);
|
|
25272
|
+
void window.electron.setGlobals(next);
|
|
25273
|
+
}
|
|
25274
|
+
break;
|
|
25275
|
+
case "environment": {
|
|
25276
|
+
const env2 = s.environments[loc.environmentId ?? ""]?.data;
|
|
25277
|
+
if (!env2) return;
|
|
25278
|
+
s.updateEnvironment(env2.id, { ...env2, variables: [...env2.variables, { key, value: value2, enabled: true }] });
|
|
25279
|
+
break;
|
|
25280
|
+
}
|
|
25281
|
+
case "collection": {
|
|
25282
|
+
const col = colOf(s, loc.collectionId);
|
|
25283
|
+
if (!col) return;
|
|
25284
|
+
s.updateCollectionVariables(col.id, { ...col.collectionVariables ?? {}, [key]: value2 }, col.collectionVariablesDisabled);
|
|
25285
|
+
break;
|
|
25286
|
+
}
|
|
25287
|
+
case "folder": {
|
|
25288
|
+
const col = colOf(s, loc.collectionId);
|
|
25289
|
+
const f = col && loc.folderId ? findFolder$1(col.rootFolder, loc.folderId) : null;
|
|
25290
|
+
if (!col || !f) return;
|
|
25291
|
+
s.updateFolder(col.id, f.id, { variables: { ...f.variables ?? {}, [key]: value2 } });
|
|
25292
|
+
break;
|
|
25293
|
+
}
|
|
25294
|
+
case "request": {
|
|
25295
|
+
const col = colOf(s, loc.collectionId);
|
|
25296
|
+
const r = col?.requests[loc.requestId ?? ""];
|
|
25297
|
+
if (!r) return;
|
|
25298
|
+
s.updateRequest(r.id, { variables: { ...r.variables ?? {}, [key]: value2 } });
|
|
25299
|
+
break;
|
|
25300
|
+
}
|
|
25301
|
+
}
|
|
25302
|
+
}
|
|
25303
|
+
function removeVarAt(loc, key) {
|
|
25304
|
+
const s = useStore$1.getState();
|
|
25305
|
+
switch (loc.kind) {
|
|
25306
|
+
case "global":
|
|
25307
|
+
{
|
|
25308
|
+
const next = omit(s.globals, key);
|
|
25309
|
+
s.setGlobals(next);
|
|
25310
|
+
void window.electron.setGlobals(next);
|
|
25311
|
+
}
|
|
25312
|
+
break;
|
|
25313
|
+
case "environment": {
|
|
25314
|
+
const env2 = s.environments[loc.environmentId ?? ""]?.data;
|
|
25315
|
+
if (!env2) return;
|
|
25316
|
+
s.updateEnvironment(env2.id, { ...env2, variables: env2.variables.filter((v) => v.key !== key) });
|
|
25317
|
+
break;
|
|
25318
|
+
}
|
|
25319
|
+
case "collection": {
|
|
25320
|
+
const col = colOf(s, loc.collectionId);
|
|
25321
|
+
if (!col) return;
|
|
25322
|
+
s.updateCollectionVariables(col.id, omit(col.collectionVariables, key), omit(col.collectionVariablesDisabled, key));
|
|
25323
|
+
break;
|
|
25324
|
+
}
|
|
25325
|
+
case "folder": {
|
|
25326
|
+
const col = colOf(s, loc.collectionId);
|
|
25327
|
+
const f = col && loc.folderId ? findFolder$1(col.rootFolder, loc.folderId) : null;
|
|
25328
|
+
if (!col || !f) return;
|
|
25329
|
+
s.updateFolder(col.id, f.id, { variables: omit(f.variables, key), variablesDisabled: omit(f.variablesDisabled, key) });
|
|
25330
|
+
break;
|
|
25331
|
+
}
|
|
25332
|
+
case "request": {
|
|
25333
|
+
const col = colOf(s, loc.collectionId);
|
|
25334
|
+
const r = col?.requests[loc.requestId ?? ""];
|
|
25335
|
+
if (!r) return;
|
|
25336
|
+
s.updateRequest(r.id, { variables: omit(r.variables, key), variablesDisabled: omit(r.variablesDisabled, key) });
|
|
25337
|
+
break;
|
|
25338
|
+
}
|
|
25339
|
+
}
|
|
25340
|
+
}
|
|
25341
|
+
function moveVariable(src, dst, key) {
|
|
25342
|
+
if (src.kind === dst.kind && src.collectionId === dst.collectionId && src.folderId === dst.folderId && src.requestId === dst.requestId && src.environmentId === dst.environmentId) {
|
|
25343
|
+
return { ok: false, error: "Source and destination are the same." };
|
|
25344
|
+
}
|
|
25345
|
+
if (isEncryptedEnvSecret(src, key)) {
|
|
25346
|
+
return { ok: false, error: `"${key}" is an encrypted secret and can't be moved out of the environment.` };
|
|
25347
|
+
}
|
|
25348
|
+
if (hasVarAt(dst, key)) {
|
|
25349
|
+
return { ok: false, error: `"${key}" already exists in ${describeLoc(dst)}. Rename or remove it there first.` };
|
|
25350
|
+
}
|
|
25351
|
+
const value2 = readVarAt(src, key) ?? "";
|
|
25352
|
+
addVarAt(dst, key, value2);
|
|
25353
|
+
removeVarAt(src, key);
|
|
25354
|
+
return { ok: true };
|
|
25355
|
+
}
|
|
25356
|
+
function walkFolders(col, out, f, path) {
|
|
25357
|
+
for (const sub of f.folders ?? []) {
|
|
25358
|
+
const p = [...path, sub.name];
|
|
25359
|
+
out.push({ loc: { kind: "folder", collectionId: col.id, folderId: sub.id }, label: `${col.name} / ${p.join(" / ")}` });
|
|
25360
|
+
walkFolders(col, out, sub, p);
|
|
25361
|
+
}
|
|
25362
|
+
}
|
|
25363
|
+
function listScopeInstances(kind, exclude) {
|
|
25364
|
+
const s = useStore$1.getState();
|
|
25365
|
+
const out = [];
|
|
25366
|
+
switch (kind) {
|
|
25367
|
+
case "global":
|
|
25368
|
+
out.push({ loc: { kind: "global" }, label: "globals" });
|
|
25369
|
+
break;
|
|
25370
|
+
case "environment":
|
|
25371
|
+
for (const { data } of Object.values(s.environments)) out.push({ loc: { kind: "environment", environmentId: data.id }, label: data.name });
|
|
25372
|
+
break;
|
|
25373
|
+
case "collection":
|
|
25374
|
+
for (const { data } of Object.values(s.collections)) out.push({ loc: { kind: "collection", collectionId: data.id }, label: data.name });
|
|
25375
|
+
break;
|
|
25376
|
+
case "folder":
|
|
25377
|
+
for (const { data } of Object.values(s.collections)) walkFolders(data, out, data.rootFolder, []);
|
|
25378
|
+
break;
|
|
25379
|
+
case "request":
|
|
25380
|
+
for (const { data } of Object.values(s.collections)) {
|
|
25381
|
+
for (const r of Object.values(data.requests)) out.push({ loc: { kind: "request", collectionId: data.id, requestId: r.id }, label: `${data.name} / ${r.name}` });
|
|
25382
|
+
}
|
|
25383
|
+
break;
|
|
25384
|
+
}
|
|
25385
|
+
if (!exclude) return out;
|
|
25386
|
+
const sameLoc = (a) => a.kind === exclude.kind && a.collectionId === exclude.collectionId && a.folderId === exclude.folderId && a.requestId === exclude.requestId && a.environmentId === exclude.environmentId;
|
|
25387
|
+
return out.filter((x) => !sameLoc(x.loc));
|
|
25388
|
+
}
|
|
25389
|
+
const KINDS = ["request", "folder", "collection", "environment", "global"];
|
|
25390
|
+
function MoveVariableMenu({ from, name, onMoved, buttonClassName }) {
|
|
25391
|
+
const t = useT();
|
|
25392
|
+
const [open2, setOpen] = reactExports.useState(false);
|
|
25393
|
+
const [kind, setKind] = reactExports.useState(null);
|
|
25394
|
+
const [error2, setError] = reactExports.useState(null);
|
|
25395
|
+
const scopeWord = {
|
|
25396
|
+
request: t("request"),
|
|
25397
|
+
folder: t("folder"),
|
|
25398
|
+
collection: t("collection"),
|
|
25399
|
+
environment: t("environment"),
|
|
25400
|
+
global: t("globals")
|
|
25401
|
+
};
|
|
25402
|
+
function close() {
|
|
25403
|
+
setOpen(false);
|
|
25404
|
+
setKind(null);
|
|
25405
|
+
setError(null);
|
|
25406
|
+
}
|
|
25407
|
+
function pick(dst) {
|
|
25408
|
+
const res = moveVariable(from, dst, name.trim());
|
|
25409
|
+
if (!res.ok) {
|
|
25410
|
+
setError(res.error ?? t("Move failed"));
|
|
25411
|
+
return;
|
|
25412
|
+
}
|
|
25413
|
+
close();
|
|
25414
|
+
onMoved?.();
|
|
25415
|
+
}
|
|
25416
|
+
function chooseKind(k) {
|
|
25417
|
+
setError(null);
|
|
25418
|
+
const insts = listScopeInstances(k, from);
|
|
25419
|
+
if (insts.length === 0) {
|
|
25420
|
+
setError(t("Nowhere to move it in that scope."));
|
|
25421
|
+
return;
|
|
25422
|
+
}
|
|
25423
|
+
if (insts.length === 1) {
|
|
25424
|
+
pick(insts[0].loc);
|
|
25425
|
+
return;
|
|
25426
|
+
}
|
|
25427
|
+
setKind(k);
|
|
25428
|
+
}
|
|
25429
|
+
const instances = kind ? listScopeInstances(kind, from) : [];
|
|
25430
|
+
const kinds = KINDS.filter((k) => !(k === "global" && from.kind === "global"));
|
|
25431
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative inline-block", onClick: (e) => e.stopPropagation(), children: [
|
|
25432
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
25433
|
+
"button",
|
|
25434
|
+
{
|
|
25435
|
+
onClick: () => {
|
|
25436
|
+
setOpen((o) => !o);
|
|
25437
|
+
setKind(null);
|
|
25438
|
+
setError(null);
|
|
25439
|
+
},
|
|
25440
|
+
title: t("Move this variable to another scope"),
|
|
25441
|
+
className: buttonClassName ?? "shrink-0 text-[9px] uppercase tracking-wider text-surface-500 hover:text-blue-400 border border-surface-700 hover:border-blue-500/40 rounded px-1 py-px",
|
|
25442
|
+
children: [
|
|
25443
|
+
t("move"),
|
|
25444
|
+
" ▸"
|
|
25445
|
+
]
|
|
25446
|
+
}
|
|
25447
|
+
),
|
|
25448
|
+
open2 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
25449
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-40", onClick: close }),
|
|
25450
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute right-0 z-50 mt-1 min-w-[190px] max-h-72 overflow-auto bg-surface-800 border border-surface-600 rounded shadow-xl text-xs py-1", children: [
|
|
25451
|
+
error2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-2 py-1.5 text-[10px] text-red-400 whitespace-normal break-words border-b border-surface-700", children: error2 }),
|
|
25452
|
+
!kind ? kinds.map((k) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
25453
|
+
"button",
|
|
25454
|
+
{
|
|
25455
|
+
onClick: () => chooseKind(k),
|
|
25456
|
+
className: "w-full text-left px-2 py-1 hover:bg-surface-700 flex items-center justify-between gap-2",
|
|
25457
|
+
children: [
|
|
25458
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
25459
|
+
t("to"),
|
|
25460
|
+
" ",
|
|
25461
|
+
scopeWord[k]
|
|
25462
|
+
] }),
|
|
25463
|
+
SCOPE_HAS_INSTANCES[k] && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-500", children: "▸" })
|
|
25464
|
+
]
|
|
25465
|
+
},
|
|
25466
|
+
k
|
|
25467
|
+
)) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
25468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: () => {
|
|
25469
|
+
setKind(null);
|
|
25470
|
+
setError(null);
|
|
25471
|
+
}, className: "w-full text-left px-2 py-1 text-surface-500 hover:bg-surface-700", children: [
|
|
25472
|
+
"‹ ",
|
|
25473
|
+
t("back")
|
|
25474
|
+
] }),
|
|
25475
|
+
instances.map((ins, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => pick(ins.loc), className: "w-full text-left px-2 py-1 hover:bg-surface-700 truncate", title: ins.label, children: ins.label }, i))
|
|
25476
|
+
] })
|
|
25477
|
+
] })
|
|
25478
|
+
] })
|
|
25479
|
+
] });
|
|
25480
|
+
}
|
|
24846
25481
|
const HEADER_NAMES = [
|
|
24847
25482
|
"Accept",
|
|
24848
25483
|
"Authorization",
|
|
@@ -24949,7 +25584,7 @@ const HEADER_VALUE_SUGGESTIONS = {
|
|
|
24949
25584
|
function getValueSuggestions(headerName) {
|
|
24950
25585
|
return HEADER_VALUE_SUGGESTIONS[headerName.toLowerCase()];
|
|
24951
25586
|
}
|
|
24952
|
-
function KVTable({ rows, onChange, keyPlaceholder, valuePlaceholder, headerMode, paramMode }) {
|
|
25587
|
+
function KVTable({ rows, onChange, keyPlaceholder, valuePlaceholder, headerMode, paramMode, moveFrom, onMoved }) {
|
|
24953
25588
|
const t = useT();
|
|
24954
25589
|
const keyPh = keyPlaceholder ?? t("Key");
|
|
24955
25590
|
const valuePh = valuePlaceholder ?? t("Value");
|
|
@@ -25082,6 +25717,15 @@ function KVTable({ rows, onChange, keyPlaceholder, valuePlaceholder, headerMode,
|
|
|
25082
25717
|
children: "≡"
|
|
25083
25718
|
}
|
|
25084
25719
|
),
|
|
25720
|
+
moveFrom && row.key.trim() && moveFrom(row.key.trim()) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25721
|
+
MoveVariableMenu,
|
|
25722
|
+
{
|
|
25723
|
+
from: moveFrom(row.key.trim()),
|
|
25724
|
+
name: row.key.trim(),
|
|
25725
|
+
onMoved,
|
|
25726
|
+
buttonClassName: "flex-shrink-0 text-[9px] uppercase tracking-wider text-surface-500 hover:text-blue-400 border border-surface-700 hover:border-blue-500/40 rounded px-1 py-px opacity-0 group-hover:opacity-100 transition-opacity"
|
|
25727
|
+
}
|
|
25728
|
+
),
|
|
25085
25729
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25086
25730
|
"button",
|
|
25087
25731
|
{
|
|
@@ -25170,6 +25814,7 @@ function Modal({
|
|
|
25170
25814
|
window.addEventListener("mouseup", endDrag);
|
|
25171
25815
|
}, [offset.x, offset.y, onDragMove, endDrag]);
|
|
25172
25816
|
reactExports.useEffect(() => endDrag, [endDrag]);
|
|
25817
|
+
const titleId = reactExports.useId();
|
|
25173
25818
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25174
25819
|
"div",
|
|
25175
25820
|
{
|
|
@@ -25189,6 +25834,8 @@ function Modal({
|
|
|
25189
25834
|
ref: panelRef,
|
|
25190
25835
|
role: "dialog",
|
|
25191
25836
|
"aria-modal": "true",
|
|
25837
|
+
"aria-labelledby": title !== void 0 ? titleId : void 0,
|
|
25838
|
+
"aria-label": title === void 0 ? "Dialog" : void 0,
|
|
25192
25839
|
className: panelClassName,
|
|
25193
25840
|
style: offset.x || offset.y ? { transform: `translate(${offset.x}px, ${offset.y}px)` } : void 0,
|
|
25194
25841
|
onMouseDown: onPanelMouseDown,
|
|
@@ -25200,10 +25847,10 @@ function Modal({
|
|
|
25200
25847
|
className: "flex items-center justify-between px-4 py-2.5 border-b border-surface-800 flex-shrink-0 cursor-move select-none",
|
|
25201
25848
|
children: [
|
|
25202
25849
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
25203
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold", children: title }),
|
|
25850
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { id: titleId, className: "text-sm font-semibold", children: title }),
|
|
25204
25851
|
subtitle !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] text-surface-400 mt-0.5", children: subtitle })
|
|
25205
25852
|
] }),
|
|
25206
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-400 hover:text-[var(--text-primary)] text-lg leading-none cursor-pointer", children: "×" })
|
|
25853
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-400 hover:text-[var(--text-primary)] text-lg leading-none cursor-pointer", children: "×" })
|
|
25207
25854
|
]
|
|
25208
25855
|
}
|
|
25209
25856
|
),
|
|
@@ -25918,7 +26565,7 @@ function FolderSettingsModal({ collectionId, folder: folder2, onClose }) {
|
|
|
25918
26565
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold", children: t("Folder settings") }),
|
|
25919
26566
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] text-surface-600 mt-0.5", children: t(":name - auth and headers inherited by all requests in this folder", { name: folder2.name }) })
|
|
25920
26567
|
] }),
|
|
25921
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-400 hover:text-white text-lg leading-none", children: "×" })
|
|
26568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-400 hover:text-white text-lg leading-none", children: "×" })
|
|
25922
26569
|
] }),
|
|
25923
26570
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex border-b border-surface-800 px-4 shrink-0", children: ["auth", "headers"].map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25924
26571
|
"button",
|
|
@@ -26013,7 +26660,7 @@ function CollectionSettingsModal({ collection: collection2, onClose }) {
|
|
|
26013
26660
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold", children: t("Collection settings") }),
|
|
26014
26661
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] text-surface-600 mt-0.5", children: t(":name - auth and headers inherited by all requests in this collection", { name: collection2.name }) })
|
|
26015
26662
|
] }),
|
|
26016
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-400 hover:text-white text-lg leading-none", children: "×" })
|
|
26663
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-400 hover:text-white text-lg leading-none", children: "×" })
|
|
26017
26664
|
] }),
|
|
26018
26665
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex border-b border-surface-800 px-4 shrink-0", children: ["auth", "headers", "tls"].map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26019
26666
|
"button",
|
|
@@ -26276,7 +26923,7 @@ function SchemaSyncModal({
|
|
|
26276
26923
|
children: [
|
|
26277
26924
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-modal-drag": true, className: "flex items-center justify-between cursor-move select-none", children: [
|
|
26278
26925
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold text-surface-100", children: t("Sync schemas - :name", { name: scopeLabel }) }),
|
|
26279
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-500 hover:text-surface-300 text-lg leading-none", children: "×" })
|
|
26926
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-500 hover:text-surface-300 text-lg leading-none", children: "×" })
|
|
26280
26927
|
] }),
|
|
26281
26928
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 text-xs", children: [
|
|
26282
26929
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-400", children: t(":count operations in spec", { count: specEntries.length }) }),
|
|
@@ -26371,7 +27018,7 @@ function SchemaSyncModal({
|
|
|
26371
27018
|
children: [
|
|
26372
27019
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-modal-drag": true, className: "flex items-center justify-between cursor-move select-none", children: [
|
|
26373
27020
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold text-surface-100", children: t("Sync schemas from OpenAPI") }),
|
|
26374
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-500 hover:text-surface-300 text-lg leading-none", children: "×" })
|
|
27021
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-500 hover:text-surface-300 text-lg leading-none", children: "×" })
|
|
26375
27022
|
] }),
|
|
26376
27023
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-surface-400", children: t("Load an OpenAPI spec to update response schemas on existing requests. Matching uses HTTP method + URL path. Only schemas are touched - URLs, params, headers, auth, and scripts are preserved.") }),
|
|
26377
27024
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -27378,7 +28025,6 @@ function RequestRow({
|
|
|
27378
28025
|
{
|
|
27379
28026
|
"data-row": true,
|
|
27380
28027
|
draggable: true,
|
|
27381
|
-
role: "button",
|
|
27382
28028
|
tabIndex: 0,
|
|
27383
28029
|
onKeyDown: (e) => {
|
|
27384
28030
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -27562,7 +28208,6 @@ function ExampleRow({ name, indent, isActive, reorderable, dragging, dragActive,
|
|
|
27562
28208
|
draggable: reorderable && !renaming,
|
|
27563
28209
|
className: `group/ex flex items-center gap-2 h-[26px] pr-2 rounded-sm cursor-pointer transition-colors outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-blue-400 ${isActive ? "bg-blue-900/40 text-[var(--text-primary)]" : "text-surface-400 hover:bg-surface-800"} ${dragging ? "opacity-40" : ""} ${over ? "ring-1 ring-inset ring-blue-500" : ""}`,
|
|
27564
28210
|
style: { paddingLeft: indent },
|
|
27565
|
-
role: "button",
|
|
27566
28211
|
tabIndex: 0,
|
|
27567
28212
|
"aria-label": t("Example: :name", { name }),
|
|
27568
28213
|
onClick: onOpen,
|
|
@@ -28192,7 +28837,6 @@ function CollectionNode({
|
|
|
28192
28837
|
{
|
|
28193
28838
|
"data-row": true,
|
|
28194
28839
|
className: `group flex items-center gap-1 px-2 py-1.5 cursor-pointer hover:bg-surface-800 transition-colors outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-blue-400 ${panelActive ? "bg-surface-800 text-[var(--text-primary)]" : isActive ? "text-[var(--text-primary)]" : "text-surface-400"} ${col.disabled ? "opacity-50" : ""} ${dropOver ? "outline outline-1 outline-blue-500 rounded" : ""}`,
|
|
28195
|
-
role: "button",
|
|
28196
28840
|
tabIndex: 0,
|
|
28197
28841
|
onClick: onSelectCollection,
|
|
28198
28842
|
onDoubleClick: (e) => {
|
|
@@ -28372,7 +29016,6 @@ function FolderRow({
|
|
|
28372
29016
|
draggable: true,
|
|
28373
29017
|
className: `group flex items-center gap-1 py-1 transition-colors cursor-pointer outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-blue-400 ${isActive ? "bg-surface-800 text-[var(--text-primary)]" : "text-surface-400 hover:bg-surface-800"} ${folder2.disabled ? "opacity-40" : ""} ${dropInside ? "outline outline-1 outline-blue-500 rounded" : ""}`,
|
|
28374
29018
|
style: { paddingLeft: indent },
|
|
28375
|
-
role: "button",
|
|
28376
29019
|
tabIndex: 0,
|
|
28377
29020
|
onClick: () => openFolderPanel(collectionId, folder2.id),
|
|
28378
29021
|
onDoubleClick: (e) => {
|
|
@@ -28853,6 +29496,19 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
|
28853
29496
|
return baseModule().catch(handlePreloadError);
|
|
28854
29497
|
});
|
|
28855
29498
|
};
|
|
29499
|
+
const scrollerFocusable = ViewPlugin.define((view) => {
|
|
29500
|
+
try {
|
|
29501
|
+
view.scrollDOM.setAttribute("tabindex", "0");
|
|
29502
|
+
} catch {
|
|
29503
|
+
}
|
|
29504
|
+
return {};
|
|
29505
|
+
});
|
|
29506
|
+
function cmLabel(label) {
|
|
29507
|
+
return [
|
|
29508
|
+
EditorView.contentAttributes.of({ "aria-label": label }),
|
|
29509
|
+
scrollerFocusable
|
|
29510
|
+
];
|
|
29511
|
+
}
|
|
28856
29512
|
function jsonCommentRanges(input) {
|
|
28857
29513
|
const ranges = [];
|
|
28858
29514
|
const n2 = input.length;
|
|
@@ -28935,8 +29591,8 @@ function jsonWithComments() {
|
|
|
28935
29591
|
function xmlWithComments() {
|
|
28936
29592
|
return [xml(), commentKeymap];
|
|
28937
29593
|
}
|
|
28938
|
-
const GraphQLEditor = reactExports.lazy(() => __vitePreload(() => import("./GraphQLEditor-
|
|
28939
|
-
const SoapEditor = reactExports.lazy(() => __vitePreload(() => import("./SoapEditor-
|
|
29594
|
+
const GraphQLEditor = reactExports.lazy(() => __vitePreload(() => import("./GraphQLEditor-CJm8glW5.js"), true ? __vite__mapDeps([0,1,2]) : void 0, import.meta.url).then((m) => ({ default: m.GraphQLEditor })));
|
|
29595
|
+
const SoapEditor = reactExports.lazy(() => __vitePreload(() => import("./SoapEditor-C2eMs7-Z.js"), true ? __vite__mapDeps([3,1,2]) : void 0, import.meta.url).then((m) => ({ default: m.SoapEditor })));
|
|
28940
29596
|
function BodyTab({ request: request2, onChange }) {
|
|
28941
29597
|
const t = useT();
|
|
28942
29598
|
const editorFallback = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4 text-xs text-surface-500", children: t("Loading editor…") });
|
|
@@ -28992,7 +29648,7 @@ function BodyTab({ request: request2, onChange }) {
|
|
|
28992
29648
|
height: "300px",
|
|
28993
29649
|
maxHeight: "50vh",
|
|
28994
29650
|
theme: oneDark,
|
|
28995
|
-
extensions: [jsonWithComments(), varExt],
|
|
29651
|
+
extensions: [jsonWithComments(), varExt, ...cmLabel(t("Request body"))],
|
|
28996
29652
|
onChange: (val) => onChange({ body: { ...body, json: val } }),
|
|
28997
29653
|
basicSetup: { lineNumbers: true, foldGutter: false, autocompletion: false }
|
|
28998
29654
|
}
|
|
@@ -29024,7 +29680,7 @@ function BodyTab({ request: request2, onChange }) {
|
|
|
29024
29680
|
height: "300px",
|
|
29025
29681
|
maxHeight: "50vh",
|
|
29026
29682
|
theme: oneDark,
|
|
29027
|
-
extensions:
|
|
29683
|
+
extensions: [.../xml/i.test(body.rawContentType ?? "") ? [xmlWithComments(), varExt] : [commentKeymap, varExt], ...cmLabel(t("Request body"))],
|
|
29028
29684
|
onChange: (val) => onChange({ body: { ...body, raw: val } }),
|
|
29029
29685
|
basicSetup: { lineNumbers: true, foldGutter: false, autocompletion: false }
|
|
29030
29686
|
}
|
|
@@ -29097,20 +29753,6 @@ const SNIPPET_GROUPS = [
|
|
|
29097
29753
|
label: "Check JSON value",
|
|
29098
29754
|
code: `sp.test("JSON field equals value", function() {
|
|
29099
29755
|
sp.expect(json.field).to.equal("expected_value");
|
|
29100
|
-
});`
|
|
29101
|
-
},
|
|
29102
|
-
{
|
|
29103
|
-
label: "Validate JSON schema (tv4)",
|
|
29104
|
-
code: `sp.test("JSON matches schema", function() {
|
|
29105
|
-
const schema = {
|
|
29106
|
-
type: "object",
|
|
29107
|
-
properties: {
|
|
29108
|
-
id: { type: "number" },
|
|
29109
|
-
name: { type: "string" }
|
|
29110
|
-
},
|
|
29111
|
-
required: ["id", "name"]
|
|
29112
|
-
};
|
|
29113
|
-
sp.expect(tv4.validate(json, schema)).to.be.true;
|
|
29114
29756
|
});`
|
|
29115
29757
|
}
|
|
29116
29758
|
]
|
|
@@ -29328,7 +29970,7 @@ function ScriptsTab({ request: request2, onChange }) {
|
|
|
29328
29970
|
value: value2,
|
|
29329
29971
|
height: "100%",
|
|
29330
29972
|
theme: oneDark,
|
|
29331
|
-
extensions,
|
|
29973
|
+
extensions: [...extensions, ...cmLabel(t("Script editor"))],
|
|
29332
29974
|
onChange: handleChange,
|
|
29333
29975
|
basicSetup: { lineNumbers: true, foldGutter: false, autocompletion: false }
|
|
29334
29976
|
}
|
|
@@ -29501,7 +30143,7 @@ function SchemaTab({ request: request2, onChange }) {
|
|
|
29501
30143
|
height: "300px",
|
|
29502
30144
|
maxHeight: "50vh",
|
|
29503
30145
|
theme: oneDark,
|
|
29504
|
-
extensions: [json()],
|
|
30146
|
+
extensions: [json(), ...cmLabel(t("JSON schema"))],
|
|
29505
30147
|
onChange: (val) => setSchema(val),
|
|
29506
30148
|
placeholder: '{\n "type": "object",\n "properties": {}\n}',
|
|
29507
30149
|
basicSetup: { lineNumbers: true, foldGutter: true }
|
|
@@ -39174,6 +39816,39 @@ function VariablesTab({ request: request2 }) {
|
|
|
39174
39816
|
if (name in requestVars) return;
|
|
39175
39817
|
addRow(name, valueOf(name) === "••••••••" ? "" : `{{${name}}}`);
|
|
39176
39818
|
};
|
|
39819
|
+
const folderChain = reactExports.useMemo(() => col ? findFolderPath(col.rootFolder, request2.id) : [], [col, request2.id]);
|
|
39820
|
+
const folderLocFor = (name) => {
|
|
39821
|
+
if (!col) return null;
|
|
39822
|
+
for (let i = folderChain.length - 1; i >= 0; i--) {
|
|
39823
|
+
if (folderChain[i].variables && name in folderChain[i].variables) {
|
|
39824
|
+
return { kind: "folder", collectionId: col.id, folderId: folderChain[i].id };
|
|
39825
|
+
}
|
|
39826
|
+
}
|
|
39827
|
+
return null;
|
|
39828
|
+
};
|
|
39829
|
+
const locForScope = (scope, name) => {
|
|
39830
|
+
switch (scope) {
|
|
39831
|
+
case "request":
|
|
39832
|
+
return col ? { kind: "request", collectionId: col.id, requestId: request2.id } : null;
|
|
39833
|
+
case "folder":
|
|
39834
|
+
return folderLocFor(name);
|
|
39835
|
+
case "collection":
|
|
39836
|
+
return col ? { kind: "collection", collectionId: col.id } : null;
|
|
39837
|
+
case "environment":
|
|
39838
|
+
return activeEnv ? { kind: "environment", environmentId: activeEnv.id } : null;
|
|
39839
|
+
case "global":
|
|
39840
|
+
return { kind: "global" };
|
|
39841
|
+
}
|
|
39842
|
+
};
|
|
39843
|
+
const reseedRows = () => {
|
|
39844
|
+
const base = useStore$1.getState().collections[col?.id ?? ""]?.data.requests[request2.id];
|
|
39845
|
+
const enabled = base?.variables ?? {};
|
|
39846
|
+
const disabled = base?.variablesDisabled ?? {};
|
|
39847
|
+
setRows([
|
|
39848
|
+
...Object.entries(enabled).map(([key, value2]) => ({ key, value: value2, enabled: true })),
|
|
39849
|
+
...Object.entries(disabled).map(([key, value2]) => ({ key, value: value2, enabled: false }))
|
|
39850
|
+
]);
|
|
39851
|
+
};
|
|
39177
39852
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-5 text-xs", children: [
|
|
39178
39853
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { children: [
|
|
39179
39854
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
@@ -39225,6 +39900,14 @@ function VariablesTab({ request: request2 }) {
|
|
|
39225
39900
|
}
|
|
39226
39901
|
),
|
|
39227
39902
|
shadows && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 text-[9px] uppercase tracking-wider text-fuchsia-400 border border-fuchsia-500/30 rounded px-1 py-px", title: t("Overrides a higher-level variable of the same name"), children: t("override") }),
|
|
39903
|
+
!isExample && key && col && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39904
|
+
MoveVariableMenu,
|
|
39905
|
+
{
|
|
39906
|
+
from: { kind: "request", collectionId: col.id, requestId: request2.id },
|
|
39907
|
+
name: key,
|
|
39908
|
+
onMoved: reseedRows
|
|
39909
|
+
}
|
|
39910
|
+
),
|
|
39228
39911
|
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => removeRow(i), className: "shrink-0 text-surface-500 hover:text-red-400 p-1", title: t("Remove"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(TrashIcon, {}) })
|
|
39229
39912
|
] }, i);
|
|
39230
39913
|
}) })
|
|
@@ -39272,6 +39955,7 @@ function VariablesTab({ request: request2 }) {
|
|
|
39272
39955
|
children: t("override")
|
|
39273
39956
|
}
|
|
39274
39957
|
),
|
|
39958
|
+
locForScope(scope, name) && /* @__PURE__ */ jsxRuntimeExports.jsx(MoveVariableMenu, { from: locForScope(scope, name), name, onMoved: reseedRows }),
|
|
39275
39959
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `shrink-0 text-[9px] uppercase tracking-wider border rounded px-1 py-px ${SCOPE_BADGE[scope]}`, children: SCOPE_LABEL[scope] })
|
|
39276
39960
|
] }, name);
|
|
39277
39961
|
}) })
|
|
@@ -41674,6 +42358,7 @@ function RequestBuilder({ request: request2 }) {
|
|
|
41674
42358
|
) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
41675
42359
|
"select",
|
|
41676
42360
|
{
|
|
42361
|
+
"aria-label": t("HTTP method"),
|
|
41677
42362
|
value: METHODS.includes(request2.method) ? request2.method : "__current__",
|
|
41678
42363
|
onChange: (e) => {
|
|
41679
42364
|
if (e.target.value === "__custom__") setCustomVerb(true);
|
|
@@ -43828,8 +44513,8 @@ function ResponseViewer() {
|
|
|
43828
44513
|
" KB"
|
|
43829
44514
|
] })
|
|
43830
44515
|
] }),
|
|
43831
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
43832
|
-
tabList.map((def) => renderTabButton(def, "inline")),
|
|
44516
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-0 min-w-0 ml-1", children: [
|
|
44517
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "tablist", tabIndex: -1, "aria-label": t("Response sections"), onKeyDown: onTablistKey, className: "flex items-center gap-0 min-w-0", children: tabList.map((def) => renderTabButton(def, "inline")) }),
|
|
43833
44518
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43834
44519
|
OverflowMenu,
|
|
43835
44520
|
{
|
|
@@ -44034,7 +44719,7 @@ function ResponseViewer() {
|
|
|
44034
44719
|
{
|
|
44035
44720
|
value: jqResult ?? "",
|
|
44036
44721
|
theme: oneDark,
|
|
44037
|
-
extensions: [json()],
|
|
44722
|
+
extensions: [json(), ...cmLabel(t("Filtered response"))],
|
|
44038
44723
|
readOnly: true,
|
|
44039
44724
|
basicSetup: { lineNumbers: true, foldGutter: true }
|
|
44040
44725
|
}
|
|
@@ -44058,7 +44743,7 @@ function ResponseViewer() {
|
|
|
44058
44743
|
{
|
|
44059
44744
|
value: displayBody,
|
|
44060
44745
|
theme: oneDark,
|
|
44061
|
-
extensions: isJson ? [json()] : isXml ? [xml()] : [],
|
|
44746
|
+
extensions: [...isJson ? [json()] : isXml ? [xml()] : [], ...cmLabel(t("Response body"))],
|
|
44062
44747
|
readOnly: true,
|
|
44063
44748
|
basicSetup: { lineNumbers: true, foldGutter: true }
|
|
44064
44749
|
}
|
|
@@ -45521,7 +46206,6 @@ function HistoryRow({
|
|
|
45521
46206
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
45522
46207
|
"div",
|
|
45523
46208
|
{
|
|
45524
|
-
role: "button",
|
|
45525
46209
|
tabIndex: 0,
|
|
45526
46210
|
onClick: onSelect,
|
|
45527
46211
|
onKeyDown: (e) => {
|
|
@@ -45652,7 +46336,7 @@ function WelcomeScreen() {
|
|
|
45652
46336
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "text-2xl font-semibold mb-1", children: [
|
|
45653
46337
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--wordmark-muted)" }, children: "API" }),
|
|
45654
46338
|
" ",
|
|
45655
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "
|
|
46339
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--wordmark-accent)" }, children: "Spector" })
|
|
45656
46340
|
] }),
|
|
45657
46341
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[11px] mb-3", style: { color: "var(--text-muted)" }, children: [
|
|
45658
46342
|
t("by"),
|
|
@@ -45662,13 +46346,13 @@ function WelcomeScreen() {
|
|
|
45662
46346
|
{
|
|
45663
46347
|
onClick: () => window.electron.openExternal("https://testsmith.io"),
|
|
45664
46348
|
className: "hover:underline focus:outline-none",
|
|
45665
|
-
style: { color: "
|
|
46349
|
+
style: { color: "var(--wordmark-accent)" },
|
|
45666
46350
|
children: "Testsmith"
|
|
45667
46351
|
}
|
|
45668
46352
|
)
|
|
45669
46353
|
] }),
|
|
45670
46354
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-surface-400 text-sm max-w-sm", children: t("Local-first API testing with Robot Framework & Playwright code generation. Secrets stay on your machine.") }),
|
|
45671
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] mt-3", style: { color: "var(--text-muted)" }, children: t("version :version", { version: "0.
|
|
46355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] mt-3", style: { color: "var(--text-muted)" }, children: t("version :version", { version: "0.9.1" }) })
|
|
45672
46356
|
] }),
|
|
45673
46357
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 w-64", children: [
|
|
45674
46358
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -45699,7 +46383,7 @@ function WelcomeScreen() {
|
|
|
45699
46383
|
onKeyDown: (e) => {
|
|
45700
46384
|
if (e.key === "Enter") openFromGit();
|
|
45701
46385
|
},
|
|
45702
|
-
placeholder: "https://github.com/owner/repo",
|
|
46386
|
+
placeholder: "https://github.com/owner/repo or git@host:owner/repo.git",
|
|
45703
46387
|
autoFocus: true,
|
|
45704
46388
|
disabled: busy || gitBusy,
|
|
45705
46389
|
className: "px-3 py-2 bg-surface-900 border border-surface-700 rounded text-xs focus:outline-none focus:border-blue-600 disabled:opacity-60"
|
|
@@ -46171,7 +46855,7 @@ function EnvironmentEditor({ onClose }) {
|
|
|
46171
46855
|
placeholder: t("Environment name")
|
|
46172
46856
|
}
|
|
46173
46857
|
),
|
|
46174
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-400 hover:text-white text-lg leading-none", children: "×" })
|
|
46858
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-400 hover:text-white text-lg leading-none", children: "×" })
|
|
46175
46859
|
] }),
|
|
46176
46860
|
nameError && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[10px] text-red-400 mt-1", children: nameError }),
|
|
46177
46861
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
@@ -46295,14 +46979,24 @@ function EnvironmentEditor({ onClose }) {
|
|
|
46295
46979
|
)
|
|
46296
46980
|
] })
|
|
46297
46981
|
] }),
|
|
46298
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsxRuntimeExports.
|
|
46299
|
-
|
|
46300
|
-
|
|
46301
|
-
|
|
46302
|
-
|
|
46303
|
-
|
|
46304
|
-
|
|
46305
|
-
|
|
46982
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "px-2 py-1.5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 justify-end", children: [
|
|
46983
|
+
v.key.trim() && env2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
46984
|
+
MoveVariableMenu,
|
|
46985
|
+
{
|
|
46986
|
+
from: { kind: "environment", environmentId: env2.id },
|
|
46987
|
+
name: v.key.trim(),
|
|
46988
|
+
buttonClassName: "text-[9px] uppercase tracking-wider text-surface-500 hover:text-blue-400 border border-surface-700 hover:border-blue-500/40 rounded px-1 py-px opacity-0 group-hover:opacity-100 transition-all"
|
|
46989
|
+
}
|
|
46990
|
+
),
|
|
46991
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
46992
|
+
"button",
|
|
46993
|
+
{
|
|
46994
|
+
onClick: () => removeVar(idx),
|
|
46995
|
+
className: "text-surface-400 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all",
|
|
46996
|
+
children: "×"
|
|
46997
|
+
}
|
|
46998
|
+
)
|
|
46999
|
+
] }) })
|
|
46306
47000
|
] }),
|
|
46307
47001
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
|
|
46308
47002
|
/* @__PURE__ */ jsxRuntimeExports.jsx("td", {}),
|
|
@@ -46472,6 +47166,7 @@ function EnvironmentBar({ inline = false }) {
|
|
|
46472
47166
|
{
|
|
46473
47167
|
value: activeEnvironmentId ?? "",
|
|
46474
47168
|
onChange: (e) => handleEnvChange(e.target.value || null),
|
|
47169
|
+
"aria-label": t("Active environment"),
|
|
46475
47170
|
className: "bg-surface-800 border border-surface-700 rounded px-2 py-0.5 text-xs focus:outline-none focus:border-blue-500 max-w-[140px]",
|
|
46476
47171
|
style: { color: "var(--text-primary)" },
|
|
46477
47172
|
children: [
|
|
@@ -46893,6 +47588,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
46893
47588
|
{
|
|
46894
47589
|
value: defaultEnvironment,
|
|
46895
47590
|
onChange: (e) => setDefaultEnvironment(e.target.value),
|
|
47591
|
+
"aria-label": t("Default environment"),
|
|
46896
47592
|
className: "bg-surface-800 border border-surface-700 rounded px-2.5 py-1.5 focus:outline-none focus:border-blue-500",
|
|
46897
47593
|
children: [
|
|
46898
47594
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: t("(none)") }),
|
|
@@ -46909,6 +47605,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
46909
47605
|
{
|
|
46910
47606
|
value: defaultRequestTab,
|
|
46911
47607
|
onChange: (e) => setDefaultRequestTab(e.target.value),
|
|
47608
|
+
"aria-label": t("Default request tab"),
|
|
46912
47609
|
className: "bg-surface-800 border border-surface-700 rounded px-2.5 py-1.5 focus:outline-none focus:border-blue-500",
|
|
46913
47610
|
children: [
|
|
46914
47611
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "docs", children: t("Docs") }),
|
|
@@ -46980,6 +47677,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
46980
47677
|
{
|
|
46981
47678
|
value: locale,
|
|
46982
47679
|
onChange: (e) => setLocale(e.target.value),
|
|
47680
|
+
"aria-label": t("Language"),
|
|
46983
47681
|
className: "bg-surface-800 hover:bg-surface-700 text-surface-300 text-xs rounded py-1.5 px-2 outline-none",
|
|
46984
47682
|
children: Object.entries(LOCALES).map(([code, name]) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: code, children: name }, code))
|
|
46985
47683
|
}
|
|
@@ -47271,10 +47969,17 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
47271
47969
|
" ",
|
|
47272
47970
|
t("in an environment variable or an auth field; it is resolved at send-time and never written to the workspace. This connection config is non-secret - tokens and secret-ids come from your environment (or the Vault sign-in below).")
|
|
47273
47971
|
] }),
|
|
47972
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-surface-600 text-[11px]", children: [
|
|
47973
|
+
t("Using OpenBao? It is API-compatible, so the same settings apply. Reference secrets with"),
|
|
47974
|
+
" ",
|
|
47975
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-surface-400", children: "bao:secret/data/app#token" }),
|
|
47976
|
+
" ",
|
|
47977
|
+
t("and set BAO_ADDR / BAO_TOKEN (VAULT_* also works).")
|
|
47978
|
+
] }),
|
|
47274
47979
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 border border-surface-800 rounded p-3", children: [
|
|
47275
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[10px] uppercase tracking-wider text-surface-500 font-semibold", children: "HashiCorp Vault" }),
|
|
47980
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[10px] uppercase tracking-wider text-surface-500 font-semibold", children: t("HashiCorp Vault / OpenBao") }),
|
|
47276
47981
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
47277
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelCls, children: t("Address (VAULT_ADDR)") }),
|
|
47982
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: labelCls, children: t("Address (VAULT_ADDR / BAO_ADDR)") }),
|
|
47278
47983
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
47279
47984
|
"input",
|
|
47280
47985
|
{
|
|
@@ -47305,6 +48010,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
47305
48010
|
{
|
|
47306
48011
|
value: vAuthMethod,
|
|
47307
48012
|
onChange: (e) => setVAuthMethod(e.target.value),
|
|
48013
|
+
"aria-label": t("Auth method"),
|
|
47308
48014
|
className: "bg-surface-800 border border-surface-700 rounded px-2.5 py-1.5 focus:outline-none focus:border-blue-500",
|
|
47309
48015
|
children: [
|
|
47310
48016
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "token", children: t("Token / OIDC") }),
|
|
@@ -47364,6 +48070,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
47364
48070
|
{
|
|
47365
48071
|
value: vKvVersion,
|
|
47366
48072
|
onChange: (e) => setVKvVersion(e.target.value),
|
|
48073
|
+
"aria-label": t("KV version"),
|
|
47367
48074
|
className: "bg-surface-800 border border-surface-700 rounded px-2.5 py-1.5 focus:outline-none focus:border-blue-500",
|
|
47368
48075
|
children: [
|
|
47369
48076
|
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "auto", children: "auto" }),
|
|
@@ -47417,6 +48124,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
47417
48124
|
value: azVault,
|
|
47418
48125
|
onChange: (e) => setAzVault(e.target.value),
|
|
47419
48126
|
placeholder: "acme-kv",
|
|
48127
|
+
"aria-label": t("Azure vault"),
|
|
47420
48128
|
className: `${inputCls$1} placeholder-surface-600`
|
|
47421
48129
|
}
|
|
47422
48130
|
)
|
|
@@ -47428,6 +48136,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
47428
48136
|
{
|
|
47429
48137
|
value: azTenantId,
|
|
47430
48138
|
onChange: (e) => setAzTenantId(e.target.value),
|
|
48139
|
+
"aria-label": t("Tenant id"),
|
|
47431
48140
|
className: inputCls$1
|
|
47432
48141
|
}
|
|
47433
48142
|
)
|
|
@@ -47439,6 +48148,7 @@ function WorkspaceSettingsModal({ onClose, initialTab }) {
|
|
|
47439
48148
|
{
|
|
47440
48149
|
value: azClientId,
|
|
47441
48150
|
onChange: (e) => setAzClientId(e.target.value),
|
|
48151
|
+
"aria-label": t("Client id"),
|
|
47442
48152
|
className: inputCls$1
|
|
47443
48153
|
}
|
|
47444
48154
|
)
|
|
@@ -48550,6 +49260,46 @@ function collectRequestsByFolder(folder2, src) {
|
|
|
48550
49260
|
walk2(folder2);
|
|
48551
49261
|
return out;
|
|
48552
49262
|
}
|
|
49263
|
+
function Tooltip({
|
|
49264
|
+
label,
|
|
49265
|
+
align = "center",
|
|
49266
|
+
children: children2
|
|
49267
|
+
}) {
|
|
49268
|
+
const pos = align === "right" ? "right-0" : align === "left" ? "left-0" : "left-1/2 -translate-x-1/2";
|
|
49269
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "relative inline-flex group/tip", children: [
|
|
49270
|
+
children2,
|
|
49271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49272
|
+
"span",
|
|
49273
|
+
{
|
|
49274
|
+
"aria-hidden": "true",
|
|
49275
|
+
className: `pointer-events-none absolute top-full ${pos} mt-1.5 z-50 hidden group-hover/tip:block group-focus-within/tip:block whitespace-nowrap rounded px-2 py-1 text-[11px] bg-surface-900 text-[var(--text-primary)] border border-surface-700 shadow-lg`,
|
|
49276
|
+
children: label
|
|
49277
|
+
}
|
|
49278
|
+
)
|
|
49279
|
+
] });
|
|
49280
|
+
}
|
|
49281
|
+
function DocIcon() {
|
|
49282
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", strokeWidth: 1.8, viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
49283
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8l-5-5z" }),
|
|
49284
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14 3v5h5M8.5 13h7M8.5 16.5h5" })
|
|
49285
|
+
] });
|
|
49286
|
+
}
|
|
49287
|
+
function ImportIcon() {
|
|
49288
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", strokeWidth: 1.8, viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
49289
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 3v10m0 0l-3.5-3.5M12 13l3.5-3.5" }),
|
|
49290
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v3a2 2 0 002 2h12a2 2 0 002-2v-3" })
|
|
49291
|
+
] });
|
|
49292
|
+
}
|
|
49293
|
+
function Svg({ children: children2 }) {
|
|
49294
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", strokeWidth: 1.8, viewBox: "0 0 24 24", "aria-hidden": "true", children: children2 });
|
|
49295
|
+
}
|
|
49296
|
+
const OpenWsIcon = () => /* @__PURE__ */ jsxRuntimeExports.jsx(Svg, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3.75 9.75h16.5a1.5 1.5 0 011.47 1.8l-1.2 6a1.5 1.5 0 01-1.47 1.2H4.95a1.5 1.5 0 01-1.47-1.2l-1.2-6a1.5 1.5 0 011.47-1.8zM3.75 9.75V6.75A1.5 1.5 0 015.25 5.25h3.88a1.5 1.5 0 011.06.44l1.12 1.12a1.5 1.5 0 001.06.44h4.88a1.5 1.5 0 011.5 1.5v.56" }) });
|
|
49297
|
+
const NewWsIcon = () => /* @__PURE__ */ jsxRuntimeExports.jsx(Svg, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 11v5m2.5-2.5h-5M3.75 7.5V18a1.5 1.5 0 001.5 1.5h13.5A1.5 1.5 0 0020.25 18V9a1.5 1.5 0 00-1.5-1.5h-5.19a1.5 1.5 0 01-1.06-.44l-1.12-1.12a1.5 1.5 0 00-1.06-.44H5.25a1.5 1.5 0 00-1.5 1.5z" }) });
|
|
49298
|
+
const CloseWsIcon = () => /* @__PURE__ */ jsxRuntimeExports.jsx(Svg, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l12 12M18 6L6 18" }) });
|
|
49299
|
+
const SaveIcon = () => /* @__PURE__ */ jsxRuntimeExports.jsxs(Svg, { children: [
|
|
49300
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 4h11l3 3v12a1 1 0 01-1 1H5a1 1 0 01-1-1V5a1 1 0 011-1z" }),
|
|
49301
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 4v4h6V4M8 13h8v6H8z" })
|
|
49302
|
+
] });
|
|
48553
49303
|
const { electron: electron$f } = window;
|
|
48554
49304
|
function Toolbar({ onOpenDocs: _onOpenDocs }) {
|
|
48555
49305
|
const t = useT();
|
|
@@ -48661,34 +49411,51 @@ function Toolbar({ onOpenDocs: _onOpenDocs }) {
|
|
|
48661
49411
|
.logo-pupil-r { animation-delay: 0.04s; }
|
|
48662
49412
|
` }),
|
|
48663
49413
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1.5 mr-1 shrink-0 select-none", children: [
|
|
48664
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
48665
|
-
|
|
48666
|
-
|
|
48667
|
-
|
|
48668
|
-
|
|
48669
|
-
|
|
48670
|
-
|
|
48671
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("
|
|
48672
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
48673
|
-
|
|
48674
|
-
|
|
48675
|
-
|
|
48676
|
-
|
|
48677
|
-
|
|
48678
|
-
|
|
48679
|
-
|
|
48680
|
-
|
|
48681
|
-
|
|
48682
|
-
|
|
48683
|
-
|
|
48684
|
-
|
|
48685
|
-
|
|
49414
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49415
|
+
"button",
|
|
49416
|
+
{
|
|
49417
|
+
onClick: () => window.electron.openExternal("https://api-spector.dev"),
|
|
49418
|
+
title: t("Open api-spector.dev"),
|
|
49419
|
+
"aria-label": t("API Spector home"),
|
|
49420
|
+
className: "shrink-0 focus:outline-none rounded hover:opacity-80 transition-opacity cursor-pointer",
|
|
49421
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "52", height: "52", viewBox: "0 0 512 512", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
49422
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("defs", { children: [
|
|
49423
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("radialGradient", { id: "logoBody", cx: "35%", cy: "22%", r: "70%", children: [
|
|
49424
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "0%", stopColor: "#5497c8" }),
|
|
49425
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "55%", stopColor: "#205d96" }),
|
|
49426
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "100%", stopColor: "#123a60" })
|
|
49427
|
+
] }),
|
|
49428
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("linearGradient", { id: "logoGloss", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
49429
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "0%", stopColor: "white", stopOpacity: "0.45" }),
|
|
49430
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("stop", { offset: "100%", stopColor: "white", stopOpacity: "0" })
|
|
49431
|
+
] }),
|
|
49432
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "logoGhostClip", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M 130,225 C 130,95 382,95 382,225 L 382,390 Q 340,435 298,390 Q 256,435 214,390 Q 172,435 130,390 Z" }) })
|
|
49433
|
+
] }),
|
|
49434
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M 130,225 C 130,95 382,95 382,225 L 382,390 Q 340,435 298,390 Q 256,435 214,390 Q 172,435 130,390 Z", fill: "url(#logoBody)" }),
|
|
49435
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "198", cy: "262", rx: "29", ry: "33", fill: "white" }),
|
|
49436
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "314", cy: "262", rx: "29", ry: "33", fill: "white" }),
|
|
49437
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "204", cy: "268", rx: "16", ry: "20", fill: "#0b1624", className: "logo-pupil" }),
|
|
49438
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "320", cy: "268", rx: "16", ry: "20", fill: "#0b1624", className: "logo-pupil logo-pupil-r" }),
|
|
49439
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "194", cy: "254", rx: "6", ry: "7", fill: "white", opacity: "0.65" }),
|
|
49440
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "310", cy: "254", rx: "6", ry: "7", fill: "white", opacity: "0.65" }),
|
|
49441
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "256", cy: "100", rx: "200", ry: "180", fill: "url(#logoGloss)", clipPath: "url(#logoGhostClip)" })
|
|
49442
|
+
] })
|
|
49443
|
+
}
|
|
49444
|
+
),
|
|
48686
49445
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col leading-tight", children: [
|
|
48687
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
48688
|
-
|
|
48689
|
-
|
|
48690
|
-
|
|
48691
|
-
|
|
49446
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
49447
|
+
"button",
|
|
49448
|
+
{
|
|
49449
|
+
onClick: () => window.electron.openExternal("https://api-spector.dev"),
|
|
49450
|
+
title: t("Open api-spector.dev"),
|
|
49451
|
+
className: "text-xs font-semibold tracking-wide text-left hover:underline focus:outline-none cursor-pointer",
|
|
49452
|
+
children: [
|
|
49453
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--wordmark-muted)" }, children: "API" }),
|
|
49454
|
+
" ",
|
|
49455
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--wordmark-accent)" }, children: "Spector" })
|
|
49456
|
+
]
|
|
49457
|
+
}
|
|
49458
|
+
),
|
|
48692
49459
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48693
49460
|
"button",
|
|
48694
49461
|
{
|
|
@@ -48700,92 +49467,98 @@ function Toolbar({ onOpenDocs: _onOpenDocs }) {
|
|
|
48700
49467
|
)
|
|
48701
49468
|
] })
|
|
48702
49469
|
] }),
|
|
48703
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48704
|
-
"button",
|
|
48705
|
-
{
|
|
48706
|
-
onClick: () => setImportOpen(true),
|
|
48707
|
-
className: "px-2.5 py-1 text-xs bg-surface-800 hover:bg-surface-700 rounded transition-colors shrink-0",
|
|
48708
|
-
title: t("Import collection (Postman, OpenAPI, Insomnia, Bruno)"),
|
|
48709
|
-
children: t("Import")
|
|
48710
|
-
}
|
|
48711
|
-
),
|
|
48712
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-px h-4 bg-surface-800 mx-1 shrink-0" }),
|
|
48713
49470
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-600 text-xs shrink-0", children: t("ENV") }),
|
|
48714
49471
|
/* @__PURE__ */ jsxRuntimeExports.jsx(EnvironmentBar, { inline: true })
|
|
48715
49472
|
] }),
|
|
48716
49473
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 shrink-0 border-l border-surface-800", children: [
|
|
48717
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49474
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-600 text-xs shrink-0", children: t("Workspace") }),
|
|
49475
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Open a different workspace"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48718
49476
|
"button",
|
|
48719
49477
|
{
|
|
48720
49478
|
onClick: openWs,
|
|
48721
49479
|
disabled: wsBusy,
|
|
48722
|
-
className: "
|
|
48723
|
-
|
|
48724
|
-
children:
|
|
49480
|
+
className: "p-1.5 bg-surface-800 hover:bg-surface-700 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
49481
|
+
"aria-label": t("Open a different workspace"),
|
|
49482
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(OpenWsIcon, {})
|
|
48725
49483
|
}
|
|
48726
|
-
),
|
|
48727
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49484
|
+
) }),
|
|
49485
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Create a new workspace"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48728
49486
|
"button",
|
|
48729
49487
|
{
|
|
48730
49488
|
onClick: newWs,
|
|
48731
49489
|
disabled: wsBusy,
|
|
48732
|
-
className: "
|
|
48733
|
-
|
|
48734
|
-
children:
|
|
49490
|
+
className: "p-1.5 bg-surface-800 hover:bg-surface-700 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
49491
|
+
"aria-label": t("Create a new workspace"),
|
|
49492
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(NewWsIcon, {})
|
|
48735
49493
|
}
|
|
48736
|
-
),
|
|
48737
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49494
|
+
) }),
|
|
49495
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Close current workspace"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48738
49496
|
"button",
|
|
48739
49497
|
{
|
|
48740
49498
|
onClick: async () => {
|
|
48741
49499
|
await electron$f.closeWorkspace();
|
|
48742
49500
|
closeWorkspace();
|
|
48743
49501
|
},
|
|
48744
|
-
className: "
|
|
48745
|
-
|
|
48746
|
-
children:
|
|
49502
|
+
className: "p-1.5 bg-surface-800 hover:bg-surface-700 rounded transition-colors",
|
|
49503
|
+
"aria-label": t("Close current workspace"),
|
|
49504
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseWsIcon, {})
|
|
48747
49505
|
}
|
|
48748
|
-
),
|
|
48749
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
49506
|
+
) }),
|
|
49507
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: saving ? t("Saving…") : t("Save all unsaved changes"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
48750
49508
|
"button",
|
|
48751
49509
|
{
|
|
48752
49510
|
onClick: saveAll,
|
|
48753
49511
|
disabled: saving,
|
|
48754
|
-
className: `
|
|
48755
|
-
|
|
49512
|
+
className: `relative p-1.5 rounded transition-colors ${hasDirty ? "bg-blue-700 hover:bg-blue-600 text-white" : "bg-surface-800 hover:bg-surface-700 text-surface-500"} ${saving ? "opacity-60" : ""}`,
|
|
49513
|
+
"aria-label": t("Save all unsaved changes"),
|
|
48756
49514
|
children: [
|
|
48757
|
-
|
|
48758
|
-
|
|
49515
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SaveIcon, {}),
|
|
49516
|
+
hasDirty && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full bg-amber-400" })
|
|
48759
49517
|
]
|
|
48760
49518
|
}
|
|
48761
|
-
),
|
|
48762
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48763
|
-
|
|
48764
|
-
{
|
|
48765
|
-
onClick: () => setWorkspaceSettingsOpen(true),
|
|
48766
|
-
className: "px-2.5 py-1 text-xs bg-surface-800 hover:bg-surface-700 rounded transition-colors",
|
|
48767
|
-
title: t("Workspace settings"),
|
|
48768
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontSize: "16px", lineHeight: 1 }, children: "⚙" })
|
|
48769
|
-
}
|
|
48770
|
-
),
|
|
48771
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49519
|
+
) }),
|
|
49520
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-px h-4 bg-surface-800 mx-1 shrink-0" }),
|
|
49521
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Import collection (Postman, OpenAPI, Insomnia, Bruno)"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48772
49522
|
"button",
|
|
48773
49523
|
{
|
|
48774
|
-
onClick: () =>
|
|
48775
|
-
className: "
|
|
48776
|
-
|
|
48777
|
-
children:
|
|
49524
|
+
onClick: () => setImportOpen(true),
|
|
49525
|
+
className: "p-1.5 bg-surface-800 hover:bg-surface-700 rounded transition-colors",
|
|
49526
|
+
"aria-label": t("Import collection (Postman, OpenAPI, Insomnia, Bruno)"),
|
|
49527
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ImportIcon, {})
|
|
48778
49528
|
}
|
|
48779
|
-
),
|
|
48780
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49529
|
+
) }),
|
|
49530
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-px h-4 bg-surface-800 mx-1 shrink-0" }),
|
|
49531
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
49532
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-600 text-xs", children: t("Generate") }),
|
|
49533
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Generate API documentation"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49534
|
+
"button",
|
|
49535
|
+
{
|
|
49536
|
+
onClick: () => setDocsOpen(true),
|
|
49537
|
+
className: "p-1.5 bg-surface-800 hover:bg-surface-700 rounded transition-colors",
|
|
49538
|
+
"aria-label": t("Generate API documentation"),
|
|
49539
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(DocIcon, {})
|
|
49540
|
+
}
|
|
49541
|
+
) }),
|
|
49542
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Toggle code generator"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49543
|
+
"button",
|
|
49544
|
+
{
|
|
49545
|
+
onClick: () => setShowGeneratorPanel(!showGeneratorPanel),
|
|
49546
|
+
className: `px-2 py-1 text-xs font-mono rounded transition-colors ${showGeneratorPanel ? "bg-blue-700 text-white" : "bg-surface-800 hover:bg-surface-700"}`,
|
|
49547
|
+
"aria-label": t("Toggle code generator"),
|
|
49548
|
+
children: "</>"
|
|
49549
|
+
}
|
|
49550
|
+
) })
|
|
49551
|
+
] }),
|
|
49552
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-px h-4 bg-surface-800 mx-1 shrink-0" }),
|
|
49553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: t("Workspace settings"), align: "right", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
48781
49554
|
"button",
|
|
48782
49555
|
{
|
|
48783
|
-
onClick: () =>
|
|
48784
|
-
className:
|
|
48785
|
-
|
|
48786
|
-
children:
|
|
49556
|
+
onClick: () => setWorkspaceSettingsOpen(true),
|
|
49557
|
+
className: "p-1.5 bg-surface-800 hover:bg-surface-700 rounded transition-colors",
|
|
49558
|
+
"aria-label": t("Workspace settings"),
|
|
49559
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(GearIcon, {})
|
|
48787
49560
|
}
|
|
48788
|
-
)
|
|
49561
|
+
) })
|
|
48789
49562
|
] })
|
|
48790
49563
|
] })
|
|
48791
49564
|
] });
|
|
@@ -48939,18 +49712,18 @@ function buildHtmlReport(results, summary2, meta = {}) {
|
|
|
48939
49712
|
:root {
|
|
48940
49713
|
--bg: #0f1117; --bg-surface: #161b22; --bg-panel: #0d1117;
|
|
48941
49714
|
--border: #21262d; --border-hover:#30363d;
|
|
48942
|
-
--text: #c9d1d9; --text-bright: #e6edf3; --text-muted: #8b949e; --text-dim: #
|
|
49715
|
+
--text: #c9d1d9; --text-bright: #e6edf3; --text-muted: #8b949e; --text-dim: #818992;
|
|
48943
49716
|
--green: #3fb950; --red: #f85149; --amber: #d29922; --blue: #79c0ff;
|
|
48944
49717
|
--badge-pass-bg: #0d3a1e; --badge-fail-bg: #3d1014; --badge-err-bg: #3d2a00; --badge-skip-bg: #21262d;
|
|
48945
49718
|
--hook-before-border: #7c3aed; --hook-after-border: #0e7490;
|
|
48946
49719
|
--hook-before-bg: #4c1d95; --hook-before-fg: #c4b5fd;
|
|
48947
49720
|
--hook-after-bg: #164e63; --hook-after-fg: #67e8f9;
|
|
48948
|
-
--link: #
|
|
49721
|
+
--link: #58a6ff;
|
|
48949
49722
|
}
|
|
48950
49723
|
html.light {
|
|
48951
49724
|
--bg: #ffffff; --bg-surface: #f6f8fa; --bg-panel: #ffffff;
|
|
48952
49725
|
--border: #d0d7de; --border-hover:#c4c9cf;
|
|
48953
|
-
--text: #1f2328; --text-bright: #1f2328; --text-muted: #656d76; --text-dim: #
|
|
49726
|
+
--text: #1f2328; --text-bright: #1f2328; --text-muted: #656d76; --text-dim: #6b7280;
|
|
48954
49727
|
--green: #1a7f37; --red: #cf222e; --amber: #9a6700; --blue: #0969da;
|
|
48955
49728
|
--badge-pass-bg: #dafbe1; --badge-fail-bg: #ffebe9; --badge-err-bg: #fff8c5; --badge-skip-bg: #f6f8fa;
|
|
48956
49729
|
--hook-before-border: #8b5cf6; --hook-after-border: #06b6d4;
|
|
@@ -50737,6 +51510,13 @@ function CollectionPanel() {
|
|
|
50737
51510
|
const disabled = Object.fromEntries(rows.filter((r) => !r.enabled && r.key.trim()).map((r) => [r.key.trim(), r.value]));
|
|
50738
51511
|
updateCollectionVariables(activeCollectionId, variables, disabled);
|
|
50739
51512
|
}
|
|
51513
|
+
function reseedVarRows() {
|
|
51514
|
+
const data = useStore$1.getState().collections[activeCollectionId ?? ""]?.data;
|
|
51515
|
+
setVarRows([
|
|
51516
|
+
...Object.entries(data?.collectionVariables ?? {}).map(([key, value2]) => ({ key, value: value2, enabled: true })),
|
|
51517
|
+
...Object.entries(data?.collectionVariablesDisabled ?? {}).map(([key, value2]) => ({ key, value: value2, enabled: false }))
|
|
51518
|
+
]);
|
|
51519
|
+
}
|
|
50740
51520
|
if (!activeCollectionId) {
|
|
50741
51521
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center h-full text-surface-400 text-sm", children: t("Select a request from the sidebar") });
|
|
50742
51522
|
}
|
|
@@ -50817,7 +51597,17 @@ function CollectionPanel() {
|
|
|
50817
51597
|
activeTab === "data" && /* @__PURE__ */ jsxRuntimeExports.jsx(DataSetEditor, { ds, onChange: setDs, exportName: col.name, scopeLabel: "collection" }),
|
|
50818
51598
|
activeTab === "variables" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 text-xs", children: [
|
|
50819
51599
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-surface-500", children: t("Variables scoped to this collection. They override environment and global variables, and are overridden by folder and request variables (and runtime / CLI / data-row values). Reference them anywhere with :token.", { token: "{{name}}" }) }),
|
|
50820
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51600
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51601
|
+
KVTable,
|
|
51602
|
+
{
|
|
51603
|
+
rows: varRows,
|
|
51604
|
+
onChange: setVars,
|
|
51605
|
+
keyPlaceholder: t("name"),
|
|
51606
|
+
valuePlaceholder: t("value"),
|
|
51607
|
+
moveFrom: () => activeCollectionId ? { kind: "collection", collectionId: activeCollectionId } : null,
|
|
51608
|
+
onMoved: reseedVarRows
|
|
51609
|
+
}
|
|
51610
|
+
),
|
|
50821
51611
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-surface-600 text-[11px]", children: [
|
|
50822
51612
|
t("Scripts can also set these at runtime via"),
|
|
50823
51613
|
" ",
|
|
@@ -50859,6 +51649,13 @@ function FolderPanel() {
|
|
|
50859
51649
|
const variablesDisabled = Object.fromEntries(rows.filter((r) => !r.enabled && r.key.trim()).map((r) => [r.key.trim(), r.value]));
|
|
50860
51650
|
updateFolder(cid, folder2.id, { variables, variablesDisabled });
|
|
50861
51651
|
}
|
|
51652
|
+
function reseedVarRows() {
|
|
51653
|
+
const f = useStore$1.getState().collections[cid]?.data && findFolder$1(useStore$1.getState().collections[cid].data.rootFolder, folder2.id);
|
|
51654
|
+
setVarRows([
|
|
51655
|
+
...Object.entries(f?.variables ?? {}).map(([key, value2]) => ({ key, value: value2, enabled: true })),
|
|
51656
|
+
...Object.entries(f?.variablesDisabled ?? {}).map(([key, value2]) => ({ key, value: value2, enabled: false }))
|
|
51657
|
+
]);
|
|
51658
|
+
}
|
|
50862
51659
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col h-full", children: [
|
|
50863
51660
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-6 py-4 border-b border-surface-800 flex-shrink-0 flex items-center justify-between", children: [
|
|
50864
51661
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
@@ -50909,7 +51706,17 @@ function FolderPanel() {
|
|
|
50909
51706
|
activeTab === "data" && /* @__PURE__ */ jsxRuntimeExports.jsx(DataSetEditor, { ds, onChange: (next) => updateFolder(cid, folder2.id, { dataSet: next }), exportName: folder2.name, scopeLabel: "folder" }),
|
|
50910
51707
|
activeTab === "variables" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
50911
51708
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] text-surface-500 leading-relaxed", children: t("Variables scoped to this folder. They override collection and environment variables, and are overridden by an inner folder, a request’s own variables, and runtime / CLI / data-row values. Reference them anywhere with :token.", { token: "{{name}}" }) }),
|
|
50912
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51709
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
51710
|
+
KVTable,
|
|
51711
|
+
{
|
|
51712
|
+
rows: varRows,
|
|
51713
|
+
onChange: setVars,
|
|
51714
|
+
keyPlaceholder: t("name"),
|
|
51715
|
+
valuePlaceholder: t("value"),
|
|
51716
|
+
moveFrom: () => ({ kind: "folder", collectionId: cid, folderId: folder2.id }),
|
|
51717
|
+
onMoved: reseedVarRows
|
|
51718
|
+
}
|
|
51719
|
+
)
|
|
50913
51720
|
] })
|
|
50914
51721
|
] })
|
|
50915
51722
|
] });
|
|
@@ -53351,6 +54158,7 @@ function detectPlatform(remotes) {
|
|
|
53351
54158
|
const NODE_LTS = "lts/*";
|
|
53352
54159
|
const PROVIDER_ENV = {
|
|
53353
54160
|
vault: ["VAULT_ADDR", "VAULT_ROLE_ID", "VAULT_SECRET_ID"],
|
|
54161
|
+
bao: ["BAO_ADDR", "BAO_ROLE_ID", "BAO_SECRET_ID"],
|
|
53354
54162
|
aws: ["AWS_REGION", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"],
|
|
53355
54163
|
azure: ["AZURE_TENANT_ID", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET"],
|
|
53356
54164
|
gcp: ["GCP_PROJECT", "GOOGLE_APPLICATION_CREDENTIALS_JSON"],
|
|
@@ -53359,10 +54167,10 @@ const PROVIDER_ENV = {
|
|
|
53359
54167
|
function secretManagerOf(ref) {
|
|
53360
54168
|
if (ref.startsWith("op://")) return "op";
|
|
53361
54169
|
const scheme = ref.split(":", 1)[0];
|
|
53362
|
-
if (scheme === "vault" || scheme === "aws" || scheme === "azure" || scheme === "gcp") return scheme;
|
|
54170
|
+
if (scheme === "vault" || scheme === "bao" || scheme === "aws" || scheme === "azure" || scheme === "gcp") return scheme;
|
|
53363
54171
|
return null;
|
|
53364
54172
|
}
|
|
53365
|
-
const INLINE_REF_RE = /\{\{\s*(vault:|aws:|azure:|gcp:|op:\/\/)/g;
|
|
54173
|
+
const INLINE_REF_RE = /\{\{\s*(vault:|bao:|aws:|azure:|gcp:|op:\/\/)/g;
|
|
53366
54174
|
function inlineSecretManagers(text) {
|
|
53367
54175
|
if (!text) return [];
|
|
53368
54176
|
const kinds = /* @__PURE__ */ new Set();
|
|
@@ -53606,7 +54414,7 @@ function ConflictEditor({ path, onClose, onResolved }) {
|
|
|
53606
54414
|
children: t("Edit manually")
|
|
53607
54415
|
}
|
|
53608
54416
|
),
|
|
53609
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "text-surface-400 hover:text-white text-lg leading-none pl-1", children: "×" })
|
|
54417
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, "aria-label": "Close", title: "Close", className: "text-surface-400 hover:text-white text-lg leading-none pl-1", children: "×" })
|
|
53610
54418
|
] })
|
|
53611
54419
|
] }),
|
|
53612
54420
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto min-h-0", children: [
|
|
@@ -53919,7 +54727,6 @@ function ChangesTab({ status, onRefresh }) {
|
|
|
53919
54727
|
"div",
|
|
53920
54728
|
{
|
|
53921
54729
|
className: `flex items-center gap-2 px-3 py-1 hover:bg-surface-800/50 cursor-pointer group text-xs ${diffFile === f.path && diffStaged ? "bg-surface-800" : ""}`,
|
|
53922
|
-
role: "button",
|
|
53923
54730
|
tabIndex: 0,
|
|
53924
54731
|
onClick: () => showDiff(f, true),
|
|
53925
54732
|
onKeyDown: onActivateKey(() => showDiff(f, true)),
|
|
@@ -53959,7 +54766,6 @@ function ChangesTab({ status, onRefresh }) {
|
|
|
53959
54766
|
"div",
|
|
53960
54767
|
{
|
|
53961
54768
|
className: `flex items-center gap-2 px-3 py-1 hover:bg-surface-800/50 cursor-pointer group text-xs ${diffFile === f.path && !diffStaged ? "bg-surface-800" : ""}`,
|
|
53962
|
-
role: "button",
|
|
53963
54769
|
tabIndex: 0,
|
|
53964
54770
|
onClick: () => showDiff(f, false),
|
|
53965
54771
|
onKeyDown: onActivateKey(() => showDiff(f, false)),
|
|
@@ -53989,7 +54795,6 @@ function ChangesTab({ status, onRefresh }) {
|
|
|
53989
54795
|
"div",
|
|
53990
54796
|
{
|
|
53991
54797
|
className: `flex items-center gap-2 px-3 py-1 hover:bg-surface-800/50 cursor-pointer group text-xs ${diffFile === path && !diffStaged ? "bg-surface-800" : ""}`,
|
|
53992
|
-
role: "button",
|
|
53993
54798
|
tabIndex: 0,
|
|
53994
54799
|
onClick: () => showDiff({ path, status: "modified" }, false),
|
|
53995
54800
|
onKeyDown: onActivateKey(() => showDiff({ path, status: "modified" }, false)),
|
|
@@ -55174,6 +55979,9 @@ function pretty(v) {
|
|
|
55174
55979
|
return esc(String(v));
|
|
55175
55980
|
}
|
|
55176
55981
|
}
|
|
55982
|
+
function headerLines(h) {
|
|
55983
|
+
return Object.entries(h).map(([k, v]) => `${k}: ${v}`).join("\n");
|
|
55984
|
+
}
|
|
55177
55985
|
const STATUS_CLS = {
|
|
55178
55986
|
passed: "badge-pass",
|
|
55179
55987
|
failed: "badge-fail",
|
|
@@ -55191,8 +55999,18 @@ function blockDetail(b) {
|
|
|
55191
55999
|
).join("");
|
|
55192
56000
|
parts.push(`<div class="section-label">Tests</div><div class="tests-wrap">${rows}</div>`);
|
|
55193
56001
|
}
|
|
55194
|
-
if (b.type === "request" && b.resolvedUrl) {
|
|
55195
|
-
|
|
56002
|
+
if (b.type === "request" && (b.resolvedUrl || b.http)) {
|
|
56003
|
+
const h = b.http;
|
|
56004
|
+
parts.push('<div class="section-label">Request</div>');
|
|
56005
|
+
if (b.resolvedUrl) parts.push(`<div class="mono url">${esc(b.method ?? "")} ${esc(b.resolvedUrl)}</div>`);
|
|
56006
|
+
if (h?.reqHeaders && Object.keys(h.reqHeaders).length) parts.push(`<pre class="code-block">${esc(headerLines(h.reqHeaders))}</pre>`);
|
|
56007
|
+
if (h?.reqBody) parts.push(`<pre class="code-block">${pretty(h.reqBody)}</pre>`);
|
|
56008
|
+
parts.push('<div class="section-label">Response</div>');
|
|
56009
|
+
const statusLine = b.httpStatus != null ? `${b.httpStatus}${h?.statusText ? " " + h.statusText : ""}${h?.bodySize != null ? ` · ${h.bodySize} bytes` : ""}` : "(no response received)";
|
|
56010
|
+
parts.push(`<div class="mono url">${esc(statusLine)}</div>`);
|
|
56011
|
+
if (h?.resHeaders && Object.keys(h.resHeaders).length) parts.push(`<pre class="code-block">${esc(headerLines(h.resHeaders))}</pre>`);
|
|
56012
|
+
if (h?.resBody) parts.push(`<pre class="code-block">${pretty(h.resBody)}</pre>`);
|
|
56013
|
+
if (h?.truncated) parts.push('<div class="muted" style="font-size:11px">Request/response body truncated for the report.</div>');
|
|
55196
56014
|
}
|
|
55197
56015
|
if (b.type === "log" && b.message) {
|
|
55198
56016
|
parts.push(`<div class="section-label">Message</div><pre class="code-block">${esc(b.message)}</pre>`);
|
|
@@ -55402,7 +56220,10 @@ function useFlowRunner() {
|
|
|
55402
56220
|
iteration: b.iteration,
|
|
55403
56221
|
atMs: b.atMs,
|
|
55404
56222
|
message: b.message,
|
|
55405
|
-
value: b.display
|
|
56223
|
+
value: b.display,
|
|
56224
|
+
method: b.method,
|
|
56225
|
+
resolvedUrl: b.resolvedUrl,
|
|
56226
|
+
http: b.http
|
|
55406
56227
|
}));
|
|
55407
56228
|
const rebuiltOutputs = summary2.blocks.filter((b) => b.type === "log" || b.type === "display").map((b) => b.type === "log" ? { kind: "log", blockId: b.blockId, message: b.message } : { kind: "display", blockId: b.blockId, value: b.display, label: b.label });
|
|
55408
56229
|
setState((prev) => ({
|
|
@@ -55853,10 +56674,11 @@ function AddBlockMenu({ onAdd: onAdd2 }) {
|
|
|
55853
56674
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute left-0 top-full mt-1 z-50 w-56 bg-surface-900 border border-surface-700 rounded-lg shadow-2xl max-h-[70vh] overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(BlockPickerList, { onPick: (type) => {
|
|
55854
56675
|
onAdd2(type);
|
|
55855
56676
|
setOpen(false);
|
|
55856
|
-
} }) })
|
|
56677
|
+
}, includeEnd: true }) })
|
|
55857
56678
|
] })
|
|
55858
56679
|
] });
|
|
55859
56680
|
}
|
|
56681
|
+
const headerText = (h) => Object.entries(h).map(([k, v]) => `${k}: ${v}`).join("\n");
|
|
55860
56682
|
const LOG_ICON = {
|
|
55861
56683
|
passed: "✓",
|
|
55862
56684
|
failed: "✗",
|
|
@@ -55893,6 +56715,15 @@ function formatLogText(log) {
|
|
|
55893
56715
|
function BottomPanel({ runner, flowName, problems, onFocusBlock, tab, setTab }) {
|
|
55894
56716
|
const t = useT();
|
|
55895
56717
|
const { outputs, variables, data, log, summary: summary2 } = runner;
|
|
56718
|
+
const [openLog, setOpenLog] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
56719
|
+
reactExports.useEffect(() => {
|
|
56720
|
+
if (!summary2) return;
|
|
56721
|
+
const fails = /* @__PURE__ */ new Set();
|
|
56722
|
+
log.forEach((e, i) => {
|
|
56723
|
+
if ((e.http || e.resolvedUrl) && (e.status === "failed" || e.status === "error")) fails.add(i);
|
|
56724
|
+
});
|
|
56725
|
+
setOpenLog(fails);
|
|
56726
|
+
}, [summary2]);
|
|
55896
56727
|
const varEntries = Object.entries(variables);
|
|
55897
56728
|
const dataEntries = Object.entries(data).filter(([k, v]) => typeof v === "object" && v !== null || !(k in variables));
|
|
55898
56729
|
const hasVars = varEntries.length > 0 || dataEntries.length > 0;
|
|
@@ -55967,24 +56798,63 @@ function BottomPanel({ runner, flowName, problems, onFocusBlock, tab, setTab })
|
|
|
55967
56798
|
": ",
|
|
55968
56799
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-300 break-all", children: typeof e.value === "string" ? e.value : JSON.stringify(e.value) })
|
|
55969
56800
|
] }, i);
|
|
55970
|
-
|
|
55971
|
-
|
|
55972
|
-
|
|
55973
|
-
|
|
55974
|
-
|
|
55975
|
-
|
|
55976
|
-
|
|
55977
|
-
|
|
55978
|
-
|
|
55979
|
-
|
|
55980
|
-
|
|
55981
|
-
|
|
55982
|
-
|
|
55983
|
-
|
|
55984
|
-
|
|
55985
|
-
|
|
55986
|
-
|
|
55987
|
-
|
|
56801
|
+
const hasDetail2 = !!(e.http || e.resolvedUrl);
|
|
56802
|
+
const open2 = openLog.has(i);
|
|
56803
|
+
const toggle = () => setOpenLog((s) => {
|
|
56804
|
+
const n2 = new Set(s);
|
|
56805
|
+
if (n2.has(i)) n2.delete(i);
|
|
56806
|
+
else n2.add(i);
|
|
56807
|
+
return n2;
|
|
56808
|
+
});
|
|
56809
|
+
const reqHeaders = e.http?.reqHeaders;
|
|
56810
|
+
const resHeaders = e.http?.resHeaders;
|
|
56811
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
|
|
56812
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
56813
|
+
"div",
|
|
56814
|
+
{
|
|
56815
|
+
className: `flex items-baseline gap-2 ${hasDetail2 ? "cursor-pointer hover:bg-surface-800/40 rounded" : ""}`,
|
|
56816
|
+
onClick: hasDetail2 ? toggle : void 0,
|
|
56817
|
+
children: [
|
|
56818
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-600 w-14 shrink-0 text-right", children: at }),
|
|
56819
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: LOG_ICON_CLS[e.status ?? "done"], children: LOG_ICON[e.status ?? "done"] ?? "•" }),
|
|
56820
|
+
hasDetail2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-surface-600 w-2 shrink-0", children: open2 ? "▾" : "▸" }),
|
|
56821
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-surface-300", children: [
|
|
56822
|
+
e.label ?? e.type,
|
|
56823
|
+
e.iteration != null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-surface-600", children: [
|
|
56824
|
+
" #",
|
|
56825
|
+
e.iteration
|
|
56826
|
+
] })
|
|
56827
|
+
] }),
|
|
56828
|
+
e.httpStatus != null && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: e.httpStatus < 400 ? "text-emerald-400" : "text-red-400", children: e.httpStatus }),
|
|
56829
|
+
e.durationMs != null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-surface-600", children: [
|
|
56830
|
+
e.durationMs,
|
|
56831
|
+
"ms"
|
|
56832
|
+
] }),
|
|
56833
|
+
e.error && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-red-400 break-all", children: [
|
|
56834
|
+
"— ",
|
|
56835
|
+
e.error
|
|
56836
|
+
] })
|
|
56837
|
+
]
|
|
56838
|
+
}
|
|
56839
|
+
),
|
|
56840
|
+
open2 && hasDetail2 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-16 mt-1 mb-2 flex flex-col gap-1 text-[10px]", children: [
|
|
56841
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-surface-500 uppercase tracking-wider", children: t("Request") }),
|
|
56842
|
+
e.resolvedUrl && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-surface-300 break-all", children: [
|
|
56843
|
+
e.method,
|
|
56844
|
+
" ",
|
|
56845
|
+
e.resolvedUrl
|
|
56846
|
+
] }),
|
|
56847
|
+
reqHeaders && Object.keys(reqHeaders).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "whitespace-pre-wrap break-all text-surface-400 bg-surface-900 rounded p-1.5 m-0", children: headerText(reqHeaders) }),
|
|
56848
|
+
e.http?.reqBody && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "whitespace-pre-wrap break-all text-surface-300 bg-surface-900 rounded p-1.5 m-0", children: e.http.reqBody }),
|
|
56849
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-surface-500 uppercase tracking-wider mt-1", children: t("Response") }),
|
|
56850
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: e.httpStatus != null && e.httpStatus < 400 ? "text-emerald-400" : "text-red-400", children: [
|
|
56851
|
+
e.httpStatus != null ? e.httpStatus : t("(no response)"),
|
|
56852
|
+
e.http?.statusText ? " " + e.http.statusText : "",
|
|
56853
|
+
e.http?.bodySize != null ? ` · ${e.http.bodySize} bytes` : ""
|
|
56854
|
+
] }),
|
|
56855
|
+
resHeaders && Object.keys(resHeaders).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "whitespace-pre-wrap break-all text-surface-400 bg-surface-900 rounded p-1.5 m-0", children: headerText(resHeaders) }),
|
|
56856
|
+
e.http?.resBody && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "whitespace-pre-wrap break-all text-surface-300 bg-surface-900 rounded p-1.5 m-0", children: e.http.resBody }),
|
|
56857
|
+
e.http?.truncated && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-surface-600", children: t("body truncated") })
|
|
55988
56858
|
] })
|
|
55989
56859
|
] }, i);
|
|
55990
56860
|
}) }) : active2 === "output" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1.5", children: outputs.map((o, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-mono", children: o.kind === "log" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-cyan-300", children: [
|
|
@@ -56872,17 +57742,17 @@ function ActivityBarBtn({
|
|
|
56872
57742
|
dataTour
|
|
56873
57743
|
}) {
|
|
56874
57744
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative group/ab", "data-tour": dataTour, children: [
|
|
56875
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
57745
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56876
57746
|
"button",
|
|
56877
57747
|
{
|
|
56878
57748
|
onClick,
|
|
57749
|
+
"aria-label": title,
|
|
57750
|
+
"aria-pressed": active2,
|
|
56879
57751
|
className: `relative w-10 h-10 flex items-center justify-center rounded transition-colors ${active2 ? "text-white bg-surface-800" : "text-surface-600 hover:text-surface-300 hover:bg-surface-800/50"}`,
|
|
56880
|
-
children:
|
|
56881
|
-
children2,
|
|
56882
|
-
badge !== void 0 && badge > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute top-1 right-1 text-[9px] bg-surface-600 text-white rounded-full w-3.5 h-3.5 flex items-center justify-center font-medium leading-none", children: badge > 9 ? "9+" : badge })
|
|
56883
|
-
]
|
|
57752
|
+
children: children2
|
|
56884
57753
|
}
|
|
56885
57754
|
),
|
|
57755
|
+
badge !== void 0 && badge > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", className: "pointer-events-none absolute top-1 right-1 text-[9px] bg-surface-600 text-white rounded-full w-3.5 h-3.5 flex items-center justify-center font-medium leading-none", children: badge > 9 ? "9+" : badge }),
|
|
56886
57756
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pointer-events-none absolute left-full top-1/2 -translate-y-1/2 ml-2 z-50 hidden group-hover/ab:block", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "whitespace-nowrap rounded px-2 py-1 text-[11px] bg-surface-900 text-[var(--text-primary)] border border-surface-700 shadow-lg", children: title }) })
|
|
56887
57757
|
] });
|
|
56888
57758
|
}
|
|
@@ -56907,35 +57777,45 @@ const TabRow = React.memo(function TabRow2({
|
|
|
56907
57777
|
onContextMenu
|
|
56908
57778
|
}) {
|
|
56909
57779
|
const t = useT();
|
|
56910
|
-
return
|
|
56911
|
-
|
|
56912
|
-
|
|
56913
|
-
|
|
56914
|
-
|
|
56915
|
-
|
|
56916
|
-
|
|
56917
|
-
|
|
56918
|
-
|
|
56919
|
-
|
|
56920
|
-
|
|
56921
|
-
|
|
56922
|
-
|
|
56923
|
-
|
|
56924
|
-
|
|
56925
|
-
|
|
56926
|
-
|
|
56927
|
-
|
|
56928
|
-
|
|
56929
|
-
|
|
56930
|
-
|
|
56931
|
-
}
|
|
56932
|
-
|
|
56933
|
-
|
|
56934
|
-
|
|
56935
|
-
|
|
56936
|
-
|
|
56937
|
-
|
|
56938
|
-
|
|
57780
|
+
return (
|
|
57781
|
+
// Plain container (no interactive role) so the activate + close buttons below
|
|
57782
|
+
// are siblings, not nested interactives — screen readers announce both.
|
|
57783
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
57784
|
+
"div",
|
|
57785
|
+
{
|
|
57786
|
+
onContextMenu: (e) => {
|
|
57787
|
+
e.preventDefault();
|
|
57788
|
+
onContextMenu(tabId, e.clientX, e.clientY);
|
|
57789
|
+
},
|
|
57790
|
+
className: `group flex items-center gap-1.5 pr-1 border-r border-surface-800 min-w-0 max-w-[200px] flex-shrink-0 transition-colors ${isActive ? "bg-surface-900 border-b-2 border-b-blue-500 -mb-px" : "hover:bg-surface-900/50 text-surface-600"}`,
|
|
57791
|
+
children: [
|
|
57792
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
57793
|
+
"button",
|
|
57794
|
+
{
|
|
57795
|
+
onClick: () => onActivate(tabId),
|
|
57796
|
+
className: "flex items-center gap-1.5 pl-3 py-1.5 min-w-0 flex-1 cursor-pointer focus:outline-none",
|
|
57797
|
+
children: [
|
|
57798
|
+
kind === "folder" ? /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3 h-3 shrink-0 text-amber-600", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M2 5a2 2 0 012-2h3.5l2 2H16a2 2 0 012 2v6a2 2 0 01-2 2H4a2 2 0 01-2-2V5z" }) }) : kind === "collection" ? /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className: "w-3 h-3 shrink-0 text-blue-400", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3 4h14v2.5H3V4zm0 4.75h14v2.5H3v-2.5zM3 13.5h14V16H3v-2.5z" }) }) : method ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-[10px] font-bold shrink-0 ${TAB_METHOD_COLORS[method] ?? "text-gray-400"}`, children: method }) : null,
|
|
57799
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `text-xs truncate ${isActive ? "text-white" : ""}`, children: name })
|
|
57800
|
+
]
|
|
57801
|
+
}
|
|
57802
|
+
),
|
|
57803
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57804
|
+
"button",
|
|
57805
|
+
{
|
|
57806
|
+
onClick: (e) => {
|
|
57807
|
+
e.stopPropagation();
|
|
57808
|
+
onClose(tabId);
|
|
57809
|
+
},
|
|
57810
|
+
className: "mr-2 opacity-0 group-hover:opacity-100 focus:opacity-100 shrink-0 text-surface-600 hover:text-white transition-all leading-none",
|
|
57811
|
+
"aria-label": t("Close tab"),
|
|
57812
|
+
title: t("Close tab"),
|
|
57813
|
+
children: "×"
|
|
57814
|
+
}
|
|
57815
|
+
)
|
|
57816
|
+
]
|
|
57817
|
+
}
|
|
57818
|
+
)
|
|
56939
57819
|
);
|
|
56940
57820
|
});
|
|
56941
57821
|
function App() {
|
|
@@ -57197,18 +58077,18 @@ function App() {
|
|
|
57197
58077
|
window.electron.platform !== "win32" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "drag-region flex-shrink-0 bg-surface-950 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "no-drag text-[11px] font-medium tracking-widest select-none", style: { color: "var(--text-muted)" }, children: [
|
|
57198
58078
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--wordmark-muted)" }, children: "API" }),
|
|
57199
58079
|
" ",
|
|
57200
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "
|
|
57201
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ml-2 text-[10px] font-normal
|
|
58080
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "var(--wordmark-accent)" }, children: "Spector" }),
|
|
58081
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ml-2 text-[10px] font-normal", style: { color: "var(--text-muted)" }, children: [
|
|
57202
58082
|
"v",
|
|
57203
|
-
"0.
|
|
58083
|
+
"0.9.1"
|
|
57204
58084
|
] }),
|
|
57205
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mx-2 opacity-30", children: "·" }),
|
|
58085
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mx-2 opacity-30", "aria-hidden": "true", children: "·" }),
|
|
57206
58086
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57207
58087
|
"button",
|
|
57208
58088
|
{
|
|
57209
58089
|
onClick: () => window.electron.openExternal("https://testsmith.io"),
|
|
57210
|
-
className: "no-drag text-[10px] font-normal
|
|
57211
|
-
style: { color: "
|
|
58090
|
+
className: "no-drag text-[10px] font-normal hover:underline focus:outline-none",
|
|
58091
|
+
style: { color: "var(--wordmark-accent)" },
|
|
57212
58092
|
children: "testsmith.io"
|
|
57213
58093
|
}
|
|
57214
58094
|
)
|
|
@@ -57512,42 +58392,44 @@ function App() {
|
|
|
57512
58392
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RequestBuilder, { request: activeRequest })
|
|
57513
58393
|
}
|
|
57514
58394
|
),
|
|
57515
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
57516
|
-
|
|
57517
|
-
|
|
57518
|
-
|
|
57519
|
-
|
|
57520
|
-
|
|
57521
|
-
|
|
57522
|
-
|
|
57523
|
-
|
|
57524
|
-
|
|
57525
|
-
|
|
57526
|
-
|
|
57527
|
-
|
|
57528
|
-
|
|
57529
|
-
|
|
57530
|
-
|
|
57531
|
-
},
|
|
57532
|
-
onKeyDown: (e) => {
|
|
57533
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
58395
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0 w-1 relative group", children: [
|
|
58396
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
58397
|
+
"div",
|
|
58398
|
+
{
|
|
58399
|
+
role: "separator",
|
|
58400
|
+
"aria-orientation": "vertical",
|
|
58401
|
+
"aria-label": "Resize request pane",
|
|
58402
|
+
"aria-valuemin": 200,
|
|
58403
|
+
"aria-valuenow": requestPaneWidth ?? leftPaneRef.current?.offsetWidth ?? 400,
|
|
58404
|
+
tabIndex: 0,
|
|
58405
|
+
className: "absolute inset-0 cursor-col-resize border-x border-surface-800 hover:border-blue-500 focus:border-blue-500 focus:outline-none transition-colors",
|
|
58406
|
+
onMouseDown: (e) => {
|
|
58407
|
+
dragging.current = "request";
|
|
58408
|
+
dragStart.current = { x: e.clientX, w: leftPaneRef.current?.offsetWidth ?? requestPaneWidth ?? 400 };
|
|
58409
|
+
document.body.style.cursor = "col-resize";
|
|
58410
|
+
document.body.style.userSelect = "none";
|
|
57534
58411
|
e.preventDefault();
|
|
57535
|
-
|
|
57536
|
-
|
|
57537
|
-
|
|
57538
|
-
|
|
57539
|
-
|
|
57540
|
-
|
|
57541
|
-
|
|
57542
|
-
|
|
57543
|
-
onClick: () => setResponseOpen((v) => !v),
|
|
57544
|
-
title: responseOpen ? t("Collapse response") : t("Expand response"),
|
|
57545
|
-
className: "absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 w-4 h-8 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 bg-surface-800 text-surface-400 hover:text-white transition-all text-xs z-10",
|
|
57546
|
-
children: responseOpen ? "›" : "‹"
|
|
58412
|
+
},
|
|
58413
|
+
onKeyDown: (e) => {
|
|
58414
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
58415
|
+
e.preventDefault();
|
|
58416
|
+
const step = e.key === "ArrowLeft" ? -16 : 16;
|
|
58417
|
+
const cur = leftPaneRef.current?.offsetWidth ?? requestPaneWidth ?? 400;
|
|
58418
|
+
setRequestPaneWidth(Math.max(200, Math.min(window.innerWidth - 300, cur + step)));
|
|
58419
|
+
}
|
|
57547
58420
|
}
|
|
57548
|
-
|
|
57549
|
-
|
|
57550
|
-
|
|
58421
|
+
}
|
|
58422
|
+
),
|
|
58423
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
58424
|
+
"button",
|
|
58425
|
+
{
|
|
58426
|
+
onClick: () => setResponseOpen((v) => !v),
|
|
58427
|
+
title: responseOpen ? t("Collapse response") : t("Expand response"),
|
|
58428
|
+
className: "absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 w-4 h-8 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 bg-surface-800 text-surface-400 hover:text-white transition-all text-xs z-10",
|
|
58429
|
+
children: responseOpen ? "›" : "‹"
|
|
58430
|
+
}
|
|
58431
|
+
)
|
|
58432
|
+
] }),
|
|
57551
58433
|
responseOpen && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57552
58434
|
"div",
|
|
57553
58435
|
{
|