@gravitee/ui-policy-studio-angular 12.15.0 → 12.15.1
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/esm2022/lib/environment-flow-studio/gio-environment-flow-studio.component.mjs +145 -0
- package/esm2022/public-api.mjs +2 -1
- package/esm2022/testing/lib/environment-flow-studio/gio-environment-flow-studio.harness.mjs +53 -0
- package/esm2022/testing/public-testing-api.mjs +2 -1
- package/fesm2022/gravitee-ui-policy-studio-angular-testing.mjs +49 -1
- package/fesm2022/gravitee-ui-policy-studio-angular-testing.mjs.map +1 -1
- package/fesm2022/gravitee-ui-policy-studio-angular.mjs +140 -2
- package/fesm2022/gravitee-ui-policy-studio-angular.mjs.map +1 -1
- package/lib/environment-flow-studio/gio-environment-flow-studio.component.d.ts +54 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/testing/lib/environment-flow-studio/gio-environment-flow-studio.harness.d.ts +21 -0
- package/testing/public-testing-api.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Inject, EventEmitter, Input, Output, Injectable, Pipe } from '@angular/core';
|
|
2
|
+
import { Component, Inject, EventEmitter, Input, Output, Injectable, Pipe, ChangeDetectionStrategy } from '@angular/core';
|
|
3
3
|
import { cloneDeep, uniqueId, isEmpty, uniq, toLower, filter, flatten, isEqual, differenceBy, omit, unionBy } from 'lodash';
|
|
4
4
|
import { BehaviorSubject, Subject, EMPTY, timer } from 'rxjs';
|
|
5
5
|
import * as i2 from '@angular/common';
|
|
@@ -1684,6 +1684,144 @@ const getPlansChangeOutput = (flowsGroups, initialFlowsGroups) => {
|
|
|
1684
1684
|
return plansWithChangedFlowsOutput.length > 0 ? plansWithChangedFlowsOutput : null;
|
|
1685
1685
|
};
|
|
1686
1686
|
|
|
1687
|
+
/*
|
|
1688
|
+
* Copyright (C) 2024 The Gravitee team (http://gravitee.io)
|
|
1689
|
+
*
|
|
1690
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1691
|
+
* you may not use this file except in compliance with the License.
|
|
1692
|
+
* You may obtain a copy of the License at
|
|
1693
|
+
*
|
|
1694
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1695
|
+
*
|
|
1696
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1697
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1698
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1699
|
+
* See the License for the specific language governing permissions and
|
|
1700
|
+
* limitations under the License.
|
|
1701
|
+
*/
|
|
1702
|
+
class GioEnvironmentFlowStudioComponent {
|
|
1703
|
+
constructor(policyStudioService) {
|
|
1704
|
+
this.policyStudioService = policyStudioService;
|
|
1705
|
+
/**
|
|
1706
|
+
* List of policies usable in the studio
|
|
1707
|
+
*/
|
|
1708
|
+
this.policies = [];
|
|
1709
|
+
/**
|
|
1710
|
+
* Called when Environment-flow Studio needs to fetch the policy schema
|
|
1711
|
+
* @returns Observable of the policy schema
|
|
1712
|
+
*/
|
|
1713
|
+
this.policySchemaFetcher = () => EMPTY;
|
|
1714
|
+
/**
|
|
1715
|
+
* Called when Environment-flow Studio needs to fetch the policy documentation
|
|
1716
|
+
* @returns Observable of the policy documentation
|
|
1717
|
+
*/
|
|
1718
|
+
this.policyDocumentationFetcher = () => EMPTY;
|
|
1719
|
+
/**
|
|
1720
|
+
* Output event when the environment flow changes
|
|
1721
|
+
*/
|
|
1722
|
+
this.environmentFlowChange = new EventEmitter();
|
|
1723
|
+
this.isLoading = true;
|
|
1724
|
+
this.readOnly = false;
|
|
1725
|
+
this.startConnector = name => [
|
|
1726
|
+
{
|
|
1727
|
+
name,
|
|
1728
|
+
icon: 'gio:arrow-right',
|
|
1729
|
+
type: 'start',
|
|
1730
|
+
supportedModes: [],
|
|
1731
|
+
},
|
|
1732
|
+
];
|
|
1733
|
+
this.endConnector = name => [
|
|
1734
|
+
{
|
|
1735
|
+
name,
|
|
1736
|
+
icon: 'gio:arrow-right',
|
|
1737
|
+
type: 'end',
|
|
1738
|
+
supportedModes: [],
|
|
1739
|
+
},
|
|
1740
|
+
];
|
|
1741
|
+
this.steps = [];
|
|
1742
|
+
this.phases = {
|
|
1743
|
+
PROXY__REQUEST: {
|
|
1744
|
+
name: 'Request phase',
|
|
1745
|
+
description: 'Policies will be applied during the connection establishment',
|
|
1746
|
+
startConnectorName: 'Incoming request',
|
|
1747
|
+
endConnectorName: 'Outgoing request',
|
|
1748
|
+
},
|
|
1749
|
+
PROXY__RESPONSE: {
|
|
1750
|
+
name: 'Response phase',
|
|
1751
|
+
description: 'Policies will be applied to the response from the initial connection.',
|
|
1752
|
+
startConnectorName: 'Incoming response',
|
|
1753
|
+
endConnectorName: 'Outgoing response',
|
|
1754
|
+
},
|
|
1755
|
+
PROXY__MESSAGE_REQUEST: null, // n/a
|
|
1756
|
+
PROXY__MESSAGE_RESPONSE: null, // n/a
|
|
1757
|
+
MESSAGE__REQUEST: {
|
|
1758
|
+
name: 'Request phase',
|
|
1759
|
+
description: 'Policies will be applied during the connection establishment',
|
|
1760
|
+
startConnectorName: 'Incoming request',
|
|
1761
|
+
endConnectorName: 'Outgoing request',
|
|
1762
|
+
},
|
|
1763
|
+
MESSAGE__RESPONSE: {
|
|
1764
|
+
name: 'Response phase',
|
|
1765
|
+
description: 'Policies will be applied during the connection termination',
|
|
1766
|
+
startConnectorName: 'Incoming response',
|
|
1767
|
+
endConnectorName: 'Outgoing response',
|
|
1768
|
+
},
|
|
1769
|
+
MESSAGE__MESSAGE_REQUEST: {
|
|
1770
|
+
name: 'Publish phase',
|
|
1771
|
+
description: 'Policies will be applied on messages sent to the endpoint',
|
|
1772
|
+
startConnectorName: 'Incoming message request',
|
|
1773
|
+
endConnectorName: 'Outgoing message request',
|
|
1774
|
+
},
|
|
1775
|
+
MESSAGE__MESSAGE_RESPONSE: {
|
|
1776
|
+
name: 'Subscribe phase',
|
|
1777
|
+
description: 'Policies will be applied on messages received by the entrypoint',
|
|
1778
|
+
startConnectorName: 'Incoming message response',
|
|
1779
|
+
endConnectorName: 'Outgoing message response',
|
|
1780
|
+
},
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
ngOnChanges(changes) {
|
|
1784
|
+
if (changes.policySchemaFetcher) {
|
|
1785
|
+
this.policyStudioService.setPolicySchemaFetcher(this.policySchemaFetcher);
|
|
1786
|
+
}
|
|
1787
|
+
if (changes.policyDocumentationFetcher) {
|
|
1788
|
+
this.policyStudioService.setPolicyDocumentationFetcher(this.policyDocumentationFetcher);
|
|
1789
|
+
}
|
|
1790
|
+
if (changes.policies) {
|
|
1791
|
+
this.isLoading = false;
|
|
1792
|
+
}
|
|
1793
|
+
if (changes.executionPhase) {
|
|
1794
|
+
this.phase = this.phases[`${this.apiType}__${this.executionPhase}`] ?? undefined;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
onStepsChange(steps) {
|
|
1798
|
+
this.steps = steps;
|
|
1799
|
+
this.environmentFlowChange.emit(steps);
|
|
1800
|
+
}
|
|
1801
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: GioEnvironmentFlowStudioComponent, deps: [{ token: GioPolicyStudioService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1802
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.3", type: GioEnvironmentFlowStudioComponent, isStandalone: true, selector: "gio-environment-flow-studio", inputs: { policies: "policies", apiType: "apiType", executionPhase: "executionPhase", policySchemaFetcher: "policySchemaFetcher", policyDocumentationFetcher: "policyDocumentationFetcher" }, outputs: { environmentFlowChange: "environmentFlowChange" }, usesOnChanges: true, ngImport: i0, template: "<!--\n\n Copyright (C) 2024 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n@if (!isLoading && phase) {\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n [name]=\"phase.name\"\n [description]=\"phase.description\"\n [readOnly]=\"readOnly\"\n [startConnector]=\"startConnector(phase.startConnectorName)\"\n [endConnector]=\"endConnector(phase.endConnectorName)\"\n [steps]=\"steps\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n [policyExecutionPhase]=\"executionPhase\"\n (stepsChange)=\"onStepsChange($event)\"\n ></gio-ps-flow-details-phase>\n} @else {\n <gio-loader></gio-loader>\n}\n", styles: [""], dependencies: [{ kind: "component", type: GioPolicyStudioDetailsPhaseComponent, selector: "gio-ps-flow-details-phase", inputs: ["readOnly", "steps", "name", "description", "startConnector", "endConnector", "apiType", "policies", "policyExecutionPhase", "trialUrl"], outputs: ["stepsChange"] }, { kind: "ngmodule", type: GioFormJsonSchemaModule }, { kind: "ngmodule", type: GioLoaderModule }, { kind: "component", type: i6$1.GioLoaderComponent, selector: "gio-loader" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1803
|
+
}
|
|
1804
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: GioEnvironmentFlowStudioComponent, decorators: [{
|
|
1805
|
+
type: Component,
|
|
1806
|
+
args: [{ selector: 'gio-environment-flow-studio', standalone: true, imports: [GioPolicyStudioDetailsPhaseComponent, GioFormJsonSchemaModule, GioLoaderModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--\n\n Copyright (C) 2024 The Gravitee team (http://gravitee.io)\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n\n-->\n@if (!isLoading && phase) {\n <gio-ps-flow-details-phase\n class=\"content__phase\"\n [name]=\"phase.name\"\n [description]=\"phase.description\"\n [readOnly]=\"readOnly\"\n [startConnector]=\"startConnector(phase.startConnectorName)\"\n [endConnector]=\"endConnector(phase.endConnectorName)\"\n [steps]=\"steps\"\n [apiType]=\"apiType\"\n [policies]=\"policies\"\n [trialUrl]=\"trialUrl\"\n [policyExecutionPhase]=\"executionPhase\"\n (stepsChange)=\"onStepsChange($event)\"\n ></gio-ps-flow-details-phase>\n} @else {\n <gio-loader></gio-loader>\n}\n" }]
|
|
1807
|
+
}], ctorParameters: () => [{ type: GioPolicyStudioService }], propDecorators: { policies: [{
|
|
1808
|
+
type: Input
|
|
1809
|
+
}], apiType: [{
|
|
1810
|
+
type: Input,
|
|
1811
|
+
args: [{ required: true }]
|
|
1812
|
+
}], executionPhase: [{
|
|
1813
|
+
type: Input,
|
|
1814
|
+
args: [{ required: true }]
|
|
1815
|
+
}], policySchemaFetcher: [{
|
|
1816
|
+
type: Input,
|
|
1817
|
+
args: [{ required: true }]
|
|
1818
|
+
}], policyDocumentationFetcher: [{
|
|
1819
|
+
type: Input,
|
|
1820
|
+
args: [{ required: true }]
|
|
1821
|
+
}], environmentFlowChange: [{
|
|
1822
|
+
type: Output
|
|
1823
|
+
}] } });
|
|
1824
|
+
|
|
1687
1825
|
/*
|
|
1688
1826
|
* Copyright (C) 2022 The Gravitee team (http://gravitee.io)
|
|
1689
1827
|
*
|
|
@@ -1707,5 +1845,5 @@ const getPlansChangeOutput = (flowsGroups, initialFlowsGroups) => {
|
|
|
1707
1845
|
* Generated bundle index. Do not edit.
|
|
1708
1846
|
*/
|
|
1709
1847
|
|
|
1710
|
-
export { GioPolicyStudioComponent, HttpMethods, toHttpMethod };
|
|
1848
|
+
export { GioEnvironmentFlowStudioComponent, GioPolicyStudioComponent, HttpMethods, toHttpMethod };
|
|
1711
1849
|
//# sourceMappingURL=gravitee-ui-policy-studio-angular.mjs.map
|