Skip to content

17714 kustomer #17814

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
merged 5 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ export default {
key: "kustomer-create-conversation",
name: "Create Conversation",
description: "Creates a new conversation in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/createaconversation)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
kustomer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "kustomer-create-customer",
name: "Create Customer",
description: "Creates a new customer in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/createacustomer)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
kustomer,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ConfigurationError } from "@pipedream/platform";
import kustomer from "../../kustomer.app.mjs";

export default {
key: "kustomer-get-custom-object-by-external-id",
name: "Get Custom Object by External ID",
description: "Gets a custom object by external ID in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/get-klasses-name-externalid-externalid)",
version: "0.0.1",
type: "action",
props: {
kustomer,
klassName: {
propDefinition: [
kustomer,
"klassName",
],
},
externalId: {
type: "string",
label: "External ID",
description: "The external ID of the custom object to retrieve",
},
},
async run({ $ }) {
try {
const response = await this.kustomer.getCustomObjectByExternalId({
$,
klassName: this.klassName,
externalId: this.externalId,
});

$.export("$summary", `Successfully retrieved custom object with external ID ${this.externalId}`);
return response;
} catch ({ response }) {
throw new ConfigurationError(response.data.errors[0].title);
}
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ConfigurationError } from "@pipedream/platform";
import kustomer from "../../kustomer.app.mjs";

export default {
key: "kustomer-get-custom-object-by-id",
name: "Get Custom Object by ID",
description: "Gets a custom object by ID in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/getkobject)",
version: "0.0.1",
type: "action",
props: {
kustomer,
klassName: {
propDefinition: [
kustomer,
"klassName",
],
},
customObjectId: {
propDefinition: [
kustomer,
"customObjectId",
({ klassName }) => ({
klassName,
}),
],
},
},
async run({ $ }) {
try {
const response = await this.kustomer.getCustomObjectById({
$,
klassName: this.klassName,
customObjectId: this.customObjectId,
});

$.export("$summary", `Successfully retrieved custom object with ID ${this.customObjectId}`);
return response;
} catch ({ response }) {
throw new ConfigurationError(response.data.errors[0].title);
}
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ConfigurationError } from "@pipedream/platform";
import kustomer from "../../kustomer.app.mjs";

export default {
key: "kustomer-get-custom-objects",
name: "Get Custom Objects",
description: "Gets custom objects in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/getkobjects)",
version: "0.0.1",
type: "action",
props: {
kustomer,
klassName: {
propDefinition: [
kustomer,
"klassName",
],
},
fromDate: {
type: "string",
label: "From Date",
description: "Date-time string in Internet Date/Time format (ISO 8601) E.g. `2025-07-25T00:00:00Z`",
optional: true,
},
},
async run({ $ }) {
try {
const response = await this.kustomer.listCustomObjects({
$,
klassName: this.klassName,
params: {
fromDate: this.fromDate,
},
});

$.export("$summary", `Successfully retrieved ${response.data.length} custom objects`);
return response;
} catch ({ response }) {
throw new ConfigurationError(response.data.errors[0].title);
}
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "kustomer-update-conversation",
name: "Update Conversation",
description: "Updates an existing conversation in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/updateconversation).",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
kustomer,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { ConfigurationError } from "@pipedream/platform";
import { parseObject } from "../../common/utils.mjs";
import kustomer from "../../kustomer.app.mjs";

export default {
key: "kustomer-update-custom-object-by-id",
name: "Update Custom Object by ID",
description: "Updates a custom object identified by ID in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/updatekobject)",
version: "0.0.1",
type: "action",
props: {
kustomer,
klassName: {
propDefinition: [
kustomer,
"klassName",
],
},
customObjectId: {
propDefinition: [
kustomer,
"customObjectId",
({ klassName }) => ({
klassName,
}),
],
},
externalId: {
type: "string",
label: "External ID",
description: "The external ID of the custom object to update",
optional: true,
},
title: {
type: "string",
label: "Title",
description: "The title of the custom object to update",
optional: true,
},
description: {
type: "string",
label: "Description",
description: "The description of the custom object to update",
optional: true,
},
data: {
type: "object",
label: "Data",
description: "The data to update the custom object with",
optional: true,
},
custom: {
type: "object",
label: "Custom",
description: "The custom data of the custom object to update",
optional: true,
},
tags: {
propDefinition: [
kustomer,
"tags",
],
label: "Tags",
description: "Tags associated with the custom object",
optional: true,
},
rev: {
type: "integer",
label: "Rev",
description: "The rev of the custom object to update",
optional: true,
},
},
async run({ $ }) {
try {
const response = await this.kustomer.updateCustomObjectById({
$,
klassName: this.klassName,
customObjectId: this.customObjectId,
data: {
externalId: this.externalId,
title: this.title,
description: this.description,
data: parseObject(this.data),
custom: parseObject(this.custom),
tags: parseObject(this.tags),
rev: this.rev,
},
});

$.export("$summary", `Successfully updated custom object with ID ${this.customObjectId}`);
return response;
} catch ({ response }) {
throw new ConfigurationError(response.data.errors[0].title);
}
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "kustomer-update-customer",
name: "Update Customer",
description: "Updates an existing customer in Kustomer. [See the documentation](https://developer.kustomer.com/kustomer-api-docs/reference/updatecustomer)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
kustomer,
Expand Down
88 changes: 88 additions & 0 deletions components/kustomer/kustomer.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,49 @@ export default {
}));
},
},
klassName: {
type: "string",
label: "Klass Name",
description: "Klass name of the KObjects (custom objects)",
async options({ page }) {
const { data } = await this.listKlasses({
params: {
page: page + 1,
pageSize: LIMIT * page,
},
});
return data.map(({
attributes: {
name: value, displayName: label,
},
}) => ({
label,
value,
}));
},
},
customObjectId: {
type: "string",
label: "Custom Object ID",
description: "The ID of the custom object to retrieve",
async options({
page, klassName,
}) {
const { data } = await this.listCustomObjects({
klassName,
params: {
page: page + 1,
pageSize: LIMIT * page,
},
});
return data.map(({
id: value, attributes: { title: label },
}) => ({
label,
value,
}));
},
},
externalId: {
type: "string",
label: "External ID",
Expand Down Expand Up @@ -327,6 +370,51 @@ export default {
...opts,
});
},
listKlasses(opts = {}) {
return this._makeRequest({
path: "/klasses",
...opts,
});
},
listCustomObjects({
klassName, ...opts
}) {
return this._makeRequest({
path: `/klasses/${klassName}`,
...opts,
});
},
getCustomObjectById({
klassName,
customObjectId,
...opts
}) {
return this._makeRequest({
path: `/klasses/${klassName}/${customObjectId}`,
...opts,
});
},
getCustomObjectByExternalId({
klassName,
externalId,
...opts
}) {
return this._makeRequest({
path: `/klasses/${klassName}/externalId=${externalId}`,
...opts,
});
},
updateCustomObjectById({
klassName,
customObjectId,
...opts
}) {
return this._makeRequest({
method: "PUT",
path: `/klasses/${klassName}/${customObjectId}`,
...opts,
});
},
createWebhook(opts = {}) {
return this._makeRequest({
method: "POST",
Expand Down
4 changes: 2 additions & 2 deletions components/kustomer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/kustomer",
"version": "0.1.0",
"version": "0.2.0",
"description": "Pipedream Kustomer Components",
"main": "kustomer.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^3.0.3"
"@pipedream/platform": "^3.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "kustomer-new-conversation-instant",
name: "New Conversation Created (Instant)",
description: "Emit new event when a conversation is created in Kustomer.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "kustomer-new-customer-instant",
name: "New Customer Created (Instant)",
description: "Emit new event when a new customer is added to Kustomer.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Loading
Loading