@betterportal/config-manager 10.6.30 → 10.6.32

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.
Files changed (55) hide show
  1. package/lib/.bsb/clients/service-betterportal-config-manager.d.ts +1 -1
  2. package/lib/.bsb/clients/service-betterportal-config-manager.js +1 -1
  3. package/lib/bp-contracts/org.betterportal.config-manager.json +1 -1
  4. package/lib/plugins/service-betterportal-config-manager/adminApi.d.ts +3 -2
  5. package/lib/plugins/service-betterportal-config-manager/adminApi.d.ts.map +1 -1
  6. package/lib/plugins/service-betterportal-config-manager/adminApi.js +58 -36
  7. package/lib/plugins/service-betterportal-config-manager/adminApi.js.map +1 -1
  8. package/lib/plugins/service-betterportal-config-manager/appQueries.d.ts +976 -0
  9. package/lib/plugins/service-betterportal-config-manager/appQueries.d.ts.map +1 -0
  10. package/lib/plugins/service-betterportal-config-manager/appQueries.js +330 -0
  11. package/lib/plugins/service-betterportal-config-manager/appQueries.js.map +1 -0
  12. package/lib/plugins/service-betterportal-config-manager/index.d.ts +6 -0
  13. package/lib/plugins/service-betterportal-config-manager/index.d.ts.map +1 -1
  14. package/lib/plugins/service-betterportal-config-manager/index.js +83 -23
  15. package/lib/plugins/service-betterportal-config-manager/index.js.map +1 -1
  16. package/lib/plugins/service-betterportal-config-manager/m2mConnections.d.ts +6 -3
  17. package/lib/plugins/service-betterportal-config-manager/m2mConnections.d.ts.map +1 -1
  18. package/lib/plugins/service-betterportal-config-manager/m2mConnections.js.map +1 -1
  19. package/lib/plugins/service-betterportal-config-manager/menuEditor.d.ts +2 -1
  20. package/lib/plugins/service-betterportal-config-manager/menuEditor.d.ts.map +1 -1
  21. package/lib/plugins/service-betterportal-config-manager/menuEditor.js +131 -160
  22. package/lib/plugins/service-betterportal-config-manager/menuEditor.js.map +1 -1
  23. package/lib/plugins/service-betterportal-config-manager/previewEnvironments.d.ts +1 -1
  24. package/lib/plugins/service-betterportal-config-manager/previewEnvironments.d.ts.map +1 -1
  25. package/lib/plugins/service-betterportal-config-manager/previewEnvironments.js.map +1 -1
  26. package/lib/plugins/service-betterportal-config-manager/routeContext.d.ts +2 -0
  27. package/lib/plugins/service-betterportal-config-manager/routeContext.d.ts.map +1 -1
  28. package/lib/plugins/service-betterportal-config-manager/routeContext.js.map +1 -1
  29. package/lib/plugins/service-betterportal-config-manager/storage/appData.d.ts +1 -1
  30. package/lib/plugins/service-betterportal-config-manager/storage/appData.d.ts.map +1 -1
  31. package/lib/plugins/service-betterportal-config-manager/storage/appData.js +12 -5
  32. package/lib/plugins/service-betterportal-config-manager/storage/appData.js.map +1 -1
  33. package/lib/plugins/service-betterportal-config-manager/storage/core.d.ts +5 -3
  34. package/lib/plugins/service-betterportal-config-manager/storage/core.d.ts.map +1 -1
  35. package/lib/plugins/service-betterportal-config-manager/storage/core.js +1 -1
  36. package/lib/plugins/service-betterportal-config-manager/storage/core.js.map +1 -1
  37. package/lib/plugins/service-betterportal-config-manager/storage/entities.d.ts.map +1 -1
  38. package/lib/plugins/service-betterportal-config-manager/storage/entities.js +4 -2
  39. package/lib/plugins/service-betterportal-config-manager/storage/entities.js.map +1 -1
  40. package/lib/plugins/service-betterportal-config-manager/storage/postgres.d.ts +19 -2
  41. package/lib/plugins/service-betterportal-config-manager/storage/postgres.d.ts.map +1 -1
  42. package/lib/plugins/service-betterportal-config-manager/storage/postgres.js +74 -22
  43. package/lib/plugins/service-betterportal-config-manager/storage/postgres.js.map +1 -1
  44. package/lib/plugins/service-betterportal-config-manager/syncApi.d.ts +4 -3
  45. package/lib/plugins/service-betterportal-config-manager/syncApi.d.ts.map +1 -1
  46. package/lib/plugins/service-betterportal-config-manager/syncApi.js.map +1 -1
  47. package/lib/plugins/service-betterportal-config-manager/tenantManagement.d.ts.map +1 -1
  48. package/lib/plugins/service-betterportal-config-manager/tenantManagement.js +3 -1
  49. package/lib/plugins/service-betterportal-config-manager/tenantManagement.js.map +1 -1
  50. package/lib/plugins/service-betterportal-config-manager/webhooks.d.ts.map +1 -1
  51. package/lib/plugins/service-betterportal-config-manager/webhooks.js +147 -54
  52. package/lib/plugins/service-betterportal-config-manager/webhooks.js.map +1 -1
  53. package/lib/schemas/service-betterportal-config-manager.json +1 -1
  54. package/lib/schemas/service-betterportal-config-manager.plugin.json +1 -1
  55. package/package.json +3 -3
@@ -0,0 +1,976 @@
1
+ import type { PoolClient } from "pg";
2
+ import { type HeaderMap, type BetterPortalConfig, type BetterPortalObservability } from "@betterportal/framework";
3
+ import type { PostgresStorage } from "./storage/postgres.js";
4
+ export type AppDatabase = PostgresStorage["database"];
5
+ /** Editor data, not a complete platform configuration and never passed to saveConfig. */
6
+ export type AppEditorData = Pick<BetterPortalConfig, "apps" | "tenants" | "platformServices" | "sharedServiceCatalog" | "sharedServiceActivations" | "previewEnvironmentDeployments">;
7
+ export declare function readAppEditor(client: PoolClient, db: AppDatabase, appId: string): Promise<AppEditorData>;
8
+ /** A short transaction over one app's relational collections. No platform snapshots. */
9
+ export declare function editAppRows<T>(db: AppDatabase, appId: string, obs: BetterPortalObservability | undefined, change: (data: AppEditorData) => Promise<T>): Promise<T>;
10
+ /** Management request resolution reads app settings first, then only the matched app's rows. */
11
+ export declare function readRequestConfig(db: AppDatabase, headers: HeaderMap, obs?: BetterPortalObservability): Promise<{
12
+ configManagement: {
13
+ auth: {
14
+ mechanism: "none" | "dev-token" | "jwt" | "oidc";
15
+ requiredPermissions: string[];
16
+ issuer?: string | undefined;
17
+ audience?: string | undefined;
18
+ };
19
+ adminTenantId?: string | undefined;
20
+ managementAppId?: string | undefined;
21
+ };
22
+ platformServices: {
23
+ id: string;
24
+ hostname: string;
25
+ apiKeyHash: string;
26
+ capabilities: string[];
27
+ title: string;
28
+ createdAt: string;
29
+ enabled: boolean;
30
+ publicKeyPem?: string | undefined;
31
+ keyId?: string | undefined;
32
+ serviceId?: string | undefined;
33
+ authProvider?: {
34
+ issuer: string;
35
+ audience: string;
36
+ jwksUri: string;
37
+ publicKeys?: {
38
+ keys: {
39
+ kty: "RSA";
40
+ use: "sig";
41
+ alg: "RS256";
42
+ kid: string;
43
+ n: string;
44
+ e: string;
45
+ }[];
46
+ } | undefined;
47
+ } | undefined;
48
+ description?: string | undefined;
49
+ category?: string | undefined;
50
+ }[];
51
+ tenants: {
52
+ id: string;
53
+ slug: string;
54
+ title: string;
55
+ active: boolean;
56
+ branding: {
57
+ brandName?: string | undefined;
58
+ logoUrl?: string | undefined;
59
+ primaryColor?: string | undefined;
60
+ secondaryColor?: string | undefined;
61
+ };
62
+ services: {
63
+ id: string;
64
+ hostname: string;
65
+ apiKeyHash: string;
66
+ capabilities: string[];
67
+ deploymentMode: "bp-hosted" | "customer-hosted" | "third-party-saas" | "self-hosted" | "saas-managed";
68
+ createdAt: string;
69
+ enabled: boolean;
70
+ publicKeyPem?: string | undefined;
71
+ keyId?: string | undefined;
72
+ serviceId?: string | undefined;
73
+ authProvider?: {
74
+ issuer: string;
75
+ audience: string;
76
+ jwksUri: string;
77
+ publicKeys?: {
78
+ keys: {
79
+ kty: "RSA";
80
+ use: "sig";
81
+ alg: "RS256";
82
+ kid: string;
83
+ n: string;
84
+ e: string;
85
+ }[];
86
+ } | undefined;
87
+ } | undefined;
88
+ title?: string | undefined;
89
+ description?: string | undefined;
90
+ lastSeenAt?: string | undefined;
91
+ lastSyncAt?: string | undefined;
92
+ }[];
93
+ activatedPlatformServices: string[];
94
+ }[];
95
+ apps: {
96
+ id: string;
97
+ tenantId: string;
98
+ slug: string;
99
+ title: string;
100
+ hostnames: string[];
101
+ originOverrides: string[];
102
+ refererOverrides: string[];
103
+ themeConfig: {
104
+ mode: "light" | "dark" | "system";
105
+ bootstrap: {
106
+ primary?: string | undefined;
107
+ secondary?: string | undefined;
108
+ success?: string | undefined;
109
+ info?: string | undefined;
110
+ warning?: string | undefined;
111
+ danger?: string | undefined;
112
+ light?: string | undefined;
113
+ dark?: string | undefined;
114
+ };
115
+ light: {
116
+ background?: string | undefined;
117
+ surface?: string | undefined;
118
+ surfaceAlt?: string | undefined;
119
+ text?: string | undefined;
120
+ textSoft?: string | undefined;
121
+ border?: string | undefined;
122
+ accentSoft?: string | undefined;
123
+ };
124
+ dark: {
125
+ background?: string | undefined;
126
+ surface?: string | undefined;
127
+ surfaceAlt?: string | undefined;
128
+ text?: string | undefined;
129
+ textSoft?: string | undefined;
130
+ border?: string | undefined;
131
+ accentSoft?: string | undefined;
132
+ };
133
+ brandName?: string | undefined;
134
+ documentTitle?: string | undefined;
135
+ lightLogoUrl?: string | undefined;
136
+ darkLogoUrl?: string | undefined;
137
+ faviconUrl?: string | undefined;
138
+ };
139
+ defaultRoute: string;
140
+ routes: {
141
+ id: string;
142
+ kind: "page" | "api";
143
+ path: string;
144
+ serviceId: string;
145
+ viewId: string;
146
+ enabled: boolean;
147
+ operations: string[];
148
+ servicePathVariant?: string | undefined;
149
+ fixedParams?: Record<string, string> | undefined;
150
+ authRequired?: boolean | undefined;
151
+ menuPermissions?: {
152
+ serviceId: string;
153
+ viewId: string;
154
+ permissions: string[];
155
+ }[] | undefined;
156
+ sitemap?: {
157
+ kind: "provider" | "default" | "exclude" | "metadata";
158
+ lastModified?: string | undefined;
159
+ changeFrequency?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never" | undefined;
160
+ priority?: number | undefined;
161
+ } | undefined;
162
+ robots?: {
163
+ userAgent: string;
164
+ access: "allow" | "disallow";
165
+ crawlDelaySeconds?: number | undefined;
166
+ }[] | undefined;
167
+ targetPath?: string | undefined;
168
+ resolvedServicePath?: string | undefined;
169
+ resolvedMethods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[] | undefined;
170
+ query?: string | undefined;
171
+ title?: string | undefined;
172
+ icon?: string | undefined;
173
+ enablement?: "enabled" | "auto" | "disabled" | undefined;
174
+ menu?: boolean | undefined;
175
+ chrome?: {
176
+ [x: string]: string | number | boolean;
177
+ hideMenu?: boolean | undefined;
178
+ hideHeader?: boolean | undefined;
179
+ hideFooter?: boolean | undefined;
180
+ fullScreen?: boolean | undefined;
181
+ } | undefined;
182
+ }[];
183
+ menu: import("@betterportal/framework").BetterPortalMenuItem[];
184
+ slots: {
185
+ slotId: string;
186
+ serviceId: string;
187
+ viewId: string;
188
+ enabled: boolean;
189
+ renderer?: string | undefined;
190
+ }[];
191
+ fragments: Record<string, {
192
+ serviceId: string;
193
+ fragmentId: string;
194
+ targetPath: string;
195
+ enabled: boolean;
196
+ }[]>;
197
+ shellFragments: Record<string, Record<string, {
198
+ mode: "none";
199
+ } | {
200
+ mode: "override";
201
+ item: {
202
+ source: "shell";
203
+ fragmentId: string;
204
+ } | {
205
+ source: "service";
206
+ serviceId: string;
207
+ fragmentId: string;
208
+ targetPath: string;
209
+ };
210
+ } | {
211
+ mode: "items";
212
+ items: ({
213
+ source: "shell";
214
+ fragmentId: string;
215
+ } | {
216
+ source: "service";
217
+ serviceId: string;
218
+ fragmentId: string;
219
+ targetPath: string;
220
+ })[];
221
+ }>>;
222
+ shell?: {
223
+ serviceId: string;
224
+ } | undefined;
225
+ layoutId?: string | undefined;
226
+ seo?: {
227
+ visibility: "auto" | "public" | "private";
228
+ serviceFailure: "error" | "known-routes" | "omit-service";
229
+ serviceCache: "none" | "1h" | "24h" | "7d";
230
+ canonicalOrigin?: string | undefined;
231
+ } | undefined;
232
+ auth?: {
233
+ serviceId: string;
234
+ expectedIssuer: string;
235
+ expectedAudience: string;
236
+ jwksUri: string;
237
+ roles: {
238
+ id: string;
239
+ title: string;
240
+ permissions: {
241
+ serviceId: string;
242
+ viewId: string;
243
+ permissions: ("read" | "create" | "update" | "delete")[];
244
+ }[];
245
+ description?: string | undefined;
246
+ }[];
247
+ provider?: {
248
+ kind: "betterportal.default";
249
+ } | {
250
+ kind: "authress.io";
251
+ roleClaimPath: string;
252
+ subjectClaimPath: string;
253
+ nameClaimPath?: string | undefined;
254
+ emailClaimPath?: string | undefined;
255
+ pictureClaimPath?: string | undefined;
256
+ } | undefined;
257
+ roleAuthority?: "provider" | "betterportal" | undefined;
258
+ loginViewId?: string | undefined;
259
+ logoutViewId?: string | undefined;
260
+ refreshViewId?: string | undefined;
261
+ redirects?: {
262
+ afterLogin?: {
263
+ serviceId: string;
264
+ viewId: string;
265
+ } | undefined;
266
+ afterLogout?: {
267
+ serviceId: string;
268
+ viewId: string;
269
+ } | undefined;
270
+ } | undefined;
271
+ publicKeys?: {
272
+ keys: {
273
+ kty: "RSA";
274
+ use: "sig";
275
+ alg: "RS256";
276
+ kid: string;
277
+ n: string;
278
+ e: string;
279
+ }[];
280
+ } | undefined;
281
+ } | undefined;
282
+ statusViewIds?: Record<string, string> | undefined;
283
+ }[];
284
+ sharedServiceCatalog: {
285
+ id: string;
286
+ title: string;
287
+ baseUrl: string;
288
+ apiKeyHash: string;
289
+ supportedDeploymentModes: ("bp-hosted" | "customer-hosted" | "third-party-saas" | "self-hosted" | "saas-managed")[];
290
+ owner: "bp" | "3p";
291
+ tags: string[];
292
+ enabled: boolean;
293
+ serviceId?: string | undefined;
294
+ description?: string | undefined;
295
+ logoUrl?: string | undefined;
296
+ publicKeyPem?: string | undefined;
297
+ keyId?: string | undefined;
298
+ authProvider?: {
299
+ issuer: string;
300
+ audience: string;
301
+ jwksUri: string;
302
+ publicKeys?: {
303
+ keys: {
304
+ kty: "RSA";
305
+ use: "sig";
306
+ alg: "RS256";
307
+ kid: string;
308
+ n: string;
309
+ e: string;
310
+ }[];
311
+ } | undefined;
312
+ } | undefined;
313
+ upgradeUrlTemplate?: string | undefined;
314
+ category?: string | undefined;
315
+ pricingHint?: "free" | "freemium" | "paid" | undefined;
316
+ publishedAt?: string | undefined;
317
+ }[];
318
+ sharedServiceActivations: {
319
+ id: string;
320
+ tenantId: string;
321
+ sharedServiceId: string;
322
+ activatedAt: string;
323
+ enabled: boolean;
324
+ appId?: string | undefined;
325
+ }[];
326
+ manifestCache: {
327
+ serviceId: string;
328
+ manifestVersion: string;
329
+ fetchedAt: string;
330
+ capabilities: string[];
331
+ m2mRequests: {
332
+ id: string;
333
+ title: string;
334
+ contractId: string;
335
+ requiredCapabilities: string[];
336
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[];
337
+ permissions: string[];
338
+ mode: "service" | "delegated";
339
+ optional: boolean;
340
+ description?: string | undefined;
341
+ version?: string | undefined;
342
+ }[];
343
+ apiContracts: {
344
+ id: string;
345
+ title: string;
346
+ version: string;
347
+ viewId: string;
348
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[];
349
+ capabilities: string[];
350
+ permissions: string[];
351
+ modes: ("service" | "delegated")[];
352
+ description?: string | undefined;
353
+ }[];
354
+ developerResources: {
355
+ id: string;
356
+ kind: "guide" | "template" | "skill" | "example";
357
+ title: string;
358
+ mediaType: string;
359
+ content: string;
360
+ description?: string | undefined;
361
+ language?: string | undefined;
362
+ }[];
363
+ configSchemas: {
364
+ id: string;
365
+ title: string;
366
+ description: string;
367
+ scope: "tenant" | "app";
368
+ jsonSchema: import("@betterportal/framework").JsonObject;
369
+ fields: {
370
+ key: string;
371
+ title: string;
372
+ description: string;
373
+ scope: "tenant" | "app";
374
+ visibility: "public" | "protected" | "secret";
375
+ ownership: "bp" | "plugin" | "mixed";
376
+ sourceOfTruth: "external" | "bp" | "plugin";
377
+ required: boolean;
378
+ groupId?: string | undefined;
379
+ order?: number | undefined;
380
+ defaultValue?: import("@betterportal/framework").JsonValue | undefined;
381
+ ui?: {
382
+ control?: "number" | "email" | "text" | "select" | "url" | "date" | "textarea" | "password" | "checkbox" | "multiselect" | "color" | "time" | "datetime-local" | undefined;
383
+ placeholder?: string | undefined;
384
+ options?: {
385
+ value: string;
386
+ label: string;
387
+ }[] | undefined;
388
+ optionsSource?: "app.routes" | undefined;
389
+ min?: string | number | undefined;
390
+ max?: string | number | undefined;
391
+ step?: number | undefined;
392
+ rows?: number | undefined;
393
+ } | undefined;
394
+ }[];
395
+ groups?: {
396
+ id: string;
397
+ title: string;
398
+ description?: string | undefined;
399
+ order?: number | undefined;
400
+ optional?: boolean | undefined;
401
+ }[] | undefined;
402
+ }[];
403
+ webhooks: {
404
+ id: string;
405
+ title: string;
406
+ payloadSchema: import("@betterportal/framework").JsonObject;
407
+ description?: string | undefined;
408
+ }[];
409
+ viewIndex: Record<string, {
410
+ viewId: string;
411
+ title: string;
412
+ description: string;
413
+ path: string;
414
+ pathVariants: string[];
415
+ operations: {
416
+ operationId: string;
417
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
418
+ title: string;
419
+ description: string;
420
+ renderers: string[];
421
+ renderModes: ("page" | "fragment" | "embed")[];
422
+ authRequired: boolean;
423
+ robots: {
424
+ userAgent: string;
425
+ access: "allow" | "disallow";
426
+ crawlDelaySeconds?: number | undefined;
427
+ }[];
428
+ dependencies: {
429
+ operationId: string;
430
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
431
+ serviceId?: string | undefined;
432
+ }[];
433
+ permissions: {
434
+ serviceId: string;
435
+ viewId: string;
436
+ permissions: string[];
437
+ }[];
438
+ renderable: boolean;
439
+ apiContracts: {
440
+ id: string;
441
+ title: string;
442
+ version: string;
443
+ viewId: string;
444
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[];
445
+ capabilities: string[];
446
+ permissions: string[];
447
+ modes: ("service" | "delegated")[];
448
+ description?: string | undefined;
449
+ }[];
450
+ demoScenarios: {
451
+ id: string;
452
+ title: string;
453
+ response: import("@betterportal/framework").JsonValue;
454
+ description?: string | undefined;
455
+ match?: {
456
+ query?: import("@betterportal/framework").JsonObject | undefined;
457
+ params?: import("@betterportal/framework").JsonObject | undefined;
458
+ headers?: Record<string, string> | undefined;
459
+ request?: import("@betterportal/framework").JsonObject | undefined;
460
+ } | undefined;
461
+ }[];
462
+ role?: string | undefined;
463
+ sitemap?: {
464
+ kind: "provider" | "default" | "exclude" | "metadata";
465
+ lastModified?: string | undefined;
466
+ changeFrequency?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never" | undefined;
467
+ priority?: number | undefined;
468
+ } | undefined;
469
+ menu?: boolean | undefined;
470
+ chrome?: {
471
+ [x: string]: string | number | boolean;
472
+ hideMenu?: boolean | undefined;
473
+ hideHeader?: boolean | undefined;
474
+ hideFooter?: boolean | undefined;
475
+ fullScreen?: boolean | undefined;
476
+ } | undefined;
477
+ schemas?: {
478
+ query?: import("@betterportal/framework").JsonObject | undefined;
479
+ headers?: import("@betterportal/framework").JsonObject | undefined;
480
+ request?: import("@betterportal/framework").JsonObject | undefined;
481
+ multipart?: import("@betterportal/framework").JsonObject | undefined;
482
+ response?: import("@betterportal/framework").JsonObject | undefined;
483
+ } | undefined;
484
+ raw?: boolean | undefined;
485
+ }[];
486
+ fragments: {
487
+ fragmentId: string;
488
+ targetPath: string;
489
+ operationId: string;
490
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS";
491
+ }[];
492
+ paramsSchema?: import("@betterportal/framework").JsonObject | undefined;
493
+ }>;
494
+ title?: string | undefined;
495
+ authProvider?: {
496
+ issuer: string;
497
+ audience: string;
498
+ jwksUri: string;
499
+ publicKeys?: {
500
+ keys: {
501
+ kty: "RSA";
502
+ use: "sig";
503
+ alg: "RS256";
504
+ kid: string;
505
+ n: string;
506
+ e: string;
507
+ }[];
508
+ } | undefined;
509
+ } | undefined;
510
+ shell?: {
511
+ service: string;
512
+ renderer: string;
513
+ fragments: {
514
+ id: string;
515
+ kind: "fragment" | "block";
516
+ title: string;
517
+ description: string;
518
+ defaultItems: string[];
519
+ }[];
520
+ } | undefined;
521
+ }[];
522
+ m2m: {
523
+ bindings: {
524
+ id: string;
525
+ tenantId: string;
526
+ sourceServiceId: string;
527
+ requestId: string;
528
+ contractId: string;
529
+ targetServiceId: string;
530
+ targetViewId: string;
531
+ mode: "service" | "delegated";
532
+ enabled: boolean;
533
+ createdAt: string;
534
+ appId?: string | undefined;
535
+ }[];
536
+ grants: {
537
+ id: string;
538
+ tenantId: string;
539
+ bindingId: string;
540
+ methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[];
541
+ permissions: string[];
542
+ enabled: boolean;
543
+ createdAt: string;
544
+ appId?: string | undefined;
545
+ }[];
546
+ };
547
+ previewEnvironmentGroups: {
548
+ id: string;
549
+ name: string;
550
+ sourceTenantId: string;
551
+ sourceAppId: string;
552
+ expiresInDays: number | null;
553
+ elevatedRoleIds: string[];
554
+ apiKeyHash: string;
555
+ services: {
556
+ serviceId: string;
557
+ config: {
558
+ tenant: import("@betterportal/framework").JsonObject;
559
+ app: import("@betterportal/framework").JsonObject;
560
+ };
561
+ title?: string | undefined;
562
+ }[];
563
+ createdAt: string;
564
+ updatedAt: string;
565
+ oidc?: {
566
+ issuer: string;
567
+ audience: string;
568
+ jwksUri: string;
569
+ requiredClaims: Record<string, string>;
570
+ subjectPrefix?: string | undefined;
571
+ } | undefined;
572
+ }[];
573
+ previewEnvironmentDeployments: {
574
+ id: string;
575
+ groupId: string;
576
+ key: string;
577
+ name: string;
578
+ hostname: string;
579
+ tenantId: string;
580
+ appId: string;
581
+ expiresInDays: number | null;
582
+ services: {
583
+ serviceId: string;
584
+ instanceId: string;
585
+ url: string;
586
+ }[];
587
+ createdAt: string;
588
+ updatedAt: string;
589
+ effectiveConfig?: {
590
+ services: {
591
+ serviceId: string;
592
+ config: {
593
+ tenant: import("@betterportal/framework").JsonObject;
594
+ app: import("@betterportal/framework").JsonObject;
595
+ };
596
+ title?: string | undefined;
597
+ }[];
598
+ elevatedRoleIds: string[];
599
+ } | undefined;
600
+ credentialReplay?: {
601
+ requestHash: string;
602
+ ciphertext: string;
603
+ expiresAt: string;
604
+ } | undefined;
605
+ expiresAt?: string | undefined;
606
+ }[];
607
+ webhooks: {
608
+ targets: {
609
+ id: string;
610
+ tenantId: string;
611
+ serviceId: string;
612
+ eventId: string;
613
+ url: string;
614
+ secret: string;
615
+ createdAt: string;
616
+ enabled: boolean;
617
+ maxAttempts: number;
618
+ appId?: string | undefined;
619
+ }[];
620
+ };
621
+ }>;
622
+ export declare function readAppPage(db: AppDatabase, appId?: string, chooseFirst?: boolean): Promise<{
623
+ appChoices: {
624
+ id: string;
625
+ tenantId: string;
626
+ title: string;
627
+ }[];
628
+ apps: {
629
+ id: string;
630
+ tenantId: string;
631
+ slug: string;
632
+ title: string;
633
+ hostnames: string[];
634
+ originOverrides: string[];
635
+ refererOverrides: string[];
636
+ themeConfig: {
637
+ mode: "light" | "dark" | "system";
638
+ bootstrap: {
639
+ primary?: string | undefined;
640
+ secondary?: string | undefined;
641
+ success?: string | undefined;
642
+ info?: string | undefined;
643
+ warning?: string | undefined;
644
+ danger?: string | undefined;
645
+ light?: string | undefined;
646
+ dark?: string | undefined;
647
+ };
648
+ light: {
649
+ background?: string | undefined;
650
+ surface?: string | undefined;
651
+ surfaceAlt?: string | undefined;
652
+ text?: string | undefined;
653
+ textSoft?: string | undefined;
654
+ border?: string | undefined;
655
+ accentSoft?: string | undefined;
656
+ };
657
+ dark: {
658
+ background?: string | undefined;
659
+ surface?: string | undefined;
660
+ surfaceAlt?: string | undefined;
661
+ text?: string | undefined;
662
+ textSoft?: string | undefined;
663
+ border?: string | undefined;
664
+ accentSoft?: string | undefined;
665
+ };
666
+ brandName?: string | undefined;
667
+ documentTitle?: string | undefined;
668
+ lightLogoUrl?: string | undefined;
669
+ darkLogoUrl?: string | undefined;
670
+ faviconUrl?: string | undefined;
671
+ };
672
+ defaultRoute: string;
673
+ routes: {
674
+ id: string;
675
+ kind: "page" | "api";
676
+ path: string;
677
+ serviceId: string;
678
+ viewId: string;
679
+ enabled: boolean;
680
+ operations: string[];
681
+ servicePathVariant?: string | undefined;
682
+ fixedParams?: Record<string, string> | undefined;
683
+ authRequired?: boolean | undefined;
684
+ menuPermissions?: {
685
+ serviceId: string;
686
+ viewId: string;
687
+ permissions: string[];
688
+ }[] | undefined;
689
+ sitemap?: {
690
+ kind: "provider" | "default" | "exclude" | "metadata";
691
+ lastModified?: string | undefined;
692
+ changeFrequency?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never" | undefined;
693
+ priority?: number | undefined;
694
+ } | undefined;
695
+ robots?: {
696
+ userAgent: string;
697
+ access: "allow" | "disallow";
698
+ crawlDelaySeconds?: number | undefined;
699
+ }[] | undefined;
700
+ targetPath?: string | undefined;
701
+ resolvedServicePath?: string | undefined;
702
+ resolvedMethods?: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS")[] | undefined;
703
+ query?: string | undefined;
704
+ title?: string | undefined;
705
+ icon?: string | undefined;
706
+ enablement?: "enabled" | "auto" | "disabled" | undefined;
707
+ menu?: boolean | undefined;
708
+ chrome?: {
709
+ [x: string]: string | number | boolean;
710
+ hideMenu?: boolean | undefined;
711
+ hideHeader?: boolean | undefined;
712
+ hideFooter?: boolean | undefined;
713
+ fullScreen?: boolean | undefined;
714
+ } | undefined;
715
+ }[];
716
+ menu: import("@betterportal/framework").BetterPortalMenuItem[];
717
+ slots: {
718
+ slotId: string;
719
+ serviceId: string;
720
+ viewId: string;
721
+ enabled: boolean;
722
+ renderer?: string | undefined;
723
+ }[];
724
+ fragments: Record<string, {
725
+ serviceId: string;
726
+ fragmentId: string;
727
+ targetPath: string;
728
+ enabled: boolean;
729
+ }[]>;
730
+ shellFragments: Record<string, Record<string, {
731
+ mode: "none";
732
+ } | {
733
+ mode: "override";
734
+ item: {
735
+ source: "shell";
736
+ fragmentId: string;
737
+ } | {
738
+ source: "service";
739
+ serviceId: string;
740
+ fragmentId: string;
741
+ targetPath: string;
742
+ };
743
+ } | {
744
+ mode: "items";
745
+ items: ({
746
+ source: "shell";
747
+ fragmentId: string;
748
+ } | {
749
+ source: "service";
750
+ serviceId: string;
751
+ fragmentId: string;
752
+ targetPath: string;
753
+ })[];
754
+ }>>;
755
+ shell?: {
756
+ serviceId: string;
757
+ } | undefined;
758
+ layoutId?: string | undefined;
759
+ seo?: {
760
+ visibility: "auto" | "public" | "private";
761
+ serviceFailure: "error" | "known-routes" | "omit-service";
762
+ serviceCache: "none" | "1h" | "24h" | "7d";
763
+ canonicalOrigin?: string | undefined;
764
+ } | undefined;
765
+ auth?: {
766
+ serviceId: string;
767
+ expectedIssuer: string;
768
+ expectedAudience: string;
769
+ jwksUri: string;
770
+ roles: {
771
+ id: string;
772
+ title: string;
773
+ permissions: {
774
+ serviceId: string;
775
+ viewId: string;
776
+ permissions: ("read" | "create" | "update" | "delete")[];
777
+ }[];
778
+ description?: string | undefined;
779
+ }[];
780
+ provider?: {
781
+ kind: "betterportal.default";
782
+ } | {
783
+ kind: "authress.io";
784
+ roleClaimPath: string;
785
+ subjectClaimPath: string;
786
+ nameClaimPath?: string | undefined;
787
+ emailClaimPath?: string | undefined;
788
+ pictureClaimPath?: string | undefined;
789
+ } | undefined;
790
+ roleAuthority?: "provider" | "betterportal" | undefined;
791
+ loginViewId?: string | undefined;
792
+ logoutViewId?: string | undefined;
793
+ refreshViewId?: string | undefined;
794
+ redirects?: {
795
+ afterLogin?: {
796
+ serviceId: string;
797
+ viewId: string;
798
+ } | undefined;
799
+ afterLogout?: {
800
+ serviceId: string;
801
+ viewId: string;
802
+ } | undefined;
803
+ } | undefined;
804
+ publicKeys?: {
805
+ keys: {
806
+ kty: "RSA";
807
+ use: "sig";
808
+ alg: "RS256";
809
+ kid: string;
810
+ n: string;
811
+ e: string;
812
+ }[];
813
+ } | undefined;
814
+ } | undefined;
815
+ statusViewIds?: Record<string, string> | undefined;
816
+ }[];
817
+ platformServices: {
818
+ id: string;
819
+ hostname: string;
820
+ apiKeyHash: string;
821
+ capabilities: string[];
822
+ title: string;
823
+ createdAt: string;
824
+ enabled: boolean;
825
+ publicKeyPem?: string | undefined;
826
+ keyId?: string | undefined;
827
+ serviceId?: string | undefined;
828
+ authProvider?: {
829
+ issuer: string;
830
+ audience: string;
831
+ jwksUri: string;
832
+ publicKeys?: {
833
+ keys: {
834
+ kty: "RSA";
835
+ use: "sig";
836
+ alg: "RS256";
837
+ kid: string;
838
+ n: string;
839
+ e: string;
840
+ }[];
841
+ } | undefined;
842
+ } | undefined;
843
+ description?: string | undefined;
844
+ category?: string | undefined;
845
+ }[];
846
+ tenants: {
847
+ id: string;
848
+ slug: string;
849
+ title: string;
850
+ active: boolean;
851
+ branding: {
852
+ brandName?: string | undefined;
853
+ logoUrl?: string | undefined;
854
+ primaryColor?: string | undefined;
855
+ secondaryColor?: string | undefined;
856
+ };
857
+ services: {
858
+ id: string;
859
+ hostname: string;
860
+ apiKeyHash: string;
861
+ capabilities: string[];
862
+ deploymentMode: "bp-hosted" | "customer-hosted" | "third-party-saas" | "self-hosted" | "saas-managed";
863
+ createdAt: string;
864
+ enabled: boolean;
865
+ publicKeyPem?: string | undefined;
866
+ keyId?: string | undefined;
867
+ serviceId?: string | undefined;
868
+ authProvider?: {
869
+ issuer: string;
870
+ audience: string;
871
+ jwksUri: string;
872
+ publicKeys?: {
873
+ keys: {
874
+ kty: "RSA";
875
+ use: "sig";
876
+ alg: "RS256";
877
+ kid: string;
878
+ n: string;
879
+ e: string;
880
+ }[];
881
+ } | undefined;
882
+ } | undefined;
883
+ title?: string | undefined;
884
+ description?: string | undefined;
885
+ lastSeenAt?: string | undefined;
886
+ lastSyncAt?: string | undefined;
887
+ }[];
888
+ activatedPlatformServices: string[];
889
+ }[];
890
+ sharedServiceCatalog: {
891
+ id: string;
892
+ title: string;
893
+ baseUrl: string;
894
+ apiKeyHash: string;
895
+ supportedDeploymentModes: ("bp-hosted" | "customer-hosted" | "third-party-saas" | "self-hosted" | "saas-managed")[];
896
+ owner: "bp" | "3p";
897
+ tags: string[];
898
+ enabled: boolean;
899
+ serviceId?: string | undefined;
900
+ description?: string | undefined;
901
+ logoUrl?: string | undefined;
902
+ publicKeyPem?: string | undefined;
903
+ keyId?: string | undefined;
904
+ authProvider?: {
905
+ issuer: string;
906
+ audience: string;
907
+ jwksUri: string;
908
+ publicKeys?: {
909
+ keys: {
910
+ kty: "RSA";
911
+ use: "sig";
912
+ alg: "RS256";
913
+ kid: string;
914
+ n: string;
915
+ e: string;
916
+ }[];
917
+ } | undefined;
918
+ } | undefined;
919
+ upgradeUrlTemplate?: string | undefined;
920
+ category?: string | undefined;
921
+ pricingHint?: "free" | "freemium" | "paid" | undefined;
922
+ publishedAt?: string | undefined;
923
+ }[];
924
+ sharedServiceActivations: {
925
+ id: string;
926
+ tenantId: string;
927
+ sharedServiceId: string;
928
+ activatedAt: string;
929
+ enabled: boolean;
930
+ appId?: string | undefined;
931
+ }[];
932
+ previewEnvironmentDeployments: {
933
+ id: string;
934
+ groupId: string;
935
+ key: string;
936
+ name: string;
937
+ hostname: string;
938
+ tenantId: string;
939
+ appId: string;
940
+ expiresInDays: number | null;
941
+ services: {
942
+ serviceId: string;
943
+ instanceId: string;
944
+ url: string;
945
+ }[];
946
+ createdAt: string;
947
+ updatedAt: string;
948
+ effectiveConfig?: {
949
+ services: {
950
+ serviceId: string;
951
+ config: {
952
+ tenant: import("@betterportal/framework").JsonObject;
953
+ app: import("@betterportal/framework").JsonObject;
954
+ };
955
+ title?: string | undefined;
956
+ }[];
957
+ elevatedRoleIds: string[];
958
+ } | undefined;
959
+ credentialReplay?: {
960
+ requestHash: string;
961
+ ciphertext: string;
962
+ expiresAt: string;
963
+ } | undefined;
964
+ expiresAt?: string | undefined;
965
+ }[];
966
+ }>;
967
+ export type CacheData = Pick<BetterPortalConfig, "apps" | "tenants" | "platformServices" | "sharedServiceCatalog" | "sharedServiceActivations" | "configManagement" | "manifestCache">;
968
+ /** Caches need service manifests and auth grants, never menus, routes or preview snapshots. */
969
+ export declare function readCacheData(db: AppDatabase): Promise<CacheData>;
970
+ export declare function readApp(db: AppDatabase, appId: string): Promise<AppEditorData>;
971
+ export type DirectoryData = Pick<BetterPortalConfig, "apps" | "tenants" | "platformServices" | "sharedServiceCatalog" | "sharedServiceActivations" | "configManagement" | "m2m">;
972
+ /** Service/settings pages need registration summaries, not app operational collections. */
973
+ export declare function readDirectory(db: AppDatabase): Promise<DirectoryData>;
974
+ /** Tenant editor needs route choices/counts, but no route options, menus or grants. */
975
+ export declare function readTenantPage(db: AppDatabase): Promise<DirectoryData>;
976
+ //# sourceMappingURL=appQueries.d.ts.map