@gravitee/ui-policy-studio-angular 16.0.1-apim-11657-adapt-ui-for-llm-a32a07d → 16.0.1-apim-11657-adapt-ui-for-llm-9594da4

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.
@@ -153,13 +153,15 @@ function fakeMcpFlow(modifier) {
153
153
  };
154
154
  }
155
155
  function fakeLlmFlow(modifier) {
156
- const llmSelector = {
157
- type: 'LLM',
158
- methods: [],
156
+ const httpSelector = {
157
+ type: 'HTTP',
158
+ path: '/path',
159
+ pathOperator: 'EQUALS',
160
+ methods: ['GET'],
159
161
  };
160
162
  const base = {
161
163
  name: 'Flow name',
162
- selectors: [llmSelector],
164
+ selectors: [httpSelector],
163
165
  request: [],
164
166
  response: [],
165
167
  enabled: true,
@@ -1762,67 +1764,6 @@ class GioPolicyStudioFlowMcpFormDialogHarness extends ComponentHarness {
1762
1764
  }
1763
1765
  }
1764
1766
 
1765
- /*
1766
- * Copyright (C) 2022 The Gravitee team (http://gravitee.io)
1767
- *
1768
- * Licensed under the Apache License, Version 2.0 (the "License");
1769
- * you may not use this file except in compliance with the License.
1770
- * You may obtain a copy of the License at
1771
- *
1772
- * http://www.apache.org/licenses/LICENSE-2.0
1773
- *
1774
- * Unless required by applicable law or agreed to in writing, software
1775
- * distributed under the License is distributed on an "AS IS" BASIS,
1776
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1777
- * See the License for the specific language governing permissions and
1778
- * limitations under the License.
1779
- */
1780
- class GioPolicyStudioFlowLlmFormDialogHarness extends ComponentHarness {
1781
- constructor() {
1782
- super(...arguments);
1783
- this.getSaveBtn = this.locatorFor(MatButtonHarness.with({ selector: '.actions__saveBtn' }));
1784
- this.getCancelBtn = this.locatorFor(MatButtonHarness.with({ selector: '.actions__cancelBtn' }));
1785
- this.nameInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="name"]' }));
1786
- this.methodsInput = this.locatorFor(GioFormTagsInputHarness.with({ selector: '[formControlName="llmMethods"]' }));
1787
- this.conditionInput = this.locatorFor(MatInputHarness.with({ selector: '[formControlName="condition"]' }));
1788
- }
1789
- static { this.hostSelector = 'gio-ps-flow-llm-form-dialog'; }
1790
- async setFlowFormValues(flow) {
1791
- if (flow.name) {
1792
- const nameInput = await this.nameInput();
1793
- await nameInput.setValue(flow.name);
1794
- }
1795
- if (flow.methods) {
1796
- const methodsInput = await this.methodsInput();
1797
- for (const method of flow.methods) {
1798
- await methodsInput.addTag(method);
1799
- }
1800
- }
1801
- if (flow.condition) {
1802
- const conditionInput = await this.conditionInput();
1803
- await conditionInput.setValue(flow.condition);
1804
- }
1805
- }
1806
- async getFlowFormValues() {
1807
- return {
1808
- name: await this.getFlowName(),
1809
- methods: await this.methodsInput().then(input => input.getTags()),
1810
- condition: await this.conditionInput().then(input => input.getValue()),
1811
- };
1812
- }
1813
- async getFlowName() {
1814
- return this.nameInput().then(input => input.getValue());
1815
- }
1816
- async save() {
1817
- const button = await this.getSaveBtn();
1818
- await button.click();
1819
- }
1820
- async cancel() {
1821
- const button = await this.getCancelBtn();
1822
- await button.click();
1823
- }
1824
- }
1825
-
1826
1767
  /*
1827
1768
  * Copyright (C) 2022 The Gravitee team (http://gravitee.io)
1828
1769
  *
@@ -1962,7 +1903,6 @@ class GioPolicyStudioHarness extends ComponentHarness {
1962
1903
  const httpSelector = flow.selectors?.find(s => s.type === 'HTTP');
1963
1904
  const conditionSelector = flow.selectors?.find(s => s.type === 'CONDITION');
1964
1905
  const mcpSelector = flow.selectors?.find(s => s.type === 'MCP');
1965
- const llmSelector = flow.selectors?.find(s => s.type === 'LLM');
1966
1906
  if (!!channelSelector && !!httpSelector) {
1967
1907
  throw new Error('Channel and HTTP selectors are not be used together.');
1968
1908
  }
@@ -2005,16 +1945,6 @@ class GioPolicyStudioHarness extends ComponentHarness {
2005
1945
  await flowFormNewDialog.save();
2006
1946
  return;
2007
1947
  }
2008
- if (llmSelector) {
2009
- const flowFormNewDialog = await this.documentRootLocatorFactory().locatorFor(GioPolicyStudioFlowLlmFormDialogHarness)();
2010
- await flowFormNewDialog.setFlowFormValues({
2011
- name: flow.name,
2012
- methods: llmSelector?.methods,
2013
- condition: conditionSelector?.condition,
2014
- });
2015
- await flowFormNewDialog.save();
2016
- return;
2017
- }
2018
1948
  if (!channelSelector && !httpSelector) {
2019
1949
  const flowFormNewDialog = await this.documentRootLocatorFactory().locatorFor(GioPolicyStudioFlowNativeFormDialogHarness)();
2020
1950
  await flowFormNewDialog.setFlowFormValues({