aepp 0.4.1__py3-none-any.whl → 0.4.1.post2__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.
aepp/__init__.py CHANGED
@@ -400,6 +400,9 @@ def __extractFieldGroup__(fieldGroup: str,folder: Union[str, Path] = None,sandbo
400
400
  for descriptor in descriptors:
401
401
  with open(f"{descriptorPath / descriptor['@id']}.json",'w') as f:
402
402
  json.dump(descriptor,f,indent=2)
403
+ classes = myfg_manager.classIds
404
+ for cls in classes:
405
+ __extractClass__(cls,folder,sandbox)
403
406
 
404
407
  def __extractSchema__(schemaEl: str,folder: Union[str, Path] = None,sandbox: 'ConnectObject' = None,region:str=None):
405
408
  schemaPath = Path(folder) / 'schema'
@@ -435,6 +438,9 @@ def __extractSchema__(schemaEl: str,folder: Union[str, Path] = None,sandbox: 'Co
435
438
  if descriptor.get('@type','') == 'xdm:descriptorIdentity':
436
439
  namespace = descriptor['xdm:namespace']
437
440
  __extractIdentity__(namespace,region,folder,sandbox)
441
+ if descriptor.get('@type','') == 'xdm:descriptorRelationship' or descriptor.get('@type','') == 'xdm:descriptorOneToOne':
442
+ targetSchema = descriptor['xdm:destinationSchema']
443
+ __extractSchema__(targetSchema,folder,sandbox,region)
438
444
 
439
445
 
440
446
  def __extractIdentity__(identityStr: str,region:str=None,folder: Union[str, Path] = None,sandbox: 'ConnectObject' = None):
aepp/__version__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.4.1"
1
+ __version__ = "0.4.1-2"
aepp/classmanager.py CHANGED
@@ -682,6 +682,7 @@ class ClassManager:
682
682
  dictionary['enumValues'] = []
683
683
  dictionary['enum'] = []
684
684
  dictionary['default'] = []
685
+ dictionary['metaStatus'] = []
685
686
  else:
686
687
  dictionary = dictionary
687
688
  for key in mydict:
@@ -707,6 +708,7 @@ class ClassManager:
707
708
  if queryPath or full:
708
709
  dictionary["querypath"].append(self.__cleanPath__(tmp_path))
709
710
  if full:
711
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
710
712
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
711
713
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
712
714
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -749,6 +751,7 @@ class ClassManager:
749
751
  if (queryPath or full) and tmp_path is not None:
750
752
  dictionary["querypath"].append(self.__cleanPath__(tmp_path))
751
753
  if full:
754
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
752
755
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
753
756
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
754
757
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -787,6 +790,7 @@ class ClassManager:
787
790
  if queryPath or full:
788
791
  dictionary["querypath"].append(self.__cleanPath__(finalpath))
789
792
  if full:
793
+ dictionary['metaStatus'].append(mydict[key]['items'].get('meta:status',pd.NA))
790
794
  dictionary['minLength'].append(mydict[key]['items'].get('minLength',np.nan))
791
795
  dictionary['maxLength'].append(mydict[key]['items'].get('maxLength',np.nan))
792
796
  dictionary['minimum'].append(mydict[key]['items'].get('minimum',np.nan))
@@ -821,6 +825,7 @@ class ClassManager:
821
825
  if queryPath or full:
822
826
  dictionary["querypath"].append(self.__cleanPath__(finalpath))
823
827
  if full:
828
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
824
829
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
825
830
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
826
831
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
aepp/customerprofile.py CHANGED
@@ -776,7 +776,6 @@ class Profile:
776
776
  privateHeader['Accept'] = "application/json"
777
777
  params = {"offset":0,"limit":20}
778
778
  res = self.connector.getData(self.endpoint_global + path,params=params,headers=privateHeader)
779
- print(res)
780
779
  data = res.get("computedAttributes",[])
781
780
  offset = res.get("_page",{}).get("offset", 0)
782
781
  while offset != 0:
aepp/datatypemanager.py CHANGED
@@ -548,6 +548,7 @@ class DataTypeManager:
548
548
  dictionary['enumValues'] = []
549
549
  dictionary['enum'] = []
550
550
  dictionary['default'] = []
551
+ dictionary['metaStatus'] = []
551
552
  else:
552
553
  dictionary = dictionary
553
554
  for key in mydict:
@@ -573,6 +574,7 @@ class DataTypeManager:
573
574
  if queryPath or full:
574
575
  dictionary["querypath"].append(self.__cleanPath__(tmp_path))
575
576
  if full:
577
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
576
578
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
577
579
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
578
580
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -615,6 +617,7 @@ class DataTypeManager:
615
617
  if queryPath or full:
616
618
  dictionary["querypath"].append(self.__cleanPath__(tmp_path))
617
619
  if full:
620
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
618
621
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
619
622
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
620
623
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -660,6 +663,7 @@ class DataTypeManager:
660
663
  if queryPath or full:
661
664
  dictionary["querypath"].append(self.__cleanPath__(finalpath))
662
665
  if full:
666
+ dictionary['metaStatus'].append(mydict[key]['items'].get('meta:status',pd.NA))
663
667
  dictionary['minLength'].append(mydict[key]['items'].get('minLength',np.nan))
664
668
  dictionary['maxLength'].append(mydict[key]['items'].get('maxLength',np.nan))
665
669
  dictionary['minimum'].append(mydict[key]['items'].get('minimum',np.nan))
@@ -697,6 +701,7 @@ class DataTypeManager:
697
701
  if queryPath or full:
698
702
  dictionary["querypath"].append(self.__cleanPath__(finalpath))
699
703
  if full:
704
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
700
705
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
701
706
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
702
707
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -1099,6 +1104,7 @@ class DataTypeManager:
1099
1104
  minLength : if you want to add a minimum length for string field
1100
1105
  maxLength : if you want to add a maximum length for string field
1101
1106
  default : if you want to add a default value for the field
1107
+ metaStatus : if you want to add a meta:status value for the field
1102
1108
  """
1103
1109
  if self.EDITABLE == False:
1104
1110
  raise Exception("The Data Type is not Editable via Field Group Manager")
@@ -1116,6 +1122,7 @@ class DataTypeManager:
1116
1122
  del pathSplit[0]
1117
1123
  newField = pathSplit.pop()
1118
1124
  description = kwargs.get("description",'')
1125
+ metaStatus = kwargs.get("metaStatus",None)
1119
1126
  obj = {}
1120
1127
  if dataType == 'object':
1121
1128
  if objectComponents is not None:
@@ -1126,6 +1133,8 @@ class DataTypeManager:
1126
1133
  obj = { 'type':'object', 'title':title, "description":description,
1127
1134
  'properties':{}
1128
1135
  }
1136
+ if metaStatus is not None:
1137
+ obj['meta:status'] = metaStatus
1129
1138
  elif dataType == 'array':
1130
1139
  if objectComponents is not None:
1131
1140
  obj = { 'type':'array', 'title':title,"description":description,
@@ -1141,6 +1150,8 @@ class DataTypeManager:
1141
1150
  'properties':{}
1142
1151
  }
1143
1152
  }
1153
+ if metaStatus is not None:
1154
+ obj['meta:status'] = metaStatus
1144
1155
  elif dataType == "dataType":
1145
1156
  obj = {'$ref': ref,
1146
1157
  'required': [],
@@ -1156,6 +1167,8 @@ class DataTypeManager:
1156
1167
  "$ref" : ref,
1157
1168
  "title":title
1158
1169
  }
1170
+ if metaStatus is not None:
1171
+ obj['meta:status'] = metaStatus
1159
1172
  self.dataTypes[ref] = title
1160
1173
  self.dataTypeManagers[ref] = DataTypeManager(dataType=ref,schemaAPI=self.schemaAPI)
1161
1174
  elif dataType == "map":
@@ -1172,6 +1185,8 @@ class DataTypeManager:
1172
1185
  obj['additionalProperties']['maximum'] = 2147483647
1173
1186
  obj['additionalProperties']['minimum'] = -2147483648
1174
1187
  obj['additionalProperties']['meta:xdmType'] = "int"
1188
+ if metaStatus is not None:
1189
+ obj['meta:status'] = metaStatus
1175
1190
  else:
1176
1191
  minimum = kwargs.get('minimum',None)
1177
1192
  maximum = kwargs.get('maximum',None)
@@ -1181,6 +1196,9 @@ class DataTypeManager:
1181
1196
  default = kwargs.get('default',None)
1182
1197
  obj = self.__transformFieldType__(dataType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1183
1198
  obj['title']= title
1199
+ obj['description']= description
1200
+ if metaStatus is not None:
1201
+ obj['meta:status'] = metaStatus
1184
1202
  if array:
1185
1203
  obj['type'] = "array"
1186
1204
  obj['items'] = self.__transformFieldType__(dataType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
@@ -1431,17 +1449,18 @@ class DataTypeManager:
1431
1449
  pattern = (lambda x : None if pd.isnull(x) else x)(row.get('pattern',None))
1432
1450
  default = (lambda x : None if pd.isnull(x) else x)(row.get('default',None))
1433
1451
  enumValues = (lambda x : None if pd.isnull(x) else x)(row.get('enumValues',None))
1452
+ metastatus = (lambda x : None if pd.isnull(x) else x)(row.get('metaStatus',None))
1434
1453
  if enumValues is None: ## ensuring to forcing a suggested value for empty enumValues
1435
1454
  enumType = None
1436
1455
  else:
1437
1456
  enumType = row.get('enum',False)
1438
1457
  if path.endswith("[]"):
1439
1458
  clean_path = self.__cleanPath__(row['path'])
1440
- self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1459
+ self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metastatus=metastatus)
1441
1460
  elif path.endswith("[]{}"):
1442
1461
  clean_path = self.__cleanPath__(row['path'])
1443
- self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1462
+ self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metastatus=metastatus)
1444
1463
  else:
1445
1464
  clean_path = self.__cleanPath__(row['path'])
1446
- self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1465
+ self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metastatus=metastatus)
1447
1466
  return self
aepp/fieldgroupmanager.py CHANGED
@@ -639,6 +639,7 @@ class FieldGroupManager:
639
639
  dictionary['enumValues'] = []
640
640
  dictionary['enum'] = []
641
641
  dictionary['default'] = []
642
+ dictionary['metaStatus'] = []
642
643
  else:
643
644
  dictionary = dictionary
644
645
  for key in mydict:
@@ -661,6 +662,7 @@ class FieldGroupManager:
661
662
  if queryPath or full:
662
663
  dictionary["querypath"].append(self.__cleanPath__(tmp_path))
663
664
  if full:
665
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
664
666
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
665
667
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
666
668
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -703,6 +705,7 @@ class FieldGroupManager:
703
705
  if (queryPath or full) and tmp_path is not None:
704
706
  dictionary["querypath"].append(self.__cleanPath__(tmp_path))
705
707
  if full:
708
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
706
709
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
707
710
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
708
711
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -748,6 +751,7 @@ class FieldGroupManager:
748
751
  if (queryPath or full) and finalpath is not None:
749
752
  dictionary["querypath"].append(self.__cleanPath__(finalpath))
750
753
  if full:
754
+ dictionary['metaStatus'].append(mydict[key]['items'].get('meta:status',pd.NA))
751
755
  dictionary['minLength'].append(mydict[key]['items'].get('minLength',np.nan))
752
756
  dictionary['maxLength'].append(mydict[key]['items'].get('maxLength',np.nan))
753
757
  dictionary['minimum'].append(mydict[key]['items'].get('minimum',np.nan))
@@ -785,6 +789,7 @@ class FieldGroupManager:
785
789
  if (queryPath or full) and finalpath is not None:
786
790
  dictionary["querypath"].append(self.__cleanPath__(finalpath))
787
791
  if full:
792
+ dictionary['metaStatus'].append(mydict[key].get('meta:status',pd.NA))
788
793
  dictionary['minLength'].append(mydict[key].get('minLength',np.nan))
789
794
  dictionary['maxLength'].append(mydict[key].get('maxLength',np.nan))
790
795
  dictionary['minimum'].append(mydict[key].get('minimum',np.nan))
@@ -1151,6 +1156,7 @@ class FieldGroupManager:
1151
1156
  minLength : if you want to add a minimum length for string field
1152
1157
  maxLength : if you want to add a maximum length for string field
1153
1158
  default : if you want to add a default value for the field
1159
+ metaStatus : if you want to add a meta:status attribute to the field
1154
1160
  """
1155
1161
  if self.EDITABLE == False:
1156
1162
  raise Exception("The Field Group is not Editable via Field Group Manager")
@@ -1171,6 +1177,7 @@ class FieldGroupManager:
1171
1177
  del pathSplit[0]
1172
1178
  newField = pathSplit.pop()
1173
1179
  description = kwargs.get("description",'')
1180
+ metaStatus = kwargs.get('metaStatus',None)
1174
1181
  if dataType == 'object':
1175
1182
  if array==False:
1176
1183
  if objectComponents is not None:
@@ -1181,6 +1188,8 @@ class FieldGroupManager:
1181
1188
  obj = { 'type':'object', 'title':title, "description":description,
1182
1189
  'properties':{}
1183
1190
  }
1191
+ if metaStatus is not None:
1192
+ obj['meta:status'] = metaStatus
1184
1193
  else:
1185
1194
  if objectComponents is not None:
1186
1195
  obj = { 'type':'array', 'title':title, "description":description,
@@ -1196,6 +1205,8 @@ class FieldGroupManager:
1196
1205
  'properties':{}
1197
1206
  }
1198
1207
  }
1208
+ if metaStatus is not None:
1209
+ obj['meta:status'] = metaStatus
1199
1210
  elif dataType == 'array':
1200
1211
  if objectComponents is not None:
1201
1212
  obj = { 'type':'array', 'title':title,"description":description,
@@ -1211,6 +1222,8 @@ class FieldGroupManager:
1211
1222
  'properties':{}
1212
1223
  }
1213
1224
  }
1225
+ if metaStatus is not None:
1226
+ obj['meta:status'] = metaStatus
1214
1227
  elif dataType == "dataType":
1215
1228
  obj = {'$ref': ref,
1216
1229
  'required': [],
@@ -1226,6 +1239,8 @@ class FieldGroupManager:
1226
1239
  "$ref" : ref,
1227
1240
  "title":title
1228
1241
  }
1242
+ if metaStatus is not None:
1243
+ obj['meta:status'] = metaStatus
1229
1244
  self.dataTypes[ref] = title
1230
1245
  self.dataTypeManagers[ref] = DataTypeManager(dataType=ref,schemaAPI=self.schemaAPI,localFolder=self.localfolder,tenantId=self.tenantId,sandbox=self.sandbox)
1231
1246
  elif dataType == "map":
@@ -1242,6 +1257,8 @@ class FieldGroupManager:
1242
1257
  obj['additionalProperties']['maximum'] = 2147483647
1243
1258
  obj['additionalProperties']['minimum'] = -2147483648
1244
1259
  obj['additionalProperties']['meta:xdmType'] = "int"
1260
+ if metaStatus is not None:
1261
+ obj['meta:status'] = metaStatus
1245
1262
  else:
1246
1263
  minimum = kwargs.get('minimum',None)
1247
1264
  maximum = kwargs.get('maximum',None)
@@ -1252,6 +1269,8 @@ class FieldGroupManager:
1252
1269
  obj = self.__transformFieldType__(dataType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1253
1270
  obj['title'] = title
1254
1271
  obj["description"] = description,
1272
+ if metaStatus is not None:
1273
+ obj['meta:status'] = metaStatus
1255
1274
  if type(obj["description"]) == tuple:
1256
1275
  obj["description"] = obj["description"][0]
1257
1276
  if array:
@@ -1640,19 +1659,20 @@ class FieldGroupManager:
1640
1659
  pattern = (lambda x : None if pd.isnull(x) else x)(row.get('pattern',None))
1641
1660
  default = (lambda x : None if pd.isnull(x) else x)(row.get('default',None))
1642
1661
  enumValues = (lambda x : None if pd.isnull(x) else x)(row.get('enumValues',None))
1662
+ metaStatus = (lambda x : None if pd.isnull(x) else x)(row.get('metaStatus',None))
1643
1663
  if enumValues is None: ## ensuring to forcing a suggested value for empty enumValues
1644
1664
  enumType = None
1645
1665
  else:
1646
1666
  enumType = row.get('enum',False)
1647
1667
  if path.endswith("[]"):
1648
1668
  clean_path = self.__cleanPath__(row['path'])
1649
- self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1669
+ self.addField(clean_path,typeElement,title=row['title'],description=row['description'],array=True,enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metaStatus=metaStatus)
1650
1670
  elif path.endswith("[]{}"):
1651
1671
  clean_path = self.__cleanPath__(row['path'])
1652
- self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1672
+ self.addField(clean_path,'array',title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metaStatus=metaStatus)
1653
1673
  else:
1654
1674
  clean_path = self.__cleanPath__(row['path'])
1655
- self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default)
1675
+ self.addField(clean_path,typeElement,title=row['title'],description=row['description'],enumType=enumType,enumValues=enumValues,mapType=mapType,minimum=minimum,maximum=maximum,pattern=pattern,minLength=minLength,maxLength=maxLength,default=default,metaStatus=metaStatus)
1656
1676
  if title is not None:
1657
1677
  self.setTitle(title)
1658
1678
  elif 'fieldGroup' in df_import.columns:
aepp/schema.py CHANGED
@@ -1765,6 +1765,9 @@ class Schema:
1765
1765
  raise Exception("Require a field Group ID")
1766
1766
  if self.loggingEnabled:
1767
1767
  self.logger.debug(f"Starting extendFieldGroup")
1768
+ if fieldGroupId.startswith("https://"):
1769
+ from urllib import parse
1770
+ fieldGroupId = parse.quote_plus(fieldGroupId)
1768
1771
  path = f"/{tenant}/fieldgroups/{fieldGroupId}"
1769
1772
  if values is not None:
1770
1773
  list_fgs = values
aepp/schemamanager.py CHANGED
@@ -122,9 +122,7 @@ class SchemaManager:
122
122
  break
123
123
  self.fieldGroupIds = [obj['$ref'] for obj in allOf if ('/mixins/' in obj['$ref'] or '/experience/' in obj['$ref'] or '/context/' in obj['$ref']) and obj['$ref'] != self.classId]
124
124
  self.classIds = [self.classId]
125
- print(self.tenantId)
126
125
  for ref in self.fieldGroupIds:
127
- print(ref)
128
126
  if '/mixins/' in ref and self.tenantId[1:] in ref:
129
127
  if self.localfolder is not None:
130
128
  for json_file in self.fieldgroupFolder.glob('*.json'):
@@ -134,7 +132,6 @@ class SchemaManager:
134
132
  break
135
133
  elif self.schemaAPI is not None:
136
134
  definition = self.schemaAPI.getFieldGroup(ref,full=False)
137
- print(definition.get('title'))
138
135
  fgM = FieldGroupManager(fieldGroup=definition,schemaAPI=self.schemaAPI,localFolder=localFolder,tenantId=self.tenantId,sandbox=self.sandbox)
139
136
  else:
140
137
  if self.localfolder is not None:
@@ -206,7 +203,6 @@ class SchemaManager:
206
203
  tmp_def = json.load(FileIO(json_file))
207
204
  if tmp_def.get('$id') == ref:
208
205
  definition = tmp_def
209
- print(definition.get('title'))
210
206
  break
211
207
  if 'properties' in definition.keys():
212
208
  definition['definitions'] = definition['properties']
@@ -260,7 +256,6 @@ class SchemaManager:
260
256
  tmp_def = json.load(FileIO(json_file))
261
257
  if tmp_def.get('$id') == ref:
262
258
  definition = tmp_def
263
- print(definition.get('title'))
264
259
  break
265
260
  fgM = FieldGroupManager(definition,schemaAPI=self.schemaAPI, localFolder=localFolder,tenantId=self.tenantId,sandbox=self.sandbox)
266
261
  self.fieldGroupsManagers[fgM.title] = fgM
@@ -585,7 +580,6 @@ class SchemaManager:
585
580
  res = self.schemaAPI.putSchema(self.id,self.schema)
586
581
  if 'status' in res.keys():
587
582
  if res['status'] == 400:
588
- print(res['title'])
589
583
  return res
590
584
  else:
591
585
  return res
@@ -600,6 +594,7 @@ class SchemaManager:
600
594
  alternateTitle:str="",
601
595
  alternateDescription:str=None,
602
596
  alternateNote:str="",
597
+ alternateEnum:str="",
603
598
  targetSchema:str=None,
604
599
  targetCompletePath:str=None,
605
600
  targetNamespace:str=None,
@@ -621,6 +616,7 @@ class SchemaManager:
621
616
  alternateTitle : OPTIONAL : if the descriptor is alternateDisplay, the alternate title to be used.
622
617
  alternateDescription : OPTIONAL if you wish to add a new description.
623
618
  alternateNote : OPTIONAL : if you wish to add a new note.
619
+ alternateEnum : OPTIONAL : if you wish to add a new enum limitation.
624
620
  targetSchema : OPTIONAL : The schema ID for the destination (lookup, B2B lookup, relationship) if the descriptor is "descriptorRelationship" or "descriptorOneToOne".
625
621
  targetCompletePath : OPTIONAL : if you have the complete path for the field in the target lookup schema, if the descriptor is "descriptorRelationship" or "descriptorOneToOne".
626
622
  targetNamespace: OPTIONAL : if you have the namespace code for the target schema (used for "descriptorRelationship").
@@ -647,8 +643,6 @@ class SchemaManager:
647
643
  "xdm:isPrimary": identityPrimary
648
644
  }
649
645
  elif descType == "xdm:alternateDisplayInfo":
650
- if alternateTitle is None:
651
- raise ValueError("Require an alternate title")
652
646
  obj = {
653
647
  "@type": descType,
654
648
  "xdm:sourceSchema": self.id,
@@ -667,6 +661,8 @@ class SchemaManager:
667
661
  obj["xdm:note"] = {
668
662
  "en_us":alternateNote
669
663
  }
664
+ if alternateEnum is not None:
665
+ obj["xdm:excludeMetaEnum"] = alternateEnum
670
666
  elif descType == "xdm:descriptorOneToOne":
671
667
  obj = {
672
668
  "@type": descType,
aepp/som.py CHANGED
@@ -567,7 +567,6 @@ class Som:
567
567
  list_path = list(reversed(list_path))
568
568
  path = '.'.join(list_path)
569
569
  o_data = self.get(path,merge=True)
570
- print(o_data)
571
570
  self.__mergedata__(o_data,deepcopy(data))
572
571
  return None
573
572
 
aepp/synchronizer.py CHANGED
@@ -340,6 +340,11 @@ class Synchronizer:
340
340
  print(f"field group '{name_base_fieldgroup}' already exists in target {target}, checking it")
341
341
  if t_fieldgroup is None: ## if need to create the FieldGroupManager
342
342
  t_fieldgroup = fieldgroupmanager.FieldGroupManager(targetSchema.data.fieldGroups_altId[name_base_fieldgroup],config=self.dict_targetsConfig[target],sandbox=target)
343
+ for fg_class in t_fieldgroup.classIds:
344
+ if fg_class not in fg_class_ids:
345
+ fg_class_ids.append(fg_class)
346
+ ### Aligning class support to the field groups
347
+ t_fieldgroup.schemaAPI.extendFieldGroup(t_fieldgroup.id,fg_class_ids)
343
348
  df_base = baseFieldGroup.to_dataframe(full=True)
344
349
  df_target = t_fieldgroup.to_dataframe(full=True)
345
350
  base_paths = df_base['path'].tolist()
@@ -515,6 +520,8 @@ class Synchronizer:
515
520
  ## adding the field group to the target components
516
521
  self.dict_targetComponents[target]['fieldgroup'][fg_name] = fieldgroupmanager.FieldGroupManager(dict_base_fg_name_id[fg_name],config=self.dict_targetsConfig[target],sandbox=target)
517
522
  else:
523
+ if verbose:
524
+ print(f"field group '{fg_name}' is a custom field group, using it")
518
525
  tmp_FieldGroup = baseSchema.getFieldGroupManager(fg_name)
519
526
  self.__syncFieldGroup__(tmp_FieldGroup,verbose=verbose)
520
527
  new_schema.addFieldGroup(self.dict_targetComponents[target]['fieldgroup'][fg_name].id)
@@ -643,25 +650,30 @@ class Synchronizer:
643
650
  case "xdm:alternateDisplayInfo":
644
651
  target_alternateDisplayInfo = [desc for desc in target_descriptors if desc['@type'] == 'xdm:alternateDisplayInfo']
645
652
  alternateTitle = baseDescriptor.get('xdm:title',{}).get('en_us',None)
653
+ alternateDescription = baseDescriptor.get('xdm:description',{}).get('en_us',None)
654
+ alternateDescription = baseDescriptor.get('xdm:description',{}).get('en_us',None)
646
655
  alternateNote = baseDescriptor.get('xdm:note',{}).get('en_us',None)
656
+ alternateEnum = baseDescriptor.get('xdm:excludeMetaEnum',None)
647
657
  alternateDescription = baseDescriptor.get('xdm:description',{}).get('en_us',None)
648
658
  if baseDescriptor['xdm:sourceProperty'] not in [el['xdm:sourceProperty'] for el in target_alternateDisplayInfo]: ## descriptor does not exists in target
649
659
  new_desc = targetSchemaManager.createDescriptorOperation(descType=descType,
650
660
  completePath=baseDescriptor['xdm:sourceProperty'],
651
661
  alternateTitle=alternateTitle,alternateDescription=alternateDescription,
652
- alternateNote=alternateNote)
662
+ alternateNote=alternateNote,alternateEnum=alternateEnum)
653
663
  res = targetSchemaManager.createDescriptor(new_desc)
654
664
  else: ## descriptor already exists in target
655
665
  res = [el for el in target_alternateDisplayInfo if el['xdm:sourceProperty'] == baseDescriptor['xdm:sourceProperty']][0]
656
666
  target_alternateTitle = res.get('xdm:title',{}).get('en_us',None)
657
667
  target_alternateNote = res.get('xdm:note',{}).get('en_us',None)
658
668
  target_alternateDescription = res.get('xdm:description',{}).get('en_us',None)
669
+ target_alternateNote = baseDescriptor.get('xdm:note',{}).get('en_us',None)
670
+ target_alternateEnum = baseDescriptor.get('xdm:excludeMetaEnum',None)
659
671
  ## check if the alternateTitle, alternateNote and alternateDescription are the same
660
- if target_alternateTitle != alternateTitle or target_alternateNote != alternateNote or target_alternateDescription != alternateDescription:
672
+ if target_alternateTitle != alternateTitle or target_alternateNote != alternateNote or target_alternateDescription != alternateDescription or str(target_alternateEnum) != str(alternateEnum):
661
673
  new_desc = targetSchemaManager.createDescriptorOperation(descType=descType,
662
674
  completePath=baseDescriptor['xdm:sourceProperty'],
663
675
  alternateTitle=alternateTitle,alternateDescription=alternateDescription,
664
- alternateNote=alternateNote)
676
+ alternateNote=alternateNote,alternateEnum=alternateEnum)
665
677
  res = targetSchemaManager.updateDescriptor(new_def)
666
678
  list_descriptors.append(res)
667
679
  case "xdm:descriptorReferenceIdentity": ## can be referenced by other schemas
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aepp
3
- Version: 0.4.1
3
+ Version: 0.4.1.post2
4
4
  Summary: Package to manage AEP API endpoint and some helper functions
5
5
  Home-page: https://github.com/adobe/aepp
6
6
  Author: Julien Piccini
@@ -1,22 +1,22 @@
1
- aepp/__init__.py,sha256=6Vx1MxvwnohShbXZgxQsB6Mg_dhx9AW7_fKGqoZhXHo,23409
2
- aepp/__version__.py,sha256=IfrBKs_W4usv6LOPMiFXYlA5wFjjr8eb0zFW3FWiUtM,21
1
+ aepp/__init__.py,sha256=igpC_xiVmPVq3IuG97OgBbcOfCSpke_9pFVzZ-5EhNo,23790
2
+ aepp/__version__.py,sha256=K2OTN9vEj3gHG8ymfOgH7-v5pOLPLqTym-Ct75s_75s,23
3
3
  aepp/accesscontrol.py,sha256=PB3FcrO4bvDjdNxjHx7p_20hp4ahBXewoOSxuTGMXC8,17423
4
4
  aepp/catalog.py,sha256=hK9m3SAP0fhgkYqu14Tcfq14qBhw54tLCOF0mH31b1M,68237
5
- aepp/classmanager.py,sha256=YF9ZhN_bNmiQ1IAcreOgxC5_YrdeWc_nQ2GPyUqlrLc,64259
5
+ aepp/classmanager.py,sha256=CTYGkg5ygB8HtRia6DfT9WLBqXJOVg7pSM9jBB25Bqw,64707
6
6
  aepp/config.py,sha256=232fcO8JaYJnS4glf8Ebnx9rCdHshZBVaVUbhoOAXkc,2543
7
7
  aepp/configs.py,sha256=5rRWJoUQDDaj3AAXWdKCZBZA_Xb7q1Hd58OkWhzwK34,16151
8
8
  aepp/connector.py,sha256=-EskFJm8Ki8A7_gpuNrydBBhz1-jZZz8QMB6gHQTZeA,27262
9
- aepp/customerprofile.py,sha256=-6cN8ZitOp36Crq1SZEZnTN7y9GNWBb8SOo0OebK4vg,49364
9
+ aepp/customerprofile.py,sha256=1yz7piGsSbxM2GaHqkCV-117Es6D1SthrNgnsVxH3Y8,49344
10
10
  aepp/dataaccess.py,sha256=oOERLSxMh2nYBFngPS1dFI_AG3W-DJXmMoUVUiKXJrw,16338
11
11
  aepp/dataprep.py,sha256=vMT4OYO8y6wsGRSjbJNQmgM048BiP3t1-RvKKglSiN4,27586
12
12
  aepp/datasets.py,sha256=hTioR0WyImB91mleCwDQ2FfunvqYi_RrxX_v-iW6N70,8778
13
- aepp/datatypemanager.py,sha256=dfVSFlNKP7PzpuM8oIAh215vjtutGR7j3xFi8KQo-Jo,80795
13
+ aepp/datatypemanager.py,sha256=Iz68Ttp3ogxAMoY3Od_KQybc-6m873Bhf3Z9V1WSHcE,82025
14
14
  aepp/deletion.py,sha256=l7YC30FAUBDTDuVGW26mwjoIMfWjZres0KRy0WyA-4k,11418
15
15
  aepp/destination.py,sha256=_-Hrzb_LUNaRrqR4Y3EZZuTisIs0nF3KH_GZpFjryrs,24348
16
16
  aepp/destinationinstanceservice.py,sha256=zEZbKi519cOOdxWMZ3mv9ccP6yjNAlNwqrQMlzW_gO4,5378
17
17
  aepp/edge.py,sha256=F2QZApmITObXB8hRWXftHBZ82KNqVZ7iSNuovT8qnk4,16041
18
18
  aepp/exportDatasetToDataLandingZone.py,sha256=C6jg3XttFC-0mswa3ypZb6qx3MCQ8_A_3kyKspurXJA,18629
19
- aepp/fieldgroupmanager.py,sha256=ccDBWf1Y9I5IeuHfuOpeLjGqvRWDtKnpbpC61pPy81c,100267
19
+ aepp/fieldgroupmanager.py,sha256=OQkSuGiSxU5ToSPqKmB_3Pmfg6aZjQMGL6LFnODqEiY,101560
20
20
  aepp/flowservice.py,sha256=gVayD3vIMu7-d9TGpVtkbQ1r9iwAjJHWNRVtxKURWKc,107610
21
21
  aepp/hygiene.py,sha256=VEspnyu9eUlcK3wLeJYclaFaOWl5G5I5MRwmVA-RnUg,15385
22
22
  aepp/identity.py,sha256=E9MCIgntScMssduqKZqehT6FqSfTjWHcq7E7wESj3Zc,20833
@@ -26,15 +26,15 @@ aepp/policy.py,sha256=JbpvfCKJl2kE2McK2mn_ZI5HKd_6pTnrfMoUdyJesWQ,24924
26
26
  aepp/privacyservice.py,sha256=V6BkJeZG1LDBCyEQm9Gx0i68iRHG6uxSJiVnXzkHapI,8790
27
27
  aepp/queryservice.py,sha256=mYcnzBG6PmNZYepQydqMhG-oFD4eIDEzb3mAKtKMgZE,61739
28
28
  aepp/sandboxes.py,sha256=UwlSFkO2OOmH--6ISz8rxwDu2LcLH1MPqoH7yOEAZHc,29363
29
- aepp/schema.py,sha256=JK1lOBYVFPC4Y8GTJsNWc0eoVCjoKoCRIBka26OdXk0,122004
30
- aepp/schemamanager.py,sha256=uRSeXWIG2kP6xaqFBeZf5fwjTeHOe8RzQ9jKlxlboAI,50889
29
+ aepp/schema.py,sha256=PmYXSkmhmVVUbXQqsEVSAaTMYKOYha8FIYoySwPgMs4,122150
30
+ aepp/schemamanager.py,sha256=hwItd4vXsPFeV25gX1Fbeiu07-BCg4z_VRQREMgJZ58,50738
31
31
  aepp/segmentation.py,sha256=oSgR2yx4nawYN5XAeHV_wefvmXEf0nb-bCguaDmp8F8,43555
32
32
  aepp/sensei.py,sha256=oYNy5BSWAEqsDkEexcQso6NfA6ntGGMnCOyHri0pJs8,7761
33
- aepp/som.py,sha256=JzNDQzGaHB9BRRv9zyY1B9Z1GZ-v1uioUZLxLtnf5vE,34206
34
- aepp/synchronizer.py,sha256=LPklzSIx2pqbmLToracGz87Ve-rJJCvn3gGsWkz4Gf8,58438
33
+ aepp/som.py,sha256=XNm_Lu2wt2kpSSpldLptuER2eludFXeO9fI6i3iNCzo,34175
34
+ aepp/synchronizer.py,sha256=B_2G55b-WXVGQFzmCQF7WisUJIwj1XFNlS8gpG1MI0M,59480
35
35
  aepp/tags.py,sha256=t2qBallTcWR4IOXcDBmrPpqjbSay1z3E2bcRijzVm1s,17641
36
36
  aepp/utils.py,sha256=tG-YVXylm38-bynqfp5N_Mzyo7mhlZj-dLo7wLoO4tM,1200
37
- aepp-0.4.1.dist-info/licenses/LICENSE,sha256=HjYTlfne3BbS5gNHzNqJ5COCiTQLUdf87QkzRyFbE4Y,10337
37
+ aepp-0.4.1.post2.dist-info/licenses/LICENSE,sha256=HjYTlfne3BbS5gNHzNqJ5COCiTQLUdf87QkzRyFbE4Y,10337
38
38
  tests/__init__.py,sha256=d6zWJsJFZrQd5wAYM7sezSxwXbuMMWfNPkK_vpaUzFA,623
39
39
  tests/catalog_test.py,sha256=O4kkG0C_dXk3E77pSzWIt1ewfyKjfZqgbJmBwWwx0po,2246
40
40
  tests/dataaccess_test.py,sha256=bnHwOjPPauTM8s1c6O7iUYC--gqt6tPzT94aEZHDC-c,1238
@@ -44,7 +44,7 @@ tests/exportDatasetToDatalandingZone_test.py,sha256=193AgQR8yhnQmRWV9pgYz1X2Hz-Y
44
44
  tests/flowservice_test.py,sha256=Y1mpYWbKYL_x-ZlIY-EuOuNvlzVV1ERlKseDO7gN3Ss,4208
45
45
  tests/schema_test.py,sha256=6UsgdsizKmii1hzREpBEKWvZouXdJMvU68UKSxlt1uk,2774
46
46
  tests/som_test.py,sha256=a4ut0pEg1HJVMTESaPITmj7YkF54eWCMzKxTMIS-VvM,12101
47
- aepp-0.4.1.dist-info/METADATA,sha256=eOLDmmlb3NEE3m4baJgQQtqDPDbdqbr9isWUzZnvnm8,5470
48
- aepp-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
- aepp-0.4.1.dist-info/top_level.txt,sha256=Gn88pv1ywuEAgOvhmmXXhN4dosEfCrBNDskje3nqS34,11
50
- aepp-0.4.1.dist-info/RECORD,,
47
+ aepp-0.4.1.post2.dist-info/METADATA,sha256=IQzC5C0ZRq_STMJgqONVT9yoVosg_E8kRL1VxuhhS50,5476
48
+ aepp-0.4.1.post2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
+ aepp-0.4.1.post2.dist-info/top_level.txt,sha256=Gn88pv1ywuEAgOvhmmXXhN4dosEfCrBNDskje3nqS34,11
50
+ aepp-0.4.1.post2.dist-info/RECORD,,