@phpsandbox/sdk 0.3.1 → 0.3.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/dist/browser/phpsandbox-sdk.esm.js +10 -0
- package/dist/browser/phpsandbox-sdk.esm.min.js +7 -7
- package/dist/browser/phpsandbox-sdk.iife.js +10 -0
- package/dist/browser/phpsandbox-sdk.iife.min.js +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/servers.d.ts +10 -0
- package/dist/servers.js +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export type { ConfigPortMapping, ProjectConfig } from './config.js';
|
|
|
34
34
|
export { PHPSandboxError, RemoteError, TransportError } from './errors/index.js';
|
|
35
35
|
export type { HttpResponseDiagnostics, RemoteErrorCode, RemoteErrorSource, TransportErrorCode, ValidationErrorDetails, } from './errors/index.js';
|
|
36
36
|
export * from './publication/index.js';
|
|
37
|
-
export type { CreateServerInput, ServerData, ServerInstance, ServerListOptions, ServerSshOptions } from './servers.js';
|
|
37
|
+
export type { CreateServerInput, ServerData, ServerInstance, ServerListOptions, ServerMemberData, ServerSshOptions } from './servers.js';
|
|
38
38
|
export type { ConfigureFeedbackInput, FeedbackData, FeedbackListOptions, FeedbackSource, FeedbackStatus, FeedbackType, FeedbackWidgetConfig, FeedbackWidgetTarget, SubmitFeedbackInput, UpdateFeedbackInput, } from './feedback.js';
|
|
39
39
|
export type { Integration, IntegrationAuthorization, IntegrationAuthorizationType, IntegrationData, IntegrationProvider, IntegrationReference, LinkIntegrationInput, UpdateIntegrationInput, AttachSandboxIntegrationInput, SandboxIntegration, SandboxIntegrationData, SandboxIntegrationEffect, SandboxIntegrationReference, UpdateSandboxIntegrationInput, } from './integrations/index.js';
|
|
40
40
|
interface Result<TType extends 'success' | 'error' | 'running', TData extends object> {
|
package/dist/servers.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface ServerData {
|
|
|
5
5
|
host: string;
|
|
6
6
|
provider: string;
|
|
7
7
|
status: string;
|
|
8
|
+
access: 'owner' | 'deployer';
|
|
8
9
|
token?: string;
|
|
9
10
|
sshPublicKey?: string;
|
|
10
11
|
installCommand?: string;
|
|
@@ -12,6 +13,12 @@ export interface ServerData {
|
|
|
12
13
|
createdAt: string | null;
|
|
13
14
|
updatedAt: string | null;
|
|
14
15
|
}
|
|
16
|
+
export interface ServerMemberData {
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
email: string;
|
|
20
|
+
access: 'deployer';
|
|
21
|
+
}
|
|
15
22
|
export interface ServerSshOptions {
|
|
16
23
|
user?: string;
|
|
17
24
|
port?: number;
|
|
@@ -38,6 +45,9 @@ export declare class ServerInstance {
|
|
|
38
45
|
installation(): Promise<{
|
|
39
46
|
installCommand: string;
|
|
40
47
|
}>;
|
|
48
|
+
members(options?: ServerListOptions): Promise<PaginatedApiResponse<ServerMemberData>>;
|
|
49
|
+
share(email: string): Promise<ServerMemberData>;
|
|
50
|
+
revokeAccess(memberId: number): Promise<void>;
|
|
41
51
|
refresh(): Promise<ServerInstance>;
|
|
42
52
|
delete(): Promise<void>;
|
|
43
53
|
waitReady(options?: {
|
package/dist/servers.js
CHANGED
|
@@ -23,6 +23,16 @@ export class ServerInstance {
|
|
|
23
23
|
async installation() {
|
|
24
24
|
return (await this.client.get(`/servers/${encodeURIComponent(this.data.id)}/installation`)).data;
|
|
25
25
|
}
|
|
26
|
+
async members(options = {}) {
|
|
27
|
+
const query = options.page === undefined ? '' : `?${new URLSearchParams({ page: String(options.page) }).toString()}`;
|
|
28
|
+
return this.client.get(`/servers/${encodeURIComponent(this.data.id)}/members${query}`);
|
|
29
|
+
}
|
|
30
|
+
async share(email) {
|
|
31
|
+
return (await this.client.post(`/servers/${encodeURIComponent(this.data.id)}/members`, { email })).data;
|
|
32
|
+
}
|
|
33
|
+
async revokeAccess(memberId) {
|
|
34
|
+
await this.client.delete(`/servers/${encodeURIComponent(this.data.id)}/members/${encodeURIComponent(String(memberId))}`);
|
|
35
|
+
}
|
|
26
36
|
refresh() {
|
|
27
37
|
return this.client.servers.get(this.data.id);
|
|
28
38
|
}
|