@teever/ez-hook 0.3.5
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/LICENSE +21 -0
- package/README.md +147 -0
- package/dist/classes/Embed.d.ts +205 -0
- package/dist/classes/Embed.d.ts.map +1 -0
- package/dist/classes/Embed.js +315 -0
- package/dist/classes/Embed.js.map +1 -0
- package/dist/classes/Errors.d.ts +59 -0
- package/dist/classes/Errors.d.ts.map +1 -0
- package/dist/classes/Errors.js +75 -0
- package/dist/classes/Errors.js.map +1 -0
- package/dist/classes/RequestClient.d.ts +38 -0
- package/dist/classes/RequestClient.d.ts.map +1 -0
- package/dist/classes/RequestClient.js +117 -0
- package/dist/classes/RequestClient.js.map +1 -0
- package/dist/classes/Webhook.d.ts +136 -0
- package/dist/classes/Webhook.d.ts.map +1 -0
- package/dist/classes/Webhook.js +208 -0
- package/dist/classes/Webhook.js.map +1 -0
- package/dist/classes/index.d.ts +5 -0
- package/dist/classes/index.d.ts.map +1 -0
- package/dist/classes/index.js +5 -0
- package/dist/classes/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/types/FileAttachment.d.ts +19 -0
- package/dist/types/FileAttachment.d.ts.map +1 -0
- package/dist/types/FileAttachment.js +2 -0
- package/dist/types/FileAttachment.js.map +1 -0
- package/dist/types/IAttachment.d.ts +39 -0
- package/dist/types/IAttachment.d.ts.map +1 -0
- package/dist/types/IAttachment.js +2 -0
- package/dist/types/IAttachment.js.map +1 -0
- package/dist/types/IAuthor.d.ts +21 -0
- package/dist/types/IAuthor.d.ts.map +1 -0
- package/dist/types/IAuthor.js +2 -0
- package/dist/types/IAuthor.js.map +1 -0
- package/dist/types/IEmbed.d.ts +66 -0
- package/dist/types/IEmbed.d.ts.map +1 -0
- package/dist/types/IEmbed.js +2 -0
- package/dist/types/IEmbed.js.map +1 -0
- package/dist/types/IField.d.ts +17 -0
- package/dist/types/IField.d.ts.map +1 -0
- package/dist/types/IField.js +2 -0
- package/dist/types/IField.js.map +1 -0
- package/dist/types/IFooter.d.ts +17 -0
- package/dist/types/IFooter.d.ts.map +1 -0
- package/dist/types/IFooter.js +2 -0
- package/dist/types/IFooter.js.map +1 -0
- package/dist/types/IImage.d.ts +21 -0
- package/dist/types/IImage.d.ts.map +1 -0
- package/dist/types/IImage.js +2 -0
- package/dist/types/IImage.js.map +1 -0
- package/dist/types/IProvider.d.ts +11 -0
- package/dist/types/IProvider.d.ts.map +1 -0
- package/dist/types/IProvider.js +2 -0
- package/dist/types/IProvider.js.map +1 -0
- package/dist/types/IThumbnail.d.ts +21 -0
- package/dist/types/IThumbnail.d.ts.map +1 -0
- package/dist/types/IThumbnail.js +2 -0
- package/dist/types/IThumbnail.js.map +1 -0
- package/dist/types/IUser.d.ts +67 -0
- package/dist/types/IUser.d.ts.map +1 -0
- package/dist/types/IUser.js +2 -0
- package/dist/types/IUser.js.map +1 -0
- package/dist/types/IVideo.d.ts +15 -0
- package/dist/types/IVideo.d.ts.map +1 -0
- package/dist/types/IVideo.js +2 -0
- package/dist/types/IVideo.js.map +1 -0
- package/dist/types/IWebhook.d.ts +30 -0
- package/dist/types/IWebhook.d.ts.map +1 -0
- package/dist/types/IWebhook.js +2 -0
- package/dist/types/IWebhook.js.map +1 -0
- package/dist/types/IWebhookParameter.d.ts +16 -0
- package/dist/types/IWebhookParameter.d.ts.map +1 -0
- package/dist/types/IWebhookParameter.js +2 -0
- package/dist/types/IWebhookParameter.js.map +1 -0
- package/dist/types/IWebhookResponse.d.ts +62 -0
- package/dist/types/IWebhookResponse.d.ts.map +1 -0
- package/dist/types/IWebhookResponse.js +2 -0
- package/dist/types/IWebhookResponse.js.map +1 -0
- package/dist/types/WebhookResponse.d.ts +38 -0
- package/dist/types/WebhookResponse.d.ts.map +1 -0
- package/dist/types/WebhookResponse.js +2 -0
- package/dist/types/WebhookResponse.js.map +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response interface for webhook operations
|
|
3
|
+
*/
|
|
4
|
+
export interface WebhookResponse {
|
|
5
|
+
/** Whether the operation was successful */
|
|
6
|
+
success: boolean;
|
|
7
|
+
/** HTTP status code from the response */
|
|
8
|
+
statusCode?: number;
|
|
9
|
+
/** Error message if the operation failed */
|
|
10
|
+
error?: string;
|
|
11
|
+
/** Time to wait before retrying (in milliseconds) */
|
|
12
|
+
retryAfter?: number;
|
|
13
|
+
/** Response headers */
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validation result interface
|
|
18
|
+
*/
|
|
19
|
+
export interface ValidationResult {
|
|
20
|
+
/** Whether the validation passed */
|
|
21
|
+
isValid: boolean;
|
|
22
|
+
/** List of validation errors */
|
|
23
|
+
errors: ValidationError[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Individual validation error
|
|
27
|
+
*/
|
|
28
|
+
export interface ValidationError {
|
|
29
|
+
/** Field that failed validation */
|
|
30
|
+
field: string;
|
|
31
|
+
/** Error message */
|
|
32
|
+
message: string;
|
|
33
|
+
/** Expected value or constraint */
|
|
34
|
+
expected?: string | number;
|
|
35
|
+
/** Actual value that failed */
|
|
36
|
+
actual?: string | number;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=WebhookResponse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookResponse.d.ts","sourceRoot":"","sources":["../../src/types/WebhookResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAA;IAChB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uBAAuB;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,gCAAgC;IAChC,MAAM,EAAE,eAAe,EAAE,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookResponse.js","sourceRoot":"","sources":["../../src/types/WebhookResponse.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { FileAttachment, WebhookFile } from './FileAttachment';
|
|
2
|
+
export type { IAttachment } from './IAttachment';
|
|
3
|
+
export type { IAuthor } from './IAuthor';
|
|
4
|
+
export type { IEmbed } from './IEmbed';
|
|
5
|
+
export type { IField } from './IField';
|
|
6
|
+
export type { IFooter } from './IFooter';
|
|
7
|
+
export type { IImage } from './IImage';
|
|
8
|
+
export type { IProvider } from './IProvider';
|
|
9
|
+
export type { IThumbnail } from './IThumbnail';
|
|
10
|
+
export type { IUser } from './IUser';
|
|
11
|
+
export type { IVideo } from './IVideo';
|
|
12
|
+
export type { IWebhook } from './IWebhook';
|
|
13
|
+
export type { IWebhookParameter } from './IWebhookParameter';
|
|
14
|
+
export type { IWebhookResponse } from './IWebhookResponse';
|
|
15
|
+
export type { ValidationError as IValidationError, ValidationResult, WebhookResponse } from './WebhookResponse';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACpC,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,YAAY,EACX,eAAe,IAAI,gBAAgB,EACnC,gBAAgB,EAChB,eAAe,EACf,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@teever/ez-hook",
|
|
3
|
+
"module": "dist/index.js",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"description": "A simple way to send webhooks to discord with zero dependencies",
|
|
13
|
+
"author": "github.com/teeverc",
|
|
14
|
+
"version": "0.3.5",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/teeverc/ez-hook.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/teeverc/ez-hook/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/teeverc/ez-hook#readme",
|
|
24
|
+
"keywords": [
|
|
25
|
+
"discord",
|
|
26
|
+
"webhook",
|
|
27
|
+
"discord-webhook",
|
|
28
|
+
"discord-bot",
|
|
29
|
+
"typescript",
|
|
30
|
+
"zero-dependency"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"start": "bun src/index.ts",
|
|
37
|
+
"dev": "bun src/index.ts",
|
|
38
|
+
"dev:watch": "bun build --watch",
|
|
39
|
+
"build": "bun run clean && tsc --project tsconfig.build.json",
|
|
40
|
+
"build:watch": "tsc --project tsconfig.build.json --watch",
|
|
41
|
+
"lint": "biome lint ./src",
|
|
42
|
+
"format": "biome check --write --unsafe ./src",
|
|
43
|
+
"check": "biome check --write ./src",
|
|
44
|
+
"check:ci": "biome check ./src",
|
|
45
|
+
"test": "bun test webhook",
|
|
46
|
+
"test:watch": "bun test --watch webhook",
|
|
47
|
+
"test:coverage": "bun test --coverage webhook",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"clean": "rm -rf dist build",
|
|
50
|
+
"example": "bun examples/01-enhanced-usage.ts",
|
|
51
|
+
"example:basic": "bun examples/basic-usage.ts",
|
|
52
|
+
"validate": "bun run typecheck && bun run check:ci && bun run test",
|
|
53
|
+
"prepublishOnly": "bun run validate && bun run build"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@biomejs/biome": "^2.2.4",
|
|
57
|
+
"@types/bun": "^1.2.22",
|
|
58
|
+
"lefthook": "^2.0.1",
|
|
59
|
+
"typescript": "^5.9.3"
|
|
60
|
+
}
|
|
61
|
+
}
|