@phpsandbox/sdk 0.1.16 → 0.1.18
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/browser/phpsandbox-sdk.esm.js +27 -0
- package/dist/browser/phpsandbox-sdk.esm.min.js +9 -9
- package/dist/browser/phpsandbox-sdk.iife.js +27 -0
- package/dist/browser/phpsandbox-sdk.iife.min.js +9 -9
- package/dist/index.d.ts +18 -1
- package/dist/index.js +3 -0
- package/dist/publications.d.ts +33 -0
- package/dist/publications.js +22 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type { NotebookBuiltinServiceName, NotebookKnownServiceName, NotebookServ
|
|
|
32
32
|
export type { ConfigPortMapping, ProjectConfig } from './config.js';
|
|
33
33
|
export { PHPSandboxError, RemoteError, TransportError, } from './errors/index.js';
|
|
34
34
|
export type { HttpResponseDiagnostics, RemoteErrorCode, RemoteErrorSource, TransportErrorCode, ValidationErrorDetails, } from './errors/index.js';
|
|
35
|
-
export type { BuiltInPublicationProviderName, CloudflareContainersProviderOptions, LaravelCloudProviderData, LaravelCloudProviderInput, LaravelCloudRegion, PublicationBuildData, PublicationBuildStatus, PublicationData, PublicationEventData, PublicationInstance, PublicationJurisdiction, PublicationLogChunkData, PublicationLogStream, PublicationPlacement, PublicationProtectionData, PublicationProtectionInput, PublicationProtectionMode, PublicationProtectionSessionData, PublicationProvider, PublicationProviderData, PublicationProviderInput, PublicationProviderInputs, PublicationProviderName, PublicationRegion, PublicationReleaseData, PublicationReleaseStatus, PublicationRun, PublicationSize, PublicationStatus, PublishInput, PublishStreamEvent, PublishStreamLog, PublishStreamPhase, PublishStreamResult, PublishStreamSseEvent, SshServerProviderOptions, UpdatePublicationProtectionInput, } from './publications.js';
|
|
35
|
+
export type { BuiltInPublicationProviderName, CloudflareContainersProviderOptions, LaravelCloudProviderData, LaravelCloudProviderInput, LaravelCloudRegion, PublicationBuildData, PublicationBuildStatus, PublicationData, PublicationDomainData, PublicationDomains, PublicationEventData, PublicationInstance, PublicationJurisdiction, PublicationLogChunkData, PublicationLogStream, PublicationPlacement, PublicationProtectionData, PublicationProtectionInput, PublicationProtectionMode, PublicationProtectionSessionData, PublicationProvider, PublicationProviderData, PublicationProviderInput, PublicationProviderInputs, PublicationProviderName, PublicationRegion, PublicationReleaseData, PublicationReleaseStatus, PublicationRun, PublicationSize, PublicationStatus, PublishInput, PublishStreamEvent, PublishStreamLog, PublishStreamPhase, PublishStreamResult, PublishStreamSseEvent, SshServerProviderOptions, UpdatePublicationProtectionInput, } from './publications.js';
|
|
36
36
|
export type { CreateServerInput, ServerData, ServerInstance, ServerListOptions, ServerSshOptions } from './servers.js';
|
|
37
37
|
export type { ConfigureFeedbackInput, FeedbackData, FeedbackListOptions, FeedbackSource, FeedbackStatus, FeedbackType, FeedbackWidgetConfig, FeedbackWidgetTarget, SubmitFeedbackInput, UpdateFeedbackInput, } from './feedback.js';
|
|
38
38
|
export type { Integration, IntegrationAuthorization, IntegrationAuthorizationType, IntegrationData, IntegrationProvider, IntegrationReference, LinkIntegrationInput, UpdateIntegrationInput, AttachSandboxIntegrationInput, SandboxIntegration, SandboxIntegrationData, SandboxIntegrationEffect, SandboxIntegrationReference, UpdateSandboxIntegrationInput, } from './integrations/index.js';
|
|
@@ -277,12 +277,29 @@ export interface PaginatedApiResponse<TData> {
|
|
|
277
277
|
links?: Record<string, unknown>;
|
|
278
278
|
meta?: Record<string, unknown>;
|
|
279
279
|
}
|
|
280
|
+
/** Account-owned notebook metadata; listing does not open runtime connections. */
|
|
281
|
+
export interface NotebookListData {
|
|
282
|
+
id: string;
|
|
283
|
+
title: string | null;
|
|
284
|
+
slug: string | null;
|
|
285
|
+
description: string | null;
|
|
286
|
+
visibility: 'private' | 'public' | 'listed';
|
|
287
|
+
type: string;
|
|
288
|
+
policy: NotebookPolicyData;
|
|
289
|
+
createdAt: string | null;
|
|
290
|
+
updatedAt: string | null;
|
|
291
|
+
}
|
|
292
|
+
export interface NotebookListOptions {
|
|
293
|
+
page?: number;
|
|
294
|
+
perPage?: number;
|
|
295
|
+
}
|
|
280
296
|
export interface NotebookMailListOptions {
|
|
281
297
|
page?: number;
|
|
282
298
|
}
|
|
283
299
|
declare class NotebookApi {
|
|
284
300
|
private readonly client;
|
|
285
301
|
constructor(client: Client);
|
|
302
|
+
list(options?: NotebookListOptions): Promise<PaginatedApiResponse<NotebookListData>>;
|
|
286
303
|
inspectImport(input: InspectNotebookImportInput): Promise<NotebookImportInspectionData>;
|
|
287
304
|
create(template: string, input?: Partial<CreateNotebookInput>): Promise<NotebookInstance>;
|
|
288
305
|
get(id: string): Promise<NotebookInstance>;
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,9 @@ class NotebookApi {
|
|
|
47
47
|
constructor(client) {
|
|
48
48
|
this.client = client;
|
|
49
49
|
}
|
|
50
|
+
async list(options = {}) {
|
|
51
|
+
return this.client.get(`/notebook${formatQueryString({ page: options.page, per_page: options.perPage })}`);
|
|
52
|
+
}
|
|
50
53
|
async inspectImport(input) {
|
|
51
54
|
const response = await this.client.post('/notebook/imports/inspect', input);
|
|
52
55
|
return response.data;
|
package/dist/publications.d.ts
CHANGED
|
@@ -106,6 +106,38 @@ export interface PublicationProtectionSessionData {
|
|
|
106
106
|
expiresAt: string;
|
|
107
107
|
url: string;
|
|
108
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
|
+
}
|
|
109
141
|
export declare class PublicationApi {
|
|
110
142
|
private readonly client;
|
|
111
143
|
constructor(client: Client);
|
|
@@ -138,6 +170,7 @@ export declare class PublicationInstance<TProvider extends PublicationProviderNa
|
|
|
138
170
|
readonly data: PublicationData<TProvider>;
|
|
139
171
|
private readonly client;
|
|
140
172
|
private readonly notebookId?;
|
|
173
|
+
readonly domains: PublicationDomains;
|
|
141
174
|
constructor(data: PublicationData<TProvider>, client: Client, notebookId?: string);
|
|
142
175
|
refresh(): Promise<PublicationInstance<TProvider>>;
|
|
143
176
|
publish(): Promise<PublicationRun<TProvider>>;
|
package/dist/publications.js
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { PublicationEventDataSchema, PublicationLogChunkDataSchema, PublishStreamSseEventNameSchema, PublishStreamSseEventSchema, } from './schemas/publications.js';
|
|
2
|
+
export class PublicationDomains {
|
|
3
|
+
constructor(client, publicationId) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
this.publicationId = publicationId;
|
|
6
|
+
}
|
|
7
|
+
async list() {
|
|
8
|
+
return (await this.client.get(this.path())).data;
|
|
9
|
+
}
|
|
10
|
+
async create(hostname) {
|
|
11
|
+
return (await this.client.post(this.path(), { hostname })).data;
|
|
12
|
+
}
|
|
13
|
+
async refresh(id) {
|
|
14
|
+
return (await this.client.post(`${this.path()}/${encodeURIComponent(id)}/refresh`)).data;
|
|
15
|
+
}
|
|
16
|
+
async delete(id) {
|
|
17
|
+
await this.client.delete(`${this.path()}/${encodeURIComponent(id)}`);
|
|
18
|
+
}
|
|
19
|
+
path() {
|
|
20
|
+
return `/publications/${encodeURIComponent(this.publicationId)}/domains`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
2
23
|
export class PublicationApi {
|
|
3
24
|
constructor(client) {
|
|
4
25
|
this.client = client;
|
|
@@ -124,6 +145,7 @@ export class PublicationInstance {
|
|
|
124
145
|
this.data = data;
|
|
125
146
|
this.client = client;
|
|
126
147
|
this.notebookId = notebookId;
|
|
148
|
+
this.domains = new PublicationDomains(client, data.id);
|
|
127
149
|
}
|
|
128
150
|
async refresh() {
|
|
129
151
|
const response = await this.client.get(`/publications/${this.data.id}`);
|