@pipeline-builder/api-core 5.3.4 → 6.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/CHANGELOG.md +15 -0
- package/lib/constants/http-status.d.ts +1 -0
- package/lib/constants/http-status.js +2 -1
- package/lib/contracts/billing.d.ts +40 -0
- package/lib/contracts/billing.js +58 -0
- package/lib/contracts/call.d.ts +95 -0
- package/lib/contracts/call.js +73 -0
- package/lib/contracts/cascade.d.ts +30 -0
- package/lib/contracts/cascade.js +30 -0
- package/lib/contracts/compliance.d.ts +96 -0
- package/lib/contracts/compliance.js +180 -0
- package/lib/contracts/define.d.ts +123 -0
- package/lib/contracts/define.js +93 -0
- package/lib/contracts/image-registry.d.ts +269 -0
- package/lib/contracts/image-registry.js +401 -0
- package/lib/contracts/index.d.ts +18 -0
- package/lib/contracts/index.js +55 -0
- package/lib/contracts/message.d.ts +93 -0
- package/lib/contracts/message.js +145 -0
- package/lib/contracts/ops-center.d.ts +9 -0
- package/lib/contracts/ops-center.js +25 -0
- package/lib/contracts/pipeline.d.ts +9 -0
- package/lib/contracts/pipeline.js +25 -0
- package/lib/contracts/platform.d.ts +338 -0
- package/lib/contracts/platform.js +522 -0
- package/lib/contracts/plugin.d.ts +79 -0
- package/lib/contracts/plugin.js +149 -0
- package/lib/contracts/quota.d.ts +32 -0
- package/lib/contracts/quota.js +48 -0
- package/lib/contracts/reporting.d.ts +94 -0
- package/lib/contracts/reporting.js +176 -0
- package/lib/errors/app-errors.d.ts +12 -0
- package/lib/errors/app-errors.js +12 -1
- package/lib/index.d.ts +7 -2
- package/lib/index.js +9 -3
- package/lib/middleware/index.d.ts +1 -1
- package/lib/middleware/index.js +2 -2
- package/lib/middleware/jwt-verify.d.ts +21 -1
- package/lib/middleware/jwt-verify.js +37 -4
- package/lib/services/circuit-breaker.d.ts +6 -0
- package/lib/services/circuit-breaker.js +11 -1
- package/lib/services/compliance-event-subscriber.js +18 -8
- package/lib/services/ecosystem-notify-client.d.ts +1 -1
- package/lib/services/ecosystem-notify-client.js +12 -9
- package/lib/services/http-client.d.ts +36 -0
- package/lib/services/http-client.js +140 -25
- package/lib/services/index.d.ts +2 -2
- package/lib/services/index.js +2 -2
- package/lib/services/org-ai-client.d.ts +3 -3
- package/lib/services/org-ai-client.js +15 -15
- package/lib/services/service-keys.d.ts +2 -11
- package/lib/services/service-keys.js +22 -2
- package/lib/services/system-notification.d.ts +2 -2
- package/lib/services/system-notification.js +27 -19
- package/lib/types/common.d.ts +6 -1
- package/lib/types/common.js +1 -1
- package/lib/types/error-codes.d.ts +3 -0
- package/lib/types/error-codes.js +6 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -1
- package/lib/types/plugin-wire.d.ts +268 -0
- package/lib/types/plugin-wire.js +4 -0
- package/lib/types/remote-audit-actions.d.ts +1 -1
- package/lib/types/remote-audit-actions.js +51 -1
- package/lib/utils/concurrency.d.ts +33 -0
- package/lib/utils/concurrency.js +70 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +2 -2
- package/lib/utils/semver.d.ts +73 -5
- package/lib/utils/semver.js +175 -45
- package/lib/utils/service-registry.d.ts +1 -1
- package/lib/utils/service-registry.js +2 -2
- package/lib/validation/pipeline-schemas.d.ts +167 -2
- package/lib/validation/pipeline-schemas.js +145 -2
- package/package.json +8 -7
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal endpoints SERVED BY platform.
|
|
3
|
+
*
|
|
4
|
+
* - `/internal/notify-email` (+ `/status`) — the email relay: five body legs
|
|
5
|
+
* (tenant, report, quota notice, offer notice, ecosystem notice), told apart
|
|
6
|
+
* by the BODY ({@link notifyEmailLegOf}), each checking its own caller.
|
|
7
|
+
* - `/internal/ecosystem/*` — Verified-publisher facts and approver counts (plugin).
|
|
8
|
+
* - `/internal/offers/seat-activity/:orgId` — the offers value signal (billing).
|
|
9
|
+
* - `/internal/reporting/*` — identity facts and access posture (reporting).
|
|
10
|
+
* - `/internal/support/entitlement/:orgId` — support entitlement (message).
|
|
11
|
+
* - `/internal/ai/*` — an org's AI switch, providers and decrypted key.
|
|
12
|
+
* - `/internal/ops/*` — the identity facts ops-center needs (an org's
|
|
13
|
+
* account root for feature quotas, and the audit-activity aggregations its
|
|
14
|
+
* dashboards render over platform's Mongo audit trail).
|
|
15
|
+
*
|
|
16
|
+
* Request schemas carry the server's own 400 messages, so a route that
|
|
17
|
+
* validates with them answers exactly as it did when it hand-parsed. Response
|
|
18
|
+
* schemas carry the NORMALIZATION each client already applied (non-string list
|
|
19
|
+
* entries dropped, absent optional counts defaulted) so a client that parses
|
|
20
|
+
* through the contract reads exactly what it read before.
|
|
21
|
+
*/
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
import { type EcosystemNotifyRequest } from '../types/ecosystem-notifications.js';
|
|
24
|
+
/** Tenant leg (`compliance`, `reporting`): email an org's users. */
|
|
25
|
+
export declare const notifyEmailSchema: z.ZodObject<{
|
|
26
|
+
orgId: z.ZodString;
|
|
27
|
+
subject: z.ZodString;
|
|
28
|
+
text: z.ZodString;
|
|
29
|
+
targetUsers: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[] | null, unknown>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
/** Quota leg (`quota` only): a threshold notice to the org's admins + billing contacts. */
|
|
32
|
+
export declare const notifyQuotaEmailSchema: z.ZodObject<{
|
|
33
|
+
quotaNotice: z.ZodLiteral<true>;
|
|
34
|
+
orgId: z.ZodString;
|
|
35
|
+
subject: z.ZodString;
|
|
36
|
+
text: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
/** Offer leg (`billing` only): an expansion offer to the same people as a quota notice. */
|
|
39
|
+
export declare const notifyOfferEmailSchema: z.ZodObject<{
|
|
40
|
+
offerNotice: z.ZodLiteral<true>;
|
|
41
|
+
orgId: z.ZodString;
|
|
42
|
+
subject: z.ZodString;
|
|
43
|
+
text: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
/**
|
|
46
|
+
* Alert leg (`ops-center` only): one org alert destination of channel
|
|
47
|
+
* `email`, i.e. ONE address an org admin configured (not a member lookup).
|
|
48
|
+
*/
|
|
49
|
+
export declare const notifyAlertEmailSchema: z.ZodObject<{
|
|
50
|
+
alertEmail: z.ZodLiteral<true>;
|
|
51
|
+
orgId: z.ZodString;
|
|
52
|
+
to: z.ZodString;
|
|
53
|
+
subject: z.ZodString;
|
|
54
|
+
text: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
/** Report recipients per send — the ceiling on a compromised reporting token. */
|
|
57
|
+
export declare const REPORT_EMAIL_MAX_RECIPIENTS = 50;
|
|
58
|
+
/** Report leg (`reporting` only): one message per verified address. */
|
|
59
|
+
export declare const notifyReportEmailSchema: z.ZodObject<{
|
|
60
|
+
orgId: z.ZodString;
|
|
61
|
+
subject: z.ZodString;
|
|
62
|
+
text: z.ZodString;
|
|
63
|
+
html: z.ZodOptional<z.ZodString>;
|
|
64
|
+
reportRecipients: z.ZodArray<z.ZodObject<{
|
|
65
|
+
email: z.ZodString;
|
|
66
|
+
unsubscribeUrl: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
/** Which relay leg a notify-email body is for. */
|
|
70
|
+
export type NotifyEmailLeg = 'report' | 'quota' | 'offer' | 'alert' | 'ecosystem' | 'tenant';
|
|
71
|
+
/**
|
|
72
|
+
* The relay leg a body is for, decided by its keys exactly as the relay
|
|
73
|
+
* dispatches: `reportRecipients`, then `quotaNotice`, then `offerNotice`, then
|
|
74
|
+
* `alertEmail`, then an ecosystem notice's `recipients` RULES; anything else is
|
|
75
|
+
* the tenant leg.
|
|
76
|
+
*/
|
|
77
|
+
export declare function notifyEmailLegOf(raw: unknown): NotifyEmailLeg;
|
|
78
|
+
/** The parsed body of one notify-email send, whichever leg. */
|
|
79
|
+
export type NotifyEmailBody = z.output<typeof notifyEmailSchema> | z.output<typeof notifyQuotaEmailSchema> | z.output<typeof notifyOfferEmailSchema> | z.output<typeof notifyReportEmailSchema> | z.output<typeof notifyAlertEmailSchema> | EcosystemNotifyRequest;
|
|
80
|
+
/** The only permissions an ecosystem decision can require. */
|
|
81
|
+
export declare const ECOSYSTEM_DECISION_PERMISSIONS: readonly ['plugins:moderate', 'publishers:verify'];
|
|
82
|
+
/** A parsed `idList` value as its ids. */
|
|
83
|
+
export declare function splitIdList(joined: string): string[];
|
|
84
|
+
/** The named aggregations over platform's audit trail an ops dashboard can render. */
|
|
85
|
+
export declare const AUDIT_ACTIVITY_QUERIES: readonly ['events_by_action', 'top_actors_24h', 'recent_events'];
|
|
86
|
+
export type AuditActivityQuery = typeof AUDIT_ACTIVITY_QUERIES[number];
|
|
87
|
+
/** The range presets the observability surface understands. */
|
|
88
|
+
export declare const AUDIT_ACTIVITY_RANGES: readonly ['1h', '6h', '24h'];
|
|
89
|
+
export type AuditActivityRange = typeof AUDIT_ACTIVITY_RANGES[number];
|
|
90
|
+
/** Ceiling on `liveOrgIds` per call (the log view's tenant cap is far below it). */
|
|
91
|
+
export declare const LIVE_ORG_IDS_MAX = 1000;
|
|
92
|
+
/** Ceiling on `recent_events` rows per call. */
|
|
93
|
+
export declare const AUDIT_ACTIVITY_MAX_LIMIT = 500;
|
|
94
|
+
/** What an audit-activity query returns: a Prometheus-shaped matrix, or a stream of rows. */
|
|
95
|
+
export declare const AuditActivityResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
96
|
+
kind: z.ZodLiteral<"matrix">;
|
|
97
|
+
series: z.ZodArray<z.ZodObject<{
|
|
98
|
+
labels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
99
|
+
values: z.ZodArray<z.ZodObject<{
|
|
100
|
+
time: z.ZodNumber;
|
|
101
|
+
value: z.ZodString;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
step: z.ZodString;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
kind: z.ZodLiteral<"stream">;
|
|
107
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
108
|
+
time: z.ZodNumber;
|
|
109
|
+
line: z.ZodString;
|
|
110
|
+
labels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
}, z.core.$strip>], "kind">;
|
|
113
|
+
export type AuditActivityResultData = z.output<typeof AuditActivityResult>;
|
|
114
|
+
export declare const PLATFORM_INTERNAL: {
|
|
115
|
+
/**
|
|
116
|
+
* The email relay. One body per leg ({@link notifyEmailLegOf}); each leg
|
|
117
|
+
* refuses a caller other than its own with 403, and the tenant/report/quota/
|
|
118
|
+
* offer legs are tenant-bound to the token's org.
|
|
119
|
+
*/
|
|
120
|
+
readonly notifyEmail: import("./define.js").InternalEndpointContract<z.ZodObject<{}, z.core.$strip>, never, z.ZodPipe<z.ZodUnknown, z.ZodTransform<EcosystemNotifyRequest | {
|
|
121
|
+
orgId: string;
|
|
122
|
+
subject: string;
|
|
123
|
+
text: string;
|
|
124
|
+
targetUsers: string[] | null;
|
|
125
|
+
} | {
|
|
126
|
+
quotaNotice: true;
|
|
127
|
+
orgId: string;
|
|
128
|
+
subject: string;
|
|
129
|
+
text: string;
|
|
130
|
+
} | {
|
|
131
|
+
offerNotice: true;
|
|
132
|
+
orgId: string;
|
|
133
|
+
subject: string;
|
|
134
|
+
text: string;
|
|
135
|
+
} | {
|
|
136
|
+
alertEmail: true;
|
|
137
|
+
orgId: string;
|
|
138
|
+
to: string;
|
|
139
|
+
subject: string;
|
|
140
|
+
text: string;
|
|
141
|
+
} | {
|
|
142
|
+
orgId: string;
|
|
143
|
+
subject: string;
|
|
144
|
+
text: string;
|
|
145
|
+
html?: string | undefined;
|
|
146
|
+
reportRecipients: {
|
|
147
|
+
email: string;
|
|
148
|
+
unsubscribeUrl?: string | undefined;
|
|
149
|
+
}[];
|
|
150
|
+
}, unknown>>, z.ZodObject<{
|
|
151
|
+
ok: z.ZodCatch<z.ZodOptional<z.ZodBoolean>>;
|
|
152
|
+
recipientCount: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
153
|
+
sent: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[] | undefined, unknown>>;
|
|
154
|
+
failed: z.ZodOptional<z.ZodUnknown>;
|
|
155
|
+
inApp: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
156
|
+
emailed: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
157
|
+
suppressed: z.ZodCatch<z.ZodOptional<z.ZodNumber>>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
/** Whether this instance can send email at all (EMAIL_ENABLED). */
|
|
160
|
+
readonly notifyEmailStatus: import("./define.js").InternalEndpointContract<z.ZodObject<{}, z.core.$strip>, never, never, z.ZodObject<{
|
|
161
|
+
enabled: z.ZodBoolean;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
/** The Verified-publisher application's platform-held facts about an org. */
|
|
164
|
+
readonly publisherEligibility: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
165
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
166
|
+
}, z.core.$strip>, never, never, z.ZodObject<{
|
|
167
|
+
verifiedDomains: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<string[], unknown[]>>;
|
|
168
|
+
owners: z.ZodNumber;
|
|
169
|
+
ownersWithMfa: z.ZodNumber;
|
|
170
|
+
}, z.core.$strip>>;
|
|
171
|
+
/** How many people could decide an ecosystem request (counts, never identities). */
|
|
172
|
+
readonly ecosystemApprovers: import("./define.js").InternalEndpointContract<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
permission: z.ZodPipe<z.ZodUnknown & z.ZodType<"plugins:moderate" | "publishers:verify", unknown, z.core.$ZodTypeInternals<"plugins:moderate" | "publishers:verify", unknown>>, z.ZodTransform<"plugins:moderate" | "publishers:verify", "plugins:moderate" | "publishers:verify">>;
|
|
174
|
+
excludeOrgIds: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string, unknown>>;
|
|
175
|
+
excludeUserIds: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string, unknown>>;
|
|
176
|
+
}, z.core.$strip>, never, z.ZodObject<{
|
|
177
|
+
holders: z.ZodNumber;
|
|
178
|
+
eligible: z.ZodNumber;
|
|
179
|
+
superadmins: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>>;
|
|
181
|
+
/** Seats held against members who actually used them, over a window (never 400s). */
|
|
182
|
+
readonly offerSeatActivity: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
183
|
+
orgId: z.ZodString;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
windowDays: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
186
|
+
}, z.core.$strip>, never, z.ZodObject<{
|
|
187
|
+
seatActivity: z.ZodObject<{
|
|
188
|
+
orgId: z.ZodString;
|
|
189
|
+
windowDays: z.ZodNumber;
|
|
190
|
+
seatsHeld: z.ZodNumber;
|
|
191
|
+
activeMembers: z.ZodNumber;
|
|
192
|
+
unknownActivity: z.ZodNumber;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
}, z.core.$strip>>;
|
|
195
|
+
/** May this user still run reports here, and what does the account hold? */
|
|
196
|
+
readonly reportAuthority: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
197
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
198
|
+
userId: z.ZodString;
|
|
199
|
+
}, z.core.$strip>, never, never, z.ZodObject<{
|
|
200
|
+
active: z.ZodBoolean;
|
|
201
|
+
permissions: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
|
|
202
|
+
features: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
|
|
203
|
+
tier: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string | undefined, unknown>>;
|
|
204
|
+
}, z.core.$strip>>;
|
|
205
|
+
/** Is this ONE address an active member of the org? */
|
|
206
|
+
readonly reportRecipientCheck: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
207
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
208
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
209
|
+
email: z.ZodPipe<z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string, unknown>>, z.ZodString>;
|
|
210
|
+
}, z.core.$strip>, never, z.ZodObject<{
|
|
211
|
+
member: z.ZodBoolean;
|
|
212
|
+
userId: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string | undefined, unknown>>;
|
|
213
|
+
displayName: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string | undefined, unknown>>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
/** Access-posture COUNTS for a report window (never a row, name or id). */
|
|
216
|
+
readonly reportAccessPosture: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
217
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
218
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
219
|
+
from: z.ZodOptional<z.ZodUnknown>;
|
|
220
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
221
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
222
|
+
from: Date;
|
|
223
|
+
to: Date;
|
|
224
|
+
}, {
|
|
225
|
+
from?: unknown;
|
|
226
|
+
to?: unknown;
|
|
227
|
+
}>>, never, z.ZodObject<{
|
|
228
|
+
members: z.ZodNumber;
|
|
229
|
+
membersWithMfa: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
230
|
+
ssoRequired: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<boolean, unknown>>;
|
|
231
|
+
serviceAccounts: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
232
|
+
activeApiKeys: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
233
|
+
permissionChanges: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
/**
|
|
236
|
+
* An org's support entitlement. `level` (string | null) and `canOpenCase`
|
|
237
|
+
* are load-bearing; the premium/contact counts default when absent (a
|
|
238
|
+
* platform predating the upgrade omits them).
|
|
239
|
+
*/
|
|
240
|
+
readonly supportEntitlement: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
241
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
242
|
+
}, z.core.$strip>, never, never, z.ZodObject<{
|
|
243
|
+
level: z.ZodNullable<z.ZodString>;
|
|
244
|
+
premium: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<boolean, unknown>>;
|
|
245
|
+
premiumLimit: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
246
|
+
limit: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
247
|
+
used: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
248
|
+
ownOrgContacts: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
249
|
+
canDesignate: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<boolean, unknown>>;
|
|
250
|
+
canOpenCase: z.ZodBoolean;
|
|
251
|
+
}, z.core.$strip>>;
|
|
252
|
+
/** The org's AI switch and which providers it holds its OWN key for. 404 for an unknown org. */
|
|
253
|
+
readonly orgAIAccess: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
254
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
255
|
+
}, z.core.$strip>, never, never, z.ZodObject<{
|
|
256
|
+
aiEnabled: z.ZodBoolean;
|
|
257
|
+
providers: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<string[], unknown>>;
|
|
258
|
+
}, z.core.$strip>>;
|
|
259
|
+
/**
|
|
260
|
+
* The DECRYPTED org key for one provider (audited on platform, never logged).
|
|
261
|
+
* 400 for a provider that is not key-based — checked AFTER the org scope (403).
|
|
262
|
+
*/
|
|
263
|
+
readonly orgAIKey: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
264
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
265
|
+
provider: z.ZodString;
|
|
266
|
+
}, z.core.$strip>, never, never, z.ZodObject<{
|
|
267
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
268
|
+
apiKey: z.ZodString;
|
|
269
|
+
}, z.core.$strip>>;
|
|
270
|
+
/**
|
|
271
|
+
* The ACCOUNT ROOT of an org (the top of its team ancestry; a flat org is its
|
|
272
|
+
* own root) — what ops-center reserves the dashboards / alertRules /
|
|
273
|
+
* alertDestinations feature quotas against. 404 for an unknown org.
|
|
274
|
+
*/
|
|
275
|
+
readonly orgAccountRoot: import("./define.js").InternalEndpointContract<z.ZodObject<{
|
|
276
|
+
orgId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
277
|
+
}, z.core.$strip>, never, never, z.ZodObject<{
|
|
278
|
+
orgId: z.ZodString;
|
|
279
|
+
rootOrgId: z.ZodString;
|
|
280
|
+
}, z.core.$strip>>;
|
|
281
|
+
/**
|
|
282
|
+
* One audit-activity aggregation for an ops dashboard panel. The SCOPE is
|
|
283
|
+
* the caller's verified identity as ops-center resolved it from the
|
|
284
|
+
* user's token (`isSuperAdmin` sees every org; anyone else exactly `orgId`,
|
|
285
|
+
* matched as the actor's org OR the affected org — the `GET /audit`
|
|
286
|
+
* predicate). A non-sysadmin scope with no org yields an empty result.
|
|
287
|
+
*/
|
|
288
|
+
readonly auditActivity: import("./define.js").InternalEndpointContract<z.ZodObject<{}, z.core.$strip>, never, z.ZodObject<{
|
|
289
|
+
query: z.ZodEnum<{
|
|
290
|
+
events_by_action: "events_by_action";
|
|
291
|
+
recent_events: "recent_events";
|
|
292
|
+
top_actors_24h: "top_actors_24h";
|
|
293
|
+
}>;
|
|
294
|
+
scope: z.ZodObject<{
|
|
295
|
+
isSuperAdmin: z.ZodBoolean;
|
|
296
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
range: z.ZodEnum<{
|
|
299
|
+
"1h": "1h";
|
|
300
|
+
"24h": "24h";
|
|
301
|
+
"6h": "6h";
|
|
302
|
+
}>;
|
|
303
|
+
end: z.ZodNumber;
|
|
304
|
+
limit: z.ZodNumber;
|
|
305
|
+
vars: z.ZodObject<{
|
|
306
|
+
event: z.ZodOptional<z.ZodString>;
|
|
307
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
308
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"matrix">;
|
|
312
|
+
series: z.ZodArray<z.ZodObject<{
|
|
313
|
+
labels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
314
|
+
values: z.ZodArray<z.ZodObject<{
|
|
315
|
+
time: z.ZodNumber;
|
|
316
|
+
value: z.ZodString;
|
|
317
|
+
}, z.core.$strip>>;
|
|
318
|
+
}, z.core.$strip>>;
|
|
319
|
+
step: z.ZodString;
|
|
320
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
321
|
+
kind: z.ZodLiteral<"stream">;
|
|
322
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
323
|
+
time: z.ZodNumber;
|
|
324
|
+
line: z.ZodString;
|
|
325
|
+
labels: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
}, z.core.$strip>], "kind">>;
|
|
328
|
+
/**
|
|
329
|
+
* Live (not soft-deleted) org ids in id order, at most `limit` — what a
|
|
330
|
+
* sysadmin's `orgs=all` log view enumerates (Loki has no tenant wildcard).
|
|
331
|
+
* Ids only, never names.
|
|
332
|
+
*/
|
|
333
|
+
readonly liveOrgIds: import("./define.js").InternalEndpointContract<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
334
|
+
limit: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<number, unknown>>;
|
|
335
|
+
}, z.core.$strip>, never, z.ZodObject<{
|
|
336
|
+
orgIds: z.ZodArray<z.ZodString>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
338
|
+
};
|