@fabrika/operations-contract 0.8.2 → 0.9.0-cloudflare.2
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 +12 -11
- package/types/src/access.d.ts +13 -0
- package/types/src/catalog.d.ts +51 -0
- package/types/src/index.d.ts +11 -0
- package/types/src/ingest.d.ts +60 -0
- package/types/src/operator-api.d.ts +234 -0
- package/types/src/operator.d.ts +134 -0
- package/types/src/release-schemas.d.ts +355 -0
- package/types/src/releases.d.ts +96 -0
- package/types/src/rpc.d.ts +109 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/operations-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-cloudflare.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,47 +11,48 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"src"
|
|
14
|
+
"src",
|
|
15
|
+
"types"
|
|
15
16
|
],
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
|
18
19
|
"bun": "./src/index.ts",
|
|
19
|
-
"types": "./src/index.ts",
|
|
20
|
+
"types": "./types/src/index.d.ts",
|
|
20
21
|
"default": "./src/index.ts"
|
|
21
22
|
},
|
|
22
23
|
"./ingest": {
|
|
23
24
|
"bun": "./src/ingest.ts",
|
|
24
|
-
"types": "./src/ingest.ts",
|
|
25
|
+
"types": "./types/src/ingest.d.ts",
|
|
25
26
|
"default": "./src/ingest.ts"
|
|
26
27
|
},
|
|
27
28
|
"./operator": {
|
|
28
29
|
"bun": "./src/operator.ts",
|
|
29
|
-
"types": "./src/operator.ts",
|
|
30
|
+
"types": "./types/src/operator.d.ts",
|
|
30
31
|
"default": "./src/operator.ts"
|
|
31
32
|
},
|
|
32
33
|
"./operator-api": {
|
|
33
34
|
"bun": "./src/operator-api.ts",
|
|
34
|
-
"types": "./src/operator-api.ts",
|
|
35
|
+
"types": "./types/src/operator-api.d.ts",
|
|
35
36
|
"default": "./src/operator-api.ts"
|
|
36
37
|
},
|
|
37
38
|
"./access": {
|
|
38
39
|
"bun": "./src/access.ts",
|
|
39
|
-
"types": "./src/access.ts",
|
|
40
|
+
"types": "./types/src/access.d.ts",
|
|
40
41
|
"default": "./src/access.ts"
|
|
41
42
|
},
|
|
42
43
|
"./catalog": {
|
|
43
44
|
"bun": "./src/catalog.ts",
|
|
44
|
-
"types": "./src/catalog.ts",
|
|
45
|
+
"types": "./types/src/catalog.d.ts",
|
|
45
46
|
"default": "./src/catalog.ts"
|
|
46
47
|
},
|
|
47
48
|
"./releases": {
|
|
48
49
|
"bun": "./src/releases.ts",
|
|
49
|
-
"types": "./src/releases.ts",
|
|
50
|
+
"types": "./types/src/releases.d.ts",
|
|
50
51
|
"default": "./src/releases.ts"
|
|
51
52
|
},
|
|
52
53
|
"./rpc": {
|
|
53
54
|
"bun": "./src/rpc.ts",
|
|
54
|
-
"types": "./src/rpc.ts",
|
|
55
|
+
"types": "./types/src/rpc.d.ts",
|
|
55
56
|
"default": "./src/rpc.ts"
|
|
56
57
|
}
|
|
57
58
|
},
|
|
@@ -60,6 +61,6 @@
|
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
63
|
"zod": "^3.25.76",
|
|
63
|
-
"@fabrika/app": "0.
|
|
64
|
+
"@fabrika/app": "0.9.0-cloudflare.2"
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** IAM vocabulary shared by the Operations runtime and Fabrika's Access schema. */
|
|
2
|
+
/**
|
|
3
|
+
* The app id every composition names the Operations HOST by — the Cloudflare proxy Worker's manifest,
|
|
4
|
+
* the shared platform manifest, and `defineApp`. One constant because a shared manifest may not name
|
|
5
|
+
* one app twice, so the two compositions cannot disagree here and stay generalisable.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OPERATIONS_APP_ID = "operations";
|
|
8
|
+
export declare const OPERATIONS_ACTIONS: {
|
|
9
|
+
readonly READ: "operations.read";
|
|
10
|
+
readonly TRIAGE: "operations.triage";
|
|
11
|
+
readonly MANAGE: "operations.manage";
|
|
12
|
+
};
|
|
13
|
+
export type OperationsAction = (typeof OPERATIONS_ACTIONS)[keyof typeof OPERATIONS_ACTIONS];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Private Control → Operations source-catalog protocol; both services ship together. */
|
|
2
|
+
export declare const DEFAULT_OPERATIONS_SERVICE_KEY = "default";
|
|
3
|
+
export interface OperationsSourceCoordinate {
|
|
4
|
+
appId: string;
|
|
5
|
+
environment: string;
|
|
6
|
+
/** Omitted by Control while an app environment has only its default service. */
|
|
7
|
+
serviceKey?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CanonicalOperationsSourceCoordinate {
|
|
10
|
+
appId: string;
|
|
11
|
+
environment: string;
|
|
12
|
+
serviceKey: string;
|
|
13
|
+
}
|
|
14
|
+
/** Caller-owned write credential transported only over the private catalog channel. */
|
|
15
|
+
export interface OperationsCatalogIngestCredential {
|
|
16
|
+
id: string;
|
|
17
|
+
publicKey: string;
|
|
18
|
+
}
|
|
19
|
+
export interface OperationsCatalogSource {
|
|
20
|
+
coordinate: OperationsSourceCoordinate;
|
|
21
|
+
displayName: string;
|
|
22
|
+
/** Canonical externally reachable origin when Control owns one; null when it does not. */
|
|
23
|
+
publicOrigin?: string | null;
|
|
24
|
+
ingestCredential: OperationsCatalogIngestCredential;
|
|
25
|
+
}
|
|
26
|
+
export interface CanonicalOperationsCatalogSource {
|
|
27
|
+
coordinate: CanonicalOperationsSourceCoordinate;
|
|
28
|
+
displayName: string;
|
|
29
|
+
publicOrigin: string | null;
|
|
30
|
+
ingestCredential: OperationsCatalogIngestCredential;
|
|
31
|
+
}
|
|
32
|
+
export interface OperationsCatalogReconcileRequest {
|
|
33
|
+
revision: number;
|
|
34
|
+
snapshotHash: string;
|
|
35
|
+
sources: OperationsCatalogSource[];
|
|
36
|
+
}
|
|
37
|
+
export type OperationsCatalogReconcileOutcome = 'applied' | 'unchanged' | 'stale';
|
|
38
|
+
export interface OperationsCatalogIngestResult {
|
|
39
|
+
coordinate: CanonicalOperationsSourceCoordinate;
|
|
40
|
+
credentialId: string;
|
|
41
|
+
ingestProjectId: string;
|
|
42
|
+
}
|
|
43
|
+
export interface OperationsCatalogReconcileResponse {
|
|
44
|
+
revision: number;
|
|
45
|
+
outcome: OperationsCatalogReconcileOutcome;
|
|
46
|
+
ingest: OperationsCatalogIngestResult[];
|
|
47
|
+
}
|
|
48
|
+
export declare function canonicalOperationsServiceKey(serviceKey: string | undefined): string;
|
|
49
|
+
export declare function canonicalOperationsCatalogSources(sources: readonly OperationsCatalogSource[]): CanonicalOperationsCatalogSource[];
|
|
50
|
+
/** Hash the canonical source array only; revision is transport ordering, not catalog content. */
|
|
51
|
+
export declare function operationsCatalogSnapshotHash(sources: readonly OperationsCatalogSource[]): Promise<string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { OPERATIONS_ACTIONS, OPERATIONS_APP_ID } from './access.js';
|
|
2
|
+
export type { OperationsAction } from './access.js';
|
|
3
|
+
export { canonicalOperationsCatalogSources, canonicalOperationsServiceKey, DEFAULT_OPERATIONS_SERVICE_KEY, operationsCatalogSnapshotHash, } from './catalog.js';
|
|
4
|
+
export type { CanonicalOperationsCatalogSource, CanonicalOperationsSourceCoordinate, OperationsCatalogIngestCredential, OperationsCatalogIngestResult, OperationsCatalogReconcileOutcome, OperationsCatalogReconcileRequest, OperationsCatalogReconcileResponse, OperationsCatalogSource, OperationsSourceCoordinate, } from './catalog.js';
|
|
5
|
+
export { buildOperationsDsn, FABRIKA_APP_ID, FABRIKA_ENVIRONMENT, FABRIKA_OPERATIONS_DSN, FABRIKA_SERVICE_KEY, OPERATIONS_MANAGED_ENVIRONMENT_KEYS, operationsEnvelopeUrl, operationsManagedEnvironment, operationsManagedEnvironmentCollisions, } from './ingest.js';
|
|
6
|
+
export type { IngestMessage, IngestRejectReason, OperationsIngestConfiguration, OperationsManagedEnvironmentKey, ParsedEvent, ParsedException, StackFrame, } from './ingest.js';
|
|
7
|
+
export type { OperationsAlertKind, OperationsAlertRuleDto, OperationsAlertRuleRequestDto, OperationsAlertSettingsResponseDto, OperationsAssigneeListResponseDto, OperationsBulkIssueStatusRequestDto, OperationsBulkIssueStatusResponseDto, OperationsCurrentHttpHealthDto, OperationsEventDetailResponseDto, OperationsHealthCheckDto, OperationsHealthCheckUpsertRequestDto, OperationsHealthObservationDto, OperationsHealthResponseDto, OperationsHealthState, OperationsIssueDetailDto, OperationsIssueDetailResponseDto, OperationsIssueListResponseDto, OperationsIssueMutationRequestDto, OperationsIssueOccurrenceDto, OperationsIssueOccurrenceListResponseDto, OperationsIssueSummaryDto, OperationsNotificationAttemptDto, OperationsNotificationChannelDto, OperationsNotificationChannelRequestDto, OperationsNotificationDeliveryDto, OperationsReleaseDetailResponseDto, OperationsReleaseListResponseDto, OperationsReleaseSummaryDto, OperationsSourceDetailResponseDto, OperationsSourceHealthDto, OperationsSourceListResponseDto, OperationsSourceSummaryDto, OperationsSpikeAlertRequestDto, } from './operator-api.js';
|
|
8
|
+
export type { ActivityDraft, ActivityItem, ActivityKind, DisplayFrame, EventBreadcrumb, EventDetail, EventException, IssueAlertType, IssueListItem, IssueMutation, IssueMutationDecision, IssueStatus, Occurrence, OccurrenceTransition, PriorIssueState, RawEventFrame, SourceContext, } from './operator.js';
|
|
9
|
+
export { FABRIKA_RELEASE, normalizeOperationsCommit, OPERATIONS_ARTIFACT_HEADERS, OPERATIONS_RELEASE_RECONCILE_PATH, OPERATIONS_SOURCE_MAP_UPLOAD_PATH, operationsReleaseName, operationsSourceMapUploadUrl, } from './releases.js';
|
|
10
|
+
export type { OperationsArtifactState, OperationsArtifactUploadConfiguration, OperationsArtifactUploadCredential, OperationsReleaseAvailability, OperationsReleaseCoordinate, OperationsReleaseOutcome, OperationsReleasePhase, OperationsReleaseReconcileOutcome, OperationsReleaseReconcileRequest, OperationsReleaseReconcileResponse, OperationsReleaseUnavailableReason, } from './releases.js';
|
|
11
|
+
export type { OperationsIssueQuery, OperationsReleaseQuery, OperationsRpcContract } from './rpc.js';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Browser- and runtime-safe shapes at the direct Sentry-compatible ingest boundary. */
|
|
2
|
+
export declare const FABRIKA_OPERATIONS_DSN = "FABRIKA_OPERATIONS_DSN";
|
|
3
|
+
export declare const FABRIKA_APP_ID = "FABRIKA_APP_ID";
|
|
4
|
+
export declare const FABRIKA_ENVIRONMENT = "FABRIKA_ENVIRONMENT";
|
|
5
|
+
export declare const FABRIKA_SERVICE_KEY = "FABRIKA_SERVICE_KEY";
|
|
6
|
+
export type OperationsManagedEnvironmentKey = typeof FABRIKA_OPERATIONS_DSN | typeof FABRIKA_APP_ID | typeof FABRIKA_ENVIRONMENT | typeof FABRIKA_SERVICE_KEY;
|
|
7
|
+
export declare const OPERATIONS_MANAGED_ENVIRONMENT_KEYS: readonly OperationsManagedEnvironmentKey[];
|
|
8
|
+
export interface OperationsIngestConfiguration {
|
|
9
|
+
dsn: string;
|
|
10
|
+
appId: string;
|
|
11
|
+
environment: string;
|
|
12
|
+
serviceKey: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildOperationsDsn(origin: string, publicKey: string, ingestProjectId: string): string;
|
|
15
|
+
export declare function operationsEnvelopeUrl(origin: string, ingestProjectId: string): string;
|
|
16
|
+
export declare function operationsManagedEnvironment(input: OperationsIngestConfiguration): Record<OperationsManagedEnvironmentKey, string>;
|
|
17
|
+
export declare function operationsManagedEnvironmentCollisions(keys: Iterable<string>): OperationsManagedEnvironmentKey[];
|
|
18
|
+
export interface StackFrame {
|
|
19
|
+
function?: string;
|
|
20
|
+
filename?: string;
|
|
21
|
+
module?: string;
|
|
22
|
+
absPath?: string;
|
|
23
|
+
line?: number;
|
|
24
|
+
column?: number;
|
|
25
|
+
inApp?: boolean;
|
|
26
|
+
preContext?: string[];
|
|
27
|
+
contextLine?: string;
|
|
28
|
+
postContext?: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface ParsedException {
|
|
31
|
+
type: string;
|
|
32
|
+
value: string;
|
|
33
|
+
frames: StackFrame[];
|
|
34
|
+
}
|
|
35
|
+
export interface ParsedEvent {
|
|
36
|
+
eventId: string;
|
|
37
|
+
projectId: string;
|
|
38
|
+
exception: ParsedException;
|
|
39
|
+
level: string;
|
|
40
|
+
release?: string;
|
|
41
|
+
environment?: string;
|
|
42
|
+
platform?: string;
|
|
43
|
+
tags: Record<string, string>;
|
|
44
|
+
sdkFingerprint: string[] | null;
|
|
45
|
+
receivedAt: number;
|
|
46
|
+
raw: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
export interface IngestMessage {
|
|
49
|
+
projectId: string;
|
|
50
|
+
fingerprint: string;
|
|
51
|
+
eventId: string;
|
|
52
|
+
title: string;
|
|
53
|
+
culprit: string | null;
|
|
54
|
+
level: string;
|
|
55
|
+
release?: string;
|
|
56
|
+
environment?: string;
|
|
57
|
+
receivedAt: number;
|
|
58
|
+
payload: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export type IngestRejectReason = 'unauthorized' | 'forbidden' | 'too_large' | 'malformed' | 'unsupported' | 'rate_limited' | 'unavailable';
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import type { ActivityItem, EventDetail, IssueStatus } from './operator.js';
|
|
2
|
+
import type { OperationsArtifactState } from './releases.js';
|
|
3
|
+
export type OperationsAlertKind = 'new_issue' | 'regression' | 'spike' | 'failed_check' | 'recovery' | 'unhealthy_telemetry';
|
|
4
|
+
export type OperationsHealthState = 'healthy' | 'degraded' | 'failed' | 'stale' | 'unavailable';
|
|
5
|
+
export interface OperationsSourceSummaryDto {
|
|
6
|
+
id: string;
|
|
7
|
+
appId: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
serviceKey: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
publicOrigin: string | null;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface OperationsSourceListResponseDto {
|
|
15
|
+
items: OperationsSourceSummaryDto[];
|
|
16
|
+
}
|
|
17
|
+
export interface OperationsSourceDetailResponseDto {
|
|
18
|
+
source: OperationsSourceSummaryDto;
|
|
19
|
+
}
|
|
20
|
+
export interface OperationsIssueSummaryDto {
|
|
21
|
+
id: string;
|
|
22
|
+
source: OperationsSourceSummaryDto;
|
|
23
|
+
title: string;
|
|
24
|
+
culprit: string | null;
|
|
25
|
+
level: string;
|
|
26
|
+
status: IssueStatus;
|
|
27
|
+
assignedTo: {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string | null;
|
|
30
|
+
} | null;
|
|
31
|
+
regressedAt: number | null;
|
|
32
|
+
firstSeen: number;
|
|
33
|
+
lastSeen: number;
|
|
34
|
+
count: number;
|
|
35
|
+
trend: number[];
|
|
36
|
+
}
|
|
37
|
+
export interface OperationsIssueOccurrenceDto {
|
|
38
|
+
id: string;
|
|
39
|
+
eventId: string;
|
|
40
|
+
receivedAt: number;
|
|
41
|
+
release: string | null;
|
|
42
|
+
}
|
|
43
|
+
export interface OperationsIssueListResponseDto {
|
|
44
|
+
items: OperationsIssueSummaryDto[];
|
|
45
|
+
nextCursor: string | null;
|
|
46
|
+
summary: {
|
|
47
|
+
total: number;
|
|
48
|
+
open: number;
|
|
49
|
+
resolved: number;
|
|
50
|
+
ignored: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface OperationsIssueDetailDto extends OperationsIssueSummaryDto {
|
|
54
|
+
snoozeUntil: number | null;
|
|
55
|
+
snoozeUntilCount: number | null;
|
|
56
|
+
resolvedInRelease: {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
} | null;
|
|
60
|
+
mergedIntoIssueId: string | null;
|
|
61
|
+
activity: ActivityItem[];
|
|
62
|
+
latestOccurrence: OperationsIssueOccurrenceDto | null;
|
|
63
|
+
occurrences: OperationsIssueOccurrenceDto[];
|
|
64
|
+
occurrencesNextCursor: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface OperationsIssueDetailResponseDto {
|
|
67
|
+
issue: OperationsIssueDetailDto;
|
|
68
|
+
}
|
|
69
|
+
export interface OperationsEventDetailResponseDto {
|
|
70
|
+
occurrenceId: string;
|
|
71
|
+
receivedAt: number;
|
|
72
|
+
detail: EventDetail;
|
|
73
|
+
}
|
|
74
|
+
export interface OperationsIssueOccurrenceListResponseDto {
|
|
75
|
+
items: OperationsIssueOccurrenceDto[];
|
|
76
|
+
nextCursor: string | null;
|
|
77
|
+
}
|
|
78
|
+
export type OperationsIssueMutationRequestDto = {
|
|
79
|
+
kind: 'status';
|
|
80
|
+
status: IssueStatus;
|
|
81
|
+
} | {
|
|
82
|
+
kind: 'comment';
|
|
83
|
+
text: string;
|
|
84
|
+
} | {
|
|
85
|
+
kind: 'assign';
|
|
86
|
+
principalId: string | null;
|
|
87
|
+
} | {
|
|
88
|
+
kind: 'snooze_until';
|
|
89
|
+
until: number;
|
|
90
|
+
} | {
|
|
91
|
+
kind: 'snooze_count';
|
|
92
|
+
additional: number;
|
|
93
|
+
} | {
|
|
94
|
+
kind: 'resolve_in_release';
|
|
95
|
+
releaseId: string | null;
|
|
96
|
+
} | {
|
|
97
|
+
kind: 'merge';
|
|
98
|
+
targetIssueId: string;
|
|
99
|
+
};
|
|
100
|
+
export interface OperationsBulkIssueStatusRequestDto {
|
|
101
|
+
issueIds: string[];
|
|
102
|
+
status: IssueStatus;
|
|
103
|
+
}
|
|
104
|
+
export interface OperationsBulkIssueStatusResponseDto {
|
|
105
|
+
items: OperationsIssueSummaryDto[];
|
|
106
|
+
}
|
|
107
|
+
export interface OperationsAssigneeListResponseDto {
|
|
108
|
+
items: {
|
|
109
|
+
id: string;
|
|
110
|
+
label: string;
|
|
111
|
+
}[];
|
|
112
|
+
}
|
|
113
|
+
export interface OperationsReleaseSummaryDto {
|
|
114
|
+
id: string;
|
|
115
|
+
source: OperationsSourceSummaryDto;
|
|
116
|
+
runId: string;
|
|
117
|
+
commitSha: string;
|
|
118
|
+
state: string;
|
|
119
|
+
artifactState: OperationsArtifactState;
|
|
120
|
+
releaseName: string;
|
|
121
|
+
createdAt: number;
|
|
122
|
+
finishedAt: number | null;
|
|
123
|
+
newIssueCount: number;
|
|
124
|
+
regressionCount: number;
|
|
125
|
+
}
|
|
126
|
+
export interface OperationsReleaseListResponseDto {
|
|
127
|
+
items: OperationsReleaseSummaryDto[];
|
|
128
|
+
nextCursor: string | null;
|
|
129
|
+
}
|
|
130
|
+
export interface OperationsReleaseDetailResponseDto {
|
|
131
|
+
release: OperationsReleaseSummaryDto;
|
|
132
|
+
issues: OperationsIssueSummaryDto[];
|
|
133
|
+
}
|
|
134
|
+
export interface OperationsCurrentHttpHealthDto {
|
|
135
|
+
state: Exclude<OperationsHealthState, 'unavailable'>;
|
|
136
|
+
observedAt: number;
|
|
137
|
+
latencyMs: number | null;
|
|
138
|
+
detailCode: string;
|
|
139
|
+
consecutiveFailures: number;
|
|
140
|
+
consecutiveSuccesses: number;
|
|
141
|
+
}
|
|
142
|
+
export interface OperationsHealthObservationDto {
|
|
143
|
+
id: string;
|
|
144
|
+
state: OperationsHealthState;
|
|
145
|
+
observedAt: number;
|
|
146
|
+
latencyMs: number | null;
|
|
147
|
+
detailCode: string | null;
|
|
148
|
+
successful: boolean;
|
|
149
|
+
statusCode: number | null;
|
|
150
|
+
}
|
|
151
|
+
export interface OperationsHealthCheckDto {
|
|
152
|
+
id: string;
|
|
153
|
+
sourceId: string;
|
|
154
|
+
path: string;
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
intervalMs: number;
|
|
157
|
+
timeoutMs: number;
|
|
158
|
+
expectedStatus: number;
|
|
159
|
+
failureThreshold: number;
|
|
160
|
+
recoveryThreshold: number;
|
|
161
|
+
staleAfterMs: number;
|
|
162
|
+
current: OperationsCurrentHttpHealthDto | null;
|
|
163
|
+
history: OperationsHealthObservationDto[];
|
|
164
|
+
}
|
|
165
|
+
export interface OperationsSourceHealthDto {
|
|
166
|
+
source: OperationsSourceSummaryDto;
|
|
167
|
+
httpChecks: OperationsHealthCheckDto[];
|
|
168
|
+
telemetryState: OperationsHealthState;
|
|
169
|
+
}
|
|
170
|
+
export interface OperationsHealthResponseDto {
|
|
171
|
+
sources: OperationsSourceHealthDto[];
|
|
172
|
+
}
|
|
173
|
+
export interface OperationsHealthCheckUpsertRequestDto {
|
|
174
|
+
path: string;
|
|
175
|
+
enabled: boolean;
|
|
176
|
+
intervalMs: number;
|
|
177
|
+
timeoutMs: number;
|
|
178
|
+
expectedStatus: number;
|
|
179
|
+
failureThreshold: number;
|
|
180
|
+
recoveryThreshold: number;
|
|
181
|
+
staleAfterMs: number;
|
|
182
|
+
}
|
|
183
|
+
export interface OperationsAlertRuleDto {
|
|
184
|
+
kind: OperationsAlertKind;
|
|
185
|
+
enabled: boolean;
|
|
186
|
+
}
|
|
187
|
+
export interface OperationsNotificationChannelDto {
|
|
188
|
+
id: string;
|
|
189
|
+
scope: OperationsAlertKind;
|
|
190
|
+
type: 'webhook';
|
|
191
|
+
targetDisplay: string;
|
|
192
|
+
hasTarget: boolean;
|
|
193
|
+
enabled: boolean;
|
|
194
|
+
}
|
|
195
|
+
export interface OperationsNotificationAttemptDto {
|
|
196
|
+
id: string;
|
|
197
|
+
attemptedAt: number;
|
|
198
|
+
delivered: boolean;
|
|
199
|
+
errorCode: string | null;
|
|
200
|
+
}
|
|
201
|
+
export interface OperationsNotificationDeliveryDto {
|
|
202
|
+
id: string;
|
|
203
|
+
channelId: string;
|
|
204
|
+
kind: OperationsAlertKind;
|
|
205
|
+
createdAt: number;
|
|
206
|
+
attemptCount: number;
|
|
207
|
+
maxAttempts: number;
|
|
208
|
+
status: 'pending' | 'delivered' | 'abandoned';
|
|
209
|
+
deliveredAt: number | null;
|
|
210
|
+
abandonedAt: number | null;
|
|
211
|
+
attempts: OperationsNotificationAttemptDto[];
|
|
212
|
+
}
|
|
213
|
+
export interface OperationsAlertSettingsResponseDto {
|
|
214
|
+
spike: {
|
|
215
|
+
threshold: number;
|
|
216
|
+
enabled: boolean;
|
|
217
|
+
} | null;
|
|
218
|
+
rules: OperationsAlertRuleDto[];
|
|
219
|
+
channels: OperationsNotificationChannelDto[];
|
|
220
|
+
deliveries: OperationsNotificationDeliveryDto[];
|
|
221
|
+
}
|
|
222
|
+
export interface OperationsSpikeAlertRequestDto {
|
|
223
|
+
threshold: number;
|
|
224
|
+
enabled: boolean;
|
|
225
|
+
}
|
|
226
|
+
export interface OperationsAlertRuleRequestDto {
|
|
227
|
+
enabled: boolean;
|
|
228
|
+
}
|
|
229
|
+
export interface OperationsNotificationChannelRequestDto {
|
|
230
|
+
scope: OperationsAlertKind;
|
|
231
|
+
type: 'webhook';
|
|
232
|
+
target?: string;
|
|
233
|
+
enabled: boolean;
|
|
234
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { StackFrame } from './ingest.js';
|
|
2
|
+
export type IssueStatus = 'open' | 'resolved' | 'ignored';
|
|
3
|
+
export type ActivityKind = 'comment' | 'status' | 'assigned' | 'regressed' | 'snoozed' | 'unsnoozed' | 'merged';
|
|
4
|
+
export type IssueAlertType = 'new_issue' | 'regression';
|
|
5
|
+
export interface IssueListItem {
|
|
6
|
+
fingerprint: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
title: string;
|
|
9
|
+
culprit: string | null;
|
|
10
|
+
level: string;
|
|
11
|
+
status: IssueStatus;
|
|
12
|
+
assignedTo: string | null;
|
|
13
|
+
regressedAt: number | null;
|
|
14
|
+
firstSeen: number;
|
|
15
|
+
lastSeen: number;
|
|
16
|
+
count: number;
|
|
17
|
+
trend: number[];
|
|
18
|
+
}
|
|
19
|
+
export interface ActivityItem {
|
|
20
|
+
id: string;
|
|
21
|
+
kind: ActivityKind;
|
|
22
|
+
actorLabel: string | null;
|
|
23
|
+
data: Record<string, unknown> | null;
|
|
24
|
+
at: number;
|
|
25
|
+
}
|
|
26
|
+
export interface SourceContext {
|
|
27
|
+
lines: string[];
|
|
28
|
+
errorIndex: number;
|
|
29
|
+
startLine: number;
|
|
30
|
+
}
|
|
31
|
+
export interface DisplayFrame {
|
|
32
|
+
file: string;
|
|
33
|
+
function: string | null;
|
|
34
|
+
line: number | null;
|
|
35
|
+
column: number | null;
|
|
36
|
+
inApp: boolean;
|
|
37
|
+
resolved: boolean;
|
|
38
|
+
source?: SourceContext;
|
|
39
|
+
}
|
|
40
|
+
export interface EventException {
|
|
41
|
+
type: string | null;
|
|
42
|
+
value: string | null;
|
|
43
|
+
handled: boolean | null;
|
|
44
|
+
frames: DisplayFrame[];
|
|
45
|
+
}
|
|
46
|
+
export interface EventBreadcrumb {
|
|
47
|
+
timestamp?: number | string;
|
|
48
|
+
type?: string;
|
|
49
|
+
category?: string;
|
|
50
|
+
level?: string;
|
|
51
|
+
message?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface EventDetail {
|
|
54
|
+
eventId: string | null;
|
|
55
|
+
platform: string | null;
|
|
56
|
+
release: string | null;
|
|
57
|
+
environment: string | null;
|
|
58
|
+
tags: {
|
|
59
|
+
key: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}[];
|
|
62
|
+
request: {
|
|
63
|
+
url: string | null;
|
|
64
|
+
method: string | null;
|
|
65
|
+
} | null;
|
|
66
|
+
user: {
|
|
67
|
+
id: string | null;
|
|
68
|
+
email: string | null;
|
|
69
|
+
username: string | null;
|
|
70
|
+
} | null;
|
|
71
|
+
breadcrumbs: EventBreadcrumb[];
|
|
72
|
+
runtime: string | null;
|
|
73
|
+
os: string | null;
|
|
74
|
+
serverName: string | null;
|
|
75
|
+
traceId: string | null;
|
|
76
|
+
exceptions: EventException[];
|
|
77
|
+
rawEvent: string;
|
|
78
|
+
}
|
|
79
|
+
export interface Occurrence {
|
|
80
|
+
release?: string;
|
|
81
|
+
receivedAt: number;
|
|
82
|
+
}
|
|
83
|
+
export interface PriorIssueState {
|
|
84
|
+
status: IssueStatus;
|
|
85
|
+
resolvedInRelease: string | null;
|
|
86
|
+
snoozeUntil: number | null;
|
|
87
|
+
snoozeUntilCount: number | null;
|
|
88
|
+
}
|
|
89
|
+
export interface OccurrenceTransition {
|
|
90
|
+
reopen: boolean;
|
|
91
|
+
regression: boolean;
|
|
92
|
+
at: number | null;
|
|
93
|
+
release: string | null;
|
|
94
|
+
activity: ActivityKind | null;
|
|
95
|
+
}
|
|
96
|
+
export type IssueMutation = {
|
|
97
|
+
kind: 'status';
|
|
98
|
+
status: IssueStatus;
|
|
99
|
+
} | {
|
|
100
|
+
kind: 'comment';
|
|
101
|
+
text: string;
|
|
102
|
+
} | {
|
|
103
|
+
kind: 'assign';
|
|
104
|
+
principalId: string | null;
|
|
105
|
+
principalLabel: string | null;
|
|
106
|
+
} | {
|
|
107
|
+
kind: 'snooze_until';
|
|
108
|
+
until: number;
|
|
109
|
+
} | {
|
|
110
|
+
kind: 'snooze_count';
|
|
111
|
+
additional: number;
|
|
112
|
+
currentCount: number;
|
|
113
|
+
} | {
|
|
114
|
+
kind: 'resolve_in_release';
|
|
115
|
+
release: string | null;
|
|
116
|
+
} | {
|
|
117
|
+
kind: 'merge';
|
|
118
|
+
target: string;
|
|
119
|
+
};
|
|
120
|
+
export interface ActivityDraft {
|
|
121
|
+
kind: ActivityKind;
|
|
122
|
+
data: Record<string, unknown>;
|
|
123
|
+
}
|
|
124
|
+
export interface IssueMutationDecision {
|
|
125
|
+
status: IssueStatus;
|
|
126
|
+
assignedTo?: string | null;
|
|
127
|
+
assignedToLabel?: string | null;
|
|
128
|
+
snoozeUntil?: number | null;
|
|
129
|
+
snoozeUntilCount?: number | null;
|
|
130
|
+
resolvedInRelease?: string | null;
|
|
131
|
+
mergedInto?: string;
|
|
132
|
+
activity: ActivityDraft | null;
|
|
133
|
+
}
|
|
134
|
+
export type RawEventFrame = StackFrame;
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const operationsReleaseCoordinateSchema: z.ZodEffects<z.ZodObject<{
|
|
3
|
+
appId: z.ZodString;
|
|
4
|
+
environment: z.ZodString;
|
|
5
|
+
serviceKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
appId: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
serviceKey?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
appId: string;
|
|
12
|
+
environment: string;
|
|
13
|
+
serviceKey?: string | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
serviceKey?: string | undefined;
|
|
16
|
+
appId: string;
|
|
17
|
+
environment: string;
|
|
18
|
+
}, {
|
|
19
|
+
appId: string;
|
|
20
|
+
environment: string;
|
|
21
|
+
serviceKey?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const operationsReleaseAvailabilitySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
24
|
+
kind: z.ZodLiteral<"available">;
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
commitSha: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
kind: "available";
|
|
29
|
+
name: string;
|
|
30
|
+
commitSha: string;
|
|
31
|
+
}, {
|
|
32
|
+
kind: "available";
|
|
33
|
+
name: string;
|
|
34
|
+
commitSha: string;
|
|
35
|
+
}>, z.ZodObject<{
|
|
36
|
+
kind: z.ZodLiteral<"unavailable">;
|
|
37
|
+
reason: z.ZodEnum<["dry_run", "missing_commit"]>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
kind: "unavailable";
|
|
40
|
+
reason: "dry_run" | "missing_commit";
|
|
41
|
+
}, {
|
|
42
|
+
kind: "unavailable";
|
|
43
|
+
reason: "dry_run" | "missing_commit";
|
|
44
|
+
}>]>;
|
|
45
|
+
export declare const operationsArtifactUploadCredentialSchema: z.ZodObject<{
|
|
46
|
+
verifier: z.ZodString;
|
|
47
|
+
expiresAt: z.ZodNumber;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
verifier: string;
|
|
50
|
+
expiresAt: number;
|
|
51
|
+
}, {
|
|
52
|
+
verifier: string;
|
|
53
|
+
expiresAt: number;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const operationsReleasePayloadSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
56
|
+
runId: z.ZodString;
|
|
57
|
+
coordinate: z.ZodEffects<z.ZodObject<{
|
|
58
|
+
appId: z.ZodString;
|
|
59
|
+
environment: z.ZodString;
|
|
60
|
+
serviceKey: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
appId: string;
|
|
63
|
+
environment: string;
|
|
64
|
+
serviceKey?: string | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
appId: string;
|
|
67
|
+
environment: string;
|
|
68
|
+
serviceKey?: string | undefined;
|
|
69
|
+
}>, {
|
|
70
|
+
serviceKey?: string | undefined;
|
|
71
|
+
appId: string;
|
|
72
|
+
environment: string;
|
|
73
|
+
}, {
|
|
74
|
+
appId: string;
|
|
75
|
+
environment: string;
|
|
76
|
+
serviceKey?: string | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
phase: z.ZodEnum<["started", "provider_accepted", "terminal"]>;
|
|
79
|
+
providerRunId: z.ZodNullable<z.ZodString>;
|
|
80
|
+
outcome: z.ZodNullable<z.ZodEnum<["succeeded", "failed"]>>;
|
|
81
|
+
artifactState: z.ZodEnum<["pending", "complete", "incomplete", "not_applicable"]>;
|
|
82
|
+
release: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
83
|
+
kind: z.ZodLiteral<"available">;
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
commitSha: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
kind: "available";
|
|
88
|
+
name: string;
|
|
89
|
+
commitSha: string;
|
|
90
|
+
}, {
|
|
91
|
+
kind: "available";
|
|
92
|
+
name: string;
|
|
93
|
+
commitSha: string;
|
|
94
|
+
}>, z.ZodObject<{
|
|
95
|
+
kind: z.ZodLiteral<"unavailable">;
|
|
96
|
+
reason: z.ZodEnum<["dry_run", "missing_commit"]>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
kind: "unavailable";
|
|
99
|
+
reason: "dry_run" | "missing_commit";
|
|
100
|
+
}, {
|
|
101
|
+
kind: "unavailable";
|
|
102
|
+
reason: "dry_run" | "missing_commit";
|
|
103
|
+
}>]>;
|
|
104
|
+
uploadCredential: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
verifier: z.ZodString;
|
|
106
|
+
expiresAt: z.ZodNumber;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
verifier: string;
|
|
109
|
+
expiresAt: number;
|
|
110
|
+
}, {
|
|
111
|
+
verifier: string;
|
|
112
|
+
expiresAt: number;
|
|
113
|
+
}>>;
|
|
114
|
+
observedAt: z.ZodNumber;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
runId: string;
|
|
117
|
+
coordinate: {
|
|
118
|
+
serviceKey?: string | undefined;
|
|
119
|
+
appId: string;
|
|
120
|
+
environment: string;
|
|
121
|
+
};
|
|
122
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
123
|
+
providerRunId: string | null;
|
|
124
|
+
outcome: "succeeded" | "failed" | null;
|
|
125
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
126
|
+
release: {
|
|
127
|
+
kind: "available";
|
|
128
|
+
name: string;
|
|
129
|
+
commitSha: string;
|
|
130
|
+
} | {
|
|
131
|
+
kind: "unavailable";
|
|
132
|
+
reason: "dry_run" | "missing_commit";
|
|
133
|
+
};
|
|
134
|
+
observedAt: number;
|
|
135
|
+
uploadCredential?: {
|
|
136
|
+
verifier: string;
|
|
137
|
+
expiresAt: number;
|
|
138
|
+
} | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
runId: string;
|
|
141
|
+
coordinate: {
|
|
142
|
+
appId: string;
|
|
143
|
+
environment: string;
|
|
144
|
+
serviceKey?: string | undefined;
|
|
145
|
+
};
|
|
146
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
147
|
+
providerRunId: string | null;
|
|
148
|
+
outcome: "succeeded" | "failed" | null;
|
|
149
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
150
|
+
release: {
|
|
151
|
+
kind: "available";
|
|
152
|
+
name: string;
|
|
153
|
+
commitSha: string;
|
|
154
|
+
} | {
|
|
155
|
+
kind: "unavailable";
|
|
156
|
+
reason: "dry_run" | "missing_commit";
|
|
157
|
+
};
|
|
158
|
+
observedAt: number;
|
|
159
|
+
uploadCredential?: {
|
|
160
|
+
verifier: string;
|
|
161
|
+
expiresAt: number;
|
|
162
|
+
} | undefined;
|
|
163
|
+
}>, {
|
|
164
|
+
runId: string;
|
|
165
|
+
coordinate: {
|
|
166
|
+
serviceKey?: string | undefined;
|
|
167
|
+
appId: string;
|
|
168
|
+
environment: string;
|
|
169
|
+
};
|
|
170
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
171
|
+
providerRunId: string | null;
|
|
172
|
+
outcome: "succeeded" | "failed" | null;
|
|
173
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
174
|
+
release: {
|
|
175
|
+
kind: "available";
|
|
176
|
+
name: string;
|
|
177
|
+
commitSha: string;
|
|
178
|
+
} | {
|
|
179
|
+
kind: "unavailable";
|
|
180
|
+
reason: "dry_run" | "missing_commit";
|
|
181
|
+
};
|
|
182
|
+
observedAt: number;
|
|
183
|
+
uploadCredential?: {
|
|
184
|
+
verifier: string;
|
|
185
|
+
expiresAt: number;
|
|
186
|
+
} | undefined;
|
|
187
|
+
}, {
|
|
188
|
+
runId: string;
|
|
189
|
+
coordinate: {
|
|
190
|
+
appId: string;
|
|
191
|
+
environment: string;
|
|
192
|
+
serviceKey?: string | undefined;
|
|
193
|
+
};
|
|
194
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
195
|
+
providerRunId: string | null;
|
|
196
|
+
outcome: "succeeded" | "failed" | null;
|
|
197
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
198
|
+
release: {
|
|
199
|
+
kind: "available";
|
|
200
|
+
name: string;
|
|
201
|
+
commitSha: string;
|
|
202
|
+
} | {
|
|
203
|
+
kind: "unavailable";
|
|
204
|
+
reason: "dry_run" | "missing_commit";
|
|
205
|
+
};
|
|
206
|
+
observedAt: number;
|
|
207
|
+
uploadCredential?: {
|
|
208
|
+
verifier: string;
|
|
209
|
+
expiresAt: number;
|
|
210
|
+
} | undefined;
|
|
211
|
+
}>, {
|
|
212
|
+
observedAt: number;
|
|
213
|
+
uploadCredential?: {
|
|
214
|
+
verifier: string;
|
|
215
|
+
expiresAt: number;
|
|
216
|
+
} | undefined;
|
|
217
|
+
runId: string;
|
|
218
|
+
coordinate: {
|
|
219
|
+
serviceKey?: string | undefined;
|
|
220
|
+
appId: string;
|
|
221
|
+
environment: string;
|
|
222
|
+
};
|
|
223
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
224
|
+
providerRunId: string | null;
|
|
225
|
+
outcome: "succeeded" | "failed" | null;
|
|
226
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
227
|
+
release: {
|
|
228
|
+
kind: "available";
|
|
229
|
+
name: string;
|
|
230
|
+
commitSha: string;
|
|
231
|
+
} | {
|
|
232
|
+
kind: "unavailable";
|
|
233
|
+
reason: "dry_run" | "missing_commit";
|
|
234
|
+
};
|
|
235
|
+
}, {
|
|
236
|
+
runId: string;
|
|
237
|
+
coordinate: {
|
|
238
|
+
appId: string;
|
|
239
|
+
environment: string;
|
|
240
|
+
serviceKey?: string | undefined;
|
|
241
|
+
};
|
|
242
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
243
|
+
providerRunId: string | null;
|
|
244
|
+
outcome: "succeeded" | "failed" | null;
|
|
245
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
246
|
+
release: {
|
|
247
|
+
kind: "available";
|
|
248
|
+
name: string;
|
|
249
|
+
commitSha: string;
|
|
250
|
+
} | {
|
|
251
|
+
kind: "unavailable";
|
|
252
|
+
reason: "dry_run" | "missing_commit";
|
|
253
|
+
};
|
|
254
|
+
observedAt: number;
|
|
255
|
+
uploadCredential?: {
|
|
256
|
+
verifier: string;
|
|
257
|
+
expiresAt: number;
|
|
258
|
+
} | undefined;
|
|
259
|
+
}>;
|
|
260
|
+
export declare const operationsSourceMapBuildUploadSchema: z.ZodObject<{
|
|
261
|
+
destination: z.ZodObject<{
|
|
262
|
+
url: z.ZodString;
|
|
263
|
+
appId: z.ZodString;
|
|
264
|
+
environment: z.ZodString;
|
|
265
|
+
serviceKey: z.ZodString;
|
|
266
|
+
release: z.ZodString;
|
|
267
|
+
runId: z.ZodString;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
appId: string;
|
|
270
|
+
environment: string;
|
|
271
|
+
serviceKey: string;
|
|
272
|
+
runId: string;
|
|
273
|
+
release: string;
|
|
274
|
+
url: string;
|
|
275
|
+
}, {
|
|
276
|
+
appId: string;
|
|
277
|
+
environment: string;
|
|
278
|
+
serviceKey: string;
|
|
279
|
+
runId: string;
|
|
280
|
+
release: string;
|
|
281
|
+
url: string;
|
|
282
|
+
}>;
|
|
283
|
+
assetRoots: z.ZodArray<z.ZodObject<{
|
|
284
|
+
prefix: z.ZodString;
|
|
285
|
+
dir: z.ZodString;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
prefix: string;
|
|
288
|
+
dir: string;
|
|
289
|
+
}, {
|
|
290
|
+
prefix: string;
|
|
291
|
+
dir: string;
|
|
292
|
+
}>, "many">;
|
|
293
|
+
}, "strip", z.ZodTypeAny, {
|
|
294
|
+
destination: {
|
|
295
|
+
appId: string;
|
|
296
|
+
environment: string;
|
|
297
|
+
serviceKey: string;
|
|
298
|
+
runId: string;
|
|
299
|
+
release: string;
|
|
300
|
+
url: string;
|
|
301
|
+
};
|
|
302
|
+
assetRoots: {
|
|
303
|
+
prefix: string;
|
|
304
|
+
dir: string;
|
|
305
|
+
}[];
|
|
306
|
+
}, {
|
|
307
|
+
destination: {
|
|
308
|
+
appId: string;
|
|
309
|
+
environment: string;
|
|
310
|
+
serviceKey: string;
|
|
311
|
+
runId: string;
|
|
312
|
+
release: string;
|
|
313
|
+
url: string;
|
|
314
|
+
};
|
|
315
|
+
assetRoots: {
|
|
316
|
+
prefix: string;
|
|
317
|
+
dir: string;
|
|
318
|
+
}[];
|
|
319
|
+
}>;
|
|
320
|
+
export declare const operationsReleaseRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
321
|
+
revision: z.ZodNumber;
|
|
322
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
323
|
+
revision: z.ZodNumber;
|
|
324
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
325
|
+
revision: z.ZodNumber;
|
|
326
|
+
}, z.ZodTypeAny, "passthrough">>, {
|
|
327
|
+
observedAt: number;
|
|
328
|
+
uploadCredential?: {
|
|
329
|
+
verifier: string;
|
|
330
|
+
expiresAt: number;
|
|
331
|
+
} | undefined;
|
|
332
|
+
runId: string;
|
|
333
|
+
coordinate: {
|
|
334
|
+
serviceKey?: string | undefined;
|
|
335
|
+
appId: string;
|
|
336
|
+
environment: string;
|
|
337
|
+
};
|
|
338
|
+
phase: "started" | "provider_accepted" | "terminal";
|
|
339
|
+
providerRunId: string | null;
|
|
340
|
+
outcome: "succeeded" | "failed" | null;
|
|
341
|
+
artifactState: "pending" | "complete" | "incomplete" | "not_applicable";
|
|
342
|
+
release: {
|
|
343
|
+
kind: "available";
|
|
344
|
+
name: string;
|
|
345
|
+
commitSha: string;
|
|
346
|
+
} | {
|
|
347
|
+
kind: "unavailable";
|
|
348
|
+
reason: "dry_run" | "missing_commit";
|
|
349
|
+
};
|
|
350
|
+
revision: number;
|
|
351
|
+
}, z.objectInputType<{
|
|
352
|
+
revision: z.ZodNumber;
|
|
353
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
354
|
+
/** Preserve the public decoder's error categories and first-failure precedence. */
|
|
355
|
+
export declare function operationsReleaseIssueMessage(issues: z.ZodIssue[]): string;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** Private Delivery → Operations release and artifact protocol; both services ship together. */
|
|
2
|
+
export { operationsArtifactUploadCredentialSchema, operationsReleaseAvailabilitySchema, operationsReleaseCoordinateSchema, operationsReleasePayloadSchema, operationsReleaseRequestSchema, operationsSourceMapBuildUploadSchema, } from './release-schemas.js';
|
|
3
|
+
export declare const FABRIKA_RELEASE = "FABRIKA_RELEASE";
|
|
4
|
+
export declare const OPERATIONS_RELEASE_RECONCILE_PATH = "/private/releases/reconcile";
|
|
5
|
+
export declare const OPERATIONS_SOURCE_MAP_UPLOAD_PATH = "/api/artifacts/source-maps/";
|
|
6
|
+
export declare const OPERATIONS_ARTIFACT_HEADERS: {
|
|
7
|
+
appId: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
serviceKey: string;
|
|
10
|
+
release: string;
|
|
11
|
+
runId: string;
|
|
12
|
+
logicalPath: string;
|
|
13
|
+
digest: string;
|
|
14
|
+
};
|
|
15
|
+
export type OperationsReleasePhase = 'started' | 'provider_accepted' | 'terminal';
|
|
16
|
+
export type OperationsReleaseOutcome = 'succeeded' | 'failed' | null;
|
|
17
|
+
export type OperationsArtifactState = 'pending' | 'complete' | 'incomplete' | 'not_applicable';
|
|
18
|
+
export type OperationsReleaseUnavailableReason = 'dry_run' | 'missing_commit';
|
|
19
|
+
export interface OperationsReleaseCoordinate {
|
|
20
|
+
appId: string;
|
|
21
|
+
environment: string;
|
|
22
|
+
serviceKey?: string;
|
|
23
|
+
}
|
|
24
|
+
export type OperationsReleaseAvailability = {
|
|
25
|
+
kind: 'available';
|
|
26
|
+
name: string;
|
|
27
|
+
commitSha: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'unavailable';
|
|
30
|
+
reason: OperationsReleaseUnavailableReason;
|
|
31
|
+
};
|
|
32
|
+
export interface OperationsArtifactUploadCredential {
|
|
33
|
+
/** SHA-256 verifier. The bearer itself never crosses the private projection boundary. */
|
|
34
|
+
verifier: string;
|
|
35
|
+
expiresAt: number;
|
|
36
|
+
}
|
|
37
|
+
export interface OperationsReleaseReconcileRequest {
|
|
38
|
+
revision: number;
|
|
39
|
+
runId: string;
|
|
40
|
+
coordinate: OperationsReleaseCoordinate;
|
|
41
|
+
phase: OperationsReleasePhase;
|
|
42
|
+
providerRunId: string | null;
|
|
43
|
+
outcome: OperationsReleaseOutcome;
|
|
44
|
+
artifactState: OperationsArtifactState;
|
|
45
|
+
release: OperationsReleaseAvailability;
|
|
46
|
+
uploadCredential?: OperationsArtifactUploadCredential;
|
|
47
|
+
observedAt: number;
|
|
48
|
+
}
|
|
49
|
+
export type OperationsReleaseProjectionPayload = Omit<OperationsReleaseReconcileRequest, 'revision'>;
|
|
50
|
+
export declare class OperationsReleaseDecodeError extends Error {
|
|
51
|
+
}
|
|
52
|
+
export declare function parseOperationsReleaseRequest(value: unknown): OperationsReleaseReconcileRequest;
|
|
53
|
+
export declare function parseOperationsReleasePayload(value: unknown): OperationsReleaseProjectionPayload;
|
|
54
|
+
export type OperationsReleaseReconcileOutcome = 'applied' | 'unchanged' | 'stale';
|
|
55
|
+
export interface OperationsReleaseReconcileResponse {
|
|
56
|
+
revision: number;
|
|
57
|
+
outcome: OperationsReleaseReconcileOutcome;
|
|
58
|
+
}
|
|
59
|
+
export interface OperationsArtifactUploadConfiguration {
|
|
60
|
+
url: string;
|
|
61
|
+
bearer: string;
|
|
62
|
+
appId: string;
|
|
63
|
+
environment: string;
|
|
64
|
+
serviceKey: string;
|
|
65
|
+
release: string;
|
|
66
|
+
runId: string;
|
|
67
|
+
}
|
|
68
|
+
/** A directory of a build's public assets and the URL path its files are served under: `{ prefix: '/', dir: 'dist/web' }`. */
|
|
69
|
+
export interface OperationsAssetRoot {
|
|
70
|
+
prefix: string;
|
|
71
|
+
dir: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* What a platform build reads to upload its source maps: the destination without its bearer, which travels apart, and
|
|
75
|
+
* the asset roots whose maps it uploads. A map's logical path is the URL path of the file it maps.
|
|
76
|
+
*/
|
|
77
|
+
export interface OperationsSourceMapBuildUpload {
|
|
78
|
+
destination: Omit<OperationsArtifactUploadConfiguration, 'bearer'>;
|
|
79
|
+
assetRoots: OperationsAssetRoot[];
|
|
80
|
+
}
|
|
81
|
+
/** Throws on any other value. */
|
|
82
|
+
export declare function parseOperationsSourceMapBuildUpload(value: unknown): OperationsSourceMapBuildUpload;
|
|
83
|
+
/** Whether every source map a build found reached Operations. */
|
|
84
|
+
export type OperationsSourceMapUploadState = 'complete' | 'incomplete';
|
|
85
|
+
/** The one line a build prints after its upload; the provider reads the state back from the build log. */
|
|
86
|
+
export declare function sourceMapUploadReport(uploaded: number, state: OperationsSourceMapUploadState): string;
|
|
87
|
+
/** The state a build-log line reports, or `null` for any other line. */
|
|
88
|
+
export declare function readSourceMapUploadReport(line: string): OperationsSourceMapUploadState | null;
|
|
89
|
+
export declare function normalizeOperationsCommit(value: string | null | undefined): string | null;
|
|
90
|
+
export declare function operationsReleaseName(input: {
|
|
91
|
+
appId: string;
|
|
92
|
+
environment: string;
|
|
93
|
+
serviceKey?: string;
|
|
94
|
+
commitSha: string;
|
|
95
|
+
}): string;
|
|
96
|
+
export declare function operationsSourceMapUploadUrl(origin: string): string;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { RpcProcedureContract } from '@fabrika/app';
|
|
2
|
+
import type { OperationsAlertKind, OperationsAlertRuleRequestDto, OperationsAlertSettingsResponseDto, OperationsAssigneeListResponseDto, OperationsBulkIssueStatusRequestDto, OperationsBulkIssueStatusResponseDto, OperationsEventDetailResponseDto, OperationsHealthCheckUpsertRequestDto, OperationsHealthResponseDto, OperationsIssueDetailResponseDto, OperationsIssueListResponseDto, OperationsIssueMutationRequestDto, OperationsIssueOccurrenceListResponseDto, OperationsNotificationChannelRequestDto, OperationsReleaseDetailResponseDto, OperationsReleaseListResponseDto, OperationsSourceDetailResponseDto, OperationsSourceHealthDto, OperationsSourceListResponseDto, OperationsSpikeAlertRequestDto } from './operator-api.js';
|
|
3
|
+
export interface OperationsIssueQuery {
|
|
4
|
+
sourceId?: string;
|
|
5
|
+
status?: 'open' | 'resolved' | 'ignored';
|
|
6
|
+
level?: 'fatal' | 'error' | 'warning' | 'info';
|
|
7
|
+
window?: 'all' | '24h' | '7d' | '30d';
|
|
8
|
+
query?: string;
|
|
9
|
+
assignee?: 'all' | 'me' | 'none';
|
|
10
|
+
sort?: 'recent' | 'new' | 'frequency';
|
|
11
|
+
cursor?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface OperationsReleaseQuery {
|
|
15
|
+
sourceId?: string;
|
|
16
|
+
cursor?: string;
|
|
17
|
+
limit?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Portable operator API implemented by Operations and consumed by its console. */
|
|
20
|
+
export interface OperationsRpcContract {
|
|
21
|
+
sources: RpcProcedureContract<void, OperationsSourceListResponseDto>;
|
|
22
|
+
source: RpcProcedureContract<{
|
|
23
|
+
sourceId: string;
|
|
24
|
+
}, OperationsSourceDetailResponseDto>;
|
|
25
|
+
issues: RpcProcedureContract<OperationsIssueQuery, OperationsIssueListResponseDto>;
|
|
26
|
+
issue: RpcProcedureContract<{
|
|
27
|
+
issueId: string;
|
|
28
|
+
}, OperationsIssueDetailResponseDto>;
|
|
29
|
+
issueOccurrences: RpcProcedureContract<{
|
|
30
|
+
issueId: string;
|
|
31
|
+
cursor?: string;
|
|
32
|
+
limit?: number;
|
|
33
|
+
}, OperationsIssueOccurrenceListResponseDto>;
|
|
34
|
+
latestEvent: RpcProcedureContract<{
|
|
35
|
+
issueId: string;
|
|
36
|
+
}, OperationsEventDetailResponseDto>;
|
|
37
|
+
event: RpcProcedureContract<{
|
|
38
|
+
issueId: string;
|
|
39
|
+
occurrenceId: string;
|
|
40
|
+
}, OperationsEventDetailResponseDto>;
|
|
41
|
+
mutateIssue: RpcProcedureContract<{
|
|
42
|
+
issueId: string;
|
|
43
|
+
mutation: OperationsIssueMutationRequestDto;
|
|
44
|
+
}, OperationsIssueDetailResponseDto>;
|
|
45
|
+
bulkIssueStatus: RpcProcedureContract<OperationsBulkIssueStatusRequestDto, OperationsBulkIssueStatusResponseDto>;
|
|
46
|
+
assignees: RpcProcedureContract<{
|
|
47
|
+
sourceId: string;
|
|
48
|
+
}, OperationsAssigneeListResponseDto>;
|
|
49
|
+
releases: RpcProcedureContract<OperationsReleaseQuery, OperationsReleaseListResponseDto>;
|
|
50
|
+
release: RpcProcedureContract<{
|
|
51
|
+
releaseId: string;
|
|
52
|
+
}, OperationsReleaseDetailResponseDto>;
|
|
53
|
+
health: RpcProcedureContract<void, OperationsHealthResponseDto>;
|
|
54
|
+
sourceHealth: RpcProcedureContract<{
|
|
55
|
+
sourceId: string;
|
|
56
|
+
}, OperationsSourceHealthDto>;
|
|
57
|
+
createHealthCheck: RpcProcedureContract<{
|
|
58
|
+
sourceId: string;
|
|
59
|
+
input: OperationsHealthCheckUpsertRequestDto;
|
|
60
|
+
}, {
|
|
61
|
+
id: string;
|
|
62
|
+
}>;
|
|
63
|
+
updateHealthCheck: RpcProcedureContract<{
|
|
64
|
+
sourceId: string;
|
|
65
|
+
checkId: string;
|
|
66
|
+
input: OperationsHealthCheckUpsertRequestDto;
|
|
67
|
+
}, {
|
|
68
|
+
id: string;
|
|
69
|
+
}>;
|
|
70
|
+
deleteHealthCheck: RpcProcedureContract<{
|
|
71
|
+
sourceId: string;
|
|
72
|
+
checkId: string;
|
|
73
|
+
}, null>;
|
|
74
|
+
alerts: RpcProcedureContract<{
|
|
75
|
+
sourceId: string;
|
|
76
|
+
}, OperationsAlertSettingsResponseDto>;
|
|
77
|
+
updateSpikeAlert: RpcProcedureContract<{
|
|
78
|
+
sourceId: string;
|
|
79
|
+
input: OperationsSpikeAlertRequestDto;
|
|
80
|
+
}, {
|
|
81
|
+
threshold: number;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
}>;
|
|
84
|
+
updateAlertRule: RpcProcedureContract<{
|
|
85
|
+
sourceId: string;
|
|
86
|
+
kind: OperationsAlertKind;
|
|
87
|
+
input: OperationsAlertRuleRequestDto;
|
|
88
|
+
}, {
|
|
89
|
+
kind: OperationsAlertKind;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
}>;
|
|
92
|
+
createAlertChannel: RpcProcedureContract<{
|
|
93
|
+
sourceId: string;
|
|
94
|
+
input: OperationsNotificationChannelRequestDto;
|
|
95
|
+
}, {
|
|
96
|
+
id: string;
|
|
97
|
+
}>;
|
|
98
|
+
updateAlertChannel: RpcProcedureContract<{
|
|
99
|
+
sourceId: string;
|
|
100
|
+
channelId: string;
|
|
101
|
+
input: OperationsNotificationChannelRequestDto;
|
|
102
|
+
}, {
|
|
103
|
+
id: string;
|
|
104
|
+
}>;
|
|
105
|
+
deleteAlertChannel: RpcProcedureContract<{
|
|
106
|
+
sourceId: string;
|
|
107
|
+
channelId: string;
|
|
108
|
+
}, null>;
|
|
109
|
+
}
|