pyxecm 1.5__py3-none-any.whl → 2.0.0__py3-none-any.whl

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.

Potentially problematic release.


This version of pyxecm might be problematic. Click here for more details.

Files changed (56) hide show
  1. pyxecm/__init__.py +6 -2
  2. pyxecm/avts.py +1492 -0
  3. pyxecm/coreshare.py +1075 -960
  4. pyxecm/customizer/__init__.py +16 -4
  5. pyxecm/customizer/__main__.py +58 -0
  6. pyxecm/customizer/api/__init__.py +5 -0
  7. pyxecm/customizer/api/__main__.py +6 -0
  8. pyxecm/customizer/api/app.py +914 -0
  9. pyxecm/customizer/api/auth.py +154 -0
  10. pyxecm/customizer/api/metrics.py +92 -0
  11. pyxecm/customizer/api/models.py +13 -0
  12. pyxecm/customizer/api/payload_list.py +865 -0
  13. pyxecm/customizer/api/settings.py +103 -0
  14. pyxecm/customizer/browser_automation.py +332 -139
  15. pyxecm/customizer/customizer.py +1075 -1057
  16. pyxecm/customizer/exceptions.py +35 -0
  17. pyxecm/customizer/guidewire.py +322 -0
  18. pyxecm/customizer/k8s.py +787 -338
  19. pyxecm/customizer/log.py +107 -0
  20. pyxecm/customizer/m365.py +3424 -2270
  21. pyxecm/customizer/nhc.py +1169 -0
  22. pyxecm/customizer/openapi.py +258 -0
  23. pyxecm/customizer/payload.py +18201 -7030
  24. pyxecm/customizer/pht.py +1047 -210
  25. pyxecm/customizer/salesforce.py +836 -727
  26. pyxecm/customizer/sap.py +58 -41
  27. pyxecm/customizer/servicenow.py +851 -383
  28. pyxecm/customizer/settings.py +442 -0
  29. pyxecm/customizer/successfactors.py +408 -346
  30. pyxecm/customizer/translate.py +83 -48
  31. pyxecm/helper/__init__.py +5 -2
  32. pyxecm/helper/assoc.py +98 -38
  33. pyxecm/helper/data.py +2482 -742
  34. pyxecm/helper/logadapter.py +27 -0
  35. pyxecm/helper/web.py +229 -101
  36. pyxecm/helper/xml.py +528 -172
  37. pyxecm/maintenance_page/__init__.py +5 -0
  38. pyxecm/maintenance_page/__main__.py +6 -0
  39. pyxecm/maintenance_page/app.py +51 -0
  40. pyxecm/maintenance_page/settings.py +28 -0
  41. pyxecm/maintenance_page/static/favicon.avif +0 -0
  42. pyxecm/maintenance_page/templates/maintenance.html +165 -0
  43. pyxecm/otac.py +234 -140
  44. pyxecm/otawp.py +2689 -0
  45. pyxecm/otcs.py +12344 -7547
  46. pyxecm/otds.py +3166 -2219
  47. pyxecm/otiv.py +36 -21
  48. pyxecm/otmm.py +1363 -296
  49. pyxecm/otpd.py +231 -127
  50. pyxecm-2.0.0.dist-info/METADATA +145 -0
  51. pyxecm-2.0.0.dist-info/RECORD +54 -0
  52. {pyxecm-1.5.dist-info → pyxecm-2.0.0.dist-info}/WHEEL +1 -1
  53. pyxecm-1.5.dist-info/METADATA +0 -51
  54. pyxecm-1.5.dist-info/RECORD +0 -30
  55. {pyxecm-1.5.dist-info → pyxecm-2.0.0.dist-info/licenses}/LICENSE +0 -0
  56. {pyxecm-1.5.dist-info → pyxecm-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,5 @@
1
+ """Initialize the maintenance page."""
2
+
3
+ from .app import run_maintenance_page, settings
4
+
5
+ __all__ = ["run_maintenance_page", "settings"]
@@ -0,0 +1,6 @@
1
+ """Wrapper to start the Maintenance Page."""
2
+
3
+ from pyxecm.maintenance_page import run_maintenance_page
4
+
5
+ if __name__ == "__main__":
6
+ run_maintenance_page()
@@ -0,0 +1,51 @@
1
+ """Maintenance Page that can be enabled by the customizer."""
2
+
3
+ import os
4
+ from datetime import datetime
5
+
6
+ import uvicorn
7
+ from fastapi import FastAPI, HTTPException, Request
8
+ from fastapi.responses import FileResponse
9
+ from fastapi.templating import Jinja2Templates
10
+ from pytz import UTC
11
+ from starlette.exceptions import HTTPException as StarletteHTTPException
12
+
13
+ from pyxecm.maintenance_page.settings import settings
14
+
15
+ app = FastAPI(openapi_url=None)
16
+
17
+ base_dir = os.path.dirname(os.path.abspath(__file__))
18
+ static_dir = os.path.join(base_dir, "static")
19
+ templates = Jinja2Templates(directory=settings.templates_dir)
20
+
21
+
22
+ @app.get("/favicon.avif", include_in_schema=False)
23
+ async def favicon() -> FileResponse:
24
+ """Serve the favicon."""
25
+ return FileResponse(path=os.path.join(static_dir, "favicon.avif"))
26
+
27
+
28
+ @app.exception_handler(StarletteHTTPException)
29
+ async def http_exception_handler(request: Request, exc: HTTPException) -> Jinja2Templates:
30
+ """Handle HTTP Exceptions."""
31
+
32
+ if exc.status_code == 404:
33
+ return templates.TemplateResponse(
34
+ request=request,
35
+ name="maintenance.html",
36
+ context={
37
+ "maint_title": settings.title,
38
+ "maint_text": settings.text,
39
+ "maint_footer": settings.footer,
40
+ "status_url": settings.status_url,
41
+ "copyright_year": datetime.now(tz=UTC).year,
42
+ },
43
+ status_code=513,
44
+ )
45
+ else:
46
+ return templates.TemplateResponse("error.html", {"request": request, "status_code": exc.status_code})
47
+
48
+
49
+ def run_maintenance_page() -> None:
50
+ """Start the FASTAPI Webserver."""
51
+ uvicorn.run(app, host=settings.host, port=settings.port)
@@ -0,0 +1,28 @@
1
+ """Place for all settings classes for the Maintenance Page."""
2
+
3
+ import os
4
+ from typing import Literal
5
+
6
+ from pydantic import Field
7
+ from pydantic_settings import BaseSettings, SettingsConfigDict
8
+
9
+
10
+ class MaintenancePageSettings(BaseSettings):
11
+ """Settings for the Customizer API."""
12
+
13
+ status_url: str | None = Field(default=None)
14
+
15
+ title: str = Field(default="Maintenance Mode")
16
+ text: str = Field(default="The Content Management system is currently unavailable.")
17
+ footer: str = Field(default="")
18
+
19
+ loglevel: Literal["INFO", "DEBUG", "WARNING", "ERROR"] = "INFO"
20
+ host: str = Field(default="0.0.0.0", frozen=True) # noqa: S104
21
+ port: int = Field(default=5555, frozen=True)
22
+ templates_dir: str = Field(default=os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates"))
23
+
24
+ model_config = SettingsConfigDict(env_prefix="MAINTENANCE_PAGE_")
25
+
26
+
27
+ # Create instance of the settings class
28
+ settings = MaintenancePageSettings()
@@ -0,0 +1,165 @@
1
+ <!DOCTYPE html>
2
+
3
+ <style>
4
+ html {
5
+ font-family: sans-serif;
6
+ -webkit-text-size-adjust: 100%;
7
+ -ms-text-size-adjust: 100%;
8
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
9
+ height: 100%;
10
+ background-color: #111b58;
11
+ background: -webkit-linear-gradient(
12
+ 29deg,
13
+ rgb(9, 14, 44) 0%,
14
+ rgb(18, 44, 105) 59%,
15
+ rgb(7, 141, 179) 100%
16
+ );
17
+ background: -o-linear-gradient(
18
+ 29deg,
19
+ rgb(9, 14, 44) 0%,
20
+ rgb(18, 44, 105) 59%,
21
+ rgb(7, 141, 179) 100%
22
+ );
23
+ background: -ms-linear-gradient(
24
+ 29deg,
25
+ rgb(9, 14, 44) 0%,
26
+ rgb(18, 44, 105) 59%,
27
+ rgb(7, 141, 179) 100%
28
+ );
29
+ background: -moz-linear-gradient(
30
+ 29deg,
31
+ rgb(9, 14, 44) 0%,
32
+ rgb(18, 44, 105) 59%,
33
+ rgb(7, 141, 179) 100%
34
+ );
35
+ background: linear-gradient(
36
+ 61deg,
37
+ rgb(9, 14, 44) 0%,
38
+ rgb(18, 44, 105) 59%,
39
+ rgb(7, 141, 179) 100%
40
+ );
41
+ background-attachment: fixed;
42
+ }
43
+ body {
44
+ background: inherit;
45
+ }
46
+
47
+ #ot-logo {
48
+ width: 280px;
49
+ height: 50px;
50
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 244 46" fill="white"><path d="M32.8 21c0 7.4-4.4 15.4-16 15.4C8.4 36.4.7 31.8.7 21c0-8.9 5.8-15.8 17.2-15.2 12.2.7 14.9 9.9 14.9 15.2zm-21.7-5.6C10 17 9.6 19 9.6 21c0 4.5 2.3 8.6 7.2 8.6 4.8 0 7.1-3.8 7.1-8.2 0-3.2-.8-5.6-2.5-7.1-1.8-1.6-3.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 9.8 4.2 13.1h-21.4c-.1 3.6 1.8 7.3 6.5 7.3 4.8 0 6.2-3.1 7.3-5.1l6.7 3.3zm-8.2-10.8c-.2-1.2-.4-2.9-1.7-4.1-1.1-1.1-2.8-1.6-4.3-1.6-2.1 0-3.6 1-4.5 1.9-1.2 1.3-1.5 2.6-1.8 3.9l12.3-.1z"/><path d="M208.7 35.7l-11-15.3 9.1-13.8h-10l-4.3 6.5-4.7-6.5h-10l9.9 13.8-10.2 15.3h10l5.3-8.1 5.8 8.1h10.1zM44.9 9.1c.8-1.3 3.5-3.3 7.8-3.3 7.3 0 12.5 5.4 12.5 15.1 0 6-2.2 15.4-12.9 15.4-3.8 0-6.8-2.1-7.5-3.3v12.2H36V6.5h8.9v2.6zm6 3.4c-1.6 0-3.3.6-4.5 2.2-1.3 1.5-1.8 3.8-1.8 6.4 0 3.4 1 5.5 2.1 6.7 1 1.1 2.5 1.8 4 1.8 4.3 0 6.2-4.4 6.2-8.7 0-3.6-1.1-7.4-4.7-8.2-.5-.1-.9-.2-1.3-.2z"/></svg>');
51
+ background-repeat: no-repeat;
52
+ background-position-y: center;
53
+ margin-right: 10px;
54
+ }
55
+
56
+ .card {
57
+ background-color: red;
58
+ }
59
+
60
+ .system-name {
61
+ position: absolute;
62
+ font-size: 15pt;
63
+ top: 58px;
64
+ left: 80px;
65
+ font-family: sans-serif;
66
+ font-style: italic;
67
+ color: rgb(158, 158, 158);
68
+ }
69
+
70
+ .logline {
71
+ font-family: monospace;
72
+ }
73
+
74
+ .logline-WARNING {
75
+ background-color: rgb(234, 192, 6, 0.5);
76
+ }
77
+
78
+ .logline-ERROR {
79
+ background-color: rgba(234, 16, 16, 0.5);
80
+ }
81
+
82
+ .scrollbox {
83
+ background: rgba(139, 139, 139, 0.2);
84
+ /* height: 650px; */
85
+ height: calc(100vh - 200px);
86
+ overflow: scroll;
87
+ border: 1px solid #000;
88
+ padding: 5px;
89
+ -ms-overflow-style: none;
90
+ white-space: nowrap;
91
+ }
92
+ </style>
93
+
94
+ <html lang="en">
95
+ <head>
96
+ <meta charset="utf-8" />
97
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
98
+ <title>Customizer</title>
99
+
100
+ <link
101
+ rel="stylesheet"
102
+ href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
103
+ />
104
+ <link rel="icon" href="favicon.avif" />
105
+ </head>
106
+
107
+ <body>
108
+ {% if status_url is not none %}
109
+ <iframe
110
+ src="{{ status_url }}"
111
+ style="
112
+ position: fixed;
113
+ top: 0px;
114
+ left: 0px;
115
+ bottom: 0px;
116
+ right: 0px;
117
+ width: 100%;
118
+ height: 100%;
119
+ border: none;
120
+ margin: 0;
121
+ padding: 0;
122
+ overflow: hidden;
123
+ z-index: 999999;
124
+ "
125
+ >
126
+ Your browser doesn't support iframes
127
+ </iframe>
128
+ {% else %}
129
+
130
+ <!-- Main -->
131
+ <main>
132
+ <div class="d-flex justify-content-center mt-5">
133
+ <div id="ot-logo"></div>
134
+ </div>
135
+
136
+ <div class="d-flex justify-content-center mt-5">
137
+ <div
138
+ class="card bg-transparent shadow text-center border"
139
+ style="width: 500px"
140
+ >
141
+ <div class="card-header bg-light opacity-100" id="maint-title">
142
+ {{ maint_title }}
143
+ </div>
144
+ <div class="card-body text-light opacity-75" id="maint-text">
145
+ {{ maint_text }}
146
+ </div>
147
+ </div>
148
+ </div>
149
+
150
+ <div class="d-flex justify-content-center mt-5">
151
+ <div class="card-footer text-light" id="maint-footer">
152
+ {{ maint_footer }}
153
+ </div>
154
+ </div>
155
+
156
+ <div
157
+ class="box text-light opacity-50 fixed-bottom text-center mb-3 small"
158
+ >
159
+ Copyright © {{ copyright_year }} Open Text. All Rights Reserved.
160
+ </div>
161
+ </main>
162
+
163
+ {% endif %}
164
+ </body>
165
+ </html>