@builder.io/ai-utils 0.84.0-dev.202607212345.137e4170f → 0.85.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/package.json +1 -1
- package/src/projects.d.ts +14 -2
- package/src/projects.js +14 -2
- package/src/acl-schema.d.ts +0 -88
- package/src/acl-schema.js +0 -71
- package/src/perf-report.d.ts +0 -116
- package/src/perf-report.js +0 -122
- package/src/vpc-peering.d.ts +0 -49
- package/src/vpc-peering.js +0 -1
package/package.json
CHANGED
package/src/projects.d.ts
CHANGED
|
@@ -1724,9 +1724,21 @@ export declare const HostingDomainKindSchema: z.ZodEnum<{
|
|
|
1724
1724
|
}>;
|
|
1725
1725
|
export type HostingDomainKind = z.infer<typeof HostingDomainKindSchema>;
|
|
1726
1726
|
/**
|
|
1727
|
-
* Custom domain record
|
|
1727
|
+
* Custom domain record. The same shape backs two Firestore collections:
|
|
1728
|
+
*
|
|
1729
|
+
* - Lock doc `hosting-domains/{domain}` is the single exclusive owner. It
|
|
1730
|
+
* exists only once a project reaches `provisioning`/`active` (cert + route
|
|
1731
|
+
* created, DNS ownership proven) and is the cross-project serialization
|
|
1732
|
+
* point serving/deploy/unpublish read to answer "is this verified?".
|
|
1733
|
+
* `certId`/`certMapEntryName`/`httpRouteName`/`verifiedAt` are only ever
|
|
1734
|
+
* populated here.
|
|
1735
|
+
* - Claim subdoc `hosting-domains/{domain}/claims/{projectId}` is a
|
|
1736
|
+
* non-exclusive, per-project verification attempt (`pending`/`verifying`/
|
|
1737
|
+
* `failed`). Multiple projects can hold a claim on the same domain at once;
|
|
1738
|
+
* whoever proves DNS ownership first wins the lock and the losers are swept
|
|
1739
|
+
* to `failed`.
|
|
1740
|
+
*
|
|
1728
1741
|
* The normalized domain is the doc key — global uniqueness comes for free.
|
|
1729
|
-
* This doc is both the record AND the claim for the domain.
|
|
1730
1742
|
*/
|
|
1731
1743
|
export declare const HostingDomainSchema: z.ZodObject<{
|
|
1732
1744
|
domain: z.ZodString;
|
package/src/projects.js
CHANGED
|
@@ -625,9 +625,21 @@ export const HostingDomainStatusSchema = z.enum([
|
|
|
625
625
|
]);
|
|
626
626
|
export const HostingDomainKindSchema = z.enum(["apex", "subdomain"]);
|
|
627
627
|
/**
|
|
628
|
-
* Custom domain record
|
|
628
|
+
* Custom domain record. The same shape backs two Firestore collections:
|
|
629
|
+
*
|
|
630
|
+
* - Lock doc `hosting-domains/{domain}` is the single exclusive owner. It
|
|
631
|
+
* exists only once a project reaches `provisioning`/`active` (cert + route
|
|
632
|
+
* created, DNS ownership proven) and is the cross-project serialization
|
|
633
|
+
* point serving/deploy/unpublish read to answer "is this verified?".
|
|
634
|
+
* `certId`/`certMapEntryName`/`httpRouteName`/`verifiedAt` are only ever
|
|
635
|
+
* populated here.
|
|
636
|
+
* - Claim subdoc `hosting-domains/{domain}/claims/{projectId}` is a
|
|
637
|
+
* non-exclusive, per-project verification attempt (`pending`/`verifying`/
|
|
638
|
+
* `failed`). Multiple projects can hold a claim on the same domain at once;
|
|
639
|
+
* whoever proves DNS ownership first wins the lock and the losers are swept
|
|
640
|
+
* to `failed`.
|
|
641
|
+
*
|
|
629
642
|
* The normalized domain is the doc key — global uniqueness comes for free.
|
|
630
|
-
* This doc is both the record AND the claim for the domain.
|
|
631
643
|
*/
|
|
632
644
|
export const HostingDomainSchema = z.object({
|
|
633
645
|
domain: z
|
package/src/acl-schema.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const PermissionSchema: z.ZodEnum<{
|
|
3
|
-
list: "list";
|
|
4
|
-
read: "read";
|
|
5
|
-
write: "write";
|
|
6
|
-
}>;
|
|
7
|
-
export type Permission = z.infer<typeof PermissionSchema>;
|
|
8
|
-
export declare const AclEntrySchema: z.ZodObject<{
|
|
9
|
-
action: z.ZodEnum<{
|
|
10
|
-
allow: "allow";
|
|
11
|
-
deny: "deny";
|
|
12
|
-
}>;
|
|
13
|
-
resource: z.ZodString;
|
|
14
|
-
permissions: z.ZodArray<z.ZodEnum<{
|
|
15
|
-
list: "list";
|
|
16
|
-
read: "read";
|
|
17
|
-
write: "write";
|
|
18
|
-
}>>;
|
|
19
|
-
description: z.ZodOptional<z.ZodString>;
|
|
20
|
-
principals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
export type AclEntry = z.infer<typeof AclEntrySchema>;
|
|
23
|
-
export declare const AclPolicySchema: z.ZodObject<{
|
|
24
|
-
secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
-
entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
-
action: z.ZodEnum<{
|
|
27
|
-
allow: "allow";
|
|
28
|
-
deny: "deny";
|
|
29
|
-
}>;
|
|
30
|
-
resource: z.ZodString;
|
|
31
|
-
permissions: z.ZodArray<z.ZodEnum<{
|
|
32
|
-
list: "list";
|
|
33
|
-
read: "read";
|
|
34
|
-
write: "write";
|
|
35
|
-
}>>;
|
|
36
|
-
description: z.ZodOptional<z.ZodString>;
|
|
37
|
-
principals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
38
|
-
}, z.core.$strip>>>;
|
|
39
|
-
denyDescription: z.ZodOptional<z.ZodString>;
|
|
40
|
-
}, z.core.$strip>;
|
|
41
|
-
export type AclPolicy = z.infer<typeof AclPolicySchema>;
|
|
42
|
-
export declare const AclDenialSchema: z.ZodObject<{
|
|
43
|
-
kind: z.ZodEnum<{
|
|
44
|
-
"command-allowlist": "command-allowlist";
|
|
45
|
-
"command-security": "command-security";
|
|
46
|
-
"file-access": "file-access";
|
|
47
|
-
}>;
|
|
48
|
-
reason: z.ZodEnum<{
|
|
49
|
-
"deny-pattern-matched": "deny-pattern-matched";
|
|
50
|
-
"no-allow-match": "no-allow-match";
|
|
51
|
-
"security-policy": "security-policy";
|
|
52
|
-
"shell-metacharacter": "shell-metacharacter";
|
|
53
|
-
}>;
|
|
54
|
-
resource: z.ZodString;
|
|
55
|
-
command: z.ZodOptional<z.ZodString>;
|
|
56
|
-
permission: z.ZodOptional<z.ZodEnum<{
|
|
57
|
-
list: "list";
|
|
58
|
-
read: "read";
|
|
59
|
-
write: "write";
|
|
60
|
-
}>>;
|
|
61
|
-
policy: z.ZodOptional<z.ZodString>;
|
|
62
|
-
matchedPattern: z.ZodOptional<z.ZodString>;
|
|
63
|
-
matchedEntry: z.ZodOptional<z.ZodObject<{
|
|
64
|
-
action: z.ZodEnum<{
|
|
65
|
-
allow: "allow";
|
|
66
|
-
deny: "deny";
|
|
67
|
-
}>;
|
|
68
|
-
resource: z.ZodString;
|
|
69
|
-
permissions: z.ZodArray<z.ZodEnum<{
|
|
70
|
-
list: "list";
|
|
71
|
-
read: "read";
|
|
72
|
-
write: "write";
|
|
73
|
-
}>>;
|
|
74
|
-
description: z.ZodOptional<z.ZodString>;
|
|
75
|
-
principals: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
-
}, z.core.$strip>>;
|
|
77
|
-
message: z.ZodString;
|
|
78
|
-
}, z.core.$strip>;
|
|
79
|
-
export type AclDenial = z.infer<typeof AclDenialSchema>;
|
|
80
|
-
export interface AccessResult {
|
|
81
|
-
allowed: boolean;
|
|
82
|
-
message: string;
|
|
83
|
-
matchedEntry?: AclEntry;
|
|
84
|
-
matchedPattern?: string;
|
|
85
|
-
reason?: "deny-pattern-matched" | "no-allow-match";
|
|
86
|
-
requestedResource?: string;
|
|
87
|
-
requestedPermission?: Permission;
|
|
88
|
-
}
|
package/src/acl-schema.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const PermissionSchema = z
|
|
3
|
-
.enum(["read", "write", "list"])
|
|
4
|
-
.meta({ title: "Permission" });
|
|
5
|
-
// One ACL rule
|
|
6
|
-
export const AclEntrySchema = z
|
|
7
|
-
.object({
|
|
8
|
-
action: z
|
|
9
|
-
.enum(["allow", "deny"])
|
|
10
|
-
.meta({ description: "whether this rule allows or denies access" }),
|
|
11
|
-
resource: z
|
|
12
|
-
.string()
|
|
13
|
-
.meta({ description: "what — supports glob patterns like /files/*.txt" }),
|
|
14
|
-
permissions: z
|
|
15
|
-
.array(PermissionSchema)
|
|
16
|
-
.meta({ description: "actions this rule applies to" }),
|
|
17
|
-
description: z.string().optional().meta({
|
|
18
|
-
description: "custom message, in deny case, this is the error message. This will override denyDescription on AclPolicy if defined.",
|
|
19
|
-
}),
|
|
20
|
-
principals: z.array(z.string()).optional().meta({
|
|
21
|
-
description: "array of teams/roles this rule applies to (e.g., ['developer', 'admin'])",
|
|
22
|
-
}),
|
|
23
|
-
})
|
|
24
|
-
.meta({ title: "AclEntry" });
|
|
25
|
-
// A full ACL policy is just a list of rules
|
|
26
|
-
export const AclPolicySchema = z
|
|
27
|
-
.object({
|
|
28
|
-
secrets: z.array(z.string()).optional(),
|
|
29
|
-
entries: z.array(AclEntrySchema).optional(),
|
|
30
|
-
denyDescription: z.string().optional().meta({
|
|
31
|
-
description: "Default message to use when a resource is denied access",
|
|
32
|
-
}),
|
|
33
|
-
})
|
|
34
|
-
.meta({ title: "AclPolicy" });
|
|
35
|
-
// Structured description of an ACL/policy denial. Travels with the tool result
|
|
36
|
-
// so internal tools can show admins exactly which rule blocked a command/file,
|
|
37
|
-
// and both UIs can render a distinct "blocked, did not run" treatment.
|
|
38
|
-
export const AclDenialSchema = z
|
|
39
|
-
.object({
|
|
40
|
-
kind: z
|
|
41
|
-
.enum(["command-security", "command-allowlist", "file-access"])
|
|
42
|
-
.meta({ description: "which gate produced the denial" }),
|
|
43
|
-
reason: z
|
|
44
|
-
.enum([
|
|
45
|
-
"security-policy",
|
|
46
|
-
"deny-pattern-matched",
|
|
47
|
-
"no-allow-match",
|
|
48
|
-
"shell-metacharacter",
|
|
49
|
-
])
|
|
50
|
-
.meta({ description: "why the denial happened" }),
|
|
51
|
-
resource: z.string().meta({
|
|
52
|
-
description: "the file path or command that was blocked",
|
|
53
|
-
}),
|
|
54
|
-
command: z.string().optional().meta({
|
|
55
|
-
description: "the full command, when the denial is command-related",
|
|
56
|
-
}),
|
|
57
|
-
permission: PermissionSchema.optional().meta({
|
|
58
|
-
description: "the requested permission, for file-access denials",
|
|
59
|
-
}),
|
|
60
|
-
policy: z.string().optional().meta({
|
|
61
|
-
description: "named security policy that matched, when applicable",
|
|
62
|
-
}),
|
|
63
|
-
matchedPattern: z.string().optional().meta({
|
|
64
|
-
description: "the glob/pattern that matched the resource or command",
|
|
65
|
-
}),
|
|
66
|
-
matchedEntry: AclEntrySchema.optional().meta({
|
|
67
|
-
description: "the full ACL entry that matched, for file-access denials",
|
|
68
|
-
}),
|
|
69
|
-
message: z.string().meta({ description: "human-readable explanation" }),
|
|
70
|
-
})
|
|
71
|
-
.meta({ title: "AclDenial" });
|
package/src/perf-report.d.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const CURRENT_PERF_REPORT_SCHEMA_VERSION = 1;
|
|
3
|
-
export declare const PerfIncidentTypeSchema: z.ZodEnum<{
|
|
4
|
-
hang: "hang";
|
|
5
|
-
"memory-pressure": "memory-pressure";
|
|
6
|
-
"recovered-hang": "recovered-hang";
|
|
7
|
-
"recovered-unclean-exit": "recovered-unclean-exit";
|
|
8
|
-
"renderer-crash": "renderer-crash";
|
|
9
|
-
}>;
|
|
10
|
-
export type PerfIncidentType = z.infer<typeof PerfIncidentTypeSchema>;
|
|
11
|
-
export declare const PerfProcessSchema: z.ZodObject<{
|
|
12
|
-
kind: z.ZodEnum<{
|
|
13
|
-
browser: "browser";
|
|
14
|
-
child: "child";
|
|
15
|
-
gpu: "gpu";
|
|
16
|
-
renderer: "renderer";
|
|
17
|
-
utility: "utility";
|
|
18
|
-
}>;
|
|
19
|
-
pid: z.ZodNumber;
|
|
20
|
-
memoryKb: z.ZodNumber;
|
|
21
|
-
cpuPercent: z.ZodNumber;
|
|
22
|
-
tabId: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
export type PerfProcess = z.infer<typeof PerfProcessSchema>;
|
|
25
|
-
export declare const PerfTabSchema: z.ZodObject<{
|
|
26
|
-
tabId: z.ZodString;
|
|
27
|
-
route: z.ZodOptional<z.ZodString>;
|
|
28
|
-
feature: z.ZodOptional<z.ZodString>;
|
|
29
|
-
jsHeapUsedKb: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
jsHeapLimitKb: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
subsystems: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
32
|
-
livenessLatencyMs: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
export type PerfTab = z.infer<typeof PerfTabSchema>;
|
|
35
|
-
export declare const PerfSampleSchema: z.ZodObject<{
|
|
36
|
-
t: z.ZodNumber;
|
|
37
|
-
desktopFootprintKb: z.ZodNumber;
|
|
38
|
-
freeMemoryKb: z.ZodNumber;
|
|
39
|
-
perTabHeapKb: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
40
|
-
}, z.core.$strip>;
|
|
41
|
-
export type PerfSample = z.infer<typeof PerfSampleSchema>;
|
|
42
|
-
export declare const PerfReportSchema: z.ZodObject<{
|
|
43
|
-
schemaVersion: z.ZodNumber;
|
|
44
|
-
incidentType: z.ZodEnum<{
|
|
45
|
-
hang: "hang";
|
|
46
|
-
"memory-pressure": "memory-pressure";
|
|
47
|
-
"recovered-hang": "recovered-hang";
|
|
48
|
-
"recovered-unclean-exit": "recovered-unclean-exit";
|
|
49
|
-
"renderer-crash": "renderer-crash";
|
|
50
|
-
}>;
|
|
51
|
-
sessionId: z.ZodString;
|
|
52
|
-
deviceId: z.ZodString;
|
|
53
|
-
appVersion: z.ZodString;
|
|
54
|
-
platform: z.ZodEnum<{
|
|
55
|
-
darwin: "darwin";
|
|
56
|
-
linux: "linux";
|
|
57
|
-
win32: "win32";
|
|
58
|
-
}>;
|
|
59
|
-
channel: z.ZodEnum<{
|
|
60
|
-
alpha: "alpha";
|
|
61
|
-
stable: "stable";
|
|
62
|
-
}>;
|
|
63
|
-
timestamp: z.ZodNumber;
|
|
64
|
-
machine: z.ZodObject<{
|
|
65
|
-
totalMemoryKb: z.ZodNumber;
|
|
66
|
-
freeMemoryKb: z.ZodNumber;
|
|
67
|
-
desktopFootprintKb: z.ZodNumber;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
processes: z.ZodArray<z.ZodObject<{
|
|
70
|
-
kind: z.ZodEnum<{
|
|
71
|
-
browser: "browser";
|
|
72
|
-
child: "child";
|
|
73
|
-
gpu: "gpu";
|
|
74
|
-
renderer: "renderer";
|
|
75
|
-
utility: "utility";
|
|
76
|
-
}>;
|
|
77
|
-
pid: z.ZodNumber;
|
|
78
|
-
memoryKb: z.ZodNumber;
|
|
79
|
-
cpuPercent: z.ZodNumber;
|
|
80
|
-
tabId: z.ZodOptional<z.ZodString>;
|
|
81
|
-
}, z.core.$strip>>;
|
|
82
|
-
tabs: z.ZodArray<z.ZodObject<{
|
|
83
|
-
tabId: z.ZodString;
|
|
84
|
-
route: z.ZodOptional<z.ZodString>;
|
|
85
|
-
feature: z.ZodOptional<z.ZodString>;
|
|
86
|
-
jsHeapUsedKb: z.ZodOptional<z.ZodNumber>;
|
|
87
|
-
jsHeapLimitKb: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
subsystems: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
89
|
-
livenessLatencyMs: z.ZodOptional<z.ZodNumber>;
|
|
90
|
-
}, z.core.$strip>>;
|
|
91
|
-
crash: z.ZodOptional<z.ZodObject<{
|
|
92
|
-
reason: z.ZodString;
|
|
93
|
-
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
oom: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
-
}, z.core.$strip>>;
|
|
96
|
-
hang: z.ZodOptional<z.ZodObject<{
|
|
97
|
-
startedAt: z.ZodNumber;
|
|
98
|
-
durationMs: z.ZodNumber;
|
|
99
|
-
recovered: z.ZodBoolean;
|
|
100
|
-
surface: z.ZodString;
|
|
101
|
-
}, z.core.$strip>>;
|
|
102
|
-
samples: z.ZodArray<z.ZodObject<{
|
|
103
|
-
t: z.ZodNumber;
|
|
104
|
-
desktopFootprintKb: z.ZodNumber;
|
|
105
|
-
freeMemoryKb: z.ZodNumber;
|
|
106
|
-
perTabHeapKb: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
107
|
-
}, z.core.$strip>>;
|
|
108
|
-
}, z.core.$strip>;
|
|
109
|
-
export type PerfReport = z.infer<typeof PerfReportSchema>;
|
|
110
|
-
/**
|
|
111
|
-
* Collapses opaque identifiers out of a route/URL so a report can't carry a
|
|
112
|
-
* project/space id. Keeps the structural shape (which screen was open) while
|
|
113
|
-
* masking the specific resource.
|
|
114
|
-
*/
|
|
115
|
-
export declare function redactPerfRoute(route: string | undefined): string | undefined;
|
|
116
|
-
export declare function redactPerfReport(report: PerfReport): PerfReport;
|
package/src/perf-report.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// ============================================================================
|
|
3
|
-
// Desktop performance & crash monitoring wire contract.
|
|
4
|
-
//
|
|
5
|
-
// Canonical schema. The Electron desktop app lives in a separate workspace and
|
|
6
|
-
// cannot import this file, so it keeps a hand-mirrored TypeScript type in
|
|
7
|
-
// code/packages/electron-app/src/perf-report.types.ts. Keep the two in sync and
|
|
8
|
-
// bump CURRENT_PERF_REPORT_SCHEMA_VERSION on any breaking shape change.
|
|
9
|
-
// ============================================================================
|
|
10
|
-
export const CURRENT_PERF_REPORT_SCHEMA_VERSION = 1;
|
|
11
|
-
export const PerfIncidentTypeSchema = z.enum([
|
|
12
|
-
"renderer-crash",
|
|
13
|
-
"hang",
|
|
14
|
-
"recovered-hang",
|
|
15
|
-
"memory-pressure",
|
|
16
|
-
"recovered-unclean-exit",
|
|
17
|
-
]);
|
|
18
|
-
export const PerfProcessSchema = z.object({
|
|
19
|
-
kind: z.enum(["browser", "renderer", "gpu", "utility", "child"]),
|
|
20
|
-
pid: z.number(),
|
|
21
|
-
memoryKb: z.number(),
|
|
22
|
-
cpuPercent: z.number(),
|
|
23
|
-
tabId: z.string().optional(),
|
|
24
|
-
});
|
|
25
|
-
export const PerfTabSchema = z.object({
|
|
26
|
-
tabId: z.string(),
|
|
27
|
-
route: z.string().optional(),
|
|
28
|
-
feature: z.string().optional(),
|
|
29
|
-
jsHeapUsedKb: z.number().optional(),
|
|
30
|
-
jsHeapLimitKb: z.number().optional(),
|
|
31
|
-
subsystems: z.record(z.string(), z.number()),
|
|
32
|
-
livenessLatencyMs: z.number().optional(),
|
|
33
|
-
});
|
|
34
|
-
export const PerfSampleSchema = z.object({
|
|
35
|
-
t: z.number(),
|
|
36
|
-
desktopFootprintKb: z.number(),
|
|
37
|
-
freeMemoryKb: z.number(),
|
|
38
|
-
perTabHeapKb: z.record(z.string(), z.number()),
|
|
39
|
-
});
|
|
40
|
-
export const PerfReportSchema = z.object({
|
|
41
|
-
schemaVersion: z.number(),
|
|
42
|
-
incidentType: PerfIncidentTypeSchema,
|
|
43
|
-
sessionId: z.string(),
|
|
44
|
-
deviceId: z.string(),
|
|
45
|
-
appVersion: z.string(),
|
|
46
|
-
platform: z.enum(["darwin", "win32", "linux"]),
|
|
47
|
-
channel: z.enum(["stable", "alpha"]),
|
|
48
|
-
timestamp: z.number(),
|
|
49
|
-
machine: z.object({
|
|
50
|
-
totalMemoryKb: z.number(),
|
|
51
|
-
freeMemoryKb: z.number(),
|
|
52
|
-
desktopFootprintKb: z.number(),
|
|
53
|
-
}),
|
|
54
|
-
processes: z.array(PerfProcessSchema),
|
|
55
|
-
tabs: z.array(PerfTabSchema),
|
|
56
|
-
crash: z
|
|
57
|
-
.object({
|
|
58
|
-
reason: z.string(),
|
|
59
|
-
exitCode: z.number().optional(),
|
|
60
|
-
oom: z.boolean().optional(),
|
|
61
|
-
})
|
|
62
|
-
.optional(),
|
|
63
|
-
hang: z
|
|
64
|
-
.object({
|
|
65
|
-
startedAt: z.number(),
|
|
66
|
-
durationMs: z.number(),
|
|
67
|
-
recovered: z.boolean(),
|
|
68
|
-
surface: z.string(),
|
|
69
|
-
})
|
|
70
|
-
.optional(),
|
|
71
|
-
samples: z.array(PerfSampleSchema),
|
|
72
|
-
});
|
|
73
|
-
// ---------------------------------------------------------------------------
|
|
74
|
-
// Route/URL redaction. The desktop client redacts before sending; this runs
|
|
75
|
-
// again at ingest (defense in depth) because the service cannot import the
|
|
76
|
-
// renderer's redactSnapshot helper across the workspace boundary.
|
|
77
|
-
// ---------------------------------------------------------------------------
|
|
78
|
-
const PROJECT_ID_SEGMENTS = new Set([
|
|
79
|
-
"projects",
|
|
80
|
-
"content",
|
|
81
|
-
"fusion",
|
|
82
|
-
"space",
|
|
83
|
-
"org",
|
|
84
|
-
"organization",
|
|
85
|
-
]);
|
|
86
|
-
/**
|
|
87
|
-
* Collapses opaque identifiers out of a route/URL so a report can't carry a
|
|
88
|
-
* project/space id. Keeps the structural shape (which screen was open) while
|
|
89
|
-
* masking the specific resource.
|
|
90
|
-
*/
|
|
91
|
-
export function redactPerfRoute(route) {
|
|
92
|
-
if (!route) {
|
|
93
|
-
return route;
|
|
94
|
-
}
|
|
95
|
-
const [pathPart] = route.split("?");
|
|
96
|
-
const segments = pathPart.split("/");
|
|
97
|
-
const redacted = segments.map((segment, index) => {
|
|
98
|
-
var _a;
|
|
99
|
-
if (!segment) {
|
|
100
|
-
return segment;
|
|
101
|
-
}
|
|
102
|
-
const previous = (_a = segments[index - 1]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
103
|
-
if (previous && PROJECT_ID_SEGMENTS.has(previous)) {
|
|
104
|
-
return ":id";
|
|
105
|
-
}
|
|
106
|
-
// Bare id-looking segments (uuids, long hex/base62 tokens).
|
|
107
|
-
if (/^[0-9a-f]{16,}$/i.test(segment) || /^[0-9a-z]{20,}$/i.test(segment)) {
|
|
108
|
-
return ":id";
|
|
109
|
-
}
|
|
110
|
-
return segment;
|
|
111
|
-
});
|
|
112
|
-
return redacted.join("/");
|
|
113
|
-
}
|
|
114
|
-
export function redactPerfReport(report) {
|
|
115
|
-
return {
|
|
116
|
-
...report,
|
|
117
|
-
tabs: report.tabs.map((tab) => ({
|
|
118
|
-
...tab,
|
|
119
|
-
route: redactPerfRoute(tab.route),
|
|
120
|
-
})),
|
|
121
|
-
};
|
|
122
|
-
}
|
package/src/vpc-peering.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/** Fields common to all VPC connectivity types. */
|
|
2
|
-
interface VpcConnectionBase {
|
|
3
|
-
id: string;
|
|
4
|
-
ownerId: string;
|
|
5
|
-
type: string;
|
|
6
|
-
gcpRegion: string;
|
|
7
|
-
customerDnsServers: string[];
|
|
8
|
-
proxyIp: string;
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
createdAt: number;
|
|
11
|
-
updatedAt: number;
|
|
12
|
-
}
|
|
13
|
-
/** Traditional VPC Peering via bridge VPC. */
|
|
14
|
-
export interface VpcGcpPeering extends VpcConnectionBase {
|
|
15
|
-
type: "gcp-peering";
|
|
16
|
-
gcpProjectId: string;
|
|
17
|
-
gcpNetworkName: string;
|
|
18
|
-
bridgeCidr: string;
|
|
19
|
-
importCustomRoutes: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* PSC Network Attachment — customer creates the network attachment in their VPC,
|
|
23
|
-
* our proxy VM connects to it via a PSC interface on nic1.
|
|
24
|
-
* No bridge VPC or bridge CIDR needed on our side.
|
|
25
|
-
*/
|
|
26
|
-
export interface VpcGcpNetworkAttachment extends VpcConnectionBase {
|
|
27
|
-
type: "gcp-network-attachment";
|
|
28
|
-
gcpProjectId: string;
|
|
29
|
-
networkAttachmentName: string;
|
|
30
|
-
}
|
|
31
|
-
/** Discriminated union of all VPC connectivity types. */
|
|
32
|
-
export type VpcPeering = VpcGcpPeering | VpcGcpNetworkAttachment;
|
|
33
|
-
export interface CreateVpcGcpPeeringParams {
|
|
34
|
-
type: "gcp-peering";
|
|
35
|
-
gcpRegion: string;
|
|
36
|
-
gcpProjectId: string;
|
|
37
|
-
gcpNetworkName: string;
|
|
38
|
-
bridgeCidr: string;
|
|
39
|
-
customerDnsServers: string[];
|
|
40
|
-
importCustomRoutes?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export interface CreateVpcGcpNetworkAttachmentParams {
|
|
43
|
-
type: "gcp-network-attachment";
|
|
44
|
-
gcpProjectId: string;
|
|
45
|
-
networkAttachmentName: string;
|
|
46
|
-
customerDnsServers: string[];
|
|
47
|
-
}
|
|
48
|
-
export type CreateVpcPeeringParams = CreateVpcGcpPeeringParams | CreateVpcGcpNetworkAttachmentParams;
|
|
49
|
-
export {};
|
package/src/vpc-peering.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|