Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import FormData from "form-data";
export default {
type: "action",
key: "akeneo-create-a-new-product-media-file",
version: "0.1.2",
version: "0.1.3",
name: "Create A New Product Media File",
description: "Allows you to create a new media file and associate it to an attribute value of a given product or product model. [See the docs](https://api.akeneo.com/api-reference.html#post_media_files)",
props: {
Expand All @@ -17,6 +17,7 @@ export default {
app,
"productId",
],
optional: true,
},
productModelCode: {
propDefinition: [
Expand Down
27 changes: 27 additions & 0 deletions components/akeneo/actions/delete-product/delete-product.mjs
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;
},
};
27 changes: 27 additions & 0 deletions components/akeneo/actions/get-draft/get-draft.mjs
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;
},
};
58 changes: 58 additions & 0 deletions components/akeneo/actions/get-product/get-product.mjs
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 components/akeneo/actions/search-products/search-products.mjs
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;
},
};
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;
},
};
Loading
Loading