@phpsandbox/sdk 0.1.19 → 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 +16944 -16822
- package/dist/browser/phpsandbox-sdk.esm.min.js +35 -35
- package/dist/browser/phpsandbox-sdk.iife.js +16933 -16810
- 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 +25 -9
- package/dist/index.js +37 -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
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
|
-
}
|