Skip to content

Commit 8b79b7f

Browse files
authored
Merging pull request #17827
* new components * pnpm-lock.yaml * pnpm-lock.yaml * versions
1 parent 6458a0f commit 8b79b7f

File tree

26 files changed

+512
-19
lines changed

26 files changed

+512
-19
lines changed

components/gorgias_oauth/actions/create-customer/create-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "gorgias_oauth-create-customer",
66
name: "Create Customer",
77
description: "Create a new customer. [See the docs](https://developers.gorgias.com/reference/post_api-customers)",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
type: "action",
1010
props: {
1111
gorgias_oauth,
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import gorgias_oauth from "../../gorgias_oauth.app.mjs";
2+
import { parseObject } from "../../common/utils.mjs";
3+
import constants from "../../common/constants.mjs";
4+
5+
export default {
6+
key: "gorgias_oauth-create-macro",
7+
name: "Create Macro",
8+
description: "Create a macro. [See the documentation](https://developers.gorgias.com/reference/create-macro)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
gorgias_oauth,
13+
name: {
14+
type: "string",
15+
label: "Name",
16+
description: "The name of the Macro. Tips: choose a name that can be easily searched.",
17+
},
18+
intent: {
19+
type: "string",
20+
label: "Intent",
21+
description: "The intention of the macro should be used for",
22+
optional: true,
23+
options: constants.macroIntents,
24+
},
25+
language: {
26+
propDefinition: [
27+
gorgias_oauth,
28+
"language",
29+
],
30+
description: "The language of the macro",
31+
},
32+
actions: {
33+
type: "string[]",
34+
label: "Actions",
35+
description: `A list of actions to be applied on tickets. [See the documentation](https://developers.gorgias.com/reference/create-macro) for more info.
36+
\nExample: [{
37+
"arguments": {
38+
"tags": "question, order-status"
39+
},
40+
"name": "addTags",
41+
"title": "add tags",
42+
"type": "user"
43+
}]`,
44+
optional: true,
45+
},
46+
},
47+
async run({ $ }) {
48+
const data = {
49+
name: this.name,
50+
intent: this.intent,
51+
language: this.language,
52+
actions: parseObject(this.actions),
53+
};
54+
const response = await this.gorgias_oauth.createMacro({
55+
$,
56+
data,
57+
});
58+
$.export("$summary", `Successfully created macro ${response.id}`);
59+
return response;
60+
},
61+
};

components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "gorgias_oauth-create-ticket-message",
88
name: "Create Ticket Message",
99
description: "Create a message for a ticket in the Gorgias system. [See the documentation](https://developers.gorgias.com/reference/create-ticket-message)",
10-
version: "0.0.3",
10+
version: "0.0.4",
1111
type: "action",
1212
props: {
1313
gorgiasOauth,

components/gorgias_oauth/actions/create-ticket/create-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "gorgias_oauth-create-ticket",
55
name: "Create Ticket",
66
description: "Create a new ticket. [See the docs](https://developers.gorgias.com/reference/post_api-tickets)",
7-
version: "0.0.7",
7+
version: "0.0.8",
88
type: "action",
99
props: {
1010
gorgias_oauth,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import gorgias_oauth from "../../gorgias_oauth.app.mjs";
2+
3+
export default {
4+
key: "gorgias_oauth-delete-macro",
5+
name: "Delete Macro",
6+
description: "Delete a macro. [See the documentation](https://developers.gorgias.com/reference/delete-macro)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
gorgias_oauth,
11+
macroId: {
12+
propDefinition: [
13+
gorgias_oauth,
14+
"macroId",
15+
],
16+
},
17+
},
18+
async run({ $ }) {
19+
const response = await this.gorgias_oauth.deleteMacro({
20+
$,
21+
id: this.macroId,
22+
});
23+
$.export("$summary", `Successfully deleted macro ${this.macroId}`);
24+
return response;
25+
},
26+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import gorgias_oauth from "../../gorgias_oauth.app.mjs";
2+
3+
export default {
4+
key: "gorgias_oauth-get-ticket",
5+
name: "Get Ticket",
6+
description: "Get a ticket. [See the documentation](https://developers.gorgias.com/reference/get-ticket)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
gorgias_oauth,
11+
ticketId: {
12+
propDefinition: [
13+
gorgias_oauth,
14+
"ticketId",
15+
],
16+
description: "The ID of a ticket to get",
17+
},
18+
},
19+
async run({ $ }) {
20+
const response = await this.gorgias_oauth.retrieveTicket({
21+
$,
22+
id: this.ticketId,
23+
});
24+
$.export("$summary", `Successfully retrieved ticket with ID: ${this.ticketId}`);
25+
return response;
26+
},
27+
};
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import gorgias_oauth from "../../gorgias_oauth.app.mjs";
2+
3+
export default {
4+
key: "gorgias_oauth-list-macros",
5+
name: "List Macros",
6+
description: "List all macros. [See the documentation](https://developers.gorgias.com/reference/list-macros)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
gorgias_oauth,
11+
search: {
12+
type: "string",
13+
label: "Search",
14+
description: "Filter macros containing the given search query",
15+
optional: true,
16+
},
17+
limit: {
18+
propDefinition: [
19+
gorgias_oauth,
20+
"limit",
21+
],
22+
},
23+
},
24+
async run({ $ }) {
25+
const params = {
26+
search: this.search,
27+
limit: this.limit,
28+
};
29+
30+
const macros = [];
31+
const paginator = this.gorgias_oauth.paginate({
32+
$,
33+
fn: this.gorgias_oauth.listMacros,
34+
params,
35+
});
36+
for await (const macro of paginator) {
37+
macros.push(macro);
38+
}
39+
40+
const suffix = macros.length === 1
41+
? ""
42+
: "s";
43+
$.export("$summary", `Returned ${macros.length} macro${suffix}`);
44+
return macros;
45+
},
46+
};

components/gorgias_oauth/actions/list-tickets/list-tickets.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "gorgias_oauth-list-tickets",
55
name: "List Tickets",
66
description: "List all tickets. [See the docs](https://developers.gorgias.com/reference/get_api-tickets)",
7-
version: "0.0.7",
7+
version: "0.0.8",
88
type: "action",
99
props: {
1010
gorgias_oauth,

components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "gorgias_oauth-retrieve-customer",
55
name: "Retrieve a Customer",
66
description: "Retrieve a customer. [See the docs](https://developers.gorgias.com/reference/get_api-customers-id-)",
7-
version: "0.0.6",
7+
version: "0.0.7",
88
type: "action",
99
props: {
1010
gorgias_oauth,

components/gorgias_oauth/actions/update-customer/update-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
key: "gorgias_oauth-update-customer",
1111
name: "Update Customer",
1212
description: "Update a customer. [See the docs](https://developers.gorgias.com/reference/put_api-customers-id-)",
13-
version: "0.0.6",
13+
version: "0.0.7",
1414
type: "action",
1515
props: {
1616
gorgias_oauth,

0 commit comments

Comments
 (0)