@keystrokehq/payhip 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/action.cjs +21 -0
- package/dist/action.cjs.map +1 -0
- package/dist/action.mjs +21 -0
- package/dist/action.mjs.map +1 -0
- package/dist/actions/create-coupon.cjs +43 -0
- package/dist/actions/create-coupon.cjs.map +1 -0
- package/dist/actions/create-coupon.d.cts +9 -0
- package/dist/actions/create-coupon.d.cts.map +1 -0
- package/dist/actions/create-coupon.d.mts +9 -0
- package/dist/actions/create-coupon.d.mts.map +1 -0
- package/dist/actions/create-coupon.mjs +42 -0
- package/dist/actions/create-coupon.mjs.map +1 -0
- package/dist/actions/delete-coupon.cjs +25 -0
- package/dist/actions/delete-coupon.cjs.map +1 -0
- package/dist/actions/delete-coupon.d.cts +9 -0
- package/dist/actions/delete-coupon.d.cts.map +1 -0
- package/dist/actions/delete-coupon.d.mts +9 -0
- package/dist/actions/delete-coupon.d.mts.map +1 -0
- package/dist/actions/delete-coupon.mjs +24 -0
- package/dist/actions/delete-coupon.mjs.map +1 -0
- package/dist/actions/get-coupon.cjs +30 -0
- package/dist/actions/get-coupon.cjs.map +1 -0
- package/dist/actions/get-coupon.d.cts +9 -0
- package/dist/actions/get-coupon.d.cts.map +1 -0
- package/dist/actions/get-coupon.d.mts +9 -0
- package/dist/actions/get-coupon.d.mts.map +1 -0
- package/dist/actions/get-coupon.mjs +29 -0
- package/dist/actions/get-coupon.mjs.map +1 -0
- package/dist/actions/index.cjs +19 -0
- package/dist/actions/index.d.cts +10 -0
- package/dist/actions/index.d.mts +10 -0
- package/dist/actions/index.mjs +10 -0
- package/dist/actions/update-coupon.cjs +33 -0
- package/dist/actions/update-coupon.cjs.map +1 -0
- package/dist/actions/update-coupon.d.cts +9 -0
- package/dist/actions/update-coupon.d.cts.map +1 -0
- package/dist/actions/update-coupon.d.mts +9 -0
- package/dist/actions/update-coupon.d.mts.map +1 -0
- package/dist/actions/update-coupon.mjs +32 -0
- package/dist/actions/update-coupon.mjs.map +1 -0
- package/dist/actions/verify-coupon.cjs +36 -0
- package/dist/actions/verify-coupon.cjs.map +1 -0
- package/dist/actions/verify-coupon.d.cts +9 -0
- package/dist/actions/verify-coupon.d.cts.map +1 -0
- package/dist/actions/verify-coupon.d.mts +9 -0
- package/dist/actions/verify-coupon.d.mts.map +1 -0
- package/dist/actions/verify-coupon.mjs +35 -0
- package/dist/actions/verify-coupon.mjs.map +1 -0
- package/dist/actions/webhook-event-paid.cjs +75 -0
- package/dist/actions/webhook-event-paid.cjs.map +1 -0
- package/dist/actions/webhook-event-paid.d.cts +9 -0
- package/dist/actions/webhook-event-paid.d.cts.map +1 -0
- package/dist/actions/webhook-event-paid.d.mts +9 -0
- package/dist/actions/webhook-event-paid.d.mts.map +1 -0
- package/dist/actions/webhook-event-paid.mjs +74 -0
- package/dist/actions/webhook-event-paid.mjs.map +1 -0
- package/dist/actions/webhook-event-refunded.cjs +79 -0
- package/dist/actions/webhook-event-refunded.cjs.map +1 -0
- package/dist/actions/webhook-event-refunded.d.cts +9 -0
- package/dist/actions/webhook-event-refunded.d.cts.map +1 -0
- package/dist/actions/webhook-event-refunded.d.mts +9 -0
- package/dist/actions/webhook-event-refunded.d.mts.map +1 -0
- package/dist/actions/webhook-event-refunded.mjs +78 -0
- package/dist/actions/webhook-event-refunded.mjs.map +1 -0
- package/dist/actions/webhook-event-subscription-created.cjs +44 -0
- package/dist/actions/webhook-event-subscription-created.cjs.map +1 -0
- package/dist/actions/webhook-event-subscription-created.d.cts +9 -0
- package/dist/actions/webhook-event-subscription-created.d.cts.map +1 -0
- package/dist/actions/webhook-event-subscription-created.d.mts +9 -0
- package/dist/actions/webhook-event-subscription-created.d.mts.map +1 -0
- package/dist/actions/webhook-event-subscription-created.mjs +41 -0
- package/dist/actions/webhook-event-subscription-created.mjs.map +1 -0
- package/dist/actions/webhook-event-subscription-deleted.cjs +46 -0
- package/dist/actions/webhook-event-subscription-deleted.cjs.map +1 -0
- package/dist/actions/webhook-event-subscription-deleted.d.cts +9 -0
- package/dist/actions/webhook-event-subscription-deleted.d.cts.map +1 -0
- package/dist/actions/webhook-event-subscription-deleted.d.mts +9 -0
- package/dist/actions/webhook-event-subscription-deleted.d.mts.map +1 -0
- package/dist/actions/webhook-event-subscription-deleted.mjs +43 -0
- package/dist/actions/webhook-event-subscription-deleted.mjs.map +1 -0
- package/dist/app.cjs +9 -0
- package/dist/app.cjs.map +1 -0
- package/dist/app.d.cts +5 -0
- package/dist/app.d.cts.map +1 -0
- package/dist/app.d.mts +5 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +10 -0
- package/dist/app.mjs.map +1 -0
- package/dist/catalog.cjs +15 -0
- package/dist/catalog.cjs.map +1 -0
- package/dist/catalog.d.cts +14 -0
- package/dist/catalog.d.cts.map +1 -0
- package/dist/catalog.d.mts +14 -0
- package/dist/catalog.d.mts.map +1 -0
- package/dist/catalog.mjs +15 -0
- package/dist/catalog.mjs.map +1 -0
- package/dist/execute.cjs +18 -0
- package/dist/execute.cjs.map +1 -0
- package/dist/execute.mjs +18 -0
- package/dist/execute.mjs.map +1 -0
- package/dist/index.cjs +24 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +13 -0
- package/package.json +49 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { action } from "../action.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/actions/update-coupon.ts
|
|
4
|
+
const PayhipUpdateCouponInput = z.object({
|
|
5
|
+
id: z.string().describe("The unique identifier for the coupon."),
|
|
6
|
+
code: z.string().describe("The code for the coupon.").optional(),
|
|
7
|
+
limit: z.string().describe("The maximum limit for the coupon usage.").optional(),
|
|
8
|
+
expiry: z.string().describe("The expiry of the coupon in a timestamp format.").optional(),
|
|
9
|
+
percentage: z.string().describe("The percentage discount for the coupon.").optional(),
|
|
10
|
+
product_id: z.string().describe("The product ID if coupon is specific to a product.").optional()
|
|
11
|
+
}).describe("Request model for updating a Payhip coupon.");
|
|
12
|
+
const PayhipUpdateCoupon_CouponDataSchema = z.object({
|
|
13
|
+
code: z.string().describe("The coupon value.").nullable().optional(),
|
|
14
|
+
limit: z.number().describe("The number of times this coupon can be used.").nullable().optional(),
|
|
15
|
+
usage: z.string().describe("The number of times the coupon has been used.").nullable().optional(),
|
|
16
|
+
expiry: z.string().describe("The date of the order.").nullable().optional(),
|
|
17
|
+
coupon_id: z.string().describe("A unique identifier for a coupon.").nullable().optional(),
|
|
18
|
+
percentage: z.string().describe("The percentage discount.").nullable().optional(),
|
|
19
|
+
product_id: z.string().describe("The product id the coupon applies to. Null is returned if it applies to all products.").nullable().optional(),
|
|
20
|
+
product_name: z.string().describe("The product the coupon applies to. All is returned if it applies to all products.").nullable().optional()
|
|
21
|
+
}).describe("Coupon data returned in the response.");
|
|
22
|
+
const payhipUpdateCoupon = action("PAYHIP_UPDATE_COUPON", {
|
|
23
|
+
slug: "payhip-update-coupon",
|
|
24
|
+
name: "Update Coupon",
|
|
25
|
+
description: "Tool to edit an existing coupon in Payhip. Use when you need to modify coupon details like code, percentage, expiry, or usage limit. Only available in v1 API.",
|
|
26
|
+
input: PayhipUpdateCouponInput,
|
|
27
|
+
output: z.object({ items: z.array(PayhipUpdateCoupon_CouponDataSchema).describe("An array of coupons.").nullable().optional() }).describe("Response model for updating a Payhip coupon.")
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { payhipUpdateCoupon };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=update-coupon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-coupon.mjs","names":[],"sources":["../../src/actions/update-coupon.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipUpdateCouponInput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"The unique identifier for the coupon.\"),\n code: z.string().describe(\"The code for the coupon.\").optional(),\n limit: z.string().describe(\"The maximum limit for the coupon usage.\").optional(),\n expiry: z.string().describe(\"The expiry of the coupon in a timestamp format.\").optional(),\n percentage: z.string().describe(\"The percentage discount for the coupon.\").optional(),\n product_id: z.string().describe(\"The product ID if coupon is specific to a product.\").optional(),\n}).describe(\"Request model for updating a Payhip coupon.\");\nconst PayhipUpdateCoupon_CouponDataSchema: z.ZodTypeAny = z.object({\n code: z.string().describe(\"The coupon value.\").nullable().optional(),\n limit: z.number().describe(\"The number of times this coupon can be used.\").nullable().optional(),\n usage: z.string().describe(\"The number of times the coupon has been used.\").nullable().optional(),\n expiry: z.string().describe(\"The date of the order.\").nullable().optional(),\n coupon_id: z.string().describe(\"A unique identifier for a coupon.\").nullable().optional(),\n percentage: z.string().describe(\"The percentage discount.\").nullable().optional(),\n product_id: z.string().describe(\"The product id the coupon applies to. Null is returned if it applies to all products.\").nullable().optional(),\n product_name: z.string().describe(\"The product the coupon applies to. All is returned if it applies to all products.\").nullable().optional(),\n}).describe(\"Coupon data returned in the response.\");\nexport const PayhipUpdateCouponOutput: z.ZodTypeAny = z.object({\n items: z.array(PayhipUpdateCoupon_CouponDataSchema).describe(\"An array of coupons.\").nullable().optional(),\n}).describe(\"Response model for updating a Payhip coupon.\");\n\nexport const payhipUpdateCoupon = action(\"PAYHIP_UPDATE_COUPON\", {\n slug: \"payhip-update-coupon\",\n name: \"Update Coupon\",\n description: \"Tool to edit an existing coupon in Payhip. Use when you need to modify coupon details like code, percentage, expiry, or usage limit. Only available in v1 API.\",\n input: PayhipUpdateCouponInput,\n output: PayhipUpdateCouponOutput,\n});\n"],"mappings":";;;AAIA,MAAa,0BAAwC,EAAE,OAAO;CAC5D,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,uCAAuC;CAC/D,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B,CAAC,CAAC,SAAS;CAC/D,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,yCAAyC,CAAC,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C3G,CAAC,CAAC,CAAC,SAAS,8CAOF;AACV,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const require_action = require("../action.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/actions/verify-coupon.ts
|
|
4
|
+
const PayhipVerifyCouponInput = zod.z.object({ code: zod.z.string().describe("The coupon code to verify.") }).describe("Request model for verifying a Payhip coupon code.");
|
|
5
|
+
const PayhipVerifyCoupon_CouponDetailsSchema = zod.z.object({
|
|
6
|
+
id: zod.z.string().describe("A unique identifier for a coupon.").nullable().optional(),
|
|
7
|
+
code: zod.z.string().describe("The coupon code.").nullable().optional(),
|
|
8
|
+
type: zod.z.string().describe("The type of coupon (e.g., 'multi', 'single', 'collection').").nullable().optional(),
|
|
9
|
+
limit: zod.z.union([
|
|
10
|
+
zod.z.number().int(),
|
|
11
|
+
zod.z.number(),
|
|
12
|
+
zod.z.string()
|
|
13
|
+
]).nullable().optional(),
|
|
14
|
+
usage: zod.z.string().describe("The number of times the coupon has been used.").nullable().optional(),
|
|
15
|
+
expiry: zod.z.string().describe("The expiry date of the coupon.").nullable().optional(),
|
|
16
|
+
has_expiry: zod.z.boolean().describe("Whether the coupon has an expiry date.").nullable().optional(),
|
|
17
|
+
percentage: zod.z.union([
|
|
18
|
+
zod.z.number().int(),
|
|
19
|
+
zod.z.number(),
|
|
20
|
+
zod.z.string()
|
|
21
|
+
]).nullable().optional(),
|
|
22
|
+
product_id: zod.z.string().describe("The product id the coupon applies to. Null is returned if it applies to all products.").nullable().optional(),
|
|
23
|
+
product_name: zod.z.string().describe("The product the coupon applies to. All is returned if it applies to all products.").nullable().optional()
|
|
24
|
+
}).describe("Details of a verified coupon.");
|
|
25
|
+
const PayhipVerifyCouponOutput = zod.z.object({ coupons: zod.z.array(PayhipVerifyCoupon_CouponDetailsSchema).describe("An array of verified coupon details.") }).describe("Response model for verifying a Payhip coupon code.");
|
|
26
|
+
const payhipVerifyCoupon = require_action.action("PAYHIP_VERIFY_COUPON", {
|
|
27
|
+
slug: "payhip-verify-coupon",
|
|
28
|
+
name: "Verify Coupon",
|
|
29
|
+
description: "Tool to verify a Payhip coupon code. Use when you need to check if a coupon code is valid and retrieve its details. Only available in v1 API.",
|
|
30
|
+
input: PayhipVerifyCouponInput,
|
|
31
|
+
output: PayhipVerifyCouponOutput
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.payhipVerifyCoupon = payhipVerifyCoupon;
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=verify-coupon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-coupon.cjs","names":["z","action"],"sources":["../../src/actions/verify-coupon.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipVerifyCouponInput: z.ZodTypeAny = z.object({\n code: z.string().describe(\"The coupon code to verify.\"),\n}).describe(\"Request model for verifying a Payhip coupon code.\");\nconst PayhipVerifyCoupon_CouponDetailsSchema: z.ZodTypeAny = z.object({\n id: z.string().describe(\"A unique identifier for a coupon.\").nullable().optional(),\n code: z.string().describe(\"The coupon code.\").nullable().optional(),\n type: z.string().describe(\"The type of coupon (e.g., 'multi', 'single', 'collection').\").nullable().optional(),\n limit: z.union([z.number().int(), z.number(), z.string()]).nullable().optional(),\n usage: z.string().describe(\"The number of times the coupon has been used.\").nullable().optional(),\n expiry: z.string().describe(\"The expiry date of the coupon.\").nullable().optional(),\n has_expiry: z.boolean().describe(\"Whether the coupon has an expiry date.\").nullable().optional(),\n percentage: z.union([z.number().int(), z.number(), z.string()]).nullable().optional(),\n product_id: z.string().describe(\"The product id the coupon applies to. Null is returned if it applies to all products.\").nullable().optional(),\n product_name: z.string().describe(\"The product the coupon applies to. All is returned if it applies to all products.\").nullable().optional(),\n}).describe(\"Details of a verified coupon.\");\nexport const PayhipVerifyCouponOutput: z.ZodTypeAny = z.object({\n coupons: z.array(PayhipVerifyCoupon_CouponDetailsSchema).describe(\"An array of verified coupon details.\"),\n}).describe(\"Response model for verifying a Payhip coupon code.\");\n\nexport const payhipVerifyCoupon = action(\"PAYHIP_VERIFY_COUPON\", {\n slug: \"payhip-verify-coupon\",\n name: \"Verify Coupon\",\n description: \"Tool to verify a Payhip coupon code. Use when you need to check if a coupon code is valid and retrieve its details. Only available in v1 API.\",\n input: PayhipVerifyCouponInput,\n output: PayhipVerifyCouponOutput,\n});\n"],"mappings":";;;AAIA,MAAa,0BAAwCA,IAAAA,EAAE,OAAO,EAC5D,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B,EACxD,CAAC,CAAC,CAAC,SAAS,mDAAmD;AAC/D,MAAM,yCAAuDA,IAAAA,EAAE,OAAO;CACpE,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACjF,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7G,OAAOA,IAAAA,EAAE,MAAM;EAACA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI;EAAGA,IAAAA,EAAE,OAAO;EAAGA,IAAAA,EAAE,OAAO;CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC/E,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,+CAA+C,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAChG,QAAQA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,gCAAgC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClF,YAAYA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,wCAAwC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC/F,YAAYA,IAAAA,EAAE,MAAM;EAACA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI;EAAGA,IAAAA,EAAE,OAAO;EAAGA,IAAAA,EAAE,OAAO;CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACpF,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uFAAuF,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7I,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mFAAmF,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC7I,CAAC,CAAC,CAAC,SAAS,+BAA+B;AAC3C,MAAa,2BAAyCA,IAAAA,EAAE,OAAO,EAC7D,SAASA,IAAAA,EAAE,MAAM,sCAAsC,CAAC,CAAC,SAAS,sCAAsC,EAC1G,CAAC,CAAC,CAAC,SAAS,oDAAoD;AAEhE,MAAa,qBAAqBC,eAAAA,OAAO,wBAAwB;CAC/D,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/verify-coupon.d.ts
|
|
4
|
+
declare const PayhipVerifyCouponInput: z.ZodTypeAny;
|
|
5
|
+
declare const PayhipVerifyCouponOutput: z.ZodTypeAny;
|
|
6
|
+
declare const payhipVerifyCoupon: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { payhipVerifyCoupon };
|
|
9
|
+
//# sourceMappingURL=verify-coupon.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-coupon.d.cts","names":[],"sources":["../../src/actions/verify-coupon.ts"],"mappings":";;;cAIa,uBAAA,EAAyB,CAAA,CAAE,UAEwB;AAAA,cAanD,wBAAA,EAA0B,CAAA,CAAE,UAEwB;AAAA,cAEpD,kBAAA,gCAAkB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/verify-coupon.d.ts
|
|
4
|
+
declare const PayhipVerifyCouponInput: z.ZodTypeAny;
|
|
5
|
+
declare const PayhipVerifyCouponOutput: z.ZodTypeAny;
|
|
6
|
+
declare const payhipVerifyCoupon: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { payhipVerifyCoupon };
|
|
9
|
+
//# sourceMappingURL=verify-coupon.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-coupon.d.mts","names":[],"sources":["../../src/actions/verify-coupon.ts"],"mappings":";;;cAIa,uBAAA,EAAyB,CAAA,CAAE,UAEwB;AAAA,cAanD,wBAAA,EAA0B,CAAA,CAAE,UAEwB;AAAA,cAEpD,kBAAA,gCAAkB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { action } from "../action.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/actions/verify-coupon.ts
|
|
4
|
+
const PayhipVerifyCouponInput = z.object({ code: z.string().describe("The coupon code to verify.") }).describe("Request model for verifying a Payhip coupon code.");
|
|
5
|
+
const PayhipVerifyCoupon_CouponDetailsSchema = z.object({
|
|
6
|
+
id: z.string().describe("A unique identifier for a coupon.").nullable().optional(),
|
|
7
|
+
code: z.string().describe("The coupon code.").nullable().optional(),
|
|
8
|
+
type: z.string().describe("The type of coupon (e.g., 'multi', 'single', 'collection').").nullable().optional(),
|
|
9
|
+
limit: z.union([
|
|
10
|
+
z.number().int(),
|
|
11
|
+
z.number(),
|
|
12
|
+
z.string()
|
|
13
|
+
]).nullable().optional(),
|
|
14
|
+
usage: z.string().describe("The number of times the coupon has been used.").nullable().optional(),
|
|
15
|
+
expiry: z.string().describe("The expiry date of the coupon.").nullable().optional(),
|
|
16
|
+
has_expiry: z.boolean().describe("Whether the coupon has an expiry date.").nullable().optional(),
|
|
17
|
+
percentage: z.union([
|
|
18
|
+
z.number().int(),
|
|
19
|
+
z.number(),
|
|
20
|
+
z.string()
|
|
21
|
+
]).nullable().optional(),
|
|
22
|
+
product_id: z.string().describe("The product id the coupon applies to. Null is returned if it applies to all products.").nullable().optional(),
|
|
23
|
+
product_name: z.string().describe("The product the coupon applies to. All is returned if it applies to all products.").nullable().optional()
|
|
24
|
+
}).describe("Details of a verified coupon.");
|
|
25
|
+
const payhipVerifyCoupon = action("PAYHIP_VERIFY_COUPON", {
|
|
26
|
+
slug: "payhip-verify-coupon",
|
|
27
|
+
name: "Verify Coupon",
|
|
28
|
+
description: "Tool to verify a Payhip coupon code. Use when you need to check if a coupon code is valid and retrieve its details. Only available in v1 API.",
|
|
29
|
+
input: PayhipVerifyCouponInput,
|
|
30
|
+
output: z.object({ coupons: z.array(PayhipVerifyCoupon_CouponDetailsSchema).describe("An array of verified coupon details.") }).describe("Response model for verifying a Payhip coupon code.")
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { payhipVerifyCoupon };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=verify-coupon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-coupon.mjs","names":[],"sources":["../../src/actions/verify-coupon.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipVerifyCouponInput: z.ZodTypeAny = z.object({\n code: z.string().describe(\"The coupon code to verify.\"),\n}).describe(\"Request model for verifying a Payhip coupon code.\");\nconst PayhipVerifyCoupon_CouponDetailsSchema: z.ZodTypeAny = z.object({\n id: z.string().describe(\"A unique identifier for a coupon.\").nullable().optional(),\n code: z.string().describe(\"The coupon code.\").nullable().optional(),\n type: z.string().describe(\"The type of coupon (e.g., 'multi', 'single', 'collection').\").nullable().optional(),\n limit: z.union([z.number().int(), z.number(), z.string()]).nullable().optional(),\n usage: z.string().describe(\"The number of times the coupon has been used.\").nullable().optional(),\n expiry: z.string().describe(\"The expiry date of the coupon.\").nullable().optional(),\n has_expiry: z.boolean().describe(\"Whether the coupon has an expiry date.\").nullable().optional(),\n percentage: z.union([z.number().int(), z.number(), z.string()]).nullable().optional(),\n product_id: z.string().describe(\"The product id the coupon applies to. Null is returned if it applies to all products.\").nullable().optional(),\n product_name: z.string().describe(\"The product the coupon applies to. All is returned if it applies to all products.\").nullable().optional(),\n}).describe(\"Details of a verified coupon.\");\nexport const PayhipVerifyCouponOutput: z.ZodTypeAny = z.object({\n coupons: z.array(PayhipVerifyCoupon_CouponDetailsSchema).describe(\"An array of verified coupon details.\"),\n}).describe(\"Response model for verifying a Payhip coupon code.\");\n\nexport const payhipVerifyCoupon = action(\"PAYHIP_VERIFY_COUPON\", {\n slug: \"payhip-verify-coupon\",\n name: \"Verify Coupon\",\n description: \"Tool to verify a Payhip coupon code. Use when you need to check if a coupon code is valid and retrieve its details. Only available in v1 API.\",\n input: PayhipVerifyCouponInput,\n output: PayhipVerifyCouponOutput,\n});\n"],"mappings":";;;AAIA,MAAa,0BAAwC,EAAE,OAAO,EAC5D,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,4BAA4B,EACxD,CAAC,CAAC,CAAC,SAAS,mDAAmD;AAC/D,MAAM,yCAAuD,EAAE,OAAO;CACpE,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACjF,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,kBAAkB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,6DAA6D,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7G,OAAO,EAAE,MAAM;EAAC,EAAE,OAAO,CAAC,CAAC,IAAI;EAAG,EAAE,OAAO;EAAG,EAAE,OAAO;CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC/E,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,+CAA+C,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAChG,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS,gCAAgC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAClF,YAAY,EAAE,QAAQ,CAAC,CAAC,SAAS,wCAAwC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC/F,YAAY,EAAE,MAAM;EAAC,EAAE,OAAO,CAAC,CAAC,IAAI;EAAG,EAAE,OAAO;EAAG,EAAE,OAAO;CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CACpF,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS,uFAAuF,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;CAC7I,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,mFAAmF,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;AAC7I,CAAC,CAAC,CAAC,SAAS,+BAA+B;AAK3C,MAAa,qBAAqB,OAAO,wBAAwB;CAC/D,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAToD,EAAE,OAAO,EAC7D,SAAS,EAAE,MAAM,sCAAsC,CAAC,CAAC,SAAS,sCAAsC,EAC1G,CAAC,CAAC,CAAC,SAAS,oDAOF;AACV,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const require_action = require("../action.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/actions/webhook-event-paid.ts
|
|
4
|
+
const PayhipWebhookEventPaidInput = zod.z.object({
|
|
5
|
+
id: zod.z.string().describe("Unique ID of the transaction"),
|
|
6
|
+
date: zod.z.number().int().describe("Unix timestamp when purchase occurred"),
|
|
7
|
+
type: zod.z.string().describe("Event type identifier"),
|
|
8
|
+
email: zod.z.string().nullable(),
|
|
9
|
+
items: zod.z.array(zod.z.object({
|
|
10
|
+
on_sale: zod.z.boolean().describe("Whether the product was on sale"),
|
|
11
|
+
quantity: zod.z.number().int().describe("Quantity purchased"),
|
|
12
|
+
product_id: zod.z.string().describe("ID of the product"),
|
|
13
|
+
has_variant: zod.z.boolean().describe("Whether the product has variants"),
|
|
14
|
+
product_key: zod.z.string().describe("Link key for the product"),
|
|
15
|
+
used_coupon: zod.z.boolean().describe("Whether a coupon was used"),
|
|
16
|
+
product_name: zod.z.string().describe("Name of the product"),
|
|
17
|
+
product_permalink: zod.z.string().nullable(),
|
|
18
|
+
used_social_discount: zod.z.boolean().describe("Whether a social discount was used"),
|
|
19
|
+
promoted_by_affiliate: zod.z.boolean().describe("Whether an affiliate promotion was applied"),
|
|
20
|
+
used_upgrade_discount: zod.z.boolean().describe("Whether an upgrade discount was used"),
|
|
21
|
+
used_cross_sell_discount: zod.z.boolean().describe("Whether a cross-sell discount was used")
|
|
22
|
+
})).describe("List of items in the order"),
|
|
23
|
+
price: zod.z.number().int().describe("Total price in cents"),
|
|
24
|
+
is_gift: zod.z.boolean().describe("Whether the purchase was a gift"),
|
|
25
|
+
currency: zod.z.string().describe("Three-letter currency code"),
|
|
26
|
+
signature: zod.z.string().describe("HMAC SHA-256 signature of the payload using your API key"),
|
|
27
|
+
ip_address: zod.z.string().nullable(),
|
|
28
|
+
payhip_fee: zod.z.number().int().describe("Payhip fee in cents"),
|
|
29
|
+
stripe_fee: zod.z.number().int().describe("Stripe fee in cents"),
|
|
30
|
+
vat_applied: zod.z.boolean().describe("Whether VAT was applied to the purchase"),
|
|
31
|
+
payment_type: zod.z.enum(["card", "paypal"]).describe("Payment method used"),
|
|
32
|
+
unconsented_from_emails: zod.z.boolean().describe("Whether customer has opted out of emails")
|
|
33
|
+
}).describe("Request model for Payhip 'paid' webhook event.");
|
|
34
|
+
const PayhipWebhookEventPaid_PayhipWebhookItemSchema = zod.z.object({
|
|
35
|
+
on_sale: zod.z.boolean().describe("Whether the product was on sale"),
|
|
36
|
+
quantity: zod.z.number().int().describe("Quantity purchased"),
|
|
37
|
+
product_id: zod.z.string().describe("ID of the product"),
|
|
38
|
+
has_variant: zod.z.boolean().describe("Whether the product has variants"),
|
|
39
|
+
product_key: zod.z.string().describe("Link key for the product"),
|
|
40
|
+
used_coupon: zod.z.boolean().describe("Whether a coupon was used"),
|
|
41
|
+
product_name: zod.z.string().describe("Name of the product"),
|
|
42
|
+
product_permalink: zod.z.string().nullable(),
|
|
43
|
+
used_social_discount: zod.z.boolean().describe("Whether a social discount was used"),
|
|
44
|
+
promoted_by_affiliate: zod.z.boolean().describe("Whether an affiliate promotion was applied"),
|
|
45
|
+
used_upgrade_discount: zod.z.boolean().describe("Whether an upgrade discount was used"),
|
|
46
|
+
used_cross_sell_discount: zod.z.boolean().describe("Whether a cross-sell discount was used")
|
|
47
|
+
});
|
|
48
|
+
const PayhipWebhookEventPaidOutput = zod.z.object({
|
|
49
|
+
id: zod.z.string(),
|
|
50
|
+
date: zod.z.number().int(),
|
|
51
|
+
type: zod.z.string(),
|
|
52
|
+
email: zod.z.string(),
|
|
53
|
+
items: zod.z.array(PayhipWebhookEventPaid_PayhipWebhookItemSchema),
|
|
54
|
+
price: zod.z.number().int(),
|
|
55
|
+
is_gift: zod.z.boolean(),
|
|
56
|
+
currency: zod.z.string(),
|
|
57
|
+
signature: zod.z.string(),
|
|
58
|
+
ip_address: zod.z.string(),
|
|
59
|
+
payhip_fee: zod.z.number().int(),
|
|
60
|
+
stripe_fee: zod.z.number().int(),
|
|
61
|
+
vat_applied: zod.z.boolean(),
|
|
62
|
+
payment_type: zod.z.enum(["card", "paypal"]),
|
|
63
|
+
unconsented_from_emails: zod.z.boolean()
|
|
64
|
+
}).describe("Response model for Payhip 'paid' webhook event.");
|
|
65
|
+
const payhipWebhookEventPaid = require_action.action("PAYHIP_WEBHOOK_EVENT_PAID", {
|
|
66
|
+
slug: "payhip-webhook-event-paid",
|
|
67
|
+
name: "Webhook Event - Paid",
|
|
68
|
+
description: "Tool to process Payhip's paid webhook event. Use when handling a purchase completion webhook from Payhip.",
|
|
69
|
+
input: PayhipWebhookEventPaidInput,
|
|
70
|
+
output: PayhipWebhookEventPaidOutput
|
|
71
|
+
});
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.payhipWebhookEventPaid = payhipWebhookEventPaid;
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=webhook-event-paid.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-paid.cjs","names":["z","action"],"sources":["../../src/actions/webhook-event-paid.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipWebhookEventPaidInput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique ID of the transaction\"),\n date: z.number().int().describe(\"Unix timestamp when purchase occurred\"),\n type: z.string().describe(\"Event type identifier\"),\n email: z.string().nullable(),\n items: z.array(z.object({\n on_sale: z.boolean().describe(\"Whether the product was on sale\"),\n quantity: z.number().int().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"ID of the product\"),\n has_variant: z.boolean().describe(\"Whether the product has variants\"),\n product_key: z.string().describe(\"Link key for the product\"),\n used_coupon: z.boolean().describe(\"Whether a coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().nullable(),\n used_social_discount: z.boolean().describe(\"Whether a social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether an affiliate promotion was applied\"),\n used_upgrade_discount: z.boolean().describe(\"Whether an upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether a cross-sell discount was used\"),\n})).describe(\"List of items in the order\"),\n price: z.number().int().describe(\"Total price in cents\"),\n is_gift: z.boolean().describe(\"Whether the purchase was a gift\"),\n currency: z.string().describe(\"Three-letter currency code\"),\n signature: z.string().describe(\"HMAC SHA-256 signature of the payload using your API key\"),\n ip_address: z.string().nullable(),\n payhip_fee: z.number().int().describe(\"Payhip fee in cents\"),\n stripe_fee: z.number().int().describe(\"Stripe fee in cents\"),\n vat_applied: z.boolean().describe(\"Whether VAT was applied to the purchase\"),\n payment_type: z.enum([\"card\", \"paypal\"]).describe(\"Payment method used\"),\n unconsented_from_emails: z.boolean().describe(\"Whether customer has opted out of emails\"),\n}).describe(\"Request model for Payhip 'paid' webhook event.\");\nconst PayhipWebhookEventPaid_PayhipWebhookItemSchema: z.ZodTypeAny = z.object({\n on_sale: z.boolean().describe(\"Whether the product was on sale\"),\n quantity: z.number().int().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"ID of the product\"),\n has_variant: z.boolean().describe(\"Whether the product has variants\"),\n product_key: z.string().describe(\"Link key for the product\"),\n used_coupon: z.boolean().describe(\"Whether a coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().nullable(),\n used_social_discount: z.boolean().describe(\"Whether a social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether an affiliate promotion was applied\"),\n used_upgrade_discount: z.boolean().describe(\"Whether an upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether a cross-sell discount was used\"),\n});\nexport const PayhipWebhookEventPaidOutput: z.ZodTypeAny = z.object({\n id: z.string(),\n date: z.number().int(),\n type: z.string(),\n email: z.string(),\n items: z.array(PayhipWebhookEventPaid_PayhipWebhookItemSchema),\n price: z.number().int(),\n is_gift: z.boolean(),\n currency: z.string(),\n signature: z.string(),\n ip_address: z.string(),\n payhip_fee: z.number().int(),\n stripe_fee: z.number().int(),\n vat_applied: z.boolean(),\n payment_type: z.enum([\"card\", \"paypal\"]),\n unconsented_from_emails: z.boolean(),\n}).describe(\"Response model for Payhip 'paid' webhook event.\");\n\nexport const payhipWebhookEventPaid = action(\"PAYHIP_WEBHOOK_EVENT_PAID\", {\n slug: \"payhip-webhook-event-paid\",\n name: \"Webhook Event - Paid\",\n description: \"Tool to process Payhip's paid webhook event. Use when handling a purchase completion webhook from Payhip.\",\n input: PayhipWebhookEventPaidInput,\n output: PayhipWebhookEventPaidOutput,\n});\n"],"mappings":";;;AAIA,MAAa,8BAA4CA,IAAAA,EAAE,OAAO;CAChE,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,8BAA8B;CACtD,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,uCAAuC;CACvE,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;CACjD,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,OAAOA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO;EACxB,SAASA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,iCAAiC;EAC/D,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,oBAAoB;EACxD,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mBAAmB;EACnD,aAAaA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,kCAAkC;EACpE,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B;EAC3D,aAAaA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,2BAA2B;EAC7D,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qBAAqB;EACvD,mBAAmBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS;EACvC,sBAAsBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,oCAAoC;EAC/E,uBAAuBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,4CAA4C;EACxF,uBAAuBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,sCAAs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|
2
|
+
|
|
3
|
+
//#region src/actions/webhook-event-paid.d.ts
|
|
4
|
+
declare const PayhipWebhookEventPaidInput: z.ZodTypeAny;
|
|
5
|
+
declare const PayhipWebhookEventPaidOutput: z.ZodTypeAny;
|
|
6
|
+
declare const payhipWebhookEventPaid: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { payhipWebhookEventPaid };
|
|
9
|
+
//# sourceMappingURL=webhook-event-paid.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-paid.d.cts","names":[],"sources":["../../src/actions/webhook-event-paid.ts"],"mappings":";;;cAIa,2BAAA,EAA6B,CAAA,CAAE,UA6BiB;AAAA,cAehD,4BAAA,EAA8B,CAAA,CAAE,UAgBiB;AAAA,cAEjD,sBAAA,gCAAsB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/webhook-event-paid.d.ts
|
|
4
|
+
declare const PayhipWebhookEventPaidInput: z.ZodTypeAny;
|
|
5
|
+
declare const PayhipWebhookEventPaidOutput: z.ZodTypeAny;
|
|
6
|
+
declare const payhipWebhookEventPaid: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { payhipWebhookEventPaid };
|
|
9
|
+
//# sourceMappingURL=webhook-event-paid.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-paid.d.mts","names":[],"sources":["../../src/actions/webhook-event-paid.ts"],"mappings":";;;cAIa,2BAAA,EAA6B,CAAA,CAAE,UA6BiB;AAAA,cAehD,4BAAA,EAA8B,CAAA,CAAE,UAgBiB;AAAA,cAEjD,sBAAA,gCAAsB,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { action } from "../action.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/actions/webhook-event-paid.ts
|
|
4
|
+
const PayhipWebhookEventPaidInput = z.object({
|
|
5
|
+
id: z.string().describe("Unique ID of the transaction"),
|
|
6
|
+
date: z.number().int().describe("Unix timestamp when purchase occurred"),
|
|
7
|
+
type: z.string().describe("Event type identifier"),
|
|
8
|
+
email: z.string().nullable(),
|
|
9
|
+
items: z.array(z.object({
|
|
10
|
+
on_sale: z.boolean().describe("Whether the product was on sale"),
|
|
11
|
+
quantity: z.number().int().describe("Quantity purchased"),
|
|
12
|
+
product_id: z.string().describe("ID of the product"),
|
|
13
|
+
has_variant: z.boolean().describe("Whether the product has variants"),
|
|
14
|
+
product_key: z.string().describe("Link key for the product"),
|
|
15
|
+
used_coupon: z.boolean().describe("Whether a coupon was used"),
|
|
16
|
+
product_name: z.string().describe("Name of the product"),
|
|
17
|
+
product_permalink: z.string().nullable(),
|
|
18
|
+
used_social_discount: z.boolean().describe("Whether a social discount was used"),
|
|
19
|
+
promoted_by_affiliate: z.boolean().describe("Whether an affiliate promotion was applied"),
|
|
20
|
+
used_upgrade_discount: z.boolean().describe("Whether an upgrade discount was used"),
|
|
21
|
+
used_cross_sell_discount: z.boolean().describe("Whether a cross-sell discount was used")
|
|
22
|
+
})).describe("List of items in the order"),
|
|
23
|
+
price: z.number().int().describe("Total price in cents"),
|
|
24
|
+
is_gift: z.boolean().describe("Whether the purchase was a gift"),
|
|
25
|
+
currency: z.string().describe("Three-letter currency code"),
|
|
26
|
+
signature: z.string().describe("HMAC SHA-256 signature of the payload using your API key"),
|
|
27
|
+
ip_address: z.string().nullable(),
|
|
28
|
+
payhip_fee: z.number().int().describe("Payhip fee in cents"),
|
|
29
|
+
stripe_fee: z.number().int().describe("Stripe fee in cents"),
|
|
30
|
+
vat_applied: z.boolean().describe("Whether VAT was applied to the purchase"),
|
|
31
|
+
payment_type: z.enum(["card", "paypal"]).describe("Payment method used"),
|
|
32
|
+
unconsented_from_emails: z.boolean().describe("Whether customer has opted out of emails")
|
|
33
|
+
}).describe("Request model for Payhip 'paid' webhook event.");
|
|
34
|
+
const PayhipWebhookEventPaid_PayhipWebhookItemSchema = z.object({
|
|
35
|
+
on_sale: z.boolean().describe("Whether the product was on sale"),
|
|
36
|
+
quantity: z.number().int().describe("Quantity purchased"),
|
|
37
|
+
product_id: z.string().describe("ID of the product"),
|
|
38
|
+
has_variant: z.boolean().describe("Whether the product has variants"),
|
|
39
|
+
product_key: z.string().describe("Link key for the product"),
|
|
40
|
+
used_coupon: z.boolean().describe("Whether a coupon was used"),
|
|
41
|
+
product_name: z.string().describe("Name of the product"),
|
|
42
|
+
product_permalink: z.string().nullable(),
|
|
43
|
+
used_social_discount: z.boolean().describe("Whether a social discount was used"),
|
|
44
|
+
promoted_by_affiliate: z.boolean().describe("Whether an affiliate promotion was applied"),
|
|
45
|
+
used_upgrade_discount: z.boolean().describe("Whether an upgrade discount was used"),
|
|
46
|
+
used_cross_sell_discount: z.boolean().describe("Whether a cross-sell discount was used")
|
|
47
|
+
});
|
|
48
|
+
const payhipWebhookEventPaid = action("PAYHIP_WEBHOOK_EVENT_PAID", {
|
|
49
|
+
slug: "payhip-webhook-event-paid",
|
|
50
|
+
name: "Webhook Event - Paid",
|
|
51
|
+
description: "Tool to process Payhip's paid webhook event. Use when handling a purchase completion webhook from Payhip.",
|
|
52
|
+
input: PayhipWebhookEventPaidInput,
|
|
53
|
+
output: z.object({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
date: z.number().int(),
|
|
56
|
+
type: z.string(),
|
|
57
|
+
email: z.string(),
|
|
58
|
+
items: z.array(PayhipWebhookEventPaid_PayhipWebhookItemSchema),
|
|
59
|
+
price: z.number().int(),
|
|
60
|
+
is_gift: z.boolean(),
|
|
61
|
+
currency: z.string(),
|
|
62
|
+
signature: z.string(),
|
|
63
|
+
ip_address: z.string(),
|
|
64
|
+
payhip_fee: z.number().int(),
|
|
65
|
+
stripe_fee: z.number().int(),
|
|
66
|
+
vat_applied: z.boolean(),
|
|
67
|
+
payment_type: z.enum(["card", "paypal"]),
|
|
68
|
+
unconsented_from_emails: z.boolean()
|
|
69
|
+
}).describe("Response model for Payhip 'paid' webhook event.")
|
|
70
|
+
});
|
|
71
|
+
//#endregion
|
|
72
|
+
export { payhipWebhookEventPaid };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=webhook-event-paid.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-paid.mjs","names":[],"sources":["../../src/actions/webhook-event-paid.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipWebhookEventPaidInput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Unique ID of the transaction\"),\n date: z.number().int().describe(\"Unix timestamp when purchase occurred\"),\n type: z.string().describe(\"Event type identifier\"),\n email: z.string().nullable(),\n items: z.array(z.object({\n on_sale: z.boolean().describe(\"Whether the product was on sale\"),\n quantity: z.number().int().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"ID of the product\"),\n has_variant: z.boolean().describe(\"Whether the product has variants\"),\n product_key: z.string().describe(\"Link key for the product\"),\n used_coupon: z.boolean().describe(\"Whether a coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().nullable(),\n used_social_discount: z.boolean().describe(\"Whether a social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether an affiliate promotion was applied\"),\n used_upgrade_discount: z.boolean().describe(\"Whether an upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether a cross-sell discount was used\"),\n})).describe(\"List of items in the order\"),\n price: z.number().int().describe(\"Total price in cents\"),\n is_gift: z.boolean().describe(\"Whether the purchase was a gift\"),\n currency: z.string().describe(\"Three-letter currency code\"),\n signature: z.string().describe(\"HMAC SHA-256 signature of the payload using your API key\"),\n ip_address: z.string().nullable(),\n payhip_fee: z.number().int().describe(\"Payhip fee in cents\"),\n stripe_fee: z.number().int().describe(\"Stripe fee in cents\"),\n vat_applied: z.boolean().describe(\"Whether VAT was applied to the purchase\"),\n payment_type: z.enum([\"card\", \"paypal\"]).describe(\"Payment method used\"),\n unconsented_from_emails: z.boolean().describe(\"Whether customer has opted out of emails\"),\n}).describe(\"Request model for Payhip 'paid' webhook event.\");\nconst PayhipWebhookEventPaid_PayhipWebhookItemSchema: z.ZodTypeAny = z.object({\n on_sale: z.boolean().describe(\"Whether the product was on sale\"),\n quantity: z.number().int().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"ID of the product\"),\n has_variant: z.boolean().describe(\"Whether the product has variants\"),\n product_key: z.string().describe(\"Link key for the product\"),\n used_coupon: z.boolean().describe(\"Whether a coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().nullable(),\n used_social_discount: z.boolean().describe(\"Whether a social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether an affiliate promotion was applied\"),\n used_upgrade_discount: z.boolean().describe(\"Whether an upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether a cross-sell discount was used\"),\n});\nexport const PayhipWebhookEventPaidOutput: z.ZodTypeAny = z.object({\n id: z.string(),\n date: z.number().int(),\n type: z.string(),\n email: z.string(),\n items: z.array(PayhipWebhookEventPaid_PayhipWebhookItemSchema),\n price: z.number().int(),\n is_gift: z.boolean(),\n currency: z.string(),\n signature: z.string(),\n ip_address: z.string(),\n payhip_fee: z.number().int(),\n stripe_fee: z.number().int(),\n vat_applied: z.boolean(),\n payment_type: z.enum([\"card\", \"paypal\"]),\n unconsented_from_emails: z.boolean(),\n}).describe(\"Response model for Payhip 'paid' webhook event.\");\n\nexport const payhipWebhookEventPaid = action(\"PAYHIP_WEBHOOK_EVENT_PAID\", {\n slug: \"payhip-webhook-event-paid\",\n name: \"Webhook Event - Paid\",\n description: \"Tool to process Payhip's paid webhook event. Use when handling a purchase completion webhook from Payhip.\",\n input: PayhipWebhookEventPaidInput,\n output: PayhipWebhookEventPaidOutput,\n});\n"],"mappings":";;;AAIA,MAAa,8BAA4C,EAAE,OAAO;CAChE,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,8BAA8B;CACtD,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,uCAAuC;CACvE,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;CACjD,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,OAAO,EAAE,MAAM,EAAE,OAAO;EACxB,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS,iCAAiC;EAC/D,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,oBAAoB;EACxD,YAAY,EAAE,OAAO,CAAC,CAAC,SAAS,mBAAmB;EACnD,aAAa,EAAE,QAAQ,CAAC,CAAC,SAAS,kCAAkC;EACpE,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS,0BAA0B;EAC3D,aAAa,EAAE,QAAQ,CAAC,CAAC,SAAS,2BAA2B;EAC7D,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,qBAAqB;EACvD,mBAAmB,EAAE,OAAO,CAAC,CAAC,SAAS;EACvC,sBAAsB,EAAE,QAAQ,CAAC,CAAC,SAAS,oCAAoC;EAC/E,uBAAuB,EAAE,QAAQ,CAAC,CAAC,SAAS,4CAA4C;EACxF,uBAAuB,EAAE,QAAQ,CAAC,CAAC,SAAS,sCAAsC;EAClF,0BAA0B,EAAE,QAAQ,CAAC,CAAC,SAAS,wCAAwC;CACzF,CAAC,CAAC,CAAC,CAAC,SAAS,4BAA4B;CACvC,OAAO,EAAE,O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CAClF,0BAA0B,EAAE,QAAQ,CAAC,CAAC,SAAS,wCAAwC;AACzF,CAAC;AAmBD,MAAa,yBAAyB,OAAO,6BAA6B;CACxE,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAvBwD,EAAE,OAAO;EACjE,IAAI,EAAE,OAAO;EACb,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI;EACrB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,OAAO;EAChB,OAAO,EAAE,MAAM,8CAA8C;EAC7D,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI;EACtB,SAAS,EAAE,QAAQ;EACnB,UAAU,EAAE,OAAO;EACnB,WAAW,EAAE,OAAO;EACpB,YAAY,EAAE,OAAO;EACrB,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI;EAC3B,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI;EAC3B,aAAa,EAAE,QAAQ;EACvB,cAAc,EAAE,KAAK,CAAC,QAAQ,QAAQ,CAAC;EACvC,yBAAyB,EAAE,QAAQ;CACrC,CAAC,CAAC,CAAC,SAAS,iDAOF;AACV,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const require_action = require("../action.cjs");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/actions/webhook-event-refunded.ts
|
|
4
|
+
const PayhipWebhookEventRefundedInput = zod.z.object({
|
|
5
|
+
id: zod.z.string().describe("Transaction ID"),
|
|
6
|
+
type: zod.z.string().describe("Event type identifier"),
|
|
7
|
+
email: zod.z.string().describe("Buyer email address"),
|
|
8
|
+
items: zod.z.array(zod.z.object({
|
|
9
|
+
on_sale: zod.z.boolean().describe("Whether product was on sale"),
|
|
10
|
+
quantity: zod.z.string().describe("Quantity purchased"),
|
|
11
|
+
product_id: zod.z.string().describe("Unique identifier for the product"),
|
|
12
|
+
has_variant: zod.z.boolean().describe("Whether product has a variant"),
|
|
13
|
+
product_key: zod.z.string().describe("Product key"),
|
|
14
|
+
used_coupon: zod.z.boolean().describe("Whether coupon was used"),
|
|
15
|
+
product_name: zod.z.string().describe("Name of the product"),
|
|
16
|
+
product_permalink: zod.z.string().describe("Product permalink URL"),
|
|
17
|
+
used_social_discount: zod.z.boolean().describe("Whether social discount was used"),
|
|
18
|
+
promoted_by_affiliate: zod.z.boolean().describe("Whether purchase was promoted by an affiliate"),
|
|
19
|
+
used_upgrade_discount: zod.z.boolean().describe("Whether upgrade discount was used"),
|
|
20
|
+
used_cross_sell_discount: zod.z.boolean().describe("Whether cross-sell discount was used")
|
|
21
|
+
}).describe("Details of an item in the refunded event")).describe("List of items included in the transaction"),
|
|
22
|
+
price: zod.z.number().int().describe("Original price in cents or pennies"),
|
|
23
|
+
is_gift: zod.z.boolean().describe("Whether purchase was a gift"),
|
|
24
|
+
currency: zod.z.string().describe("ISO 4217 currency code, e.g., USD"),
|
|
25
|
+
signature: zod.z.string().describe("HMAC SHA-256 signature of the payload using your API key"),
|
|
26
|
+
ip_address: zod.z.string().describe("IP address of the buyer"),
|
|
27
|
+
payhip_fee: zod.z.number().int().describe("Payhip fee in cents"),
|
|
28
|
+
stripe_fee: zod.z.number().int().describe("Stripe fee in cents"),
|
|
29
|
+
vat_applied: zod.z.boolean().describe("Whether VAT was applied"),
|
|
30
|
+
date_created: zod.z.number().int().describe("Unix timestamp when transaction was created"),
|
|
31
|
+
payment_type: zod.z.string().describe("Payment method used, e.g., card"),
|
|
32
|
+
date_refunded: zod.z.number().int().describe("Unix timestamp when refund occurred"),
|
|
33
|
+
amount_refunded: zod.z.number().int().describe("Amount refunded in cents or pennies"),
|
|
34
|
+
unconsented_from_emails: zod.z.boolean().describe("Whether buyer did not consent to marketing emails")
|
|
35
|
+
}).describe("Request model for Payhip refunded webhook event.");
|
|
36
|
+
const PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema = zod.z.object({
|
|
37
|
+
on_sale: zod.z.boolean().describe("Whether product was on sale"),
|
|
38
|
+
quantity: zod.z.string().describe("Quantity purchased"),
|
|
39
|
+
product_id: zod.z.string().describe("Unique identifier for the product"),
|
|
40
|
+
has_variant: zod.z.boolean().describe("Whether product has a variant"),
|
|
41
|
+
product_key: zod.z.string().describe("Product key"),
|
|
42
|
+
used_coupon: zod.z.boolean().describe("Whether coupon was used"),
|
|
43
|
+
product_name: zod.z.string().describe("Name of the product"),
|
|
44
|
+
product_permalink: zod.z.string().describe("Product permalink URL"),
|
|
45
|
+
used_social_discount: zod.z.boolean().describe("Whether social discount was used"),
|
|
46
|
+
promoted_by_affiliate: zod.z.boolean().describe("Whether purchase was promoted by an affiliate"),
|
|
47
|
+
used_upgrade_discount: zod.z.boolean().describe("Whether upgrade discount was used"),
|
|
48
|
+
used_cross_sell_discount: zod.z.boolean().describe("Whether cross-sell discount was used")
|
|
49
|
+
}).describe("Details of an item in the refunded event");
|
|
50
|
+
const PayhipWebhookEventRefundedOutput = zod.z.object({
|
|
51
|
+
id: zod.z.string(),
|
|
52
|
+
type: zod.z.string(),
|
|
53
|
+
email: zod.z.string(),
|
|
54
|
+
items: zod.z.array(PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema),
|
|
55
|
+
price: zod.z.number().int(),
|
|
56
|
+
is_gift: zod.z.boolean(),
|
|
57
|
+
currency: zod.z.string(),
|
|
58
|
+
signature: zod.z.string(),
|
|
59
|
+
ip_address: zod.z.string(),
|
|
60
|
+
payhip_fee: zod.z.number().int(),
|
|
61
|
+
stripe_fee: zod.z.number().int(),
|
|
62
|
+
vat_applied: zod.z.boolean(),
|
|
63
|
+
date_created: zod.z.number().int(),
|
|
64
|
+
payment_type: zod.z.string(),
|
|
65
|
+
date_refunded: zod.z.number().int(),
|
|
66
|
+
amount_refunded: zod.z.number().int(),
|
|
67
|
+
unconsented_from_emails: zod.z.boolean()
|
|
68
|
+
}).describe("Response model for Payhip refunded webhook event.");
|
|
69
|
+
const payhipWebhookEventRefunded = require_action.action("PAYHIP_WEBHOOK_EVENT_REFUNDED", {
|
|
70
|
+
slug: "payhip-webhook-event-refunded",
|
|
71
|
+
name: "Webhook Event - Refunded Payment",
|
|
72
|
+
description: "Tool to process Payhip's refunded webhook event. Use when handling a payment refund event from Payhip.",
|
|
73
|
+
input: PayhipWebhookEventRefundedInput,
|
|
74
|
+
output: PayhipWebhookEventRefundedOutput
|
|
75
|
+
});
|
|
76
|
+
//#endregion
|
|
77
|
+
exports.payhipWebhookEventRefunded = payhipWebhookEventRefunded;
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=webhook-event-refunded.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-refunded.cjs","names":["z","action"],"sources":["../../src/actions/webhook-event-refunded.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipWebhookEventRefundedInput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Transaction ID\"),\n type: z.string().describe(\"Event type identifier\"),\n email: z.string().describe(\"Buyer email address\"),\n items: z.array(z.object({\n on_sale: z.boolean().describe(\"Whether product was on sale\"),\n quantity: z.string().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"Unique identifier for the product\"),\n has_variant: z.boolean().describe(\"Whether product has a variant\"),\n product_key: z.string().describe(\"Product key\"),\n used_coupon: z.boolean().describe(\"Whether coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().describe(\"Product permalink URL\"),\n used_social_discount: z.boolean().describe(\"Whether social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether purchase was promoted by an affiliate\"),\n used_upgrade_discount: z.boolean().describe(\"Whether upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether cross-sell discount was used\"),\n}).describe(\"Details of an item in the refunded event\")).describe(\"List of items included in the transaction\"),\n price: z.number().int().describe(\"Original price in cents or pennies\"),\n is_gift: z.boolean().describe(\"Whether purchase was a gift\"),\n currency: z.string().describe(\"ISO 4217 currency code, e.g., USD\"),\n signature: z.string().describe(\"HMAC SHA-256 signature of the payload using your API key\"),\n ip_address: z.string().describe(\"IP address of the buyer\"),\n payhip_fee: z.number().int().describe(\"Payhip fee in cents\"),\n stripe_fee: z.number().int().describe(\"Stripe fee in cents\"),\n vat_applied: z.boolean().describe(\"Whether VAT was applied\"),\n date_created: z.number().int().describe(\"Unix timestamp when transaction was created\"),\n payment_type: z.string().describe(\"Payment method used, e.g., card\"),\n date_refunded: z.number().int().describe(\"Unix timestamp when refund occurred\"),\n amount_refunded: z.number().int().describe(\"Amount refunded in cents or pennies\"),\n unconsented_from_emails: z.boolean().describe(\"Whether buyer did not consent to marketing emails\"),\n}).describe(\"Request model for Payhip refunded webhook event.\");\nconst PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema: z.ZodTypeAny = z.object({\n on_sale: z.boolean().describe(\"Whether product was on sale\"),\n quantity: z.string().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"Unique identifier for the product\"),\n has_variant: z.boolean().describe(\"Whether product has a variant\"),\n product_key: z.string().describe(\"Product key\"),\n used_coupon: z.boolean().describe(\"Whether coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().describe(\"Product permalink URL\"),\n used_social_discount: z.boolean().describe(\"Whether social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether purchase was promoted by an affiliate\"),\n used_upgrade_discount: z.boolean().describe(\"Whether upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether cross-sell discount was used\"),\n}).describe(\"Details of an item in the refunded event\");\nexport const PayhipWebhookEventRefundedOutput: z.ZodTypeAny = z.object({\n id: z.string(),\n type: z.string(),\n email: z.string(),\n items: z.array(PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema),\n price: z.number().int(),\n is_gift: z.boolean(),\n currency: z.string(),\n signature: z.string(),\n ip_address: z.string(),\n payhip_fee: z.number().int(),\n stripe_fee: z.number().int(),\n vat_applied: z.boolean(),\n date_created: z.number().int(),\n payment_type: z.string(),\n date_refunded: z.number().int(),\n amount_refunded: z.number().int(),\n unconsented_from_emails: z.boolean(),\n}).describe(\"Response model for Payhip refunded webhook event.\");\n\nexport const payhipWebhookEventRefunded = action(\"PAYHIP_WEBHOOK_EVENT_REFUNDED\", {\n slug: \"payhip-webhook-event-refunded\",\n name: \"Webhook Event - Refunded Payment\",\n description: \"Tool to process Payhip's refunded webhook event. Use when handling a payment refund event from Payhip.\",\n input: PayhipWebhookEventRefundedInput,\n output: PayhipWebhookEventRefundedOutput,\n});\n"],"mappings":";;;AAIA,MAAa,kCAAgDA,IAAAA,EAAE,OAAO;CACpE,IAAIA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,gBAAgB;CACxC,MAAMA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;CACjD,OAAOA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qBAAqB;CAChD,OAAOA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,OAAO;EACxB,SAASA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,6BAA6B;EAC3D,UAAUA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,oBAAoB;EAClD,YAAYA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,mCAAmC;EACnE,aAAaA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,+BAA+B;EACjE,aAAaA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,aAAa;EAC9C,aAAaA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,yBAAyB;EAC3D,cAAcA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,qBAAqB;EACvD,mBAAmBA,IAAAA,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;EAC9D,sBAAsBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,kCAAkC;EAC7E,uBAAuBA,IAAAA,EAAE,QAAQ,CAAC,CAAC,SAAS,+CAA+C;EAC3F,uBAAuBA,IAAAA,EAAE,QAAQ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,IAAAA,EAAE,OAAO;CACvB,eAAeA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI;CAC9B,iBAAiBA,IAAAA,EAAE,OAAO,CAAC,CAAC,IAAI;CAChC,yBAAyBA,IAAAA,EAAE,QAAQ;AACrC,CAAC,CAAC,CAAC,SAAS,mDAAmD;AAE/D,MAAa,6BAA6BC,eAAAA,OAAO,iCAAiC;CAChF,MAAM;CACN,MAAM;CACN,aAAa;CACb,OAAO;CACP,QAAQ;AACV,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/webhook-event-refunded.d.ts
|
|
4
|
+
declare const PayhipWebhookEventRefundedInput: z.ZodTypeAny;
|
|
5
|
+
declare const PayhipWebhookEventRefundedOutput: z.ZodTypeAny;
|
|
6
|
+
declare const payhipWebhookEventRefunded: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { payhipWebhookEventRefunded };
|
|
9
|
+
//# sourceMappingURL=webhook-event-refunded.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-refunded.d.cts","names":[],"sources":["../../src/actions/webhook-event-refunded.ts"],"mappings":";;;cAIa,+BAAA,EAAiC,CAAA,CAAE,UA+Be;AAAA,cAelD,gCAAA,EAAkC,CAAA,CAAE,UAkBe;AAAA,cAEnD,0BAAA,gCAA0B,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/actions/webhook-event-refunded.d.ts
|
|
4
|
+
declare const PayhipWebhookEventRefundedInput: z.ZodTypeAny;
|
|
5
|
+
declare const PayhipWebhookEventRefundedOutput: z.ZodTypeAny;
|
|
6
|
+
declare const payhipWebhookEventRefunded: import("@keystrokehq/action").WorkflowActionDefinition<unknown, unknown, import("@keystrokehq/shared").ResolvedCredentials<readonly [import("@keystrokehq/shared").Credential]>, readonly [import("@keystrokehq/shared").Credential]>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { payhipWebhookEventRefunded };
|
|
9
|
+
//# sourceMappingURL=webhook-event-refunded.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-refunded.d.mts","names":[],"sources":["../../src/actions/webhook-event-refunded.ts"],"mappings":";;;cAIa,+BAAA,EAAiC,CAAA,CAAE,UA+Be;AAAA,cAelD,gCAAA,EAAkC,CAAA,CAAE,UAkBe;AAAA,cAEnD,0BAAA,gCAA0B,wBAAA,iDAAA,mBAAA,yCAAA,UAAA,4CAAA,UAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { action } from "../action.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/actions/webhook-event-refunded.ts
|
|
4
|
+
const PayhipWebhookEventRefundedInput = z.object({
|
|
5
|
+
id: z.string().describe("Transaction ID"),
|
|
6
|
+
type: z.string().describe("Event type identifier"),
|
|
7
|
+
email: z.string().describe("Buyer email address"),
|
|
8
|
+
items: z.array(z.object({
|
|
9
|
+
on_sale: z.boolean().describe("Whether product was on sale"),
|
|
10
|
+
quantity: z.string().describe("Quantity purchased"),
|
|
11
|
+
product_id: z.string().describe("Unique identifier for the product"),
|
|
12
|
+
has_variant: z.boolean().describe("Whether product has a variant"),
|
|
13
|
+
product_key: z.string().describe("Product key"),
|
|
14
|
+
used_coupon: z.boolean().describe("Whether coupon was used"),
|
|
15
|
+
product_name: z.string().describe("Name of the product"),
|
|
16
|
+
product_permalink: z.string().describe("Product permalink URL"),
|
|
17
|
+
used_social_discount: z.boolean().describe("Whether social discount was used"),
|
|
18
|
+
promoted_by_affiliate: z.boolean().describe("Whether purchase was promoted by an affiliate"),
|
|
19
|
+
used_upgrade_discount: z.boolean().describe("Whether upgrade discount was used"),
|
|
20
|
+
used_cross_sell_discount: z.boolean().describe("Whether cross-sell discount was used")
|
|
21
|
+
}).describe("Details of an item in the refunded event")).describe("List of items included in the transaction"),
|
|
22
|
+
price: z.number().int().describe("Original price in cents or pennies"),
|
|
23
|
+
is_gift: z.boolean().describe("Whether purchase was a gift"),
|
|
24
|
+
currency: z.string().describe("ISO 4217 currency code, e.g., USD"),
|
|
25
|
+
signature: z.string().describe("HMAC SHA-256 signature of the payload using your API key"),
|
|
26
|
+
ip_address: z.string().describe("IP address of the buyer"),
|
|
27
|
+
payhip_fee: z.number().int().describe("Payhip fee in cents"),
|
|
28
|
+
stripe_fee: z.number().int().describe("Stripe fee in cents"),
|
|
29
|
+
vat_applied: z.boolean().describe("Whether VAT was applied"),
|
|
30
|
+
date_created: z.number().int().describe("Unix timestamp when transaction was created"),
|
|
31
|
+
payment_type: z.string().describe("Payment method used, e.g., card"),
|
|
32
|
+
date_refunded: z.number().int().describe("Unix timestamp when refund occurred"),
|
|
33
|
+
amount_refunded: z.number().int().describe("Amount refunded in cents or pennies"),
|
|
34
|
+
unconsented_from_emails: z.boolean().describe("Whether buyer did not consent to marketing emails")
|
|
35
|
+
}).describe("Request model for Payhip refunded webhook event.");
|
|
36
|
+
const PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema = z.object({
|
|
37
|
+
on_sale: z.boolean().describe("Whether product was on sale"),
|
|
38
|
+
quantity: z.string().describe("Quantity purchased"),
|
|
39
|
+
product_id: z.string().describe("Unique identifier for the product"),
|
|
40
|
+
has_variant: z.boolean().describe("Whether product has a variant"),
|
|
41
|
+
product_key: z.string().describe("Product key"),
|
|
42
|
+
used_coupon: z.boolean().describe("Whether coupon was used"),
|
|
43
|
+
product_name: z.string().describe("Name of the product"),
|
|
44
|
+
product_permalink: z.string().describe("Product permalink URL"),
|
|
45
|
+
used_social_discount: z.boolean().describe("Whether social discount was used"),
|
|
46
|
+
promoted_by_affiliate: z.boolean().describe("Whether purchase was promoted by an affiliate"),
|
|
47
|
+
used_upgrade_discount: z.boolean().describe("Whether upgrade discount was used"),
|
|
48
|
+
used_cross_sell_discount: z.boolean().describe("Whether cross-sell discount was used")
|
|
49
|
+
}).describe("Details of an item in the refunded event");
|
|
50
|
+
const payhipWebhookEventRefunded = action("PAYHIP_WEBHOOK_EVENT_REFUNDED", {
|
|
51
|
+
slug: "payhip-webhook-event-refunded",
|
|
52
|
+
name: "Webhook Event - Refunded Payment",
|
|
53
|
+
description: "Tool to process Payhip's refunded webhook event. Use when handling a payment refund event from Payhip.",
|
|
54
|
+
input: PayhipWebhookEventRefundedInput,
|
|
55
|
+
output: z.object({
|
|
56
|
+
id: z.string(),
|
|
57
|
+
type: z.string(),
|
|
58
|
+
email: z.string(),
|
|
59
|
+
items: z.array(PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema),
|
|
60
|
+
price: z.number().int(),
|
|
61
|
+
is_gift: z.boolean(),
|
|
62
|
+
currency: z.string(),
|
|
63
|
+
signature: z.string(),
|
|
64
|
+
ip_address: z.string(),
|
|
65
|
+
payhip_fee: z.number().int(),
|
|
66
|
+
stripe_fee: z.number().int(),
|
|
67
|
+
vat_applied: z.boolean(),
|
|
68
|
+
date_created: z.number().int(),
|
|
69
|
+
payment_type: z.string(),
|
|
70
|
+
date_refunded: z.number().int(),
|
|
71
|
+
amount_refunded: z.number().int(),
|
|
72
|
+
unconsented_from_emails: z.boolean()
|
|
73
|
+
}).describe("Response model for Payhip refunded webhook event.")
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { payhipWebhookEventRefunded };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=webhook-event-refunded.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-event-refunded.mjs","names":[],"sources":["../../src/actions/webhook-event-refunded.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const PayhipWebhookEventRefundedInput: z.ZodTypeAny = z.object({\n id: z.string().describe(\"Transaction ID\"),\n type: z.string().describe(\"Event type identifier\"),\n email: z.string().describe(\"Buyer email address\"),\n items: z.array(z.object({\n on_sale: z.boolean().describe(\"Whether product was on sale\"),\n quantity: z.string().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"Unique identifier for the product\"),\n has_variant: z.boolean().describe(\"Whether product has a variant\"),\n product_key: z.string().describe(\"Product key\"),\n used_coupon: z.boolean().describe(\"Whether coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().describe(\"Product permalink URL\"),\n used_social_discount: z.boolean().describe(\"Whether social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether purchase was promoted by an affiliate\"),\n used_upgrade_discount: z.boolean().describe(\"Whether upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether cross-sell discount was used\"),\n}).describe(\"Details of an item in the refunded event\")).describe(\"List of items included in the transaction\"),\n price: z.number().int().describe(\"Original price in cents or pennies\"),\n is_gift: z.boolean().describe(\"Whether purchase was a gift\"),\n currency: z.string().describe(\"ISO 4217 currency code, e.g., USD\"),\n signature: z.string().describe(\"HMAC SHA-256 signature of the payload using your API key\"),\n ip_address: z.string().describe(\"IP address of the buyer\"),\n payhip_fee: z.number().int().describe(\"Payhip fee in cents\"),\n stripe_fee: z.number().int().describe(\"Stripe fee in cents\"),\n vat_applied: z.boolean().describe(\"Whether VAT was applied\"),\n date_created: z.number().int().describe(\"Unix timestamp when transaction was created\"),\n payment_type: z.string().describe(\"Payment method used, e.g., card\"),\n date_refunded: z.number().int().describe(\"Unix timestamp when refund occurred\"),\n amount_refunded: z.number().int().describe(\"Amount refunded in cents or pennies\"),\n unconsented_from_emails: z.boolean().describe(\"Whether buyer did not consent to marketing emails\"),\n}).describe(\"Request model for Payhip refunded webhook event.\");\nconst PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema: z.ZodTypeAny = z.object({\n on_sale: z.boolean().describe(\"Whether product was on sale\"),\n quantity: z.string().describe(\"Quantity purchased\"),\n product_id: z.string().describe(\"Unique identifier for the product\"),\n has_variant: z.boolean().describe(\"Whether product has a variant\"),\n product_key: z.string().describe(\"Product key\"),\n used_coupon: z.boolean().describe(\"Whether coupon was used\"),\n product_name: z.string().describe(\"Name of the product\"),\n product_permalink: z.string().describe(\"Product permalink URL\"),\n used_social_discount: z.boolean().describe(\"Whether social discount was used\"),\n promoted_by_affiliate: z.boolean().describe(\"Whether purchase was promoted by an affiliate\"),\n used_upgrade_discount: z.boolean().describe(\"Whether upgrade discount was used\"),\n used_cross_sell_discount: z.boolean().describe(\"Whether cross-sell discount was used\"),\n}).describe(\"Details of an item in the refunded event\");\nexport const PayhipWebhookEventRefundedOutput: z.ZodTypeAny = z.object({\n id: z.string(),\n type: z.string(),\n email: z.string(),\n items: z.array(PayhipWebhookEventRefunded_PayhipWebhookEventRefundedItemSchema),\n price: z.number().int(),\n is_gift: z.boolean(),\n currency: z.string(),\n signature: z.string(),\n ip_address: z.string(),\n payhip_fee: z.number().int(),\n stripe_fee: z.number().int(),\n vat_applied: z.boolean(),\n date_created: z.number().int(),\n payment_type: z.string(),\n date_refunded: z.number().int(),\n amount_refunded: z.number().int(),\n unconsented_from_emails: z.boolean(),\n}).describe(\"Response model for Payhip refunded webhook event.\");\n\nexport const payhipWebhookEventRefunded = action(\"PAYHIP_WEBHOOK_EVENT_REFUNDED\", {\n slug: \"payhip-webhook-event-refunded\",\n name: \"Webhook Event - Refunded Payment\",\n description: \"Tool to process Payhip's refunded webhook event. Use when handling a payment refund event from Payhip.\",\n input: PayhipWebhookEventRefundedInput,\n output: PayhipWebhookEventRefundedOutput,\n});\n"],"mappings":";;;AAIA,MAAa,kCAAgD,EAAE,OAAO;CACpE,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,gBAAgB;CACxC,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB;CACj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