@pipeline-builder/pipeline-data 4.3.16 → 4.3.17
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/lib/api/crud-service.d.ts +15 -5
- package/lib/api/crud-service.js +39 -25
- package/lib/api/public-directory.js +6 -2
- package/lib/api/reporting/caches.js +3 -3
- package/lib/api/reporting/failure-classifier.js +5 -1
- package/lib/api/reporting/stakeholder/compose.js +3 -3
- package/lib/api/reporting/stakeholder/index.d.ts +3 -3
- package/lib/api/reporting/stakeholder/index.js +4 -4
- package/lib/api/reporting/stakeholder/sections.d.ts +2 -2
- package/lib/api/reporting/stakeholder/sections.js +29 -29
- package/lib/api/reporting/stakeholder/store.d.ts +25 -14
- package/lib/api/reporting/stakeholder/store.js +48 -32
- package/lib/api/reporting/stakeholder/templates.d.ts +3 -3
- package/lib/api/reporting/stakeholder/templates.js +4 -4
- package/lib/api/reporting/types.d.ts +40 -39
- package/lib/api/reporting/types.js +1 -1
- package/lib/api/reporting-service.d.ts +18 -4
- package/lib/api/reporting-service.js +63 -32
- package/lib/api/support-cases.d.ts +8 -3
- package/lib/api/support-cases.js +16 -8
- package/lib/database/drizzle-schema.d.ts +34 -0
- package/lib/database/postgres-connection.js +3 -3
- package/lib/database/public-reader.js +2 -2
- package/lib/database/read-connection.js +3 -3
- package/lib/database/schema/ecosystem.d.ts +19 -1
- package/lib/database/schema/ecosystem.js +8 -2
- package/lib/database/schema/reporting-stakeholder.d.ts +17 -0
- package/lib/database/schema/reporting-stakeholder.js +7 -1
- package/lib/database/tenancy.d.ts +17 -25
- package/lib/database/tenancy.js +52 -53
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/testing/exports.json +7 -7
- package/package.json +2 -2
|
@@ -18,18 +18,28 @@ export interface UnsubscribeResult {
|
|
|
18
18
|
export declare const DEFAULT_SHARE_LINK_TTL_DAYS = 30;
|
|
19
19
|
/** The longest a share link may live. Beyond this it is a permanent URL. */
|
|
20
20
|
export declare const MAX_SHARE_LINK_TTL_DAYS = 180;
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* How long a recipient's verification link is accepted: 7 days, measured from
|
|
23
|
+
* when that link's token was minted (`verification_issued_at`) — a resend starts
|
|
24
|
+
* a fresh window. Generous on purpose — the address belongs to someone outside the product who
|
|
25
|
+
* may be away for a week, and an expired link means re-adding them.
|
|
26
|
+
*/
|
|
27
|
+
export declare const RECIPIENT_VERIFICATION_TTL_MS: number;
|
|
23
28
|
/**
|
|
24
29
|
* Bounces before an address is treated as undeliverable and skipped. Three, not
|
|
25
30
|
* one: a single bounce is often an out-of-office autoresponder or a full mailbox,
|
|
26
31
|
* and dropping a manager off the list for one of those is a silent failure.
|
|
27
32
|
*/
|
|
28
|
-
export declare const
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
export declare const MAX_REPORT_BOUNCES = 3;
|
|
34
|
+
/**
|
|
35
|
+
* SHA-256 hex of a report token — the only form share-link and verification
|
|
36
|
+
* tokens are stored in. The UNSUBSCRIBE token is the exception: it is stored
|
|
37
|
+
* raw (`unsubscribe_token`), because every later report email must embed the
|
|
38
|
+
* same link and a hash cannot be turned back into it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function hashReportToken(token: string): string;
|
|
41
|
+
/** A fresh URL-safe report token, and its hash. The raw value is returned exactly once. */
|
|
42
|
+
export declare function mintReportToken(): {
|
|
33
43
|
token: string;
|
|
34
44
|
tokenHash: string;
|
|
35
45
|
};
|
|
@@ -185,8 +195,7 @@ export declare class StakeholderReportStore {
|
|
|
185
195
|
* Resolve a share token to its link and run, for the UNAUTHENTICATED public
|
|
186
196
|
* route.
|
|
187
197
|
*
|
|
188
|
-
*
|
|
189
|
-
* structural: the reader holds a token and nothing else — no account, no org,
|
|
198
|
+
* It runs as sysadmin, and the reason is structural: the reader holds a token and nothing else — no account, no org,
|
|
190
199
|
* no JWT — so there is no tenant context for RLS to scope by, and the org can
|
|
191
200
|
* only be learned FROM the row. The escalation is kept as narrow as the problem:
|
|
192
201
|
*
|
|
@@ -237,8 +246,11 @@ export declare class StakeholderReportStore {
|
|
|
237
246
|
}>;
|
|
238
247
|
listRecipients(orgId: string): Promise<ReportRecipient[]>;
|
|
239
248
|
getRecipients(orgId: string, ids: string[]): Promise<ReportRecipient[]>;
|
|
240
|
-
/**
|
|
241
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Mint a fresh verification token for a recipient that has not confirmed yet.
|
|
251
|
+
* The new token gets its own full window ({@link RECIPIENT_VERIFICATION_TTL_MS}).
|
|
252
|
+
*/
|
|
253
|
+
resendVerification(orgId: string, id: string, now?: Date): Promise<{
|
|
242
254
|
recipient: ReportRecipient;
|
|
243
255
|
token: string;
|
|
244
256
|
}>;
|
|
@@ -268,7 +280,7 @@ export declare class StakeholderReportStore {
|
|
|
268
280
|
* clicker's point of view it is.
|
|
269
281
|
*/
|
|
270
282
|
unsubscribeByToken(token: string, now?: Date): Promise<UnsubscribeResult>;
|
|
271
|
-
/** Record a delivery bounce. At {@link
|
|
283
|
+
/** Record a delivery bounce. At {@link MAX_REPORT_BOUNCES} the address is skipped. */
|
|
272
284
|
recordBounce(orgId: string, email: string, now?: Date): Promise<number>;
|
|
273
285
|
deleteRecipient(orgId: string, id: string, deletedBy: string): Promise<void>;
|
|
274
286
|
/**
|
|
@@ -390,8 +402,7 @@ export declare class StakeholderReportStore {
|
|
|
390
402
|
* Definitions whose next run is due, across every org.
|
|
391
403
|
*
|
|
392
404
|
* Runs as SYSADMIN, because the scheduler has no tenant: it is looking for work
|
|
393
|
-
* in orgs it has not been told about.
|
|
394
|
-
* boundaries, and it is kept to the narrowest possible shape — the rows needed to
|
|
405
|
+
* in orgs it has not been told about. It is kept to the narrowest possible shape — the rows needed to
|
|
395
406
|
* claim and execute, ordered oldest-due first so a backlog drains in order rather
|
|
396
407
|
* than starving whichever org sorts last by id.
|
|
397
408
|
*
|