Skip to content
Open
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
2 changes: 1 addition & 1 deletion components/trengo/actions/attach-label/attach-label.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "trengo-attach-label",
name: "Attach Label",
description: "Attach a label to a ticket. [See the documentation](https://developers.trengo.com/reference/apply-a-label)",
version: "0.0.3",
version: "0.0.4",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
2 changes: 1 addition & 1 deletion components/trengo/actions/close-ticket/close-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "trengo-close-ticket",
name: "Close Ticket",
description: "Close a ticket. [See the documentation](https://developers.trengo.com/reference/close-a-ticket)",
version: "0.0.1",
version: "0.0.2",
type: "action",
annotations: {
destructiveHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import app from "../../trengo.app.mjs";
export default {
type: "action",
key: "trengo-create-contact",
version: "0.0.8",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/trengo/actions/find-contacts/find-contacts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import app from "../../trengo.app.mjs";
export default {
type: "action",
key: "trengo-find-contacts",
version: "0.0.8",
version: "0.0.9",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
41 changes: 41 additions & 0 deletions components/trengo/actions/get-article/get-article.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import app from "../../trengo.app.mjs";

export default {
key: "trengo-get-article",
name: "Get Article",
description: "Get a specific article. [See the documentation](https://developers.trengo.com/reference/get-an-article)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
app,
helpCenterId: {
propDefinition: [
app,
"helpCenterId",
],
},
articleId: {
propDefinition: [
app,
"articleId",
({ helpCenterId }) => ({
helpCenterId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.getArticle({
$,
helpCenterId: this.helpCenterId,
articleId: this.articleId,
});
$.export("$summary", "Successfully retrieved article");
return response;
},
};
41 changes: 41 additions & 0 deletions components/trengo/actions/get-block/get-block.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import app from "../../trengo.app.mjs";

export default {
key: "trengo-get-block",
name: "Get Block",
description: "Get a specific block. [See the documentation](https://developers.trengo.com/reference/get-a-block)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
app,
helpCenterId: {
propDefinition: [
app,
"helpCenterId",
],
},
blockId: {
propDefinition: [
app,
"blockId",
({ helpCenterId }) => ({
helpCenterId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.getBlock({
$,
helpCenterId: this.helpCenterId,
blockId: this.blockId,
});
$.export("$summary", "Successfully retrieved block");
return response;
},
};
41 changes: 41 additions & 0 deletions components/trengo/actions/get-category/get-category.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import app from "../../trengo.app.mjs";

export default {
key: "trengo-get-category",
name: "Get Category",
description: "Get a specific category. [See the documentation](https://developers.trengo.com/reference/get-a-category)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
app,
helpCenterId: {
propDefinition: [
app,
"helpCenterId",
],
},
categoryId: {
propDefinition: [
app,
"categoryId",
({ helpCenterId }) => ({
helpCenterId,
}),
],
},
},
async run({ $ }) {
const response = await this.app.getCategory({
$,
helpCenterId: this.helpCenterId,
categoryId: this.categoryId,
});
$.export("$summary", "Successfully retrieved category");
return response;
},
};
31 changes: 31 additions & 0 deletions components/trengo/actions/get-help-center/get-help-center.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import app from "../../trengo.app.mjs";

export default {
key: "trengo-get-help-center",
name: "Get Help Center",
description: "Get a specific help center. [See the documentation](https://developers.trengo.com/reference/get-a-help-center)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
app,
helpCenterId: {
propDefinition: [
app,
"helpCenterId",
],
},
},
async run({ $ }) {
const response = await this.app.getHelpCenter({
$,
helpCenterId: this.helpCenterId,
});
$.export("$summary", "Successfully retrieved help center");
return response;
},
};
2 changes: 1 addition & 1 deletion components/trengo/actions/get-label/get-label.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "trengo-get-label",
name: "Get Label",
description: "Get a label by ID. [See the documentation](https://developers.trengo.com/reference/get-a-label)",
version: "0.0.3",
version: "0.0.4",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
2 changes: 1 addition & 1 deletion components/trengo/actions/get-message/get-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "trengo-get-message",
name: "Get Message",
description: "Get a message by ID. [See the documentation](https://developers.trengo.com/reference/fetch-a-message)",
version: "0.0.3",
version: "0.0.4",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
50 changes: 50 additions & 0 deletions components/trengo/actions/list-all-blocks/list-all-blocks.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import utils from "../../common/utils.mjs";
import app from "../../trengo.app.mjs";

export default {
key: "trengo-list-all-blocks",
name: "List All Blocks",
description: "List all blocks in a help center. [See the documentation](https://developers.trengo.com/reference/list-all-blocks)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
app,
helpCenterId: {
propDefinition: [
app,
"helpCenterId",
],
},
maxResults: {
type: "integer",
label: "Max Results",
description: "Maximum number of blocks to return (if not specified, all results will be returned)",
optional: true,
},
},
async run({ $ }) {
const blocks = [];
const resourcesStream = utils.getResourcesStream({
resourceFn: this.app.listBlocks,
resourceFnArgs: {
helpCenterId: this.helpCenterId,
},
});
for await (const item of resourcesStream) {
blocks.push(item);
if (this.maxResults && blocks.length >= this.maxResults) {
break;
}
}
const length = blocks.length;
$.export("$summary", `Successfully retrieved ${length} block${length === 1
? ""
: "s"}`);
return blocks;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import utils from "../../common/utils.mjs";
import app from "../../trengo.app.mjs";

export default {
key: "trengo-list-all-categories",
name: "List All Categories",
description: "List all categories in a help center. [See the documentation](https://developers.trengo.com/reference/list-all-categories)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
app,
helpCenterId: {
propDefinition: [
app,
"helpCenterId",
],
},
maxResults: {
type: "integer",
label: "Max Results",
description: "Maximum number of categories to return (if not specified, all results will be returned)",
optional: true,
},
},
async run({ $ }) {
const categories = [];
const resourcesStream = utils.getResourcesStream({
resourceFn: this.app.listCategories,
resourceFnArgs: {
helpCenterId: this.helpCenterId,
},
});
for await (const item of resourcesStream) {
categories.push(item);
if (this.maxResults && categories.length >= this.maxResults) {
break;
}
}
const length = categories.length;
$.export("$summary", `Successfully retrieved ${length} categor${length === 1
? "y"
: "ies"}`);
return categories;
},
};
2 changes: 1 addition & 1 deletion components/trengo/actions/list-articles/list-articles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import app from "../../trengo.app.mjs";
export default {
type: "action",
key: "trengo-list-articles",
version: "0.0.6",
version: "0.0.7",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
42 changes: 42 additions & 0 deletions components/trengo/actions/list-help-centers/list-help-centers.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import utils from "../../common/utils.mjs";
import app from "../../trengo.app.mjs";

export default {
type: "action",
key: "trengo-list-help-centers",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
name: "List Help Centers",
description: "List all help centers. [See the documentation](https://developers.trengo.com/reference/list-all-help-centers)",
props: {
app,
maxResults: {
type: "integer",
label: "Max Results",
description: "Maximum number of help centers to return (if not specified, all results will be returned)",
optional: true,
},
},
async run({ $ }) {
const helpCenters = [];
const resourcesStream = utils.getResourcesStream({
resourceFn: this.app.getHelpCenters,
resourceFnArgs: {},
});
for await (const item of resourcesStream) {
helpCenters.push(item);
if (this.maxResults && helpCenters.length >= this.maxResults) {
break;
}
}
const length = helpCenters.length;
$.export("$summary", `Successfully retrieved ${length} help center${length === 1
? ""
: "s"}`);
return helpCenters;
},
};
2 changes: 1 addition & 1 deletion components/trengo/actions/list-labels/list-labels.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "trengo-list-labels",
name: "List Labels",
description: "List all labels. [See the documentation](https://developers.trengo.com/reference/list-all-labels)",
version: "0.0.3",
version: "0.0.4",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
2 changes: 1 addition & 1 deletion components/trengo/actions/list-messages/list-messages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "trengo-list-messages",
name: "List Messages",
description: "List messages from a ticket. [See the documentation](https://developers.trengo.com/reference/list-all-messages)",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/trengo/actions/list-tickets/list-tickets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "trengo-list-tickets",
name: "List Tickets",
description: "List tickets according to the specified criteria. [See the documentation](https://developers.trengo.com/reference/list-all-tickets)",
version: "0.0.5",
version: "0.0.6",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Loading
Loading