@phpsandbox/sdk 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/dist/browser/phpsandbox-sdk.esm.js +18 -29
- package/dist/browser/phpsandbox-sdk.esm.min.js +23 -23
- package/dist/browser/phpsandbox-sdk.iife.js +18 -29
- package/dist/browser/phpsandbox-sdk.iife.min.js +8 -8
- package/dist/integrations/account.d.ts +1 -0
- package/dist/publication/instance.d.ts +0 -1
- package/dist/publication/instance.js +0 -9
- package/dist/publication/notebook.d.ts +10 -11
- package/dist/publication/notebook.js +20 -18
- package/dist/publication/types.d.ts +208 -116
- package/package.json +1 -1
|
@@ -21,7 +21,6 @@ export declare class PublicationInstance<TProvider extends PublicationProviderNa
|
|
|
21
21
|
refresh(): Promise<PublicationInstance<TProvider>>;
|
|
22
22
|
/** Start or reattach to the current release stream without queuing another release. */
|
|
23
23
|
follow(): PublicationRun<TProvider>;
|
|
24
|
-
publish(): Promise<PublicationRun<TProvider>>;
|
|
25
24
|
destroy(options?: PublicationDestroyOptions): Promise<void>;
|
|
26
25
|
wait(options?: {
|
|
27
26
|
intervalMs?: number;
|
|
@@ -36,15 +36,6 @@ export class PublicationInstance {
|
|
|
36
36
|
follow() {
|
|
37
37
|
return new PublicationRun(this, this.client).start();
|
|
38
38
|
}
|
|
39
|
-
async publish() {
|
|
40
|
-
if (!this.notebookId) {
|
|
41
|
-
throw new PHPSandboxError('Publishing requires a notebook-scoped publication instance.');
|
|
42
|
-
}
|
|
43
|
-
const response = await this.client.post(`/notebook/${encodeURIComponent(this.notebookId)}/publication`);
|
|
44
|
-
const run = new PublicationRun(new PublicationInstance(response.data, this.client, this.notebookId), this.client);
|
|
45
|
-
run.start();
|
|
46
|
-
return run;
|
|
47
|
-
}
|
|
48
39
|
async destroy(options = {}) {
|
|
49
40
|
const query = options.deleteResources ? '?deleteResources=1' : '';
|
|
50
41
|
await this.client.delete(`/publications/${encodeURIComponent(this.data.id)}${query}`);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Client } from '../index.js';
|
|
2
2
|
import { PublicationInstance } from './instance.js';
|
|
3
|
-
import { PublicationRun } from './run.js';
|
|
4
3
|
import { PublicationResources } from './resources.js';
|
|
5
|
-
import type {
|
|
4
|
+
import type { PublicationProjectConfiguration, PublicationConfigurationUpdate, PublicationApplicationPlan, PublicationApplicationPlanInput, PublicationApplicationPublishInput, PublicationApplicationPublishResult, PublicationApplicationData, PublicationReadiness, PublicationResourceCatalog } from './types.js';
|
|
6
5
|
export declare class NotebookPublication {
|
|
7
6
|
private readonly notebookId;
|
|
8
7
|
private readonly client;
|
|
@@ -11,14 +10,16 @@ export declare class NotebookPublication {
|
|
|
11
10
|
private get path();
|
|
12
11
|
current(): Promise<PublicationInstance | null>;
|
|
13
12
|
readiness(): Promise<PublicationReadiness>;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
13
|
+
/** Inspect saved configuration and the actual inventory, including removed and legacy apps. */
|
|
14
|
+
configuration(): Promise<PublicationProjectConfiguration>;
|
|
15
|
+
/** Explicit operations preserve omitted apps. Removals never stop deployments or delete resource data. */
|
|
16
|
+
updateConfiguration(input: PublicationConfigurationUpdate): Promise<PublicationProjectConfiguration>;
|
|
17
|
+
/** Review all or selected configured apps at an exact saved revision. */
|
|
18
|
+
prepare(input: PublicationApplicationPlanInput): Promise<PublicationApplicationPlan>;
|
|
19
|
+
/** Publish the exact app selection in a server-owned review. */
|
|
20
|
+
publish(input: PublicationApplicationPublishInput): Promise<PublicationApplicationPublishResult>;
|
|
20
21
|
application(applicationId: string): Promise<PublicationApplicationData>;
|
|
21
|
-
/** Retry
|
|
22
|
+
/** Retry failed apps and pending route attachments while preserving running releases. */
|
|
22
23
|
retryApplication(applicationId: string): Promise<PublicationApplicationData>;
|
|
23
24
|
destroyApplication(applicationId: string, options?: {
|
|
24
25
|
deleteResources?: boolean;
|
|
@@ -26,6 +27,4 @@ export declare class NotebookPublication {
|
|
|
26
27
|
private startApplicationRuns;
|
|
27
28
|
catalog(provider: 'laravel-cloud' | 'cloudflare-containers'): Promise<PublicationResourceCatalog>;
|
|
28
29
|
catalog(provider: 'ssh-server', serverId: string): Promise<PublicationResourceCatalog>;
|
|
29
|
-
/** Core validates the plan, prepares source and executes publishing. */
|
|
30
|
-
publish(input?: PlannedPublishInput): Promise<PublicationRun>;
|
|
31
30
|
}
|
|
@@ -26,24 +26,29 @@ export class NotebookPublication {
|
|
|
26
26
|
async readiness() {
|
|
27
27
|
return (await this.client.get(`${this.path}/publication/readiness`)).data;
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/** Inspect saved configuration and the actual inventory, including removed and legacy apps. */
|
|
30
|
+
async configuration() {
|
|
31
|
+
return (await this.client.get(`${this.path}/publication/configuration`)).data;
|
|
32
|
+
}
|
|
33
|
+
/** Explicit operations preserve omitted apps. Removals never stop deployments or delete resource data. */
|
|
34
|
+
async updateConfiguration(input) {
|
|
35
|
+
return (await this.client.patch(`${this.path}/publication/configuration`, input)).data;
|
|
36
|
+
}
|
|
37
|
+
/** Review all or selected configured apps at an exact saved revision. */
|
|
30
38
|
async prepare(input) {
|
|
31
39
|
return (await this.client.post(`${this.path}/publication/plan`, input)).data;
|
|
32
40
|
}
|
|
33
|
-
/**
|
|
34
|
-
async
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
async publishApplication(input) {
|
|
39
|
-
const application = (await this.client.post(`${this.path}/publication/application`, input)).data;
|
|
40
|
-
this.startApplicationRuns(application);
|
|
41
|
+
/** Publish the exact app selection in a server-owned review. */
|
|
42
|
+
async publish(input) {
|
|
43
|
+
const application = (await this.client.post(`${this.path}/publication`, input)).data;
|
|
44
|
+
if (!('confirmationRequired' in application))
|
|
45
|
+
this.startApplicationRuns(application);
|
|
41
46
|
return application;
|
|
42
47
|
}
|
|
43
48
|
async application(applicationId) {
|
|
44
49
|
return (await this.client.get(`${this.path}/publication/application/${encodeURIComponent(applicationId)}`)).data;
|
|
45
50
|
}
|
|
46
|
-
/** Retry
|
|
51
|
+
/** Retry failed apps and pending route attachments while preserving running releases. */
|
|
47
52
|
async retryApplication(applicationId) {
|
|
48
53
|
const application = (await this.client.post(`${this.path}/publication/application/${encodeURIComponent(applicationId)}/retry`, {})).data;
|
|
49
54
|
this.startApplicationRuns(application);
|
|
@@ -54,10 +59,12 @@ export class NotebookPublication {
|
|
|
54
59
|
await this.client.delete(`${this.path}/publication/application/${encodeURIComponent(applicationId)}${query}`);
|
|
55
60
|
}
|
|
56
61
|
startApplicationRuns(application) {
|
|
57
|
-
for (const
|
|
58
|
-
if (!
|
|
62
|
+
for (const app of application.apps) {
|
|
63
|
+
if (!(application.selectedAppIds ?? []).includes(app.appId))
|
|
64
|
+
continue;
|
|
65
|
+
if (!['pending', 'queued', 'building', 'deploying'].includes(app.publication.status))
|
|
59
66
|
continue;
|
|
60
|
-
new PublicationRun(new PublicationInstance(
|
|
67
|
+
new PublicationRun(new PublicationInstance(app.publication, this.client, this.notebookId), this.client).start();
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
70
|
async catalog(provider, serverId) {
|
|
@@ -68,9 +75,4 @@ export class NotebookPublication {
|
|
|
68
75
|
return (await this.client.get(`${this.path}/publication/catalog?${query}`))
|
|
69
76
|
.data;
|
|
70
77
|
}
|
|
71
|
-
/** Core validates the plan, prepares source and executes publishing. */
|
|
72
|
-
async publish(input) {
|
|
73
|
-
const response = await this.client.post(`${this.path}/publication`, input);
|
|
74
|
-
return new PublicationRun(new PublicationInstance(response.data, this.client, this.notebookId), this.client).start();
|
|
75
|
-
}
|
|
76
78
|
}
|
|
@@ -52,6 +52,13 @@ export interface PublicationReadiness {
|
|
|
52
52
|
productionVariables: string[];
|
|
53
53
|
missingVariables: string[];
|
|
54
54
|
warnings: string[];
|
|
55
|
+
configuration?: PublicationConfigurationField[];
|
|
56
|
+
defaultBuild?: 'laravel' | 'dockerfile' | 'unresolved' | null;
|
|
57
|
+
}
|
|
58
|
+
export interface PublicationConfigurationField {
|
|
59
|
+
name: string;
|
|
60
|
+
requirement: 'required' | 'optional' | 'platform';
|
|
61
|
+
source: string;
|
|
55
62
|
}
|
|
56
63
|
export type PublicationResourceMode = 'none' | 'create' | 'reuse' | 'external' | 'enable';
|
|
57
64
|
export interface PublicationResourceSelection {
|
|
@@ -62,18 +69,6 @@ export interface PublicationResourceSelection {
|
|
|
62
69
|
size?: string;
|
|
63
70
|
config?: Record<string, string | number | boolean | null>;
|
|
64
71
|
}
|
|
65
|
-
export type PublicationPlanProviderInput<TName extends PublicationProviderName = PublicationProviderName> = {
|
|
66
|
-
[Name in TName]: {
|
|
67
|
-
name: Name;
|
|
68
|
-
} & Partial<PublicationProviderInputs[Name]>;
|
|
69
|
-
}[TName];
|
|
70
|
-
export interface PublicationPlanInput<TName extends PublicationProviderName = PublicationProviderName> {
|
|
71
|
-
slug?: string;
|
|
72
|
-
provider: PublicationPlanProviderInput<TName>;
|
|
73
|
-
requirements?: PublicationRequirement[];
|
|
74
|
-
resources?: Partial<Record<PublicationResourceKind, PublicationResourceSelection>>;
|
|
75
|
-
}
|
|
76
|
-
export type PlannedPublishInput = PublishInput & Pick<PublicationPlanInput, 'requirements' | 'resources'>;
|
|
77
72
|
export interface PublicationAccessCapabilities {
|
|
78
73
|
routing: 'platform' | 'provider';
|
|
79
74
|
protection: boolean;
|
|
@@ -82,8 +77,8 @@ export interface PublicationAccessCapabilities {
|
|
|
82
77
|
export interface PublicationCapabilities {
|
|
83
78
|
source: 'git' | 'workspace';
|
|
84
79
|
sourceProviders?: string[];
|
|
85
|
-
buildModes?: Array<
|
|
86
|
-
|
|
80
|
+
buildModes?: Array<PublicationAppBuild['mode']>;
|
|
81
|
+
appKinds?: Array<'http'>;
|
|
87
82
|
resourceCleanup?: boolean;
|
|
88
83
|
resources: Record<PublicationResourceKind, PublicationResourceMode[]>;
|
|
89
84
|
access: {
|
|
@@ -116,6 +111,10 @@ export interface PublicationCatalogResourceType {
|
|
|
116
111
|
configFields: PublicationCatalogConfigField[];
|
|
117
112
|
}
|
|
118
113
|
export interface PublicationResourceCatalog {
|
|
114
|
+
accounts?: {
|
|
115
|
+
id: string;
|
|
116
|
+
name: string;
|
|
117
|
+
}[];
|
|
119
118
|
provider: PublicationProviderName;
|
|
120
119
|
scope: string | null;
|
|
121
120
|
capabilities: PublicationCapabilities;
|
|
@@ -136,56 +135,14 @@ export interface PublicationResourceCatalog {
|
|
|
136
135
|
}[];
|
|
137
136
|
pricingUrl: string | null;
|
|
138
137
|
}
|
|
139
|
-
export interface PublicationPlan<TName extends PublicationProviderName = PublicationProviderName> {
|
|
140
|
-
provider: TName;
|
|
141
|
-
capabilities: PublicationCapabilities;
|
|
142
|
-
readiness: PublicationReadiness;
|
|
143
|
-
source: {
|
|
144
|
-
type: 'git' | 'workspace';
|
|
145
|
-
repository: string | null;
|
|
146
|
-
branch: string | null;
|
|
147
|
-
commitAndPush: boolean;
|
|
148
|
-
providerAccess: 'verified' | 'confirmed' | 'confirmation_required' | 'not_required';
|
|
149
|
-
};
|
|
150
|
-
resources: Array<{
|
|
151
|
-
kind: PublicationResourceKind;
|
|
152
|
-
mode: PublicationResourceMode | 'unconfigured';
|
|
153
|
-
engine: string | null;
|
|
154
|
-
required: boolean;
|
|
155
|
-
recommended: boolean;
|
|
156
|
-
supported: boolean;
|
|
157
|
-
selection: PublicationResourceSelection | boolean | null;
|
|
158
|
-
}>;
|
|
159
|
-
blockers: Array<{
|
|
160
|
-
code: string;
|
|
161
|
-
message: string;
|
|
162
|
-
}>;
|
|
163
|
-
ready: boolean;
|
|
164
|
-
input: PublicationPlanInput<TName>;
|
|
165
|
-
cost: {
|
|
166
|
-
status: 'unknown';
|
|
167
|
-
message: string;
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
export type PublicationComponentKind = 'frontend' | 'http-service' | 'static-site' | 'worker' | 'scheduler';
|
|
171
138
|
export type PublicationDockerfile = {
|
|
172
139
|
source: 'generated';
|
|
173
140
|
content: string;
|
|
174
|
-
digest?: string;
|
|
175
141
|
} | {
|
|
176
142
|
source: 'project';
|
|
177
143
|
path: string;
|
|
178
|
-
digest?: string;
|
|
179
144
|
};
|
|
180
|
-
export type
|
|
181
|
-
mode: 'provider-native';
|
|
182
|
-
workingDirectory?: string;
|
|
183
|
-
context?: string;
|
|
184
|
-
installCommand?: string;
|
|
185
|
-
buildCommand?: string;
|
|
186
|
-
deployCommand?: string;
|
|
187
|
-
outputDirectory?: string;
|
|
188
|
-
} | {
|
|
145
|
+
export type PublicationContainerBuild = {
|
|
189
146
|
mode: 'dockerfile';
|
|
190
147
|
workingDirectory?: string;
|
|
191
148
|
context?: string;
|
|
@@ -193,59 +150,174 @@ export type PublicationComponentBuild = {
|
|
|
193
150
|
target?: string;
|
|
194
151
|
arguments?: Record<string, string>;
|
|
195
152
|
secrets?: string[];
|
|
153
|
+
};
|
|
154
|
+
export type PublicationNativeBuild = {
|
|
155
|
+
mode: 'provider-native';
|
|
156
|
+
installCommand?: string;
|
|
157
|
+
buildCommand?: string;
|
|
158
|
+
deployCommand?: string;
|
|
159
|
+
};
|
|
160
|
+
export type PublicationAppBuild = PublicationContainerBuild | PublicationNativeBuild;
|
|
161
|
+
export type PublicationRoutingDraft = {
|
|
162
|
+
mode: 'managed';
|
|
163
|
+
routes?: never;
|
|
196
164
|
} | {
|
|
197
|
-
mode: '
|
|
198
|
-
|
|
165
|
+
mode: 'custom';
|
|
166
|
+
routes: [{
|
|
167
|
+
hostname: string;
|
|
168
|
+
}, ...Array<{
|
|
169
|
+
hostname: string;
|
|
170
|
+
}>];
|
|
199
171
|
};
|
|
200
|
-
export interface
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
172
|
+
export interface PublicationManagedAddress {
|
|
173
|
+
slug: string;
|
|
174
|
+
url: string;
|
|
175
|
+
}
|
|
176
|
+
export type PublicationRouting = PublicationRoutingDraft & {
|
|
177
|
+
managedAddress: PublicationManagedAddress;
|
|
178
|
+
};
|
|
179
|
+
export type PublicationContainerRuntime = {
|
|
180
|
+
mode: 'container';
|
|
181
|
+
port: number;
|
|
182
|
+
healthCheck: {
|
|
205
183
|
path: string;
|
|
206
184
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
185
|
+
command?: string[];
|
|
186
|
+
};
|
|
187
|
+
export type PublicationNativeRuntime = {
|
|
188
|
+
mode: 'provider-native';
|
|
189
|
+
port?: never;
|
|
190
|
+
command?: never;
|
|
191
|
+
healthCheck?: never;
|
|
192
|
+
};
|
|
193
|
+
interface PublicationAppDraftBase {
|
|
194
|
+
name: string;
|
|
195
|
+
kind: 'http';
|
|
216
196
|
root: string;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
197
|
+
slug?: string;
|
|
198
|
+
routing: PublicationRoutingDraft;
|
|
199
|
+
resourceIds?: string[];
|
|
200
|
+
}
|
|
201
|
+
/** Only executable HTTP workloads are accepted. Runtime and build follow the destination. */
|
|
202
|
+
export type PublicationAppDraft = PublicationAppDraftBase & ({
|
|
203
|
+
destination: {
|
|
204
|
+
provider: 'ssh-server';
|
|
205
|
+
serverId?: string;
|
|
206
|
+
};
|
|
207
|
+
build: PublicationContainerBuild;
|
|
208
|
+
runtime: PublicationContainerRuntime;
|
|
209
|
+
} | {
|
|
210
|
+
destination: {
|
|
211
|
+
provider: 'cloudflare-containers';
|
|
212
|
+
} & Partial<Omit<CloudflareContainersProviderOptions, 'resources'>>;
|
|
213
|
+
build: Omit<PublicationContainerBuild, 'target' | 'arguments' | 'secrets'>;
|
|
214
|
+
runtime: PublicationContainerRuntime;
|
|
215
|
+
} | {
|
|
216
|
+
destination: {
|
|
217
|
+
provider: 'laravel-cloud';
|
|
218
|
+
region?: LaravelCloudProviderInput['region'];
|
|
219
|
+
setup?: Pick<NonNullable<LaravelCloudProviderInput['setup']>, 'repositoryAccessConfirmed' | 'workerPlacement' | 'workerSize'>;
|
|
220
|
+
};
|
|
221
|
+
build: PublicationNativeBuild;
|
|
222
|
+
runtime: PublicationNativeRuntime;
|
|
223
|
+
});
|
|
224
|
+
/** Server-issued ID and managed address remain stable through names and app-count changes. */
|
|
225
|
+
export type PublicationApp = PublicationAppDraft extends infer Draft ? Draft extends PublicationAppDraft ? Omit<Draft, 'slug' | 'routing' | 'resourceIds'> & {
|
|
226
|
+
id: string;
|
|
227
|
+
routing: PublicationRouting;
|
|
228
|
+
resourceIds: string[];
|
|
229
|
+
} : never : never;
|
|
230
|
+
export type PublicationApplicationResourceInput = {
|
|
224
231
|
id: string;
|
|
225
232
|
kind: PublicationResourceKind;
|
|
226
|
-
mode: PublicationResourceMode;
|
|
227
233
|
engine?: string;
|
|
228
234
|
provider?: PublicationProviderName;
|
|
229
|
-
|
|
235
|
+
} & ({
|
|
236
|
+
mode: 'none' | 'external' | 'enable';
|
|
237
|
+
selection?: never;
|
|
238
|
+
} | {
|
|
239
|
+
mode: 'reuse';
|
|
240
|
+
selection: {
|
|
241
|
+
id: string;
|
|
242
|
+
};
|
|
243
|
+
} | {
|
|
244
|
+
mode: 'create';
|
|
245
|
+
provider: 'laravel-cloud';
|
|
246
|
+
kind: 'storage';
|
|
247
|
+
selection?: never;
|
|
248
|
+
} | {
|
|
249
|
+
mode: 'create';
|
|
250
|
+
selection: {
|
|
251
|
+
type: string;
|
|
252
|
+
version?: string;
|
|
253
|
+
size?: string;
|
|
254
|
+
config?: Record<string, string | number | boolean | null>;
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
export type PublicationConfigurationOperation = {
|
|
258
|
+
op: 'add-app';
|
|
259
|
+
app: PublicationAppDraft;
|
|
260
|
+
adoptPublicationId?: string;
|
|
261
|
+
} | {
|
|
262
|
+
op: 'update-app';
|
|
263
|
+
appId: string;
|
|
264
|
+
app: PublicationAppDraft;
|
|
265
|
+
} | {
|
|
266
|
+
op: 'remove-app';
|
|
267
|
+
appId: string;
|
|
268
|
+
} | {
|
|
269
|
+
op: 'add-resource';
|
|
270
|
+
resource: PublicationApplicationResourceInput;
|
|
271
|
+
} | {
|
|
272
|
+
op: 'update-resource';
|
|
273
|
+
resourceId: string;
|
|
274
|
+
resource: PublicationApplicationResourceInput;
|
|
275
|
+
} | {
|
|
276
|
+
op: 'remove-resource';
|
|
277
|
+
resourceId: string;
|
|
278
|
+
};
|
|
279
|
+
export interface PublicationConfigurationUpdate {
|
|
280
|
+
expectedRevision: number;
|
|
281
|
+
operations: PublicationConfigurationOperation[];
|
|
230
282
|
}
|
|
231
|
-
export interface
|
|
232
|
-
|
|
233
|
-
|
|
283
|
+
export interface PublicationProjectConfiguration {
|
|
284
|
+
schemaVersion: 1;
|
|
285
|
+
proposal: {
|
|
286
|
+
id: string;
|
|
287
|
+
token: string;
|
|
288
|
+
} | null;
|
|
289
|
+
id: string | null;
|
|
290
|
+
revision: number;
|
|
291
|
+
apps: PublicationApp[];
|
|
292
|
+
resources: PublicationApplicationResourceInput[];
|
|
293
|
+
deployments: Array<{
|
|
294
|
+
appId: string | null;
|
|
295
|
+
configured: boolean;
|
|
296
|
+
publication: PublicationData;
|
|
297
|
+
}>;
|
|
234
298
|
}
|
|
235
299
|
export interface PublicationApplicationPlanInput {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
source?: {
|
|
239
|
-
repository?: string;
|
|
240
|
-
revision?: string;
|
|
241
|
-
root?: string;
|
|
242
|
-
};
|
|
243
|
-
components: PublicationApplicationComponentInput[];
|
|
244
|
-
resources?: PublicationApplicationResourceInput[];
|
|
245
|
-
routes?: PublicationApplicationRouteInput[];
|
|
300
|
+
expectedRevision: number;
|
|
301
|
+
appIds?: string[];
|
|
246
302
|
}
|
|
247
|
-
|
|
248
|
-
|
|
303
|
+
export interface PublicationApplicationPlan {
|
|
304
|
+
schemaVersion: 1;
|
|
305
|
+
configurationId: string;
|
|
306
|
+
configurationRevision: number;
|
|
307
|
+
apps: Array<PublicationApp & {
|
|
308
|
+
action: 'create' | 'update' | 'retry';
|
|
309
|
+
publicationId: string | null;
|
|
310
|
+
routeAttachment: 'pending_after_deployment' | 'not_required';
|
|
311
|
+
/** Digest fingerprints the reviewed workspace; revision is the last synced Git commit, before native commit-and-push preparation. */
|
|
312
|
+
source: {
|
|
313
|
+
type: 'workspace' | 'git';
|
|
314
|
+
repository: string | null;
|
|
315
|
+
branch: string | null;
|
|
316
|
+
revision: string | null;
|
|
317
|
+
digest: string | null;
|
|
318
|
+
};
|
|
319
|
+
}>;
|
|
320
|
+
resources: PublicationApplicationResourceInput[];
|
|
249
321
|
review: {
|
|
250
322
|
id: string;
|
|
251
323
|
ready: boolean;
|
|
@@ -253,34 +325,56 @@ export interface PublicationApplicationPlan extends PublicationApplicationPlanIn
|
|
|
253
325
|
code: string;
|
|
254
326
|
message: string;
|
|
255
327
|
}>;
|
|
256
|
-
action: 'create' | 'update' | 'retry';
|
|
257
|
-
publicationId: string | null;
|
|
258
328
|
destinations: Record<string, string | null>;
|
|
259
329
|
productionVariables: string[];
|
|
260
|
-
configuration:
|
|
261
|
-
name: string;
|
|
262
|
-
requirement: 'required' | 'optional' | 'platform';
|
|
263
|
-
source: string;
|
|
264
|
-
}>;
|
|
330
|
+
configuration: PublicationConfigurationField[];
|
|
265
331
|
source: {
|
|
266
|
-
type: 'workspace' | 'git';
|
|
332
|
+
type: 'workspace' | 'git' | 'mixed';
|
|
267
333
|
repository: string | null;
|
|
268
334
|
branch: string | null;
|
|
335
|
+
revision: string | null;
|
|
336
|
+
digest: string | null;
|
|
269
337
|
};
|
|
270
338
|
digest: string;
|
|
339
|
+
proposal: string;
|
|
271
340
|
};
|
|
272
341
|
}
|
|
273
342
|
export interface PublicationApplicationPublishInput {
|
|
274
343
|
reviewId: string;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
344
|
+
proposal: string;
|
|
345
|
+
appIds?: string[];
|
|
346
|
+
}
|
|
347
|
+
export interface PublicationApplicationConfirmationRequired {
|
|
348
|
+
confirmationRequired: true;
|
|
349
|
+
plan: PublicationApplicationPlan;
|
|
350
|
+
changes: string[];
|
|
351
|
+
}
|
|
352
|
+
export type PublicationApplicationPublishResult = PublicationApplicationData | PublicationApplicationConfirmationRequired;
|
|
353
|
+
export interface PublicationApplicationAppData {
|
|
354
|
+
appId: string;
|
|
355
|
+
configurationRevision: number | null;
|
|
278
356
|
publication: PublicationData;
|
|
357
|
+
runtime: {
|
|
358
|
+
status: 'healthy' | 'unknown' | 'stopped';
|
|
359
|
+
state: Record<string, unknown>;
|
|
360
|
+
};
|
|
361
|
+
routing: {
|
|
362
|
+
managedAddress: PublicationManagedAddress;
|
|
363
|
+
status: 'connected' | 'pending' | 'failed';
|
|
364
|
+
routes: Array<{
|
|
365
|
+
hostname: string;
|
|
366
|
+
status: string;
|
|
367
|
+
error: string | null;
|
|
368
|
+
}>;
|
|
369
|
+
errors: Record<string, string>;
|
|
370
|
+
};
|
|
279
371
|
}
|
|
280
372
|
export interface PublicationApplicationData {
|
|
281
373
|
id: string;
|
|
282
|
-
status: 'publishing' | 'healthy' | 'failed' | 'deleted';
|
|
283
|
-
|
|
374
|
+
status: 'publishing' | 'healthy' | 'partial' | 'failed' | 'deleted';
|
|
375
|
+
apps: PublicationApplicationAppData[];
|
|
376
|
+
reviewId?: string;
|
|
377
|
+
selectedAppIds?: string[];
|
|
284
378
|
}
|
|
285
379
|
export interface PublicationDnsInstructions {
|
|
286
380
|
stage: 'ownership' | 'traffic' | 'connected';
|
|
@@ -308,14 +402,12 @@ export type PublicationProvider<TName extends PublicationProviderName = Publicat
|
|
|
308
402
|
name: Name;
|
|
309
403
|
} & PublicationProviderData[Name];
|
|
310
404
|
}[TName];
|
|
311
|
-
export interface PublishInput<TName extends PublicationProviderName = PublicationProviderName> {
|
|
312
|
-
slug: string;
|
|
313
|
-
provider: PublicationProviderInput<TName>;
|
|
314
|
-
protection?: PublicationProtectionInput;
|
|
315
|
-
metadata?: Record<string, unknown>;
|
|
316
|
-
}
|
|
317
405
|
export interface PublicationBuildData<TProvider extends PublicationProviderName = PublicationProviderName> {
|
|
318
406
|
id: string;
|
|
407
|
+
appId?: string | null;
|
|
408
|
+
configurationRevision?: number | null;
|
|
409
|
+
reviewId?: string | null;
|
|
410
|
+
sourceRevision?: string | null;
|
|
319
411
|
status: PublicationBuildStatus;
|
|
320
412
|
strategy: string;
|
|
321
413
|
provider: PublicationProvider<TProvider>;
|