forked from Thijzer/csv-validation-header.wip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'obelink-xml-v3' into feat/magento-app-mappings
- Loading branch information
Showing
90 changed files
with
2,451 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
## Templates | ||
|
||
We support the following Akeneo endpoints. | ||
|
||
- attributes | ||
- family | ||
- family_variants | ||
- options | ||
- products | ||
- product-models | ||
- categories | ||
- reference-entities | ||
|
||
If you like to add support to the template system, make sure you have the required converter(s) in place. | ||
|
||
You can the API in 3 different Styles: JSON, CSV & as ITEM. | ||
|
||
### [JSON] | ||
Will not change anything, all Payloads are as is. | ||
Multidimensional Payload Structure is kept (We don't use any converters). | ||
The Style is not very flexible, to make structural changes or the read multidimensional data. | ||
|
||
### [CSV] | ||
Will convert the Payload to CSV style flat data. | ||
This style is not very flexible to make structural changes. | ||
The data is flat, so it's relatively easy to manipulate but looses on structural integrity, as you don't have contextual awareness. | ||
|
||
### [ITEM] - [V3-edition] | ||
Will convert the Payload into a easy parsable Item. | ||
The data becomes discoverable, searchable across other | ||
This type will give you the most flexibility to manipulate the data. | ||
You can export to CSV and/or API from this point. | ||
|
||
### Examples | ||
|
||
```yaml | ||
transformation_steps: | ||
- {'run': akeneo/json/pull_akeneo-reference-entities.yaml, 'with': {'endpoint': ['brand']}} | ||
- {'run': akeneo/json/pull_akeneo-entities.yaml, 'with': {'endpoint': ['attributes', 'families']}} | ||
|
||
- {'run': akeneo/json/push_akeneo-reference-entities.yaml, 'with': {'endpoint': ['brand']}} | ||
- {'run': akeneo/json/push_akeneo-entities.yaml, 'with': {'endpoint': ['attributes', 'families']}} | ||
``` | ||
In this example the only custom file is change_other_attributes.yaml. | ||
```yaml | ||
context: | ||
akeneo_read_connection: '%source_resource%' | ||
akeneo_write_connection: '%target_resource%' | ||
|
||
transformation_steps: | ||
- {'run': akeneo/json/pull_akeneo-entities.yaml, 'with': {'endpoint': ['attributes']}} | ||
# DO SOMETHING | ||
- {'run': change_other_attributes.yaml, 'with': {'endpoint': ['attributes']}} | ||
- {'run': akeneo/json/push_akeneo-entities.yaml, 'with': {'endpoint': ['attributes']}} | ||
``` | ||
```yaml | ||
# change_other_attributes.yaml | ||
|
||
sources: | ||
- '%workpath%/akeneo_%endpoint%.jsonl' | ||
|
||
pipeline: | ||
input: | ||
reader: | ||
type: jsonl | ||
filename: '%workpath%/akeneo_%endpoint%.jsonl' | ||
filter: | ||
group: 'other' | ||
|
||
actions: | ||
# DO SOMETHING | ||
|
||
output: | ||
writer: | ||
type: jsonl | ||
filename: '%workpath%/akeneo_%endpoint%.jsonl' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
pipeline: | ||
input: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_read_connection%' | ||
endpoint: '%endpoint%' | ||
method: GET | ||
output: | ||
writer: | ||
type: csv | ||
filename: 'akeneo_%endpoint%.csv' | ||
converter: 'akeneo/%endpoint%/csv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pipeline: | ||
input: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_read_connection%' | ||
endpoint: '%endpoint%' | ||
method: GET | ||
actions: | ||
remove_unwanted: | ||
action: retain | ||
keys: [ identifier, code ] | ||
output: | ||
writer: | ||
type: csv | ||
filename: 'akeneo_%endpoint%_identifiers.csv' |
13 changes: 13 additions & 0 deletions
13
config/template/akeneo/csv/pull_akeneo-reference-entities.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pipeline: | ||
input: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_read_connection%' | ||
endpoint: reference-entities | ||
method: GET | ||
identifier_filter_list: ['%endpoint%'] | ||
output: | ||
writer: | ||
type: csv | ||
filename: 'akeneo_reference-entities_%endpoint%.csv' | ||
converter: 'akeneo/reference-entities/csv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
sources: | ||
- '%workpath%/akeneo_%endpoint%.csv' | ||
|
||
pipeline: | ||
input: | ||
reader: | ||
type: csv | ||
filename: '%workpath%/akeneo_%endpoint%.csv' | ||
converter: 'akeneo/%endpoint%/csv' | ||
output: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_write_connection%' | ||
endpoint: '%endpoint%' | ||
method: MULTI_PATCH | ||
converter: 'akeneo/%endpoint%/api' |
16 changes: 16 additions & 0 deletions
16
config/template/akeneo/csv/push_akeneo-reference-entities.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
sources: | ||
- '%workpath%/akeneo_reference-entities_%endpoint%.csv' | ||
|
||
pipeline: | ||
input: | ||
reader: | ||
type: csv | ||
filename: '%workpath%/akeneo_reference-entities_%endpoint%.csv' | ||
converter: 'akeneo/reference_entities/csv' | ||
output: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_write_connection%' | ||
endpoint: reference-entities | ||
method: PATCH | ||
converter: 'akeneo/reference_entities/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
context: | ||
filter: [] | ||
identifier_filter_list: [] | ||
query: '' | ||
|
||
pipeline: | ||
input: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_read_connection%' | ||
endpoint: '%endpoint%' | ||
method: GET | ||
filter: '%filter%' | ||
identifier_filter_list: '%identifier_filter_list%' | ||
limiters: | ||
querystring: '%query%' | ||
output: | ||
writer: | ||
type: jsonl | ||
filename: 'akeneo_%endpoint%.jsonl' |
13 changes: 13 additions & 0 deletions
13
config/template/akeneo/jsonl/pull_akeneo-entity_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pipeline: | ||
input: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_read_connection%' | ||
endpoint: '%endpoint%' | ||
method: GET | ||
multiple: true | ||
attribute_list: '%attribute_options%' | ||
output: | ||
writer: | ||
type: jsonl | ||
filename: 'akeneo_%endpoint%.jsonl' |
13 changes: 13 additions & 0 deletions
13
config/template/akeneo/jsonl/pull_akeneo-reference-entities.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pipeline: | ||
input: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_read_connection%' | ||
endpoint: reference-entities | ||
method: GET | ||
identifier_filter_list: ['%endpoint%'] | ||
|
||
output: | ||
writer: | ||
type: jsonl | ||
filename: 'akeneo_reference-entities_%endpoint%.jsonl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sources: | ||
- '%workpath%/akeneo_%endpoint%.jsonl' | ||
|
||
pipeline: | ||
input: | ||
reader: | ||
type: jsonl | ||
filename: '%workpath%/akeneo_%endpoint%.jsonl' | ||
output: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_write_connection%' | ||
endpoint: '%endpoint%' | ||
method: MULTI_PATCH |
16 changes: 16 additions & 0 deletions
16
config/template/akeneo/jsonl/push_akeneo-reference-entities.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
sources: | ||
- '%workpath%/akeneo_reference-entities_%endpoint%.jsonl' | ||
|
||
pipeline: | ||
input: | ||
reader: | ||
type: jsonl | ||
filename: '%workpath%/akeneo_reference-entities_%endpoint%.jsonl' | ||
converter: 'akeneo/reference_entities/csv' | ||
output: | ||
http: | ||
type: rest_api | ||
account: '%akeneo_write_connection%' | ||
endpoint: reference-entities | ||
method: PATCH | ||
converter: 'akeneo/reference_entities/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Misery\Component\Action; | ||
|
||
use Misery\Model\DataStructure\ItemInterface; | ||
|
||
interface ActionItemInterface | ||
{ | ||
public function applyAsItem(ItemInterface $item): ItemInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.