kodexa 7.4.414540091860__tar.gz → 7.4.414561019241__tar.gz
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.
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/PKG-INFO +1 -1
- kodexa-7.4.414561019241/kodexa/platform/manifest.py +452 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/pyproject.toml +1 -1
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/LICENSE +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/README.md +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/assistant/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/assistant/assistant.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/connectors/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/connectors/connectors.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/dataclasses/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/base.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/entities/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/entities/check_response.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/entities/product.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/entities/product_group.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/entities/product_subscription.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/model.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/objects.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/persistence.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/utils.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/pipeline/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/pipeline/pipeline.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/platform/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/platform/client.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/platform/interaction.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/platform/kodexa.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/ast.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/core.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/lexrules.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/lextab.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/lextab.pyi +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/parserules.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/parserules.pyi +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/parsetab.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/selectors/parsetab.pyi +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/spatial/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/spatial/azure_models.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/spatial/bbox_common.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/spatial/table_form_common.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/steps/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/steps/common.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/testing/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/testing/test_components.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/testing/test_utils.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/training/__init__.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/training/train_utils.py +0 -0
- {kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/utils/__init__.py +0 -0
@@ -0,0 +1,452 @@
|
|
1
|
+
import yaml
|
2
|
+
import os
|
3
|
+
import glob
|
4
|
+
import logging
|
5
|
+
import json
|
6
|
+
from kodexa import KodexaClient
|
7
|
+
|
8
|
+
logger = logging.getLogger(__name__)
|
9
|
+
|
10
|
+
|
11
|
+
class ManifestManager:
|
12
|
+
"""
|
13
|
+
A class to manage the manifests for deploying and monitoring
|
14
|
+
Kodexa use-cases
|
15
|
+
"""
|
16
|
+
|
17
|
+
def __init__(self, kodexa_client: KodexaClient):
|
18
|
+
self.kodexa_client = kodexa_client
|
19
|
+
|
20
|
+
@staticmethod
|
21
|
+
def read_manifest(manifest_path: str) -> list:
|
22
|
+
"""
|
23
|
+
Read and parse a YAML manifest file and extract resource paths.
|
24
|
+
|
25
|
+
Args:
|
26
|
+
manifest_path (str): Path to the YAML manifest file.
|
27
|
+
|
28
|
+
Returns:
|
29
|
+
list: List of resource paths extracted from the manifest file.
|
30
|
+
Returns an empty list if 'resource-paths' key is not present
|
31
|
+
or the file doesn't exist.
|
32
|
+
"""
|
33
|
+
if not os.path.exists(manifest_path):
|
34
|
+
logger.warning(f"Manifest file not found: {manifest_path}")
|
35
|
+
return []
|
36
|
+
try:
|
37
|
+
with open(manifest_path, 'r') as file:
|
38
|
+
manifest = yaml.safe_load(file)
|
39
|
+
# Support 'resource-paths' as the primary key
|
40
|
+
return manifest.get('resource-paths', [])
|
41
|
+
except Exception as e:
|
42
|
+
logger.error(
|
43
|
+
f"Failed to read or parse manifest {manifest_path}: {e}",
|
44
|
+
exc_info=True
|
45
|
+
)
|
46
|
+
return []
|
47
|
+
|
48
|
+
def deploy_from_manifest(self, manifest_path: str,
|
49
|
+
org_slug: str | None = None):
|
50
|
+
"""
|
51
|
+
Deploys all resources listed in a manifest file.
|
52
|
+
|
53
|
+
Args:
|
54
|
+
manifest_path (str): The path to the manifest file.
|
55
|
+
org_slug (str | None): The organization slug to deploy to. If None,
|
56
|
+
uses the default org from the client.
|
57
|
+
"""
|
58
|
+
target_org_slug = org_slug or self.kodexa_client.get_org_slug()
|
59
|
+
if not target_org_slug:
|
60
|
+
msg = "Organization slug must be provided or set in the client."
|
61
|
+
raise ValueError(msg)
|
62
|
+
|
63
|
+
logger.info(
|
64
|
+
f"Starting deployment from manifest {manifest_path} "
|
65
|
+
f"to organization {target_org_slug}"
|
66
|
+
)
|
67
|
+
resource_paths = self.read_manifest(manifest_path)
|
68
|
+
abs_manifest_path = os.path.abspath(manifest_path)
|
69
|
+
manifest_dir = os.path.dirname(abs_manifest_path)
|
70
|
+
original_cwd = os.getcwd()
|
71
|
+
deployed_count = 0
|
72
|
+
|
73
|
+
try:
|
74
|
+
# Change to manifest directory to resolve relative paths
|
75
|
+
os.chdir(manifest_dir)
|
76
|
+
|
77
|
+
for resource_pattern in resource_paths:
|
78
|
+
# Use glob to find matching files
|
79
|
+
resource_files = glob.glob(resource_pattern, recursive=True)
|
80
|
+
|
81
|
+
if not resource_files:
|
82
|
+
logger.warning(
|
83
|
+
f"No files found matching pattern '{resource_pattern}' "
|
84
|
+
f"relative to {manifest_dir}"
|
85
|
+
)
|
86
|
+
continue
|
87
|
+
|
88
|
+
for rel_path in resource_files:
|
89
|
+
# Resolve absolute path based on current directory
|
90
|
+
abs_path = os.path.abspath(rel_path)
|
91
|
+
logger.info(f"Processing resource file: {abs_path}")
|
92
|
+
resource_dir = os.path.dirname(abs_path)
|
93
|
+
|
94
|
+
# Temporarily change to resource file's directory
|
95
|
+
# This helps with relative paths in the resource definition
|
96
|
+
os.chdir(resource_dir)
|
97
|
+
|
98
|
+
try:
|
99
|
+
with open(abs_path, 'r') as f:
|
100
|
+
path_lower = abs_path.lower()
|
101
|
+
if path_lower.endswith(".json"):
|
102
|
+
obj = json.load(f)
|
103
|
+
elif path_lower.endswith((".yaml", ".yml")):
|
104
|
+
obj = yaml.safe_load(f)
|
105
|
+
else:
|
106
|
+
logger.warning(
|
107
|
+
f"Skipping unsupported file type: {abs_path}"
|
108
|
+
)
|
109
|
+
continue
|
110
|
+
|
111
|
+
components = []
|
112
|
+
if isinstance(obj, list):
|
113
|
+
logger.info(f"Found {len(obj)} components in {abs_path}")
|
114
|
+
components.extend(obj)
|
115
|
+
elif isinstance(obj, dict):
|
116
|
+
components.append(obj)
|
117
|
+
else:
|
118
|
+
logger.warning(
|
119
|
+
f"Skipping unexpected object type in {abs_path}"
|
120
|
+
)
|
121
|
+
continue
|
122
|
+
|
123
|
+
for comp_obj in components:
|
124
|
+
# Ensure component object is a dictionary
|
125
|
+
if not isinstance(comp_obj, dict):
|
126
|
+
logger.warning(
|
127
|
+
f"Skipping non-dictionary item in {abs_path}"
|
128
|
+
)
|
129
|
+
continue
|
130
|
+
|
131
|
+
try:
|
132
|
+
if "deployed" in comp_obj:
|
133
|
+
# Remove deployment state if present
|
134
|
+
del comp_obj["deployed"]
|
135
|
+
|
136
|
+
component = self.kodexa_client.deserialize(comp_obj)
|
137
|
+
# Ensure correct org slug
|
138
|
+
component.org_slug = target_org_slug
|
139
|
+
|
140
|
+
logger.info(
|
141
|
+
"Deploying component %s:%s",
|
142
|
+
component.slug, component.version
|
143
|
+
)
|
144
|
+
log_details = component.deploy(update=True)
|
145
|
+
deployed_count += 1
|
146
|
+
for log_detail in log_details:
|
147
|
+
logger.info(log_detail)
|
148
|
+
except Exception as e:
|
149
|
+
comp_id = comp_obj.get('slug', 'unknown')
|
150
|
+
logger.error(
|
151
|
+
"Failed to deploy component %s from %s: %s",
|
152
|
+
comp_id, abs_path, e, exc_info=True
|
153
|
+
)
|
154
|
+
# Option: stop deployment on first error
|
155
|
+
# raise
|
156
|
+
|
157
|
+
except Exception as e:
|
158
|
+
logger.error(
|
159
|
+
"Failed to process resource file %s: %s",
|
160
|
+
abs_path, e, exc_info=True
|
161
|
+
)
|
162
|
+
finally:
|
163
|
+
# Return to manifest directory for next file
|
164
|
+
os.chdir(manifest_dir)
|
165
|
+
|
166
|
+
finally:
|
167
|
+
# Return to original working directory
|
168
|
+
os.chdir(original_cwd)
|
169
|
+
|
170
|
+
logger.info(
|
171
|
+
f"Deployment completed from manifest {manifest_path}. "
|
172
|
+
f"Deployed {deployed_count} components."
|
173
|
+
)
|
174
|
+
|
175
|
+
def undeploy_from_manifest(self, manifest_path: str,
|
176
|
+
org_slug: str | None = None):
|
177
|
+
"""
|
178
|
+
Undeploys all resources listed in a manifest file.
|
179
|
+
|
180
|
+
Args:
|
181
|
+
manifest_path (str): The path to the manifest file.
|
182
|
+
org_slug (str | None): The organization slug to undeploy from.
|
183
|
+
If None, uses the default org from client.
|
184
|
+
"""
|
185
|
+
target_org_slug = org_slug or self.kodexa_client.get_org_slug()
|
186
|
+
if not target_org_slug:
|
187
|
+
msg = "Organization slug must be provided or set in the client."
|
188
|
+
raise ValueError(msg)
|
189
|
+
|
190
|
+
logger.info(
|
191
|
+
f"Starting undeployment from manifest {manifest_path} "
|
192
|
+
f"for organization {target_org_slug}"
|
193
|
+
)
|
194
|
+
resource_paths = self.read_manifest(manifest_path)
|
195
|
+
abs_manifest_path = os.path.abspath(manifest_path)
|
196
|
+
manifest_dir = os.path.dirname(abs_manifest_path)
|
197
|
+
original_cwd = os.getcwd()
|
198
|
+
undeployed_count = 0
|
199
|
+
|
200
|
+
try:
|
201
|
+
# Change to manifest directory to resolve relative paths
|
202
|
+
os.chdir(manifest_dir)
|
203
|
+
|
204
|
+
for resource_pattern in resource_paths:
|
205
|
+
resource_files = glob.glob(resource_pattern, recursive=True)
|
206
|
+
|
207
|
+
if not resource_files:
|
208
|
+
logger.warning(
|
209
|
+
f"No files found matching pattern '{resource_pattern}' "
|
210
|
+
f"relative to {manifest_dir}"
|
211
|
+
)
|
212
|
+
continue
|
213
|
+
|
214
|
+
for rel_path in resource_files:
|
215
|
+
# Resolve absolute path based on current directory
|
216
|
+
abs_path = os.path.abspath(rel_path)
|
217
|
+
logger.info(f"Processing for undeployment: {abs_path}")
|
218
|
+
|
219
|
+
try:
|
220
|
+
with open(abs_path, 'r') as f:
|
221
|
+
path_lower = abs_path.lower()
|
222
|
+
if path_lower.endswith(".json"):
|
223
|
+
obj = json.load(f)
|
224
|
+
elif path_lower.endswith((".yaml", ".yml")):
|
225
|
+
obj = yaml.safe_load(f)
|
226
|
+
else:
|
227
|
+
logger.warning(
|
228
|
+
f"Skipping unsupported file type: {abs_path}"
|
229
|
+
)
|
230
|
+
continue
|
231
|
+
|
232
|
+
components = []
|
233
|
+
if isinstance(obj, list):
|
234
|
+
logger.info(f"Found {len(obj)} components in {abs_path}")
|
235
|
+
components.extend(obj)
|
236
|
+
elif isinstance(obj, dict):
|
237
|
+
components.append(obj)
|
238
|
+
else:
|
239
|
+
logger.warning(
|
240
|
+
f"Skipping unexpected object type in {abs_path}"
|
241
|
+
)
|
242
|
+
continue
|
243
|
+
|
244
|
+
for comp_obj in components:
|
245
|
+
# Ensure component object is a dictionary
|
246
|
+
if not isinstance(comp_obj, dict):
|
247
|
+
logger.warning(
|
248
|
+
f"Skipping non-dictionary item in {abs_path}"
|
249
|
+
)
|
250
|
+
continue
|
251
|
+
|
252
|
+
slug = comp_obj.get('slug')
|
253
|
+
version = comp_obj.get('version')
|
254
|
+
|
255
|
+
if not slug or not version:
|
256
|
+
logger.warning(
|
257
|
+
"Skipping component in %s (missing slug/version)",
|
258
|
+
abs_path
|
259
|
+
)
|
260
|
+
continue
|
261
|
+
|
262
|
+
try:
|
263
|
+
# Get component object to call undeploy
|
264
|
+
# Note: This assumes get_object method exists
|
265
|
+
# with appropriate parameters and return value
|
266
|
+
component = self.kodexa_client.get_object(
|
267
|
+
target_org_slug, slug, version
|
268
|
+
)
|
269
|
+
if component:
|
270
|
+
logger.info(
|
271
|
+
"Undeploying component %s:%s",
|
272
|
+
slug, version
|
273
|
+
)
|
274
|
+
component.undeploy()
|
275
|
+
undeployed_count += 1
|
276
|
+
else:
|
277
|
+
logger.warning(
|
278
|
+
"Component %s:%s not found in org %s",
|
279
|
+
slug, version, target_org_slug
|
280
|
+
)
|
281
|
+
except Exception as e:
|
282
|
+
logger.error(
|
283
|
+
"Failed to undeploy component %s:%s: %s",
|
284
|
+
slug, version, e, exc_info=True
|
285
|
+
)
|
286
|
+
# Option: stop on first error
|
287
|
+
# raise
|
288
|
+
|
289
|
+
except Exception as e:
|
290
|
+
logger.error(
|
291
|
+
"Failed to process file %s for undeployment: %s",
|
292
|
+
abs_path, e, exc_info=True
|
293
|
+
)
|
294
|
+
|
295
|
+
finally:
|
296
|
+
# Return to original working directory
|
297
|
+
os.chdir(original_cwd)
|
298
|
+
|
299
|
+
logger.info(
|
300
|
+
f"Undeployment completed from manifest {manifest_path}. "
|
301
|
+
f"Undeployed {undeployed_count} components."
|
302
|
+
)
|
303
|
+
|
304
|
+
def sync_from_instance(self, manifest_path: str, org_slug: str | None = None):
|
305
|
+
"""
|
306
|
+
Syncs resources from a Kodexa instance to the filesystem based on a manifest.
|
307
|
+
|
308
|
+
This reads a manifest file and for each resource defined:
|
309
|
+
1. Retrieves the resource from the Kodexa instance
|
310
|
+
2. Saves it to the corresponding file on the filesystem
|
311
|
+
|
312
|
+
Args:
|
313
|
+
manifest_path (str): The path to the manifest file.
|
314
|
+
org_slug (str | None): The organization slug to sync from.
|
315
|
+
If None, uses the default org from client.
|
316
|
+
"""
|
317
|
+
target_org_slug = org_slug or self.kodexa_client.get_org_slug()
|
318
|
+
if not target_org_slug:
|
319
|
+
msg = "Organization slug must be provided or set in the client."
|
320
|
+
raise ValueError(msg)
|
321
|
+
|
322
|
+
logger.info(
|
323
|
+
f"Starting sync from instance to filesystem using manifest "
|
324
|
+
f"{manifest_path} for organization {target_org_slug}"
|
325
|
+
)
|
326
|
+
resource_paths = self.read_manifest(manifest_path)
|
327
|
+
abs_manifest_path = os.path.abspath(manifest_path)
|
328
|
+
manifest_dir = os.path.dirname(abs_manifest_path)
|
329
|
+
original_cwd = os.getcwd()
|
330
|
+
synced_count = 0
|
331
|
+
|
332
|
+
try:
|
333
|
+
# Change to manifest directory to resolve relative paths
|
334
|
+
os.chdir(manifest_dir)
|
335
|
+
|
336
|
+
for resource_pattern in resource_paths:
|
337
|
+
resource_files = glob.glob(resource_pattern, recursive=True)
|
338
|
+
|
339
|
+
if not resource_files:
|
340
|
+
logger.warning(
|
341
|
+
f"No files found matching pattern '{resource_pattern}' "
|
342
|
+
f"relative to {manifest_dir}"
|
343
|
+
)
|
344
|
+
continue
|
345
|
+
|
346
|
+
for rel_path in resource_files:
|
347
|
+
# Resolve absolute path based on current directory
|
348
|
+
abs_path = os.path.abspath(rel_path)
|
349
|
+
logger.info(f"Processing for sync: {abs_path}")
|
350
|
+
|
351
|
+
try:
|
352
|
+
# Read the file to get component information
|
353
|
+
with open(abs_path, 'r') as f:
|
354
|
+
path_lower = abs_path.lower()
|
355
|
+
if path_lower.endswith(".json"):
|
356
|
+
file_obj = json.load(f)
|
357
|
+
elif path_lower.endswith((".yaml", ".yml")):
|
358
|
+
file_obj = yaml.safe_load(f)
|
359
|
+
else:
|
360
|
+
logger.warning(
|
361
|
+
f"Skipping unsupported file type: {abs_path}"
|
362
|
+
)
|
363
|
+
continue
|
364
|
+
|
365
|
+
components = []
|
366
|
+
if isinstance(file_obj, list):
|
367
|
+
logger.info(
|
368
|
+
f"Found {len(file_obj)} components in {abs_path}"
|
369
|
+
)
|
370
|
+
components.extend(file_obj)
|
371
|
+
elif isinstance(file_obj, dict):
|
372
|
+
components.append(file_obj)
|
373
|
+
else:
|
374
|
+
logger.warning(
|
375
|
+
f"Skipping unexpected object type in {abs_path}"
|
376
|
+
)
|
377
|
+
continue
|
378
|
+
|
379
|
+
for comp_obj in components:
|
380
|
+
# Ensure component object is a dictionary
|
381
|
+
if not isinstance(comp_obj, dict):
|
382
|
+
logger.warning(
|
383
|
+
f"Skipping non-dictionary item in {abs_path}"
|
384
|
+
)
|
385
|
+
continue
|
386
|
+
|
387
|
+
slug = comp_obj.get('slug')
|
388
|
+
version = comp_obj.get('version')
|
389
|
+
|
390
|
+
if not slug or not version:
|
391
|
+
logger.warning(
|
392
|
+
"Skipping component (missing slug/version) in %s",
|
393
|
+
abs_path
|
394
|
+
)
|
395
|
+
continue
|
396
|
+
|
397
|
+
try:
|
398
|
+
# Get the component from the Kodexa instance
|
399
|
+
logger.info(
|
400
|
+
f"Retrieving component {slug}:{version} "
|
401
|
+
f"from org {target_org_slug}"
|
402
|
+
)
|
403
|
+
component = self.kodexa_client.get_object(
|
404
|
+
target_org_slug, slug, version
|
405
|
+
)
|
406
|
+
|
407
|
+
if not component:
|
408
|
+
logger.warning(
|
409
|
+
f"Component {slug}:{version} not found "
|
410
|
+
f"in org {target_org_slug}"
|
411
|
+
)
|
412
|
+
continue
|
413
|
+
|
414
|
+
# Serialize the component to data
|
415
|
+
updated_obj = component.serialize()
|
416
|
+
|
417
|
+
# Write the updated data back to the file
|
418
|
+
write_format = "json"
|
419
|
+
if path_lower.endswith((".yaml", ".yml")):
|
420
|
+
write_format = "yaml"
|
421
|
+
|
422
|
+
with open(abs_path, 'w') as f:
|
423
|
+
if write_format == "json":
|
424
|
+
json.dump(updated_obj, f, indent=2)
|
425
|
+
else:
|
426
|
+
yaml.dump(updated_obj, f)
|
427
|
+
|
428
|
+
logger.info(
|
429
|
+
f"Synced component {slug}:{version} to {abs_path}"
|
430
|
+
)
|
431
|
+
synced_count += 1
|
432
|
+
|
433
|
+
except Exception as e:
|
434
|
+
logger.error(
|
435
|
+
"Failed to sync component %s:%s: %s",
|
436
|
+
slug, version, e, exc_info=True
|
437
|
+
)
|
438
|
+
except Exception as e:
|
439
|
+
logger.error(
|
440
|
+
"Failed to process file %s for sync: %s",
|
441
|
+
abs_path, e, exc_info=True
|
442
|
+
)
|
443
|
+
|
444
|
+
finally:
|
445
|
+
# Return to original working directory
|
446
|
+
os.chdir(original_cwd)
|
447
|
+
|
448
|
+
logger.info(
|
449
|
+
f"Sync completed from instance to filesystem using manifest "
|
450
|
+
f"{manifest_path}. Synced {synced_count} components."
|
451
|
+
)
|
452
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "kodexa"
|
3
|
-
version = "7.4.
|
3
|
+
version = "7.4.414561019241"
|
4
4
|
description = "Python SDK for the Kodexa Platform"
|
5
5
|
authors = ["Austin Redenbaugh <austin@kodexa.com>", "Philip Dodds <philip@kodexa.com>", "Romar Cablao <rcablao@kodexa.com>", "Amadea Paula Dodds <amadeapaula@kodexa.com>"]
|
6
6
|
readme = "README.md"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/dataclasses/templates/llm_data_class.j2
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kodexa-7.4.414540091860 → kodexa-7.4.414561019241}/kodexa/model/entities/product_subscription.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|