Skip to content

Commit f5105b2

Browse files
committed
feat: add webhook classes for WooCommerce order creation and update
1 parent 8f77020 commit f5105b2

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
Description,
3+
DisplayIcon,
4+
DisplayMessage,
5+
EventSetting,
6+
Identifier,
7+
Name,
8+
Rest,
9+
Signature
10+
} from "@code0-tech/hercules";
11+
12+
@Identifier("WooCommerceOrderCreatedWebhook")
13+
@DisplayIcon("simple:woo")
14+
@Name({code: "en-US", content: "WooCommerce order created"})
15+
@Description({code: "en-US", content: "Triggered when a new order is created in WooCommerce."})
16+
@DisplayMessage({code: "en-US", content: "WooCommerce order created on ${httpURL}"})
17+
@Signature("<A extends REST_AUTH_TYPE>(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE<A>, input_schema?: WooCommerceOrderCreatedWebhookPayload): REST_ADAPTER_INPUT<WooCommerceOrderCreatedWebhookPayload>")
18+
@EventSetting({
19+
identifier: "input_schema",
20+
hidden: true
21+
})
22+
@EventSetting({
23+
identifier: "httpMethod",
24+
hidden: true,
25+
defaultValue: "POST"
26+
})
27+
@EventSetting({
28+
identifier: "httpSchema",
29+
hidden: true,
30+
defaultValue: "application/json"
31+
})
32+
export class WooCommerceOrderCreatedWebhook extends Rest {
33+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import {
2+
Description,
3+
DisplayIcon,
4+
DisplayMessage,
5+
EventSetting,
6+
Identifier,
7+
Name,
8+
Rest,
9+
Signature
10+
} from "@code0-tech/hercules";
11+
12+
@Identifier("WooCommerceOrderUpdatedWebhook")
13+
@DisplayIcon("simple:woo")
14+
@Name({code: "en-US", content: "WooCommerce order updated"})
15+
@Description({
16+
code: "en-US",
17+
content: "Triggered when an order is updated in WooCommerce, including all status changes such as paid, cancelled or refunded. Check the status field of the payload to distinguish between them."
18+
})
19+
@DisplayMessage({code: "en-US", content: "WooCommerce order updated on ${httpURL}"})
20+
@Signature("<A extends REST_AUTH_TYPE>(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE<A>, input_schema?: WooCommerceOrderUpdatedWebhookPayload): REST_ADAPTER_INPUT<WooCommerceOrderUpdatedWebhookPayload>")
21+
@EventSetting({
22+
identifier: "input_schema",
23+
hidden: true
24+
})
25+
@EventSetting({
26+
identifier: "httpMethod",
27+
hidden: true,
28+
defaultValue: "POST"
29+
})
30+
@EventSetting({
31+
identifier: "httpSchema",
32+
hidden: true,
33+
defaultValue: "application/json"
34+
})
35+
export class WooCommerceOrderUpdatedWebhook extends Rest {
36+
}

0 commit comments

Comments
 (0)