@fabrika/control-contract 0.8.1 → 0.9.0-dev.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 +7 -6
- package/src/index.ts +11 -0
- package/types/src/access.d.ts +56 -0
- package/types/src/builder-bootstrap.d.ts +41 -0
- package/types/src/builder-connections.d.ts +223 -0
- package/types/src/builder-pairing.d.ts +12 -0
- package/types/src/index.d.ts +500 -0
- package/types/src/mail.d.ts +88 -0
- package/types/src/rpc.d.ts +193 -0
- package/types/src/source-connection-list.d.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/control-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,12 +11,13 @@
|
|
|
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
|
},
|
|
@@ -25,8 +26,8 @@
|
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"zod": "^3.25.76",
|
|
28
|
-
"@fabrika/auth-core": "0.
|
|
29
|
-
"@fabrika/app": "0.
|
|
30
|
-
"@fabrika/provider-contract": "0.
|
|
29
|
+
"@fabrika/auth-core": "0.9.0-dev.2",
|
|
30
|
+
"@fabrika/app": "0.9.0-dev.2",
|
|
31
|
+
"@fabrika/provider-contract": "0.9.0-dev.2"
|
|
31
32
|
}
|
|
32
33
|
}
|
package/src/index.ts
CHANGED
|
@@ -207,9 +207,18 @@ export interface UpdateAppRequest extends AppOptionalFields {
|
|
|
207
207
|
repoUrl?: string
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* `dev` follows the workspace bound to it through its launcher, without a run (ADR-0049); at most one per application,
|
|
212
|
+
* never protected and never production. Every other environment is `standard`.
|
|
213
|
+
*/
|
|
214
|
+
export const APP_ENV_KINDS = ['standard', 'dev'] as const
|
|
215
|
+
|
|
216
|
+
export type AppEnvKind = (typeof APP_ENV_KINDS)[number]
|
|
217
|
+
|
|
210
218
|
export interface AppEnvDto {
|
|
211
219
|
appId: string
|
|
212
220
|
env: string
|
|
221
|
+
kind: AppEnvKind
|
|
213
222
|
domain: string | null
|
|
214
223
|
publicOrigin: string | null
|
|
215
224
|
/** The exact origins whose pages may call this environment's cross-origin endpoints (ADR-0022); empty lists none. */
|
|
@@ -272,6 +281,8 @@ export interface PutAppEnvRequest {
|
|
|
272
281
|
triggerRef?: string | null
|
|
273
282
|
/** Omitted keeps the stored value. Only a Zerops environment of an app with a GitHub connection qualifies. */
|
|
274
283
|
authoring?: boolean
|
|
284
|
+
/** Set when the environment is created, `standard` when omitted; it never changes afterwards. */
|
|
285
|
+
kind?: AppEnvKind
|
|
275
286
|
namespaceId?: string | null
|
|
276
287
|
target: ProviderEnvelopeDto
|
|
277
288
|
artifact: ProviderEnvelopeDto
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** IAM vocabulary shared by the Control runtime, its Access schema and the console. */
|
|
2
|
+
/** Durable IAM application id of the console — a deployed identity, not configuration branding (ADR-0024). */
|
|
3
|
+
export declare const CONTROL_APP_ID = "vozka";
|
|
4
|
+
/**
|
|
5
|
+
* The actions Control authorizes against. AWS-IAM-style dotted strings; IAM's `permits` matches
|
|
6
|
+
* them (incl. `*` / `prefix.*` wildcards in granted roles).
|
|
7
|
+
*/
|
|
8
|
+
export declare const CONTROL_ACTIONS: Readonly<{
|
|
9
|
+
/** Trigger a deploy run (the manual "Deploy" button / triggerDeploy RPC). Scoped by app/environment. */
|
|
10
|
+
DEPLOY_TRIGGER: "deploy.trigger";
|
|
11
|
+
/** Read deploy runs + their logs (run history API). Scoped by app/environment. */
|
|
12
|
+
DEPLOY_READ: "deploy.read";
|
|
13
|
+
/** Manage the app registry (apps + app_envs CRUD, onboarding). Scoped by app (global to create). */
|
|
14
|
+
APP_MANAGE: "app.manage";
|
|
15
|
+
/** Manage provider-owned deployment namespaces and their lifecycle. Global because namespaces may span apps. */
|
|
16
|
+
NAMESPACE_MANAGE: "namespace.manage";
|
|
17
|
+
/**
|
|
18
|
+
* Manage SECRET VALUES + their references. Gates the app_secrets reference CRUD (scoped by app) AND
|
|
19
|
+
* writing/rotating/deleting the encrypted per-app/app-env VALUES in the vault. The value is
|
|
20
|
+
* write-only over the API; it is never returned. (Platform creds — the CF token, IAM
|
|
21
|
+
* provisioning creds — are fabrika's own Worker secrets, not managed through this action.)
|
|
22
|
+
*/
|
|
23
|
+
SECRET_MANAGE: "secret.manage";
|
|
24
|
+
/** Manage the platform GitHub source connection. Global because it changes control-wide credentials. */
|
|
25
|
+
SOURCE_CONNECTION_MANAGE: "source.connection.manage";
|
|
26
|
+
/** Read the files of one's own Git workspaces on an authoring target (ADR-0049). Scoped by app/environment. */
|
|
27
|
+
SOURCE_WORKSPACE_READ: "source.workspace.read";
|
|
28
|
+
/** Create Git workspaces and commit to them on an authoring target. Scoped by app/environment. */
|
|
29
|
+
SOURCE_WORKSPACE_WRITE: "source.workspace.write";
|
|
30
|
+
/** Open a pull request from one's own workspace to the default branch. Scoped by app/environment. */
|
|
31
|
+
SOURCE_PULL_REQUEST_CREATE: "source.pull-request.create";
|
|
32
|
+
/**
|
|
33
|
+
* Approve a widening of an environment's access and change its `protected` flag (ADR-0050). Outside `deploy.*`, so
|
|
34
|
+
* the operator role does not hold it; only a human user principal in the console may use it. Scoped by app/environment.
|
|
35
|
+
*/
|
|
36
|
+
ACCESS_APPROVE: "access.approve";
|
|
37
|
+
/**
|
|
38
|
+
* List relayed mail and read its metadata. Scoped by app/environment for an application's messages; an installation
|
|
39
|
+
* sender's messages need a global grant.
|
|
40
|
+
*/
|
|
41
|
+
MAIL_READ: "mail.read";
|
|
42
|
+
/** Read a relayed message's recipient, subject and bodies. Global. */
|
|
43
|
+
MAIL_CONTENT_READ: "mail.content.read";
|
|
44
|
+
/** Release or drop a held message, requeue a final one, and change the gate's rules. Global. */
|
|
45
|
+
MAIL_MANAGE: "mail.manage";
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* The scope dimensions Control authorizes within (flat + independent IAM semantics):
|
|
49
|
+
* - `app` — scoped to one registered app (its `id`), across every environment.
|
|
50
|
+
* - `environment` — scoped to one environment name (e.g. only `stage`), across apps.
|
|
51
|
+
* A grant with neither scope is global.
|
|
52
|
+
*/
|
|
53
|
+
export declare const CONTROL_SCOPES: Readonly<{
|
|
54
|
+
APP: "app";
|
|
55
|
+
ENVIRONMENT: "environment";
|
|
56
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const BUILDER_APPROVAL_STORAGE_KEY = "fabrika.builder.approval.v1";
|
|
3
|
+
export declare const BUILDER_AUTHORIZE_PATH = "/builder/authorize";
|
|
4
|
+
export interface BuilderApprovalState {
|
|
5
|
+
readonly attemptId: string;
|
|
6
|
+
readonly approvalVerifier: string;
|
|
7
|
+
readonly expiresAt: number;
|
|
8
|
+
}
|
|
9
|
+
export interface BuilderInstallationDiscoveryDto {
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
readonly controlOrigin: string;
|
|
12
|
+
readonly iamIssuer: string;
|
|
13
|
+
readonly provider: string;
|
|
14
|
+
}
|
|
15
|
+
/** Self-contained so the public capture page can embed this exact validator without external assets. */
|
|
16
|
+
export declare function parseBuilderApprovalState(value: unknown, nowSeconds?: number): BuilderApprovalState | null;
|
|
17
|
+
/** Accept only a credential-free installation origin, never a redirect or a repository-selected path. */
|
|
18
|
+
export declare function parseBuilderPublicOrigin(value: unknown): string | null;
|
|
19
|
+
export declare function parseBuilderInstallationDiscovery(value: unknown): BuilderInstallationDiscoveryDto | null;
|
|
20
|
+
export declare const builderPublicOriginSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
21
|
+
export declare const builderInstallationDiscoverySchema: z.ZodEffects<z.ZodObject<{
|
|
22
|
+
version: z.ZodLiteral<1>;
|
|
23
|
+
controlOrigin: z.ZodEffects<z.ZodString, string, string>;
|
|
24
|
+
iamIssuer: z.ZodEffects<z.ZodString, string, string>;
|
|
25
|
+
provider: z.ZodString;
|
|
26
|
+
}, "strict", z.ZodTypeAny, {
|
|
27
|
+
version: 1;
|
|
28
|
+
controlOrigin: string;
|
|
29
|
+
iamIssuer: string;
|
|
30
|
+
provider: string;
|
|
31
|
+
}, {
|
|
32
|
+
version: 1;
|
|
33
|
+
controlOrigin: string;
|
|
34
|
+
iamIssuer: string;
|
|
35
|
+
provider: string;
|
|
36
|
+
}>, {
|
|
37
|
+
version: 1;
|
|
38
|
+
controlOrigin: string;
|
|
39
|
+
iamIssuer: string;
|
|
40
|
+
provider: string;
|
|
41
|
+
}, unknown>;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AppDto } from './index.js';
|
|
3
|
+
export declare const BUILDER_CONNECTION_ATTEMPT_ID: RegExp;
|
|
4
|
+
export declare const BUILDER_APPROVAL_VERIFIER: RegExp;
|
|
5
|
+
export declare const BUILDER_CONNECTION_IDENTIFIER: RegExp;
|
|
6
|
+
export interface BuilderConnectionEnvironmentDto {
|
|
7
|
+
readonly env: string;
|
|
8
|
+
readonly namespaceId: string | null;
|
|
9
|
+
readonly domain: string | null;
|
|
10
|
+
readonly publicOrigin: string | null;
|
|
11
|
+
readonly triggerRef: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface BuilderConnectionReceiptDto {
|
|
14
|
+
readonly version: 1;
|
|
15
|
+
readonly attemptId: string;
|
|
16
|
+
readonly provider: string;
|
|
17
|
+
readonly app: AppDto;
|
|
18
|
+
readonly environment: BuilderConnectionEnvironmentDto;
|
|
19
|
+
readonly createdAt: number;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateBuilderConnectionReceiptRequest {
|
|
22
|
+
readonly attemptId: string;
|
|
23
|
+
readonly approvalVerifier: string;
|
|
24
|
+
readonly appId: string;
|
|
25
|
+
readonly environment: BuilderConnectionEnvironmentDto;
|
|
26
|
+
}
|
|
27
|
+
export interface GetBuilderConnectionReceiptRequest {
|
|
28
|
+
readonly attemptId: string;
|
|
29
|
+
}
|
|
30
|
+
/** Decode the persisted/wire snapshot without accepting provider envelopes or credential fields. */
|
|
31
|
+
export declare function parseBuilderConnectionReceipt(value: unknown): BuilderConnectionReceiptDto;
|
|
32
|
+
export declare const builderConnectionAppSchema: z.ZodEffects<z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
repoUrl: z.ZodString;
|
|
35
|
+
defaultBranch: z.ZodString;
|
|
36
|
+
workerDir: z.ZodNullable<z.ZodString>;
|
|
37
|
+
buildCmd: z.ZodNullable<z.ZodString>;
|
|
38
|
+
configPath: z.ZodNullable<z.ZodString>;
|
|
39
|
+
githubConnectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
githubInstallationId: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
createdAt: z.ZodNumber;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
id: string;
|
|
44
|
+
repoUrl: string;
|
|
45
|
+
defaultBranch: string;
|
|
46
|
+
workerDir: string | null;
|
|
47
|
+
buildCmd: string | null;
|
|
48
|
+
configPath: string | null;
|
|
49
|
+
githubInstallationId: number | null;
|
|
50
|
+
createdAt: number;
|
|
51
|
+
githubConnectionId?: string | null | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
id: string;
|
|
54
|
+
repoUrl: string;
|
|
55
|
+
defaultBranch: string;
|
|
56
|
+
workerDir: string | null;
|
|
57
|
+
buildCmd: string | null;
|
|
58
|
+
configPath: string | null;
|
|
59
|
+
githubInstallationId: number | null;
|
|
60
|
+
createdAt: number;
|
|
61
|
+
githubConnectionId?: string | null | undefined;
|
|
62
|
+
}>, {
|
|
63
|
+
githubInstallationId: number | null;
|
|
64
|
+
createdAt: number;
|
|
65
|
+
githubConnectionId?: string | null | undefined;
|
|
66
|
+
id: string;
|
|
67
|
+
repoUrl: string;
|
|
68
|
+
defaultBranch: string;
|
|
69
|
+
workerDir: string | null;
|
|
70
|
+
buildCmd: string | null;
|
|
71
|
+
configPath: string | null;
|
|
72
|
+
}, {
|
|
73
|
+
id: string;
|
|
74
|
+
repoUrl: string;
|
|
75
|
+
defaultBranch: string;
|
|
76
|
+
workerDir: string | null;
|
|
77
|
+
buildCmd: string | null;
|
|
78
|
+
configPath: string | null;
|
|
79
|
+
githubInstallationId: number | null;
|
|
80
|
+
createdAt: number;
|
|
81
|
+
githubConnectionId?: string | null | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const builderConnectionEnvironmentSchema: z.ZodObject<{
|
|
84
|
+
env: z.ZodString;
|
|
85
|
+
namespaceId: z.ZodNullable<z.ZodString>;
|
|
86
|
+
domain: z.ZodNullable<z.ZodString>;
|
|
87
|
+
publicOrigin: z.ZodNullable<z.ZodString>;
|
|
88
|
+
triggerRef: z.ZodNullable<z.ZodString>;
|
|
89
|
+
}, "strict", z.ZodTypeAny, {
|
|
90
|
+
env: string;
|
|
91
|
+
domain: string | null;
|
|
92
|
+
publicOrigin: string | null;
|
|
93
|
+
triggerRef: string | null;
|
|
94
|
+
namespaceId: string | null;
|
|
95
|
+
}, {
|
|
96
|
+
env: string;
|
|
97
|
+
domain: string | null;
|
|
98
|
+
publicOrigin: string | null;
|
|
99
|
+
triggerRef: string | null;
|
|
100
|
+
namespaceId: string | null;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const builderConnectionReceiptSchema: z.ZodObject<{
|
|
103
|
+
version: z.ZodLiteral<1>;
|
|
104
|
+
attemptId: z.ZodString;
|
|
105
|
+
provider: z.ZodString;
|
|
106
|
+
app: z.ZodEffects<z.ZodObject<{
|
|
107
|
+
id: z.ZodString;
|
|
108
|
+
repoUrl: z.ZodString;
|
|
109
|
+
defaultBranch: z.ZodString;
|
|
110
|
+
workerDir: z.ZodNullable<z.ZodString>;
|
|
111
|
+
buildCmd: z.ZodNullable<z.ZodString>;
|
|
112
|
+
configPath: z.ZodNullable<z.ZodString>;
|
|
113
|
+
githubConnectionId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
githubInstallationId: z.ZodNullable<z.ZodNumber>;
|
|
115
|
+
createdAt: z.ZodNumber;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
id: string;
|
|
118
|
+
repoUrl: string;
|
|
119
|
+
defaultBranch: string;
|
|
120
|
+
workerDir: string | null;
|
|
121
|
+
buildCmd: string | null;
|
|
122
|
+
configPath: string | null;
|
|
123
|
+
githubInstallationId: number | null;
|
|
124
|
+
createdAt: number;
|
|
125
|
+
githubConnectionId?: string | null | undefined;
|
|
126
|
+
}, {
|
|
127
|
+
id: string;
|
|
128
|
+
repoUrl: string;
|
|
129
|
+
defaultBranch: string;
|
|
130
|
+
workerDir: string | null;
|
|
131
|
+
buildCmd: string | null;
|
|
132
|
+
configPath: string | null;
|
|
133
|
+
githubInstallationId: number | null;
|
|
134
|
+
createdAt: number;
|
|
135
|
+
githubConnectionId?: string | null | undefined;
|
|
136
|
+
}>, {
|
|
137
|
+
githubInstallationId: number | null;
|
|
138
|
+
createdAt: number;
|
|
139
|
+
githubConnectionId?: string | null | undefined;
|
|
140
|
+
id: string;
|
|
141
|
+
repoUrl: string;
|
|
142
|
+
defaultBranch: string;
|
|
143
|
+
workerDir: string | null;
|
|
144
|
+
buildCmd: string | null;
|
|
145
|
+
configPath: string | null;
|
|
146
|
+
}, {
|
|
147
|
+
id: string;
|
|
148
|
+
repoUrl: string;
|
|
149
|
+
defaultBranch: string;
|
|
150
|
+
workerDir: string | null;
|
|
151
|
+
buildCmd: string | null;
|
|
152
|
+
configPath: string | null;
|
|
153
|
+
githubInstallationId: number | null;
|
|
154
|
+
createdAt: number;
|
|
155
|
+
githubConnectionId?: string | null | undefined;
|
|
156
|
+
}>;
|
|
157
|
+
environment: z.ZodObject<{
|
|
158
|
+
env: z.ZodString;
|
|
159
|
+
namespaceId: z.ZodNullable<z.ZodString>;
|
|
160
|
+
domain: z.ZodNullable<z.ZodString>;
|
|
161
|
+
publicOrigin: z.ZodNullable<z.ZodString>;
|
|
162
|
+
triggerRef: z.ZodNullable<z.ZodString>;
|
|
163
|
+
}, "strict", z.ZodTypeAny, {
|
|
164
|
+
env: string;
|
|
165
|
+
domain: string | null;
|
|
166
|
+
publicOrigin: string | null;
|
|
167
|
+
triggerRef: string | null;
|
|
168
|
+
namespaceId: string | null;
|
|
169
|
+
}, {
|
|
170
|
+
env: string;
|
|
171
|
+
domain: string | null;
|
|
172
|
+
publicOrigin: string | null;
|
|
173
|
+
triggerRef: string | null;
|
|
174
|
+
namespaceId: string | null;
|
|
175
|
+
}>;
|
|
176
|
+
createdAt: z.ZodNumber;
|
|
177
|
+
}, "strict", z.ZodTypeAny, {
|
|
178
|
+
app: {
|
|
179
|
+
githubInstallationId: number | null;
|
|
180
|
+
createdAt: number;
|
|
181
|
+
githubConnectionId?: string | null | undefined;
|
|
182
|
+
id: string;
|
|
183
|
+
repoUrl: string;
|
|
184
|
+
defaultBranch: string;
|
|
185
|
+
workerDir: string | null;
|
|
186
|
+
buildCmd: string | null;
|
|
187
|
+
configPath: string | null;
|
|
188
|
+
};
|
|
189
|
+
environment: {
|
|
190
|
+
env: string;
|
|
191
|
+
domain: string | null;
|
|
192
|
+
publicOrigin: string | null;
|
|
193
|
+
triggerRef: string | null;
|
|
194
|
+
namespaceId: string | null;
|
|
195
|
+
};
|
|
196
|
+
attemptId: string;
|
|
197
|
+
version: 1;
|
|
198
|
+
provider: string;
|
|
199
|
+
createdAt: number;
|
|
200
|
+
}, {
|
|
201
|
+
app: {
|
|
202
|
+
id: string;
|
|
203
|
+
repoUrl: string;
|
|
204
|
+
defaultBranch: string;
|
|
205
|
+
workerDir: string | null;
|
|
206
|
+
buildCmd: string | null;
|
|
207
|
+
configPath: string | null;
|
|
208
|
+
githubInstallationId: number | null;
|
|
209
|
+
createdAt: number;
|
|
210
|
+
githubConnectionId?: string | null | undefined;
|
|
211
|
+
};
|
|
212
|
+
environment: {
|
|
213
|
+
env: string;
|
|
214
|
+
domain: string | null;
|
|
215
|
+
publicOrigin: string | null;
|
|
216
|
+
triggerRef: string | null;
|
|
217
|
+
namespaceId: string | null;
|
|
218
|
+
};
|
|
219
|
+
attemptId: string;
|
|
220
|
+
version: 1;
|
|
221
|
+
provider: string;
|
|
222
|
+
createdAt: number;
|
|
223
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { ApproveDeviceAuthorizationResult, DenyDeviceAuthorizationResult, DeviceAuthorizationFailure, DeviceAuthorizationReceipt, DeviceAuthorizationRequest, InspectDeviceAuthorizationResult, ListOwnDeviceAuthorizationsResult, RevokeKeyResult, } from '@fabrika/auth-core';
|
|
2
|
+
export interface BuilderPairingProofRequest {
|
|
3
|
+
readonly attemptId: string;
|
|
4
|
+
readonly approvalVerifier: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ListOwnBuilderPairingsRequest {
|
|
7
|
+
readonly before?: string;
|
|
8
|
+
readonly limit?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RevokeBuilderPairingRequest {
|
|
11
|
+
readonly credentialId: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
import type { EndpointKind, EndpointMethod } from '@fabrika/auth-core';
|
|
2
|
+
import type { JsonValue, ProviderEnvelope } from '@fabrika/provider-contract';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export * from './access.js';
|
|
5
|
+
export * from './builder-bootstrap.js';
|
|
6
|
+
export * from './builder-connections.js';
|
|
7
|
+
export * from './builder-pairing.js';
|
|
8
|
+
export * from './mail.js';
|
|
9
|
+
export type { JsonValue };
|
|
10
|
+
/** A plain list response. */
|
|
11
|
+
export interface ListResponse<T> {
|
|
12
|
+
items: T[];
|
|
13
|
+
}
|
|
14
|
+
/** A keyset-paginated list. */
|
|
15
|
+
export interface CursorList<T> {
|
|
16
|
+
items: T[];
|
|
17
|
+
nextCursor: string | null;
|
|
18
|
+
}
|
|
19
|
+
export type ProviderEnvelopeDto = ProviderEnvelope;
|
|
20
|
+
/** What the console needs to know about the installation it runs in. */
|
|
21
|
+
export interface InstallationDto {
|
|
22
|
+
/** The id of the one provider bundle this installation composes (ADR-0011). */
|
|
23
|
+
readonly provider: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The console actions the caller's verified token holds, in the shape of an application's caller document. The
|
|
27
|
+
* console shows and hides by it; it decides nothing, because every procedure checks its own action.
|
|
28
|
+
*/
|
|
29
|
+
export interface ConsoleAccessDto {
|
|
30
|
+
/** Null for a credential bound to no principal. */
|
|
31
|
+
readonly principal: {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly label: string;
|
|
34
|
+
} | null;
|
|
35
|
+
/** The actions held as a global grant, so in every scope value. */
|
|
36
|
+
readonly global: readonly string[];
|
|
37
|
+
/** Each scope value the caller holds an action in, with those actions; sorted by dimension, then value. */
|
|
38
|
+
readonly scopes: readonly ConsoleScopedActionsDto[];
|
|
39
|
+
}
|
|
40
|
+
export interface ConsoleScopedActionsDto {
|
|
41
|
+
readonly type: string;
|
|
42
|
+
readonly value: string;
|
|
43
|
+
readonly actions: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
export interface GitHubSourceRepositoryDto {
|
|
46
|
+
readonly owner: string;
|
|
47
|
+
readonly name: string;
|
|
48
|
+
}
|
|
49
|
+
export interface GitHubSourceConnectionAppDto {
|
|
50
|
+
readonly id: number;
|
|
51
|
+
readonly slug: string;
|
|
52
|
+
readonly htmlUrl: string;
|
|
53
|
+
readonly public: boolean;
|
|
54
|
+
readonly owner: {
|
|
55
|
+
readonly login: string;
|
|
56
|
+
readonly type: 'Organization';
|
|
57
|
+
};
|
|
58
|
+
readonly permissions: {
|
|
59
|
+
readonly contents: 'read';
|
|
60
|
+
};
|
|
61
|
+
readonly events: readonly ['push'];
|
|
62
|
+
}
|
|
63
|
+
export interface GitHubSourceConnectionInstallationDto {
|
|
64
|
+
readonly id: number;
|
|
65
|
+
readonly accountLogin: string;
|
|
66
|
+
readonly repositorySelection: 'all' | 'selected';
|
|
67
|
+
readonly verifiedRepositories: readonly GitHubSourceRepositoryDto[];
|
|
68
|
+
}
|
|
69
|
+
interface GitHubSourceConnectionBaseDto {
|
|
70
|
+
readonly provider: string;
|
|
71
|
+
readonly kind: 'github-app';
|
|
72
|
+
}
|
|
73
|
+
export interface GitHubSourceConnectionAnonymousDto extends GitHubSourceConnectionBaseDto {
|
|
74
|
+
readonly state: 'anonymous';
|
|
75
|
+
}
|
|
76
|
+
export interface GitHubSourceConnectionUnavailableDto extends GitHubSourceConnectionBaseDto {
|
|
77
|
+
readonly state: 'unavailable';
|
|
78
|
+
}
|
|
79
|
+
export interface GitHubSourceConnectionSetupPendingDto extends GitHubSourceConnectionBaseDto {
|
|
80
|
+
readonly state: 'setup-pending';
|
|
81
|
+
readonly connectionId: string;
|
|
82
|
+
readonly phase: 'starting' | 'awaiting-manifest-callback' | 'persisting' | 'activating';
|
|
83
|
+
/** Present only while the same-origin manifest handoff can be resumed. */
|
|
84
|
+
readonly continuePath?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface GitHubSourceConnectionInstallationRequiredDto extends GitHubSourceConnectionBaseDto {
|
|
87
|
+
readonly state: 'installation-required';
|
|
88
|
+
readonly connectionId: string;
|
|
89
|
+
readonly app: GitHubSourceConnectionAppDto;
|
|
90
|
+
readonly installationUrl: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The query parameter Control's GitHub setup URL adds when it sends the browser to the console's source page. It reports
|
|
94
|
+
* what that one return from GitHub found; the page still reads the connection state from the API.
|
|
95
|
+
*/
|
|
96
|
+
export declare const GITHUB_SETUP_OUTCOME_PARAM = "github-setup";
|
|
97
|
+
export type GitHubSetupOutcome = 'connected' | 'approval-requested' | 'unverified';
|
|
98
|
+
export interface GitHubSourceConnectionConnectedDto extends GitHubSourceConnectionBaseDto {
|
|
99
|
+
readonly state: 'connected';
|
|
100
|
+
readonly connectionId: string;
|
|
101
|
+
readonly app: GitHubSourceConnectionAppDto;
|
|
102
|
+
readonly installation: GitHubSourceConnectionInstallationDto;
|
|
103
|
+
}
|
|
104
|
+
export type GitHubSourceConnectionWorkflowDto = Exclude<GitHubSourceConnectionStatusDto, GitHubSourceConnectionConnectedDto>;
|
|
105
|
+
export * from './source-connection-list.js';
|
|
106
|
+
export interface GitHubSourceConnectionListInput {
|
|
107
|
+
readonly cursor?: string;
|
|
108
|
+
readonly limit?: number;
|
|
109
|
+
}
|
|
110
|
+
export interface GitHubSourceConnectionListResponse {
|
|
111
|
+
readonly items: readonly GitHubSourceConnectionConnectedDto[];
|
|
112
|
+
readonly nextCursor: string | null;
|
|
113
|
+
/** The one global non-connected workflow state, when present. */
|
|
114
|
+
readonly workflow: GitHubSourceConnectionWorkflowDto | null;
|
|
115
|
+
}
|
|
116
|
+
export interface GitHubSourceConnectionRepairRequiredDto extends GitHubSourceConnectionBaseDto {
|
|
117
|
+
readonly state: 'repair-required';
|
|
118
|
+
readonly connectionId: string;
|
|
119
|
+
readonly reason: 'interrupted-setup' | 'credential-activation' | 'installation-verification';
|
|
120
|
+
readonly app?: GitHubSourceConnectionAppDto;
|
|
121
|
+
}
|
|
122
|
+
/** Browser-safe setup state. It never carries a private key, webhook secret, token, or source RPC key. */
|
|
123
|
+
export type GitHubSourceConnectionStatusDto = GitHubSourceConnectionAnonymousDto | GitHubSourceConnectionUnavailableDto | GitHubSourceConnectionSetupPendingDto | GitHubSourceConnectionInstallationRequiredDto | GitHubSourceConnectionConnectedDto | GitHubSourceConnectionRepairRequiredDto;
|
|
124
|
+
export interface StartGitHubSourceConnectionRequest {
|
|
125
|
+
readonly organization: string;
|
|
126
|
+
readonly appName: string;
|
|
127
|
+
readonly visibility: 'private' | 'public';
|
|
128
|
+
readonly repositories: readonly GitHubSourceRepositoryDto[];
|
|
129
|
+
}
|
|
130
|
+
export interface StartGitHubSourceConnectionResponse {
|
|
131
|
+
readonly connectionId: string;
|
|
132
|
+
/** Same-origin path that starts the GitHub manifest handoff. */
|
|
133
|
+
readonly continuePath: string;
|
|
134
|
+
}
|
|
135
|
+
/** One redacted line of deploy output: the runner's NDJSON log line and the control API's view of it. */
|
|
136
|
+
export declare const runLogLineSchema: z.ZodObject<{
|
|
137
|
+
ts: z.ZodNumber;
|
|
138
|
+
stream: z.ZodEnum<["stdout", "stderr", "meta"]>;
|
|
139
|
+
text: z.ZodString;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
text: string;
|
|
142
|
+
ts: number;
|
|
143
|
+
stream: "stdout" | "stderr" | "meta";
|
|
144
|
+
}, {
|
|
145
|
+
text: string;
|
|
146
|
+
ts: number;
|
|
147
|
+
stream: "stdout" | "stderr" | "meta";
|
|
148
|
+
}>;
|
|
149
|
+
export type RunLogLine = z.infer<typeof runLogLineSchema>;
|
|
150
|
+
/** Backward-compatible short name for browser consumers. */
|
|
151
|
+
export type LogLine = RunLogLine;
|
|
152
|
+
export interface SetSecretValueRequest {
|
|
153
|
+
value: string;
|
|
154
|
+
env?: string | null;
|
|
155
|
+
}
|
|
156
|
+
export interface AppDto {
|
|
157
|
+
id: string;
|
|
158
|
+
repoUrl: string;
|
|
159
|
+
defaultBranch: string;
|
|
160
|
+
workerDir: string | null;
|
|
161
|
+
buildCmd: string | null;
|
|
162
|
+
configPath: string | null;
|
|
163
|
+
githubConnectionId?: string | null;
|
|
164
|
+
githubInstallationId: number | null;
|
|
165
|
+
createdAt: number;
|
|
166
|
+
}
|
|
167
|
+
export interface AppOptionalFields {
|
|
168
|
+
defaultBranch?: string;
|
|
169
|
+
workerDir?: string | null;
|
|
170
|
+
buildCmd?: string | null;
|
|
171
|
+
configPath?: string | null;
|
|
172
|
+
/** Must equal the installation of the repository owner's GitHub connection. */
|
|
173
|
+
githubInstallationId?: number | null;
|
|
174
|
+
/** Bind the app to the repository owner's GitHub connection (one per owner). */
|
|
175
|
+
resolveInstallationId?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface UpdateAppRequest extends AppOptionalFields {
|
|
178
|
+
repoUrl?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* `dev` follows the workspace bound to it through its launcher, without a run (ADR-0049); at most one per application,
|
|
182
|
+
* never protected and never production. Every other environment is `standard`.
|
|
183
|
+
*/
|
|
184
|
+
export declare const APP_ENV_KINDS: readonly ["standard", "dev"];
|
|
185
|
+
export type AppEnvKind = (typeof APP_ENV_KINDS)[number];
|
|
186
|
+
export interface AppEnvDto {
|
|
187
|
+
appId: string;
|
|
188
|
+
env: string;
|
|
189
|
+
kind: AppEnvKind;
|
|
190
|
+
domain: string | null;
|
|
191
|
+
publicOrigin: string | null;
|
|
192
|
+
/** The exact origins whose pages may call this environment's cross-origin endpoints (ADR-0022); empty lists none. */
|
|
193
|
+
crossOrigins: string[];
|
|
194
|
+
triggerRef: string | null;
|
|
195
|
+
/** An MCP authoring target (ADR-0049): users with `source.workspace.*` grants may edit and deploy it. */
|
|
196
|
+
authoring: boolean;
|
|
197
|
+
/** A widening of access waits for a human's approval here (ADR-0050); `prod` is protected by default. */
|
|
198
|
+
protected: boolean;
|
|
199
|
+
/** The run whose snapshot is this environment's active access; null until a run publishes one. */
|
|
200
|
+
publishedRunId: string | null;
|
|
201
|
+
/**
|
|
202
|
+
* The published snapshot's steps off the paved road, grouped by the site or migration that takes them: the reach its
|
|
203
|
+
* sites declare and the database code its migrations declare. Listed whether or not the environment is protected.
|
|
204
|
+
*/
|
|
205
|
+
deviationSubjects: DeviationSubjectDto[];
|
|
206
|
+
/** The published snapshot's endpoints as the outside reaches them, most exposed first; empty until a run publishes one. */
|
|
207
|
+
surface: SurfaceEndpointDto[];
|
|
208
|
+
namespaceId: string | null;
|
|
209
|
+
provider: string;
|
|
210
|
+
target: ProviderEnvelopeDto;
|
|
211
|
+
artifact: ProviderEnvelopeDto;
|
|
212
|
+
createdAt: number;
|
|
213
|
+
}
|
|
214
|
+
/** One endpoint, job or migration of a published snapshot and its steps off the paved road. */
|
|
215
|
+
export interface DeviationSubjectDto {
|
|
216
|
+
/** `Endpoint \`id\``, `Job \`name\`` or `Migration \`file\``. */
|
|
217
|
+
subject: string;
|
|
218
|
+
/** Each step, phrased to follow the subject: `declares raw SQL (\`read\`)`. */
|
|
219
|
+
steps: string[];
|
|
220
|
+
}
|
|
221
|
+
/** Who reaches an endpoint, most exposed first. */
|
|
222
|
+
export declare const SURFACE_REACHES: readonly ["anyone", "link", "app", "machine", "human"];
|
|
223
|
+
/** An endpoint is listed under its most exposed caller: `anyone` for an anonymous kind, `app` for an `app:<id>` caller. */
|
|
224
|
+
export type SurfaceReach = (typeof SURFACE_REACHES)[number];
|
|
225
|
+
/** One endpoint of a published snapshot, in the approval's words. */
|
|
226
|
+
export interface SurfaceEndpointDto {
|
|
227
|
+
id: string;
|
|
228
|
+
method: EndpointMethod;
|
|
229
|
+
path: string;
|
|
230
|
+
kind: EndpointKind;
|
|
231
|
+
reach: SurfaceReach;
|
|
232
|
+
/** Every caller kind the endpoint admits; empty for an anonymous kind. */
|
|
233
|
+
callers: string[];
|
|
234
|
+
/** What a caller must hold: `who are members` or `` with `notes.read` (on `note`) ``; null for an anonymous kind. */
|
|
235
|
+
requirement: string | null;
|
|
236
|
+
/** What else opens the endpoint: another origin, a file it answers, a body limit, a form's protection, a signature. */
|
|
237
|
+
notes: string[];
|
|
238
|
+
}
|
|
239
|
+
export interface PutAppEnvRequest {
|
|
240
|
+
domain?: string | null;
|
|
241
|
+
publicOrigin?: string | null;
|
|
242
|
+
/** Replaces the stored list; omitted keeps it, and an empty list clears it. */
|
|
243
|
+
crossOrigins?: string[];
|
|
244
|
+
triggerRef?: string | null;
|
|
245
|
+
/** Omitted keeps the stored value. Only a Zerops environment of an app with a GitHub connection qualifies. */
|
|
246
|
+
authoring?: boolean;
|
|
247
|
+
/** Set when the environment is created, `standard` when omitted; it never changes afterwards. */
|
|
248
|
+
kind?: AppEnvKind;
|
|
249
|
+
namespaceId?: string | null;
|
|
250
|
+
target: ProviderEnvelopeDto;
|
|
251
|
+
artifact: ProviderEnvelopeDto;
|
|
252
|
+
}
|
|
253
|
+
export type DeploymentNamespaceState = 'pending' | 'provisioning' | 'ready' | 'failed';
|
|
254
|
+
export interface DeploymentNamespaceDto {
|
|
255
|
+
id: string;
|
|
256
|
+
env: string;
|
|
257
|
+
provider: string;
|
|
258
|
+
exclusiveAppId: string | null;
|
|
259
|
+
target: ProviderEnvelopeDto;
|
|
260
|
+
state: DeploymentNamespaceState;
|
|
261
|
+
/**
|
|
262
|
+
* The last lifecycle failure, redacted and bounded, with its class in `lastErrorCode`: a stable
|
|
263
|
+
* identifier — a provider error code such as `insufficientPermissions`, or `internal` when the cause
|
|
264
|
+
* was not a typed provider failure — so a console can tell two failures apart without matching prose.
|
|
265
|
+
* A row written before the codes existed carries a message and no code.
|
|
266
|
+
*/
|
|
267
|
+
lastError: string | null;
|
|
268
|
+
lastErrorCode: string | null;
|
|
269
|
+
/**
|
|
270
|
+
* Present only while a `namespaces.update` is unconfirmed (`lastErrorCode` `namespaceUpdateUnconfirmed`):
|
|
271
|
+
* the target that update was moving to. Retrying `namespaces.update` with it finishes the update.
|
|
272
|
+
*/
|
|
273
|
+
unconfirmedTarget?: ProviderEnvelopeDto;
|
|
274
|
+
createdAt: number;
|
|
275
|
+
}
|
|
276
|
+
export interface DeploymentNamespaceDetailDto extends DeploymentNamespaceDto {
|
|
277
|
+
presentation: DeploymentNamespacePresentationDto | null;
|
|
278
|
+
/**
|
|
279
|
+
* The public hosts this namespace serves, with the environment that already claimed each one. Absent
|
|
280
|
+
* where the provider names none — a placement whose domains are bound out of band, or one whose entry
|
|
281
|
+
* point is not published yet.
|
|
282
|
+
*/
|
|
283
|
+
readonly hosts?: readonly DeploymentNamespaceHostDto[];
|
|
284
|
+
}
|
|
285
|
+
/** One host a namespace serves, and the application environment whose domain already takes it. */
|
|
286
|
+
export interface DeploymentNamespaceHostDto {
|
|
287
|
+
readonly host: string;
|
|
288
|
+
readonly port: number;
|
|
289
|
+
readonly takenBy?: {
|
|
290
|
+
readonly appId: string;
|
|
291
|
+
readonly environment: string;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
export interface CreateDeploymentNamespaceRequest {
|
|
295
|
+
id: string;
|
|
296
|
+
env: string;
|
|
297
|
+
exclusiveAppId?: string | null;
|
|
298
|
+
target: ProviderEnvelopeDto;
|
|
299
|
+
}
|
|
300
|
+
export interface AdoptDeploymentNamespaceRequest {
|
|
301
|
+
env: string;
|
|
302
|
+
exclusiveAppId?: string | null;
|
|
303
|
+
target: ProviderEnvelopeDto;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* A namespace's new provider target. Its payload may name only what changes; the provider merges it over
|
|
307
|
+
* the stored one. Only what the provider can change in place is accepted — on Zerops the PostgreSQL
|
|
308
|
+
* profile. A field the target does not have is a 400; any other change is a 409 that names the supported
|
|
309
|
+
* path, a new namespace under a new id.
|
|
310
|
+
*/
|
|
311
|
+
export interface UpdateDeploymentNamespaceRequest {
|
|
312
|
+
target: ProviderEnvelopeDto;
|
|
313
|
+
}
|
|
314
|
+
export interface DeploymentNamespaceFactDto {
|
|
315
|
+
readonly label: string;
|
|
316
|
+
readonly value: string;
|
|
317
|
+
/** Set when the value names a LIVE provider resource that outlives the namespace row (see removal). */
|
|
318
|
+
readonly resource?: boolean;
|
|
319
|
+
}
|
|
320
|
+
export interface DeploymentNamespacePresentationDto {
|
|
321
|
+
readonly preset: string;
|
|
322
|
+
readonly title: string;
|
|
323
|
+
readonly facts: readonly DeploymentNamespaceFactDto[];
|
|
324
|
+
readonly instructions: readonly string[];
|
|
325
|
+
}
|
|
326
|
+
export interface DeploymentNamespacePresetDto {
|
|
327
|
+
readonly id: string;
|
|
328
|
+
readonly label: string;
|
|
329
|
+
readonly description: string;
|
|
330
|
+
readonly requiresExclusiveApp: boolean;
|
|
331
|
+
}
|
|
332
|
+
export interface DeploymentNamespaceOperatorDto {
|
|
333
|
+
readonly presets: readonly DeploymentNamespacePresetDto[];
|
|
334
|
+
}
|
|
335
|
+
export interface DeploymentNamespaceListResponse {
|
|
336
|
+
items: DeploymentNamespaceDto[];
|
|
337
|
+
operator: DeploymentNamespaceOperatorDto | null;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* What removal leaves behind. Fabrika deletes no provider resource: it holds OWNER on the projects it
|
|
341
|
+
* creates ([ADR-0034](../../../docs/decisions/0034-the-control-plane-creates-the-projects-it-owns.md)),
|
|
342
|
+
* so deleting one is a destructive act on live state that stays with the operator. The removed row is
|
|
343
|
+
* returned whole — its provider target and presentation name what is now unowned.
|
|
344
|
+
*/
|
|
345
|
+
export interface RemoveDeploymentNamespaceResponse {
|
|
346
|
+
readonly removed: DeploymentNamespaceDetailDto;
|
|
347
|
+
}
|
|
348
|
+
export interface PlanDeploymentNamespaceRequest {
|
|
349
|
+
id: string;
|
|
350
|
+
env: string;
|
|
351
|
+
preset: string;
|
|
352
|
+
exclusiveAppId?: string;
|
|
353
|
+
options?: JsonValue;
|
|
354
|
+
}
|
|
355
|
+
export interface PlannedDeploymentNamespaceDto {
|
|
356
|
+
readonly id: string;
|
|
357
|
+
readonly env: string;
|
|
358
|
+
readonly exclusiveAppId?: string;
|
|
359
|
+
readonly target: ProviderEnvelopeDto;
|
|
360
|
+
}
|
|
361
|
+
export interface PlanDeploymentNamespaceResponse {
|
|
362
|
+
readonly namespace: PlannedDeploymentNamespaceDto;
|
|
363
|
+
readonly presentation: DeploymentNamespacePresentationDto;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Where an app secret's value is kept: `vault` (control's vault), `provider` (the provider's own storage),
|
|
367
|
+
* or `legacy` — a row from before secrets were vault-only, which no deploy resolves until it is set again.
|
|
368
|
+
*/
|
|
369
|
+
export type AppSecretStorage = 'vault' | 'provider' | 'legacy';
|
|
370
|
+
export interface AppSecretDto {
|
|
371
|
+
appId: string;
|
|
372
|
+
env: string | null;
|
|
373
|
+
name: string;
|
|
374
|
+
storage: AppSecretStorage;
|
|
375
|
+
/** The `vault:` ref; null for any other storage, whose stored ref control cannot vouch for. */
|
|
376
|
+
valueRef: string | null;
|
|
377
|
+
createdAt: number;
|
|
378
|
+
}
|
|
379
|
+
/** The plaintext is write-only: control seals it and stores only the resulting ref. */
|
|
380
|
+
export interface PutAppSecretRequest {
|
|
381
|
+
name: string;
|
|
382
|
+
value: string;
|
|
383
|
+
env?: string | null;
|
|
384
|
+
}
|
|
385
|
+
export interface AppVarDto {
|
|
386
|
+
appId: string;
|
|
387
|
+
env: string | null;
|
|
388
|
+
name: string;
|
|
389
|
+
value: string;
|
|
390
|
+
createdAt: number;
|
|
391
|
+
}
|
|
392
|
+
export interface PutAppVarRequest {
|
|
393
|
+
name: string;
|
|
394
|
+
value: string;
|
|
395
|
+
env?: string | null;
|
|
396
|
+
}
|
|
397
|
+
export interface RegisterAppRequest extends AppOptionalFields {
|
|
398
|
+
id: string;
|
|
399
|
+
repoUrl: string;
|
|
400
|
+
env: string;
|
|
401
|
+
domain?: string | null;
|
|
402
|
+
publicOrigin?: string | null;
|
|
403
|
+
/** The environment's cross-origin list (ADR-0022); omitted lists none. */
|
|
404
|
+
crossOrigins?: string[];
|
|
405
|
+
triggerRef?: string | null;
|
|
406
|
+
namespaceId?: string | null;
|
|
407
|
+
target: ProviderEnvelopeDto;
|
|
408
|
+
artifact: ProviderEnvelopeDto;
|
|
409
|
+
}
|
|
410
|
+
export interface RegisterAppResponse {
|
|
411
|
+
app: AppDto;
|
|
412
|
+
env: AppEnvDto;
|
|
413
|
+
}
|
|
414
|
+
export type RunTrigger = 'webhook' | 'manual' | 'poll';
|
|
415
|
+
/** `awaiting_approval`: the run widens access on a protected environment and waits for a human (ADR-0050). */
|
|
416
|
+
export type RunStatus = 'pending' | 'running' | 'awaiting_approval' | 'succeeded' | 'failed';
|
|
417
|
+
export interface RunDto {
|
|
418
|
+
id: string;
|
|
419
|
+
appId: string;
|
|
420
|
+
env: string;
|
|
421
|
+
ref: string;
|
|
422
|
+
commitSha: string | null;
|
|
423
|
+
trigger: RunTrigger;
|
|
424
|
+
/** Who created the run: `user:<id>`, `service:<id>`, `oauth:<id>` (an MCP client acting for a user), `webhook:<connection>` or `poll`. */
|
|
425
|
+
actor: string | null;
|
|
426
|
+
status: RunStatus;
|
|
427
|
+
exitCode: number | null;
|
|
428
|
+
externalRunId: string | null;
|
|
429
|
+
logKey: string | null;
|
|
430
|
+
createdAt: number;
|
|
431
|
+
startedAt: number | null;
|
|
432
|
+
finishedAt: number | null;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* One plain-language line of an access change. `effect` is `widens` when it can grant access the baseline did not,
|
|
436
|
+
* `narrows` when it can only take access away, and `neutral` when it admits no one new and takes nothing away.
|
|
437
|
+
* `review: 'closer'` marks a step off the paved road (declared reach, database code) or a change the diff cannot classify.
|
|
438
|
+
*/
|
|
439
|
+
export interface AccessChangeDto {
|
|
440
|
+
effect: 'widens' | 'narrows' | 'neutral';
|
|
441
|
+
line: string;
|
|
442
|
+
review?: 'closer';
|
|
443
|
+
/** The line opens an endpoint to the pages on the origins the environment lists; `ApprovalDto.crossOrigins` names them. */
|
|
444
|
+
environmentOrigins?: true;
|
|
445
|
+
}
|
|
446
|
+
/** A run's access change against its environment's active snapshot (ADR-0050 §3). */
|
|
447
|
+
export interface ApprovalDto {
|
|
448
|
+
run: RunDto;
|
|
449
|
+
/** `none`: no line. `no-widening`: lines that narrow or leave access unchanged; it publishes at once. */
|
|
450
|
+
outcome: 'none' | 'no-widening' | 'widening';
|
|
451
|
+
changes: AccessChangeDto[];
|
|
452
|
+
/** The digest of the run's snapshot and of the active one it was compared with: an approval is bound to both. */
|
|
453
|
+
candidateDigest: string;
|
|
454
|
+
baselineDigest: string;
|
|
455
|
+
/** The published run the change was compared with; null when nothing was published. */
|
|
456
|
+
baselineRunId: string | null;
|
|
457
|
+
protected: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* The environment's cross-origin list as it stands now: the pages an endpoint the contract opens to the environment's
|
|
460
|
+
* list answers. It is set on the environment, takes effect at once, and no approval covers it (ADR-0050). Only on one
|
|
461
|
+
* approval read while the run waits for a decision, its environment exists and a line has `environmentOrigins`;
|
|
462
|
+
* empty when the environment lists none.
|
|
463
|
+
*/
|
|
464
|
+
crossOrigins?: string[];
|
|
465
|
+
/** The human who approved it, once one did. */
|
|
466
|
+
approval: {
|
|
467
|
+
principalId: string;
|
|
468
|
+
label: string;
|
|
469
|
+
approvedAt: number;
|
|
470
|
+
} | null;
|
|
471
|
+
}
|
|
472
|
+
/** Approve or refuse one parked run. The digests are the ones the approver read; a reclassified run refuses them. */
|
|
473
|
+
export interface CompleteApprovalRequest {
|
|
474
|
+
runId: string;
|
|
475
|
+
decision: 'approve' | 'reject';
|
|
476
|
+
candidateDigest: string;
|
|
477
|
+
baselineDigest: string;
|
|
478
|
+
}
|
|
479
|
+
/** Change whether a widening waits for approval on one environment (ADR-0050 §4). */
|
|
480
|
+
export interface SetEnvironmentProtectionRequest {
|
|
481
|
+
appId: string;
|
|
482
|
+
env: string;
|
|
483
|
+
protected: boolean;
|
|
484
|
+
}
|
|
485
|
+
export interface TriggerDeployRequest {
|
|
486
|
+
appId: string;
|
|
487
|
+
env: string;
|
|
488
|
+
ref?: string;
|
|
489
|
+
}
|
|
490
|
+
export interface RunTailResponse {
|
|
491
|
+
lines: RunLogLine[];
|
|
492
|
+
cursor: number;
|
|
493
|
+
done: boolean;
|
|
494
|
+
status: RunStatus;
|
|
495
|
+
}
|
|
496
|
+
export interface RunLogResponse {
|
|
497
|
+
lines: RunLogLine[];
|
|
498
|
+
status?: RunStatus;
|
|
499
|
+
}
|
|
500
|
+
export type { AdoptNamespaceInput, AppEnvironmentInput, AppIdInput, AppNamedValueInput, ControlRpcContract, CreateAppRequest, DescribeConnectorRequest, GitHubSourceConnectionInput, GitHubSourceConnectionRpcContract, NamespaceIdInput, OkResponse, PutAppEnvironmentInput, PutAppSecretInput, PutAppVarInput, RotateTokenKeyResponse, RunIdInput, RunListInput, SecretValueInput, SecretValueResponse, TailRunInput, UpdateNamespaceInput, } from './rpc.js';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** The mail relay as the console reads and steers it. */
|
|
2
|
+
/**
|
|
3
|
+
* `held` waits for a person, `queued` for the dispatcher, `sending` is one attempt a dispatcher claimed. `sent`,
|
|
4
|
+
* `failed` (not sent), `unknown` (may have left) and `dropped` are final.
|
|
5
|
+
*/
|
|
6
|
+
export type MailMessageState = 'held' | 'queued' | 'sending' | 'sent' | 'failed' | 'unknown' | 'dropped';
|
|
7
|
+
export type MailRuleAction = 'pass' | 'hold' | 'drop';
|
|
8
|
+
/** A relayed message's metadata, behind `mail.read`. It carries no recipient, subject or body. */
|
|
9
|
+
export interface MailMessageDto {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
/** `<app>@<env>`, or `installation:<service>` for an installation sender. */
|
|
12
|
+
readonly sender: string;
|
|
13
|
+
readonly recipientDomain: string;
|
|
14
|
+
readonly state: MailMessageState;
|
|
15
|
+
/** The rule that decided the message at acceptance; null when none did. */
|
|
16
|
+
readonly ruleId: string | null;
|
|
17
|
+
/** Who released or dropped it, or requeued it once it was final. */
|
|
18
|
+
readonly decidedBy: string | null;
|
|
19
|
+
readonly attempts: number;
|
|
20
|
+
readonly nextAttemptAt: number | null;
|
|
21
|
+
readonly providerMessageId: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The `EmailDeliveryErrorCode` of the last failed attempt, or `dispatch_interrupted`: the dispatcher stopped after it
|
|
24
|
+
* claimed the attempt, before it recorded an outcome.
|
|
25
|
+
*/
|
|
26
|
+
readonly errorCode: string | null;
|
|
27
|
+
readonly createdAt: number;
|
|
28
|
+
readonly updatedAt: number;
|
|
29
|
+
}
|
|
30
|
+
/** One attachment as the console shows it: its name, type and size, never its bytes. */
|
|
31
|
+
export interface MailAttachmentDto {
|
|
32
|
+
readonly filename: string;
|
|
33
|
+
readonly contentType: string;
|
|
34
|
+
readonly bytes: number;
|
|
35
|
+
}
|
|
36
|
+
/** What the recipient sees, behind `mail.content.read`. */
|
|
37
|
+
export interface MailMessageContentDto {
|
|
38
|
+
readonly to: string;
|
|
39
|
+
readonly subject: string;
|
|
40
|
+
readonly text: string;
|
|
41
|
+
readonly html?: string;
|
|
42
|
+
readonly replyTo?: string;
|
|
43
|
+
readonly fromName?: string;
|
|
44
|
+
readonly unsubscribeUrl?: string;
|
|
45
|
+
readonly attachments: readonly MailAttachmentDto[];
|
|
46
|
+
}
|
|
47
|
+
/** `withheld`: the caller does not hold `mail.content.read`. `purged`: the relay no longer keeps it. */
|
|
48
|
+
export type MailContentDto = {
|
|
49
|
+
readonly kind: 'withheld';
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: 'purged';
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: 'present';
|
|
54
|
+
readonly message: MailMessageContentDto;
|
|
55
|
+
};
|
|
56
|
+
export interface MailMessageDetailDto extends MailMessageDto {
|
|
57
|
+
readonly content: MailContentDto;
|
|
58
|
+
/** Whether a requeue would send it again now: `failed`, or `unknown` over an idempotent transport, with its content kept. */
|
|
59
|
+
readonly requeueable: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface MailMessageListInput {
|
|
62
|
+
readonly state?: MailMessageState;
|
|
63
|
+
/** One sender: `<app>@<env>` or `installation:<service>`. */
|
|
64
|
+
readonly scope?: string;
|
|
65
|
+
readonly cursor?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface MailMessageIdInput {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
}
|
|
70
|
+
export interface MailRuleDto {
|
|
71
|
+
readonly id: string;
|
|
72
|
+
/** `*` or `<app>@<env>`. */
|
|
73
|
+
readonly scope: string;
|
|
74
|
+
/** `*` or a lowercase recipient domain. */
|
|
75
|
+
readonly domain: string;
|
|
76
|
+
readonly action: MailRuleAction;
|
|
77
|
+
readonly createdAt: number;
|
|
78
|
+
readonly updatedAt: number;
|
|
79
|
+
}
|
|
80
|
+
/** Sets the action of the rule of `scope` and `domain`, creating it when there is none. */
|
|
81
|
+
export interface SetMailRuleInput {
|
|
82
|
+
readonly scope: string;
|
|
83
|
+
readonly domain: string;
|
|
84
|
+
readonly action: MailRuleAction;
|
|
85
|
+
}
|
|
86
|
+
export interface MailRuleIdInput {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { RpcProcedureContract } from '@fabrika/app';
|
|
2
|
+
import type { ExportDescription } from '@fabrika/auth-core';
|
|
3
|
+
import type { BuilderConnectionReceiptDto, CreateBuilderConnectionReceiptRequest, GetBuilderConnectionReceiptRequest } from './builder-connections.js';
|
|
4
|
+
import type { ApproveDeviceAuthorizationResult, BuilderPairingProofRequest, DenyDeviceAuthorizationResult, InspectDeviceAuthorizationResult, ListOwnBuilderPairingsRequest, ListOwnDeviceAuthorizationsResult, RevokeBuilderPairingRequest, RevokeKeyResult } from './builder-pairing.js';
|
|
5
|
+
import type { AdoptDeploymentNamespaceRequest, AppDto, AppEnvDto, ApprovalDto, AppSecretDto, AppVarDto, CompleteApprovalRequest, ConsoleAccessDto, CreateDeploymentNamespaceRequest, CursorList, DeploymentNamespaceDetailDto, DeploymentNamespaceListResponse, GitHubSourceConnectionListInput, GitHubSourceConnectionListResponse, GitHubSourceConnectionStatusDto, InstallationDto, ListResponse, PlanDeploymentNamespaceRequest, PlanDeploymentNamespaceResponse, PutAppEnvRequest, PutAppSecretRequest, PutAppVarRequest, RegisterAppRequest, RegisterAppResponse, RemoveDeploymentNamespaceResponse, RunDto, RunLogResponse, RunTailResponse, SetEnvironmentProtectionRequest, StartGitHubSourceConnectionRequest, StartGitHubSourceConnectionResponse, TriggerDeployRequest, UpdateAppRequest, UpdateDeploymentNamespaceRequest } from './index.js';
|
|
6
|
+
import type { MailMessageDetailDto, MailMessageDto, MailMessageIdInput, MailMessageListInput, MailRuleDto, MailRuleIdInput, SetMailRuleInput } from './mail.js';
|
|
7
|
+
type RpcProcedure<TInput, TOutput> = RpcProcedureContract<TInput, TOutput>;
|
|
8
|
+
export interface AppIdInput {
|
|
9
|
+
readonly appId: string;
|
|
10
|
+
}
|
|
11
|
+
/** Whether a rotation was recorded: `false` while the environment holds no token key. */
|
|
12
|
+
export interface RotateTokenKeyResponse {
|
|
13
|
+
readonly requested: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface AppEnvironmentInput extends AppIdInput {
|
|
16
|
+
readonly env: string;
|
|
17
|
+
}
|
|
18
|
+
export interface AppNamedValueInput extends AppIdInput {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly env?: string | null;
|
|
21
|
+
}
|
|
22
|
+
export interface CreateAppRequest extends UpdateAppRequest {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly repoUrl: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PutAppEnvironmentInput extends AppEnvironmentInput {
|
|
27
|
+
readonly environment: PutAppEnvRequest;
|
|
28
|
+
}
|
|
29
|
+
export interface PutAppSecretInput extends AppIdInput {
|
|
30
|
+
readonly secret: PutAppSecretRequest;
|
|
31
|
+
}
|
|
32
|
+
export interface PutAppVarInput extends AppIdInput {
|
|
33
|
+
readonly variable: PutAppVarRequest;
|
|
34
|
+
}
|
|
35
|
+
export interface SecretValueInput extends AppNamedValueInput {
|
|
36
|
+
readonly value: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SecretValueResponse {
|
|
39
|
+
readonly ok: boolean;
|
|
40
|
+
readonly valueRef?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface OkResponse {
|
|
43
|
+
readonly ok: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface NamespaceIdInput {
|
|
46
|
+
readonly namespaceId: string;
|
|
47
|
+
}
|
|
48
|
+
export interface AdoptNamespaceInput extends NamespaceIdInput {
|
|
49
|
+
readonly namespace: AdoptDeploymentNamespaceRequest;
|
|
50
|
+
}
|
|
51
|
+
export interface UpdateNamespaceInput extends NamespaceIdInput {
|
|
52
|
+
readonly namespace: UpdateDeploymentNamespaceRequest;
|
|
53
|
+
}
|
|
54
|
+
export interface RunListInput {
|
|
55
|
+
readonly appId?: string;
|
|
56
|
+
readonly env?: string;
|
|
57
|
+
readonly before?: string;
|
|
58
|
+
readonly limit?: number;
|
|
59
|
+
}
|
|
60
|
+
export interface RunIdInput {
|
|
61
|
+
readonly runId: string;
|
|
62
|
+
}
|
|
63
|
+
export interface TailRunInput extends RunIdInput {
|
|
64
|
+
readonly after?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface GitHubSourceConnectionInput {
|
|
67
|
+
readonly connectionId: string;
|
|
68
|
+
}
|
|
69
|
+
/** Provider-neutral admin seam. A statically composed provider implements these GitHub operations. */
|
|
70
|
+
export interface GitHubSourceConnectionRpcContract {
|
|
71
|
+
list: RpcProcedure<GitHubSourceConnectionListInput, GitHubSourceConnectionListResponse>;
|
|
72
|
+
start: RpcProcedure<StartGitHubSourceConnectionRequest, StartGitHubSourceConnectionResponse>;
|
|
73
|
+
verifyInstallation: RpcProcedure<GitHubSourceConnectionInput, GitHubSourceConnectionStatusDto>;
|
|
74
|
+
repair: RpcProcedure<GitHubSourceConnectionInput, GitHubSourceConnectionStatusDto>;
|
|
75
|
+
reconcile: RpcProcedure<GitHubSourceConnectionInput, GitHubSourceConnectionStatusDto>;
|
|
76
|
+
}
|
|
77
|
+
/** Portable Delivery control API shared by browser and machine callers. */
|
|
78
|
+
export interface ControlRpcContract {
|
|
79
|
+
installation: RpcProcedure<void, InstallationDto>;
|
|
80
|
+
consoleAccess: RpcProcedure<void, ConsoleAccessDto>;
|
|
81
|
+
builderPairing: {
|
|
82
|
+
inspect: RpcProcedure<BuilderPairingProofRequest, InspectDeviceAuthorizationResult>;
|
|
83
|
+
approve: RpcProcedure<BuilderPairingProofRequest, ApproveDeviceAuthorizationResult>;
|
|
84
|
+
deny: RpcProcedure<BuilderPairingProofRequest, DenyDeviceAuthorizationResult>;
|
|
85
|
+
listOwn: RpcProcedure<ListOwnBuilderPairingsRequest, ListOwnDeviceAuthorizationsResult>;
|
|
86
|
+
revoke: RpcProcedure<RevokeBuilderPairingRequest, RevokeKeyResult>;
|
|
87
|
+
};
|
|
88
|
+
builderConnections: {
|
|
89
|
+
createReceipt: RpcProcedure<CreateBuilderConnectionReceiptRequest, BuilderConnectionReceiptDto>;
|
|
90
|
+
getReceipt: RpcProcedure<GetBuilderConnectionReceiptRequest, BuilderConnectionReceiptDto>;
|
|
91
|
+
};
|
|
92
|
+
sourceConnection: GitHubSourceConnectionRpcContract;
|
|
93
|
+
apps: {
|
|
94
|
+
list: RpcProcedure<void, ListResponse<AppDto>>;
|
|
95
|
+
get: RpcProcedure<AppIdInput, AppDto>;
|
|
96
|
+
create: RpcProcedure<CreateAppRequest, AppDto>;
|
|
97
|
+
update: RpcProcedure<AppIdInput & {
|
|
98
|
+
app: UpdateAppRequest;
|
|
99
|
+
}, AppDto>;
|
|
100
|
+
delete: RpcProcedure<AppIdInput, OkResponse>;
|
|
101
|
+
environments: {
|
|
102
|
+
list: RpcProcedure<AppIdInput, ListResponse<AppEnvDto>>;
|
|
103
|
+
put: RpcProcedure<PutAppEnvironmentInput, AppEnvDto>;
|
|
104
|
+
delete: RpcProcedure<AppEnvironmentInput, OkResponse>;
|
|
105
|
+
/** Human user principals with `access.approve` only, from the console (ADR-0050 §4). */
|
|
106
|
+
protect: RpcProcedure<SetEnvironmentProtectionRequest, AppEnvDto>;
|
|
107
|
+
/** The environment's next deploy retires the key its signed tokens are signed with and signs with a new one. */
|
|
108
|
+
rotateTokenKey: RpcProcedure<AppEnvironmentInput, RotateTokenKeyResponse>;
|
|
109
|
+
};
|
|
110
|
+
secrets: {
|
|
111
|
+
list: RpcProcedure<AppIdInput, ListResponse<AppSecretDto>>;
|
|
112
|
+
put: RpcProcedure<PutAppSecretInput, AppSecretDto>;
|
|
113
|
+
/** Removes the value where it is stored (vault or provider), then the row; a failed value delete keeps the row. */
|
|
114
|
+
delete: RpcProcedure<AppNamedValueInput, OkResponse>;
|
|
115
|
+
};
|
|
116
|
+
variables: {
|
|
117
|
+
list: RpcProcedure<AppIdInput, ListResponse<AppVarDto>>;
|
|
118
|
+
put: RpcProcedure<PutAppVarInput, AppVarDto>;
|
|
119
|
+
delete: RpcProcedure<AppNamedValueInput, OkResponse>;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
vault: {
|
|
123
|
+
set: RpcProcedure<SecretValueInput, SecretValueResponse>;
|
|
124
|
+
rotate: RpcProcedure<SecretValueInput, OkResponse>;
|
|
125
|
+
/** The same operation as `apps.secrets.delete`. */
|
|
126
|
+
delete: RpcProcedure<AppNamedValueInput, OkResponse>;
|
|
127
|
+
};
|
|
128
|
+
namespaces: {
|
|
129
|
+
list: RpcProcedure<void, DeploymentNamespaceListResponse>;
|
|
130
|
+
get: RpcProcedure<NamespaceIdInput, DeploymentNamespaceDetailDto>;
|
|
131
|
+
plan: RpcProcedure<PlanDeploymentNamespaceRequest, PlanDeploymentNamespaceResponse>;
|
|
132
|
+
create: RpcProcedure<CreateDeploymentNamespaceRequest, DeploymentNamespaceDetailDto>;
|
|
133
|
+
adopt: RpcProcedure<AdoptNamespaceInput, DeploymentNamespaceDetailDto>;
|
|
134
|
+
reconcile: RpcProcedure<NamespaceIdInput, DeploymentNamespaceDetailDto>;
|
|
135
|
+
/** Change a ready namespace in place, synchronously (backlog 79); also the retry after an unconfirmed update. */
|
|
136
|
+
update: RpcProcedure<UpdateNamespaceInput, DeploymentNamespaceDetailDto>;
|
|
137
|
+
/** Free a namespace id. Refused while any app environment is registered in it (backlog 73). */
|
|
138
|
+
remove: RpcProcedure<NamespaceIdInput, RemoveDeploymentNamespaceResponse>;
|
|
139
|
+
};
|
|
140
|
+
runs: {
|
|
141
|
+
list: RpcProcedure<RunListInput, CursorList<RunDto>>;
|
|
142
|
+
/** Per app environment, its newest finished run when that run failed: a later finished run supersedes a failure. */
|
|
143
|
+
latestFailures: RpcProcedure<void, ListResponse<RunDto>>;
|
|
144
|
+
get: RpcProcedure<RunIdInput, RunDto>;
|
|
145
|
+
log: RpcProcedure<RunIdInput, RunLogResponse>;
|
|
146
|
+
tail: RpcProcedure<TailRunInput, RunTailResponse>;
|
|
147
|
+
cancel: RpcProcedure<RunIdInput, RunDto>;
|
|
148
|
+
};
|
|
149
|
+
/** Runs whose access change waits for a human (ADR-0050 §5), behind `access.approve`. */
|
|
150
|
+
approvals: {
|
|
151
|
+
list: RpcProcedure<void, ListResponse<ApprovalDto>>;
|
|
152
|
+
get: RpcProcedure<RunIdInput, ApprovalDto>;
|
|
153
|
+
/** A human user principal, from the console's own origin; no key, service or OAuth token completes one. */
|
|
154
|
+
complete: RpcProcedure<CompleteApprovalRequest, ApprovalDto>;
|
|
155
|
+
};
|
|
156
|
+
deploy: RpcProcedure<TriggerDeployRequest, RunDto>;
|
|
157
|
+
register: RpcProcedure<RegisterAppRequest, RegisterAppResponse>;
|
|
158
|
+
/** What a consumer vendors (`fabrika connect add`): the export its owner's environment approved for it. */
|
|
159
|
+
connectors: {
|
|
160
|
+
describe: RpcProcedure<DescribeConnectorRequest, ExportDescription>;
|
|
161
|
+
};
|
|
162
|
+
/** The mail relay: `mail.read`, `mail.content.read` and `mail.manage`. */
|
|
163
|
+
mail: {
|
|
164
|
+
messages: {
|
|
165
|
+
list: RpcProcedure<MailMessageListInput, CursorList<MailMessageDto>>;
|
|
166
|
+
/** The content only with `mail.content.read`. */
|
|
167
|
+
get: RpcProcedure<MailMessageIdInput, MailMessageDetailDto>;
|
|
168
|
+
/** A held message only. */
|
|
169
|
+
release: RpcProcedure<MailMessageIdInput, MailMessageDto>;
|
|
170
|
+
/** A held message only. */
|
|
171
|
+
drop: RpcProcedure<MailMessageIdInput, MailMessageDto>;
|
|
172
|
+
/** A `failed` message, or an `unknown` one over an idempotent transport, whose content is kept. */
|
|
173
|
+
requeue: RpcProcedure<MailMessageIdInput, MailMessageDto>;
|
|
174
|
+
};
|
|
175
|
+
rules: {
|
|
176
|
+
list: RpcProcedure<void, ListResponse<MailRuleDto>>;
|
|
177
|
+
set: RpcProcedure<SetMailRuleInput, MailRuleDto>;
|
|
178
|
+
remove: RpcProcedure<MailRuleIdInput, OkResponse>;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* One export version of `app` as the environment `env` approved it, read for its consumer `consumer`. Unknown, not
|
|
184
|
+
* approved, or not exported to that consumer: 404 alike.
|
|
185
|
+
*/
|
|
186
|
+
export interface DescribeConnectorRequest {
|
|
187
|
+
readonly consumer: string;
|
|
188
|
+
readonly env: string;
|
|
189
|
+
readonly app: string;
|
|
190
|
+
readonly export: string;
|
|
191
|
+
readonly version: number;
|
|
192
|
+
}
|
|
193
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GITHUB_SOURCE_CONNECTION_DEFAULT_PAGE_SIZE = 50;
|
|
3
|
+
export declare const GITHUB_SOURCE_CONNECTION_MAX_PAGE_SIZE = 100;
|
|
4
|
+
export declare const GITHUB_SOURCE_CONNECTION_PAGE_CURSOR_MAX_LENGTH = 512;
|
|
5
|
+
export declare const githubSourceConnectionListInputSchema: z.ZodEffects<z.ZodObject<{
|
|
6
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
7
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
limit?: number | undefined;
|
|
10
|
+
cursor?: string | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
limit?: number | undefined;
|
|
13
|
+
cursor?: string | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
limit?: number | undefined;
|
|
16
|
+
cursor?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
limit?: number | undefined;
|
|
19
|
+
cursor?: string | undefined;
|
|
20
|
+
}>;
|