@nice2dev/ui-api 1.4.29 → 1.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.mjs CHANGED
@@ -240,12 +240,24 @@ function Ct(e, t, n = {}) {
240
240
  function Is(e, t, n = {}) {
241
241
  return Nt(Ct(e, t, n));
242
242
  }
243
- function Ls(e, t, n) {
244
- const s = {}, r = (o) => {
245
- for (const i of o ?? [])
246
- L(i) && i.key && (s[i.key] = i.value);
243
+ function Ls(e, t) {
244
+ const n = [];
245
+ for (const s of e)
246
+ for (const r of (s == null ? void 0 : s.variableSets) ?? []) {
247
+ const o = t.find((i) => i.id === r);
248
+ o && n.push(o);
249
+ }
250
+ return n;
251
+ }
252
+ function Ps(e, t, n, s) {
253
+ const r = {}, o = (i) => {
254
+ for (const a of i ?? [])
255
+ L(a) && a.key && (r[a.key] = a.value);
247
256
  };
248
- return r(e == null ? void 0 : e.variables), r(t == null ? void 0 : t.values), { ...s, ...n };
257
+ o(e == null ? void 0 : e.variables), o(t == null ? void 0 : t.values);
258
+ for (const i of s ?? [])
259
+ o(i.values);
260
+ return { ...r, ...n };
249
261
  }
250
262
  function pe(e) {
251
263
  let t = e.trim(), n = "";
@@ -312,7 +324,7 @@ function Ue(e, t = (n) => n) {
312
324
  );
313
325
  return o + (i.length ? `?${i.join("&")}` : "") + t(r);
314
326
  }
315
- function Ps(e, t) {
327
+ function Rs(e, t) {
316
328
  return e ? t ? `${e.replace(/\/+$/, "")}/${t.replace(/^\/+/, "")}` : e : t;
317
329
  }
318
330
  function dn(e) {
@@ -1827,7 +1839,7 @@ function Ye(e) {
1827
1839
  return {};
1828
1840
  }
1829
1841
  }
1830
- function Rs(e, t) {
1842
+ function Ms(e, t) {
1831
1843
  var p;
1832
1844
  const n = (p = e.examples) == null ? void 0 : p[0];
1833
1845
  if (n) {
@@ -2321,7 +2333,7 @@ function Bn(e) {
2321
2333
  }
2322
2334
  };
2323
2335
  }
2324
- function Ms(e) {
2336
+ function Ds(e) {
2325
2337
  const t = /* @__PURE__ */ new Map(), n = (s, r) => {
2326
2338
  if (!s || s.type === "none" || s.type === "inherit")
2327
2339
  return;
@@ -2563,7 +2575,7 @@ function Kn(e, t = {}) {
2563
2575
  const d = {};
2564
2576
  return e.schemas && Object.keys(e.schemas).length && (d.schemas = e.schemas), Object.keys(i).length && (d.securitySchemes = i), Object.keys(d).length && (f.components = d), f;
2565
2577
  }
2566
- function Ds(e, t = {}) {
2578
+ function Hs(e, t = {}) {
2567
2579
  return Mn(Kn(e, t));
2568
2580
  }
2569
2581
  const W = (e) => !!e && typeof e == "object" && !Array.isArray(e), E = (e) => typeof e == "string" ? e : typeof e == "number" || typeof e == "boolean" ? String(e) : void 0, ke = (e) => Array.isArray(e) ? e.filter(W) : [], Jn = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json";
@@ -2949,7 +2961,7 @@ function Ft(e) {
2949
2961
  body: a.body ?? ""
2950
2962
  })), o;
2951
2963
  }
2952
- function Hs(e) {
2964
+ function zs(e) {
2953
2965
  const t = {
2954
2966
  info: {
2955
2967
  _postman_id: e.id,
@@ -2966,7 +2978,7 @@ function Hs(e) {
2966
2978
  const n = Xe(e.auth);
2967
2979
  return n && (t.auth = n), t;
2968
2980
  }
2969
- function zs(e) {
2981
+ function Ws(e) {
2970
2982
  return {
2971
2983
  id: e.id,
2972
2984
  name: e.name,
@@ -3045,7 +3057,7 @@ function rs(e, t = {}) {
3045
3057
  return ge({ name: t.name ?? "HAR import", items: o });
3046
3058
  }
3047
3059
  const Be = (e) => ({ name: e.key, value: e.value });
3048
- function Ws(e, t = {}) {
3060
+ function Bs(e, t = {}) {
3049
3061
  const n = Array.isArray(e) ? e : be(e.items).map((i) => i.request), s = t.transform ?? ((i) => i), r = (t.now ?? (() => /* @__PURE__ */ new Date()))().toISOString(), o = n.map((i) => {
3050
3062
  var k, y, v, $, T;
3051
3063
  const a = Ue(i, s), c = i.params.filter((b) => b.in === "header" && L(b)).map((b) => ({ key: s(b.key), value: s(b.value) })), p = i.params.filter((b) => b.in === "cookie" && L(b)).map((b) => ({ key: s(b.key), value: s(b.value) })), u = ((k = c.find((b) => /^content-type$/i.test(b.key))) == null ? void 0 : k.value) ?? Ce(i.body), f = {
@@ -3101,7 +3113,7 @@ function Ws(e, t = {}) {
3101
3113
  }
3102
3114
  };
3103
3115
  }
3104
- const Bs = `query IntrospectionQuery {
3116
+ const Fs = `query IntrospectionQuery {
3105
3117
  __schema {
3106
3118
  queryType { name }
3107
3119
  mutationType { name }
@@ -3780,7 +3792,7 @@ async function vt(e, t = {}) {
3780
3792
  } else r.type === "awsSigV4" ? await vs(d, r, l) : r.type === "hmac" && await As(d, r, l);
3781
3793
  return d;
3782
3794
  }
3783
- async function Fs(e, t, n = {}, s) {
3795
+ async function Vs(e, t, n = {}, s) {
3784
3796
  let r = await vt(e, n), o = await t(r, s);
3785
3797
  const i = n.auth ?? e.auth;
3786
3798
  if (o.status === 401 && (i == null ? void 0 : i.type) === "digest" && !i.nonce) {
@@ -3804,7 +3816,7 @@ function At(e, t) {
3804
3816
  const n = Uint8Array.from(atob(e), (s) => s.charCodeAt(0));
3805
3817
  return new Blob([n], t ? { type: t } : void 0);
3806
3818
  }
3807
- function Vs(e = (...t) => fetch(...t)) {
3819
+ function Ks(e = (...t) => fetch(...t)) {
3808
3820
  return async (t, n) => {
3809
3821
  var p, u, f;
3810
3822
  const s = new Headers();
@@ -3856,13 +3868,13 @@ function Vs(e = (...t) => fetch(...t)) {
3856
3868
  function xt(e) {
3857
3869
  return lt(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
3858
3870
  }
3859
- async function Ks() {
3871
+ async function Js() {
3860
3872
  const e = new Uint8Array(32);
3861
3873
  globalThis.crypto.getRandomValues(e);
3862
3874
  const t = xt(e), n = xt(await Re("SHA-256", t));
3863
3875
  return { verifier: t, challenge: n };
3864
3876
  }
3865
- function Js(e, t = {}) {
3877
+ function Qs(e, t = {}) {
3866
3878
  const n = new URLSearchParams();
3867
3879
  n.set("response_type", e.grant === "implicit" ? "token" : "code"), n.set("client_id", e.clientId), e.redirectUri && n.set("redirect_uri", e.redirectUri), e.scope && n.set("scope", e.scope), e.audience && n.set("audience", e.audience), t.state && n.set("state", t.state), t.challenge && (n.set("code_challenge", t.challenge), n.set("code_challenge_method", "S256"));
3868
3880
  const s = e.authUrl ?? "";
@@ -3906,7 +3918,7 @@ async function Oe(e, t, n) {
3906
3918
  idToken: typeof i.id_token == "string" ? i.id_token : void 0
3907
3919
  };
3908
3920
  }
3909
- async function Qs(e, t) {
3921
+ async function Gs(e, t) {
3910
3922
  if (e.grant === "clientCredentials")
3911
3923
  return Oe(e, { grant_type: "client_credentials" }, t);
3912
3924
  if (e.grant === "password")
@@ -3919,14 +3931,14 @@ async function Qs(e, t) {
3919
3931
  `OAuth 2: the ${e.grant} grant needs the user — use buildAuthorizationUrl / startDeviceAuthorization`
3920
3932
  );
3921
3933
  }
3922
- async function Gs(e, t, n, s) {
3934
+ async function Ys(e, t, n, s) {
3923
3935
  const r = { grant_type: "authorization_code", code: t };
3924
3936
  return e.redirectUri && (r.redirect_uri = e.redirectUri), s && (r.code_verifier = s), Oe(e, r, n);
3925
3937
  }
3926
- async function Ys(e, t, n) {
3938
+ async function Xs(e, t, n) {
3927
3939
  return Oe(e, { grant_type: "refresh_token", refresh_token: t }, n);
3928
3940
  }
3929
- async function Xs(e, t) {
3941
+ async function Zs(e, t) {
3930
3942
  if (!e.deviceUrl)
3931
3943
  throw new Error("OAuth 2: no device authorization URL");
3932
3944
  const n = new URLSearchParams({ client_id: e.clientId });
@@ -3951,7 +3963,7 @@ async function Xs(e, t) {
3951
3963
  expiresIn: r.expires_in === void 0 ? void 0 : Number(r.expires_in)
3952
3964
  };
3953
3965
  }
3954
- async function Zs(e, t, n) {
3966
+ async function er(e, t, n) {
3955
3967
  try {
3956
3968
  return await Oe(
3957
3969
  e,
@@ -4084,7 +4096,7 @@ function js(e, t, n, s, r, o) {
4084
4096
  }
4085
4097
  return a;
4086
4098
  }
4087
- function er(e, t = {}) {
4099
+ function tr(e, t = {}) {
4088
4100
  var o;
4089
4101
  const n = { ...Ts, ...t.labels }, s = [`# ${e.name}`, ""];
4090
4102
  e.description && s.push(e.description, ""), e.version && s.push(`**${n.version}:** ${e.version}`, ""), (o = e.servers) != null && o.length && s.push(
@@ -4136,7 +4148,7 @@ function Os(e, t = {}) {
4136
4148
  if (r.__schema || o != null && o.__schema)
4137
4149
  return "graphql";
4138
4150
  }
4139
- function tr(e, t = {}) {
4151
+ function nr(e, t = {}) {
4140
4152
  const n = Os(e, t), s = () => Yt(e.trim(), t.parseYaml);
4141
4153
  switch (n) {
4142
4154
  case "curl":
@@ -4159,7 +4171,7 @@ function tr(e, t = {}) {
4159
4171
  );
4160
4172
  }
4161
4173
  }
4162
- const nr = [
4174
+ const sr = [
4163
4175
  "rest",
4164
4176
  "graphql",
4165
4177
  "soap",
@@ -4171,7 +4183,7 @@ const nr = [
4171
4183
  "database",
4172
4184
  "sftp"
4173
4185
  ];
4174
- function sr(e = {}) {
4186
+ function rr(e = {}) {
4175
4187
  return {
4176
4188
  ...e,
4177
4189
  key: e.key ?? Ne("i"),
@@ -4195,7 +4207,7 @@ function Xt(e, t) {
4195
4207
  i.secret && o[i.key] === void 0 && (o[i.key] = `{{secret:${i.key}}}`);
4196
4208
  return o;
4197
4209
  }
4198
- function rr(e, t, n) {
4210
+ function ir(e, t, n) {
4199
4211
  const s = /* @__PURE__ */ new Set();
4200
4212
  let r = e.sets.find((a) => a.id === t), o = !0;
4201
4213
  for (; r && !s.has(r.id); ) {
@@ -4206,7 +4218,7 @@ function rr(e, t, n) {
4206
4218
  const i = e.variables.find((a) => a.key === n);
4207
4219
  return (i == null ? void 0 : i.defaultValue) !== void 0 ? { value: i.defaultValue, from: "default" } : { from: "none" };
4208
4220
  }
4209
- function ir(e) {
4221
+ function or(e) {
4210
4222
  return e.sets.map((t) => ({
4211
4223
  id: t.id,
4212
4224
  name: t.name,
@@ -4220,7 +4232,7 @@ function ir(e) {
4220
4232
  })
4221
4233
  }));
4222
4234
  }
4223
- function or(e, t) {
4235
+ function ar(e, t) {
4224
4236
  return (t ? e.sets.find((n) => {
4225
4237
  var s;
4226
4238
  return ((s = n.appliesTo) == null ? void 0 : s.database) === t;
@@ -4240,7 +4252,7 @@ function ot(e, t = []) {
4240
4252
  ot(n, t);
4241
4253
  return t;
4242
4254
  }
4243
- function ar(e, t = { variables: [], sets: [] }, n = {}) {
4255
+ function cr(e, t = { variables: [], sets: [] }, n = {}) {
4244
4256
  var a, c;
4245
4257
  const s = [], r = new Set(t.variables.map((p) => p.key)), o = /* @__PURE__ */ new Set();
4246
4258
  for (const p of e.integrations) {
@@ -4316,7 +4328,7 @@ function ar(e, t = { variables: [], sets: [] }, n = {}) {
4316
4328
  }
4317
4329
  return s;
4318
4330
  }
4319
- function cr(e) {
4331
+ function pr(e) {
4320
4332
  const t = /* @__PURE__ */ new Map();
4321
4333
  for (const s of e) {
4322
4334
  const r = s.package ?? "";
@@ -4330,7 +4342,7 @@ function cr(e) {
4330
4342
  directions: n.filter((o) => r.has(o)).map((o) => ({ direction: o, integrations: r.get(o) }))
4331
4343
  }));
4332
4344
  }
4333
- function pr(e) {
4345
+ function lr(e) {
4334
4346
  const t = be(e.endpoints.items).map(
4335
4347
  ({ request: s }) => ({
4336
4348
  id: s.id,
@@ -4345,37 +4357,38 @@ function pr(e) {
4345
4357
  return [...t, ...n];
4346
4358
  }
4347
4359
  export {
4348
- Bs as GRAPHQL_INTROSPECTION_QUERY,
4360
+ Fs as GRAPHQL_INTROSPECTION_QUERY,
4349
4361
  Us as NICE_API_AUTH_TYPES,
4350
4362
  An as NICE_API_CODE_LANGUAGES,
4351
4363
  Ts as NICE_API_MARKDOWN_LABELS,
4352
4364
  Cs as NICE_API_METHODS,
4353
- nr as NICE_CONNECTION_PROTOCOLS,
4365
+ sr as NICE_CONNECTION_PROTOCOLS,
4354
4366
  Z as NiceYamlError,
4355
4367
  Jn as POSTMAN_SCHEMA_V21,
4356
- Ms as apiSecuritySchemes,
4368
+ Ds as apiSecuritySchemes,
4369
+ Ls as assignedVariableSets,
4357
4370
  Ce as bodyContentType,
4358
4371
  St as bodyFromText,
4359
4372
  oe as bodyText,
4360
- Js as buildAuthorizationUrl,
4373
+ Qs as buildAuthorizationUrl,
4361
4374
  ps as buildGraphqlOperation,
4362
4375
  Ue as buildRequestUrl,
4363
4376
  ys as buildSoapEnvelope,
4364
- er as collectionToMarkdown,
4365
- Ks as createPkcePair,
4377
+ tr as collectionToMarkdown,
4378
+ Js as createPkcePair,
4366
4379
  Os as detectApiDocument,
4367
4380
  Re as digest,
4368
4381
  ws as digestAuthorization,
4369
4382
  on as effectiveAuth,
4370
- or as environmentSetFor,
4371
- Gs as exchangeAuthorizationCode,
4372
- Ws as exportHar,
4383
+ ar as environmentSetFor,
4384
+ Ys as exchangeAuthorizationCode,
4385
+ Bs as exportHar,
4373
4386
  Kn as exportOpenApi,
4374
- Ds as exportOpenApiYaml,
4375
- Hs as exportPostman,
4376
- zs as exportPostmanEnvironment,
4377
- Qs as fetchOAuth2Token,
4378
- Vs as fetchTransport,
4387
+ Hs as exportOpenApiYaml,
4388
+ zs as exportPostman,
4389
+ Ws as exportPostmanEnvironment,
4390
+ Gs as fetchOAuth2Token,
4391
+ Ks as fetchTransport,
4379
4392
  nn as findApiItem,
4380
4393
  Nt as findVariables,
4381
4394
  be as flattenApiRequests,
@@ -4384,10 +4397,10 @@ export {
4384
4397
  qe as graphqlExampleValue,
4385
4398
  os as graphqlOperations,
4386
4399
  et as graphqlTypeName,
4387
- cr as groupIntegrations,
4400
+ pr as groupIntegrations,
4388
4401
  qs as headerValue,
4389
4402
  me as hmac,
4390
- tr as importApiDocument,
4403
+ nr as importApiDocument,
4391
4404
  ls as importGraphqlIntrospection,
4392
4405
  rs as importHar,
4393
4406
  Wn as importOpenApi,
@@ -4395,23 +4408,23 @@ export {
4395
4408
  Zn as importPostmanEnvironment,
4396
4409
  gs as importWsdl,
4397
4410
  Ye as inferSchema,
4398
- pr as integrationEndpoints,
4411
+ lr as integrationEndpoints,
4399
4412
  Ct as interpolate,
4400
4413
  dn as isCurlCommand,
4401
4414
  L as isEnabled,
4402
4415
  Vt as isHar,
4403
4416
  Ht as isPostmanCollection,
4404
- Ps as joinUrl,
4417
+ Rs as joinUrl,
4405
4418
  kt as jsonPointer,
4406
4419
  Gt as md5Hex,
4407
4420
  Rt as mockFromSchema,
4408
- Rs as mockResponse,
4421
+ Ms as mockResponse,
4409
4422
  Kt as namedType,
4410
4423
  ge as newApiCollection,
4411
4424
  Te as newApiFolder,
4412
4425
  Ne as newApiId,
4413
4426
  ye as newApiRequest,
4414
- sr as newIntegration,
4427
+ rr as newIntegration,
4415
4428
  rn as paramsIn,
4416
4429
  $n as parseCurl,
4417
4430
  $s as parseDigestChallenge,
@@ -4421,8 +4434,8 @@ export {
4421
4434
  ms as parseWsdl,
4422
4435
  In as parseYaml,
4423
4436
  pn as pathParamNames,
4424
- Zs as pollDeviceToken,
4425
- Ys as refreshOAuth2Token,
4437
+ er as pollDeviceToken,
4438
+ Xs as refreshOAuth2Token,
4426
4439
  Es as renameApiSchema,
4427
4440
  Et as requestName,
4428
4441
  Xt as resolveEnvironmentSet,
@@ -4430,22 +4443,22 @@ export {
4430
4443
  vt as resolveRequest,
4431
4444
  _s as rowsToRecord,
4432
4445
  Pt as schemaResolver,
4433
- Fs as sendApiRequest,
4446
+ Vs as sendApiRequest,
4434
4447
  un as setRequestUrl,
4435
4448
  vs as signAwsV4,
4436
4449
  As as signHmac,
4437
4450
  pe as splitUrl,
4438
- Xs as startDeviceAuthorization,
4451
+ Zs as startDeviceAuthorization,
4439
4452
  Mn as stringifyYaml,
4440
4453
  Bn as swagger2ToOpenApi3,
4441
4454
  ln as syncPathParams,
4442
- ir as toApiEnvironments,
4455
+ or as toApiEnvironments,
4443
4456
  at as toBase64,
4444
4457
  De as toCurl,
4445
4458
  hn as tokenizeCommand,
4446
4459
  Is as unresolvedVariables,
4447
4460
  sn as updateApiItem,
4448
- ar as validateIntegrations,
4449
- rr as valueOrigin,
4450
- Ls as variableScope
4461
+ cr as validateIntegrations,
4462
+ ir as valueOrigin,
4463
+ Ps as variableScope
4451
4464
  };