fundedlytics-mcp 0.0.0-stage → 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 +41 -2
- package/dist/affiliates-shared.d.ts +165 -0
- package/dist/affiliates-shared.js +350 -0
- package/dist/affiliates-shared.js.map +1 -0
- package/dist/client.d.ts +79 -0
- package/dist/client.js +169 -0
- package/dist/client.js.map +1 -0
- package/dist/content.d.ts +9 -0
- package/dist/content.js +84 -0
- package/dist/content.js.map +1 -0
- package/dist/http.d.ts +30 -0
- package/dist/http.js +201 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/links-out.d.ts +14 -0
- package/dist/links-out.js +67 -0
- package/dist/links-out.js.map +1 -0
- package/dist/links.d.ts +19 -0
- package/dist/links.js +32 -0
- package/dist/links.js.map +1 -0
- package/dist/offers.d.ts +37 -0
- package/dist/offers.js +91 -0
- package/dist/offers.js.map +1 -0
- package/dist/ratelimit.d.ts +14 -0
- package/dist/ratelimit.js +30 -0
- package/dist/ratelimit.js.map +1 -0
- package/dist/schemas.d.ts +827 -0
- package/dist/schemas.js +159 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.js +66 -0
- package/dist/server.js.map +1 -0
- package/dist/stdio.d.ts +2 -0
- package/dist/stdio.js +26 -0
- package/dist/stdio.js.map +1 -0
- package/dist/tools.d.ts +920 -0
- package/dist/tools.js +542 -0
- package/dist/tools.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +60 -4
package/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# fundedlytics-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP server for [Fundedlytics](https://fundedlytics.com): prop-firm payouts verified on-chain, firm rules and a dated
|
|
4
|
+
rule-change log. Read-only. Needs a Fundedlytics Pro API key (create one at https://fundedlytics.com/account#keys).
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
FUNDEDLYTICS_API_KEY=fl_live_... npx -y fundedlytics-mcp # stdio
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Or use the hosted server: `https://fundedlytics.com/mcp` (streamable HTTP) with the key in the `X-API-Key` header
|
|
11
|
+
(or `Authorization: Bearer <key>`). Without a key it answers 401; a key whose account has no Pro answers 403.
|
|
12
|
+
|
|
13
|
+
**Tools:** `list_firms`, `firm_stats`, `firm_payouts`, `firm_daily`, `search_wallet`, `rules`,
|
|
14
|
+
`compare_firms`, `rule_changes`, `latest_payouts`, `how_to_subscribe`, and the calculators `check_rules` (would trades or days break
|
|
15
|
+
a plan's rules), `payout_calendar` (next payout dates) and `cost_to_funded` (expected cost to get funded from a pass rate you give).
|
|
16
|
+
Every result includes `sources` URLs. Firm tools (`firm_stats`, `firm_payouts`, `firm_daily`, `rules`, each `compare_firms` entry) include `offer` (a referral code or `null`); `list_firms` includes an `offers` map.
|
|
17
|
+
**Resources:** `fundedlytics://firms`, `fundedlytics://firms/{slug}`, `fundedlytics://methodology`.
|
|
18
|
+
|
|
19
|
+
| Env | Default |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `FUNDEDLYTICS_API_URL` | `https://fundedlytics.com` |
|
|
22
|
+
| `FUNDEDLYTICS_API_KEY` | none. Required: a Fundedlytics Pro API key |
|
|
23
|
+
| `FUNDEDLYTICS_SITE_URL` | `https://fundedlytics.com` (used in source links) |
|
|
24
|
+
| `FUNDEDLYTICS_AFFILIATES_FILE` | none. Hosted server: path to `data/affiliates.json`. Firm tools then return `offer: {code, link, discountText, disclosure}` (link = `/go/<slug>?src=mcp`), else `offer: null` |
|
|
25
|
+
|
|
26
|
+
Claude Code: `claude mcp add fundedlytics -e FUNDEDLYTICS_API_KEY=fl_live_... -- npx -y fundedlytics-mcp`
|
|
27
|
+
Claude Desktop: `{"mcpServers":{"fundedlytics":{"command":"npx","args":["-y","fundedlytics-mcp"],"env":{"FUNDEDLYTICS_API_KEY":"fl_live_..."}}}}`
|
|
28
|
+
|
|
29
|
+
Caveat: on-chain payouts only. Payouts by bank, card or PayPal are not visible, so totals are a lower bound. This is not financial advice.
|
|
30
|
+
|
|
31
|
+
Docs: https://fundedlytics.com/developers/mcp
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm ci
|
|
37
|
+
npm run typecheck && npm run lint && npm test && npm run build
|
|
38
|
+
npm run dev # hosted server from source on :3163 (POST /mcp, GET /healthz)
|
|
39
|
+
npm run lint:openapi # lint ../docs/openapi.yaml
|
|
40
|
+
npm run docs:llms # regenerate ../docs/agents/llms-full.txt
|
|
41
|
+
npm run skill:zip # rebuild ../skills/fundedlytics.zip
|
|
42
|
+
```
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export type LinkMode = 'tracked' | 'param' | 'code' | 'none';
|
|
2
|
+
export type Programme = 'active' | 'pending' | 'none';
|
|
3
|
+
/** What an API / MCP caller sees: the link carries attribution, the code does, both, or neither (plain link). */
|
|
4
|
+
export type PublicMode = 'link' | 'code' | 'both' | 'none';
|
|
5
|
+
/** Placement switches a firm's terms can turn off. Unlisted keys default to allowed. */
|
|
6
|
+
export declare const ALLOW_KEYS: readonly ["site", "deals_index", "seo_discount", "extension", "llms", "email", "telegram", "discord", "x", "mcp", "api", "ai_chat"];
|
|
7
|
+
export type AllowKey = (typeof ALLOW_KEYS)[number];
|
|
8
|
+
export interface AffiliateEntry {
|
|
9
|
+
slug: string;
|
|
10
|
+
programme: Programme;
|
|
11
|
+
linkMode: LinkMode;
|
|
12
|
+
/** Tracked URL from the firm's programme (https, on the firm's own domains). Null for code-only firms. */
|
|
13
|
+
url: string | null;
|
|
14
|
+
/** linkMode "param": query parameter appended to any page on the firm's domains. */
|
|
15
|
+
refParam: {
|
|
16
|
+
name: string;
|
|
17
|
+
value: string;
|
|
18
|
+
} | null;
|
|
19
|
+
/** Our code, null for link-only firms. */
|
|
20
|
+
code: string | null;
|
|
21
|
+
/** The tracked link fills the code in at checkout, so no copy step is needed. */
|
|
22
|
+
codeAutoApplies: boolean;
|
|
23
|
+
discountPct: number | null;
|
|
24
|
+
/** Filled only after the code was seen working at checkout; never guessed. */
|
|
25
|
+
discountText: string;
|
|
26
|
+
/** The discount figure was seen at checkout. Without it no figure is shown anywhere, only "Use code X at checkout". */
|
|
27
|
+
discountVerified: boolean;
|
|
28
|
+
/** Our code tracks the firm's current public promo. */
|
|
29
|
+
mirrorsFirmPromo: boolean;
|
|
30
|
+
checkedAt: string | null;
|
|
31
|
+
terms: string | null;
|
|
32
|
+
expires: string | null;
|
|
33
|
+
allow: Partial<Record<AllowKey, boolean>>;
|
|
34
|
+
/** false: never print the code anywhere (firm bans public codes). */
|
|
35
|
+
publicCode: boolean;
|
|
36
|
+
/** Firm-mandated disclosure shown beside its code or link. */
|
|
37
|
+
extraDisclosure: string | null;
|
|
38
|
+
notes: string | null;
|
|
39
|
+
addedAt: string;
|
|
40
|
+
}
|
|
41
|
+
/** Shown beside every list of firm links, every code and in every API / MCP affiliate object. */
|
|
42
|
+
export declare const DISCLOSURE = "Links to firms may be affiliate links: Fundedlytics may earn a commission at no extra cost to you. It never affects rankings, scores or verdicts.";
|
|
43
|
+
/** Short form for tight spots (sticky bar, table footers). */
|
|
44
|
+
export declare const DISCLOSURE_SHORT = "Links to firms may be affiliate links. It never affects our rankings.";
|
|
45
|
+
export declare const SITE_URL = "https://fundedlytics.com";
|
|
46
|
+
/** Channel tags for ?src=. Short aliases map to the stored placement name. */
|
|
47
|
+
export declare const SRC_ALIASES: Readonly<Record<string, string>>;
|
|
48
|
+
export declare function normalizeSrc(src: string | null | undefined): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* One entry from the file, v2 or the old v1 shape ({slug, code, url, active, ...}). Returns null when the entry is
|
|
51
|
+
* unusable; a bad entry never hides the others.
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseEntry(raw: unknown): AffiliateEntry | null;
|
|
54
|
+
/** The whole file. Not an array = no entries. First entry per slug wins. */
|
|
55
|
+
export declare function parseAffiliates(raw: unknown): AffiliateEntry[];
|
|
56
|
+
/** Programme active and not expired. */
|
|
57
|
+
export declare function isLiveEntry(e: Pick<AffiliateEntry, 'programme' | 'expires'>, nowMs: number): boolean;
|
|
58
|
+
export declare function allowed(e: Pick<AffiliateEntry, 'allow'>, placement: string | null | undefined): boolean;
|
|
59
|
+
/** Over this many days since the last checkout check, the line says "confirm at checkout". */
|
|
60
|
+
export declare const CHECK_STALE_DAYS = 14;
|
|
61
|
+
/** Over this many days the code stops showing until someone checks it again. */
|
|
62
|
+
export declare const CHECK_EXPIRED_DAYS = 30;
|
|
63
|
+
/** Whole days since `checkedAt`, or null when it was never set or does not parse. */
|
|
64
|
+
export declare function checkedAgeDays(e: Pick<AffiliateEntry, 'checkedAt'>, nowMs: number): number | null;
|
|
65
|
+
/** "checked 3 Dec", or "checked 20 Nov, confirm at checkout" past CHECK_STALE_DAYS. Null without a date. */
|
|
66
|
+
export declare function checkedLabel(e: Pick<AffiliateEntry, 'checkedAt'>, nowMs: number): string | null;
|
|
67
|
+
/** The code we may print for this placement, or null (none, banned publicly, switched off here, or not checked for 30 days). */
|
|
68
|
+
export declare function publicCode(e: AffiliateEntry | null | undefined, placement: string | null | undefined, nowMs: number): string | null;
|
|
69
|
+
/** "5% off" or the checked discount text, only when the figure was verified at checkout; else null. */
|
|
70
|
+
export declare function discountLabel(e: Pick<AffiliateEntry, 'discountPct' | 'discountText' | 'discountVerified'>): string | null;
|
|
71
|
+
/** Neutral line for a code: "5% off with code X" when verified, else "Use code X at checkout". */
|
|
72
|
+
export declare function codeLine(e: Pick<AffiliateEntry, 'discountPct' | 'discountText' | 'discountVerified'>, code: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Firms where we print our own code: their own public codes are hidden (owner, 3 Dec: only show ours).
|
|
75
|
+
* Firms without our code keep their public codes.
|
|
76
|
+
*/
|
|
77
|
+
export declare function ourCodeFirms(entries: readonly AffiliateEntry[], nowMs: number, placement?: string): Set<string>;
|
|
78
|
+
/** A firm deal with the firm's own code taken out (code null, the code word removed from the title and marker). */
|
|
79
|
+
export declare function withoutFirmCode<T extends {
|
|
80
|
+
code: string | null;
|
|
81
|
+
title: string;
|
|
82
|
+
marker?: string | null;
|
|
83
|
+
}>(d: T): T;
|
|
84
|
+
/** True when the link itself carries our attribution (tracked URL or ref parameter). */
|
|
85
|
+
export declare function linkCarriesAttribution(e: AffiliateEntry | null | undefined, nowMs: number): boolean;
|
|
86
|
+
export declare function publicMode(e: AffiliateEntry | null | undefined, placement: string | null | undefined, nowMs: number): PublicMode;
|
|
87
|
+
/** A code the visitor has to copy: code mode, or a code the link does not fill in. Null = nothing to copy. */
|
|
88
|
+
export declare function codeToCopy(e: AffiliateEntry | null | undefined, placement: string | null | undefined, nowMs: number): string | null;
|
|
89
|
+
export declare function goPath(slug: string, src: string, to?: string | null): string;
|
|
90
|
+
export declare function goUrl(siteUrl: string, slug: string, src: string, to?: string | null): string;
|
|
91
|
+
/** The affiliate object on every firm in API and MCP results (and anywhere else a firm is handed to a third party). */
|
|
92
|
+
export interface AffiliateInfo {
|
|
93
|
+
url: string;
|
|
94
|
+
mode: PublicMode;
|
|
95
|
+
code?: string;
|
|
96
|
+
discount?: string;
|
|
97
|
+
disclosure: string;
|
|
98
|
+
/** Firm-mandated disclosure, if any, to show beside the code or link. */
|
|
99
|
+
firmDisclosure?: string;
|
|
100
|
+
}
|
|
101
|
+
export declare function affiliateInfo(e: AffiliateEntry | null | undefined, slug: string, src: string, nowMs: number, siteUrl?: string): AffiliateInfo;
|
|
102
|
+
export interface FirmSite {
|
|
103
|
+
website: string | null;
|
|
104
|
+
domains: string[];
|
|
105
|
+
}
|
|
106
|
+
/** https URL whose host is one of the firm's domains or a subdomain of one. */
|
|
107
|
+
export declare function onFirmDomain(url: string, domains: readonly string[]): boolean;
|
|
108
|
+
export type GoResult = {
|
|
109
|
+
kind: 'redirect';
|
|
110
|
+
url: string;
|
|
111
|
+
mode: 'tracked' | 'param' | 'plain';
|
|
112
|
+
deep: boolean;
|
|
113
|
+
} | {
|
|
114
|
+
kind: 'copy';
|
|
115
|
+
url: string;
|
|
116
|
+
code: string;
|
|
117
|
+
deep: boolean;
|
|
118
|
+
} | {
|
|
119
|
+
kind: 'error';
|
|
120
|
+
status: 400 | 404;
|
|
121
|
+
message: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Where /go/<slug>?to=&c= sends the visitor.
|
|
125
|
+
* - No `to`: the tracked URL when the firm has one, else the firm's website.
|
|
126
|
+
* - `to`: only on the firm's own domains (else 400); tracked links cannot carry attribution to a deep page, so it goes
|
|
127
|
+
* there plain (a citation must open the page it cites); `param` firms get their ref parameter appended.
|
|
128
|
+
* - Code-only firms: `copy` (the interstitial page) unless `codeCopied` (c=1: our page already copied it).
|
|
129
|
+
*/
|
|
130
|
+
export declare function resolveGo(e: AffiliateEntry | null | undefined, firm: FirmSite | null, opts: {
|
|
131
|
+
to?: string | null;
|
|
132
|
+
codeCopied?: boolean;
|
|
133
|
+
nowMs: number;
|
|
134
|
+
placement?: string | null;
|
|
135
|
+
}): GoResult;
|
|
136
|
+
export interface FirmDomains {
|
|
137
|
+
slug: string;
|
|
138
|
+
domains: readonly string[];
|
|
139
|
+
}
|
|
140
|
+
/** The firm whose own domains host this URL, or null (explorers, shared help hosts, our own site). */
|
|
141
|
+
export declare function firmForUrl(url: string, firms: readonly FirmDomains[]): string | null;
|
|
142
|
+
/** A firm URL as our /go link (exact deep link kept via `to`); any other URL unchanged. */
|
|
143
|
+
export declare function firmOutUrl(url: string, firms: readonly FirmDomains[], siteUrl: string, src: string): string;
|
|
144
|
+
/** Rewrites every firm URL in a text (markdown links and bare URLs) to /go with `src`. Other URLs stay as they are. */
|
|
145
|
+
export declare function rewriteFirmUrls(text: string, firms: readonly FirmDomains[], siteUrl: string, src: string): string;
|
|
146
|
+
/** The fields of a data/deals.json row the promo-sync check reads. */
|
|
147
|
+
export interface PromoDeal {
|
|
148
|
+
id: string;
|
|
149
|
+
firm: string;
|
|
150
|
+
firstSeen?: string | null;
|
|
151
|
+
endedOn?: string | null;
|
|
152
|
+
start?: string | null;
|
|
153
|
+
}
|
|
154
|
+
export interface PromoSyncIssue {
|
|
155
|
+
slug: string;
|
|
156
|
+
checkedAt: string | null;
|
|
157
|
+
changedOn: string;
|
|
158
|
+
deals: string[];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Firms whose public deals changed (a deal appeared, started or ended) after our entry was last checked at checkout,
|
|
162
|
+
* while that check is older than `staleDays`. A person then re-checks the code and sets checkedAt; nothing is
|
|
163
|
+
* changed automatically, and no discount figure is ever published from this.
|
|
164
|
+
*/
|
|
165
|
+
export declare function promoSyncIssues(entries: readonly AffiliateEntry[], deals: readonly PromoDeal[], nowMs: number, staleDays?: number): PromoSyncIssue[];
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
// GENERATED copy of ../shared/affiliates.ts (cp, header added). Do not edit here; test/affiliates-shared.test.ts fails on drift.
|
|
2
|
+
// Affiliate links and codes (data/affiliates.json v2). One copy of the rules for every service:
|
|
3
|
+
// app/ imports it directly; hub/, mcp/ and api/ get a generated copy (hub: npm run sync-shared;
|
|
4
|
+
// mcp and api: their sync script) and a test fails on drift. No imports, no runtime dependencies.
|
|
5
|
+
//
|
|
6
|
+
// Owner rules (3 Dec 2026):
|
|
7
|
+
// - Every firm link goes through fundedlytics.com/go/<slug>. With a tracked link the route uses it; without one it
|
|
8
|
+
// falls back to the firm's own site. Deep links (`to`) only go to the firm's own domains: never an open redirect.
|
|
9
|
+
// - Codes never affect ranking, scores, "Best" or verdicts. Nothing in this file is read by a ranking function.
|
|
10
|
+
// - Only our code is shown, never a firm's public code in its place.
|
|
11
|
+
// - Per-firm `allow` flags switch placements off (terms of the firm's programme).
|
|
12
|
+
/** Placement switches a firm's terms can turn off. Unlisted keys default to allowed. */
|
|
13
|
+
export const ALLOW_KEYS = [
|
|
14
|
+
'site', 'deals_index', 'seo_discount', 'extension', 'llms', 'email', 'telegram', 'discord', 'x', 'mcp', 'api', 'ai_chat',
|
|
15
|
+
];
|
|
16
|
+
/** Shown beside every list of firm links, every code and in every API / MCP affiliate object. */
|
|
17
|
+
export const DISCLOSURE = 'Links to firms may be affiliate links: Fundedlytics may earn a commission at no extra cost to you. It never affects rankings, scores or verdicts.';
|
|
18
|
+
/** Short form for tight spots (sticky bar, table footers). */
|
|
19
|
+
export const DISCLOSURE_SHORT = 'Links to firms may be affiliate links. It never affects our rankings.';
|
|
20
|
+
export const SITE_URL = 'https://fundedlytics.com';
|
|
21
|
+
/** Channel tags for ?src=. Short aliases map to the stored placement name. */
|
|
22
|
+
export const SRC_ALIASES = { ext: 'extension', tg: 'telegram' };
|
|
23
|
+
export function normalizeSrc(src) {
|
|
24
|
+
if (!src)
|
|
25
|
+
return null;
|
|
26
|
+
const s = src.trim().toLowerCase();
|
|
27
|
+
return SRC_ALIASES[s] ?? s;
|
|
28
|
+
}
|
|
29
|
+
const SLUG_RE = /^[a-z0-9-]{1,64}$/;
|
|
30
|
+
const isStr = (v) => typeof v === 'string';
|
|
31
|
+
const strOrNull = (v) => (isStr(v) && v.trim() ? v.trim() : null);
|
|
32
|
+
/**
|
|
33
|
+
* One entry from the file, v2 or the old v1 shape ({slug, code, url, active, ...}). Returns null when the entry is
|
|
34
|
+
* unusable; a bad entry never hides the others.
|
|
35
|
+
*/
|
|
36
|
+
export function parseEntry(raw) {
|
|
37
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
38
|
+
return null;
|
|
39
|
+
const x = raw;
|
|
40
|
+
if (!isStr(x.slug) || !SLUG_RE.test(x.slug))
|
|
41
|
+
return null;
|
|
42
|
+
const url = strOrNull(x.url);
|
|
43
|
+
if (url !== null && !/^https:\/\//.test(url))
|
|
44
|
+
return null;
|
|
45
|
+
const code = strOrNull(x.code);
|
|
46
|
+
const v1 = typeof x.active === 'boolean' && x.programme === undefined;
|
|
47
|
+
const programme = v1 ? (x.active ? 'active' : 'pending') : x.programme === 'active' || x.programme === 'pending' ? x.programme : 'none';
|
|
48
|
+
let linkMode;
|
|
49
|
+
if (x.linkMode === 'tracked' || x.linkMode === 'param' || x.linkMode === 'code' || x.linkMode === 'none')
|
|
50
|
+
linkMode = x.linkMode;
|
|
51
|
+
else
|
|
52
|
+
linkMode = url ? 'tracked' : code ? 'code' : 'none';
|
|
53
|
+
if ((linkMode === 'tracked') && !url)
|
|
54
|
+
return null;
|
|
55
|
+
const rp = x.refParam;
|
|
56
|
+
const refParam = rp && isStr(rp.name) && isStr(rp.value) && rp.name && rp.value ? { name: rp.name, value: rp.value } : null;
|
|
57
|
+
if (linkMode === 'param' && !refParam)
|
|
58
|
+
return null;
|
|
59
|
+
if (linkMode === 'code' && !code)
|
|
60
|
+
return null;
|
|
61
|
+
const allow = {};
|
|
62
|
+
if (x.allow && typeof x.allow === 'object') {
|
|
63
|
+
for (const k of ALLOW_KEYS) {
|
|
64
|
+
const v = x.allow[k];
|
|
65
|
+
if (typeof v === 'boolean')
|
|
66
|
+
allow[k] = v;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
slug: x.slug,
|
|
71
|
+
programme,
|
|
72
|
+
linkMode,
|
|
73
|
+
url,
|
|
74
|
+
refParam,
|
|
75
|
+
code,
|
|
76
|
+
codeAutoApplies: x.codeAutoApplies === true,
|
|
77
|
+
discountPct: typeof x.discountPct === 'number' && x.discountPct > 0 && x.discountPct < 100 ? x.discountPct : null,
|
|
78
|
+
discountText: isStr(x.discountText) ? x.discountText.trim() : '',
|
|
79
|
+
discountVerified: v1 || x.discountVerified === true,
|
|
80
|
+
mirrorsFirmPromo: x.mirrorsFirmPromo === true,
|
|
81
|
+
checkedAt: strOrNull(x.checkedAt),
|
|
82
|
+
terms: strOrNull(x.terms),
|
|
83
|
+
expires: strOrNull(x.expires),
|
|
84
|
+
allow,
|
|
85
|
+
publicCode: x.publicCode !== false,
|
|
86
|
+
extraDisclosure: strOrNull(x.extraDisclosure),
|
|
87
|
+
notes: strOrNull(x.notes),
|
|
88
|
+
addedAt: isStr(x.addedAt) ? x.addedAt : '',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** The whole file. Not an array = no entries. First entry per slug wins. */
|
|
92
|
+
export function parseAffiliates(raw) {
|
|
93
|
+
if (!Array.isArray(raw))
|
|
94
|
+
return [];
|
|
95
|
+
const seen = new Set();
|
|
96
|
+
const out = [];
|
|
97
|
+
for (const r of raw) {
|
|
98
|
+
const e = parseEntry(r);
|
|
99
|
+
if (e && !seen.has(e.slug)) {
|
|
100
|
+
seen.add(e.slug);
|
|
101
|
+
out.push(e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
/** Programme active and not expired. */
|
|
107
|
+
export function isLiveEntry(e, nowMs) {
|
|
108
|
+
if (e.programme !== 'active')
|
|
109
|
+
return false;
|
|
110
|
+
return !(e.expires && Date.parse(e.expires) <= nowMs);
|
|
111
|
+
}
|
|
112
|
+
export function allowed(e, placement) {
|
|
113
|
+
const key = normalizeSrc(placement);
|
|
114
|
+
if (!key)
|
|
115
|
+
return true;
|
|
116
|
+
const map = {
|
|
117
|
+
firm_hero: 'site', firm_sticky: 'site', firms_table: 'site', rules: 'site', compare: 'site', home: 'site', firm_deals: 'site',
|
|
118
|
+
source: 'site', rule_change: 'site', other: 'site', deals_index: 'deals_index', extension: 'extension', email: 'email',
|
|
119
|
+
telegram: 'telegram', discord: 'discord', x: 'x', mcp: 'mcp', api: 'api', ai_chat: 'ai_chat', llms: 'llms', seo_discount: 'seo_discount',
|
|
120
|
+
};
|
|
121
|
+
const k = map[key];
|
|
122
|
+
if (!k)
|
|
123
|
+
return true;
|
|
124
|
+
return e.allow[k] !== false;
|
|
125
|
+
}
|
|
126
|
+
const DAY_MS = 86_400_000;
|
|
127
|
+
/** Over this many days since the last checkout check, the line says "confirm at checkout". */
|
|
128
|
+
export const CHECK_STALE_DAYS = 14;
|
|
129
|
+
/** Over this many days the code stops showing until someone checks it again. */
|
|
130
|
+
export const CHECK_EXPIRED_DAYS = 30;
|
|
131
|
+
/** Whole days since `checkedAt`, or null when it was never set or does not parse. */
|
|
132
|
+
export function checkedAgeDays(e, nowMs) {
|
|
133
|
+
if (!e.checkedAt)
|
|
134
|
+
return null;
|
|
135
|
+
const t = Date.parse(e.checkedAt);
|
|
136
|
+
return Number.isFinite(t) ? Math.max(0, Math.floor((nowMs - t) / DAY_MS)) : null;
|
|
137
|
+
}
|
|
138
|
+
/** "checked 3 Dec", or "checked 20 Nov, confirm at checkout" past CHECK_STALE_DAYS. Null without a date. */
|
|
139
|
+
export function checkedLabel(e, nowMs) {
|
|
140
|
+
const age = checkedAgeDays(e, nowMs);
|
|
141
|
+
if (age === null || !e.checkedAt)
|
|
142
|
+
return null;
|
|
143
|
+
const d = new Date(Date.parse(e.checkedAt));
|
|
144
|
+
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
145
|
+
const day = `${d.getUTCDate()} ${months[d.getUTCMonth()]}`;
|
|
146
|
+
return age > CHECK_STALE_DAYS ? `checked ${day}, confirm at checkout` : `checked ${day}`;
|
|
147
|
+
}
|
|
148
|
+
/** The code we may print for this placement, or null (none, banned publicly, switched off here, or not checked for 30 days). */
|
|
149
|
+
export function publicCode(e, placement, nowMs) {
|
|
150
|
+
if (!e || !e.code || !e.publicCode || !isLiveEntry(e, nowMs) || !allowed(e, placement))
|
|
151
|
+
return null;
|
|
152
|
+
const age = checkedAgeDays(e, nowMs);
|
|
153
|
+
if (age !== null && age > CHECK_EXPIRED_DAYS)
|
|
154
|
+
return null;
|
|
155
|
+
return e.code;
|
|
156
|
+
}
|
|
157
|
+
/** "5% off" or the checked discount text, only when the figure was verified at checkout; else null. */
|
|
158
|
+
export function discountLabel(e) {
|
|
159
|
+
if (!e.discountVerified)
|
|
160
|
+
return null;
|
|
161
|
+
if (e.discountText)
|
|
162
|
+
return e.discountText;
|
|
163
|
+
return e.discountPct ? `${e.discountPct}% off` : null;
|
|
164
|
+
}
|
|
165
|
+
/** Neutral line for a code: "5% off with code X" when verified, else "Use code X at checkout". */
|
|
166
|
+
export function codeLine(e, code) {
|
|
167
|
+
const d = discountLabel(e);
|
|
168
|
+
return d ? `${d} with code ${code}` : `Use code ${code} at checkout`;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Firms where we print our own code: their own public codes are hidden (owner, 3 Dec: only show ours).
|
|
172
|
+
* Firms without our code keep their public codes.
|
|
173
|
+
*/
|
|
174
|
+
export function ourCodeFirms(entries, nowMs, placement = 'site') {
|
|
175
|
+
const out = new Set();
|
|
176
|
+
for (const e of entries)
|
|
177
|
+
if (publicCode(e, placement, nowMs))
|
|
178
|
+
out.add(e.slug);
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
/** A firm deal with the firm's own code taken out (code null, the code word removed from the title and marker). */
|
|
182
|
+
export function withoutFirmCode(d) {
|
|
183
|
+
if (!d.code)
|
|
184
|
+
return d;
|
|
185
|
+
const esc = d.code.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
186
|
+
const title = d.title
|
|
187
|
+
.replace(new RegExp(`[,:;]?\\s*(?:with\\s+|use\\s+)?(?:promo\\s+|coupon\\s+|discount\\s+)?(?:code\\s+)?${esc}\\b`, 'gi'), '')
|
|
188
|
+
.replace(/\s{2,}/g, ' ')
|
|
189
|
+
.replace(/^[\s,:;.]+/, '')
|
|
190
|
+
.trim();
|
|
191
|
+
const out = { ...d, code: null, title: title || d.title.replace(d.code, '').trim() };
|
|
192
|
+
if (typeof d.marker === 'string' && d.marker.toUpperCase() === d.code.toUpperCase())
|
|
193
|
+
out.marker = null;
|
|
194
|
+
return out;
|
|
195
|
+
}
|
|
196
|
+
/** True when the link itself carries our attribution (tracked URL or ref parameter). */
|
|
197
|
+
export function linkCarriesAttribution(e, nowMs) {
|
|
198
|
+
return !!e && isLiveEntry(e, nowMs) && (e.linkMode === 'tracked' || e.linkMode === 'param');
|
|
199
|
+
}
|
|
200
|
+
export function publicMode(e, placement, nowMs) {
|
|
201
|
+
const link = linkCarriesAttribution(e, nowMs);
|
|
202
|
+
const code = publicCode(e, placement, nowMs) !== null;
|
|
203
|
+
return link && code ? 'both' : link ? 'link' : code ? 'code' : 'none';
|
|
204
|
+
}
|
|
205
|
+
/** A code the visitor has to copy: code mode, or a code the link does not fill in. Null = nothing to copy. */
|
|
206
|
+
export function codeToCopy(e, placement, nowMs) {
|
|
207
|
+
const code = publicCode(e, placement, nowMs);
|
|
208
|
+
if (!code || !e)
|
|
209
|
+
return null;
|
|
210
|
+
if (e.linkMode === 'code')
|
|
211
|
+
return code;
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
export function goPath(slug, src, to) {
|
|
215
|
+
const q = new URLSearchParams({ src });
|
|
216
|
+
if (to)
|
|
217
|
+
q.set('to', to);
|
|
218
|
+
return `/go/${encodeURIComponent(slug)}?${q.toString()}`;
|
|
219
|
+
}
|
|
220
|
+
export function goUrl(siteUrl, slug, src, to) {
|
|
221
|
+
return `${siteUrl.replace(/\/+$/, '')}${goPath(slug, src, to)}`;
|
|
222
|
+
}
|
|
223
|
+
export function affiliateInfo(e, slug, src, nowMs, siteUrl = SITE_URL) {
|
|
224
|
+
const code = publicCode(e, src, nowMs);
|
|
225
|
+
const out = { url: goUrl(siteUrl, slug, src), mode: publicMode(e, src, nowMs), disclosure: DISCLOSURE };
|
|
226
|
+
if (code && e) {
|
|
227
|
+
out.code = code;
|
|
228
|
+
const d = discountLabel(e);
|
|
229
|
+
if (d)
|
|
230
|
+
out.discount = d;
|
|
231
|
+
}
|
|
232
|
+
if (e && e.extraDisclosure && isLiveEntry(e, nowMs))
|
|
233
|
+
out.firmDisclosure = e.extraDisclosure;
|
|
234
|
+
return out;
|
|
235
|
+
}
|
|
236
|
+
/** https URL whose host is one of the firm's domains or a subdomain of one. */
|
|
237
|
+
export function onFirmDomain(url, domains) {
|
|
238
|
+
let u;
|
|
239
|
+
try {
|
|
240
|
+
u = new URL(url);
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
if (u.protocol !== 'https:' && u.protocol !== 'http:')
|
|
246
|
+
return false;
|
|
247
|
+
if (u.username || u.password)
|
|
248
|
+
return false;
|
|
249
|
+
const host = u.hostname.toLowerCase().replace(/\.$/, '');
|
|
250
|
+
return domains.some((d) => {
|
|
251
|
+
const dom = d.toLowerCase().replace(/^www\./, '');
|
|
252
|
+
return host === dom || host.endsWith(`.${dom}`);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Where /go/<slug>?to=&c= sends the visitor.
|
|
257
|
+
* - No `to`: the tracked URL when the firm has one, else the firm's website.
|
|
258
|
+
* - `to`: only on the firm's own domains (else 400); tracked links cannot carry attribution to a deep page, so it goes
|
|
259
|
+
* there plain (a citation must open the page it cites); `param` firms get their ref parameter appended.
|
|
260
|
+
* - Code-only firms: `copy` (the interstitial page) unless `codeCopied` (c=1: our page already copied it).
|
|
261
|
+
*/
|
|
262
|
+
export function resolveGo(e, firm, opts) {
|
|
263
|
+
if (!firm)
|
|
264
|
+
return { kind: 'error', status: 404, message: 'Unknown firm.' };
|
|
265
|
+
const live = !!e && isLiveEntry(e, opts.nowMs);
|
|
266
|
+
const to = opts.to?.trim() || null;
|
|
267
|
+
if (to && !onFirmDomain(to, firm.domains))
|
|
268
|
+
return { kind: 'error', status: 400, message: 'That link is not on this firm\'s own site.' };
|
|
269
|
+
const website = firm.website && /^https?:\/\//.test(firm.website) ? firm.website : null;
|
|
270
|
+
let url;
|
|
271
|
+
let mode = 'plain';
|
|
272
|
+
if (live && e.linkMode === 'tracked' && !to && e.url) {
|
|
273
|
+
url = e.url;
|
|
274
|
+
mode = 'tracked';
|
|
275
|
+
}
|
|
276
|
+
else if (live && e.linkMode === 'param' && e.refParam) {
|
|
277
|
+
const base = to ?? e.url ?? website;
|
|
278
|
+
if (!base)
|
|
279
|
+
return { kind: 'error', status: 404, message: 'No website on file for this firm.' };
|
|
280
|
+
const u = new URL(base);
|
|
281
|
+
u.searchParams.set(e.refParam.name, e.refParam.value);
|
|
282
|
+
url = u.toString();
|
|
283
|
+
mode = 'param';
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
const base = to ?? website;
|
|
287
|
+
if (!base)
|
|
288
|
+
return { kind: 'error', status: 404, message: 'No website on file for this firm.' };
|
|
289
|
+
url = base;
|
|
290
|
+
}
|
|
291
|
+
const code = codeToCopy(e, opts.placement ?? null, opts.nowMs);
|
|
292
|
+
if (code && !opts.codeCopied)
|
|
293
|
+
return { kind: 'copy', url, code, deep: !!to };
|
|
294
|
+
return { kind: 'redirect', url, mode, deep: !!to };
|
|
295
|
+
}
|
|
296
|
+
/** The firm whose own domains host this URL, or null (explorers, shared help hosts, our own site). */
|
|
297
|
+
export function firmForUrl(url, firms) {
|
|
298
|
+
for (const f of firms)
|
|
299
|
+
if (f.domains.length && onFirmDomain(url, f.domains))
|
|
300
|
+
return f.slug;
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
/** A firm URL as our /go link (exact deep link kept via `to`); any other URL unchanged. */
|
|
304
|
+
export function firmOutUrl(url, firms, siteUrl, src) {
|
|
305
|
+
const slug = firmForUrl(url, firms);
|
|
306
|
+
return slug ? goUrl(siteUrl, slug, src, url) : url;
|
|
307
|
+
}
|
|
308
|
+
/** Rewrites every firm URL in a text (markdown links and bare URLs) to /go with `src`. Other URLs stay as they are. */
|
|
309
|
+
export function rewriteFirmUrls(text, firms, siteUrl, src) {
|
|
310
|
+
if (!text || !firms.length)
|
|
311
|
+
return text;
|
|
312
|
+
return text.replace(/https?:\/\/[^\s)<>\]"'`]+/g, (m) => {
|
|
313
|
+
const trail = /[.,;:!?]+$/.exec(m)?.[0] ?? '';
|
|
314
|
+
const url = trail ? m.slice(0, -trail.length) : m;
|
|
315
|
+
return firmOutUrl(url, firms, siteUrl, src) + trail;
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Firms whose public deals changed (a deal appeared, started or ended) after our entry was last checked at checkout,
|
|
320
|
+
* while that check is older than `staleDays`. A person then re-checks the code and sets checkedAt; nothing is
|
|
321
|
+
* changed automatically, and no discount figure is ever published from this.
|
|
322
|
+
*/
|
|
323
|
+
export function promoSyncIssues(entries, deals, nowMs, staleDays = CHECK_STALE_DAYS) {
|
|
324
|
+
const out = [];
|
|
325
|
+
for (const e of entries) {
|
|
326
|
+
if (!isLiveEntry(e, nowMs))
|
|
327
|
+
continue;
|
|
328
|
+
const age = checkedAgeDays(e, nowMs);
|
|
329
|
+
if (age !== null && age <= staleDays)
|
|
330
|
+
continue;
|
|
331
|
+
const checked = e.checkedAt ? Date.parse(e.checkedAt) : Number.NEGATIVE_INFINITY;
|
|
332
|
+
let changed = '';
|
|
333
|
+
const ids = [];
|
|
334
|
+
for (const d of deals) {
|
|
335
|
+
if (d.firm !== e.slug)
|
|
336
|
+
continue;
|
|
337
|
+
const dates = [d.firstSeen, d.endedOn, d.start].filter((x) => typeof x === 'string' && Number.isFinite(Date.parse(x)) && Date.parse(x) > checked && Date.parse(x) <= nowMs);
|
|
338
|
+
if (!dates.length)
|
|
339
|
+
continue;
|
|
340
|
+
ids.push(d.id);
|
|
341
|
+
for (const x of dates)
|
|
342
|
+
if (x > changed)
|
|
343
|
+
changed = x;
|
|
344
|
+
}
|
|
345
|
+
if (ids.length)
|
|
346
|
+
out.push({ slug: e.slug, checkedAt: e.checkedAt, changedOn: changed.slice(0, 10), deals: ids });
|
|
347
|
+
}
|
|
348
|
+
return out;
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=affiliates-sh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