@grafana/k6-test-builder 0.8.7 → 0.8.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/dist/index.d.ts CHANGED
@@ -203,12 +203,15 @@ type ThresholdValue = string | {
203
203
  abortOnFail: boolean;
204
204
  };
205
205
  type Thresholds = Record<string, ThresholdValue[]>;
206
+ interface CloudOptions {
207
+ distribution: Record<string, LoadZoneOption>;
208
+ apm: APM[];
209
+ }
206
210
  export interface LogOptions {
207
- ext: {
208
- loadimpact: {
209
- distribution: Record<string, LoadZoneOption>;
210
- apm: APM[];
211
- };
211
+ cloud: CloudOptions;
212
+ /** @deprecated Only old (pre cloud options) tests has this property */
213
+ ext?: {
214
+ loadimpact: CloudOptions;
212
215
  };
213
216
  /** @deprecated Only old (pre scenarios) tests has this property */
214
217
  stages?: RampingStage[];
package/dist/index.js CHANGED
@@ -609,13 +609,11 @@ const $e96a968658210988$export$807b1b70df68fbc6 = {
609
609
  const $e96a968658210988$export$93ca5d3f8675ae4c = {
610
610
  vus: 20,
611
611
  duration: "5m",
612
- ext: {
613
- loadimpact: {
614
- distribution: {
615
- "amazon:us:ashburn": {
616
- loadZone: "amazon:us:ashburn",
617
- percent: 100
618
- }
612
+ cloud: {
613
+ distribution: {
614
+ "amazon:us:ashburn": {
615
+ loadZone: "amazon:us:ashburn",
616
+ percent: 100
619
617
  }
620
618
  }
621
619
  }
@@ -2569,6 +2567,7 @@ class $5e61066313dfdf41$export$d74eb9a6e453f567 {
2569
2567
  $5e61066313dfdf41$var$_defineProperty(this, "request", void 0);
2570
2568
  $5e61066313dfdf41$var$_defineProperty(this, "variables", []);
2571
2569
  $5e61066313dfdf41$var$_defineProperty(this, "sleep", void 0);
2570
+ $5e61066313dfdf41$var$_defineProperty(this, "startedDateTime", "");
2572
2571
  // Note: har-to-k6 will not add automatic sleep if we pass an empty array
2573
2572
  this.sleep = sleep && sleep.length ? sleep : undefined;
2574
2573
  const { config: config , request: request , checks: checks , variables: variables } = node;
@@ -2606,6 +2605,7 @@ class $9c9b5794851acede$export$437940182842cc21 {
2606
2605
  $9c9b5794851acede$var$_defineProperty(this, "title", void 0);
2607
2606
  $9c9b5794851acede$var$_defineProperty(this, "name", void 0);
2608
2607
  $9c9b5794851acede$var$_defineProperty(this, "sleep", void 0);
2608
+ $9c9b5794851acede$var$_defineProperty(this, "startedDateTime", "");
2609
2609
  const { id: id , title: title , name: name } = node;
2610
2610
  this.id = id;
2611
2611
  this.title = title;
@@ -2652,11 +2652,9 @@ class $08703cbb0c917710$export$e5858e3f1a067a7 {
2652
2652
  static getEmptyLog() {
2653
2653
  return {
2654
2654
  options: {
2655
- ext: {
2656
- loadimpact: {
2657
- distribution: {},
2658
- apm: []
2659
- }
2655
+ cloud: {
2656
+ distribution: {},
2657
+ apm: []
2660
2658
  },
2661
2659
  thresholds: {},
2662
2660
  scenarios: {}
@@ -3686,20 +3684,16 @@ function $4f39a7e6764d7df8$export$ce9e7b45132a9c55(apm) {
3686
3684
  }
3687
3685
 
3688
3686
 
3689
- const $49f027a0602fd918$export$892f281b890b5148 = ({ loadZones: loadZones , apm: apm })=>{
3687
+ const $b0785620de6fffeb$export$eea562e3d032aaa4 = ({ loadZones: loadZones , apm: apm })=>{
3690
3688
  const distribution = (0, $19f0e6d9506aaebf$export$365e3fcb5ffcc8c6)(loadZones);
3691
3689
  const serializedAPM = (0, $4f39a7e6764d7df8$export$ce9e7b45132a9c55)(apm);
3692
3690
  if (serializedAPM.length > 0) return {
3693
- loadimpact: {
3694
- distribution: distribution,
3695
- apm: serializedAPM
3696
- }
3691
+ distribution: distribution,
3692
+ apm: serializedAPM
3697
3693
  };
3698
3694
  return {
3699
- loadimpact: {
3700
- distribution: distribution,
3701
- apm: []
3702
- }
3695
+ distribution: distribution,
3696
+ apm: []
3703
3697
  };
3704
3698
  };
3705
3699
 
@@ -4048,7 +4042,7 @@ class $09bbc5e14b02adac$export$dbf96015a8a67c16 {
4048
4042
  }
4049
4043
  static createLogOptions(loadZones, thresholds, apm) {
4050
4044
  return {
4051
- ext: (0, $49f027a0602fd918$export$892f281b890b5148)({
4045
+ cloud: (0, $b0785620de6fffeb$export$eea562e3d032aaa4)({
4052
4046
  loadZones: loadZones,
4053
4047
  apm: apm
4054
4048
  }),
@@ -4468,9 +4462,11 @@ class $27b7f69a914929cd$export$1576fc997deee1a4 {
4468
4462
  });
4469
4463
  }
4470
4464
  getLoadZonesFromOptions(options) {
4471
- const { ext: ext } = options || {};
4472
- if (!ext || !ext.loadimpact || !ext.loadimpact.distribution) return this.loadZones;
4473
- return Object.values(ext.loadimpact.distribution);
4465
+ const { cloud: cloud , ext: ext } = options || {};
4466
+ const legacyPath = ext && ext.loadimpact;
4467
+ const cloudOptions = cloud || legacyPath;
4468
+ if (!cloudOptions || !cloudOptions.distribution) return this.loadZones;
4469
+ return Object.values(cloudOptions.distribution);
4474
4470
  }
4475
4471
  getThresholdsFromOptions(options) {
4476
4472
  const { thresholds: thresholds } = options || {};
@@ -5848,7 +5844,7 @@ const $2f1b8f749d0252f0$export$5820f661515dab4f = /*#__PURE__*/ (0, ($parcel$int
5848
5844
  ], ({ theme: theme })=>theme.palette.background.paper, ({ theme: theme })=>theme.palette.text.secondary, ({ theme: theme })=>theme.palette.background.default, ({ theme: theme })=>theme.palette.background.default, $2f1b8f749d0252f0$export$eddf54ea3db8d0f0, $2f1b8f749d0252f0$export$a0c24614540b0efb, $2f1b8f749d0252f0$export$a0c24614540b0efb, $2f1b8f749d0252f0$export$eddf54ea3db8d0f0, $2f1b8f749d0252f0$export$eddf54ea3db8d0f0, $2f1b8f749d0252f0$export$f06e977173f1857c, $2f1b8f749d0252f0$export$7004694e7c14858d, $2f1b8f749d0252f0$export$cb8e6a2fd2fdc16b, $2f1b8f749d0252f0$export$a0c24614540b0efb, $2f1b8f749d0252f0$export$eddf54ea3db8d0f0, $2f1b8f749d0252f0$export$f06e977173f1857c, $2f1b8f749d0252f0$export$f06e977173f1857c, $2f1b8f749d0252f0$export$f06e977173f1857c, $2f1b8f749d0252f0$export$f06e977173f1857c, $2f1b8f749d0252f0$export$f06e977173f1857c);
5849
5845
  const $2f1b8f749d0252f0$export$1c180cb67301903c = /*#__PURE__*/ (0, ($parcel$interopDefault($gkIgo$styledcomponents))).div.attrs((props)=>({
5850
5846
  "data-parent-id": props.id,
5851
- id: null
5847
+ id: undefined
5852
5848
  })).withConfig({
5853
5849
  displayName: "styled__RootNode",
5854
5850
  componentId: "sc-1kgh2zd-7"
@@ -7831,7 +7827,9 @@ function $ac2f6d2ef648627b$export$a977df6ccef00812({ disabledValues: disabledVal
7831
7827
  });
7832
7828
  }, [
7833
7829
  disabledValues,
7834
- availableLoadZones
7830
+ availableLoadZones,
7831
+ onChange,
7832
+ value
7835
7833
  ]);
7836
7834
  return /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)((0, $df621c65e95d0d5b$export$ef9b1a59e592288f), {
7837
7835
  ...props,
@@ -8860,7 +8858,8 @@ function $44828b75e076e511$var$convertGroupToPage(group, sleep = []) {
8860
8858
  id: id,
8861
8859
  name: name,
8862
8860
  title: title,
8863
- sleep: sleep && sleep.length ? sleep : undefined
8861
+ sleep: sleep && sleep.length ? sleep : undefined,
8862
+ startedDateTime: ""
8864
8863
  };
8865
8864
  }
8866
8865
  function $44828b75e076e511$var$keyValuePairsToText(keyValuePairs) {
@@ -8933,7 +8932,8 @@ function $44828b75e076e511$var$convertRequestToEntry(request, sleep = [], parent
8933
8932
  // remove id's from variables
8934
8933
  variables: (0, $1fa7dc7d3bd71b64$export$78936e15dcfe90b6)(request.variables),
8935
8934
  pageref: parentId,
8936
- sleep: sleep && sleep.length ? sleep : undefined
8935
+ sleep: sleep && sleep.length ? sleep : undefined,
8936
+ startedDateTime: ""
8937
8937
  };
8938
8938
  }
8939
8939
  /** @deprecated */ function $44828b75e076e511$var$closestValue(subject, target) {
@@ -8951,7 +8951,7 @@ function $44828b75e076e511$var$convertRequestToEntry(request, sleep = [], parent
8951
8951
  function $44828b75e076e511$export$830e3e7c910fe629(loadZones, // stages: Array<Stage>,
8952
8952
  thresholds, apm) {
8953
8953
  return {
8954
- ext: (0, $49f027a0602fd918$export$892f281b890b5148)({
8954
+ cloud: (0, $b0785620de6fffeb$export$eea562e3d032aaa4)({
8955
8955
  loadZones: loadZones,
8956
8956
  apm: apm
8957
8957
  }),
@@ -9132,6 +9132,7 @@ const $d5b57d1cbe7f2b8f$export$ca5d2fb09291d9a8 = ({ parentId: parentId = "" , c
9132
9132
  name: "nested",
9133
9133
  put: canDrop
9134
9134
  },
9135
+ // @ts-expect-error - 'handle' prop is typed as string in ReactSortable. Hopefully it will be fixed in the future.
9135
9136
  handle: (0, $2f1b8f749d0252f0$export$a0c24614540b0efb),
9136
9137
  swapThreshold: 0.65,
9137
9138
  onEnd: handleOnEnd,
package/dist/module.js CHANGED
@@ -586,13 +586,11 @@ const $977f5f8f585fbb2c$export$807b1b70df68fbc6 = {
586
586
  const $977f5f8f585fbb2c$export$93ca5d3f8675ae4c = {
587
587
  vus: 20,
588
588
  duration: "5m",
589
- ext: {
590
- loadimpact: {
591
- distribution: {
592
- "amazon:us:ashburn": {
593
- loadZone: "amazon:us:ashburn",
594
- percent: 100
595
- }
589
+ cloud: {
590
+ distribution: {
591
+ "amazon:us:ashburn": {
592
+ loadZone: "amazon:us:ashburn",
593
+ percent: 100
596
594
  }
597
595
  }
598
596
  }
@@ -2546,6 +2544,7 @@ class $9e8f84151ee086d5$export$d74eb9a6e453f567 {
2546
2544
  $9e8f84151ee086d5$var$_defineProperty(this, "request", void 0);
2547
2545
  $9e8f84151ee086d5$var$_defineProperty(this, "variables", []);
2548
2546
  $9e8f84151ee086d5$var$_defineProperty(this, "sleep", void 0);
2547
+ $9e8f84151ee086d5$var$_defineProperty(this, "startedDateTime", "");
2549
2548
  // Note: har-to-k6 will not add automatic sleep if we pass an empty array
2550
2549
  this.sleep = sleep && sleep.length ? sleep : undefined;
2551
2550
  const { config: config , request: request , checks: checks , variables: variables } = node;
@@ -2583,6 +2582,7 @@ class $d7709c101a6a93ad$export$437940182842cc21 {
2583
2582
  $d7709c101a6a93ad$var$_defineProperty(this, "title", void 0);
2584
2583
  $d7709c101a6a93ad$var$_defineProperty(this, "name", void 0);
2585
2584
  $d7709c101a6a93ad$var$_defineProperty(this, "sleep", void 0);
2585
+ $d7709c101a6a93ad$var$_defineProperty(this, "startedDateTime", "");
2586
2586
  const { id: id , title: title , name: name } = node;
2587
2587
  this.id = id;
2588
2588
  this.title = title;
@@ -2629,11 +2629,9 @@ class $53c71a9068d90815$export$e5858e3f1a067a7 {
2629
2629
  static getEmptyLog() {
2630
2630
  return {
2631
2631
  options: {
2632
- ext: {
2633
- loadimpact: {
2634
- distribution: {},
2635
- apm: []
2636
- }
2632
+ cloud: {
2633
+ distribution: {},
2634
+ apm: []
2637
2635
  },
2638
2636
  thresholds: {},
2639
2637
  scenarios: {}
@@ -3663,20 +3661,16 @@ function $54905f88e4d0aee6$export$ce9e7b45132a9c55(apm) {
3663
3661
  }
3664
3662
 
3665
3663
 
3666
- const $eab7139be51067d7$export$892f281b890b5148 = ({ loadZones: loadZones , apm: apm })=>{
3664
+ const $0018c28bbc45422b$export$eea562e3d032aaa4 = ({ loadZones: loadZones , apm: apm })=>{
3667
3665
  const distribution = (0, $2e7731019bf383f7$export$365e3fcb5ffcc8c6)(loadZones);
3668
3666
  const serializedAPM = (0, $54905f88e4d0aee6$export$ce9e7b45132a9c55)(apm);
3669
3667
  if (serializedAPM.length > 0) return {
3670
- loadimpact: {
3671
- distribution: distribution,
3672
- apm: serializedAPM
3673
- }
3668
+ distribution: distribution,
3669
+ apm: serializedAPM
3674
3670
  };
3675
3671
  return {
3676
- loadimpact: {
3677
- distribution: distribution,
3678
- apm: []
3679
- }
3672
+ distribution: distribution,
3673
+ apm: []
3680
3674
  };
3681
3675
  };
3682
3676
 
@@ -4025,7 +4019,7 @@ class $d875af20a6533bde$export$dbf96015a8a67c16 {
4025
4019
  }
4026
4020
  static createLogOptions(loadZones, thresholds, apm) {
4027
4021
  return {
4028
- ext: (0, $eab7139be51067d7$export$892f281b890b5148)({
4022
+ cloud: (0, $0018c28bbc45422b$export$eea562e3d032aaa4)({
4029
4023
  loadZones: loadZones,
4030
4024
  apm: apm
4031
4025
  }),
@@ -4445,9 +4439,11 @@ class $ab0d82593c0c1516$export$1576fc997deee1a4 {
4445
4439
  });
4446
4440
  }
4447
4441
  getLoadZonesFromOptions(options) {
4448
- const { ext: ext } = options || {};
4449
- if (!ext || !ext.loadimpact || !ext.loadimpact.distribution) return this.loadZones;
4450
- return Object.values(ext.loadimpact.distribution);
4442
+ const { cloud: cloud , ext: ext } = options || {};
4443
+ const legacyPath = ext && ext.loadimpact;
4444
+ const cloudOptions = cloud || legacyPath;
4445
+ if (!cloudOptions || !cloudOptions.distribution) return this.loadZones;
4446
+ return Object.values(cloudOptions.distribution);
4451
4447
  }
4452
4448
  getThresholdsFromOptions(options) {
4453
4449
  const { thresholds: thresholds } = options || {};
@@ -5825,7 +5821,7 @@ const $7506a092cb35f299$export$5820f661515dab4f = /*#__PURE__*/ (0, $b7VBt$style
5825
5821
  ], ({ theme: theme })=>theme.palette.background.paper, ({ theme: theme })=>theme.palette.text.secondary, ({ theme: theme })=>theme.palette.background.default, ({ theme: theme })=>theme.palette.background.default, $7506a092cb35f299$export$eddf54ea3db8d0f0, $7506a092cb35f299$export$a0c24614540b0efb, $7506a092cb35f299$export$a0c24614540b0efb, $7506a092cb35f299$export$eddf54ea3db8d0f0, $7506a092cb35f299$export$eddf54ea3db8d0f0, $7506a092cb35f299$export$f06e977173f1857c, $7506a092cb35f299$export$7004694e7c14858d, $7506a092cb35f299$export$cb8e6a2fd2fdc16b, $7506a092cb35f299$export$a0c24614540b0efb, $7506a092cb35f299$export$eddf54ea3db8d0f0, $7506a092cb35f299$export$f06e977173f1857c, $7506a092cb35f299$export$f06e977173f1857c, $7506a092cb35f299$export$f06e977173f1857c, $7506a092cb35f299$export$f06e977173f1857c, $7506a092cb35f299$export$f06e977173f1857c);
5826
5822
  const $7506a092cb35f299$export$1c180cb67301903c = /*#__PURE__*/ (0, $b7VBt$styledcomponents).div.attrs((props)=>({
5827
5823
  "data-parent-id": props.id,
5828
- id: null
5824
+ id: undefined
5829
5825
  })).withConfig({
5830
5826
  displayName: "styled__RootNode",
5831
5827
  componentId: "sc-1kgh2zd-7"
@@ -7808,7 +7804,9 @@ function $d11389a8752f23d8$export$a977df6ccef00812({ disabledValues: disabledVal
7808
7804
  });
7809
7805
  }, [
7810
7806
  disabledValues,
7811
- availableLoadZones
7807
+ availableLoadZones,
7808
+ onChange,
7809
+ value
7812
7810
  ]);
7813
7811
  return /*#__PURE__*/ (0, $b7VBt$jsx)((0, $7b2e34940da063e7$export$ef9b1a59e592288f), {
7814
7812
  ...props,
@@ -8837,7 +8835,8 @@ function $a712508a121abd88$var$convertGroupToPage(group, sleep = []) {
8837
8835
  id: id,
8838
8836
  name: name,
8839
8837
  title: title,
8840
- sleep: sleep && sleep.length ? sleep : undefined
8838
+ sleep: sleep && sleep.length ? sleep : undefined,
8839
+ startedDateTime: ""
8841
8840
  };
8842
8841
  }
8843
8842
  function $a712508a121abd88$var$keyValuePairsToText(keyValuePairs) {
@@ -8910,7 +8909,8 @@ function $a712508a121abd88$var$convertRequestToEntry(request, sleep = [], parent
8910
8909
  // remove id's from variables
8911
8910
  variables: (0, $f3225c9cfb4c8b15$export$78936e15dcfe90b6)(request.variables),
8912
8911
  pageref: parentId,
8913
- sleep: sleep && sleep.length ? sleep : undefined
8912
+ sleep: sleep && sleep.length ? sleep : undefined,
8913
+ startedDateTime: ""
8914
8914
  };
8915
8915
  }
8916
8916
  /** @deprecated */ function $a712508a121abd88$var$closestValue(subject, target) {
@@ -8928,7 +8928,7 @@ function $a712508a121abd88$var$convertRequestToEntry(request, sleep = [], parent
8928
8928
  function $a712508a121abd88$export$830e3e7c910fe629(loadZones, // stages: Array<Stage>,
8929
8929
  thresholds, apm) {
8930
8930
  return {
8931
- ext: (0, $eab7139be51067d7$export$892f281b890b5148)({
8931
+ cloud: (0, $0018c28bbc45422b$export$eea562e3d032aaa4)({
8932
8932
  loadZones: loadZones,
8933
8933
  apm: apm
8934
8934
  }),
@@ -9109,6 +9109,7 @@ const $89b7eccc62773a08$export$ca5d2fb09291d9a8 = ({ parentId: parentId = "" , c
9109
9109
  name: "nested",
9110
9110
  put: canDrop
9111
9111
  },
9112
+ // @ts-expect-error - 'handle' prop is typed as string in ReactSortable. Hopefully it will be fixed in the future.
9112
9113
  handle: (0, $7506a092cb35f299$export$a0c24614540b0efb),
9113
9114
  swapThreshold: 0.65,
9114
9115
  onEnd: handleOnEnd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/k6-test-builder",
3
- "version": "0.8.7",
3
+ "version": "0.8.9",
4
4
  "license": "AGPL-3.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/module.js",
@@ -48,7 +48,7 @@
48
48
  "react-dom": "^16.14.0",
49
49
  "sortablejs": "1.14.0",
50
50
  "storybook-dark-mode": "^1.1.2",
51
- "styled-components": "^5.3.1",
51
+ "styled-components": "^6.1.1",
52
52
  "typescript": "4.6.4",
53
53
  "web-vitals": "^2.1.4",
54
54
  "webpack": "5"
@@ -58,7 +58,7 @@
58
58
  "react": ">= 16.14.0",
59
59
  "react-dom": ">= 16.14.0",
60
60
  "sortablejs": "^1.10.2",
61
- "styled-components": "^5.3.1"
61
+ "styled-components": "^6.1.1"
62
62
  },
63
63
  "dependencies": {
64
64
  "@material-ui/core": "^4.12.4",