launchpy 0.4.3.post2__tar.gz → 0.4.4__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.
- {launchpy-0.4.3.post2/launchpy.egg-info → launchpy-0.4.4}/PKG-INFO +1 -1
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/getstarted.md +9 -1
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/library.md +8 -7
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/property.md +4 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/releases.md +9 -1
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/synchronizer.md +11 -12
- launchpy-0.4.4/launchpy/__version__.py +1 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/library.py +22 -2
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/property.py +26 -3
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/synchronizer.py +1 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4/launchpy.egg-info}/PKG-INFO +1 -1
- launchpy-0.4.3.post2/launchpy/__version__.py +0 -1
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/LICENSE +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/README.md +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/admin.md +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/main.md +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/docs/translator.md +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/__init__.py +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/admin.py +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/config.py +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/configs.py +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/connector.py +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy/launchpy.py +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy.egg-info/SOURCES.txt +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy.egg-info/dependency_links.txt +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy.egg-info/requires.txt +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/launchpy.egg-info/top_level.txt +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/pyproject.toml +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/requirements.txt +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/setup.cfg +0 -0
- {launchpy-0.4.3.post2 → launchpy-0.4.4}/setup.py +0 -0
|
@@ -26,7 +26,15 @@ lp.createConfigFile()
|
|
|
26
26
|
This will create a JSON and you will need to fill it with the information available in your adobe io account.
|
|
27
27
|
|
|
28
28
|
**NOTE**: scope in the config file has evolved over time so you can change it. Following this [link](https://www.adobe.io/authentication/auth-methods.html#!AdobeDocs/adobeio-auth/master/JWT/Scopes.md) to see the different scope possible.\
|
|
29
|
-
|
|
29
|
+
You can change the `scope` attribute for one of these values: `"https://ims-na1.adobelogin.com/s/ent_reactor_admin_sdk"` or `"https://ims-na1.adobelogin.com/s/ent_reactor_sdk"`
|
|
30
|
+
By default, I will test the dev scope if the scope provided fails. So normally nothing you need to do.
|
|
31
|
+
|
|
32
|
+
**NOTE 2**: There is a possibility till end of 2024 to use the JWT.\
|
|
33
|
+
launchpy supports both `jwt` and `oauthV2` authentication.\
|
|
34
|
+
By default the latest version will try to use the `oauthV2`.\
|
|
35
|
+
You can specify the keys generated in the config file by using the `auth_type` parameter.\
|
|
36
|
+
Possible values : `oauthV2` (default) or `jwt`
|
|
37
|
+
|
|
30
38
|
|
|
31
39
|
## 4. Import the configuration file
|
|
32
40
|
|
|
@@ -33,10 +33,10 @@ The different attributes are the following:
|
|
|
33
33
|
|
|
34
34
|
* id : id of the library
|
|
35
35
|
* name : name of the library
|
|
36
|
-
* state : is it
|
|
36
|
+
* state : is it "development", "staging" or "production" environment
|
|
37
37
|
* build_required : is a build required or not (Boolean)
|
|
38
38
|
* builds : The build attache to this library
|
|
39
|
-
* buid_status : Is the last build has been
|
|
39
|
+
* buid_status : Is the last build has been "successful" ?
|
|
40
40
|
* relationships : the different element attached to this Library
|
|
41
41
|
* _environments = a dictionary of the different environment possible.
|
|
42
42
|
|
|
@@ -45,10 +45,11 @@ The different attributes are the following:
|
|
|
45
45
|
The get methods will enable you to retrieve the elements that have been attached to this library.
|
|
46
46
|
The different get methods are the followings:
|
|
47
47
|
|
|
48
|
-
* getDataElements
|
|
49
|
-
* getExtensions
|
|
50
|
-
* getRules
|
|
48
|
+
* getDataElements : get the data element in that library
|
|
49
|
+
* getExtensions : get the Extension in that library
|
|
50
|
+
* getRules : get the rules in the library
|
|
51
51
|
* getFullLibrary : It is a combinaison of all of the 3 above.
|
|
52
|
+
* getBuilds : Retrieve the builds of that library
|
|
52
53
|
|
|
53
54
|
## Adding element to a library
|
|
54
55
|
|
|
@@ -62,7 +63,7 @@ They are the following:
|
|
|
62
63
|
|
|
63
64
|
## Environments settings
|
|
64
65
|
|
|
65
|
-
Before you can actually start building the library and pass it from one state to another (
|
|
66
|
+
Before you can actually start building the library and pass it from one state to another ("development" -> "staging"). You would need to set the different environments.
|
|
66
67
|
|
|
67
68
|
The method used for that is : setEnvironments().
|
|
68
69
|
It takes 2 arguments:
|
|
@@ -90,7 +91,7 @@ myLib.build() # require that you have set your environment.
|
|
|
90
91
|
As it is your goal to publish your library, you want to transition it from the dev to the staging environment and so forth.
|
|
91
92
|
In order to do that, you can use the transition() method.
|
|
92
93
|
***Note*** : You would need to build your library between 2 transition.
|
|
93
|
-
At the end of the funnel, you just need to build your library when you are in the
|
|
94
|
+
At the end of the funnel, you just need to build your library when you are in the "approved" state.
|
|
94
95
|
The transition method takes 1 argument:
|
|
95
96
|
|
|
96
97
|
* action : it can be either
|
|
@@ -98,6 +98,10 @@ The different get methods are the following :
|
|
|
98
98
|
Arguments:
|
|
99
99
|
* element : REQUIRED : the element definition dictionary
|
|
100
100
|
|
|
101
|
+
* **getProductionEndpoint** : Get the URL for the production library
|
|
102
|
+
|
|
103
|
+
* **getStagingEndpoint** : Get the URL for the staging library
|
|
104
|
+
|
|
101
105
|
|
|
102
106
|
## Create methods
|
|
103
107
|
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
This page gathered the changes made between version of the launchpy module.\
|
|
4
4
|
This has been started after the 0.3.0 release.\
|
|
5
5
|
|
|
6
|
+
## 0.4.4
|
|
7
|
+
* adding a `getBuilds` method on the `Library` class instance
|
|
8
|
+
* extend support for pagination on `getEnvironments`
|
|
9
|
+
* adding `getProductionEndpoint` and `getStagingEndpoint` to retrieve the URL to use on websites
|
|
10
|
+
* support the instantiation of the `Library` class via a single libraryId string.
|
|
11
|
+
|
|
6
12
|
## 0.4.3
|
|
7
|
-
* Refactor `Translator` class for removing `pandas` dependency
|
|
13
|
+
* Refactor `Translator` class for removing `pandas` dependency\
|
|
14
|
+
Patch:
|
|
15
|
+
* Fix an issue with dependency on `target_configs` attribute in synchronizor.
|
|
8
16
|
|
|
9
17
|
## 0.4.2
|
|
10
18
|
* Supporting the Oauth Token V2 authentication
|
|
@@ -217,18 +217,9 @@ synchronizor.dynamicFiltering(myRules)
|
|
|
217
217
|
```
|
|
218
218
|
|
|
219
219
|
|
|
220
|
-
###
|
|
220
|
+
### Dynamic Component filter check
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
```python
|
|
225
|
-
synchronizor = lp.Synchronizer(base='BaseProperty',targets=['Target Property 1',
|
|
226
|
-
'Target Property 2',
|
|
227
|
-
'Target Property 3'],
|
|
228
|
-
dynamicRuleComponent='syncFilter')
|
|
229
|
-
```
|
|
230
|
-
In this example above, `syncFilter` is the name of the data element containing that configuration.\
|
|
231
|
-
Once your Synchronizer class has been instanciated, you can access 2 attributes in it to verify the correct setup.
|
|
222
|
+
Once you have loaded your dynamic component rules in your Synchronizer class, you can access 2 attributes to verify the correct setup.
|
|
232
223
|
|
|
233
224
|
* `dict_config`
|
|
234
225
|
The `dict_config` attribute will be a copy of your data element setup, but a dictionary instead of an array where all of the target properties rule will be a key.\
|
|
@@ -249,4 +240,12 @@ The logic that will be applied during the sync is the following:
|
|
|
249
240
|
* IF the component name is in that list, **and not** in the `exclComponents` list, it will be sync
|
|
250
241
|
* IF the component name is in that list **and** in the `exclComponents` list, it will **NOT** be sync
|
|
251
242
|
* IF there is no list of `inclComponents` for that target property (or empty list), **and not** in the `exclComponents` list, the component will be synced
|
|
252
|
-
* ELSE: it will be sync
|
|
243
|
+
* ELSE: it will be sync
|
|
244
|
+
|
|
245
|
+
### Regular expression in Python
|
|
246
|
+
|
|
247
|
+
One common issue seeing the pattern used in Regular Expression is the use of the quantifier `*` without any character before.\
|
|
248
|
+
This can lead to some errors when using the following regular expression: `*some pattern*`\
|
|
249
|
+
This type of pattern needs to be replaced by `.*some pattern.*`\
|
|
250
|
+
|
|
251
|
+
The `*` is a quantifier that needs to have a character before it so it can know which character or pattern to repeat (or not).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.4"
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import time
|
|
2
2
|
# Non standard libraries
|
|
3
3
|
from launchpy import config, connector
|
|
4
|
+
from typing import Union
|
|
4
5
|
|
|
5
6
|
class Library:
|
|
6
7
|
"""
|
|
7
8
|
A class that handle the library in a Launch environment.
|
|
8
9
|
"""
|
|
9
10
|
|
|
10
|
-
def __init__(self, data: dict,config_object:dict=config.config_object,header:dict=config.header):
|
|
11
|
+
def __init__(self, data: Union[str,dict],config_object:dict=config.config_object,header:dict=config.header):
|
|
11
12
|
"""
|
|
12
13
|
The instantiator for the library.
|
|
13
14
|
Arguments:
|
|
@@ -19,6 +20,8 @@ class Library:
|
|
|
19
20
|
config_object=config_object, header=header)
|
|
20
21
|
self.header = self.connector.header
|
|
21
22
|
self.endpoint = config.endpoints['global']
|
|
23
|
+
if type(data) == str:
|
|
24
|
+
data = self.connector.getData("https://reactor.adobe.io/libraries/"+data).get('data')
|
|
22
25
|
self.id = data['id']
|
|
23
26
|
self.name = data['attributes']['name']
|
|
24
27
|
self.state = data['attributes']['state']
|
|
@@ -100,6 +103,23 @@ class Library:
|
|
|
100
103
|
return dataOrigin
|
|
101
104
|
self.relationships['extensions'] = data
|
|
102
105
|
return data
|
|
106
|
+
|
|
107
|
+
def getBuilds(self)->list:
|
|
108
|
+
"""
|
|
109
|
+
Retrieve the last builds.
|
|
110
|
+
Return a list of build
|
|
111
|
+
"""
|
|
112
|
+
params = {'page[number]':1}
|
|
113
|
+
res = self.connector.getData(self._Builds,params=params)
|
|
114
|
+
builds = res.get('data',[])
|
|
115
|
+
next_page = res.get('meta',{}).get('pagination',{}).get('next_page',None)
|
|
116
|
+
while next_page is not None:
|
|
117
|
+
params['page[number]'] +=1
|
|
118
|
+
res = self.connector.getData(self._Builds,params=params)
|
|
119
|
+
builds += res.get('data',[])
|
|
120
|
+
next_page = res.get('meta',{}).get('pagination',{}).get('next_page',None)
|
|
121
|
+
return builds
|
|
122
|
+
|
|
103
123
|
|
|
104
124
|
def getRules(self,page:int=0,pageSize:int=50,origin:bool=True)->list:
|
|
105
125
|
"""
|
|
@@ -296,7 +316,7 @@ class Library:
|
|
|
296
316
|
Save the different environments ids available.
|
|
297
317
|
It is required to use the library class.
|
|
298
318
|
Arguments :
|
|
299
|
-
environments_list : REQUIRED : list of environment retrieved by the
|
|
319
|
+
environments_list : REQUIRED : list of environment retrieved by the getEnvironments method
|
|
300
320
|
dev_name : OPTIONAL : Name of your dev environment. If not defined, will take the first dev environment.
|
|
301
321
|
"""
|
|
302
322
|
for env in environments_list:
|
|
@@ -99,8 +99,15 @@ class Property:
|
|
|
99
99
|
"""
|
|
100
100
|
Retrieve the environment sets for this property
|
|
101
101
|
"""
|
|
102
|
+
params = {"page[number]":1}
|
|
102
103
|
env = self.connector.getData(self._Environments)
|
|
103
104
|
data = env['data'] # skip meta for now
|
|
105
|
+
next_page = env.get('meta',{}).get('pagination',{}).get('next_page',None)
|
|
106
|
+
while next_page is not None:
|
|
107
|
+
params['page[number]'] = next_page
|
|
108
|
+
env = self.connector.getData(self._Environments,params=params)
|
|
109
|
+
data += env.get('data',[])
|
|
110
|
+
next_page = env.get('meta',{}).get('pagination',{}).get('next_page',None)
|
|
104
111
|
return data
|
|
105
112
|
|
|
106
113
|
def getHost(self)->object:
|
|
@@ -258,9 +265,9 @@ class Property:
|
|
|
258
265
|
"""
|
|
259
266
|
filters = {}
|
|
260
267
|
if name != None:
|
|
261
|
-
filters['filter[name]
|
|
268
|
+
filters['filter[name]'] = f"EQ {name}"
|
|
262
269
|
if name_contains != None:
|
|
263
|
-
filters['filter[name]
|
|
270
|
+
filters['filter[name]'] = f"CONTAINS {name_contains}"
|
|
264
271
|
if dirty != None:
|
|
265
272
|
filters['filter[dirty]'] = f"EQ {str(dirty).lower()}"
|
|
266
273
|
if enabled != None:
|
|
@@ -1187,6 +1194,22 @@ class Property:
|
|
|
1187
1194
|
for de in dataelements:
|
|
1188
1195
|
self.deleteDataElement(de['id'])
|
|
1189
1196
|
return res
|
|
1197
|
+
|
|
1198
|
+
def getProductionEndpoint(self)->dict:
|
|
1199
|
+
"""
|
|
1200
|
+
Returns the production library URL to use on the website
|
|
1201
|
+
"""
|
|
1202
|
+
envs = self.getEnvironments()
|
|
1203
|
+
prod = [env for env in envs if env['attributes']['stage'] == 'production'][0]
|
|
1204
|
+
return prod['meta']['script_sources'][0]["license_path"]
|
|
1205
|
+
|
|
1206
|
+
def getStagingEndpoint(self)->dict:
|
|
1207
|
+
"""
|
|
1208
|
+
Returns the staging library URL to use on the website
|
|
1209
|
+
"""
|
|
1210
|
+
envs = self.getEnvironments()
|
|
1211
|
+
staging = [env for env in envs if env['attributes']['stage'] == 'staging'][0]
|
|
1212
|
+
return staging['meta']['script_sources'][0]["license_path"]
|
|
1190
1213
|
|
|
1191
1214
|
def extensionsInfo(data: list)->dict:
|
|
1192
1215
|
"""
|
|
@@ -1551,4 +1574,4 @@ def extractAnalyticsCode(rcSettings: str, save: bool = False, filename: str = No
|
|
|
1551
1574
|
filename = filename.replace('/', '_').replace('|', '_')
|
|
1552
1575
|
if save:
|
|
1553
1576
|
saveFile(json_code,filename,type='js',encoding=encoding)
|
|
1554
|
-
return json_code
|
|
1577
|
+
return json_code
|
|
@@ -45,6 +45,7 @@ class Synchronizer:
|
|
|
45
45
|
self.translator.setBaseExtensions(self.base['extensions'],self.base['name'])
|
|
46
46
|
self.translator.setBaseRules(self.base['rules'],self.base['name'])
|
|
47
47
|
self.targets = {}
|
|
48
|
+
self.target_configs = {}
|
|
48
49
|
for target in targets:
|
|
49
50
|
tmp_target = [prop for prop in properties if prop['attributes']['name'] == target]
|
|
50
51
|
if len(tmp_target) == 0:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.3-2"
|
|
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
|