-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
17714 kustomer #17814
Changes from all commits
Commits
Show all changes
5 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
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
38 changes: 38 additions & 0 deletions
38
...ts/kustomer/actions/get-custom-object-by-external-id/get-custom-object-by-external-id.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,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); | ||
} | ||
}, | ||
}; |
42 changes: 42 additions & 0 deletions
42
components/kustomer/actions/get-custom-object-by-id/get-custom-object-by-id.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,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); | ||
} | ||
}, | ||
}; |
41 changes: 41 additions & 0 deletions
41
components/kustomer/actions/get-custom-objects/get-custom-objects.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,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); | ||
} | ||
}, | ||
}; |
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
97 changes: 97 additions & 0 deletions
97
components/kustomer/actions/update-custom-object-by-id/update-custom-object-by-id.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,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); | ||
} | ||
}, | ||
}; |
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
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
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
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
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
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.