@grafana/k6-test-builder 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -4,9 +4,19 @@ import { ThemeOptions } from "@material-ui/core/styles/createTheme";
4
4
  import { GrafanaTheme2 } from "@grafana/data";
5
5
  /** @todo move this type */
6
6
  interface K6LoadZone {
7
+ available: boolean;
8
+ id: number;
9
+ name: string;
10
+ vendor: string;
11
+ country: string | null;
12
+ city: string | null;
13
+ aggregate_region: boolean;
14
+ latitude: number;
15
+ longitude: number;
16
+ configurable: boolean;
17
+ is_k6_only: boolean;
7
18
  k6_load_zone_id: string;
8
- country: string;
9
- city: string;
19
+ public: boolean;
10
20
  }
11
21
  type LoadZoneDistribution = 'even' | 'manual';
12
22
  export interface RampingStage {
package/dist/index.js CHANGED
@@ -1092,9 +1092,18 @@ const $b0053bc75d27f892$var$defaultContext = {
1092
1092
  availableLoadZones: [
1093
1093
  {
1094
1094
  id: 11,
1095
+ available: true,
1096
+ name: "Ashburn, US (Amazon)",
1097
+ vendor: "amazon",
1095
1098
  country: "US",
1096
1099
  city: "Ashburn",
1097
- k6_load_zone_id: "amazon:us:ashburn"
1100
+ aggregate_region: false,
1101
+ latitude: 39.04,
1102
+ longitude: -77.48,
1103
+ configurable: true,
1104
+ is_k6_only: false,
1105
+ k6_load_zone_id: "amazon:us:ashburn",
1106
+ public: true
1098
1107
  }
1099
1108
  ],
1100
1109
  DocsLinkComponent: (0, $cd402c1b3ca4b836$export$e816d7af81d48a79),
@@ -2160,6 +2169,7 @@ function $4bac6ee95b8c8b72$export$623efd7781ab509e(path, view, exact = false) {
2160
2169
  })(view);
2161
2170
  }
2162
2171
  function $4bac6ee95b8c8b72$export$ea0b53343d95e8c5(loadZone) {
2172
+ if (!loadZone.city || !loadZone.country) return "";
2163
2173
  if (loadZone.city.toLowerCase() === "hong kong") return "hk";
2164
2174
  return loadZone.country.toLowerCase();
2165
2175
  }
@@ -7718,6 +7728,34 @@ var $d74d54ce0479ba0c$export$2e2bcd8739ae039 = $d74d54ce0479ba0c$var$SvgXx;
7718
7728
 
7719
7729
 
7720
7730
 
7731
+
7732
+
7733
+ const $303ecaf29377061a$export$2d8598c0b89a07db = /*#__PURE__*/ (0, $gkIgo$react.forwardRef)((props, ref)=>{
7734
+ const theme = (0, $gkIgo$materialuicore.useTheme)();
7735
+ return /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)("svg", {
7736
+ viewBox: "0 0 24 24",
7737
+ xmlns: "http://www.w3.org/2000/svg",
7738
+ ref: ref,
7739
+ ...props,
7740
+ children: [
7741
+ /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("circle", {
7742
+ cx: "12",
7743
+ cy: "12",
7744
+ r: "12",
7745
+ fill: theme.palette.divider
7746
+ }),
7747
+ /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("path", {
7748
+ d: "M 17.826 5.626 C 17.647 5.48 17.411 5.424 17.185 5.473 C 15.536 5.819 13.817 5.467 12.436 4.502 C 12.173 4.321 11.827 4.321 11.564 4.502 C 10.183 5.467 8.464 5.819 6.815 5.473 C 6.589 5.424 6.353 5.48 6.174 5.626 C 5.994 5.771 5.89 5.99 5.891 6.221 L 5.891 11.91 C 5.889 14.131 6.962 16.217 8.77 17.508 L 11.558 19.493 C 11.822 19.681 12.178 19.681 12.442 19.493 L 15.23 17.508 C 17.038 16.217 18.111 14.131 18.109 11.91 L 18.109 6.221 C 18.11 5.99 18.006 5.771 17.826 5.626 Z",
7749
+ style: {
7750
+ fill: theme.palette.text.secondary
7751
+ }
7752
+ })
7753
+ ]
7754
+ });
7755
+ });
7756
+
7757
+
7758
+
7721
7759
  const $93fbf4cb9a1ece0e$var$availableLoadZoneFlags = {
7722
7760
  au: (0, $709aa92758f97578$export$2e2bcd8739ae039),
7723
7761
  bh: (0, $ca303bd1e24c7773$export$2e2bcd8739ae039),
@@ -7745,6 +7783,10 @@ function $93fbf4cb9a1ece0e$export$2a443dbec7599f4d({ loadZone: loadZone , forwar
7745
7783
  width: width || height,
7746
7784
  height: height || width
7747
7785
  };
7786
+ if (!loadZone.public) return /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)((0, $303ecaf29377061a$export$2d8598c0b89a07db), {
7787
+ ...dimensions,
7788
+ ...props
7789
+ });
7748
7790
  const countryCode = (0, $4bac6ee95b8c8b72$export$ea0b53343d95e8c5)(loadZone);
7749
7791
  const Icon = $93fbf4cb9a1ece0e$var$availableLoadZoneFlags[countryCode] || (0, $d74d54ce0479ba0c$export$2e2bcd8739ae039);
7750
7792
  return /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)(Icon, {
@@ -7765,7 +7807,7 @@ function $ac2f6d2ef648627b$export$a977df6ccef00812({ disabledValues: disabledVal
7765
7807
  const { availableLoadZones: availableLoadZones } = (0, $b0053bc75d27f892$export$8bcb3cb1ba0d67a7)();
7766
7808
  const options = (0, $gkIgo$react.useMemo)(()=>{
7767
7809
  return availableLoadZones.map((loadZone)=>{
7768
- const { k6_load_zone_id: k6_load_zone_id , city: city , country: country } = loadZone;
7810
+ const { k6_load_zone_id: k6_load_zone_id , city: city , country: country , name: name , public: isPublic } = loadZone;
7769
7811
  return {
7770
7812
  disabled: (disabledValues || []).includes(k6_load_zone_id),
7771
7813
  value: k6_load_zone_id,
@@ -7777,7 +7819,7 @@ function $ac2f6d2ef648627b$export$a977df6ccef00812({ disabledValues: disabledVal
7777
7819
  loadZone: loadZone
7778
7820
  }),
7779
7821
  /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
7780
- children: `${city}, ${country} (${k6_load_zone_id})`
7822
+ children: isPublic ? `${city}, ${country} (${k6_load_zone_id})` : `${name} (${k6_load_zone_id})`
7781
7823
  })
7782
7824
  ]
7783
7825
  })
@@ -14563,10 +14605,19 @@ function $1ae39e1e435a2397$export$9bb8a8c9de09825e({ children: children }) {
14563
14605
 
14564
14606
  function $00b916e228a936f5$export$f290710bbb710efa({ loading: loading , saving: saving , k6Test: k6Test , hasCloudExecution: hasCloudExecution , hasFractionalVUhResolution: hasFractionalVUhResolution , availableLoadZones: availableLoadZones = [
14565
14607
  {
14566
- id: 1,
14567
- country: "us",
14608
+ id: 11,
14609
+ available: true,
14610
+ name: "Ashburn, US (Amazon)",
14611
+ vendor: "amazon",
14612
+ country: "US",
14613
+ city: "Ashburn",
14614
+ aggregate_region: false,
14615
+ latitude: 39.04,
14616
+ longitude: -77.48,
14617
+ configurable: true,
14618
+ is_k6_only: false,
14568
14619
  k6_load_zone_id: "amazon:us:ashburn",
14569
- city: "Ashburn"
14620
+ public: true
14570
14621
  }
14571
14622
  ] , DocsLinkComponent: DocsLinkComponent = (0, $cd402c1b3ca4b836$export$e816d7af81d48a79) , onViewChange: onViewChange , StagesVirtualizationComponent: StagesVirtualizationComponent , ScriptEditorComponent: ScriptEditorComponent = (0, $ab0bf6ee71c94953$export$32efa5142ae8aa01) , TestBuilderIconComponent: TestBuilderIconComponent = (0, $924f96bd0d5c630d$export$cc0ae9a5c96bcd6f) , readonlyScriptScenarios: readonlyScriptScenarios = false , apmConfigs: apmConfigs = [] , hasCloudAPM: hasCloudAPM = false , disableAPM: disableAPM = false , openImportModal: openImportModal , startRecorder: startRecorder }) {
14572
14623
  // create test builder context
@@ -15212,10 +15263,16 @@ function $86a6ac2413d415f3$export$d4e10f46dd803e0a({ loadZones: loadZones = [] ,
15212
15263
  /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)($86a6ac2413d415f3$var$StyledFlag, {
15213
15264
  loadZone: loadZone
15214
15265
  }),
15215
- loadZone.city,
15216
- ",\xa0",
15217
- /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
15218
- children: loadZone.country
15266
+ loadZone.public ? /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)((0, $gkIgo$reactjsxruntime.Fragment), {
15267
+ children: [
15268
+ loadZone.city,
15269
+ ",\xa0",
15270
+ /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
15271
+ children: loadZone.country
15272
+ })
15273
+ ]
15274
+ }) : /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
15275
+ children: loadZone.name
15219
15276
  })
15220
15277
  ]
15221
15278
  }, loadZone.id));
@@ -15229,10 +15286,16 @@ function $86a6ac2413d415f3$export$d4e10f46dd803e0a({ loadZones: loadZones = [] ,
15229
15286
  /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)($86a6ac2413d415f3$var$StyledFlag, {
15230
15287
  loadZone: loadZone
15231
15288
  }),
15232
- loadZone.city,
15233
- ",\xa0",
15234
- /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
15235
- children: loadZone.country
15289
+ loadZone.public ? /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)((0, $gkIgo$reactjsxruntime.Fragment), {
15290
+ children: [
15291
+ loadZone.city,
15292
+ ",\xa0",
15293
+ /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
15294
+ children: loadZone.country
15295
+ })
15296
+ ]
15297
+ }) : /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)("span", {
15298
+ children: loadZone.name
15236
15299
  })
15237
15300
  ]
15238
15301
  }, `tooltip-${loadZone.id}`));
package/dist/module.js CHANGED
@@ -1069,9 +1069,18 @@ const $4cf6d05a57acd1d1$var$defaultContext = {
1069
1069
  availableLoadZones: [
1070
1070
  {
1071
1071
  id: 11,
1072
+ available: true,
1073
+ name: "Ashburn, US (Amazon)",
1074
+ vendor: "amazon",
1072
1075
  country: "US",
1073
1076
  city: "Ashburn",
1074
- k6_load_zone_id: "amazon:us:ashburn"
1077
+ aggregate_region: false,
1078
+ latitude: 39.04,
1079
+ longitude: -77.48,
1080
+ configurable: true,
1081
+ is_k6_only: false,
1082
+ k6_load_zone_id: "amazon:us:ashburn",
1083
+ public: true
1075
1084
  }
1076
1085
  ],
1077
1086
  DocsLinkComponent: (0, $a2bbc3b49e805484$export$e816d7af81d48a79),
@@ -2137,6 +2146,7 @@ function $f54872b9dc7588c3$export$623efd7781ab509e(path, view, exact = false) {
2137
2146
  })(view);
2138
2147
  }
2139
2148
  function $f54872b9dc7588c3$export$ea0b53343d95e8c5(loadZone) {
2149
+ if (!loadZone.city || !loadZone.country) return "";
2140
2150
  if (loadZone.city.toLowerCase() === "hong kong") return "hk";
2141
2151
  return loadZone.country.toLowerCase();
2142
2152
  }
@@ -7695,6 +7705,34 @@ var $f866fa8c7e7ba07d$export$2e2bcd8739ae039 = $f866fa8c7e7ba07d$var$SvgXx;
7695
7705
 
7696
7706
 
7697
7707
 
7708
+
7709
+
7710
+ const $2f9c21821713259b$export$2d8598c0b89a07db = /*#__PURE__*/ (0, $b7VBt$forwardRef)((props, ref)=>{
7711
+ const theme = (0, $b7VBt$useTheme)();
7712
+ return /*#__PURE__*/ (0, $b7VBt$jsxs)("svg", {
7713
+ viewBox: "0 0 24 24",
7714
+ xmlns: "http://www.w3.org/2000/svg",
7715
+ ref: ref,
7716
+ ...props,
7717
+ children: [
7718
+ /*#__PURE__*/ (0, $b7VBt$jsx)("circle", {
7719
+ cx: "12",
7720
+ cy: "12",
7721
+ r: "12",
7722
+ fill: theme.palette.divider
7723
+ }),
7724
+ /*#__PURE__*/ (0, $b7VBt$jsx)("path", {
7725
+ d: "M 17.826 5.626 C 17.647 5.48 17.411 5.424 17.185 5.473 C 15.536 5.819 13.817 5.467 12.436 4.502 C 12.173 4.321 11.827 4.321 11.564 4.502 C 10.183 5.467 8.464 5.819 6.815 5.473 C 6.589 5.424 6.353 5.48 6.174 5.626 C 5.994 5.771 5.89 5.99 5.891 6.221 L 5.891 11.91 C 5.889 14.131 6.962 16.217 8.77 17.508 L 11.558 19.493 C 11.822 19.681 12.178 19.681 12.442 19.493 L 15.23 17.508 C 17.038 16.217 18.111 14.131 18.109 11.91 L 18.109 6.221 C 18.11 5.99 18.006 5.771 17.826 5.626 Z",
7726
+ style: {
7727
+ fill: theme.palette.text.secondary
7728
+ }
7729
+ })
7730
+ ]
7731
+ });
7732
+ });
7733
+
7734
+
7735
+
7698
7736
  const $0e08e80b41915ca2$var$availableLoadZoneFlags = {
7699
7737
  au: (0, $ebf3b4597005c1f6$export$2e2bcd8739ae039),
7700
7738
  bh: (0, $f2e0d6fb223d00cb$export$2e2bcd8739ae039),
@@ -7722,6 +7760,10 @@ function $0e08e80b41915ca2$export$2a443dbec7599f4d({ loadZone: loadZone , forwar
7722
7760
  width: width || height,
7723
7761
  height: height || width
7724
7762
  };
7763
+ if (!loadZone.public) return /*#__PURE__*/ (0, $b7VBt$jsx)((0, $2f9c21821713259b$export$2d8598c0b89a07db), {
7764
+ ...dimensions,
7765
+ ...props
7766
+ });
7725
7767
  const countryCode = (0, $f54872b9dc7588c3$export$ea0b53343d95e8c5)(loadZone);
7726
7768
  const Icon = $0e08e80b41915ca2$var$availableLoadZoneFlags[countryCode] || (0, $f866fa8c7e7ba07d$export$2e2bcd8739ae039);
7727
7769
  return /*#__PURE__*/ (0, $b7VBt$jsx)(Icon, {
@@ -7742,7 +7784,7 @@ function $d11389a8752f23d8$export$a977df6ccef00812({ disabledValues: disabledVal
7742
7784
  const { availableLoadZones: availableLoadZones } = (0, $4cf6d05a57acd1d1$export$8bcb3cb1ba0d67a7)();
7743
7785
  const options = (0, $b7VBt$useMemo)(()=>{
7744
7786
  return availableLoadZones.map((loadZone)=>{
7745
- const { k6_load_zone_id: k6_load_zone_id , city: city , country: country } = loadZone;
7787
+ const { k6_load_zone_id: k6_load_zone_id , city: city , country: country , name: name , public: isPublic } = loadZone;
7746
7788
  return {
7747
7789
  disabled: (disabledValues || []).includes(k6_load_zone_id),
7748
7790
  value: k6_load_zone_id,
@@ -7754,7 +7796,7 @@ function $d11389a8752f23d8$export$a977df6ccef00812({ disabledValues: disabledVal
7754
7796
  loadZone: loadZone
7755
7797
  }),
7756
7798
  /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
7757
- children: `${city}, ${country} (${k6_load_zone_id})`
7799
+ children: isPublic ? `${city}, ${country} (${k6_load_zone_id})` : `${name} (${k6_load_zone_id})`
7758
7800
  })
7759
7801
  ]
7760
7802
  })
@@ -14540,10 +14582,19 @@ function $59eb99f127c45ea7$export$9bb8a8c9de09825e({ children: children }) {
14540
14582
 
14541
14583
  function $045b658c7184976c$export$f290710bbb710efa({ loading: loading , saving: saving , k6Test: k6Test , hasCloudExecution: hasCloudExecution , hasFractionalVUhResolution: hasFractionalVUhResolution , availableLoadZones: availableLoadZones = [
14542
14584
  {
14543
- id: 1,
14544
- country: "us",
14585
+ id: 11,
14586
+ available: true,
14587
+ name: "Ashburn, US (Amazon)",
14588
+ vendor: "amazon",
14589
+ country: "US",
14590
+ city: "Ashburn",
14591
+ aggregate_region: false,
14592
+ latitude: 39.04,
14593
+ longitude: -77.48,
14594
+ configurable: true,
14595
+ is_k6_only: false,
14545
14596
  k6_load_zone_id: "amazon:us:ashburn",
14546
- city: "Ashburn"
14597
+ public: true
14547
14598
  }
14548
14599
  ] , DocsLinkComponent: DocsLinkComponent = (0, $a2bbc3b49e805484$export$e816d7af81d48a79) , onViewChange: onViewChange , StagesVirtualizationComponent: StagesVirtualizationComponent , ScriptEditorComponent: ScriptEditorComponent = (0, $b60f5acc8283b9c9$export$32efa5142ae8aa01) , TestBuilderIconComponent: TestBuilderIconComponent = (0, $a80b21e889559c22$export$cc0ae9a5c96bcd6f) , readonlyScriptScenarios: readonlyScriptScenarios = false , apmConfigs: apmConfigs = [] , hasCloudAPM: hasCloudAPM = false , disableAPM: disableAPM = false , openImportModal: openImportModal , startRecorder: startRecorder }) {
14549
14600
  // create test builder context
@@ -15189,10 +15240,16 @@ function $79002af3b59253f5$export$d4e10f46dd803e0a({ loadZones: loadZones = [] ,
15189
15240
  /*#__PURE__*/ (0, $b7VBt$jsx)($79002af3b59253f5$var$StyledFlag, {
15190
15241
  loadZone: loadZone
15191
15242
  }),
15192
- loadZone.city,
15193
- ",\xa0",
15194
- /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
15195
- children: loadZone.country
15243
+ loadZone.public ? /*#__PURE__*/ (0, $b7VBt$jsxs)((0, $b7VBt$Fragment), {
15244
+ children: [
15245
+ loadZone.city,
15246
+ ",\xa0",
15247
+ /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
15248
+ children: loadZone.country
15249
+ })
15250
+ ]
15251
+ }) : /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
15252
+ children: loadZone.name
15196
15253
  })
15197
15254
  ]
15198
15255
  }, loadZone.id));
@@ -15206,10 +15263,16 @@ function $79002af3b59253f5$export$d4e10f46dd803e0a({ loadZones: loadZones = [] ,
15206
15263
  /*#__PURE__*/ (0, $b7VBt$jsx)($79002af3b59253f5$var$StyledFlag, {
15207
15264
  loadZone: loadZone
15208
15265
  }),
15209
- loadZone.city,
15210
- ",\xa0",
15211
- /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
15212
- children: loadZone.country
15266
+ loadZone.public ? /*#__PURE__*/ (0, $b7VBt$jsxs)((0, $b7VBt$Fragment), {
15267
+ children: [
15268
+ loadZone.city,
15269
+ ",\xa0",
15270
+ /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
15271
+ children: loadZone.country
15272
+ })
15273
+ ]
15274
+ }) : /*#__PURE__*/ (0, $b7VBt$jsx)("span", {
15275
+ children: loadZone.name
15213
15276
  })
15214
15277
  ]
15215
15278
  }, `tooltip-${loadZone.id}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/k6-test-builder",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "license": "AGPL-3.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/module.js",