@phpsandbox/sdk 0.1.20 → 0.2.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/dist/beacon/index.d.ts +2 -2
- package/dist/browser/phpsandbox-sdk.esm.js +16939 -16823
- package/dist/browser/phpsandbox-sdk.esm.min.js +35 -35
- package/dist/browser/phpsandbox-sdk.iife.js +16928 -16811
- package/dist/browser/phpsandbox-sdk.iife.min.js +24 -24
- package/dist/errors/index.d.ts +2 -2
- package/dist/events/index.d.ts +21 -15
- package/dist/events/index.js +9 -5
- package/dist/index.d.ts +9 -8
- package/dist/index.js +31 -34
- package/dist/publication/domains.d.ts +17 -0
- package/dist/publication/domains.js +25 -0
- package/dist/publication/index.d.ts +8 -0
- package/dist/publication/index.js +6 -0
- package/dist/publication/instance.d.ts +42 -0
- package/dist/publication/instance.js +133 -0
- package/dist/publication/notebook.d.ts +20 -0
- package/dist/publication/notebook.js +46 -0
- package/dist/publication/providers/laravel-cloud.d.ts +114 -0
- package/dist/publication/providers/laravel-cloud.js +13 -0
- package/dist/publication/resources.d.ts +9 -0
- package/dist/publication/resources.js +19 -0
- package/dist/publication/run.d.ts +30 -0
- package/dist/{publications.js → publication/run.js} +11 -133
- package/dist/publication/types.d.ts +303 -0
- package/dist/publication/types.js +1 -0
- package/dist/runtime/rest.d.ts +1 -1
- package/dist/schemas/publications.d.ts +33 -33
- package/dist/servers.d.ts +3 -0
- package/dist/servers.js +3 -0
- package/dist/socket/index.d.ts +4 -4
- package/dist/socket/index.js +5 -3
- package/package.json +1 -1
- package/dist/publications.d.ts +0 -192
|
@@ -5,33 +5,33 @@ export declare const PublicationProviderNameSchema: z.ZodEnum<{
|
|
|
5
5
|
"laravel-cloud": "laravel-cloud";
|
|
6
6
|
}>;
|
|
7
7
|
export declare const PublicationStatusSchema: z.ZodEnum<{
|
|
8
|
-
stopped: "stopped";
|
|
9
|
-
deleted: "deleted";
|
|
10
8
|
pending: "pending";
|
|
11
9
|
queued: "queued";
|
|
12
10
|
building: "building";
|
|
13
11
|
deploying: "deploying";
|
|
14
12
|
healthy: "healthy";
|
|
15
13
|
failed: "failed";
|
|
14
|
+
stopped: "stopped";
|
|
16
15
|
deleting: "deleting";
|
|
16
|
+
deleted: "deleted";
|
|
17
17
|
delete_failed: "delete_failed";
|
|
18
18
|
}>;
|
|
19
19
|
export declare const PublicationBuildStatusSchema: z.ZodEnum<{
|
|
20
|
-
running: "running";
|
|
21
20
|
pending: "pending";
|
|
22
21
|
queued: "queued";
|
|
23
22
|
failed: "failed";
|
|
23
|
+
running: "running";
|
|
24
24
|
succeeded: "succeeded";
|
|
25
25
|
cancelled: "cancelled";
|
|
26
26
|
}>;
|
|
27
27
|
export declare const PublicationReleaseStatusSchema: z.ZodEnum<{
|
|
28
|
-
created: "created";
|
|
29
28
|
deleted: "deleted";
|
|
29
|
+
created: "created";
|
|
30
30
|
ready: "ready";
|
|
31
31
|
}>;
|
|
32
32
|
export declare const PublicationSizeSchema: z.ZodEnum<{
|
|
33
|
-
small: "small";
|
|
34
33
|
nano: "nano";
|
|
34
|
+
small: "small";
|
|
35
35
|
medium: "medium";
|
|
36
36
|
large: "large";
|
|
37
37
|
lite: "lite";
|
|
@@ -86,8 +86,8 @@ export declare const PublicationLogChunkDataSchema: z.ZodObject<{
|
|
|
86
86
|
export declare const PublishStreamPhaseSchema: z.ZodObject<{
|
|
87
87
|
name: z.ZodString;
|
|
88
88
|
status: z.ZodOptional<z.ZodEnum<{
|
|
89
|
-
running: "running";
|
|
90
89
|
failed: "failed";
|
|
90
|
+
running: "running";
|
|
91
91
|
completed: "completed";
|
|
92
92
|
}>>;
|
|
93
93
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -107,23 +107,23 @@ export declare const PublishStreamResultSchema: z.ZodObject<{
|
|
|
107
107
|
buildId: z.ZodString;
|
|
108
108
|
releaseId: z.ZodString;
|
|
109
109
|
status: z.ZodEnum<{
|
|
110
|
-
stopped: "stopped";
|
|
111
|
-
deleted: "deleted";
|
|
112
110
|
pending: "pending";
|
|
113
111
|
queued: "queued";
|
|
114
112
|
building: "building";
|
|
115
113
|
deploying: "deploying";
|
|
116
114
|
healthy: "healthy";
|
|
117
115
|
failed: "failed";
|
|
116
|
+
stopped: "stopped";
|
|
118
117
|
deleting: "deleting";
|
|
118
|
+
deleted: "deleted";
|
|
119
119
|
delete_failed: "delete_failed";
|
|
120
120
|
}>;
|
|
121
121
|
}, z.core.$strict>;
|
|
122
122
|
export declare const PublishStreamPhaseEventSchema: z.ZodObject<{
|
|
123
123
|
name: z.ZodString;
|
|
124
124
|
status: z.ZodOptional<z.ZodEnum<{
|
|
125
|
-
running: "running";
|
|
126
125
|
failed: "failed";
|
|
126
|
+
running: "running";
|
|
127
127
|
completed: "completed";
|
|
128
128
|
}>>;
|
|
129
129
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -145,15 +145,15 @@ export declare const PublishStreamResultEventSchema: z.ZodObject<{
|
|
|
145
145
|
buildId: z.ZodString;
|
|
146
146
|
releaseId: z.ZodString;
|
|
147
147
|
status: z.ZodEnum<{
|
|
148
|
-
stopped: "stopped";
|
|
149
|
-
deleted: "deleted";
|
|
150
148
|
pending: "pending";
|
|
151
149
|
queued: "queued";
|
|
152
150
|
building: "building";
|
|
153
151
|
deploying: "deploying";
|
|
154
152
|
healthy: "healthy";
|
|
155
153
|
failed: "failed";
|
|
154
|
+
stopped: "stopped";
|
|
156
155
|
deleting: "deleting";
|
|
156
|
+
deleted: "deleted";
|
|
157
157
|
delete_failed: "delete_failed";
|
|
158
158
|
}>;
|
|
159
159
|
type: z.ZodLiteral<"result">;
|
|
@@ -161,8 +161,8 @@ export declare const PublishStreamResultEventSchema: z.ZodObject<{
|
|
|
161
161
|
export declare const PublishStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
162
162
|
name: z.ZodString;
|
|
163
163
|
status: z.ZodOptional<z.ZodEnum<{
|
|
164
|
-
running: "running";
|
|
165
164
|
failed: "failed";
|
|
165
|
+
running: "running";
|
|
166
166
|
completed: "completed";
|
|
167
167
|
}>>;
|
|
168
168
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -182,15 +182,15 @@ export declare const PublishStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
182
182
|
buildId: z.ZodString;
|
|
183
183
|
releaseId: z.ZodString;
|
|
184
184
|
status: z.ZodEnum<{
|
|
185
|
-
stopped: "stopped";
|
|
186
|
-
deleted: "deleted";
|
|
187
185
|
pending: "pending";
|
|
188
186
|
queued: "queued";
|
|
189
187
|
building: "building";
|
|
190
188
|
deploying: "deploying";
|
|
191
189
|
healthy: "healthy";
|
|
192
190
|
failed: "failed";
|
|
191
|
+
stopped: "stopped";
|
|
193
192
|
deleting: "deleting";
|
|
193
|
+
deleted: "deleted";
|
|
194
194
|
delete_failed: "delete_failed";
|
|
195
195
|
}>;
|
|
196
196
|
type: z.ZodLiteral<"result">;
|
|
@@ -199,19 +199,19 @@ export declare const PublishStreamErrorSchema: z.ZodObject<{
|
|
|
199
199
|
message: z.ZodOptional<z.ZodString>;
|
|
200
200
|
}, z.core.$loose>;
|
|
201
201
|
export declare const PublishStreamSseEventNameSchema: z.ZodEnum<{
|
|
202
|
-
error: "error";
|
|
203
202
|
phase: "phase";
|
|
204
203
|
log: "log";
|
|
205
204
|
result: "result";
|
|
206
205
|
done: "done";
|
|
206
|
+
error: "error";
|
|
207
207
|
}>;
|
|
208
208
|
export declare const PublishStreamSsePhaseEventSchema: z.ZodObject<{
|
|
209
209
|
event: z.ZodLiteral<"phase">;
|
|
210
210
|
data: z.ZodObject<{
|
|
211
211
|
name: z.ZodString;
|
|
212
212
|
status: z.ZodOptional<z.ZodEnum<{
|
|
213
|
-
running: "running";
|
|
214
213
|
failed: "failed";
|
|
214
|
+
running: "running";
|
|
215
215
|
completed: "completed";
|
|
216
216
|
}>>;
|
|
217
217
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -237,15 +237,15 @@ export declare const PublishStreamSseDoneEventSchema: z.ZodObject<{
|
|
|
237
237
|
buildId: z.ZodString;
|
|
238
238
|
releaseId: z.ZodString;
|
|
239
239
|
status: z.ZodEnum<{
|
|
240
|
-
stopped: "stopped";
|
|
241
|
-
deleted: "deleted";
|
|
242
240
|
pending: "pending";
|
|
243
241
|
queued: "queued";
|
|
244
242
|
building: "building";
|
|
245
243
|
deploying: "deploying";
|
|
246
244
|
healthy: "healthy";
|
|
247
245
|
failed: "failed";
|
|
246
|
+
stopped: "stopped";
|
|
248
247
|
deleting: "deleting";
|
|
248
|
+
deleted: "deleted";
|
|
249
249
|
delete_failed: "delete_failed";
|
|
250
250
|
}>;
|
|
251
251
|
}, z.core.$strict>;
|
|
@@ -259,15 +259,15 @@ export declare const PublishStreamSseResultEventSchema: z.ZodObject<{
|
|
|
259
259
|
buildId: z.ZodString;
|
|
260
260
|
releaseId: z.ZodString;
|
|
261
261
|
status: z.ZodEnum<{
|
|
262
|
-
stopped: "stopped";
|
|
263
|
-
deleted: "deleted";
|
|
264
262
|
pending: "pending";
|
|
265
263
|
queued: "queued";
|
|
266
264
|
building: "building";
|
|
267
265
|
deploying: "deploying";
|
|
268
266
|
healthy: "healthy";
|
|
269
267
|
failed: "failed";
|
|
268
|
+
stopped: "stopped";
|
|
270
269
|
deleting: "deleting";
|
|
270
|
+
deleted: "deleted";
|
|
271
271
|
delete_failed: "delete_failed";
|
|
272
272
|
}>;
|
|
273
273
|
}, z.core.$strict>;
|
|
@@ -283,8 +283,8 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
283
283
|
data: z.ZodObject<{
|
|
284
284
|
name: z.ZodString;
|
|
285
285
|
status: z.ZodOptional<z.ZodEnum<{
|
|
286
|
-
running: "running";
|
|
287
286
|
failed: "failed";
|
|
287
|
+
running: "running";
|
|
288
288
|
completed: "completed";
|
|
289
289
|
}>>;
|
|
290
290
|
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -308,15 +308,15 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
308
308
|
buildId: z.ZodString;
|
|
309
309
|
releaseId: z.ZodString;
|
|
310
310
|
status: z.ZodEnum<{
|
|
311
|
-
stopped: "stopped";
|
|
312
|
-
deleted: "deleted";
|
|
313
311
|
pending: "pending";
|
|
314
312
|
queued: "queued";
|
|
315
313
|
building: "building";
|
|
316
314
|
deploying: "deploying";
|
|
317
315
|
healthy: "healthy";
|
|
318
316
|
failed: "failed";
|
|
317
|
+
stopped: "stopped";
|
|
319
318
|
deleting: "deleting";
|
|
319
|
+
deleted: "deleted";
|
|
320
320
|
delete_failed: "delete_failed";
|
|
321
321
|
}>;
|
|
322
322
|
}, z.core.$strict>;
|
|
@@ -329,15 +329,15 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
329
329
|
buildId: z.ZodString;
|
|
330
330
|
releaseId: z.ZodString;
|
|
331
331
|
status: z.ZodEnum<{
|
|
332
|
-
stopped: "stopped";
|
|
333
|
-
deleted: "deleted";
|
|
334
332
|
pending: "pending";
|
|
335
333
|
queued: "queued";
|
|
336
334
|
building: "building";
|
|
337
335
|
deploying: "deploying";
|
|
338
336
|
healthy: "healthy";
|
|
339
337
|
failed: "failed";
|
|
338
|
+
stopped: "stopped";
|
|
340
339
|
deleting: "deleting";
|
|
340
|
+
deleted: "deleted";
|
|
341
341
|
delete_failed: "delete_failed";
|
|
342
342
|
}>;
|
|
343
343
|
}, z.core.$strict>;
|
|
@@ -349,8 +349,8 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
349
349
|
}, z.core.$strict>], "event">, z.ZodTransform<{
|
|
350
350
|
name: string;
|
|
351
351
|
type: "phase";
|
|
352
|
-
status?: "
|
|
353
|
-
data?: Record<string, unknown
|
|
352
|
+
status?: "failed" | "running" | "completed" | undefined;
|
|
353
|
+
data?: Record<string, unknown> | undefined;
|
|
354
354
|
} | {
|
|
355
355
|
stream: "runtime" | "build" | "publish";
|
|
356
356
|
content: string;
|
|
@@ -361,14 +361,14 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
361
361
|
url: string;
|
|
362
362
|
buildId: string;
|
|
363
363
|
releaseId: string;
|
|
364
|
-
status: "
|
|
364
|
+
status: "pending" | "queued" | "building" | "deploying" | "healthy" | "failed" | "stopped" | "deleting" | "deleted" | "delete_failed";
|
|
365
365
|
type: "result";
|
|
366
366
|
}, {
|
|
367
367
|
event: "phase";
|
|
368
368
|
data: {
|
|
369
369
|
name: string;
|
|
370
|
-
status?: "
|
|
371
|
-
data?: Record<string, unknown
|
|
370
|
+
status?: "failed" | "running" | "completed" | undefined;
|
|
371
|
+
data?: Record<string, unknown> | undefined;
|
|
372
372
|
};
|
|
373
373
|
} | {
|
|
374
374
|
event: "log";
|
|
@@ -384,7 +384,7 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
384
384
|
url: string;
|
|
385
385
|
buildId: string;
|
|
386
386
|
releaseId: string;
|
|
387
|
-
status: "
|
|
387
|
+
status: "pending" | "queued" | "building" | "deploying" | "healthy" | "failed" | "stopped" | "deleting" | "deleted" | "delete_failed";
|
|
388
388
|
};
|
|
389
389
|
} | {
|
|
390
390
|
event: "result";
|
|
@@ -394,13 +394,13 @@ export declare const PublishStreamSseEventSchema: z.ZodPipe<z.ZodDiscriminatedUn
|
|
|
394
394
|
url: string;
|
|
395
395
|
buildId: string;
|
|
396
396
|
releaseId: string;
|
|
397
|
-
status: "
|
|
397
|
+
status: "pending" | "queued" | "building" | "deploying" | "healthy" | "failed" | "stopped" | "deleting" | "deleted" | "delete_failed";
|
|
398
398
|
};
|
|
399
399
|
} | {
|
|
400
400
|
event: "error";
|
|
401
401
|
data: {
|
|
402
402
|
[x: string]: unknown;
|
|
403
|
-
message?: string;
|
|
403
|
+
message?: string | undefined;
|
|
404
404
|
};
|
|
405
405
|
}>>;
|
|
406
406
|
export type BuiltInPublicationProviderName = z.infer<typeof PublicationProviderNameSchema>;
|
package/dist/servers.d.ts
CHANGED
|
@@ -35,6 +35,9 @@ export declare class ServerInstance {
|
|
|
35
35
|
readonly data: ServerData;
|
|
36
36
|
private readonly client;
|
|
37
37
|
constructor(data: ServerData, client: Client);
|
|
38
|
+
installation(): Promise<{
|
|
39
|
+
installCommand: string;
|
|
40
|
+
}>;
|
|
38
41
|
refresh(): Promise<ServerInstance>;
|
|
39
42
|
delete(): Promise<void>;
|
|
40
43
|
waitReady(options?: {
|
package/dist/servers.js
CHANGED
|
@@ -20,6 +20,9 @@ export class ServerInstance {
|
|
|
20
20
|
this.data = data;
|
|
21
21
|
this.client = client;
|
|
22
22
|
}
|
|
23
|
+
async installation() {
|
|
24
|
+
return (await this.client.get(`/servers/${encodeURIComponent(this.data.id)}/installation`)).data;
|
|
25
|
+
}
|
|
23
26
|
refresh() {
|
|
24
27
|
return this.client.servers.get(this.data.id);
|
|
25
28
|
}
|
package/dist/socket/index.d.ts
CHANGED
|
@@ -31,12 +31,12 @@ export declare class ConnectionTimeoutError extends TransportError<'ConnectionTi
|
|
|
31
31
|
constructor(message?: string);
|
|
32
32
|
}
|
|
33
33
|
export declare class ConnectionFailedError extends TransportError<'ConnectionFailed'> {
|
|
34
|
-
readonly originalError?: unknown;
|
|
35
|
-
constructor(message: string, originalError?: unknown);
|
|
34
|
+
readonly originalError?: unknown | undefined;
|
|
35
|
+
constructor(message: string, originalError?: unknown | undefined);
|
|
36
36
|
}
|
|
37
37
|
export declare class InvalidMessageError extends TransportError<'InvalidResponse'> {
|
|
38
|
-
readonly data?: unknown;
|
|
39
|
-
constructor(message: string, data?: unknown);
|
|
38
|
+
readonly data?: unknown | undefined;
|
|
39
|
+
constructor(message: string, data?: unknown | undefined);
|
|
40
40
|
}
|
|
41
41
|
export declare class InvalidConfigurationError extends Error {
|
|
42
42
|
constructor(message: string);
|
package/dist/socket/index.js
CHANGED
|
@@ -67,7 +67,7 @@ export class Transport {
|
|
|
67
67
|
this.validateConfiguration(options);
|
|
68
68
|
this.url = typeof url === 'string' ? new URL(url) : null;
|
|
69
69
|
const urlProvider = typeof url === 'string'
|
|
70
|
-
?
|
|
70
|
+
? new URL(url).toString()
|
|
71
71
|
: async () => new URL(await url()).toString();
|
|
72
72
|
// Use configurable ping interval
|
|
73
73
|
this.PING_INTERVAL = options.pingInterval ?? 30000;
|
|
@@ -313,7 +313,9 @@ export class Transport {
|
|
|
313
313
|
}
|
|
314
314
|
onDidBootError(listener) {
|
|
315
315
|
return this.eventEmitter.listen('transport.boot_error', (event) => {
|
|
316
|
-
|
|
316
|
+
if (event && typeof event === 'object' && 'error' in event && RemoteError.is(event.error, 'NotebookUnavailable')) {
|
|
317
|
+
listener(event.error);
|
|
318
|
+
}
|
|
317
319
|
});
|
|
318
320
|
}
|
|
319
321
|
removeListener(event, listener) {
|
|
@@ -323,7 +325,7 @@ export class Transport {
|
|
|
323
325
|
return this.eventEmitter.once(event, listener, context);
|
|
324
326
|
}
|
|
325
327
|
emit(event, ...data) {
|
|
326
|
-
this.eventEmitter.emit(event,
|
|
328
|
+
this.eventEmitter.emit(event, data.length > 1 ? data : data[0]);
|
|
327
329
|
}
|
|
328
330
|
get isConnected() {
|
|
329
331
|
return this.status === 'OPEN';
|
package/package.json
CHANGED
package/dist/publications.d.ts
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import type { Client } from './index.js';
|
|
2
|
-
import type { PublicationBuildStatus, PublicationEventData, PublicationJurisdiction, PublicationLogChunkData, PublicationProtectionMode, PublicationRegion, PublicationReleaseStatus, PublicationSize, PublicationStatus, PublishStreamEvent, PublishStreamResult } from './schemas/publications.js';
|
|
3
|
-
export type { BuiltInPublicationProviderName, PublicationBuildStatus, PublicationEventData, PublicationJurisdiction, PublicationLogChunkData, PublicationLogStream, PublicationProtectionMode, PublicationRegion, PublicationReleaseStatus, PublicationSize, PublicationStatus, PublishStreamEvent, PublishStreamLog, PublishStreamPhase, PublishStreamResult, PublishStreamSseEvent, } from './schemas/publications.js';
|
|
4
|
-
export interface PublicationPlacement {
|
|
5
|
-
regions?: PublicationRegion[];
|
|
6
|
-
jurisdiction?: PublicationJurisdiction;
|
|
7
|
-
}
|
|
8
|
-
export type LaravelCloudRegion = 'us-east-2' | 'us-east-1' | 'ca-central-1' | 'eu-central-1' | 'eu-west-1' | 'eu-west-2' | 'me-central-1' | 'ap-southeast-1' | 'ap-southeast-2' | 'ap-northeast-1';
|
|
9
|
-
export interface PublicationProtectionData {
|
|
10
|
-
mode: PublicationProtectionMode;
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
token?: string;
|
|
13
|
-
expiresAt?: string;
|
|
14
|
-
url?: string;
|
|
15
|
-
}
|
|
16
|
-
export type PublicationProtectionInput = {
|
|
17
|
-
mode: 'none';
|
|
18
|
-
password?: never;
|
|
19
|
-
} | {
|
|
20
|
-
mode: 'password';
|
|
21
|
-
password: string;
|
|
22
|
-
};
|
|
23
|
-
export interface CloudflareContainersProviderOptions {
|
|
24
|
-
accountId: string;
|
|
25
|
-
size?: PublicationSize;
|
|
26
|
-
sleepAfter?: string;
|
|
27
|
-
placement?: PublicationPlacement;
|
|
28
|
-
instances?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface SshServerProviderOptions {
|
|
31
|
-
serverId: string;
|
|
32
|
-
}
|
|
33
|
-
export interface LaravelCloudProviderData {
|
|
34
|
-
region?: LaravelCloudRegion;
|
|
35
|
-
repository?: string;
|
|
36
|
-
branch?: string;
|
|
37
|
-
sourceControlProviderType?: 'github' | 'gitlab' | 'bitbucket';
|
|
38
|
-
}
|
|
39
|
-
export interface LaravelCloudProviderInput {
|
|
40
|
-
region: LaravelCloudRegion;
|
|
41
|
-
}
|
|
42
|
-
export interface PublicationProviderInputs {
|
|
43
|
-
'cloudflare-containers': CloudflareContainersProviderOptions;
|
|
44
|
-
'ssh-server': SshServerProviderOptions;
|
|
45
|
-
'laravel-cloud': LaravelCloudProviderInput;
|
|
46
|
-
}
|
|
47
|
-
export interface PublicationProviderData {
|
|
48
|
-
'cloudflare-containers': CloudflareContainersProviderOptions;
|
|
49
|
-
'ssh-server': SshServerProviderOptions;
|
|
50
|
-
'laravel-cloud': LaravelCloudProviderData;
|
|
51
|
-
}
|
|
52
|
-
export type PublicationProviderName = Extract<keyof PublicationProviderInputs, string>;
|
|
53
|
-
export type PublicationProviderInput<TName extends PublicationProviderName = PublicationProviderName> = {
|
|
54
|
-
[Name in TName]: {
|
|
55
|
-
name: Name;
|
|
56
|
-
} & PublicationProviderInputs[Name];
|
|
57
|
-
}[TName];
|
|
58
|
-
export type PublicationProvider<TName extends PublicationProviderName = PublicationProviderName> = {
|
|
59
|
-
[Name in TName]: {
|
|
60
|
-
name: Name;
|
|
61
|
-
} & PublicationProviderData[Name];
|
|
62
|
-
}[TName];
|
|
63
|
-
export interface PublishInput<TName extends PublicationProviderName = PublicationProviderName> {
|
|
64
|
-
slug: string;
|
|
65
|
-
provider: PublicationProviderInput<TName>;
|
|
66
|
-
protection?: PublicationProtectionInput;
|
|
67
|
-
metadata?: Record<string, unknown>;
|
|
68
|
-
}
|
|
69
|
-
export interface PublicationBuildData<TProvider extends PublicationProviderName = PublicationProviderName> {
|
|
70
|
-
id: string;
|
|
71
|
-
status: PublicationBuildStatus;
|
|
72
|
-
strategy: string;
|
|
73
|
-
provider: PublicationProvider<TProvider>;
|
|
74
|
-
errorMessage: string | null;
|
|
75
|
-
startedAt: string | null;
|
|
76
|
-
finishedAt: string | null;
|
|
77
|
-
}
|
|
78
|
-
export interface PublicationReleaseData {
|
|
79
|
-
id: string;
|
|
80
|
-
status: PublicationReleaseStatus;
|
|
81
|
-
manifest: Record<string, unknown>;
|
|
82
|
-
}
|
|
83
|
-
export interface PublicationData<TProvider extends PublicationProviderName = PublicationProviderName> {
|
|
84
|
-
id: string;
|
|
85
|
-
slug: string;
|
|
86
|
-
url: string;
|
|
87
|
-
status: PublicationStatus;
|
|
88
|
-
strategy: string;
|
|
89
|
-
provider: PublicationProvider<TProvider>;
|
|
90
|
-
protection: PublicationProtectionData;
|
|
91
|
-
eventStreamUrl: string | null;
|
|
92
|
-
originUrl: string | null;
|
|
93
|
-
currentRelease?: PublicationReleaseData | null;
|
|
94
|
-
latestBuild?: PublicationBuildData<TProvider> | null;
|
|
95
|
-
deployedAt: string | null;
|
|
96
|
-
createdAt: string | null;
|
|
97
|
-
updatedAt: string | null;
|
|
98
|
-
}
|
|
99
|
-
export interface UpdatePublicationProtectionInput {
|
|
100
|
-
mode: PublicationProtectionMode;
|
|
101
|
-
password?: string;
|
|
102
|
-
}
|
|
103
|
-
export interface PublicationProtectionSessionData {
|
|
104
|
-
previewSessionId: string;
|
|
105
|
-
token: string;
|
|
106
|
-
expiresAt: string;
|
|
107
|
-
url: string;
|
|
108
|
-
}
|
|
109
|
-
export interface PublicationDomainData {
|
|
110
|
-
id: string;
|
|
111
|
-
publicationId: string | null;
|
|
112
|
-
hostname: string;
|
|
113
|
-
status: string;
|
|
114
|
-
provider: string;
|
|
115
|
-
providerHostnameId: string | null;
|
|
116
|
-
dns: {
|
|
117
|
-
type: string | null;
|
|
118
|
-
name: string | null;
|
|
119
|
-
value: string | null;
|
|
120
|
-
};
|
|
121
|
-
ssl: {
|
|
122
|
-
status: string | null;
|
|
123
|
-
};
|
|
124
|
-
validationErrors: unknown[];
|
|
125
|
-
validationRecords: unknown[];
|
|
126
|
-
metadata: Record<string, unknown>;
|
|
127
|
-
verifiedAt: string | null;
|
|
128
|
-
createdAt: string | null;
|
|
129
|
-
updatedAt: string | null;
|
|
130
|
-
}
|
|
131
|
-
export declare class PublicationDomains {
|
|
132
|
-
private readonly client;
|
|
133
|
-
private readonly publicationId;
|
|
134
|
-
constructor(client: Client, publicationId: string);
|
|
135
|
-
list(): Promise<PublicationDomainData[]>;
|
|
136
|
-
create(hostname: string): Promise<PublicationDomainData>;
|
|
137
|
-
refresh(id: string): Promise<PublicationDomainData>;
|
|
138
|
-
delete(id: string): Promise<void>;
|
|
139
|
-
private path;
|
|
140
|
-
}
|
|
141
|
-
export declare class PublicationApi {
|
|
142
|
-
private readonly client;
|
|
143
|
-
constructor(client: Client);
|
|
144
|
-
get<TProvider extends PublicationProviderName = PublicationProviderName>(id: string): Promise<PublicationInstance<TProvider>>;
|
|
145
|
-
}
|
|
146
|
-
export declare class PublicationRun<TProvider extends PublicationProviderName = PublicationProviderName> {
|
|
147
|
-
readonly initial: PublicationInstance<TProvider>;
|
|
148
|
-
private readonly client;
|
|
149
|
-
private readonly streamAbort;
|
|
150
|
-
private started;
|
|
151
|
-
private completed;
|
|
152
|
-
private finalError;
|
|
153
|
-
private finalResult;
|
|
154
|
-
private resultPromise;
|
|
155
|
-
private resolveResult;
|
|
156
|
-
private rejectResult;
|
|
157
|
-
private readonly bufferedEvents;
|
|
158
|
-
private readonly subscribers;
|
|
159
|
-
constructor(initial: PublicationInstance<TProvider>, client: Client);
|
|
160
|
-
events(): AsyncIterable<PublishStreamEvent>;
|
|
161
|
-
result(): Promise<PublishStreamResult>;
|
|
162
|
-
publication(): Promise<PublicationInstance<TProvider>>;
|
|
163
|
-
start(): this;
|
|
164
|
-
/** Stop observing this run; the server-side publication continues. */
|
|
165
|
-
dispose(): void;
|
|
166
|
-
private subscribe;
|
|
167
|
-
private consumeStream;
|
|
168
|
-
private publish;
|
|
169
|
-
private closeSubscribers;
|
|
170
|
-
private fail;
|
|
171
|
-
}
|
|
172
|
-
export declare class PublicationInstance<TProvider extends PublicationProviderName = PublicationProviderName> {
|
|
173
|
-
readonly data: PublicationData<TProvider>;
|
|
174
|
-
private readonly client;
|
|
175
|
-
private readonly notebookId?;
|
|
176
|
-
readonly domains: PublicationDomains;
|
|
177
|
-
constructor(data: PublicationData<TProvider>, client: Client, notebookId?: string);
|
|
178
|
-
refresh(): Promise<PublicationInstance<TProvider>>;
|
|
179
|
-
publish(): Promise<PublicationRun<TProvider>>;
|
|
180
|
-
destroy(): Promise<void>;
|
|
181
|
-
wait(options?: {
|
|
182
|
-
intervalMs?: number;
|
|
183
|
-
timeoutMs?: number;
|
|
184
|
-
}): Promise<PublicationInstance<TProvider>>;
|
|
185
|
-
events(): Promise<ReadableStream<PublicationEventData>>;
|
|
186
|
-
buildLogs(buildId?: string): Promise<ReadableStream<PublicationLogChunkData>>;
|
|
187
|
-
logs(): Promise<ReadableStream<PublicationLogChunkData>>;
|
|
188
|
-
setProtection(input: UpdatePublicationProtectionInput): Promise<PublicationInstance<TProvider>>;
|
|
189
|
-
protection(): Promise<PublicationProtectionData>;
|
|
190
|
-
createProtectionSession(): Promise<PublicationProtectionSessionData>;
|
|
191
|
-
disableProtection(): Promise<PublicationInstance<TProvider>>;
|
|
192
|
-
}
|