@pega/constellationjs 0.25.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/LICENSE ADDED
@@ -0,0 +1,167 @@
1
+ ConstellationJS Engine License
2
+ Version 1.0, December 2021
3
+
4
+ This is a proprietary license based on the Apache 2.0 license and is intended to
5
+ provide a similar set of rights with the exception that any and all ConstellationJS
6
+ Engine components shall be used only with Pegasystems Software.
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution
12
+ as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner
15
+ that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all other entities that
18
+ control, are controlled by, or are under common control with that entity. For the
19
+ purposes of this definition, "control" means (i) the power, direct or indirect, to
20
+ cause the direction or management of such entity, whether by contract or otherwise,
21
+ or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or
22
+ (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions
25
+ granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications, including
28
+ but not limited to software source code, documentation source, and configuration
29
+ files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical transformation or
32
+ translation of a Source form, including but not limited to compiled object code,
33
+ generated documentation, and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
36
+ available under the License, as indicated by a copyright notice that is included
37
+ in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is
40
+ based on (or derived from) the Work and for which the editorial revisions,
41
+ annotations, elaborations, or other modifications represent, as a whole, an
42
+ original work of authorship. For the purposes of this License, Derivative Works
43
+ shall not include works that remain separable from, or merely link (or bind by
44
+ name) to the interfaces of, the Work and Derivative Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original version
47
+ of the Work and any modifications or additions to that Work or Derivative Works
48
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
49
+ by the copyright owner or by an individual or Legal Entity authorized to submit
50
+ on behalf of the copyright owner. For the purposes of this definition, "submitted"
51
+ means any form of electronic, verbal, or written communication sent to the Licensor
52
+ or its representatives, including but not limited to communication on electronic
53
+ mailing lists, source code control systems, and issue tracking systems that are
54
+ managed by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously marked or
56
+ otherwise designated in writing by the copyright owner as "Not a Contribution."
57
+
58
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
59
+ of whom a Contribution has been received by Licensor and subsequently incorporated
60
+ within the Work.
61
+
62
+ "Pegasystems" (or "Pega") shall mean Pegasystems Inc., a Massachusetts Corporation,
63
+ having an office at One Main Street, Cambridge, MA 02142.
64
+
65
+ "Pegasystems Software" shall mean duly licensed Pegasystems software and/or
66
+ subscription services including but not limited to the Pega Platform.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
69
+ License, each Contributor hereby grants to You a perpetual, worldwide,
70
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
71
+ reproduce, publicly display, publicly perform, sublicense, and distribute
72
+ the Work in minified JavaScript form solely for use with Pegasystems Software.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
75
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
76
+ no-charge, royalty-free, irrevocable (except as stated in this section) patent
77
+ license to make, have made, use, offer to sell, sell, import, and otherwise
78
+ transfer the Work, where such license applies only to those patent claims
79
+ licensable by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s) with the Work
81
+ to which such Contribution(s) was submitted. If You institute patent litigation
82
+ against any entity (including a cross-claim or counterclaim in a lawsuit) alleging
83
+ that the Work or a Contribution incorporated within the Work constitutes direct
84
+ or contributory patent infringement, then any patent licenses granted to You
85
+ under this License for that Work shall terminate as of the date such litigation
86
+ is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
89
+ Derivative Works thereof in any medium, with or without modifications, and in
90
+ Source or Object form, provided that You meet the following conditions:
91
+
92
+ 1. You must give any other recipients of the Work or Derivative Works
93
+ a copy of this License; and
94
+
95
+ 2. You must cause any modified files to carry prominent notices stating
96
+ that You changed the files;
97
+ and
98
+
99
+ 3. You must retain, in the Source form of any Derivative Works that You
100
+ distribute, all copyright, patent, trademark, and attribution notices
101
+ from the Source form of the Work, excluding those notices that do not
102
+ pertain to any part of the Derivative Works; and
103
+
104
+ 4. If the Work includes a "NOTICE" text file as part of its distribution,
105
+ then any Derivative Works that You distribute must include a readable
106
+ copy of the attribution notices contained within such NOTICE file,
107
+ excluding those notices that do not pertain to any part of the Derivative
108
+ Works, in at least one of the following places: within a NOTICE text
109
+ file distributed as part of the Derivative Works; within the Source
110
+ form or documentation, if provided along with the Derivative Works;
111
+ or, within a display generated by the Derivative Works, if and
112
+ wherever such third-party notices normally appear. The contents
113
+ of the NOTICE file are for informational purposes only and do not
114
+ modify the License. You may add Your own attribution notices within
115
+ Derivative Works that You distribute, alongside or as an addendum
116
+ to the NOTICE text from the Work, provided that such additional
117
+ attribution notices cannot be construed as modifying the License.
118
+
119
+ You may add Your own copyright statement to Your modifications and may
120
+ provide additional or different license terms and conditions for use,
121
+ reproduction, or distribution of Your modifications, or for any such
122
+ Derivative Works as a whole, provided Your use, reproduction, and
123
+ distribution of the Work otherwise complies with the conditions stated
124
+ in this License including the limitation that the Work be used only
125
+ with Pegasystems Software.
126
+
127
+ 5. Submission of Contributions. Any Contribution intentionally submitted for inclusion
128
+ in the Work by You to the Licensor shall be under the terms and conditions of this
129
+ License, without any additional terms or conditions. Notwithstanding the above,
130
+ nothing herein shall supersede or modify the terms of any separate license agreement
131
+ you may have executed with Licensor regarding such Contributions.
132
+
133
+ 6. Trademarks. This License does not grant permission to use the trade names,
134
+ trademarks, service marks, or product names of the Licensor, except as required
135
+ for reasonable and customary use in describing the origin of the Work and
136
+ reproducing the content of the NOTICE file.
137
+
138
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
139
+ writing, Licensor provides the Work (and each Contributor provides its Contributions)
140
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
141
+ implied, including, without limitation, any warranties or conditions of TITLE,
142
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
143
+ solely responsible for determining the appropriateness of using or redistributing
144
+ the Work and assume any risks associated with Your exercise of permissions under
145
+ this License.
146
+
147
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
148
+ tort (including negligence), contract, or otherwise, unless required by applicable
149
+ law (such as deliberate and grossly negligent acts) or agreed to in writing, shall
150
+ any Contributor be liable to You for damages, including any direct, indirect,
151
+ special, incidental, or consequential damages of any character arising as a
152
+ result of this License or out of the use or inability to use the Work (including
153
+ but not limited to damages for loss of goodwill, work stoppage, computer failure
154
+ or malfunction, or any and all other commercial damages or losses), even if such
155
+ Contributor has been advised of the possibility of such damages.
156
+
157
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
158
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
159
+ acceptance of support, warranty, indemnity, or other liability obligations
160
+ and/or rights consistent with this License. However, in accepting such obligations,
161
+ You may act only on Your own behalf and on Your sole responsibility, not on
162
+ behalf of any other Contributor, and only if You agree to indemnify, defend,
163
+ and hold each Contributor harmless for any liability incurred by, or claims
164
+ asserted against, such Contributor by reason of your accepting any such
165
+ warranty or additional liability.
166
+
167
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @pega/constellationjs
2
+
3
+ This npm package delivers the ConstellationJS files associated with a specific version of Pega Infinity to your project as an npm package. These ConstellationJS files enable interaction with the Constellation UI model, providing essential services such as data, metadata, and orchestration.
4
+
5
+ ## Usage
6
+
7
+ Open your project's **package.json** file and in the **dependencies** section, specify the version of the ConstellationJS files required by your project in the following format:
8
+
9
+ > "@pega/constellationjs": "npm version or tag name"
10
+
11
+ **Note**:
12
+
13
+ - Ensure that you specify the npm version or tag name corresponding to the version of Pega Infinity used in your environment.
14
+ - If you are using Pega Infinity 23.1.1 or later versions, specify the [corresponding npm version](#npm-versions).
15
+ - If you are using Pega Infinity 23.1.0 or earlier versions, specify the [corresponding tag name](#tag-names).
16
+
17
+ For example:
18
+
19
+ - If your project requires the ConstellationJS files associated with Pega Infinity 24.2.2, specify
20
+
21
+ > "@pega/constellationjs": "24.2.2"
22
+
23
+ - If your project requires the ConstellationJS files associated with Pega Infinity 23.1.0, specify
24
+ > "@pega/constellationjs": "SDK-8.23.0"
25
+
26
+ <br>
27
+
28
+ ## npm versions
29
+
30
+ If you are using Pega Infinity 23.1.1 or later, use the corresponding npm version mentioned in the following table:
31
+
32
+ | Pega Infinity version | npm version |
33
+ | --------------------- | ----------- |
34
+ | 24.2.2 | 24.2.2 |
35
+ | 24.2.1 | 24.2.1 |
36
+ | 24.2.0 | 24.2.0 |
37
+ | 24.1.3 | 24.1.3 |
38
+ | 24.1.2 | 24.1.2 |
39
+ | 24.1.1 | 24.1.1 |
40
+ | 24.1.0 | 24.1.0 |
41
+ | 23.1.2 | 23.1.2 |
42
+ | 23.1.1 | 23.1.1 |
43
+
44
+ <br>
45
+
46
+ ## Tag names
47
+
48
+ If you are using Pega Infinity 23.1.0 or earlier, use the corresponding tag name mentioned in the following table:
49
+
50
+ | Pega Infinity version | Tag name |
51
+ | --------------------- | ---------- |
52
+ | 23.1.0 | SDK-8.23.0 |
53
+ | 8.8.4 | SDK-8.8.4 |
54
+ | 8.8.3 | SDK-8.8.3 |
55
+ | 8.8.2 | SDK-8.8.2 |
56
+ | 8.8.1 | SDK-8.8.1 |
57
+ | 8.8.0 | SDK-8.8.0 |
58
+ | 8.7.5 | SDK-8.7.5 |
59
+ | 8.7.4 | SDK-8.7.4 |
60
+ | 8.7.3 | SDK-8.7.3 |
61
+ | 8.7.2 | SDK-8.7.2 |
62
+ | 8.7.1 | SDK-8.7.1 |
63
+ | 8.7.0 | SDK-8.7.0 |
64
+
65
+ <br><br>
package/SECURITY.md ADDED
@@ -0,0 +1,10 @@
1
+ # Reporting Security Issues
2
+
3
+ Pegasystems takes security seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
4
+
5
+ To report a security issue, [email us](mailto:opensource@pega.com;security@pega.com) and include the word "SECURITY" in the subject line.
6
+
7
+ The Pega team will send a response indicating the next steps in handling your report. We may ask for additional information or guidance.
8
+
9
+ ## Learning More About Security
10
+ To learn more about securing a Pega application or our security capabilities, please see the [security article](https://community.pega.com/knowledgebase/capabilities/security) on Pega Community and the [Pega Trust Center](https://www.pega.com/products/cloud/pega-trust-center).
@@ -0,0 +1,167 @@
1
+ ConstellationJS Engine License
2
+ Version 1.0, December 2021
3
+
4
+ This is a proprietary license based on the Apache 2.0 license and is intended to
5
+ provide a similar set of rights with the exception that any and all ConstellationJS
6
+ Engine components shall be used only with Pegasystems Software.
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution
12
+ as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner
15
+ that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all other entities that
18
+ control, are controlled by, or are under common control with that entity. For the
19
+ purposes of this definition, "control" means (i) the power, direct or indirect, to
20
+ cause the direction or management of such entity, whether by contract or otherwise,
21
+ or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or
22
+ (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions
25
+ granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications, including
28
+ but not limited to software source code, documentation source, and configuration
29
+ files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical transformation or
32
+ translation of a Source form, including but not limited to compiled object code,
33
+ generated documentation, and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
36
+ available under the License, as indicated by a copyright notice that is included
37
+ in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is
40
+ based on (or derived from) the Work and for which the editorial revisions,
41
+ annotations, elaborations, or other modifications represent, as a whole, an
42
+ original work of authorship. For the purposes of this License, Derivative Works
43
+ shall not include works that remain separable from, or merely link (or bind by
44
+ name) to the interfaces of, the Work and Derivative Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original version
47
+ of the Work and any modifications or additions to that Work or Derivative Works
48
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
49
+ by the copyright owner or by an individual or Legal Entity authorized to submit
50
+ on behalf of the copyright owner. For the purposes of this definition, "submitted"
51
+ means any form of electronic, verbal, or written communication sent to the Licensor
52
+ or its representatives, including but not limited to communication on electronic
53
+ mailing lists, source code control systems, and issue tracking systems that are
54
+ managed by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously marked or
56
+ otherwise designated in writing by the copyright owner as "Not a Contribution."
57
+
58
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
59
+ of whom a Contribution has been received by Licensor and subsequently incorporated
60
+ within the Work.
61
+
62
+ "Pegasystems" (or "Pega") shall mean Pegasystems Inc., a Massachusetts Corporation,
63
+ having an office at One Main Street, Cambridge, MA 02142.
64
+
65
+ "Pegasystems Software" shall mean duly licensed Pegasystems software and/or
66
+ subscription services including but not limited to the Pega Platform.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
69
+ License, each Contributor hereby grants to You a perpetual, worldwide,
70
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
71
+ reproduce, publicly display, publicly perform, sublicense, and distribute
72
+ the Work in minified JavaScript form solely for use with Pegasystems Software.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of this License,
75
+ each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
76
+ no-charge, royalty-free, irrevocable (except as stated in this section) patent
77
+ license to make, have made, use, offer to sell, sell, import, and otherwise
78
+ transfer the Work, where such license applies only to those patent claims
79
+ licensable by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s) with the Work
81
+ to which such Contribution(s) was submitted. If You institute patent litigation
82
+ against any entity (including a cross-claim or counterclaim in a lawsuit) alleging
83
+ that the Work or a Contribution incorporated within the Work constitutes direct
84
+ or contributory patent infringement, then any patent licenses granted to You
85
+ under this License for that Work shall terminate as of the date such litigation
86
+ is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
89
+ Derivative Works thereof in any medium, with or without modifications, and in
90
+ Source or Object form, provided that You meet the following conditions:
91
+
92
+ 1. You must give any other recipients of the Work or Derivative Works
93
+ a copy of this License; and
94
+
95
+ 2. You must cause any modified files to carry prominent notices stating
96
+ that You changed the files;
97
+ and
98
+
99
+ 3. You must retain, in the Source form of any Derivative Works that You
100
+ distribute, all copyright, patent, trademark, and attribution notices
101
+ from the Source form of the Work, excluding those notices that do not
102
+ pertain to any part of the Derivative Works; and
103
+
104
+ 4. If the Work includes a "NOTICE" text file as part of its distribution,
105
+ then any Derivative Works that You distribute must include a readable
106
+ copy of the attribution notices contained within such NOTICE file,
107
+ excluding those notices that do not pertain to any part of the Derivative
108
+ Works, in at least one of the following places: within a NOTICE text
109
+ file distributed as part of the Derivative Works; within the Source
110
+ form or documentation, if provided along with the Derivative Works;
111
+ or, within a display generated by the Derivative Works, if and
112
+ wherever such third-party notices normally appear. The contents
113
+ of the NOTICE file are for informational purposes only and do not
114
+ modify the License. You may add Your own attribution notices within
115
+ Derivative Works that You distribute, alongside or as an addendum
116
+ to the NOTICE text from the Work, provided that such additional
117
+ attribution notices cannot be construed as modifying the License.
118
+
119
+ You may add Your own copyright statement to Your modifications and may
120
+ provide additional or different license terms and conditions for use,
121
+ reproduction, or distribution of Your modifications, or for any such
122
+ Derivative Works as a whole, provided Your use, reproduction, and
123
+ distribution of the Work otherwise complies with the conditions stated
124
+ in this License including the limitation that the Work be used only
125
+ with Pegasystems Software.
126
+
127
+ 5. Submission of Contributions. Any Contribution intentionally submitted for inclusion
128
+ in the Work by You to the Licensor shall be under the terms and conditions of this
129
+ License, without any additional terms or conditions. Notwithstanding the above,
130
+ nothing herein shall supersede or modify the terms of any separate license agreement
131
+ you may have executed with Licensor regarding such Contributions.
132
+
133
+ 6. Trademarks. This License does not grant permission to use the trade names,
134
+ trademarks, service marks, or product names of the Licensor, except as required
135
+ for reasonable and customary use in describing the origin of the Work and
136
+ reproducing the content of the NOTICE file.
137
+
138
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
139
+ writing, Licensor provides the Work (and each Contributor provides its Contributions)
140
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
141
+ implied, including, without limitation, any warranties or conditions of TITLE,
142
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
143
+ solely responsible for determining the appropriateness of using or redistributing
144
+ the Work and assume any risks associated with Your exercise of permissions under
145
+ this License.
146
+
147
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
148
+ tort (including negligence), contract, or otherwise, unless required by applicable
149
+ law (such as deliberate and grossly negligent acts) or agreed to in writing, shall
150
+ any Contributor be liable to You for damages, including any direct, indirect,
151
+ special, incidental, or consequential damages of any character arising as a
152
+ result of this License or out of the use or inability to use the Work (including
153
+ but not limited to damages for loss of goodwill, work stoppage, computer failure
154
+ or malfunction, or any and all other commercial damages or losses), even if such
155
+ Contributor has been advised of the possibility of such damages.
156
+
157
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
158
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
159
+ acceptance of support, warranty, indemnity, or other liability obligations
160
+ and/or rights consistent with this License. However, in accepting such obligations,
161
+ You may act only on Your own behalf and on Your sole responsibility, not on
162
+ behalf of any other Contributor, and only if You agree to indemnify, defend,
163
+ and hold each Contributor harmless for any liability incurred by, or claims
164
+ asserted against, such Contributor by reason of your accepting any such
165
+ warranty or additional liability.
166
+
167
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1 @@
1
+ const viewConfig="@P .viewConfig",routingInfo="@ROUTING_INFO",rootContainerWithHybrid={type:"RootContainer",config:{renderingMode:"hybrid"},children:[{type:"HybridViewContainer",config:{routingInfo,name:"primary",contextName:"app"},children:[]}]},rootContainerWithHybridAcTertiary={type:"RootContainer",config:{renderingMode:"hybrid",acTertiary:!0},children:[{type:"HybridViewContainer",config:{routingInfo,name:"primary",contextName:"app",acTertiary:!0},children:[]}]},buildSemanticUrl=(e,t,o,n,i)=>{const a=new URLSearchParams(t);let r=!1;"true"===o&&(r=!0);let s=null,l=null;if(e){e.startsWith("/")&&(e=e.substring(1));const t=e.split("/");t.length>0&&t[0]&&(s=t[0]),t.length>1&&t[1]&&(l=t[1])}else r=!1;let c=n;s&&(c=`${c}/${s}`),l&&(c=`${c}/${l}`),r&&(a.has("noPortal")||a.append("noPortal",!0),l&&i&&a.append("view",i));const C=a.toString();return c+=C?`?${C}`:"",c};let containerCount=0;const loadView=(e,t,o=[],n,i,a,r)=>{const s=("hybrid"===r?`hybrid_${containerCount+=1}`:r)||`mashup${containerCount+=1}`,l={type:"RootContainer",config:{renderingMode:"portal",viewConfig,name:s}};globalThis.PCore.getRuntimeParamsAPI().setRuntimeParams(n),PCore.getBootstrapUtils().loadRootComponent(e,l,o,i,a).then((()=>PCore.getBootstrapUtils().updateStoreWithUiRoot(t,s)))},loadPortal=(e,t,o=[],n)=>{const i=n||`portal${containerCount+=1}`,a={type:"RootContainer",config:{viewConfig,renderingMode:"portal",skeleton:"LoadingComponent",name:i}};o.push(a.config.skeleton),PCore.getEnvironmentInfo().isPortalLoaded=!0,PCore.getBootstrapUtils().loadRootComponent(e,a,o).then((()=>PCore.getBootstrapUtils().loadPortalView(t,i)))},loadComponent=(e,t,o)=>PCore.getBootstrapUtils().loadComponent(t,e,o),loadViewByName=(e,t,o,n,i,a,r,s)=>{const l=s||`mashup${containerCount+=1}`,c={type:"RootContainer",config:{viewConfig,renderingMode:"view",name:l}};PCore.getBootstrapUtils().loadRootComponent(e,c,i,a,r).then((()=>PCore.getBootstrapUtils().loadViewByName(t,o,n,l)))},loadMashup=(e,t=!0)=>{const o={type:"RootContainer",config:{renderingMode:"noPortal"},children:[{type:"ViewContainer",config:{routingInfo,name:"primary"}}]};if(t){const t=document.getElementsByTagName(e)[0]&&document.getElementsByTagName(e)[0].parentNode;if(t){const e=document.createElement("style");e.setAttribute("id","portal-less-styles"),e.innerHTML="app-root.mashup > .case-view, app-root.mashup > .page-view { min-height: 0px !important; }",t.appendChild(e)}}PCore.getBootstrapUtils().loadRootComponent(e,o,[PCore.getConstants().LOAD_VIEW_STRING,"ViewContainer"]),globalThis.parent!==globalThis&&import(`${PCore.getAssetLoader().getStaticServerUrl()}constellation-mashup-bridge.js`).then((e=>{e.mashup.init({resizing:"stretch"})}))},loadCase=(e,t,o=[],n,i,a={})=>{const{isCaseLocked:r=!1}=a;o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().openCase(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY)))).then((()=>{r&&PCore.getPubSubUtils().publish(PCore.getEvents().getCaseEvent().CASE_LOCK_EVENT),PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}))},loadPreview=(e,t,o=[],n,i)=>{const{caseID:a,caseClass:r}=t;o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),rootContainerWithHybrid.config.name="hybrid_preview",PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getCoexistenceManager().showCasePreview(a,r))))},createCase=(e,t,o=[],n,i)=>{o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().createCase(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY))))},loadAssignment=(e,t,o=[],n,i,{isUIkit:a,isReloadAssignment:r,caseId:s,acTertiary:l,uiKitConstellationCaseInCreateStage:c})=>{if(a){const e=PCore.getEnvironmentInfo().getCoexistenceMeta();e.isCoexistence=!0,e.appType=PCore.getConstants().APP_TYPE.UIKIT,PCore.getEnvironmentInfo().setCoexistenceMeta(e)}if(r)PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),JSON.parse(c)&&a?PCore.getMashupApi().openCase(s,PCore.getConstants().APP.APP,{pageName:PCore.getConstants().VIEW_TYPE.PY_EMBEDASSIGNMENT}):PCore.getBootstrapUtils().getCaseApi().openCase(s,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY)))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}));else if(o.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),a)PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getMashupApi().openAssignment(t,PCore.getConstants().APP.APP,{pageName:PCore.getConstants().VIEW_TYPE.PY_EMBEDASSIGNMENT})))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}));else{const a=l?rootContainerWithHybridAcTertiary:rootContainerWithHybrid;PCore.getBootstrapUtils().loadRootComponent(e,a,o,n,i).then((()=>(PCore.getInitialiser().initCoreContainers(),PCore.getBootstrapUtils().getCaseApi().openAssignment(t,PCore.getConstants().APP.APP,PCore.getConstants().PRIMARY,{acTertiary:l,skipFlowNameCheck:!0})))).then((()=>{PCore.getCoexistenceManager().getEventUtils().publishConstellationLoadedEvent()}))}},registerForDebugInfo=e=>{PCore.getEnvironmentInfo().setPreviewMode(),e&&PCore.getPubSubUtils().subscribe("fetchSuccess",(({debugInfo:t})=>{const o=t&&t["X-Pega-App-Debug-ID"];e.postMessage({appDebugID:o})}),"fetchSuccess")},toggleTracerHeaders=e=>{e.addEventListener("message",(async e=>{const t=e?.data?.enableTracer;t?PCore.getDebugger().enableTracer():PCore.getDebugger().disableTracer()}))},initCoreConfig=e=>{const{serviceConfig:t,semanticUrl:o,queryParams:n,noPortal:i,noHistory:a,viewName:r,theme:s,restServerConfig:l,dynamicLoadComponents:c=!0,dynamicSemanticUrl:C=!0,renderingMode:p="FULL_PORTAL",envType:g,extras:d}=e,{appAlias:m,contextPath:P}=t;let u=globalThis.location.origin;const h={};if(void 0!==l&&(u=l),P&&(u=`${u}${P}`),m&&"LAUNCHPAD"!==g&&(u=`${u}/${m}`),e.restServerConfig=u,!0===C){const e=buildSemanticUrl(o,n,i,u,r);!a&&e&&globalThis.history.pushState({},"home",e)}else if("HYBRID"!==p){let e=globalThis.location.href;e.indexOf("?")>0&&(e=e.substring(0,e.indexOf("?")),globalThis.history.pushState({},"home",e)),h.dynamicSemanticUrl=!1}!0!==c&&(h.dynamicLoadComponents=!1);let f=null;if(m){const e=m.indexOf("/app/");f=e>=0?m.substring(e+1):m}if(Object.keys(h).length>0&&PCore.setBehaviorOverrides(h),e.appAlias=f,s){let t="object"==typeof s?s:null;if(null===t)try{t=JSON.parse(s)}catch{t={}}e.theme=t}const y={...e.routingInfo,domain:`${globalThis.location.protocol}//${globalThis.location.host}`,searchParams:globalThis.location.search};e.routingInfo=y,e.initBroadcast="true"===PCore.getEnvironmentInfo().environmentInfoObject?.pxMashupDetails?.pyIsTraditionalCoexistence,!e.noPortal||"true"!==e.noPortal&&!0!==e.noPortal||"HYBRID"===e.renderingMode||(e.renderingMode="EMBED"),d?.cspNonce&&(globalThis.__webpack_nonce__=d.cspNonce),e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getInitialiser().init(e)},importConstellationCore=async(e,t)=>{const{isDevServerMode:o,isSdk:n}=t,{prerequisite:i}=t;if(i&&i.length>0){const t=i[0];let a;const r=Object.keys(t)[0];if(o){const e=Object.values(t)[0];a=e.endsWith("/")?`${e}prerequisite/${r}`:`${e}/prerequisite/${r}`}else a=e.endsWith("/")?`${e}prerequisite/${r}`:`${e}/prerequisite/${r}`;if(n){a=`${e?.endsWith("/")?e.slice(0,-1):e}/prerequisite/${r.startsWith("/")?r.slice(1):r}`}return import(a).then((()=>{PCore.getAssetLoader().initServer(e,"no-appstatic");for(let t=1;t<i.length;t+=1){const n=i[t],a=Object.keys(n)[0];if(o){const e=Object.values(n)[0];import(`${e}prerequisite/${a}`).then((e=>{console.log(e)}))}else import(`${e}prerequisite/${a}`).then((e=>{console.log(e)}))}}))}return null},importLocalizationAssets=async(e,t)=>{const o=await PCore.getAssetLoader().getSvcLocale(t,`${e}.json`);if(o.ok){const t=await o.json();PCore.getLocaleUtils().setLocaleForRule(t,e)}},importLocalizationV2Assets=async e=>{const t=PCore.getEnvironmentInfo().getAvailableLocalePacks(),o=PCore.getEnvironmentInfo().getLocalizationBundles();let n;if(e&&t&&t.includes(e)?n=[PCore.getRestClient().invokeRestApi("getLocalizationPack",{queryPayload:{locale:e}})]:o.length>0&&(n=o.map((e=>PCore.getRestClient().invokeRestApi("getLocalizationPack",{queryPayload:{version:e.pyBundleVersion,bundle:e.pyBundleName}})))),!n||0===n.length)return void console.warn(`current locale ${e} is not supported by application.`);(await Promise.allSettled(n)).forEach((({status:e,value:t})=>{if("fulfilled"===e&&(201===t.status||200===t.status)&&t.data){const e=t.data;Object.keys(e).forEach((t=>{PCore.getLocaleUtils().setLocaleForRule(e[t],t)}))}}))},importExternals=async e=>{const{isDevServerMode:t}=e,o=PCore.getEnvironmentInfo().getLocale(),n=PCore.getEnvironmentInfo().getLocalizationVersion();try{let e;e=2===n?[o]:[PCore.getLocaleUtils().GENERIC_BUNDLE_KEY,PCore.getLocaleUtils().MESSAGE_BUNDLE_KEY,PCore.getLocaleUtils().FIELD_LABELS_BUNDLE_KEY];const t=e.map((async e=>{2===n?await importLocalizationV2Assets(e):await PCore.getLocaleUtils().isCurrentLocalePackAvailable()&&await importLocalizationAssets(e,o)}));await Promise.allSettled(t)}catch(e){console.warn(e)}await PCore.getAssetLoader().loadAssets(e.externals,{isDevServerMode:t}),await PCore.getAssetLoader().loadAssets(e.entry,{isDevServerMode:t})},importAssetsJson=async e=>{const t=(new Date).getTime();return fetch(`${e}lib_asset.json?v=${t}`).then((e=>e.json()))},importReactRoot=async()=>{const e=[];return PCore.getComponentsRegistry().getComponent("ReactRoot").modules.forEach((t=>{e.push(t())})),Promise.allSettled(e)},importDesignSystemComponentMap=async(e,t,o)=>{try{await function(e,t=!0){return new Promise(((o,n)=>{const i=document.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",e),i.setAttribute("async",t),i.onload=o(),i.onerror=()=>n(new Error("Failed to load resource from Design System")),document.body.appendChild(i)}))}(`${e}component/project/${t}/designsystems/${o}/componentsmap.js?v=${Date.now()}`)}catch(e){console.log(e)}},bootstrap=async(e,t)=>new Promise((async(o,n)=>{try{const{staticContentServer:n,appStaticContentServer:i}=e.serviceConfig,{ccV2LibId:a,environmentId:r,isAlternateDesignSystemEnabled:s,alternateDesignSystemName:l}=e,c=await importAssetsJson(n);await importConstellationCore(n,c),initCoreConfig(e);const C=async()=>{await importReactRoot(),a&&await PCore.getAssetLoader().importCustomComponentMap(a),"true"===s&&"other"!==l&&await importDesignSystemComponentMap(i,r,l),t&&t(),o(!0)};PCore.getPubSubUtils().subscribe("component-map-loaded",C),await importExternals(c),"ReactRoot"in PCore.getComponentsRegistry().getLazyMap()&&o(!0)}catch(e){n(e)}})),loadEnvironmentInfo=async e=>{if(e.theme&&(!globalThis.pms||"Android"!==globalThis.pms.device.systemName))try{const t=JSON.parse(e.theme.definition);PCore.getEnvironmentInfo().setBrandingInfo(t.Branding),PCore.getEnvironmentInfo().setTheme(t.Theme)}catch{PCore.getEnvironmentInfo().setBrandingInfo({}),PCore.getEnvironmentInfo().setTheme({})}e.keyMapping&&PCore.getEnvironmentInfo().setKeyMapping(e.keyMapping),PCore.getEnvironmentInfo().setCookieComplianceMethod(e.cookieComplianceMethod??"none"),PCore.getEnvironmentInfo().setIsExtraCallRequiredForDefaultHome(e.isExtraCallRequiredForDefaultHome??"false")},getBootstrapConfig=async(e,t,o,n,i,a)=>{const r={};n&&(r.themeID=n),a&&(r.locale=a);const s=`${e}/api/application/v2/data_views/D_pxBootstrapConfig${n||a?`?dataViewParameters=${encodeURIComponent(JSON.stringify(r))}`:""}`,l=t?{Authorization:t,...o}:o;return fetch(s,{method:"GET",headers:new Headers(l),credentials:t&&!i?"omit":"include"}).then((e=>{if(e.ok)return e.json();throw Error("D_pxBootstrapConfig load failed.",{cause:e.status})}))},applyEnvironmentInfoResponse=async e=>{const{environmentInfo:t,pyCaseTypeList:o,theme:n,keyMapping:i}=e,{pxApplication:a,features:r,pxLocale:s}=t,l={simpleTable:{pageInstructionUUIDGeneration:!1},...r},c=Intl.DateTimeFormat().resolvedOptions().timeZone.toUpperCase(),C="ETC/UNKNOWN"===c?"America/New_York":c;e.environmentInfo={...t,pxApplication:{...a},features:l,pyCaseTypeList:o,pxLocale:{...s,pyTimeZone:C}},e.timezone=C;const p=Object.keys(e.environmentInfo);return{isEnvInfoValid:["pxOperator","pxLocale","pxApplication"].every((e=>p.includes(e))),theme:n,keyMapping:i,features:l}},getLPConfig=async(e,t,o,n)=>{const i=new Headers({...o,...t&&{Authorization:t}}),a=await fetch(e,{method:"GET",headers:i,credentials:t&&!n?"omit":"include"});if(!a.ok)throw new Error("environmentInfo load failed.",{cause:a.status});return a.json()},loadRootContainer=(e,t=[],o,n)=>(t.push(PCore.getConstants().CONTAINER_TYPE.HYBRID,PCore.getConstants().LOAD_VIEW_STRING),PCore.getBootstrapUtils().loadRootComponent(e,rootContainerWithHybrid,t,o,n)),bootstrapWithAuthHeader=async(e,t,o=[],n,i)=>{const{customRendering:a=!1,onPCoreReadyCallback:r,staticContentServerUrl:s,dynamicSetCookie:l=!1,authInfo:c={},renderingMode:C,locale:p,envType:g,themeID:d,customCookies:m,enableRouting:P}=e;let{restServerUrl:u,authorizationHeader:h,appAlias:f,theme:y={}}=e,v=e.additionalHeaders?{...e.additionalHeaders}:{},I=null;if((h&&0===Object.keys(c).length||m)&&(c.authType="custom",c.customCookies=m),!h&&c.tokenInfo?.access_token){const{tokenInfo:e}=c;h=`${e.token_type} ${e.access_token}`}if(c.tokenInfo?.csrf&&(v={...v,pzCTkn:c.tokenInfo.csrf}),f&&-1===f.indexOf("/")&&(f=`app/${f}`),"LAUNCHPAD"===g){v={...v,"X-Constellation-App":"Pega"},u=u.endsWith("/dx")?u:`${u}/dx`;const e=d?`?themeID=${d}`:"";I=await getLPConfig(`${u}/api/application/v2/environmentInfo${e}`,h,v,m),0===Object.keys(y).length&&I.theme?.definition&&(y=JSON.parse(I.theme.definition).Theme)}else I=await getBootstrapConfig(f?`${u}/${f}`:`${u}`,h,v,d,m,p);const b=I?.pyConfigJSON?JSON.parse(I.pyConfigJSON):{...I};"LAUNCHPAD"===g&&await applyEnvironmentInfoResponse(b),b.restServerConfig=u,b.dynamicSemanticUrl=!1,b.dynamicSetCookie=l,b.enableRouting=!1,b.serviceConfig.contextPath="",b.serviceConfig.appAlias=f,b.additionalHeaders={Authorization:h,...v},b.envType=g,b.dynamicLoadComponents=!a,b.dynamicSemanticUrl=!a,b.noHistory=!0,b.theme=y??{};const A=d&&b?.themeObject?b.themeObject:null;b.theme=A||y,b.renderingMode=C??b.renderingMode,b.locale=p||b.locale;const E=s||b.serviceConfig.staticContentServer,R=await importAssetsJson(E);if(R.isSdk?(b.enableRouting=P,b.dynamicSemanticUrl=b.enableRouting,await importConstellationCore(s,R)):(b.serviceConfig.staticContentServer=E,b.serviceConfig.appStaticContentServer=b.serviceConfig.appStaticContentServer||"no-appstatic",await importConstellationCore(E,R)),initCoreConfig(b),r&&globalThis.PCore.onPCoreReady(r),"LAUNCHPAD"===b.envType&&"EMBED"===b.renderingMode&&PCore.getEnvironmentInfo().setIsWebEmbed(!0),c&&["OAuth2.0","custom"].includes(c?.authType)&&PCore.getBootstrapUtils().setFetchAuthInfo(c),R.isSdk&&a&&await importExternals(R),!a){const e=PCore.getEnvironmentInfo().environmentInfoObject?.pyInfinityStaticService;let a=null;if(e){const e=await PCore.getDataPageUtils().getDataAsync("D_pxGetComponentLibraryListAndMap","",{});Array.isArray(e.data)&&e.data.length>0&&(a=e.data)}const r=async(e,t)=>{try{const t=async()=>{await importReactRoot(),a&&await Promise.all(a.map((({pyComponentMap:e})=>PCore.getAssetLoader().importCustomComponentMap(e)))),e(!0)};PCore.getPubSubUtils().subscribe("component-map-loaded",t),await importExternals(R),"ReactRoot"in PCore.getComponentsRegistry().getLazyMap()&&e(!0)}catch(e){t(e)}},s=new Promise(r);await s,PCore.getInitialiser().initCoreContainers(),await loadRootContainer(t,o,n,i)}},initConstellationCore=async e=>{const t=await importAssetsJson(e);await importConstellationCore(e,t)},loadDefaultPortal=(e,t=[],o)=>{const n=PCore.getEnvironmentInfo().getDefaultPortal();loadPortal(e,n,t,o)},isNewUnifiedBuild=()=>!1,updateLocale=e=>{PCore.getEnvironmentInfo().setLocale(e)};export{bootstrap,loadView,loadPortal,loadDefaultPortal,loadComponent,loadMashup,loadViewByName,loadCase,createCase,loadAssignment,loadPreview,bootstrapWithAuthHeader,initConstellationCore,isNewUnifiedBuild,registerForDebugInfo,toggleTracerHeaders,loadEnvironmentInfo,updateLocale};
Binary file
Binary file