@percher/shared 1.0.2 → 1.2.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/billing-test-accounts.d.ts +20 -0
- package/dist/billing-test-accounts.d.ts.map +1 -0
- package/dist/billing-test-accounts.js +32 -0
- package/dist/billing-test-accounts.js.map +1 -0
- package/dist/crash-prompt.d.ts +8 -0
- package/dist/crash-prompt.d.ts.map +1 -0
- package/dist/crash-prompt.js +10 -0
- package/dist/crash-prompt.js.map +1 -0
- package/dist/data-filter.d.ts +27 -0
- package/dist/data-filter.d.ts.map +1 -0
- package/dist/data-filter.js +288 -0
- package/dist/data-filter.js.map +1 -0
- package/dist/data-records.d.ts +359 -0
- package/dist/data-records.d.ts.map +1 -0
- package/dist/data-records.js +124 -0
- package/dist/data-records.js.map +1 -0
- package/dist/disposable-email-domains.d.ts +11 -0
- package/dist/disposable-email-domains.d.ts.map +1 -0
- package/dist/disposable-email-domains.js +112 -0
- package/dist/disposable-email-domains.js.map +1 -0
- package/dist/domain-name.d.ts +14 -0
- package/dist/domain-name.d.ts.map +1 -0
- package/dist/domain-name.js +14 -0
- package/dist/domain-name.js.map +1 -0
- package/dist/email-budget.d.ts +60 -0
- package/dist/email-budget.d.ts.map +1 -0
- package/dist/email-budget.js +135 -0
- package/dist/email-budget.js.map +1 -0
- package/dist/env-mask.d.ts +17 -0
- package/dist/env-mask.d.ts.map +1 -0
- package/dist/env-mask.js +23 -0
- package/dist/env-mask.js.map +1 -0
- package/dist/env-name.d.ts +25 -0
- package/dist/env-name.d.ts.map +1 -0
- package/dist/env-name.js +25 -0
- package/dist/env-name.js.map +1 -0
- package/dist/escape-html.d.ts +10 -0
- package/dist/escape-html.d.ts.map +1 -0
- package/dist/escape-html.js +17 -0
- package/dist/escape-html.js.map +1 -0
- package/dist/image-rejection.d.ts +45 -0
- package/dist/image-rejection.d.ts.map +1 -0
- package/dist/image-rejection.js +27 -0
- package/dist/image-rejection.js.map +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/internal-sig.d.ts +2 -2
- package/dist/internal-sig.js +2 -2
- package/dist/legal-changes.d.ts +5 -7
- package/dist/legal-changes.d.ts.map +1 -1
- package/dist/legal-changes.js +189 -6
- package/dist/legal-changes.js.map +1 -1
- package/dist/legal.d.ts +16 -16
- package/dist/legal.d.ts.map +1 -1
- package/dist/legal.js +15 -15
- package/dist/legal.js.map +1 -1
- package/dist/oauth-scopes.d.ts +8 -0
- package/dist/oauth-scopes.d.ts.map +1 -1
- package/dist/oauth-scopes.js +11 -13
- package/dist/oauth-scopes.js.map +1 -1
- package/dist/platform.d.ts +2 -2
- package/dist/platform.js +2 -2
- package/dist/secure-compare.d.ts +16 -0
- package/dist/secure-compare.d.ts.map +1 -0
- package/dist/secure-compare.js +27 -0
- package/dist/secure-compare.js.map +1 -0
- package/dist/signup-capacity.d.ts +12 -0
- package/dist/signup-capacity.d.ts.map +1 -0
- package/dist/signup-capacity.js +29 -0
- package/dist/signup-capacity.js.map +1 -0
- package/dist/signup-day.d.ts +7 -0
- package/dist/signup-day.d.ts.map +1 -0
- package/dist/signup-day.js +42 -0
- package/dist/signup-day.js.map +1 -0
- package/dist/switches.d.ts +88 -0
- package/dist/switches.d.ts.map +1 -0
- package/dist/switches.js +232 -0
- package/dist/switches.js.map +1 -0
- package/dist/waitlist-token.d.ts +49 -0
- package/dist/waitlist-token.d.ts.map +1 -0
- package/dist/waitlist-token.js +71 -0
- package/dist/waitlist-token.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A bare DNS hostname as Percher accepts it for custom domains: lowercase
|
|
3
|
+
* labels of 1 to 63 characters that neither start nor end with a hyphen, at
|
|
4
|
+
* least two labels, an alphabetic top-level label of two or more characters,
|
|
5
|
+
* and at most 253 characters in all. No protocol, no port, no trailing dot.
|
|
6
|
+
*
|
|
7
|
+
* One rule for the API's domain service and the worker's provision guard.
|
|
8
|
+
* The percher.toml schema (`@percher/toml`) carries the same pattern by
|
|
9
|
+
* value and lowercases before matching; it imports this one once a shared
|
|
10
|
+
* release carries it (cross-package exports move with version bumps).
|
|
11
|
+
* `packages/shared/test/domain-name.test.ts` fails if the two texts drift.
|
|
12
|
+
*/
|
|
13
|
+
export const DOMAIN_RE = /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
14
|
+
//# sourceMappingURL=domain-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-name.js","sourceRoot":"","sources":["../src/domain-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,uEAAuE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Resend free tier: 100/day, 3,000/month. UTC calendar windows. */
|
|
2
|
+
export declare const EMAIL_BUDGET_LIMITS: {
|
|
3
|
+
readonly daily: 95;
|
|
4
|
+
readonly monthly: 2900;
|
|
5
|
+
readonly notificationDaily: 45;
|
|
6
|
+
readonly crashPerAppDaily: 3;
|
|
7
|
+
};
|
|
8
|
+
export type EmailCategory = "auth" | "operator" | "legal" | "notification";
|
|
9
|
+
interface EmailBudgetCounts {
|
|
10
|
+
total: number;
|
|
11
|
+
auth: number;
|
|
12
|
+
operator: number;
|
|
13
|
+
legal: number;
|
|
14
|
+
notification: number;
|
|
15
|
+
}
|
|
16
|
+
export interface EmailBudgetConnection {
|
|
17
|
+
run(query: string, params?: (string | number)[]): void;
|
|
18
|
+
/** Drizzle's raw Bun SQLite queries return positional rows. */
|
|
19
|
+
get<T extends unknown[]>(query: string, params?: (string | number)[]): T | undefined;
|
|
20
|
+
}
|
|
21
|
+
interface EmailBudgetDatabase extends EmailBudgetConnection {
|
|
22
|
+
immediate<T>(work: (connection: EmailBudgetConnection) => T): T;
|
|
23
|
+
}
|
|
24
|
+
interface EmailBudgetDecision {
|
|
25
|
+
allowed: boolean;
|
|
26
|
+
category: EmailCategory;
|
|
27
|
+
dayKey: string;
|
|
28
|
+
reason?: "notification_daily" | "daily" | "monthly" | "crash_daily";
|
|
29
|
+
overCeiling: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Dashboard-only startup must coexist with the API's migration. */
|
|
32
|
+
export declare const EMAIL_BUDGET_SCHEMA = "\nCREATE TABLE IF NOT EXISTS email_budget_counters (\n period TEXT PRIMARY KEY NOT NULL,\n total INTEGER NOT NULL DEFAULT 0,\n auth INTEGER NOT NULL DEFAULT 0,\n operator INTEGER NOT NULL DEFAULT 0,\n legal INTEGER NOT NULL DEFAULT 0,\n notification INTEGER NOT NULL DEFAULT 0,\n warning INTEGER NOT NULL DEFAULT 0\n);\nCREATE TABLE IF NOT EXISTS email_budget_crashes (\n day TEXT NOT NULL,\n app_id TEXT NOT NULL,\n count INTEGER NOT NULL DEFAULT 0,\n PRIMARY KEY (day, app_id)\n);";
|
|
33
|
+
/** Attempts, not successful deliveries: uncertain sends never release capacity. */
|
|
34
|
+
export declare class EmailBudget {
|
|
35
|
+
private readonly db;
|
|
36
|
+
private readonly now;
|
|
37
|
+
onWarning?: (usage: ReturnType<EmailBudget["usage"]>) => Promise<unknown>;
|
|
38
|
+
constructor(db: EmailBudgetDatabase, now?: () => Date);
|
|
39
|
+
reserve(category: EmailCategory, options?: {
|
|
40
|
+
count?: number;
|
|
41
|
+
crashAppId?: string;
|
|
42
|
+
}): EmailBudgetDecision;
|
|
43
|
+
usage(at?: Date): {
|
|
44
|
+
dayKey: string;
|
|
45
|
+
monthKey: string;
|
|
46
|
+
day: EmailBudgetCounts;
|
|
47
|
+
month: EmailBudgetCounts;
|
|
48
|
+
limits: {
|
|
49
|
+
readonly daily: 95;
|
|
50
|
+
readonly monthly: 2900;
|
|
51
|
+
readonly notificationDaily: 45;
|
|
52
|
+
readonly crashPerAppDaily: 3;
|
|
53
|
+
};
|
|
54
|
+
uncountedOperatorSenders: string[];
|
|
55
|
+
};
|
|
56
|
+
/** The dashboard leaves a durable pending warning; API monitoring drains it. */
|
|
57
|
+
dispatchWarning(): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=email-budget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-budget.d.ts","sourceRoot":"","sources":["../src/email-budget.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,eAAO,MAAM,mBAAmB;aAC9B,KAAK,EAAE,EAAE;aACT,OAAO,EAAE,IAAK;aACd,iBAAiB,EAAE,EAAE;aACrB,gBAAgB,EAAE,CAAC;CACX,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,CAAC;AAC3E,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IACvD,+DAA+D;IAC/D,GAAG,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CACtF;AACD,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,qBAAqB,KAAK,CAAC,GAAG,CAAC,CAAC;CACjE;AACD,UAAU,mBAAmB;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;IACpE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,kfAe7B,CAAC;AAoBJ,mFAAmF;AACnF,qBAAa,WAAW;IAIpB,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAJtB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1E,YACmB,EAAE,EAAE,mBAAmB,EACvB,GAAG,GAAE,MAAM,IAAuB,EACjD;IAEJ,OAAO,CACL,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAO,GACpD,mBAAmB,CAgErB;IAED,KAAK,CAAC,EAAE,OAAa;;;;;;4BAhJd,EAAE;8BACA,IAAK;wCACK,EAAE;uCACH,CAAC;;;MAwJlB;IAED,gFAAgF;IAC1E,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAarC;CACF"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/** Resend free tier: 100/day, 3,000/month. UTC calendar windows. */
|
|
2
|
+
export const EMAIL_BUDGET_LIMITS = {
|
|
3
|
+
daily: 95,
|
|
4
|
+
monthly: 2_900,
|
|
5
|
+
notificationDaily: 45,
|
|
6
|
+
crashPerAppDaily: 3,
|
|
7
|
+
};
|
|
8
|
+
/** Dashboard-only startup must coexist with the API's migration. */
|
|
9
|
+
export const EMAIL_BUDGET_SCHEMA = `
|
|
10
|
+
CREATE TABLE IF NOT EXISTS email_budget_counters (
|
|
11
|
+
period TEXT PRIMARY KEY NOT NULL,
|
|
12
|
+
total INTEGER NOT NULL DEFAULT 0,
|
|
13
|
+
auth INTEGER NOT NULL DEFAULT 0,
|
|
14
|
+
operator INTEGER NOT NULL DEFAULT 0,
|
|
15
|
+
legal INTEGER NOT NULL DEFAULT 0,
|
|
16
|
+
notification INTEGER NOT NULL DEFAULT 0,
|
|
17
|
+
warning INTEGER NOT NULL DEFAULT 0
|
|
18
|
+
);
|
|
19
|
+
CREATE TABLE IF NOT EXISTS email_budget_crashes (
|
|
20
|
+
day TEXT NOT NULL,
|
|
21
|
+
app_id TEXT NOT NULL,
|
|
22
|
+
count INTEGER NOT NULL DEFAULT 0,
|
|
23
|
+
PRIMARY KEY (day, app_id)
|
|
24
|
+
);`;
|
|
25
|
+
const emptyCounts = () => ({
|
|
26
|
+
total: 0,
|
|
27
|
+
auth: 0,
|
|
28
|
+
operator: 0,
|
|
29
|
+
legal: 0,
|
|
30
|
+
notification: 0,
|
|
31
|
+
});
|
|
32
|
+
function readCounts(db, period) {
|
|
33
|
+
const row = db.get("SELECT total, auth, operator, legal, notification FROM email_budget_counters WHERE period = ?", [period]);
|
|
34
|
+
if (!row)
|
|
35
|
+
return emptyCounts();
|
|
36
|
+
const [total, auth, operator, legal, notification] = row;
|
|
37
|
+
return { total, auth, operator, legal, notification };
|
|
38
|
+
}
|
|
39
|
+
/** Attempts, not successful deliveries: uncertain sends never release capacity. */
|
|
40
|
+
export class EmailBudget {
|
|
41
|
+
db;
|
|
42
|
+
now;
|
|
43
|
+
onWarning;
|
|
44
|
+
constructor(db, now = () => new Date()) {
|
|
45
|
+
this.db = db;
|
|
46
|
+
this.now = now;
|
|
47
|
+
}
|
|
48
|
+
reserve(category, options = {}) {
|
|
49
|
+
if (!["auth", "operator", "legal", "notification"].includes(category))
|
|
50
|
+
throw new Error("Invalid email category");
|
|
51
|
+
const count = options.count ?? 1;
|
|
52
|
+
if (!Number.isSafeInteger(count) || count < 1)
|
|
53
|
+
throw new Error("Invalid email recipient count");
|
|
54
|
+
if (options.crashAppId !== undefined && (category !== "notification" || !options.crashAppId))
|
|
55
|
+
throw new Error("Invalid crash email category or app");
|
|
56
|
+
const dayKey = this.now().toISOString().slice(0, 10);
|
|
57
|
+
const periods = [`day:${dayKey}`, `month:${dayKey.slice(0, 7)}`];
|
|
58
|
+
const decision = this.db.immediate((db) => {
|
|
59
|
+
for (const period of periods)
|
|
60
|
+
db.run("INSERT OR IGNORE INTO email_budget_counters (period) VALUES (?)", [period]);
|
|
61
|
+
const day = readCounts(db, periods[0]);
|
|
62
|
+
const month = readCounts(db, periods[1]);
|
|
63
|
+
const reason = day.total + count > EMAIL_BUDGET_LIMITS.daily
|
|
64
|
+
? "daily"
|
|
65
|
+
: month.total + count > EMAIL_BUDGET_LIMITS.monthly
|
|
66
|
+
? "monthly"
|
|
67
|
+
: category === "notification" &&
|
|
68
|
+
day.notification + count > EMAIL_BUDGET_LIMITS.notificationDaily
|
|
69
|
+
? "notification_daily"
|
|
70
|
+
: undefined;
|
|
71
|
+
if (category === "notification" && reason)
|
|
72
|
+
return { allowed: false, category, dayKey, reason, overCeiling: false };
|
|
73
|
+
if (options.crashAppId !== undefined) {
|
|
74
|
+
const crash = db.get("SELECT count FROM email_budget_crashes WHERE day = ? AND app_id = ?", [dayKey, options.crashAppId]);
|
|
75
|
+
if ((crash?.[0] ?? 0) >= EMAIL_BUDGET_LIMITS.crashPerAppDaily)
|
|
76
|
+
return {
|
|
77
|
+
allowed: false,
|
|
78
|
+
category,
|
|
79
|
+
dayKey,
|
|
80
|
+
reason: "crash_daily",
|
|
81
|
+
overCeiling: false,
|
|
82
|
+
};
|
|
83
|
+
db.run("INSERT INTO email_budget_crashes (day, app_id, count) VALUES (?, ?, 1) ON CONFLICT(day, app_id) DO UPDATE SET count = count + 1", [dayKey, options.crashAppId]);
|
|
84
|
+
}
|
|
85
|
+
for (const period of periods)
|
|
86
|
+
db.run(`UPDATE email_budget_counters SET total = total + ?, ${category} = ${category} + ? WHERE period = ?`, [count, count, period]);
|
|
87
|
+
if (reason)
|
|
88
|
+
db.run("UPDATE email_budget_counters SET warning = 1 WHERE period = ? AND warning = 0", [
|
|
89
|
+
periods[0],
|
|
90
|
+
]);
|
|
91
|
+
return { allowed: true, category, dayKey, reason, overCeiling: reason !== undefined };
|
|
92
|
+
});
|
|
93
|
+
if (!decision.allowed || decision.overCeiling) {
|
|
94
|
+
const line = JSON.stringify({
|
|
95
|
+
event: decision.allowed ? "email_budget_priority_overflow" : "email_budget_skipped",
|
|
96
|
+
...decision,
|
|
97
|
+
crashAppId: options.crashAppId,
|
|
98
|
+
});
|
|
99
|
+
if (decision.overCeiling)
|
|
100
|
+
console.error(line);
|
|
101
|
+
else
|
|
102
|
+
console.warn(line);
|
|
103
|
+
}
|
|
104
|
+
return decision;
|
|
105
|
+
}
|
|
106
|
+
usage(at = this.now()) {
|
|
107
|
+
const dayKey = at.toISOString().slice(0, 10);
|
|
108
|
+
const monthKey = dayKey.slice(0, 7);
|
|
109
|
+
return {
|
|
110
|
+
dayKey,
|
|
111
|
+
monthKey,
|
|
112
|
+
day: readCounts(this.db, `day:${dayKey}`),
|
|
113
|
+
month: readCounts(this.db, `month:${monthKey}`),
|
|
114
|
+
limits: EMAIL_BUDGET_LIMITS,
|
|
115
|
+
uncountedOperatorSenders: ["infra/scripts/lib/backup-alert.py"],
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** The dashboard leaves a durable pending warning; API monitoring drains it. */
|
|
119
|
+
async dispatchWarning() {
|
|
120
|
+
if (!this.onWarning)
|
|
121
|
+
return;
|
|
122
|
+
const claimed = this.db.get("UPDATE email_budget_counters SET warning = 2 WHERE period = (SELECT period FROM email_budget_counters WHERE period LIKE 'day:%' AND warning = 1 ORDER BY period LIMIT 1) AND warning = 1 RETURNING period");
|
|
123
|
+
if (!claimed)
|
|
124
|
+
return;
|
|
125
|
+
const [period] = claimed;
|
|
126
|
+
// Claim before dispatch: an operator warning itself goes through this budget.
|
|
127
|
+
try {
|
|
128
|
+
await this.onWarning(this.usage(new Date(`${period.slice(4)}T00:00:00Z`)));
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
console.error(JSON.stringify({ event: "email_budget_warning_failed", period }));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=email-budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-budget.js","sourceRoot":"","sources":["../src/email-budget.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,KAAK;IACd,iBAAiB,EAAE,EAAE;IACrB,gBAAgB,EAAE,CAAC;CACX,CAAC;AA0BX,oEAAoE;AACpE,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;GAehC,CAAC;AAEJ,MAAM,WAAW,GAAG,GAAsB,EAAE,CAAC,CAAC;IAC5C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,CAAC;IACX,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,EAAyB,EAAE,MAAc;IAC3D,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAChB,+FAA+F,EAC/F,CAAC,MAAM,CAAC,CACT,CAAC;IACF,IAAI,CAAC,GAAG;QAAE,OAAO,WAAW,EAAE,CAAC;IAC/B,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC;IACzD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACxD,CAAC;AAED,mFAAmF;AACnF,MAAM,OAAO,WAAW;IAIH,EAAE;IACF,GAAG;IAJtB,SAAS,CAAiE;IAE1E,YACmB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IACJ,CAAC;IAED,gFAAgF;IAChF,KAAK,CAAC,eAAe;QACnB,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CACzB,2MAA2M,CAC5M,CAAC;QACF,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;QACzB,8EAA8E;QAC9E,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The mask every surface shows for a hidden environment value. */
|
|
2
|
+
export declare const ENV_MASK = "\u2022\u2022\u2022\u2022";
|
|
3
|
+
/**
|
|
4
|
+
* Mask an environment value for display: values of eight characters or
|
|
5
|
+
* fewer are hidden entirely, longer ones show their first four characters.
|
|
6
|
+
* One rule for the API listing, the dashboard's paste preview and the CLI,
|
|
7
|
+
* which used to disagree (the CLI returned values of eight characters or
|
|
8
|
+
* fewer unmasked; the dashboard showed two characters).
|
|
9
|
+
*/
|
|
10
|
+
export declare function maskEnvValue(value: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* True for a string shaped like `maskEnvValue`'s output. A client that
|
|
13
|
+
* re-masks what the API already masked uses this to leave the API's
|
|
14
|
+
* four-character hint intact instead of collapsing it to the bare mask.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isMaskedEnvValue(value: string): boolean;
|
|
17
|
+
//# sourceMappingURL=env-mask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-mask.d.ts","sourceRoot":"","sources":["../src/env-mask.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,eAAO,MAAM,QAAQ,6BAAS,CAAC;AAE/B;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
package/dist/env-mask.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The mask every surface shows for a hidden environment value. */
|
|
2
|
+
export const ENV_MASK = "••••";
|
|
3
|
+
/**
|
|
4
|
+
* Mask an environment value for display: values of eight characters or
|
|
5
|
+
* fewer are hidden entirely, longer ones show their first four characters.
|
|
6
|
+
* One rule for the API listing, the dashboard's paste preview and the CLI,
|
|
7
|
+
* which used to disagree (the CLI returned values of eight characters or
|
|
8
|
+
* fewer unmasked; the dashboard showed two characters).
|
|
9
|
+
*/
|
|
10
|
+
export function maskEnvValue(value) {
|
|
11
|
+
if (value.length <= 8)
|
|
12
|
+
return ENV_MASK;
|
|
13
|
+
return `${value.slice(0, 4)}${ENV_MASK}`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* True for a string shaped like `maskEnvValue`'s output. A client that
|
|
17
|
+
* re-masks what the API already masked uses this to leave the API's
|
|
18
|
+
* four-character hint intact instead of collapsing it to the bare mask.
|
|
19
|
+
*/
|
|
20
|
+
export function isMaskedEnvValue(value) {
|
|
21
|
+
return /^[^•]{0,4}••••$/.test(value);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=env-mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-mask.js","sourceRoot":"","sources":["../src/env-mask.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACvC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An environment variable NAME as Percher stores and injects it: uppercase
|
|
3
|
+
* letters, digits and underscores, not starting with a digit, 1 to 256
|
|
4
|
+
* characters. The length is part of the pattern so a copy cannot carry the
|
|
5
|
+
* alphabet and forget the bound.
|
|
6
|
+
*
|
|
7
|
+
* This is the API's rule (`PUT /apps/:app/env`), so it is the contract: a
|
|
8
|
+
* client that accepts more sends a batch the API refuses whole, and one that
|
|
9
|
+
* accepts less hides a name the API would have stored.
|
|
10
|
+
*
|
|
11
|
+
* The API and the dashboard import it. `@percher/toml` (`ENV_NAME_RE`) and
|
|
12
|
+
* `@percher/client` (`KEY_PATTERN` in env-file.ts) carry the same pattern by
|
|
13
|
+
* value; they import this one once a shared release carries it (cross-package
|
|
14
|
+
* exports move with version bumps). `packages/shared/test/env-name.test.ts`
|
|
15
|
+
* fails if the texts drift.
|
|
16
|
+
*
|
|
17
|
+
* Two rules are wider on purpose and are NOT copies:
|
|
18
|
+
* - the worker's run-payload guard also admits lowercase, because the platform
|
|
19
|
+
* injects `http_proxy`/`https_proxy`/`no_proxy` and because a name stored
|
|
20
|
+
* before the API required uppercase must still reach its container;
|
|
21
|
+
* - `isEnvKey` in `@percher/core` validates names the API REPORTS, and the
|
|
22
|
+
* source scanner reports references in whatever case the source wrote.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ENV_NAME_RE: RegExp;
|
|
25
|
+
//# sourceMappingURL=env-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-name.d.ts","sourceRoot":"","sources":["../src/env-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW,QAA6B,CAAC"}
|
package/dist/env-name.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An environment variable NAME as Percher stores and injects it: uppercase
|
|
3
|
+
* letters, digits and underscores, not starting with a digit, 1 to 256
|
|
4
|
+
* characters. The length is part of the pattern so a copy cannot carry the
|
|
5
|
+
* alphabet and forget the bound.
|
|
6
|
+
*
|
|
7
|
+
* This is the API's rule (`PUT /apps/:app/env`), so it is the contract: a
|
|
8
|
+
* client that accepts more sends a batch the API refuses whole, and one that
|
|
9
|
+
* accepts less hides a name the API would have stored.
|
|
10
|
+
*
|
|
11
|
+
* The API and the dashboard import it. `@percher/toml` (`ENV_NAME_RE`) and
|
|
12
|
+
* `@percher/client` (`KEY_PATTERN` in env-file.ts) carry the same pattern by
|
|
13
|
+
* value; they import this one once a shared release carries it (cross-package
|
|
14
|
+
* exports move with version bumps). `packages/shared/test/env-name.test.ts`
|
|
15
|
+
* fails if the texts drift.
|
|
16
|
+
*
|
|
17
|
+
* Two rules are wider on purpose and are NOT copies:
|
|
18
|
+
* - the worker's run-payload guard also admits lowercase, because the platform
|
|
19
|
+
* injects `http_proxy`/`https_proxy`/`no_proxy` and because a name stored
|
|
20
|
+
* before the API required uppercase must still reach its container;
|
|
21
|
+
* - `isEnvKey` in `@percher/core` validates names the API REPORTS, and the
|
|
22
|
+
* source scanner reports references in whatever case the source wrote.
|
|
23
|
+
*/
|
|
24
|
+
export const ENV_NAME_RE = /^[A-Z_][A-Z0-9_]{0,255}$/;
|
|
25
|
+
//# sourceMappingURL=env-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-name.js","sourceRoot":"","sources":["../src/env-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape text for interpolation into HTML (or XML) markup: the five
|
|
3
|
+
* characters that can end a text node or an attribute value. One copy for
|
|
4
|
+
* every process; the six hand-rolled variants it replaces disagreed on
|
|
5
|
+
* whether quotes were escaped, which is the difference between a name that
|
|
6
|
+
* is safe in a text node and one that is also safe inside an attribute.
|
|
7
|
+
* Pure string work, so the barrel can carry it into browser bundles.
|
|
8
|
+
*/
|
|
9
|
+
export declare function escapeHtml(value: string): string;
|
|
10
|
+
//# sourceMappingURL=escape-html.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape-html.d.ts","sourceRoot":"","sources":["../src/escape-html.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escape text for interpolation into HTML (or XML) markup: the five
|
|
3
|
+
* characters that can end a text node or an attribute value. One copy for
|
|
4
|
+
* every process; the six hand-rolled variants it replaces disagreed on
|
|
5
|
+
* whether quotes were escaped, which is the difference between a name that
|
|
6
|
+
* is safe in a text node and one that is also safe inside an attribute.
|
|
7
|
+
* Pure string work, so the barrel can carry it into browser bundles.
|
|
8
|
+
*/
|
|
9
|
+
export function escapeHtml(value) {
|
|
10
|
+
return value
|
|
11
|
+
.replace(/&/g, "&")
|
|
12
|
+
.replace(/</g, "<")
|
|
13
|
+
.replace(/>/g, ">")
|
|
14
|
+
.replace(/"/g, """)
|
|
15
|
+
.replace(/'/g, "'");
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=escape-html.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escape-html.js","sourceRoot":"","sources":["../src/escape-html.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a moderator turned down an owner-uploaded image. The API stores the
|
|
3
|
+
* stable `code`; the label is looked up when it is shown, so its wording
|
|
4
|
+
* can change without touching stored rows. Labels are written for the app
|
|
5
|
+
* owner, who reads them on their app's Settings page.
|
|
6
|
+
*/
|
|
7
|
+
export type ImageKind = "icon" | "preview";
|
|
8
|
+
export declare const IMAGE_REJECTION_REASONS: readonly [{
|
|
9
|
+
readonly code: "not_screenshot";
|
|
10
|
+
readonly label: "Not a screenshot of the app (logo or marketing image)";
|
|
11
|
+
readonly kinds: readonly ["preview"];
|
|
12
|
+
}, {
|
|
13
|
+
readonly code: "login_or_empty";
|
|
14
|
+
readonly label: "Shows only a login or empty screen";
|
|
15
|
+
readonly kinds: readonly ["preview"];
|
|
16
|
+
}, {
|
|
17
|
+
readonly code: "personal_data";
|
|
18
|
+
readonly label: "Contains personal data";
|
|
19
|
+
readonly kinds: readonly ["icon", "preview"];
|
|
20
|
+
}, {
|
|
21
|
+
readonly code: "unreadable";
|
|
22
|
+
readonly label: "Too small or unreadable";
|
|
23
|
+
readonly kinds: readonly ["icon", "preview"];
|
|
24
|
+
}, {
|
|
25
|
+
readonly code: "mismatch";
|
|
26
|
+
readonly label: "Does not match the app";
|
|
27
|
+
readonly kinds: readonly ["icon", "preview"];
|
|
28
|
+
}, {
|
|
29
|
+
readonly code: "aup";
|
|
30
|
+
readonly label: "Breaks the Acceptable Use Policy";
|
|
31
|
+
readonly kinds: readonly ["icon", "preview"];
|
|
32
|
+
}];
|
|
33
|
+
export type ImageRejectionCode = (typeof IMAGE_REJECTION_REASONS)[number]["code"];
|
|
34
|
+
/** The longest moderator note (or legacy free-text reason) the API stores. */
|
|
35
|
+
export declare const IMAGE_REJECTION_NOTE_MAX = 280;
|
|
36
|
+
/** The reasons a moderator may pick for this kind of image, in display order. */
|
|
37
|
+
export declare function imageRejectionReasons(kind: ImageKind): {
|
|
38
|
+
code: ImageRejectionCode;
|
|
39
|
+
label: string;
|
|
40
|
+
}[];
|
|
41
|
+
/** The owner-facing label for a stored code; null for an unknown or absent code. */
|
|
42
|
+
export declare function imageRejectionLabel(code: string | null | undefined): string | null;
|
|
43
|
+
/** True when `code` is a reason a moderator may pick for this kind of image. */
|
|
44
|
+
export declare function isImageRejectionCode(kind: ImageKind, code: unknown): code is ImageRejectionCode;
|
|
45
|
+
//# sourceMappingURL=image-rejection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-rejection.d.ts","sourceRoot":"","sources":["../src/image-rejection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3C,eAAO,MAAM,uBAAuB;mBAE1B,gBAAgB;oBACf,uDAAuD;;;mBAGxD,gBAAgB;oBAAS,oCAAoC;;;mBAC7D,eAAe;oBAAS,wBAAwB;;;mBAChD,YAAY;oBAAS,yBAAyB;;;mBAC9C,UAAU;oBAAS,wBAAwB;;;mBAC3C,KAAK;oBAAS,kCAAkC;;EACkC,CAAC;AAE7F,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,iFAAiF;AACjF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,SAAS,GACd;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAI/C;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAElF;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,kBAAkB,CAE/F"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const IMAGE_REJECTION_REASONS = [
|
|
2
|
+
{
|
|
3
|
+
code: "not_screenshot",
|
|
4
|
+
label: "Not a screenshot of the app (logo or marketing image)",
|
|
5
|
+
kinds: ["preview"],
|
|
6
|
+
},
|
|
7
|
+
{ code: "login_or_empty", label: "Shows only a login or empty screen", kinds: ["preview"] },
|
|
8
|
+
{ code: "personal_data", label: "Contains personal data", kinds: ["icon", "preview"] },
|
|
9
|
+
{ code: "unreadable", label: "Too small or unreadable", kinds: ["icon", "preview"] },
|
|
10
|
+
{ code: "mismatch", label: "Does not match the app", kinds: ["icon", "preview"] },
|
|
11
|
+
{ code: "aup", label: "Breaks the Acceptable Use Policy", kinds: ["icon", "preview"] },
|
|
12
|
+
];
|
|
13
|
+
/** The longest moderator note (or legacy free-text reason) the API stores. */
|
|
14
|
+
export const IMAGE_REJECTION_NOTE_MAX = 280;
|
|
15
|
+
/** The reasons a moderator may pick for this kind of image, in display order. */
|
|
16
|
+
export function imageRejectionReasons(kind) {
|
|
17
|
+
return IMAGE_REJECTION_REASONS.filter((r) => r.kinds.includes(kind)).map(({ code, label }) => ({ code, label }));
|
|
18
|
+
}
|
|
19
|
+
/** The owner-facing label for a stored code; null for an unknown or absent code. */
|
|
20
|
+
export function imageRejectionLabel(code) {
|
|
21
|
+
return IMAGE_REJECTION_REASONS.find((r) => r.code === code)?.label ?? null;
|
|
22
|
+
}
|
|
23
|
+
/** True when `code` is a reason a moderator may pick for this kind of image. */
|
|
24
|
+
export function isImageRejectionCode(kind, code) {
|
|
25
|
+
return imageRejectionReasons(kind).some((r) => r.code === code);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=image-rejection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-rejection.js","sourceRoot":"","sources":["../src/image-rejection.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC;QACE,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,uDAAuD;QAC9D,KAAK,EAAE,CAAC,SAAS,CAAC;KACnB;IACD,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,oCAAoC,EAAE,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;IAC3F,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;IACtF,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;IACpF,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;IACjF,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;CACI,CAAC;AAI7F,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,iFAAiF;AACjF,MAAM,UAAU,qBAAqB,CACnC,IAAe;IAEf,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACzC,CAAC,CAAC,KAA8B,CAAC,QAAQ,CAAC,IAAI,CAAC,CACjD,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,mBAAmB,CAAC,IAA+B;IACjE,OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,IAAI,CAAC;AAC7E,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,IAAe,EAAE,IAAa;IACjE,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
export { APP_NAME_RE } from "./app-name.js";
|
|
2
|
+
export { BILLING_TEST_ACCOUNTS_ENV, isBillingTestAccount, parseBillingTestAccounts, } from "./billing-test-accounts.js";
|
|
2
3
|
export { BRAND, ICON_COLOURS, type IconColourKey, iconColourHex } from "./brand.js";
|
|
3
4
|
export { CLIENT_IP_ATTESTATION_MAX_SKEW_MS, CLIENT_IP_ATTESTATION_VERSION, CLIENT_IP_HEADER, CLIENT_IP_MAX_LENGTH, CLIENT_IP_PROOF_HEADER, type ClientIpAttestationParts, clientIpAttestationPayload, formatClientIpProof, parseClientIpProof, } from "./client-ip-attestation.js";
|
|
5
|
+
export { crashAssistantPrompt } from "./crash-prompt.js";
|
|
6
|
+
export { type DataExpressionErrorReason, type DataExpressionResult, type DataQueryInvalidExtra, type DataSchemaField, parseDataFields, parseDataFilter, parseDataSort, } from "./data-filter.js";
|
|
7
|
+
export { DATA_ACCESS_MODES, DATA_ACCESS_SCOPES, DATA_ACCESS_SETTER_ERROR_STATUS, DATA_ACT_AS_UNAVAILABLE_REASONS, DATA_ACTING_AS, DATA_COLLECTION_RE, DATA_IDENTITY_KINDS, DATA_IDENTITY_LABEL_FIELD_TYPES, DATA_IDENTITY_LABELS, DATA_LIMITS, DATA_NOT_RUNNING_REASONS, DATA_RATE_LIMIT_SOURCES, DATA_RECORD_ERROR_STATUS, DATA_RECORD_ID_RE, DATA_RULE_CLASSES, DATA_RULE_DENIED_REASONS, DATA_RULE_OPS, type DataAccess, type DataAccessMode, type DataAccessNoticePayload, type DataAccessScope, type DataAccessSet, type DataAccessSetterErrorCode, type DataAccessUpdate, type DataActAsUnavailableExtra, type DataActAsUnavailableReason, type DataActingAs, type DataCollectionAccess, type DataCollectionSummary, type DataConflictExtra, type DataCreateInput, type DataFieldSummary, type DataIdentity, type DataIdentityCandidatesRequest, type DataIdentityCandidatesResponse, type DataIdentityCollection, type DataIdentityLabelFieldType, type DataNotRunningReason, type DataPaginatedRecords, type DataQueryOptions, type DataRateLimitedExtra, type DataRateLimitSource, type DataRecord, type DataRecordErrorCode, type DataRuleClass, type DataRuleDeniedExtra, type DataRuleDeniedReason, type DataRuleOp, type DataSchemaResponse, type DataTokenAccessNoticePayload, type DataTokenAccessRow, type DataTokenAccessUpdate, type DataUpdateInput, type DataValidationFields, type OAuthGrantsDataTools, } from "./data-records.js";
|
|
8
|
+
export { disposableDomainCount, isDisposableEmailDomain } from "./disposable-email-domains.js";
|
|
9
|
+
export { DOMAIN_RE } from "./domain-name.js";
|
|
10
|
+
export { EMAIL_BUDGET_LIMITS, EMAIL_BUDGET_SCHEMA, EmailBudget, type EmailBudgetConnection, type EmailCategory, } from "./email-budget.js";
|
|
11
|
+
export { ENV_MASK, isMaskedEnvValue, maskEnvValue } from "./env-mask.js";
|
|
12
|
+
export { ENV_NAME_RE } from "./env-name.js";
|
|
13
|
+
export { escapeHtml } from "./escape-html.js";
|
|
14
|
+
export { IMAGE_REJECTION_NOTE_MAX, IMAGE_REJECTION_REASONS, type ImageKind, type ImageRejectionCode, imageRejectionLabel, imageRejectionReasons, isImageRejectionCode, } from "./image-rejection.js";
|
|
4
15
|
export { INTERNAL_SIG_HEADER, INTERNAL_SIG_MAX_SKEW_MS, INTERNAL_SIG_VERSION, INTERNAL_TS_HEADER, type InternalSigParts, internalSigPayload, } from "./internal-sig.js";
|
|
5
16
|
export { CURRENT_TERMS_VERSION, LEGAL_DOCUMENT_HASHES, LEGAL_DOCUMENT_LAST_UPDATED, LEGAL_DOCUMENT_VERSIONS, type TermsAcceptanceEvidence, } from "./legal.js";
|
|
6
17
|
export { canonicalLegalChangeJson, compareVersions, declaredVersion, LEGAL_CHANGE_ID_PATTERN, LEGAL_CHANGES, LEGAL_VERSION_PATTERN, type LegalChange, type LegalChangeDocument, type LegalChangeEnforcement, type LegalChangeReason, type LegalDocumentKey, MATERIAL_CHANGE_NOTICE_MS, openMaterialChanges, pendingAcknowledgement, SIGNUP_DISCLOSURE_HEADER, } from "./legal-changes.js";
|
|
7
18
|
export { MAX_ANON_TARBALL_BYTES, MAX_INLINE_PUBLISH_BYTES, MAX_OPEN_UPLOAD_SESSIONS_PER_USER, MAX_TARBALL_BYTES, MAX_UPLOAD_CHUNK_BYTES, MAX_UPLOAD_SESSION_FILES, MIN_UPLOAD_CHUNK_BYTES, UPLOAD_SESSION_MAX_LIFETIME_MS, UPLOAD_SESSION_TTL_MS, } from "./limits.js";
|
|
8
19
|
export { MAX_LOG_SEARCH_LENGTH } from "./logs.js";
|
|
9
20
|
export { MAX_OAUTH_CLIENT_NAME_DISPLAY_CODE_POINTS, normaliseOAuthClientName, } from "./oauth-client-name.js";
|
|
10
|
-
export { describeOAuthScope, OAUTH_SCOPE_LABELS, parseOAuthScopes } from "./oauth-scopes.js";
|
|
21
|
+
export { DATA_ACCESS_MODE_LABELS, describeOAuthScope, OAUTH_SCOPE_LABELS, parseOAuthScopes, } from "./oauth-scopes.js";
|
|
11
22
|
export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, MCP_TOOL_COUNT_HOSTED, MCP_TOOL_COUNT_LOCAL, } from "./platform.js";
|
|
12
23
|
export { canonicalInjectedKey, isPercherInjected, PERCHER_INJECTED_ENV_KEYS, } from "./platform-env.js";
|
|
13
24
|
export { DEFAULT_NODE_VERSION_LABEL, DEFAULT_NODE_VERSION_MAJOR } from "./runtime.js";
|
|
25
|
+
export { parseSignupCapacity, SIGNUP_CAPACITY_MAX_AGE_MS, SIGNUP_CAPACITY_MESSAGE, type SignupCapacityReason, type SignupCapacityState, } from "./signup-capacity.js";
|
|
26
|
+
export { signupDayWindow } from "./signup-day.js";
|
|
14
27
|
export { normalizeSignupInviteCode, SIGNUP_INVITE_CODE_ALPHABET, SIGNUP_INVITE_CODE_LENGTH, SIGNUP_INVITE_CODE_PREFIX, SIGNUP_INVITE_HEADER, } from "./signup-invite.js";
|
|
28
|
+
export { assertValidSwitches, type BooleanSwitch, type EnumSwitch, type PresenceSwitch, reportSwitches, SWITCH_BY_NAME, SWITCHES, type SwitchReader, type SwitchReport, type SwitchSpec, type SwitchState, switchEnabled, switchState, switchValue, } from "./switches.js";
|
|
15
29
|
export { BUN_MAX_IDLE_TIMEOUT_SECONDS, HTTP_IDLE_TIMEOUT_SECONDS, type HttpIdleTimeoutSurface, TIMEOUTS, type TimeoutKey, } from "./timeouts.js";
|
|
16
30
|
export { WAITLIST_THROTTLE_WINDOW_MS } from "./waitlist.js";
|
|
17
31
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EACL,iCAAiC,EACjC,6BAA6B,EAC7B,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,wBAAwB,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,KAAK,uBAAuB,GAC7B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,yCAAyC,EACzC,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,Y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Y,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,sBAAsB,EAC3B,QAAQ,EACR,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
export { APP_NAME_RE } from "./app-name.js";
|
|
2
|
+
export { BILLING_TEST_ACCOUNTS_ENV, isBillingTestAccount, parseBillingTestAccounts, } from "./billing-test-accounts.js";
|
|
2
3
|
export { BRAND, ICON_COLOURS, iconColourHex } from "./brand.js";
|
|
3
4
|
export { CLIENT_IP_ATTESTATION_MAX_SKEW_MS, CLIENT_IP_ATTESTATION_VERSION, CLIENT_IP_HEADER, CLIENT_IP_MAX_LENGTH, CLIENT_IP_PROOF_HEADER, clientIpAttestationPayload, formatClientIpProof, parseClientIpProof, } from "./client-ip-attestation.js";
|
|
5
|
+
export { crashAssistantPrompt } from "./crash-prompt.js";
|
|
6
|
+
export { parseDataFields, parseDataFilter, parseDataSort, } from "./data-filter.js";
|
|
7
|
+
export { DATA_ACCESS_MODES, DATA_ACCESS_SCOPES, DATA_ACCESS_SETTER_ERROR_STATUS, DATA_ACT_AS_UNAVAILABLE_REASONS, DATA_ACTING_AS, DATA_COLLECTION_RE, DATA_IDENTITY_KINDS, DATA_IDENTITY_LABEL_FIELD_TYPES, DATA_IDENTITY_LABELS, DATA_LIMITS, DATA_NOT_RUNNING_REASONS, DATA_RATE_LIMIT_SOURCES, DATA_RECORD_ERROR_STATUS, DATA_RECORD_ID_RE, DATA_RULE_CLASSES, DATA_RULE_DENIED_REASONS, DATA_RULE_OPS, } from "./data-records.js";
|
|
8
|
+
export { disposableDomainCount, isDisposableEmailDomain } from "./disposable-email-domains.js";
|
|
9
|
+
export { DOMAIN_RE } from "./domain-name.js";
|
|
10
|
+
export { EMAIL_BUDGET_LIMITS, EMAIL_BUDGET_SCHEMA, EmailBudget, } from "./email-budget.js";
|
|
11
|
+
export { ENV_MASK, isMaskedEnvValue, maskEnvValue } from "./env-mask.js";
|
|
12
|
+
export { ENV_NAME_RE } from "./env-name.js";
|
|
13
|
+
export { escapeHtml } from "./escape-html.js";
|
|
14
|
+
export { IMAGE_REJECTION_NOTE_MAX, IMAGE_REJECTION_REASONS, imageRejectionLabel, imageRejectionReasons, isImageRejectionCode, } from "./image-rejection.js";
|
|
4
15
|
export { INTERNAL_SIG_HEADER, INTERNAL_SIG_MAX_SKEW_MS, INTERNAL_SIG_VERSION, INTERNAL_TS_HEADER, internalSigPayload, } from "./internal-sig.js";
|
|
5
16
|
export { CURRENT_TERMS_VERSION, LEGAL_DOCUMENT_HASHES, LEGAL_DOCUMENT_LAST_UPDATED, LEGAL_DOCUMENT_VERSIONS, } from "./legal.js";
|
|
6
17
|
export { canonicalLegalChangeJson, compareVersions, declaredVersion, LEGAL_CHANGE_ID_PATTERN, LEGAL_CHANGES, LEGAL_VERSION_PATTERN, MATERIAL_CHANGE_NOTICE_MS, openMaterialChanges, pendingAcknowledgement, SIGNUP_DISCLOSURE_HEADER, } from "./legal-changes.js";
|
|
7
18
|
export { MAX_ANON_TARBALL_BYTES, MAX_INLINE_PUBLISH_BYTES, MAX_OPEN_UPLOAD_SESSIONS_PER_USER, MAX_TARBALL_BYTES, MAX_UPLOAD_CHUNK_BYTES, MAX_UPLOAD_SESSION_FILES, MIN_UPLOAD_CHUNK_BYTES, UPLOAD_SESSION_MAX_LIFETIME_MS, UPLOAD_SESSION_TTL_MS, } from "./limits.js";
|
|
8
19
|
export { MAX_LOG_SEARCH_LENGTH } from "./logs.js";
|
|
9
20
|
export { MAX_OAUTH_CLIENT_NAME_DISPLAY_CODE_POINTS, normaliseOAuthClientName, } from "./oauth-client-name.js";
|
|
10
|
-
export { describeOAuthScope, OAUTH_SCOPE_LABELS, parseOAuthScopes } from "./oauth-scopes.js";
|
|
21
|
+
export { DATA_ACCESS_MODE_LABELS, describeOAuthScope, OAUTH_SCOPE_LABELS, parseOAuthScopes, } from "./oauth-scopes.js";
|
|
11
22
|
export { DEFAULT_DOMAIN_SUFFIX, DEFAULT_MCP_HTTP_PORT, DEFAULT_POCKETBASE_IMAGE, MCP_TOOL_COUNT_HOSTED, MCP_TOOL_COUNT_LOCAL, } from "./platform.js";
|
|
12
23
|
export { canonicalInjectedKey, isPercherInjected, PERCHER_INJECTED_ENV_KEYS, } from "./platform-env.js";
|
|
13
24
|
export { DEFAULT_NODE_VERSION_LABEL, DEFAULT_NODE_VERSION_MAJOR } from "./runtime.js";
|
|
25
|
+
export { parseSignupCapacity, SIGNUP_CAPACITY_MAX_AGE_MS, SIGNUP_CAPACITY_MESSAGE, } from "./signup-capacity.js";
|
|
26
|
+
export { signupDayWindow } from "./signup-day.js";
|
|
14
27
|
export { normalizeSignupInviteCode, SIGNUP_INVITE_CODE_ALPHABET, SIGNUP_INVITE_CODE_LENGTH, SIGNUP_INVITE_CODE_PREFIX, SIGNUP_INVITE_HEADER, } from "./signup-invite.js";
|
|
28
|
+
export { assertValidSwitches, reportSwitches, SWITCH_BY_NAME, SWITCHES, switchEnabled, switchState, switchValue, } from "./switches.js";
|
|
15
29
|
export { BUN_MAX_IDLE_TIMEOUT_SECONDS, HTTP_IDLE_TIMEOUT_SECONDS, TIMEOUTS, } from "./timeouts.js";
|
|
16
30
|
export { WAITLIST_THROTTLE_WINDOW_MS } from "./waitlist.js";
|
|
17
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAsB,aAAa,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EACL,iCAAiC,EACjC,6BAA6B,EAC7B,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EAEtB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAElB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,GAExB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,qBAAqB,EAMrB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,iCAAiC,EACjC,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,yCAAyC,EACzC,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAsB,aAAa,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EACL,iCAAiC,EACjC,6BAA6B,EAC7B,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EAEtB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,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AAwB,EACxB,iCAAiC,EACjC,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EACL,yCAAyC,EACzC,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,GAGxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,mBAAmB,EAInB,cAAc,EACd,cAAc,EACd,QAAQ,EAKR,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EAEzB,QAAQ,GAET,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/internal-sig.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* window, and the raw secret never has to ride on the wire once enforce is on.
|
|
9
9
|
*
|
|
10
10
|
* This module is the single source of truth for the canonical string both sides
|
|
11
|
-
* HMAC, so the API verifier and every signer (the dashboard
|
|
12
|
-
*
|
|
11
|
+
* HMAC, so the API verifier and every signer (the dashboard and the external
|
|
12
|
+
* security runner, per the security-ingest contract in docs/integrations) can't drift. It
|
|
13
13
|
* is dependency-free on purpose — no crypto here — so it bundles cleanly into the
|
|
14
14
|
* dashboard (Node) as well as the API (Bun). Each side wraps it with its own
|
|
15
15
|
* `node:crypto` HMAC.
|
package/dist/internal-sig.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* window, and the raw secret never has to ride on the wire once enforce is on.
|
|
9
9
|
*
|
|
10
10
|
* This module is the single source of truth for the canonical string both sides
|
|
11
|
-
* HMAC, so the API verifier and every signer (the dashboard
|
|
12
|
-
*
|
|
11
|
+
* HMAC, so the API verifier and every signer (the dashboard and the external
|
|
12
|
+
* security runner, per the security-ingest contract in docs/integrations) can't drift. It
|
|
13
13
|
* is dependency-free on purpose — no crypto here — so it bundles cleanly into the
|
|
14
14
|
* dashboard (Node) as well as the API (Bun). Each side wraps it with its own
|
|
15
15
|
* `node:crypto` HMAC.
|
package/dist/legal-changes.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export interface LegalChange {
|
|
|
46
46
|
materiality: "material" | "editorial";
|
|
47
47
|
reason: LegalChangeReason;
|
|
48
48
|
enforcement: LegalChangeEnforcement;
|
|
49
|
-
/** ISO instant, UTC.
|
|
49
|
+
/** ISO instant, UTC. First send instant of the notice batch. */
|
|
50
50
|
announceAt: string;
|
|
51
|
-
/** ISO instant, UTC.
|
|
51
|
+
/** ISO instant, UTC. Existing-account effect; material changes need 30 full days after the last send. */
|
|
52
52
|
effectiveAt: string;
|
|
53
53
|
/** Every document whose version header moves in this change. */
|
|
54
54
|
documents: readonly LegalChangeDocument[];
|
|
@@ -62,12 +62,10 @@ export interface LegalChange {
|
|
|
62
62
|
};
|
|
63
63
|
/** Set when the same change also modifies the Service itself (2019/770 Art. 19). */
|
|
64
64
|
modifiesService?: boolean;
|
|
65
|
+
/** This change governs new accounts from signup, before the existing-account date. */
|
|
66
|
+
appliesToNewAccountsFromSignup?: boolean;
|
|
65
67
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Newest last. Empty because version 1.0 is the first publication under
|
|
68
|
-
* Kaizensu AB: there is no earlier version to have changed from, so the chain
|
|
69
|
-
* starts here rather than being backfilled with a notice nobody was owed.
|
|
70
|
-
*/
|
|
68
|
+
/** Newest last. Editorial corrections record the published document history. */
|
|
71
69
|
export declare const LEGAL_CHANGES: readonly LegalChange[];
|
|
72
70
|
/**
|
|
73
71
|
* Header carrying the change ids the signup form actually rendered.
|