@wfgraph/plugins 3.1.1 → 4.0.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 +23 -6
- package/dist/client-B0M2Cle4.js +115 -0
- package/dist/{client-BEcFnbOB.js → client-B0dhD5OA.js} +1 -2
- package/dist/{client-DDDCNLId.js → client-BQmwEhSH.js} +1 -2
- package/dist/{client-LRwmIiPU.js → client-C32OdgmT.js} +5 -6
- package/dist/client-D3ALurAR.js +167 -0
- package/dist/config-options-BgSb_XqZ.js +101 -0
- package/dist/{errors-C4i6-DQE.js → errors-DQPf9k4I.js} +31 -24
- package/dist/index.d.ts +185 -53
- package/dist/index.js +1887 -447
- package/dist/omit-undefined-CnDMZgmp.js +6 -0
- package/dist/{test-B8I6nxMN.js → test-B5WBOt4r.js} +7 -6
- package/dist/{test-DN4ZApY4.js → test-Beetxizr.js} +2 -3
- package/dist/test-CTNffdZM.js +50 -0
- package/dist/{test-DWVpiQNl.js → test-CTWGAckT.js} +2 -3
- package/dist/{test-Dsrib2EJ.js → test-CiIt-3_x.js} +2 -3
- package/dist/{test-8wDSAiFQ.js → test-x2qD6zdE.js} +2 -3
- package/dist/ui.d.ts +11 -19
- package/dist/ui.js +119 -73
- package/package.json +15 -11
- package/skills/wfgraph-plugins/SKILL.md +106 -0
- package/dist/client-C2NIQxhb.js +0 -64
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as listResendDomains, s as readResendError, t as classifyResendFailure } from "./client-D3ALurAR.js";
|
|
2
2
|
import { callExternalAsync } from "@wfgraph/core/plugin";
|
|
3
|
-
|
|
4
|
-
async function testResend(credentials) {
|
|
3
|
+
// src/resend/test.ts
|
|
4
|
+
async function testResend(credentials, context) {
|
|
5
5
|
const apiKey = credentials.RESEND_API_KEY;
|
|
6
|
-
|
|
6
|
+
const isOAuthAccessToken = context.oauthCredentialKeys.includes("RESEND_API_KEY");
|
|
7
|
+
if (!(apiKey && (isOAuthAccessToken || apiKey.startsWith("re_")))) return {
|
|
7
8
|
success: false,
|
|
8
9
|
error: "Invalid API key format. Resend API keys start with 're_'"
|
|
9
10
|
};
|
|
@@ -16,7 +17,8 @@ async function testResend(credentials) {
|
|
|
16
17
|
details: { message: failure.message }
|
|
17
18
|
};
|
|
18
19
|
const body = failure._tag === "ExternalRejected" ? readResendError(failure.payload) : void 0;
|
|
19
|
-
|
|
20
|
+
const refusal = classifyResendFailure(failure);
|
|
21
|
+
if (refusal === "send_only_key" || isOAuthAccessToken && refusal === "insufficient_scope") return { success: true };
|
|
20
22
|
const status = body?.statusCode ?? failure.status;
|
|
21
23
|
const details = {
|
|
22
24
|
statusCode: status,
|
|
@@ -34,5 +36,4 @@ async function testResend(credentials) {
|
|
|
34
36
|
details
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
|
-
//#endregion
|
|
38
39
|
export { testResend };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as readTwilioError, n as describeTwilioFailure, r as fetchTwilioAccount } from "./client-
|
|
1
|
+
import { i as readTwilioError, n as describeTwilioFailure, r as fetchTwilioAccount } from "./client-C32OdgmT.js";
|
|
2
2
|
import { callExternalAsync } from "@wfgraph/core/plugin";
|
|
3
|
-
|
|
3
|
+
// src/twilio/test.ts
|
|
4
4
|
async function testTwilio(credentials) {
|
|
5
5
|
const accountSid = credentials.TWILIO_ACCOUNT_SID;
|
|
6
6
|
const authToken = credentials.TWILIO_AUTH_TOKEN;
|
|
@@ -31,5 +31,4 @@ async function testTwilio(credentials) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { testTwilio };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { a as resolvePostHogHost, i as readPostHogError, n as describePostHogFailure, r as evaluateFlags } from "./client-B0M2Cle4.js";
|
|
2
|
+
import { callExternalAsync } from "@wfgraph/core/plugin";
|
|
3
|
+
// src/posthog/test.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Test connection button, for PostHog.
|
|
6
|
+
*
|
|
7
|
+
* The capture endpoint cannot answer this question: ingestion is async, so it
|
|
8
|
+
* takes a bad project key as readily as a good one and answers `{"status": 1}`
|
|
9
|
+
* either way. The flags endpoint validates the key against the same host and
|
|
10
|
+
* refuses a bad one, and writes no event doing it.
|
|
11
|
+
*/
|
|
12
|
+
/** The person the check asks about, who does not have to exist. */
|
|
13
|
+
const TEST_DISTINCT_ID = "wfgraph-connection-test";
|
|
14
|
+
async function testPostHog(credentials, context) {
|
|
15
|
+
const projectApiKey = credentials.POSTHOG_PROJECT_API_KEY;
|
|
16
|
+
if (!projectApiKey) return {
|
|
17
|
+
success: false,
|
|
18
|
+
error: "POSTHOG_PROJECT_API_KEY is required"
|
|
19
|
+
};
|
|
20
|
+
if (!context.oauthCredentialKeys.includes("POSTHOG_PROJECT_API_KEY") && !projectApiKey.startsWith("phc_")) return {
|
|
21
|
+
success: false,
|
|
22
|
+
error: "Invalid project API key format. PostHog project API keys start with 'phc_'"
|
|
23
|
+
};
|
|
24
|
+
const result = await callExternalAsync(evaluateFlags({
|
|
25
|
+
projectApiKey,
|
|
26
|
+
host: resolvePostHogHost(credentials.POSTHOG_HOST)
|
|
27
|
+
}, TEST_DISTINCT_ID), (error) => error);
|
|
28
|
+
if (result.ok) return { success: true };
|
|
29
|
+
const { failure } = result;
|
|
30
|
+
if (failure._tag === "ExternalUnreachable") return {
|
|
31
|
+
success: false,
|
|
32
|
+
error: failure.message,
|
|
33
|
+
details: {
|
|
34
|
+
kind: "unreachable",
|
|
35
|
+
message: failure.message
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const body = failure._tag === "ExternalRejected" ? readPostHogError(failure.payload) : void 0;
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: `API validation failed: HTTP ${failure.status}`,
|
|
42
|
+
details: {
|
|
43
|
+
kind: failure._tag === "ExternalRejected" ? "rejected" : "http",
|
|
44
|
+
status: failure.status,
|
|
45
|
+
code: body?.code,
|
|
46
|
+
message: describePostHogFailure(failure)
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export { testPostHog };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as toLinearError } from "./errors-
|
|
1
|
+
import { n as toLinearError } from "./errors-DQPf9k4I.js";
|
|
2
2
|
import { LinearErrorType } from "@linear/sdk";
|
|
3
|
-
|
|
3
|
+
// src/linear/test.ts
|
|
4
4
|
async function testLinear(credentials, createClient) {
|
|
5
5
|
try {
|
|
6
6
|
const apiKey = credentials.LINEAR_API_KEY;
|
|
@@ -32,5 +32,4 @@ async function testLinear(credentials, createClient) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { testLinear };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as getClerkApiErrorMessage, t as createClerkBackendClient } from "./client-
|
|
2
|
-
|
|
1
|
+
import { n as getClerkApiErrorMessage, t as createClerkBackendClient } from "./client-B0dhD5OA.js";
|
|
2
|
+
// src/clerk/test.ts
|
|
3
3
|
async function testClerk(credentials) {
|
|
4
4
|
try {
|
|
5
5
|
const secretKey = credentials.CLERK_SECRET_KEY;
|
|
@@ -28,5 +28,4 @@ async function testClerk(credentials) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
//#endregion
|
|
32
31
|
export { testClerk };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as describeSlackFailure, r as readSlackError, t as callSlack } from "./client-
|
|
1
|
+
import { n as describeSlackFailure, r as readSlackError, t as callSlack } from "./client-BQmwEhSH.js";
|
|
2
2
|
import { callExternalAsync } from "@wfgraph/core/plugin";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
|
-
|
|
4
|
+
// src/slack/test.ts
|
|
5
5
|
const authTestSchema = Schema.Struct({ team: Schema.optionalKey(Schema.String) });
|
|
6
6
|
async function testSlack(credentials) {
|
|
7
7
|
const apiKey = credentials.SLACK_API_KEY;
|
|
@@ -41,5 +41,4 @@ async function testSlack(credentials) {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { testSlack };
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
import { ComponentType } from "react";
|
|
2
|
-
//#region src/clerk/components/user-card.d.ts
|
|
3
2
|
declare function UserCard({ output }: ResultComponentProps): import("react").JSX.Element | null;
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/clerk/icon.d.ts
|
|
6
3
|
declare function ClerkIcon({ className }: {
|
|
7
4
|
className?: string;
|
|
8
5
|
}): import("react").JSX.Element;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/linear/icon.d.ts
|
|
11
6
|
declare function LinearIcon({ className }: {
|
|
12
7
|
className?: string;
|
|
13
8
|
}): import("react").JSX.Element;
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
declare function PostHogIcon({ className }: {
|
|
10
|
+
className?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
16
12
|
declare function ResendIcon({ className }: {
|
|
17
13
|
className?: string;
|
|
18
14
|
}): import("react").JSX.Element;
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/slack/icon.d.ts
|
|
21
15
|
declare function SlackIcon({ className }: {
|
|
22
16
|
className?: string;
|
|
23
17
|
}): import("react").JSX.Element;
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/twilio/icon.d.ts
|
|
26
18
|
declare function TwilioIcon({ className }: {
|
|
27
19
|
className?: string;
|
|
28
20
|
}): import("react").JSX.Element;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/ui.d.ts
|
|
31
21
|
/** Props passed to a custom output renderer. */
|
|
32
|
-
type ResultComponentProps = {
|
|
22
|
+
export type ResultComponentProps = {
|
|
33
23
|
output: unknown;
|
|
34
24
|
input?: unknown;
|
|
35
25
|
};
|
|
36
|
-
type IntegrationUi = {
|
|
26
|
+
export type IntegrationUi = {
|
|
37
27
|
icon: ComponentType<{
|
|
38
28
|
className?: string;
|
|
39
29
|
}>;
|
|
40
|
-
outputComponents?: Record<string, ComponentType<ResultComponentProps
|
|
30
|
+
outputComponents?: Record<string, ComponentType<ResultComponentProps>> | undefined;
|
|
41
31
|
};
|
|
42
|
-
declare const integrationUi: {
|
|
32
|
+
export declare const integrationUi: {
|
|
43
33
|
clerk: {
|
|
44
34
|
icon: typeof ClerkIcon;
|
|
45
35
|
outputComponents: {
|
|
@@ -51,6 +41,9 @@ declare const integrationUi: {
|
|
|
51
41
|
linear: {
|
|
52
42
|
icon: typeof LinearIcon;
|
|
53
43
|
};
|
|
44
|
+
posthog: {
|
|
45
|
+
icon: typeof PostHogIcon;
|
|
46
|
+
};
|
|
54
47
|
resend: {
|
|
55
48
|
icon: typeof ResendIcon;
|
|
56
49
|
};
|
|
@@ -61,5 +54,4 @@ declare const integrationUi: {
|
|
|
61
54
|
icon: typeof TwilioIcon;
|
|
62
55
|
};
|
|
63
56
|
};
|
|
64
|
-
|
|
65
|
-
export { IntegrationUi, ResultComponentProps, integrationUi };
|
|
57
|
+
export {};
|