@nice2dev/ui-api 1.4.8 → 1.4.9
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/CHANGELOG.md +36 -0
- package/README.md +44 -0
- package/dist/apiModelBridge.d.ts +16 -0
- package/dist/core/codegen.d.ts +16 -0
- package/dist/core/curl.d.ts +32 -0
- package/dist/core/detect.d.ts +19 -0
- package/dist/core/graphql.d.ts +74 -0
- package/dist/core/har.d.ts +19 -0
- package/dist/core/index.d.ts +22 -0
- package/dist/core/markdown.d.ts +29 -0
- package/dist/core/md5.d.ts +6 -0
- package/dist/core/mock.d.ts +25 -0
- package/dist/core/model.d.ts +332 -0
- package/dist/core/openapi.d.ts +27 -0
- package/dist/core/postman.d.ts +12 -0
- package/dist/core/transport.d.ts +122 -0
- package/dist/core/url.d.ts +23 -0
- package/dist/core/variables.d.ts +25 -0
- package/dist/core/wsdl.d.ts +62 -0
- package/dist/core/yaml.d.ts +20 -0
- package/dist/core.cjs +121 -0
- package/dist/core.mjs +4215 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1314 -1008
- package/package.json +8 -3
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { NiceAppShell as
|
|
3
|
-
import { useNiceTranslation as
|
|
4
|
-
import { useState as C, useCallback as I, useRef as
|
|
5
|
-
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { NiceAppShell as Te, NiceButton as U, NiceTextInput as L, NiceTextArea as ce, NiceSelect as se, NiceCheckbox as ke, NiceIcon as ee } from "@nice2dev/ui";
|
|
3
|
+
import { useNiceTranslation as O, NiceTutorialButton as le, resolveTutorial as de, NiceIcon as B, clickOnActivationKey as _e, createId as ae } from "@nice2dev/ui-core";
|
|
4
|
+
import { useState as C, useCallback as I, useRef as pe, useEffect as Ce, forwardRef as xe, useMemo as Ie } from "react";
|
|
5
|
+
import { exportOpenApi as Re, newApiCollection as qe, newApiRequest as Oe, setRequestUrl as Be, importOpenApi as $e, rowsToRecord as oe, isEnabled as ye, buildRequestUrl as ze, flattenApiRequests as je, newApiFolder as Ke } from "./core.mjs";
|
|
6
|
+
import { GRAPHQL_INTROSPECTION_QUERY as zt, NICE_API_AUTH_TYPES as jt, NICE_API_CODE_LANGUAGES as Kt, NICE_API_MARKDOWN_LABELS as Ht, NICE_API_METHODS as Ut, NiceYamlError as Mt, POSTMAN_SCHEMA_V21 as Lt, bodyContentType as Vt, bodyFromText as Ft, bodyText as Jt, buildAuthorizationUrl as Gt, buildGraphqlOperation as Wt, buildSoapEnvelope as Yt, collectionToMarkdown as Xt, createPkcePair as Qt, detectApiDocument as Zt, digest as ei, digestAuthorization as ti, effectiveAuth as ii, exchangeAuthorizationCode as ni, exportHar as ri, exportOpenApiYaml as ai, exportPostman as si, exportPostmanEnvironment as oi, fetchOAuth2Token as ci, fetchTransport as li, findApiItem as di, findVariables as pi, fromBase64 as ui, generateCode as mi, graphqlExampleValue as hi, graphqlOperations as gi, graphqlTypeName as bi, headerValue as _i, hmac as yi, importApiDocument as vi, importGraphqlIntrospection as fi, importHar as Ni, importPostman as wi, importPostmanEnvironment as Ti, importWsdl as ki, inferSchema as Ci, interpolate as Si, isCurlCommand as Ei, isHar as Pi, isPostmanCollection as Ai, joinUrl as Di, jsonPointer as xi, md5Hex as Ii, mockFromSchema as Ri, mockResponse as qi, namedType as Oi, newApiId as Bi, paramsIn as $i, parseCurl as zi, parseDigestChallenge as ji, parseFormEncoded as Ki, parseGraphqlIntrospection as Hi, parseJsonOrYaml as Ui, parseWsdl as Mi, parseYaml as Li, pathParamNames as Vi, pollDeviceToken as Fi, refreshOAuth2Token as Ji, requestName as Gi, resolvePlainScalar as Wi, resolveRequest as Yi, schemaResolver as Xi, sendApiRequest as Qi, signAwsV4 as Zi, signHmac as en, splitUrl as tn, startDeviceAuthorization as nn, stringifyYaml as rn, swagger2ToOpenApi3 as an, syncPathParams as sn, toBase64 as on, toCurl as cn, tokenizeCommand as ln, unresolvedVariables as dn, updateApiItem as pn, variableScope as un } from "./core.mjs";
|
|
7
|
+
const He = [
|
|
6
8
|
{
|
|
7
9
|
target: ".nice-api-designer",
|
|
8
10
|
titleKey: "tutorial.apiDesigner.intro.title",
|
|
@@ -11,7 +13,7 @@ const Pe = [
|
|
|
11
13
|
content: "Define endpoints, parameters, request/response schemas and security for your OpenAPI document.",
|
|
12
14
|
placement: "auto"
|
|
13
15
|
}
|
|
14
|
-
],
|
|
16
|
+
], ve = {
|
|
15
17
|
openapi: "3.0.3",
|
|
16
18
|
info: {
|
|
17
19
|
title: "Pet Store API",
|
|
@@ -113,52 +115,52 @@ const Pe = [
|
|
|
113
115
|
}
|
|
114
116
|
},
|
|
115
117
|
tags: [{ name: "pets", description: "Pet operations" }]
|
|
116
|
-
},
|
|
118
|
+
}, Se = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Ue = [
|
|
117
119
|
"object",
|
|
118
120
|
"array",
|
|
119
121
|
"string",
|
|
120
122
|
"number",
|
|
121
123
|
"integer",
|
|
122
124
|
"boolean"
|
|
123
|
-
],
|
|
124
|
-
function
|
|
125
|
-
var
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
|
|
125
|
+
], Me = ["query", "path", "header", "cookie"], Le = ["apiKey", "http", "oauth2", "openIdConnect"];
|
|
126
|
+
function me(e) {
|
|
127
|
+
var r, i;
|
|
128
|
+
const n = [];
|
|
129
|
+
return e.openapi || n.push({ path: "openapi", message: "OpenAPI version is required", severity: "error" }), (r = e.info) != null && r.title || n.push({ path: "info.title", message: "API title is required", severity: "error" }), (i = e.info) != null && i.version || n.push({ path: "info.version", message: "API version is required", severity: "error" }), Object.entries(e.paths || {}).forEach(([a, c]) => {
|
|
130
|
+
a.startsWith("/") || n.push({ path: `paths.${a}`, message: "Path must start with /", severity: "error" }), Se.forEach((l) => {
|
|
129
131
|
const d = c[l.toLowerCase()];
|
|
130
|
-
d && !d.responses &&
|
|
131
|
-
path: `paths.${
|
|
132
|
+
d && !d.responses && n.push({
|
|
133
|
+
path: `paths.${a}.${l.toLowerCase()}.responses`,
|
|
132
134
|
message: "Responses are required",
|
|
133
135
|
severity: "error"
|
|
134
136
|
});
|
|
135
137
|
});
|
|
136
|
-
}),
|
|
138
|
+
}), n;
|
|
137
139
|
}
|
|
138
|
-
const
|
|
139
|
-
value: String(
|
|
140
|
-
label: String(
|
|
140
|
+
const fe = /* @__PURE__ */ Ue.map((e) => ({
|
|
141
|
+
value: String(e),
|
|
142
|
+
label: String(e)
|
|
141
143
|
}));
|
|
142
|
-
function
|
|
143
|
-
schema:
|
|
144
|
-
onChange:
|
|
145
|
-
onSave:
|
|
144
|
+
function Et({
|
|
145
|
+
schema: e,
|
|
146
|
+
onChange: n,
|
|
147
|
+
onSave: r,
|
|
146
148
|
readOnly: i = !1,
|
|
147
|
-
className:
|
|
149
|
+
className: a = "",
|
|
148
150
|
tutorial: c
|
|
149
151
|
}) {
|
|
150
|
-
var V,
|
|
151
|
-
const { t: l } =
|
|
152
|
-
() =>
|
|
152
|
+
var V, W;
|
|
153
|
+
const { t: l } = O(), [d, p] = C(e || ve), [y, u] = C("/pets"), [N, _] = C("get"), [v, T] = C("paths"), [h, S] = C(
|
|
154
|
+
() => me(e || ve)
|
|
153
155
|
), w = I(
|
|
154
156
|
(k) => {
|
|
155
157
|
p((f) => {
|
|
156
158
|
const x = k(f);
|
|
157
|
-
return
|
|
159
|
+
return n == null || n(x), S(me(x)), x;
|
|
158
160
|
});
|
|
159
161
|
},
|
|
160
|
-
[
|
|
161
|
-
),
|
|
162
|
+
[n]
|
|
163
|
+
), D = I(() => {
|
|
162
164
|
const k = "/new-endpoint";
|
|
163
165
|
w((f) => ({
|
|
164
166
|
...f,
|
|
@@ -169,21 +171,21 @@ function ct({
|
|
|
169
171
|
get: { summary: "New endpoint", responses: { 200: { description: "Success" } } }
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
|
-
})), u(k),
|
|
174
|
+
})), u(k), _("get");
|
|
173
175
|
}, [w]), J = I(
|
|
174
176
|
(k) => {
|
|
175
177
|
w((f) => {
|
|
176
|
-
const { [k]: x, ...
|
|
177
|
-
return { ...f, paths:
|
|
178
|
-
}), u(null),
|
|
178
|
+
const { [k]: x, ...j } = f.paths;
|
|
179
|
+
return { ...f, paths: j };
|
|
180
|
+
}), u(null), _(null);
|
|
179
181
|
},
|
|
180
182
|
[w]
|
|
181
183
|
), te = I(() => {
|
|
182
184
|
let k = "NewSchema";
|
|
183
185
|
w((f) => {
|
|
184
|
-
var
|
|
186
|
+
var j, F, R;
|
|
185
187
|
let x = 1;
|
|
186
|
-
for (; (F = (
|
|
188
|
+
for (; (F = (j = f.components) == null ? void 0 : j.schemas) != null && F[k]; )
|
|
187
189
|
k = `NewSchema${x++}`;
|
|
188
190
|
return {
|
|
189
191
|
...f,
|
|
@@ -193,55 +195,55 @@ function ct({
|
|
|
193
195
|
}
|
|
194
196
|
};
|
|
195
197
|
});
|
|
196
|
-
}, [w]),
|
|
197
|
-
const k =
|
|
198
|
-
S(k), k.filter((f) => f.severity === "error").length === 0 && (
|
|
199
|
-
}, [d,
|
|
200
|
-
([k, f]) =>
|
|
198
|
+
}, [w]), $ = I(() => {
|
|
199
|
+
const k = me(d);
|
|
200
|
+
S(k), k.filter((f) => f.severity === "error").length === 0 && (r == null || r(d));
|
|
201
|
+
}, [d, r]), M = Object.entries(d.paths).flatMap(
|
|
202
|
+
([k, f]) => Se.filter((x) => f[x.toLowerCase()]).map(
|
|
201
203
|
(x) => ({
|
|
202
204
|
path: k,
|
|
203
205
|
method: x,
|
|
204
206
|
operation: f[x.toLowerCase()]
|
|
205
207
|
})
|
|
206
208
|
)
|
|
207
|
-
),
|
|
208
|
-
return /* @__PURE__ */
|
|
209
|
-
c && /* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
209
|
+
), z = ["info", "paths", "schemas", "security", "preview"];
|
|
210
|
+
return /* @__PURE__ */ s("div", { style: { position: "relative", height: "100%" }, children: [
|
|
211
|
+
c && /* @__PURE__ */ t("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ t(le, { steps: de(c, He) }) }),
|
|
212
|
+
/* @__PURE__ */ t(
|
|
213
|
+
Te,
|
|
212
214
|
{
|
|
213
215
|
flush: !0,
|
|
214
|
-
className: `nice-api-designer ${
|
|
216
|
+
className: `nice-api-designer ${a}`,
|
|
215
217
|
height: "100%",
|
|
216
218
|
style: { minHeight: 600 },
|
|
217
|
-
toolbar: /* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
+
toolbar: /* @__PURE__ */ s("div", { className: "nice-api-designer__toolbar", children: [
|
|
220
|
+
/* @__PURE__ */ t("div", { className: "nice-api-designer__tabs", children: z.map((k) => /* @__PURE__ */ t(
|
|
219
221
|
U,
|
|
220
222
|
{
|
|
221
223
|
size: "sm",
|
|
222
|
-
variant:
|
|
224
|
+
variant: v === k ? "primary" : "ghost",
|
|
223
225
|
onClick: () => T(k),
|
|
224
226
|
children: k.charAt(0).toUpperCase() + k.slice(1)
|
|
225
227
|
},
|
|
226
228
|
k
|
|
227
229
|
)) }),
|
|
228
|
-
!i && /* @__PURE__ */
|
|
230
|
+
!i && /* @__PURE__ */ t(
|
|
229
231
|
U,
|
|
230
232
|
{
|
|
231
233
|
size: "sm",
|
|
232
234
|
variant: "primary",
|
|
233
|
-
leftIcon: /* @__PURE__ */
|
|
234
|
-
onClick:
|
|
235
|
+
leftIcon: /* @__PURE__ */ t(B, { name: "check", size: 14 }),
|
|
236
|
+
onClick: $,
|
|
235
237
|
children: l("apiDesigner.save", "Save")
|
|
236
238
|
}
|
|
237
239
|
)
|
|
238
240
|
] }),
|
|
239
|
-
bottomPanel:
|
|
241
|
+
bottomPanel: h.length > 0 ? /* @__PURE__ */ t("div", { className: "nice-api-designer__errors", children: h.map((k, f) => /* @__PURE__ */ s(
|
|
240
242
|
"div",
|
|
241
243
|
{
|
|
242
244
|
className: `nice-api-designer__error nice-api-designer__error--${k.severity}`,
|
|
243
245
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ s("strong", { children: [
|
|
245
247
|
k.path,
|
|
246
248
|
":"
|
|
247
249
|
] }),
|
|
@@ -251,26 +253,26 @@ function ct({
|
|
|
251
253
|
},
|
|
252
254
|
f
|
|
253
255
|
)) }) : void 0,
|
|
254
|
-
children: /* @__PURE__ */
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
children: /* @__PURE__ */ s("div", { className: "nice-api-designer__content", children: [
|
|
257
|
+
v === "info" && /* @__PURE__ */ t(Ve, { schema: d, onChange: w, readOnly: i }),
|
|
258
|
+
v === "paths" && /* @__PURE__ */ t(
|
|
259
|
+
Fe,
|
|
258
260
|
{
|
|
259
261
|
endpoints: M,
|
|
260
262
|
schema: d,
|
|
261
|
-
selectedPath:
|
|
263
|
+
selectedPath: y,
|
|
262
264
|
selectedMethod: N,
|
|
263
265
|
onSelectEndpoint: (k, f) => {
|
|
264
|
-
u(k),
|
|
266
|
+
u(k), _(f);
|
|
265
267
|
},
|
|
266
|
-
onAdd:
|
|
268
|
+
onAdd: D,
|
|
267
269
|
onDelete: J,
|
|
268
270
|
onChange: w,
|
|
269
271
|
readOnly: i
|
|
270
272
|
}
|
|
271
273
|
),
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
v === "schemas" && /* @__PURE__ */ t(
|
|
275
|
+
Je,
|
|
274
276
|
{
|
|
275
277
|
schemas: ((V = d.components) == null ? void 0 : V.schemas) || {},
|
|
276
278
|
onAdd: te,
|
|
@@ -281,10 +283,10 @@ function ct({
|
|
|
281
283
|
readOnly: i
|
|
282
284
|
}
|
|
283
285
|
),
|
|
284
|
-
|
|
285
|
-
|
|
286
|
+
v === "security" && /* @__PURE__ */ t(
|
|
287
|
+
Ge,
|
|
286
288
|
{
|
|
287
|
-
schemes: ((
|
|
289
|
+
schemes: ((W = d.components) == null ? void 0 : W.securitySchemes) || {},
|
|
288
290
|
onChange: (k) => w((f) => ({
|
|
289
291
|
...f,
|
|
290
292
|
components: { ...f.components, securitySchemes: k }
|
|
@@ -292,167 +294,167 @@ function ct({
|
|
|
292
294
|
readOnly: i
|
|
293
295
|
}
|
|
294
296
|
),
|
|
295
|
-
|
|
297
|
+
v === "preview" && /* @__PURE__ */ t(We, { schema: d })
|
|
296
298
|
] })
|
|
297
299
|
}
|
|
298
300
|
)
|
|
299
301
|
] });
|
|
300
302
|
}
|
|
301
|
-
function
|
|
302
|
-
const { t: i } =
|
|
303
|
-
return /* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
303
|
+
function Ve({ schema: e, onChange: n, readOnly: r }) {
|
|
304
|
+
const { t: i } = O();
|
|
305
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-designer__info-editor", children: [
|
|
306
|
+
/* @__PURE__ */ t("h3", { children: i("apiDesigner.apiInformation", "API information") }),
|
|
307
|
+
/* @__PURE__ */ t(
|
|
306
308
|
L,
|
|
307
309
|
{
|
|
308
310
|
label: i("apiDesigner.title", "Title"),
|
|
309
|
-
value:
|
|
310
|
-
onChange: (
|
|
311
|
-
readOnly:
|
|
311
|
+
value: e.info.title,
|
|
312
|
+
onChange: (a) => n((c) => ({ ...c, info: { ...c.info, title: a } })),
|
|
313
|
+
readOnly: r
|
|
312
314
|
}
|
|
313
315
|
),
|
|
314
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ t(
|
|
315
317
|
L,
|
|
316
318
|
{
|
|
317
319
|
label: i("apiDesigner.version", "Version"),
|
|
318
|
-
value:
|
|
319
|
-
onChange: (
|
|
320
|
-
readOnly:
|
|
320
|
+
value: e.info.version,
|
|
321
|
+
onChange: (a) => n((c) => ({ ...c, info: { ...c.info, version: a } })),
|
|
322
|
+
readOnly: r
|
|
321
323
|
}
|
|
322
324
|
),
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
|
|
325
|
+
/* @__PURE__ */ t(
|
|
326
|
+
ce,
|
|
325
327
|
{
|
|
326
328
|
label: i("apiDesigner.description", "Description"),
|
|
327
|
-
value:
|
|
328
|
-
onChange: (
|
|
329
|
-
readOnly:
|
|
329
|
+
value: e.info.description || "",
|
|
330
|
+
onChange: (a) => n((c) => ({ ...c, info: { ...c.info, description: a } })),
|
|
331
|
+
readOnly: r,
|
|
330
332
|
rows: 4
|
|
331
333
|
}
|
|
332
334
|
),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
(
|
|
335
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ t("h4", { children: i("apiDesigner.servers", "Servers") }),
|
|
336
|
+
(e.servers || []).map((a, c) => /* @__PURE__ */ s("div", { className: "nice-api-designer__server", children: [
|
|
337
|
+
/* @__PURE__ */ t(
|
|
336
338
|
L,
|
|
337
339
|
{
|
|
338
|
-
value:
|
|
340
|
+
value: a.url,
|
|
339
341
|
placeholder: i("apiDesigner.serverUrl", "Server URL"),
|
|
340
|
-
onChange: (l) =>
|
|
342
|
+
onChange: (l) => n((d) => {
|
|
341
343
|
var p;
|
|
342
344
|
return {
|
|
343
345
|
...d,
|
|
344
|
-
servers: (p = d.servers) == null ? void 0 : p.map((
|
|
346
|
+
servers: (p = d.servers) == null ? void 0 : p.map((y, u) => u === c ? { ...y, url: l } : y)
|
|
345
347
|
};
|
|
346
348
|
}),
|
|
347
|
-
readOnly:
|
|
349
|
+
readOnly: r
|
|
348
350
|
}
|
|
349
351
|
),
|
|
350
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ t(
|
|
351
353
|
L,
|
|
352
354
|
{
|
|
353
|
-
value:
|
|
355
|
+
value: a.description || "",
|
|
354
356
|
placeholder: i("apiDesigner.description", "Description"),
|
|
355
|
-
onChange: (l) =>
|
|
357
|
+
onChange: (l) => n((d) => {
|
|
356
358
|
var p;
|
|
357
359
|
return {
|
|
358
360
|
...d,
|
|
359
|
-
servers: (p = d.servers) == null ? void 0 : p.map((
|
|
361
|
+
servers: (p = d.servers) == null ? void 0 : p.map((y, u) => u === c ? { ...y, description: l } : y)
|
|
360
362
|
};
|
|
361
363
|
}),
|
|
362
|
-
readOnly:
|
|
364
|
+
readOnly: r
|
|
363
365
|
}
|
|
364
366
|
),
|
|
365
|
-
!
|
|
367
|
+
!r && /* @__PURE__ */ t(
|
|
366
368
|
U,
|
|
367
369
|
{
|
|
368
370
|
size: "sm",
|
|
369
371
|
variant: "ghost",
|
|
370
|
-
onClick: () =>
|
|
372
|
+
onClick: () => n((l) => {
|
|
371
373
|
var d;
|
|
372
374
|
return {
|
|
373
375
|
...l,
|
|
374
|
-
servers: (d = l.servers) == null ? void 0 : d.filter((p,
|
|
376
|
+
servers: (d = l.servers) == null ? void 0 : d.filter((p, y) => y !== c)
|
|
375
377
|
};
|
|
376
378
|
}),
|
|
377
379
|
"aria-label": i("apiDesigner.removeServer", "Remove server"),
|
|
378
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 14 })
|
|
379
381
|
}
|
|
380
382
|
)
|
|
381
383
|
] }, c)),
|
|
382
|
-
!
|
|
384
|
+
!r && /* @__PURE__ */ t(
|
|
383
385
|
U,
|
|
384
386
|
{
|
|
385
387
|
size: "sm",
|
|
386
388
|
variant: "outline",
|
|
387
|
-
leftIcon: /* @__PURE__ */
|
|
388
|
-
onClick: () =>
|
|
389
|
-
...
|
|
390
|
-
servers: [...
|
|
389
|
+
leftIcon: /* @__PURE__ */ t(B, { name: "plus", size: 14 }),
|
|
390
|
+
onClick: () => n((a) => ({
|
|
391
|
+
...a,
|
|
392
|
+
servers: [...a.servers || [], { url: "https://api.example.com" }]
|
|
391
393
|
})),
|
|
392
394
|
children: i("apiDesigner.addServer", "Add server")
|
|
393
395
|
}
|
|
394
396
|
)
|
|
395
397
|
] });
|
|
396
398
|
}
|
|
397
|
-
function
|
|
398
|
-
endpoints:
|
|
399
|
-
schema:
|
|
400
|
-
selectedPath:
|
|
399
|
+
function Fe({
|
|
400
|
+
endpoints: e,
|
|
401
|
+
schema: n,
|
|
402
|
+
selectedPath: r,
|
|
401
403
|
selectedMethod: i,
|
|
402
|
-
onSelectEndpoint:
|
|
404
|
+
onSelectEndpoint: a,
|
|
403
405
|
onAdd: c,
|
|
404
406
|
onDelete: l,
|
|
405
407
|
onChange: d,
|
|
406
408
|
readOnly: p
|
|
407
409
|
}) {
|
|
408
|
-
var
|
|
409
|
-
const { t:
|
|
410
|
-
!
|
|
411
|
-
...
|
|
410
|
+
var v;
|
|
411
|
+
const { t: y } = O(), u = r && i ? (v = n.paths[r]) == null ? void 0 : v[i] : null, N = (T) => {
|
|
412
|
+
!r || !i || !u || d((h) => ({
|
|
413
|
+
...h,
|
|
412
414
|
paths: {
|
|
413
|
-
...
|
|
414
|
-
[
|
|
415
|
-
...
|
|
415
|
+
...h.paths,
|
|
416
|
+
[r]: {
|
|
417
|
+
...h.paths[r],
|
|
416
418
|
[i]: { ...u, ...T }
|
|
417
419
|
}
|
|
418
420
|
}
|
|
419
421
|
}));
|
|
420
|
-
},
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
!p && /* @__PURE__ */
|
|
426
|
-
/* @__PURE__ */
|
|
422
|
+
}, _ = (u == null ? void 0 : u.parameters) ?? [];
|
|
423
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-designer__paths-editor", children: [
|
|
424
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__endpoints-list", children: [
|
|
425
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__list-header", children: [
|
|
426
|
+
/* @__PURE__ */ t("h3", { children: y("apiDesigner.endpoints", "Endpoints") }),
|
|
427
|
+
!p && /* @__PURE__ */ s(U, { size: "sm", variant: "ghost", onClick: c, children: [
|
|
428
|
+
/* @__PURE__ */ t(B, { name: "plus", size: 14 }),
|
|
427
429
|
" ",
|
|
428
|
-
|
|
430
|
+
y("apiDesigner.add", "Add")
|
|
429
431
|
] })
|
|
430
432
|
] }),
|
|
431
|
-
|
|
433
|
+
e.map(({ path: T, method: h }) => /* @__PURE__ */ s(
|
|
432
434
|
"div",
|
|
433
435
|
{
|
|
434
436
|
role: "button",
|
|
435
437
|
tabIndex: 0,
|
|
436
|
-
onKeyDown:
|
|
437
|
-
className: `nice-api-designer__endpoint ${
|
|
438
|
-
onClick: () =>
|
|
438
|
+
onKeyDown: _e,
|
|
439
|
+
className: `nice-api-designer__endpoint ${r === T && i === h.toLowerCase() ? "nice-api-designer__endpoint--selected" : ""}`,
|
|
440
|
+
onClick: () => a(T, h.toLowerCase()),
|
|
439
441
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ t(
|
|
441
443
|
"span",
|
|
442
444
|
{
|
|
443
|
-
className: `nice-api-designer__method nice-api-designer__method--${
|
|
444
|
-
children:
|
|
445
|
+
className: `nice-api-designer__method nice-api-designer__method--${h.toLowerCase()}`,
|
|
446
|
+
children: h
|
|
445
447
|
}
|
|
446
448
|
),
|
|
447
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ t("span", { className: "nice-api-designer__path", children: T })
|
|
448
450
|
]
|
|
449
451
|
},
|
|
450
|
-
`${
|
|
452
|
+
`${h}-${T}`
|
|
451
453
|
))
|
|
452
454
|
] }),
|
|
453
|
-
u &&
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
455
|
+
u && r && i && /* @__PURE__ */ s("div", { className: "nice-api-designer__operation-editor", children: [
|
|
456
|
+
/* @__PURE__ */ s("h3", { children: [
|
|
457
|
+
/* @__PURE__ */ t(
|
|
456
458
|
"span",
|
|
457
459
|
{
|
|
458
460
|
className: `nice-api-designer__method nice-api-designer__method--${i}`,
|
|
@@ -460,269 +462,269 @@ function Re({
|
|
|
460
462
|
}
|
|
461
463
|
),
|
|
462
464
|
" ",
|
|
463
|
-
|
|
465
|
+
r
|
|
464
466
|
] }),
|
|
465
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ t(
|
|
466
468
|
L,
|
|
467
469
|
{
|
|
468
|
-
label:
|
|
470
|
+
label: y("apiDesigner.summary", "Summary"),
|
|
469
471
|
value: u.summary || "",
|
|
470
472
|
onChange: (T) => N({ summary: T }),
|
|
471
473
|
readOnly: p
|
|
472
474
|
}
|
|
473
475
|
),
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
|
|
476
|
+
/* @__PURE__ */ t(
|
|
477
|
+
ce,
|
|
476
478
|
{
|
|
477
|
-
label:
|
|
479
|
+
label: y("apiDesigner.description", "Description"),
|
|
478
480
|
value: u.description || "",
|
|
479
481
|
onChange: (T) => N({ description: T }),
|
|
480
482
|
readOnly: p,
|
|
481
483
|
rows: 3
|
|
482
484
|
}
|
|
483
485
|
),
|
|
484
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ t(
|
|
485
487
|
L,
|
|
486
488
|
{
|
|
487
|
-
label:
|
|
489
|
+
label: y("apiDesigner.operationId", "Operation ID"),
|
|
488
490
|
value: u.operationId || "",
|
|
489
491
|
onChange: (T) => N({ operationId: T }),
|
|
490
492
|
readOnly: p
|
|
491
493
|
}
|
|
492
494
|
),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
!p && /* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__subhead", children: [
|
|
496
|
+
/* @__PURE__ */ t("h4", { children: y("apiDesigner.parameters", "Parameters") }),
|
|
497
|
+
!p && /* @__PURE__ */ s(
|
|
496
498
|
U,
|
|
497
499
|
{
|
|
498
500
|
size: "sm",
|
|
499
501
|
variant: "ghost",
|
|
500
502
|
onClick: () => N({
|
|
501
503
|
parameters: [
|
|
502
|
-
...
|
|
504
|
+
..._,
|
|
503
505
|
{ name: "param", in: "query", required: !1, schema: { type: "string" } }
|
|
504
506
|
]
|
|
505
507
|
}),
|
|
506
508
|
children: [
|
|
507
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ t(B, { name: "plus", size: 14 }),
|
|
508
510
|
" ",
|
|
509
|
-
|
|
511
|
+
y("apiDesigner.add", "Add")
|
|
510
512
|
]
|
|
511
513
|
}
|
|
512
514
|
)
|
|
513
515
|
] }),
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
/* @__PURE__ */
|
|
516
|
+
_.length === 0 && /* @__PURE__ */ t("p", { className: "nice-api-designer__muted", children: y("apiDesigner.noParameters", "No parameters.") }),
|
|
517
|
+
_.map((T, h) => /* @__PURE__ */ s("div", { className: "nice-api-designer__param-row", children: [
|
|
518
|
+
/* @__PURE__ */ t(
|
|
517
519
|
L,
|
|
518
520
|
{
|
|
519
521
|
size: "sm",
|
|
520
522
|
value: T.name,
|
|
521
523
|
placeholder: "name",
|
|
522
|
-
onChange: (S) => N({ parameters:
|
|
524
|
+
onChange: (S) => N({ parameters: _.map((w, D) => D === h ? { ...w, name: S } : w) }),
|
|
523
525
|
readOnly: p
|
|
524
526
|
}
|
|
525
527
|
),
|
|
526
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ t(
|
|
527
529
|
se,
|
|
528
530
|
{
|
|
529
531
|
size: "sm",
|
|
530
532
|
value: T.in,
|
|
531
|
-
options:
|
|
533
|
+
options: Me.map((S) => ({ value: String(S), label: String(S) })),
|
|
532
534
|
onChange: (S) => N({
|
|
533
|
-
parameters:
|
|
534
|
-
(w,
|
|
535
|
+
parameters: _.map(
|
|
536
|
+
(w, D) => D === h ? { ...w, in: S } : w
|
|
535
537
|
)
|
|
536
538
|
})
|
|
537
539
|
}
|
|
538
540
|
),
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
|
|
541
|
+
/* @__PURE__ */ t(
|
|
542
|
+
ke,
|
|
541
543
|
{
|
|
542
544
|
checked: !!T.required,
|
|
543
545
|
onChange: (S) => N({
|
|
544
|
-
parameters:
|
|
546
|
+
parameters: _.map((w, D) => D === h ? { ...w, required: S } : w)
|
|
545
547
|
}),
|
|
546
548
|
label: "required"
|
|
547
549
|
}
|
|
548
550
|
),
|
|
549
|
-
!p && /* @__PURE__ */
|
|
551
|
+
!p && /* @__PURE__ */ t(
|
|
550
552
|
U,
|
|
551
553
|
{
|
|
552
554
|
size: "sm",
|
|
553
555
|
variant: "ghost",
|
|
554
|
-
onClick: () => N({ parameters:
|
|
555
|
-
"aria-label":
|
|
556
|
+
onClick: () => N({ parameters: _.filter((S, w) => w !== h) }),
|
|
557
|
+
"aria-label": y("apiDesigner.remove", "Remove {name}").replace(
|
|
556
558
|
"{name}",
|
|
557
559
|
String(T.name)
|
|
558
560
|
),
|
|
559
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 14 })
|
|
560
562
|
}
|
|
561
563
|
)
|
|
562
|
-
] },
|
|
563
|
-
!p && /* @__PURE__ */
|
|
564
|
+
] }, h)),
|
|
565
|
+
!p && /* @__PURE__ */ t(
|
|
564
566
|
U,
|
|
565
567
|
{
|
|
566
568
|
className: "nice-api-designer__delete-btn",
|
|
567
569
|
size: "sm",
|
|
568
570
|
variant: "danger",
|
|
569
|
-
leftIcon: /* @__PURE__ */
|
|
570
|
-
onClick: () => l(
|
|
571
|
-
children:
|
|
571
|
+
leftIcon: /* @__PURE__ */ t(B, { name: "trash", size: 14 }),
|
|
572
|
+
onClick: () => l(r),
|
|
573
|
+
children: y("apiDesigner.deleteEndpoint", "Delete endpoint")
|
|
572
574
|
}
|
|
573
575
|
)
|
|
574
576
|
] })
|
|
575
577
|
] });
|
|
576
578
|
}
|
|
577
|
-
function
|
|
578
|
-
schemas:
|
|
579
|
-
onAdd:
|
|
580
|
-
onChange:
|
|
579
|
+
function Je({
|
|
580
|
+
schemas: e,
|
|
581
|
+
onAdd: n,
|
|
582
|
+
onChange: r,
|
|
581
583
|
readOnly: i
|
|
582
584
|
}) {
|
|
583
|
-
const { t:
|
|
584
|
-
!l || !p ||
|
|
585
|
-
}, N = (
|
|
586
|
-
u({ properties: { ...
|
|
585
|
+
const { t: a } = O(), c = Object.keys(e), [l, d] = C(c[0] ?? null), p = l ? e[l] : null, y = (p == null ? void 0 : p.properties) ?? {}, u = (_) => {
|
|
586
|
+
!l || !p || r({ ...e, [l]: { ...p, ..._ } });
|
|
587
|
+
}, N = (_, v) => {
|
|
588
|
+
u({ properties: { ...y, [_]: v } });
|
|
587
589
|
};
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
!i && /* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
590
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-designer__schemas-editor", children: [
|
|
591
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__schemas-list", children: [
|
|
592
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__list-header", children: [
|
|
593
|
+
/* @__PURE__ */ t("h3", { children: a("apiDesigner.schemas", "Schemas") }),
|
|
594
|
+
!i && /* @__PURE__ */ s(U, { size: "sm", variant: "ghost", onClick: n, children: [
|
|
595
|
+
/* @__PURE__ */ t(B, { name: "plus", size: 14 }),
|
|
594
596
|
" ",
|
|
595
|
-
|
|
597
|
+
a("apiDesigner.add", "Add")
|
|
596
598
|
] })
|
|
597
599
|
] }),
|
|
598
|
-
c.map((
|
|
600
|
+
c.map((_) => /* @__PURE__ */ t(
|
|
599
601
|
"div",
|
|
600
602
|
{
|
|
601
603
|
role: "button",
|
|
602
604
|
tabIndex: 0,
|
|
603
|
-
onKeyDown:
|
|
604
|
-
className: `nice-api-designer__schema-item ${l ===
|
|
605
|
-
onClick: () => d(
|
|
606
|
-
children:
|
|
605
|
+
onKeyDown: _e,
|
|
606
|
+
className: `nice-api-designer__schema-item ${l === _ ? "nice-api-designer__schema-item--selected" : ""}`,
|
|
607
|
+
onClick: () => d(_),
|
|
608
|
+
children: _
|
|
607
609
|
},
|
|
608
|
-
|
|
610
|
+
_
|
|
609
611
|
))
|
|
610
612
|
] }),
|
|
611
|
-
l && p && /* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
613
|
+
l && p && /* @__PURE__ */ s("div", { className: "nice-api-designer__schema-editor", children: [
|
|
614
|
+
/* @__PURE__ */ t("h3", { children: l }),
|
|
615
|
+
/* @__PURE__ */ t(
|
|
614
616
|
se,
|
|
615
617
|
{
|
|
616
|
-
label:
|
|
618
|
+
label: a("apiDesigner.type", "Type"),
|
|
617
619
|
value: p.type || "object",
|
|
618
|
-
options:
|
|
619
|
-
onChange: (
|
|
620
|
+
options: fe,
|
|
621
|
+
onChange: (_) => u({ type: _ })
|
|
620
622
|
}
|
|
621
623
|
),
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
|
|
624
|
+
/* @__PURE__ */ t(
|
|
625
|
+
ce,
|
|
624
626
|
{
|
|
625
|
-
label:
|
|
627
|
+
label: a("apiDesigner.description", "Description"),
|
|
626
628
|
value: p.description || "",
|
|
627
|
-
onChange: (
|
|
629
|
+
onChange: (_) => u({ description: _ }),
|
|
628
630
|
readOnly: i,
|
|
629
631
|
rows: 2
|
|
630
632
|
}
|
|
631
633
|
),
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
634
|
-
!i && /* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__subhead", children: [
|
|
635
|
+
/* @__PURE__ */ t("h4", { children: a("apiDesigner.properties", "Properties") }),
|
|
636
|
+
!i && /* @__PURE__ */ s(
|
|
635
637
|
U,
|
|
636
638
|
{
|
|
637
639
|
size: "sm",
|
|
638
640
|
variant: "ghost",
|
|
639
641
|
onClick: () => {
|
|
640
|
-
let
|
|
641
|
-
for (;
|
|
642
|
-
|
|
643
|
-
N(
|
|
642
|
+
let _ = "field", v = 1;
|
|
643
|
+
for (; y[_]; )
|
|
644
|
+
_ = `field${v++}`;
|
|
645
|
+
N(_, { type: "string" });
|
|
644
646
|
},
|
|
645
647
|
children: [
|
|
646
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ t(B, { name: "plus", size: 14 }),
|
|
647
649
|
" ",
|
|
648
|
-
|
|
650
|
+
a("apiDesigner.add", "Add")
|
|
649
651
|
]
|
|
650
652
|
}
|
|
651
653
|
)
|
|
652
654
|
] }),
|
|
653
|
-
Object.keys(
|
|
654
|
-
Object.entries(
|
|
655
|
-
const T = (p.required || []).includes(
|
|
656
|
-
return /* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
655
|
+
Object.keys(y).length === 0 && /* @__PURE__ */ t("p", { className: "nice-api-designer__muted", children: a("apiDesigner.noProperties", "No properties.") }),
|
|
656
|
+
Object.entries(y).map(([_, v]) => {
|
|
657
|
+
const T = (p.required || []).includes(_);
|
|
658
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-designer__param-row", children: [
|
|
659
|
+
/* @__PURE__ */ t(
|
|
658
660
|
L,
|
|
659
661
|
{
|
|
660
662
|
size: "sm",
|
|
661
|
-
value:
|
|
662
|
-
onChange: (
|
|
663
|
-
if (!
|
|
663
|
+
value: _,
|
|
664
|
+
onChange: (h) => {
|
|
665
|
+
if (!h || h === _ || y[h])
|
|
664
666
|
return;
|
|
665
667
|
const S = {};
|
|
666
|
-
Object.entries(
|
|
667
|
-
S[w ===
|
|
668
|
+
Object.entries(y).forEach(([w, D]) => {
|
|
669
|
+
S[w === _ ? h : w] = D;
|
|
668
670
|
}), u({
|
|
669
671
|
properties: S,
|
|
670
|
-
required: (p.required || []).map((w) => w ===
|
|
672
|
+
required: (p.required || []).map((w) => w === _ ? h : w)
|
|
671
673
|
});
|
|
672
674
|
},
|
|
673
675
|
readOnly: i
|
|
674
676
|
}
|
|
675
677
|
),
|
|
676
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ t(
|
|
677
679
|
se,
|
|
678
680
|
{
|
|
679
681
|
size: "sm",
|
|
680
|
-
value:
|
|
681
|
-
options:
|
|
682
|
-
onChange: (
|
|
682
|
+
value: v.type || "string",
|
|
683
|
+
options: fe,
|
|
684
|
+
onChange: (h) => N(_, { ...v, type: h })
|
|
683
685
|
}
|
|
684
686
|
),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
|
|
687
|
+
/* @__PURE__ */ t(
|
|
688
|
+
ke,
|
|
687
689
|
{
|
|
688
690
|
checked: T,
|
|
689
|
-
onChange: (
|
|
690
|
-
required:
|
|
691
|
+
onChange: (h) => u({
|
|
692
|
+
required: h ? [...p.required || [], _] : (p.required || []).filter((S) => S !== _)
|
|
691
693
|
}),
|
|
692
694
|
label: "required"
|
|
693
695
|
}
|
|
694
696
|
),
|
|
695
|
-
!i && /* @__PURE__ */
|
|
697
|
+
!i && /* @__PURE__ */ t(
|
|
696
698
|
U,
|
|
697
699
|
{
|
|
698
700
|
size: "sm",
|
|
699
701
|
variant: "ghost",
|
|
700
702
|
onClick: () => {
|
|
701
|
-
const { [
|
|
703
|
+
const { [_]: h, ...S } = y;
|
|
702
704
|
u({
|
|
703
705
|
properties: S,
|
|
704
|
-
required: (p.required || []).filter((w) => w !==
|
|
706
|
+
required: (p.required || []).filter((w) => w !== _)
|
|
705
707
|
});
|
|
706
708
|
},
|
|
707
|
-
"aria-label":
|
|
709
|
+
"aria-label": a("apiDesigner.remove2", "Remove {propName}").replace(
|
|
708
710
|
"{propName}",
|
|
709
|
-
String(
|
|
711
|
+
String(_)
|
|
710
712
|
),
|
|
711
|
-
children: /* @__PURE__ */
|
|
713
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 14 })
|
|
712
714
|
}
|
|
713
715
|
)
|
|
714
|
-
] },
|
|
716
|
+
] }, _);
|
|
715
717
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
|
|
718
|
+
/* @__PURE__ */ s("details", { className: "nice-api-designer__raw", children: [
|
|
719
|
+
/* @__PURE__ */ t("summary", { children: a("apiDesigner.rawJsonSchema", "Raw JSON schema") }),
|
|
720
|
+
/* @__PURE__ */ t(
|
|
721
|
+
ce,
|
|
720
722
|
{
|
|
721
723
|
value: JSON.stringify(p, null, 2),
|
|
722
|
-
onChange: (
|
|
724
|
+
onChange: (_) => {
|
|
723
725
|
try {
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
+
const v = JSON.parse(_);
|
|
727
|
+
r({ ...e, [l]: v });
|
|
726
728
|
} catch {
|
|
727
729
|
}
|
|
728
730
|
},
|
|
@@ -735,125 +737,125 @@ function qe({
|
|
|
735
737
|
] })
|
|
736
738
|
] });
|
|
737
739
|
}
|
|
738
|
-
function
|
|
739
|
-
const { t: i } =
|
|
740
|
-
return /* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
!
|
|
740
|
+
function Ge({ schemes: e, onChange: n, readOnly: r }) {
|
|
741
|
+
const { t: i } = O(), a = (c, l) => n({ ...e, [c]: l });
|
|
742
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-designer__security-editor", children: [
|
|
743
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__list-header", children: [
|
|
744
|
+
/* @__PURE__ */ t("h3", { children: i("apiDesigner.securitySchemes", "Security schemes") }),
|
|
745
|
+
!r && /* @__PURE__ */ s(
|
|
744
746
|
U,
|
|
745
747
|
{
|
|
746
748
|
size: "sm",
|
|
747
749
|
variant: "ghost",
|
|
748
750
|
onClick: () => {
|
|
749
751
|
let c = "newScheme", l = 1;
|
|
750
|
-
for (;
|
|
752
|
+
for (; e[c]; )
|
|
751
753
|
c = `newScheme${l++}`;
|
|
752
|
-
|
|
754
|
+
a(c, { type: "apiKey", name: "X-API-Key", in: "header" });
|
|
753
755
|
},
|
|
754
756
|
children: [
|
|
755
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ t(B, { name: "plus", size: 14 }),
|
|
756
758
|
" ",
|
|
757
759
|
i("apiDesigner.add", "Add")
|
|
758
760
|
]
|
|
759
761
|
}
|
|
760
762
|
)
|
|
761
763
|
] }),
|
|
762
|
-
Object.entries(
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
!
|
|
764
|
+
Object.entries(e).map(([c, l]) => /* @__PURE__ */ s("div", { className: "nice-api-designer__security-item", children: [
|
|
765
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__subhead", children: [
|
|
766
|
+
/* @__PURE__ */ t("h4", { children: c }),
|
|
767
|
+
!r && /* @__PURE__ */ t(
|
|
766
768
|
U,
|
|
767
769
|
{
|
|
768
770
|
size: "sm",
|
|
769
771
|
variant: "ghost",
|
|
770
772
|
onClick: () => {
|
|
771
|
-
const { [c]: d, ...p } =
|
|
772
|
-
|
|
773
|
+
const { [c]: d, ...p } = e;
|
|
774
|
+
n(p);
|
|
773
775
|
},
|
|
774
776
|
"aria-label": i("apiDesigner.remove", "Remove {name}").replace(
|
|
775
777
|
"{name}",
|
|
776
778
|
String(c)
|
|
777
779
|
),
|
|
778
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 14 })
|
|
779
781
|
}
|
|
780
782
|
)
|
|
781
783
|
] }),
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
784
|
+
/* @__PURE__ */ s("div", { className: "nice-api-designer__param-row", children: [
|
|
785
|
+
/* @__PURE__ */ t(
|
|
784
786
|
se,
|
|
785
787
|
{
|
|
786
788
|
size: "sm",
|
|
787
789
|
value: l.type,
|
|
788
|
-
options:
|
|
789
|
-
onChange: (d) =>
|
|
790
|
+
options: Le.map((d) => ({ value: String(d), label: String(d) })),
|
|
791
|
+
onChange: (d) => a(c, { ...l, type: d })
|
|
790
792
|
}
|
|
791
793
|
),
|
|
792
|
-
l.type === "apiKey" && /* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
794
|
+
l.type === "apiKey" && /* @__PURE__ */ s(Q, { children: [
|
|
795
|
+
/* @__PURE__ */ t(
|
|
794
796
|
L,
|
|
795
797
|
{
|
|
796
798
|
size: "sm",
|
|
797
799
|
value: l.name || "",
|
|
798
800
|
placeholder: i("apiDesigner.headerParamName", "header/param name"),
|
|
799
|
-
onChange: (d) =>
|
|
800
|
-
readOnly:
|
|
801
|
+
onChange: (d) => a(c, { ...l, name: d }),
|
|
802
|
+
readOnly: r
|
|
801
803
|
}
|
|
802
804
|
),
|
|
803
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ t(
|
|
804
806
|
se,
|
|
805
807
|
{
|
|
806
808
|
size: "sm",
|
|
807
809
|
value: l.in || "header",
|
|
808
810
|
options: ["header", "query", "cookie"].map((d) => ({ value: d, label: d })),
|
|
809
|
-
onChange: (d) =>
|
|
811
|
+
onChange: (d) => a(c, { ...l, in: d })
|
|
810
812
|
}
|
|
811
813
|
)
|
|
812
814
|
] }),
|
|
813
|
-
l.type === "http" && /* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
+
l.type === "http" && /* @__PURE__ */ s(Q, { children: [
|
|
816
|
+
/* @__PURE__ */ t(
|
|
815
817
|
L,
|
|
816
818
|
{
|
|
817
819
|
size: "sm",
|
|
818
820
|
value: l.scheme || "",
|
|
819
821
|
placeholder: i("apiDesigner.schemeBearerBasic", "scheme (bearer/basic)"),
|
|
820
|
-
onChange: (d) =>
|
|
821
|
-
readOnly:
|
|
822
|
+
onChange: (d) => a(c, { ...l, scheme: d }),
|
|
823
|
+
readOnly: r
|
|
822
824
|
}
|
|
823
825
|
),
|
|
824
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ t(
|
|
825
827
|
L,
|
|
826
828
|
{
|
|
827
829
|
size: "sm",
|
|
828
830
|
value: l.bearerFormat || "",
|
|
829
831
|
placeholder: i("apiDesigner.bearerformatJwt", "bearerFormat (JWT)"),
|
|
830
|
-
onChange: (d) =>
|
|
831
|
-
readOnly:
|
|
832
|
+
onChange: (d) => a(c, { ...l, bearerFormat: d }),
|
|
833
|
+
readOnly: r
|
|
832
834
|
}
|
|
833
835
|
)
|
|
834
836
|
] })
|
|
835
837
|
] }),
|
|
836
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ t(
|
|
837
839
|
L,
|
|
838
840
|
{
|
|
839
841
|
size: "sm",
|
|
840
842
|
value: l.description || "",
|
|
841
843
|
placeholder: i("apiDesigner.description", "Description"),
|
|
842
|
-
onChange: (d) =>
|
|
843
|
-
readOnly:
|
|
844
|
+
onChange: (d) => a(c, { ...l, description: d }),
|
|
845
|
+
readOnly: r
|
|
844
846
|
}
|
|
845
847
|
)
|
|
846
848
|
] }, c))
|
|
847
849
|
] });
|
|
848
850
|
}
|
|
849
|
-
function
|
|
850
|
-
const { t:
|
|
851
|
-
return /* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
/* @__PURE__ */
|
|
851
|
+
function We({ schema: e }) {
|
|
852
|
+
const { t: n } = O();
|
|
853
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-designer__json-preview", children: [
|
|
854
|
+
/* @__PURE__ */ t("h3", { children: n("apiDesigner.openapiSpecification", "OpenAPI specification") }),
|
|
855
|
+
/* @__PURE__ */ t("pre", { className: "nice-api-designer__code", children: JSON.stringify(e, null, 2) })
|
|
854
856
|
] });
|
|
855
857
|
}
|
|
856
|
-
const
|
|
858
|
+
const Ye = [
|
|
857
859
|
{
|
|
858
860
|
target: ".nice-api-tester",
|
|
859
861
|
titleKey: "tutorial.apiTester.intro.title",
|
|
@@ -862,7 +864,7 @@ const ze = [
|
|
|
862
864
|
content: "Build requests with collections and environment variables, send them and assert on the responses.",
|
|
863
865
|
placement: "auto"
|
|
864
866
|
}
|
|
865
|
-
],
|
|
867
|
+
], Xe = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], Qe = {
|
|
866
868
|
id: "",
|
|
867
869
|
name: "New Request",
|
|
868
870
|
method: "GET",
|
|
@@ -870,85 +872,85 @@ const ze = [
|
|
|
870
872
|
headers: {},
|
|
871
873
|
queryParams: {}
|
|
872
874
|
};
|
|
873
|
-
function he(
|
|
874
|
-
return
|
|
875
|
+
function he(e, n) {
|
|
876
|
+
return e.replace(/\{\{(\w+)\}\}/g, (r, i) => n[i] || `{{${i}}}`);
|
|
875
877
|
}
|
|
876
|
-
function
|
|
877
|
-
const
|
|
878
|
-
return
|
|
878
|
+
function Ze(e, n) {
|
|
879
|
+
const r = Object.entries(n).filter(([, i]) => i).map(([i, a]) => `${encodeURIComponent(i)}=${encodeURIComponent(a)}`).join("&");
|
|
880
|
+
return r ? `${e}?${r}` : e;
|
|
879
881
|
}
|
|
880
|
-
function
|
|
881
|
-
collections:
|
|
882
|
-
environments:
|
|
883
|
-
onRequest:
|
|
882
|
+
function Pt({
|
|
883
|
+
collections: e = [],
|
|
884
|
+
environments: n = [],
|
|
885
|
+
onRequest: r,
|
|
884
886
|
onSaveCollection: i,
|
|
885
|
-
className:
|
|
887
|
+
className: a = "",
|
|
886
888
|
tutorial: c
|
|
887
889
|
}) {
|
|
888
|
-
const { t: l } =
|
|
889
|
-
|
|
890
|
-
), [
|
|
891
|
-
...
|
|
892
|
-
id:
|
|
893
|
-
}), [
|
|
890
|
+
const { t: l } = O(), [d, p] = C(e), [y, u] = C(n), [N, _] = C(
|
|
891
|
+
n.find((o) => o.isActive) || null
|
|
892
|
+
), [v, T] = C({
|
|
893
|
+
...Qe,
|
|
894
|
+
id: ae()
|
|
895
|
+
}), [h, S] = C(null), [w, D] = C(!1), [J, te] = C("none"), [$, M] = C(
|
|
894
896
|
"params"
|
|
895
|
-
), [
|
|
897
|
+
), [z, V] = C("body"), [W, k] = C(""), [f, x] = C(""), [j, F] = C([]), [R, ie] = C([]), K = pe(null), Y = I(async () => {
|
|
896
898
|
var H;
|
|
897
|
-
if (!
|
|
899
|
+
if (!v.url)
|
|
898
900
|
return;
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
Object.entries((N == null ? void 0 : N.variables) || {}).map(([E,
|
|
901
|
+
D(!0), S(null), F([]);
|
|
902
|
+
const o = Object.fromEntries(
|
|
903
|
+
Object.entries((N == null ? void 0 : N.variables) || {}).map(([E, b]) => [E, b.value])
|
|
902
904
|
), g = {
|
|
903
|
-
...
|
|
904
|
-
url: he(
|
|
905
|
+
...v,
|
|
906
|
+
url: he(v.url, o),
|
|
905
907
|
headers: Object.fromEntries(
|
|
906
|
-
Object.entries(
|
|
908
|
+
Object.entries(v.headers).map(([E, b]) => [E, he(b, o)])
|
|
907
909
|
),
|
|
908
910
|
queryParams: Object.fromEntries(
|
|
909
|
-
Object.entries(
|
|
911
|
+
Object.entries(v.queryParams).map(([E, b]) => [
|
|
910
912
|
E,
|
|
911
|
-
he(
|
|
913
|
+
he(b, o)
|
|
912
914
|
])
|
|
913
915
|
)
|
|
914
916
|
}, P = performance.now();
|
|
915
917
|
try {
|
|
916
918
|
let E;
|
|
917
|
-
if (
|
|
918
|
-
E = await
|
|
919
|
+
if (r)
|
|
920
|
+
E = await r(g);
|
|
919
921
|
else {
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
const
|
|
922
|
+
K.current = new AbortController();
|
|
923
|
+
const b = { ...g.headers };
|
|
924
|
+
v.auth && et(b, v.auth);
|
|
925
|
+
const A = Ze(g.url, g.queryParams), q = {
|
|
924
926
|
method: g.method,
|
|
925
|
-
headers:
|
|
926
|
-
signal:
|
|
927
|
+
headers: b,
|
|
928
|
+
signal: K.current.signal
|
|
927
929
|
};
|
|
928
|
-
["POST", "PUT", "PATCH"].includes(g.method) && ((H =
|
|
929
|
-
const
|
|
930
|
-
let
|
|
930
|
+
["POST", "PUT", "PATCH"].includes(g.method) && ((H = v.body) != null && H.content) && (q.body = typeof v.body.content == "string" ? v.body.content : JSON.stringify(v.body.content), v.body.type === "json" && (b["Content-Type"] = "application/json"));
|
|
931
|
+
const G = await fetch(A, q), X = await G.text();
|
|
932
|
+
let ue;
|
|
931
933
|
try {
|
|
932
|
-
|
|
934
|
+
ue = JSON.parse(X);
|
|
933
935
|
} catch {
|
|
934
|
-
|
|
936
|
+
ue = X;
|
|
935
937
|
}
|
|
936
|
-
const
|
|
938
|
+
const De = performance.now();
|
|
937
939
|
E = {
|
|
938
|
-
status:
|
|
939
|
-
statusText:
|
|
940
|
-
headers: Object.fromEntries(
|
|
941
|
-
body:
|
|
942
|
-
time: Math.round(
|
|
940
|
+
status: G.status,
|
|
941
|
+
statusText: G.statusText,
|
|
942
|
+
headers: Object.fromEntries(G.headers.entries()),
|
|
943
|
+
body: ue,
|
|
944
|
+
time: Math.round(De - P),
|
|
943
945
|
size: new Blob([X]).size,
|
|
944
946
|
timestamp: /* @__PURE__ */ new Date()
|
|
945
947
|
};
|
|
946
948
|
}
|
|
947
949
|
if (S(E), ie(
|
|
948
|
-
(
|
|
950
|
+
(b) => [...b, { request: v, response: E }].slice(-50)
|
|
949
951
|
), f) {
|
|
950
|
-
const
|
|
951
|
-
F(
|
|
952
|
+
const b = it(f, E);
|
|
953
|
+
F(b);
|
|
952
954
|
}
|
|
953
955
|
} catch (E) {
|
|
954
956
|
E.name !== "AbortError" && S({
|
|
@@ -961,74 +963,74 @@ function lt({
|
|
|
961
963
|
timestamp: /* @__PURE__ */ new Date()
|
|
962
964
|
});
|
|
963
965
|
} finally {
|
|
964
|
-
|
|
966
|
+
D(!1), K.current = null;
|
|
965
967
|
}
|
|
966
|
-
}, [
|
|
967
|
-
var
|
|
968
|
-
(
|
|
968
|
+
}, [v, N, r, f]), ne = I(() => {
|
|
969
|
+
var o;
|
|
970
|
+
(o = K.current) == null || o.abort(), D(!1);
|
|
969
971
|
}, []), Z = I(() => {
|
|
970
|
-
T((
|
|
971
|
-
...
|
|
972
|
-
headers: { ...
|
|
972
|
+
T((o) => ({
|
|
973
|
+
...o,
|
|
974
|
+
headers: { ...o.headers, "": "" }
|
|
973
975
|
}));
|
|
974
|
-
}, []),
|
|
975
|
-
T((
|
|
976
|
-
...
|
|
977
|
-
queryParams: { ...
|
|
976
|
+
}, []), re = I(() => {
|
|
977
|
+
T((o) => ({
|
|
978
|
+
...o,
|
|
979
|
+
queryParams: { ...o.queryParams, "": "" }
|
|
978
980
|
}));
|
|
979
|
-
}, []),
|
|
981
|
+
}, []), m = I(() => {
|
|
980
982
|
if (d.length === 0) {
|
|
981
|
-
const
|
|
982
|
-
id:
|
|
983
|
+
const o = {
|
|
984
|
+
id: ae(),
|
|
983
985
|
name: "My Collection",
|
|
984
|
-
requests: [
|
|
986
|
+
requests: [v]
|
|
985
987
|
};
|
|
986
|
-
p([
|
|
988
|
+
p([o]), i == null || i(o);
|
|
987
989
|
} else {
|
|
988
|
-
const
|
|
990
|
+
const o = {
|
|
989
991
|
...d[0],
|
|
990
|
-
requests: [...d[0].requests,
|
|
992
|
+
requests: [...d[0].requests, v]
|
|
991
993
|
};
|
|
992
|
-
p((g) => [
|
|
994
|
+
p((g) => [o, ...g.slice(1)]), i == null || i(o);
|
|
993
995
|
}
|
|
994
|
-
}, [d,
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
-
c && /* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
996
|
+
}, [d, v, i]);
|
|
997
|
+
return /* @__PURE__ */ s("div", { className: `nice-api-tester ${a}`, style: { position: "relative" }, children: [
|
|
998
|
+
c && /* @__PURE__ */ t("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ t(le, { steps: de(c, Ye) }) }),
|
|
999
|
+
/* @__PURE__ */ t("div", { className: "nice-api-tester__toolbar", children: /* @__PURE__ */ t("div", { className: "nice-api-tester__env-selector", children: /* @__PURE__ */ s(
|
|
998
1000
|
"select",
|
|
999
1001
|
{
|
|
1000
1002
|
value: (N == null ? void 0 : N.id) || "",
|
|
1001
|
-
onChange: (
|
|
1003
|
+
onChange: (o) => _(y.find((g) => g.id === o.target.value) || null),
|
|
1002
1004
|
children: [
|
|
1003
|
-
/* @__PURE__ */
|
|
1004
|
-
|
|
1005
|
+
/* @__PURE__ */ t("option", { value: "", children: l("apiTester.noEnvironment", "No Environment") }),
|
|
1006
|
+
y.map((o) => /* @__PURE__ */ t("option", { value: o.id, children: o.name }, o.id))
|
|
1005
1007
|
]
|
|
1006
1008
|
}
|
|
1007
1009
|
) }) }),
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__request-bar", children: [
|
|
1011
|
+
/* @__PURE__ */ t(
|
|
1010
1012
|
"select",
|
|
1011
1013
|
{
|
|
1012
|
-
value:
|
|
1013
|
-
onChange: (
|
|
1014
|
+
value: v.method,
|
|
1015
|
+
onChange: (o) => T((g) => ({
|
|
1014
1016
|
...g,
|
|
1015
|
-
method:
|
|
1017
|
+
method: o.target.value
|
|
1016
1018
|
})),
|
|
1017
|
-
className: `nice-api-tester__method nice-api-tester__method--${
|
|
1018
|
-
children:
|
|
1019
|
+
className: `nice-api-tester__method nice-api-tester__method--${v.method.toLowerCase()}`,
|
|
1020
|
+
children: Xe.map((o) => /* @__PURE__ */ t("option", { value: o, children: o }, o))
|
|
1019
1021
|
}
|
|
1020
1022
|
),
|
|
1021
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ t(
|
|
1022
1024
|
"input",
|
|
1023
1025
|
{
|
|
1024
1026
|
type: "text",
|
|
1025
|
-
value:
|
|
1026
|
-
onChange: (
|
|
1027
|
+
value: v.url,
|
|
1028
|
+
onChange: (o) => T((g) => ({ ...g, url: o.target.value })),
|
|
1027
1029
|
placeholder: l("apiTester.enterRequestUrl", "Enter request URL"),
|
|
1028
1030
|
className: "nice-api-tester__url-input"
|
|
1029
1031
|
}
|
|
1030
1032
|
),
|
|
1031
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ t(
|
|
1032
1034
|
"button",
|
|
1033
1035
|
{
|
|
1034
1036
|
onClick: w ? ne : Y,
|
|
@@ -1036,56 +1038,56 @@ function lt({
|
|
|
1036
1038
|
children: w ? l("apiTester.cancel", "Cancel") : l("apiTester.send", "Send")
|
|
1037
1039
|
}
|
|
1038
1040
|
),
|
|
1039
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ t("button", { onClick: m, className: "nice-api-tester__save-btn", children: l("apiTester.save", "Save") })
|
|
1040
1042
|
] }),
|
|
1041
|
-
/* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__main", children: [
|
|
1044
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__request-panel", children: [
|
|
1045
|
+
/* @__PURE__ */ t("div", { className: "nice-api-tester__tabs", children: ["params", "headers", "body", "auth", "tests"].map((o) => /* @__PURE__ */ t(
|
|
1044
1046
|
"button",
|
|
1045
1047
|
{
|
|
1046
|
-
className: `nice-api-tester__tab ${
|
|
1047
|
-
onClick: () => M(
|
|
1048
|
-
children:
|
|
1048
|
+
className: `nice-api-tester__tab ${$ === o ? "nice-api-tester__tab--active" : ""}`,
|
|
1049
|
+
onClick: () => M(o),
|
|
1050
|
+
children: o.charAt(0).toUpperCase() + o.slice(1)
|
|
1049
1051
|
},
|
|
1050
|
-
|
|
1052
|
+
o
|
|
1051
1053
|
)) }),
|
|
1052
|
-
/* @__PURE__ */
|
|
1053
|
-
|
|
1054
|
-
|
|
1054
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__tab-content", children: [
|
|
1055
|
+
$ === "params" && /* @__PURE__ */ t(
|
|
1056
|
+
nt,
|
|
1055
1057
|
{
|
|
1056
|
-
params:
|
|
1057
|
-
onChange: (
|
|
1058
|
-
onAdd:
|
|
1058
|
+
params: v.queryParams,
|
|
1059
|
+
onChange: (o) => T((g) => ({ ...g, queryParams: o })),
|
|
1060
|
+
onAdd: re
|
|
1059
1061
|
}
|
|
1060
1062
|
),
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
+
$ === "headers" && /* @__PURE__ */ t(
|
|
1064
|
+
rt,
|
|
1063
1065
|
{
|
|
1064
|
-
headers:
|
|
1065
|
-
onChange: (
|
|
1066
|
+
headers: v.headers,
|
|
1067
|
+
onChange: (o) => T((g) => ({ ...g, headers: o })),
|
|
1066
1068
|
onAdd: Z
|
|
1067
1069
|
}
|
|
1068
1070
|
),
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
+
$ === "body" && /* @__PURE__ */ t(
|
|
1072
|
+
at,
|
|
1071
1073
|
{
|
|
1072
|
-
body:
|
|
1074
|
+
body: v.body,
|
|
1073
1075
|
bodyTab: J,
|
|
1074
1076
|
onBodyTabChange: te,
|
|
1075
|
-
onChange: (
|
|
1077
|
+
onChange: (o) => T((g) => ({ ...g, body: o }))
|
|
1076
1078
|
}
|
|
1077
1079
|
),
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
+
$ === "auth" && /* @__PURE__ */ t(
|
|
1081
|
+
st,
|
|
1080
1082
|
{
|
|
1081
|
-
auth:
|
|
1082
|
-
onChange: (
|
|
1083
|
+
auth: v.auth,
|
|
1084
|
+
onChange: (o) => T((g) => ({ ...g, auth: o }))
|
|
1083
1085
|
}
|
|
1084
1086
|
),
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
+
$ === "tests" && /* @__PURE__ */ t(
|
|
1088
|
+
ot,
|
|
1087
1089
|
{
|
|
1088
|
-
preRequestScript:
|
|
1090
|
+
preRequestScript: W,
|
|
1089
1091
|
testScript: f,
|
|
1090
1092
|
onPreRequestChange: k,
|
|
1091
1093
|
onTestChange: x
|
|
@@ -1093,82 +1095,82 @@ function lt({
|
|
|
1093
1095
|
)
|
|
1094
1096
|
] })
|
|
1095
1097
|
] }),
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
/* @__PURE__ */
|
|
1098
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ t("div", { className: "nice-api-tester__response-panel", children: h ? /* @__PURE__ */ s(Q, { children: [
|
|
1099
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__response-meta", children: [
|
|
1100
|
+
/* @__PURE__ */ s(
|
|
1099
1101
|
"span",
|
|
1100
1102
|
{
|
|
1101
|
-
className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
|
|
1103
|
+
className: `nice-api-tester__status nice-api-tester__status--${Math.floor(h.status / 100)}`,
|
|
1102
1104
|
children: [
|
|
1103
|
-
|
|
1105
|
+
h.status,
|
|
1104
1106
|
" ",
|
|
1105
|
-
|
|
1107
|
+
h.statusText
|
|
1106
1108
|
]
|
|
1107
1109
|
}
|
|
1108
1110
|
),
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
|
|
1111
|
+
/* @__PURE__ */ s("span", { className: "nice-api-tester__time", children: [
|
|
1112
|
+
h.time,
|
|
1111
1113
|
"ms"
|
|
1112
1114
|
] }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1115
|
+
/* @__PURE__ */ t("span", { className: "nice-api-tester__size", children: tt(h.size) })
|
|
1114
1116
|
] }),
|
|
1115
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ t("div", { className: "nice-api-tester__tabs", children: ["body", "headers", "tests"].map((o) => /* @__PURE__ */ s(
|
|
1116
1118
|
"button",
|
|
1117
1119
|
{
|
|
1118
|
-
className: `nice-api-tester__tab ${
|
|
1119
|
-
onClick: () => V(
|
|
1120
|
+
className: `nice-api-tester__tab ${z === o ? "nice-api-tester__tab--active" : ""}`,
|
|
1121
|
+
onClick: () => V(o),
|
|
1120
1122
|
children: [
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1123
|
+
o.charAt(0).toUpperCase() + o.slice(1),
|
|
1124
|
+
o === "tests" && j.length > 0 && /* @__PURE__ */ s("span", { className: "nice-api-tester__test-badge", children: [
|
|
1125
|
+
j.filter((g) => g.passed).length,
|
|
1124
1126
|
"/",
|
|
1125
|
-
|
|
1127
|
+
j.length
|
|
1126
1128
|
] })
|
|
1127
1129
|
]
|
|
1128
1130
|
},
|
|
1129
|
-
|
|
1131
|
+
o
|
|
1130
1132
|
)) }),
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
/* @__PURE__ */
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
] },
|
|
1137
|
-
|
|
1133
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__response-content", children: [
|
|
1134
|
+
z === "body" && /* @__PURE__ */ t("pre", { className: "nice-api-tester__response-body", children: typeof h.body == "string" ? h.body : JSON.stringify(h.body, null, 2) }),
|
|
1135
|
+
z === "headers" && /* @__PURE__ */ t("div", { className: "nice-api-tester__response-headers", children: Object.entries(h.headers).map(([o, g]) => /* @__PURE__ */ s("div", { className: "nice-api-tester__header-row", children: [
|
|
1136
|
+
/* @__PURE__ */ t("span", { className: "nice-api-tester__header-key", children: o }),
|
|
1137
|
+
/* @__PURE__ */ t("span", { className: "nice-api-tester__header-value", children: g })
|
|
1138
|
+
] }, o)) }),
|
|
1139
|
+
z === "tests" && /* @__PURE__ */ t("div", { className: "nice-api-tester__test-results", children: j.map((o, g) => /* @__PURE__ */ s(
|
|
1138
1140
|
"div",
|
|
1139
1141
|
{
|
|
1140
|
-
className: `nice-api-tester__test-result nice-api-tester__test-result--${
|
|
1142
|
+
className: `nice-api-tester__test-result nice-api-tester__test-result--${o.passed ? "pass" : "fail"}`,
|
|
1141
1143
|
children: [
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
|
|
1144
|
+
/* @__PURE__ */ t("span", { className: "nice-api-tester__test-icon", children: /* @__PURE__ */ t(B, { name: o.passed ? "check" : "close", size: 14 }) }),
|
|
1145
|
+
/* @__PURE__ */ t("span", { className: "nice-api-tester__test-name", children: o.name }),
|
|
1146
|
+
o.message && /* @__PURE__ */ t("span", { className: "nice-api-tester__test-message", children: o.message })
|
|
1145
1147
|
]
|
|
1146
1148
|
},
|
|
1147
1149
|
g
|
|
1148
1150
|
)) })
|
|
1149
1151
|
] })
|
|
1150
|
-
] }) : /* @__PURE__ */
|
|
1152
|
+
] }) : /* @__PURE__ */ t("div", { className: "nice-api-tester__empty-response", children: w ? l("apiTester.loading", "Loading...") : l("apiTester.sendARequestToSee", "Send a request to see the response") }) })
|
|
1151
1153
|
] }),
|
|
1152
|
-
R.length > 0 && /* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1154
|
+
R.length > 0 && /* @__PURE__ */ s("div", { className: "nice-api-tester__history", children: [
|
|
1155
|
+
/* @__PURE__ */ t("h4", { children: l("apiTester.history", "History") }),
|
|
1156
|
+
/* @__PURE__ */ t("div", { className: "nice-api-tester__history-list", children: R.slice().reverse().map(({ request: o, response: g }, P) => /* @__PURE__ */ s(
|
|
1155
1157
|
"div",
|
|
1156
1158
|
{
|
|
1157
1159
|
role: "button",
|
|
1158
1160
|
tabIndex: 0,
|
|
1159
|
-
onKeyDown:
|
|
1161
|
+
onKeyDown: _e,
|
|
1160
1162
|
className: "nice-api-tester__history-item",
|
|
1161
|
-
onClick: () => T(
|
|
1163
|
+
onClick: () => T(o),
|
|
1162
1164
|
children: [
|
|
1163
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ t(
|
|
1164
1166
|
"span",
|
|
1165
1167
|
{
|
|
1166
|
-
className: `nice-api-tester__method nice-api-tester__method--${
|
|
1167
|
-
children:
|
|
1168
|
+
className: `nice-api-tester__method nice-api-tester__method--${o.method.toLowerCase()}`,
|
|
1169
|
+
children: o.method
|
|
1168
1170
|
}
|
|
1169
1171
|
),
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ t("span", { className: "nice-api-tester__history-url", children: o.url }),
|
|
1173
|
+
/* @__PURE__ */ t(
|
|
1172
1174
|
"span",
|
|
1173
1175
|
{
|
|
1174
1176
|
className: `nice-api-tester__status nice-api-tester__status--${Math.floor(
|
|
@@ -1184,61 +1186,61 @@ function lt({
|
|
|
1184
1186
|
] })
|
|
1185
1187
|
] });
|
|
1186
1188
|
}
|
|
1187
|
-
function
|
|
1188
|
-
var
|
|
1189
|
-
switch (
|
|
1189
|
+
function et(e, n) {
|
|
1190
|
+
var r, i, a, c, l;
|
|
1191
|
+
switch (n.type) {
|
|
1190
1192
|
case "bearer":
|
|
1191
|
-
|
|
1193
|
+
e.Authorization = `${((r = n.bearer) == null ? void 0 : r.prefix) || "Bearer"} ${(i = n.bearer) == null ? void 0 : i.token}`;
|
|
1192
1194
|
break;
|
|
1193
1195
|
case "basic":
|
|
1194
|
-
|
|
1196
|
+
e.Authorization = `Basic ${btoa(`${(a = n.basic) == null ? void 0 : a.username}:${(c = n.basic) == null ? void 0 : c.password}`)}`;
|
|
1195
1197
|
break;
|
|
1196
1198
|
case "api-key":
|
|
1197
|
-
((l =
|
|
1199
|
+
((l = n.apiKey) == null ? void 0 : l.in) === "header" && (e[n.apiKey.key] = n.apiKey.value);
|
|
1198
1200
|
break;
|
|
1199
1201
|
}
|
|
1200
1202
|
}
|
|
1201
|
-
function
|
|
1202
|
-
return
|
|
1203
|
+
function tt(e) {
|
|
1204
|
+
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1203
1205
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const
|
|
1206
|
+
function it(e, n) {
|
|
1207
|
+
const r = [], i = {
|
|
1206
1208
|
response: {
|
|
1207
|
-
code:
|
|
1208
|
-
status:
|
|
1209
|
-
headers:
|
|
1210
|
-
json: () =>
|
|
1211
|
-
text: () => typeof
|
|
1212
|
-
responseTime:
|
|
1209
|
+
code: n.status,
|
|
1210
|
+
status: n.statusText,
|
|
1211
|
+
headers: n.headers,
|
|
1212
|
+
json: () => n.body,
|
|
1213
|
+
text: () => typeof n.body == "string" ? n.body : JSON.stringify(n.body),
|
|
1214
|
+
responseTime: n.time
|
|
1213
1215
|
},
|
|
1214
|
-
test: (
|
|
1216
|
+
test: (a, c) => {
|
|
1215
1217
|
const l = performance.now();
|
|
1216
1218
|
try {
|
|
1217
|
-
c(),
|
|
1219
|
+
c(), r.push({ name: a, passed: !0, duration: performance.now() - l });
|
|
1218
1220
|
} catch (d) {
|
|
1219
|
-
|
|
1220
|
-
name:
|
|
1221
|
+
r.push({
|
|
1222
|
+
name: a,
|
|
1221
1223
|
passed: !1,
|
|
1222
1224
|
message: d.message,
|
|
1223
1225
|
duration: performance.now() - l
|
|
1224
1226
|
});
|
|
1225
1227
|
}
|
|
1226
1228
|
},
|
|
1227
|
-
expect: (
|
|
1229
|
+
expect: (a) => ({
|
|
1228
1230
|
to: {
|
|
1229
1231
|
equal: (c) => {
|
|
1230
|
-
if (
|
|
1231
|
-
throw new Error(`Expected ${c} but got ${
|
|
1232
|
+
if (a !== c)
|
|
1233
|
+
throw new Error(`Expected ${c} but got ${a}`);
|
|
1232
1234
|
},
|
|
1233
1235
|
be: {
|
|
1234
1236
|
oneOf: (c) => {
|
|
1235
|
-
if (!c.includes(
|
|
1236
|
-
throw new Error(`Expected ${
|
|
1237
|
+
if (!c.includes(a))
|
|
1238
|
+
throw new Error(`Expected ${a} to be one of ${c}`);
|
|
1237
1239
|
}
|
|
1238
1240
|
},
|
|
1239
1241
|
have: {
|
|
1240
1242
|
property: (c) => {
|
|
1241
|
-
if (typeof
|
|
1243
|
+
if (typeof a != "object" || a === null || !(c in a))
|
|
1242
1244
|
throw new Error(`Expected object to have property ${c}`);
|
|
1243
1245
|
}
|
|
1244
1246
|
}
|
|
@@ -1246,192 +1248,192 @@ function Me(t, a) {
|
|
|
1246
1248
|
})
|
|
1247
1249
|
};
|
|
1248
1250
|
try {
|
|
1249
|
-
new Function("pm",
|
|
1250
|
-
} catch (
|
|
1251
|
-
|
|
1251
|
+
new Function("pm", e)(i);
|
|
1252
|
+
} catch (a) {
|
|
1253
|
+
r.push({
|
|
1252
1254
|
name: "Script Error",
|
|
1253
1255
|
passed: !1,
|
|
1254
|
-
message:
|
|
1256
|
+
message: a.message,
|
|
1255
1257
|
duration: 0
|
|
1256
1258
|
});
|
|
1257
1259
|
}
|
|
1258
|
-
return
|
|
1260
|
+
return r;
|
|
1259
1261
|
}
|
|
1260
|
-
function
|
|
1261
|
-
items:
|
|
1262
|
-
onChange:
|
|
1263
|
-
onAdd:
|
|
1262
|
+
function Ee({
|
|
1263
|
+
items: e,
|
|
1264
|
+
onChange: n,
|
|
1265
|
+
onAdd: r,
|
|
1264
1266
|
keyPlaceholder: i,
|
|
1265
|
-
valuePlaceholder:
|
|
1267
|
+
valuePlaceholder: a
|
|
1266
1268
|
}) {
|
|
1267
|
-
const { t: c } =
|
|
1268
|
-
return /* @__PURE__ */
|
|
1269
|
-
Object.entries(
|
|
1270
|
-
/* @__PURE__ */
|
|
1269
|
+
const { t: c } = O(), l = i ?? c("apiTester.key", "Key"), d = a ?? c("apiTester.value", "Value");
|
|
1270
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-tester__kv-editor", children: [
|
|
1271
|
+
Object.entries(e).map(([p, y], u) => /* @__PURE__ */ s("div", { className: "nice-api-tester__kv-row", children: [
|
|
1272
|
+
/* @__PURE__ */ t(
|
|
1271
1273
|
"input",
|
|
1272
1274
|
{
|
|
1273
1275
|
type: "text",
|
|
1274
1276
|
value: p,
|
|
1275
1277
|
placeholder: l,
|
|
1276
1278
|
onChange: (N) => {
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
+
const _ = Object.entries(e);
|
|
1280
|
+
_[u] = [N.target.value, y], n(Object.fromEntries(_));
|
|
1279
1281
|
}
|
|
1280
1282
|
}
|
|
1281
1283
|
),
|
|
1282
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ t(
|
|
1283
1285
|
"input",
|
|
1284
1286
|
{
|
|
1285
1287
|
type: "text",
|
|
1286
|
-
value:
|
|
1288
|
+
value: y,
|
|
1287
1289
|
placeholder: d,
|
|
1288
|
-
onChange: (N) =>
|
|
1290
|
+
onChange: (N) => n({ ...e, [p]: N.target.value })
|
|
1289
1291
|
}
|
|
1290
1292
|
),
|
|
1291
|
-
/* @__PURE__ */
|
|
1293
|
+
/* @__PURE__ */ t(
|
|
1292
1294
|
"button",
|
|
1293
1295
|
{
|
|
1294
1296
|
"aria-label": c("apiTester.close", "Close"),
|
|
1295
1297
|
onClick: () => {
|
|
1296
|
-
const { [p]: N, ...
|
|
1297
|
-
|
|
1298
|
+
const { [p]: N, ..._ } = e;
|
|
1299
|
+
n(_);
|
|
1298
1300
|
},
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1301
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 14 })
|
|
1300
1302
|
}
|
|
1301
1303
|
)
|
|
1302
1304
|
] }, u)),
|
|
1303
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ t("button", { onClick: r, className: "nice-api-tester__add-btn", children: c("apiTester.add", "+ Add") })
|
|
1304
1306
|
] });
|
|
1305
1307
|
}
|
|
1306
|
-
function
|
|
1307
|
-
params:
|
|
1308
|
-
onChange:
|
|
1309
|
-
onAdd:
|
|
1308
|
+
function nt({
|
|
1309
|
+
params: e,
|
|
1310
|
+
onChange: n,
|
|
1311
|
+
onAdd: r
|
|
1310
1312
|
}) {
|
|
1311
|
-
return /* @__PURE__ */
|
|
1312
|
-
|
|
1313
|
+
return /* @__PURE__ */ t(
|
|
1314
|
+
Ee,
|
|
1313
1315
|
{
|
|
1314
|
-
items:
|
|
1315
|
-
onChange:
|
|
1316
|
-
onAdd:
|
|
1316
|
+
items: e,
|
|
1317
|
+
onChange: n,
|
|
1318
|
+
onAdd: r,
|
|
1317
1319
|
keyPlaceholder: "Parameter",
|
|
1318
1320
|
valuePlaceholder: "Value"
|
|
1319
1321
|
}
|
|
1320
1322
|
);
|
|
1321
1323
|
}
|
|
1322
|
-
function
|
|
1323
|
-
headers:
|
|
1324
|
-
onChange:
|
|
1325
|
-
onAdd:
|
|
1324
|
+
function rt({
|
|
1325
|
+
headers: e,
|
|
1326
|
+
onChange: n,
|
|
1327
|
+
onAdd: r
|
|
1326
1328
|
}) {
|
|
1327
|
-
return /* @__PURE__ */
|
|
1328
|
-
|
|
1329
|
+
return /* @__PURE__ */ t(
|
|
1330
|
+
Ee,
|
|
1329
1331
|
{
|
|
1330
|
-
items:
|
|
1331
|
-
onChange:
|
|
1332
|
-
onAdd:
|
|
1332
|
+
items: e,
|
|
1333
|
+
onChange: n,
|
|
1334
|
+
onAdd: r,
|
|
1333
1335
|
keyPlaceholder: "Header",
|
|
1334
1336
|
valuePlaceholder: "Value"
|
|
1335
1337
|
}
|
|
1336
1338
|
);
|
|
1337
1339
|
}
|
|
1338
|
-
function
|
|
1339
|
-
body:
|
|
1340
|
-
bodyTab:
|
|
1341
|
-
onBodyTabChange:
|
|
1340
|
+
function at({
|
|
1341
|
+
body: e,
|
|
1342
|
+
bodyTab: n,
|
|
1343
|
+
onBodyTabChange: r,
|
|
1342
1344
|
onChange: i
|
|
1343
1345
|
}) {
|
|
1344
|
-
const { t:
|
|
1345
|
-
return /* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
/* @__PURE__ */
|
|
1346
|
+
const { t: a } = O();
|
|
1347
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-tester__body-editor", children: [
|
|
1348
|
+
/* @__PURE__ */ t("div", { className: "nice-api-tester__body-tabs", children: ["none", "json", "form-data", "raw"].map((c) => /* @__PURE__ */ s("label", { children: [
|
|
1349
|
+
/* @__PURE__ */ t(
|
|
1348
1350
|
"input",
|
|
1349
1351
|
{
|
|
1350
1352
|
type: "radio",
|
|
1351
|
-
checked:
|
|
1353
|
+
checked: n === c,
|
|
1352
1354
|
onChange: () => {
|
|
1353
|
-
|
|
1355
|
+
r(c), i({ type: c, content: "" });
|
|
1354
1356
|
}
|
|
1355
1357
|
}
|
|
1356
1358
|
),
|
|
1357
1359
|
c
|
|
1358
1360
|
] }, c)) }),
|
|
1359
|
-
|
|
1361
|
+
n !== "none" && /* @__PURE__ */ t(
|
|
1360
1362
|
"textarea",
|
|
1361
1363
|
{
|
|
1362
|
-
value: typeof (
|
|
1363
|
-
onChange: (c) => i({ type:
|
|
1364
|
-
placeholder:
|
|
1364
|
+
value: typeof (e == null ? void 0 : e.content) == "string" ? e.content : JSON.stringify(e == null ? void 0 : e.content, null, 2),
|
|
1365
|
+
onChange: (c) => i({ type: n, content: c.target.value }),
|
|
1366
|
+
placeholder: n === "json" ? '{ "key": "value" }' : a("apiTester.enterBodyContent", "Enter body content"),
|
|
1365
1367
|
rows: 10,
|
|
1366
1368
|
className: "nice-api-tester__body-textarea"
|
|
1367
1369
|
}
|
|
1368
1370
|
)
|
|
1369
1371
|
] });
|
|
1370
1372
|
}
|
|
1371
|
-
function
|
|
1372
|
-
auth:
|
|
1373
|
-
onChange:
|
|
1373
|
+
function st({
|
|
1374
|
+
auth: e,
|
|
1375
|
+
onChange: n
|
|
1374
1376
|
}) {
|
|
1375
|
-
var i,
|
|
1376
|
-
const { t:
|
|
1377
|
-
return /* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1377
|
+
var i, a, c, l, d, p;
|
|
1378
|
+
const { t: r } = O();
|
|
1379
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-tester__auth-editor", children: [
|
|
1380
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1381
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.type", "Type") }),
|
|
1382
|
+
/* @__PURE__ */ s(
|
|
1381
1383
|
"select",
|
|
1382
1384
|
{
|
|
1383
|
-
value: (
|
|
1384
|
-
onChange: (
|
|
1385
|
+
value: (e == null ? void 0 : e.type) || "none",
|
|
1386
|
+
onChange: (y) => n({ type: y.target.value }),
|
|
1385
1387
|
children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
/* @__PURE__ */
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ t("option", { value: "none", children: r("apiTester.noAuth", "No Auth") }),
|
|
1389
|
+
/* @__PURE__ */ t("option", { value: "api-key", children: r("apiTester.apiKey", "API Key") }),
|
|
1390
|
+
/* @__PURE__ */ t("option", { value: "bearer", children: r("apiTester.bearerToken", "Bearer Token") }),
|
|
1391
|
+
/* @__PURE__ */ t("option", { value: "basic", children: r("apiTester.basicAuth", "Basic Auth") }),
|
|
1392
|
+
/* @__PURE__ */ t("option", { value: "oauth2", children: r("apiTester.oauth20", "OAuth 2.0") })
|
|
1391
1393
|
]
|
|
1392
1394
|
}
|
|
1393
1395
|
)
|
|
1394
1396
|
] }),
|
|
1395
|
-
(
|
|
1396
|
-
/* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */
|
|
1397
|
+
(e == null ? void 0 : e.type) === "api-key" && /* @__PURE__ */ s(Q, { children: [
|
|
1398
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1399
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.key", "Key") }),
|
|
1400
|
+
/* @__PURE__ */ t(
|
|
1399
1401
|
"input",
|
|
1400
1402
|
{
|
|
1401
1403
|
type: "text",
|
|
1402
|
-
value: ((i =
|
|
1403
|
-
onChange: (
|
|
1404
|
+
value: ((i = e.apiKey) == null ? void 0 : i.key) || "",
|
|
1405
|
+
onChange: (y) => {
|
|
1404
1406
|
var u, N;
|
|
1405
|
-
return
|
|
1406
|
-
...
|
|
1407
|
+
return n({
|
|
1408
|
+
...e,
|
|
1407
1409
|
apiKey: {
|
|
1408
|
-
...
|
|
1409
|
-
key:
|
|
1410
|
-
value: ((u =
|
|
1411
|
-
in: ((N =
|
|
1410
|
+
...e.apiKey,
|
|
1411
|
+
key: y.target.value,
|
|
1412
|
+
value: ((u = e.apiKey) == null ? void 0 : u.value) || "",
|
|
1413
|
+
in: ((N = e.apiKey) == null ? void 0 : N.in) || "header"
|
|
1412
1414
|
}
|
|
1413
1415
|
});
|
|
1414
1416
|
},
|
|
1415
|
-
placeholder:
|
|
1417
|
+
placeholder: r("apiTester.xApiKey", "X-API-Key")
|
|
1416
1418
|
}
|
|
1417
1419
|
)
|
|
1418
1420
|
] }),
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
-
/* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */
|
|
1421
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1422
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.value", "Value") }),
|
|
1423
|
+
/* @__PURE__ */ t(
|
|
1422
1424
|
"input",
|
|
1423
1425
|
{
|
|
1424
1426
|
type: "text",
|
|
1425
|
-
value: ((
|
|
1426
|
-
onChange: (
|
|
1427
|
+
value: ((a = e.apiKey) == null ? void 0 : a.value) || "",
|
|
1428
|
+
onChange: (y) => {
|
|
1427
1429
|
var u, N;
|
|
1428
|
-
return
|
|
1429
|
-
...
|
|
1430
|
+
return n({
|
|
1431
|
+
...e,
|
|
1430
1432
|
apiKey: {
|
|
1431
|
-
...
|
|
1432
|
-
value:
|
|
1433
|
-
key: ((u =
|
|
1434
|
-
in: ((N =
|
|
1433
|
+
...e.apiKey,
|
|
1434
|
+
value: y.target.value,
|
|
1435
|
+
key: ((u = e.apiKey) == null ? void 0 : u.key) || "",
|
|
1436
|
+
in: ((N = e.apiKey) == null ? void 0 : N.in) || "header"
|
|
1435
1437
|
}
|
|
1436
1438
|
});
|
|
1437
1439
|
},
|
|
@@ -1439,81 +1441,81 @@ function Je({
|
|
|
1439
1441
|
}
|
|
1440
1442
|
)
|
|
1441
1443
|
] }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1444
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1445
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.addTo", "Add to") }),
|
|
1446
|
+
/* @__PURE__ */ s(
|
|
1445
1447
|
"select",
|
|
1446
1448
|
{
|
|
1447
|
-
value: ((c =
|
|
1448
|
-
onChange: (
|
|
1449
|
+
value: ((c = e.apiKey) == null ? void 0 : c.in) || "header",
|
|
1450
|
+
onChange: (y) => {
|
|
1449
1451
|
var u, N;
|
|
1450
|
-
return
|
|
1451
|
-
...
|
|
1452
|
+
return n({
|
|
1453
|
+
...e,
|
|
1452
1454
|
apiKey: {
|
|
1453
|
-
...
|
|
1454
|
-
in:
|
|
1455
|
-
key: ((u =
|
|
1456
|
-
value: ((N =
|
|
1455
|
+
...e.apiKey,
|
|
1456
|
+
in: y.target.value,
|
|
1457
|
+
key: ((u = e.apiKey) == null ? void 0 : u.key) || "",
|
|
1458
|
+
value: ((N = e.apiKey) == null ? void 0 : N.value) || ""
|
|
1457
1459
|
}
|
|
1458
1460
|
});
|
|
1459
1461
|
},
|
|
1460
1462
|
children: [
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ t("option", { value: "header", children: r("apiTester.header", "Header") }),
|
|
1464
|
+
/* @__PURE__ */ t("option", { value: "query", children: r("apiTester.queryParams", "Query Params") })
|
|
1463
1465
|
]
|
|
1464
1466
|
}
|
|
1465
1467
|
)
|
|
1466
1468
|
] })
|
|
1467
1469
|
] }),
|
|
1468
|
-
(
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */
|
|
1470
|
+
(e == null ? void 0 : e.type) === "bearer" && /* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1471
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.token", "Token") }),
|
|
1472
|
+
/* @__PURE__ */ t(
|
|
1471
1473
|
"input",
|
|
1472
1474
|
{
|
|
1473
1475
|
type: "text",
|
|
1474
|
-
value: ((l =
|
|
1475
|
-
onChange: (
|
|
1476
|
+
value: ((l = e.bearer) == null ? void 0 : l.token) || "",
|
|
1477
|
+
onChange: (y) => n({ ...e, bearer: { token: y.target.value } }),
|
|
1476
1478
|
placeholder: "your-bearer-token"
|
|
1477
1479
|
}
|
|
1478
1480
|
)
|
|
1479
1481
|
] }),
|
|
1480
|
-
(
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1482
|
+
(e == null ? void 0 : e.type) === "basic" && /* @__PURE__ */ s(Q, { children: [
|
|
1483
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1484
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.username", "Username") }),
|
|
1485
|
+
/* @__PURE__ */ t(
|
|
1484
1486
|
"input",
|
|
1485
1487
|
{
|
|
1486
1488
|
type: "text",
|
|
1487
|
-
value: ((d =
|
|
1488
|
-
onChange: (
|
|
1489
|
+
value: ((d = e.basic) == null ? void 0 : d.username) || "",
|
|
1490
|
+
onChange: (y) => {
|
|
1489
1491
|
var u;
|
|
1490
|
-
return
|
|
1491
|
-
...
|
|
1492
|
+
return n({
|
|
1493
|
+
...e,
|
|
1492
1494
|
basic: {
|
|
1493
|
-
...
|
|
1494
|
-
username:
|
|
1495
|
-
password: ((u =
|
|
1495
|
+
...e.basic,
|
|
1496
|
+
username: y.target.value,
|
|
1497
|
+
password: ((u = e.basic) == null ? void 0 : u.password) || ""
|
|
1496
1498
|
}
|
|
1497
1499
|
});
|
|
1498
1500
|
}
|
|
1499
1501
|
}
|
|
1500
1502
|
)
|
|
1501
1503
|
] }),
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__field", children: [
|
|
1505
|
+
/* @__PURE__ */ t("label", { children: r("apiTester.password", "Password") }),
|
|
1506
|
+
/* @__PURE__ */ t(
|
|
1505
1507
|
"input",
|
|
1506
1508
|
{
|
|
1507
1509
|
type: "password",
|
|
1508
|
-
value: ((p =
|
|
1509
|
-
onChange: (
|
|
1510
|
+
value: ((p = e.basic) == null ? void 0 : p.password) || "",
|
|
1511
|
+
onChange: (y) => {
|
|
1510
1512
|
var u;
|
|
1511
|
-
return
|
|
1512
|
-
...
|
|
1513
|
+
return n({
|
|
1514
|
+
...e,
|
|
1513
1515
|
basic: {
|
|
1514
|
-
...
|
|
1515
|
-
password:
|
|
1516
|
-
username: ((u =
|
|
1516
|
+
...e.basic,
|
|
1517
|
+
password: y.target.value,
|
|
1518
|
+
username: ((u = e.basic) == null ? void 0 : u.username) || ""
|
|
1517
1519
|
}
|
|
1518
1520
|
});
|
|
1519
1521
|
}
|
|
@@ -1523,32 +1525,32 @@ function Je({
|
|
|
1523
1525
|
] })
|
|
1524
1526
|
] });
|
|
1525
1527
|
}
|
|
1526
|
-
function
|
|
1527
|
-
preRequestScript:
|
|
1528
|
-
testScript:
|
|
1529
|
-
onPreRequestChange:
|
|
1528
|
+
function ot({
|
|
1529
|
+
preRequestScript: e,
|
|
1530
|
+
testScript: n,
|
|
1531
|
+
onPreRequestChange: r,
|
|
1530
1532
|
onTestChange: i
|
|
1531
1533
|
}) {
|
|
1532
|
-
const { t:
|
|
1533
|
-
return /* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1534
|
+
const { t: a } = O();
|
|
1535
|
+
return /* @__PURE__ */ s("div", { className: "nice-api-tester__tests-editor", children: [
|
|
1536
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__script-section", children: [
|
|
1537
|
+
/* @__PURE__ */ t("h4", { children: a("apiTester.preRequestScript", "Pre-request Script") }),
|
|
1538
|
+
/* @__PURE__ */ t(
|
|
1537
1539
|
"textarea",
|
|
1538
1540
|
{
|
|
1539
|
-
value:
|
|
1540
|
-
onChange: (c) =>
|
|
1541
|
+
value: e,
|
|
1542
|
+
onChange: (c) => r(c.target.value),
|
|
1541
1543
|
placeholder: "// Code to run before the request",
|
|
1542
1544
|
rows: 5
|
|
1543
1545
|
}
|
|
1544
1546
|
)
|
|
1545
1547
|
] }),
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ s("div", { className: "nice-api-tester__script-section", children: [
|
|
1549
|
+
/* @__PURE__ */ t("h4", { children: a("apiTester.tests", "Tests") }),
|
|
1550
|
+
/* @__PURE__ */ t(
|
|
1549
1551
|
"textarea",
|
|
1550
1552
|
{
|
|
1551
|
-
value:
|
|
1553
|
+
value: n,
|
|
1552
1554
|
onChange: (c) => i(c.target.value),
|
|
1553
1555
|
placeholder: `pm.test("Status code is 200", function () {
|
|
1554
1556
|
pm.expect(pm.response.code).to.equal(200);
|
|
@@ -1559,7 +1561,7 @@ function We({
|
|
|
1559
1561
|
] })
|
|
1560
1562
|
] });
|
|
1561
1563
|
}
|
|
1562
|
-
const
|
|
1564
|
+
const ct = [
|
|
1563
1565
|
{
|
|
1564
1566
|
target: ".nice-integration-builder",
|
|
1565
1567
|
titleKey: "tutorial.integrationBuilder.intro.title",
|
|
@@ -1568,7 +1570,7 @@ const Ge = [
|
|
|
1568
1570
|
content: "Wire a flow of nodes (triggers → actions → error handling) and connect them to build an integration.",
|
|
1569
1571
|
placement: "auto"
|
|
1570
1572
|
}
|
|
1571
|
-
],
|
|
1573
|
+
], ge = [
|
|
1572
1574
|
{ type: "trigger", label: "Trigger", icon: "zap", category: "Control" },
|
|
1573
1575
|
{ type: "http-request", label: "HTTP Request", icon: "globe", category: "Actions" },
|
|
1574
1576
|
{ type: "transform", label: "Transform", icon: "shuffle", category: "Data" },
|
|
@@ -1582,7 +1584,7 @@ const Ge = [
|
|
|
1582
1584
|
{ type: "webhook", label: "Webhook", icon: "link", category: "Actions" },
|
|
1583
1585
|
{ type: "function", label: "Function", icon: "code", category: "Actions" },
|
|
1584
1586
|
{ type: "error-handler", label: "Error Handler", icon: "warning", category: "Control" }
|
|
1585
|
-
],
|
|
1587
|
+
], lt = {
|
|
1586
1588
|
id: "",
|
|
1587
1589
|
name: "New Flow",
|
|
1588
1590
|
nodes: [],
|
|
@@ -1591,35 +1593,35 @@ const Ge = [
|
|
|
1591
1593
|
triggers: [],
|
|
1592
1594
|
errorHandling: { strategy: "stop" }
|
|
1593
1595
|
};
|
|
1594
|
-
function
|
|
1595
|
-
flow:
|
|
1596
|
-
connectors:
|
|
1597
|
-
onChange:
|
|
1596
|
+
function At({
|
|
1597
|
+
flow: e,
|
|
1598
|
+
connectors: n = [],
|
|
1599
|
+
onChange: r,
|
|
1598
1600
|
onSave: i,
|
|
1599
|
-
onRun:
|
|
1601
|
+
onRun: a,
|
|
1600
1602
|
className: c = "",
|
|
1601
1603
|
tutorial: l
|
|
1602
1604
|
}) {
|
|
1603
|
-
const { t: d } =
|
|
1604
|
-
|
|
1605
|
-
), [u, N] = C(null), [
|
|
1606
|
-
(
|
|
1607
|
-
|
|
1608
|
-
const g =
|
|
1609
|
-
return
|
|
1605
|
+
const { t: d } = O(), [p, y] = C(
|
|
1606
|
+
e || { ...lt, id: ae() }
|
|
1607
|
+
), [u, N] = C(null), [_, v] = C(!0), [T, h] = C("canvas"), [S, w] = C(!1), [D, J] = C(null), [te, $] = C(!1), [M, z] = C(null), [V, W] = C(!1), k = pe(null), f = I(
|
|
1608
|
+
(m) => {
|
|
1609
|
+
y((o) => {
|
|
1610
|
+
const g = m(o);
|
|
1611
|
+
return r == null || r(g), g;
|
|
1610
1612
|
});
|
|
1611
1613
|
},
|
|
1612
|
-
[
|
|
1614
|
+
[r]
|
|
1613
1615
|
), x = I(
|
|
1614
|
-
(
|
|
1616
|
+
(m, o) => {
|
|
1615
1617
|
var P;
|
|
1616
1618
|
const g = {
|
|
1617
|
-
id:
|
|
1618
|
-
type:
|
|
1619
|
-
name: ((P =
|
|
1620
|
-
position:
|
|
1621
|
-
config:
|
|
1622
|
-
inputs:
|
|
1619
|
+
id: ae(),
|
|
1620
|
+
type: m,
|
|
1621
|
+
name: ((P = ge.find((H) => H.type === m)) == null ? void 0 : P.label) || m,
|
|
1622
|
+
position: o,
|
|
1623
|
+
config: dt(m),
|
|
1624
|
+
inputs: m !== "trigger" ? ["input"] : [],
|
|
1623
1625
|
outputs: ["output"]
|
|
1624
1626
|
};
|
|
1625
1627
|
f((H) => ({
|
|
@@ -1628,37 +1630,37 @@ function dt({
|
|
|
1628
1630
|
})), N(g);
|
|
1629
1631
|
},
|
|
1630
1632
|
[f]
|
|
1631
|
-
),
|
|
1632
|
-
(
|
|
1633
|
-
f((
|
|
1634
|
-
...
|
|
1635
|
-
nodes:
|
|
1636
|
-
connections:
|
|
1637
|
-
(g) => g.sourceNodeId !==
|
|
1633
|
+
), j = I(
|
|
1634
|
+
(m) => {
|
|
1635
|
+
f((o) => ({
|
|
1636
|
+
...o,
|
|
1637
|
+
nodes: o.nodes.filter((g) => g.id !== m),
|
|
1638
|
+
connections: o.connections.filter(
|
|
1639
|
+
(g) => g.sourceNodeId !== m && g.targetNodeId !== m
|
|
1638
1640
|
)
|
|
1639
1641
|
})), N(null);
|
|
1640
1642
|
},
|
|
1641
1643
|
[f]
|
|
1642
1644
|
), F = I(
|
|
1643
|
-
(
|
|
1645
|
+
(m, o) => {
|
|
1644
1646
|
f((g) => ({
|
|
1645
1647
|
...g,
|
|
1646
|
-
nodes: g.nodes.map((P) => P.id ===
|
|
1647
|
-
})), (u == null ? void 0 : u.id) ===
|
|
1648
|
+
nodes: g.nodes.map((P) => P.id === m ? { ...P, ...o } : P)
|
|
1649
|
+
})), (u == null ? void 0 : u.id) === m && N((g) => g ? { ...g, ...o } : null);
|
|
1648
1650
|
},
|
|
1649
1651
|
[f, u]
|
|
1650
1652
|
), R = I(
|
|
1651
|
-
(
|
|
1652
|
-
|
|
1653
|
-
(E) => E.sourceNodeId ===
|
|
1653
|
+
(m, o, g, P) => {
|
|
1654
|
+
m === g || p.connections.some(
|
|
1655
|
+
(E) => E.sourceNodeId === m && E.targetNodeId === g && E.sourceOutput === o && E.targetInput === P
|
|
1654
1656
|
) || f((E) => ({
|
|
1655
1657
|
...E,
|
|
1656
1658
|
connections: [
|
|
1657
1659
|
...E.connections,
|
|
1658
1660
|
{
|
|
1659
|
-
id:
|
|
1660
|
-
sourceNodeId:
|
|
1661
|
-
sourceOutput:
|
|
1661
|
+
id: ae(),
|
|
1662
|
+
sourceNodeId: m,
|
|
1663
|
+
sourceOutput: o,
|
|
1662
1664
|
targetNodeId: g,
|
|
1663
1665
|
targetInput: P
|
|
1664
1666
|
}
|
|
@@ -1667,183 +1669,183 @@ function dt({
|
|
|
1667
1669
|
},
|
|
1668
1670
|
[p.connections, f]
|
|
1669
1671
|
), ie = I(
|
|
1670
|
-
(
|
|
1671
|
-
f((
|
|
1672
|
-
...
|
|
1673
|
-
connections:
|
|
1672
|
+
(m) => {
|
|
1673
|
+
f((o) => ({
|
|
1674
|
+
...o,
|
|
1675
|
+
connections: o.connections.filter((g) => g.id !== m)
|
|
1674
1676
|
}));
|
|
1675
1677
|
},
|
|
1676
1678
|
[f]
|
|
1677
|
-
),
|
|
1678
|
-
(
|
|
1679
|
-
if (
|
|
1679
|
+
), K = I(
|
|
1680
|
+
(m) => {
|
|
1681
|
+
if (m.preventDefault(), !D || !k.current)
|
|
1680
1682
|
return;
|
|
1681
|
-
const
|
|
1682
|
-
x(
|
|
1683
|
+
const o = k.current.getBoundingClientRect(), g = m.clientX - o.left, P = m.clientY - o.top;
|
|
1684
|
+
x(D, { x: g, y: P }), w(!1), J(null);
|
|
1683
1685
|
},
|
|
1684
|
-
[
|
|
1686
|
+
[D, x]
|
|
1685
1687
|
), Y = I(async () => {
|
|
1686
|
-
if (
|
|
1687
|
-
|
|
1688
|
+
if (a) {
|
|
1689
|
+
W(!0);
|
|
1688
1690
|
try {
|
|
1689
|
-
await
|
|
1691
|
+
await a(p);
|
|
1690
1692
|
} finally {
|
|
1691
|
-
|
|
1693
|
+
W(!1);
|
|
1692
1694
|
}
|
|
1693
1695
|
}
|
|
1694
|
-
}, [p,
|
|
1696
|
+
}, [p, a]), ne = I(() => {
|
|
1695
1697
|
i == null || i(p);
|
|
1696
|
-
}, [p, i]), Z =
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
["Control", "Actions", "Data"].map((
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
|
|
1698
|
+
}, [p, i]), Z = _ && T === "canvas" ? /* @__PURE__ */ s("div", { className: "nice-integration-builder__palette", children: [
|
|
1699
|
+
/* @__PURE__ */ t("h4", { children: d("integrationBuilder.nodes", "Nodes") }),
|
|
1700
|
+
["Control", "Actions", "Data"].map((m) => /* @__PURE__ */ s("div", { className: "nice-integration-builder__category", children: [
|
|
1701
|
+
/* @__PURE__ */ t("h5", { children: m }),
|
|
1702
|
+
ge.filter((o) => o.category === m).map((o) => /* @__PURE__ */ s(
|
|
1701
1703
|
"div",
|
|
1702
1704
|
{
|
|
1703
1705
|
className: "nice-integration-builder__palette-item",
|
|
1704
1706
|
draggable: !0,
|
|
1705
1707
|
onDragStart: () => {
|
|
1706
|
-
w(!0), J(
|
|
1708
|
+
w(!0), J(o.type);
|
|
1707
1709
|
},
|
|
1708
1710
|
onDragEnd: () => {
|
|
1709
1711
|
w(!1), J(null);
|
|
1710
1712
|
},
|
|
1711
1713
|
children: [
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__palette-icon", children: /* @__PURE__ */ t(ee, { name: o.icon, size: 14 }) }),
|
|
1715
|
+
/* @__PURE__ */ t("span", { children: o.label })
|
|
1714
1716
|
]
|
|
1715
1717
|
},
|
|
1716
|
-
|
|
1718
|
+
o.type
|
|
1717
1719
|
))
|
|
1718
|
-
] },
|
|
1719
|
-
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
] },
|
|
1720
|
+
] }, m)),
|
|
1721
|
+
n.length > 0 && /* @__PURE__ */ s("div", { className: "nice-integration-builder__category", children: [
|
|
1722
|
+
/* @__PURE__ */ t("h5", { children: d("integrationBuilder.connectors", "Connectors") }),
|
|
1723
|
+
n.map((m) => /* @__PURE__ */ s("div", { className: "nice-integration-builder__palette-item", children: [
|
|
1724
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__palette-icon", children: /* @__PURE__ */ t(ee, { name: "plug", size: 14 }) }),
|
|
1725
|
+
/* @__PURE__ */ t("span", { children: m.name })
|
|
1726
|
+
] }, m.id))
|
|
1725
1727
|
] })
|
|
1726
|
-
] }) : void 0,
|
|
1727
|
-
|
|
1728
|
+
] }) : void 0, re = u && T === "canvas" ? /* @__PURE__ */ t(
|
|
1729
|
+
ut,
|
|
1728
1730
|
{
|
|
1729
1731
|
node: u,
|
|
1730
|
-
onChange: (
|
|
1732
|
+
onChange: (m) => F(u.id, m),
|
|
1731
1733
|
onClose: () => N(null)
|
|
1732
1734
|
}
|
|
1733
1735
|
) : void 0;
|
|
1734
|
-
return /* @__PURE__ */
|
|
1735
|
-
l && /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
|
|
1736
|
+
return /* @__PURE__ */ s("div", { style: { position: "relative", height: "100%" }, children: [
|
|
1737
|
+
l && /* @__PURE__ */ t("div", { style: { position: "absolute", top: 8, right: 8, zIndex: 5 }, children: /* @__PURE__ */ t(le, { steps: de(l, ct) }) }),
|
|
1738
|
+
/* @__PURE__ */ s(
|
|
1739
|
+
Te,
|
|
1738
1740
|
{
|
|
1739
1741
|
flush: !0,
|
|
1740
1742
|
className: `nice-integration-builder ${c}`,
|
|
1741
1743
|
height: "100%",
|
|
1742
1744
|
style: { minHeight: 600 },
|
|
1743
1745
|
sidebar: Z,
|
|
1744
|
-
rightSidebar:
|
|
1745
|
-
toolbar: /* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1746
|
+
rightSidebar: re,
|
|
1747
|
+
toolbar: /* @__PURE__ */ s("div", { className: "nice-integration-builder__toolbar", children: [
|
|
1748
|
+
/* @__PURE__ */ t(
|
|
1747
1749
|
"input",
|
|
1748
1750
|
{
|
|
1749
1751
|
type: "text",
|
|
1750
1752
|
value: p.name,
|
|
1751
|
-
onChange: (
|
|
1753
|
+
onChange: (m) => f((o) => ({ ...o, name: m.target.value })),
|
|
1752
1754
|
className: "nice-integration-builder__name-input"
|
|
1753
1755
|
}
|
|
1754
1756
|
),
|
|
1755
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ t("div", { className: "nice-integration-builder__tabs", children: ["canvas", "code", "variables", "settings"].map((m) => /* @__PURE__ */ t(
|
|
1756
1758
|
"button",
|
|
1757
1759
|
{
|
|
1758
|
-
className: `nice-integration-builder__tab ${T ===
|
|
1759
|
-
onClick: () => m
|
|
1760
|
-
children:
|
|
1760
|
+
className: `nice-integration-builder__tab ${T === m ? "nice-integration-builder__tab--active" : ""}`,
|
|
1761
|
+
onClick: () => h(m),
|
|
1762
|
+
children: m.charAt(0).toUpperCase() + m.slice(1)
|
|
1761
1763
|
},
|
|
1762
|
-
|
|
1764
|
+
m
|
|
1763
1765
|
)) }),
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__actions", children: [
|
|
1767
|
+
/* @__PURE__ */ s(
|
|
1766
1768
|
"button",
|
|
1767
1769
|
{
|
|
1768
1770
|
onClick: Y,
|
|
1769
1771
|
disabled: V,
|
|
1770
1772
|
className: "nice-integration-builder__run-btn",
|
|
1771
1773
|
children: [
|
|
1772
|
-
/* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ t(ee, { name: V ? "clock" : "play", size: 14 }),
|
|
1773
1775
|
" ",
|
|
1774
1776
|
V ? d("integrationBuilder.running", "Running...") : d("integrationBuilder.run", "Run")
|
|
1775
1777
|
]
|
|
1776
1778
|
}
|
|
1777
1779
|
),
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ s("button", { onClick: ne, className: "nice-integration-builder__save-btn", children: [
|
|
1781
|
+
/* @__PURE__ */ t(ee, { name: "save", size: 14 }),
|
|
1780
1782
|
" ",
|
|
1781
1783
|
d("integrationBuilder.save", "Save")
|
|
1782
1784
|
] })
|
|
1783
1785
|
] })
|
|
1784
1786
|
] }),
|
|
1785
1787
|
children: [
|
|
1786
|
-
T === "canvas" && /* @__PURE__ */
|
|
1788
|
+
T === "canvas" && /* @__PURE__ */ s(
|
|
1787
1789
|
"div",
|
|
1788
1790
|
{
|
|
1789
1791
|
role: "presentation",
|
|
1790
1792
|
ref: k,
|
|
1791
1793
|
className: `nice-integration-builder__canvas ${S ? "nice-integration-builder__canvas--dragging" : ""}`,
|
|
1792
|
-
onDragOver: (
|
|
1793
|
-
onDrop:
|
|
1794
|
+
onDragOver: (m) => m.preventDefault(),
|
|
1795
|
+
onDrop: K,
|
|
1794
1796
|
onClick: () => N(null),
|
|
1795
1797
|
children: [
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
const
|
|
1798
|
-
if (!
|
|
1798
|
+
/* @__PURE__ */ t("svg", { className: "nice-integration-builder__connections", children: p.connections.map((m) => {
|
|
1799
|
+
const o = p.nodes.find((q) => q.id === m.sourceNodeId), g = p.nodes.find((q) => q.id === m.targetNodeId);
|
|
1800
|
+
if (!o || !g)
|
|
1799
1801
|
return null;
|
|
1800
|
-
const P =
|
|
1801
|
-
return /* @__PURE__ */
|
|
1802
|
+
const P = o.position.x + 150, H = o.position.y + 30, E = g.position.x, b = g.position.y + 30, A = (P + E) / 2;
|
|
1803
|
+
return /* @__PURE__ */ t("g", { onClick: () => ie(m.id), children: /* @__PURE__ */ t(
|
|
1802
1804
|
"path",
|
|
1803
1805
|
{
|
|
1804
|
-
d: `M ${P} ${H} C ${
|
|
1806
|
+
d: `M ${P} ${H} C ${A} ${H}, ${A} ${b}, ${E} ${b}`,
|
|
1805
1807
|
className: "nice-integration-builder__connection"
|
|
1806
1808
|
}
|
|
1807
|
-
) },
|
|
1809
|
+
) }, m.id);
|
|
1808
1810
|
}) }),
|
|
1809
|
-
p.nodes.map((
|
|
1810
|
-
|
|
1811
|
+
p.nodes.map((m) => /* @__PURE__ */ t(
|
|
1812
|
+
pt,
|
|
1811
1813
|
{
|
|
1812
|
-
node:
|
|
1813
|
-
isSelected: (u == null ? void 0 : u.id) ===
|
|
1814
|
-
onSelect: () => N(
|
|
1815
|
-
onDelete: () =>
|
|
1816
|
-
onPositionChange: (
|
|
1817
|
-
onStartConnection: (
|
|
1818
|
-
|
|
1814
|
+
node: m,
|
|
1815
|
+
isSelected: (u == null ? void 0 : u.id) === m.id,
|
|
1816
|
+
onSelect: () => N(m),
|
|
1817
|
+
onDelete: () => j(m.id),
|
|
1818
|
+
onPositionChange: (o) => F(m.id, { position: o }),
|
|
1819
|
+
onStartConnection: (o) => {
|
|
1820
|
+
$(!0), z({ nodeId: m.id, output: o });
|
|
1819
1821
|
},
|
|
1820
|
-
onEndConnection: (
|
|
1821
|
-
M && R(M.nodeId, M.output,
|
|
1822
|
+
onEndConnection: (o) => {
|
|
1823
|
+
M && R(M.nodeId, M.output, m.id, o), $(!1), z(null);
|
|
1822
1824
|
}
|
|
1823
1825
|
},
|
|
1824
|
-
|
|
1826
|
+
m.id
|
|
1825
1827
|
)),
|
|
1826
|
-
p.nodes.length === 0 && /* @__PURE__ */
|
|
1828
|
+
p.nodes.length === 0 && /* @__PURE__ */ t("div", { className: "nice-integration-builder__empty", children: d(
|
|
1827
1829
|
"integrationBuilder.dragNodesFromThePalette",
|
|
1828
1830
|
"Drag nodes from the palette to build your flow"
|
|
1829
1831
|
) })
|
|
1830
1832
|
]
|
|
1831
1833
|
}
|
|
1832
1834
|
),
|
|
1833
|
-
T === "code" && /* @__PURE__ */
|
|
1834
|
-
T === "variables" && /* @__PURE__ */
|
|
1835
|
-
|
|
1835
|
+
T === "code" && /* @__PURE__ */ t("div", { className: "nice-integration-builder__code-view", children: /* @__PURE__ */ t("pre", { children: JSON.stringify(p, null, 2) }) }),
|
|
1836
|
+
T === "variables" && /* @__PURE__ */ t(
|
|
1837
|
+
mt,
|
|
1836
1838
|
{
|
|
1837
1839
|
variables: p.variables,
|
|
1838
|
-
onChange: (
|
|
1840
|
+
onChange: (m) => f((o) => ({ ...o, variables: m }))
|
|
1839
1841
|
}
|
|
1840
1842
|
),
|
|
1841
|
-
T === "settings" && /* @__PURE__ */
|
|
1842
|
-
|
|
1843
|
+
T === "settings" && /* @__PURE__ */ t(
|
|
1844
|
+
ht,
|
|
1843
1845
|
{
|
|
1844
1846
|
errorHandling: p.errorHandling,
|
|
1845
1847
|
schedule: p.schedule,
|
|
1846
|
-
onChange: (
|
|
1848
|
+
onChange: (m, o) => f((g) => ({ ...g, errorHandling: m, schedule: o }))
|
|
1847
1849
|
}
|
|
1848
1850
|
)
|
|
1849
1851
|
]
|
|
@@ -1851,8 +1853,8 @@ function dt({
|
|
|
1851
1853
|
)
|
|
1852
1854
|
] });
|
|
1853
1855
|
}
|
|
1854
|
-
function
|
|
1855
|
-
switch (
|
|
1856
|
+
function dt(e) {
|
|
1857
|
+
switch (e) {
|
|
1856
1858
|
case "http-request":
|
|
1857
1859
|
return { method: "GET", url: "", headers: {}, body: "" };
|
|
1858
1860
|
case "transform":
|
|
@@ -1882,216 +1884,216 @@ return input;` };
|
|
|
1882
1884
|
return {};
|
|
1883
1885
|
}
|
|
1884
1886
|
}
|
|
1885
|
-
function
|
|
1886
|
-
node:
|
|
1887
|
-
isSelected:
|
|
1888
|
-
onSelect:
|
|
1887
|
+
function pt({
|
|
1888
|
+
node: e,
|
|
1889
|
+
isSelected: n,
|
|
1890
|
+
onSelect: r,
|
|
1889
1891
|
onDelete: i,
|
|
1890
|
-
onPositionChange:
|
|
1892
|
+
onPositionChange: a,
|
|
1891
1893
|
onStartConnection: c,
|
|
1892
1894
|
onEndConnection: l
|
|
1893
1895
|
}) {
|
|
1894
|
-
const { t: d } =
|
|
1895
|
-
|
|
1896
|
-
x:
|
|
1897
|
-
y:
|
|
1898
|
-
}),
|
|
1896
|
+
const { t: d } = O(), [p, y] = C(!1), [u, N] = C({ x: 0, y: 0 }), _ = pe(null), v = ge.find((h) => h.type === e.type), T = (h) => {
|
|
1897
|
+
h.button === 0 && (h.stopPropagation(), y(!0), N({
|
|
1898
|
+
x: h.clientX - e.position.x,
|
|
1899
|
+
y: h.clientY - e.position.y
|
|
1900
|
+
}), r());
|
|
1899
1901
|
};
|
|
1900
|
-
return
|
|
1902
|
+
return Ce(() => {
|
|
1901
1903
|
if (!p)
|
|
1902
1904
|
return;
|
|
1903
|
-
const
|
|
1904
|
-
|
|
1905
|
+
const h = (w) => {
|
|
1906
|
+
a({
|
|
1905
1907
|
x: w.clientX - u.x,
|
|
1906
1908
|
y: w.clientY - u.y
|
|
1907
1909
|
});
|
|
1908
1910
|
}, S = () => {
|
|
1909
|
-
|
|
1911
|
+
y(!1);
|
|
1910
1912
|
};
|
|
1911
|
-
return window.addEventListener("mousemove",
|
|
1912
|
-
window.removeEventListener("mousemove",
|
|
1913
|
+
return window.addEventListener("mousemove", h), window.addEventListener("mouseup", S), () => {
|
|
1914
|
+
window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", S);
|
|
1913
1915
|
};
|
|
1914
|
-
}, [p, u,
|
|
1916
|
+
}, [p, u, a]), /* @__PURE__ */ s(
|
|
1915
1917
|
"div",
|
|
1916
1918
|
{
|
|
1917
|
-
ref:
|
|
1918
|
-
className: `nice-integration-builder__node nice-integration-builder__node--${
|
|
1919
|
+
ref: _,
|
|
1920
|
+
className: `nice-integration-builder__node nice-integration-builder__node--${e.type} ${n ? "nice-integration-builder__node--selected" : ""}`,
|
|
1919
1921
|
style: {
|
|
1920
|
-
left:
|
|
1921
|
-
top:
|
|
1922
|
+
left: e.position.x,
|
|
1923
|
+
top: e.position.y
|
|
1922
1924
|
},
|
|
1923
1925
|
onMouseDown: T,
|
|
1924
1926
|
children: [
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__node-header", children: [
|
|
1928
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__node-icon", children: /* @__PURE__ */ t(ee, { name: (v == null ? void 0 : v.icon) || "box", size: 14 }) }),
|
|
1929
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__node-name", children: e.name }),
|
|
1930
|
+
/* @__PURE__ */ t(
|
|
1929
1931
|
"button",
|
|
1930
1932
|
{
|
|
1931
1933
|
"aria-label": d("integrationBuilder.close", "Close"),
|
|
1932
1934
|
className: "nice-integration-builder__node-delete",
|
|
1933
|
-
onClick: (
|
|
1934
|
-
|
|
1935
|
+
onClick: (h) => {
|
|
1936
|
+
h.stopPropagation(), i();
|
|
1935
1937
|
},
|
|
1936
|
-
children: /* @__PURE__ */
|
|
1938
|
+
children: /* @__PURE__ */ t(ee, { name: "close", size: 14 })
|
|
1937
1939
|
}
|
|
1938
1940
|
)
|
|
1939
1941
|
] }),
|
|
1940
|
-
|
|
1942
|
+
e.inputs.map((h) => /* @__PURE__ */ s(
|
|
1941
1943
|
"div",
|
|
1942
1944
|
{
|
|
1943
1945
|
className: "nice-integration-builder__port nice-integration-builder__port--input",
|
|
1944
|
-
onMouseUp: () => l(
|
|
1946
|
+
onMouseUp: () => l(h),
|
|
1945
1947
|
children: [
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__port-dot" }),
|
|
1949
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__port-label", children: h })
|
|
1948
1950
|
]
|
|
1949
1951
|
},
|
|
1950
|
-
|
|
1952
|
+
h
|
|
1951
1953
|
)),
|
|
1952
|
-
|
|
1954
|
+
e.outputs.map((h) => /* @__PURE__ */ s(
|
|
1953
1955
|
"div",
|
|
1954
1956
|
{
|
|
1955
1957
|
className: "nice-integration-builder__port nice-integration-builder__port--output",
|
|
1956
1958
|
onMouseDown: (S) => {
|
|
1957
|
-
S.stopPropagation(), c(
|
|
1959
|
+
S.stopPropagation(), c(h);
|
|
1958
1960
|
},
|
|
1959
1961
|
children: [
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__port-label", children: h }),
|
|
1963
|
+
/* @__PURE__ */ t("span", { className: "nice-integration-builder__port-dot" })
|
|
1962
1964
|
]
|
|
1963
1965
|
},
|
|
1964
|
-
|
|
1966
|
+
h
|
|
1965
1967
|
))
|
|
1966
1968
|
]
|
|
1967
1969
|
}
|
|
1968
1970
|
);
|
|
1969
1971
|
}
|
|
1970
|
-
function
|
|
1971
|
-
node:
|
|
1972
|
-
onChange:
|
|
1973
|
-
onClose:
|
|
1972
|
+
function ut({
|
|
1973
|
+
node: e,
|
|
1974
|
+
onChange: n,
|
|
1975
|
+
onClose: r
|
|
1974
1976
|
}) {
|
|
1975
|
-
const { t: i } =
|
|
1976
|
-
return /* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
1977
|
+
const { t: i } = O();
|
|
1978
|
+
return /* @__PURE__ */ s("div", { className: "nice-integration-builder__properties", children: [
|
|
1979
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__properties-header", children: [
|
|
1980
|
+
/* @__PURE__ */ t("h4", { children: e.name }),
|
|
1981
|
+
/* @__PURE__ */ t("button", { "aria-label": i("integrationBuilder.close", "Close"), onClick: r, children: /* @__PURE__ */ t(ee, { name: "close", size: 14 }) })
|
|
1980
1982
|
] }),
|
|
1981
|
-
/* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
/* @__PURE__ */
|
|
1984
|
-
/* @__PURE__ */
|
|
1983
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__properties-content", children: [
|
|
1984
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
1985
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.name", "Name") }),
|
|
1986
|
+
/* @__PURE__ */ t(
|
|
1985
1987
|
"input",
|
|
1986
1988
|
{
|
|
1987
1989
|
type: "text",
|
|
1988
|
-
value:
|
|
1989
|
-
onChange: (
|
|
1990
|
+
value: e.name,
|
|
1991
|
+
onChange: (a) => n({ name: a.target.value })
|
|
1990
1992
|
}
|
|
1991
1993
|
)
|
|
1992
1994
|
] }),
|
|
1993
|
-
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
1995
|
+
e.type === "http-request" && /* @__PURE__ */ s(Q, { children: [
|
|
1996
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
1997
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.method", "Method") }),
|
|
1998
|
+
/* @__PURE__ */ t(
|
|
1997
1999
|
"select",
|
|
1998
2000
|
{
|
|
1999
|
-
value:
|
|
2000
|
-
onChange: (
|
|
2001
|
-
children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((
|
|
2001
|
+
value: e.config.method || "GET",
|
|
2002
|
+
onChange: (a) => n({ config: { ...e.config, method: a.target.value } }),
|
|
2003
|
+
children: ["GET", "POST", "PUT", "PATCH", "DELETE"].map((a) => /* @__PURE__ */ t("option", { value: a, children: a }, a))
|
|
2002
2004
|
}
|
|
2003
2005
|
)
|
|
2004
2006
|
] }),
|
|
2005
|
-
/* @__PURE__ */
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2008
|
+
/* @__PURE__ */ t("label", { children: "URL" }),
|
|
2009
|
+
/* @__PURE__ */ t(
|
|
2008
2010
|
"input",
|
|
2009
2011
|
{
|
|
2010
2012
|
type: "text",
|
|
2011
|
-
value:
|
|
2012
|
-
onChange: (
|
|
2013
|
+
value: e.config.url || "",
|
|
2014
|
+
onChange: (a) => n({ config: { ...e.config, url: a.target.value } }),
|
|
2013
2015
|
placeholder: "https://api.example.com/endpoint"
|
|
2014
2016
|
}
|
|
2015
2017
|
)
|
|
2016
2018
|
] })
|
|
2017
2019
|
] }),
|
|
2018
|
-
|
|
2019
|
-
/* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */
|
|
2020
|
+
e.type === "delay" && /* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2021
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.durationMs", "Duration (ms)") }),
|
|
2022
|
+
/* @__PURE__ */ t(
|
|
2021
2023
|
"input",
|
|
2022
2024
|
{
|
|
2023
2025
|
type: "number",
|
|
2024
|
-
value:
|
|
2025
|
-
onChange: (
|
|
2026
|
+
value: e.config.duration || 1e3,
|
|
2027
|
+
onChange: (a) => n({ config: { ...e.config, duration: parseInt(a.target.value, 10) } })
|
|
2026
2028
|
}
|
|
2027
2029
|
)
|
|
2028
2030
|
] }),
|
|
2029
|
-
|
|
2030
|
-
/* @__PURE__ */
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */
|
|
2031
|
+
e.type === "set-variable" && /* @__PURE__ */ s(Q, { children: [
|
|
2032
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2033
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.variableName", "Variable Name") }),
|
|
2034
|
+
/* @__PURE__ */ t(
|
|
2033
2035
|
"input",
|
|
2034
2036
|
{
|
|
2035
2037
|
type: "text",
|
|
2036
|
-
value:
|
|
2037
|
-
onChange: (
|
|
2038
|
+
value: e.config.name || "",
|
|
2039
|
+
onChange: (a) => n({ config: { ...e.config, name: a.target.value } })
|
|
2038
2040
|
}
|
|
2039
2041
|
)
|
|
2040
2042
|
] }),
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2043
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2044
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.value", "Value") }),
|
|
2045
|
+
/* @__PURE__ */ t(
|
|
2044
2046
|
"input",
|
|
2045
2047
|
{
|
|
2046
2048
|
type: "text",
|
|
2047
|
-
value:
|
|
2048
|
-
onChange: (
|
|
2049
|
+
value: e.config.value || "",
|
|
2050
|
+
onChange: (a) => n({ config: { ...e.config, value: a.target.value } })
|
|
2049
2051
|
}
|
|
2050
2052
|
)
|
|
2051
2053
|
] })
|
|
2052
2054
|
] }),
|
|
2053
|
-
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2055
|
+
e.type === "function" && /* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2056
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.code", "Code") }),
|
|
2057
|
+
/* @__PURE__ */ t(
|
|
2056
2058
|
"textarea",
|
|
2057
2059
|
{
|
|
2058
|
-
value:
|
|
2059
|
-
onChange: (
|
|
2060
|
+
value: e.config.code || "",
|
|
2061
|
+
onChange: (a) => n({ config: { ...e.config, code: a.target.value } }),
|
|
2060
2062
|
rows: 10,
|
|
2061
2063
|
className: "nice-integration-builder__code-input"
|
|
2062
2064
|
}
|
|
2063
2065
|
)
|
|
2064
2066
|
] }),
|
|
2065
|
-
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2067
|
+
e.type === "email" && /* @__PURE__ */ s(Q, { children: [
|
|
2068
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2069
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.to", "To") }),
|
|
2070
|
+
/* @__PURE__ */ t(
|
|
2069
2071
|
"input",
|
|
2070
2072
|
{
|
|
2071
2073
|
type: "text",
|
|
2072
|
-
value:
|
|
2073
|
-
onChange: (
|
|
2074
|
+
value: e.config.to || "",
|
|
2075
|
+
onChange: (a) => n({ config: { ...e.config, to: a.target.value } })
|
|
2074
2076
|
}
|
|
2075
2077
|
)
|
|
2076
2078
|
] }),
|
|
2077
|
-
/* @__PURE__ */
|
|
2078
|
-
/* @__PURE__ */
|
|
2079
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2080
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.subject", "Subject") }),
|
|
2081
|
+
/* @__PURE__ */ t(
|
|
2080
2082
|
"input",
|
|
2081
2083
|
{
|
|
2082
2084
|
type: "text",
|
|
2083
|
-
value:
|
|
2084
|
-
onChange: (
|
|
2085
|
+
value: e.config.subject || "",
|
|
2086
|
+
onChange: (a) => n({ config: { ...e.config, subject: a.target.value } })
|
|
2085
2087
|
}
|
|
2086
2088
|
)
|
|
2087
2089
|
] }),
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2090
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2091
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.body", "Body") }),
|
|
2092
|
+
/* @__PURE__ */ t(
|
|
2091
2093
|
"textarea",
|
|
2092
2094
|
{
|
|
2093
|
-
value:
|
|
2094
|
-
onChange: (
|
|
2095
|
+
value: e.config.body || "",
|
|
2096
|
+
onChange: (a) => n({ config: { ...e.config, body: a.target.value } }),
|
|
2095
2097
|
rows: 5
|
|
2096
2098
|
}
|
|
2097
2099
|
)
|
|
@@ -2100,126 +2102,126 @@ function Ze({
|
|
|
2100
2102
|
] })
|
|
2101
2103
|
] });
|
|
2102
2104
|
}
|
|
2103
|
-
function
|
|
2104
|
-
const { t:
|
|
2105
|
-
|
|
2105
|
+
function mt({ variables: e, onChange: n }) {
|
|
2106
|
+
const { t: r } = O(), i = () => {
|
|
2107
|
+
n({ ...e, newVariable: "" });
|
|
2106
2108
|
};
|
|
2107
|
-
return /* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ s("div", { className: "nice-integration-builder__variables", children: [
|
|
2110
|
+
/* @__PURE__ */ t("h4", { children: r("integrationBuilder.flowVariables", "Flow Variables") }),
|
|
2111
|
+
/* @__PURE__ */ t("div", { className: "nice-integration-builder__variables-list", children: Object.entries(e).map(([a, c]) => /* @__PURE__ */ s("div", { className: "nice-integration-builder__variable-row", children: [
|
|
2112
|
+
/* @__PURE__ */ t(
|
|
2111
2113
|
"input",
|
|
2112
2114
|
{
|
|
2113
2115
|
type: "text",
|
|
2114
|
-
value:
|
|
2116
|
+
value: a,
|
|
2115
2117
|
onChange: (l) => {
|
|
2116
|
-
const { [
|
|
2117
|
-
|
|
2118
|
+
const { [a]: d, ...p } = e;
|
|
2119
|
+
n({ ...p, [l.target.value]: c });
|
|
2118
2120
|
},
|
|
2119
|
-
placeholder:
|
|
2121
|
+
placeholder: r("integrationBuilder.name", "Name")
|
|
2120
2122
|
}
|
|
2121
2123
|
),
|
|
2122
|
-
/* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ t(
|
|
2123
2125
|
"input",
|
|
2124
2126
|
{
|
|
2125
2127
|
type: "text",
|
|
2126
2128
|
value: String(c),
|
|
2127
|
-
onChange: (l) =>
|
|
2128
|
-
placeholder:
|
|
2129
|
+
onChange: (l) => n({ ...e, [a]: l.target.value }),
|
|
2130
|
+
placeholder: r("integrationBuilder.value", "Value")
|
|
2129
2131
|
}
|
|
2130
2132
|
),
|
|
2131
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ t(
|
|
2132
2134
|
"button",
|
|
2133
2135
|
{
|
|
2134
|
-
"aria-label":
|
|
2136
|
+
"aria-label": r("integrationBuilder.close", "Close"),
|
|
2135
2137
|
onClick: () => {
|
|
2136
|
-
const { [
|
|
2137
|
-
|
|
2138
|
+
const { [a]: l, ...d } = e;
|
|
2139
|
+
n(d);
|
|
2138
2140
|
},
|
|
2139
|
-
children: /* @__PURE__ */
|
|
2141
|
+
children: /* @__PURE__ */ t(ee, { name: "close", size: 14 })
|
|
2140
2142
|
}
|
|
2141
2143
|
)
|
|
2142
|
-
] },
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
+
] }, a)) }),
|
|
2145
|
+
/* @__PURE__ */ t("button", { onClick: i, children: r("integrationBuilder.addVariable", "+ Add Variable") })
|
|
2144
2146
|
] });
|
|
2145
2147
|
}
|
|
2146
|
-
function
|
|
2147
|
-
errorHandling:
|
|
2148
|
-
schedule:
|
|
2149
|
-
onChange:
|
|
2148
|
+
function ht({
|
|
2149
|
+
errorHandling: e,
|
|
2150
|
+
schedule: n,
|
|
2151
|
+
onChange: r
|
|
2150
2152
|
}) {
|
|
2151
|
-
const { t: i } =
|
|
2152
|
-
return /* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2155
|
-
/* @__PURE__ */
|
|
2156
|
-
/* @__PURE__ */
|
|
2153
|
+
const { t: i } = O();
|
|
2154
|
+
return /* @__PURE__ */ s("div", { className: "nice-integration-builder__settings", children: [
|
|
2155
|
+
/* @__PURE__ */ t("h4", { children: i("integrationBuilder.errorHandling", "Error Handling") }),
|
|
2156
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2157
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.strategy", "Strategy") }),
|
|
2158
|
+
/* @__PURE__ */ s(
|
|
2157
2159
|
"select",
|
|
2158
2160
|
{
|
|
2159
|
-
value:
|
|
2160
|
-
onChange: (
|
|
2161
|
-
{ ...
|
|
2162
|
-
|
|
2161
|
+
value: e.strategy,
|
|
2162
|
+
onChange: (a) => r(
|
|
2163
|
+
{ ...e, strategy: a.target.value },
|
|
2164
|
+
n
|
|
2163
2165
|
),
|
|
2164
2166
|
children: [
|
|
2165
|
-
/* @__PURE__ */
|
|
2166
|
-
/* @__PURE__ */
|
|
2167
|
-
/* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ t("option", { value: "stop", children: i("integrationBuilder.stopOnError", "Stop on error") }),
|
|
2168
|
+
/* @__PURE__ */ t("option", { value: "continue", children: i("integrationBuilder.continueOnError", "Continue on error") }),
|
|
2169
|
+
/* @__PURE__ */ t("option", { value: "retry", children: i("integrationBuilder.retryOnError", "Retry on error") })
|
|
2168
2170
|
]
|
|
2169
2171
|
}
|
|
2170
2172
|
)
|
|
2171
2173
|
] }),
|
|
2172
|
-
|
|
2173
|
-
/* @__PURE__ */
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
/* @__PURE__ */
|
|
2174
|
+
e.strategy === "retry" && /* @__PURE__ */ s(Q, { children: [
|
|
2175
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2176
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.maxRetries", "Max Retries") }),
|
|
2177
|
+
/* @__PURE__ */ t(
|
|
2176
2178
|
"input",
|
|
2177
2179
|
{
|
|
2178
2180
|
type: "number",
|
|
2179
|
-
value:
|
|
2180
|
-
onChange: (
|
|
2181
|
+
value: e.maxRetries || 3,
|
|
2182
|
+
onChange: (a) => r({ ...e, maxRetries: parseInt(a.target.value, 10) }, n)
|
|
2181
2183
|
}
|
|
2182
2184
|
)
|
|
2183
2185
|
] }),
|
|
2184
|
-
/* @__PURE__ */
|
|
2185
|
-
/* @__PURE__ */
|
|
2186
|
-
/* @__PURE__ */
|
|
2186
|
+
/* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2187
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.retryDelayMs", "Retry Delay (ms)") }),
|
|
2188
|
+
/* @__PURE__ */ t(
|
|
2187
2189
|
"input",
|
|
2188
2190
|
{
|
|
2189
2191
|
type: "number",
|
|
2190
|
-
value:
|
|
2191
|
-
onChange: (
|
|
2192
|
+
value: e.retryDelay || 1e3,
|
|
2193
|
+
onChange: (a) => r({ ...e, retryDelay: parseInt(a.target.value, 10) }, n)
|
|
2192
2194
|
}
|
|
2193
2195
|
)
|
|
2194
2196
|
] })
|
|
2195
2197
|
] }),
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2198
|
+
/* @__PURE__ */ t("h4", { children: i("integrationBuilder.schedule", "Schedule") }),
|
|
2199
|
+
/* @__PURE__ */ t("div", { className: "nice-integration-builder__field", children: /* @__PURE__ */ s("label", { children: [
|
|
2200
|
+
/* @__PURE__ */ t(
|
|
2199
2201
|
"input",
|
|
2200
2202
|
{
|
|
2201
2203
|
type: "checkbox",
|
|
2202
|
-
checked: (
|
|
2203
|
-
onChange: (
|
|
2204
|
+
checked: (n == null ? void 0 : n.enabled) || !1,
|
|
2205
|
+
onChange: (a) => r(e, { ...n, enabled: a.target.checked })
|
|
2204
2206
|
}
|
|
2205
2207
|
),
|
|
2206
2208
|
i("integrationBuilder.enableScheduledExecution", "Enable scheduled execution")
|
|
2207
2209
|
] }) }),
|
|
2208
|
-
(
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
/* @__PURE__ */
|
|
2210
|
+
(n == null ? void 0 : n.enabled) && /* @__PURE__ */ s("div", { className: "nice-integration-builder__field", children: [
|
|
2211
|
+
/* @__PURE__ */ t("label", { children: i("integrationBuilder.cronExpression", "Cron Expression") }),
|
|
2212
|
+
/* @__PURE__ */ t(
|
|
2211
2213
|
"input",
|
|
2212
2214
|
{
|
|
2213
2215
|
type: "text",
|
|
2214
|
-
value:
|
|
2215
|
-
onChange: (
|
|
2216
|
+
value: n.cron || "",
|
|
2217
|
+
onChange: (a) => r(e, { ...n, cron: a.target.value }),
|
|
2216
2218
|
placeholder: "0 0 * * *"
|
|
2217
2219
|
}
|
|
2218
2220
|
)
|
|
2219
2221
|
] })
|
|
2220
2222
|
] });
|
|
2221
2223
|
}
|
|
2222
|
-
const
|
|
2224
|
+
const gt = [
|
|
2223
2225
|
{
|
|
2224
2226
|
target: ".nice-webhook-tester",
|
|
2225
2227
|
titleKey: "tutorial.webhookTester.intro.title",
|
|
@@ -2229,112 +2231,112 @@ const it = [
|
|
|
2229
2231
|
placement: "auto"
|
|
2230
2232
|
}
|
|
2231
2233
|
];
|
|
2232
|
-
function
|
|
2233
|
-
return
|
|
2234
|
+
function Ne(e) {
|
|
2235
|
+
return e ? Object.entries(e).map(([n, r]) => ({ key: n, value: r })) : [];
|
|
2234
2236
|
}
|
|
2235
|
-
function
|
|
2236
|
-
const
|
|
2237
|
-
for (const
|
|
2238
|
-
|
|
2239
|
-
return
|
|
2237
|
+
function we(e) {
|
|
2238
|
+
const n = {};
|
|
2239
|
+
for (const r of e)
|
|
2240
|
+
r.key.trim() !== "" && (n[r.key] = r.value);
|
|
2241
|
+
return n;
|
|
2240
2242
|
}
|
|
2241
|
-
async function
|
|
2243
|
+
async function bt(e, n) {
|
|
2242
2244
|
var l;
|
|
2243
|
-
const
|
|
2244
|
-
if (!
|
|
2245
|
+
const r = (l = globalThis.crypto) == null ? void 0 : l.subtle;
|
|
2246
|
+
if (!r)
|
|
2245
2247
|
throw new Error("Web Crypto (crypto.subtle) is unavailable in this environment");
|
|
2246
|
-
const i = new TextEncoder(),
|
|
2248
|
+
const i = new TextEncoder(), a = await r.importKey(
|
|
2247
2249
|
"raw",
|
|
2248
|
-
i.encode(
|
|
2250
|
+
i.encode(e),
|
|
2249
2251
|
{ name: "HMAC", hash: "SHA-256" },
|
|
2250
2252
|
!1,
|
|
2251
2253
|
["sign"]
|
|
2252
|
-
), c = await
|
|
2254
|
+
), c = await r.sign("HMAC", a, i.encode(n));
|
|
2253
2255
|
return [...new Uint8Array(c)].map((d) => d.toString(16).padStart(2, "0")).join("");
|
|
2254
2256
|
}
|
|
2255
|
-
const
|
|
2256
|
-
function(
|
|
2257
|
-
const { t: i } =
|
|
2258
|
-
url:
|
|
2257
|
+
const Dt = /* @__PURE__ */ xe(
|
|
2258
|
+
function(n, r) {
|
|
2259
|
+
const { t: i } = O(), {
|
|
2260
|
+
url: a = "",
|
|
2259
2261
|
method: c = "POST",
|
|
2260
2262
|
headers: l,
|
|
2261
2263
|
payload: d = "",
|
|
2262
2264
|
samples: p = [],
|
|
2263
|
-
onSend:
|
|
2265
|
+
onSend: y,
|
|
2264
2266
|
signing: u,
|
|
2265
2267
|
onSaveSample: N,
|
|
2266
|
-
tutorial:
|
|
2267
|
-
className:
|
|
2268
|
+
tutorial: _,
|
|
2269
|
+
className: v,
|
|
2268
2270
|
style: T,
|
|
2269
|
-
id:
|
|
2271
|
+
id: h,
|
|
2270
2272
|
"data-testid": S
|
|
2271
|
-
} =
|
|
2272
|
-
|
|
2273
|
-
var
|
|
2274
|
-
Z && ((
|
|
2273
|
+
} = n, [w, D] = C(a), [J, te] = C(c), [$, M] = C(() => Ne(l)), [z, V] = C(d), [W, k] = C(""), [f, x] = C(!1), [j, F] = C(null), [R, ie] = C(null), [K, Y] = C(null), ne = pe(null), Z = K !== null;
|
|
2274
|
+
Ce(() => {
|
|
2275
|
+
var b;
|
|
2276
|
+
Z && ((b = ne.current) == null || b.focus());
|
|
2275
2277
|
}, [Z]);
|
|
2276
|
-
const
|
|
2277
|
-
const
|
|
2278
|
-
for (const
|
|
2279
|
-
|
|
2280
|
-
return
|
|
2281
|
-
}, [p]),
|
|
2282
|
-
k(
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
},
|
|
2286
|
-
M((q) => q.map((
|
|
2278
|
+
const re = Ie(() => {
|
|
2279
|
+
const b = /* @__PURE__ */ new Map();
|
|
2280
|
+
for (const A of p)
|
|
2281
|
+
b.set(A.id, A);
|
|
2282
|
+
return b;
|
|
2283
|
+
}, [p]), m = (b) => {
|
|
2284
|
+
k(b);
|
|
2285
|
+
const A = re.get(b);
|
|
2286
|
+
A && (V(A.payload), A.headers && M(Ne(A.headers)));
|
|
2287
|
+
}, o = (b, A) => {
|
|
2288
|
+
M((q) => q.map((G, X) => X === b ? { ...G, ...A } : G));
|
|
2287
2289
|
}, g = async () => {
|
|
2288
2290
|
x(!0), F(null), ie(null);
|
|
2289
2291
|
try {
|
|
2290
|
-
const
|
|
2292
|
+
const b = we($);
|
|
2291
2293
|
if (u && u.secret) {
|
|
2292
|
-
const X = await
|
|
2293
|
-
|
|
2294
|
+
const X = await bt(u.secret, z);
|
|
2295
|
+
b[u.header] = `${u.prefix ?? ""}${X}`;
|
|
2294
2296
|
}
|
|
2295
|
-
const
|
|
2296
|
-
(typeof performance < "u" ? performance.now() : Date.now()) -
|
|
2297
|
+
const A = typeof performance < "u" ? performance.now() : Date.now(), q = await y({ url: w, method: J ?? "POST", headers: b, body: z }), G = Math.round(
|
|
2298
|
+
(typeof performance < "u" ? performance.now() : Date.now()) - A
|
|
2297
2299
|
);
|
|
2298
|
-
ie({ ...q, durationMs: q.durationMs ??
|
|
2299
|
-
} catch (
|
|
2300
|
-
F(
|
|
2300
|
+
ie({ ...q, durationMs: q.durationMs ?? G });
|
|
2301
|
+
} catch (b) {
|
|
2302
|
+
F(b instanceof Error ? b.message : String(b));
|
|
2301
2303
|
} finally {
|
|
2302
2304
|
x(!1);
|
|
2303
2305
|
}
|
|
2304
2306
|
}, P = () => {
|
|
2305
|
-
const
|
|
2306
|
-
!N || !
|
|
2307
|
+
const b = K == null ? void 0 : K.trim();
|
|
2308
|
+
!N || !b || (N({
|
|
2307
2309
|
id: `sample_${Date.now().toString(36)}`,
|
|
2308
|
-
name:
|
|
2309
|
-
payload:
|
|
2310
|
-
headers:
|
|
2310
|
+
name: b,
|
|
2311
|
+
payload: z,
|
|
2312
|
+
headers: we($)
|
|
2311
2313
|
}), Y(null));
|
|
2312
|
-
}, H = R == null ? "" : R.status >= 200 && R.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", E = "nice-webhook-tester" + (
|
|
2313
|
-
return /* @__PURE__ */
|
|
2314
|
-
|
|
2315
|
-
/* @__PURE__ */
|
|
2316
|
-
/* @__PURE__ */
|
|
2314
|
+
}, H = R == null ? "" : R.status >= 200 && R.status < 300 ? " nice-webhook-tester__status--ok" : " nice-webhook-tester__status--error", E = "nice-webhook-tester" + (v ? ` ${v}` : "");
|
|
2315
|
+
return /* @__PURE__ */ s("div", { ref: r, id: h, className: E, style: T, "data-testid": S, children: [
|
|
2316
|
+
_ && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__tutorial", children: /* @__PURE__ */ t(le, { steps: de(_, gt) }) }),
|
|
2317
|
+
/* @__PURE__ */ s("div", { className: "nice-webhook-tester__bar", children: [
|
|
2318
|
+
/* @__PURE__ */ t(
|
|
2317
2319
|
"select",
|
|
2318
2320
|
{
|
|
2319
2321
|
className: "nice-webhook-tester__method",
|
|
2320
2322
|
value: J,
|
|
2321
|
-
onChange: (
|
|
2323
|
+
onChange: (b) => te(b.target.value),
|
|
2322
2324
|
"aria-label": i("webhookTester.method", "Method"),
|
|
2323
|
-
children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((
|
|
2325
|
+
children: ["POST", "PUT", "GET", "PATCH", "DELETE"].map((b) => /* @__PURE__ */ t("option", { value: b, children: b }, b))
|
|
2324
2326
|
}
|
|
2325
2327
|
),
|
|
2326
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ t(
|
|
2327
2329
|
"input",
|
|
2328
2330
|
{
|
|
2329
2331
|
type: "text",
|
|
2330
2332
|
className: "nice-webhook-tester__url",
|
|
2331
2333
|
value: w,
|
|
2332
2334
|
placeholder: "https://example.com/api/payments/stripe/webhook",
|
|
2333
|
-
onChange: (
|
|
2335
|
+
onChange: (b) => D(b.target.value),
|
|
2334
2336
|
"aria-label": i("webhookTester.url", "URL")
|
|
2335
2337
|
}
|
|
2336
2338
|
),
|
|
2337
|
-
/* @__PURE__ */
|
|
2339
|
+
/* @__PURE__ */ t(
|
|
2338
2340
|
"button",
|
|
2339
2341
|
{
|
|
2340
2342
|
type: "button",
|
|
@@ -2345,69 +2347,69 @@ const pt = /* @__PURE__ */ Se(
|
|
|
2345
2347
|
}
|
|
2346
2348
|
)
|
|
2347
2349
|
] }),
|
|
2348
|
-
p.length > 0 && /* @__PURE__ */
|
|
2350
|
+
p.length > 0 && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__samples", children: /* @__PURE__ */ s("label", { children: [
|
|
2349
2351
|
i("webhookTester.sample", "Sample:"),
|
|
2350
2352
|
" ",
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
p.map((
|
|
2353
|
+
/* @__PURE__ */ s("select", { value: W, onChange: (b) => m(b.target.value), children: [
|
|
2354
|
+
/* @__PURE__ */ t("option", { value: "", children: i("webhookTester.chooseASavedPayload", "— choose a saved payload —") }),
|
|
2355
|
+
p.map((b) => /* @__PURE__ */ t("option", { value: b.id, children: b.name }, b.id))
|
|
2354
2356
|
] })
|
|
2355
2357
|
] }) }),
|
|
2356
|
-
/* @__PURE__ */
|
|
2357
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ s("div", { className: "nice-webhook-tester__headers", children: [
|
|
2359
|
+
/* @__PURE__ */ s("div", { className: "nice-webhook-tester__section-label", children: [
|
|
2358
2360
|
i("webhookTester.headers", "Headers"),
|
|
2359
|
-
u && /* @__PURE__ */
|
|
2361
|
+
u && /* @__PURE__ */ s("span", { className: "nice-webhook-tester__signed", children: [
|
|
2360
2362
|
" ",
|
|
2361
2363
|
i("webhookTester.autoSigns", "· auto-signs"),
|
|
2362
2364
|
" ",
|
|
2363
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ t("code", { children: u.header })
|
|
2364
2366
|
] })
|
|
2365
2367
|
] }),
|
|
2366
|
-
|
|
2367
|
-
/* @__PURE__ */
|
|
2368
|
+
$.map((b, A) => /* @__PURE__ */ s("div", { className: "nice-webhook-tester__header-row", children: [
|
|
2369
|
+
/* @__PURE__ */ t(
|
|
2368
2370
|
"input",
|
|
2369
2371
|
{
|
|
2370
2372
|
type: "text",
|
|
2371
|
-
value:
|
|
2373
|
+
value: b.key,
|
|
2372
2374
|
placeholder: i("webhookTester.header", "Header"),
|
|
2373
|
-
onChange: (q) =>
|
|
2375
|
+
onChange: (q) => o(A, { key: q.target.value }),
|
|
2374
2376
|
"aria-label": i("webhookTester.headerName", "Header name")
|
|
2375
2377
|
}
|
|
2376
2378
|
),
|
|
2377
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ t(
|
|
2378
2380
|
"input",
|
|
2379
2381
|
{
|
|
2380
2382
|
type: "text",
|
|
2381
|
-
value:
|
|
2383
|
+
value: b.value,
|
|
2382
2384
|
placeholder: i("webhookTester.value", "Value"),
|
|
2383
|
-
onChange: (q) =>
|
|
2385
|
+
onChange: (q) => o(A, { value: q.target.value }),
|
|
2384
2386
|
"aria-label": i("webhookTester.headerValue", "Header value")
|
|
2385
2387
|
}
|
|
2386
2388
|
),
|
|
2387
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ t(
|
|
2388
2390
|
"button",
|
|
2389
2391
|
{
|
|
2390
2392
|
type: "button",
|
|
2391
|
-
onClick: () => M((q) => q.filter((
|
|
2393
|
+
onClick: () => M((q) => q.filter((G, X) => X !== A)),
|
|
2392
2394
|
"aria-label": i("webhookTester.removeHeader", "Remove header"),
|
|
2393
|
-
children: /* @__PURE__ */
|
|
2395
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 12 })
|
|
2394
2396
|
}
|
|
2395
2397
|
)
|
|
2396
|
-
] },
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
+
] }, A)),
|
|
2399
|
+
/* @__PURE__ */ t(
|
|
2398
2400
|
"button",
|
|
2399
2401
|
{
|
|
2400
2402
|
type: "button",
|
|
2401
2403
|
className: "nice-webhook-tester__add-header",
|
|
2402
|
-
onClick: () => M((
|
|
2404
|
+
onClick: () => M((b) => [...b, { key: "", value: "" }]),
|
|
2403
2405
|
children: i("webhookTester.header2", "+ Header")
|
|
2404
2406
|
}
|
|
2405
2407
|
)
|
|
2406
2408
|
] }),
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ s("div", { className: "nice-webhook-tester__payload", children: [
|
|
2410
|
+
/* @__PURE__ */ s("div", { className: "nice-webhook-tester__section-label", children: [
|
|
2409
2411
|
i("webhookTester.payload", "Payload"),
|
|
2410
|
-
N && /* @__PURE__ */
|
|
2412
|
+
N && /* @__PURE__ */ t(
|
|
2411
2413
|
"button",
|
|
2412
2414
|
{
|
|
2413
2415
|
type: "button",
|
|
@@ -2418,68 +2420,372 @@ const pt = /* @__PURE__ */ Se(
|
|
|
2418
2420
|
}
|
|
2419
2421
|
)
|
|
2420
2422
|
] }),
|
|
2421
|
-
N && Z && /* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
+
N && Z && /* @__PURE__ */ s("div", { className: "nice-webhook-tester__header-row", children: [
|
|
2424
|
+
/* @__PURE__ */ t(
|
|
2423
2425
|
"input",
|
|
2424
2426
|
{
|
|
2425
2427
|
ref: ne,
|
|
2426
2428
|
type: "text",
|
|
2427
|
-
value:
|
|
2429
|
+
value: K,
|
|
2428
2430
|
placeholder: i("webhookTester.sampleNamePrompt", "Sample name"),
|
|
2429
2431
|
"aria-label": i("webhookTester.sampleNamePrompt", "Sample name"),
|
|
2430
|
-
onChange: (
|
|
2431
|
-
onKeyDown: (
|
|
2432
|
-
|
|
2432
|
+
onChange: (b) => Y(b.target.value),
|
|
2433
|
+
onKeyDown: (b) => {
|
|
2434
|
+
b.key === "Enter" ? (b.preventDefault(), P()) : b.key === "Escape" && Y(null);
|
|
2433
2435
|
}
|
|
2434
2436
|
}
|
|
2435
2437
|
),
|
|
2436
|
-
/* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ t("button", { type: "button", onClick: P, disabled: !K.trim(), children: i("save", "Save") }),
|
|
2439
|
+
/* @__PURE__ */ t(
|
|
2438
2440
|
"button",
|
|
2439
2441
|
{
|
|
2440
2442
|
type: "button",
|
|
2441
2443
|
onClick: () => Y(null),
|
|
2442
2444
|
"aria-label": i("cancel", "Cancel"),
|
|
2443
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ t(B, { name: "close", size: 12 })
|
|
2444
2446
|
}
|
|
2445
2447
|
)
|
|
2446
2448
|
] }),
|
|
2447
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ t(
|
|
2448
2450
|
"textarea",
|
|
2449
2451
|
{
|
|
2450
2452
|
className: "nice-webhook-tester__textarea",
|
|
2451
|
-
value:
|
|
2453
|
+
value: z,
|
|
2452
2454
|
spellCheck: !1,
|
|
2453
2455
|
rows: 8,
|
|
2454
2456
|
placeholder: i(
|
|
2455
2457
|
"webhookTester.typePaymentSucceededData",
|
|
2456
2458
|
'{ "type": "payment.succeeded", "data": { ... } }'
|
|
2457
2459
|
),
|
|
2458
|
-
onChange: (
|
|
2460
|
+
onChange: (b) => V(b.target.value),
|
|
2459
2461
|
"aria-label": i("webhookTester.payload", "Payload")
|
|
2460
2462
|
}
|
|
2461
2463
|
)
|
|
2462
2464
|
] }),
|
|
2463
|
-
|
|
2464
|
-
R && /* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2465
|
+
j && /* @__PURE__ */ t("div", { className: "nice-webhook-tester__error", children: j }),
|
|
2466
|
+
R && /* @__PURE__ */ s("div", { className: "nice-webhook-tester__response", children: [
|
|
2467
|
+
/* @__PURE__ */ s("div", { className: "nice-webhook-tester__section-label", children: [
|
|
2466
2468
|
i("webhookTester.response", "Response"),
|
|
2467
2469
|
" ",
|
|
2468
|
-
/* @__PURE__ */
|
|
2469
|
-
R.durationMs != null && /* @__PURE__ */
|
|
2470
|
+
/* @__PURE__ */ t("span", { className: "nice-webhook-tester__status" + H, children: R.status }),
|
|
2471
|
+
R.durationMs != null && /* @__PURE__ */ s("span", { className: "nice-webhook-tester__time", children: [
|
|
2470
2472
|
" · ",
|
|
2471
2473
|
R.durationMs,
|
|
2472
2474
|
" ms"
|
|
2473
2475
|
] })
|
|
2474
2476
|
] }),
|
|
2475
|
-
R.body != null && /* @__PURE__ */
|
|
2477
|
+
R.body != null && /* @__PURE__ */ t("pre", { className: "nice-webhook-tester__response-body", children: R.body })
|
|
2476
2478
|
] })
|
|
2477
2479
|
] });
|
|
2478
2480
|
}
|
|
2479
|
-
);
|
|
2481
|
+
), _t = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"];
|
|
2482
|
+
function yt(e) {
|
|
2483
|
+
var n, r, i, a, c, l, d;
|
|
2484
|
+
switch (e == null ? void 0 : e.type) {
|
|
2485
|
+
case void 0:
|
|
2486
|
+
return;
|
|
2487
|
+
case "none":
|
|
2488
|
+
return { type: "none" };
|
|
2489
|
+
case "api-key":
|
|
2490
|
+
return e.apiKey ? { type: "apiKey", key: e.apiKey.key, value: e.apiKey.value, in: e.apiKey.in } : void 0;
|
|
2491
|
+
case "bearer":
|
|
2492
|
+
return { type: "bearer", token: ((n = e.bearer) == null ? void 0 : n.token) ?? "", prefix: (r = e.bearer) == null ? void 0 : r.prefix };
|
|
2493
|
+
case "basic":
|
|
2494
|
+
return {
|
|
2495
|
+
type: "basic",
|
|
2496
|
+
username: ((i = e.basic) == null ? void 0 : i.username) ?? "",
|
|
2497
|
+
password: ((a = e.basic) == null ? void 0 : a.password) ?? ""
|
|
2498
|
+
};
|
|
2499
|
+
case "oauth2":
|
|
2500
|
+
return {
|
|
2501
|
+
type: "oauth2",
|
|
2502
|
+
grant: "clientCredentials",
|
|
2503
|
+
clientId: "",
|
|
2504
|
+
accessToken: (c = e.oauth2) == null ? void 0 : c.accessToken,
|
|
2505
|
+
tokenType: (l = e.oauth2) == null ? void 0 : l.tokenType,
|
|
2506
|
+
refreshToken: (d = e.oauth2) == null ? void 0 : d.refreshToken
|
|
2507
|
+
};
|
|
2508
|
+
default:
|
|
2509
|
+
return;
|
|
2510
|
+
}
|
|
2511
|
+
}
|
|
2512
|
+
function vt(e) {
|
|
2513
|
+
switch (e == null ? void 0 : e.type) {
|
|
2514
|
+
case "none":
|
|
2515
|
+
return { type: "none" };
|
|
2516
|
+
case "apiKey":
|
|
2517
|
+
return e.in === "cookie" ? void 0 : { type: "api-key", apiKey: { key: e.key, value: e.value, in: e.in } };
|
|
2518
|
+
case "bearer":
|
|
2519
|
+
return { type: "bearer", bearer: { token: e.token, prefix: e.prefix } };
|
|
2520
|
+
case "basic":
|
|
2521
|
+
return { type: "basic", basic: { username: e.username, password: e.password } };
|
|
2522
|
+
case "oauth2":
|
|
2523
|
+
return {
|
|
2524
|
+
type: "oauth2",
|
|
2525
|
+
oauth2: {
|
|
2526
|
+
accessToken: e.accessToken ?? "",
|
|
2527
|
+
tokenType: e.tokenType,
|
|
2528
|
+
refreshToken: e.refreshToken
|
|
2529
|
+
}
|
|
2530
|
+
};
|
|
2531
|
+
default:
|
|
2532
|
+
return;
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
function ft(e) {
|
|
2536
|
+
if (!e)
|
|
2537
|
+
return { kind: "none" };
|
|
2538
|
+
const n = e.content, r = () => n && typeof n == "object" && !(typeof FormData < "u" && n instanceof FormData) ? n : {}, i = typeof n == "string" ? n : n === void 0 ? "" : JSON.stringify(n, null, 2);
|
|
2539
|
+
switch (e.type) {
|
|
2540
|
+
case "json":
|
|
2541
|
+
return { kind: "json", text: i };
|
|
2542
|
+
case "raw":
|
|
2543
|
+
return { kind: "text", text: i };
|
|
2544
|
+
case "x-www-form-urlencoded":
|
|
2545
|
+
return {
|
|
2546
|
+
kind: "form",
|
|
2547
|
+
fields: Object.entries(r()).map(([a, c]) => ({
|
|
2548
|
+
key: a,
|
|
2549
|
+
value: String(c ?? "")
|
|
2550
|
+
}))
|
|
2551
|
+
};
|
|
2552
|
+
case "form-data":
|
|
2553
|
+
return {
|
|
2554
|
+
kind: "multipart",
|
|
2555
|
+
parts: Object.entries(r()).map(([a, c]) => ({
|
|
2556
|
+
key: a,
|
|
2557
|
+
value: String(c ?? ""),
|
|
2558
|
+
type: "text"
|
|
2559
|
+
}))
|
|
2560
|
+
};
|
|
2561
|
+
case "binary":
|
|
2562
|
+
return { kind: "binary" };
|
|
2563
|
+
default:
|
|
2564
|
+
return { kind: "none" };
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
function Nt(e) {
|
|
2568
|
+
switch (e.kind) {
|
|
2569
|
+
case "none":
|
|
2570
|
+
return;
|
|
2571
|
+
case "json":
|
|
2572
|
+
return { type: "json", content: e.text };
|
|
2573
|
+
case "form":
|
|
2574
|
+
return { type: "x-www-form-urlencoded", content: oe(e.fields) };
|
|
2575
|
+
case "multipart":
|
|
2576
|
+
return {
|
|
2577
|
+
type: "form-data",
|
|
2578
|
+
content: oe(e.parts.filter((n) => n.type !== "file"))
|
|
2579
|
+
};
|
|
2580
|
+
case "binary":
|
|
2581
|
+
return { type: "binary" };
|
|
2582
|
+
case "xml":
|
|
2583
|
+
case "text":
|
|
2584
|
+
return { type: "raw", content: e.text };
|
|
2585
|
+
case "graphql":
|
|
2586
|
+
return {
|
|
2587
|
+
type: "json",
|
|
2588
|
+
content: JSON.stringify({
|
|
2589
|
+
query: e.query,
|
|
2590
|
+
variables: e.variables ? JSON.parse(e.variables) : void 0
|
|
2591
|
+
})
|
|
2592
|
+
};
|
|
2593
|
+
case "soap":
|
|
2594
|
+
return { type: "raw", content: e.envelope };
|
|
2595
|
+
default:
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
function Pe(e) {
|
|
2600
|
+
const n = Oe({
|
|
2601
|
+
id: e.id,
|
|
2602
|
+
name: e.name,
|
|
2603
|
+
method: e.method,
|
|
2604
|
+
params: [
|
|
2605
|
+
...Object.entries(e.headers ?? {}).map(([i, a]) => ({
|
|
2606
|
+
key: i,
|
|
2607
|
+
value: a,
|
|
2608
|
+
in: "header"
|
|
2609
|
+
})),
|
|
2610
|
+
...Object.entries(e.queryParams ?? {}).map(([i, a]) => ({
|
|
2611
|
+
key: i,
|
|
2612
|
+
value: a,
|
|
2613
|
+
in: "query"
|
|
2614
|
+
}))
|
|
2615
|
+
],
|
|
2616
|
+
body: ft(e.body),
|
|
2617
|
+
auth: yt(e.auth)
|
|
2618
|
+
}), r = Be(
|
|
2619
|
+
{ ...n, params: n.params.filter((i) => i.in !== "query") },
|
|
2620
|
+
e.url
|
|
2621
|
+
);
|
|
2622
|
+
return {
|
|
2623
|
+
...r,
|
|
2624
|
+
params: [...r.params, ...n.params.filter((i) => i.in === "query")]
|
|
2625
|
+
};
|
|
2626
|
+
}
|
|
2627
|
+
function be(e) {
|
|
2628
|
+
const n = _t.includes(e.method.toUpperCase()) ? e.method.toUpperCase() : "GET";
|
|
2629
|
+
return {
|
|
2630
|
+
id: e.id,
|
|
2631
|
+
name: e.name,
|
|
2632
|
+
method: n,
|
|
2633
|
+
url: ze({ ...e, params: e.params.filter((r) => r.in === "path") }),
|
|
2634
|
+
headers: oe(e.params.filter((r) => r.in === "header" && ye(r))),
|
|
2635
|
+
queryParams: oe(e.params.filter((r) => r.in === "query" && ye(r))),
|
|
2636
|
+
body: Nt(e.body),
|
|
2637
|
+
auth: vt(e.auth)
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
function Ae(e) {
|
|
2641
|
+
return Ke({
|
|
2642
|
+
id: e.id,
|
|
2643
|
+
name: e.name,
|
|
2644
|
+
items: [
|
|
2645
|
+
...(e.folders ?? []).map(Ae),
|
|
2646
|
+
...e.requests.map(Pe)
|
|
2647
|
+
]
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2650
|
+
function xt(e) {
|
|
2651
|
+
return qe({
|
|
2652
|
+
id: e.id,
|
|
2653
|
+
name: e.name,
|
|
2654
|
+
description: e.description,
|
|
2655
|
+
items: [
|
|
2656
|
+
...(e.folders ?? []).map(Ae),
|
|
2657
|
+
...e.requests.map(Pe)
|
|
2658
|
+
],
|
|
2659
|
+
variables: Object.entries(e.variables ?? {}).map(([n, r]) => ({ key: n, value: r }))
|
|
2660
|
+
});
|
|
2661
|
+
}
|
|
2662
|
+
function It(e) {
|
|
2663
|
+
const n = (r) => r.filter((i) => i.kind === "folder").map((i) => ({
|
|
2664
|
+
id: i.id,
|
|
2665
|
+
name: i.name,
|
|
2666
|
+
requests: i.items.filter((a) => a.kind === "request").map(be),
|
|
2667
|
+
folders: n(i.items)
|
|
2668
|
+
}));
|
|
2669
|
+
return {
|
|
2670
|
+
id: e.id,
|
|
2671
|
+
name: e.name,
|
|
2672
|
+
description: e.description,
|
|
2673
|
+
requests: e.items.filter((r) => r.kind === "request").map(be),
|
|
2674
|
+
folders: n(e.items),
|
|
2675
|
+
variables: oe(e.variables)
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
function Rt(e) {
|
|
2679
|
+
return je(e.items).map(({ request: n }) => be(n));
|
|
2680
|
+
}
|
|
2681
|
+
function qt(e) {
|
|
2682
|
+
return $e(e);
|
|
2683
|
+
}
|
|
2684
|
+
function Ot(e) {
|
|
2685
|
+
return Re(e);
|
|
2686
|
+
}
|
|
2480
2687
|
export {
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2688
|
+
zt as GRAPHQL_INTROSPECTION_QUERY,
|
|
2689
|
+
jt as NICE_API_AUTH_TYPES,
|
|
2690
|
+
Kt as NICE_API_CODE_LANGUAGES,
|
|
2691
|
+
Ht as NICE_API_MARKDOWN_LABELS,
|
|
2692
|
+
Ut as NICE_API_METHODS,
|
|
2693
|
+
Et as NiceAPIDesigner,
|
|
2694
|
+
Pt as NiceAPITester,
|
|
2695
|
+
At as NiceIntegrationBuilder,
|
|
2696
|
+
Dt as NiceWebhookTester,
|
|
2697
|
+
Mt as NiceYamlError,
|
|
2698
|
+
Lt as POSTMAN_SCHEMA_V21,
|
|
2699
|
+
Vt as bodyContentType,
|
|
2700
|
+
Ft as bodyFromText,
|
|
2701
|
+
Jt as bodyText,
|
|
2702
|
+
Gt as buildAuthorizationUrl,
|
|
2703
|
+
Wt as buildGraphqlOperation,
|
|
2704
|
+
ze as buildRequestUrl,
|
|
2705
|
+
Yt as buildSoapEnvelope,
|
|
2706
|
+
Xt as collectionToMarkdown,
|
|
2707
|
+
Ot as collectionToOpenApiSchema,
|
|
2708
|
+
Qt as createPkcePair,
|
|
2709
|
+
Zt as detectApiDocument,
|
|
2710
|
+
ei as digest,
|
|
2711
|
+
ti as digestAuthorization,
|
|
2712
|
+
ii as effectiveAuth,
|
|
2713
|
+
ni as exchangeAuthorizationCode,
|
|
2714
|
+
ri as exportHar,
|
|
2715
|
+
Re as exportOpenApi,
|
|
2716
|
+
ai as exportOpenApiYaml,
|
|
2717
|
+
si as exportPostman,
|
|
2718
|
+
oi as exportPostmanEnvironment,
|
|
2719
|
+
ci as fetchOAuth2Token,
|
|
2720
|
+
li as fetchTransport,
|
|
2721
|
+
di as findApiItem,
|
|
2722
|
+
pi as findVariables,
|
|
2723
|
+
je as flattenApiRequests,
|
|
2724
|
+
xt as fromApiTesterCollection,
|
|
2725
|
+
Pe as fromApiTesterRequest,
|
|
2726
|
+
ui as fromBase64,
|
|
2727
|
+
mi as generateCode,
|
|
2728
|
+
hi as graphqlExampleValue,
|
|
2729
|
+
gi as graphqlOperations,
|
|
2730
|
+
bi as graphqlTypeName,
|
|
2731
|
+
_i as headerValue,
|
|
2732
|
+
yi as hmac,
|
|
2733
|
+
vi as importApiDocument,
|
|
2734
|
+
fi as importGraphqlIntrospection,
|
|
2735
|
+
Ni as importHar,
|
|
2736
|
+
$e as importOpenApi,
|
|
2737
|
+
wi as importPostman,
|
|
2738
|
+
Ti as importPostmanEnvironment,
|
|
2739
|
+
ki as importWsdl,
|
|
2740
|
+
Ci as inferSchema,
|
|
2741
|
+
Si as interpolate,
|
|
2742
|
+
Ei as isCurlCommand,
|
|
2743
|
+
ye as isEnabled,
|
|
2744
|
+
Pi as isHar,
|
|
2745
|
+
Ai as isPostmanCollection,
|
|
2746
|
+
Di as joinUrl,
|
|
2747
|
+
xi as jsonPointer,
|
|
2748
|
+
Ii as md5Hex,
|
|
2749
|
+
Ri as mockFromSchema,
|
|
2750
|
+
qi as mockResponse,
|
|
2751
|
+
Oi as namedType,
|
|
2752
|
+
qe as newApiCollection,
|
|
2753
|
+
Ke as newApiFolder,
|
|
2754
|
+
Bi as newApiId,
|
|
2755
|
+
Oe as newApiRequest,
|
|
2756
|
+
qt as openApiSchemaToCollection,
|
|
2757
|
+
$i as paramsIn,
|
|
2758
|
+
zi as parseCurl,
|
|
2759
|
+
ji as parseDigestChallenge,
|
|
2760
|
+
Ki as parseFormEncoded,
|
|
2761
|
+
Hi as parseGraphqlIntrospection,
|
|
2762
|
+
Ui as parseJsonOrYaml,
|
|
2763
|
+
Mi as parseWsdl,
|
|
2764
|
+
Li as parseYaml,
|
|
2765
|
+
Vi as pathParamNames,
|
|
2766
|
+
Fi as pollDeviceToken,
|
|
2767
|
+
Ji as refreshOAuth2Token,
|
|
2768
|
+
Gi as requestName,
|
|
2769
|
+
Wi as resolvePlainScalar,
|
|
2770
|
+
Yi as resolveRequest,
|
|
2771
|
+
oe as rowsToRecord,
|
|
2772
|
+
Xi as schemaResolver,
|
|
2773
|
+
Qi as sendApiRequest,
|
|
2774
|
+
Be as setRequestUrl,
|
|
2775
|
+
Zi as signAwsV4,
|
|
2776
|
+
en as signHmac,
|
|
2777
|
+
tn as splitUrl,
|
|
2778
|
+
nn as startDeviceAuthorization,
|
|
2779
|
+
rn as stringifyYaml,
|
|
2780
|
+
an as swagger2ToOpenApi3,
|
|
2781
|
+
sn as syncPathParams,
|
|
2782
|
+
It as toApiTesterCollection,
|
|
2783
|
+
be as toApiTesterRequest,
|
|
2784
|
+
Rt as toApiTesterRequests,
|
|
2785
|
+
on as toBase64,
|
|
2786
|
+
cn as toCurl,
|
|
2787
|
+
ln as tokenizeCommand,
|
|
2788
|
+
dn as unresolvedVariables,
|
|
2789
|
+
pn as updateApiItem,
|
|
2790
|
+
un as variableScope
|
|
2485
2791
|
};
|