@dominusnode/flowise-tools 1.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/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/toolkit.d.ts +100 -0
- package/dist/toolkit.d.ts.map +1 -0
- package/dist/toolkit.js +1668 -0
- package/dist/toolkit.js.map +1 -0
- package/package.json +26 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @dominusnode/flowise-tools
|
|
3
|
+
*
|
|
4
|
+
* DomiNode rotating proxy tools for Flowise AI.
|
|
5
|
+
*
|
|
6
|
+
* Exposes a DominusNodeToolkit class that produces LangChain-compatible
|
|
7
|
+
* DynamicStructuredTool instances for use inside Flowise workflows.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { DominusNodeToolkit } from "@dominusnode/flowise-tools";
|
|
12
|
+
*
|
|
13
|
+
* const toolkit = new DominusNodeToolkit({ apiKey: "dn_live_..." });
|
|
14
|
+
* const tools = toolkit.getTools(); // DynamicStructuredTool[]
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
export { DominusNodeToolkit } from "./toolkit.js";
|
|
20
|
+
export type { DominusNodeToolkitOptions } from "./toolkit.js";
|
|
21
|
+
export { isPrivateIp, validateTargetUrl, validateCountry, validateUuid, normalizeIpv4, stripDangerousKeys, scrubCredentials, truncate, formatBytes, formatCents, checkDnsRebinding, SANCTIONED_COUNTRIES, BLOCKED_HOSTNAMES, } from "./toolkit.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @dominusnode/flowise-tools
|
|
4
|
+
*
|
|
5
|
+
* DomiNode rotating proxy tools for Flowise AI.
|
|
6
|
+
*
|
|
7
|
+
* Exposes a DominusNodeToolkit class that produces LangChain-compatible
|
|
8
|
+
* DynamicStructuredTool instances for use inside Flowise workflows.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { DominusNodeToolkit } from "@dominusnode/flowise-tools";
|
|
13
|
+
*
|
|
14
|
+
* const toolkit = new DominusNodeToolkit({ apiKey: "dn_live_..." });
|
|
15
|
+
* const tools = toolkit.getTools(); // DynamicStructuredTool[]
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @packageDocumentation
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.BLOCKED_HOSTNAMES = exports.SANCTIONED_COUNTRIES = exports.checkDnsRebinding = exports.formatCents = exports.formatBytes = exports.truncate = exports.scrubCredentials = exports.stripDangerousKeys = exports.normalizeIpv4 = exports.validateUuid = exports.validateCountry = exports.validateTargetUrl = exports.isPrivateIp = exports.DominusNodeToolkit = void 0;
|
|
22
|
+
var toolkit_js_1 = require("./toolkit.js");
|
|
23
|
+
Object.defineProperty(exports, "DominusNodeToolkit", { enumerable: true, get: function () { return toolkit_js_1.DominusNodeToolkit; } });
|
|
24
|
+
// Re-export security utilities for testing
|
|
25
|
+
var toolkit_js_2 = require("./toolkit.js");
|
|
26
|
+
Object.defineProperty(exports, "isPrivateIp", { enumerable: true, get: function () { return toolkit_js_2.isPrivateIp; } });
|
|
27
|
+
Object.defineProperty(exports, "validateTargetUrl", { enumerable: true, get: function () { return toolkit_js_2.validateTargetUrl; } });
|
|
28
|
+
Object.defineProperty(exports, "validateCountry", { enumerable: true, get: function () { return toolkit_js_2.validateCountry; } });
|
|
29
|
+
Object.defineProperty(exports, "validateUuid", { enumerable: true, get: function () { return toolkit_js_2.validateUuid; } });
|
|
30
|
+
Object.defineProperty(exports, "normalizeIpv4", { enumerable: true, get: function () { return toolkit_js_2.normalizeIpv4; } });
|
|
31
|
+
Object.defineProperty(exports, "stripDangerousKeys", { enumerable: true, get: function () { return toolkit_js_2.stripDangerousKeys; } });
|
|
32
|
+
Object.defineProperty(exports, "scrubCredentials", { enumerable: true, get: function () { return toolkit_js_2.scrubCredentials; } });
|
|
33
|
+
Object.defineProperty(exports, "truncate", { enumerable: true, get: function () { return toolkit_js_2.truncate; } });
|
|
34
|
+
Object.defineProperty(exports, "formatBytes", { enumerable: true, get: function () { return toolkit_js_2.formatBytes; } });
|
|
35
|
+
Object.defineProperty(exports, "formatCents", { enumerable: true, get: function () { return toolkit_js_2.formatCents; } });
|
|
36
|
+
Object.defineProperty(exports, "checkDnsRebinding", { enumerable: true, get: function () { return toolkit_js_2.checkDnsRebinding; } });
|
|
37
|
+
Object.defineProperty(exports, "SANCTIONED_COUNTRIES", { enumerable: true, get: function () { return toolkit_js_2.SANCTIONED_COUNTRIES; } });
|
|
38
|
+
Object.defineProperty(exports, "BLOCKED_HOSTNAMES", { enumerable: true, get: function () { return toolkit_js_2.BLOCKED_HOSTNAMES; } });
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,2CAAkD;AAAzC,gHAAA,kBAAkB,OAAA;AAG3B,2CAA2C;AAC3C,2CAcsB;AAbpB,yGAAA,WAAW,OAAA;AACX,+GAAA,iBAAiB,OAAA;AACjB,6GAAA,eAAe,OAAA;AACf,0GAAA,YAAY,OAAA;AACZ,2GAAA,aAAa,OAAA;AACb,gHAAA,kBAAkB,OAAA;AAClB,8GAAA,gBAAgB,OAAA;AAChB,sGAAA,QAAQ,OAAA;AACR,yGAAA,WAAW,OAAA;AACX,yGAAA,WAAW,OAAA;AACX,+GAAA,iBAAiB,OAAA;AACjB,kHAAA,oBAAoB,OAAA;AACpB,+GAAA,iBAAiB,OAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DomiNode Flowise Toolkit
|
|
3
|
+
*
|
|
4
|
+
* Provides 24 LangChain-compatible DynamicStructuredTool instances for use
|
|
5
|
+
* inside Flowise AI workflows. Covers proxied fetching, wallet management,
|
|
6
|
+
* agentic wallets, teams, PayPal top-up, and x402 micropayment info.
|
|
7
|
+
*
|
|
8
|
+
* Security:
|
|
9
|
+
* - Full SSRF protection (private IP blocking, DNS rebinding, Teredo/6to4,
|
|
10
|
+
* IPv4-mapped/compatible IPv6, hex/octal/decimal normalization, zone ID
|
|
11
|
+
* stripping, .localhost/.local/.internal/.arpa TLD blocking, embedded
|
|
12
|
+
* credential blocking)
|
|
13
|
+
* - OFAC sanctioned country validation (CU, IR, KP, RU, SY)
|
|
14
|
+
* - Credential scrubbing in all error outputs
|
|
15
|
+
* - Prototype pollution prevention on all parsed JSON (recursive)
|
|
16
|
+
* - HTTP method restriction (GET/HEAD/OPTIONS only for proxied fetch)
|
|
17
|
+
* - 10 MB response cap, 4000 char truncation, 30 s timeout
|
|
18
|
+
* - Redirect following disabled to prevent open redirect abuse
|
|
19
|
+
*/
|
|
20
|
+
import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
21
|
+
/** OFAC sanctioned countries -- must never be used as geo-targeting destinations. */
|
|
22
|
+
export declare const SANCTIONED_COUNTRIES: Set<string>;
|
|
23
|
+
/** Remove any dn_live_* or dn_test_* tokens from error messages. */
|
|
24
|
+
export declare function scrubCredentials(msg: string): string;
|
|
25
|
+
export declare function truncate(text: string, max?: number): string;
|
|
26
|
+
export declare const BLOCKED_HOSTNAMES: Set<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Normalize non-standard IPv4 representations to dotted-decimal.
|
|
29
|
+
* Handles: decimal integers (2130706433), hex (0x7f000001), octal octets (0177.0.0.1).
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeIpv4(hostname: string): string | null;
|
|
32
|
+
export declare function isPrivateIp(hostname: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Validate a URL for safety before proxying.
|
|
35
|
+
* Blocks: private IPs, localhost, .local/.internal/.arpa, embedded credentials, non-http(s).
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateTargetUrl(url: string): URL;
|
|
38
|
+
/**
|
|
39
|
+
* Validate a country code: must be 2 uppercase letters and not OFAC sanctioned.
|
|
40
|
+
*/
|
|
41
|
+
export declare function validateCountry(country: string | undefined): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Validate a UUID string.
|
|
44
|
+
*/
|
|
45
|
+
export declare function validateUuid(id: string, label: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a hostname via DNS and verify none of the resolved IPs are private.
|
|
48
|
+
* Skips check if the hostname is already an IP literal.
|
|
49
|
+
*/
|
|
50
|
+
export declare function checkDnsRebinding(hostname: string): Promise<void>;
|
|
51
|
+
export declare function stripDangerousKeys(obj: unknown, depth?: number): void;
|
|
52
|
+
export declare function formatBytes(bytes: number): string;
|
|
53
|
+
export declare function formatCents(cents: number): string;
|
|
54
|
+
export interface DominusNodeToolkitOptions {
|
|
55
|
+
apiKey?: string;
|
|
56
|
+
baseUrl?: string;
|
|
57
|
+
proxyHost?: string;
|
|
58
|
+
proxyPort?: number;
|
|
59
|
+
timeout?: number;
|
|
60
|
+
}
|
|
61
|
+
export declare class DominusNodeToolkit {
|
|
62
|
+
private apiKey;
|
|
63
|
+
private baseUrl;
|
|
64
|
+
private proxyHost;
|
|
65
|
+
private proxyPort;
|
|
66
|
+
private timeout;
|
|
67
|
+
private token;
|
|
68
|
+
private tokenExpiresAt;
|
|
69
|
+
constructor(options?: DominusNodeToolkitOptions);
|
|
70
|
+
private _authenticate;
|
|
71
|
+
private _ensureAuth;
|
|
72
|
+
private _apiRequest;
|
|
73
|
+
private _requestWithRetry;
|
|
74
|
+
proxiedFetch(url: string, method?: string, country?: string, proxyType?: string): Promise<string>;
|
|
75
|
+
checkBalance(): Promise<string>;
|
|
76
|
+
checkUsage(days?: number): Promise<string>;
|
|
77
|
+
getProxyConfig(): Promise<string>;
|
|
78
|
+
listSessions(): Promise<string>;
|
|
79
|
+
createAgenticWallet(label: string, spendingLimitCents?: number, dailyLimitCents?: number, allowedDomains?: string[]): Promise<string>;
|
|
80
|
+
updateWalletPolicy(walletId: string, dailyLimitCents?: number | null, allowedDomains?: string[] | null): Promise<string>;
|
|
81
|
+
fundAgenticWallet(walletId: string, amountCents: number): Promise<string>;
|
|
82
|
+
agenticWalletBalance(walletId: string): Promise<string>;
|
|
83
|
+
listAgenticWallets(): Promise<string>;
|
|
84
|
+
agenticTransactions(walletId: string, limit?: number): Promise<string>;
|
|
85
|
+
freezeAgenticWallet(walletId: string): Promise<string>;
|
|
86
|
+
unfreezeAgenticWallet(walletId: string): Promise<string>;
|
|
87
|
+
deleteAgenticWallet(walletId: string): Promise<string>;
|
|
88
|
+
createTeam(name: string, maxMembers?: number): Promise<string>;
|
|
89
|
+
listTeams(): Promise<string>;
|
|
90
|
+
teamDetails(teamId: string): Promise<string>;
|
|
91
|
+
teamFund(teamId: string, amountCents: number): Promise<string>;
|
|
92
|
+
teamCreateKey(teamId: string, label: string): Promise<string>;
|
|
93
|
+
teamUsage(teamId: string, limit?: number): Promise<string>;
|
|
94
|
+
updateTeam(teamId: string, name?: string, maxMembers?: number): Promise<string>;
|
|
95
|
+
updateTeamMemberRole(teamId: string, userId: string, role: string): Promise<string>;
|
|
96
|
+
topupPaypal(amountCents: number): Promise<string>;
|
|
97
|
+
x402Info(): Promise<string>;
|
|
98
|
+
getTools(): DynamicStructuredTool[];
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=toolkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../src/toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAgB9D,qFAAqF;AACrF,eAAO,MAAM,oBAAoB,aAA0C,CAAC;AAY5E,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD;AAWD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAA2B,GAAG,MAAM,CAG/E;AAMD,eAAO,MAAM,iBAAiB,aAS5B,CAAC;AAEH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoC7D;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CA0ErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CA0ClD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAY/E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9D;AAMD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,Q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