-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New Components - akeneo #18189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+359
−3
Merged
New Components - akeneo #18189
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
27 changes: 27 additions & 0 deletions
27
components/akeneo/actions/delete-product/delete-product.mjs
This file contains hidden or 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,27 @@ | ||
| import akeneo from "../../akeneo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "akeneo-delete-product", | ||
| name: "Delete Product", | ||
| description: "Delete a product from Akeneo. [See the documentation](https://api.akeneo.com/api-reference.html#delete_products__code_)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| akeneo, | ||
| productId: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "productId", | ||
| ], | ||
| description: "Identifier of the product to delete", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.akeneo.deleteProduct({ | ||
| $, | ||
| productId: this.productId, | ||
| }); | ||
| $.export("$summary", `Successfully deleted product ${this.productId}`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or 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,27 @@ | ||
| import akeneo from "../../akeneo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "akeneo-get-draft", | ||
| name: "Get Draft", | ||
| description: "Get a product draft from Akeneo. [See the documentation](https://api.akeneo.com/api-reference.html#get_draft__code_)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| akeneo, | ||
| productId: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "productId", | ||
| ], | ||
| description: "Identifier of the product to get the draft for", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.akeneo.getProductDraft({ | ||
| $, | ||
| productId: this.productId, | ||
| }); | ||
| $.export("$summary", `Found draft for product ${this.productId}`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or 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,58 @@ | ||
| import akeneo from "../../akeneo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "akeneo-get-product", | ||
| name: "Get Product", | ||
| description: "Get a product from Akeneo. [See the documentation](https://api.akeneo.com/api-reference.html#get_products__code_)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| akeneo, | ||
| productId: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "productId", | ||
| ], | ||
| description: "Identifier of the product to get", | ||
| }, | ||
| withAttributeOptions: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withAttributeOptions", | ||
| ], | ||
| }, | ||
| withAssetShareLinks: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withAssetShareLinks", | ||
| ], | ||
| }, | ||
| withQualityScores: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withQualityScores", | ||
| ], | ||
| }, | ||
| withCompleteness: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withCompleteness", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.akeneo.getProduct({ | ||
| $, | ||
| productId: this.productId, | ||
| params: { | ||
| with_attribute_options: this.withAttributeOptions, | ||
| with_asset_share_links: this.withAssetShareLinks, | ||
| with_quality_scores: this.withQualityScores, | ||
| with_completeness: this.withCompleteness, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Found product ${response.identifier}`); | ||
| return response; | ||
| }, | ||
| }; |
119 changes: 119 additions & 0 deletions
119
components/akeneo/actions/search-products/search-products.mjs
This file contains hidden or 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,119 @@ | ||
| import akeneo from "../../akeneo.app.mjs"; | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
|
|
||
| export default { | ||
| key: "akeneo-search-products", | ||
| name: "Search Products", | ||
| description: "Search products from Akeneo. [See the documentation](https://api.akeneo.com/api-reference.html#get_products)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| akeneo, | ||
| search: { | ||
| type: "string", | ||
| label: "Search", | ||
| description: "Filter products, for more details see the [Filters](https://api.akeneo.com/documentation/filter.html) section", | ||
| optional: true, | ||
| }, | ||
| scope: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "channelCode", | ||
| ], | ||
| label: "Scope", | ||
| description: "Filter product values to return scopable attributes for the given channel as well as the non localizable/non scopable attributes, for more details see the [Filter product values via channel](https://api.akeneo.com/documentation/filter.html#via-channel) section", | ||
| optional: true, | ||
| }, | ||
| locales: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "locale", | ||
| ], | ||
| description: "Filter product values to return localizable attributes for the given locales as well as the non localizable/non scopable attributes, for more details see the [Filter product values via locale](https://api.akeneo.com/documentation/filter.html#via-locale) section", | ||
| optional: true, | ||
| }, | ||
| attributes: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "attribute", | ||
| ], | ||
| label: "Attributes", | ||
| description: "Filter product values to only return those concerning the given attributes, for more details see the [Filter on product values](https://api.akeneo.com/documentation/filter.html#filter-product-values) section", | ||
| optional: true, | ||
| }, | ||
| convertMeasurements: { | ||
| type: "boolean", | ||
| label: "Convert Measurements", | ||
| description: "Convert values of measurement attributes to the unit configured in the channel provided by the parameter \"scope\". Therefore, this parameter requires the \"scope\" parameter to be provided.", | ||
| optional: true, | ||
| }, | ||
| withCount: { | ||
| type: "boolean", | ||
| label: "With Count", | ||
| description: "Return the count of items in the response. Be carefull with that, on a big catalog, it can decrease performance in a significative way", | ||
| optional: true, | ||
| }, | ||
| withAttributeOptions: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withAttributeOptions", | ||
| ], | ||
| }, | ||
| withAssetShareLinks: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withAssetShareLinks", | ||
| ], | ||
| }, | ||
| withQualityScores: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withQualityScores", | ||
| ], | ||
| }, | ||
| withCompleteness: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "withCompleteness", | ||
| ], | ||
| }, | ||
| page: { | ||
| type: "integer", | ||
| label: "Page", | ||
| description: "The page number to return", | ||
| optional: true, | ||
| }, | ||
| limit: { | ||
| type: "integer", | ||
| label: "Limit", | ||
| description: "The number of items to return per page", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (this.convertMeasurements && !this.scope) { | ||
| throw new ConfigurationError("The `convertMeasurements` parameter requires the `scope` parameter to be provided"); | ||
| } | ||
|
|
||
| const response = await this.akeneo.getProducts({ | ||
| $, | ||
| params: { | ||
| search: this.search, | ||
| scope: this.scope, | ||
| locales: this.locales, | ||
| attributes: this.attributes, | ||
| convert_measurements: this.convertMeasurements, | ||
| with_count: this.withCount, | ||
| with_attribute_options: this.withAttributeOptions, | ||
| with_asset_share_links: this.withAssetShareLinks, | ||
| with_quality_scores: this.withQualityScores, | ||
| with_completeness: this.withCompleteness, | ||
| page: this.page, | ||
| limit: this.limit, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Found ${response._embedded.items.length} products`); | ||
| return response; | ||
| }, | ||
| }; | ||
27 changes: 27 additions & 0 deletions
27
components/akeneo/actions/submit-product-for-approval/submit-product-for-approval.mjs
This file contains hidden or 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,27 @@ | ||
| import akeneo from "../../akeneo.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "akeneo-submit-product-for-approval", | ||
| name: "Submit Product For Approval", | ||
| description: "Submit a product for approval. [See the documentation](https://api.akeneo.com/api-reference.html#post_proposal)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| akeneo, | ||
| productId: { | ||
| propDefinition: [ | ||
| akeneo, | ||
| "productId", | ||
| ], | ||
| description: "Identifier of the product to submit for approval", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.akeneo.submitDraft({ | ||
| $, | ||
| productId: this.productId, | ||
| }); | ||
| $.export("$summary", `Successfully submitted product ${this.productId} for approval`); | ||
| return response; | ||
| }, | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.