@theholocron/holocron-plugin-discord 5.0.0-alpha.115 → 5.0.0-alpha.116
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/dist/index.d.mts +2 -11
- package/dist/index.mjs +2 -1
- package/package.json +5 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthError, Notifications, ResolveTokenInput } from "@theholocron/cli";
|
|
1
|
+
import { AuthError, Notifications, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
|
|
2
2
|
//#region src/auth.d.ts
|
|
3
3
|
declare const resolveToken: (input?: ResolveTokenInput) => string;
|
|
4
4
|
//#endregion
|
|
@@ -54,20 +54,11 @@ declare class DiscordNotifications implements Notifications {
|
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/verify-token.d.ts
|
|
57
|
-
interface VerifyTokenSuccess {
|
|
58
|
-
ok: true;
|
|
59
|
-
subject: string;
|
|
60
|
-
}
|
|
61
|
-
interface VerifyTokenFailure {
|
|
62
|
-
ok: false;
|
|
63
|
-
message: string;
|
|
64
|
-
}
|
|
65
|
-
type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
|
|
66
57
|
interface VerifyTokenOptions {
|
|
67
58
|
baseUrl?: string;
|
|
68
59
|
fetch?: typeof fetch;
|
|
69
60
|
}
|
|
70
|
-
declare function verifyToken(webhookUrl: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
|
|
61
|
+
declare function verifyToken(webhookUrl: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
|
|
71
62
|
//#endregion
|
|
72
63
|
//#region src/index.d.ts
|
|
73
64
|
interface DiscordPluginOptions extends ResolveTokenInput, DiscordNotificationsOptions {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AuthError, ProviderApiError, createResolveToken } from "@theholocron/cli";
|
|
2
|
+
import { errorMessage } from "@theholocron/misc-utils";
|
|
2
3
|
//#region src/auth.ts
|
|
3
4
|
const resolveToken = createResolveToken({
|
|
4
5
|
envName: "HOLOCRON_DISCORD_WEBHOOK",
|
|
@@ -78,7 +79,7 @@ async function verifyToken(webhookUrl, opts = {}) {
|
|
|
78
79
|
} catch (err) {
|
|
79
80
|
return {
|
|
80
81
|
ok: false,
|
|
81
|
-
message:
|
|
82
|
+
message: errorMessage(err)
|
|
82
83
|
};
|
|
83
84
|
}
|
|
84
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-discord",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.116",
|
|
4
4
|
"description": "Holocron plugin for Discord. Implements the notifications capability via Discord incoming webhooks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"discord",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@theholocron/eslint-config": "^8.7.0",
|
|
34
34
|
"@theholocron/http-client": "^1.37.1",
|
|
35
|
+
"@theholocron/misc-utils": "^1.9.2",
|
|
35
36
|
"@theholocron/tsconfig": "^8.7.0",
|
|
36
37
|
"@theholocron/tsdown-config": "^8.7.0",
|
|
37
38
|
"@theholocron/vitest-config": "^8.7.0",
|
|
@@ -46,10 +47,11 @@
|
|
|
46
47
|
"tsx": "4.23.12",
|
|
47
48
|
"typescript": "^5.9.3",
|
|
48
49
|
"vitest": "^4.1.11",
|
|
49
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
50
|
+
"@theholocron/cli": "5.0.0-alpha.116"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@theholocron/
|
|
53
|
+
"@theholocron/misc-utils": "^1.9.2",
|
|
54
|
+
"@theholocron/cli": "5.0.0-alpha.116"
|
|
53
55
|
},
|
|
54
56
|
"engines": {
|
|
55
57
|
"node": ">=22"
|